Giter VIP home page Giter VIP logo

helium-data-hotspot's Introduction

Helium data-only Hotspot

This is a balena version based on the Nebra helium hotspot.

Disclaimer

This Helium Hotspot is going to transfer LoRa data to Helium OUIs but it's not going to perform proof-of-coverage or anything else to retrieve tokens. Read more information about the milestones and what's possible to get here

Requirements

Hardware

  • Raspberry Pi 0/2/3/4 or balenaFin
  • SD card in case of the RPi 0/2/3/4
  • Power supply and (optionally) ethernet cable
  • LoRa concentrator (SX1302 SPI based) (e.g. RAK2287)

Software

Deploy the fleet

Find 2 possibilities here:

One-click deploy using Balena Deploy

Running this project is as simple as deploying it to a balenaCloud application. You can do it in just one click by using the button below:

Follow instructions, click Add a Device and flash an SD card with that OS image dowloaded from balenaCloud. Enjoy the magic 🌟Over-The-Air🌟!

Deploy via Balena CLI

If you are a balena CLI expert, feel free to use balena CLI. This option lets you configure in detail some options, like adding new services to your deploy or configure de DNS Server to use.

  • Sign up on balena.io
  • Create a new fleet on balenaCloud.
  • Click Add a new device and download the balenaOS image it creates.
  • Burn and SD card (if using a Pi), connect it to the device and boot it up.

While the device boots (it will eventually show up in the balenaCloud dashboard) we will prepare de services:

  • Clone this repository to your local workstation. Don't forget to update the submodules.
cd ~/workspace
git clone https://github.com/mpous/helium-data-hotspot
cd helium-data-hotspot
  • Using Balena CLI, push the code to the fleet with balena push <fleet-name>
  • See the magic happening, your device is getting updated 🌟Over-The-Air🌟!

Device Variables

Once the device is online and the services packet-forwarder and gatewayrs are downloaded and installed go to Device Variables:

  • Create the variable for all the services VARIANT with your hardware definition. During the test is being used a Raspberry Pi 4 with RAK2287 LoRa concentrator and the VARIANT is defined DIY-RAK2287. You can find here the list of hardware compatible.

  • Create the variable for all the services REGION_OVERRIDE with your LoRa region (e.g. EU868). You can find here the list of LoRa regions compatible.

At that moment the hotspot should be running showing some errors on connecting to the Blockchain on the balenaCloud Logs.

Run the Helium Hotspot

To check that everything is running properly, go to the Terminal and select the gatewayrs service, then introduce.

helium_gateway key info

And you will get something like this:

{ "address": <hotspot address>, "name": <hotspot name> }

Join the Helium blockchain with your data-only hotspot

To join the Helium blockchain, at the moment (summer 2021) you only can use the Helium CLI. The Helium app is still not compatible with the data-only hotspots. Install the Helium CLI wallet and follow these steps:

Create a Helium wallet

Install the Helium wallet CLI or use the wallet key from your mobile application. In case that you need to create a wallet from scratch, just type and follow the instructions.

helium-wallet create basic

Then to see YOUR_WALLET of the Helium wallet type:

helium-wallet info

Add the hotspot from balenaCloud

Go to your device on balenaCloud and type on the HostOS terminal (before change YOUR_WALLET by your public Helium wallet ID):

root@d83bf778fc69:/etc/helium_gateway# helium_gateway add --owner YOUR_WALLET --payer YOUR_WALLET
{
  "address": "YOUR_ADDRESS",
  "fee": 65000,
  "mode": "dataonly",
  "owner": "YOUR_WALLET",
  "payer": "YOUR_WALLET",
  "staking fee": 1000000,
  "txn": "YOUR_TXN"
}

Remember that to confirm all the commands you will need to add --commit at the end of the command.

Then go to your computer where you installed the Helium wallet CLI software. Copy your txn from the previous JSON response and type:

MacBookPro-Marc-Pous-2827:helium-wallet-v1.6.6-x86-64-macos marcpous$ ./helium-wallet hotspots add YOUR_TXN --commit
Password: [hidden]
+-------------+-----------------------------------------------------+
| Key         | Value                                               |
+-------------+-----------------------------------------------------+
| Address     | YOUR_ADDRESS                                        |
+-------------+-----------------------------------------------------+
| Payer       | YOUR_WALLET                                         |
+-------------+-----------------------------------------------------+
| Fee         | 65000                                               |
+-------------+-----------------------------------------------------+
| Staking fee | 1000000                                             |
+-------------+-----------------------------------------------------+
| Hash        | YOUR_HASH                                           |
+-------------+-----------------------------------------------------+

You will need to have some Data Credits to be able to do this operation (1065000 DCs).

Finally you will need to assert the location of the data-only Helium hotspot. Cpy your

MacBookPro-Marc-Pous-2827:helium-wallet-v1.6.6-x86-64-macos marcpous$ ./helium-wallet hotspots assert --gateway YOUR_ADDRESS --lat=YOUR_LAT --lon=YOUR_LON --mode dataonly --commit
Password: [hidden]
+------------------+-----------------------------------------------------+
| Key              | Value                                               |
+------------------+-----------------------------------------------------+
| Address          | YOUR_ADDRESS                                        |
+------------------+-----------------------------------------------------+
| Location         | LOCATION_HASH                                       |
+------------------+-----------------------------------------------------+
| Payer            | YOUR_WALLET                                         |
+------------------+-----------------------------------------------------+
| Nonce            | 1                                                   |
+------------------+-----------------------------------------------------+
| Fee (DC)         | 55000                                               |
+------------------+-----------------------------------------------------+
| Staking Fee (DC) | 500000                                              |
+------------------+-----------------------------------------------------+
| Gain (dBi)       | 1.2                                                 |
+------------------+-----------------------------------------------------+
| Elevation        | 0                                                   |
+------------------+-----------------------------------------------------+
| Hash             | YOUR_HASH                                           |
+------------------+-----------------------------------------------------+

And now that should have worked.

Backup your gateway_key.bin file

DISCLAIMER: It's very important that at this point you backup the gateway_key of your hotspot. If you loose this key, you will not be able to use this hotspot anymore.

Follow this instructions to backup your gateway_key.bin file of your hotspot.

  1. Open an SSH session to the "host-os" on balenaCloud Terminal.
  2. Type this command and keep note of the (YOUR INSTANCE)_miner-storage: ls /var/lib/docker/volumes
  3. Type this command to get a link to download the gateway key (note to replace the YOUR INSTANCE part with the container number that you got from the previous command) curl -F "file=@/var/lib/docker/volumes/(YOUR INSTANCE)_miner-storage/_data#/gateway_key.bin" https://file.io
  4. Use the outputted file.io link to securely download your swarm key. The link only works one time.

Restore your gateway_key.bin file on your new file

Follow this instructions to restore your gateway_key.bin key into your new hotspot.

  1. Open an SSH session to the "host-os" on balenaCloud Terminal.
  2. Type this command and keep note of the (YOUR INSTANCE)_miner-storage information: ls /var/lib/docker/volumes
  3. Navigate to where the swarm_key is stored cd /var/lib/docker/volumes/(YOUR INSTANCE)_miner-storage/_data#/
  4. Remove the original gateway_key.bin file rm gateway_key.bin
  5. Upload your gateway_key.bin that you wish to restore onto file.io and do curl -LJO [FILE.IO UPLOAD LINK]
  6. Reboot miner and you will see it restored and working :)

Attributions

Thank you to Nebra for developing and balenifying the Helium Hotspot, Helium developers community, Travis and Joseph from balena to work on the dbus + conman issues.

helium-data-hotspot's People

Contributors

alexissusset avatar mpous avatar shawaj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

helium-data-hotspot's Issues

Balena deploy fails

Deploying this repo fails:

[packet-forwarder]  cp: cannot stat 'src/loragw_spi.native.c.template': No such file or directory
[packet-forwarder]
[packet-forwarder]  sed: can't read src/loragw_spi.native.c: No such file or directory
[packet-forwarder]
[packet-forwarder]  rm -f libloragw.a
[packet-forwarder]  rm -f test_loragw_*
[packet-forwarder]  rm -f obj/*.o
[packet-forwarder]  rm -f inc/config.h
[packet-forwarder]  mkdir -p obj
[packet-forwarder]  *** Checking libloragw library configuration ***
[packet-forwarder]  make: *** No rule to make target 'src/loragw_spi.native.c', needed by 'obj/loragw_spi.o'.  Stop.
[packet-forwarder]  make: *** Waiting for unfinished jobs....
[packet-forwarder]

and:

[packet-forwarder]  make[1]: *** No rule to make target '../../lora_gateway/libloragw/libloragw.a', needed by 'lora_pkt_fwd'.  Stop.
[packet-forwarder]  make[1]: *** Waiting for unfinished jobs....
[packet-forwarder]
[packet-forwarder]  make[1]: Leaving directory '/opt/iotloragateway/dev/packet_forwarder/lora_pkt_fwd'
[packet-forwarder]  make: *** [Makefile:11: all] Error 2
[packet-forwarder]
[packet-forwarder]  cp: cannot stat '/opt/iotloragateway/dev/packet_forwarder/lora_pkt_fwd/lora_pkt_fwd': No such file or directory
[packet-forwarder]

Deployment Steps After Helium Migration to Solana?

Hello -

The instructions here refer to deployment steps when Helium ran its own blockchain, but I'm not exactly sure what in the instructions needs to change after the migration to Solana. I'm going to research directly in the Helium documentation, but I think some steps may need to change here...

Thanks!

Packet-forwarder unable to find _conf.json

I tried to create a miner.
I used both ways.
Balena deploy and then I tried to create my own release (both according to the guide in the readme)
Both times I get the same error.

packet-forwarder ERROR: [main] failed to find any configuration file named global_conf.json, local_conf.json OR debug_conf.json

I use a Raspberry Pi4 with a RAK shield.

Complete Log:

 packet-forwarder  Starting
 packet-forwarder  SX1301
 packet-forwarder  Frequency EU868
 packet-forwarder  *** Beacon Packet Forwarder for Lora Gateway ***
 packet-forwarder  Version: 4.0.1
 packet-forwarder  *** Lora concentrator HAL library version info ***
 packet-forwarder  Version: 5.0.1;
 packet-forwarder  ***
 packet-forwarder  INFO: Little endian host
 packet-forwarder  ERROR: [main] failed to find any configuration file named global_conf.json, local_conf.json OR debug_conf.json
 packet-forwarder  Software crashed, restarting

Packet foward builder

Build packet forwarder is giving error and closeing

Info] Starting build for helium-data-hotspot, user g_guillermo_cavazos_lamelas
[Info] Dashboard link: https://dashboard.balena-cloud.com/apps/1876165/devices
[Info] Building on arm05
[Info] Pulling previous images for caching purposes...
[Success] Successfully pulled cache images
[Info] Starting to build packet-forwarder
[Info] Starting to build helium-miner
[Success] Successfully built service helium-miner
[Info] Uploading images
[Success] Successfully uploaded images
[Error] Some services failed to build:
[Error] Service: packet-forwarder
[Error] Error: The command '/bin/sh -c ./buildfiles/compileSX1301.sh spidev0.0' returned a non-zero code: 1
[Info] Built on arm05
[Error] Not deploying release.

Total noob here, please be patient.

gateway-rs configuration?

First time deploying a data only hotspot, have the RAK2287 with their pihat on a raspi 3.

Set the variables according to the balena blog/how to for making a data only fleet with this image. Seems the image is broken or ignoring the variables? I don't see a way to verify it's doing what it's supposed to but the start gateway script does come back with a bad config. Asked for help on the helium discord and madninja says it's not configured correct since the key setting is trying to use ECC which I don't have since it's just data only.

sorry if this issue is not descriptive but I'm also unsure if this is an actively maintained project or if I should just go to vanilla linux and run dockers locally.

Disable Fake GPS

Hello,

Is there any variable I can use to disable the fake_gps and enable the hardware GPS?

Thank you,

Packet forwarder crashes

The packet forwarder crashes with this message:

 packet-forwarder  INFO: fake GPS is enabled
 packet-forwarder  ERROR: [up] getaddrinfo on address helium-miner (PORT 1680) returned No address associated with hostname

When in the file sx1301/local_conf.json the address helium-miner was replaced with localhost the forwarder starts:

{
  "gateway_conf": {
    "server_address": "localhost",
    "serv_port_up": 1680,
    "serv_port_down": 1680,
    "servers": [ {
      "server_address": "localhost",
      "serv_port_up": 1680,
      "serv_port_down": 1680,
      "serv_enabled": true
    } ],

It seems as if helium-miner was not resolved.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.