ST Americas mbed Team


Information on how to use the STM32 Nucleo board with mbed

From Device to Cloud via U Blox

Putting it all Together: From Device to Cloud

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

  • Connect the Nucleo Sensor Shield/s 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

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

Import the STM32 U-Blox Cellular Connect M2X 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.

<</note>>

  • Compile and load the image onto the STM32F401 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

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