2323 */
2424#define ARDUINO_WIFI_SHIELD
2525
26- //do not modify these next 4 lines
26+ //do not modify these next 5 lines
2727#ifdef ARDUINO_WIFI_SHIELD
28+ #include <WiFi.h>
2829#include "utility/WiFiStream.h"
2930WiFiStream stream ;
3031#endif
@@ -44,46 +45,57 @@ WiFiStream stream;
4445 */
4546//#define WIFI_101
4647
47- //do not modify these next 4 lines
48+ //do not modify these next 5 lines
4849#ifdef WIFI_101
50+ #include <WiFi101.h>
4951#include "utility/WiFi101Stream.h"
50- WiFi101Stream stream ;
52+ WiFiStream stream ;
5153#endif
5254
5355/*
54- * OPTION C: Configure for HUZZAH
56+ * OPTION C: Configure for ESP8266
57+ *
58+ * This will configure StandardFirmataWiFi to use the ESP8266WiFi library for boards
59+ * with an ESP8266 chip. It is compatible with 802.11 B/G/N networks.
60+ *
61+ * To enable, uncomment the #define ESP8266_WIFI below and verify the #define values under
62+ * options A and B are commented out.
5563 *
56- * HUZZAH is not yet supported, this will be added in a later revision to StandardFirmataWiFi
64+ * IMPORTANT: You must have the esp8266 board support installed. To easily install this board, open the board manager via:
65+ * Arduino IDE Menus: Tools > Board > Manage Boards > filter search for "esp8266" > Select the result and click 'install'
5766 */
67+ //#define ESP8266_WIFI
5868
59- //------------------------------
60- // TODO
61- //------------------------------
62- //#define HUZZAH_WIFI
69+ //do not modify these next 5 lines
70+ #ifdef ESP8266_WIFI
71+ #include <ESP8266WiFi.h>
72+ #include "utility/WiFiStream.h"
73+ WiFiStream stream ;
74+ #endif
6375
6476/*
65- * OPTION D: Configure for ESP6288
77+ * OPTION D: Configure for HUZZAH
6678 *
67- * ESP6288 is supported through its Arduino Core at
68- * https://github.com/esp8266/Arduino/
79+ * HUZZAH with CC3000 is not yet supported, this will be added in a later revision to StandardFirmataWiFi.
80+ * For HUZZAH with ESP8266 use ESP8266_WIFI.
6981 */
7082
71- //#define ESP_WIFI
83+ //------------------------------
84+ // TODO
85+ //------------------------------
86+ //#define HUZZAH_WIFI
7287
73- //do not modify these next 4 lines
74- #ifdef ESP_WIFI
75- #include "utility/ESPWiFiStream.h"
76- WiFiStream stream ;
77- #endif
7888
7989// STEP 2 [REQUIRED for all boards and shields]
8090// replace this with your wireless network SSID
8191char ssid [] = "your_network_name" ;
8292
8393// STEP 3 [OPTIONAL for all boards and shields]
8494// if you want to use a static IP (v4) address, uncomment the line below. You can also change the IP.
85- // if this line is commented out, the WiFi shield will attempt to get an IP from the DHCP server
86- // #define STATIC_IP_ADDRESS 192,168,1,113
95+ // if the first line is commented out, the WiFi shield will attempt to get an IP from the DHCP server
96+ #define STATIC_IP_ADDRESS 192,168,1,113
97+ #define SUBNET_MASK 255,255,255,0 // REQUIRED for ESP8266_WIFI, ignored for others
98+ #define GATEWAY_IP_ADDRESS 0,0,0,0 // REQUIRED for ESP8266_WIFI, ignored for others
8799
88100// STEP 4 [REQUIRED for all boards and shields]
89101// define your port number here, you will need this to open a TCP connection to your Arduino
@@ -107,6 +119,7 @@ char ssid[] = "your_network_name";
107119char wpa_passphrase [] = "your_wpa_passphrase" ;
108120#endif //WIFI_WPA_SECURITY
109121
122+
110123/*
111124 * OPTION B: WEP
112125 *
@@ -140,11 +153,11 @@ char wep_key[] = "your_wep_key";
140153 * CONFIGURATION ERROR CHECK (don't change anything here)
141154 *============================================================================*/
142155
143- #if ((defined(ARDUINO_WIFI_SHIELD ) && (defined(WIFI_101 ) || defined(HUZZAH_WIFI ))) || (defined(WIFI_101 ) && defined(HUZZAH_WIFI )) || (defined(WIFI_101 ) && defined(ESP_WIFI )) || (defined(ESP_WIFI ) && defined(HUZZAH_WIFI )) || (defined(ESP_WIFI ) && defined(ARDUINO_WIFI_SHIELD )))
156+ #if ((defined(ARDUINO_WIFI_SHIELD ) && (defined(WIFI_101 ) || defined(HUZZAH_WIFI ))) || (defined(WIFI_101 ) && defined(HUZZAH_WIFI )) || (defined(WIFI_101 ) && defined(ESP8266_WIFI )) || (defined(ESP8266_WIFI ) && defined(HUZZAH_WIFI )) || (defined(ESP8266_WIFI ) && defined(ARDUINO_WIFI_SHIELD )))
144157#error "you may not define more than one wifi device type in wifiConfig.h."
145158#endif //WIFI device type check
146159
147- #if !(defined(ARDUINO_WIFI_SHIELD ) || defined(WIFI_101 ) || defined(HUZZAH_WIFI ) || defined(ESP_WIFI ))
160+ #if !(defined(ARDUINO_WIFI_SHIELD ) || defined(WIFI_101 ) || defined(HUZZAH_WIFI ) || defined(ESP8266_WIFI ))
148161#error "you must define a wifi device type in wifiConfig.h."
149162#endif
150163
@@ -156,6 +169,10 @@ char wep_key[] = "your_wep_key";
156169#error "you must define a wifi security type in wifiConfig.h."
157170#endif //WIFI_* security define check
158171
172+ #if (defined(ESP8266_WIFI ) && !(defined(WIFI_NO_SECURITY ) || (defined(WIFI_WPA_SECURITY ))))
173+ #error "you must choose between WIFI_NO_SECURITY and WIFI_WPA_SECURITY"
174+ #endif
175+
159176/*==============================================================================
160177 * PIN IGNORE MACROS (don't change anything here)
161178 *============================================================================*/
0 commit comments