继WiFi信号的使用RSSI源 [英] Following the source of WiFi signal using rssi

查看:313
本文介绍了继WiFi信号的使用RSSI源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有带wifi屏蔽一个Arduino UNO,我希望它能够进入信号源。

I have an arduino uno with wifi shield and I want it to be able to go to source of signal.

这是我得到的RSSI一般为-80 dBm的上述-40 dBm的我认为机器人已经找到了源头。

The rssi that I get is usually -80 dBm above -40 dBm I assume the robot has found the source.

所以,机器人会直接和检查每2秒的RSSI如果新的信号比它更糟糕事实证明之前向右旋转90度,去直,并保持这样做,直到找到源头。

So the robot goes straight and checks every 2 seconds the rssi if the new signal is worse than it was before it turns 90 degrees right and goes straight and keeps doing that until it finds the source.

虚空环路()与机器人的逻辑。

int angle = 90;
char ssid[]="AndroidAP";
bool sourceFound = false;
long rssi = -100;
long prevRssi = 0;

void setup() {
  Serial.begin(9600); 
  updateRSSI();
  servoLeft.attach(8);
  servoRight.attach(9);
  goStraight();
}

void loop() {
  if(!sourceFound){
    updateRSSI();
    if(prevRssi>rssi){
      turnRight();
      goStraight();
      delay(2500);
    }
    if(rssi>-41){
      stayStill();
      detachServos();
      sourceFound = true;
      Serial.print("Source found.");
      Serial.println();
    }
  }
}

/*MOVEMENT CONTROLS*/
void turnLeft(){
  servoLeft.writeMicroseconds(1300);
  servoRight.writeMicroseconds(1300);
  delay(angle*10.6);
}
void turnRight(){
  servoLeft.writeMicroseconds(1700);
  servoRight.writeMicroseconds(1700);
  delay(angle*10.6);
}
void turnAround(){
  if((double)rand() / (double)RAND_MAX==0){
    turnLeft(); 
    turnLeft();
  }else{
    turnRight();
    turnRight();
  }
}
void stayStill(){
  servoLeft.writeMicroseconds(1500);
  servoRight.writeMicroseconds(1500);
}
void goStraight(){
  servoLeft.writeMicroseconds(1600);
  servoRight.writeMicroseconds(1444 );
}
void detachServos(){
  servoLeft.detach();
  servoRight.detach(); 
}
/*MOVEMENT CONTROLS*/
/*WIFI SHIELD CONTROLS*/
void updateRSSI(){
  prevRssi = rssi;
  uint8_t available_networks = WiFi.scanNetworks();
  for (uint8_t net = 0; net < available_networks; ++net)
  {
    if (strcmp(WiFi.SSID(net), ssid) == 0)
    {
     // ssidFound = true;
      rssi = WiFi.RSSI(net);

      if(rssi-prevRssi<-10){ //disregard the measurement and try again
        rssi = prevRssi;
        updateRSSI();
      }

      Serial.print("Old: ");
      Serial.print(prevRssi);
      Serial.print(" dBm ");
      Serial.print("New: ");
      Serial.print(rssi);
      Serial.print(" dBm");
      Serial.println();
      break;
   }
  }
}

问题是信号改变了很多,这将有时会导致机器人右转,甚至当它是pretty靠近源总是正确的是没有得到到路由器是相当随机的最有效途径。是否有更简单的方法,或找到并获得源更有效的方式?

The problem is that the signal varies a lot which will cause robot sometimes to turn right even when it's pretty close to the source and always going right is not the most effective way of getting to router it is quite random. Is there an easier way or more efficient way to find and get to the source?

推荐答案

基本上你的机器人在做所谓的驾驶攻击的共同任务的本地化部分(听起来非法的,但它不是)。我最近在做pretty一些研究多正是你在做什么,但也有一些论文发现,基本上无线电台的信号强度弱和使用的不一致。

Basically your robot is doing the localization part of a common task called "wardriving" (sounds illegal but it's not). I was recently doing some research in pretty much exactly what you were doing although some papers found that essentially the signal strength of WiFi stations is to weak and inconsistent for use.

达特茅斯研究(第14页)本研究发现当使用典型的战争驾驶方法,他们只能40和所有的WiFi节点的60%之间,以检测和平均是错误的周围30-40M从实际发射机。

Dartmouth study (Page 14) This study found that using typical war driving methods they were only able to detect between 40 and 60 % of all WiFi nodes and on average was around 30-40m of error from the actual transmitter.

<一个href=\"http://referaat.cs.utwente.nl/conference/21/paper/7464/accuracy-characterization-for-wifi-localization-in-changing-environments.pdf\"相对=nofollow>另一项研究(第4页)在这里,你必须在一个恒定的距离被采样的3个基站的阴谋的信号强度之遥。你会发现一个钟形曲线,看起来至少有5(可惜没有表中的数据)的标准偏差。然而,做pretty清楚地显示了如何嘈杂的信号,你应该期望。

Another study (Page 4) Here you have a plot of 3 base stations being sampled for signal strength at a constant distance away. You will notice a bell curve which looks to have a standard deviation of at least 5 (sadly no table for the data). However that does pretty clearly show how noisy of a signal you should expect.

我不是说你的目标是不可能的,我说不过你需要做大量的滤波和移动非常缓慢的(东西我的项目不能这样做)。出乎本能WiFi信号强度是令人难以置信的嘈杂使得没有一个非常大的数据集精确驾驶攻击难度。希望有这些论文至少有助于曲线您的期望。

I'm not saying that your goal is impossible I am saying however you will need to do a lot of filtering and move very slowly (something my project could not do). Contrary to instincts WiFi signal strength is incredibly noisy making accurate wardriving difficult without an extremely large data set. Hope having these papers at least helps curve your expectations.

这篇关于继WiFi信号的使用RSSI源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆