Node SDK

更新时间:
复制 MD 格式

The Node SDK is a LoRaWAN node software development kit (SDK) that Alibaba Cloud Link WAN provides for module vendors. This SDK is an enhanced version of the open-source node code from Semtech and includes bug fixes, new features, reference implementations, and application instances. The SDK complies with the Link WAN access specifications and helps module vendors shorten development cycles, expand use cases, and become more competitive.

Download the code

To obtain the Link WAN Node SDK, log on to the official Alibaba Cloud website with your Alibaba Cloud account and submit a ticket.

Configure the environment

  • CMake 3.6 or later

  • GNU ARM-Toolchain

  • (Optional) Visual Studio Code

  • SEGGER-JLink (flashing tool)

Note

For more information about installation and configuration, refer to the setup instructions in the document.

Modify the compile configuration

  • Open ./LoRaMac-node/buildconfig.sh and configure the development board model and toolchain path.

  • Modify the node trituple, multicast address, and key in ./LoRaMac-node/src/LoRaModuleSDK/Commissioning.h.

Note

To obtain the node trituple:

  1. Log on to the Alibaba Cloud Link WAN console.

  2. In the left navigation pane, click Key Management.

  3. On the Key Management page, you can purchase a Professional Edition or Standard Edition key.

Compile the SDK

cd ./LoRaMac-node
sh build.sh            

Compilation results:

./build/src/apps/LoRaMac/SdkExample-LoRaWanModule.hex

Verify the SDK

Download the .hex file to the development board. This example uses the ST NucleoL476 board, which is the default. To flash the board, run the following JLink command: JLinkExe->loadfile build/src/apps/LoRaMac/SdkExample-LoRaWanModule.hex.

Open the serial port debugging tool. Restart the board to run the program. The output is as follows:

**********************************************
====== LinkWAN LoRa Node SDK Example    =====
====== LoRaWAN 1.0.3 Specification,CN470 =====
*********************************************

This is a debug version. Input AT commands to start.

=======================================================
****Set device info:     e.g., AT+CDEVEUI=devEui, AT+CAPPEUI=joinEUI, AT+CAPPKEY=appKey 
****Start OTAA join: e.g., AT+CJOIN=1,1
****Send data:       e.g., AT+DTX=10,0123456789 
****Switch class:    e.g., AT+CCLASS=2 (Class C) 
****Switch class:    e.g., AT+CCLASS=1,0,2 (Class B) 
****Enter repeater mode: e.g., AT+CJOINMODE=1 
****Send confirmed uplinks periodically (20s): e.g., AT+CCONFIRM=1, AT+CRM=1,20 
****For more information about AT commands, see the <ICA AT Cmd Spec>. 
=======================================================           

Debug

The following example shows how to debug the ST NucleoL476 development board using JLink and GDB:

Start JLinkGDBServer.

JLinkGDBServer -device STM32L476RGTx -if swd -speed 4000           

Start the GDB client to begin debugging.

arm-none-eabi-gdb SdkExample-classB -ex "target remote localhost:2331"           

Technical architecture diagram

SDK description

For a description of the SDK, see the SDK user manual, which is available at ./LoRaNodeSDK/Doc/NodeSDK_Manual_vX.X.X.pdf.

For node access requirements, see the access specification document, which is available at ./LoRaNodeSDK/Doc/Alibaba Cloud Link WAN Node Access Specification vX.X.X.pdf.

Hardware support

Development boards that can run the LoRaWAN protocol stack are supported by default. For example:

  • NucleoL073

  • NucleoL152

  • NucleoL476 (default)

  • SAML21

  • SKiM880B

  • SKiM980A

  • SKiM881AXL

Releases

  • v2.0.4 includes the following features and services:

    • Added support for the RAK811 node development board.

    • AT commands: Added usage instruction printouts and optimized the AT+CDEVADDR feature.

  • v2.0.3 includes the following features and services:

    • Provided a reference implementation for full-band scanning as specified in the Link WAN Node Access Specification.

    • Provided a reference implementation for the enhanced version of the ICA Consortium Standard - AT Command Set Specification for LoRa 1.0.

    • Added support for relay mode for Link WAN Class A nodes.

    • Added support for the Listen Before Talk (LBT) feature.

    • Added support for node protocol detection.

    • Added support for Activation by Personalization (ABP) mode.

  • v2.0.2 includes the following features and services:

    • Added an authentication mode feature.

    • Provided more convenient APIs for the application layer.

    • Added an implementation of the consortium's application layer multicast feature.

    • Added connection policies for LoRa modules, such as network join backoff, Class B switching, and time synchronization policies.

    • Fixed bugs in the original Class A, Class B, and Class C implementations.

    • Further enhanced the robustness, reliability, and stability of the existing LoRaWAN node protocol stack. For more information, see the following documents: