DynamicDevices / ming-original

Balena.io/Docker-compose repo for a containerised #MING (Mosquitto, InfluxDB, NodeRed, Grafana) stack
33 stars 20 forks source link

When running in AP mode the time is incorrect #4

Closed ajlennon closed 4 years ago

ajlennon commented 5 years ago

Currently we have support for an I2C battery backed RTC device to deal with this issue.

Code looks like it still needs to be committed

ajlennon commented 5 years ago

Quoting gtp "Alex has ordered this: https://www.amazon.co.uk/DS3231-RTC-MODULE-RASPBERRY-PI/dp/B01I1I8HY8 Though there still needs to be a provision to set the time initially."

MatthewCroughan commented 5 years ago

@ajlennon What needs to be done in order to apply this?

ajlennon commented 5 years ago

We either have to add an I2C RTC device onto every board or to find a way to use an NTP client to grab the time from the Internet on startup.

MatthewCroughan commented 5 years ago

@goatchurchprime Julian has suggested a few methods of getting time. One method he suggested included having time emitted as mqtt messages from some device that has an RTC. You could then add nodes as ENV variables in balena by using either their expected IP or hostname.

ajlennon commented 4 years ago

Yeah not a bad idea but it adds a dependency on another device which I'd rather not have. If we had to have a dependency I'd rather have one on an internal I2C RTC

MatthewCroughan commented 4 years ago

@ajlennon Why not both? More sources of time the better, like /dev/random gets its randomness from every place it can, this is like /dev/time.

ajlennon commented 4 years ago

Mmm. Not really. Time is a problem. Which time source is preferable?

A local I2C RTC time source is probably accurate to a minute a month so needs to be regularly updated with a more accurate time source which would be GPS or network time...

ajlennon commented 4 years ago

Currently not intending to run in AP mode so closing this