Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5442

Networking and servers • MQTT Broker/Client on local network connection issues

$
0
0
I am trying to use a Pi Zero 2 W as an MQTT broker using Mosquitto and a Pi Pico W as the MQTT client using Micropython and Peter Hinch's mqtt_as lib (https://github.com/peterhinch/micropyth ... er/mqtt_as). I can connect to the broker with Postman, and I can connect to test.mosquitto.org with the Pico, but when I try to connect from the Pico to the Zero it times out. I'm guessing that it is a configuration setting with the Mosquitto server that I'm missing or perhaps with the Pi Zero itself.

mosquitto.conf

Code:

# Place your local configuration in /etc/mosquitto/conf.d/## A full description of the configuration file is at# /usr/share/doc/mosquitto/examples/mosquitto.conf.examplepid_file /run/mosquitto/mosquitto.pidpersistence truepersistence_location /var/lib/mosquitto/log_dest file /var/log/mosquitto/mosquitto.loginclude_dir /etc/mosquitto/conf.dallow_anonymous falselistener 1883 0.0.0.0password_file /etc/mosquitto/passwd
I have tried both with allow_anonymous true and false, either works with Postman, neither works with the Pico.

Code:

Traceback (most recent call last):  File "<stdin>", line 41, in <module>  File "asyncio/core.py", line 1, in run  File "asyncio/core.py", line 1, in run_until_complete  File "asyncio/core.py", line 1, in run_until_complete  File "<stdin>", line 27, in main  File "/lib/mqtt_as.py", line 645, in connect  File "/lib/mqtt_as.py", line 314, in _connect  File "/lib/mqtt_as.py", line 213, in _as_readOSError: (-1, 'Timeout on socket read')
I've been pounding my head against this for a while and would appreciate any help. Thanks!

Statistics: Posted by TomCamp — Wed Jan 10, 2024 3:10 am



Viewing all articles
Browse latest Browse all 5442

Trending Articles