Example program for simple-mbed-client, connecting a device to mbed Device Connector.
Dependencies: simple-mbed-client
Fork of simple-mbed-client-example by
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.
Diff: mbed_app.json
- Revision:
- 34:1e8d914a2876
- Parent:
- 30:36236b00a869
- Child:
- 36:52249470d973
--- a/mbed_app.json Wed Sep 28 12:39:13 2016 +0300 +++ b/mbed_app.json Fri Dec 02 15:44:32 2016 +0800 @@ -4,6 +4,10 @@ "help": "options are ETHERNET,WIFI_ESP8266,MESH_LOWPAN_ND,MESH_THREAD", "value": "ETHERNET" }, + "mesh_radio_type": { + "help": "options are ATMEL, MCR20", + "value": "ATMEL" + }, "esp8266-tx": { "help": "Pin used as TX (connects to ESP8266 RX)", "value": "D1" @@ -24,14 +28,30 @@ "button": { "help": "Pin which you'll use as button (can be overriden per target below)", "value": "BUTTON1" + }, + "builtin_led_on": { + "help": "Value to write to built-in LEDs to turn them on", + "value": 1, + "macro_name": "BUILTIN_LED_ON" + }, + "builtin_led_off": { + "help": "Value to write to built-in LEDs to turn them off", + "value": 0, + "macro_name": "BUILTIN_LED_OFF" } }, + "macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\""], "target_overrides": { "*": { - "target.features_add": ["IPV4", "IPV6"] + "target.features_add": ["NANOSTACK", "LOWPAN_ROUTER", "COMMON_PAL"], + "mbed-mesh-api.6lowpan-nd-channel-page": 0, + "mbed-mesh-api.6lowpan-nd-channel": 12, + "mbed-trace.enable": 0 }, "K64F": { - "button": "SW2" + "button": "SW2", + "builtin_led_on": 0, + "builtin_led_off": 1 }, "HEXIWEAR": { "button": "PTA12", @@ -42,6 +62,14 @@ "button": "USER_BUTTON", "esp8266-tx": "D8", "esp8266-rx": "D2" + }, + "NUCLEO_F411RE": { + "button": "USER_BUTTON", + "esp8266-tx": "D8", + "esp8266-rx": "D2" + }, + "NUMAKER_PFM_NUC472": { + "button": "SW1" } } }