Transmit Data from Sensor Node to TTN Server

The below steps are useful to follow to transmit data from the sensor node to the TTN server.
  1. 1.Disconnect the Mini-USB cable from the XMEGA-A3BUXplained board, which is used to connect to the PC.
  2. 2.Insert two AAA batteries in the battery holder of the RN2483 LoRa technology mote board and turn switch S1 ON to power the board. Hereafter, the sensor node works in sensor node mode.
  3. 3.The initial message that gets displayed on the LCD of XMEGA-A3BUXplained board is XMEGA LoRa, Sensor Node Demo, V 1.0.3 Code.
  4. 4.Then after, it waits for the user inputs to choose the appropriate joining method for the sensor node to join the LoRa network.
  5. 5.Press button SW0 on XMEGA-A3BU Xplained to select the Activation By Personalization (ABP) method of joining the LoRa network.
    Note: Press button SW1 to select OTAA method of joining.
  6. 6.After the sensor node has successfully joined the network, the ABP join successful message gets displayed on the LCD screen.
  7. 7.Use switches SW0 and SW1 to navigate between the different states of the sensor node.
  8. 8.If there isn’t any button press activity for 15 seconds, the sensor node goes into sleep mode.
  9. 9.The sensor node periodically wakes up from the sleep mode to scan the light and temperature sensors and transmit the data to TTN server. The periodicity is a user-configurable parameter. By default, the periodic data transmission interval is set to one minute. The periodicity can be configured as 5 minutes, 10 minutes, 15 minutes, 30 minutes, or 60 minutes.

Table 1 shows the different states supported by the sensor node mode in demo application firmware.

Table 1. The Different States Supported by Sensor Node Mode
State Description
Issue up-link message Transmit light and temperature sensors data to the TTN server either as unconfirmed or confirmed messages. For the confirmed messages, the TTN server responds with an acknowledgment after each message reception.
View down-link message View last received down-link data along with down-link message if present
Sensor data display View light and temperature sensor data, which is updated every 1 second
Menu timeout Enable or disable menu timeout of 15 sec. If disabled, the LoRa sensor node will not go into sleep mode.
Periodic up-link timing configuration Configure periodic up-link message timing for sensor data to the TTN server. The time interval can be 1, 5, 10, 15, 30, or 60 minutes
Select data rate The data rate can be configured as 0, 1, 2, 3, 4, 5, or ADR