BG96_K6xF_pelion-example-frdm_Temp

Dependencies:   FXAS21002 FXOS8700Q

Overview

This document is based on https://os.mbed.com/teams/NXP/code/pelion-example-frdm/ and the code forked Daniel_Lee's(https://os.mbed.com/users/Daniel_Lee/code/BG96_K6xF_pelion-example-frdm/)BG96_K6xF_pelion-example-frdm repository and added some features. Need a WIZnet IoT Shield BG96 board and development board.

This example is known to work great on the following platforms:

/media/uploads/stkim92/pel01.png

Requirement

  1. FRDM-K64F or FRDM-K66F
  2. WIZnet IoT Shield BG96 board
  3. USIM card

Example functionality

This example showcases the following device functionality:

Read onboard FXOS8700Q accelerometer, magnetometer and temperature(on shield). And report the values as Pelion LWM2M resources (see image below). (FRDM-K66F only) Read onboard FXAS21002 gyroscope and report the values as Pelion LWM2M resources. 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.

1. Import into Compiler

/media/uploads/stkim92/pel1.png

2. Apply Update Certificate

/media/uploads/stkim92/pel03.png

3. Compile and Program

/media/uploads/stkim92/pel04.png

4. If successfully connect to cellular networks(SKTelecom) then you can get below message

Device's Result

include the mbed library with this snippet

You can hold the user button during boot to format the storage and change the device identity.

M2Mnet(BG96) Power ON



Sensors configuration:

FXOS8700Q accelerometer = 0xC7

FXOS8700Q magnetometer  = 0xC7



Connecting to the network using the default network interface...

Connected to the network successfully. IP address: 2001:2D8:65

Initializing Pelion Device Management Client...

Initialized Pelion Device Management Client. Registering...

Press the user button to increment the LwM2M resource value...

Celsius temp : 26.10 C                                                             

FXOS8700Q mag:    0.217 x,   0.420 y,   0.288 z [gauss]     

Pelion Cloud Result (1)

/media/uploads/stkim92/pel4.png

Pelion Cloud Result (2)

/media/uploads/stkim92/pel5.png

Files at this revision

API Documentation at this revision

Comitter:
stkim92
Date:
Tue Aug 06 14:38:56 2019 +0000
Parent:
13:ec1c3a64ee39
Commit message:
Add MbedCloudClientResource_temperature

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed_cloud_dev_credentials.c Show annotated file Show diff for this revision Revisions of this file
sensors/FXAS21002.lib Show annotated file Show diff for this revision Revisions of this file
sensors/FXOS8700Q.lib Show annotated file Show diff for this revision Revisions of this file
update_certificate.pem Show annotated file Show diff for this revision Revisions of this file
update_default_resources.c Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Jul 24 16:20:11 2019 +0000
+++ b/main.cpp	Tue Aug 06 14:38:56 2019 +0000
@@ -43,7 +43,7 @@
 
 // How often to fetch sensor data (in seconds)
 #define SENSORS_POLL_INTERVAL 3.0
-
+#define MBED_CONF_IOTSHIELD_SENSOR_TEMP             A1
 // Send all sensor data or just limited (useful for when running out of memory)
 //#define SEND_ALL_SENSORS
 
@@ -51,6 +51,8 @@
 #include "FXOS8700Q.h"
 #include "FXAS21002.h"
 
+AnalogIn   tempVal(MBED_CONF_IOTSHIELD_SENSOR_TEMP); //19.08.06 added by tom
+
 #ifdef TARGET_K66F
 I2C sens_i2c(PTD9, PTD8);
 #else
@@ -67,9 +69,11 @@
 MbedCloudClientResource *res_button;
 MbedCloudClientResource *res_led;
 MbedCloudClientResource *res_post;
+MbedCloudClientResource *res_temperature; //19.08.06 added by tom
 
 // Additional resources for sensor readings
 #ifdef SEND_ALL_SENSORS
+MbedCloudClientResource *res_temperature; //19.08.06 added by tom
 MbedCloudClientResource *res_magnometer_x;
 MbedCloudClientResource *res_magnometer_y;
 MbedCloudClientResource *res_magnometer_z;
@@ -83,6 +87,10 @@
 #endif /* TARGET_K66F */
 #endif /* SEND_ALL_SENSORS */
 
+float temp =0;
+float voltage = 0;    // 전압 계산 값 넣을 변수
+float celsius = 0;    // 섭씨 계산 값 넣을 변수
+
 void BG96_Modem_PowerON(void)
 {
     DigitalOut BG96_RESET(D7);
@@ -181,11 +189,22 @@
     printf("\n"); ;
 }
 
+float getTemperature_C(float _voltage)
+{
+    // LM35는 섭씨 1도당 10mV의 전위차를 갖는다.
+    // 센서핀의 전압이 0.28V라면 280mV이므로 온도는 28도씨.
+    // 100을 곱해서 섭씨 온도로 나타냄
+    celsius = voltage * 100.0;
+    return celsius;
+}
+
+
 /**
  * Update sensors and report their values.
  * This function is called periodically.
  */
 void sensors_update() {
+
     motion_data_counts_t acc_raw, mag_raw;
 
     sens_acc.getAxis(acc_raw);
@@ -193,6 +212,15 @@
 
     float mag_x = (double)mag_raw.x / 1000.0, mag_y = (double)mag_raw.y / 1000.0, mag_z = (double)mag_raw.z / 1000.0;
     float acc_x = (double)acc_raw.x / 1000.0, acc_y = (double)acc_raw.y / 1000.0, acc_z = (double)acc_raw.z / 1000.0;
+    
+    temp = tempVal.read_u16()/100;
+    voltage = temp * 4.95 / 1024;
+    celsius = getTemperature_C(voltage);
+    printf("Celsius temp : %.2f C", celsius);
+    if (endpointInfo) {
+        res_temperature->set_value(celsius);
+    }
+    
 #ifdef TARGET_K66F
     float gyro_x = (double)sens_gyro.getX() / 1000.0, gyro_y = (double)sens_gyro.getY() / 1000.0, gyro_z = (double)sens_gyro.getZ() / 1000.0;
 #endif /* TARGET_K66F */
@@ -209,6 +237,7 @@
 
     if (endpointInfo) {
 #ifdef SEND_ALL_SENSORS
+        res_temperature->set_value(celsius);
         res_accelerometer_x->set_value(acc_x);
         res_accelerometer_y->set_value(acc_y);
         res_accelerometer_z->set_value(acc_z);
@@ -224,6 +253,9 @@
     }
 }
 
+
+
+
 int main(void) {
     printf("\nStarting Simple Pelion Device Management Client example\n");
 
@@ -278,6 +310,12 @@
     }
 
     // Creating resources, which can be written or read from the cloud
+    
+    res_temperature = client.create_resource("3303/0/5700", "Temperature (C)");
+    res_temperature->set_value(0);
+    res_temperature->methods(M2MMethod::GET);
+    res_temperature->observable(true);
+    
     res_button = client.create_resource("3200/0/5501", "button_count");
     res_button->set_value(0);
     res_button->methods(M2MMethod::GET);
@@ -362,4 +400,5 @@
     eventQueue.dispatch_forever();
 }
 
+
 #endif /* MBED_TEST_MODE */
--- a/mbed_cloud_dev_credentials.c	Wed Jul 24 16:20:11 2019 +0000
+++ b/mbed_cloud_dev_credentials.c	Tue Aug 06 14:38:56 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 ARM Limited. All rights reserved.
+ * Copyright (c) 2018 ARM Limited. All rights reserved.
  * SPDX-License-Identifier: Apache-2.0
  * Licensed under the Apache License, Version 2.0 (the License); you may
  * not use this file except in compliance with the License.
@@ -15,39 +15,202 @@
  */
 #ifndef __MBED_CLOUD_DEV_CREDENTIALS_H__
 #define __MBED_CLOUD_DEV_CREDENTIALS_H__
- 
-#if MBED_CONF_DEVICE_MANAGEMENT_DEVELOPER_MODE == 1
-#error "Replace mbed_cloud_dev_credentials.c with your own developer cert."
-#endif
- 
+
 #include <inttypes.h>
- 
-const char MBED_CLOUD_DEV_BOOTSTRAP_ENDPOINT_NAME[] = "";
-const char MBED_CLOUD_DEV_ACCOUNT_ID[] = "";
-const char MBED_CLOUD_DEV_BOOTSTRAP_SERVER_URI[] = "";
- 
-const uint8_t MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_CERTIFICATE[] =
-{ 0x0 };
- 
-const uint8_t MBED_CLOUD_DEV_BOOTSTRAP_SERVER_ROOT_CA_CERTIFICATE[] =
-{ 0x0 };
- 
-const uint8_t MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_PRIVATE_KEY[] =
-{ 0x0 };
- 
+
+const char MBED_CLOUD_DEV_BOOTSTRAP_ENDPOINT_NAME[] = "016c22e3835236edb65b18b303c00000";
+const char MBED_CLOUD_DEV_ACCOUNT_ID[] = "016c22e26fecaab1b96ba5c000000000";
+const char MBED_CLOUD_DEV_BOOTSTRAP_SERVER_URI[] = "coaps://bootstrap.us-east-1.mbedcloud.com:5684?aid=016c22e26fecaab1b96ba5c000000000";
+
+const uint8_t MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_CERTIFICATE[] = 
+{ 0x30, 0x82, 0x02, 0x82, 0x30, 0x82, 0x02, 0x29,
+ 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x1c,
+ 0xe7, 0x8e, 0xb4, 0xd0, 0x26, 0x4c, 0x17, 0xb1,
+ 0xfd, 0x4a, 0x68, 0x8e, 0x89, 0xb7, 0xc5, 0x30,
+ 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d,
+ 0x04, 0x03, 0x02, 0x30, 0x81, 0xa2, 0x31, 0x0b,
+ 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
+ 0x02, 0x47, 0x42, 0x31, 0x17, 0x30, 0x15, 0x06,
+ 0x03, 0x55, 0x04, 0x08, 0x0c, 0x0e, 0x43, 0x61,
+ 0x6d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x73,
+ 0x68, 0x69, 0x72, 0x65, 0x31, 0x12, 0x30, 0x10,
+ 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x09, 0x43,
+ 0x61, 0x6d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65,
+ 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04,
+ 0x0a, 0x0c, 0x07, 0x41, 0x52, 0x4d, 0x20, 0x4c,
+ 0x74, 0x64, 0x31, 0x29, 0x30, 0x27, 0x06, 0x03,
+ 0x55, 0x04, 0x0b, 0x0c, 0x20, 0x30, 0x31, 0x36,
+ 0x63, 0x32, 0x32, 0x65, 0x32, 0x36, 0x66, 0x65,
+ 0x63, 0x61, 0x61, 0x62, 0x31, 0x62, 0x39, 0x36,
+ 0x62, 0x61, 0x35, 0x63, 0x30, 0x30, 0x30, 0x30,
+ 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x29, 0x30,
+ 0x27, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x20,
+ 0x30, 0x31, 0x36, 0x63, 0x32, 0x32, 0x65, 0x33,
+ 0x38, 0x33, 0x35, 0x32, 0x33, 0x36, 0x65, 0x64,
+ 0x62, 0x36, 0x35, 0x62, 0x31, 0x38, 0x62, 0x33,
+ 0x30, 0x33, 0x63, 0x30, 0x30, 0x30, 0x30, 0x30,
+ 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x39, 0x30, 0x37,
+ 0x32, 0x34, 0x30, 0x37, 0x33, 0x30, 0x33, 0x31,
+ 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x30, 0x37, 0x32,
+ 0x34, 0x30, 0x37, 0x33, 0x30, 0x33, 0x31, 0x5a,
+ 0x30, 0x81, 0xa2, 0x31, 0x0b, 0x30, 0x09, 0x06,
+ 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x47, 0x42,
+ 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04,
+ 0x08, 0x0c, 0x0e, 0x43, 0x61, 0x6d, 0x62, 0x72,
+ 0x69, 0x64, 0x67, 0x65, 0x73, 0x68, 0x69, 0x72,
+ 0x65, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55,
+ 0x04, 0x07, 0x0c, 0x09, 0x43, 0x61, 0x6d, 0x62,
+ 0x72, 0x69, 0x64, 0x67, 0x65, 0x31, 0x10, 0x30,
+ 0x0e, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x07,
+ 0x41, 0x52, 0x4d, 0x20, 0x4c, 0x74, 0x64, 0x31,
+ 0x29, 0x30, 0x27, 0x06, 0x03, 0x55, 0x04, 0x0b,
+ 0x0c, 0x20, 0x30, 0x31, 0x36, 0x63, 0x32, 0x32,
+ 0x65, 0x32, 0x36, 0x66, 0x65, 0x63, 0x61, 0x61,
+ 0x62, 0x31, 0x62, 0x39, 0x36, 0x62, 0x61, 0x35,
+ 0x63, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
+ 0x30, 0x30, 0x31, 0x29, 0x30, 0x27, 0x06, 0x03,
+ 0x55, 0x04, 0x03, 0x0c, 0x20, 0x30, 0x31, 0x36,
+ 0x63, 0x32, 0x32, 0x65, 0x33, 0x38, 0x33, 0x35,
+ 0x32, 0x33, 0x36, 0x65, 0x64, 0x62, 0x36, 0x35,
+ 0x62, 0x31, 0x38, 0x62, 0x33, 0x30, 0x33, 0x63,
+ 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x59, 0x30,
+ 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d,
+ 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce,
+ 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04,
+ 0x9c, 0x97, 0x23, 0xe8, 0x34, 0x40, 0x3b, 0x67,
+ 0x0e, 0x75, 0xd7, 0x4a, 0xf7, 0xc6, 0x3e, 0x87,
+ 0x97, 0x86, 0xad, 0xb8, 0x29, 0x08, 0x92, 0x60,
+ 0xcb, 0x10, 0x6f, 0x11, 0x22, 0x5b, 0x21, 0x38,
+ 0xa8, 0x58, 0xad, 0xf8, 0x51, 0xc1, 0xb1, 0x60,
+ 0x3c, 0x67, 0xe9, 0xb0, 0x13, 0x01, 0x61, 0x62,
+ 0x55, 0x35, 0x60, 0x1d, 0x85, 0x3b, 0xed, 0x8f,
+ 0x9b, 0x5b, 0x3b, 0x8a, 0x24, 0x89, 0x88, 0x87,
+ 0xa3, 0x3f, 0x30, 0x3d, 0x30, 0x12, 0x06, 0x09,
+ 0x2b, 0x06, 0x01, 0x04, 0x01, 0xa0, 0x20, 0x81,
+ 0x49, 0x04, 0x05, 0x02, 0x03, 0x40, 0x00, 0x91,
+ 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01,
+ 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01,
+ 0xff, 0x02, 0x01, 0x00, 0x30, 0x13, 0x06, 0x03,
+ 0x55, 0x1d, 0x25, 0x04, 0x0c, 0x30, 0x0a, 0x06,
+ 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03,
+ 0x02, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48,
+ 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, 0x00,
+ 0x30, 0x44, 0x02, 0x20, 0x08, 0xa7, 0x2f, 0xdf,
+ 0x41, 0x6a, 0xc5, 0x97, 0xe9, 0xa3, 0x45, 0x96,
+ 0x50, 0x09, 0xf9, 0x24, 0x6f, 0xf1, 0x9a, 0x5a,
+ 0xe3, 0xa1, 0x82, 0xf0, 0x8b, 0x1b, 0x04, 0x03,
+ 0x62, 0xdd, 0xc1, 0x8a, 0x02, 0x20, 0x5b, 0x33,
+ 0x71, 0x3f, 0x23, 0x2e, 0x88, 0xd4, 0x4c, 0xcb,
+ 0x22, 0xf0, 0x7b, 0x6c, 0xc3, 0x35, 0xbe, 0x78,
+ 0xff, 0xe1, 0x69, 0x14, 0x70, 0x8e, 0x5b, 0x47,
+ 0x7d, 0x30, 0xf3, 0x96, 0x3e, 0x73 };
+
+const uint8_t MBED_CLOUD_DEV_BOOTSTRAP_SERVER_ROOT_CA_CERTIFICATE[] = 
+{ 0x30, 0x82, 0x02, 0x1f, 0x30, 0x82, 0x01, 0xc5,
+ 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x3c,
+ 0x63, 0x38, 0x70, 0x08, 0xd3, 0xc9, 0x8a, 0x4c,
+ 0x72, 0x1f, 0x8f, 0x45, 0xeb, 0xd8, 0xf3, 0x30,
+ 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d,
+ 0x04, 0x03, 0x02, 0x30, 0x67, 0x31, 0x0b, 0x30,
+ 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
+ 0x47, 0x42, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03,
+ 0x55, 0x04, 0x08, 0x13, 0x0e, 0x43, 0x61, 0x6d,
+ 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x73, 0x68,
+ 0x69, 0x72, 0x65, 0x31, 0x12, 0x30, 0x10, 0x06,
+ 0x03, 0x55, 0x04, 0x07, 0x13, 0x09, 0x43, 0x61,
+ 0x6d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x31,
+ 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x0a,
+ 0x13, 0x07, 0x41, 0x52, 0x4d, 0x20, 0x4c, 0x74,
+ 0x64, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55,
+ 0x04, 0x03, 0x13, 0x10, 0x41, 0x52, 0x4d, 0x20,
+ 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61,
+ 0x70, 0x20, 0x43, 0x41, 0x30, 0x20, 0x17, 0x0d,
+ 0x31, 0x37, 0x30, 0x34, 0x30, 0x33, 0x31, 0x34,
+ 0x30, 0x33, 0x33, 0x36, 0x5a, 0x18, 0x0f, 0x32,
+ 0x30, 0x35, 0x32, 0x30, 0x34, 0x30, 0x33, 0x31,
+ 0x34, 0x31, 0x33, 0x33, 0x36, 0x5a, 0x30, 0x67,
+ 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04,
+ 0x06, 0x13, 0x02, 0x47, 0x42, 0x31, 0x17, 0x30,
+ 0x15, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0e,
+ 0x43, 0x61, 0x6d, 0x62, 0x72, 0x69, 0x64, 0x67,
+ 0x65, 0x73, 0x68, 0x69, 0x72, 0x65, 0x31, 0x12,
+ 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13,
+ 0x09, 0x43, 0x61, 0x6d, 0x62, 0x72, 0x69, 0x64,
+ 0x67, 0x65, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03,
+ 0x55, 0x04, 0x0a, 0x13, 0x07, 0x41, 0x52, 0x4d,
+ 0x20, 0x4c, 0x74, 0x64, 0x31, 0x19, 0x30, 0x17,
+ 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x10, 0x41,
+ 0x52, 0x4d, 0x20, 0x42, 0x6f, 0x6f,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 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07,
+ 0xa1, 0x44, 0x03, 0x42, 0x00, 0x04, 0x9c, 0x97,
+ 0x23, 0xe8, 0x34, 0x40, 0x3b, 0x67, 0x0e, 0x75,
+ 0xd7, 0x4a, 0xf7, 0xc6, 0x3e, 0x87, 0x97, 0x86,
+ 0xad, 0xb8, 0x29, 0x08, 0x92, 0x60, 0xcb, 0x10,
+ 0x6f, 0x11, 0x22, 0x5b, 0x21, 0x38, 0xa8, 0x58,
+ 0xad, 0xf8, 0x51, 0xc1, 0xb1, 0x60, 0x3c, 0x67,
+ 0xe9, 0xb0, 0x13, 0x01, 0x61, 0x62, 0x55, 0x35,
+ 0x60, 0x1d, 0x85, 0x3b, 0xed, 0x8f, 0x9b, 0x5b,
+ 0x3b, 0x8a, 0x24, 0x89, 0x88, 0x87 };
+
 const char MBED_CLOUD_DEV_MANUFACTURER[] = "dev_manufacturer";
- 
+
 const char MBED_CLOUD_DEV_MODEL_NUMBER[] = "dev_model_num";
- 
+
 const char MBED_CLOUD_DEV_SERIAL_NUMBER[] = "0";
- 
+
 const char MBED_CLOUD_DEV_DEVICE_TYPE[] = "dev_device_type";
- 
+
 const char MBED_CLOUD_DEV_HARDWARE_VERSION[] = "dev_hardware_version";
- 
+
 const uint32_t MBED_CLOUD_DEV_MEMORY_TOTAL_KB = 0;
+
 const uint32_t MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_CERTIFICATE_SIZE = sizeof(MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_CERTIFICATE);
 const uint32_t MBED_CLOUD_DEV_BOOTSTRAP_SERVER_ROOT_CA_CERTIFICATE_SIZE = sizeof(MBED_CLOUD_DEV_BOOTSTRAP_SERVER_ROOT_CA_CERTIFICATE);
 const uint32_t MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_PRIVATE_KEY_SIZE = sizeof(MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_PRIVATE_KEY);
- 
-#endif //__MBED_CLOUD_DEV_CREDENTIALS_H__
\ No newline at end of file
+
+#endif //__MBED_CLOUD_DEV_CREDENTIALS_H__
--- a/sensors/FXAS21002.lib	Wed Jul 24 16:20:11 2019 +0000
+++ b/sensors/FXAS21002.lib	Tue Aug 06 14:38:56 2019 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/users/Daniel_Lee/code/FXAS21002/#8461f7fe0a7f
+https://os.mbed.com/users/Daniel_Lee/code/FXAS21002/#ee0bdc90f4fb
--- a/sensors/FXOS8700Q.lib	Wed Jul 24 16:20:11 2019 +0000
+++ b/sensors/FXOS8700Q.lib	Tue Aug 06 14:38:56 2019 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/users/Daniel_Lee/code/FXOS8700Q/#834488c11340
+https://os.mbed.com/users/Daniel_Lee/code/FXOS8700Q/#192bb7e45280
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/update_certificate.pem	Tue Aug 06 14:38:56 2019 +0000
@@ -0,0 +1,9 @@
+-----BEGIN CERTIFICATE-----
+MIIBTDCB9KADAgECAhRozv8lCeRy658eqQvrze8MMUL4wzAKBggqhkjOPQQDAjAU
+MRIwEAYDVQQDDAlsb2NhbGhvc3QwHhcNMTkwNzMxMDM0NzAxWhcNMjAwNzMwMTUw
+MDAwWjAUMRIwEAYDVQQDDAlsb2NhbGhvc3QwWTATBgcqhkjOPQIBBggqhkjOPQMB
+BwNCAASfhmNRnngjaaLfgC+LEe4DN+9e7vZglrPtz/cUtExN/ywdxr297AE1FU42
+NOkDEXeYbAIR/SAReSsJxAedUAlXoyQwIjALBgNVHQ8EBAMCB4AwEwYDVR0lBAww
+CgYIKwYBBQUHAwMwCgYIKoZIzj0EAwIDRwAwRAIgcxA8gH/SBDdmCQC6ca7Gb5u/
+Eg+xxg3wXFNZEXdS9koCINj7DI6Ds7wWN2mSBaVwKlcGMCu1/bOvcOl3avGvkz4C
+-----END CERTIFICATE-----
--- a/update_default_resources.c	Wed Jul 24 16:20:11 2019 +0000
+++ b/update_default_resources.c	Tue Aug 06 14:38:56 2019 +0000
@@ -1,41 +1,71 @@
-// ----------------------------------------------------------------------------
-// Copyright 2016-2017 ARM Ltd.
-//
-// SPDX-License-Identifier: Apache-2.0
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ----------------------------------------------------------------------------
- 
+
 #ifdef MBED_CLOUD_CLIENT_USER_CONFIG_FILE
 #include MBED_CLOUD_CLIENT_USER_CONFIG_FILE
 #endif
- 
+
 #include <stdint.h>
- 
+
 #ifdef MBED_CLOUD_DEV_UPDATE_ID
-const uint8_t arm_uc_vendor_id[16] = { "dev_manufacturer" };
+const uint8_t arm_uc_vendor_id[] = {
+    0x8b, 0x9c, 0x29, 0x91, 0xfc, 0xf8, 0x55, 0x8a, 0xa5, 0x30, 0x1d, 0xd4, 0x05, 0xb4, 0x83, 0xb9
+};
 const uint16_t arm_uc_vendor_id_size = sizeof(arm_uc_vendor_id);
- 
-const uint8_t arm_uc_class_id[16]  = { "dev_model_number" };
+
+const uint8_t arm_uc_class_id[]  = {
+    0x95, 0x9e, 0xdf, 0x33, 0xe0, 0x68, 0x55, 0xc2, 0x80, 0x7f, 0xb1, 0x6b, 0xa9, 0x8d, 0x29, 0x6a
+};
 const uint16_t arm_uc_class_id_size = sizeof(arm_uc_class_id);
 #endif
- 
+
 #ifdef MBED_CLOUD_DEV_UPDATE_CERT
-const uint8_t arm_uc_default_fingerprint[32] = { 0 };
+const uint8_t arm_uc_default_fingerprint[] =  {
+    0x84, 0x89, 0x24, 0xfd, 0xff, 0x10, 0xea, 0x83, 0x7e, 0xff, 0x30, 0xcf, 0xe2, 0xd8, 0xa3, 0x68,
+    0xe2, 0x4c, 0x3e, 0x88, 0xd0, 0xf9, 0x77, 0x3d, 0x8e, 0x70, 0xf9, 0x63, 0x10, 0x01, 0x94, 0x08
+};
 const uint16_t arm_uc_default_fingerprint_size =
     sizeof(arm_uc_default_fingerprint);
- 
-const uint8_t arm_uc_default_certificate[1] = { 0 };
-const uint16_t arm_uc_default_certificate_size =
-    sizeof(arm_uc_default_certificate);
-#endif
\ No newline at end of file
+
+const uint8_t arm_uc_default_subject_key_identifier[] =  {
+};
+const uint16_t arm_uc_default_subject_key_identifier_size =
+    sizeof(arm_uc_default_subject_key_identifier);
+
+const uint8_t arm_uc_default_certificate[] = {
+    0x30, 0x82, 0x01, 0x4c, 0x30, 0x81, 0xf4, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x14, 0x68, 0xce,
+    0xff, 0x25, 0x09, 0xe4, 0x72, 0xeb, 0x9f, 0x1e, 0xa9, 0x0b, 0xeb, 0xcd, 0xef, 0x0c, 0x31, 0x42,
+    0xf8, 0xc3, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x14,
+    0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c,
+    0x68, 0x6f, 0x73, 0x74, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x39, 0x30, 0x37, 0x33, 0x31, 0x30, 0x33,
+    0x34, 0x37, 0x30, 0x31, 0x5a, 0x17, 0x0d, 0x32, 0x30, 0x30, 0x37, 0x33, 0x30, 0x31, 0x35, 0x30,
+    0x30, 0x30, 0x30, 0x5a, 0x30, 0x14, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c,
+    0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07,
+    0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01,
+    0x07, 0x03, 0x42, 0x00, 0x04, 0x9f, 0x86, 0x63, 0x51, 0x9e, 0x78, 0x23, 0x69, 0xa2, 0xdf, 0x80,
+    0x2f, 0x8b, 0x11, 0xee, 0x03, 0x37, 0xef, 0x5e, 0xee, 0xf6, 0x60, 0x96, 0xb3, 0xed, 0xcf, 0xf7,
+    0x14, 0xb4, 0x4c, 0x4d, 0xff, 0x2c, 0x1d, 0xc6, 0xbd, 0xbd, 0xec, 0x01, 0x35, 0x15, 0x4e, 0x36,
+    0x34, 0xe9, 0x03, 0x11, 0x77, 0x98, 0x6c, 0x02, 0x11, 0xfd, 0x20, 0x11, 0x79, 0x2b, 0x09, 0xc4,
+    0x07, 0x9d, 0x50, 0x09, 0x57, 0xa3, 0x24, 0x30, 0x22, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f,
+    0x04, 0x04, 0x03, 0x02, 0x07, 0x80, 0x30, 0x13, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x0c, 0x30,
+    0x0a, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x03, 0x30, 0x0a, 0x06, 0x08, 0x2a,
+    0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, 0x00, 0x30, 0x44, 0x02, 0x20, 0x73, 0x10,
+    0x3c, 0x80, 0x7f, 0xd2, 0x04, 0x37, 0x66, 0x09, 0x00, 0xba, 0x71, 0xae, 0xc6, 0x6f, 0x9b, 0xbf,
+    0x12, 0x0f, 0xb1, 0xc6, 0x0d, 0xf0, 0x5c, 0x53, 0x59, 0x11, 0x77, 0x52, 0xf6, 0x4a, 0x02, 0x20,
+    0xd8, 0xfb, 0x0c, 0x8e, 0x83, 0xb3, 0xbc, 0x16, 0x37, 0x69, 0x92, 0x05, 0xa5, 0x70, 0x2a, 0x57,
+    0x06, 0x30, 0x2b, 0xb5, 0xfd, 0xb3, 0xaf, 0x70, 0xe9, 0x77, 0x6a, 0xf1, 0xaf, 0x93, 0x3e, 0x02
+};
+const uint16_t arm_uc_default_certificate_size = sizeof(arm_uc_default_certificate);
+#endif
+
+
+#ifdef MBED_CLOUD_DEV_UPDATE_PSK
+const uint8_t arm_uc_default_psk[] = {
+
+};
+const uint8_t arm_uc_default_psk_size = sizeof(arm_uc_default_psk);
+const uint16_t arm_uc_default_psk_bits = sizeof(arm_uc_default_psk)*8;
+
+const uint8_t arm_uc_default_psk_id[] = {
+
+};
+const uint8_t arm_uc_default_psk_id_size = sizeof(arm_uc_default_psk_id);
+#endif