The first version of the software is now complete and has been tested.
The software has 3 main functions...
- Fetch the current time, sunset time, and solar noon time from the internet.
- Calculate how long until the next sunset and next solar midnight.
- Turn on the lamp at sunset and turn it off at solar midnight.
The most important aspect of the software is that it should continue to work even if internet connectivity is lost. Every 10 minutes, the times are refreshed from the internet. Even if this fails, the internal clock will continue to run, and the cycle will be repeated every 24 hours until the refresh from the internet is successful.
After a power failure, the program will wait for 30 seconds (init.lua) to allow internet conntivity to be restored. The the main program (suntracker.lua) is launched. The lamp defaults to ON, and will remain ON until a valid shedule has been downloaded from the internet.
Next step is to tackle the hardware...
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.