Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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_HYBRID | 125KHz | 500KHz |
|---|---|---|
| defined value | channels | channel |
| 0 | 0 to 7 | 64 |
| 1 | 8 to 15 | 65 |
| 2 | 16 to 23 | 66 |
| 3 | 24 to 31 | 67 |
| 4 | 32 to 39 | 68 |
| 5 | 40 to 47 | 69 |
| 6 | 48 to 55 | 70 |
| 7 | 56 to 63 | 71 |
| undef | 0 to 63 | 64 to 71 |
Revision 2:edb5d1f3deeb, committed 2015-06-04
- Comitter:
- dudmuck
- Date:
- Thu Jun 04 20:00:55 2015 +0000
- Parent:
- 1:04fd63382b03
- Child:
- 3:d87012f45bf6
- Commit message:
- add full TX power for NA-mote
Changed in this revision
| TARGET_MOTE_L152RC/hal.cpp | Show annotated file Show diff for this revision Revisions of this file |
| radio.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/TARGET_MOTE_L152RC/hal.cpp Wed Jun 03 23:17:59 2015 +0000
+++ b/TARGET_MOTE_L152RC/hal.cpp Thu Jun 04 20:00:55 2015 +0000
@@ -300,7 +300,6 @@
void hal_opmode(u1_t mode, u1_t pa_boost)
{
if (mode == OPMODE_TX) { // start of transmission
- // assuming always using PA_BOOST
if (pa_boost) {
rfsw2 = 0;
rfsw1 = 1;
--- a/radio.cpp Wed Jun 03 23:17:59 2015 +0000
+++ b/radio.cpp Thu Jun 04 20:00:55 2015 +0000
@@ -10,6 +10,7 @@
*******************************************************************************/
#include "lmic.h"
+#include "debug.h" // wbr
// ----------------------------------------
// Registers Mapping
@@ -414,15 +415,25 @@
#elif defined(CFG_sx1272_radio)
// set PA config (2-17 dBm using PA_BOOST)
s1_t pw = (s1_t)LMIC.txpow;
- if(pw > 17) {
+ /*if(pw > 17) {
pw = 17;
} else if(pw < 2) {
pw = 2;
+ }*/
+ /* NA-mote TX power config: */
+ if (pw > 23) {
+ // use RFO with external amplifier
+ PaSelect = 0x00; // use RFO
+ writeReg(RegPaConfig, (u1_t)(PaSelect|(pw-25)));
+ } else {
+ // use PA_BOOST directo to antenna
+ PaSelect = 0x80; // use PA_BOOST
+ if (pw > 17)
+ pw = 17;
+ writeReg(RegPaConfig, (u1_t)(PaSelect|(pw-2)));
}
- PaSelect = 0x80; // use PA_BOOST
- //PaSelect = 0x00; // use RFO for external amplifier
- writeReg(RegPaConfig, (u1_t)(PaSelect|(pw-2)));
+
#else
#error Missing CFG_sx1272_radio/CFG_sx1276_radio
#endif /* CFG_sx1272_radio */
@@ -465,7 +476,7 @@
writeBuf(RegFifo, LMIC.frame, LMIC.dataLen);
// enable antenna switch for TX
- //hal_pin_rxtx(1);
+ //hal_pin_rxtx(1); usint hal_opmode
// now we actually start the transmission
opmode(OPMODE_TX);
@@ -505,7 +516,7 @@
writeBuf(RegFifo, LMIC.frame, LMIC.dataLen);
// enable antenna switch for TX
- //hal_pin_rxtx(1);
+ //hal_pin_rxtx(1); using hal_opmode
// now we actually start the transmission
opmode(OPMODE_TX);
@@ -567,7 +578,7 @@
writeReg(LORARegIrqFlagsMask, ~rxlorairqmask[rxmode]);
// enable antenna switch for RX
- //hal_pin_rxtx(0);
+ //hal_pin_rxtx(0); using hal_opmode
// now instruct the radio to receive
if (rxmode == RXMODE_SINGLE) { // single rx
@@ -622,7 +633,7 @@
writeReg(RegDioMapping1, MAP_DIO0_FSK_READY|MAP_DIO1_FSK_NOP|MAP_DIO2_FSK_TIMEOUT);
// enable antenna switch for RX
- //hal_pin_rxtx(0);
+ //hal_pin_rxtx(0); using hal_opmode
// now instruct the radio to receive
hal_waitUntil(LMIC.rxtime); // busy wait until exact rx time