Arduino NTP issue for IN-12 Arduino Shield+Adapter+Raspberry Pi Nixie Tubes CLK

Tagged: , , ,

This topic contains 8 replies, has 3 voices, and was last updated by  DonZalmrol 2 years, 2 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #35021

    DonZalmrol
    Participant

    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 2 years, 3 months ago by  DonZalmrol.
    #35023

    DonZalmrol
    Participant

    Screenshot: 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 2 years, 3 months ago by  DonZalmrol.
    #35026

    mcpgza
    Participant

    Hello,

    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.

    #35027

    DonZalmrol
    Participant

    Hi, do you have a link to your firmware and more information about this? ๐Ÿ™‚

    #35028

    mcpgza
    Participant

    Not yet, but I will publish at the weekend.
    More info about esphome: https://esphome.io/

    #35029

    DonZalmrol
    Participant

    Ah fantastic looking forward for other solutions/ insights.
    Do you experience any other issues regarding your NTP solution?

    #35129

    DonZalmrol
    Participant

    I 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!

    #35602

    Zwartoog
    Participant

    @DonZalmrol: did you check the NTP code in this package?
    http://sebastiaanbreedveld.nl/other/nixie/NixieClockWeatherStation.zip

    I also made some updates to the NTP code there.

    #35935

    DonZalmrol
    Participant

    Hi 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!

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.