Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect date/year with ESP8266 board 3.0.0 #149

Open
bartgrefte opened this issue Jun 13, 2021 · 12 comments
Open

Incorrect date/year with ESP8266 board 3.0.0 #149

bartgrefte opened this issue Jun 13, 2021 · 12 comments
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@bartgrefte
Copy link

bartgrefte commented Jun 13, 2021

Recently I ran into the problem that the NTP-sketch from https://randomnerdtutorials.com/esp8266-nodemcu-date-time-ntp-client-server-arduino/ suddenly displays incorrect dates and year, time is correct. Example output before and after timesync:

08:29:15
Epoch Time: 2085985755
Month day: 6
Week Day: Thursday
Month: 8
Month name: August
Year: -3135390
Current date: -3135390-8-6

19:19:31
Epoch Time: 1622834371
Month day: 2
Week Day: Friday
Month: 12
Month name: December
Year: -3135405
Current date: -3135405-12-2

I thought I'd tracked down the cause of the problem, this issue appeared after having updated the ESP8266 boards platform to 3.0.0, downgrading it and reflashing the sketch solves the problem.

Yesterday I reported it at esp8266/Arduino#8118, but according to who responded, this problem is in the NTP library, it might have something to do with 32 and 64 bit time_t.

@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Jun 13, 2021
@chalkmaroon
Copy link

Exactly the same bug here, with the exception that no downgrade helped in my code. I've tried 3.2.0, 3.1.0 and 3.0.0.
The version 2.0.0 seemd to be too old, since this doesn't even compile my code, which worked fine, the last months.

@bartgrefte
Copy link
Author

bartgrefte commented Jun 25, 2021

3.2.0? I wasn't referring to the version of the NTP library, but the ESP8266 board library. The most recent version for that is 3.0.0, To fix this problem that library (not the NTP library) has to be downgraded to 2.7.*

@chalkmaroon
Copy link

Oh, I'm sorry, I didn't read your post carefully enough and yes you're right, I downgraded the board library and the error disappeared.

@sercona
Copy link

sercona commented Jul 2, 2021

this is scary, I did a grep -r for time_t in my $HOME/.arduino15 area and it was a random mix of 32 unsigned, 32 signed, and 64 unsigned (good!) types.

some from lwip, some from esp, some from other areas.

my god, this should really be cleaned up, somehow ;)

in this day and age, I'm not sure why we're not all using 64bit time_t types. anyone have a good reason why we're still stuck in 32 bit land for time types? didn't we already fix things back in y2k days? (half serious).

@andreaguiar
Copy link

same problem here :(

I noticed that when I reboot the ESP8266 the date is correct at first, it's only when I update it that it goes wrong...

is someone working on this issue, or did you guys found a temporary fix (excluding the downgrade)?

@yoonhong98
Copy link

yoonhong98 commented Nov 5, 2021

Hello, I am having the same problem. I did downgrade the ESP8266 to 2.3.0 but it still showing me different date after a while.

Today is : friday
Current Time : 16:40:22
Current Time : 1636130422

Today is : friday
Current Time : 16:40:43
Current Time : 1636130443

Today is : thursday
Current Time : 14:28:16
Current Time : 2086007296

Today is : thursday
Current Time : 14:28:37
Current Time : 2086007317

Today is : thursday
Current Time : 14:28:58
Current Time : 2086007338

Today is : friday
Current Time : 16:42:08
Current Time : 1636130528

@bsvdoom
Copy link

bsvdoom commented Nov 5, 2021

Use 2.7.4.

@yoonhong98
Copy link

yoonhong98 commented Nov 7, 2021

Use 2.7.4.

Changed to 2.7.4 but the time still changes and addition with error exception(9)

Exception (9):
epc1=0x4020c270 epc2=0x00000000 epc3=0x00000000 excvaddr=0x5a51327b depc=0x00000000

>>>stack>>>

ctx: cont
sp: 3ffffc40 end: 3fffffc0 offset: 0190
3ffffdd0:  00000000 00000001 3ffffe94 3ffeeb48  
3ffffde0:  0000000b 3ffeeb10 3ffefc60 40206628  
3ffffdf0:  3ffe88ef 000001bb 3ffefc60 40207550  
3ffffe00:  3ffe89a3 0000003b 3ffefc60 40207980  
3ffffe10:  0000003b 3ffffed0 0000002e 402043a0  
3ffffe20:  3ffffe68 0000003b 3ffffe50 40208404  
3ffffe30:  3ffeeb0c 3ffffe50 3ffe89a3 3ffffed0  
3ffffe40:  3ffeeb0c 3ffffe94 3ffefc5c 40205c5b  
3ffffe50:  3fff02c4 003b003f 00fffe94 3ffefd5c  
3ffffe60:  0042004f 00000000 3fff01b4 004b004f  
3ffffe70:  00fffee0 00000002 3ffefbd2 3ffffed0  
3ffffe80:  3ffeeb0c 3ffe8920 3ffefd1c 402039dc  
3ffffe90:  402079fc 3fff0168 3ffffed6 3ffe8540  
3ffffea0:  3fffff40 3ffffed0 3ffe8764 40204364  
3ffffeb0:  3ffffed8 4bc6a7f0 f3b645a1 3ffe8540  
3ffffec0:  3fffff40 3ffefd1c 3ffeeb08 40204c55  
3ffffed0:  3ffeeb48 3fff00f0 732f0029 4020a1ad  
3ffffee0:  00000018 3ffeeb08 3fffff64 40204c96  
3ffffef0:  00000001 3ffefbc4 3fffff40 40208404  
3fffff00:  3fffff70 3fffff70 3fffff40 3ffe8540  
3fffff10:  00000018 3ffeea5c 3fffff40 402089ce  
3fffff20:  3ffe888e 3ffeea5c 3ffeeb68 40207dec  
3fffff30:  00000018 3ffeea5c 3ffeeb68 40201366  
3fffff40:  3ffefbc4 000e000f 06fe8a00 333a3000  
3fffff50:  3ffe0037 80000028 3f003000 40208221  
3fffff60:  807a1200 9e8c1342 3ffeeb00 80208240  
3fffff70:  646e7573 00007961 86feeb68 333a3031  
3fffff80:  00000037 85000000 00000001 40100154  
3fffff90:  3fffdad0 00000000 3ffeeba4 3ffeebe4  
3fffffa0:  3fffdad0 00000000 3ffeeba4 40209284  
3fffffb0:  feefeffe feefeffe 3ffe85fc 40100c75  
<<<stack<<<

@bsvdoom
Copy link

bsvdoom commented Nov 7, 2021 via email

@bsvdoom
Copy link

bsvdoom commented Nov 7, 2021 via email

@ind03
Copy link

ind03 commented Aug 11, 2023

Time is ok, but date is wrong for me too.

@bsvdoom

This comment was marked as off-topic.

@arduino-libraries arduino-libraries locked as too heated and limited conversation to collaborators Aug 25, 2023
@per1234 per1234 added the topic: code Related to content of the project itself label Jun 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

8 participants