Hi,
I have a dedicated wifi network for mqtt without DHCP (static IP), does mqtt_as support this setup ?
I have digged a little in mqtt_as code, I have found that : wifi_connect() function does not call ifconfig() before calling connect(), so static IP is not configured before trying to connect, so it lead to « OSError: Wifi Internal Error »
Am I right ?
mqtt_as – static IP
mqtt_as – static IP
nodemcu V2 (amica)
micropython firmware Daily build 05/31/2016
micropython firmware Daily build 05/31/2016
Re: mqtt_as – static IP
I'd try adding:
before the connect()
I have noticed that sometimes, during code development, on a ESP32 that I have to do a hard re-boot or I get that error.
Code: Select all
sta_if.ifconfig((config.WiFi_device, '255.255.255.0', config.gateway, '8.8.8.8'))
I have noticed that sometimes, during code development, on a ESP32 that I have to do a hard re-boot or I get that error.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: mqtt_as – static IP
Re WiFi internal error there was an issue raised which I fixed 5 days ago. You may want to grab the latest code.
The code does assume a DHCP server. The relevant line is here. I imagine it would be easy to change this to use a fixed IP. Most of my testing was with a broker on a fixed IP, but the DHCP server was responding to the getaddrinfo query. So replacing this line should work but I haven't time to investigate it in detail at the moment.
The code does assume a DHCP server. The relevant line is here. I imagine it would be easy to change this to use a fixed IP. Most of my testing was with a broker on a fixed IP, but the DHCP server was responding to the getaddrinfo query. So replacing this line should work but I haven't time to investigate it in detail at the moment.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.