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.

  • 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

/media/uploads/SeanNewton/sensor.png

  • Plug the STM32F411 Nucleo board to your PC with a USB cable

or;

/media/uploads/SeanNewton/mts_import.png

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

/media/uploads/SeanNewton/import_program.png

  • 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

Information

This information is obtained from your M2X Blueprint you should have created by now, you can refer to see Getting Started with M2X

Change:

/media/uploads/SeanNewton/ccode_key.png

To:

/media/uploads/SeanNewton/ccode_sample.png

Enter the SSID and password of your local WiFi hotspot, see screenshot below for an example of this

/media/uploads/SeanNewton/set_net_param.png

Note

Note: make sure your WiFi router is setup for 802.11g as the module is 802.11g compliant.

  • Compile and load the image onto the F411 Nucleo

Information

Refer to Getting Started with mbed and the STM32F to learn how to compile and load your code into the Nucleo board.

  • Open your terminal emulation program for serial communications. Set the baudrate to 9600

Information

Refer to Creating Console Output for instructions on how to configure a terminal emulation program

After you have loaded your Nucleo (or perform a reset by unplugging/plunging your USBb cable, or pushing the Black reset button on the STM32 Nucleo board). Through the terminal emulator 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. It will then report temperature readings to your M2X “temperature” stream every 5 seconds.

/media/uploads/SeanNewton/temp_data2.png

You should see a chart plot of your device’s temperature sensor data from your M2X stream as shown below.

/media/uploads/SeanNewton/temp_chart.png

You have now completed the basics of creating a connected embedded device to the cloud.


All wikipages