OpenGarage Forums OpenGarage Firmware Time in Log file invalid when using Static IP

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1429

    andrewsci
    Participant

    It seems that when I set the OG with a static ip address, the time in the log becomes invalid. I think I first noticed this in 1.0.9 and it’s still there in 1.1.0

    It works fine using DHCP.

    Just an FYI.

    Thanks, a

    #1431

    Ray
    Keymaster

    OK, I will check. I don’t think it should have anything to do with static ip vs. DHCP — the only reason for time being invalid would be NTP time sync fails.

    By the way, even with DHCP, you can still set a fixed IP, by going to your router’s configuration page, and set a DHCP reservation for the device (basically binding a fixed IP to its MAC address). This is effectively static IP, but managed using the router.

    #1434

    andrewsci
    Participant

    Thanks, Ray. That is, in fact, how I created the new static ip. I only noticed it because in trying to reset the device, the default is DHCP and suddenly the time was right in the log. I then set a static ip address and the time stamps were all wrong. Initially I did not use DHCP because I use a different sub-net to isolate all my IOT devices, JIFC. I’d like to go back to that policy, so please let me know if you find the problem. Again, thanks.

    #1522

    apop
    Participant

    I noticed the same thing after setting a static IP. Not a big deal for me since I’m using Home Assistant and that’s my source of truth for logging, but I still decided to manage my IP reservation through the router to remedy this.

    #1568

    binnyuk
    Participant

    I found the same issue.

    On top of this, it also seems if the date/time is wrong, blynk doesn’t see the board online. As soon as you use DHCP and date/time is correct, blynk says the board is online.

    #1640

    insight3fl
    Participant

    I am having the same problem. I am running old firmware, but since I added static IP the date and time is wrong… it says January 1 1970!

    #1697

    kentaylor
    Participant

    Could this be a DNS issue? – DHCP will supply the DNS, but there is nowhere on the static IP page to insert one

    I worked around this by doing a DHCP static mapping and it came good

    • This reply was modified 4 years, 10 months ago by kentaylor.
    #1709

    Ray
    Keymaster

    Yes, this is most likely a DNS issue — the current firmware 1.1.0 does not accommodate custom DNS. I’m already working on firmware 1.1.1 which will allow custom DNS and should fix this issue. In the meantime, as suggested earlier in the thread, you can use your router’s DHCP reservation feature to bind a fixed IP address to the controller — there is no need to set static IP on OpenGarage, instead, leave it in DHCP but use your router to set a fixed IP to it.

    #1716

    AndyC
    Participant

    I noticed the same thing and modified the firmware to allow specifying the DNS value for a static configuration.
    I’ve attached an updated firmware which is working well for me if anyone wants to try. Ray, I’ve attached the source if interested.

    • This reply was modified 4 years, 10 months ago by AndyC.
    • This reply was modified 4 years, 10 months ago by AndyC.
    Attachments:
    You must be logged in to view attached files.
    #1727

    Ray
    Keymaster

    Thanks, yes I did pretty much make the same changes and that indeed fixed the issue. I haven’t got around time to push the code out yet but should be able to do so this weekend. Thanks.

    #1736

    Ray
    Keymaster

    A new firmware (1.1.1) has been committed to github (it’s in dev-1.1.1 branch, not yet merged with master). You can download and try the compiled firmware 1.1.1:
    https://github.com/OpenGarage/OpenGarage-Firmware/tree/dev-1.1.1/Compiled

    It added DNS parameter which should fix the NTP time sync issue when using static IP. It also includes another option to disable alarm when opening door (thus alarm is only effective when closing the door, per request from another thread).

    #1746

    jagos
    Participant

    How about also adding a field for NTP IP address that is settable independent of static or DHCP? My router acts as an NTP server and I might point the OG to that. May be too late for 1.1.1 but maybe in future?

    ETA: Are the new fields also added to the http API for reading and setting?

    • This reply was modified 4 years, 9 months ago by jagos.
    #1755

    Ray
    Keymaster

    Sure, adding another field for NTP is pretty straightforward.

    I haven’t had time to update the API document. The added option name is ‘dns1’:
    https://github.com/OpenGarage/OpenGarage-Firmware/blob/dev-1.1.1/OpenGarage/defines.h#L148
    the reason it’s called dns1 is that the ESP8266 library can accept 3 DNS servers, so in the firmware we left dns1 as user-configurable, and the other two default DNS server IPs. The format of this parameter is the same as other similar parameters (i.e. dvip and gwip).

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.

OpenGarage Forums OpenGarage Firmware Time in Log file invalid when using Static IP