Skip to content

kscharan/helium-dyi-hotspot-balena-pi4

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build your own helium hotspot ( miner + packet forwader ) on Raspberry pi 4 using BalenaOS

IMG_3112 IMG_3115

Hardwares you need

  • Raspberry Pi 4 link
  • USBC power adapter link
  • 64GB Micro SD card link
  • RAK2245 Pi HAT link While purchasing please check frequency of your country.

Sowftwares you need

  • Free Balena Cloud account link
  • Mac or Windows ( I tested on Windows10 )
  • BalenaEtcher to flash image download
  • Balena CLI install
  • jq install

Let's get started

As you got your hardwares and softwares let's get started and turn your Pi into a helium hotspot

Step 1: Prepare image with balenaOS

Log into balena cloud website and click on "Create Application" button

Screen Shot 2020-07-22 at 11 06 14 AM

This wil bring a modal window as below. Type a name as you desire, choose device type as "Raspberry Pi 4" , application type as "Starter" and hit "Create new application" button.

Screen Shot 2020-07-22 at 11 09 00 AM

Once the application is created, it will take you to the application page. You need to add a device now. Screen Shot 2020-07-22 at 11 12 22 AM

Click on "Add device" button which will open below modal. Screen Shot 2020-07-22 at 11 14 44 AM Turn on "Wifi+Ethernet" and put your wifi credential there. After that click on "Download BalenaOS" button which will download a zip file on your comuter. Next, click on Environment variable menu from left pane and create a new variable as "REGION" with value "US915" (you may need to change as per your region. This repo supports US915 and EU868. Please create PR if with your region) Screen Shot 2020-07-22 at 11 19 30 AM

Step 2: Flash image on SD card

Plug micro SD card into your computer. Open balenaEtcher software, select the downloaded zip file from your computer and select the SD card to format and click on "Flash"

Screen Shot 2020-07-22 at 11 26 22 AM

Once completed, unplug SD card from your computer and insert in your Raspberry Pi and power up your Pi. In about 20-30 seconds your device should appear on balena cloud application as below.

Screen Shot 2020-07-22 at 11 34 12 AM

Very exciting so far! Isn't is?

Deploy with Balena Button

  • Now if you want to deploy the Helium Hotspot for IN865 region you can simply do it by clicking on the button below.

  • But if you want to deploy it for any other region move to the next step.
Step 3: Deploy helium miner and gateway to balena

Now the fun begins. Stack your RAK2245 HAT on your Pi. From balena cloud , generate a session token ( Preferences -> Access Tokens )

Next, clone this repo somewhere on your computer

git clone https://github.com/just4give/helium-dyi-hotspot-balena-pi4  && cd helium-dyi-hotspot-balena-pi4

Next log into balena cli

balena login

Choose "Web Authorization" from the list.You will be redirected to a webpage . Press authorize. You can close the window and come back to the console. You should receive successful login message there.

Screen Shot 2020-07-22 at 11 45 08 AM

Next, issue below commands one by one

chmod +x build.sh
sh build.sh
balena push helium_diy_hotspot_pi4

Please note - the command is balena push <application_name>. If you have used different name in step 1, then use that.

If everything goes fine, you will see a nice unicorn :)

Screen Shot 2020-07-22 at 11 54 55 AM

And in few minutes, both gateway and miner will be distrubuted to your device. You should see some logs like. Now if you have a LoRa node, test it out.

22.07.20 12:05:36 (-0400)  gateway  INFO: [up] PUSH_ACK received in 0 ms
22.07.20 12:05:40 (-0400)  gateway  INFO: [down] PULL_ACK received in 0 ms

Screen Shot 2020-07-22 at 12 04 04 PM

Troubleshooting

  • If you are not on Mac, you may see some issue running build.sh file. If so , remove '' from sed command.
  • If you are on Windows and are unable to build the run the bash script 'build.sh':
    • First check the sed version using the command sed --version
    • If GNU sed version 3.02 is the version installed it wont support the -i option for sed, so update to the latest version of sed and try running it.
    • Or replace the contents of the 'build.sh' file with the following one:
    
    cp docker-compose-template.yml docker-compose.yml 
    export MINER_TAG=$(curl -s 'https://quay.io/api/v1/repository/team-helium/miner/tag/?limit=100&page=1&onlyActiveTags=true' | jq -c '[ .tags[] | select( .namecontains("arm")) ][0].name' | cut -d'"' -f2)
    sed.exe s/MINER_TAG/$MINER_TAG/g docker-compose.yml > docker-temp.yml
    cp docker-temp.yml docker-compose.yml
    

Special Thanks

I like to thank Marc from Balena and PastaGringo. They are the creators of the multi conatiner docker images which I reused.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 98.3%
  • Other 1.7%