sergeskor / ssvlongtime Goto Github PK
View Code? Open in Web Editor NEWSingleton class to return UpTime in seconds. Does not overfloat as fast as millis().
Singleton class to return UpTime in seconds. Does not overfloat as fast as millis().
We are using this library on 50+ devices (ESP32 and STM32)
Just occasionally we see a jump in uptime, e.g, I just observed one ESP32 device going from 2907s (~48mins) to 4297876s (~7weeks)
Looking at the code I see a similar number const uint32_t multiplier = 4294967;
and if I add that to my original value of 2907 I get 4297874 which is very close to the inflated uptime I'm seeing!
I'm guessing the multiplier is being applied when it should not be!?
We do not see this behaviour often, maybe seen 20 times over the 50 devices over the last year or so.
This device in question gets reset several times a day, avg uptime is between 1 and 15 hours, this has not happened on this device in its 90days of operation.
Some device run almost constantly while others are reset quite frequently.
Looking back through our last 90 days data, I see another ESP32 jumping form 20 weeks to 27 weeks. Some seem to jump just at random times, others not jumping at all, and I see one device has done this 4 times always around the 2 day mark.
Each of our boards contain one ESP32 and one STM32. This issue seems isolated to the ESP32s. I can not find this happening on any STM32s.
Very strange. Any ideas?
I am maybe thinking power supply / noise issues? All these devices are situated around combustion engines powered from the alternator/battery. Although we do have good regulators.
Or maybe a threading issue. The ESP32 is dual core and we are using threads. Could a thread sync/timing issue be causing newMillis < lastMillis just by 1 and triggering overflow when it shouldn't be?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.