NebraLtd / hm-config

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

App diagnostics fails (possibly only on RockPi?!?) #162

Closed shawaj closed 2 years ago

shawaj commented 2 years ago

On RockPi the app diagnostics from the helium app always seems to fail, even though the IP based diagnostics works fine.

I have not yet tried to reproduce this issue on a RasPi based miner...

**Please add more details to the issue you're experiencing below**

Hotspot: macho-punch-cormorant
Hotspot Maker: Nebra Ltd
Address: 112HLD4r8RgBhmcs2b8FVENrRVvvFu5fMPSyqbKiU67JjANEduzN
Connected to Blockchain: Loading...
Dialable: Loading...
Height: Unknown
Last Challenge: never
Firmware: 2021.12.14.0-1
App Version: 3.8.5
Wi-Fi MAC: B0:02:47:93:8A:EF
Eth MAC: 6E:63:A1:68:0A:79
NAT Type: Loading...
IP Address:
Disk status:
Report Generated: 2021-12-21 04:42 AM
Device Info: exynos2100 | android 31 
shawaj commented 2 years ago

Gives the error:

The name com.helium.Miner was not provided by any .service files

Full logs...

 gateway-config  Agent registered
[CHG] Controller 43:45:C5:00:1F:AC Pairable: yes
 gateway-config  [Aaron's S21 Ultra]# pairable off
 gateway-config  [Aaron's S21 Ultra]# quit
method return time=1640061702.811925 sender=org.freedesktop.DBus -> destination=:1.3 serial=3 reply_serial=2
 gateway-config     array [
 gateway-config        string "org.freedesktop.DBus"
 gateway-config        string ":1.3"
 gateway-config     ]
 gateway-config  DBus is now accepting connections
 gateway-config  libmraa[12]: libmraa version v2.1.0-17-g10adedc initialised by user 'root' with EUID 0
 gateway-config  libmraa[12]: gpio: platform doesn't support chardev, falling back to sysfs
 gateway-config  libmraa[12]: libmraa initialised for platform 'ROCK Pi 4' of type 20
 gateway-config  2021-12-21 04:41:43,975 - [DEBUG] - __main__ - (__main__.py).validate_env -- gatewayconfig/__main__.py:(52) - Starting with the following ENV:
 gateway-config          SENTRY_DSN=https://3234e2c67fe04c3e9f8b0c9b118c415a@o571444.ingest.sentry.io/5725518
 gateway-config          BALENA_APP_NAME=HELIUM-TESTNET-ROCKPI
 gateway-config          BALENA_DEVICE_UUID=79966c99632cdf13cedb3831e8d83c53
 gateway-config          VARIANT=NEBHNT-HHRK4
 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=2021.12.14.0-1
 gateway-config  
 gateway-config  2021-12-21 04:41:44,045 - [INFO] - gatewayconfig.gpio.mraa_button - (mraa_button.py).__init__ -- /opt/gatewayconfig/gpio/mraa_button.py:(34) - Initializing mraa button on pin 16
 gateway-config  libmraa[14]: libmraa version v2.1.0-17-g10adedc initialised by user 'root' with EUID 0
 gateway-config  libmraa[14]: gpio: platform doesn't support chardev, falling back to sysfs
 gateway-config  libmraa[14]: libmraa initialised for platform 'ROCK Pi 4' of type 20
 gateway-config  2021-12-21 04:41:44,065 - [INFO] - gatewayconfig.gpio.mraa_led - (mraa_led.py).__init__ -- /opt/gatewayconfig/gpio/mraa_led.py:(20) - Initializing mraa LED on pin 18
 gateway-config  libmraa[16]: libmraa version v2.1.0-17-g10adedc initialised by user 'root' with EUID 0
 gateway-config  libmraa[16]: gpio: platform doesn't support chardev, falling back to sysfs
 gateway-config  libmraa[16]: libmraa initialised for platform 'ROCK Pi 4' of type 20
 gateway-config  2021-12-21 04:41:44,077 - [DEBUG] - gatewayconfig.gatewayconfig_app - (gatewayconfig_app.py).__init__ -- /opt/gatewayconfig/gatewayconfig_app.py:(40) - Read eth0 mac address 6E:63:A1:68:0A:79 and wlan0 B0:02:47:93:8A:EF
 gateway-config  2021-12-21 04:41:44,165 - [INFO] - hm_pyhelper.miner_param - (miner_param.py).run_gateway_mfr -- /opt/venv/lib/python3.7/site-packages/hm_pyhelper/miner_param.py:(42) - gateway_mfr response stdout: b'{\n  "key": "112HLD4r8RgBhmcs2b8FVENrRVvvFu5fMPSyqbKiU67JjANEduzN",\n  "name": "macho-punch-cormorant",\n  "slot": 0\n}\n'
 gateway-config  2021-12-21 04:41:44,166 - [INFO] - hm_pyhelper.miner_param - (miner_param.py).run_gateway_mfr -- /opt/venv/lib/python3.7/site-packages/hm_pyhelper/miner_param.py:(44) - gateway_mfr response stderr: b''
 gateway-config  2021-12-21 04:41:44,176 - [DEBUG] - gatewayconfig.bluetooth.characteristics.diagnostics_characteristic - (diagnostics_characteristic.py).new_diagnostics_proto -- /opt/gatewayconfig/bluetooth/characteristics/diagnostics_characteristic.py:(52) - New Diagnostics Proto
 gateway-config  2021-12-21 04:41:44,196 - [DEBUG] - gatewayconfig.bluetooth.advertisements.bluetooth_connection_advertisement - (bluetooth_connection_advertisement.py).__init__ -- /opt/gatewayconfig/bluetooth/advertisements/bluetooth_connection_advertisement.py:(12) - Creating advertisement with MAC 6E:63:A1:68:0A:79 and variant details {'FRIENDLY': 'Nebra ROCK Pi 4 Indoor', 'APPNAME': 'ROCK Pi', 'SPIBUS': 'spidev32766.0', 'RESET': 149, 'MAC': 'eth0', 'STATUS': 156, 'BUTTON': 154, 'ECCOB': True, 'TYPE': 'Full', 'CELLULAR': False, 'GPIO_PIN_LED': 18, 'GPIO_PIN_BUTTON': 16}
 gateway-config  2021-12-21 04:41:44,197 - [DEBUG] - gatewayconfig.gatewayconfig_app - (gatewayconfig_app.py).start -- /opt/gatewayconfig/gatewayconfig_app.py:(61) - Starting ConfigApp
 gateway-config  2021-12-21 04:41:44,198 - [DEBUG] - gatewayconfig.processors.led_processor - (led_processor.py).run -- /opt/gatewayconfig/processors/led_processor.py:(17) - LED LEDProcessor
 gateway-config  2021-12-21 04:41:44,201 - [DEBUG] - gatewayconfig.processors.diagnostics_processor - (diagnostics_processor.py).run -- /opt/gatewayconfig/processors/diagnostics_processor.py:(19) - Running DiagnosticsProcessor
 gateway-config  2021-12-21 04:41:44,201 - [DEBUG] - gatewayconfig.processors.diagnostics_processor - (diagnostics_processor.py).run -- /opt/gatewayconfig/processors/diagnostics_processor.py:(20) - <gatewayconfig.gatewayconfig_shared_state.GatewayconfigSharedState object at 0xf50ecd30>
 gateway-config  2021-12-21 04:41:44,202 - [DEBUG] - gatewayconfig.processors.diagnostics_processor - (diagnostics_processor.py).read_diagnostics_and_get_ok -- /opt/gatewayconfig/processors/diagnostics_processor.py:(24) - Reading diagnostics from http://localhost/json
 gateway-config  2021-12-21 04:41:44,204 - [DEBUG] - gatewayconfig.processors.wifi_processor - (wifi_processor.py).run -- /opt/gatewayconfig/processors/wifi_processor.py:(16) - Wifi WifiProcessor
 gateway-config  2021-12-21 04:41:44,205 - [DEBUG] - gatewayconfig.processors.bluetooth_advertisement_processor - (bluetooth_advertisement_processor.py).run -- /opt/gatewayconfig/processors/bluetooth_advertisement_processor.py:(22) - Running BluetoothAdvertisementProcessor
 gateway-config  2021-12-21 04:41:44,238 - [DEBUG] - gatewayconfig.processors.diagnostics_processor - (diagnostics_processor.py).read_diagnostics_and_get_ok -- /opt/gatewayconfig/processors/diagnostics_processor.py:(27) - Read diagnostics {'AN': 'macho-punch-cormorant', 'APPNAME': 'ROCK Pi', 'BA': 'HELIUM-TESTNET-ROCKPI', 'BCH': 1147907, 'BN': 'dull-zombie', 'BSP': 100.0, 'BT': True, 'BUTTON': 154, 'CELLULAR': False, 'CONTAINS_FCC_IDS': ['2ARPP-GL5712UX', '2A3PA-ROCKPI4'], 'CONTAINS_IC_IDS': [], 'E0': '6E:63:A1:68:0A:79', 'ECC': True, 'ECCOB': True, 'FCC_IDS': ['2AZDM-HHRK4'], 'FR': '868', 'FRIENDLY': 'Nebra ROCK Pi 4 Indoor', 'FW': '2021.12.14.0-1', 'GPIO_PIN_BUTTON': 16, 'GPIO_PIN_LED': 18, 'IC_IDS': ['27187-HHRK4'], 'ID': '79966c99632cdf13cedb3831e8d83c53', 'LOR': True, 'LTE': False, 'MAC': 'eth0', 'MC': True, 'MD': True, 'MH': 1147907, 'MN': 'restricted', 'MR': False, 'MS': True, 'OK': '112HLD4r8RgBhmcs2b8FVENrRVvvFu5fMPSyqbKiU67JjANEduzN', 'PF': True, 'PK': '112HLD4r8RgBhmcs2b8FVENrRVvvFu5fMPSyqbKiU67JjANEduzN', 'RE': 'EU868', 'RESET': 149, 'SPIBUS': 'spidev32766.0', 'STATUS': 156, 'TYPE': 'Full', 'VA': 'NEBHNT-HHRK4', 'W0': 'B0:02:47:93:8A:EF', 'last_updated': '04:41 UTC 21 Dec 2021', 'serial_number': '44f9aee71d7ab3c7'}
 gateway-config  GATT application registered
 gateway-config  2021-12-21 04:41:47,003 - [DEBUG] - gatewayconfig.processors.bluetooth_advertisement_processor - (bluetooth_advertisement_processor.py).run -- /opt/gatewayconfig/processors/bluetooth_advertisement_processor.py:(37) - Starting Bluetooth advertisement
 gateway-config  GATT advertisement registered
 gateway-config  2021-12-21 04:41:59,780 - [DEBUG] - gatewayconfig.bluetooth.characteristics.wifi_ssid_characteristic - (wifi_ssid_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/wifi_ssid_characteristic.py:(25) - Read WiFi SSID
 gateway-config  2021-12-21 04:41:59,781 - [DEBUG] - gatewayconfig.bluetooth.characteristics.wifi_ssid_characteristic - (wifi_ssid_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/wifi_ssid_characteristic.py:(35) - SSID not in use: SKY91DAC
 gateway-config  2021-12-21 04:41:59,785 - [DEBUG] - gatewayconfig.bluetooth.characteristics.wifi_ssid_characteristic - (wifi_ssid_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/wifi_ssid_characteristic.py:(32) - SSID in use: SKY91DAC
 gateway-config  2021-12-21 04:41:59,787 - [DEBUG] - gatewayconfig.bluetooth.characteristics.wifi_ssid_characteristic - (wifi_ssid_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/wifi_ssid_characteristic.py:(35) - SSID not in use: SKY91DAC
 gateway-config  2021-12-21 04:41:59,790 - [DEBUG] - gatewayconfig.bluetooth.characteristics.wifi_ssid_characteristic - (wifi_ssid_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/wifi_ssid_characteristic.py:(35) - SSID not in use: SKY91DAC
 gateway-config  2021-12-21 04:41:59,792 - [DEBUG] - gatewayconfig.bluetooth.characteristics.wifi_ssid_characteristic - (wifi_ssid_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/wifi_ssid_characteristic.py:(35) - SSID not in use: DIRECT-F0-HP OfficeJet Pro 8710
 gateway-config  2021-12-21 04:41:59,794 - [DEBUG] - gatewayconfig.bluetooth.characteristics.wifi_ssid_characteristic - (wifi_ssid_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/wifi_ssid_characteristic.py:(35) - SSID not in use: SKY91DAC
 gateway-config  2021-12-21 04:41:59,795 - [DEBUG] - gatewayconfig.bluetooth.characteristics.wifi_ssid_characteristic - (wifi_ssid_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/wifi_ssid_characteristic.py:(35) - SSID not in use: SKY91DAC
 gateway-config  2021-12-21 04:41:59,797 - [DEBUG] - gatewayconfig.bluetooth.characteristics.wifi_ssid_characteristic - (wifi_ssid_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/wifi_ssid_characteristic.py:(35) - SSID not in use: SKY91DAC
 gateway-config  2021-12-21 04:41:59,798 - [DEBUG] - gatewayconfig.bluetooth.characteristics.wifi_ssid_characteristic - (wifi_ssid_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/wifi_ssid_characteristic.py:(35) - SSID not in use: SKY91DAC
 gateway-config  2021-12-21 04:41:59,798 - [DEBUG] - gatewayconfig.bluetooth.characteristics.wifi_ssid_characteristic - (wifi_ssid_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/wifi_ssid_characteristic.py:(35) - SSID not in use: Theaks
 gateway-config  2021-12-21 04:41:59,799 - [DEBUG] - gatewayconfig.bluetooth.characteristics.wifi_ssid_characteristic - (wifi_ssid_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/wifi_ssid_characteristic.py:(35) - SSID not in use: TEG-7LR
 gateway-config  2021-12-21 04:41:59,824 - [DEBUG] - gatewayconfig.bluetooth.characteristics.ethernet_online_characteristic - (ethernet_online_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/ethernet_online_characteristic.py:(25) - Read Ethernet Online from /sys/class/net/eth0/carrier
 gateway-config  2021-12-21 04:41:59,826 - [DEBUG] - gatewayconfig.bluetooth.characteristics.ethernet_online_characteristic - (ethernet_online_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/ethernet_online_characteristic.py:(28) - Ethernet is online: false
 gateway-config  2021-12-21 04:41:59,904 - [DEBUG] - gatewayconfig.bluetooth.characteristics.public_key_characteristic - (public_key_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/public_key_characteristic.py:(23) - Read Public Key
 gateway-config  2021-12-21 04:41:59,905 - [DEBUG] - gatewayconfig.bluetooth.characteristics.public_key_characteristic - (public_key_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/public_key_characteristic.py:(25) - Read Public Key: 112HLD4r8RgBhmcs2b8FVENrRVvvFu5fMPSyqbKiU67JjANEduzN
 gateway-config  2021-12-21 04:41:59,995 - [DEBUG] - gatewayconfig.bluetooth.characteristics.onboarding_key_characteristic - (onboarding_key_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/onboarding_key_characteristic.py:(22) - Read Onboarding Key
 gateway-config  2021-12-21 04:41:59,996 - [DEBUG] - gatewayconfig.bluetooth.characteristics.onboarding_key_characteristic - (onboarding_key_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/onboarding_key_characteristic.py:(25) - Onboarding key:  112HLD4r8RgBhmcs2b8FVENrRVvvFu5fMPSyqbKiU67JjANEduzN
 gateway-config  2021-12-21 04:42:02,380 - [DEBUG] - gatewayconfig.bluetooth.characteristics.diagnostics_characteristic - (diagnostics_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/diagnostics_characteristic.py:(34) - Read diagnostics
 gateway-config  2021-12-21 04:42:02,381 - [DEBUG] - gatewayconfig.bluetooth.characteristics.diagnostics_characteristic - (diagnostics_characteristic.py).get_p2pstatus -- /opt/gatewayconfig/bluetooth/characteristics/diagnostics_characteristic.py:(83) - Diagnostics miner_bus
 gateway-config  2021-12-21 04:42:02,388 - [DEBUG] - gatewayconfig.bluetooth.characteristics.diagnostics_characteristic - (diagnostics_characteristic.py).get_p2pstatus -- /opt/gatewayconfig/bluetooth/characteristics/diagnostics_characteristic.py:(85) - Diagnostics miner_object
 gateway-config  2021-12-21 04:42:02,394 - [ERROR] - gatewayconfig.bluetooth.characteristics.diagnostics_characteristic - (diagnostics_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/diagnostics_characteristic.py:(41) - Unexpected exception while trying to read diagnostics: org.freedesktop.DBus.Error.ServiceUnknown: The name com.helium.Miner was not provided by any .service files
 gateway-config  Traceback (most recent call last):
 gateway-config    File "/opt/venv/lib/python3.7/site-packages/dbus/bus.py", line 177, in activate_name_owner
 gateway-config      return self.get_name_owner(bus_name)
 gateway-config    File "/opt/venv/lib/python3.7/site-packages/dbus/bus.py", line 363, in get_name_owner
 gateway-config      's', (bus_name,), **keywords)
 gateway-config    File "/opt/venv/lib/python3.7/site-packages/dbus/connection.py", line 653, in call_blocking
 gateway-config      message, timeout)
 gateway-config  dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'com.helium.Miner': no such name
 gateway-config  
 gateway-config  During handling of the above exception, another exception occurred:
 gateway-config  
 gateway-config  Traceback (most recent call last):
 gateway-config    File "/opt/gatewayconfig/bluetooth/characteristics/diagnostics_characteristic.py", line 36, in ReadValue
 gateway-config      p2pstatus = self.get_p2pstatus()
 gateway-config    File "/opt/gatewayconfig/bluetooth/characteristics/diagnostics_characteristic.py", line 86, in get_p2pstatus
 gateway-config      miner_object = miner_bus.get_object('com.helium.Miner', '/')
 gateway-config    File "/opt/venv/lib/python3.7/site-packages/dbus/bus.py", line 243, in get_object
 gateway-config      follow_name_owner_changes=follow_name_owner_changes)
 gateway-config    File "/opt/venv/lib/python3.7/site-packages/dbus/proxies.py", line 250, in __init__
 gateway-config      self._named_service = conn.activate_name_owner(bus_name)
 gateway-config    File "/opt/venv/lib/python3.7/site-packages/dbus/bus.py", line 182, in activate_name_owner
 gateway-config      self.start_service_by_name(bus_name)
 gateway-config    File "/opt/venv/lib/python3.7/site-packages/dbus/bus.py", line 280, in start_service_by_name
 gateway-config      'su', (bus_name, flags)))
 gateway-config    File "/opt/venv/lib/python3.7/site-packages/dbus/connection.py", line 653, in call_blocking
 gateway-config      message, timeout)
 gateway-config  dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name com.helium.Miner was not provided by any .service files
 gateway-config  2021-12-21 04:42:02,442 - [DEBUG] - gatewayconfig.bluetooth.characteristics.diagnostics_characteristic - (diagnostics_characteristic.py).ReadValue -- /opt/gatewayconfig/bluetooth/characteristics/diagnostics_characteristic.py:(44) - Diagnostics are b'\n\x17\n\tconnected\x12\nLoading...\n\x16\n\x08dialable\x12\nLoading...\n\x14\n\x06height\x12\nLoading...\n\x16\n\x08nat_type\x12\nLoading...\n\x13\n\x03eth\x12\x0c6E63A1680A79\n\x14\n\x04wifi\x12\x0cB00247938AEF\n\x14\n\x02fw\x12\x0e2021.12.14.0-1\n\x06\n\x02ip\x12\x00'
shawaj commented 2 years ago

cc @vpetersson @marvinmarnold @posterzh

shawaj commented 2 years ago

This is the specific device I was testing on https://dashboard.balena-cloud.com/devices/79966c99632cdf13cedb3831e8d83c53/summary

vpetersson commented 2 years ago

@marvinmarnold could you fold this into your finalization checks of RockPi?

shawaj commented 2 years ago

I'm not entirely sure what was causing this but can perform more tests on this device locally if necessary.

shawaj commented 2 years ago

I have a funny feeling it may be the dbus container failing with no error message but can't seem to fix it currently. Will try a purge

shawaj commented 2 years ago

I can confirm that restarting the dbus container and purging the miner did not help this. App diagnostics still fails in the same way

vpetersson commented 2 years ago

Hmm we don't have a ton of control over the DBUS container. @shawaj did you raise this with Balena?

posterzh commented 2 years ago

Unlike Rpi miners, only for the Rockpi miners com.helium.Miner dbus object is not exposed to gateway_config service through session bus. SessionBus is configured correctly in 'gateway_config` service, but helium miner service from their Quay repo does register dbus service object.

Rasp pi:

Rock pi:

shawaj commented 2 years ago

Unlike Rpi miners, only for the Rockpi miners com.helium.Miner dbus object is not exposed to gateway_config service through session bus

@posterzh why is it not exposed to gateway config through session bus on RockPi?

shawaj commented 2 years ago

Hmm we don't have a ton of control over the DBUS container. @shawaj did you raise this with Balena?

@vpetersson it's not an issue with the dbus container. That appears to be working correctly. It's an issue on our side AFAICT.

If it's not on our side then it's an issue with the balenaOS not exposing dbus correctly to the containers. But I don't see how that would be the case given its just a Yocto layer and that bit hasn't changed

shawaj commented 2 years ago

One thing I don't understand, is how we can onboard a miner over Bluetooth, but we can't do the diagnostics on a ROCK Pi?

IIRC the onboarding uses both the system bus (for Bluetooth) and session bus (for miner) so in principle it uses the same thing as app diagnostics

vpetersson commented 2 years ago

I'm a bit confused about this too, @posterzh. As far as DBUS and communication goes, that should be the same on both RockPi and Raspberry Pi. Is there any good reason for having a different pathways?

posterzh commented 2 years ago

@shawaj @vpetersson It's confusing me, too. Let me dig into this in more detail at this week.

vpetersson commented 2 years ago

Thanks, @posterzh.

shawaj commented 2 years ago

The weird thing is @vpetersson that we don't seem to have any device specific code for this.

So I'm wondering if it maybe it's a balena issue after all with the actual yocto image or something.

It doesn't really make much sense to me.

Does anyone have a Nebra RasPi based miner to hand and could test the app diagnostics is working ok?

vpetersson commented 2 years ago

I'm off today (we celebrate Xmas on 24th in Sweden) so I can't look at this. Maybe @posterzh can do some remote analysis using balena?

posterzh commented 2 years ago

@shawaj @vpetersson This issue occurs in any fleet no matter its device type is RPi or RockPi. It's because “dbus-session” container is restarted, but “helium-miner” container keeps alive after a new release is pushed to the fleet.

For example in “HELIUM-TESTNET” updating the release from e7ebbb7 to 6915fe1 or vice versa, “dbus-session” service is changed(FIRMWARE_VERSION: 2021.12.14.0-2 to FIRMWARE_VERSION: 2021.12.14.0-4) but “helium-miner” is nothing changed in docker-compose file. In “HELIUM-TESTNET-ROCKPI”, it's 2310c92 to 2f5454b.

So “dbus-session” container get updated and restarted but “helium-miner” container keeps alive. The new “dbus-session” container doesn't know about the “com.helium.Miner” dbus service registered in the old “dbus-session” container. The simple manual workaround to fix this is to restart the “helium-miner” container in a device after the device is upgraded to a new release. For automtic and programtic solution can be:

marvinmarnold commented 2 years ago

Great finding @posterzh. @shawaj's issue confused me because I was not seeing it in my devices -- mobile app diagnostics has been working fine. But I tend to restart my devices during dev a lot, so your explanation makes sense.

But I think simply adding FIRMWARE_VERSION to the miner service would be an easier solution.

shawaj commented 2 years ago

@marvinmarnold yep agree that's the best course of action now.

I know @kashifpk was working on templating this but I guess it wasn't super urgent (and still isn't really) so probably just need to add that. I'll add to my existing PR in helium-miner-software

shawaj commented 2 years ago

Here we go https://github.com/NebraLtd/helium-miner-software/pull/322

shawaj commented 2 years ago

That worked perfectly, nice find @posterzh 👍

@marvinmarnold maybe we should add the firmware version to every container? Not sure what you think? Might be useful to kill and restart them with every update

marvinmarnold commented 2 years ago

@shawaj I agree we might as well restart all containers

marvinmarnold commented 2 years ago

Closed by: https://github.com/NebraLtd/helium-miner-software/pull/324