This page helps you with embedded firmware development for the LoRa development board.

Preparing development environment

Sodaq Explorer is programmed with easy to use graphical Arduino IDE (Integrated Development Environment), using simplified C/C++ language. Download latest IDE software version from Arduino web-site. Windows, Linux and Mac OSX are supported. 

Off-the-shelf Arduino IDE does not know Sodaq boards, thus custom board descriptions needs to be added. This is easy and can be done via the IDE itself. Take a look at the Sodaq support page for detailed instructions After installing board description, choose SODAQ Explorer from Tools -> Board menu.

In order to upload compiled firmware into your board, simply connect the board to your computer with USB cable. Choose proper port from Tools -> Port menu, and click Upload button in the IDE. Blue LED is blinking at the board when firmware uploading process is ongoing.

Before proceeding to testing LoRa transmit, please verify your board's LoRa Hardware EUI, which is the unique identifier of the radio chip (equivalent to MAC address). 

Copy-paste the "Get HWEUI from RN module" source code from web site to your IDE editor. Compile and upload the code to the board.

If there is an error during compilation, replace #elif by #else in the source code. 

Once you have your program uploaded, open serial monitor from Tools -> Serial monitor menu. Default speed is 115200 bps. Now you should get message like the one below.

Get the hardware serial, sending "sys get hweui\r\n", expecting "xxxxxxxx", received: "

Please make sure your Hardware EUI (last string) match with the information given to you. If you see a miss-match, please contact your local organiser.


LoRa Transmit

Example source code for simple LoRa transmit is available at the Sodaq web site:

Following section of code must be changed according to unique LoRaWAN keys for Digita network, provided to participants.

const uint8_t devAddr[4] =
  0x00, 0x00, 0x00, 0x00

const uint8_t appSKey[16] =
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

const uint8_t nwkSKey[16] =
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

Changing parameters of LoRaWAN stack

The LoRaWAN library and documentation for Sodaq board is available in github:

Spreading factor / Transmit speed

Factors affecting the LoRaWAN performance are explained at Connectivity page: 

Spreading factor: LoraBee->setSpreadingFactor(9);

Above example assumes the Lora object is named "LoRaBee" as in the example source code.

Send some data

At the Sodaq support site, there is example code to send temperature measurements using the integrated temperature sensor: Send Temperature with LoRaWAN

By default the example uses OTAA mode. This needs to be changed to ABP by setting variable OTAA to false.

//Use OTAA, set to false to use ABP
bool OTAA = false;


Read more about LoRa modes from Connectivity support page.

In the example, data is send as ASCII string. This is OK for simple readings, but un-efficient way to transmit data. Binary representation is preferred, especially if more data needs to fit within the same datagram.

LoRa modem for PC / Raspberry Pi

The Sodaq board can serve as a LoRa modem for any PC / Laptop / Single-board-computer with USB port supporting serial communication. This is handy if your application requires more computation power than what Sodaq can support by itself: machine vision, image recognition, audio manipulation, etc. All your application software can run in PC / Raspberry.


There is readily available firmware 'LoRa Serial Passthrough' for the Sodaq, which does not require any embedded programming. Just copy-paste the example as is into Arduino development environment and flash the firmware to your board.

This firmware simply does echo all characters in between computer's USB serial port and the Microchip's RN2483 LoRa module onboard at Sodaq board. Serial commands of the RN2483 module are defined in datasheet:

Minimum set of commands for successful communication is described in this posting:

Any programming language and environment which supports serial port communication is good for the purpose. If you're running Node-RED locally in your PC, you may enjoy controlling the LoRa module directly from your Node-RED flow easily. In some Raspberry Pi Linux distributions like recent Raspbian, Node-RED comes pre-installed on the firmware image.

Here's a minimal Node-RED example how to communicate with Sodaq (copy and past to Node-RED Menu -> Import -> Clipboard). This example requires serial port support in Node-RED. In Raspberry that is included by default. In other platforms you may need to install node-red-node-serialport manually by using Menu -> Manage palette in Node-RED editor.

[{"id":"bf9c9d5a.b09a2","type":"serial out","z":"7e322121.ed1da","name":"SODAQ OUT","serial":"46b6abcf.31ac04","x":837.5,"y":187,"wires":[]},{"id":"a322dca1.c3149","type":"serial in","z":"7e322121.ed1da","name":"SODAQ IN","serial":"46b6abcf.31ac04","x":298.5,"y":550,"wires":[["c793b1f.cc58a5"]]},{"id":"c793b1f.cc58a5","type":"debug","z":"7e322121.ed1da","name":"SODAQ SAYS","active":true,"console":"false","complete":"payload","x":525.5,"y":550,"wires":[]},{"id":"a2c53ac4.f2cdb8","type":"inject","z":"7e322121.ed1da","name":"GET HWEUI","topic":"","payload":"sys get hweui","payloadType":"str","repeat":"","crontab":"","once":false,"x":505.5,"y":44,"wires":[["bf9c9d5a.b09a2"]]},{"id":"959518a5.576c48","type":"inject","z":"7e322121.ed1da","name":"Configure LoRaWAN","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":263.5,"y":107,"wires":[["c8e0460c.5f1ae8"]]},{"id":"79a739dc.8b1f48","type":"function","z":"7e322121.ed1da","name":"<DevAddr>","func":"msg.payload = \"mac set devaddr ABC12345\";\nreturn msg;","outputs":1,"noerr":0,"x":479.5,"y":163,"wires":[["bf9c9d5a.b09a2","3bc27147.ca6bbe"]]},{"id":"3bc27147.ca6bbe","type":"delay","z":"7e322121.ed1da","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":288.5,"y":224,"wires":[["70fb68ee.0c5e48"]]},{"id":"70fb68ee.0c5e48","type":"function","z":"7e322121.ed1da","name":"<NetSKey>","func":"msg.payload = \"mac set nwkskey ABC12345ABC12345ABC12345ABC12345\";\nreturn msg;","outputs":1,"noerr":0,"x":480,"y":224,"wires":[["bf9c9d5a.b09a2","c609d80e.c86f18"]]},{"id":"c609d80e.c86f18","type":"delay","z":"7e322121.ed1da","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":287,"y":288,"wires":[["856e447f.8586b8"]]},{"id":"856e447f.8586b8","type":"function","z":"7e322121.ed1da","name":"<AppSKey>","func":"msg.payload = \"mac set appskey ABC12345ABC12345ABC12345ABC12345\";\nreturn msg;","outputs":1,"noerr":0,"x":481,"y":288,"wires":[["bf9c9d5a.b09a2","83f936b6.73f888"]]},{"id":"f46bfa7e.e09228","type":"delay","z":"7e322121.ed1da","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":283,"y":430,"wires":[["e0f57b0a.7e6f38"]]},{"id":"e0f57b0a.7e6f38","type":"function","z":"7e322121.ed1da","name":"Save","func":"msg.payload = \"mac save\";","outputs":1,"noerr":0,"x":462,"y":429,"wires":[["bf9c9d5a.b09a2"]]},{"id":"63c572b4.8b1c8c","type":"inject","z":"7e322121.ed1da","name":"","topic":"","payload":"mac tx uncnf 1 123456","payloadType":"str","repeat":"","crontab":"","once":false,"x":483.5,"y":490,"wires":[["bf9c9d5a.b09a2"]]},{"id":"ad2ab8d1.b94ce8","type":"function","z":"7e322121.ed1da","name":"ABP mode","func":"msg.payload = \"mac join abp\";\nreturn msg;","outputs":1,"noerr":0,"x":475.5,"y":361,"wires":[["f46bfa7e.e09228","bf9c9d5a.b09a2"]]},{"id":"83f936b6.73f888","type":"delay","z":"7e322121.ed1da","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":289,"y":362,"wires":[["ad2ab8d1.b94ce8"]]},{"id":"c8e0460c.5f1ae8","type":"function","z":"7e322121.ed1da","name":"Reset","func":"msg.payload = \"sys reset\";\nreturn msg;","outputs":1,"noerr":0,"x":461.5,"y":105,"wires":[["a23c1a1e.ad3418","bf9c9d5a.b09a2"]]},{"id":"a23c1a1e.ad3418","type":"delay","z":"7e322121.ed1da","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":287,"y":162,"wires":[["79a739dc.8b1f48"]]},{"id":"46b6abcf.31ac04","type":"serial-port","z":"","serialport":"/dev/cu.usbmodem1411","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","newline":"\\r\\n","bin":"false","out":"char","addchar":true}]

Notice that serial port node needs to be configured according to your operation system's preferences. Also DevAddr, AppSKey and NetSKey needs to be changed according to credentials of your board.