2727/*
2828 README
2929
30+ StandardFirmataWiFi is a WiFi server application. You will need a Firmata client library with
31+ a network transport in order to establish a connection with StandardFirmataWiFi.
32+
3033 To use StandardFirmataWiFi you will need to have one of the following
3134 boards or shields:
3235
3841 Follow the instructions in the wifiConfig.h file (wifiConfig.h tab in Arduino IDE) to
3942 configure your particular hardware.
4043
44+ Dependencies:
45+ - WiFi Shield 101 requires version 0.7.0 or higher of the WiFi101 library (available in Arduino
46+ 1.6.8 or higher, or update the library via the Arduino Library Manager or clone from source:
47+ https://github.com/arduino-libraries/WiFi101)
48+
4149 In order to use the WiFi Shield 101 with Firmata you will need a board with at least
4250 35k of Flash memory. This means you cannot use the WiFi Shield 101 with an Arduino Uno
4351 or any other ATmega328p-based microcontroller or with an Arduino Leonardo or other
99107 *============================================================================*/
100108
101109#ifdef STATIC_IP_ADDRESS
102- IPAddress local_ip (STATIC_IP_ADDRESS);
110+ IPAddress local_ip (STATIC_IP_ADDRESS);
103111#endif
104112
105113int wifiConnectionAttemptCounter = 0 ;
@@ -782,7 +790,7 @@ void systemResetCallback()
782790
783791void printWifiStatus () {
784792#if defined(ARDUINO_WIFI_SHIELD) || defined(WIFI_101)
785- if ( WiFi.status () != WL_CONNECTED )
793+ if ( WiFi.status () != WL_CONNECTED )
786794 {
787795 DEBUG_PRINT ( " WiFi connection failed. Status value: " );
788796 DEBUG_PRINTLN ( WiFi.status () );
@@ -797,15 +805,15 @@ void printWifiStatus() {
797805 DEBUG_PRINTLN ( WiFi.SSID () );
798806#endif // defined(ARDUINO_WIFI_SHIELD) || defined(WIFI_101)
799807
800- // print your WiFi shield's IP address:
808+ // print your WiFi shield's IP address:
801809 DEBUG_PRINT ( " IP Address: " );
802810
803811#if defined(ARDUINO_WIFI_SHIELD) || defined(WIFI_101)
804812 IPAddress ip = WiFi.localIP ();
805813 DEBUG_PRINTLN ( ip );
806814#endif // defined(ARDUINO_WIFI_SHIELD) || defined(WIFI_101)
807815
808- // print the received signal strength:
816+ // print the received signal strength:
809817 DEBUG_PRINT ( " signal strength (RSSI): " );
810818
811819#if defined(ARDUINO_WIFI_SHIELD) || defined(WIFI_101)
@@ -823,7 +831,7 @@ void setup()
823831 * WIFI SETUP
824832 */
825833 DEBUG_BEGIN (9600 );
826-
834+
827835 /*
828836 * This statement will clarify how a connection is being made
829837 */
@@ -834,7 +842,7 @@ void setup()
834842 DEBUG_PRINTLN ( " using the legacy WiFi library." );
835843#elif defined(HUZZAH_WIFI)
836844 DEBUG_PRINTLN ( " using the HUZZAH WiFi library." );
837- // else should never happen here as error-checking in wifiConfig.h will catch this
845+ // else should never happen here as error-checking in wifiConfig.h will catch this
838846#endif // defined(WIFI_101)
839847
840848 /*
@@ -854,27 +862,28 @@ void setup()
854862 * Configure WiFi security
855863 */
856864#if defined(WIFI_WEP_SECURITY)
857- while (wifiStatus != WL_CONNECTED) {
858- DEBUG_PRINT (" Attempting to connect to WEP SSID: " );
865+ while (wifiStatus != WL_CONNECTED) {
866+ DEBUG_PRINT ( " Attempting to connect to WEP SSID: " );
859867 DEBUG_PRINTLN (ssid);
860868 wifiStatus = stream.begin ( ssid, wep_index, wep_key, SERVER_PORT );
861869 delay (5000 ); // TODO - determine minimum delay
862870 if (++wifiConnectionAttemptCounter > WIFI_MAX_CONN_ATTEMPTS) break ;
863871 }
864872
865873#elif defined(WIFI_WPA_SECURITY)
866- while (wifiStatus != WL_CONNECTED) {
867- DEBUG_PRINT (" Attempting to connect to WPA SSID: " );
874+ while (wifiStatus != WL_CONNECTED) {
875+ DEBUG_PRINT ( " Attempting to connect to WPA SSID: " );
868876 DEBUG_PRINTLN (ssid);
869877 wifiStatus = stream.begin (ssid, wpa_passphrase, SERVER_PORT);
870878 delay (5000 ); // TODO - determine minimum delay
871879 if (++wifiConnectionAttemptCounter > WIFI_MAX_CONN_ATTEMPTS) break ;
872880 }
873881
874882#else // OPEN network
875- DEBUG_PRINTLN ( " Connecting to an open network ..." );
876- while (wifiStatus != WL_CONNECTED) {
877- wifiStatus = stream.begin ( ssid, SERVER_PORT );
883+ while (wifiStatus != WL_CONNECTED) {
884+ DEBUG_PRINTLN ( " Attempting to connect to open SSID: " );
885+ DEBUG_PRINTLN (ssid);
886+ wifiStatus = stream.begin (ssid, SERVER_PORT);
878887 delay (5000 ); // TODO - determine minimum delay
879888 if (++wifiConnectionAttemptCounter > WIFI_MAX_CONN_ATTEMPTS) break ;
880889 }
@@ -909,7 +918,7 @@ void setup()
909918 || 24 == i // On Leonardo, pin 24 maps to D4 and pin 28 maps to D10
910919 || 28 == i
911920 #endif // defined(__AVR_ATmega32U4__)
912- ) {
921+ ) {
913922#elif defined (WIFI_101)
914923 if (IS_IGNORE_WIFI101_SHIELD (i)) {
915924#elif defined (HUZZAH_WIFI)
@@ -922,7 +931,7 @@ void setup()
922931 }
923932 }
924933
925- // Set up controls for the Arduino WiFi Shield SS for the SD Card
934+ // Set up controls for the Arduino WiFi Shield SS for the SD Card
926935#ifdef ARDUINO_WIFI_SHIELD
927936 // Arduino WiFi, Arduino WiFi Shield and Arduino Yun all have SD SS wired to D4
928937 pinMode (PIN_TO_DIGITAL (4 ), OUTPUT); // switch off SD card bypassing Firmata
0 commit comments