Cytron ESPWiFi Shield with Arduino

Talk about Arduino board, sheilds. Sharing Arduino projects, program, problems, solutions, suggestions..... many more, all are welcome.

Re: Cytron ESPWiFi Shield with Arduino

Postby vincent94 » Wed Oct 26, 2016 9:33 am

Thanks beng chet. Really appreciate your help.

One more question, is it possible to do a scan network function on the WiFi shield? Where the WiFi shield will scan all nearby wifi connection and print the wifi name and signal strength on the serial monitor.
vincent94
Freshie
 
Posts: 6
Joined: Tue Oct 11, 2016 10:20 pm

Re: Cytron ESPWiFi Shield with Arduino

Postby bengchet » Thu Oct 27, 2016 11:55 am

Hi,

Ya it is possible. But we don't provide this function in the library. You can try use the following snippet to do the job. Basically we write AT command to the shield then get the response. Haven't tested it yet, but it should be working.

CODE: SELECT_ALL_CODE
// send AT command for scan WiFi
wifi.println("AT+CWLAP");

// set 5s as timeout to wait for response after AT command for scan WiFi is sent
int i=5000;
while (wifi.available()<=0&&i--) {
    delay(1);
    if(i==1) {
      Serial.println(F("Timeout"));
    }
}

//if there is response, print it on serial monitor
while (wifi.available() > 0){
    Serial.write(wifi.read());
}
bengchet
Moderator
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

Previous

Return to Arduino Based

Who is online

Users browsing this forum: No registered users and 27 guests

cron