NebraLtd / hm-config

Helium Miner Config Container
https://nebra.io/hnt
MIT License
12 stars 20 forks source link

failed to add edge detection on rak / sensecap / syncrobit? #233

Closed shawaj closed 1 year ago

shawaj commented 1 year ago

Not working correctly on rak / sensecap and possibly other raspi 4 / cm4...

 gateway-config          SENTRY_DSN=None
 gateway-config          BALENA_APP_NAME=helium-rak
 gateway-config          BALENA_DEVICE_UUID=4ec29dfb812ef82fdd32eff7a0e2f3c8
 gateway-config          VARIANT=COMP-RAKHM
 gateway-config          ETH0_MAC_ADDRESS_FILEPATH=/sys/class/net/eth0/address
 gateway-config          WLAN0_MAC_ADDRESS_FILEPATH=/sys/class/net/wlan0/address
 gateway-config          DIAGNOSTICS_JSON_URL=http://localhost/json
 gateway-config          ETHERNET_IS_ONLINE_FILEPATH=/sys/class/net/eth0/carrier
 gateway-config          FIRMWARE_VERSION=2022.12.13.0-22
 gateway-config  
 gateway-config  Traceback (most recent call last):
Agent registered
[CHG] Controller E4:5F:01:30:AE:E8 Pairable: yes
 gateway-config  [bluetooth]# pairable off
 gateway-config  [bluetooth]# quit
method return time=1675634867.057119 sender=org.freedesktop.DBus -> destination=:1.20 serial=3 reply_serial=2
 gateway-config     array [
 gateway-config        string "org.freedesktop.DBus"
 gateway-config        string "com.helium.Miner"
 gateway-config        string ":1.20"
 gateway-config        string ":1.6"
 gateway-config     ]
 gateway-config  DBus is now accepting connections
 gateway-config  libmraa[11]: libmraa version v2.1.0-24-gbd91964 initialised by user 'root' with EUID 0
 gateway-config  libmraa[11]: gpio: platform doesn't support chardev, falling back to sysfs
 gateway-config  libmraa[11]: libmraa initialised for platform 'Raspberry Pi Model B Rev 1' of type 5
 gateway-config  2023-02-05 22:07:48,073 - [DEBUG] - __main__ - (__main__.py).validate_env -- /opt/gatewayconfig/__main__.py:(34) - Starting with the following ENV:
 gateway-config          SENTRY_DSN=None
 gateway-config          BALENA_APP_NAME=helium-rak
 gateway-config          BALENA_DEVICE_UUID=4ec29dfb812ef82fdd32eff7a0e2f3c8
 gateway-config          VARIANT=COMP-RAKHM
 gateway-config          ETH0_MAC_ADDRESS_FILEPATH=/sys/class/net/eth0/address
 gateway-config          WLAN0_MAC_ADDRESS_FILEPATH=/sys/class/net/wlan0/address
 gateway-config          DIAGNOSTICS_JSON_URL=http://localhost/json
 gateway-config          ETHERNET_IS_ONLINE_FILEPATH=/sys/class/net/eth0/carrier
 gateway-config          FIRMWARE_VERSION=2022.12.13.0-22
 gateway-config  
 gateway-config  Traceback (most recent call last):
 gateway-config    File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
 gateway-config      return _run_code(code, main_globals, None,
 gateway-config    File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
 gateway-config      exec(code, run_globals)
 gateway-config    File "/opt/gatewayconfig/__main__.py", line 77, in <module>
 gateway-config      main()
 gateway-config    File "/opt/gatewayconfig/__main__.py", line 30, in main
 gateway-config      start()
 gateway-config    File "/opt/gatewayconfig/__main__.py", line 57, in start
 gateway-config      config_app = GatewayconfigApp(
 gateway-config    File "/opt/gatewayconfig/gatewayconfig_app.py", line 43, in __init__
 gateway-config      self.init_gpio(variant)
 gateway-config    File "/opt/gatewayconfig/gatewayconfig_app.py", line 136, in init_gpio
 gateway-config      self.user_button = Button(btn, hold_time=USER_BUTTON_HOLD_SECONDS)
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/devices.py", line 108, in __call__
 gateway-config      self = super(GPIOMeta, cls).__call__(*args, **kwargs)
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/input_devices.py", line 414, in __init__
 gateway-config      super(Button, self).__init__(
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/mixins.py", line 433, in __init__
 gateway-config      super(HoldMixin, self).__init__(*args, **kwargs)
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/input_devices.py", line 171, in __init__
 gateway-config      self.pin.when_changed = self._pin_changed
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/pins/__init__.py", line 432, in <lambda>
 gateway-config      lambda self, value: self._set_when_changed(value),
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/pins/pi.py", line 319, in _set_when_changed
 gateway-config      self._enable_event_detect()
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/pins/rpigpio.py", line 226, in _enable_event_detect
 gateway-config      GPIO.add_event_detect(
 gateway-config  RuntimeError: Failed to add edge detection
shawaj commented 1 year ago

More output...

 gateway-config     array [
 gateway-config        string "org.freedesktop.DBus"
 gateway-config        string "com.helium.Miner"
 gateway-config        string ":1.28"
 gateway-config        string ":1.6"
 gateway-config     ]
 gateway-config  DBus is now accepting connections
 gateway-config  libmraa[11]: libmraa version v2.1.0-24-gbd91964 initialised by user 'root' with EUID 0
 gateway-config  libmraa[11]: gpio: platform doesn't support chardev, falling back to sysfs
 gateway-config  libmraa[11]: libmraa initialised for platform 'Raspberry Pi Model B Rev 1' of type 5
 gateway-config  2023-02-05 22:16:08,450 - [DEBUG] - __main__ - (__main__.py).validate_env -- /opt/gatewayconfig/__main__.py:(34) - Starting with the following ENV:
 gateway-config          SENTRY_DSN=None
 gateway-config          BALENA_APP_NAME=helium-rak
 gateway-config          BALENA_DEVICE_UUID=4ec29dfb812ef82fdd32eff7a0e2f3c8
 gateway-config          VARIANT=COMP-RAKHM
 gateway-config          ETH0_MAC_ADDRESS_FILEPATH=/sys/class/net/eth0/address
 gateway-config          WLAN0_MAC_ADDRESS_FILEPATH=/sys/class/net/wlan0/address
 gateway-config          DIAGNOSTICS_JSON_URL=http://localhost/json
 gateway-config          ETHERNET_IS_ONLINE_FILEPATH=/sys/class/net/eth0/carrier
 gateway-config          FIRMWARE_VERSION=2022.12.13.0-22
 gateway-config  
 gateway-config  Traceback (most recent call last):
 gateway-config    File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
 gateway-config      return _run_code(code, main_globals, None,
 gateway-config    File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
 gateway-config      exec(code, run_globals)
 gateway-config    File "/opt/gatewayconfig/__main__.py", line 77, in <module>
 gateway-config      main()
 gateway-config    File "/opt/gatewayconfig/__main__.py", line 30, in main
 gateway-config      start()
 gateway-config    File "/opt/gatewayconfig/__main__.py", line 57, in start
 gateway-config      config_app = GatewayconfigApp(
 gateway-config    File "/opt/gatewayconfig/gatewayconfig_app.py", line 43, in __init__
 gateway-config      self.init_gpio(variant)
 gateway-config    File "/opt/gatewayconfig/gatewayconfig_app.py", line 136, in init_gpio
 gateway-config      self.user_button = Button(btn, hold_time=USER_BUTTON_HOLD_SECONDS)
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/devices.py", line 108, in __call__
 gateway-config      self = super(GPIOMeta, cls).__call__(*args, **kwargs)
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/input_devices.py", line 414, in __init__
 gateway-config      super(Button, self).__init__(
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/mixins.py", line 433, in __init__
 gateway-config      super(HoldMixin, self).__init__(*args, **kwargs)
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/input_devices.py", line 171, in __init__
 gateway-config      self.pin.when_changed = self._pin_changed
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/pins/__init__.py", line 432, in <lambda>
 gateway-config      lambda self, value: self._set_when_changed(value),
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/pins/pi.py", line 319, in _set_when_changed
 gateway-config      self._enable_event_detect()
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/pins/rpigpio.py", line 226, in _enable_event_detect
 gateway-config      GPIO.add_event_detect(
Agent registered
[CHG] Controller E4:5F:01:30:AE:E8 Pairable: yes
 gateway-config  [bluetooth]# pairable off
 gateway-config  [bluetooth]# quit
method return time=1675635429.940294 sender=org.freedesktop.DBus -> destination=:1.29 serial=3 reply_serial=2
 gateway-config     array [
 gateway-config        string "org.freedesktop.DBus"
 gateway-config        string "com.helium.Miner"
 gateway-config        string ":1.29"
 gateway-config        string ":1.6"
 gateway-config     ]
 gateway-config  DBus is now accepting connections
 gateway-config  libmraa[11]: libmraa version v2.1.0-24-gbd91964 initialised by user 'root' with EUID 0
 gateway-config  libmraa[11]: gpio: platform doesn't support chardev, falling back to sysfs
 gateway-config  libmraa[11]: libmraa initialised for platform 'Raspberry Pi Model B Rev 1' of type 5
 gateway-config  2023-02-05 22:17:10,994 - [DEBUG] - __main__ - (__main__.py).validate_env -- /opt/gatewayconfig/__main__.py:(34) - Starting with the following ENV:
 gateway-config          SENTRY_DSN=None
 gateway-config          BALENA_APP_NAME=helium-rak
 gateway-config          BALENA_DEVICE_UUID=4ec29dfb812ef82fdd32eff7a0e2f3c8
 gateway-config          VARIANT=COMP-RAKHM
 gateway-config          ETH0_MAC_ADDRESS_FILEPATH=/sys/class/net/eth0/address
 gateway-config          WLAN0_MAC_ADDRESS_FILEPATH=/sys/class/net/wlan0/address
 gateway-config          DIAGNOSTICS_JSON_URL=http://localhost/json
 gateway-config          ETHERNET_IS_ONLINE_FILEPATH=/sys/class/net/eth0/carrier
 gateway-config          FIRMWARE_VERSION=2022.12.13.0-22
 gateway-config  
 gateway-config  Traceback (most recent call last):
 gateway-config    File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
 gateway-config      return _run_code(code, main_globals, None,
 gateway-config    File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
 gateway-config      exec(code, run_globals)
 gateway-config    File "/opt/gatewayconfig/__main__.py", line 77, in <module>
 gateway-config      main()
 gateway-config    File "/opt/gatewayconfig/__main__.py", line 30, in main
 gateway-config      start()
 gateway-config    File "/opt/gatewayconfig/__main__.py", line 57, in start
 gateway-config      config_app = GatewayconfigApp(
 gateway-config    File "/opt/gatewayconfig/gatewayconfig_app.py", line 43, in __init__
 gateway-config      self.init_gpio(variant)
 gateway-config    File "/opt/gatewayconfig/gatewayconfig_app.py", line 136, in init_gpio
 gateway-config      self.user_button = Button(btn, hold_time=USER_BUTTON_HOLD_SECONDS)
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/devices.py", line 108, in __call__
 gateway-config      self = super(GPIOMeta, cls).__call__(*args, **kwargs)
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/input_devices.py", line 414, in __init__
 gateway-config      super(Button, self).__init__(
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/mixins.py", line 433, in __init__
 gateway-config      super(HoldMixin, self).__init__(*args, **kwargs)
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/input_devices.py", line 171, in __init__
 gateway-config      self.pin.when_changed = self._pin_changed
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/pins/__init__.py", line 432, in <lambda>
 gateway-config      lambda self, value: self._set_when_changed(value),
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/pins/pi.py", line 319, in _set_when_changed
 gateway-config      self._enable_event_detect()
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/pins/rpigpio.py", line 226, in _enable_event_detect
 gateway-config      GPIO.add_event_detect(
 gateway-config  RuntimeError: Failed to add edge detection
Agent registered
[CHG] Controller E4:5F:01:30:AE:E8 Pairable: yes
 gateway-config  [bluetooth]# pairable off
 gateway-config  [bluetooth]# quit
method return time=1675635492.523165 sender=org.freedesktop.DBus -> destination=:1.30 serial=3 reply_serial=2
 gateway-config     array [
 gateway-config        string "org.freedesktop.DBus"
 gateway-config        string ":1.30"
 gateway-config        string "com.helium.Miner"
 gateway-config        string ":1.6"
 gateway-config     ]
 gateway-config  DBus is now accepting connections
 gateway-config  libmraa[11]: libmraa version v2.1.0-24-gbd91964 initialised by user 'root' with EUID 0
 gateway-config  libmraa[11]: gpio: platform doesn't support chardev, falling back to sysfs
 gateway-config  libmraa[11]: libmraa initialised for platform 'Raspberry Pi Model B Rev 1' of type 5
 gateway-config  2023-02-05 22:18:13,549 - [DEBUG] - __main__ - (__main__.py).validate_env -- /opt/gatewayconfig/__main__.py:(34) - Starting with the following ENV:
 gateway-config          SENTRY_DSN=None
 gateway-config          BALENA_APP_NAME=helium-rak
 gateway-config          BALENA_DEVICE_UUID=4ec29dfb812ef82fdd32eff7a0e2f3c8
 gateway-config          VARIANT=COMP-RAKHM
 gateway-config          ETH0_MAC_ADDRESS_FILEPATH=/sys/class/net/eth0/address
 gateway-config          WLAN0_MAC_ADDRESS_FILEPATH=/sys/class/net/wlan0/address
 gateway-config          DIAGNOSTICS_JSON_URL=http://localhost/json
 gateway-config          ETHERNET_IS_ONLINE_FILEPATH=/sys/class/net/eth0/carrier
 gateway-config          FIRMWARE_VERSION=2022.12.13.0-22
 gateway-config  
 gateway-config  Traceback (most recent call last):
 gateway-config    File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
 gateway-config      return _run_code(code, main_globals, None,
 gateway-config    File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
 gateway-config      exec(code, run_globals)
 gateway-config    File "/opt/gatewayconfig/__main__.py", line 77, in <module>
 gateway-config      main()
 gateway-config    File "/opt/gatewayconfig/__main__.py", line 30, in main
 gateway-config      start()
 gateway-config    File "/opt/gatewayconfig/__main__.py", line 57, in start
 gateway-config      config_app = GatewayconfigApp(
 gateway-config    File "/opt/gatewayconfig/gatewayconfig_app.py", line 43, in __init__
 gateway-config      self.init_gpio(variant)
 gateway-config    File "/opt/gatewayconfig/gatewayconfig_app.py", line 136, in init_gpio
 gateway-config      self.user_button = Button(btn, hold_time=USER_BUTTON_HOLD_SECONDS)
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/devices.py", line 108, in __call__
 gateway-config      self = super(GPIOMeta, cls).__call__(*args, **kwargs)
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/input_devices.py", line 414, in __init__
 gateway-config      super(Button, self).__init__(
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/mixins.py", line 433, in __init__
 gateway-config      super(HoldMixin, self).__init__(*args, **kwargs)
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/input_devices.py", line 171, in __init__
 gateway-config      self.pin.when_changed = self._pin_changed
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/pins/__init__.py", line 432, in <lambda>
 gateway-config      lambda self, value: self._set_when_changed(value),
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/pins/pi.py", line 319, in _set_when_changed
 gateway-config      self._enable_event_detect()
 gateway-config    File "/opt/venv/lib/python3.9/site-packages/gpiozero/pins/rpigpio.py", line 226, in _enable_event_detect
 gateway-config      GPIO.add_event_detect(
 gateway-config  RuntimeError: Failed to add edge detection
shawaj commented 1 year ago

Seems to be same as #177 but is still happening

shawaj commented 1 year ago

Same fix as in https://github.com/NebraLtd/hm-config/issues/177#issuecomment-1080350657

😂