schollz / howmanypeoplearearound

Count the number of people around you :family_man_man_boy: by monitoring wifi signals :satellite:
MIT License
6.92k stars 386 forks source link

Multiple MAC addresses for a single rssi in dumped JSON #12

Closed ansell closed 7 years ago

ansell commented 7 years ago

For one timepoint my dumped JSON file contains the following (redacted), with two MAC addresses separated by a comma, where there is usually a single MAC address:

{"rssi": -77.0, "company": "Apple, Inc.", "mac": "48:43:7c:XX:XX:XX,23:eb:f7:XX:XX:XX"}

This causes a syntax issue in the Javascript generated for analysis that looks like the following, causing the analysis to not display:

var mac48437cXXXXXX,23ebf7XXXXXX = {
  x: timex,
  y: [rssi-numbers-omitted],
 name: '48:43:7c:XX:XX:XX,23:eb:f7:XX:XX:XX', mode: 'lines', type:'scatter' };

Not sure how to replicate it, as I don't have a raw Wireshark dump file matching it. There seems to be the implicit assumption that wireshark will never emit two mac addresses in a single line like that, which should probably be improved on by either dropping the line or splitting the mac address field and duplicating the result. However, given I am not sure why it occurred, I am not sure what the best course of action should be.

schollz commented 7 years ago

Thanks, seems like an easy fix would be to just split on commas for the mac address.

schollz commented 7 years ago

its updated now, you can reinstall with

pip install --upgrade howmanypeoplearearound