-->
Page 5 of 7

Re: Coding Help Needed Dual ESP8266 Tracking System

PostPosted: Thu Oct 29, 2015 1:46 pm
by danbicks
Why are you trying to connect to the access point in this code?

You only need to scan and see if your access point is found then return RSSI.

I will have a play later and see if I can knock up a solution for you.

Dans

Re: Coding Help Needed Dual ESP8266 Tracking System

PostPosted: Thu Oct 29, 2015 1:53 pm
by Barnabybear
@ derek bernsen - try that - fixed the WiFI.status check if you have no connection.
@ danbicks - I know it's not ideal but when I tried a scan, took about 2500ms minimum, too long for direction finding.
This loops in about 1000ms geting faster the stronger the signal.

Re: Coding Help Needed Dual ESP8266 Tracking System

PostPosted: Thu Oct 29, 2015 2:01 pm
by derek bernsen
@barnabybear it now gives an error message when verifying:

"Disconnected" what not declared in this scope"

Re: Coding Help Needed Dual ESP8266 Tracking System

PostPosted: Thu Oct 29, 2015 5:38 pm
by derek bernsen
Hi all,
This code almost works, I don't know why it doesn't work. It just flickers the buzzer at a pattern that doesn't change as signal strength changes. However, this code seems really, really close to working.
Code: Select all#include "ESP8266WiFi.h"

const char* ssid = "target beacon name here";
const char* password = "beacon password here if applicable";

void setup() {
  Serial.begin(115200);
  delay(50);
  pinMode(2, OUTPUT);
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  WiFi.begin(ssid, password);
  delay(50);   
 
}
  void loop() { 
int out = WiFi.RSSI();
int result = out * - 15;
//Serial.print(out);
//Serial.print(result);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(2, LOW);
delay(result);

}