Strange behavior of time on ESP8266

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: Strange behavior of time on ESP8266

Post by kevinkk525 » Mon Nov 05, 2018 11:16 am

just put the class into your main file.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

lazarvgd
Posts: 39
Joined: Sun May 20, 2018 8:57 am

Re: Strange behavior of time on ESP8266

Post by lazarvgd » Tue Nov 06, 2018 4:54 am

kevinkk525 wrote:
Mon Nov 05, 2018 11:16 am
just put the class into your main file.
I have added the class, now the whole system is more robust, works almost as expected.
I have had few rebooting of the board, I think between 5-15, but at least it is precise and turns on the heater.
Now, I am waiting 0800h to check whether will heater be turned off.

Thanks for help guys, I guess that I will leave this thread unsolved for some time, but 90% of problems are solved. Winter will not be that cold :)

thanks :)

EDIT:

Since I have added log to be written to file on the board, could that cause the problem regarding the size?
Should I remove file if size is grater than 1MB or so?

Thanks

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Strange behavior of time on ESP8266

Post by pythoncoder » Tue Nov 06, 2018 7:03 am

One approach is to have multiple log files. For example you might start a new one each hour, deleting any older than (say) four hours. The rate at which you create them and how many you keep would depend on how quickly they grow; I'd advised never letting filesystems get more than about 80% full, maybe less on the ESP8266. Naming the files with sequential names aids management.
Peter Hinch
Index to my micropython libraries.

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: Strange behavior of time on ESP8266

Post by kevinkk525 » Tue Nov 06, 2018 9:57 am

You get 5-15 reboots per day? That is way too much... Might be worth investigating if the ntptime synchronization is blocking that long or even freezing. I get at most 4 reboots per day and even that is quite rare.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

lazarvgd
Posts: 39
Joined: Sun May 20, 2018 8:57 am

Re: Strange behavior of time on ESP8266

Post by lazarvgd » Tue Nov 06, 2018 1:12 pm

kevinkk525 wrote:
Tue Nov 06, 2018 9:57 am
You get 5-15 reboots per day? That is way too much... Might be worth investigating if the ntptime synchronization is blocking that long or even freezing. I get at most 4 reboots per day and even that is quite rare.
You were right, ntp is the problem. I have found that error occurs from time to time. Will try to find another library or at least to make my ntp server more "available".
Let me reach the pc, and I will post the error message that I got regarding the ntp.

Thanks :)

EDIT:

Here are the logs from esp:

Code: Select all

ERROR:<module 'utime'> [Errno 110] ETIMEDOUTERROR:<module 'utime'> [Errno 110] ETIMEDOUTERROR:<module 'utime'> [Errno 110] ETIMEDOUTERROR:<module 'utime'> [Errno 110] ETIMEDOUTERROR:<module 'utime'> [Errno 110] ETIMEDOUTERROR:<module 'utime'> [Errno 110] ETIMEDOUTERROR:<module 'utime'> [Errno 110] ETIMEDOUTERROR:<module 'utime'> [Errno 110] ETIMEDOUTERROR:<module 'utime'> [Errno 110] ETIMEDOUT

Post Reply