forked from mpous/helium-data-hotspot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbalena.yml
213 lines (140 loc) · 8.64 KB
/
balena.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: Helium Data Hotspot
type: sw.application
description: >-
Deploys the Helium Data Only Hotspot that doesn't mine any HNT
joinable: false
post-provisioning: |
## What is a data-only Helium Hotspot?
A Data-Only Helium Hotspot is a variation of Helium Hotspots that can participate on the Helium Network by transferring data from the end devices (LoRaWAN nodes).
They are eligible for Network Data Transfer Rewards but not Proof of Coverage Rewards.
If you only need to send/receive data through the Helium Network this is a good solution.
## Installation instructions
### Hardware and software needed
* Raspberry Pi 0/2/3/4 or [balenaFin](https://balena.io/fin)
* RAK 2287 SPI LoRa concentrator and RAK2287 Pi Hat
* SD card
* [balenaEtcher](https://balena.io/etcher/)
### Deploy the code
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 `Fork this fleet`.
This project is currently based on Nebra Light Hotspot. Once the Hotspot is online and the services `packet-forwarder` and `gatewayrs` are downloaded and installed.
### Configure Device Variables
Go to `Device Variables`.
* This project is compatible with all the Rapsberry Pi family running RAK2287 LoRa concentrator (SPI based) with a Pi Hat. In case you use something different change the `VARIANT` variable. If you have doubts check the [Nebra list of compatible hardware](https://github.com/NebraLtd/helium-hardware-definitions).
* By default the defined region is Europe (`EU868`). If you are not based in Europe change the variable `REGION_OVERRIDE` to `US915` or something different. Check different regions available [here](https://github.com/NebraLtd/hm-pktfwd).
### Test the Data Only Hotspot
At this point, go to Terminal and select the `gatewayrs` service.
Type `helium_gateway key info` and you will get a JSON like this below.
`{ "address": <hotspot address>, "name": <hotspot name> }`
With the `Hotspot Address` you will be able to join your data-only Helium Hotspot into the Helium Blockchain.
### Add your Data Only Hotspot to the Helium Blockchain
To join the Helium blockchain, at the moment (summer 2021) you only can use the [Helium CLI](https://docs.helium.com/wallets/cli-wallet/).
The Helium app is still not compatible with the data-only hotspots.
It's time to install the [Helium CLI](https://docs.helium.com/wallets/cli-wallet/) 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 Terminal
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.
#### Add the hotspot from the Helium wallet using CLI
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).
#### Assert the location of the Hotspot
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
***This is important!*** At this point, remember to back-up your `gateway_key.bin` key.
* Open an SSH session to the "host-os" on balenaCloud Terminal.
* Type this command and keep note of the `(YOUR INSTANCE)_miner-storage`: `ls /var/lib/docker/volumes`
* 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`
* Use the outputted file.io link to securely download your swarm key. The link only works one time.
## Usage instructions
Once the Hotspot is registered into the Helium Network. You can check the status in the Helium Explorer using this URL
`https://explorer.helium.com/hotspots/<hotspot address>`
Change `<hotspot address>` by your hotspot address generated on the Terminal at balenaCloud.
On the other hand, to test that it receives packages properly. Create an account at the [Helium Console](https://console.helium.com/), connect a LoRa device and see how your device starts relaying data through the LoRaWAN Helium network.
## Contributions are open
Feel free to contribute into the repo [here](https://github.com/mpous/helium-data-hotspot).
assets:
repository:
type: blob.asset
data:
url: 'https://github.com/mpous/helium-data-hotspot'
logo:
type: blob.asset
data:
url: >-
https://raw.githubusercontent.com/mpous/helium-data-hotspot/main/logo.png
data:
applicationEnvironmentVariables:
- VARIANT: DIY-RAK2287
- REGION_OVERRIDE: EU868
- MINER_UPDATE: true
defaultDeviceType: raspberrypi4-64
supportedDeviceTypes:
- raspberrypi4-64
- raspberrypi3-64
- raspberrypi3
- fincm3
- raspberry-pi2
- raspberry-pi