Generic Pelion Device Management example for various U-blox-based boards.
Dependencies: ublox-at-cellular-interface ublox-cellular-base
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:
- UBLOX_C030_R412M over Cellular and using SD card.
- UBLOX_C030_U201 over Cellular and using SD card.
For Odin-W2 please go to Repository link
Follow the Quick-Start instructions: https://cloud.mbed.com/quick-start
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 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)
Revision 12:dd17519b5e30, committed 2019-07-04
- Comitter:
- fahimalavi
- Date:
- Thu Jul 04 14:47:10 2019 +0500
- Parent:
- 11:7cdc7397d270
- Child:
- 13:f5b874c31495
- Commit message:
- Reverting back as Odin-W2 has build error with Mbed-os 5.12.4 and SMCC, reverting back to 230af466efc4
Changed in this revision
--- a/bootloader/bootloader_app.json Wed Jul 03 10:58:54 2019 +0500 +++ b/bootloader/bootloader_app.json Thu Jul 04 14:47:10 2019 +0500 @@ -79,22 +79,6 @@ "update-client.application-details": "(MBED_CONF_APP_FLASH_START_ADDRESS + 64*1024)", "application-start-address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + 65*1024)", "max-application-size" : "DEFAULT_MAX_APPLICATION_SIZE" - }, - "UBLOX_C030_R41XM": { - "target.components_add" : ["SD"], - "flash-start-address" : "0x08000000", - "flash-size" : "(1024*1024)", - "nvstore.area_1_address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + MBED_CONF_APP_FLASH_SIZE - 2*(128*1024))", - "nvstore.area_1_size" : "(128*1024)", - "nvstore.area_2_address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + MBED_CONF_APP_FLASH_SIZE - 1*(128*1024))", - "nvstore.area_2_size" : "(128*1024)", - "update-client.storage-address" : "(64*1024*1024)", - "update-client.storage-size" : "(2*1024*1024)", - "update-client.storage-locations" : 1, - "update-client.firmware-header-version": "2", - "update-client.application-details": "(MBED_CONF_APP_FLASH_START_ADDRESS + 64*1024)", - "application-start-address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + 65*1024)", - "max-application-size" : "DEFAULT_MAX_APPLICATION_SIZE" - }, + } } }
Binary file bootloader/mbed-bootloader-UBLOX_C030_R412M.bin has changed
--- a/main.cpp Wed Jul 03 10:58:54 2019 +0500 +++ b/main.cpp Thu Jul 04 14:47:10 2019 +0500 @@ -22,12 +22,6 @@ #include "FATFileSystem.h" #include "LittleFileSystem.h" -#ifdef TARGET_UBLOX_C030_R41XM -#include "UbloxATCellularInterface.h" -#endif - -#define PIN "0000" - // Default network interface object. Don't forget to change the WiFi SSID/password in mbed_app.json if you're using WiFi. NetworkInterface *net = NetworkInterface::get_default_instance(); @@ -137,28 +131,7 @@ // Connect to the Internet (DHCP is expected to be on) printf("Connecting to the network using the default network interface...\n"); -#ifdef TARGET_UBLOX_C030_R41XM - net = new UbloxATCellularInterface(); - - if (((UbloxATCellularInterface*)net)->init(PIN)) { - - if ( (((UbloxATCellularInterface*)net)->is_registered_csd() || ((UbloxATCellularInterface*)net)->is_registered_psd() || ((UbloxATCellularInterface*)net)->is_registered_eps()) ) { - printf("De-registering...\n\n"); - ((UbloxATCellularInterface*)net)->nwk_deregistration(); - } - - - if (((UbloxATCellularInterface*)net)->set_modem_rat(UbloxATCellularInterface::GPRS_EGPRS)) { - printf("GPRS_EGPRS RAT configured\n"); - } - - if (((UbloxATCellularInterface*)net)->reboot_modem()) { - printf("Rebooting modem\n"); - } - } -#else net = NetworkInterface::get_default_instance(); -#endif nsapi_error_t net_status = NSAPI_ERROR_NO_CONNECTION; while ((net_status = net->connect()) != NSAPI_ERROR_OK) {
--- a/mbed-os.lib Wed Jul 03 10:58:54 2019 +0500 +++ b/mbed-os.lib Thu Jul 04 14:47:10 2019 +0500 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-os/#73f096399b4cda1f780b140c87afad9446047432 +https://github.com/ARMmbed/mbed-os/#51d55508e8400b60af467005646c4e2164738d48
--- a/mbed_app.json Wed Jul 03 10:58:54 2019 +0500 +++ b/mbed_app.json Thu Jul 04 14:47:10 2019 +0500 @@ -2,11 +2,9 @@ "target_overrides": { "*": { "target.components_remove" : ["FLASHIAP"], - "target.extra_labels_remove" : ["PSA"], "platform.stdio-baud-rate" : 115200, "platform.stdio-convert-newlines" : true, "mbed-trace.enable" : null, - "mbed-cloud-client.external-sst-support" : null, "nsapi.default-wifi-security" : "WPA_WPA2", "nsapi.default-wifi-ssid" : "\"SSID\"", "nsapi.default-wifi-password" : "\"Password\"" @@ -53,31 +51,6 @@ "target.bootloader_img" : "bootloader/mbed-bootloader-UBLOX_C030_U201.bin", "target.header_offset" : "0x10000", "target.app_offset" : "0x10400" - }, - "UBLOX_C030_R41XM": { - "target.features_add" : ["STORAGE", "LWIP"], - "target.components_add" : ["SD"], - "target.network-default-interface-type" : "CELLULAR", - "lwip.ipv4-enabled" : true, - "lwip.ethernet-enabled" : false, - "lwip.ppp-enabled" : true, - "lwip.tcp-enabled" : true, - "mbed-trace.enable" : false, - "device-management.flash-start-address" : "0x08000000", - "device-management.flash-size" : "(1024*1024)", - "device-management.sotp-section-1-address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + MBED_CONF_APP_FLASH_SIZE - 2*(128*1024))", - "device-management.sotp-section-1-size" : "(128*1024)", - "device-management.sotp-section-2-address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + MBED_CONF_APP_FLASH_SIZE - 1*(128*1024))", - "device-management.sotp-section-2-size" : "(128*1024)", - "update-client.application-details" : "(MBED_CONF_APP_FLASH_START_ADDRESS + 64*1024)", - "update-client.storage-address" : "(64*1024*1024)", - "update-client.storage-size" : "(2*1024*1024)", - "update-client.storage-locations" : "1", - "target.features_add" : ["BOOTLOADER"], - "target.bootloader_img" : "bootloader/mbed-bootloader-UBLOX_C030_R412M.bin", - "target.header_offset" : "0x10000", - "target.app_offset" : "0x10400", - "platform.default-serial-baud-rate" : 115200 } }, "config": {
--- a/simple-mbed-cloud-client.lib Wed Jul 03 10:58:54 2019 +0500 +++ b/simple-mbed-cloud-client.lib Thu Jul 04 14:47:10 2019 +0500 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/simple-mbed-cloud-client/#eadf19d642431cf534c3a70b9c72f97ed5b0dd7c +https://github.com/ARMmbed/simple-mbed-cloud-client/#2ad31604eb91b1facc11b2f9d1ba4e54a80d1384
--- a/ublox-at-cellular-interface.lib Wed Jul 03 10:58:54 2019 +0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://developer.mbed.org/teams/ublox/code/ublox-at-cellular-interface/#aef4a3de0de3
--- a/ublox-cellular-base.lib Wed Jul 03 10:58:54 2019 +0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://developer.mbed.org/teams/ublox/code/ublox-cellular-base/#e67d3d9d2e7e