This is a quick explanation of a recent YouTube Short.
I was working with a Wio Terminal from Seeed Studio, and I needed for one to perform rough detection of its location. The most obvious way to do this is to add GPS hardware to the device. This works, but since I was concerned with batter life, adding additional hardware also felt like a disadvantage. Detection of known WiFi access points has long been a solution for location detection. I went on a search to see where I could download a listing of known WiFi hardware IDs (BSSIDs) and their location. I couldn’t find any. While there are some open source solutions for WiFi based location to which users can submit data, none of them allow the complete dataset to be downloaded. That’s no problem, I will just make my own.
This was the day before Christmas. I was going to be performing a lot of driving. To make the most of it, I quickly put together a WiFi scanning solution on Android to save WiFi data and the location at which it was found. I ended up with a dataset of about 10,000 access points. This is plenty to experiment with. After some processing and filtering, I reduced this information to a data set of 12 bytes per record to put on an SD card. The ID that a router broadcast (BSSID) is 6 bytes, but I store the has of the BSSID instead of the BSSID, which is only 4 bytes. A completed record is the 4 byte has, 4 byte latitude, and 4 byte longitude.
While I had a strategy in mind for quickly searching through a large dataset, 10,000 access points is not huge. The WioTerminal could find the matching record even if it performed a linear search. When the Wio powers up, I set it to scan the environment for the BSSIDS , calculate their hashes, and search for a matching hash. Since this was only a proof of concept, I only searched for a first match. There are some other strategies that may give more accurate results in exchange for increased computation.
The solution has touched on C++, C#, and JavaScript. There is a lot to be said about it. I’ll discuss it across several posts with the first describing the collection of data in January 2023. More to come!
Mastodon: @j2inet@masto.ai
Instagram: @j2inet
Facebook: @j2inet
YouTube: @j2inet
Telegram: j2inet
Twitter: @j2inet
Posts may contain products with affiliate links. When you make purchases using these links, we receive a small commission at no extra cost to you. Thank you for your support.