LMIC transmit example for NAmote-72 with GPS

Dependencies:   lib_gps lib_mpl3115a2 lmic_MOTE_L152RC mbed

Deprecated and replaced with

Import programLoRaWAN-NAMote72-Application-Demo

Demonstration of Class-A LoRaWAN device using NAMote-72

LoRaWAN Network Configuration (in Config.h)

For Over the Air (OTA) activation of an End-Device, it must be configured with the following parameters:

  1. DEVEUI (8 Bytes) : Fist 3 Bytes is the Organizationally Unique Identifier (OUI) followed by 5 bytes of unique ID.
  2. APPEUI (8 Bytes)
  3. APPKey (or DEVKEY) (16 Bytes) The parameters can be entered as shown in the figure below /media/uploads/ubhat/nwkconfig.png

LoRaWAN Transmission Configuration (in Config.h)

  • Inter-Frame Delay : One can change the delay between each frame transmission using MS_DELAY_NEXT_TX It is advisable that MS_DELAY_NEXT_TX is greater than or equal to 3sec. /media/uploads/ubhat/txtiming.png
  • Payload Length : The lenght of the payload (in bytes) to be transmitted can be configured using PAYLOAD_LENGTH /media/uploads/ubhat/payload.png
  • Data Rate : The data rate can be configured as per LoRaWAN specification using the paramter FIXED_DR /media/uploads/ubhat/datarate.png
  • Channel Configuration : In the case where the End-Device is transmitting over frequencies corresponding to a block of 8 channels, the block can be specified using CHNL_HYBRID. The value 0 corresponds to Block A, 1 corresponds to Block B and so on. /media/uploads/ubhat/hybrid.png When the End-Device transmits over more than 50 channels, CHNL_HYBRID needs to be commented out /media/uploads/ubhat/frequencyhopping.png
  • Transmit Power : The power of the data to be transmitted can be configured using the parameter FIXED_TX_POWER. The maximum transmit power allowed is as per FCC regulation, depending upon the mode of transmission. /media/uploads/ubhat/txpower.png

Serial Terminal Display

By using a serial port connection using applications such as teraterm or putty, one can view the status of the End-Device. Once the End-Device Joins the network, transmission parameters such as payload data, transmit power, battery level etc. are displayed on the terminal.

/media/uploads/ubhat/teraterm.png

Default Application Payload

This application defaults to sending uplink data to logical port 5. The application payload consists of: /media/uploads/jknapp_smtc/payload.png

Sample Application Payload Calculation for Longitude/Latitude

Payload => 00 19 F6 352BBA A94C20 FFFF

Temperature Calculation

19H => 2510

Temp = 25/2 = 12.5 oC

Battery Level

FFH => 100 %

F6H => 96.5 %

Longitude Calculation

longitude = A94C20H => 1109507210

longitudinal coordinate = -360 + (longitude10 x 180/(223))

longitudinal coordinate = -121.93

Latitude Calculation

latitude = 352BBAH = 348460210

latitude coordinate = (latitude10 x 90/(223-1))

latitude coordinate = 37.39

config.h

Committer:
ubhat
Date:
2016-03-02
Revision:
8:26682f47bff1
Parent:
6:0b2b2d196ddd

File content as of revision 8:26682f47bff1:

// Organizationally Unique Identifier
#define OUI         0x00, 0x00, 0x00

/* DEVEUI = {[OUI] [5 bytes of Unique ID]}
if last 4 bytes of DEVEUI equals 0, then the firmware will assign a unique ID
*/
#define DEVEUI      OUI, 0x00, 0x00, 0x00, 0x00, 0x00

#define APPEUI      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
#define DEVKEY      0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF

// Time between transmissions in msec
#define MS_DELAY_NEXT_TX        3000

// Length of payload (Must be within the Maximum Length as defined in 7.2.6 of LoRaWAN 1.0 Specification
#define PAYLOAD_LENGTH          11  

/* DR_SF10 = 0, DR_SF9 = 1, DR_SF8 = 2, DR_SF7 = 3, DR_SF8C = 4  [as defined in Table 18 of Section 7 of LoRaWAN 1.0 Specification */
#define FIXED_DR                DR_SF10 

/* US 915MHz ISM Band */
#define CFG_us915

/* SX1272 chip */
#define CFG_sx1272_radio

// 0-7 to select block of 8 channels (Block A = 0, Block B = 1 ... Block H = 7). Comment this line to enable all 64 channels
#define CHNL_HYBRID     0       

// Set Tx Power in dBm (Max = 30dBm for frequency hopping over 50channels; 26dBm with Digital Modulation; 21dBm in Hybrid mode)
#define FIXED_TX_POWER  20