Moin Zusammen,
Hardware: Arduino DUE
IDE: 1.5.6-r2
Arduino WiFi Shield
Folgendes Problem möchte mit dem WiFi Shield auf einen Server Connecten jedoch schlägt dies immer fehl.
Benutze den Example Code von: http://arduino.cc/de/Reference/WiFiClient
Funktioniert bis zur Stelle wo er verbinden sollte: client.connect(server, 80);
Versucht hab ich schon die Firmware vom WiFi Shield zu updaten. Sollte auch geklappt haben aber wenn ich mit
Serial.println(WiFi.firmwareVersion());
die Firmware Version anzeigen lasse ist diese nach wie vor auf 1.0.0. Die Files mit welchen ich geupdatet hatte waren von hier binarytaskforce.com : 404 Not Found
Kann das passen?Stimmt die Firmware?
Besten Dank für Eure Hilfe!
Hier noch mein Kompletter Code sowie der Output:
Output:
Attempting to connect to WPA network...
SSID: Android
Connected to wifi
Starting connection...
SSID: Android
IP Address: 10.0.22.165
GATEWAY: 10.0.22.10
NETMASK: 255.255.255.0
Firmware version: 1.0.0
signal strength (RSSI):-81 dBm
#include <SPI.h>
#include <WiFi.h>
char ssid[] = "Android"; // your network SSID (name)
int status = WL_IDLE_STATUS;
IPAddress server(74,125,115,105); // Google
// Initialize the client library
WiFiClient client;
void setup() {
Serial.begin(9600);
Serial.println("Attempting to connect to WPA network...");
Serial.print("SSID: ");
Serial.println(ssid);
status = WiFi.begin(ssid);
if ( status != WL_CONNECTED) {
Serial.println("Couldn't get a wifi connection");
// don't do anything else:
while(true);
}
else {
Serial.println("Connected to wifi");
Serial.println("\nStarting connection...");
// if you get a connection, report back via serial:
if (client.connect(server, 80)) {
Serial.println("connected");
// Make a HTTP request:
client.println("GET /search?q=arduino HTTP/1.0");
client.println();
}
}
}
void loop() {
printWifiStatus();
while(true);
}
void printWifiStatus() {
// print the SSID of the network you're attached to:
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
// print your WiFi shield's IP address:
IPAddress ip = WiFi.localIP();
Serial.print("IP Address: ");
Serial.println(ip);
// print your gateway address:
IPAddress gateway = WiFi.gatewayIP();
Serial.print("GATEWAY: ");
Serial.println(gateway);
// print your subnet mask:
IPAddress subnet = WiFi.subnetMask();
Serial.print("NETMASK: ");
Serial.println(subnet);
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println("WiFi shield not present");
// don't continue:
while(true);
}
// check firmware version
Serial.print(F("Firmware version: "));
Serial.println(WiFi.firmwareVersion());
// print the received signal strength:
long rssi = WiFi.RSSI();
Serial.print("signal strength (RSSI):");
Serial.print(rssi);
Serial.println(" dBm");
}