You are viewing an older revision! See the latest version

From Device to Cloud

Putting it all Together: From Device to Cloud

This tutorial will explain how to take your connected device and connected to the cloud.

  • Gather the following hardware:
    • STM32F411 Nucleo Board
    • Multitech Systems or ACKme WiFi Module
    • Grove Shield board
    • Grove Temperature Sensor
    • Grove LED
  • Connect the WiFi module to the STM32 Nucleo Ardiuno connector
  • Connect the Grove shield board to the WiFi module's Ardiuno connector
  • Connect the Grove temperature sensor to port A0 and the Grove LED to port D7 of the Grove Shield board
  • Plug the STM32F411 Nucleo board to your PC with a USB cable

Next, we will import the “STM32_MTS_Wifi_Connect_M2X” mbed project which includes example methods for reading five of the Grove sensors (accel sensor, light sensor, water sensor, gas sensor, and temp sensor). To import, go to http://mbed.org/teams/ATT-CTIA-Hackathon-2014/code/STM32_Read_Sensors_Example/ and click the “Import program” button.

Click “Import” button on the pop up window shown below.

Once the program is loaded into your mbed workspace, open the main.cpp file and make the following modifications:

- Enter your M2X API key, Feed ID, Stream, and Name in the corresponding fields as shown below This information is obtained from your M2X Blueprint you should have created by now, you can refer to see “Getting Started with M2X Tutorial”.

- Enter the SSID and password of your local WiFi hotspot, see screenshot below for an example of this. (Note: make sure your WiFi router is setup for 802.11g since this module is 802.11g compliant).

Compile and load the image onto the F411 Nucleo, you can refer to Tutorial #2 for compiling and loading the Nucleo board. After you have loaded your Nucleo, you can see the board connecting to the WiFi network. After it has successfully joined the network, the application will perform a device location update before it starts readings the temperature sensor and reporting these readings to your M2X “temperature” stream every 5 seconds. You can see this activity from your Console Output terminal, you can refer to Tutorial #3 for setting a terminal emulator, with the only difference that the Serial baudrate for your port should be 9600.

You can see a chart plot of your device’s temperature sensor reported values from your M2X stream as shown below.

You should also be able to see your device’s location on the “Location” tab on a map but for some reason my browser isn’t displaying this image :(


All wikipages