Ra-09H Series Development Board Beginner’s Guide
1. Introduction
This document explains how to create an application and node device in TTN, configure the Ai-Thinker Ra-09H module to connect to the TTN server, and implement data transmission and reception. Note: This tutorial applies only to areas covered by TTN gateways. Users in uncovered areas need to build their own gateway and connect it to the TTN server.
2. Preparations
Visit the TTN website and create/log into a personal account. In the Console, select a cluster to start adding end devices and gateways.
3. Create an Application
Go to Applications → Add Application, customize and fill in the Application ID and Application Name, then click Create Application to finish creating it.
4. Create a Device
Go to the application you just created and click Add End Device to start adding a node device. You can either manually input preset configurations or click Generate to automatically generate new keys. Click Register End Device to complete the creation.
Choose Manually to customize the creation. (The default method for adding devices is OTAA.) For OTAA (Over-The-Air Activation) mode, you need to save these three parameters: Device EUI, App EUI, and App Key. These will be used for future device connections. You can manually enter preset configurations or click Generate to auto-generate new keys. Click Register End Device to complete.
5. Device Information
Select the frequency band according to your region and device. Ensure that the device’s frequency band matches the sub-band options used by the gateway. For LoRaWAN version, select v1.0.3; for Regional Parameters, use RP001 Regional Parameters 1.0.3.
During the device creation process, you can configure the connection method to OTAA:
OTAA provides better security than ABP; however, because of the JoinAccept process during network entry, the OTAA connection is slightly slower than ABP.
6. AT Command Process in OTAA Mode
- Network Join & Uplink Data:
AT+APPEUI=00:00:00:00:00:00:00:00
AT+DEUI=70:B3:D5:7E:D0:05:F4:9D
AT+APPKEY=48:A2:75:2A:19:EE:8F:EC:07:50:31:6B:DC:8F:1A:A1
AT+NWKKEY=48:A2:75:2A:19:EE:8F:EC:07:50:31:6B:DC:8F:1A:A1
AT+MASK=0400
AT+JOIN=1
AT+SEND=2:0:1234
- Uplink Data:
AT+SEND=2:0:1122
41s468:TX on freq 868500000 Hz at DR 3
OK
41s644:MAC txDone
7. TTN Log Viewing
Live Data - Real-time Information
After executing the above AT commands, if the device connects to the gateway successfully, you will see the device connection logs and uplink data in the TTN console.
Click Messaging to manually send data to the device. Note: The device must upload data to receive the latest downlink data from the gateway.
Example of Downlink Data and Module Response:
634s966:RX_1 on freq 868100000 Hz at DR 5
635s019:MAC rxDone
635s019:RSSI -84, SNR 9
+EVT:1:05:3344455566
+EVT:RX_1, PORT 1, DR 5, RSSI -84, SNR 9
8、MQTT Client
Using an MQTT Client to retrieve data from the TTN server enables data receiving/downlink.The MQTT SERVER URL, port, and login information can be obtained from the TTN console.
Uplink Topic
v3/{application id}@{tenant id}/devices/{device id}/up
v3/{application id}@{tenant id}/devices/{device id}/up
Downlink Topic
v3/{application id}@{tenant id}/devices/{device id}/down/push
v3/{application id}@{tenant id}/devices/{device id}/down/push
Note: The payload of the subscribed data is in Base64 encoding format.
9. More Information
For more detailed tutorials on TTN integration interfaces (MQTT, Webhooks, Storage Integration, AWS IoT, Azure IoT Hub, LoRa Cloud), please refer to the TTN official integration development documentation.