flyte / mqtt-io

Expose GPIO modules (Raspberry Pi, Beaglebone, PCF8754, PiFace2 etc.) and digital sensors (LM75 etc.) to an MQTT server for remote control and monitoring.
MIT License
465 stars 157 forks source link

Connection reset by peer #243

Open Julusian opened 2 years ago

Julusian commented 2 years ago

Describe the bug Not reconnecting to MQTT

Expected behavior The software to reconnect to the MQTT server, or exit with a fatal error

Error messages and traceback

2021-12-06 00:24:39 mqtt_io.server [INFO] Digital output 'relay11' set to False (off)
2021-12-06 00:24:39 mqtt_io.server [INFO] Digital output 'relay12' set to False (off)
failed to receive on socket: [Errno 104] Connection reset by peer

Config

mqtt:
  host: 
  port: 1883
  user: ""
  password: ""
  topic_prefix: relay/rack

gpio_modules:
  - name: raspberrypi
    module: raspberrypi

digital_outputs:
  - name: relay1
    module: raspberrypi
    pin: 2
    on_payload: "ON"
    off_payload: "OFF"

More outputs are defined, in an identical fashion

Hardware

System:

Additional context I believe this is also happening to some pi zeros too, but I do not have the logs to verify

CoolSaet commented 2 years ago

I have the same issue. However no error message. I am also running only digital outputs. On an RPI 2B with bullseye installed. Everything works fine with mosquito server running as addon in home Assistant. After HA reboot or restart of the mosquito addon, nothing is received on the mqtt-io client. Only restarting the process seems to fix it. Basically reinitiating the connection.

Bettman66 commented 2 years ago

The problem has existed since the switch to asynchronous. You have to control an input first and it reconnects. I went back to the old version, it works great.

CoolSaet commented 2 years ago

The problem has existed since the switch to asynchronous. You have to control an input first and it reconnects. I went back to the old version, it works great.

Thanks. Could you tell me which version is the old one? Everything below 2.0.0?

Bettman66 commented 2 years ago

I forked and removed everything but PIFace and GPIO. If that is enough for you, you can use this. I added installation instructions in German. You can use the translator.

i think v.0.5.6

Julusian commented 2 years ago

My solution to this issue has been to switch to use an esp32 running esphome (connecting to home assistant)