Impossible to use wifiClient
hi, here code
and there output :
i can't final "connected" output .... don't understand why arduino can't connect google (i try'd severals servers)
if know how fix !
thanks.
code: [select]
#include <spi.h>
#include <wifi.h>
#include <wificlient.h>
char ssid[] = "numericable-9b49";
char pass[] = "*******"; // network password
int status = wl_idle_status;
char servername[]="google.com"; // remote server connect to
wificlient client;
void setup() {
serial.begin(9600);
serial.println("attempting connect wpa network...");
serial.print("ssid: ");
serial.println(ssid);
status = wifi.begin(ssid, pass);
if ( status != wl_connected) {
serial.println("couldn't wifi connection");
// don't else:
while(true);
}
else {
serial.println("connected wifi");
serial.println("\nstarting connection...");
// if connection, report via serial:
if (client.connect(servername, 80)) {
serial.println("connected");
// make http request:
client.println("get /search?q=arduino http/1.0");
client.println();
}
else serial.println("not connected");
}
}
void loop() {
}
and there output :
code: [select]
attempting connect wpa network...
ssid: numericable-9b49
connected wifi
starting connection...
not connected
i can't final "connected" output .... don't understand why arduino can't connect google (i try'd severals servers)
if know how fix !
thanks.
have upgraded firmware? check code after serial.begin() in setup. if upgraded, should show version 1.1.0.
code: [select]
// check presence of 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());
Arduino Forum > Using Arduino > Programming Questions > Impossible to use wifiClient
arduino
Comments
Post a Comment