Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » ConnectionRefusedError After Update(Everything was working, did an update, now Connection refused)
ConnectionRefusedError After Update [message #1853104] Fri, 17 June 2022 21:13
Pete Cal is currently offline Pete CalFriend
Messages: 2
Registered: October 2020
Location: Nashville TN
Junior Member
I have been using this particular python script for weeks if not longer and it always worked. Last night I did an update to mosquitto. Now I get the failure below. During the update I was given an option to do "something" (sorry, my gray cells are not what they used to be....I don't remember the option). I thought I selected the option that made the most sense. Apparently it was the wrong one. I am hoping someone knows how to undo what I did wrong.

I am using a raspberry pi. The broker_address is 192.168.1.115 = the RPi processor IP.

Note I can open two terminal windows and publish and subscribe successfully

Below is the error message. Below that is a segment of the code.

Connected with result code 60
connecting to broker
Traceback (most recent call last):
  File "/var/www/myurl/KBD2Var.py", line 159, in <module>
    main()
  File "/var/www/myurl/KBD2Var.py", line 96, in main
    client.connect(broker_address,1883,60) #connect to broker
  File "/home/pi/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 914, in connect
    return self.reconnect()
  File "/home/pi/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1044, in reconnec  sock = self._create_socket_connection()
  File "/home/pi/.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)
ConnectionRefusedError: [Errno 111] Connection refused


------------------
(program exited with code: 1)
Press return to continue



Segment of the code

broker_address="192.168.1.115"
    client = mqtt.Client("P1")
    client.on_message=on_message
    client.on_connect=on_connect(broker_address,1883,60)
    print("connecting to broker")
    client.connect(broker_address,1883,60) #connect to broker
    client.loop_start() #start the loop
    #print("Subscribing to topics")
    client.subscribe("BackDoor")
    client.subscribe("FrontDoor")
    client.subscribe("GarageDoor")


I'm not going to live long enough to do all I want to do.

[Updated on: Fri, 17 June 2022 21:36]

Report message to a moderator

Previous Topic:PSK TLS does not work with mosquitto broker
Next Topic:Testing MQTT QoS 1 behavior with connection drop-out mid-publish?
Goto Forum:
  


Current Time: Thu Mar 28 09:52:56 GMT 2024

Powered by FUDForum. Page generated in 0.02185 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top