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:
72:d0c254f237c4
Parent:
71:ec259c9b02ea
--- a/README.md	Mon Mar 13 13:00:12 2017 +0000
+++ b/README.md	Mon Mar 13 13:45:12 2017 +0000
@@ -110,13 +110,23 @@
 
 6LoWPAN ND and Thread use IPv6 for connectivity. Therefore, you need to verify first that you have a working IPv6 connection. To do that, ping the Connector IPv6 address `2607:f0d0:2601:52::20` from your network.
 
+<span class="notes">**Note:** In case you want to use 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:</span>
+
+```json
+    "target_overrides": {
+        "*": {
+            "spirit1.mac-address": "{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7}"
+        },
+    }
+```
+
 #### Border router
 
 There are two options for border router.
 
 ##### Nanostack-border-router
 
- The [Nanostack-border-router](https://github.com/ARMmbed/nanostack-border-router-private) can be configured and built for the 6LoWPAN ND or Thread mode.  
+ The [nanostack-border-router](https://github.com/ARMmbed/nanostack-border-router) can be configured and built for the 6LoWPAN ND or Thread mode.  
 
 ##### mbed gateway
 
@@ -137,35 +147,6 @@
 
 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:
@@ -302,29 +283,29 @@
     mbed import mbed-os-example-client
     ```
 
-4. To build the application, select the hardware board and build the toolchain using the command:
+3. To build the application, select the hardware board and build the toolchain using the command:
 
 	Specify the config file in the build command, for example for 6LoWPAN
 
-	```
+    ```
     mbed compile -m K64F -t GCC_ARM -c --app-config configs/6lowpan_Atmel_RF.json
     ```
 
     mbed CLI builds a binary file under the project’s `BUILD/` directory.
 
-5. Plug the Ethernet cable into the board if you are using Ethernet mode.
+4. Plug the Ethernet cable into the board if you are using Ethernet mode.
 
-6. If you are using 6LoWPAN ND or Thread mode, connect and power on the gateway first.
+5. If you are using 6LoWPAN ND or Thread mode, connect and power on the gateway first.
 
-7. Plug the micro-USB cable into the **OpenSDA** port. The board is listed as a mass-storage device.
+6. Plug the micro-USB cable into the **OpenSDA** port. The board is listed as a mass-storage device.
 
-8. Drag the binary `BUILD/K64F/GCC_ARM/mbed-os-example-client.bin` to the board to flash the application.
+7. Drag the binary `BUILD/K64F/GCC_ARM/mbed-os-example-client.bin` to the board to flash the application.
 
-9. The board is automatically programmed with the new binary. A flashing LED on it indicates that it is still working. When the LED stops blinking, the board is ready to work.
+8. The board is automatically programmed with the new binary. A flashing LED on it indicates that it is still working. When the LED stops blinking, the board is ready to work.
 
-10. Press the **Reset** button on the board to run the program.
+9. Press the **Reset** button on the board to run the program.
 
-11. For verification, continue to the [Monitoring the application](#monitoring-the-application) chapter.
+10. For verification, continue to the [Monitoring the application](#monitoring-the-application) chapter.
 
 **To build the example using the Online IDE:**