ArduinoGeneral

Scanning near wifi routers, from WiFi Bee?

userHead ardakshalkar 2014-04-09 00:11:04 5926 Views19 Replies
We want to find available WiFi networks near. So in tutorial there is command scan, which is send from CoolTerm program from PC. [url=http://www.dfrobot.com/wiki/index.php/WiFi_Bee_V1.0_(SKU:TEL0067)]http://www.dfrobot.com/wiki/index.php/WiFi_Bee_V1.0_(SKU:TEL0067)[/url] Now we want to write program to Arduino which will do same operation, how it can be done?
2014-06-04 00:59:23 Hello zerde,
I am using the same code, every thing works fine.
After several restart, it still works.

What is your wifi name? I guess it only could recognize the English words.
userHeadPic Grey.CC
2014-06-04 00:59:23 Hello zerde,
I am using the same code, every thing works fine.
After several restart, it still works.

What is your wifi name? I guess it only could recognize the English words.
userHeadPic Grey.CC
2014-06-04 00:40:49 Hi Grey! your code helped me a lot, but we still get errors,sometimes it is ERR: ?-Cmd <4.00> type of error, but mostly it prints out some  symbols(like in the picture attached below) We want to get router id and rssi values. But with errors we can't compute them...Do you know what causes of errors?

Also after scanning few times wifi bee disconnects from router, then i have to reboot it to make it connect again. We also tried to scan using telnet, but after giving scan command 4-5 times it will just disconnect from router.
userHeadPic zerde
2014-06-04 00:40:49 Hi Grey! your code helped me a lot, but we still get errors,sometimes it is ERR: ?-Cmd <4.00> type of error, but mostly it prints out some  symbols(like in the picture attached below) We want to get router id and rssi values. But with errors we can't compute them...Do you know what causes of errors?

Also after scanning few times wifi bee disconnects from router, then i have to reboot it to make it connect again. We also tried to scan using telnet, but after giving scan command 4-5 times it will just disconnect from router.
userHeadPic zerde
2014-04-30 18:28:03 Yeah, only the first time you need to input "$$$".
And you need to input the exit command in the end, because if it has entered the AT mode, every time you input "$$$", it won't be recognized. It will just be what Jose said.
[code]char t;
void setup() {
  Serial.begin(9600);
  Serial.println("program start");
  Serial.write("$$$");
  delay(1000);
  Serial.println("scan");
  Serial.println("exit");
  delay(1000);
}

void loop() {
  if (Serial.available()) {
    t=Serial.read();
    Serial.print(t);
  }
}
[/code]
Try this one, as UNO only has one serial port, it still some error, but it has worked. You could see the network in the serial port.
userHeadPic Grey.CC
2014-04-30 18:28:03 Yeah, only the first time you need to input "$$$".
And you need to input the exit command in the end, because if it has entered the AT mode, every time you input "$$$", it won't be recognized. It will just be what Jose said.
[code]char t;
void setup() {
  Serial.begin(9600);
  Serial.println("program start");
  Serial.write("$$$");
  delay(1000);
  Serial.println("scan");
  Serial.println("exit");
  delay(1000);
}

void loop() {
  if (Serial.available()) {
    t=Serial.read();
    Serial.print(t);
  }
}
[/code]
Try this one, as UNO only has one serial port, it still some error, but it has worked. You could see the network in the serial port.
userHeadPic Grey.CC
2014-04-29 23:56:05 [quote="zerde"]
We tried to remove "$$$" command from code, but when we run the code there is no any respond.Maybe we ..
[/quote]

If you remove the "$$$" you can't input the AT commands. So put it back and do this sequence for example:
start AT command mode;
Send your configuration;
Close AT mode with:
Serial.println("exit"); // Exit command mode
Alternatively, if configuration requires restart just do as in the wiki example:
  Serial.println("save"); // save it forever and ever
  Serial.println("reboot"); // reboot to load configuration

[quote="ardakshalkar"]
Thank for your answers)
We have sent command $$$ to serial output
But in response it outputs [code]ERR: ?-Cmd <4.00>[/code]
What's the problem?
[/quote]

Looks like there was an attempt of a previous input. or a malformed input. Anyway, if you got that, the AT mode is enabled and you can input your AT command for configuration. If thats not what you need just exit it like i mentioned earlier..
userHeadPic Jose
2014-04-29 23:56:05 [quote="zerde"]
We tried to remove "$$$" command from code, but when we run the code there is no any respond.Maybe we ..
[/quote]

If you remove the "$$$" you can't input the AT commands. So put it back and do this sequence for example:
start AT command mode;
Send your configuration;
Close AT mode with:
Serial.println("exit"); // Exit command mode
Alternatively, if configuration requires restart just do as in the wiki example:
  Serial.println("save"); // save it forever and ever
  Serial.println("reboot"); // reboot to load configuration

[quote="ardakshalkar"]
Thank for your answers)
We have sent command $$$ to serial output
But in response it outputs [code]ERR: ?-Cmd <4.00>[/code]
What's the problem?
[/quote]

Looks like there was an attempt of a previous input. or a malformed input. Anyway, if you got that, the AT mode is enabled and you can input your AT command for configuration. If thats not what you need just exit it like i mentioned earlier..
userHeadPic Jose
2014-04-29 05:40:18 Hi Grey) thank you for answer! We tried to remove "$$$" command from code, but when we run the code there is no any respond.Maybe we have some problem with code
Here is sample code we used:
[code]
void setup() {
  Serial.begin(9600);
  pinMode(13, HIGH);
  Serial.println("program start");

  delay(1000);
  digitalWrite(13, HIGH);
//Serial.print("$$$");
Serial.print("show net");
  delay(300);
  Serial.println();
// Serial.print("scan");
digitalWrite(13, LOW);
}
 
void loop() {
if (Serial.available()) {
  Serial.write(Serial.read());
    }
}[/code]

We are using DFRduino Romeo-All in one Controller V1.1,  I/O expansion Shield V7, Wifi Bee V1.0
userHeadPic zerde
2014-04-29 05:40:18 Hi Grey) thank you for answer! We tried to remove "$$$" command from code, but when we run the code there is no any respond.Maybe we have some problem with code
Here is sample code we used:
[code]
void setup() {
  Serial.begin(9600);
  pinMode(13, HIGH);
  Serial.println("program start");

  delay(1000);
  digitalWrite(13, HIGH);
//Serial.print("$$$");
Serial.print("show net");
  delay(300);
  Serial.println();
// Serial.print("scan");
digitalWrite(13, LOW);
}
 
void loop() {
if (Serial.available()) {
  Serial.write(Serial.read());
    }
}[/code]

We are using DFRduino Romeo-All in one Controller V1.1,  I/O expansion Shield V7, Wifi Bee V1.0
userHeadPic zerde
2014-04-15 21:18:34 After you have input "$$$", it will appear "CMD"
it means it has already into AT command mode. you could input the at command directly.
It is no need to input $$$ again.
userHeadPic Grey.CC
2014-04-15 21:18:34 After you have input "$$$", it will appear "CMD"
it means it has already into AT command mode. you could input the at command directly.
It is no need to input $$$ again.
userHeadPic Grey.CC
2014-04-15 20:07:05 Thank for your answers)
We have sent command $$$ to serial output
But in response it outputs [code]ERR: ?-Cmd <4.00>[/code]
What's the problem?
userHeadPic ardakshalkar
2014-04-15 20:07:05 Thank for your answers)
We have sent command $$$ to serial output
But in response it outputs [code]ERR: ?-Cmd <4.00>[/code]
What's the problem?
userHeadPic ardakshalkar
2014-04-09 21:31:02 Welcome Arda,

in the example:
[url=https://www.dfrobot.com/wiki/index.php/WiFi_Bee_V1.0_(SKU:TEL0067)#Arduino_Server_example]https://www.dfrobot.com/wiki/index.php/WiFi_Bee_V1.0_(SKU:TEL0067)#Arduino_Server_example[/url]

You can see how AT commands are included on Arduino Sketch. In a similar way you can add the scan function and parse the data output from the Bee. However if the data output is too long, the Serial buffer might not be enough to get all the data.
You can increase the Serial Read buffer if you run into such problems.

Cheers^^
userHeadPic Jose
2014-04-09 21:31:02 Welcome Arda,

in the example:
[url=https://www.dfrobot.com/wiki/index.php/WiFi_Bee_V1.0_(SKU:TEL0067)#Arduino_Server_example]https://www.dfrobot.com/wiki/index.php/WiFi_Bee_V1.0_(SKU:TEL0067)#Arduino_Server_example[/url]

You can see how AT commands are included on Arduino Sketch. In a similar way you can add the scan function and parse the data output from the Bee. However if the data output is too long, the Serial buffer might not be enough to get all the data.
You can increase the Serial Read buffer if you run into such problems.

Cheers^^
userHeadPic Jose
2014-04-09 02:23:25 In theory, yes!
You could let arduino input the AT command, and let it show the data in the serial port.
It is a little complicated. it needs a certain C++ base. But you can have a try!
userHeadPic Grey.CC
2014-04-09 02:23:25 In theory, yes!
You could let arduino input the AT command, and let it show the data in the serial port.
It is a little complicated. it needs a certain C++ base. But you can have a try!
userHeadPic Grey.CC
2014-04-09 00:11:04 We want to find available WiFi networks near. So in tutorial there is command scan, which is send from CoolTerm program from PC. [url=https://www.dfrobot.com/wiki/index.php/WiFi_Bee_V1.0_(SKU:TEL0067)]https://www.dfrobot.com/wiki/index.php/WiFi_Bee_V1.0_(SKU:TEL0067)[/url] Now we want to write program to Arduino which will do same operation, how it can be done? userHeadPic ardakshalkar