|
1 | 1 | # Adafruit IO Arduino Library
|
2 | 2 |
|
3 |
| -This library provides a simple device independent interface for interacting with [Adafruit IO](https://io.adafruit.com) using Arduino. |
4 |
| -It allows you to switch beween WiFi (ESP8266, M0 WINC1500, & WICED), Cellular (32u4 FONA), and Ethernet (Ethernet FeatherWing) |
5 |
| -with only a two line change in your sketch. |
| 3 | +[](https://adafruit-io-arduino.readthedocs.io/en/latest/) [](https://travis-ci.org/adafruit/Adafruit_IO_Arduino) [](https://discord.gg/nBQh6qu) |
6 | 4 |
|
7 |
| -## Dependencies |
8 | 5 |
|
9 |
| -This library requires the latest version of the [Arduino IDE](https://www.arduino.cc/en/Main/Software) (tested with v1.6.10). |
| 6 | +This library provides a simple device independent interface for interacting with [Adafruit IO](https://io.adafruit.com) using Arduino. It allows you to switch between WiFi (ESP8266, M0 WINC1500, & WICED), Cellular (32u4 FONA), and Ethernet (Ethernet FeatherWing) |
10 | 7 |
|
11 |
| -### Adafruit Feather HUZZAH ESP8266 & Adafruit HUZZAH ESP8266 Breakout |
12 | 8 |
|
13 |
| -* Latest version of the [ESP8266 Arduino Core](https://github.com/esp8266/Arduino#installing-with-boards-manager) |
14 |
| -* Latest version of the [Adafruit MQTT Library](https://github.com/adafruit/Adafruit_MQTT_Library) |
15 |
| -* Latest version of the [Arduino HTTP Client Library](https://github.com/arduino-libraries/ArduinoHttpClient) |
16 |
| - |
17 |
| -### Adafruit Feather HUZZAH32 (ESP32) |
18 |
| - |
19 |
| -* Latest version of the [ESP32 Arduino Core](https://github.com/espressif/arduino-esp32#using-through-arduino-ide) |
20 |
| -* Latest version of the [Adafruit MQTT Library](https://github.com/adafruit/Adafruit_MQTT_Library) |
21 |
| -* Latest version of the [Arduino HTTP Client Library](https://github.com/arduino-libraries/ArduinoHttpClient) |
22 |
| - |
23 |
| -### Adafruit Feather M0 WiFi with ATWINC1500 |
24 |
| - |
25 |
| -* Latest version of the [Arduino SAMD Arduino Core](https://github.com/arduino/ArduinoCore-samd) |
26 |
| -* Latest version of the [Adafruit SAMD Arduino Core](https://github.com/adafruit/ArduinoCore-samd) |
27 |
| -* Latest version of the [Adafruit MQTT Library](https://github.com/adafruit/Adafruit_MQTT_Library) |
28 |
| -* Latest version of the [WiFi101 Library](https://github.com/arduino-libraries/WiFi101) |
29 |
| -* Latest version of the [Arduino HTTP Client Library](https://github.com/arduino-libraries/ArduinoHttpClient) |
30 |
| - |
31 |
| -You will also need to add the SSL certificate for `io.adafruit.com` using the [guide on the Adafruit Learning System.](https://learn.adafruit.com/adafruit-feather-m0-wifi-atwinc1500/updating-ssl-certificates) |
32 |
| - |
33 |
| -### Arduino MKR1000 |
34 |
| - |
35 |
| -* Latest version of the [Arduino SAMD Arduino Core](https://github.com/arduino/ArduinoCore-samd) |
36 |
| -* Latest version of the [Adafruit MQTT Library](https://github.com/adafruit/Adafruit_MQTT_Library) |
37 |
| -* Latest version of the [WiFi101 Library](https://github.com/arduino-libraries/WiFi101) |
38 |
| -* Latest version of the [Arduino HTTP Client Library](https://github.com/arduino-libraries/ArduinoHttpClient) |
39 |
| - |
40 |
| -You will also need to add the SSL certificate for `io.adafruit.com` using the MKR1000 SSL utility. |
41 |
| - |
42 |
| -### Adafruit WICED Feather WiFi |
43 |
| - |
44 |
| -* Latest version of the [Adafruit WICED Arduino Core](https://github.com/adafruit/Adafruit_WICED_Arduino) |
45 |
| -* Latest version of the [Adafruit MQTT Library](https://github.com/adafruit/Adafruit_MQTT_Library) |
46 |
| -* Latest version of the [Arduino HTTP Client Library](https://github.com/arduino-libraries/ArduinoHttpClient) |
47 |
| - |
48 |
| -### Adafruit Feather 32u4 FONA |
49 |
| - |
50 |
| -* Latest version of the [Adafruit AVR Arduino Core](https://github.com/adafruit/Adafruit_Arduino_Boards) |
51 |
| -* Latest version of the [Adafruit MQTT Library](https://github.com/adafruit/Adafruit_MQTT_Library) |
52 |
| -* Latest version of the [Adafruit FONA Library](https://github.com/adafruit/Adafruit_FONA) |
53 |
| - |
54 |
| -### Adafruit Ethernet FeatherWing |
55 |
| - |
56 |
| -The Ethernet FeatherWing will also require a 32u4, M0, or ESP8266 based Feather. Any Arduino cores |
57 |
| -required by the host Feather board will also be required. |
58 |
| - |
59 |
| -* Latest version of the [Adafruit Ethernet2 Library](https://github.com/adafruit/Ethernet2) |
60 |
| -* Latest version of the [Adafruit MQTT Library](https://github.com/adafruit/Adafruit_MQTT_Library) |
61 |
| -* Latest version of the [Arduino HTTP Client Library](https://github.com/arduino-libraries/ArduinoHttpClient) |
62 |
| - |
63 |
| -## Usage |
64 |
| - |
65 |
| -The included examples sketches will walk you through all of the features of the library. |
66 |
| -They can be used on all platforms, but they default to WiFi. To change between platforms, |
67 |
| -you will need to change two lines of code in the `config.h` tab of the example. |
68 |
| -It is recommended that you start with one of the Adafruit WiFi feathers before |
69 |
| -moving on to cellular or ethernet. |
70 |
| - |
71 |
| -For all examples, you will need to set `IO_USERNAME` and `IO_KEY` in the `config.h` tab. |
72 |
| - |
73 |
| -The following sections demonstrate how to switch between WiFi, cellular, and ethernet. |
74 |
| - |
75 |
| -### WiFi (ESP8266, M0 WINC1500, WICED) |
76 |
| - |
77 |
| -If you are using the included examples, you do not need to change anything for the Adafruit WiFi Feathers. |
78 |
| -All WiFi based Feathers (ESP8266, M0 WiFi, WICED) will work with the examples out of the box. |
79 |
| - |
80 |
| -You will need to add your WiFi information to the `WIFI_SSID` and `WIFI_PASS` defines in the `config.h` tab. |
81 |
| - |
82 |
| -### Cellular (32u4 FONA) |
83 |
| - |
84 |
| -For FONA, you will only need to change from the default WiFi constructor to the FONA specific constructor in the `config.h` tab. |
85 |
| -The rest of the sketch remains the same. |
86 |
| - |
87 |
| -You will need to comment out these WiFi lines in `config.h`: |
88 |
| - |
89 |
| -```ino |
90 |
| -#include "AdafruitIO_WiFi.h" |
91 |
| -AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS); |
92 |
| -``` |
93 |
| -and uncomment the FONA lines in `config.h`: |
94 |
| -
|
95 |
| -```ino |
96 |
| -#include "AdafruitIO_FONA.h" |
97 |
| -AdafruitIO_FONA io(IO_USERNAME, IO_KEY); |
98 |
| -``` |
99 |
| - |
100 |
| -If your carrier requires APN info, you can set it by adding a call to `io.setAPN()` after `io.connect()` in the `setup()` function of the sketch. |
101 |
| - |
102 |
| -```ino |
103 |
| -void setup() { |
104 |
| - |
105 |
| - // start the serial connection |
106 |
| - Serial.begin(115200); |
107 |
| - |
108 |
| - // connect to io.adafruit.com |
109 |
| - io.connect(); |
110 |
| - |
111 |
| - io.setAPN(F("your_apn"), F("your_apn_user"), F("your_apn_pass")); |
112 |
| - |
113 |
| -} |
114 |
| -``` |
115 |
| - |
116 |
| -### Ethernet (Ethernet FeatherWing) |
117 |
| - |
118 |
| -For Ethernet, you will only need to change from the default WiFi constructor to the Ethernet specific constructor in the `config.h` tab. |
119 |
| -The rest of the sketch remains the same. |
120 |
| - |
121 |
| -You will need to comment out these WiFi lines in `config.h`: |
122 |
| - |
123 |
| -```ino |
124 |
| -#include "AdafruitIO_WiFi.h" |
125 |
| -AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS); |
126 |
| -``` |
127 |
| -
|
128 |
| -and uncomment the Ethernet lines in `config.h`: |
129 |
| -
|
130 |
| -```ino |
131 |
| -#include "AdafruitIO_Ethernet.h" |
132 |
| -AdafruitIO_Ethernet io(IO_USERNAME, IO_KEY); |
133 |
| -``` |
134 |
| - |
135 |
| -## Compatibility |
136 |
| - |
137 |
| -Last test with `v2.0.0` on 08/10/2016. |
138 |
| - |
139 |
| -Example | ESP8266 | M0 WINC1500 | WICED | FONA 32u4 | Ethernet* | MKR1000 | |
140 |
| ------------------- | :----------: | :----------: | :---------: | :---------: | :--------: | :--------: | |
141 |
| -00_publish | ✓ | ✓ | ✓ | ✓ | ✓ | ? | |
142 |
| -01_subscribe | ✓ | ✓ | ✓ | ✓ | ✓ | ? | |
143 |
| -02_pubsub | ✓ | ✓ | ✓ | ✓ | ✓ | ? | |
144 |
| -03_multiple_feeds | ✓ | ✓ | ✓ | ✓ | ✓ | ? | |
145 |
| -04_location | ✓ | ✓ | ✓ | ✓ | ✓ | ? | |
146 |
| -05_type_conversion | ✓ | ✓ | ✓ | ✓ | ✓ | ? | |
147 |
| -06_digital_in | ✓ | ✓ | ✓ | ✓ | ? | ? | |
148 |
| - |
149 |
| -*Ethernet FeatherWing tested with Feather M0 Basic Proto |
| 9 | +## Documentation |
| 10 | +Documentation including installation, configuration and usage for this library is found on [the Adafruit IO Arduino ReadTheDocs pages](https://adafruit-io-arduino.readthedocs.io/en/latest/). |
150 | 11 |
|
151 | 12 | ## License
|
152 |
| -Copyright (c) 2016 [Adafruit Industries](https://adafruit.com). Licensed under the [MIT license](/LICENSE?raw=true). |
| 13 | +Copyright (c) 2018 [Adafruit Industries](https://adafruit.com). Licensed under the [MIT license](/LICENSE?raw=true). |
153 | 14 |
|
154 | 15 | [Adafruit](https://adafruit.com) invests time and resources providing this open source code.
|
155 | 16 | Please support Adafruit and open-source hardware by purchasing products from [Adafruit](https://adafruit.com).
|
0 commit comments