synergy enterprise cloud toolbox - application project · 2018. 2. 6. · the synergy enterprise...

67
Application Note R20AN0485EU0108 Rev.1.08 Page 1 of 65 Jan 11, 2018 Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox Introduction The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing cloud connectivity solutions using the Renesas Synergy Platform. Required Resources Hardware and software resources used for the project, include: Synergy Software Package (SSP) v1.3.2 Renesas Synergy™ e 2 studio Integrated Solution Development Environment (ISDE) v5.4.0.023 IAR Embedded Workbench ® for Renesas Synergy (IAR EW for Synergy) v7.71.3 Synergy Standalone Configurator (SSC) v5.4.0.23 Microsoft ® Windows ® 7 or 10 PK-Cloud1 Kit (hardware set supporting the Synergy Enterprise Cloud Toolbox): Synergy PK-S5D9 (Device) Sensor Shield board Wi-Fi PMOD Cellular CAT3 PMOD Two antennas Power adapter Two micro USB connector cables Ethernet Cable AE-Cloud1 Kit (hardware set supporting the Synergy Enterprise Cloud Toolbox): IoT FPK-S5D9 development kit (MCU Board = YIOTFASTPROTOS5D9) Longsys GT202 Wi-Fi board based on Qualcomm (QCA 4002 chipset) with a PMOD plug-in (Wi-Fi Board = YSAEWIFI-1) Debugger and cable (SEGGER J-Link ® Lite for Renesas Synergy™) Two micro USB connector cables Browser: Google Chrome, Internet Explorer, Microsoft Edge, Mozilla Firefox, or Safari The Synergy Enterprise Cloud Toolbox application project has the following components: Code: Dashboard code Embedded code for AE-Cloud1 Embedded code for PK-Cloud1 Documentation: Application Note Quick Start Guide for PK-Cloud1 Quick Start Guide for AE-Cloud1 Project Import Guide Download the application project at www.renesas.com/cloudtoolbox. Prerequisites As the reader of this application note, you are assumed to have prior experience with IAR EW for Synergy or e 2 studio ISDE and SSP. The embedded code is intended for firmware developers who are familiar with Synergy. The Dashboard code is intended for UI/UX web developers who are familiar with the concept of web services. R20AN0485EU0108 Rev.1.08 Jan 11, 2018

Upload: others

Post on 28-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Application Note

R20AN0485EU0108 Rev.1.08 Page 1 of 65 Jan 11, 2018

Renesas Synergy™ Platform

Synergy Enterprise Cloud Toolbox Introduction The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing cloud connectivity solutions using the Renesas Synergy™ Platform.

Required Resources Hardware and software resources used for the project, include:

• Synergy Software Package (SSP) v1.3.2 • Renesas Synergy™ e2 studio Integrated Solution Development Environment (ISDE) v5.4.0.023 • IAR Embedded Workbench® for Renesas Synergy™ (IAR EW for Synergy) v7.71.3 • Synergy Standalone Configurator (SSC) v5.4.0.23 • Microsoft® Windows® 7 or 10 • PK-Cloud1 Kit (hardware set supporting the Synergy Enterprise Cloud Toolbox):

Synergy PK-S5D9 (Device) Sensor Shield board Wi-Fi PMOD Cellular CAT3 PMOD

• Two antennas • Power adapter

Two micro USB connector cables • Ethernet Cable • AE-Cloud1 Kit (hardware set supporting the Synergy Enterprise Cloud Toolbox):

IoT FPK-S5D9 development kit (MCU Board = YIOTFASTPROTOS5D9) Longsys GT202 Wi-Fi board based on Qualcomm (QCA 4002 chipset) with a PMOD plug-in

(Wi-Fi Board = YSAEWIFI-1) Debugger and cable (SEGGER J-Link® Lite for Renesas Synergy™) Two micro USB connector cables

• Browser: Google Chrome, Internet Explorer, Microsoft Edge, Mozilla Firefox, or Safari The Synergy Enterprise Cloud Toolbox application project has the following components:

• Code: Dashboard code Embedded code for AE-Cloud1 Embedded code for PK-Cloud1

• Documentation: Application Note Quick Start Guide for PK-Cloud1 Quick Start Guide for AE-Cloud1 Project Import Guide

Download the application project at www.renesas.com/cloudtoolbox.

Prerequisites As the reader of this application note, you are assumed to have prior experience with IAR EW for Synergy or e2 studio ISDE and SSP.

The embedded code is intended for firmware developers who are familiar with Synergy. The Dashboard code is intended for UI/UX web developers who are familiar with the concept of web services.

R20AN0485EU0108 Rev.1.08

Jan 11, 2018

Page 2: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 2 of 65 Jan 11, 2018

Contents

1 Synergy Enterprise Cloud Toolbox Overview ........................................................................... 5 System architecture ................................................................................................................................. 5 System flow sequence/ architectural diagram ......................................................................................... 5 System features ....................................................................................................................................... 6 Sensors ................................................................................................................................................... 6

1.4.1 PK-CLOUD1 .......................................................................................................................................... 6 1.4.2 AE-CLOUD1 .......................................................................................................................................... 6

2 Synergy Enterprise Cloud Toolbox Dashboard ........................................................................ 6 Architecture overview .............................................................................................................................. 7

2.1.1 IoT connectors ....................................................................................................................................... 7 2.1.2 AWS platform connector ....................................................................................................................... 7 2.1.3 User management service .................................................................................................................... 8

High-level design ..................................................................................................................................... 8 2.2.1 Cloud device services ........................................................................................................................... 8 2.2.2 User management ................................................................................................................................. 8 2.2.3 GUI 8

APIs used ................................................................................................................................................ 8 Request/Response URL ........................................................................................................................ 12 Configuring the Synergy Enterprise Cloud Toolbox Dashboard ........................................................... 12

3 Security certificate ................................................................................................................. 13

4 Connecting to an IoT service provider ................................................................................... 13 Operation ............................................................................................................................................... 13 APIs Used .............................................................................................................................................. 13 IoT service providers ............................................................................................................................. 14

5 Synergy Enterprise Cloud Toolbox Embedded Application Demonstration ............................ 14 Threads overview .................................................................................................................................. 14

5.1.1 IoTKit thread ........................................................................................................................................ 14 5.1.2 Turbine Thread .................................................................................................................................... 15 5.1.3 MQTT Notifier Thread ......................................................................................................................... 15

Interface definitions for communication between modules ................................................................... 16 5.2.1 IoT Service Interface ........................................................................................................................... 17 5.2.2 MQTT Client Interface ......................................................................................................................... 17

Usage .................................................................................................................................................... 18 5.3.1 Memory Usage .................................................................................................................................... 18 5.3.2 Synergy Enterprise Cloud ToolBox embedded application memory footprints ................................... 18

6 Building, configuring, and setting up the Dashboard application ............................................ 19 System Requirements ........................................................................................................................... 19

Page 3: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 3 of 65 Jan 11, 2018

Setting up Gcloud VM ........................................................................................................................... 19 6.2.1 Installing JDK....................................................................................................................................... 19 6.2.2 Installing Apache-maven ..................................................................................................................... 20 6.2.3 Updating bashrc .................................................................................................................................. 21 6.2.4 Confirming Java and Maven versions ................................................................................................. 22 6.2.5 Generating CSR .................................................................................................................................. 22 6.2.6 Generating self-signed certificate ........................................................................................................ 22

Customizing user AWS/Azure/Google-cloud credentials ...................................................................... 22 6.3.1 Amazon AWS ...................................................................................................................................... 23 6.3.2 Microsoft Azure.................................................................................................................................... 25 6.3.3 Google Cloud....................................................................................................................................... 25

Running installation script ..................................................................................................................... 26 Building and running the configurator.................................................................................................... 26

6.5.1 Building the configurator ...................................................................................................................... 27 6.5.2 Running the configurator ..................................................................................................................... 27 6.5.3 Updating the terms and conditions ...................................................................................................... 37 6.5.4 Building Dashboard artifacts ............................................................................................................... 37

Run the application ................................................................................................................................ 38 AWS Cognito – User Pool configuration ............................................................................................... 38 Enabling or disabling a user signup ...................................................................................................... 41

6.8.1 Disabling user signup .......................................................................................................................... 41 6.8.2 Enabling user signup ........................................................................................................................... 42

Signing Out a user ................................................................................................................................. 43

7 Customizing UI theme and branding ...................................................................................... 43 Color customizations ............................................................................................................................. 43 Colors (Theming) ................................................................................................................................... 44 Branding ................................................................................................................................................ 46 Sample Rebranded UI ........................................................................................................................... 47

8 Installing e2 studio and importing a project ............................................................................. 47 Installing e2 studio ................................................................................................................................. 47 Importing/creating the project ................................................................................................................ 47 Adding the board support package to the AE-CLOUD1 Kit manually ................................................... 47 Importing/creating the project manually ................................................................................................ 48 Installing the Synergy License ............................................................................................................... 52 Generating the Project Files .................................................................................................................. 53 Building the project ................................................................................................................................ 55 Running the application/Flash on PK-CLOUD1 or AE-CLOUD1 kit ...................................................... 55

9 Configuring the IAR Build....................................................................................................... 57 Adding the board support package to the IoT Fast Prototyping Kit manually ....................................... 57

Page 4: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 4 of 65 Jan 11, 2018

Importing the project manually .............................................................................................................. 58

10 Cellular framework configuration, issues, and workarounds ................................................... 62 Configuration ......................................................................................................................................... 62 Issues .................................................................................................................................................... 63 Workarounds ......................................................................................................................................... 63

11 Further improvements ............................................................................................................ 64 Securing Key Storage ........................................................................................................................... 64 Supporting RSA key lengths greater than 2048 bits ............................................................................. 64 Storing credentials in clear text ............................................................................................................. 64

Page 5: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 5 of 65 Jan 11, 2018

1 Synergy Enterprise Cloud Toolbox Overview This section introduces you to Synergy Enterprise Cloud Toolbox version 1.0.8 and its system architecture, features, and components.

System architecture

Figure 1 High-level end-to-end system architecture

System flow sequence/ architectural diagram

Figure 2 System flow sequence

Synergy Enterprise Cloud Toolbox Dashboard

Page 6: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 6 of 65 Jan 11, 2018

1. User signs up with the Synergy Enterprise Cloud Toolbox Dashboard to register devices. 2. User provisions user Email and Password on the device via the command line. 3. Device is pre-provisioned with the Synergy Enterprise Cloud Toolbox Dashboard URL. 4. Device make a REST call over HTTPS to the Synergy Enterprise Cloud Toolbox Dashboard with the user’s Email,

Password, and Unique Device Information. 5. Synergy Enterprise Cloud Toolbox Dashboard authenticates the device against user-configured information and

creates a device profile with the IoT Service Provider (AWS/Azure/ Google). 6. Synergy Enterprise Cloud Toolbox Dashboard creates device keys and a certificate, and gets Signed Certificates for

the device from the IoT Service Provider. 7. In response to the REST call from the device, the Synergy Enterprise Cloud Toolbox dashboard sends certificates

and other provisioning information. 8. Once provisioned, the device then communicates to the IoT Service Provider via MQTT.

System features 1. User management through the Dashboard 2. Device management though the Dashboard 3. Device auto-provisioning 4. Secure connectivity with the Cloud 5. Device remote monitoring 6. Device connects with MQTT endpoint on AWS, Azure and Google IoT through a secure connection. 7. Device publishes various sensor readings periodically that are displayed on the Dashboard. 8. Device LEDs can be controlled via the Dashboard.

Sensors 1.4.1 PK-CLOUD1

Sensor type Model Barometric Pressure Sensor MS5637 Temperature/ Humidity Sensor HIH6030 Accelerometer BMC150

1.4.2 AE-CLOUD1

Sensor type Model Barometric Pressure Sensor MS5637 Temperature/ Humidity Sensor ENS210 Accelerometer BMC150

2 Synergy Enterprise Cloud Toolbox Dashboard The Dashboard provides a web-based GUI where users can sign up, monitor, and update a Renesas device connected to a specified IoT service provider cloud platform. The current release supports AWS, Azure and Google IoT platforms.

The Dashboard has three functional areas:

1. User Management 2. Device Management 3. Remote Monitoring

Note: -

The Synergy Enterprise Cloud Toolbox Dashboard is available at: https://cloud.renesassynergy.com.

Page 7: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 7 of 65 Jan 11, 2018

Architecture overview

Figure 3 High-level Dashboard Application Architecture

The main architectural components include IoT platform connectors and user management APIs. See the following sections for brief overviews.

2.1.1 IoT connectors The implementation supports AWS, Azure IoT and Google Cloud IoT connectors to communicate with the target IoT platform (AWS, Azure or Google Cloud).

The connectors contain the actual implementation to register the Synergy device with the target platform, attaching security credentials to the platform, performing GET/SET operations on the device, and receiving notifications sent by the device.

2.1.2 AWS platform connector User identity management and authentication are done using identity management services provided by AWS Cognito.

Page 8: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 8 of 65 Jan 11, 2018

Figure 4 User identity management and authentication

2.1.3 User management service The user management service provides APIs for user-signup, authentication, forgotten passwords and password resets. A user is associated with one or more devices that the user has registered. The source code can be used as an example to integrate similar services used for screening users.

High-level design The Dashboard is a spring-boot web application deployed on an Amazon EC2 instance. Spring framework is the container that holds instantiated beans, and the Apache Shiro Framework is the default security filter.

The main services can be broadly categorized into device activities and user management-related services.

2.2.1 Cloud device services The DeviceManagement service and the DeviceConfiguration service make up the Cloud Device services. The DeviceManagement service caters to ADD/EDIT/DELETE/GET operations for the device and the DeviceConfiguration service reads the real-time status and sensor-properties of the device.

The DeviceServiceFactory provides the platform-specific (AWS, Azure and Google Cloud ) implementation for the device management and configuration features.

2.2.2 User management AWS Cognito has been used to maintain account identities and authentication. The user management service provides user-signup, reset-password, forgot-password and authentication functionality.

2.2.3 GUI The GUI has been developed using HTML and javascript with reactJS UI framework. Gulp and Yarn have been used for the build and packaging tools.

APIs used The following section defines the input and output parameters of all the APIs used.

Note: -

All URL’s are to be prefixed with https://cloud.renesassynergy.com to get the complete URL.

Page 9: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 9 of 65 Jan 11, 2018

Table 1 Summary of Enterprise Cloud Toolbox API parameters

API URL HTTP Method

Request Data Response Data Description

User Management /user POST {

"email": [email protected], "password": "Passw0rd", "company": "K2-Inc", "phone": "1234567809", "fullName":"Fname Lname" }

{ "email": "[email protected]", "fullName": "Tushar Gokhale", "company": "Renesas", "phone": "1234567809", “createdDate":1502282625497, "modifiedDate":1502282680199, "role": "USER" }

Registers a user with the dashboard. The response JSON contains the created user.

/login POST {"username":"[email protected]", "password":"Passw0rd"}

{"token":"eyJraWQiOiJrWitp........ XE2yUVw"}

Request to login to the dashboard with the specified user credentials. The response JSON contains the authorization token which the client (web) will need to send for each subsequent request to the dashboard. Note – The authorization token is valid for 1 hour.

/api/users/current GET {"email":"[email protected]", "fullName":"Tushar Gokhale", "company":"Renesas", "phone":"1234567809", "createdDate":1502282625497," modifiedDate":1502282680199," role":"USER"}

Fetches the current (logged-in) user.

/user/{userName}/password (Forgot password request)

PUT HTTP status code 200 on success and HTTP status code 400 on failure

Forgot password request. A verification code is sent to the registered email address which can be used to set a new password.

/user/{userName}/password (Reset password request)

POST HTTP status code 200 on success and HTTP status code 400 on failure

Updates the password of the user.

Page 10: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 10 of 65 Jan 11, 2018

API URL HTTP Method

Request Data Response Data Description

Device Management /api/deviceTypes GET [{"id":"WindTurbine",

"displayName":"Wind Turbine"}]

Returns a JSON array containing the list of device-types supported by the dashboard.

/api/devices POST {"id":"2b5e035233303835534c6f387a215454", "type":"WindTurbine", "attributes":{"description":" South Pune Wind Turbine ", "iotProvider":"AWS", “userName”:”[email protected]”}}

{"id":"2b5e035233303835534c6f387a215454", "type":"WindTurbine", "attributes": {"description": "South Pune Wind Turbine", "userName":"[email protected]", "iotprovider":"AWS"}, "properties":null}

Adds a new device to the specified iotprovider and associates it with the logged in user.

/api/devices GET [{"id":"2b5e035233303835534c6f387a215454", "type":"WindTurbine", "attributes":{"iotProvider":"AWS", "description":"South Pune Wind Turbine", “userName":"[email protected]”}, "properties":{}}]

Get a list of devices associated with the logged in user. By default the devices registered with all the available iotproviders for the logged in user are returned.

/api/devices?iotProvider=AWS|AZURE

GET [{"id":"2b5e035233303835534c6f387a215454", "type":"WindTurbine", "attributes":{"iotProvider":"AWS", "description":"South Pune Wind Turbine", “userName":"[email protected]”}, "properties":{}}]

Returns the devices, associated with the logged in user for the IoT provider specified.

/api/devices/{deviceId}

GET {"id":"2b5e035233303835534c6f387a215454", "type":"WindTurbine", "attributes":{"iotProvider":"AWS", "description":"South Pune Wind Turbine", “userName":"[email protected]”}, "properties":{}}

A request to get the details of the device identified by the {deviceId}.

Page 11: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 11 of 65 Jan 11, 2018

API URL HTTP Method

Request Data Response Data Description

/api/devices/{deviceId}

PUT {"id":"2b5e035233303835534c6f387a215454", "type":"WindTurbine","attributes":{"description":" South Pune Wind Turbine. Id-No-#123", "iotProvider":"AWS", “userName":"[email protected]”}}

Response status 200 Ok A request to update the device specified by the {deviceId}. This request can be used to switch the iotprovider of the device as well. (For example, from AWS to Azure and vice-versa)

/api/devices/{deviceId}

DELETE HTTP Status code 200 on success

A request to delete the device, as identified by the {deviceId}, from the dashboard.

/api/iotProviders GET [{“name”:”Amazon AWS”,”value”:”AWS”}, {“name”:”Microsoft Azure”, “value”:”AZURE”}, {"name":"Google Cloud Platform","value":"GCLOUD"}]

Request to fetch the list of configured IoT providers.

Remote Monitoring /api/devices GET [{"id":"2b5e0352333038

35534c6f387a215454", "type":"WindTurbine", "attributes":{"connected":"true", "iotProvider":"AWS", "certificateId":"ba88d487eb49cb14684b6d5724645e9ab75f7cb9a8ed8f2a035b55389a71f839", "description":"South Pune Wind Turbine", “userName":"[email protected]}, "properties":{}}]

/api/devices/{deviceId}/state

GET { "id": "5033012d31363846394e184f51215454", "type": null, "attributes": { "connected": "true", "provisioned": "true", "iotProvider": "AZURE", "description": "My First Device", "userName": "[email protected]",

A request to get the latest device state in terms of connectivity and reported values of various sensors.

Page 12: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 12 of 65 Jan 11, 2018

API URL HTTP Method

Request Data Response Data Description

"delete": "false" }, "properties": { "altitude": "544.39", "green": "off", "yellow": "off", "pressure": "27.75", "yacc": "49", "red": "off", "xacc": "28", "x": "-90", "temperature": "82.99", "humidity": "66.03", "y": "35", "z": "-48", "zacc": "1074" } }

/api/devices/{deviceId}/state

PUT {"red":"off"} Request to update the state of the device. (Eg. We can update the LED state by clicking on the sliders)

/api/notifications?token=<auth-token>&deviceId=<deviceId>

GET {"red":"off" }

/api/reset POST HTTP Status code 200 on success

Resets the installation by deleting all devices and non-admin users. This is available only for the admin user.

Request/Response URL Table 1 lists APIs exposed by the Dashboard. To access the complete URL for a given API, append the API URL to the dashboard address: https://cloud.renesassynergy.com.

For example:

To add user to the complete API URL: https://cloud.renesassynergy.com/user To get all devices: https://cloud.renesassynergy.com/api/devices

The HTTP methods exposed by the APIs are listed in the description.

Configuring the Synergy Enterprise Cloud Toolbox Dashboard See the section Customizing UI theme and branding

Page 13: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 13 of 65 Jan 11, 2018

3 Security certificate Digital certificates are used by any entity connected to a network to establish its identity. Typically, digital certificates are digitally signed by a Certificate Authority (CA), which is deemed as a trusted entity that can vouch for the authenticity of the entity’s identity. X.509 certificates form the backbone of Public Key Infrastructure (PKI); the basis for almost all secure communications over the public Internet.

The Synergy Enterprise Cloud Toolbox uses x.509 certificates to authenticate the Cloud Dashboard server and the IoT Cloud Providers’ servers. In the case of AWS, the cloud provider requires the use of a device certificate signed by AWS to establish the identity of the device.

The Cloud Dashboard server creates keys and certificates on behalf of the device during the provisioning process, generating a Certificate Signing Request (CSR) for the device certificate as required by AWS. The server then transmits the certificate and keys to the device at the end of the bootstrap process.

4 Connecting to an IoT service provider This section describes the complete operation of connecting the PK-CLOUD1 (device) to an IoT service provider.

Operation To establish connectivity, the device needs to be provisioned with the appropriate certificate. The device can then establish a secure connection with the IoT service provider over MQTT.

Successfully adding a device via the Dashboard and provisioning the device with certificate/keys is a one-time activity. There is no need to provision the device again, unless it is deleted from the Dashboard and added again.

On the device, start the Wind-turbine demonstration, it creates a secure connection with the cloud and periodically publishes sensor data to the cloud site. This data can be seen on dashboard. Device LEDs can also be controlled via the dashboard.

APIs Used The dashboard provides an API, over HTTPS, for device provisioning. The details of the API are described below.

Table 2 API Device Provisioning

API URL HTTP Method

Request (HTTP form submit)

Response (JSON format) Description

https://cloud.renesassynergy.com/api/bootstrap

POST email <signup username> password <password> deviceId <id used while adding device via Dashboard> version<optional parameter, indicating the firmware version of the board>

Response in case the device is added to AWS { "publicKeyHex": <pub key hex>, "privateKeyHex": <pvt key hex>, "certificateHex": <certificate hex>, "mqttEndpoint": <endpoint-id>, “iotProvider”:<iot-provider> }

A request to provision the device with a given iot-provider. The response JSON contains the credentials required by the device to connect to the iot-provider. The “version” is an optional parameter, sent along with bootstrap request.

Note: -

The same operation can be followed to connect the IoT Fast Prototyping Kit (device) to an IoT service provider.

Note: -

For details on the Synergy Enterprise Cloud Toolbox application and the associated steps listed in the following sections, see the Synergy Enterprise Cloud Toolbox Quick Start Guide.

Page 14: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 14 of 65 Jan 11, 2018

API URL HTTP Method

Request (HTTP form submit)

Response (JSON format) Description

Response in case the device is added to AZURE { "primaryKey": <pub key hex>, " secondaryKey ": <pvt key hex>, "mqttEndpoint": <endpoint-id>, “iotProvider”:<iot-provider> } For devices added to Google cloud, the response is as below. { "publicKeyHex": <pub key hex>, "privateKeyHex":<pvt key hex>, "certificateHex": <certificate hex>, "mqttEndpoint": "mqtt.googleapis.com", "primaryKey": "<Full path of the device in Gcloud registry>", "secondaryKey": "The Google gcloud project ID", "iotProvider": "GCLOUD" }

https://cloud.renesassynergy.com/api/bootstrap/confirm

POST email <signup username> password <password> deviceId <id used while adding device via Dashboard>

Response HTTP status code 200

A request sent to the Dashboard, by the device, to confirm that the device has received provisioning credentials.

IoT service providers Amazon AWS, Microsoft Azure, and Google Cloud are the IoT Service Providers supported.

5 Synergy Enterprise Cloud Toolbox Embedded Application Demonstration See the S5D9 IOT Device Quick Start Guide for details on the application demonstration flow.

Threads overview There are two threads in the embedded application:

5.1.1 IoTKit thread

Page 15: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 15 of 65 Jan 11, 2018

The IoTKit thread has different stacks used by network interfaces, like Ethernet, Wi-Fi, and Cellular. It includes stacks for the console command line interface (CLI) and internal data-flash storage.

Here is the list of stacks included:

1. SF Console on USB CDC 2. MQTT Client with TLS on Wi-Fi interface 3. DHCP Client on Wi-Fi interface 4. DNS Client on Wi-Fi interface 5. SNTP Client on Wi-Fi interface 6. MQTT Client with TLS on Ethernet interface 7. DHCP Client on Ethernet interface 8. DNS Client on Ethernet interface 9. SNTP Client on Ethernet interface 10. MQTT Client with TLS on Cellular interface (stack included only for PK_CLOUD1) 11. DNS Client on Cellular interface (stack included only for PK_CLOUD1) 12. SNTP Client on Cellular interface (stack included only for PK_CLOUD1) 13. Internal data-flash storage interface

The IoTKit thread starts the console framework providing a command prompt on the console and waits on commands from the user. There are different commands provided by the command line interface for operations for configuring the network interface, bootstrap and others.

IoTKit Thread properties:

• Priority: 6 This thread handles CLI commands and does not need run at a high priority level. Run the thread at a priority

lower than the system threads (NetX™ Duo IP helper, MQTT, various Synergy Framework threads, and more.) • Stack Size: 8192 bytes

This thread calls various CLI command callbacks that use stack variables and buffers for string buffers and other temporary storage objects. The stack size is set to 8192 to accommodate these objects.

• Time slice: None • The thread is auto-started and runs forever. 5.1.2 Turbine Thread The turbine thread runs the wind-turbine model. The thread performs the following activities:

1. Establishes secure connection with a MQTT Endpoint. 2. Periodically publishes values read from sensors to the MQTT Endpoint. By default, the polling interval is set to

5 seconds via the freq_ms variable. This interval can be changed as you required. Reducing this interval increases the amount of data transmitted to the cloud and, if using a cellular interface, may incur additional charges.

3. Subscribes to topics that informs the device about the state of the LEDs. LED states can be changed accordingly to turn on or off.

Turbine Thread properties:

• Priority: 6 The thread does not need to run at a high priority level. It should run at a priority lower than the system threads

(NetX Duo IP helper, MQTT, various Synergy Framework threads and others). • Stack Size: 4096 bytes

This thread reads the sensors and calls the appropriate IoT Service instance to get and set properties. It also uses stack variables to store temporary values read from the sensors and must budget for stack variables used by the IoT Service instance functions. The stack size is set to 4096 bytes that is large enough to accommodate these objects.

Time Slice: No time slicing. Thread starts on the turb start command from console and runs forever.

5.1.3 MQTT Notifier Thread

Page 16: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 16 of 65 Jan 11, 2018

The NetX MQTT client documentation specifies that the notification callback should not perform a blocking operation and should only perform lightweight operations, such as releasing a semaphore.

This thread is created during startup and remains idle until the MQTT client receives a notification when a message is received on a subscribed topic. The notification callback wakes up this thread and then calls the notification callback of the IoT service instance.

MQTT Notifier Thread properties:

• Priority: 6 This thread does not need to run at a high priority level. It should run at a priority lower than the system threads

(NetX Duo IP helper, MQTT, various Synergy Framework threads, and others). • Stack Size: 1024 bytes

This thread does not use many stack variables. It calls the IoT service instance’s notifier function. If you change or add a new IoT service instance with more stack variables, then this value must be evaluated to ensure that the stack is large enough to accommodate such changes.

• Time slice: None • Thread is auto-started and runs forever.

Interface definitions for communication between modules The Turbine thread, which runs the Wind-turbine model, uses instances of the IoT service and MQTT client interfaces. To add support for different IoT service providers, instances of these two interfaces are created with the appropriate configurations.

Figure 5 IoT Service and MQTT Client Interface Communication between Modules

Page 17: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 17 of 65 Jan 11, 2018

5.2.1 IoT Service Interface • Control Structure:

Pointer to MQTT client Instance Semaphore used for notifications from IoT service provider Mutex used for thread-safe operation

• Config Structure: Name of IoT service provider Protocol to be used for communication with IoT service provider, the only supported option is MQTT Pointer to MQTT client instance

• APIs (provided by the IoT service interface): open: Initializes and starts secure connection with the IoT service provider using MQTT close: Terminates connection with the IoT service provider propertySet: Sets Property value and sends it to the IoT service provider propertyGet: Gets property value from IoT service provider

5.2.2 MQTT Client Interface • Control Structure:

TLS packet buffer used for reassembly of packets Crypto meta data buffer used by NetX Secure Remote Intermediate CA X509 certificates Remote Intermediate CA certificate buffer Pointer to ROOT CA certificate ROOT CA certificate length Pointer to device certificate Device certificate length Pointer to Private Key Private key length Pointer to NetX Duo MQTT Client instance Topic name buffer Message buffer Pointer to IoT Service instance Notify function callback that will be called on receiving data from IoT service provider Message logger function or function to log debug messages

• Config Structure:

MQTT Endpoint, or MQTT Broker Device name Username Password Pointer to ROOT CA certificate ROOT CA certificate length Pointer to device certificate Device certificate length Pointer to Private Key Private key length Pointer to NetX IP Instance Pointer to Crypto cyphers to be used with TLS Pointer to NetX DNS instance used to resolve MQTT endpoint name to IP address Pointer to NetX Duo MQTT Client instance Pointer to IOT Service instance

Page 18: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 18 of 65 Jan 11, 2018

• APIs (provided by the MQTT Client interface): open: Initiates secure connection with MQTT broker close: Terminates connection with MQTT broker publish: Publishes message to MQTT broker subscribe: Subscribes to topic, to receive notifications from MQTT broker unsubscribe: Unsubscribes topic so that it will not receive notification from MQTT broker messageGet: Retrieves the message received on the subscribed topic(s)

Usage 5.3.1 Memory Usage

All ROOT CA certificates are placed in on-chip data-flash at compile time. Apart from this device certificate, private/public keys received while bootstrapping and other information (such as Wi-Fi/Cellular provisioning, user credentialing, and others) are also stored in internal data-flash at run-time.

Memory map of on-chip data-flash

Start Address (Hex) End Address (Hex) Size in bytes Description 40100000 40102FFF 12288 Area reserved for ROOT CA 40103000 401030FF 256 Username 40103100 401031FF 256 Password 40103200 401032FF 256 AWS MQTT Endpoint 40103300 401042FF 4096 Private Key (Used by AWS) 40104300 401052FF 4096 Public Key (Used by AWS) 40105300 401062FF 4096 Device certificate (Used by AWS) 40106300 401063FF 256 Wi-Fi provisioning information 40106400 401064FF 256 Cell provisioning information 40106500 401065FF 256 Primary Key (Used by Azure) 40106600 401066FF 256 Secondary Key (Used by Azure) 40106700 401067FF 256 Azure MQTT Endpoint 40106800 401068FF 256 Google Client ID 40106900 401069FF 256 Google Project ID 40106A00 40106A40 64 IoT Service Provider Information

5.3.2 Synergy Enterprise Cloud ToolBox embedded application memory footprints • PK-CLOUD1

Code = 425176 bytes placed in on-chip code-flash Data and BSS = 414488 bytes placed in on-chip RAM Heap = 8192

• AE-CLOUD1 Code = 395680 bytes placed in on-chip code-flash Data and BSS = 319868 bytes placed in on-chip RAM Heap = 8192

Page 19: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 19 of 65 Jan 11, 2018

6 Building, configuring, and setting up the Dashboard application Download the Dashboard and the IotProviderConfigurator code for Synergy Enterprise Cloud Toolbox source at www.renesas.com/cloudtoolbox. Instructions to set up the build environment and build the dashboard are explained in the following subsections.

System Requirements The Synergy Enterprise Cloud Toolbox Dashboard is a Java™-based web application. See the following system requirements to build and deploy the Dashboard:

Setting up Gcloud VM 1. Set up a gcloud VM instance with the OS and minimum hardware configuration listed in section 6.1.

For more information, visit: https://cloud.google.com/compute/docs/gcloud-compute/ 2. Connect to the instance over ssh and download the install. 3. Unzip the package by executing the following command: sudo apt-get install unzip

6.2.1 Installing JDK 1. Connect to the VM instance over ssh. Open a browser window and point the location to the JDK download URL:

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

2. Select the Accept License Agreement radio-button.

Hardware (Minimum) EC2 instance (m4.large (2vCPU, 8GB RAM), Google-cloud instance (custom – 2vCPU, 8GB RAM)

OS Ubuntu 16.04 (64bit)

Page 20: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 20 of 65 Jan 11, 2018

3. Copy the link-address of the Linux® x64 product with the tar.gz file type shown.

4. Execute the following command from the ssh shell: wget --no-cookies --no-check-certificate --header "Cookie:oraclelicense=accept-securebackup-cookie" <YOUR COPIED URL HERE> -O <YOUR_JDK_FILENAME>.tar.gz

Executing this command downloads the file <YOUR_JDK_FILENAME>.tar.gz.

5. Extract the file using the command: tar -xvzf <archive_file_name>.tar.gz

(E.g tar -xvzf jdk-8u144-linux-x64.tar.gz)

6.2.2 Installing Apache-maven 1. Point the browser to the URL (https://maven.apache.org/download.cgi). 2. Download the latest Apache-maven artifact (Binary tar.gz archive) from the URL. 3. Copy the link address of the latest maven binary.

Page 21: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 21 of 65 Jan 11, 2018

4. Execute the command to download the binary: wget <YOUR_COPIED_LINK_ADDRESS_HERE>

Executing this command downloads Maven version 3.5.0.

5. Extract the archive using the following command: tar -xvzf <archive_file_name>.tar.gz

(E.g tar -xvzf apache-maven-3.5.0-bin.tar.gz)

6.2.3 Updating bashrc 1. After successful installation of JDK and Apache-maven, edit the .bashrc file located under the user’s home

directory, to add the JAVA_HOME, MEV_HOME environment variables and update the PATH environment variable.

2. Add the following lines at the end of the file: export JAVA_HOME=/<path_to_jdk_installation_directory> export MVN_HOME=/<path_to_apache_maven_installation_directory>

export PATH=$PATH:$JAVA_HOME/bin:$MVN_HOME/bin

For example: Assuming that the JDK and Apache-maven packages are installed under the directory /home/testuser/; the JDK installation directory name is jdk8; the Apache-maven installation directory is apache-maven; then, the entries in the ~/.bashrc file should have the following:

export JAVA_HOME=/home/testuser/jdk8 export MVN_HOME=/home/testuser/apache-maven

export PATH=$PATH:$JAVA_HOME/bin:$MVN_HOME/bin

3. Execute the following command to ensure that the newly added environment variables are available in the current shell: source ~/.bashrc

Page 22: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 22 of 65 Jan 11, 2018

6.2.4 Confirming Java and Maven versions Type in the following command to confirm that the java and mvn commands are available and point to the correct versions:

1. Confirm java version

java -version

If the JDK was installed by downloading and extracting the file, jdk-8u144-linux-x64.tar.gz, then the above command would generate the output:

java version "1.8.0_144"

Java(TM) SE Runtime Environment (build 1.8.0_144-b01)

Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

2. Confirm the maven version. Execute the following command:

mvn -version

If the Apache-maven was installed by downloading and extracting the file, apache-maven-3.5.0-bin.tar.gz, then the preceding command would generate the output:

Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T01:09:06+05:30)

Maven home: /<full_path_to_install_folder>

Java version: 1.8.0_144, vendor: Oracle Corporation

Java home: <jre_path>

Default locale: en_IN, platform encoding: UTF-8

OS name: "linux", version: "4.4.0-93-generic", arch: "amd64", family: "unix"

6.2.5 Generating CSR You may either generate a CSR using the GUI of a certificate provider (for example, Digicert - https://www.digicert.com/csr-creation.htm) or, you may generate a CSR using the openssl binary as follows.

openssl req -new -newkey rsa:2048 -nodes -out my_lucky_company.csr -subj "/C=US/ST=California/L=Santa Clara/O=My Lucky Inc./OU=IT/CN=myluckycompany.com" -keyout my_lucky_company_key.key

Connect to the gcloud instance over ssh. The example shows how to generate the certificate and private key for a fictitious company My Lucky Inc. with a registered domain name of myluckycompany.com.

After executing the command, the generated artifacts can be used to request a certificate from a certificate-issuing authority: https://www.digicert.com/order/order-1.php

6.2.6 Generating self-signed certificate You may also choose to generate a self-signed certificate for testing purposes. The command to generate such a certificate is:

openssl req -x509 -newkey rsa:2048 -keyout private.key -out cert.pem -days 365 -nodes -subj "/C=US/ST=Oregon/L=Portland/O=Company Name/OU=Org/CN=www.example.com"

In this situation, a self-signed certificate for www.example.com is generated. The certificate and private key files are cert.pem and private.key. You may generate a certificate for localhost by replacing www.example.com for localhost. In that case, pass localhost as the first-argument to the installation script.

Customizing user AWS/Azure/Google-cloud credentials The deployed Dashboard uses the pre-configured master account credentials for AWS, Azure, and Google-cloud platform accounts. You can override these credentials and deploy the Dashboard in your own environment. Information on how your account can be created, instead of using the K2 master account, follows.

Page 23: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 23 of 65 Jan 11, 2018

It is assumed that you download the dashboard artifacts to deploy in your own environment. Also, that you have registered with Amazon AWS, Microsoft Azure, and Google Cloud. Be sure you are in possession of the AWS accessKey and secretAccessKey; the Azure IoT connection strings, namely, the iot-hub connection string, the device connection string and the event hub connection string; and the Google Cloud credentials file. Override the properties before starting the dashboard application.

When selecting regions for the resource being created, select regions that have all the required AWS services (AWS IoT, Cognito, and Lambda).

For example, Region Name - US East (Ohio), region – us-east-2.

The Region Name is listed in the AWS console, at the top-right corner next to the logged in username screen.

6.3.1 Amazon AWS You have to register with Amazon AWS and obtain the accessKey and secretAccessKey using the following steps:

1. Register with Amazon AWS (http://docs.aws.amazon.com/iot/latest/developerguide/iot-console-signin.html). 2. Go to Security Credentials. 3. Generate accessKey and secretAccessKey from the AWS console. 4. Click the My Security Credentials menu item.

Note: -

Having an AWS account is a must as your information is stored in AWS Cognito, even if the IoT Provider used it in Microsoft Azure or Google Cloud. You MAY choose NOT to use Microsoft Azure or Google Cloud; in such cases, you need not configure the Azure/Cloud related properties and can skip the Microsoft Azure/Google Cloud section on the following pages.

Page 24: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 24 of 65 Jan 11, 2018

5. Select the Continue to Security Credentials option.

6. Select Access Keys (Access Key ID and Secret Access Key) option and download the ID and Secret Access

Key using the instructions.

Page 25: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 25 of 65 Jan 11, 2018

7. Create an Access Key and save for later use.

8. Save the Access Key ID and Secret Access Key for further use.

6.3.2 Microsoft Azure To use the Microsoft Azure platform, you have to register with Microsoft Azure IoT. To register, use the following link: https://azure.microsoft.com/en-in/free/

6.3.3 Google Cloud To use the Google IoT platform the user must register with the Google cloud platform and enable billing. The user must have at least one valid billing account configured. User can follow the link https://cloud.google.com/iot-core/

Note: -

Google GCloud IoT is in public beta stage and the functional features supported may change.

Page 26: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 26 of 65 Jan 11, 2018

Running installation script 1. Copy the source code zip files (renesas-iot.zip and IotProviderConfigurator.zip) to the gcloud instance. 2. Connect to the instance. Extract and setup the source-code. 3. Unzip the source code zip file using the command:

unzip <renesas-dashboard-src>.zip

Once extracted, the renesas-iot directory is created. The renesas-iot directory contains the following files: dashboard-installation.sh nginx.conf.SAMPLE pom.xml README.md resource-assembly.xml, and a directory ‘src’

4. Run the script dashboard-installation.sh with sudo as shown:

sudo ./dashboard-installation.sh <domain-name-of-ssl-cert> <full path to the certificate(.pem) file.> <full path to the private key (.key) file.>

This command downloads and set ups the required artifacts, configures nginx, and copies the certificate and private key files to the /etc/nginx/ssl folder. The installation script updates the system configuration to start the nginx daemon on every system reboot.

5. During script execution, there is a prompt for confirmation while installing the packages. Enter ‘Y’ when asked for confirmation.

6. Once setup is complete, configure the IotProvider using the IotProviderConfigurator, and then build and deploy the artifacts from the source code using custom AWS and/or Azure and/or Google Cloud credentials.

Building and running the configurator

An IotProviderConfigurator artifact has been provided as a separate tool to assist you in configuring your Dashboard deployment. The IotProviderConfigurator tool generates the property files required to run the Dashboard with AWS/Azure IoT/Google Cloud IoT, or all of them. On execution, the IoT configurator script prompts you to enter the minimum information needed, and generates the required resources on AWS/Azure/Google, or all, depending on the IoT platform selected.

1. Copy the IotProviderConfigurator.zip file to the gcloud instance. 2. Connect to the instance. 3. Extract and set up the source-code. 4. Unzip the source code zip file using the command:

unzip IotProviderConfigurator.zip

Once extracted, the IotProviderConfigurator directory is created. The IotProviderConfigurator directory contains the following files: pom.xml README.txt and 3 directories scripts src cloud-functions

Page 27: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 27 of 65 Jan 11, 2018

6.5.1 Building the configurator To build the IotProviderConfigurator cd to the IotProviderConfigurator directory, execute the command:

mvn clean package

6.5.2 Running the configurator 1. Post successful build, change the working directory to scripts by executing the command:

cd scripts

2. If you have registered with Microsoft Azure, and want to use Azure IoT, then execute the following command to install the Azure-CLI, before proceeding to configure the Dashboard for IoT providers. sudo ./install-azure-cli.sh

3. If the user has registered with Google GCloud and wants to use GCloud IoT, then execute the following command

to install the GCloud-CLI, before proceeding to configure the Dashboard for IoT providers. sudo ./install-gcloud-cli.sh

Note: If the configurator is being run on a Google Compute Engine VM Instance, the GCloud CLI must be installed

using the following command (instead of the preceding command):

curl https://sdk.cloud.google.com | bash

4. After installation, restart the shell and ensure that the Google Cloud SDK is at version 182.0.0, or above. Use the following command to verify the version information. gcloud version

5. Execute the configuration script as follows:

./configure-iot-kit.sh

The configurator script prompts you to provide required details for the AWS Cognito configuration, AWS IoT, Microsoft Azure IoT and GCloud IoT.

Note: You can choose to build the Dashboard configured for either AWS IoT, Microsoft Azure, Google GCloud, or combination of these. At least one IoT service provider must be chosen.

The following screenshots show a configuration example:

Page 28: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 28 of 65 Jan 11, 2018

Note The profile details of the Admin user are set to default values (Company – “Your Company Name Here”, Full

Name – “Admin” and PhoneNo – “0000”). The Admin user may change these values via the “User Profile” view.

Page 29: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 29 of 65 Jan 11, 2018

6. Enter the AWS accessKey and secretAccessKey (see section 6.3.1). 7. Enter the region where the user’s subscription of AWS Cognito service is located.

To get the region’s value, use the following URL: http://docs.aws.amazon.com/general/latest/gr/rande.html#iot_region The user-pool name is a user-friendly name of the configured Cognito User-Pool, where details on the admin user and the newly added users are persisted.

8. You can keep the defaults or customize the email sent in case of ‘forgot password’ by providing customized email subject and body. The email body must contain the string {####} that is replaced by the account verification code at runtime.

9. The script then prompts the user to input the URL of the server. This URL is used to form the verification link in the email pertaining to the account verification.

Page 30: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 30 of 65 Jan 11, 2018

10. The script prints the default subject and the email that is used for Account Verification emails. You can override this

script by providing your own email template file adhering to the format mentioned by the prompt. 11. Once the AWS Cognito configuration is complete, you are asked to specify if AWS IoT must be used (y/n). Enter y

if you want to use AWS IoT services. 12. You are then prompted to specify the region where the subscribed AWS IoT service is located. Use the link

provided earlier to have the Cognito Service region locate the AWS-specific region string for the IoT service. 13. Post AWS IoT, you are prompted to specify whether Microsoft Azure IoT needs to be configured. If your answer is

yes (y), you are then prompted to copy and paste a URL in a web-browser. 14. When prompted, enter the code in the browser view. 15. After entering the code, you must log in, using the credentials you used to register with Microsoft Azure.

After a successful login, the script displays the subscriptions registered against the user. There could be one or more subscriptions.

Page 31: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 31 of 65 Jan 11, 2018

Page 32: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 32 of 65 Jan 11, 2018

16. The user is prompted to specify whether Google Cloud IoT also needs to be configured. If the user enters ‘y,’ then

the tool proceeds with setting up the DB and configuring the Google Cloud IoT project.

Page 33: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 33 of 65 Jan 11, 2018

Note Google Cloud IoT, being public beta, does not yet provide APIs to store metadata about the device. This

metadata is possible in AWS using DeviceShadow, and in Azure, using the DeviceTwin feature. To store this information, an RDS instance must be explicitly set up and configured. In the future, as Google Cloud-IoT adds similar features, the need to use a database may go away.

17. During initialization of the gcloud CLI, the user is directed to copy and paste a URL in the browser to perform

authentication.

Page 34: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 34 of 65 Jan 11, 2018

18. Post authentication you see the projects owned and are prompted to either select an existing project or create a new

one. Follow the instructions as they appear on the prompt to configure the Service Account and Region.

Page 35: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 35 of 65 Jan 11, 2018

19. You can follow the instructions to configure the Device Registry and Pub/Sub configuration

Page 36: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 36 of 65 Jan 11, 2018

20. With AWS, Azure, and Google-cloud, you must specify the region in which the IoT service has been subscribed. After entering the region, the script creates the required resources on the Azure platform.

21. Lastly, you are prompted to enter the full file path of the schema directory location. Under the Dashboard source, the schema directory path is src/main/resources/schema.

After entering the schema directory path, the script generates the following files application.properties application-aws-cognito.properties application-aws.properties (if the user selected AWS IoT ) application-azure.properties (If the user selected Microsoft Azure as the IoT platform) application-gcloud.properties (if the user selected Google Gcloud IoT )

22. Copy these properties files to the resources folder under the Dashboard source (renesas-iot /src/main/resources/).

Page 37: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 37 of 65 Jan 11, 2018

6.5.3 Updating the terms and conditions 1. Execute the cd command to go to the renesas-iot directory where the source code is located. 2. Update the file src/main/ui/app/www/tos.html with the contents to match your organization’s policy. 6.5.4 Building Dashboard artifacts All the required pre-build steps have now been completed. Now, you can proceed to build the Dashboard artifacts.

1. Execute the cd command to go to the renesas-iot directory where the source code is located. The source code follows the maven directory structure. The following code directory structure is used:

├── pom.xml

├── README.md

├── resource-assembly.xml

└── src

├── main

│ ├──java

│ │ └── com

│ ├── resources

│ │ ├── application-aws.properties

│ │ ├── application-azure.properties

│ │ ├── application-aws-cognito.properties

│ │ ├── application-gcloud.properties

│ │ ├── application.properties

│ │ ├── policy

│ │ ├── rules

│ │ ├── schema

│ │ └── WindTurbine.json

│ ├──ui

│ │ └── app

│ └── webapp

│ ├── index.html

│ └── WEB-INF

└── test

├── java

│ └── com

└── resources

└── application.properties

2. Execute the maven package command in the renesas-iot directory. This directory contains the following pom.xml file used to build the source.

mvn clean package

This command triggers the build and generates the executable .war file, renesas-iot-Rev-1.0.8-Released05Jan2018.war, in the target directory.

Page 38: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 38 of 65 Jan 11, 2018

Run the application 1. To run the application, execute the following command: java -jar -Dport=8080 target/renesas-iot-Rev-1.0.8-Released05Jan2018.war & 2. After a successful startup, point the browser to the URL: https:<hostname>.

This URL opens the Dashboard Signup view.

AWS Cognito – User Pool configuration 1. After starting the application login for the AWS console at: https://aws.amazon.com/console/. Search and select the

Cognito service from the AWS console.

When you click the Manage your User Pools button, the Dashboard application displays the newly created User Pool.

Page 39: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 39 of 65 Jan 11, 2018

2. Select the User Pool and update the following message customizations:

3. Enter the information shown in the following screen:

For Verification type select Code. For the Email subject type: Renesas Synergy Enterprise Cloud Toolbox Account Verification Code. For the Email message type: Please use this verification code to reset your Renesas Synergy Enterprise

Cloud Toolbox Account: {####}.

Page 40: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 40 of 65 Jan 11, 2018

4. Customize the invitation message. Set the Email subject text as: Verify your email for the Renesas Synergy

Enterprise Cloud Toolbox account.

5. Set the Email message text by typing:

Your account for accessing the Renesas Synergy Enterprise Cloud Toolbox Account has been setup. Please <href="https://<INSTALLATION_SERVER_HOST:PORT>/app/index.html?userName={username}&code={####}#/user/verification"> click here </a> to verify your email address or copy paste below URL in a browser.

<br><br> https://<INSTALLATION_SERVER_HOST:PORT>/app/index.html?userName={username}&code={####}#/user/verification <br></br> Thanks, <br><br> Support Team”.

Page 41: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 41 of 65 Jan 11, 2018

6. Save the changes.

The installation and setup is now complete. You may either log-in using the configured admin credentials or invite users to sign up.

Enabling or disabling a user signup If you wish to disable (and then re-enable) the User Signup link and functionality, make the changes described in the following sections, rebuild and deploy the artifacts.

6.8.1 Disabling user signup To disable Signup, you must make changes in the UI as well as the backend code.

6.8.1.1 UI To disable new user signups in IoT-Kit UI, follow the steps below. These changes require re-building the IoT-Kit.

1. Open {Iot-Kit project directory}/src/main/ui/app/www/modules/user/routes.js in a text editor. Search for the route /user/signup and comment the entire route definition as shown. Save this file.

/* { path: "/user/signup", controller: context => { return { component: SignUpView, context: Object.assign({navbar: false}, context) }; } }, */

2. Hide the Signup button on the landing page. Open {Iot-Kit project directory}/src/main/ui/app/www/modules/user/View.jsx and change/comment the line: <a className="button inline sign-up" href="#/user/signup">Sign Up</a> to following and save the file {/* <a className="button inline sign-up" href="#/user/signup">Sign Up</a> */}

3. Open {Iot-Kit project directory}/src/main/ui/app/www/Main.jsx and comment the code (do a text search.). Change the line: return [{path: "/user/signup", text: "Sign Up"}]; To the following: return [/* {path: "/user/signup", text: "Sign Up"} */];

Note: -

Replace the ://<INSTALLATION_SERVER_HOST:PORT> with the actual server hostname and port where your installation of the Dashboard is running.

Note: -

This is a one-time operation to be done by the admin user having the AWS credentials. This is a must for the User-Signup feature to function correctly.

Note: -

User Sign up is enabled by default.

Page 42: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 42 of 65 Jan 11, 2018

6.8.1.2 Backend Edit the file src/main/java/com/renesas/iot/application/usermanagement/api/UserController.java. Comment out the lines of code, above the method register as shown below using “/* */”. (Marked in bold)

/*

@RequestMapping(value = "/user", consumes = "application/json", produces = "application/json", method = RequestMethod.POST)

*/

private ResponseEntity register(@RequestBody UserInfo user, HttpServletResponse httpResponse) {

6.8.2 Enabling user signup To re-enable Signup, you must make changes in the UI as well as backend code.

6.8.2.1 UI To re-enable the user signup feature again, remove comments in all the three files used in disabling the Signup feature.

1. Open {Iot-Kit project directory}/src/main/ui/app/www/modules/user/routes.js in a text editor. 2. Search for the route /user/signup. 3. Remove the comments inserted during disabling, as indicated, and save this file:

Change the following section: /* { path: "/user/signup", controller: context => { return { component: SignUpView, context: Object.assign({navbar: false}, context) }; } }, */ to: { path: "/user/signup", controller: context => { return { component: SignUpView, context: Object.assign({navbar: false}, context) }; } },

4. Unhide the Signup button on the landing page. 5. Open {Iot-Kit project directory}/src/main/ui/app/www/modules/user/View.jsx. 6. Remove the comment inserted while disabling. Change the line: {/*

<a className="button inline sign-up" href="#/user/signup">Sign Up</a> */}

Page 43: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 43 of 65 Jan 11, 2018

To the following line and save the file.

<a className="button inline sign-up" href="#/user/signup">Sign Up</a> 7. Open {Iot-Kit project directory}/src/main/ui/app/www/Main.jsx and uncomment the code (do a text search):

Change the line:

return [/* {path: "/user/signup", text: "Sign Up"} */];

To the following line:

return [{path: "/user/signup", text: "Sign Up"}];

6.8.2.2 Backend To re-enable the Signup feature uncomment the code in the UserController.java file, commented during disabling the Signup feature, above.

1. Change the line: /*

@RequestMapping(value = "/user", consumes = "application/json", produces = "application/json", method = RequestMethod.POST)

*/

2. To the following line: @RequestMapping(value = "/user", consumes = "application/json", produces = "application/json", method = RequestMethod.POST)

Signing Out a user On clicking Sign Out a logged in user is logged out of all open sessions. For example: If a user has logged in from different browsers, simultaneously, then clicking on Sign Out in any one browser/tab will logout the user from all logged in sessions.

7 Customizing UI theme and branding The UI allows limited customization, theming and branding capabilities. It allows basic color and branding logo changes.

Color customizations The application color theme can be changed by changing colors in the theme configuration file. It is located in the directory:

src/main/ui/app | +- less/ | - colors.less

Note: -

After every change (disable/ enable), you must build and deploy the application again.

Page 44: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 44 of 65 Jan 11, 2018

Colors (Theming)

// Blue color @brand-color: #0460BD; // Generic background @base-color: #fff; // Dashboard background @bg-color: #fefefe; // Alternate color (User management pages) @alt-bg-color: @brand-color; // Generic text color @text-color: desaturate(lighten(@brand-color, 25%), 10%); // Text color for alt background pages @alt-text-color: darken(@bg-color, 10%); // Label color for forms @form-label-color: #706f6f; // Color for form input fields @form-text-color: #000; // Background color for selected elements (For example, navigation bar) @selected-bg-color: @brand-color; // Alternate selection color. (For example, Device list in remote monitoring) @selected-bg-color-alt: rgba(0,0,0,0.08); @selected-text-color: @alt-text-color; // Color for mouse hovers @active-bg-color: lighten(@selected-bg-color, 50%); @active-text-color: @alt-text-color; // Color for primary buttons (For example, Save, etc.) @primary-color: rgb(233,97,33); @primary-text-color: #fff; @primary-action-bg-color: @primary-color; @primary-action-text-color: @primary-text-color; // Color for secondary buttons (For example, Cancel, etc.) @secondary-color: rgb(153,153,153); @secondary-text-color: #fff; @secondary-action-bg-color: @secondary-color; @secondary-action-text-color: @secondary-text-color; // Colors for links (For example, <a class=”link” />) @link-color: #3891de; // Dashboard configuration @dashboard-bg: transparent; @dashboard-fg: inherit; @widget-bg: #fff; @widget-fg: @text-color;

Page 45: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 45 of 65 Jan 11, 2018

@widget-header-bg: inherit; @widget-header-fg: @brand-color; @widget-content-bg: inherit; @widget-content-fg: inherit; @gauge-dial-color: #999; @gauge-value-color: @brand-color; @gauge-value-text-color: @brand-color;

Changing these colors affect the entire UI color scheme, including dashboard widgets.

Figure 6 Dashboard color themes — example 1

Page 46: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 46 of 65 Jan 11, 2018

Figure 7 Dashboard color themes — example 2

Branding All the branding related assets are located in the images directory. Simply replace these images with your own logo and favicon images (Note: The images used have to be the same size).

src/main/ui/app | +- images/ | - logo.jgp (Contains the top logo) - favicon.png (contains the favicon)

Figure 8 Synergy Enterprise Cloud Toolbox Dashboard widgets

Page 47: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 47 of 65 Jan 11, 2018

Sample Rebranded UI

Figure 9 Rebranded sample user interface widgets

8 Installing e2 studio and importing a project Installing e2 studio

Install e2 studio that can be obtained from the Renesas Synergy™ Gallery.

Importing/creating the project See the included application note, Importing a Renesas Synergy Project (r11an0023eu0118-synergy-ssp-import-guide.pdf), for instructions on importing, building, and running a project in e2 studio ISDE.

Import the existing project into workspace, build it, and run it on the target platform.

Adding the board support package to the AE-CLOUD1 Kit manually 1. Extract the Synergy_Enterprise_Cloud_Toolbox_AE_CLOUD1.zip. 2. Open the unzipped folder Synergy_Enterprise_Cloud_Toolbox_AE_CLOUD1. Locate the BSP file,

Renesas.S5D9_IOT_BOARD.1.3.2.pack. 3. Copy the file (see Figure 10) to the following location: C:\Renesas\e2_studio\internal\projectgen\arm\Packs.

Page 48: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 48 of 65 Jan 11, 2018

Figure 10 Load BSP Pack for IoT Fast Prototyping Kit Board

Importing/creating the project manually 1. Open e2 studio.

At the end of e2 studio start up, you see the Workspace Launcher Dialog box.

Figure 11 Workspace Launcher dialog

2. Do one of the following: If you see the Workspace Launcher dialog box, continue to perform the following steps. If you do not see this dialog box, you might have turned it off. If this is the case, open your desired project and

skip to step 5. 3. Enter a new workspace name in the Workspace Launcher dialog box.

e2 studio creates a new workspace with this name.

Note: -

If e2 studio is installed in any other location, the same information needs to be provided to copy the pack.

Page 49: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 49 of 65 Jan 11, 2018

Figure 12 Workspace Launcher dialog 4. Click OK.

5. When the workspace is opened, you may see the Welcome Window. If that happens, click the Workbench arrow to proceed past the Welcome Screen.

Figure 13 Workbench arrow You are now in the workspace into which you want to import the project.

6. Click the File menu in the menu bar.

Figure 14 Menu and tool bar

Page 50: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 50 of 65 Jan 11, 2018

7. Click Import from the File menu.

Figure 15 File drop-down menu 8. In the Import dialog box, select Rename & Import Existing/C++ Project into Workspace, to import the project

into the current workspace. Click Next.

Figure 16 Project Import dialog

Page 51: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 51 of 65 Jan 11, 2018

9. Click Select archive file.

Figure 17 Rename and Import Project dialog 10. Click Browse.

Browse to the folder where the zip file for the project you want to import is located.

11. Select the file for import. In our example, it is Synergy_Enterprise_Cloud_Toolbox.zip. Click Open.

Note: -

If using PK-Cloud1, the zip file to be loaded is Synergy_Enterprise_Cloud_Toolbox_PK_CLOUD1.zip and

for AE-Cloud1, the zip file to be loaded is Synergy_Enterprise_Cloud_Toolbox_AE_CLOUD1.zip

Page 52: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 52 of 65 Jan 11, 2018

12. Select the project to import from the Projects list. Give the new project a name.

Figure 18 Rename and Import Project dialog 13. Click Finish to complete importing the project.

Installing the Synergy License Building and running example applications requires a Synergy license to be installed in e2 studio. If this license is not installed, a box displays in the ISDE, after you have imported your example application.

Figure 19 Synergy License Required prompt

Page 53: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 53 of 65 Jan 11, 2018

1. To install the license, click Click here to set up the license. This takes you to the Synergy License setup window.

Figure 20 Synergy License file

2. Click Browse to go to the folder where your default Synergy License is stored. Select this file to install the license.

The Synergy License Require prompt disappears and the build can begin.

Generating the Project Files 1. In the Project Explorer, select the recently imported project.

Figure 21 Project Explorer Window

Note: -

Make sure to select the license associated with the correct SSP version.

Page 54: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 54 of 65 Jan 11, 2018

2. If not already open, double-click the configuration.xml file in Project Explorer to start the Synergy Configuration.

Figure 22 Synergy Project Configuration window

3. In the Synergy Configuration window, click Generate Project Content.

Figure 23 Generate Project Content button

Note: -

The synergy and synergy_cfg folders have not been created. These two folders contain files generated by e2 studio and the SSP. The next step generates these files.

Page 55: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 55 of 65 Jan 11, 2018

Building the project The project can be built either for the Debug or for the Release version. Select one of these build versions, then click the dropdown arrow near hammer icon on the tool bar. This action also starts the build process for the project.

Figure 24 Build project A successful build produces an output similar to the following screen.

Figure 25 Error-free build example

Running the application/Flash on PK-CLOUD1 or AE-CLOUD1 kit 1. Click the Debug icon drop-down menu. Select Debug Configurations... option.

Figure 26 Debug options 2. Under the Renesas GDB Hardware Debug section, select the name of the project that was imported recently.

Select either the Debug or Release version, depending upon the build compiled.

Page 56: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 56 of 65 Jan 11, 2018

3. Be sure the .elf filename (text highlighted in figure) matches the one the project generated inside the debug folder.

Figure 27 Debug Configurations window

4. Click the Debugger tab located on the dialog box.

5. Ensure the Debug hardware setting is set to J-Link ARM. If not, change it using the drop-down menu.

6. Ensure the Target Device setting (see highlighting in figure) matches the target hardware. If it does not match, click the “…” button to select the correct target device from the Synergy device list.

Figure 28 Debug Configurations debugger setup 7. Click Debug button to start debugging.

8. Click Yes to open the Debug Perspective.

Page 57: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 57 of 65 Jan 11, 2018

Figure 29 Perspective Switch dialog

9. Press F8 or click Resume to start the application.

Figure 30 Resume button 10. Press F8 or click Resume at the main screen to continue.

9 Configuring the IAR Build The IAR EW for Synergy and the toolchain can be configured by following the steps given in the link:

https://synergygallery.renesas.com/media/products/25/220/en-US/GSEWSYNERGY-4.PDF

Adding the board support package to the IoT Fast Prototyping Kit manually 1. Extract the project Synergy_Enterprise_Cloud_Toolbox_AE_CLOUD1.zip. Open the unzipped folder

Synergy_Enterprise_Cloud_Toolbox_AE_CLOUD1 and locate the BSP file “Renesas.S5D9_IOT_BOARD.1.3.2.pack”

2. Copy the file to following location. C:\Renesas\Synergy\SSC_v5_4_0_023\internal\projectgen\arm\Packs

Note: -

The application is now running on the hardware.

Note: -

If IAR for Synergy and the SSC are installed in any other location, the same information needs to be provided to copy the pack.

Page 58: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 58 of 65 Jan 11, 2018

Importing the project manually Once configured, the Synergy Enterprise Cloud Toolbox demonstration application project can be added as an existing project in IAR EW for Synergy.

1. Go to Project -> Add Existing Project.

Figure 31 Project menu

2. Go to folder where the project file is located and select the Synergy_Enterprise_Cloud_Toolbox.ewp file:

Figure 32 Project selection

Page 59: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 59 of 65 Jan 11, 2018

3. Go to Renesas Synergy -> Configurator.

Figure 33 Renesas Synergy Configurator

4. Click Generate Project Content and save all in IAR EW for Synergy IDE.

Figure 34 Generate Project Content

5. The project can be built either for Debug or for Release version. These build versions can be selected from the drop down located below the workspace banner as shown in figure below.

Figure 35 Select The Build Variant

Page 60: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 60 of 65 Jan 11, 2018

6. To build the project, right-click the project name and select the Rebuild All option.

Figure 36 Build the project

7. Click the Download and Debug icon on the toolbar.

Figure 37 Download and debug

Page 61: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 61 of 65 Jan 11, 2018

8. To run the application press F5 or go to Debug -> Go.

Figure 38 Run Project

9. After running the program, the device is now ready to be accessed via the serial console.

Page 62: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 62 of 65 Jan 11, 2018

10 Cellular framework configuration, issues, and workarounds

Configuration 1. The Cellular Framework implementation in SSP v1.3.0 and above supports NimbeLink CAT3 modules. The

following part numbers are used for the three supported NimbeLink CAT3 modems:

NL-SW-LTE-TSVG NL-SW-LTE-TEUG NL-SW-LTE-TNAG

2. The Cellular framework implementation only supports NL-SW-LTE-TSVG and NL-SW-LTE-TEUG modems. The

type of modem can be configured through ISDE.

Figure 39 Cellular framework Modem type configuration

Note: Be sure to configure the correct modem type in the project. Failing to do so causes a cellular framework initialization failure. • For the Asia and Europe regions, the modem part number NL-SW-LTE-TEUG must be used. • For the USA, the modem part number NL-SW-LTE-TSVG must be used.

3. Before running the project, connect the CAT3 PMOD cellular module to PMODB on the PK-CLOUD1 device.

The CAT3 module has a slot for a SIM card. You need to purchase a SIM card and a data plan for it from the Cellular Service provider. The CAT3 module IMEI number and the SIM ID number from the SIM card is needed when you activate a data plan with the service provider. The service provider for the SIM card activates the CAT3 module and adds the device to their network (can be done over the phone or via email).

After successfully activating the CAT3 module on the service provider’s network, use the command line interface to configure your CAT3 module for one of the supported services. Supported service providers are Tata Docomo Network (India), Jio (India), Verizon (USA), and Vodafone (Europe).

Note: -

This section applies only to the PK-CLOUD1 project.

Page 63: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 63 of 65 Jan 11, 2018

Notes: 1. Sometimes the service provider associates the IMEI and SIM numbers together. It may not work to interchange

the SIM with different cellular hardware modules. 2. The Synergy Enterprise Cloud Toolbox requires the use of the PK-Cloud1 kit (not sold commercially). To get

one, contact your Renesas sales office. 3. To configure a Cellular setup, use the command cell <APN> <Context ID>><PDP Type>. 4. Valid APN and Context ID information needs to be obtained from the service provider: 5. Valid Context ID range is 1 to 5

a. For Tata Docomo SIM in India, use the command cell internet 1 IP b. For Jio SIM in India, use the command cell internet 1 IP c. For Verizon SIM in USA, use the command cell VZWINTERNET 3 IPV4V6 d. For Vodafone in Europe, use the command cell internet 1 IP

Issues 1. It has been observed while testing with Jio in India, the SIM on occasion takes longer to register with the Network.

The Cellular framework does a fixed number of retries for the command to check the network registration status. Due to the behavior observed with Jio SIM, the cellular framework runs out of retries and fails.

2. Verizon SIM’s provisioned with an APN value of UWSEXT.GW15.VZWENT will not work with this application

project. Ensure that if a Verizon SIM is used, the APN is provisioned to vzwinternet. This setting is not controlled by this application project. Contact Verizon to provision your SIM card.

Workarounds The number of retries for the command which checks the network registration status needs to be increased. The default value for number of retries is 5; it needs to be increased to 20. To modify this value, Synergy-Builder needs to be disabled.

1. To disable Synergy-Builder, right click on project and go to project properties. In the properties window go to Builders and un-check the box for Synergy Builder. See the figure below:

Figure 40 Disable Synergy Builder

Note: -

This may be applicable with other SIM cards as well. The work around for this issue is described in the section below.

Page 64: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 64 of 65 Jan 11, 2018

2. After disabling the Synergy Builder, modify the code under synergy/ssp_supplemetal/src/framework/sf_cellular_cat3/sf_cellular_cat3.c as shown below. (See text in bold).

Old Code:

/** AT Command set to read registration status */

[SF_CELLULAR_AT_CMD_INDEX_AT_CREG] =

{

.p_cmd = (uint8_t *) "AT+CREG?\r\n",

.p_success_resp = (uint8_t *) "+CREG: 0,1",

.max_resp_length = SF_CELLULAR_STR_LEN_32,

.retry = SF_CELLULAR_RETRY_VALUE_5,

.retry_delay = SF_CELLULAR_DELAY_500MS

},

New Code:

/** AT Command set to read registration status */

[SF_CELLULAR_AT_CMD_INDEX_AT_CREG] =

{

.p_cmd = (uint8_t *) "AT+CREG?\r\n",

.p_success_resp = (uint8_t *) "+CREG: 0,1",

.max_resp_length = SF_CELLULAR_STR_LEN_32,

.retry = 20,

.retry_delay = SF_CELLULAR_DELAY_500MS

},

11 Further improvements Securing Key Storage

Private keys for the device are stored unencrypted in data flash because secure key storage is out of scope for this project. Potential solutions for secure key storage are:

1. Use of an external secure element

2. Use of key wrapping to encrypt private keys

Supporting RSA key lengths greater than 2048 bits The NX Secure implementation currently only uses SCE for cryptographic and hashing operations. RSA keys are limited to 1024 or 2048 bits in length. It is possible that TLS-enabled servers may require support for keys greater than 2048 bits in length and this SECT implementation does not interoperate with those TLS-enabled servers.

For example, validating the Microsoft Azure IoT server certificate chain requires using 4096-bit RSA keys. SECT contains a workaround that supports Azure IoT. This workaround is specific to Azure IoT and does not work with any other TLS server that requires 4096-bit RSA keys. To support key lengths greater than 2048 bits, you should implement RSA operations in software.

Storing credentials in clear text This project stores Wi-Fi passwords and user credentials for the Dashboard on the device in clear text. Storing this data on the device provides a better user experience during the evaluation process: You do not need to re-enter credentials during provisioning of the Wi-Fi interface and the device for a given IoT cloud provider. In production scenarios, storing any sensitive data in clear text on the device should be avoided. This data can be encrypted using a device-specific hardware root key (HRK) and stored in the data flash.

Page 65: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Renesas Synergy™ Platform Synergy Enterprise Cloud Toolbox

R20AN0485EU0108 Rev.1.08 Page 65 of 65 Jan 11, 2018

Website and Support Support: https://synergygallery.renesas.com/support

Technical Contact Details:

• America: https://www.renesas.com/en-us/support/contact.html • Europe: https://www.renesas.com/en-eu/support/contact.html • Japan: https://www.renesas.com/ja-jp/support/contact.html All trademarks and registered trademarks are the property of their respective owners.

Page 66: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

Revision History

Rev. Date Description Page Summary

1.00 Dec 18, 2017 — Initial release 1.08 Jan 11, 2018 — Removed Staging server configuration on device and updated

procedures

Page 67: Synergy Enterprise Cloud Toolbox - Application Project · 2018. 2. 6. · The Synergy Enterprise Cloud Toolbox and supporting documentation aids the user in evaluating and developing

http://www.renesas.comRefer to "http://www.renesas.com/" for the latest and detailed information.

Renesas Electronics America Inc.1001 Murphy Ranch Road, Milpitas, CA 95035, U.S.A.Tel: +1-408-432-8888, Fax: +1-408-434-5351Renesas Electronics Canada Limited9251 Yonge Street, Suite 8309 Richmond Hill, Ontario Canada L4C 9T3Tel: +1-905-237-2004Renesas Electronics Europe LimitedDukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, U.KTel: +44-1628-651-700, Fax: +44-1628-651-804Renesas Electronics Europe GmbHArcadiastrasse 10, 40472 Düsseldorf, GermanyTel: +49-211-6503-0, Fax: +49-211-6503-1327Renesas Electronics (China) Co., Ltd.Room 1709 Quantum Plaza, No.27 ZhichunLu, Haidian District, Beijing, 100191 P. R. ChinaTel: +86-10-8235-1155, Fax: +86-10-8235-7679Renesas Electronics (Shanghai) Co., Ltd.Unit 301, Tower A, Central Towers, 555 Langao Road, Putuo District, Shanghai, 200333 P. R. ChinaTel: +86-21-2226-0888, Fax: +86-21-2226-0999Renesas Electronics Hong Kong LimitedUnit 1601-1611, 16/F., Tower 2, Grand Century Place, 193 Prince Edward Road West, Mongkok, Kowloon, Hong KongTel: +852-2265-6688, Fax: +852 2886-9022Renesas Electronics Taiwan Co., Ltd.13F, No. 363, Fu Shing North Road, Taipei 10543, TaiwanTel: +886-2-8175-9600, Fax: +886 2-8175-9670Renesas Electronics Singapore Pte. Ltd.80 Bendemeer Road, Unit #06-02 Hyflux Innovation Centre, Singapore 339949Tel: +65-6213-0200, Fax: +65-6213-0300Renesas Electronics Malaysia Sdn.Bhd.Unit 1207, Block B, Menara Amcorp, Amcorp Trade Centre, No. 18, Jln Persiaran Barat, 46050 Petaling Jaya, Selangor Darul Ehsan, MalaysiaTel: +60-3-7955-9390, Fax: +60-3-7955-9510Renesas Electronics India Pvt. Ltd.No.777C, 100 Feet Road, HAL 2nd Stage, Indiranagar, Bangalore 560 038, IndiaTel: +91-80-67208700, Fax: +91-80-67208777Renesas Electronics Korea Co., Ltd.17F, KAMCO Yangjae Tower, 262, Gangnam-daero, Gangnam-gu, Seoul, 06265 KoreaTel: +82-2-558-3737, Fax: +82-2-558-5338

SALES OFFICES

© 2018 Renesas Electronics Corporation. All rights reserved.Colophon 7.0

(Rev.4.0-1 November 2017)

Notice1. Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples. You are fully responsible for

the incorporation or any other use of the circuits, software, and information in the design of your product or system. Renesas Electronics disclaims any and all liability for any losses and damages incurred by

you or third parties arising from the use of these circuits, software, or information.

2. Renesas Electronics hereby expressly disclaims any warranties against and liability for infringement or any other claims involving patents, copyrights, or other intellectual property rights of third parties, by or

arising from the use of Renesas Electronics products or technical information described in this document, including but not limited to, the product data, drawings, charts, programs, algorithms, and application

examples.

3. No license, express, implied or otherwise, is granted hereby under any patents, copyrights or other intellectual property rights of Renesas Electronics or others.

4. You shall not alter, modify, copy, or reverse engineer any Renesas Electronics product, whether in whole or in part. Renesas Electronics disclaims any and all liability for any losses or damages incurred by

you or third parties arising from such alteration, modification, copying or reverse engineering.

5. Renesas Electronics products are classified according to the following two quality grades: “Standard” and “High Quality”. The intended applications for each Renesas Electronics product depends on the

product’s quality grade, as indicated below.

"Standard": Computers; office equipment; communications equipment; test and measurement equipment; audio and visual equipment; home electronic appliances; machine tools; personal electronic

equipment; industrial robots; etc.

"High Quality": Transportation equipment (automobiles, trains, ships, etc.); traffic control (traffic lights); large-scale communication equipment; key financial terminal systems; safety control equipment; etc.

Unless expressly designated as a high reliability product or a product for harsh environments in a Renesas Electronics data sheet or other Renesas Electronics document, Renesas Electronics products are

not intended or authorized for use in products or systems that may pose a direct threat to human life or bodily injury (artificial life support devices or systems; surgical implantations; etc.), or may cause

serious property damage (space system; undersea repeaters; nuclear power control systems; aircraft control systems; key plant systems; military equipment; etc.). Renesas Electronics disclaims any and all

liability for any damages or losses incurred by you or any third parties arising from the use of any Renesas Electronics product that is inconsistent with any Renesas Electronics data sheet, user’s manual or

other Renesas Electronics document.

6. When using Renesas Electronics products, refer to the latest product information (data sheets, user’s manuals, application notes, “General Notes for Handling and Using Semiconductor Devices” in the

reliability handbook, etc.), and ensure that usage conditions are within the ranges specified by Renesas Electronics with respect to maximum ratings, operating power supply voltage range, heat dissipation

characteristics, installation, etc. Renesas Electronics disclaims any and all liability for any malfunctions, failure or accident arising out of the use of Renesas Electronics products outside of such specified

ranges.

7. Although Renesas Electronics endeavors to improve the quality and reliability of Renesas Electronics products, semiconductor products have specific characteristics, such as the occurrence of failure at a

certain rate and malfunctions under certain use conditions. Unless designated as a high reliability product or a product for harsh environments in a Renesas Electronics data sheet or other Renesas

Electronics document, Renesas Electronics products are not subject to radiation resistance design. You are responsible for implementing safety measures to guard against the possibility of bodily injury, injury

or damage caused by fire, and/or danger to the public in the event of a failure or malfunction of Renesas Electronics products, such as safety design for hardware and software, including but not limited to

redundancy, fire control and malfunction prevention, appropriate treatment for aging degradation or any other appropriate measures. Because the evaluation of microcomputer software alone is very difficult

and impractical, you are responsible for evaluating the safety of the final products or systems manufactured by you.

8. Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product. You are responsible for carefully and

sufficiently investigating applicable laws and regulations that regulate the inclusion or use of controlled substances, including without limitation, the EU RoHS Directive, and using Renesas Electronics

products in compliance with all these applicable laws and regulations. Renesas Electronics disclaims any and all liability for damages or losses occurring as a result of your noncompliance with applicable

laws and regulations.

9. Renesas Electronics products and technologies shall not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited under any applicable domestic or foreign laws

or regulations. You shall comply with any applicable export control laws and regulations promulgated and administered by the governments of any countries asserting jurisdiction over the parties or

transactions.

10. It is the responsibility of the buyer or distributor of Renesas Electronics products, or any other party who distributes, disposes of, or otherwise sells or transfers the product to a third party, to notify such third

party in advance of the contents and conditions set forth in this document.

11. This document shall not be reprinted, reproduced or duplicated in any form, in whole or in part, without prior written consent of Renesas Electronics.

12. Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electronics products.

(Note 1) “Renesas Electronics” as used in this document means Renesas Electronics Corporation and also includes its directly or indirectly controlled subsidiaries.

(Note 2) “Renesas Electronics product(s)” means any product developed or manufactured by or for Renesas Electronics.