23
23
*/
24
24
#define ARDUINO_WIFI_SHIELD
25
25
26
- //do not modify these next 4 lines
26
+ //do not modify these next 5 lines
27
27
#ifdef ARDUINO_WIFI_SHIELD
28
+ #include <WiFi.h>
28
29
#include "utility/WiFiStream.h"
29
30
WiFiStream stream ;
30
31
#endif
@@ -44,46 +45,57 @@ WiFiStream stream;
44
45
*/
45
46
//#define WIFI_101
46
47
47
- //do not modify these next 4 lines
48
+ //do not modify these next 5 lines
48
49
#ifdef WIFI_101
50
+ #include <WiFi101.h>
49
51
#include "utility/WiFi101Stream.h"
50
- WiFi101Stream stream ;
52
+ WiFiStream stream ;
51
53
#endif
52
54
53
55
/*
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.
55
63
*
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'
57
66
*/
67
+ //#define ESP8266_WIFI
58
68
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
63
75
64
76
/*
65
- * OPTION D: Configure for ESP6288
77
+ * OPTION D: Configure for HUZZAH
66
78
*
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.
69
81
*/
70
82
71
- //#define ESP_WIFI
83
+ //------------------------------
84
+ // TODO
85
+ //------------------------------
86
+ //#define HUZZAH_WIFI
72
87
73
- //do not modify these next 4 lines
74
- #ifdef ESP_WIFI
75
- #include "utility/ESPWiFiStream.h"
76
- WiFiStream stream ;
77
- #endif
78
88
79
89
// STEP 2 [REQUIRED for all boards and shields]
80
90
// replace this with your wireless network SSID
81
91
char ssid [] = "your_network_name" ;
82
92
83
93
// STEP 3 [OPTIONAL for all boards and shields]
84
94
// 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
87
99
88
100
// STEP 4 [REQUIRED for all boards and shields]
89
101
// 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";
107
119
char wpa_passphrase [] = "your_wpa_passphrase" ;
108
120
#endif //WIFI_WPA_SECURITY
109
121
122
+
110
123
/*
111
124
* OPTION B: WEP
112
125
*
@@ -140,11 +153,11 @@ char wep_key[] = "your_wep_key";
140
153
* CONFIGURATION ERROR CHECK (don't change anything here)
141
154
*============================================================================*/
142
155
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 )))
144
157
#error "you may not define more than one wifi device type in wifiConfig.h."
145
158
#endif //WIFI device type check
146
159
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 ))
148
161
#error "you must define a wifi device type in wifiConfig.h."
149
162
#endif
150
163
@@ -156,6 +169,10 @@ char wep_key[] = "your_wep_key";
156
169
#error "you must define a wifi security type in wifiConfig.h."
157
170
#endif //WIFI_* security define check
158
171
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
+
159
176
/*==============================================================================
160
177
* PIN IGNORE MACROS (don't change anything here)
161
178
*============================================================================*/
0 commit comments