opendata-stuttgart / sensors-software

sourcecode for reading sensor data
573 stars 312 forks source link

Sensor data won't get uploaded #200

Closed kristigu closed 5 years ago

kristigu commented 6 years ago

Hello everyone,

A few days ago I installed my measurement station with the SDS011, DHT22 and ESP8266.

Initially everything seemed to be going fine but after a while the data would first not get regularly uploaded, and later wouldn't get uploaded at all. https://www.madavi.de/sensor/graph.php?sensor=esp8266-1846195-sds011

However if I access the sensor locally on it's IP 192.168.1.104, the data is regularly updated every three minutes.

I thought it could be a connectivity issue since my modem was located a bit far and the signal was rather poor (40%). So yesterday I installed a new network from a router very close to the sensor and configured it again but the problem persists.

Last night I managed to get a couple of datasets uploaded from 1AM to 2AM after updating the network configuration but then not anymore. I tried changing the frequency of uploading and the levels of debug on the configuration page but no result. My current configuration looks like this (with Messinterval set 290 and dauer routermodus at 1200:

Luftdaten.info: 1 Madavi: 1 DHT: 1 HTU21D: 0 SDS: 1 PMS1003, PMS5003, PMS6003, PMS7003: 0 PMS3003: 0 PPD: 0 BMP180: 0 BMP280: 0 BME280: 0 DS18B20: 0 GPS: 0 Auto update firmware: 1 Screen: 0 LCD 1602 (I2C: 0x27): 0 LCD 1602 (I2C: 0x3F): 0 Debug Level: 3 : 290000 opensensemap: 0 senseBox-ID

Eigene API: 0 Server: 192.168.234.1 Path: /data.php Port: 80 User: Password:

InfluxDB: 0 Server: api.luftdaten.info Path: /write?db=luftdaten Port: 8086 User: luftdaten Password: info

Is there any way to provide you with more data or to check an error log? I'm not that familiar with code so any instruction would be greatly appreciated!

DwaineGarden commented 6 years ago

Go into configuration and set the debug level higher. With the Arduino console you can see the network connection fail or not. Also if there is a crash

kristigu commented 6 years ago

Can you please be more specific on how can I check on Arduino? Also, do I need to connect the boars via USB to the computer?

kristigu commented 6 years ago

I tried various things to make the sensor work but no luck. I recently switched the plug and also put on a shorter microUSB cable instead of the 3m one I was initially using. No luck. Last night I managed to get the data online every hour, but at times it still gets stuck.

So I tried connecting the sensor to my PC and debugging the sensor with the Serial Monitor tool and looks like the problem is a communication one between luftdaten.info and my sensor. Any idea what could it be? These are the results that I got:

Start reading SDS011 End reading SDS011 Call sensorSDS Start reading SDS011 End reading SDS011 Call sensorSDS Start reading SDS011 0 - 110 - 6e - 110 . 0 - 80 - 50 - 80 . 0 - 160 - a0 - 160 . 0 - 184 - b8 - 184 . 0 - 170 - aa - 170 . 1 - 197 - c5 - 197 . 0 - 6 - 6 - 6 . 0 - 1 - 1 - 1 . 0 - 0 - 0 - 0 . 0 - 0 - 0 - 0 . 0 - 165 - a5 - 165 . 0 - 192 - c0 - 192 . 0 - 108 - 6c - 108 . 0 - 171 - ab - 171 . 0 - 173 - ad - 173 . 0 - 40 - 28 - 40 . 0 - 16 - 10 - 16 . 0 - 92 - 5c - 92 . 0 - 245 - f5 - 245 . End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 51 - 33 - 51 . 3 - 0 - 0 - 0 . 4 - 108 - 6c - 108 . 5 - 0 - 0 - 0 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 4 - 4 - 4 . Checksum is: 4 - should: 4 9 - 171 - ab - 171 . End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 50 - 32 - 50 . 3 - 0 - 0 - 0 . 4 - 139 - 8b - 139 . 5 - 0 - 0 - 0 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 34 - 22 - 34 . Checksum is: 34 - should: 34 9 - 171 - ab - 171 . End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 50 - 32 - 50 . 3 - 0 - 0 - 0 . 4 - 206 - ce - 206 . 5 - 0 - 0 - 0 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 101 - 65 - 101 . Checksum is: 101 - should: 101 9 - 171 - ab - 171 . End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 49 - 31 - 49 . 3 - 0 - 0 - 0 . 4 - 29 - 1d - 29 . 5 - 1 - 1 - 1 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 180 - b4 - 180 . Checksum is: 180 - should: 180 9 - 171 - ab - 171 . End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 50 - 32 - 50 . 3 - 0 - 0 - 0 . 4 - 41 - 29 - 41 . 5 - 1 - 1 - 1 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 193 - c1 - 193 . Checksum is: 193 - should: 193 9 - 171 - ab - 171 . End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 53 - 35 - 53 . 3 - 0 - 0 - 0 . 4 - 67 - 43 - 67 . 5 - 1 - 1 - 1 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 222 - de - 222 . Checksum is: 222 - should: 222 9 - 171 - ab - 171 . End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 55 - 37 - 55 . 3 - 0 - 0 - 0 . 4 - 83 - 53 - 83 . 5 - 1 - 1 - 1 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 240 - f0 - 240 . Checksum is: 240 - should: 240 9 - 171 - ab - 171 . End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 57 - 39 - 57 . 3 - 0 - 0 - 0 . 4 - 63 - 3f - 63 . 5 - 1 - 1 - 1 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 222 - de - 222 . Checksum is: 222 - should: 222 9 - 171 - ab - 171 . End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 58 - 3a - 58 . 3 - 0 - 0 - 0 . 4 - 55 - 37 - 55 . 5 - 1 - 1 - 1 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 215 - d7 - 215 . Checksum is: 215 - should: 215 9 - 171 - ab - 171 . End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 60 - 3c - 60 . 3 - 0 - 0 - 0 . 4 - 65 - 41 - 65 . 5 - 1 - 1 - 1 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 227 - e3 - 227 . Checksum is: 227 - should: 227 9 - 171 - ab - 171 . End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 60 - 3c - 60 . 3 - 0 - 0 - 0 . 4 - 78 - 4e - 78 . 5 - 1 - 1 - 1 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 240 - f0 - 240 . Checksum is: 240 - should: 240 9 - 171 - ab - 171 . End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 60 - 3c - 60 . 3 - 0 - 0 - 0 . 4 - 67 - 43 - 67 . 5 - 1 - 1 - 1 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 229 - e5 - 229 . Checksum is: 229 - should: 229 9 - 171 - ab - 171 . End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 60 - 3c - 60 . 3 - 0 - 0 - 0 . 4 - 53 - 35 - 53 . 5 - 1 - 1 - 1 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 215 - d7 - 215 . Checksum is: 215 - should: 215 9 - 171 - ab - 171 . End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 61 - 3d - 61 . 3 - 0 - 0 - 0 . 4 - 41 - 29 - 41 . 5 - 1 - 1 - 1 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 204 - cc - 204 . Checksum is: 204 - should: 204 9 - 171 - ab - 171 . End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 59 - 3b - 59 . 3 - 0 - 0 - 0 . 4 - 32 - 20 - 32 . 5 - 1 - 1 - 1 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 193 - c1 - 193 . Checksum is: 193 - should: 193 9 - 171 - ab - 171 . PM10 (sec.) : 28.80 PM2.5 (sec.): 5.90 End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 59 - 3b - 59 . 3 - 0 - 0 - 0 . 4 - 17 - 11 - 17 . 5 - 1 - 1 - 1 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 178 - b2 - 178 . Checksum is: 178 - should: 178 9 - 171 - ab - 171 . PM10 (sec.) : 27.30 PM2.5 (sec.): 5.90 End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 58 - 3a - 58 . 3 - 0 - 0 - 0 . 4 - 24 - 18 - 24 . 5 - 1 - 1 - 1 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 184 - b8 - 184 . Checksum is: 184 - should: 184 9 - 171 - ab - 171 . PM10 (sec.) : 28.00 PM2.5 (sec.): 5.80 End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 58 - 3a - 58 . 3 - 0 - 0 - 0 . 4 - 21 - 15 - 21 . 5 - 1 - 1 - 1 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 181 - b5 - 181 . Checksum is: 181 - should: 181 9 - 171 - ab - 171 . PM10 (sec.) : 27.70 PM2.5 (sec.): 5.80 End reading SDS011 Call sensorSDS Start reading SDS011 0 - 170 - aa - 170 . 1 - 192 - c0 - 192 . 2 - 58 - 3a - 58 . 3 - 0 - 0 - 0 . 4 - 10 - a - 10 . 5 - 1 - 1 - 1 . 6 - 165 - a5 - 165 . 7 - 192 - c0 - 192 . 8 - 170 - aa - 170 . Checksum is: 170 - should: 170 9 - 171 - ab - 171 . PM10 (sec.) : 26.60 PM2.5 (sec.): 5.80 End reading SDS011 Call sensorSDS Start reading SDS011 PM10: 27.67 PM2.5: 5.83

End reading SDS011 Call sensorDHT Start reading DHT11/22 Humidity : 60.20% Temperature : 21.30⸮C

End reading DHT11/22 Creating data string: WLAN signal strength: -63 dBm

**## Sending to luftdaten.info (SDS): Start connecting to api.luftdaten.info connection failed

Sending to luftdaten.info (DHT):

Start connecting to api.luftdaten.info connection failed

Sending to madavi.de:

Start connecting to api-rrd.madavi.de connection failed Time for sending data: 7492153** Call sensorSDS Start reading SDS011 End reading SDS011 Call sensorSDS Start reading SDS011 End reading SDS011 ...

ricki-z commented 6 years ago

How is the sensor 'connected' to your wifi network? Is there an IP address shown after start that belongs to your home network? Is there anything blocked on your router? The sensor can't connect to 2 different domains. So there may be a DNS problem or a connection problem.

kristigu commented 6 years ago

Indeed it seems like my internet connection is causing the problem. Weird however that it was ok the first two or three days.

I happened to have a mobile data usb key from a mobile network provider and configured the sensor with it. It has been working with no problems for the past 2.5 hours. Let's hope this fixes it!

ricki-z commented 6 years ago

@kristigu any news? can we close this issue?

henare commented 6 years ago

Hi everyone :wave: This is my first comment on this project - thanks so much for making it! :revolving_hearts:

I've recently built my first sensor and I've been having the same issue. You can see spotty little outages on the charts, e.g. https://www.madavi.de/sensor/graph.php?sensor=esp8266-818835-dht

I've been documenting the debugging process on this issue: https://github.com/henare/air_quality_monitor/issues/9

It's weird because I've seen the device drop off my WiFi completely but I've also observed it being connected to WiFi, uploading to a local IP address OK, but not uploading to a remote server using a DNS name.

I'd like some suggestions from others on this issue about what I can do to debug it further. Turning up the debug level and monitoring it over serial didn't reveal any insights (similar to @kristigu's comment above).

My next step is to connect it to my phone's WiFi to completely remove my home network's WiFi as a possible problem. However no other devices have a problem with my home WiFi so even if that tests OK I'd still say the device has a problem.

Thanks in advance for any help :bouquet:

michaelshmitty commented 6 years ago

Definitely check and / or test with different quality power supplies. High frequency noise, under voltage can cause unexpected behavior within these micro controllers.

Good you’re taking a methodical debug approach. Change only one parameter (power supply, other WiFi network, ...) at the time and test again. Otherwise you risk chasing ghosts. Good luck and let us know if you figure out what the problem was. Also keep in mind that the problem may be at the remote end or a combination of problems you have no control over.

Cheers!

On 11 Jul 2018, at 02:32, Henare Degan notifications@github.com wrote:

Hi everyone 👋 This is my first comment on this project - thanks so much for making it! 💞

I've recently built my first sensor and I've been having the same issue. You can see spotty little outages on the charts, e.g. https://www.madavi.de/sensor/graph.php?sensor=esp8266-818835-dht

I've been documenting the debugging process on this issue: henare/air_quality_monitor#9

It's weird because I've seen the device drop off my WiFi completely but I've also observed it being connected to WiFi, uploading to a local IP address OK, but not uploading to a remote server using a DNS name.

I'd like some suggestions from others on this issue about what I can do to debug it further. Turning up the debug level and monitoring it over serial didn't reveal any insights (similar to @kristigu's comment above).

My next step is to connect it to my phone's WiFi to completely remove my home network's WiFi as a possible problem. However no other devices have a problem with my home WiFi so even if that tests OK I'd still say the device has a problem.

Thanks in advance for any help 💐

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

dynand commented 5 years ago

Looks very familiar to my sensor. I notice that the data gets very spotty during the night but during daytime everything seems fine. I use an Apple power supply in the bike shed so environmental temperature might be a problem. I’ll put a USB Voltage and current monitor in the USBline to see if that gives any clues.

Just a suggestion: can we get a WiFi connection strength in graph at madavi.de? Just to see if that causes problems?

Would adding a condensator in let’s say mF range help stabilise the 5V and thus solve interference?

lodagro commented 5 years ago

@dynand Wifi signal strength is available at madavi

https://www.madavi.de/sensor/signal.php?sensor=esp8266-<esp-id>

dynand commented 5 years ago

Thanks! Found it at https://www.madavi.de/sensor/signal.php?sensor=esp8266-6893890

Gives me a clue wether the problem occurs in the sensor or in the 8266 or the connection

ricki-z commented 5 years ago

Can we close this issue?

kristigu commented 5 years ago

Yes, for me it's fine to close!

Kristi Gusho +32495157946 Drietorekenstraat 12, 9000 Gent, Ghent, Belgium

On Sun, Apr 28, 2019 at 4:03 AM Rajko Zschiegner notifications@github.com wrote:

Can we close this issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/opendata-stuttgart/sensors-software/issues/200#issuecomment-487334028, or mute the thread https://github.com/notifications/unsubscribe-auth/AJC3N47M7LGFY6HGT7HVPODPSUAXDANCNFSM4EZGBBYA .