-
More Wifis
04/24/2018 at 23:31 • 0 commentsTo make guerillaClock more mobile and versatile, additional wireless networks can be added beyond that which is configured within sudo raspi-config.
Add Additional Wireless Networks
- Type sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
- Look within the wpa_supplicant.conf file for a "network" section that looks like this:
network={ ssid="SSID_added_during_raspi-config" psk="password_for_SSID" }
Add additional "network" sections for each wireless network to which guerillaClock will connect
network={ ssid="SSID_added_during_raspi-config" psk="password_for_SSID" } network={ ssid="freewifi" psk="topsecretpass" } network={ ssid="myHotSpot" psk="passwordDefintedByHotSpot" }
-
Low Battery Detection
04/07/2018 at 20:51 • 1 commentAfter a few unexpected shutdowns, due to low battery power, that resulted in SD card corruption (specifically Git cache corruption) I decided to take advantage of the LBO pin on the PowerBoost 1000c.
The LBO pin will go to 0V when the battery voltage drops below 3.2V. We can utilize a GPIO pin on the Raspberry Pi Zero W to monitor the LBO pin state and then initiate a system shutdown when the LBO pin goes low.
I selected GPIO pin 21 simply because it was at the end of the bonnet and out of the way.
Adding a male pin to the PowerBoost 1000c and a female jumper cable to the bonnet allows for easy disassembly if components need to be replaced.
To configure pin 21, we need but a few lines of code at the beginning of the guerillaClock.py script
#LBO shutdown PIN PIN = 21 GPIO.setmode(GPIO.BCM) GPIO.setup(PIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)
And finally, at the end of the main loop we check the current state of the LBO pin and shutdown the system if necessary.
#Check for low power if not GPIO.input(PIN): logger.debug("Low Battery Power Detected. Shutting down...") GCD.off() os.system("sudo shutdown -h now")
-
Power Consumption
04/06/2018 at 01:15 • 0 commentsInitially, guerillaClock was to incorporate a solar panel for it's primary power source. As such it would need a backup battery, for cloudy days, so the case was designed around a 6600 mAh LiPo battery that was on hand.
To determine the power draw, a USB Charge Doctor was put in line and it showed voltage and amperage usage.
Calculating off the peak amperage, which interestingly is when the display is static, we can determine the approximate uptime.
Using some simplistic napkin-math, the LiPo's 6600mAh capacity / peak 360mA draw, we can anticipate the guerillaClock staying online for over 18 hours.
When not displaying a message the guerillaClock draws far less power. So, uptime could be improved by increasing the interval between arrival time calculations and display or by adding a physical button for on-demand only inquiries which could be considerably less frequent.