Example program for simple-mbed-client, connecting a device to mbed Device Connector.

Dependencies:   simple-mbed-client

Fork of simple-mbed-client-example by Jan Jongboom

This is an example on how to connect to mbed Device Connector using simple-mbed-client. It can connect over Ethernet, WiFi (using an ESP8266 module or an ODIN board), Thread and 6LoWPAN.

After cloning this repository update `mbed_app.json` to reflect your connectivity method. For docs on configuring connectivity, see easy-connect.

End to end example

For an end-to-end example of using Simple mbed Client to connect devices to mbed Device Connector see Building an internet connected lighting system.

Entropy (or lack thereof)

On all platforms except the K64F and K22F the library is compiled without TLS entropy sources. This means that your code is inherently unsafe and should not be deployed to any production systems. To enable entropy, remove the MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES and MBEDTLS_TEST_NULL_ENTROPY macros from mbed_app.json.

Files at this revision

API Documentation at this revision

Comitter:
Jan Jongboom
Date:
Tue Sep 06 13:38:46 2016 +0200
Parent:
28:f5e41738699d
Child:
30:36236b00a869
Commit message:
Override button in config, update mbed-os to latest master, update easy-connect

Changed in this revision

easy-connect.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
mbed_app.json Show annotated file Show diff for this revision Revisions of this file
--- a/easy-connect.lib	Thu Aug 25 14:39:39 2016 +0200
+++ b/easy-connect.lib	Tue Sep 06 13:38:46 2016 +0200
@@ -1,1 +1,1 @@
-https://github.com/armmbed/easy-connect/#5a733bd2750342660d9021bfc9b3583ca8c62668
+https://github.com/armmbed/easy-connect/#0e924fc9504c5fc4425adf30f7ad85a9fe0bf4fd
--- a/main.cpp	Thu Aug 25 14:39:39 2016 +0200
+++ b/main.cpp	Tue Sep 06 13:38:46 2016 +0200
@@ -8,7 +8,7 @@
 
 DigitalOut led(LED1);
 DigitalOut blinkLed(LED2);
-InterruptIn btn(SW2);
+InterruptIn btn(MBED_CONF_APP_BUTTON);
 Semaphore updates(0);
 
 void patternUpdated(string v) {
--- a/mbed-os.lib	Thu Aug 25 14:39:39 2016 +0200
+++ b/mbed-os.lib	Tue Sep 06 13:38:46 2016 +0200
@@ -1,1 +1,1 @@
-https://github.com/ARMmbed/mbed-os/#d2202045ac8f2fc63836a5b7131c9b56ac58f06a
+https://github.com/ARMmbed/mbed-os/#5dcd546fd58644cb35ce28ccc87c634349fd2c5a
--- a/mbed_app.json	Thu Aug 25 14:39:39 2016 +0200
+++ b/mbed_app.json	Tue Sep 06 13:38:46 2016 +0200
@@ -20,11 +20,24 @@
         },
         "esp8266-debug": {
             "value": true
+        },
+        "button": {
+            "help": "Pin which you'll use as button (can be overriden per target below)",
+            "value": "BUTTON1"
         }
     },
     "target_overrides": {
         "*": {
             "target.features_add": ["IPV4", "IPV6"]
+        },
+        "K64F": {
+            "button": "SW2"
+        },
+        "HEXIWEAR": {
+            "button": "PTA12"
+        },
+        "NUCLEO_F401RE": {
+            "button": "USER_BUTTON"
         }
     }
 }