Connect “ESP32 + LoRa” to LoRaWAN Server

[简体中文]

Preparation

  1. A ESP32 + LoRa node that’s configured and uploaded code, as described in the previous topic:: “ESP32 + LoRa” Node Preparation & Config Parameters

  2. A LoRa server, We recommend the following three:

  3. A Gateway that matches the LoRaWAN region of the node, and already is connected to the lora server. If you are using Heltec Gateway, you can find out how to connect to the server in the Heltec Gateway documentation


Important to know

Tip

Regardless of which LoRaWAN NS, the parameters that need to be configured are similar. Ensuring that the relevant configurations of NS and Node are consistent is the key to ensuring successful LoRaWAN communication.

Device Type

Generally, you will be asked to select a LoRa Gateway or LoRa Node.

LoRaWAN Class

OTAA or ABP, choose one of the while working, keep LoRa Node and NS select the same LoRaWAN Class.

For development devices with source code, you may see something like this:

Region

LoRaWAN protocol agreement RF communication parameters. For technical details, please refer to LoRaWAN™ 1.0.2 Regional Parameters, also the LoRaWAN Frequency Plans and LoRaWAN Frequency Plans and Regulations by Country/Region can make sense to you.

The region setting of LoRa Node, LoRa Gateway, LoRaWAN NS should be strictly the same.

For development devices with source code, you may see something like this:

OTAA Parameter

For OTAA LoRaWAN Class, mainly includeDevEUI, AppEUI (Also called JoinEUI), AppKey, the LoRa Node and NS should strictly keep the same.

Note

If you select ABP, you do not need to set OTAA parameters.

ABP Parameter

For ABP LoRaWAN Class, mainly include NetworkSecuritykey, ApplicationSecuritykey, DeviceAddress, the LoRa Node and NS should strictly keep the same.

For development devices with source code, you may see something like this:

Note

If you select ABP, you do not need to set OTAA parameters.

Connect to LoRaWAN Server

Before that, make sure there is a LoRa Gateway active in your server.


Connect to TTN/TTS

  1. Log in to the TTS server web page, register a new “Applications” .

  2. Create application

  1. You can freely fill in the Application information in the red box, and click Creat application when you’re done.

  2. Register an end device.

  3. Choose Enter end device specifics manually, Select the frequency band corresponding to the node,

  4. The LoRaWAN version is chosen to be 1.0.2 B

    The Show advanced activation, LoRaWAN class and cluster settings option has some other LoRaWAN parameter Settings such as OTAA/ABP.CLASS A/C, these parameters default to OTAA and CLASS A, in general need to be consistent with the node Settings.

  5. Fill in JoinEUI and click confirm.

    Tip

    In code or some application products, JoinEUI is represented as AppEUI.

  6. Fill in DevEUI and AppKey.

    Tip

    The End device ID is automatically generated when you fill in DevEUI.

  7. Click to register.

After registration is complete, if all is well, you will see the device active.


Connect to ChirpStack

Register a new device in ChirpStack’s “Applications” page. Enter the device name, description, DevEUI. Select Device-profile.

Enter the Application key of the device.

After registration is complete, if all is well, you will see the device active.


Manual registration on SnapEmu

Log-in to SnapEmu by using their Heltec website account. Access into the devices page to register new device.

Click + and file in relevant device information.

In the Add device step, file in the LoRa Node parameters and double check to make sure the content are the same with each other. If everything goes well, LoRa Node is successfully registered after Submit.

Important Hints

Please double check the following two things:

  1. The LoRaWAN parameters is the same as server!

  2. The listening frequency of your LoRa Gateway is the same as ESP32 LoRa node’s sending frequency. We strictly follow LoRaWAN™ 1.0.2 Regional Parameters rB;