CoAP example application for mbed OS 5

This application demonstrates how to connect to a CoAP server from mbed OS 5. It connects to coap://coap.me, sends a message to /hello and receives the response.

To build

  1. Open mbed_app.json and change the network-interface option to your connectivity method (more info).
  2. Build the project in the online compiler or using mbed CLI.
  3. Flash the project to your development board.
  4. Attach a serial monitor to your board to see the debug messages (baud rate 115,200).
Committer:
Jan Jongboom
Date:
Wed Feb 15 21:18:58 2017 +0100
Revision:
0:0681e205d0e9
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jan Jongboom 0:0681e205d0e9 1 {
Jan Jongboom 0:0681e205d0e9 2 "config": {
Jan Jongboom 0:0681e205d0e9 3 "network-interface":{
Jan Jongboom 0:0681e205d0e9 4 "help": "options are ETHERNET, WIFI_ESP8266, WIFI_ODIN, MESH_LOWPAN_ND, MESH_THREAD",
Jan Jongboom 0:0681e205d0e9 5 "value": "ETHERNET"
Jan Jongboom 0:0681e205d0e9 6 },
Jan Jongboom 0:0681e205d0e9 7 "mesh_radio_type": {
Jan Jongboom 0:0681e205d0e9 8 "help": "options are ATMEL, MCR20",
Jan Jongboom 0:0681e205d0e9 9 "value": "ATMEL"
Jan Jongboom 0:0681e205d0e9 10 },
Jan Jongboom 0:0681e205d0e9 11 "esp8266-tx": {
Jan Jongboom 0:0681e205d0e9 12 "help": "Pin used as TX (connects to ESP8266 RX)",
Jan Jongboom 0:0681e205d0e9 13 "value": "D1"
Jan Jongboom 0:0681e205d0e9 14 },
Jan Jongboom 0:0681e205d0e9 15 "esp8266-rx": {
Jan Jongboom 0:0681e205d0e9 16 "help": "Pin used as RX (connects to ESP8266 TX)",
Jan Jongboom 0:0681e205d0e9 17 "value": "D0"
Jan Jongboom 0:0681e205d0e9 18 },
Jan Jongboom 0:0681e205d0e9 19 "esp8266-debug": {
Jan Jongboom 0:0681e205d0e9 20 "value": true
Jan Jongboom 0:0681e205d0e9 21 },
Jan Jongboom 0:0681e205d0e9 22 "wifi-ssid": {
Jan Jongboom 0:0681e205d0e9 23 "value": "\"SSID\""
Jan Jongboom 0:0681e205d0e9 24 },
Jan Jongboom 0:0681e205d0e9 25 "wifi-password": {
Jan Jongboom 0:0681e205d0e9 26 "value": "\"Password\""
Jan Jongboom 0:0681e205d0e9 27 },
Jan Jongboom 0:0681e205d0e9 28 "button": {
Jan Jongboom 0:0681e205d0e9 29 "help": "Pin which you'll use as button (can be overriden per target below)",
Jan Jongboom 0:0681e205d0e9 30 "value": "BUTTON1"
Jan Jongboom 0:0681e205d0e9 31 },
Jan Jongboom 0:0681e205d0e9 32 "builtin_led_on": {
Jan Jongboom 0:0681e205d0e9 33 "help": "Value to write to built-in LEDs to turn them on",
Jan Jongboom 0:0681e205d0e9 34 "value": 1,
Jan Jongboom 0:0681e205d0e9 35 "macro_name": "BUILTIN_LED_ON"
Jan Jongboom 0:0681e205d0e9 36 },
Jan Jongboom 0:0681e205d0e9 37 "builtin_led_off": {
Jan Jongboom 0:0681e205d0e9 38 "help": "Value to write to built-in LEDs to turn them off",
Jan Jongboom 0:0681e205d0e9 39 "value": 0,
Jan Jongboom 0:0681e205d0e9 40 "macro_name": "BUILTIN_LED_OFF"
Jan Jongboom 0:0681e205d0e9 41 }
Jan Jongboom 0:0681e205d0e9 42 },
Jan Jongboom 0:0681e205d0e9 43 "target_overrides": {
Jan Jongboom 0:0681e205d0e9 44 "*": {
Jan Jongboom 0:0681e205d0e9 45 "target.features_add": ["NANOSTACK", "LOWPAN_ROUTER", "COMMON_PAL"],
Jan Jongboom 0:0681e205d0e9 46 "platform.stdio-baud-rate": 115200,
Jan Jongboom 0:0681e205d0e9 47 "platform.stdio-convert-newlines": true,
Jan Jongboom 0:0681e205d0e9 48 "mbed-mesh-api.6lowpan-nd-channel-page": 0,
Jan Jongboom 0:0681e205d0e9 49 "mbed-mesh-api.6lowpan-nd-channel": 12,
Jan Jongboom 0:0681e205d0e9 50 "mbed-trace.enable": 0
Jan Jongboom 0:0681e205d0e9 51 },
Jan Jongboom 0:0681e205d0e9 52 "K64F": {
Jan Jongboom 0:0681e205d0e9 53 "button": "SW2",
Jan Jongboom 0:0681e205d0e9 54 "builtin_led_on": 0,
Jan Jongboom 0:0681e205d0e9 55 "builtin_led_off": 1
Jan Jongboom 0:0681e205d0e9 56 },
Jan Jongboom 0:0681e205d0e9 57 "HEXIWEAR": {
Jan Jongboom 0:0681e205d0e9 58 "button": "PTA12",
Jan Jongboom 0:0681e205d0e9 59 "esp8266-tx": "PTD3",
Jan Jongboom 0:0681e205d0e9 60 "esp8266-rx": "PTD2"
Jan Jongboom 0:0681e205d0e9 61 },
Jan Jongboom 0:0681e205d0e9 62 "NUCLEO_F401RE": {
Jan Jongboom 0:0681e205d0e9 63 "button": "USER_BUTTON",
Jan Jongboom 0:0681e205d0e9 64 "esp8266-tx": "D8",
Jan Jongboom 0:0681e205d0e9 65 "esp8266-rx": "D2"
Jan Jongboom 0:0681e205d0e9 66 },
Jan Jongboom 0:0681e205d0e9 67 "NUCLEO_F411RE": {
Jan Jongboom 0:0681e205d0e9 68 "button": "USER_BUTTON",
Jan Jongboom 0:0681e205d0e9 69 "esp8266-tx": "D8",
Jan Jongboom 0:0681e205d0e9 70 "esp8266-rx": "D2"
Jan Jongboom 0:0681e205d0e9 71 },
Jan Jongboom 0:0681e205d0e9 72 "NUMAKER_PFM_NUC472": {
Jan Jongboom 0:0681e205d0e9 73 "button": "SW1",
Jan Jongboom 0:0681e205d0e9 74 "builtin_led_on": 0,
Jan Jongboom 0:0681e205d0e9 75 "builtin_led_off": 1
Jan Jongboom 0:0681e205d0e9 76 }
Jan Jongboom 0:0681e205d0e9 77 }
Jan Jongboom 0:0681e205d0e9 78 }