Contents


Overview

Skill Level: Any Skill Level

The TI AM335x based BeagleBone Green Wireless board from SeeedStudio is a highly integrated solution for IoT applications, containing a high performance processor and flexible WiFi/Bluetooth connectivity with grove connectors for easy sensor expansion.

Ingredients

BeagleBone Green Wireless - https://beagleboard.org/green-wireless

BBGW_frombeagleboardorgrotated

Bluetooth LE device with Sensors (e.g. TI BLE SensorTag) - http://www.ti.com/sensortag 

 sensortag-img-bluetooth

Step-by-step

  1. Setting up Hardware

    Setting up the BeagleBone Green Wireless (BBGW) is quick and easy, following instructions at http://wiki.seeed.cc/SeeedStudio_BeagleBone_Green_Wireless.  These instructions describe how to boot the BBGW and provision it onto a Wi-Fi access point and connect to a public internet connection.

    This recipe was tested using Debian Jesse 8.5 based IoT filesystem image (26th August¬†2016) –¬†This specific filesystem image can be found at¬†https://debian.beagleboard.org/images/bone-debian-8.5-seeed-gcp-iot-armhf-2016-08-26-4gb.img.xz.

    Instructions for installing the base software on the BBGW can be found at http://wiki.seeed.cc/SeeedStudio_BeagleBone_Green_Wireless/#update-to-latest-software.

     

  2. Setting up Software

    The next step is to install the necessary software on the BBGW for connection to IBM Watson IoT Platform.

    1. Login (as root) to the BBGW via a serial connection or SSH and ensure the BBGW has a public internet connection.
    2. Clone the GitHub project: git clone http://github.com/ibm-messaging/iot-beaglebone
    3. Enter the command: cd iot-beaglebone/samples/nodejs
    4. Update the package repository information : apt-get update
    5. Run the setup script to download the necessary packages : ./setup.sh
      1. This installs the bluetooth system packages [bluez, libbluetooth-dev], and nodejs dependencies, using npm [async, sensortag, properties, MQTT]
    6. Next stop the wifi provisioning service : systemctl stop wificonfig.service
      1. This is necessary to avoid conflict with control of the USR leds which are also used by the iot application.
    7. Now run the sample with: node iot_sensortag.js
      1. This sample runs in the foreground and will need to be restarted if the SensorTag disconnects
    8. Press the button on the side of the SensorTag to start it advertising.  The BBGW will connect automatically to the SensorTag and will start sending sensor data to the IBM Watson IoT Platform.
    9. The sample will display the MAC address needed for the Quickstart Visualizer (step 3 below) on the console.
    10. When messages are being sent, the LED3 (close to the USB connectors) will flash once per message.

     

     

  3. Visualizing your data in IBM Watson QuickStart Visualizer

    The sensor data, from the BLE SensorTag, sent to IBM Watson IoT Platform can now be viewed in the cloud using IBM Watson IoT Platform Web Visualizer.

    1. Take the MAC address displayed in the console, and remove all colons, and ensure letters are lowercase.  This is the 'device ID' of your device.
    2. Enter your device ID here : https://quickstart.internetofthings.ibmcloud.com/?deviceId=#/

     

  4. Register your Device in IBM Watson IoT Platform

    To explore and make use of full capabilities of Watson IoT Platform, we need to setup and register your device(s) in it. This section shows how you can setup the same.

    Carry out the steps present in this recipe (https://developer.ibm.com/recipes/tutorials/how-to-register-devices-in-ibm-iot-foundation/) to register your device(s) in IBM Watson Internet of Things Platform.

    At this step, we have successfully created the Watson IoT service and registered your device(s) in it.

     

  5. Connecting to the IBM Watson IoT Platform Registered Service

    1. Once you have access to an IBM Watson IoT Platform (https://internetofthings.ibmcloud.com/)¬†organization through Bluemix or the Marketplace, you can click to ‚ÄėAdd a new device‚Äô on the IoT organization dashboard.
    2. During the device registration process you will get device properties, copy these when you get them. They will look like this: org=xyzzyz type=iotsample-ti-bbst id=01c7ca014599 auth-method=token auth-token=ijeifwiefiweff@
    3. Log in to the BeagleBone
    4. Enter command: cd ~/iot-beaglebone/samples/nodejs
    5. Stop the script if it’s running (ctrl-C).
    6. Create a new file called device.cfg using: nano device.cfg
    7. Paste the properties into the editor.
    8. Exit nano and save (Ctrl-X, y).
    9. Restart the script with: node iot-sensortag.js

     

  6. Command Support

    Now the BeagleBone and SensorTag Sample is running in registered mode and supports receiving of commands sent by an application.

    1. The script responds to commands from the blink command-id. This makes LED 0 blink at a fixed rate.
    2. You can write an application which sends the payload { ‚Äúrate‚ÄĚ: 2 } to the topic iot-2/type/iotsample-ti-bbst/id//evt/blink/fmt/json
    3. The numeric value is the rate in blinks per second. A value of 0 will stop the LED blinking.
    4. The script may be used as a starting point for your own work. You can make direct modifications to the script on the BeagleBone platform using nano, vi or your favorite editor. You are, of course, welcome to fork the repository at https://github.com/ibm-messaging/iot-beaglebone

     

2 comments on"Texas Instruments AM335x based BeagleBone Green Wireless Gateway from SeeedStudio with integrated TI WL18xx Wi-Fi¬ģ/Bluetoooth¬ģ"

  1. Amit M Mangalvedkar February 18, 2016

    @rdmonk
    Thanks a lot for submitting the recipe. Could you please add more content in it?

    Thanks and Regards
    Amit M Mangalvedkar

  2. What is the maximum number of BLE devices that can be supported on this implementation? Does it perform continuous monitoring of the said devices or is it a round robin style monitoring?

    Thanks

Join The Discussion