Sign inSign up

nebraltd/hm-diag

By nebraltd

•Updated 10 months ago

Helium Miner Diagnostics

Buildkit cache
Image
1

100K+

nebraltd/hm-diag repository overview

⁠hm-diag: Helium Miner Diagnostics Container

hm-diag is a small website that displays diagnostic information about a hotspot. The website is only accessible if you are on the same network as the hotspot. Some people have exposed their devices publicly but this is not generally advised.

⁠Quick start

Find the IP address of the hotspot using Balena's dashboard or network scanner. The website is available on port 80 so you can simply input the hotspot's IP address in the browser.

⁠Diagnostics JSON Layout

As part of the code the system produces a JSON file which then is used to carry the data over easily to other parts of the system.

VariableDescription
ANThe Animal Name of the miner
APPNAMEThe name advertised on BTLE
BABalena Application Name
BCHCurrent blockchain height
BNBalena Name, used to identify on balena
BSPSync percentage
BTIf the bluetooth module is detected
BUTTONThe GPIO pin of the button on the miner
CELLULARWhether the device has optional cellular capability
E0MAC Address of the ETH0 interface
ECCIf the ECC Key is detected over I2C
ECCOBIf the miner should have an ECC chip on board
FRThe hardware frequency
FRIENDLYThe Friendly name of the hotspot
FWFirmware running on the unit
IDBalena UUID
LORIf a fault has been found with the LoRa Module
LTEIf the LTE Module is detected
MACWhich mac address to print on labels in production
MCIf the miner is connected to the Helium Network
MDIf the miner is "Dialable" on the network
MHThe sync height of the miner
MNNAT Type of the miner
MRWhether the miner is relayed or not
MSIf miner is synced within 500 blocks
OKThe onboarding key of the miner
PFIf overall diagnostics have passed
PKThe public key of the miner
REThe detected region plan from the miner (or override)
RESETThe reset pin to use for the LoRa Module
serial_numberThe serial number of the onboard Raspberry Pi or other SBC
SPIBUSThe SPI Bus to use for the LoRa Module
STATUSThe GPIO Pin of the status LED
TYPEIf it is a Full or Light Hotspot
VAID of the hardware variant⁠
W0Mac Address of the WLAN0 interface
last_updatedWhen this JSON was last updated (UTC timezone)
firmware_short_hashThe related commit short hash of currently running firmware

⁠Local development environment

Because the stack is tightly intertwined with Balena, the easiest way to test the code base on your own Raspberry Pi in your own Balena project.

  • Create a new Balena application (in a personal org):
    • Default device type: Raspberry Pi 3 (using 64 bit OS)
    • Application type: Starter
  • Add a device:
    • Select newest version
    • Development (required for local mode)
    • Click Download Balena OS
  • Use Etcher⁠ to flash the downloaded image
  • Insert flash drive into the Raspberry Pi and boot (don't forget to plugin ethernet if necessary)
  • Set env vars for the application in Balena:
    • FREQ: 868, 915, etc.
    • VARIANT: Choose from here⁠
  • Deploy changes to:
    • All devices in application: balena push BALENA_APPLICATION
    • Single device in local mode: balena push UUID.local (this will build on the device and )

If you are on the same network as the Raspberry Pi, enter LOCAL IP ADDRESS from Balena into the browser.

⁠Testing
poetry install --with dev
poetry run pytest --cov=hw_diag --cov=bigquery --cov-fail-under=80
poetry run ruff check hw_diag
⁠Deprecated deployment

This is no longer the recommended way⁠ of doing Balena deployments.

  • Add the remote Balena repo:git remote add balena [email protected]:BALENA_USERNAME/BALENA_PROJECT.git
  • Deploy changes: git push balena YourLocalBranch:master

⁠Access from other networks

Balena will generate a public URL for a device if PUBLIC DEVICE URL⁠ is toggled from the Balena device dashboard. This is not generally recommended, except for debugging.

⁠Pre built containers

This repo automatically builds docker containers and uploads them to two repositories for easy access:

The images are tagged using the docker long and short commit SHAs for that release. The current version deployed to miners can be found in the helium-miner-software repo⁠.

⁠Light hotspot notes

Helium network is transitioning to light hotspot mode. During the transition, there is a possibility of hotspot going back and forth between light and full blockchain sync mode. We support a environment variable (DISPLAY_MINER_INFO) to disable showing blockchain mining information so that administrators can enable/disable its visibility to avoid confusion among their customers.

The envvar default to false. If set and set to anything other than true, following mining information will be hidden:

  • Sync Percentage
  • Miner Connected To Blockchain
  • Height Status
  • Miner Relayed

This is a temporary capability that will be removed when hotspots moves to gateway-rs. Instead validator information will be shown.

Tag summary

Content type

Image

Digest

sha256:ea9c76dbe…

Size

176.4 MB

Last updated

almost 2 years ago

docker pull nebraltd/hm-diag