# Part 3: LoRaWAN on Helium ###### tags: `TA Stuff ESP32` `PyCom` `Heltec` `ESP32` ## Step 0: Add your device to Helium We need to have a Helium account: create one [here](https://console.helium.com/). To add a device we first need to go to the Devices tab—found on the left side of the website. Then follow these steps: #### Step 0.1 Add device Press the botton that looks like this: ![](https://i.imgur.com/1SAbpCB.png) Shoud say "Add new device" #### Step 0.2 Create device Here Helium will genearte the Dev EUI, App EUI and the App Key that will be used in the next step. Next press "Save Device" and move on to Step 1 ![](https://i.imgur.com/z5udGH8.png) ## Step 1: Add the DevEUI --- Now, you connect to Helium using the `AppKey` you generated earlier. :::danger **⚠️ Important ⚠️ Make sure the LoRa antenna is connected properly before running any LoRa code on your device. Not doing so might break your device.** You can find how to properly connect the antenna in the TTN tutorial [here](https://hackmd.io/@lnu-iot/HJUu_sIO9). Only look at "Connect the antenna" ::: First, add the snippet below at the begining of your `boot.py` that you have in your project folder in Atom or VSCode. ```python= from network import LoRa import time import binascii lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.EU868) dev_eui = binascii.unhexlify('0000000000000000') app_eui = binascii.unhexlify('0000000000000000') app_key = binascii.unhexlify('00000000000000000000000000000000') lora.join(activation=LoRa.OTAA, auth=(dev_eui, app_eui, app_key), timeout=0) # wait until the module has joined the network while not lora.has_joined(): time.sleep(2.5) print('Not joined yet...') print('Network joined!') # Your old code from main.py should be here ``` :::info Remove duplicate imports if you have any after adding the snippet above. ::: Now, replace the zeros in row 8 with your `AppKey`, & `DevEUI`. In our case, the generated `AppKey` was `D160B88547A8F383E1E2B1848FD7F8CB`, & the generated `DevEUI` was `6081F987B338CD02`. Note that only row 7, & 9 is changed. ```python= from network import LoRa import time import binascii lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.EU868) dev_eui = binascii.unhexlify('6081F987B338CD02')# Add your own dev_eui here app_eui = binascii.unhexlify('0000000000000000') app_key = binascii.unhexlify('D160B88547A8F383E1E2B1848FD7F8CB')# Add your own app_key here lora.join(activation=LoRa.OTAA, auth=(dev_eui, app_eui, app_key), timeout=0) # wait until the module has joined the network while not lora.has_joined(): time.sleep(2.5) print('Not joined yet...') print('Network joined!') # Your old code from main.py should be here ``` ::: warning ❗Note: It can take a while to connect to Helium the first time—about 20 mins. ::: Try to run `boot.py` and now in the console, you should see something like: ![](https://i.imgur.com/mvCfxwu.png) Congratulations, you have now successfully connected to Helium and are ready to start sending messages!