Hey everyone
Been having a lot of difficulty getting my Enviroplus and Particulate sensor sending data over MQTT with the mqtt_all.py program. The other examples are running well on my Raspberry Pi 3b and the data is showing on the Enviroplus Web App.
I have the MQTT broker working on the Pi, and tested it is operational.
When trying to run mqtt-all with the necessary arguments I get a Time out error below. No data is getting to the Broker. Ultimately I want to connect into Home Assistance but first step is getting the data into the Broker, I think.
I did read there was version issue with paho mqtt so I did rollback the version as mentioned here but now getting this timeout error instead of an API error. python - Paho MQTT 'Unsupported callback API version' error - Stack Overflow
Anyway, heres the command to run mqtt_all.py followed by the resulting error
kavanaa1@raspberrypi3b:~/Pimoroni/enviroplus/examples $ python3 mqtt-all.py --broker 192.162.210 --topic enviroplus --interval 5
mqtt-all.py - Reads Enviro plus data and sends over mqtt.
broker: 192.162.210
client_id: raspi-000000008999ab6e
port: 1883
topic: enviroplus
tls: False
username: None
password: None
Press Ctrl+C to exit!
Traceback (most recent call last):
File “/home/kavanaa1/Pimoroni/enviroplus/examples/mqtt-all.py”, line 278, in
main()
File “/home/kavanaa1/Pimoroni/enviroplus/examples/mqtt-all.py”, line 225, in main
mqtt_client.connect(args.broker, port=args.port)
File “/home/kavanaa1/.local/lib/python3.9/site-packages/paho/mqtt/client.py”, line 914, in connect
return self.reconnect()
File “/home/kavanaa1/.local/lib/python3.9/site-packages/paho/mqtt/client.py”, line 1044, in reconnect
sock = self._create_socket_connection()
File “/home/kavanaa1/.local/lib/python3.9/site-packages/paho/mqtt/client.py”, line 3685, in _create_socket_connection
return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
File “/usr/lib/python3.9/socket.py”, line 843, in create_connection
raise err
File “/usr/lib/python3.9/socket.py”, line 831, in create_connection
sock.connect(sa)
socket.timeout: timed out
Any and all help gratefully accepted !