I bought a board from Ali Express - The board is like this
The board has a set of jumpers set to
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
---|---|---|---|---|---|---|---|
ON | ON | ON | ON | OFF | OFF | OFF | OFF |
My simple script just reads/writes from the Arduino USB Serial and sends anything it receives to the ESP8266 and anything it receives from the ESP8266 it sends to the Arduino Serial USB.
Both are running at 115200 baud rate. I resend the command every 10 seconds to just request the list again.
// COMMANDS
// Serial Monitor - Make sure that Both NL + CR is the mode.
// AT+CWLAP = LIST Access Points
unsigned long lastMillis = 0;
void setup()
{
Serial3.begin(115200);
Serial.begin(115200);
delay(1000);
Serial3.println("AT+CWLAP");
}
void loop()
{
if (millis() - lastMillis >= 10000)
{
lastMillis = millis();
Serial3.println("AT+CWLAP");
}
while (Serial3.available())
{
Serial.write(Serial3.read());
}
while (Serial.available())
{
Serial3.write(Serial.read());
}
}
The Output is like below - Why is the access points so all over the place, it sometimes shows none, sometimes a few, sometimes my local ones and sometimes not?
Is it my code or something else?
AT+CWLAP
OK
AT+CWLAP
ERROR
AT+CWLAP
+CWLAP:(4,"SPARK-ZY9PSZ",-90,"44:c3:46:d0:08:5a",4)
OK
AT+CWLAP
+CWLAP:(3,"vodafone7A4D",-49,"a4:71:74:07:7a:54",4)
OK
AT+CWLAP
+CWLAP:(4,"SPARK-ZY9PSZ",-82,"44:c3:46:d0:08:5a",4)
+CWLAP:(4,"CROWEAV",-71,"80:1f:02:3d:54:66",13)
OK
AT+CWLAP
+CWLAP:(4,"CROWEAV",-74,"80:1f:02:3d:54:66",13)
OK
AT+CWLAP
+CWLAP:(3,"vodafone7A4D",-60,"a4:71:74:07:7a:54",4)
+CWLAP:(4,"SPARK-ZY9PSZ",-81,"44:c3:46:d0:08:5a",4)
OK
AT+CWLAP
OK
AT+CWLAP
+CWLAP:(4,"SPARK-ZY9PSZ",-84,"44:c3:46:d0:08:5a",4)
OK
AT+CWLAP
OK
Just looking for ideas on why the list is so random instead of listing all known access points each time.
My local Access Point is vodafone7A4D but CROWEAV is also in my house the others are my neighbors.
Chris