Generic Pelion Device Management example for various short range U-blox-based boards.

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:

Follow the Quick-Start instructions: https://cloud.mbed.com/quick-start

UBLOX_EVK_ODIN_W2

Example functionality

This example showcases the following device functionality:

  • 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.
  • (currently disabled) Read ADC temperature and ADC vref, and report them as Pelion LWM2M resources.

Use this example with Mbed CLI

1. Import the application into your desktop:

mbed import https://os.mbed.com/teams/ublox/code/pelion-example-common-odinw2

cd pelion-example-common-odinw2

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)

Committer:
fahimalavi
Date:
Fri Oct 04 18:56:50 2019 +0500
Revision:
3:fd659f991dc9
Parent:
1:74e24f935f2f
Reverting invalid commit during merge

Who changed what in which revision?

UserRevisionLine numberNew contents of line
fahimalavi 0:7e9105051efa 1 {
fahimalavi 0:7e9105051efa 2 "target_overrides": {
fahimalavi 0:7e9105051efa 3 "*": {
fahimalavi 0:7e9105051efa 4 "target.components_remove" : ["FLASHIAP"],
fahimalavi 0:7e9105051efa 5 "platform.stdio-baud-rate" : 115200,
fahimalavi 0:7e9105051efa 6 "platform.stdio-convert-newlines" : true,
fahimalavi 0:7e9105051efa 7 "mbed-trace.enable" : null,
fahimalavi 0:7e9105051efa 8 "nsapi.default-wifi-security" : "WPA_WPA2",
fahimalavi 0:7e9105051efa 9 "nsapi.default-wifi-ssid" : "\"SSID\"",
fahimalavi 0:7e9105051efa 10 "nsapi.default-wifi-password" : "\"Password\""
fahimalavi 0:7e9105051efa 11 },
fahimalavi 0:7e9105051efa 12 "UBLOX_EVK_ODIN_W2": {
fahimalavi 0:7e9105051efa 13 "target.components_add" : ["SD"],
fahimalavi 0:7e9105051efa 14 "target.network-default-interface-type" : "WIFI",
fahimalavi 0:7e9105051efa 15 "device-management.flash-start-address" : "0x08000000",
fahimalavi 0:7e9105051efa 16 "device-management.flash-size" : "(2048*1024)",
fahimalavi 0:7e9105051efa 17 "device-management.sotp-section-1-address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + MBED_CONF_APP_FLASH_SIZE - 2*(128*1024))",
fahimalavi 0:7e9105051efa 18 "device-management.sotp-section-1-size" : "(128*1024)",
fahimalavi 0:7e9105051efa 19 "device-management.sotp-section-2-address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + MBED_CONF_APP_FLASH_SIZE - 1*(128*1024))",
fahimalavi 0:7e9105051efa 20 "device-management.sotp-section-2-size" : "(128*1024)",
fahimalavi 0:7e9105051efa 21 "update-client.application-details" : "(MBED_CONF_APP_FLASH_START_ADDRESS + 64*1024)",
fahimalavi 0:7e9105051efa 22 "update-client.storage-address" : "(64*1024*1024)",
fahimalavi 0:7e9105051efa 23 "update-client.storage-size" : "(2*1024*1024)",
fahimalavi 0:7e9105051efa 24 "update-client.storage-locations" : "1",
fahimalavi 0:7e9105051efa 25 "target.features_add" : ["BOOTLOADER"],
fahimalavi 0:7e9105051efa 26 "target.bootloader_img" : "bootloader/mbed-bootloader-UBLOX_EVK_ODIN_W2.bin",
fahimalavi 0:7e9105051efa 27 "target.header_offset" : "0x10000",
fahimalavi 0:7e9105051efa 28 "target.app_offset" : "0x10400",
fahimalavi 0:7e9105051efa 29 "use-button" : false
fahimalavi 0:7e9105051efa 30 }
fahimalavi 0:7e9105051efa 31 },
fahimalavi 0:7e9105051efa 32 "config": {
fahimalavi 0:7e9105051efa 33 "format-storage-layer-on-error": {
fahimalavi 0:7e9105051efa 34 "help": "Whether to format the storage layer when it cannot be read - always disable for production devices!",
fahimalavi 0:7e9105051efa 35 "value": 1
fahimalavi 0:7e9105051efa 36 },
fahimalavi 0:7e9105051efa 37 "main-stack-size": {
fahimalavi 0:7e9105051efa 38 "value": 6000
fahimalavi 0:7e9105051efa 39 },
fahimalavi 0:7e9105051efa 40 "use-button": {
fahimalavi 0:7e9105051efa 41 "help": "Whether the target has a button",
fahimalavi 0:7e9105051efa 42 "macro_name": "USE_BUTTON",
fahimalavi 0:7e9105051efa 43 "value": true
fahimalavi 0:7e9105051efa 44 },
fahimalavi 0:7e9105051efa 45 "button-pressed-state": {
fahimalavi 0:7e9105051efa 46 "help": "Value of the button when pressed",
fahimalavi 0:7e9105051efa 47 "value": 1
fahimalavi 0:7e9105051efa 48 },
fahimalavi 0:7e9105051efa 49 "no_led": {
fahimalavi 0:7e9105051efa 50 "help": "This flag disables the heartbeat thread in tests. This is useful for platforms that don't have an LED or the LED is used for other functionality like LED on the SPI clockline etc",
fahimalavi 0:7e9105051efa 51 "value": null
fahimalavi 0:7e9105051efa 52 }
fahimalavi 0:7e9105051efa 53 }
fahimalavi 0:7e9105051efa 54 }