-1

how to get the distance of the WLAN device connected to wi-fi of my node esp8266 device using micropython in the node esp8266?

Jagdish Chauhan
  • 129
  • 1
  • 10
  • Can you clarify your question further and add some code that you have already tried? At a minimum you should be able to get the RSSI signal strength, which is not an exact distance but would give you a rough idea. – Adam B Apr 18 '17 at 01:37
  • @AdamB actually i am working on a project in which i want to use the distance of the device connected to my wi-fi hotspot(my network) and use that distance to trigger some events on this basis. As i want to trigger events on small change in distance(in meters) so i think RSSI signal strength is not so much helpful... anyway thanks – Jagdish Chauhan Apr 19 '17 at 02:47

2 Answers2

1

It isn't possible to get a physical distance measurement from just wifi information. The wifi standard has no way to gather or communicate such information.

Here are some common approaches that have been used to try to estimate a user's location outside of wifi:

  • Have an app running on the phone that can use GPS to directly get position information and communicate that to your IoT device (may not work well indoors or be able to differentiate distances within wifi range).
  • Deploy multiple IoT devices throughout a space and assume the user is closest to the one where the signal strength is highest. If the space can be mapped for signal strength beforehand, a more complex triangulation technique can add accuracy to this approach.
  • Use a technology such as Bluetooth beacons and an app to determine rough location and send that to your IoT device.
Adam B
  • 3,775
  • 3
  • 32
  • 42
0

You can’t acquire the location, except with rough fumbling, i.e. sta_if.status(‘rssi’). In an unchanging space (no people or objects moving about), and depending on the polarization of your antenna, you can deduce approximate distance in meters.

This will not work in a 2.4GHz saturated environment, since your signal level will rise and fall.

user2497
  • 111
  • 3