1. References

2. jFed and Fed4FIRE+ account

Email This email address is being protected from spambots. You need JavaScript enabled to view it. to register for a jfed account (also on this URL: You can use your student account at your institute, or alternatively request to join the "pervasivenation" project when registering

3. Download jFed Framework

Download jFed client software to run the RSPEC file in the next section 

4. Rspec for Seeeduino LoRAWAN Board at Iris - Support for Pervasive Nation

Load the following rspec, with connected Seeeduino LoRaWAN Board  with  ubuntu 20.04 image.

<?xml version='1.0'?>
<rspec xmlns="" type="request" generated_by="jFed RSpec Editor" generated="2021-12-21T10:53:13.983Z" xmlns:emulab="" xmlns:delay="" xmlns:jfed-command="" xmlns:client="" xmlns:jfed-ssh-keys="" xmlns:jfed="" xmlns:sharedvlan="" xmlns:xsi="" xsi:schemaLocation=" ">
  <node client_id="Seeeduino_node" exclusive="false" component_manager_id="">
    <sliver_type name="vm">
      <disk_image name=""/>
      <flavor_type xmlns="" name="seeeduino-iot"/>
    <location xmlns="" x="353.0" y="208.0"/>


5. Jfed

Make sure that Seeeduino board is connected to the VM at Iris, by running the following command. dmesg | grep Seeed - and if the board is there you should see the following information. 

iristest@seeeduino-node:~$ dmesg | grep Seeed
[    3.171580] usb 1-1.5: Product: Seeeduino LoRaWAN
[    3.174509] usb 1-1.5: Manufacturer: Seeed Studio


6. Download the PN TheThingsNetwork GitHub code 

Clone the pervasive nation Seeeduino code or copy the contents of the file:

git clone

 Start arduino if not already started


Open the pn_seeed.ino file 

Compile the file - using the "Verify" button


Use the "Upload" button to push the code to the board. 


Note, you can see debug information from the Serial Monitor


7. Install the Seeduino board

Open your Arudino IDE, click on File > Preferences, and copy below url to Additional Boards Manager URLs:

8. Install a board manager

Click on Toos > Board > Board Manager.

Now you can search the board by name "Seeduino" and install Seed SAMD Boards


9. Set a board

After Step 3 was successful, a board named SeeeduinoLoraWan will show up at the boards list. Select it.

Click on Tools > BoardSeeeduinoLoraWan > Seeed SAMD (32-Bits ARM cortex - MO+ and Cortex-M4) Boards > Seeeduino LoRaWAN is available now. You may need to click this to activate it.



When the LoRaWAN Seeeduino USB device is attached to the machine, its visible in the following screenshot. You can now load code to the board to support LoRaWAN seeeduino communication. 


11. Add your user to the dialout group and grant permission on the Seeduino board.

sudo usermod -a -G dialout $USER

sudo chmod a+rw /dev/ttyACM0
Log out and back in again after running these commands.

10. Load the PN LoRaWAN Code, and execute to test it. 

Download the PN LoRaWAN Code from GitHub, and use the "Upload" button to upload the code to the Seeeduino board. 


Enable debug and view the console output.


11. Create an Account on TheThings Stack

Create a user account on the Pervasive Nation Things Network. Use the following link:

12. Add a device to your LoRaWAN Account

You need to add the device code specified in the pn_seeed code. For example, you need to add the following information to your Create a device ID, in the things board GUI.

    //lora.setId (DevAddr, DevEUI, AppEUI)
    lora.setId("DA006039", "00DBBF7C763121C4", "2a7d151628bea2a6ace7158809de4f3b");

Note, you should change this information. The Things Network might force you to change this information anyway.

The DevEUI must be unique so you should change this for each device you will add.

Its possible to generate the DevEUI and AppKey at The Things Network, so you copy from there to your pn_seed code.

 Add End Device.


Register End Device. 


Manually Enter The DevEUI, AppEUI, AppKey etc.


Activation mode is Over The Air Activation (OTAA)

MAC Version is V1.0.3

PHY Version is V1.0.3 REV A

Additional information is available on this link


13. Load the PN LoRaWAN Code, and execute to join the sensor on the Network Server.

We observe the data stream from the gateway and wait for the join request message from the sensor and from the join accept message from the Server. Then we will start receiving uplink messages with the payload which is the data. See in the videos below the process of running the pn_seed code and joining the Seeduino at The Things Stack.


Running Seeduino and seeing transmissions on the gateway:


Getting join request message from the device and join accept message from the server. Then getting the first uplink message:


14. Viewing Data on the Network Server.

 It's possible for the experimenter to view the data transmitted in the TTN console. Within the TTN console, select Live Data



   "received_at": "2021-10-19T12:48:32.950030130Z",
    "uplink_message": {
      "f_port": 2,
      "f_cnt": 4153,
      "frm_payload": "AQpKE18nDw==",
      "decoded_payload": {
        "bytes": [



Troubleshooting / Debugging

a. Install Arduino IDE [Note these steps should already have been run on the base Seeeduino image

- Skip to Step 8]

Open up a terminal window and use the snap command to install Arduino IDE on your Ubuntu 20.04 server. To do so execute the command below:

sudo apt-get update
sudo apt-get dist-upgrade
##to support remote viewing over ssh install xorg on remote server
sudo apt-get install xorg 
sudo apt-get install -y xorg-dev

You now need to download the Arduino IDE from

You need to download this library locally, and scp it to the VM using jFed scp tool.

When available on the VM run the following commands:

tar -xf arduino-1.8.13-linux64.tar.xz
cd arduino-1.8.13
sudo ./ 
Adding desktop shortcut and menu item for Arduino IDE...


Next, You can start the Arduino IDE from the Linux command line be executing:


The Arduino GUI should be visible. You will need X11 client locally to support viewing.

b. Setup Arudino IDE to support Seeeduino Board 

[Note these steps should already have been run on the base Seeeduino image - Skip to Step 8]

Open your Arudino IDE, click on File > Preferences, and copy below url to Additional Boards Manager URLs: [More info here:]