Send the data of GR-PEACH_HVC-P2_sample to the cloud.

Dependencies:   AsciiFont GR-PEACH_video GraphicsFramework LCD_shield_config R_BSP USBHost_custom easy-connect-gr-peach

Fork of mbed-os-example-client by mbed-os-examples

Note at the time of sample import

Please not check the "Update all libraries to the latest version" at the time of import.

Warning!

When exporting and using it, increase the following stack size.

mbed-os/features/FEATURE_LWIP/lwip-interface/lwipopts.h

#define TCPIP_THREAD_STACKSIZE      1024
->
#define TCPIP_THREAD_STACKSIZE      2048

Overview

This is a sample to send the analysis result of GR-PEACH_HVC-P2_sample to the cloud using mbed-client. Please refer to following for operation of HVC-P2.

Import programGR-PEACH_HVC-P2_sample

Sample to operate omron HVC-P2 on GR-PEACH.


Required hardware

Application setup

Client credentials

To register the application to mbed Device Connector, you need to create and set the client side certificate.

  1. Go to https://connector.mbed.com/ and log in with your mbed account
  2. On mbed Device Connector, go to https://connector.mbed.com/#credentials and click the Get my device security credentials button to get new credentials for your device.
  3. Replace the contents in security.h of this example with content copied above.

Ethernet settings

This sample uses Ethernet as the default connection type. To change the connection type, set WIFI_BP3595 in mbed_app.json:

mbed_app.json

"network-interface":{
    "help": "Options are ETHERNET, WIFI_ESP8266, WIFI_BP3595",
    "value": "ETHERNET"
},


To specify MAC address, add fllowing function to main.cpp. (When using Wifi, setting of MAC address is not necessary.)

Specify MAC address

// set mac address
void mbed_mac_address(char *mac) {
    mac[0] = 0x00;
    mac[1] = 0x02;
    mac[2] = 0xF7;
    mac[3] = 0xF0;
    mac[4] = 0x00;
    mac[5] = 0x00;
}


Wifi settings

This example can use BP3595 Wifi Interface for managing the wireless connectivity. To run this example using Wifi, you need:

  1. A BP3595 Wifi module ( https://developer.mbed.org/components/BP3595-for-GR-PEACH/ )
  2. Mount BP3595 onto GR-PEACH
  3. Close GR-PEACH's JP21 (https://developer.mbed.org/teams/Renesas/wiki/Jumper-settings-of-GR-PEACH)
  4. In the mbed_app.json file, change

mbed_app.json

"network-interface":{
    "help": "Options are ETHERNET, WIFI_ESP8266, WIFI_BP3595",
    "value": "WIFI_BP3595"
},


Provide your Wifi SSID and password here and leave \" in the beginning and end of your SSID and password as shown in the example below:

mbed_app.json

"wifi-ssid": {
    "help": "WiFi SSID",
    "value": "\"SSID\""
},
"wifi-password": {
    "help": "WIFI Password",
    "value": "\"Password\""
}


Specify the security type for connection to be used. When the security type is WPA2, you need to specify NSAPI_SECURITY_WAP as follows:

mbed_app.json

"wifi-security":{
    "help": "Options are NSAPI_SECURITY_WEP, NSAPI_SECURITY_WPA, NSAPI_SECURITY_WPA2, NSAPI_SECURITY_WPA_WPA2",
    "value": "NSAPI_SECURITY_WEP"
},

By default, NSAPI_SECURITY_WPA_WPA2 is specified here.

Application resources

This example exposes four resources listed below:

  1. 3202/0/5700. Recognition result from HVC-P2 (GET).
  2. 3201/0/5850. Blink function, blinks LED when executed (POST).
  3. 3201/0/5853. Blink pattern, used by the blink function to determine how to blink. In the format of 1000:500:1000:500:1000:500 (PUT).
  4. 3201/0/5855. Blink color, used by the blink function. Any of red, green, blue, cyan, yellow and magenta is acceptable (PUT).

For more info on how to get notifications when resource 1 changes, or how to use resource 2, 3 and 4, please look at

Import programGR-PEACH_mbed-connector-ZXingSample-node

Node.js based Web Application for mbed Device Connector specific to GR-PEACH_mbed-os-client-ZXingSample

# This is a Web Application for GR-PEACH_mbed-os-client-ZXingSample, but it can also be used for this sample.

Revision:
71:ec259c9b02ea
Parent:
70:23c95e43feb9
Child:
72:d0c254f237c4
--- a/README.md	Thu Mar 09 14:30:14 2017 +0000
+++ b/README.md	Mon Mar 13 13:00:12 2017 +0000
@@ -22,6 +22,7 @@
 
  This example has been tested in following configuration
  * K64F + NXP MCR20 15.4 shield (mesh `NANOSTACK_FULL` mode)
+ * [NUCLEO_F429ZI](https://developer.mbed.org/platforms/ST-Nucleo-F429ZI/) + [X-NUCLEO-IDS01A4](https://github.com/ARMmbed/stm-spirit1-rf-driver) Spirit1 6LoWPAN expansion board (mesh `LOWPAN_ROUTER` mode)
  * NUCLEO_F429ZI + ATMEL AT233 15.4 shield (mesh `LOWPAN_ROUTER` mode)
  * K64F (Ethernet)
  * NUCLEO_F429ZI (Ethernet)
@@ -84,14 +85,13 @@
 
 ### 6LoWPAN ND and Thread settings
 
-First, you need to select the RF driver to be used by the 6LoWPAN/Thread stack. This example supports [AT86RF233/212B](https://github.com/ARMmbed/atmel-rf-driver) and [NXP-MCR20a](https://github.com/ARMmbed/mcr20a-rf-driver) radio shields.
+First, you need to select the RF driver to be used by the 6LoWPAN/Thread stack. This example supports [AT86RF233/212B](https://github.com/ARMmbed/atmel-rf-driver), [NXP-MCR20a](https://github.com/ARMmbed/mcr20a-rf-driver), and [X-NUCLEO-IDS01A4](https://github.com/ARMmbed/stm-spirit1-rf-driver) (*a.k.a.* Spirit1) radio shields.
 
-To add the Atmel driver to your application from the command line, call: `mbed add https://github.com/ARMmbed/atmel-rf-driver`.
-Please make sure that the `mbed_app.json` file points to the correct radio driver type:
+To choose the radio shield make sure that the `mbed_app.json` file points to the correct radio driver type:
 
 ```json
     "mesh_radio_type": {
-        	"help": "options are ATMEL, MCR20",
+        	"help": "options are ATMEL, MCR20, SPIRIT1",
         	"value": "ATMEL"
         },
 ```
@@ -137,6 +137,35 @@
 
 You can view debug traces from the gateway with a serial port monitor. The gateway uses baud rate 460800. The gateway IPv6 address is correctly configured when the following trace is visible: `Eth bootstrap ready, IP=XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX`.
 
+<span class="notes">**Note:** In case you want to use the NUCLEO_F429ZI + X-NUCLEO-IDS01A4 target hardware configuration, you need also to use the [stm32-border-router](https://github.com/ARMmbed/stm32-border-router) (that can be used only as a 6LoWPAN BR and only with NUCLEO_F429ZI) as gateway router. In this case, you need to enable another security feature. By default, the `stm32-border-router` uses `PSK` as security.</span>
+
+You can enable the security here on your mbed-os-example-client application, for example:
+
+```json
+    "target_overrides": {
+        "*": {
+            "mbed-mesh-api.6lowpan-nd-security-mode": "PSK",
+        }
+	}
+```
+
+Alternatively, you can remove the link layer security from the `stm32-border-router`. To do that, change the [mbed_app.json](https://github.com/ARMmbed/stm32-border-router/blob/master/mbed_app.json) fetched from the `stm32-border-router` repository, for example: 
+
+```json
+    "config": {
+            "security-mode": "NONE",
+        }
+```
+
+Furthermore, for the STM Spirit1 Sub-1 GHz RF expansion board (X-NUCLEO-IDS01A4) you need also to configure its MAC address in the `mbed_app.json` file, for example:
+```json
+    "target_overrides": {
+        "*": {
+            "spirit1.mac-address": "{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7}"
+        },
+    }
+```
+
 #### Channel settings
 
 The default 2.4GHz channel settings are already defined by the [mbed-mesh-api](https://github.com/ARMmbed/mbed-mesh-api) to match the mbed gateway settings. The application can override these settings by adding them to the `mbed_app.json` file in the main project directory. For example:
@@ -152,7 +181,7 @@
     }
 ```
 
-For sub-GHz shields (AT86RF212B) use the following overrides, **6LoWPAN ND only**:
+For sub-GHz shields ([Spirit1](https://github.com/ARMmbed/stm-spirit1-rf-driver) or AT86RF212B) use the following overrides, **6LoWPAN ND only**:
 
 ```json
 "mbed-mesh-api.6lowpan-nd-channel-page": 2,