【 IoTを試そう [ODIN-W2(WiFi) + 温度計 + milkcocoa ] 】 ODIN-W2 にmbed ApplicationShiled をつないで、 https://developer.mbed.org/components/mbed-Application-Shield/ 温度のデータをMilkcocoaにアップするプログラムです。

Dependencies:   LM75B Milkcocoa-os

Fork of mbed-os-example-mbed5-wifi by mbed-os-examples

Committer:
Okoshi
Date:
Tue Apr 18 07:22:04 2017 +0000
Revision:
17:79fa29aa6724
Parent:
10:5b5beb106156
? IoT???? [ODIN-W2(WiFi) + ??? + milkcocoa ] ?; ODIN-W2 ?mbed ApplicationShiled ??????; ???????Milkcocoa??????????????;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Okoshi 17:79fa29aa6724 1 # mbed-os-example-wifi with Milkcocoa #
mbed_official 0:857719181846 2
mbed_official 0:857719181846 3 WiFi example for mbed OS
mbed_official 0:857719181846 4
mbed_official 0:857719181846 5 ## Getting started with the WiFi API ##
mbed_official 0:857719181846 6
mbed_official 0:857719181846 7 This is a quick example of a simple WiFi application using the WiFi and network-socket APIs that is provided as a part of [mbed-os](github.com/armmbed/mbed-os).
mbed_official 0:857719181846 8
mbed_official 0:857719181846 9 The program brings up the WiFi and the underlying network interface, and uses it to scans available networks, connects to a network, prints interface and connection details and performs simple HTTP operation.
mbed_official 0:857719181846 10
mbed_official 0:857719181846 11 ### Supported hardware ###
mbed_official 0:857719181846 12
mbed_official 10:5b5beb106156 13 * [UBLOX Odin board](https://developer.mbed.org/platforms/ublox-EVK-ODIN-W2/) (`UBLOX_EVK_ODIN_W2` target when using mbed CLI) with ESP8266-01 module using pins D1 D0
mbed_official 10:5b5beb106156 14 * [NUCLEO_F429ZI](https://developer.mbed.org/platforms/ST-Nucleo-F429ZI/) with ESP8266-01 module using pins D1 D0
mbed_official 10:5b5beb106156 15 * [NUCLEO_L476RG](https://developer.mbed.org/platforms/ST-Nucleo-L476RG/) with ESP8266-01 module using pins D8 D2
mbed_official 0:857719181846 16 * Other mbed target with ESP2866 module (Board it's connected to shouldn't have other network interface eg. Ethernet)
mbed_official 0:857719181846 17
mbed_official 0:857719181846 18 ESP2866 is a fallback option and will be used if the build is for unsupported platform.
mbed_official 0:857719181846 19
Okoshi 17:79fa29aa6724 20 with
Okoshi 17:79fa29aa6724 21 * [mbed Application Shield](https://developer.mbed.org/components/mbed-Application-Shield/)
Okoshi 17:79fa29aa6724 22
mbed_official 6:9944c5308062 23 #### Connecting the ESP2866 ####
mbed_official 6:9944c5308062 24
mbed_official 6:9944c5308062 25 ESP module needs to be connected to RX and TX UART pins (+ power and ground) on your target board. That can be achieved using Grove shield or connected directly using jumper wires, please note that not all Arduino form factor boards have UART compatible with the Grove shiled.
mbed_official 6:9944c5308062 26
mbed_official 6:9944c5308062 27 For Grove shield TX has to be connected to D1 and RX to D0.
mbed_official 6:9944c5308062 28
mbed_official 6:9944c5308062 29 Make sure that UART module you're connecting ESP to is different than the debug UART connected to your USB port.
mbed_official 6:9944c5308062 30
mbed_official 0:857719181846 31 ## Getting started
mbed_official 0:857719181846 32
mbed_official 0:857719181846 33 1. Import the example
mbed_official 0:857719181846 34
mbed_official 0:857719181846 35 ```
mbed_official 0:857719181846 36 mbed import mbed-os-example-wifi
mbed_official 0:857719181846 37 cd mbed-os-example-wifi
mbed_official 0:857719181846 38 ```
mbed_official 0:857719181846 39 2. Configure the WiFi credentials
mbed_official 0:857719181846 40
mbed_official 0:857719181846 41 Edit ```mbed_app.json``` to include correct SSID and Password:
Okoshi 17:79fa29aa6724 42 and MilkCocoa item.
mbed_official 0:857719181846 43
mbed_official 0:857719181846 44 ```
Okoshi 17:79fa29aa6724 45 "milkcocoa_app_id": {
Okoshi 17:79fa29aa6724 46 "help": "MilkCocoa Application ID",
Okoshi 17:79fa29aa6724 47 "value": "\"xxxxxxxxxxxx\"",
Okoshi 17:79fa29aa6724 48 "macro_name": "CONFIG_MILKCOCOA_APP_ID"
Okoshi 17:79fa29aa6724 49 },
Okoshi 17:79fa29aa6724 50 "milkcocoa_datastore": {
Okoshi 17:79fa29aa6724 51 "help": "Milkcocoa Datastore",
Okoshi 17:79fa29aa6724 52 "value": "\"xxxxxxxxx\"",
Okoshi 17:79fa29aa6724 53 "macro_name": "CONFIG_MILKCOCOA_DATASTORE"
Okoshi 17:79fa29aa6724 54 },
Okoshi 17:79fa29aa6724 55 "serial_console_speed": {
Okoshi 17:79fa29aa6724 56 "help": "Baud rate of the serial console",
Okoshi 17:79fa29aa6724 57 "value": 115200,
Okoshi 17:79fa29aa6724 58 "macro_name": "MBED_SERIAL_UART_SPEED"
Okoshi 17:79fa29aa6724 59 },
Okoshi 17:79fa29aa6724 60 "wifi-ssid": {
Okoshi 17:79fa29aa6724 61 "help": "WiFi SSID",
Okoshi 17:79fa29aa6724 62 "value": "\"xxxxxxxxxxxxx\""
Okoshi 17:79fa29aa6724 63 },
Okoshi 17:79fa29aa6724 64 "wifi-password": {
Okoshi 17:79fa29aa6724 65 "help": "WiFi Password",
Okoshi 17:79fa29aa6724 66 "value": "\"xxxxxxxxxxx\""
Okoshi 17:79fa29aa6724 67 },
mbed_official 0:857719181846 68 ```
mbed_official 0:857719181846 69
mbed_official 0:857719181846 70 3. Compile and generate binary
mbed_official 0:857719181846 71
mbed_official 0:857719181846 72 For example, for `GCC`:
mbed_official 0:857719181846 73
mbed_official 0:857719181846 74 ```
mbed_official 0:857719181846 75 mbed compile -t GCC_ARM -m UBLOX_EVK_ODIN_W2
mbed_official 0:857719181846 76 ```
mbed_official 0:857719181846 77
mbed_official 0:857719181846 78 ## Documentation ##
mbed_official 0:857719181846 79
mbed_official 0:857719181846 80 More information on the network-socket API can be found in the [mbed handbook](https://docs.mbed.com/docs/mbed-os-api-reference/en/5.2/APIs/communication/network_sockets/).