I am building an early prototype, proof of concept, network monitoring tool. A big part of it uses localization of a Smartphone. It seems that the best way to do this is using RSSI from multiple points. I plan to do this using several Arduino Fios with Xbee WiFi (S6B) cards.
My current setup has a network running from my smartphone (it is running DHCP) with a laptop monitoring all the traffic on the network.
What I need is for my Fio Xbees to dump the RSSI of the "access point" (Smartphone) onto the network so my laptop can pull the data.
Thus, to/from is not important as far as the packet is concerned, I just need the data dropped on the "wire" for my laptop to later parse, which is good because Serial.print* sends out a broadcast to 255.255.255.255:fffff.
I can make my devices broadcast any integer, but when I go into AT mode nothing aside from the initial DHCP handshake gets put on the wire. Any ideas?
void setup() {
Serial.begin(9600);
Serial.flush();
delay(1000);//enter AT mode start
Serial.print("+");//AT
Serial.print("+");//AT
Serial.print("+");//AT
Serial.flush();
delay(1000);//enter AT mode finish
while(Serial.available()>0){
Serial.write(Serial.read());
}
}
void loop(){
Serial.println("ATDB");
while(Serial.available()>0){
Serial.write(Serial.read());
}
delay(750);//3/4 a sec
}
Note, Serial.println("ATDB");
should cause the xbee to drop the RSSI on the wire; see
XBee_WiFi_AT_Commands.pdf
at digi.com.
The three "+"s at the start are how you move the device into AT mode; see Digi_International_90002124_G.pdf at mouser.com.
Once again what I am trying to do is get the collected RSSI information dropped onto a wifi connection from multiple xbee WiFi S6B equipped Fios.
-
You are reading from the device then echoing back the characters, still in AT mode. You need to save the rssi response, exit AT mode, then send the response, otherwise the device will interpret it as another AT command.geometrikal– geometrikal2014年09月19日 22:37:22 +00:00Commented Sep 19, 2014 at 22:37
1 Answer 1
Just incase anybody stumbles onto this page googling, I am posting my solution below (I think it will work for any xbee radio)
Basically for some reason the RSSI values are getting nulled out before I can read them, both in my API mode tests and AT commands. I'm not convinced that there is not some way around this in API mode at least, but it is irrelevant for my current purpose.
What I did was wire pin 6 on the xbee to a digital pin on the Arduino (I used 7) then use a pulse detector to find the period of the wireless signal coming in.
int pin = 7;
unsigned long period;
void setup(){
Serial.begin(9600);
pinMode(pin, INPUT);
Serial.println("Getting started");
}
void loop(){
delay(100);
period = pulseIn(pin, HIGH);
Serial.println(period);
}
It is not perfect, but for now it works, might help someone else in the future.