• AVR Freaks

[FAQ]Basic Commands for ABP Join

Junior Member
  • Total Posts : 49
  • Reward points : 0
  • Joined: 2015/11/06 20:05:06
  • Location: 0
  • Status: offline
2016/08/27 05:27:18 (permalink)
5 (1)

Basic Commands for ABP Join

The example below shows the essential commands needed to join a LoRaWAN network using ABP join. Also some optional commands are shown. This process uses mainly 'mac' level commands, although a few 'sys' commands are used as well. The test mode 'radio' commands are not needed when using the LoRaWAN mac protocol.
Activation By Personalisation (ABP) join relies on exchanging three essential pieces of information between the end node and the network server. These are the device address (devaddr) used to identify packets in the network, the network session key (nwkskey) used for authentication, and the application session key (appskey) used for payload encryption. These can be generated either by the end node or the server, but must match at both ends.
With ABP join, there is no over-the-air communication during the join process (see alternative method OTAA). The devaddr and keys are just being set up in the mac layer of the end node ready for use. For this reason the 'accepted" response doesn't actually prove that the end-node is communicating with a network, it just means the parameters have been set up in the mac layer correctly.
In the RN2483 example below, > indicates a command to the modem and < indicates a response from the modem:
// OPTIONAL - resets the module firmware to default values
> sys reset                                          < RN2483 1.0.1 Dec 15 2015 09:38:09
// OPTIONAL - resets the module firmware to default values, plus clears the EEPROM
> sys factoryRESET                                   < RN2483 1.0.1 Dec 15 2015 09:38:09
// OPTIONAL - reads the IEEE EUI of the module.  Can be useful for node serialisation
> sys get hweui                                      < 0123456789ABCDEF
// MANDATORY - in this example the least-significant half of hweui is used
> mac set devaddr 89ABCDEF                           < ok
// MANDATORY - unique per device & must match server
> mac set nwkskey 0123456789ABCDEF0123456789ABCDEF   < ok
// MANDATORY - unique per device & must match server
> mac set appskey 0123456789ABCDEF0123456789ABCDEF   < ok 
// OPTIONAL - default value is 34. Some private networks use 12
> mac set sync 34                                    < ok
// OPTIONAL - default is off, but ADR is healthy for battery life & capacity if supported by the network
> mac set adr on                                     < ok
// OPTIONAL - saves all the settings to EEPROM for future use
> mac save                                           < ok
// MANDATORY - prepares the LoRaWAN mac with the personalised settings
> mac join abp                                       < ok
                                                     < accepted
// DEFAULT - transmit an unconfirmed packet on port 1. "Hello World!"
> mac tx uncnf 1 48656c6c6f20576f726c6421            < ok
                                                     < mac_tx_ok
// OPTIONAL - transmit a confirmed packet on port 1. "Hello World!"
> mac tx cnf 1 48656c6c6f20576f726c6421              < ok
                                                     < mac_tx_ok
                                                     < mac_rx 1 23                       
// NOTE - cnf or uncnf uplinks may receive a downlink packet from the server. E.g. 0x23 on port 1 
In this example ASCII text is being sent, but the payload can be any hexidecimal bytes
post edited by @JDP - 2016/09/09 03:37:38

4 Replies Related Threads

    New Member
    • Total Posts : 14
    • Reward points : 0
    • Joined: 2016/05/16 06:37:33
    • Location: 0
    • Status: offline
    Re: Basic Commands for ABP Join 2017/09/20 01:40:14 (permalink)
    I'm using DV164140-1 development kit. i have followed the steps described in reference document. So i'm able to send data to server.
    Then i tried above commands. Rn2483 module uplinking data to gateway. but module not receiving anything back from the server(down linking).
    How I can receive data from the server though gateway? 
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2007/03/12 02:59:04
    • Location: 0
    • Status: offline
    Re: Basic Commands for ABP Join 2017/09/22 00:12:35 (permalink)
    Bravo JDP for this article.
    Thank you for sharing
    New Member
    • Total Posts : 1
    • Reward points : 0
    • Joined: 2018/02/06 13:02:12
    • Location: 0
    • Status: offline
    Re: Basic Commands for ABP Join 2018/02/07 09:52:47 (permalink)
    Hello, that's not working for me. The differences are the firmware version and I'm using RN2903 instead RN2483. 
    Ps: I'm doing exactly the same configuration
    The screenshots about of TTN and RN2903 configuration are attached.
    Thank you.

    Attached Image(s)

    Super Member
    • Total Posts : 511
    • Reward points : 0
    • Joined: 2005/05/18 06:35:17
    • Status: offline
    Re: Basic Commands for ABP Join 2019/03/26 09:10:44 (permalink)
    Hi guys,
    I'm porting application designed for DigiCom Xbee modules (point to multi-point network) and I shame, but I can't understand LoRa....

    They only gived me couple of RN2483 modules.
    I can make point-to-point communication using simple LoRa protocol.
    1)  when sending data, is data send broadcast to all modules? (I suppose yes...)

    Target is point-to-multipoint network with only one central module and several end points.
    I save configuration parameters into file, so I suppose I need to work in APB mode.
    On JDP post I can see parameters for end point to connect to APB.
    How should I program central module to allow end point to connect?
    I'm very confused about examples I can find on web...

    nwskey and appskey are "unique per device and must match server"
    I don't understand. Isn't this mismatching?

    unique for device:
    end node A: nwskey = 0xFF appskey = 0xAA
    end node B: nwskey = 0xFA appskey = 0x07

    but "match server"?


    Jump to:
    © 2021 APG vNext Commercial Version 4.5