We have released our new Power Dock 2! This dock contains the on-board ADC in order to measure the voltage level of an attached LiPo battery. And we have made a project that will output the current date and time as well as the battery level (Voltage and Percentage) on the OLED screen.
You need the following list of items:
- Power Dock 2
- OLED Expansion
- Omega2/2+
- 3.7 LiPo Battery
Initialize your Omega2 and combine all items together and you will need to run the following commands:
opkg update
opkg install python-light pyOledExp power-dock2
In order to see the correct time and date that are corresponded to your current location, we need to change the Timezone settings on the Omega. Go to the OpenWRT System Configuration page, navigate to the Time Zones
and copy the TZ string of the desired timezone. Issue uci show system
command and you will see your current timezone under the line that looks like this:
system.@system[0].timezone='GMTO0'
Now, we need to change the timezone to be corresponded to your location. Issue:
uci set system.@system[0].timezone='<TZ String that was copied previously>'
uci commit
echo "<TZ String>" > /tmp/TZ
Now copy the python program oled-display-battery
to your root directory. This project was meant to start on boot and update the information every minute. To do so, we need to initialize the cron
settings. From your command line, issue crontab -e
and populate it with the following text:
#
*/1 * * * * python /root/oled-display-battery.py
#
Save the file and restart the cron daemon
with the following command
etc/init.d/cron restart
And you are all set! You will see updated info on your OLED screen every minute and the program itself will start on the boot.
Comments