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
1050186 6:ea24d9271ff1 1 {
1050186 6:ea24d9271ff1 2 "config": {
1050186 6:ea24d9271ff1 3 "network-interface":{
1050186 6:ea24d9271ff1 4 "help": "Options are ETHERNET, WIFI_IDW0XX1, WIFI_ESP8266, WIFI_ODIN, WIFI_WIZFI310, MESH_LOWPAN_ND, MESH_THREAD, CELLULAR_ONBOARD",
1050186 6:ea24d9271ff1 5 "value": "WIFI_WIZFI310"
1050186 6:ea24d9271ff1 6 },
1050186 6:ea24d9271ff1 7 "wifi-ssid": {
1050186 6:ea24d9271ff1 8 "help": "WiFi SSID",
1050186 6:ea24d9271ff1 9 "value": "\"SSID\""
1050186 6:ea24d9271ff1 10 },
1050186 6:ea24d9271ff1 11 "wifi-password": {
1050186 6:ea24d9271ff1 12 "help": "WiFi Password",
1050186 6:ea24d9271ff1 13 "value": "\"Password\""
1050186 6:ea24d9271ff1 14 },
1050186 6:ea24d9271ff1 15 "wifi-tx": {
1050186 6:ea24d9271ff1 16 "help": "TX pin for serial connection to external device",
1050186 6:ea24d9271ff1 17 "value": "D1"
1050186 6:ea24d9271ff1 18 },
1050186 6:ea24d9271ff1 19 "wifi-rx": {
1050186 6:ea24d9271ff1 20 "help": "RX pin for serial connection to external device",
1050186 6:ea24d9271ff1 21 "value": "D0"
1050186 6:ea24d9271ff1 22 },
1050186 6:ea24d9271ff1 23 "button1": {
1050186 6:ea24d9271ff1 24 "help": "Use BUTTON1 from PinNames.h by default",
1050186 6:ea24d9271ff1 25 "value": "BUTTON1"
1050186 6:ea24d9271ff1 26 }
1050186 6:ea24d9271ff1 27 },
1050186 6:ea24d9271ff1 28 "macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\""],
1050186 6:ea24d9271ff1 29 "target_overrides": {
1050186 6:ea24d9271ff1 30 "*": {
1050186 6:ea24d9271ff1 31 "drivers.uart-serial-rxbuf-size": 1024,
1050186 6:ea24d9271ff1 32 "target.features_add": ["COMMON_PAL"],
1050186 6:ea24d9271ff1 33 "platform.stdio-baud-rate": 115200,
1050186 6:ea24d9271ff1 34 "platform.stdio-convert-newlines": true,
1050186 6:ea24d9271ff1 35 "mbed-trace.enable": 0
1050186 6:ea24d9271ff1 36 },
1050186 6:ea24d9271ff1 37 "NUCLEO_F401RE": {
1050186 6:ea24d9271ff1 38 "wifi-tx": "PA_11",
1050186 6:ea24d9271ff1 39 "wifi-rx": "PA_12"
1050186 6:ea24d9271ff1 40 },
1050186 6:ea24d9271ff1 41 "NUCLEO_F411RE": {
1050186 6:ea24d9271ff1 42 "wifi-tx": "PA_11",
1050186 6:ea24d9271ff1 43 "wifi-rx": "PA_12"
1050186 6:ea24d9271ff1 44 }
1050186 6:ea24d9271ff1 45 }
1050186 6:ea24d9271ff1 46 }
1050186 6:ea24d9271ff1 47