This is a mbed Client sample where ZXing is incorporated, and works on GR-PEACH and GR-LYCHEE.

Dependencies:   DisplayApp AsciiFont

Overview

This sample program shows how to use mbed Client together with ZXing which is an open-source, multi-format 1D/2D barcode image processing library. For more info on ZXing, please refer to https://github.com/zxing/zxing.

Required hardware

Application setup

  1. Select the connection type. For details, please refer to the following wiki:
    https://os.mbed.com/teams/Renesas/code/GR-PEACH_mbed-os-client-ZXingSample/wiki/Connection-type.
  2. Set the client credentials. For details, please refer to the following wiki:
    https://os.mbed.com/teams/Renesas/code/GR-PEACH_mbed-os-client-ZXingSample/wiki/Client-credentials.
  3. Change Ethernet settings. For details, please refer to the following wiki:
    https://developer.mbed.org/teams/Renesas/code/GR-PEACH_mbed-os-client-ZXingSample/wiki/Ethernet-settings.
  4. Change Wifi settings. For details, please refer to the following wiki:
    https://os.mbed.com/teams/Renesas/code/GR-PEACH_mbed-os-client-ZXingSample/wiki/Wifi-settings.
  5. Set up an IP address. (This step is optional.) For details, please refer to the following wiki:
    https://os.mbed.com/teams/Renesas/code/GR-PEACH_mbed-os-client-ZXingSample/wiki/IP-address-setup.

Building the example

To build this example:

  1. Import this example onto mbed Compiler.
  2. Configure the example in accordance with Application setup.
  3. Compile the example on mbed Compiler and download the resultant binary file.
  4. Plug the Ethernet cable into GR-PEACH or GR-LYCHEE if you are using Ethernet mode.
  5. Plug the micro-USB cable into the OpenSDA port which lies on the next to the RESET button.
  6. Copy the binary previously downloaded to your PC to GR-PEACH or GR-LYCHEE to flash this example. When the copy is successfully completed, the board is ready to work.
  7. Press the RESET button on the board to run the example.
  8. For verification, please refer to the following wiki:
    https://developer.mbed.org/teams/Renesas/code/GR-PEACH_mbed-os-client-ZXingSample/wiki/Monitoring-the-application.

Application resources

This example exposes four resources listed below:

  1. 3202/0/5700. Decode result of barcode data input from camera (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 if you are using GR-PEACH board (PUT).
  5. 3201/0/5855. Blink color, used by the blink function. Any of green, yellow, orange and red is acceptable if you are using GR-LYCHEE board (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

Committer:
1050186
Date:
Thu Dec 13 09:17:41 2018 +0000
Revision:
10:f7e8d2b608c3
Parent:
6:ea24d9271ff1
Delete unnecessary code.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dkato 2:6ec5c1c1d41c 1 {
dkato 2:6ec5c1c1d41c 2 "config": {
dkato 2:6ec5c1c1d41c 3 "network-interface":{
1050186 6:ea24d9271ff1 4 "help": "Options are ETHERNET, WIFI_IDW0XX1, WIFI_ESP8266, WIFI_BP3595, WIFI_ESP32, WIFI_ISM43362, WIFI_ODIN, WIFI_WIZFI310, MESH_LOWPAN_ND, MESH_THREAD, CELLULAR_ONBOARD, NO_CONNECT",
dkato 2:6ec5c1c1d41c 5 "value": "NO_CONNECT"
dkato 2:6ec5c1c1d41c 6 },
1050186 6:ea24d9271ff1 7 "mesh_radio_type": {
1050186 6:ea24d9271ff1 8 "help": "options are ATMEL, MCR20, SPIRIT1, EFR32",
1050186 6:ea24d9271ff1 9 "value": "ATMEL"
1050186 6:ea24d9271ff1 10 },
dkato 2:6ec5c1c1d41c 11 "wifi-ssid": {
dkato 2:6ec5c1c1d41c 12 "help": "WiFi SSID",
dkato 2:6ec5c1c1d41c 13 "value": "\"SSID\""
dkato 2:6ec5c1c1d41c 14 },
dkato 2:6ec5c1c1d41c 15 "wifi-password": {
dkato 2:6ec5c1c1d41c 16 "help": "WiFi Password",
dkato 2:6ec5c1c1d41c 17 "value": "\"Password\""
dkato 2:6ec5c1c1d41c 18 },
dkato 2:6ec5c1c1d41c 19 "wifi-security":{
dkato 2:6ec5c1c1d41c 20 "help": "Options are NSAPI_SECURITY_WEP, NSAPI_SECURITY_WPA, NSAPI_SECURITY_WPA2, NSAPI_SECURITY_WPA_WPA2",
dkato 2:6ec5c1c1d41c 21 "value": "NSAPI_SECURITY_WPA_WPA2"
dkato 2:6ec5c1c1d41c 22 },
dkato 2:6ec5c1c1d41c 23 "wifi-tx": {
dkato 2:6ec5c1c1d41c 24 "help": "TX pin for serial connection to external device",
dkato 2:6ec5c1c1d41c 25 "value": "D1"
dkato 2:6ec5c1c1d41c 26 },
dkato 2:6ec5c1c1d41c 27 "wifi-rx": {
dkato 2:6ec5c1c1d41c 28 "help": "RX pin for serial connection to external device",
dkato 2:6ec5c1c1d41c 29 "value": "D0"
1050186 6:ea24d9271ff1 30 },
1050186 6:ea24d9271ff1 31 "camera":{
1050186 6:ea24d9271ff1 32 "help": "0:disable 1:enable",
1050186 6:ea24d9271ff1 33 "value": "1"
1050186 6:ea24d9271ff1 34 },
1050186 6:ea24d9271ff1 35 "camera-type":{
1050186 6:ea24d9271ff1 36 "help": "Options are CAMERA_CVBS, CAMERA_MT9V111, CAMERA_OV7725",
1050186 6:ea24d9271ff1 37 "value": "CAMERA_MT9V111"
1050186 6:ea24d9271ff1 38 },
1050186 6:ea24d9271ff1 39 "lcd":{
1050186 6:ea24d9271ff1 40 "help": "0:disable 1:enable",
1050186 6:ea24d9271ff1 41 "value": "1"
1050186 6:ea24d9271ff1 42 },
1050186 6:ea24d9271ff1 43 "lcd-type":{
1050186 6:ea24d9271ff1 44 "help": "Options are GR_PEACH_4_3INCH_SHIELD, GR_PEACH_7_1INCH_SHIELD, GR_PEACH_RSK_TFT, GR_PEACH_DISPLAY_SHIELD, GR_LYCHEE_LCD",
1050186 6:ea24d9271ff1 45 "value": "GR_PEACH_4_3INCH_SHIELD"
dkato 2:6ec5c1c1d41c 46 }
dkato 2:6ec5c1c1d41c 47 },
dkato 2:6ec5c1c1d41c 48 "macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\""],
dkato 2:6ec5c1c1d41c 49 "target_overrides": {
dkato 2:6ec5c1c1d41c 50 "*": {
1050186 6:ea24d9271ff1 51 "target.features_add": ["NANOSTACK", "COMMON_PAL"],
1050186 6:ea24d9271ff1 52 "nanostack.configuration": "lowpan_router",
dkato 2:6ec5c1c1d41c 53 "platform.stdio-baud-rate": 115200,
dkato 2:6ec5c1c1d41c 54 "platform.stdio-convert-newlines": true,
1050186 6:ea24d9271ff1 55 "mbed-mesh-api.6lowpan-nd-channel-page": 0,
1050186 6:ea24d9271ff1 56 "mbed-mesh-api.6lowpan-nd-channel": 12,
dkato 2:6ec5c1c1d41c 57 "mbed-trace.enable": 0
dkato 2:6ec5c1c1d41c 58 },
1050186 6:ea24d9271ff1 59 "DISCO_F413ZH": {
1050186 6:ea24d9271ff1 60 "network-interface": "WIFI_ISM43362"
1050186 6:ea24d9271ff1 61 },
1050186 6:ea24d9271ff1 62 "DISCO_L475VG_IOT01A": {
1050186 6:ea24d9271ff1 63 "network-interface": "WIFI_ISM43362"
1050186 6:ea24d9271ff1 64 },
dkato 2:6ec5c1c1d41c 65 "NUCLEO_F401RE": {
dkato 2:6ec5c1c1d41c 66 "wifi-tx": "PA_11",
dkato 2:6ec5c1c1d41c 67 "wifi-rx": "PA_12"
dkato 2:6ec5c1c1d41c 68 },
dkato 2:6ec5c1c1d41c 69 "NUCLEO_F411RE": {
dkato 2:6ec5c1c1d41c 70 "wifi-tx": "PA_11",
dkato 2:6ec5c1c1d41c 71 "wifi-rx": "PA_12"
dkato 2:6ec5c1c1d41c 72 },
dkato 2:6ec5c1c1d41c 73 "RZ_A1H": {
dkato 2:6ec5c1c1d41c 74 "target.macros_add": ["MBEDTLS_TEST_NULL_ENTROPY", "MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES"]
dkato 2:6ec5c1c1d41c 75 },
dkato 2:6ec5c1c1d41c 76 "UBLOX_EVK_ODIN_W2": {
1050186 6:ea24d9271ff1 77 "target.network-default-interface-type": "ETHERNET"
1050186 6:ea24d9271ff1 78 },
1050186 6:ea24d9271ff1 79 "UBLOX_C030_U201": {
1050186 6:ea24d9271ff1 80 "lwip.ppp-enabled": true,
1050186 6:ea24d9271ff1 81 "ppp-cell-iface.apn-lookup": true
dkato 2:6ec5c1c1d41c 82 }
dkato 2:6ec5c1c1d41c 83 }
dkato 2:6ec5c1c1d41c 84 }