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

MCP23017 module not starting in mqtt-io Add-on #358

Open
jfiger opened this issue Mar 20, 2024 · 1 comment
Open

MCP23017 module not starting in mqtt-io Add-on #358

jfiger opened this issue Mar 20, 2024 · 1 comment
Labels
bug issue in 3rd party lib Issue has to be fixed in 3rd party libary needs triage

Comments

@jfiger
Copy link

jfiger commented Mar 20, 2024

Describe the bug
The initialization of the MCP23017 module failed. see dump below
Config

mqtt:
  host:  *redacted*
  port: 1883

gpio_modules:
  - name: mcp
    module: mcp23017
    chip_addr: 0x20

digital_inputs:
  - name: hallway_frontdoor
    module: mcp
    pin: 14
    inverted: false
    pullup: true
    retain: true
    ha_discovery:
      component: binary_sensor
      name: Hallway Frontdoor
19:57:10] INFO: Starting MQTT IO...
s6-rc: info: service legacy-services successfully started
2024-03-20 19:57:17 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 1269, in run
   self._init_gpio_modules()
 File "/usr/lib/python3.11/site-packages/mqtt_io/server.py", line 244, in _init_gpio_modules
   self.gpio_modules[gpio_config["name"]] = _init_module(
                                            ^^^^^^^^^^^^^
 File "/usr/lib/python3.11/site-packages/mqtt_io/server.py", line 128, in _init_module
   return module_class(module_config)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/usr/lib/python3.11/site-packages/mqtt_io/modules/gpio/__init__.py", line 106, in __init__
   self.setup_module()
 File "/usr/lib/python3.11/site-packages/mqtt_io/modules/gpio/mcp23017.py", line 40, in setup_module
   import board  # type: ignore
   ^^^^^^^^^^^^
 File "/usr/lib/python3.11/site-packages/board.py", line 22, in <module>
   from adafruit_blinka.agnostic import board_id, detector
 File "/usr/lib/python3.11/site-packages/adafruit_blinka/agnostic/__init__.py", line 21, in <module>
   chip_id = detector.chip.id
             ^^^^^^^^^^^^^^^^
 File "/usr/lib/python3.11/site-packages/adafruit_platformdetect/chip.py", line 423, in __getattr__
   raise AttributeError()  # Avoid infinite recursion
   ^^^^^^^^^^^^^^^^^^^^^^
AttributeError
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 1269, in run
   self._init_gpio_modules()
 File "/usr/lib/python3.11/site-packages/mqtt_io/server.py", line 244, in _init_gpio_modules
   self.gpio_modules[gpio_config["name"]] = _init_module(
                                            ^^^^^^^^^^^^^
 File "/usr/lib/python3.11/site-packages/mqtt_io/server.py", line 128, in _init_module
   return module_class(module_config)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/usr/lib/python3.11/site-packages/mqtt_io/modules/gpio/__init__.py", line 106, in __init__
   self.setup_module()
 File "/usr/lib/python3.11/site-packages/mqtt_io/modules/gpio/mcp23017.py", line 40, in setup_module
   import board  # type: ignore
   ^^^^^^^^^^^^
 File "/usr/lib/python3.11/site-packages/board.py", line 22, in <module>
   from adafruit_blinka.agnostic import board_id, detector
 File "/usr/lib/python3.11/site-packages/adafruit_blinka/agnostic/__init__.py", line 21, in <module>
   chip_id = detector.chip.id
             ^^^^^^^^^^^^^^^^
 File "/usr/lib/python3.11/site-packages/adafruit_platformdetect/chip.py", line 423, in __getattr__
   raise AttributeError()  # Avoid infinite recursion
   ^^^^^^^^^^^^^^^^^^^^^^
AttributeError
[19:57:18] INFO: Service MQTT IO exited with code 1 (by signal 0)

Hardware

  • Platform: Raspberry Pi 4B
  • Connected hardware: SEENGREAD MCP2317 mdule via I2C interface

System:

  • OS: Core 2024.3.1
    Supervisor 2024.03.0
    Operating System 12.1
    Interface utilisateur 20240307.0
@BenjiU BenjiU added the issue in 3rd party lib Issue has to be fixed in 3rd party libary label Mar 21, 2024
@BenjiU
Copy link
Collaborator

BenjiU commented Mar 21, 2024

Looks like, that it is an issue in the adafruit lib with newer python libs:
adafruit/Adafruit_Python_PlatformDetect#342

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue in 3rd party lib Issue has to be fixed in 3rd party libary needs triage
Projects
None yet
Development

No branches or pull requests

2 participants