Generic Pelion Device Management example for various ST-based boards.
This example is known to work great on the following platforms:
- DISCO_L475E_IOT01A over WiFI and using onboard QSPI flash. Board specific example using onboard sensors is available here.
- DISCO_F413H over WiFI and using onboard QSPI flash.
- DISCO_F746NG over Ethernet and using onboard QSPI flash.
- NUCLEO_F429ZI over Ethernet and using SD card (see instructions below).
- NUCLEO_F767ZI over Ethernet and using SD card (see instructions below).
- NUCLEO_F746ZG over Ethernet and using SD card (see instructions below).
- NUCLEO_F207ZG over Ethernet and using SD card (see instructions below).
Follow the Quick-Start instructions: https://cloud.mbed.com/quick-start
This example showcases the following device functionality:
- Read ADC temperature and ADC vref, and report them as Pelion LWM2M resources (see image below).
- On user button click, increment Pelion LWM2M button resource.
- Allow the user to change the state of the board LED from Pelion LWM2M led_state resource and PUT request.
ST Nucleo 144 hardware setup
The ST Nucleo family of boards don't have storage onboard and therefore you will need an SD card. See the image below how to wire an SD card to any ST Nucleo 144 board.
If you are not a first-time Pelion Device Management user your device's SD card may already have connect and update certificates on it. If this is the case, remove and manually format your micro SD card, flash the binary to the device and then re-insert your micro SD card.
Use this example with Mbed CLI
1. Import the application into your desktop:
mbed import https://os.mbed.com/teams/ST/code/pelion-example-common cd pelion-example-common
2. Install the CLOUD_SDK_API_KEY
mbed config -G CLOUD_SDK_API_KEY <PELION_DM_API_KEY>
For instructions on how to generate your API key, please see the documentation.
3. Initialize firmware credentials (done once per repository). You can use the following command:
mbed dm init -d "<your company name in Pelion DM>" --model-name "<product model identifier>" -q --force
If above command do not work for your Mbed CLI, please consider upgrading Mbed CLI to version 1.8.x or above.
4. Compile and program:
mbed compile -t <toolchain> -m <TARGET_BOARD>
(supported toolchains : GCC_ARM / ARM / IAR)
Files at revision 18:a5a85e6482b9