Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Anyone importing data from WeeWX / weather station into EmonCMS? It's stopped working?

Tags: #<Tag:0x00007fe79e83fad0> #<Tag:0x00007fe79e83fa08> #<Tag:0x00007fe79e83f940>

I’ve used WeeWX to capture data from my weather station for many years, a couple of years ago I found the Weewx-emoncms plugin for WeeWX that sends the weather data over to EmonCMS using a http call. This has worked great for years, until sometime last week. When it broke without me noticing. Not sure what’s causing it, but it seems that EmonCMS is rejecting (or erroring on) the http call,

Feb 15 22:30:36 server7 python3[633267]: weewx[633267] DEBUG weewx.restx: EmonCMS: Failed upload attempt 2: Server returned ’
notice: undefined variable: jsondatalc in /var/www/emoncms/modules/input/input_methods.php on line 60

ok’
Feb 15 22:30:42 server7 python3[633267]: weewx[633267] DEBUG weewx.restx: EmonCMS: Failed upload attempt 3: Server returned ’
notice: undefined variable: jsondatalc in /var/www/emoncms/modules/input/input_methods.php on line 60

ok’
Feb 15 22:30:42 server7 python3[633267]: weewx[633267] ERROR weewx.restx: EmonCMS: Failed to publish record 2021-02-15 22:30:00 GMT (1613428200): Failed upload after 3 tries

Line 60 in the input_methods.php looks like this - unset($jsondataLC[‘time’]);
I can’t see jsondataLC mentioned anywhere else, but then I’m no Python expert!

The http call being made from the WeeWX server looks like this -

http://10.0.0.42:81/input/post.json?apikey=xxx&time=1613428200&node=31&json={dateTime:1613428200.0,inHumidity:58.0,outHumidity:89.0,pressure_mbar:1004.35,windSpeed_mps:1.0,windDir:213,windGust_mps:2,windGustDir:225.0,rain_mm:0.0,status:0.0,ptr:416.0,delay:20,rxCheckPercent:100.0,outTempBatteryStatus:0.0,rainTotal:98,altimeter_mbar:1015,appTemp_C:6.3,barometer_mbar:1015.40,beaufort_count:1.0,cloudbase_meter:302,dewpoint_C:6.1,heatindex_C:7.0,humidex_C:7.8,inDewpoint_C:11.8,rainRate_mm_per_hour:0.0,windchill_C:7.7,interval_minute:5.0,windrun_km:0.3,hourRain_mm:0.0,rain24_mm:0.0,dayRain_mm:0.0,usUnits:17.0}

Which seems OK to me, but then again I’m no expert. I didn’t see anything in the logs on EmonCMS.

Any ideas?

That is unexpected!

@TrystanLea I think it is best we remove this and look at it again.

Hi Brian,

Could you suggest an edit I can make to remove this line?
I’m guessing just ripping it out will have other consequences?

Lee

Just comment out that line. You will need to revert the change before you can do an update though.

Hello,

I have the same setup where weewx sends my VantagePro data to emoncms (15 minute archive).
For several weeks, maybe longer, I have noticed in the weewx log three failed attempts to send data from weewx to emoncms:

DEBUG weewx.restx: EmonCMS: Failed upload attempt 1: Server returned ‘
#012Notice: Undefined variable: jsondataLC in /var/www/emoncms/Modules/input/input_methods.php on line 60
#012ok

But in spite of this message, the data is still being sent correctly and on time. So, I haven’t worried about this until I saw this post.

I am not a programmer so I need some help on how to fix this. I can comment out the line but don’t understand what is meant by “You will need to revert the change before you can do an update though.” Does this mean that a full update will replace the modified version with the old one?
Sorry for the ignorant question but I want to be sure what I’m doing.

Thanks for the excellent graphing capabilities in emoncms–that’s why I export my weewx data to it.

Cheers,
Bob

Hi @bgrattan

No, I think @borpin is saying we will need to add the line back in before running an EmonCMS update, otherwise the update may break or not work correctly.

1 Like

I also should add that removing that line cleared up the errors that WeeWX was having sending data to EmonCMS. So that’s a win! :grinning:

1 Like