I have a Arduino Uno and a WiFi shield ; the project goal is to aquire data from a sensor and to send it to a Processing sketch running on a PC over WiFi.
Taking most of my code from the various official exemples, I managed to have the WiFi shield to successfully connect to a WiFi (WPA) network (according to the board and the smartphone hosting the network).
However, when I try to send/receive data from the board, I always get an error, and I do not know where it is from.
I doubt the error comes from my code, as it's almost only copy and pastes, but here are the relevant parts just in case :
Initilization :
char ssid[] = "MiniStepper"; // Network name
char pass[] = "Test1234"; // Network code
int keyIndex = 0; // Network key
int statut = WL_IDLE_STATUS;
WiFiServer server(80);
Setup :
void beginWiFi(){ // called in setup()
// Connection to the network (working, so omitted)
//...
server.begin();
}
Answering to requests :
void connexionRead(){ // called in loop()
WiFiClient client = server.available();
if(!client) return;
Serial.println("New connexion !"); // This never prints, so I'm sure the problem is earlier
// ...code sending back a HTML file with the HTTP protocol
}
I'm doing access using Chrome (I tried Firefox with no results as well), using the IP Address given by WiFi.localIP()
(the smartphone hosting the network gives the same) :
which gives back "ERR_CONNECTION_REFUSED".
I'm really new to IoT, and I'm guessing it's probably a config problem (firewall, ...) ; my computer is running Ubuntu 15.10 (Willy Werewolf) (I tried with the same results with a Windows 7 PC), the network is encrypted by WPA, hosted by a XPeria U (I tried with other smartphone-hosted WPA networks with the same results), the arduino WiFi shield with Uno board (bought less than 3 months ago so I'm guessing it's the latest version).
My researches on the Arduino Forum or here only let results like "doesn't work in Arduino 1.0.5, go back to Arduino 1.0.3", but the current version is 1.8.2, so I'm not really sure if going back this much would help.
Is there anything I missed ?
EDIT. Here is the ping :
/home/ubuntu>ping 192.168.43.200
PING 192.168.43.200 (192.168.43.200) 56(84) bytes of data.
64 bytes from 192.168.43.200: icmp_seq=1 ttl=255 time=9.54 ms
64 bytes from 192.168.43.200: icmp_seq=2 ttl=255 time=6.01 ms
64 bytes from 192.168.43.200: icmp_seq=3 ttl=255 time=6.15 ms
64 bytes from 192.168.43.200: icmp_seq=4 ttl=255 time=7.23 ms
64 bytes from 192.168.43.200: icmp_seq=5 ttl=255 time=7.03 ms
<and more>
--- 192.168.43.200 ping statistics ---
31 packets transmitted, 31 received, 0% packet loss, time 30048ms
rtt min/avg/max/mdev = 4.112/6.415/11.377/1.706 ms