ESP8266 does not connect to MQTT server anymore, ESP32 does, since new WiFi cablemodem is installed

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
User avatar
tve
Posts: 214
Joined: Wed Jan 01, 2020 10:12 pm
Location: Santa Barbara, CA
Contact:

Re: ESP8266 does not connect to MQTT server anymore, ESP32 does, since new WiFi cablemodem is installed

Post by tve » Sun Mar 22, 2020 1:32 am

Sorry, but I haven't used the esp8266 with MP other than to try "hello world" and to see that it has too little memory to be fun...
Did you do an erase_flash at some point and reprogram from scratch (sorry if I already asked)? esptool.py also has a read_mac command, dunno whether that works for esp8266.
Otherwise set up a build env and see what gets pulled in...

this_andre
Posts: 12
Joined: Mon Dec 24, 2018 2:26 pm
Location: Germany - near Stuttgart

Re: ESP8266 does not connect to MQTT server anymore, ESP32 does, since new WiFi cablemodem is installed

Post by this_andre » Sun Mar 22, 2020 11:23 am

I have setup the build environment and built a new version and erased and reloaded already several times, also with different versions, including the 'official ones'. Same result. II can see the MAC address and this is OK.
Will look further for the software modules that are pulled in and keep you posted!

this_andre
Posts: 12
Joined: Mon Dec 24, 2018 2:26 pm
Location: Germany - near Stuttgart

Re: ESP8266 does not connect to MQTT server anymore, ESP32 does, since new WiFi cablemodem is installed

Post by this_andre » Thu Mar 26, 2020 6:10 pm

How can I trace what's going wrong at socket level during socket.connect? Is there any possibility to trace the TCP/IP activity for ESP8266 outgoing messages?
I try to setup a mqtt connection and the 'connect' in simple.py fails due to 'ECONNABORTED'. The WiFi is connected (sta_if.isconnected returns TRUE) and sta_if.status returns 5. At the server side (Wireshark), I can see repeated ARP requests from the ESP8266, which are all responded OK.
Can it have something to do with the version of lwip on the ESP8266 since this problem does NOT exist at the ESP32??

this_andre
Posts: 12
Joined: Mon Dec 24, 2018 2:26 pm
Location: Germany - near Stuttgart

Re: ESP8266 does not connect to MQTT server anymore, ESP32 does, since new WiFi cablemodem is installed

Post by this_andre » Sat Mar 28, 2020 5:19 pm

Apparently, the ESP8266 cannot handle WPA and WPA2 authentication properly!

Both the ESP and router report that the WiFi link is up but nevertheless, no packets can be sent across. the ESP reports as WiFi status :
- connected
- authentication mode : 4 (same as configured at the router)

When switching off the authentication (open network), the ESP can send packets to the server over the WiFi connection.
(And yes, I reloaded the software already many times on the board!)

Does anyone know how to solve this?

kevinkk525
Posts: 769
Joined: Sat Feb 03, 2018 7:02 pm

Re: ESP8266 does not connect to MQTT server anymore, ESP32 does, since new WiFi cablemodem is installed

Post by kevinkk525 » Sat Mar 28, 2020 7:03 pm

I use wpa2 and have no problems with my esp8266s
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

this_andre
Posts: 12
Joined: Mon Dec 24, 2018 2:26 pm
Location: Germany - near Stuttgart

Re: ESP8266 does not connect to MQTT server anymore, ESP32 does, since new WiFi cablemodem is installed

Post by this_andre » Sun Mar 29, 2020 12:29 pm

Hi Kevin,
Thanks for your comment. I did not have problems before neither !!
I believe the problem is the type of WPA/WPA2 which is used by the router. One is 'the classic one', which works ok (also for me, before I got my new modem with WiFi router). The other one is the enterprise one, which I believe my new router is using. This does not work on the ESP8266 but works on the ESP32 (which I tested myself).
There are updated source files for the ESP32 (wpa2.a and wpa2_enterprise.h) but I cannot find a build for esp-open-sdk and Micropython on the ESP8266, which incorporates these changes.

kevinkk525
Posts: 769
Joined: Sat Feb 03, 2018 7:02 pm

Re: ESP8266 does not connect to MQTT server anymore, ESP32 does, since new WiFi cablemodem is installed

Post by kevinkk525 » Sun Mar 29, 2020 1:08 pm

Ah well the enterprise one could indeed be the cause of the problem. I remember reading somewhere about it not being completely/correctly implemented but can't point you anywhere.
Is changing the wifi encryption not possible with your new router?
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

this_andre
Posts: 12
Joined: Mon Dec 24, 2018 2:26 pm
Location: Germany - near Stuttgart

Re: ESP8266 does not connect to MQTT server anymore, ESP32 does, since new WiFi cablemodem is installed

Post by this_andre » Sun Mar 29, 2020 4:13 pm

I recently update my UnityMedia cable router to a Vodafone one (which apparently is an Arris TG3442DE). The WiFi authentication modes on this router are OFF/WPA2/WPA+WPA2. I tried all of them and it only works with OFF.
The problem is reported at Vodafone since 2018, without solution. 'Rumours' say that Vodafone is not willing to solve this for security reasons.
According to other forums, the problem is that the ESP8266 cannot handle WPA-PSK (AES). WPA-PSK (TKIP) works.
I'm looking now for a way to implement WPA-PSK AES on the ESP8266.
Who can help me with this?

User avatar
tve
Posts: 214
Joined: Wed Jan 01, 2020 10:12 pm
Location: Santa Barbara, CA
Contact:

Re: ESP8266 does not connect to MQTT server anymore, ESP32 does, since new WiFi cablemodem is installed

Post by tve » Sun Mar 29, 2020 5:49 pm

I think you'll save yourself a lot of time and headaches by buying your own access point and turning the vodafone one off... Buy a good one and it'll avoid similar future nightmares...

kevinkk525
Posts: 769
Joined: Sat Feb 03, 2018 7:02 pm

Re: ESP8266 does not connect to MQTT server anymore, ESP32 does, since new WiFi cablemodem is installed

Post by kevinkk525 » Sun Mar 29, 2020 8:06 pm

Yeah.. Well I guess we would all appreciate if you implement WPA (AES) for the esp8266 :D

But as tve said, it'd be easier to buy a proper router instead of that vodafone box. I'm also using cable internet with vodafone but I'm renting a FritzBox for all functionality.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

Post Reply