Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT Io On OrangePi 5 #347

Open
niraviry opened this issue Feb 10, 2024 · 1 comment
Open

MQTT Io On OrangePi 5 #347

niraviry opened this issue Feb 10, 2024 · 1 comment

Comments

@niraviry
Copy link

Describe the bug
I am running HA (supervised) on my OrangePi 5 Plus under Debian 12 (Bookworm) with latest updates of both OS and HA.
I setup the config.yml file as follows:

Errors appear below in the proper section.

Expected behavior
No errors in the log file (set to debug).

Error messages and traceback
See errors from the log file:
[19:25:01] INFO: Starting MQTT IO... Looking in indexes: https://pypi.org/simple, https://wheels.home-assistant.io/musllinux-index/ Collecting OPi.GPIO Downloading OPi.GPIO-0.5.2-py2.py3-none-any.whl (33 kB) Installing collected packages: OPi.GPIO Successfully installed OPi.GPIO-0.5.2 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv /usr/lib/python3.11/site-packages/mqtt_io/modules/gpio/orangepi.py:63: UserWarning: Pull up/down setting are not (yet) fully supported, continuing anyway. Use GPIO.setwarnings(False) to disable warnings. self.io.setup(pin, direction, pull_up_down=pullup, initial=initial_int) 2024-02-10 19:25:09 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 1270, in run self._init_digital_inputs() File "/usr/lib/python3.11/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.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/orangepi.py", line 63, in setup_pin self.io.setup(pin, direction, pull_up_down=pullup, initial=initial_int) File "/usr/lib/python3.11/site-packages/OPi/GPIO.py", line 480, in setup raise e File "/usr/lib/python3.11/site-packages/OPi/GPIO.py", line 472, in setup sysfs.export(pin) File "/usr/lib/python3.11/site-packages/OPi/sysfs.py", line 37, in export with open(path, "w") as fp: ^^^^^^^^^^^^^^^ OSError: [Errno 30] Read-only file system: '/sys/class/gpio/export' 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 1270, in run self._init_digital_inputs() File "/usr/lib/python3.11/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.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/orangepi.py", line 63, in setup_pin self.io.setup(pin, direction, pull_up_down=pullup, initial=initial_int) File "/usr/lib/python3.11/site-packages/OPi/GPIO.py", line 480, in setup raise e File "/usr/lib/python3.11/site-packages/OPi/GPIO.py", line 472, in setup sysfs.export(pin) File "/usr/lib/python3.11/site-packages/OPi/sysfs.py", line 37, in export with open(path, "w") as fp: ^^^^^^^^^^^^^^^ OSError: [Errno 30] Read-only file system: '/sys/class/gpio/export' [19:25:09] 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
Paste any error messages and Python traceback if applicable.


**Config**
Here is the config.yml file:

`mqtt:
  host: localhost
  topic_prefix: front_gate
  ha_discovery:
    enabled: yes

gpio_modules:
  - name: orangepi5
    module: orangepi

digital_inputs:
  - name: front_gate_state
    module: orangepi5
    pin: 11`

**Hardware**
 - OrangePi 5Plus
 - Built in GPIO

**System:**
 - OS: Debian 12 (Bookworm)
 - Python version: 3.11.2
 - User you're running as: root
 - Using a virtualenv?: not sure. Followed the installation instructions

**Additional context**
Add any other context about the problem here.
@BenjiU
Copy link
Collaborator

BenjiU commented Feb 26, 2024

Hi @niraviry,

it looks like, that orangepi module can't set the gpio:

in setup sysfs.export(pin) File "/usr/lib/python3.11/site-packages/OPi/sysfs.py", line 37, in export with open(path, "w") as fp:
OSError: [Errno 30] Read-only file system: '/sys/class/gpio/export'

Any clue, while the file system can't be written?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants