Open Laserlicht opened 2 years ago
I guess you're trying to write too fast to serial port. But it is just a guess. Try to use exception decoder in Platformio to find the point where code crashed.
Hi, I faced the same problem and discovered that this is not related to serial port write speed.
The error is caused by the use of delay(100) statement in the main loop. I guess it is somehow interfering with ticker events scheduled by the library that are calling some asynchronous functions of TCP/UDP stack that don't tolerate the use of delay.
This error can be easily reproduced by changing delay(0) to delay(100) into the main loop of advancedExample.
I suggest it is worth mentionig this problem in the library documentation. As an improvement you could provide an alternative way to run the periodic tasks providing an update() method to be called explicitely inside the main loop without relying on ticker library.
I guess I will change Ticker by etsTimer so it does not depend on external Library.
Anyway you can call stop() to stop internal processes. Time will not be updated anymore but internal clock will keep on running.
There is not a single call to sync time. This is because the whole synchronization is a multiple step process that happens asynchronously.
If you don't need high precision this library provides I recommend using ESP8266 SDK internal SNTP functions.
I get with the following code unfortunately after a few seconds always a reset at the NodeMCU. But the synchronization works, as you can see on the output. What is the problem?
Code:
Platformio.ini:
Output: