Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By derek bernsen
#32403 Hi all,
I found out I can use a ESP-201 as a radio beacon for t-hunting, but I'd like to make it work without an Android receiver.
All I had to do was plug it into a small 3.7v battery, and it broadcasts an SSID like an access point, stock, no programming needed.
The Android phone was placed inside a aluminum foil wrapped can, which made the signal directional and longer range.
A WiFi signal meter app with a audio mode beeped faster as I walked/aimed the can/phone closer to the beacon, and the app was set to look for only the SSID my ESP-201 beacon emitted, not other networks, even when I went out of range.

The downside of this setup is that the Android phone only has a WiFi range of about 955 feet.
I would like to increase that while maintaining portability.

So, I would appreciate help in writing code for a second ESP8266 module setup that acts as the receiver like the Android phone used to. So it would go inside a cantenna and it would pulse a piezo buzzer or small speaker - faster and/or louder as the other ESP8266 module (acting as a beacon) gets stronger in signal, like a WiFi Geiger counter but for that specific WiFi AP the ESP8266 beacon is broadcasting. I don't want it to have to pair to the ESP8226 beacon, just observe.

Thanks in advance,
Derek
User avatar
By derek bernsen
#32414
kolban wrote:Howdy Derek,
What is "t-hunting"? What is the back-story behind your project? Is it for a game for kids like "find the treasure"?

Neil


T-hunting is basically played like "find the treasure". It is a competitive radio-direction-finding sport for some amateur radio clubs. There can be multiple beacons, and it is usually a timed race to find the beacons.

I found out that I could use the ESP-201 module as a general use locatable beacon right out of the box like seen here: https://youtu.be/ZpEhnLIgZgU
It would probably be more useful to find crash landed R/C aircraft in tall grass or brush. In my local R/C aircraft club flying field, they have all tall grass, and when I asked them how they find crashed R/C planes in tall grass and if they use a on board siren of some sort, they told me that they do a walk through the grass in rows on foot briefly, and if they don't find it, then "oh well". I was surprised because one guy said he spent hundreds of hours building a working R/C model plane from actual blueprints of the real-life full-size historical aircraft. That amount of labor is common, from what I can tell. With all of that craftsmanship and labor, I was surprised they've supposedly looked for a mere few minutes for the priceless crashed R/C airplanes, and then gave up.
Most lost R/C aircraft locators for sale online cost well over $25 and I've seen beacons for over $230, and that's more costly than most people want to spend.

So see-a-need,fill-a-need as the saying goes.

But not everyone has Android or flies only <955 feet or so away, so that's why I'm here, asking for coding help to program a device to be the better solution. I want to post the tutorial on instructables.com at some point, assuming I succeed.


- Donovan
User avatar
By Mmiscool
#32425 Found some code that looks like it dose what you want.
It was on this page. Had to modify it to work in current arduino esp environment.

https://github.com/esp8266/Arduino/issues/132

Have fun an happy coding.

Modified code below:
Code: Select all#include <Arduino.h>
#include <ESP8266WiFi.h>

const char* SSID = "your ssid";

// Return RSSI or 0 if target SSID not found
int32_t getRSSI(const char* target_ssid) {
  byte available_networks = WiFi.scanNetworks();

  for (int network = 0; network < available_networks; network++) {
    if (WiFi.SSID(network).startsWith(target_ssid)  != 0) {
      return WiFi.RSSI(network);
    }
  }
  return 0;
}

void setup() {
  Serial.begin(9600);
}

void loop() {
  unsigned long before = millis();
  int32_t rssi = getRSSI(SSID);
  unsigned long after = millis();
  Serial.print("Signal strength: ");
  Serial.print(rssi);
  Serial.println("dBm");

  Serial.print("Took ");
  Serial.print(after - before);
  Serial.println("ms");
  delay(1000);
}