Skip to content
This repository has been archived by the owner on May 2, 2021. It is now read-only.

Display measuring points #16

Open
Frief84 opened this issue Mar 16, 2015 · 8 comments
Open

Display measuring points #16

Frief84 opened this issue Mar 16, 2015 · 8 comments

Comments

@Frief84
Copy link

Frief84 commented Mar 16, 2015

It would be nice if you could see the measurement points of your current Log within the app on a map ...

@tjanson
Copy link
Owner

tjanson commented Mar 16, 2015

Yes, I’ve thought about this, and maybe this could be achieved by simply adding an HTML view of the local version of the Leaflet map? This might even result in an almost live map as you log. Embedding an HTML like that should definitely be possible.

Alternatively, the Google Maps API allows adding markers for GeoJSON points etc. too.

Worth exploring in the future.

@lingz
Copy link

lingz commented Feb 23, 2016

Hi, it says in the README that a map visualization has been done. Is it possible to see any working code for this?

@tjanson
Copy link
Owner

tjanson commented Feb 23, 2016

Yes, I did put something together with Leaflet, resulting in a "hex bin map", i.e., the RSSI is averaged over hexagonal tiles. (If you speak German, here’s the forum thread where all this originated.) It looked like this:

sample hexmap image

It wasn’t much more than a proof of concept. Here’s a downloadable version (.zip); the HTML file contains an explanatory comment.

(There was a server component too, which allowed uploading the logs from the app. I might still have it somewhere, but it was just some script.)


The thing is – and I guess I should eventually type up a post-mortem and post it in this project’s README – the results where underwhelming. At least for the original purpose, which was mapping the wifi coverage of a community wifi project.

  • The various Android devices have very different wifi properties, making cross-device comparisons very difficult. Even for a single device measurements can be inconsistent (e.g., phone in pocket versus phone in hand), so filtering and averaging would be needed. (This was never implemented.)
  • Android’s aggressive power saving makes it difficult to continuously scan for wifi networks.
  • GPS accuracy is typically ±10 m (best case: 4 m), which may be too coarse for your liking. (And of course it’s not possible to map indoor coverage at all due to lack of GPS reception.)
  • Finally and most importantly, in this context of community wifi, signal strength does not necessarily correlate with actual reception quality / “user happiness” (e.g., throughput, availability, etc.). (For this, congestion, interference, uplink & backbone status etc. play a very important role.)

@lingz
Copy link

lingz commented Feb 23, 2016

Thanks for this info!

I'm about to make something similar for my community. I'm interested specifically in the power saving issues you ran into. Would you be able to briefly describe them and any workarounds you tried? Might be able to save myself some headache.

@tjanson
Copy link
Owner

tjanson commented Feb 26, 2016

Unfortunately I don’t remember much of the details. I should say that this was my first (and so far only) foray into Android programming, so it’s entirely possible that the problems would be easily solvable to an experienced Android programmer.

The general problem was that wifi scanning and/or logging to file would stop when the screen is turned off or a different app takes the foreground (#1). AFAIK there no way to guarantee that an Android activity/service stays running (even if that is clearly what the user desires).

I tried acquiring a wake lock as seen in this commit, and the scanning/logging was moved to a service (this PR, but it’s possible that either of this was somehow done incorrectly. We still had users report that the log was incomplete or stopped entirely.

@lingz
Copy link

lingz commented Feb 26, 2016

So I built my own monitor and you can solve this by pushing the wifi scanning to a Service that is run as a foreground service. It will have a persistent notification and a very high priority so Android will not clean it up.

See here:

https://github.com/lingz/NetworkMonitor/blob/master/android/app/src/main/java/com/networkmonitor/NetworkMonitoringService.java#L137

@tjanson
Copy link
Owner

tjanson commented Feb 26, 2016

Cool! Are you logging to DB only? I see you integrated a speed test too.

Out of curiosity, what will you use this for?

@lingz
Copy link

lingz commented Feb 26, 2016

I'm logging to a firebase instance. I'm running a network performance evaluation of the university wireless network.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants