S3A7 with Lora Demo – Quick Start Guide

This tutorial will show you how to get started with connecting two S3A7 boards using Lora PMODs to Renesas IoT Sandbox.   One S3A7 board will operate in Gateway mode with a Lora radio and wifi connectivity to the cloud.  The second board will operate in Endpoint mode with a Lora radio and the AMS sensor.  Note this Demo is not intended for production use.

What you need to get started:

  1. 2x S3A7 Fast Prototyping Lit
  2. WiFi Internet access
  3. 2x LinkLabs Lora PMOD modules (tested with 1.3.1 LinkLabs firmware)
  4. Lora Demo image with S3A7 (updated 9-30-16)

Recommended Reading:

Step 1: Program The Kit

Before you begin, flash both S3A7 kit with the Lora Demo image with S3A7  image using this guide: How to flash the S3A7 board

Step 2: Activate Kit in the Renesas IoT Sandbox

Click here to activate the kit and complete the registration process to create a Renesas IoT Sandbox account preloaded with the demo workflows.  Note: It’s important to use the activation link provided since it creates Renesas IoT Sandbox workflows required for this kit.

Configure the Gateway board

With one of the s3A7 boards, connect the Lora PMOD to port J6 as shown.

img_2873

Configure the Endpoint board

With the other s3A7 board, connect the Lora PMOD to port J6 and the AMS sensor to the J18 grove connector.

img_2881

 

Step 3: Connect the S3A7 kit to the Cloud

Provision the Gateway

Provision the Board for Lora and WiFi to Renesas IoT Sandbox API:

  • Power up the board and touch the screen within 10 seconds to boot it up in provisioning mode. The board will become a WiFi Access Point.

img_2856

  • When you see the following screen, connect to the board from a computer via the WiFi network printed at the top of the screen.  

img_2854

  • Once connected, open the provisioning page served by the board by going to  http://192.168.3.1 on your browser.
  • On the provisioning page, select Gateway mode and enter your WiFi information and Renesas IoT Sandbox API credentials emailed to you when you activated the kit.   Note, you’ll need to specify your own 32 character encryption key to pair the LoRa modules.  This is an arbitrary key, we use this 1a2b3c4d5e6f7a8b9c0d1e2f3a4b5cff for this demo.  Make sure this key is identical for both boards.

screen-shot-2016-09-30-at-11-50-24-am

  • When you submit the form, you will see the error screen below. This is expected since the board is no longer in provisioning mode

smartchef_page_isnt_working

The screen on the board should look like this:

img_2860

Turn off the board.

 

Provision the Endpoint

Provision the other Lora to the Gateway board:

  • Power up the board and touch the screen within 10 seconds to boot it up in provisioning mode. The board will become a WiFi Access Point.

img_2856

  • When you see the following screen, connect to the board from a computer via the WiFi network printed at the top of the screen.  

img_2854

  • Once connected, open the provisioning page served by the board by going to  http://192.168.3.1 on your browser.
  • On the provisioning page, specify Endpoint mode.  Specify the encryption key from the prior step. In this example, we use 1a2b3c4d5e6f7a8b9c0d1e2f3a4b5cff to match the previous step.  Make sure this encryption key is identical for both boards.  Specify the sample period in seconds.  We use 6 seconds.

screen-shot-2016-09-30-at-12-14-01-pm

  • When you submit the form, you will see the error screen below. This is expected since the board is no longer in provisioning mode

smartchef_page_isnt_working

The screen on the board should look like this:

img_2860

Turn off the board

 

Step 4: Power up

First power up the Gateway board by re-connecting the USB cable. Do not touch the screen or you will reenter provisioning mode and have to enter your information again. After 10 seconds, if the Wifi information entered was successful, you will see “Connecting to SSID,” then “Connecting to MQTT,” and then “Connected” status. If it doesn’t get past the connecting to SSID screen or connecting to MQTT screen, the credentials entered were incorrect.

 

This will establish connection to the cloud.  Wait until you see “Lora ready” printing on the board display. This may take a few seconds. If “transport failed” shows up instead of “Lora ready”, reset the board.

img_2877

 

Power up the Endpoint board by re-connecting the USB cable.  You should see the following printed on the display.  Note the light sensor value from the AMS printed on the display.  The first value is the sensor reading, the second value is the sample count. This may take a few seconds.

img_2883

 

Look at the Gateway board and you should see the sensor readings printed on that board as well.  This signifies the Lora connection is working.

img_2884

Note, if you do not see these messages, go back to Step 3 to make sure the provisioning is completed properly.

Congrats, you’ve established communication between the two boards via Lora!

Step 5: Visualize Data On Dashboard

Login to Renesas IoT Sandbox with your web credentials.  Select Dashboard from the left navigation panel.   On the default view, specified in the upper right corner, you will see the Dashboard with a Real Time Events Log Widget.  

Repeat the power up sequence from Step 4.

When the board is connected to Wifi, you should see messages appear in the Real Time Event Log after a few seconds.  If you do not see data, then go back to Step 3 to ensure that you have entered the correct API and MQTT credentials.  Note the data streaming in JSON format.

screen-shot-2016-09-30-at-1-26-40-pm

 

Next, let’s add a Gauge widget by clicking on the Gauge icon at the bottom of the dashboard.

screen-shot-2016-09-30-at-1-26-49-pm

Configure the Gauge widget: select user “device”, then click on the Gear icon.

screen-shot-2016-09-30-at-1-26-55-pm

Select “raw:light-sensor” and Save.

screen-shot-2016-09-30-at-1-27-06-pm

You will notice a Gauge appear with the light sensor readings.  Place the sensor in a bright location to see a high value.

screen-shot-2016-09-30-at-1-28-02-pm

Cover the sensor with your hands and see the readings drop.  This may take a few seconds.

screen-shot-2016-09-30-at-1-28-27-pm

Step 6: What’s Next

Congrats! The rest is up to your imagination.  Refer to the documentation to learn more about the dashboard, widgets and workflows!