|
Post by triggerfish on Sept 19, 2018 22:32:36 GMT -8
All of a sudden, after the previous reboot this night, the weatherstation is not reporting to wunderground anymore --Sending Data to WeatherUnderground-- cws=| 4.56257146528 myURL= ID=IBADHOEV14&PASSWORD=XXXXXXX&dateutc=now&winddir=0&windspeedmph=2.85&humidity=78&tempf=65.84&dewptf=58.21&rainin=0.00&baromin=30.05&indoortempf=32.00&indoorhumidity0.00=&software=GroveWeatherPi --Sending Data to WeatherUnderground-- cws=| 4.56257146528 myURL= ID=IBADHOEV14&PASSWORD=XXXXXXXX&dateutc=now&winddir=0&windspeedmph=2.85&humidity=78&tempf=65.84&dewptf=58.21&rainin=0.00&baromin=30.05&indoortempf=32.00&indoorhumidity0.00=&software=GroveWeatherPi --WeatherUnderground Data Send Failed checking WLAN: ping_ret=0 WLAN_check_flg=0 WLAN is OK --WeatherUnderground Data Send Failed ('count of t=', 2340) ----------------- When I just take the url and paste it in my browser like: https://weatherstation.wunderground.com/weatherstation/updateweatherstation.php?ID=IBADHOEV14&PASSWORD=XXXXXXXX&dateutc=now&winddir=0&windspeedmph=2.85&humidity=78&tempf=65.84&dewptf=58.21&rainin=0.00&baromin=30.05&indoortempf=32.00&indoorhumidity0.00=&software=GroveWeatherPi I get a "success" page and some time later I am "reporting" again on wunderground. Until I stopped entering that url obviously. BTW, I did not do any of the planned hardening yet Any suggestions?
|
|
|
Post by triggerfish on Sept 19, 2018 22:41:43 GMT -8
Wait! I did change something in the code, that has worked for a while. I realize some specific situations can occur, so this is what I did:
Defined outsideTemperaturePrevious and outsideHumidityPrevious to save the last valid values around line 860.
# sample and display totalRain = 0 def sampleWeather():
global as3935LightningCount global as3935, as3935LastInterrupt, as3935LastDistance, as3935LastStatus global currentWindSpeed, currentWindGust, totalRain global bmp180Temperature, bmp180Pressure, bmp180Altitude, bmp180SeaLevel global outsideTemperature, outsideHumidity, crc_check global outsideTemperaturePrevious, outsideHumidityPrevious global currentWindDirection, currentWindDirectionVoltage global SunlightVisible, SunlightIR, SunlightUV, SunlightUVIndex Checked for validity around line 1040:
# always set message stale set to False since we have consumed it config.WXLink_Data_Fresh = False
try: print "--Sending Data to WeatherUnderground--" if ((outsideTemperature == 0) and (outsideHumidity == 0)): # On apparent error set previous values outsideTemperature = outsideTemperaturePrevious outsideHumidity = outsideHumidityPrevious else: # Save apparent correct settings outsideTemperaturePrevious = outsideTemperature outsideHumidityPrevious = outsideHumidity
WeatherUnderground.sendWeatherUndergroundData( as3935LightningCount, as3935, as3935LastInterrupt, as3935LastDistance, as3935LastStatus, currentWindSpeed, currentWindGust, totalRain, bmp180Temperature, bmp180SeaLevel, bmp180Altitude, bmp180SeaLevel, outsideTemperature, outsideHumidity, crc_check, currentWindDirection, currentWindDirectionVoltage, HTUtemperature, HTUhumidity, rain60Minutes) except: print "--WeatherUnderground Data Send Failed"
else: # set the Data to stale config.WXLink_Data_Fresh = False Could this cause the upload error somehow???
|
|
|
Post by triggerfish on Sept 20, 2018 11:08:21 GMT -8
Ok, home again, removed the code I added, rebooted and all is like it was. Uploading again, but the occasional 0 dip So the code was causing the problem, but I can not figure out why. I just wanted to save the last apparent valid values and use that when there were obvious wring values...
|
|
|
Post by SDL on Sept 20, 2018 13:41:14 GMT -8
Odds were the it did cause the problem. Check your indenting on the code you posted. It looks wrong.
BP
|
|
|
Post by triggerfish on Sept 21, 2018 9:05:32 GMT -8
Odds were the it did cause the problem. Check your indenting on the code you posted. It looks wrong. BP In vi the indentation "looked" fine. I redid the code, als added assigning a default value to the new variables. Station is running now and seems to give stable values. See how long it works.
|
|
|
Post by triggerfish on Sept 21, 2018 22:25:25 GMT -8
Odds were the it did cause the problem. Check your indenting on the code you posted. It looks wrong. BP In vi the indentation "looked" fine. I redid the code, als added assigning a default value to the new variables. Station is running now and seems to give stable values. See how long it works. Do you indent with spaces or with tabs btw? Mixing that seems to upset python also.
|
|