diff --git a/README.md b/README.md index f5b7aed..d0e8052 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,61 @@ # Helium Python Helper A helper module used across various Nebra repos to reduce redundant features. + +This package is used in a number of Nebra software repos: +- [hm-pktfwd](https://github.com/NebraLtd/hm-pktfwd/) +- [hm-config](https://github.com/NebraLtd/hm-config/) +- [hm-diag](https://github.com/NebraLtd/hm-diag/) + +## Helium Hardware Definitions + +```python +from hm_pyhelper.hardware_definitions import variant_definitions +``` + +This repository contains the python file that contains a GPIO map for all of the different hardware combinations to be supported by the Nebra Helium Hotspot Software. + +All numbers below are their GPIO / BCM Numbers, not physical pin numbers. + +Note: Light hotspot software will also work on all models listed as type "full". + +### Nebra Hotspots + +| Model | ENV Identifier | SPI Bus | Reset Pin | Status LED | Button |Type | Cellular | Notes | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | +| Nebra Indoor Hotspot Gen 1 | NEBHNT-IN1 | 1.2 | 38 | 25 | 26 | Full | False | CM3 based | +| Nebra Outdoor Hotspot Gen 1 | NEBHNT-OUT1 | 1.2 | 38 | 25 | 24 | Full | True | CM3 based | +| Nebra Pi 0 Light Hotspot S | NEBHNT-LGT-ZS | 1.2 | 22 | 24 | 23 | Light | False | SPI Based Ethernet | +| Nebra Pi 0 Light Hotspot X | NEBHNT-LGT-ZX | 1.2 | 22 | 24 | 23 | Light | False | USB Based Ethernet | +| Nebra Beaglebone Light Hotspot | NEBHNT-BBB | 1.0 | 60 | 31 | 30 | Light | False | In Planning | +| Nebra Pocket Beagle Light Hotspot | NEBHNT-PBB | 1.0 | 60 | 31 | 30 | Light | False | In Planning | +| Nebra Hotspot HAT RockPi4 | NEBHNT-HHRK4 | 1.0 | 149 | 156 | 154 | Full | False | In Planning | +| Nebra Hotspot HAT RPi | NEBHNT-HHRPI | 0.0 | 22 | 24 | 23 | Full | False | Should be compatible with 3+ & 4 | +| Nebra Hotspot HAT RPi LIGHT | NEBHNT-HHRPL | 0.0 | 22 | 24 | 23 | Light | False | Light is compatible with all 40 pin headers | +| Nebra Hotspot HAT Tinkerboard 2 | NEBHNT-HHTK | 2.0 | 167 | 163 | 162 | Full | False | Light would be compatible on TK1 | + +### Third Party Hotspots + +We may be adding in support for other vendor's hotspots to use our software soon. Here are the variables for those. + +These would also depend on their SOCs being supported by Balena. + +| Model | SOC/SBC | ENV Identifier | SPI Bus | Reset Pin | Status LED | Button |Type | Cellular | Notes | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | +| Rak Hotspot Miner | BCM2711 (Pi4 2gb RAM) | COMP-RAKHM | 0.0 | 17 | 20 | 21 | Full | False | Only Compatible with V2 hotspots with ECC Key. | +| OG Helium Hotspot | BCM2711 (Pi4 2gb RAM) | COMP-HELIUM | 0.0 | 17 | 20 | 21 | Full | False | | +| Syncrobit Hotspot 1 (Pi) | | | | | | | Full | False | | +| Syncrobit Hotspot 2 (RK) | | | | | | | Full | False | | +| Bobcat Miner 300 | | | | | | | Full | False | | +| SenseCAP M1 | BCM2711 (Pi4 2gb RAM) | COMP-SENSECAPM1 | 0.0 | 17 | 20 | 21 | Full | False | | + +### DIY Hotspots + +The following DIY options are also supported for light hotspot software only. + +Please note, DIY Hotspots do not earn HNT. + +| Model | SOC/SBC | ENV Identifier | SPI Bus | Reset Pin | Status LED | Button |Type | Cellular | Notes | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | +| Pi Supply IoT LoRa Gateway HAT | RPi | DIY-PISLGH | 0.0 | 22 | | | Light | False | Any pi with 40 pin header | +| RAK2287 | RPi | DIY-RAK2287 | 0.0 | 17 | | | Light | False | Any pi with 40 pin header | diff --git a/hm_pyhelper/hardware_definitions.py b/hm_pyhelper/hardware_definitions.py new file mode 100644 index 0000000..83ba658 --- /dev/null +++ b/hm_pyhelper/hardware_definitions.py @@ -0,0 +1,247 @@ +variant_definitions = { + # Nebra Indoor Hotspot Gen1 + 'NEBHNT-IN1': { + 'FRIENDLY': 'Nebra Indoor Hotspot Gen 1', + 'APPNAME': 'Indoor', + 'SPIBUS': 'spidev1.2', + 'RESET': 38, + 'MAC': 'eth0', + 'STATUS': 25, + 'BUTTON': 26, + 'ECCOB': True, + 'TYPE': 'Full', + 'CELLULAR': False + }, + + # Nebra Indoor Hotspot, Old identifier + 'Indoor': { + 'FRIENDLY': 'Nebra Indoor Hotspot Gen 1', + 'APPNAME': 'Indoor', + 'SPIBUS': 'spidev1.2', + 'RESET': 38, + 'MAC': 'eth0', + 'STATUS': 25, + 'BUTTON': 26, + 'ECCOB': True, + 'TYPE': 'Full', + 'CELLULAR': False + }, + + # Nebra Outdoor Hotspot Gen1 + 'NEBHNT-OUT1': { + 'FRIENDLY': 'Nebra Outdoor Hotspot Gen 1', + 'APPNAME': 'Outdoor', + 'SPIBUS': 'spidev1.2', + 'RESET': 38, + 'MAC': 'eth0', + 'STATUS': 25, + 'BUTTON': 24, + 'ECCOB': True, + 'TYPE': 'Full', + 'CELLULAR': True + }, + + # Nebra Outdoor Hotspot Old Identifier + 'Outdoor': { + 'FRIENDLY': 'Nebra Outdoor Hotspot Gen 1', + 'APPNAME': 'Outdoor', + 'SPIBUS': 'spidev1.2', + 'RESET': 38, + 'MAC': 'eth0', + 'STATUS': 25, + 'BUTTON': 24, + 'ECCOB': True, + 'TYPE': 'Full', + 'CELLULAR': True + }, + + # Nebra Pi 0 Light Hotspot SPI Ethernet + 'NEBHNT-LGT-ZS': { + 'FRIENDLY': 'Nebra Pi 0 Light Hotspot SE', + 'APPNAME': 'Pi 0 Light', + 'SPIBUS': 'spidev1.2', + 'RESET': 22, + 'MAC': 'wlan0', + 'STATUS': 24, + 'BUTTON': 23, + 'ECCOB': True, + 'TYPE': 'Full', + 'CELLULAR': False + }, + # Nebra Pi 0 Light Hotspot USB Ethernet + 'NEBHNT-LGT-ZX': { + 'FRIENDLY': 'Nebra Pi 0 Light Hotspot XE', + 'APPNAME': 'Pi 0 Light', + 'SPIBUS': 'spidev1.2', + 'RESET': 22, + 'MAC': 'wlan0', + 'STATUS': 24, + 'BUTTON': 23, + 'ECCOB': True, + 'TYPE': 'Full', + 'CELLULAR': False + }, + + # Nebra Beaglebone Light Hotspot + 'NEBHNT-BBB': { + 'FRIENDLY': 'Nebra Beaglebone Light Hotspot', + 'APPNAME': 'Beaglebone Light', + 'SPIBUS': 'spidev1.0', + 'RESET': 60, + 'MAC': 'eth0', + 'STATUS': 31, + 'BUTTON': 30, + 'ECCOB': True, + 'TYPE': 'Full', + 'CELLULAR': False + }, + + # Nebra Pocket Beagle Light Hotspot + 'NEBHNT-PBB': { + 'FRIENDLY': 'Nebra Pocket Beagle Light Hotspot', + 'APPNAME': 'PB Light', + 'SPIBUS': 'spidev1.2', + 'RESET': 60, + 'MAC': 'wlan0', + 'STATUS': 31, + 'BUTTON': 30, + 'ECCOB': True, + 'TYPE': 'Full', + 'CELLULAR': False + }, + + # Nebra Hotspot HAT Rockpi 4 + 'NEBHNT-HHRK4': { + 'FRIENDLY': 'Nebra Hotspot HAT RockPi 4', + 'APPNAME': 'RockPi', + 'SPIBUS': 'spidev1.0', + 'RESET': 149, + 'MAC': 'eth0', + 'STATUS': 156, + 'BUTTON': 154, + 'ECCOB': True, + 'TYPE': 'Full', + 'CELLULAR': False + }, + + # Nebra Hotspot HAT RPi 3/4 Full + 'NEBHNT-HHRPI': { + 'FRIENDLY': 'Nebra Hotspot HAT RPi', + 'APPNAME': 'RPi', + 'SPIBUS': 'spidev0.0', + 'RESET': 22, + 'MAC': 'eth0', + 'STATUS': 24, + 'BUTTON': 23, + 'ECCOB': True, + 'TYPE': 'Full', + 'CELLULAR': False + }, + + # Nebra Hotspot HAT RPi Light + 'NEBHNT-HHRPL': { + 'FRIENDLY': 'Nebra Hotspot HAT RPi Light', + 'APPNAME': 'Light RPi', + 'SPIBUS': 'spidev0.0', + 'RESET': 22, + 'MAC': 'eth0', + 'STATUS': 24, + 'BUTTON': 23, + 'ECCOB': True, + 'TYPE': 'Light', + 'CELLULAR': False + }, + + # Nebra Hotspot HAT Tinkerboard 1 + 'NEBHNT-HHTK': { + 'FRIENDLY': 'Nebra Hotspot HAT Tinkerboard Light', + 'APPNAME': 'Tinkerboard Light', + 'SPIBUS': 'spidev2.0', + 'RESET': 167, + 'MAC': 'eth0', + 'STATUS': 163, + 'BUTTON': 162, + 'ECCOB': True, + 'TYPE': 'Light', + 'CELLULAR': False + }, + + # Nebra Hotspot HAT Tinkerboard 2 + 'NEBHNT-HHTK2': { + 'FRIENDLY': 'Nebra Hotspot HAT Tinkerboard 2', + 'APPNAME': 'Tinkerboard', + 'SPIBUS': 'spidev2.0', + 'RESET': 167, + 'MAC': 'eth0', + 'STATUS': 163, + 'BUTTON': 162, + 'ECCOB': True, + 'TYPE': 'Full', + 'CELLULAR': False + }, + + # RAKwireless Hotspot Miner + 'COMP-RAKHM': { + 'FRIENDLY': 'RAK Hotspot', + 'SPIBUS': 'spidev0.0', + 'RESET': 17, + 'MAC': 'wlan0', + 'STATUS': 20, + 'BUTTON': 21, + 'ECCOB': True, + 'TYPE': 'Full', + 'CELLULAR': False + }, + + # Helium Hotspot + 'COMP-HELIUM': { + 'FRIENDLY': 'Helium Hotspot', + 'SPIBUS': 'spidev0.0', + 'RESET': 17, + 'MAC': 'wlan0', + 'STATUS': 20, + 'BUTTON': 21, + 'ECCOB': True, + 'TYPE': 'Full', + 'CELLULAR': False + }, + + # SenseCAP M1 Hotspot + 'COMP-SENSECAPM1': { + 'FRIENDLY': 'SenseCAP M1', + 'SPIBUS': 'spidev0.0', + 'RESET': 17, + 'MAC': 'wlan0', + 'STATUS': 20, + 'BUTTON': 21, + 'ECCOB': True, + 'TYPE': 'Full', + 'CELLULAR': False + }, + + # DIY Pi Supply Hotspot HAT + 'DIY-PISLGH': { + 'FRIENDLY': 'DIY Pi Supply Hotspot HAT', + 'SPIBUS': 'spidev0.0', + 'RESET': 22, + 'MAC': 'eth0', + 'STATUS': 20, + 'BUTTON': 21, + 'ECCOB': False, + 'TYPE': 'Light', + 'CELLULAR': False + }, + + # Nebra Indoor Hotspot + 'DIY-RAK2287': { + 'FRIENDLY': 'DIY RAK2247/RAK2287 HAT', + 'SPIBUS': 'spidev0.0', + 'RESET': 17, + 'MAC': 'eth0', + 'STATUS': 20, + 'BUTTON': 21, + 'ECCOB': False, + 'TYPE': 'Light', + 'CELLULAR': False + } +} diff --git a/hm_pyhelper/tests/test_get_mac_address.py b/hm_pyhelper/tests/test_get_mac_address.py index 4a4281c..12aa8ad 100644 --- a/hm_pyhelper/tests/test_get_mac_address.py +++ b/hm_pyhelper/tests/test_get_mac_address.py @@ -1,8 +1,8 @@ +from hm_pyhelper.miner_param import get_mac_address import unittest from unittest.mock import mock_open, patch import sys sys.path.append("..") -from hm_pyhelper.miner_param import get_mac_address class TestGetEthMac(unittest.TestCase): diff --git a/setup.py b/setup.py index 7f4c484..731f87a 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='hm_pyhelper', - version='0.2', + version='0.3', author="Nebra Ltd", description="Helium Python Helper", long_description=open(join(dirname(__file__), 'README.md')).read(),