Information on how to use the STM32 Nucleo board with mbed
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.
- Gather the following hardware:
- 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
- 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
- Click “Import” button on the pop up window shown below
- Open the main.cpp file and make the following modifications:
- Enter your M2X API key, Feed ID in the corresponding fields as shown below
The M2X information is obtained from the M2X Blueprint you should have already created. Refer to Getting Started with M2X for details.
- Compile and load the image onto the STM32F401 Nucleo board
Refer to Getting Started with mbed and the STM32F401 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
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
- Go to your M2X account and select the blueprint created previously from Getting Started with ATT M2X
You should see a chart plot of your device’s temperature sensor data from your M2X stream as shown below.
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.