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.

Committer:
mbed_official
Date:
Wed Nov 23 13:45:10 2016 +0000
Revision:
31:218ca6b6fe19
Parent:
0:7d5ec759888b
Child:
32:7b3841243d70
Merge pull request #115 from ARMmbed/revert-5.2.3

Revert mbed OS 5.2.3 back 5.2.0 due to WiFi issues
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-client

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 31:218ca6b6fe19 1
mbed_official 31:218ca6b6fe19 2
mbed_official 31:218ca6b6fe19 3 /*
mbed_official 31:218ca6b6fe19 4
mbed_official 31:218ca6b6fe19 5 * Copyright (c) 2015 ARM Limited. All rights reserved.
mbed_official 31:218ca6b6fe19 6
mbed_official 31:218ca6b6fe19 7 * SPDX-License-Identifier: Apache-2.0
mbed_official 31:218ca6b6fe19 8
mbed_official 31:218ca6b6fe19 9 * Licensed under the Apache License, Version 2.0 (the License); you may
mbed_official 31:218ca6b6fe19 10
mbed_official 31:218ca6b6fe19 11 * not use this file except in compliance with the License.
mbed_official 31:218ca6b6fe19 12
mbed_official 31:218ca6b6fe19 13 * You may obtain a copy of the License at
mbed_official 31:218ca6b6fe19 14
mbed_official 31:218ca6b6fe19 15 *
mbed_official 31:218ca6b6fe19 16
mbed_official 31:218ca6b6fe19 17 * http://www.apache.org/licenses/LICENSE-2.0
mbed_official 31:218ca6b6fe19 18
mbed_official 31:218ca6b6fe19 19 *
mbed_official 31:218ca6b6fe19 20
mbed_official 31:218ca6b6fe19 21 * Unless required by applicable law or agreed to in writing, software
mbed_official 31:218ca6b6fe19 22
mbed_official 31:218ca6b6fe19 23 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
mbed_official 31:218ca6b6fe19 24
mbed_official 31:218ca6b6fe19 25 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
mbed_official 31:218ca6b6fe19 26
mbed_official 31:218ca6b6fe19 27 * See the License for the specific language governing permissions and
mbed_official 31:218ca6b6fe19 28
mbed_official 31:218ca6b6fe19 29 * limitations under the License.
mbed_official 31:218ca6b6fe19 30
mbed_official 31:218ca6b6fe19 31 */
mbed_official 31:218ca6b6fe19 32
mbed_official 31:218ca6b6fe19 33 #ifndef __SECURITY_H__
mbed_official 31:218ca6b6fe19 34
mbed_official 31:218ca6b6fe19 35 #define __SECURITY_H__
mbed_official 31:218ca6b6fe19 36
mbed_official 31:218ca6b6fe19 37
mbed_official 31:218ca6b6fe19 38
mbed_official 31:218ca6b6fe19 39 #include <inttypes.h>
mbed_official 31:218ca6b6fe19 40
mbed_official 31:218ca6b6fe19 41
mbed_official 31:218ca6b6fe19 42
mbed_official 31:218ca6b6fe19 43 #define MBED_DOMAIN "9d6fe233-9a5f-4eaa-8992-97b1e0fce338"
mbed_official 31:218ca6b6fe19 44
mbed_official 31:218ca6b6fe19 45 #define MBED_ENDPOINT_NAME "c154cc0b-8dc0-4ae6-a28b-25c44c86789e"
mbed_official 31:218ca6b6fe19 46
mbed_official 31:218ca6b6fe19 47
mbed_official 31:218ca6b6fe19 48
mbed_official 31:218ca6b6fe19 49 const uint8_t SERVER_CERT[] = "-----BEGIN CERTIFICATE-----\r\n"
mbed_official 31:218ca6b6fe19 50
mbed_official 31:218ca6b6fe19 51 "MIIBmDCCAT6gAwIBAgIEVUCA0jAKBggqhkjOPQQDAjBLMQswCQYDVQQGEwJGSTEN\r\n"
mbed_official 31:218ca6b6fe19 52
mbed_official 31:218ca6b6fe19 53 "MAsGA1UEBwwET3VsdTEMMAoGA1UECgwDQVJNMQwwCgYDVQQLDANJb1QxETAPBgNV\r\n"
mbed_official 31:218ca6b6fe19 54
mbed_official 31:218ca6b6fe19 55 "BAMMCEFSTSBtYmVkMB4XDTE1MDQyOTA2NTc0OFoXDTE4MDQyOTA2NTc0OFowSzEL\r\n"
mbed_official 31:218ca6b6fe19 56
mbed_official 31:218ca6b6fe19 57 "MAkGA1UEBhMCRkkxDTALBgNVBAcMBE91bHUxDDAKBgNVBAoMA0FSTTEMMAoGA1UE\r\n"
mbed_official 31:218ca6b6fe19 58
mbed_official 31:218ca6b6fe19 59 "CwwDSW9UMREwDwYDVQQDDAhBUk0gbWJlZDBZMBMGByqGSM49AgEGCCqGSM49AwEH\r\n"
mbed_official 31:218ca6b6fe19 60
mbed_official 31:218ca6b6fe19 61 "A0IABLuAyLSk0mA3awgFR5mw2RHth47tRUO44q/RdzFZnLsAsd18Esxd5LCpcT9w\r\n"
mbed_official 31:218ca6b6fe19 62
mbed_official 31:218ca6b6fe19 63 "0tvNfBv4xJxGw0wcYrPDDb8/rjujEDAOMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0E\r\n"
mbed_official 31:218ca6b6fe19 64
mbed_official 31:218ca6b6fe19 65 "AwIDSAAwRQIhAPAonEAkwixlJiyYRQQWpXtkMZax+VlEiS201BG0PpAzAiBh2RsD\r\n"
mbed_official 31:218ca6b6fe19 66
mbed_official 31:218ca6b6fe19 67 "NxLKWwf4O7D6JasGBYf9+ZLwl0iaRjTjytO+Kw==\r\n"
mbed_official 31:218ca6b6fe19 68
mbed_official 31:218ca6b6fe19 69 "-----END CERTIFICATE-----\r\n";
mbed_official 31:218ca6b6fe19 70
mbed_official 31:218ca6b6fe19 71
mbed_official 31:218ca6b6fe19 72
mbed_official 31:218ca6b6fe19 73 const uint8_t CERT[] = "-----BEGIN CERTIFICATE-----\r\n"
mbed_official 31:218ca6b6fe19 74
mbed_official 31:218ca6b6fe19 75 "MIIBzzCCAXOgAwIBAgIEPbJdijAMBggqhkjOPQQDAgUAMDkxCzAJBgNVBAYTAkZ\r\n"
mbed_official 31:218ca6b6fe19 76
mbed_official 31:218ca6b6fe19 77 "JMQwwCgYDVQQKDANBUk0xHDAaBgNVBAMME21iZWQtY29ubmVjdG9yLTIwMTYwHh\r\n"
mbed_official 31:218ca6b6fe19 78
mbed_official 31:218ca6b6fe19 79 "cNMTYwODE5MDg0OTA4WhcNMTYxMjMxMDYwMDAwWjCBoTFSMFAGA1UEAxNJOWQ2Z\r\n"
mbed_official 31:218ca6b6fe19 80
mbed_official 31:218ca6b6fe19 81 "mUyMzMtOWE1Zi00ZWFhLTg5OTItOTdiMWUwZmNlMzM4L2MxNTRjYzBiLThkYzAt\r\n"
mbed_official 31:218ca6b6fe19 82
mbed_official 31:218ca6b6fe19 83 "NGFlNi1hMjhiLTI1YzQ0Yzg2Nzg5ZTEMMAoGA1UECxMDQVJNMRIwEAYDVQQKEwl\r\n"
mbed_official 31:218ca6b6fe19 84
mbed_official 31:218ca6b6fe19 85 "tYmVkIHVzZXIxDTALBgNVBAcTBE91bHUxDTALBgNVBAgTBE91bHUxCzAJBgNVBA\r\n"
mbed_official 31:218ca6b6fe19 86
mbed_official 31:218ca6b6fe19 87 "YTAkZJMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEiP8HcjnPyb+nnV2GP7n5T\r\n"
mbed_official 31:218ca6b6fe19 88
mbed_official 31:218ca6b6fe19 89 "h7OC9wFZLa78zVdK9/FClHbJJd6zWlaGEYFhirMzcoNYrpwBNOsMmUEmA6YW0+m\r\n"
mbed_official 31:218ca6b6fe19 90
mbed_official 31:218ca6b6fe19 91 "1DAMBggqhkjOPQQDAgUAA0gAMEUCIQDHzTkR1MGVm16Jai42bxAYPAds5JG38T0\r\n"
mbed_official 31:218ca6b6fe19 92
mbed_official 31:218ca6b6fe19 93 "/OodSMndhhAIgNhLhfotPYL2u0TGLFquQJNNEXNZs604u5n/JsT1BGYo=\r\n"
mbed_official 31:218ca6b6fe19 94
mbed_official 31:218ca6b6fe19 95 "-----END CERTIFICATE-----\r\n";
mbed_official 31:218ca6b6fe19 96
mbed_official 31:218ca6b6fe19 97
mbed_official 31:218ca6b6fe19 98
mbed_official 31:218ca6b6fe19 99 const uint8_t KEY[] = "-----BEGIN PRIVATE KEY-----\r\n"
mbed_official 31:218ca6b6fe19 100
mbed_official 31:218ca6b6fe19 101 "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgw2tABV2TaAMckC02\r\n"
mbed_official 31:218ca6b6fe19 102
mbed_official 31:218ca6b6fe19 103 "PQ8SAiVbD2o5LHJ9bwfvejviFSShRANCAASI/wdyOc/Jv6edXYY/uflOHs4L3AVk\r\n"
mbed_official 31:218ca6b6fe19 104
mbed_official 31:218ca6b6fe19 105 "trvzNV0r38UKUdskl3rNaVoYRgWGKszNyg1iunAE06wyZQSYDphbT6bU\r\n"
mbed_official 31:218ca6b6fe19 106
mbed_official 31:218ca6b6fe19 107 "-----END PRIVATE KEY-----\r\n";
mbed_official 31:218ca6b6fe19 108
mbed_official 31:218ca6b6fe19 109
mbed_official 31:218ca6b6fe19 110
mbed_official 31:218ca6b6fe19 111 #endif //__SECURITY_H__