-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
ESP32 + Paho + PubSubclient Issue #1198
Comments
Have you done any other debugging? At the moment it doesn't sound like you know what component the problem is in - the broker or the esp I am guessing. Does publishing with another mqtt client like |
@imaniroman When do you start to see this issue? I've noticed similar issue in my setup where I use ESP8266 devices with PubSubClient-EspEasy-2.6.09 on Arduino 2.5.0 (Tasmota firmware) and Mosquitto on Raspberry Pi 3B+. I had the issue when I've upgraded from Moquitto 1.4.10-3+deb9u2 to Mosquitto 1.4.10-3+deb9u4 (yes just different update) from Rasbian default repository. Then I've tried to use Mosquitto repository https://repo.mosquitto.org/debian stretch main with version 1.5.6 but it contains the same issue. The only way to make my setup working again was Mosquitto downgrade back to 1.4.10-3+deb9u2. Before downgrading Mosquitto, I tried to downgrade kernel and various system libraries which were upgraded during the same R Pi upgrade cycles but without any success. Later, when I had some time I did more debugging with newer Mosquitto and it seems that the problem lies somewhere in authentication. PubSubClient was not able to connect to Mosquitto and does regular retries but without any success. When I've disabled acl_file and allow anonymous access to mosquitto, it works on new version. However, running Mosquitto without authentication and acl is not acceptable for IoT devices. I was able to run tcpdump and collect few attempts to connect + auth into mqtt both on old version and new version of mosquitto using the same configuration on connection without TLS. Initial communication from client looks exactly same but newer mosquitto is not accepting this connection. Thus it seems that there must be some change around initial authentication. |
@ralight Thanks for the reply! I installed mosquitto on Ubuntu on Windows 10 and tried a simple mqtt sketch. Both failed to publish. I then tried pinging my Ras pi which failed to. Currently having weird connection issues with my raspi to my Mobile hotspot. Trying to fix that first :) |
@sislakd |
Turns out my Wifi hot stop and my Pi's wifi module was dead!!! Got it all running with a new pi! |
Glad you got it sorted! |
Hello Everyone,
I am using an ESP32 with PubSubClient and Paho and Mosquitto (1.5.8) running on a Raspi 3 on Ubuntu. ESP32 and Raspi are on the same local network . PubSubClient's MQTT_MAX_PACKET_SIZE has been set to 256 bytes. Code used to work fine before but not anymore.
Error is "Attempting MQTT connection...failed, rc=-4 try again in 5 seconds"
The code running on my ESP32 is below. Setup is 2 Pro mins connected to IMUs over UART/Serial and a Temp sensor.
Using this python script on the Raspi to receive mqtt packets and save to CSV file
Please help as my thesis is due soon. Thank you!
The text was updated successfully, but these errors were encountered: