hassio-addons/addon-mqtt-io

last version dosen't work

Closed this issue · 11 comments

Problem

I updated with the last vesrion version and the addon stop working

Actual behavior

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting

Add-on: MQTT IO
Expose GPIO modules and digital sensors via MQTT for remote control and monitoring.

Add-on version: 0.2.1
You are running the latest version of this add-on.
System: Home Assistant OS 10.2 (aarch64 / raspberrypi3-64)
Home Assistant Core: 2023.6.0
Home Assistant Supervisor: 2023.06.2

Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.

s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
Log level is set to DEBUG
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service mqtt-io: starting
s6-rc: info: service mqtt-io successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[23:22:07] INFO: Starting MQTT IO...
2023-06-26 23:22:38 mqtt_io.main [ERROR] MqttIo crashed!
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/mqtt_io/main.py", line 107, in main
mqtt_gpio.run()
File "/usr/lib/python3.10/site-packages/mqtt_io/server.py", line 1241, in run
self._init_digital_outputs()
File "/usr/lib/python3.10/site-packages/mqtt_io/server.py", line 453, in _init_digital_outputs
gpio_module.setup_pin_internal(PinDirection.OUTPUT, out_conf)
File "/usr/lib/python3.10/site-packages/mqtt_io/modules/gpio/init.py", line 208, in setup_pin_internal
return self.setup_pin(
File "/usr/lib/python3.10/site-packages/mqtt_io/modules/gpio/raspberrypi.py", line 56, in setup_pin
self.io.setup(pin, direction, pull_up_down=pullup, initial=initial_int)
RuntimeError: No access to /dev/mem. Try running as root!
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/lib/python3.10/site-packages/mqtt_io/main.py", line 115, in
main()
File "/usr/lib/python3.10/site-packages/mqtt_io/main.py", line 107, in main
mqtt_gpio.run()
File "/usr/lib/python3.10/site-packages/mqtt_io/server.py", line 1241, in run
self._init_digital_outputs()
File "/usr/lib/python3.10/site-packages/mqtt_io/server.py", line 453, in _init_digital_outputs
gpio_module.setup_pin_internal(PinDirection.OUTPUT, out_conf)
File "/usr/lib/python3.10/site-packages/mqtt_io/modules/gpio/init.py", line 208, in setup_pin_internal
return self.setup_pin(
File "/usr/lib/python3.10/site-packages/mqtt_io/modules/gpio/raspberrypi.py", line 56, in setup_pin
self.io.setup(pin, direction, pull_up_down=pullup, initial=initial_int)
RuntimeError: No access to /dev/mem. Try running as root!
[23:22:40] INFO: Service MQTT IO exited with code 1 (by signal 0)
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service mqtt-io: stopping
s6-rc: info: service mqtt-io successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

Steps to reproduce

reinstall old version and upgrade again

Is there anyone had this issue?
Thanks guys
Steve

Yeah I am also having this issue. I'm investigating...

UPDATE: Not the update you're looking for, but I rolled back to version 0.1.3 and it looks like its working again.

To roll back, you can go to your backups and do a selective restore of just the plugin.

Other (now closed) issue suggest that its something to do with the config of the plugin itself.

Rolling back to 0.13 works but it would be nice to have this as a working addon again..

Looking over the closed issue there are two fixes proposed..

  1. revert config.yaml devices: section as per this comment
  2. delete devices section from config.yaml, as per this fork

What is the best way forward, would it help to submit a PR?

Hey there,
I know it is not probably completely related, but I have tried installing the older (working) version and evening installing the new one with the mentioned update (as a local addon) but both failed on this:

The command '/bin/bash -o pipefail -c apk add --no-cache --virtual .build-dependencies build-base=0.5-r3 libffi-dev=3.4.4-r0 py3-wheel=0.38.4-r0 python3-dev=3.10.9-r1 && apk add --no-cache py3-bcrypt=4.0.1-r0 py3-cryptography=38.0.3-r0 py3-pip=22.3.1-r1 python3=3.10.9-r1 && pip install -r /tmp/requirements.txt && pip install Adafruit_DHT==1.4.0 --install-option="--force-pi2" && find /usr ( -type d -a -name test -o -name tests -o -name 'pycache' ) -o ( -type f -a -name '.pyc' -o -name '.pyo' ) -exec rm -rf '{}' + && apk del --no-cache --purge .build-dependencies' returned a non-zero code: 56

OK - after many hours of various attempts -> loading pip requirements.txt file somehow doesn’t work for me. And then when I move all those into Dockerfile the only one failing is mqtt-io. (pip install mqtt-io)

Would you mind pointing me in some direction as I am a bit lost now …. Sorry for the stupid question :(

I tried a local addon install and get the same error.

After some searching the docker build works if I add the following line to Dockerfile..

     ...
     && pip install --upgrade pip==23.0.1 \
+    && pip install "cython<3.0.0" pyyaml==5.4.1 --no-build-isolation \
     && pip install -r /tmp/requirements.txt \
     ...

Use at your own risk (source)!

Looks like a fix is coming for python mqtt-io module but not yet in pip.

I also reverted config.yaml to v0.1.3.

Once installed, I stopped the 0.1.3 addon, started this one and it is working fine.

Thanks for the help, I succeeded and with your advice installed it. But then again the whole thing crashed on the startup. So I am now using the thingy from HACS and it all works (honestly it took me approx. 10 mins).

Same error

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

afaict nothing has been done to fix this issue, so I think it should remain open until a fix has been put in place. Correct me if I am wrong, I would like to use this plugin.

Same issue here. Fresh install today of V0.2.1.

Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/lib/python3.10/site-packages/mqtt_io/main.py", line 115, in
main()
File "/usr/lib/python3.10/site-packages/mqtt_io/main.py", line 107, in main
mqtt_gpio.run()
File "/usr/lib/python3.10/site-packages/mqtt_io/server.py", line 1240, in run
self._init_digital_inputs()
File "/usr/lib/python3.10/site-packages/mqtt_io/server.py", line 387, in _init_digital_inputs
gpio_module.setup_pin_internal(PinDirection.INPUT, in_conf)
File "/usr/lib/python3.10/site-packages/mqtt_io/modules/gpio/init.py", line 208, in setup_pin_internal
return self.setup_pin(
File "/usr/lib/python3.10/site-packages/mqtt_io/modules/gpio/raspberrypi.py", line 56, in setup_pin
self.io.setup(pin, direction, pull_up_down=pullup, initial=initial_int)
RuntimeError: No access to /dev/mem. Try running as root!

Just published v0.3.0, which should address this.

../Frenck

Installed version 3.0 by uninstalling and reinstalling the Addon. Same error.

s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting
-----------------------------------------------------------
 Add-on: MQTT IO
 Expose GPIO modules and digital sensors via MQTT for remote control and monitoring.
-----------------------------------------------------------
 Add-on version: 0.3.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 10.5  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2023.10.3
 Home Assistant Supervisor: 2023.10.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service mqtt-io: starting
s6-rc: info: service mqtt-io successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[08:13:24] INFO: Starting MQTT IO...
2023-10-16 08:13:31 mqtt_io.__main__ [ERROR] MqttIo crashed!
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/mqtt_io/__main__.py", line 107, in main
    mqtt_gpio.run()
  File "/usr/lib/python3.11/site-packages/mqtt_io/server.py", line 1271, in run
    self._init_digital_outputs()
  File "/usr/lib/python3.11/site-packages/mqtt_io/server.py", line 453, in _init_digital_outputs
    gpio_module.setup_pin_internal(PinDirection.OUTPUT, out_conf)
  File "/usr/lib/python3.11/site-packages/mqtt_io/modules/gpio/__init__.py", line 208, in setup_pin_internal
    return self.setup_pin(
           ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mqtt_io/modules/gpio/raspberrypi.py", line 56, in setup_pin
    self.io.setup(pin, direction, pull_up_down=pullup, initial=initial_int)
RuntimeError: No access to /dev/mem.  Try running as root!
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib/python3.11/site-packages/mqtt_io/__main__.py", line 115, in <module>
    main()
  File "/usr/lib/python3.11/site-packages/mqtt_io/__main__.py", line 107, in main
    mqtt_gpio.run()
  File "/usr/lib/python3.11/site-packages/mqtt_io/server.py", line 1271, in run
    self._init_digital_outputs()
  File "/usr/lib/python3.11/site-packages/mqtt_io/server.py", line 453, in _init_digital_outputs
    gpio_module.setup_pin_internal(PinDirection.OUTPUT, out_conf)
  File "/usr/lib/python3.11/site-packages/mqtt_io/modules/gpio/__init__.py", line 208, in setup_pin_internal
    return self.setup_pin(
           ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mqtt_io/modules/gpio/raspberrypi.py", line 56, in setup_pin
    self.io.setup(pin, direction, pull_up_down=pullup, initial=initial_int)
RuntimeError: No access to /dev/mem.  Try running as root!
[08:13:32] INFO: Service MQTT IO exited with code 1 (by signal 0)
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service mqtt-io: stopping
s6-rc: info: service mqtt-io successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped```