openevse_esp32_firmware
                                
                                 openevse_esp32_firmware copied to clipboard
                                
                                    openevse_esp32_firmware copied to clipboard
                            
                            
                            
                        network not respecting DHCP assigned DNS servers since upgrade to 5.0.0
I upgraded to 5.0.0 this morning, and ever since that time MQTT and NTP aren't working. All the settings show the same in the front-end as they did before the update, and I have double checked that both MQTT and NTP servers are working properly.
Unsure how to troubleshoot, I don't see much in the way of logs, in developer debug console I see:
{"mqtt_connected":0}
Ideas?
After a LOT of digging, and no thanks at all to OpenEVSE's lack of logging/troubleshooting ability, I discovered that it seems to be a DNS issue. I have no idea WHY it's a DNS issue, but when I changed NTP and MQTT servers to IP addresses instead of names, it works.
Still no idea how to troubleshoot the DNS issue though, everything else connected to the same wifi has no problem with the DNS.
That sounds really weird, can't think of anything that has changed in that area.
Yeah the debug in the production builds is not great, we do have a ticket to improve that.
I tried multiple reboots, I tried a factory reset, no luck. It's obviously having DNS issues, but I don't know where to go from here.
Interesting, I don't believe there's been any change in this area. What servers are you trying to connect to? Are they local servers? Connecting to https://emoncms.org for energy monitoring works fine
DNS servers are local to my network. Or at least that is what the DHCP server is serving, without any form of diagnostics, I can't see if OpenEVSE is trying to access a different DNS service, if that is the case, it would be unsuccessful, as I have firewall off my IoT devices from the public internet. However it would also be poor form for it to ignore the DNS servers supplied through DHCP.
The networking library (mongoose) uses the Google DNS server by default (8.8.8.8), but unfortunately, it doesn't try alternative DNS servers automatically. It should be possible to change the default by inserting
-D MG_DEFAULT_NAMESERVER='"8.8.8.8"' (with the alternative IP address)
into the build_flags section of the platformio.ini (here).
@ve6rah -
If you have a setting on your router to redirect all DNS requests to local DNS source, that would be a possible workaround for now. I have this set up on my custom LAN router that uses dnsmasq for both DNS and DHCP, so "misbehaving" devices still end up using local DNS whether they want to or not.
Long term fix should be having OpenEVSE respect DNS servers assigned by DHCP, of course.
Right now my short-term fix is to ignore DNS, and put everything in by IP.
However it seems like we've at least figured out why this is happening. Sounds like a badly misbehaving library.
Hum, my wrapper does try to select the router provided IP via MongooseCore::ipConfigChanged() maybe that is not being called...
Also what DNS names are you trying to resolve?
The names I'm trying to resolve are both internal to my network. One is the MQTT server, the other is the NTP server. I don't allow IoT devices to connect to the public internet.
That would certainly track, with the DNS server not being set, although can you confirm that you are not using .local? That is mDNS not DNS and not supported.
The domain names in question are FQDN. They are part of my registered domain, however only served locally.