|
Post by njordan on Jan 27, 2017 23:45:34 GMT -7
So we were writing our launch/recovery procedures and we ran into this issue; if the batteries die, is there a safety built in to shut down pi or is there a risk of corruption of video/photo/whole card? I would assume the pi would shutdown on low voltage, but better safe than sorry. The concern is since we have one GS do we wait until the signal cuts out to pack up and take the GS to shut them down or do we send out a team after launch and just bring it back. For practice flights we would prefer to not transport the GS.
|
|
|
Post by leviw on Jan 28, 2017 9:07:30 GMT -7
The payload will not gracefully shutdown on low voltage. Doing so would require measuring the voltage and triggering a shutdown script. It's possible and could be done, but isn't implemented right now. It wouldn't be incredibly difficult but would require adding some hardware to the payload to measure the voltage, and connecting to the gpio pins on the pi to trigger a shutdown script.
However, there is a much easier and free solution: The script you run to begin streaming video includes a duration (-t <time in milliseconds>). When that duration ends, raspivid stops running, the stream dies, and the pi can be safely unplugged. If you want to be especially careful you could add a shutdown command after the line beginning with raspivid. That won't stop the pi from consuming power, but it will ensure it won't be writing to the sd card. If anyone is interested I can elaborate more on how to do this.
|
|
|
Post by njordan on Jan 28, 2017 12:27:53 GMT -7
Please do tell. We definitely want to implement this.
|
|
|
Post by njordan on Jan 28, 2017 12:48:15 GMT -7
Also, Is there a way to implement something like this on the RFD Pi?
|
|
|
Post by Wesley on Jan 31, 2017 21:45:02 GMT -7
We actually plan on using SparkFuns Lipo Fuel Gauge. www.sparkfun.com/products/10617We've had really great success using this in the past on the Pi and Arduinos. You can communicate with it over I2C or just use its "Alert" pin to trigger a shutdown script. Over I2C it reports the state of charge in percent, the amount of current being drawn, and the pack voltage with acceptable accuracy while boasting high simplicity. This would be really simple to integrate and is much more reliable then reading voltage and having to add a resistor while measuring the voltage drop for calculating current. The algorithm for that is really complicated. I've also used just the MAX17043 IC in previous projects with success. Impressive little package.
|
|
|
Post by David MSGC on Feb 1, 2017 14:13:03 GMT -7
You would need to accommodate the real time clock which is also on I2C. Right now the RTC header is blocking any other I2C connections. Or some folks have asked about the product found at this link: blog.petrockblock.com/2015/07/04/powerblock-another-power-switch-for-the-raspberry-pi/I have not used or looked into the petrockblock powerblock but it looks like a microcontroller monitors the battery and or switch and it signals the pi over I2C and the pi has a module installed which watches for a command/signal from the microcontroller then the pi runs a shutdown command if it sees said signal. It could be incorporated with the sparkfun Lipo Gauge or use some of the software examples from petrockblock.
|
|
|
Post by Wesley on Feb 1, 2017 19:55:22 GMT -7
Neat! I like that idea as well. Implementing both ideas would allow for live battery monitoring, low battery graceful shutdown, and switch operated graceful shutdown.
|
|