-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V10 Library fails to compile #111
Comments
I am using Arduino ide 1.6.12 The library still does not compile if the sketch includes the <TimeLib.h> (time) library: The errors returned are
The sketch is from the new ping example #include <SPI.h>
#include <WiFi101.h>
#include <TimeLib.h>
char ssid[] = "DRP3"; // your network SSID (name)
int status = WL_IDLE_STATUS; // the Wifi radio's status
// Specify IP address or hostname
String hostName = "www.google.com";
int pingResult;
int loopcount = 0;
void setup() {
// Initialize serial and wait for port to open:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println("WiFi shield not present");
// don't continue:
while (true);
}
// attempt to connect to Wifi network:
while ( status != WL_CONNECTED) {
Serial.print("Attempting to connect to WPA SSID: ");
Serial.println(ssid);
// Connect to WPA/WPA2 network:
status = WiFi.begin(ssid);
// wait 5 seconds for connection:
delay(5000);
}
// you're connected now, so print out the data:
Serial.println("You're connected to the network");
printCurrentNet();
printWifiData();
}
void loop() {
loopcount++;
if(loopcount == 10) while(1);
Serial.print("Pinging ");
Serial.print(hostName);
Serial.print(": ");
pingResult = WiFi.ping(hostName);
if (pingResult >= 0) {
Serial.print("SUCCESS! RTT = ");
Serial.print(pingResult);
Serial.println(" ms");
} else {
Serial.print("FAILED! Error code: ");
Serial.println(pingResult);
}
delay(5000);
}
void printWifiData() {
// print your WiFi shield's IP address:
IPAddress ip = WiFi.localIP();
Serial.print("IP address : ");
Serial.println(ip);
Serial.print("Subnet mask: ");
Serial.println((IPAddress)WiFi.subnetMask());
Serial.print("Gateway IP : ");
Serial.println((IPAddress)WiFi.gatewayIP());
// print your MAC address:
byte mac[6];
WiFi.macAddress(mac);
Serial.print("MAC address: ");
Serial.print(mac[5], HEX);
Serial.print(":");
Serial.print(mac[4], HEX);
Serial.print(":");
Serial.print(mac[3], HEX);
Serial.print(":");
Serial.print(mac[2], HEX);
Serial.print(":");
Serial.print(mac[1], HEX);
Serial.print(":");
Serial.println(mac[0], HEX);
Serial.println();
}
void printCurrentNet() {
// print the SSID of the network you're attached to:
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
// print the MAC address of the router you're attached to:
byte bssid[6];
WiFi.BSSID(bssid);
Serial.print("BSSID: ");
Serial.print(bssid[5], HEX);
Serial.print(":");
Serial.print(bssid[4], HEX);
Serial.print(":");
Serial.print(bssid[3], HEX);
Serial.print(":");
Serial.print(bssid[2], HEX);
Serial.print(":");
Serial.print(bssid[1], HEX);
Serial.print(":");
Serial.println(bssid[0], HEX);
// print the received signal strength:
long rssi = WiFi.RSSI();
Serial.print("signal strength (RSSI): ");
Serial.println(rssi);
// print the encryption type:
byte encryption = WiFi.encryptionType();
Serial.print("Encryption Type: ");
Serial.println(encryption, HEX);
Serial.println();
} It may be worth adding to any ping documentation that a dmz might be required on the yifi101 lan ip, to get the ping to work. David |
This should not be needed, because the new AVR compiler includes Can you remove the Also, please share what |
Hi Sandeep, Re removing the time library: I believe I covered that in the post above ("toggling") David |
I had the same issue.... On Sat, Oct 29, 2016 at 2:06 AM, drp0 notifications@github.com wrote:
~~ _/) ~~~~ _/) ~~~~ _/) ~~~~ _/) ~~ Tom Lafleur |
Please note the playground section of the website is user editable, the content is not created by Arduino, but instead by the community. I was able to reproduce with Paul Stoffregen's Time library: https://github.com/PaulStoffregen/Time - I think it's the same one you are using. The problem is (at least on my Mac), that |
Hi Sandeep, David |
It's the one provided by the compiler
We don't really want to include The problem is because of the case insensitive file system in OS X and Windows XP, I've pushed a change to #113, to check if the system @drp0 @trlafleur please try out the latest change from PR #113. |
With github source
https://github.com/arduino-libraries/WiFi101/tree/9384c5b7b3c39d756877f728fbc346b38871ee77
I get the following compilation errors:
David
The text was updated successfully, but these errors were encountered: