Arduino NTP issue for IN-12 Arduino Shield+Adapter+Raspberry Pi Nixie Tubes CLK
Nixie Tubes Clocks | Shields for Arduino Clocks | Raspberry Pi HAT Nixie Clocks | DIY KITs for Nixie Clocks | Cases for Nixie Clocks | Nixie Tubes | RF Units | Assembled Boards | Bare PCBs | Components | Spare Parts | Circuits | Firmwares… › Forums › General Information › Arduino NTP issue for IN-12 Arduino Shield+Adapter+Raspberry Pi Nixie Tubes CLK
This topic contains 8 replies, has 3 voices, and was last updated by DonZalmrol 4 years ago.
-
AuthorPosts
-
16.10.2020 at 09:57 #35021
Hi all,
So yesterday I’ve received my kit and with the default config all is working well. Since I have some Arduino’s and Raspi’s that are not in use I’ve picked the kit that also has the pi shield for the clock kit. This way I can mix around with what would support my needs.
At the moment I’ve hooked the clock PCB to my Arduino Mega 2560 + ESP8266 and it works out-of-the-box with the INO file(s) and libraries from Gra-Afch.
So then I started tweaking and adding an NTP client that uses the ESP8266 wifi capabilities. This works, but something is wrong with my code. After a few minutes (sometimes from the start, sometimes after a minute or sometimes after a little bit longer +- 3minutes) the UDP packets are returned empty. And I have no idea/ clue what could be causing this.
The source I’ve used is this one and then I started adding DST to it, with or without my DST code its the same.
I’m new to Arduino, so its high likely a beginner error.
Code is on my Github, I’ve tried saving/ preserving as much of the original code as possible, there is even the option to enable/ disable the NTP and use the GPS again.Would highly appreciate it if someone could help me out 🙂
- This topic was modified 4 years, 2 months ago by DonZalmrol.
16.10.2020 at 11:14 #35023Screenshot: https://drive.google.com/file/d/1RFTbuxxkNdk7MhseVxAiCaDOahn-5l38/view
As you can see the UDP package size drops from 48 (What it should be for NTP) to 0 and then after a while the WifiESP gets a timeout followed by a Data packet send error.
What happens then is that the clock sets its NTP to 1970 (default UNIX time) or messes up the DST (jumping +1 or +2) or even displaying a completely different date from who knows where…
If it’s a known issue with the NTP udp packages on Arduino, could I fetch this and create an exception e.g try-catch-finally?
- This reply was modified 4 years, 2 months ago by DonZalmrol.
16.10.2020 at 13:01 #35026Hello,
I created my esp firmware using esphome, it has integrated NTP client which works like charm, handles local time for example, and has a lot of useful features such as monitoring, logging, mini webserver, and firmware update over the air. I wrote a simple custom component which communicates with the Arduino, and provides the ntp clock for the nixie clock through the integrated serial.
16.10.2020 at 13:06 #35027Hi, do you have a link to your firmware and more information about this? 🙂
16.10.2020 at 13:32 #35028Not yet, but I will publish at the weekend.
More info about esphome: https://esphome.io/16.10.2020 at 14:50 #35029Ah fantastic looking forward for other solutions/ insights.
Do you experience any other issues regarding your NTP solution?22.10.2020 at 11:05 #35129I was able to create my own NTP sync with the help from this source: https://medium.com/@joeldavidw/nixie-clock-ntp-sync-remote-switch-4b6ad7b686d
I then improved the code and added some failsafes e.g. when no internet connection is there or the UDP package size is not 48, … it retries to fetch the NTP and if that fails after 3 consecutive tries it goes over to GPS
My code can be viewed/ downloaded from my GitHub page: https://github.com/DonZalmrol/GRA-AFCH-IN-12-Arduino-Nixie-clock-kit-with-NTP
Cheers!
26.10.2020 at 11:02 #35602@DonZalmrol: did you check the NTP code in this package?
http://sebastiaanbreedveld.nl/other/nixie/NixieClockWeatherStation.zipI also made some updates to the NTP code there.
30.11.2020 at 15:28 #35935Hi Zwartoog,
Yes, I’ve looked at your code and we have certainly some similarities in our code.
Mine seems to be working stable at the moment.I will probably use some of your code for a CPM sensor display 😉
Thx!
-
AuthorPosts
You must be logged in to reply to this topic.