LyndLabs / Cutie-Wardriver-Firmware

Basic ESP8266/ESP32 Wardriving & Logging in WiGLE Format
MIT License
37 stars 5 forks source link

AP names with commas corrupt CSV entries #11

Open pejacoby opened 12 months ago

pejacoby commented 12 months ago

Encountered a glitch in the CSV file output:

SSID: LG_Speaker_S80QY7934.l078 (as captured by WiGle WiFi - they replace commas with _)

CSV output line -- note the comma in the SSID name has be included in the output. This leaves the "AuthMode" for this entry blank, and pushes the "[ESS]" value into "FirstSeen" column, and all subsequent fields only column to the right.

FA:8F:CA:5D:71:B9,LG_Speaker_S80QY_7934.l078,,[ESS],2023-10-01 22:48:54,1,-91,44.885960,-92.903198,295,0.970000,WIFI

Here is the full output from a Wigle KML file export for comparison. Wigle replaces the comma with an underscore "_" to avoid the issue.

            <Placemark>
                <name>LG_Speaker_S80QY_7934.l078_</name>
                <open>1</open>
                <description>Network ID: FA:8F:CA:5D:71:B9
Encryption: None
Time: 2023-10-01T22:48:53.000-07:00
Signal: -82.0
Accuracy: 2.5
Type: WIFI</description>
                <styleUrl>#highConfidence</styleUrl>
                <Point>
                    <coordinates>-92.90318298,44.88571167</coordinates>
                </Point>
            </Placemark>

This has also been observed with the SSID "Bill Wi, The Science Fi" and similar naming where there is a comma at a word boundary. In Wigle-land, the comma is replaced by an underscore "_"

lukeswitz commented 12 months ago

Documented in #1 as well..

the /%s/ in the save line has trouble with punctuation and spaces.

pejacoby commented 12 months ago

Thanks for the pointer to #1 The pattern definitely holds, curious with the commonality to various "home speaker" SSIDs that have odd trailing characters.

Check out the code for the WigleWiFi app for a possible approach - this addresses various things that shouldn't be in a KML file.

https://github.com/wiglenet/wigle-wifi-wardriving/blob/main/wiglewifiwardriving/src/main/java/net/wigle/wigleandroid/background/KmlWriter.java#L338

Also in ObservationUploader, they do nothing fancier that replacing a comma in an SSID with an "_".

https://github.com/wiglenet/wigle-wifi-wardriving/blob/2170cb04896227e8fab079a472495284c7c0d974/wiglewifiwardriving/src/main/java/net/wigle/wigleandroid/background/ObservationUploader.java#L434

lukeswitz commented 12 months ago

This can be closed, was fixed in a previous release

Sanitized correctly: https://github.com/LyndLabs/Wardriver/blob/d6592d9f79394e645411a025fd570676b35ef299/src/Wardriver/src/Wardriver.cpp#L207