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:
68:1a8e13b21e7e
Parent:
63:c73f78fd7982
Child:
69:64f9214729ae
--- a/README.md	Tue Feb 28 12:45:10 2017 +0000
+++ b/README.md	Thu Mar 09 11:15:21 2017 +0000
@@ -18,7 +18,7 @@
 * mbed 6LoWPAN shield (AT86RF212B/[AT86RF233](https://firefly-iot.com/product/firefly-arduino-shield-2-4ghz/)) for 6LoWPAN ND and Thread.
 * Ethernet cable and connection to the internet.
 
-## Supported Target hardware configurations
+## Supported target hardware configurations
 
  This example has been tested in following configuration
  * K64F + NXP MCR20 15.4 shield (mesh `NANOSTACK_FULL` mode)
@@ -26,8 +26,8 @@
  * K64F (Ethernet)
  * NUCLEO_F429ZI (Ethernet)
  * UBLOX_EVK_ODIN_W2 (WiFi & Ethernet - use the supplied `configs/eth_v4.json` for Ethernet)
- * K64F + GROVE SEEED shield (Wifi)
- * NUCLEO_F429ZI + GROVE SEEED shield (Wifi)
+ * K64F + GROVE SEEED shield (WiFi)
+ * NUCLEO_F429ZI + GROVE SEEED shield (WiFi)
 
 Apart from this, this example can work on other mbed OS supported hardware boards which support any of the given network interface including Ethernet, WiFi, Mesh (6LoWPAN) or Thread, provided the configuration fulfills condition that the target hardware has TLS entropy implemented for it and the complete example configuration of mbed Client, selected network interface and mbed OS components fits into hardware's given memory size (Flash size and RAM size). 
 
@@ -59,9 +59,9 @@
 1. [Set the client credentials](#client-credentials).
 1. [Change 6LoWPAN ND & Thread settings](#6lowpan-nd-and-thread-settings).
 1. [Change Ethernet settings](#ethernet-settings).
-1. [Change Wi-Fi settings](#wi-fi-settings).
+1. [Change WiFi settings](#wifi-settings).
 1. [Set up an IP address](#ip-address-setup). This step is optional.
-1. [Change the socket type](#changing-socket-type). This step is optional.
+1. [Change the socket type](#changing-the-socket-type). This step is optional.
 
 ### Connection type
 
@@ -86,7 +86,7 @@
 
 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.
 
-To add the Atmel driver to you application from command line, call: `mbed add https://github.com/ARMmbed/atmel-rf-driver`.
+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:
 
 ```json
@@ -132,7 +132,7 @@
 
 #### mbed gateway
 
-To connect the example application in 6LoWPAN ND or Thread mode to Connector, you need to set up an mbed 6LoWPAN gateway router as follows:
+To connect the example application in 6LoWPAN ND or Thread mode to mbed Device Connector, you need to set up an mbed 6LoWPAN gateway router as follows:
 
 1. Use an Ethernet cable to connect the mbed 6LoWPAN gateway router to the internet.
 2. Use a micro-USB cable to connect the mbed 6LoWPAN gateway router to your computer. The computer will list the router as removable storage.
@@ -141,7 +141,7 @@
 	* For the **6LoWPAN ND** bootstrap, use `gateway6LoWPANDynamic.bin`.
 	* For the **Thread** bootstrap, use `gatewayThreadDynamic.bin`.
 
-	The dynamic binaries use IPv6 autoconfiguration and enable the client to connect to the Connector service. The static binaries create a site-local IPv6 network and packets cannot be routed outside.
+	The dynamic binaries use IPv6 autoconfiguration and enable the client to connect to the mbed Device Connector service. The static binaries create a site-local IPv6 network and packets cannot be routed outside.
 
 4. Copy the gateway binary file to the mbed 6LoWPAN gateway router to flash the device. The device reboots automatically after flashing. If that does not happen, press the **Reset** button on the board.
 
@@ -186,7 +186,7 @@
 - An Ethernet cable.
 - An Ethernet connection to the internet.
 
-### Wi-Fi settings
+### WiFi settings
 
 The example application uses ESP8266 WiFi Interface for managing the wireless connectivity. To run this application using WiFi, you need:
 
@@ -231,11 +231,9 @@
     }
 ```
 
-
 ### IP address setup
 
-This example uses IPv4 to communicate with the [mbed Device Connector Server](https://api.connector.mbed.com) except for 6LoWPAN ND and Thread. However, you can easily change it to IPv6
-by changing the mbed_app.json you make:
+This example uses IPv4 to communicate with the [mbed Device Connector Server](https://api.connector.mbed.com) except for 6LoWPAN ND and Thread. However, you can easily change it to IPv6 by changing the `mbed_app.json` you make:
 ```
     "target_overrides": {
         "*": {
@@ -245,15 +243,15 @@
             "mbed-trace.enable": 0
         }
 ```
-by modifying the ipv4-enable or ipv6-enable to true/false. Only one should be true.
+by modifying the `ipv4-enabled` or `ipv6-enabled` to `true/false`. Only one should be true.
 
 The example program should automatically get an IP address from the router when connected over Ethernet or WiFi.
 
 If your network does not have DHCP enabled, you have to manually assign a static IP address to the board. We recommend having DHCP enabled to make everything run smoothly.
 
-### Changing socket type
+### Changing the socket type
 
-Your device can connect to mbed Device Connector via UDP or TCP binding mode. The default and only allowed value is UDP for Thread and 6LowPan. TCP is the default for other connections. The binding mode cannot be changed in 6LoWPAN ND or Thread mode.
+Your device can connect to mbed Device Connector via UDP or TCP binding mode. The default and only allowed value is UDP for Thread and 6LoWPAN. TCP is the default for other connections. The binding mode cannot be changed in 6LoWPAN ND or Thread mode.
 
 To change the binding mode:
 
@@ -314,6 +312,41 @@
 
 Import this repository in the Online IDE and continue from step 3 onwards.
 
+### Compilation problems		
+		
+If you encounter a problem like this when compiling the application:
+		
+```		
+Building project mbed-os-example-client (K64F, GCC_ARM)		
+Scan: .		
+Scan: FEATURE_LWIP		
+Scan: FEATURE_UVISOR		
+Scan: FEATURE_COMMON_PAL		
+Scan: FEATURE_BLE		
+Scan: FEATURE_STORAGE		
+Scan: FEATURE_THREAD_BORDER_ROUTER		
+Scan: FEATURE_THREAD_ROUTER		
+Scan: FEATURE_LOWPAN_BORDER_ROUTER		
+Scan: FEATURE_LOWPAN_ROUTER		
+Scan: FEATURE_LOWPAN_HOST		
+Scan: FEATURE_NANOSTACK_FULL		
+Scan: FEATURE_NANOSTACK		
+Scan: FEATURE_THREAD_END_DEVICE		
+Scan: mbed		
+Scan: env		
+Compile [  0.3%]: NanostackRfPhyAtmel.cpp		
+[ERROR] ./atmel-rf-driver/source/NanostackRfPhyAtmel.cpp:18:44: fatal error: nanostack/platform/arm_hal_phy.h: No such file or directory		
+compilation terminated.		
+```		
+
+You are probably using the LWIP stack with Ethernet or WiFi and you have the mesh RF stacks in the root of this example. You need to tell mbed NOT to compile the related files. To do that, set up a `.mbedignore` file. An example file is available in the `configs` folder.		
+
+This should resolve the issue:
+
+```		
+cp configs/eth-wifi-mbedignore ./.mbedignore		
+```		
+ 		
 ## Monitoring the application
 
 The application prints debug messages over the serial port, so you can monitor its activity with a serial port monitor. The application uses baud rate 115200.
@@ -375,38 +408,3 @@
 
 To learn how to get notifications when resource 1 changes, or how to use resources 2 and 3, read the [mbed Device Connector Quick Start](https://github.com/ARMmbed/mbed-connector-api-node-quickstart).
 
-#### Compilation problems?		
-		
-If you encounter a problem like this when compiling the application:
-		
-```		
-Building project mbed-os-example-client (K64F, GCC_ARM)		
-Scan: .		
-Scan: FEATURE_LWIP		
-Scan: FEATURE_UVISOR		
-Scan: FEATURE_COMMON_PAL		
-Scan: FEATURE_BLE		
-Scan: FEATURE_STORAGE		
-Scan: FEATURE_THREAD_BORDER_ROUTER		
-Scan: FEATURE_THREAD_ROUTER		
-Scan: FEATURE_LOWPAN_BORDER_ROUTER		
-Scan: FEATURE_LOWPAN_ROUTER		
-Scan: FEATURE_LOWPAN_HOST		
-Scan: FEATURE_NANOSTACK_FULL		
-Scan: FEATURE_NANOSTACK		
-Scan: FEATURE_THREAD_END_DEVICE		
-Scan: mbed		
-Scan: env		
-Compile [  0.3%]: NanostackRfPhyAtmel.cpp		
-[ERROR] ./atmel-rf-driver/source/NanostackRfPhyAtmel.cpp:18:44: fatal error: nanostack/platform/arm_hal_phy.h: No such file or directory		
-compilation terminated.		
-```		
-
-You probably have the LWIP stack in use with Ethernet or WiFi and you have the mesh RF stacks in the root of this example. You need to tell mbed NOT to compile the related files. To do that, set up a `.mbedignore` file. An example file is available in the `configs` folder.		
-
-This should resolve the issue:
-
-```		
-cp configs/eth-wifi-mbedignore ./.mbedignore		
-```		
-