porcej / njord

A buoy to augment a GNSS data stream based on known Wifi AP locations.
MIT License
0 stars 0 forks source link

Sometimes njord will not match Known APs #31

Closed timbellomo closed 4 months ago

timbellomo commented 5 months ago

We're noticing an issue where on some calls to get location, while in the range of a known AP, njord will report GNSS data. In many cases, this is a very inaccurate signal, as they're typically in the apparatus bay when this occurs.

Airlink OS's REST API will sometimes not report all in-range APs. But also, I've hit the API in quick succession after a failure to match an AP, and the return will show the known AP.

Unsure if there's a logic problem in the evaluation of the known APs, or if Airlink OS is failing to scan and report all APs.

porcej commented 5 months ago

need more info please log AOS API response for these situations.

timbellomo commented 5 months ago

I have observed this in several instances. When hitting the AOS API, I see that occasionally, it only shows a few SSIDs. My thought is that it's "mid-scan" when it's being queried, and as such, only presents a partial list of SSIDs (as though when the scan begins, it empties the ssid object, then repopulates it). I can fiddle with the scan interval, but upping it means latency in evaluation in either case.

It does seem to stabilize when you associate with an AP. We are still working on getting these associated with enterprise APs (security review); that's probably not going to happen quickly.

Meanwhile, gnss is producing very low accuracy hits, and njord is (as instructed) passing them on. We may have to introduce a quality check, but that increases complexity. An algo something along the lines of: -record instance of known AP -on subsequent checks, only accept gnss if accuracy is above a certain threshold -if not, re-emit last known AP sentence -on some period, re-confirm known AP; as in, check over a 30 second period; if we ever reconfirm the AP is still present in that period, keep re-emitting it unless we get a superseding high accuracy GNSS hit.

To be clear, I'm not crazy about this - just trying to work with the constraints we have.

porcej commented 4 months ago

This is an artifact of the Wifi scanning and is not something we can fix in njord. Please considering using a device that does active Wifi scanning rather than passive.