Closed dkerr64 closed 3 weeks ago
@dkerr64 Ok, so I changed the DNS lookup to a gateway ping check. The old way was fine, but I wanted to eliminate the need to do an internet lookup. With the DNS method, mine would lookup google.com because my DNS server is on a different subnet. Also fixed a bug that was introduced when you refactored the settings.
@dkerr64 Ok, so I changed the DNS lookup to a gateway ping check. The old way was fine, but I wanted to eliminate the need to do an internet lookup. With the DNS method, mine would lookup google.com because my DNS server is on a different subnet. Also fixed a bug that was introduced when you refactored the settings.
Thanks for finding the wifi settings change bug. Yes that was a mistake on my part.
Do you think we should log every minute that we pinged the gateway ok? Feels excessive. Maybe only log if it fails and/or latency is excessive?
my latency logs at 3-4ms. Excessive might be >50ms ?
yeah, I was wondering if that was going to be too noisy. ill rework it
Now that I have timezone implemented, I'm thinking maybe should use ratgdo time (if available) for syslog.
Also... for timezones, I have provided selection for usual USA timezones. But I could load the full list from the CSV file here... https://github.com/nayarsystems/posix_tz_db ... it is all client-size in the browser javascript, so no impact on memory/performance at the ratgdo.
I think you can auto discover you timezone based on your public IP address using https://ip-api.com
@dkerr64 I pushed a function that will lookup the timezone offset from that url I sent earlier. You can use it if you want. If you dont want to use it, we can drop the commit
@jgstroud Thanks for the timezone lookup. We also need to convert from e.g. Americas/New_York into the posix encoding, in this example "EST5EDT,M3.2.0,M11.1.0". I'm doing this now on the browser side with a hardcoded list, but the full list is available online (link above).
Yeah I saw that. I just used UTC
Otherwise we can just use your browser selector.
Maybe give my commit a try for auto setting the timezone. If you don't like it we can remove the commit. My testing, it worked fine. But, to handle daylight savings time, we would probably need to check the offset daily just after midnight.
Maybe give my commit a try for auto setting the timezone. If you don't like it we can remove the commit. My testing, it worked fine. But, to handle daylight savings time, we would probably need to check the offset daily just after midnight.
Your lookup is useful. I think we can solve for the 2nd part... worst case in in the browser javascript side if not on the ratgdo itself. I'll look into it this evening.
Also, on the gateway pings, I see you do a millis() % 60000 == 0
test. I don't think this is reliable, it requires that the loop is executed exactly on a multiple of 60 seconds. If it executes just one millisecond later then the test fails. I think we need to set a static timeout = mills() + 60000
and then test for millis() > timeout
Thanks.
Yeah, you are right. There is no way that would be reliable. I've been writing Verilog recently where this wouldn't be an issue. My context switching in my head just isn't what it used to be. I'll make the change. Thanks for catching that.
@dkerr64 I fixed the mistake with the timers. also, for the Timezone, I was just setting it to UTC
Here is what I am working on for time zone...
On the browser side... we will asynchronously load the timezone CSV from https://github.com/nayarsystems/posix_tz_db and use that to do the lookup. We will also use it to populate a selection field in settings page. If loading from that URL fails, then use built-in list of half-dozen USA timezones.
That all sounds good. The only suggestion might be in step 1, instead of having a blank selection, have a default selection of "Auto".
Have implemented time zone. If you switch SSID then timezone is reset and discovered from external IP address. I'm not sure if this is good idea or not, but it provides us a way to test it.
I'm inclined to finish this up with update to readme for timezone, and then publish this.
Then maybe we look harder at dry contact support as several people are requesting it... before we get tied up with ESP32.
I agree. Let's not add any more to this merge. Yeah, there have been quite a few dry contact requests recently. My plan was to just lift the dry contact code verbatim from https://github.com/ratgdo/mqtt-ratgdo/blob/2.5/src/ratgdo.cpp
The biggest reason I haven't touched it yet is because I have no way to test it.
I agree. Let's not add any more to this merge. Yeah, there have been quite a few dry contact requests recently. My plan was to just lift the dry contact code verbatim from https://github.com/ratgdo/mqtt-ratgdo/blob/2.5/src/ratgdo.cpp
The biggest reason I haven't touched it yet is because I have no way to test it.
One of my doors has a 20-year old opener. I have not connected a ratgdo to it, but it may well require dry contact.
v1.8.1 (2024-11-xx)
What's Changed
Known Issues