Mbed OS and Pelion Device Management example over WIFI for RHOMBIO_L476DMW1K IoT kit
DEPRECATED
This example application is not maintained and not recommended. It uses an old version of Mbed OS, Pelion DM, and Arm toolchain. It doesn't work with Mbed Studio.
Please use: https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-pelion/
This example is known to work great on the following platforms:
RHOMBIO_L476DMW1K over WiFI and using onboard QSPI flash.

Follow the Quick-Start instructions: https://cloud.mbed.com/quick-start
Example functionality
This example showcases the following device functionality:
- Read onboard MCU ADC temperature and MCU ADC voltage reference, 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.
- External sensors can be easily added to the kit and then sensor readings reported as Pelion LWM2M resources.

Use this example with Mbed CLI
1. Import the application into your desktop:
mbed import https://os.mbed.com/teams/Rhombio/code/pelion-example-rhombio-l476dmw1k cd pelion-example-rhombio-l476dmw1k
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 RHOMBIO_L476DMW1K -f
(supported toolchains : GCC_ARM / ARM / IAR)
5. You can connect on a virtual terminal/COM port to the platform using:
mbed sterm -b 115200
This should give you an output similar to:
[BOOT] Mbed Bootloader
[BOOT] ARM: 0000000000000000000000000000000000000000
[BOOT] OEM: 0000000000000000000000000000000000000000
[BOOT] Layout: 0 800D24C
[BOOT] Active firmware integrity check:
[BOOT] SHA256: 9036E19F1414720659B2C2FAC8855F621AF533BA211D930119720E7A2BD60BF2
[BOOT] Version: 1558516039
[BOOT] Slot 0 is empty
[BOOT] Active firmware up-to-date
[BOOT] Application's start address: 0x8010400
[BOOT] Application's jump address: 0x8010889
[BOOT] Application's stack address: 0x20018000
[BOOT] Forwarding to application...
Starting Simple Pelion Device Management Client example
You can hold the user button during boot to format the storage and change the device identity.
Connecting to the network using Wifi...
Connected to the network successfully. IP address: 192.168.1.201
Initializing Pelion Device Management Client...
Initialized Pelion Client. Registering...
Registered to Pelion Device Management. Endpoint Name: 016a***********************10006d
ADC temp: 23.1746 C, vref: 0.3665 V
ADC temp: 23.2234 C, vref: 0.3663 V
Revision 2:84828eb738dd, committed 2019-05-22
- Comitter:
- galonso@rhomb.io
- Date:
- Wed May 22 09:31:31 2019 +0200
- Parent:
- 1:c11137afc120
- Child:
- 3:4c17ae41019c
- Commit message:
- README.md removed
Changed in this revision
| README.md | Show diff for this revision Revisions of this file |
--- a/README.md Tue May 21 18:41:02 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -## Mbed OS Device Management / Pelion Enablement -How to bring up new platforms and run tests successfully (and with ease!) - -See porting guide at https://github.com/ARMmbed/simple-mbed-cloud-client#device-management-configuration. - -Also validation and testing guide available at https://github.com/ARMmbed/simple-mbed-cloud-client#validation-and-testing - -### Setup your environment - -1. Make sure that you have Mbed CLI over 1.9.1 - ``` - C:\>mbed --version - 1.9.1 - ``` - For instruction on how to upgrade Mbed CLI, please refer to this [link](https://github.com/ARMmbed/mbed-cli). - -2. Get the whole test code via `mbed import git@github.com:ARMmbed/pelion-enablement.git` - - It will automatically expand dependent libraries in the test SW. - -3. Get mbed_cloud_dev_credential.c file from the Pelion portal. - - Then overwrite the existing mbed_cloud_dev_credential.c file. - -4. Install the `CLOUD_SDK_API_KEY` - - `mbed config -G CLOUD_SDK_API_KEY ak_1MDE1...<snip>` - - For convenience, this repository uses pre-generated certificates for API key `ak_1MDE1ZjZlMzg4ZTVkMDI0MjBhMDExYjA4MDAwMDAwMDA016617c30d482200d95670ee000000006iCt30Oe5HufoIQbyhTo1ybH00EZviYo`. It's recommended that you generate your own API key as some of the tests (e.g. LWM2M Post) are limited to 1 open active connection to the Pelion DM API server at a time. You should use this key only if you don't have access to Pelion Device Management (which is free to register for any Mbed developer - therefore go register now!). - - For instructions on how to generate your API key, please [see the documentation](https://cloud.mbed.com/docs/current/integrate-web-app/api-keys.html#generating-an-api-key). - -5. Initialize firmware credentials (optional) - - Simple Pelion DM Client provides Greentea tests to test your porting efforts. Before running these tests, it's recommended that you run the `mbed dm init` command, which will install all needed credentials for both Connect and Update Pelion DM features. You can use the following command: - ``` - $ cd pelion-enablement - $ 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. - -6. (Optional) If you already compiled your bootloader for your specific target device - - If so, please update your bootloader to mbed-os. - -### Known problems - -1. On Windows and when using `GCC_ARM`, you're likely to hit the Path limit. The workaround is running following commands: - - Move the repo directory close to `C:\` - - `move C:\...\pelion-enablement C:\P` - - Rename simple-mbed-cloud-client foler and lib file - - `move simple-mbed-cloud-client spdmc` - - `move simple-mbed-cloud-client.lib spdmc.lib` - - Compile and run with changed test name prefix of `spdmc-`. - - `mbed test -t <TOOLCHAIN> -m <TARGET> -n spdmc-tests-* --compile` - - `mbed test -t <TOOLCHAIN> -m <TARGET> -n spdmc-tests-* --run -v`



