LMIC for MOTE_L152RC

Dependents:   lmic_transmit

LoRa WAN in C for NA-mote 72

Currently version 1.5


LoRaWAN network configuration for end-device

The following three pieces of information uniquely identifies end-device to network to allow over-the-air activation. These are stored in the end-device prior to join procedure.

AppEUI

Uniquely identifies application provider of end-device.

Least-significant byte first, 8 bytes. Use LMIC_reverse_memcpy() for AppEUI to keep same byte order as that on lora server.

example C code

static const u1_t APPEUI[8]  = { 0x01, 0x00, 0x01, 0x00, 0x00, 0x0C, 0x25, 0x00 };

This is copied into LMIC by os_getArtEui() callback function in application.

DevEUI

End-device ID, unique to each end-node.

Least-significant byte first, 8 bytes. Use LMIC_reverse_memcpy() for DevEUI to keep same byte order as that on lora server.

example C code

static const u1_t DEVEUI[8]  = { 0x00, 0x00, 0x00, 0x00, 0x01, 0x0C, 0x25, 0x00 }; 

This is copied into LMIC by os_getDevEui() callback function in application.

AppKey (aka DevKey)

128-bit (16byte) AES key.

example C code

static const u1_t DEVKEY[16] = { 0xe4, 0x72, 0x71, 0xc5, 0xf5, 0x30, 0xa9, 0x9f, 0xcf, 0xc4, 0x0e, 0xab, 0xea, 0xd7, 0x19, 0x42 };

This is copied into LMIC by os_getDevKey() callback function in application.

Using over-the air activation, the end-device (LMIC) performs a join procedure every time it starts for first time, or has lost session context information. When join procedure has successfully completed, the end-device will have a network session key (NwkSKey) and an application session key (AppSKey), which are used for encryption and message integrity check.


configuration with http://us01-iot.semtech.com/

  • log in to server
  • click on Applications
  • find your application and click it
  • go to configure motes
  • to create a mote, you may enter a new DevEUI
    • you may copy-paste the 16byte application key from an already existing mote, if you desire.

Information

DevEUI is entered in reverse order into C-code from that shown on server (unique device ID).

AppEUI is entered in reverse order into C-code from that shown on server.

AppEUI is equivalent to "Application"

transmit power limits

FCC Part 15 rules permit one watt of transmit power when more than 50 channels are used. When received by a 64-channel gateway, the maximum power may be used.

However, if end-device is sending to a 8-channel gateway (single SX1301), the maximum transmit power permitted is +20dBm.

To configure LMIC for use with 8-channel gateway, CHNL_HYBRID should be defined in in config.h, and should be undefined for use with 64-channel gateway.

CHNL_HYBRID125KHz500KHz
defined valuechannelschannel
00 to 764
18 to 1565
216 to 2366
324 to 3167
432 to 3968
540 to 4769
648 to 5570
756 to 6371
undef0 to 6364 to 71

History

correct DR4 channel used in 8ch mode. added JOIN_SINGLE_CHANNEL_BLOCK option for faster joining in 8ch mode. default tip

2015-12-04, by dudmuck [Fri, 04 Dec 2015 01:05:11 +0000] rev 10

correct DR4 channel used in 8ch mode. added JOIN_SINGLE_CHANNEL_BLOCK option for faster joining in 8ch mode.


correct join behavior after link dead (joining again)

2015-11-16, by dudmuck [Mon, 16 Nov 2015 23:52:45 +0000] rev 9

correct join behavior after link dead (joining again)


parse channel mask in join accept, tx power table, channel search in nextJoinState()

2015-10-21, by dudmuck [Wed, 21 Oct 2015 01:03:34 +0000] rev 8

parse channel mask in join accept, tx power table, channel search in nextJoinState()


CHNL_HYBRID defined with value 0 to 7 to select block of 8 channels to be used of the 64 available

2015-09-21, by dudmuck [Mon, 21 Sep 2015 17:59:42 +0000] rev 7

CHNL_HYBRID defined with value 0 to 7 to select block of 8 channels to be used of the 64 available


hal: change debug pin

2015-07-18, by dudmuck [Sat, 18 Jul 2015 00:18:44 +0000] rev 6

hal: change debug pin


add txpow_limit to limit transmit power

2015-07-17, by dudmuck [Fri, 17 Jul 2015 21:09:16 +0000] rev 5

add txpow_limit to limit transmit power


correct the value of MAP_DIO2_LORA_NOP

2015-07-07, by dudmuck [Tue, 07 Jul 2015 18:25:05 +0000] rev 4

correct the value of MAP_DIO2_LORA_NOP


added support in configPower() for PD2 power amplifier control

2015-06-18, by dudmuck [Thu, 18 Jun 2015 23:22:43 +0000] rev 3

added support in configPower() for PD2 power amplifier control


add full TX power for NA-mote

2015-06-04, by dudmuck [Thu, 04 Jun 2015 20:00:55 +0000] rev 2

add full TX power for NA-mote


fix hal_ticks()

2015-06-03, by dudmuck [Wed, 03 Jun 2015 23:17:59 +0000] rev 1

fix hal_ticks()