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

Committer:
ubhat
Date:
Wed Mar 02 08:11:33 2016 +0000
Revision:
8:26682f47bff1
Parent:
6:0b2b2d196ddd
Restructure Main.cpp & config.h

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ubhat 8:26682f47bff1 1 // Organizationally Unique Identifier
ubhat 8:26682f47bff1 2 #define OUI 0x00, 0x00, 0x00
ubhat 8:26682f47bff1 3
ubhat 8:26682f47bff1 4 /* DEVEUI = {[OUI] [5 bytes of Unique ID]}
ubhat 8:26682f47bff1 5 if last 4 bytes of DEVEUI equals 0, then the firmware will assign a unique ID
ubhat 8:26682f47bff1 6 */
ubhat 8:26682f47bff1 7 #define DEVEUI OUI, 0x00, 0x00, 0x00, 0x00, 0x00
ubhat 8:26682f47bff1 8
ubhat 8:26682f47bff1 9 #define APPEUI 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
ubhat 8:26682f47bff1 10 #define DEVKEY 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
ubhat 8:26682f47bff1 11
ubhat 8:26682f47bff1 12 // Time between transmissions in msec
ubhat 8:26682f47bff1 13 #define MS_DELAY_NEXT_TX 3000
ubhat 8:26682f47bff1 14
ubhat 8:26682f47bff1 15 // Length of payload (Must be within the Maximum Length as defined in 7.2.6 of LoRaWAN 1.0 Specification
ubhat 8:26682f47bff1 16 #define PAYLOAD_LENGTH 11
ubhat 8:26682f47bff1 17
ubhat 8:26682f47bff1 18 /* 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 */
ubhat 8:26682f47bff1 19 #define FIXED_DR DR_SF10
ubhat 8:26682f47bff1 20
ubhat 8:26682f47bff1 21 /* US 915MHz ISM Band */
dudmuck 0:a5e3347bad61 22 #define CFG_us915
dudmuck 0:a5e3347bad61 23
ubhat 8:26682f47bff1 24 /* SX1272 chip */
dudmuck 3:d81e4a63fb2e 25 #define CFG_sx1272_radio
dudmuck 3:d81e4a63fb2e 26
ubhat 8:26682f47bff1 27 // 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
ubhat 8:26682f47bff1 28 #define CHNL_HYBRID 0
ubhat 8:26682f47bff1 29
ubhat 8:26682f47bff1 30 // Set Tx Power in dBm (Max = 30dBm for frequency hopping over 50channels; 26dBm with Digital Modulation; 21dBm in Hybrid mode)
ubhat 8:26682f47bff1 31 #define FIXED_TX_POWER 20