0 LoRaWAN: Device setup on TTN
HeadBoffin edytuje tę stronę 2024-02-28 21:33:28 +00:00

On the right hand side about half way down on your application's summary is a big blue button + Register end device. Click this to create the settings for your first device.

As you are making your own device using a third party LoRaWAN stack there will not be an entry in the main repository so choose 'Enter end device specifics manually'.

Choose the Frequency plan appropriate for your region. Consider that almost all countries have laws relating to what frequencies you use so don't get creative. For Europe please use the recommended option. For other regions use the entry marked 'used by TTN'.

Choose LoRaWAN 1.1.0 - the last one in the list - the latest specfication. RadioLib uses Regional Parameters 1.1 revision 1.1.

At this point you will be asked for your JoinEUI. As this is a DIY device and we are using RadioLib, you can use all zero's as recommended by The LoRa Alliance TR007 Technical Recommendations document. Once you've put in all zeros and clicked confirm you will be asked for a DevEUI, AppKey and NwkKey. It is preferable to generate them so they are properly formatted.

Your End device ID can be changed to make the device more identifiable. Something related to your hardware helps - like devicename-01. The you can click the blue 'Register device'.

A normal device is registered, batteries put in, it joins and gets on with sending data for the next few years. For development purposes we need to turn off one of the security settings so that you can join & uplink out of the normal sequence that a device in the field would do.

Click on General Settings, scroll down to Join settings, click the Expand button, scroll down and click the Resets join nonces option. You will see a warning about replay attacks which is entirely proper & correct. If anyone evesdropping in your area on your LoRa transmissions could fake a join and send uplinks from their device if they happened to find out your AppKey & NwkKey which is kept securely on the TTN servers and is never transmitted over the air, so they'd also have to login to your account, which is protected by your password.

You then need to copy over the device details in to the config file for RadioLib. There are buttons to copy items to the clipboard so you don't have to hand type them.

Copy & Paste made easy

You can copy the EUIs & keys from the device overview section.

The EUIs are really straightforward - click the clipboard icon at the right hand end of the EUI display field and it will be copied in the format you need. You can then paste it in to the code - you must leave the 0x in place so the compiler knows that it's a hex value.

The keys are relatively straightforward. Click the eye icon at the right hand end of the field. Then click the <> icon that will appear to the left. This will format the hex values as an array. Then you can click the clipboard icon to copy the array and then paste it between the { } brackets.