1. References

https://wiki.seeedstudio.com/Seeeduino_LoRAWAN/

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: https://portal.fed4fire.eu/). 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

https://jfed.ilabt.imec.be/downloads/ 

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="http://www.geni.net/resources/rspec/3" type="request" generated_by="jFed RSpec Editor" generated="2021-02-18T19:38:43.096Z" xmlns:emulab="http://www.protogeni.net/resources/rspec/ext/emulab/1" xmlns:delay="http://www.protogeni.net/resources/rspec/ext/delay/1" xmlns:jfed-command="http://jfed.iminds.be/rspec/ext/jfed-command/1" xmlns:client="http://www.protogeni.net/resources/rspec/ext/client/1" xmlns:jfed-ssh-keys="http://jfed.iminds.be/rspec/ext/jfed-ssh-keys/1" xmlns:jfed="http://jfed.iminds.be/rspec/ext/jfed/1" xmlns:sharedvlan="http://www.protogeni.net/resources/rspec/ext/shared-vlan/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.geni.net/resources/rspec/3 http://www.geni.net/resources/rspec/3/request.xsd ">
  <node client_id="Seeeduino_node" exclusive="false" component_manager_id="urn:publicid:IDN+iris-open-testbed.connectcentre.ie+authority+am">
    <sliver_type name="vm">
      <disk_image name="urn:publicid:IDN+iris-open-testbed.connectcentre.ie+image+seeeduino-board"/>
      <flavor_type xmlns="http://iris-testbed.connectcentre.ie/rspec/ext/openstack/1" name="seeeduino-iot"/>
    </sliver_type>
    <location xmlns="http://jfed.iminds.be/rspec/ext/jfed/1" x="353.0" y="208.0"/>
  </node>
</rspec>

 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
iristest@seeeduino-node:~$ 

 

6. Download the PN TheThingsNetwork GitHub code 

Clone the pervasive nation Seeeduino code or copy the contents of the file: https://github.com/pervasivenation/pn_seeed/blob/master/pn_seeed.ino

git clone https://github.com/pervasivenation/pn_seeed.git

 Start arduino if not already started

arduino

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:

https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json

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. 

 

10. Load the PN LoRaWAN Code, and execute. 

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 TheThingsNetwork

Create a user account on the ThingsNetwork. Use the following link:

https://account.thethingsnetwork.org/register

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

 Add End Device.

 

Register End Device. 

 

Manually Enter The DevEUI, AppEUI, AppKey etc.

Additional information is available on this link

 

https://www.thethingsnetwork.org/docs/devices/registration/

13. Viewing Data on the Network Server.

 Its 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": [
          1,
          10,
          74,
          19,
          95,
          39,
          15
        ]
      },

.....

 

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 https://www.arduino.cc/en/software

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 ./install.sh 
Adding desktop shortcut and menu item for Arduino IDE...

 done!

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

arduino 

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: https://wiki.seeedstudio.com/Seeed_Arduino_Boards/]

https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json