Connectifity issues
Posted: Tue Feb 05, 2019 8:58 am
Hey!
so I have been playing around with an ESP32 for a little now and my project should be finished but I have some weird connectivity issues which I just can't manage to resolve.
The latest version of my project can be found here https://github.com/Thomseeen/Summerscho ... /Debugging.
I am using the PlatformIO IDE in VSCode, that's why makefiles and such are missing.
My project uses an OV2640 camera with the camera library provided by espressif. To be able to send MQTT messages I'm using this library https://github.com/256dpi/esp-mqtt.
My problem: A lot of TCP packages seem to not reach their destination.
The program sends a timestamp and a picture (up to 37kB) via MQTT.
The ESP always connects successfully to the WiFi.
The lwip SNTP app is always able to get the current time.
Then the library tries to connect to an MQTT-broker on my computer (mosquitto) and this is the first step where it (sometimes) fails. I enabled lwip debugging in lwipopts.h. Looking at Wireshark at my computer I can see that the TCP-SYN package reaches the broker and the broker ACK successful. Then the MQTT-library sends a connection request but that never reaches my computer (can't see it in Wireshark) but lwip got it from the library tcp_write: queueing 6510:6540 and sends it tcp_output_segment: 6510:6540 . I can see the tcp_output_segment: 6510:6540 multiple times (retries as no ACK is received I presume...) and sometimes it reaches my computer after a few tries but more often than not it doesn't and the connection attempt times out.
If eventually the MQTT-connection gets established and I try to publish the timestamp (6bytes payload) it almost always reaches the broker. Then the picture follows, gets split up into 1436byte TCP-packages by lwip and gets sent. As with the MQTT-connection attempt I can see the packages getting queued and sent (multiple times if no ACK is recieved) and eventually the sending times out because one or more packages never reach my computer and never get acknowledged.
Sometime it works just fine for a long time... picture and timestamp reach my computer without any problem within a second. Sometimes it takes about half a minute (timeout is 60s) to sent the picture. Sometimes it doesn't sent the picture, sometimes I can't even connect to the MQTT-broker.
I have multiple ESP32 devkit 1 boards I tried. I also tried different WiFi access points. Neither changes the issue at all.
I know this is probably a very very long shot but at this point I'm somewhat desperate...
Maybe someone has the motivation to help me look into this issue... I really would appreciate any help.
so I have been playing around with an ESP32 for a little now and my project should be finished but I have some weird connectivity issues which I just can't manage to resolve.
The latest version of my project can be found here https://github.com/Thomseeen/Summerscho ... /Debugging.
I am using the PlatformIO IDE in VSCode, that's why makefiles and such are missing.
My project uses an OV2640 camera with the camera library provided by espressif. To be able to send MQTT messages I'm using this library https://github.com/256dpi/esp-mqtt.
My problem: A lot of TCP packages seem to not reach their destination.
The program sends a timestamp and a picture (up to 37kB) via MQTT.
The ESP always connects successfully to the WiFi.
The lwip SNTP app is always able to get the current time.
Then the library tries to connect to an MQTT-broker on my computer (mosquitto) and this is the first step where it (sometimes) fails. I enabled lwip debugging in lwipopts.h. Looking at Wireshark at my computer I can see that the TCP-SYN package reaches the broker and the broker ACK successful. Then the MQTT-library sends a connection request but that never reaches my computer (can't see it in Wireshark) but lwip got it from the library tcp_write: queueing 6510:6540 and sends it tcp_output_segment: 6510:6540 . I can see the tcp_output_segment: 6510:6540 multiple times (retries as no ACK is received I presume...) and sometimes it reaches my computer after a few tries but more often than not it doesn't and the connection attempt times out.
If eventually the MQTT-connection gets established and I try to publish the timestamp (6bytes payload) it almost always reaches the broker. Then the picture follows, gets split up into 1436byte TCP-packages by lwip and gets sent. As with the MQTT-connection attempt I can see the packages getting queued and sent (multiple times if no ACK is recieved) and eventually the sending times out because one or more packages never reach my computer and never get acknowledged.
Sometime it works just fine for a long time... picture and timestamp reach my computer without any problem within a second. Sometimes it takes about half a minute (timeout is 60s) to sent the picture. Sometimes it doesn't sent the picture, sometimes I can't even connect to the MQTT-broker.
I have multiple ESP32 devkit 1 boards I tried. I also tried different WiFi access points. Neither changes the issue at all.
I know this is probably a very very long shot but at this point I'm somewhat desperate...
Maybe someone has the motivation to help me look into this issue... I really would appreciate any help.