ST Americas mbed Team


Information on how to use the STM32 Nucleo board with mbed

From Device to Cloud

Putting it all Together: From Device to Cloud

This tutorial will show how to connect your Nucleo board to the cloud using a U-Blox Cellular module and AT&T's M2X services.

  • Connect the Nucleo Sensor Shield to the STM32 Nucleo Ardiuno connector
  • Connect the U-Blox connectivity module to the Nucleo Sensor Shield Ardiuno connector

/media/uploads/joe_tijerina/m2x_mems_ublox_cellular_mbed_connections_2.png

Or

  • Connect the ACKme connectivity module to the STM32 Nucleo Arduino connector
  • Connect the Nucleo Sensor Shield to the Sensor Shield Ardiuno connector

/media/uploads/davidkwak/nucleo_wifi_sensor_shield.png

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

Import the STM32 ACKme Wifi Connect M2X or STM32 U-Blox Cellular Connect M2X (depending on which module you’re using) into your mbed compiler

  • At the program landing page, click on the "Import this program" button

/media/uploads/joe_tijerina/m2x_mems_ublox_cellular_mbed.png

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

/media/uploads/joe_tijerina/m2x_mems_ublox_cellular_mbed_import.png

  • Open the main.cpp file and make the following modifications:
    • Enter your M2X API key, Feed ID in the corresponding fields as shown below

/media/uploads/joe_tijerina/m2x_mems_ublox_cellular_mbed_code.png

Information

The M2X information is obtained from the M2X Blueprint you should have already created. Refer to Getting Started with M2X for details.

  • For the ACKme WiFi Module, enter the SSID and password of your local WiFi hotspot

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 STM32F411 Nucleo board

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 configuring a terminal emulation program

After you have loaded your code onto the Nucleo, the console should show your board connecting. After it has successfully joined the network, the application will start reporting sensor readings to your M2X “temperature”, “humidity”, and “acceleration” streams every 30 seconds.

  • U-Blox Module Terminal
    /media/uploads/joe_tijerina/m2x_mems_ublox_cellular_mbed_terminal_1.png
  • AckME Module Terminal
    /media/uploads/davidkwak/console_output.png

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

Information

M2X will return a code of 202 upon successful update to your M2X Blueprint.

Congratulations! You have now connected an embedded device to the cloud.


All wikipages