Open imaluschi opened 5 years ago
It would be very much easier if the format is always the same. The same as I mentioned with DHT is for WIFI-Signal. For a mobile application I often have no WIFI. This means to filter out the error message and change where the values are written (in this case for WIFI Signal Strength).
While working on my mobile-Feinstaubsensor Projekt I came across some problems with the CSV-Data export and DEBUG messages:
I realized that sometimes no DHT-values couldn't be read. If this happens, the CSV-Data sent over the serial port are missing these values. Wouldn't be a problem if the CSV-format would always be the same and "only" no values are sent. The CSV-Header is sent (without Particle Sensor, I'm still waiting for the orderd Sensor):
Timestamp_ms;temperature;humidity;BMP280_pressure;BMP280_temperature;GPS_lat;GPS_lon;GPS_height;GPS_date;GPS_time;samples;min_micro;max_micro;signal
The data values are sent like this (as mentioned in issue #381 I changed the GPS Date format!)1459334;22.60;42.90;93409.06;36.75;-200.000000;-200.000000;-1000.00;2019/02/17;11:32:31.00;145991;246;46796;-75
So if the DHT-values couldn't be read, the DEBUG-message sends:
[DHT22 couldn't be read]
for four times, and the data values:2064074;93392.64;38.22;-200.000000;-200.000000;-1000.00;2019/02/17;11:42:37.00;145907;246;44695;-76
That means, if you seperate the string according to CSV at the semicolon, you are missing two commas. It would be much better and easier if the sent values would be:408953;;;93436.38;33.44;-200.000000;-200.000000;-1000.00;2000/00/00;00:00:00.00;149977;246;38444;-71
(with the semicolons on the right place) To write out a correct CSV to the SD-Card you have to read the DEBUG-message and then assign the values correctly.And when i configure the ESP with
#define SDS_READ 1
there is no DEBUG-message if no SDS (maybe also with other particle Sensors)-values couldn't be read. That should be fixed in my opinion. The missing DEBUG-message was also mentioned in #335. As this is an error this should be put out also on#define DEBUG 1
or 2. Tried also with 3. This makes it even more complicated to assign the data-values for saving a correct CSV file (didn't try it but you've to check string length and/or the index of the last ; or count of the ;).Didn't try this with the BMP-Sensor as I've already solderd it onto the ESP.
Long story short: