-
Notifications
You must be signed in to change notification settings - Fork 20
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
In preparation for 1.8.1 release... #244
Conversation
…l allow for time zone setting
…ed than published version
Don't use DNS lookup as a network test as that might require internet access. Use a simple ping check. LwIP has ping support, but not exposed in an easy to use manner. Pull in ESP8266Ping library to make ping easy. Log once a minute the gateway ping stats Fix bug in web.cpp that wasn't saving the wifi change setting anymore
@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 |
8dceabd
to
2488343
Compare
@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. That sets the time correctly, but doesn't display a friendly timezone when you print the time. I think this works if you just remove the time zone when you print the time. 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. |
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 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. |
autoset the time based on local timezone
2488343
to
945f3e4
Compare
@dkerr64 I fixed the mistake with the timers. also, for the Timezone, I was just setting it to UTC, so I removed the timezone code from the timeString. But I don't want to overstep. If you want to change it, go right ahead. I just got the itch to make the auto-timezone thing work. My feelings won't be hurt if you completely redo that. |
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. |
…and allow user to select
48232ad
to
6f8a331
Compare
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. |
49fb10d
to
229dc19
Compare
v1.8.1 (2024-11-xx)
What's Changed
Known Issues