Sample program showing how to connect GR-PEACH into Watson IoT through mbed Connector and Watson's Connector Bridge

Dependencies:   AsciiFont DisplayApp GR-PEACH_video LCD_shield_config LWIPBP3595Interface_STA_for_mbed-os USBDevice

You are viewing an older revision! See the latest version

Homepage

Overview

This sample program shows how to connect GR-PEACH into Watson IoT through mbed Connector and Watson's Connector Bridge. Note that this program is derived from https://github.com/ARMmbed/mbed-ethernet-sample-techcon2016.

In this program, at first, the barcode data input from camera is decoded on GR-PEACH using ZXing which is an open-source, multi-format 1D/2D barcode image processing library. Then, the decoded string is sent to Watson IoT via mbed Device Connector and Watson's Connector Bridge. At last, the delivered string is confirmed via NodeRED flow.

Required hardware

Application setup

  1. Select the connection type. For details, please refer to the following wiki:
    https://developer.mbed.org/teams/Renesas/code/mbed-os_Watson-IoT_ZXing_sample/wiki/Connection-type.
  2. Set the client credentials. For details, please refer to the following wiki:
    https://developer.mbed.org/teams/Renesas/code/mbed-os_Watson-IoT_ZXing_sample/wiki/Client-credentials.
  3. Change Ethernet settings. For details, please refer to the following wiki:
    https://developer.mbed.org/teams/Renesas/code/mbed-os_Watson-IoT_ZXing_sample/wiki/Ethernet-settings.
  4. Change Wifi settings. For details, please refer to the following wiki:
    https://developer.mbed.org/teams/Renesas/code/mbed-os_Watson-IoT_ZXing_sample/wiki/Wifi-settings.

Building this sample program

  1. Import this sample program onto mbed Compiler.
  2. Configure this sample program 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 if you are using Ethernet mode. /media/uploads/HinoNaka/mbed-os_watson-iot_zxing_sample_screen7.png
  5. Plug the micro-USB cable into the OpenSDA port with lies on the next to the RESET button.
  6. Copy the binary previously downloaded to your PC to GR-PEACH to flash this sample program. When the copy is successfully completed, the board is ready to work.
  7. Press the RESET button on the board to run this sample program.
  8. For verification, please refer to the following wiki:
    https://developer.mbed.org/teams/Renesas/code/mbed-os_Watson-IoT_ZXing_sample/wiki/Monitoring-the-application.

Application resources

This sample program exposes two resources listed below:

  1. /311/0/5850 : Trigger to toggle LED on GR-PEACH (PUT). When "1" is sent to this resource by PUT method, LED should be turned off. Otherwise, LED should be turned on.
  2. /888/0/7700: Decode result of barcode data input from camera (GET)

Setup of Watson IoT

  1. You should create Watson IoT Instance by the following procedure:
    • Login IBM Bluemix from https://console.ng.bluemix.net/ and login it.
    • Select Services as follows: /media/uploads/HinoNaka/mbed-os_watson-iot_zxing_sample_screen6.png
    • Select Internet of Things" as follows: /media/uploads/HinoNaka/mbed-os_watson-iot_zxing_sample_screen7_1.png
    • Press Get Started as follows: /media/uploads/HinoNaka/mbed-os_watson-iot_zxing_sample_screen8.png
    • Configure Watson IoT Instance
      • Leave unbound /media/uploads/HinoNaka/mbed-os_watson-iot_zxing_sample_screen9.png
      • Select the Free plan, then click Create /media/uploads/HinoNaka/mbed-os_watson-iot_zxing_sample_screen10.png

  2. You should create Watson IoT Application Credentials Once you successfully create Watson IoT Instance, you should see the following Watson IoT dashboard: /media/uploads/HinoNaka/mbed-os_watson-iot_zxing_sample_screen11.png
    • On dashboard, launch the Connect your devices dashboard /media/uploads/HinoNaka/mbed-os_watson-iot_zxing_sample_screen12.png
    • Click APPS /media/uploads/HinoNaka/mbed-os_watson-iot_zxing_sample_screen13.png
    • Click Generate API Key /media/uploads/HinoNaka/mbed-os_watson-iot_zxing_sample_screen14_1.png
    • Record the API Key and Authenticatoin Token. Then click Generate after adding a comment /media/uploads/HinoNaka/mbed-os_watson-iot_zxing_sample_screen15.png Note that these two values will be needed in the later step.
  3. Watson IoT NodeRED Application should be created in accordance with the following procedure:
    • Go back to your Bluemix Dashboard: https://console.ng.bluemix.net
    • Click Create Application /media/uploads/HinoNaka/mbed-os_watson-iot_zxing_sample_screen16.png
    • Select Node-RED Starter /media/uploads/HinoNaka/mbed-os_watson-iot_zxing_sample_screen17.png
    • Enter a unique App name and Click Create /media/uploads/HinoNaka/mbed-os_watson-iot_zxing_sample_screen18.png
    • Application will Stage after a few minutes
    • Application will report app is running when the staging has completed

All wikipages