Weewx-emoncms on weewx 5.1

191 views
Skip to first unread message

bgra...@umw.edu

unread,
Dec 29, 2024, 2:58:42 PM12/29/24
to weewx-user
Hello,
With the exception of weewx-emoncms, I have moved everything (ubuntu weewx 4.10.1) to an RPI5 running weewx 5.1. Will this extension work on 5.1? It has been working fine 4.10.1 but I want to be sure I can move it. Thanks.
Cheers,
Bob

vince

unread,
Dec 29, 2024, 3:21:38 PM12/29/24
to weewx-user
Try it and see.

bgra...@umw.edu

unread,
Dec 30, 2024, 3:58:40 PM12/30/24
to weewx-user
Hi Vince,
Ok, I tried and got errors so something may have changed I need to correct.

This was running correctly on weewx 4.10.2 (Ubuntu latest). I downloaded the zip file and installed the extension with weectl extension install.
```
(weewx-venv) bg@RPI5:~/weewx-data $ weectl extension list
Using configuration file /home/bg/weewx-data/weewx.conf
Extension Name    Version   Description
MQTTSubscribe     3.0.0-rc08Source WeeWX data from MQTT.
emoncms           0.17      Upload weather data to EmonCMS.
```
I copied the following from my old weewx.conf:
```
[[EmonCMS]]
        url = http://192.168.1.174/emoncms/input/post.json    
        token = 3bff2182121fbefca8f0c5d0cxxxxxx
        prefix = weather
```
The following is a section from weewx.log at the 15 minute archival time:

```
Dec 30 15:30:15 RPI5 weewxd[2112056]: INFO weewx.manager: Added record 2024-12-30 15:30:00 EST (1735590600) to database 'weewx.sdb'
Dec 30 15:30:15 RPI5 weewxd[2112056]: INFO weewx.manager: Added record 2024-12-30 15:30:00 EST (1735590600) to daily summary in 'weewx.sdb'
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: EmonCMS: Unexpected exception of type <class 'UnicodeEncodeError'>
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: *** Traceback (most recent call last):
Dec 30 15:30:15 RPI5 python3[2112056]: Exception in thread EmonCMS:
Dec 30 15:30:15 RPI5 python3[2112056]: Traceback (most recent call last):
Dec 30 15:30:15 RPI5 python3[2112056]:   File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
Dec 30 15:30:15 RPI5 python3[2112056]:     self.run()
Dec 30 15:30:15 RPI5 python3[2112056]:   File "/home/bg/weewx-venv/lib/python3.11/site-packages/weewx/restx.py", line 357, in run
Dec 30 15:30:15 RPI5 python3[2112056]:     self.run_loop(_manager)
Dec 30 15:30:15 RPI5 python3[2112056]:   File "/home/bg/weewx-venv/lib/python3.11/site-packages/weewx/restx.py", line 384, in run_loop
Dec 30 15:30:15 RPI5 python3[2112056]:     self.process_record(_record, dbmanager)
Dec 30 15:30:15 RPI5 python3[2112056]:   File "/home/bg/weewx-data/bin/user/emoncms.py", line 288, in process_record
Dec 30 15:30:15 RPI5 python3[2112056]:     self.post_with_retries(req)
Dec 30 15:30:15 RPI5 python3[2112056]:   File "/home/bg/weewx-venv/lib/python3.11/site-packages/weewx/restx.py", line 482, in post_with_retries
Dec 30 15:30:15 RPI5 python3[2112056]:     _response = self.post_request(request, data)
Dec 30 15:30:15 RPI5 python3[2112056]:                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 30 15:30:15 RPI5 python3[2112056]:   File "/home/bg/weewx-venv/lib/python3.11/site-packages/weewx/restx.py", line 553, in post_request
Dec 30 15:30:15 RPI5 python3[2112056]:     _response = urllib.request.urlopen(request, data=data, timeout=self.timeout)
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***   File "/home/bg/weewx-venv/lib/python3.11/site-packages/weewx/restx.py", line 384, in run_loop
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***     self.process_record(_record, dbmanager)
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***   File "/home/bg/weewx-data/bin/user/emoncms.py", line 288, in process_record
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***     self.post_with_retries(req)
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***   File "/home/bg/weewx-venv/lib/python3.11/site-packages/weewx/restx.py", line 482, in post_with_retries
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***     _response = self.post_request(request, data)
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***   File "/home/bg/weewx-venv/lib/python3.11/site-packages/weewx/restx.py", line 553, in post_request
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***     _response = urllib.request.urlopen(request, data=data, timeout=self.timeout)
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***   File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***     return opener.open(url, data, timeout)
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***   File "/usr/lib/python3.11/urllib/request.py", line 519, in open
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***     response = self._open(req, data)
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***                ^^^^^^^^^^^^^^^^^^^^^
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***   File "/usr/lib/python3.11/urllib/request.py", line 536, in _open
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***     result = self._call_chain(self.handle_open, protocol, protocol +
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***   File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***     result = func(*args)
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***              ^^^^^^^^^^^
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***   File "/usr/lib/python3.11/urllib/request.py", line 1377, in http_open
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***     return self.do_open(http.client.HTTPConnection, req)
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***   File "/usr/lib/python3.11/urllib/request.py", line 1348, in do_open
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***     h.request(req.get_method(), req.selector, req.data, headers,
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***   File "/usr/lib/python3.11/http/client.py", line 1282, in request
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***     self._send_request(method, url, body, headers, encode_chunked)
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***   File "/usr/lib/python3.11/http/client.py", line 1293, in _send_request
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***     self.putrequest(method, url, **skips)
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***   File "/usr/lib/python3.11/http/client.py", line 1131, in putrequest
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***     self._output(self._encode_request(request))
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***   File "/usr/lib/python3.11/http/client.py", line 1211, in _encode_request
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***     return request.encode('ascii')
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: ***            ^^^^^^^^^^^^^^^^^^^^^^^
Dec 30 15:30:15 RPI5 python3[2112056]:                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 30 15:30:15 RPI5 python3[2112056]:   File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen
Dec 30 15:30:15 RPI5 weewxd[2112056]: ERROR weewx.restx: *** UnicodeEncodeError: 'ascii' codec can't encode character '\xb5' in position 926: ordinal not in range(128)
Dec 30 15:30:15 RPI5 weewxd[2112056]: CRITICAL weewx.restx: EmonCMS: Thread terminating. Reason: 'ascii' codec can't encode character '\xb5' in position 926: ordinal not in range(128)
Dec 30 15:30:15 RPI5 python3[2112056]:     return opener.open(url, data, timeout)
Dec 30 15:30:15 RPI5 python3[2112056]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 30 15:30:15 RPI5 python3[2112056]:   File "/usr/lib/python3.11/urllib/request.py", line 519, in open
Dec 30 15:30:15 RPI5 python3[2112056]:     response = self._open(req, data)
Dec 30 15:30:15 RPI5 python3[2112056]:                ^^^^^^^^^^^^^^^^^^^^^
Dec 30 15:30:15 RPI5 python3[2112056]:   File "/usr/lib/python3.11/urllib/request.py", line 536, in _open
Dec 30 15:30:15 RPI5 python3[2112056]:     result = self._call_chain(self.handle_open, protocol, protocol +
Dec 30 15:30:15 RPI5 python3[2112056]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 30 15:30:15 RPI5 python3[2112056]:   File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain
Dec 30 15:30:15 RPI5 python3[2112056]:     result = func(*args)
Dec 30 15:30:15 RPI5 python3[2112056]:              ^^^^^^^^^^^
Dec 30 15:30:15 RPI5 python3[2112056]:   File "/usr/lib/python3.11/urllib/request.py", line 1377, in http_open
Dec 30 15:30:15 RPI5 python3[2112056]:     return self.do_open(http.client.HTTPConnection, req)
Dec 30 15:30:15 RPI5 python3[2112056]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 30 15:30:15 RPI5 python3[2112056]:   File "/usr/lib/python3.11/urllib/request.py", line 1348, in do_open
Dec 30 15:30:15 RPI5 python3[2112056]:     h.request(req.get_method(), req.selector, req.data, headers,
Dec 30 15:30:15 RPI5 python3[2112056]:   File "/usr/lib/python3.11/http/client.py", line 1282, in request
Dec 30 15:30:15 RPI5 python3[2112056]:     self._send_request(method, url, body, headers, encode_chunked)
Dec 30 15:30:15 RPI5 python3[2112056]:   File "/usr/lib/python3.11/http/client.py", line 1293, in _send_request
Dec 30 15:30:15 RPI5 python3[2112056]:     self.putrequest(method, url, **skips)
Dec 30 15:30:15 RPI5 python3[2112056]:   File "/usr/lib/python3.11/http/client.py", line 1131, in putrequest
Dec 30 15:30:15 RPI5 python3[2112056]:     self._output(self._encode_request(request))
Dec 30 15:30:15 RPI5 python3[2112056]:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 30 15:30:15 RPI5 python3[2112056]:   File "/usr/lib/python3.11/http/client.py", line 1211, in _encode_request
Dec 30 15:30:15 RPI5 python3[2112056]:     return request.encode('ascii')
Dec 30 15:30:15 RPI5 python3[2112056]:            ^^^^^^^^^^^^^^^^^^^^^^^
Dec 30 15:30:15 RPI5 python3[2112056]: UnicodeEncodeError: 'ascii' codec can't encode character '\xb5' in position 926: ordinal not in range(128)
Dec 30 15:30:15 RPI5 weewxd[2112056]: INFO weewx.restx: Wunderground-PWS: Published record 2024-12-30 15:30:00 EST (1735590600)
Dec 30 15:30:16 RPI5 weewxd[2112056]: INFO weewx.restx: PWSWeather: Published record 2024-12-30 15:30:00 EST (1735590600)
Dec 30 15:30:16 RPI5 weewxd[2112056]: ERROR weewx.cheetahgenerator: Evaluation of template /home/bg/weewx-data/skins/Standard/smartphone/radar.html.tmpl failed.
Dec 30 15:30:16 RPI5 weewxd[2112056]: ERROR weewx.cheetahgenerator: **** Ignoring template /home/bg/weewx-data/skins/Standard/smartphone/radar.html.tmpl
Dec 30 15:30:16 RPI5 weewxd[2112056]: ERROR weewx.cheetahgenerator: **** Reason: cannot find 'radar_url' while searching for 'Extras.radar_url'
Dec 30 15:30:16 RPI5 weewxd[2112056]: ERROR weewx.cheetahgenerator: **** To debug, try inserting '#errorCatcher Echo' at top of template
Dec 30 15:30:16 RPI5 weewxd[2112056]: INFO weewx.cheetahgenerator: Generated 12 files for report StandardReport in 0.73 seconds
Dec 30 15:30:16 RPI5 weewxd[2112056]: INFO weewx.imagegenerator: Generated 21 images for report StandardReport in 0.47 seconds
Dec 30 15:30:16 RPI5 weewxd[2112056]: INFO weewx.reportengine: Copied 14 files to /home/bg/weewx-data/public_html
Dec 30 15:30:16 RPI5 weewxd[2112056]: INFO weewx.cheetahgenerator: Generated 1 files for report LoopDataReport in 0.03 seconds
Dec 30 15:30:16 RPI5 weewxd[2112056]: INFO weewx.reportengine: Copied 1 files to /home/bg/weewx-data/public_html/loopdata
Dec 30 15:30:16 RPI5 weewxd[2112056]: INFO weewx.cheetahgenerator: Generated 1 files for report lastrain in 0.03 seconds
Dec 30 15:30:17 RPI5 weewxd[2112056]: INFO weewx.restx: CWOP: Published record 2024-12-30 15:30:00 EST (1735590600)
Dec 30 15:30:17 RPI5 weewxd[2112056]: INFO weewx.cheetahgenerator: Generated 2 files for report wxobs in 0.30 seconds
Dec 30 15:30:17 RPI5 weewxd[2112056]: INFO weewx.reportengine: Copied 6 files to /home/bg/weewx-data/public_html/wxobs
Dec 30 15:30:17 RPI5 weewxd[2112056]: INFO weewx.cheetahgenerator: Generated 1 files for report PurpleReport in 0.01 seconds
Dec 30 15:30:17 RPI5 weewxd[2112056]: INFO weewx.imagegenerator: Generated 2 images for report PurpleReport in 0.03 seconds
Dec 30 15:30:17 RPI5 weewxd[2112056]: INFO weewx.restx: AWEKAS: Published record 2024-12-30 15:30:00 EST (1735590600)
Dec 30 15:30:23 RPI5 weewxd[2112056]: INFO weewx.restx: WOW: Published record 2024-12-30 15:30:00 EST (1735590600)
Dec 30 15:30:37 RPI5 weewxd[2112056]: INFO weewx.reportengine: ftpgenerator: Ftp'd 34 files in 20.35 seconds
Dec 30 15:30:57 RPI5 weewxd[2112056]: ERROR weewx.restx: StationRegistry: Failed to publish record 2024-12-30 15:30:00 EST (1735590600): HTTP Error 429: TOO MANY REQUESTS
```
Thanks for any suggestions.
Cheers,
Bob

vince

unread,
Dec 30, 2024, 10:28:30 PM12/30/24
to weewx-user
Try setting debug=2, restart weewx, and look for log entries with the string "url:" in it which should be logged.   

Only other thing I can think of is whether you correctly added the [[EmonCMS]] stanza within the [StdRESTful] contents, or possibly have a typo in the url you're trying to post to.  Hopefully you've checked that your weewx system can reach the url you posted above in this thread and that the server side answers to begin with.

Other than than that, I'm out of ideas on this one.  I'm finding the extension code very hard to decipher vs. your log snippet.

bgra...@umw.edu

unread,
Dec 31, 2024, 10:47:50 AM12/31/24
to weewx-user
Vince,
I checked  the [[EmonCMS]] stanza within the [StdRESTful] and all seems ok. I have attached two files. weewx.log.test.txt is the complete log (debug=2) showing an archive period activity.
weewx.log.emoncms.txt shows a section where it looks as if it's sending data to emoncms (192.168.1.174 on the same WAN). I have noted an error regarding the  Greek "mu" character which it doesn't seem to like. I got this before with the Ubuntu weewx (4.10.2) but it posted the data to emoncms just the same. Could there be something in weewx 5.1 that is refusing the data because of this non-ascii character? 
 
UnicodeEncodeError: 'ascii' codec can't encode character '\xb5' in position 904: ordinal not in range(128)
Dec 31 10:00:15 RPI5 weewxd[2297446]: CRITICAL weewx.restx: EmonCMS: Thread terminating. Reason: 'ascii' codec can't encode character '\xb5' in position 904: ordinal not in range(128)

Thanks for your help and best wishes for the New Year!
Cheers,
Bob
weewx.log.emoncms.txt
weewx.log.test.txt

Tom Keffer

unread,
Dec 31, 2024, 10:58:55 AM12/31/24
to weewx...@googlegroups.com
If I'm reading the debug=2 log correctly, it looks like it's trying an HTTP GET with a JSON structure in the URL itself:

http://192.168.1.174/emoncms/input/post.json?apikey=XXX&time=1735657200.0&node=0&json={weather_dateTime:1735657200.0,weather_usUnits:1.0, ...etc... }

Those braces should be escaped in the URL. Or, even better, use a POST statement and put the JSON structure in the request body.

It's also possible I'm misinterpreting what's there!

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/weewx-user/0dc773bd-347a-45ad-8a93-29c18e7694dan%40googlegroups.com.

vince

unread,
Dec 31, 2024, 1:41:52 PM12/31/24
to weewx-user
No idea if this will help somebody else debug this one, but on a mac mini running current macos sequoia, it doesn't throw errors to a bogus url location that has nothing there to listen to the post request.

2024-12-31 10:26:14 weewxd[22405]: DEBUG weewx.restx: EmonCMS url: 'http://192.168.1.171/emocms/input/post.json?apikey=mytokenhere&time=1735669200&node=0&json={weather_dateTime:1735669200.0,weather_usUnits:1.0,weather_outTemp_F:32.0006334505517,weather_inTemp_F:63.01324834203465,weather_barometer_inHg:31.0993373568215,weather_pressure_inHg:31.0993373568215,weather_windSpeed_mph:0.003313215892505128,weather_windDir:359.87717728132714,weather_windGust_mph:0.005210619290453522,weather_windGustDir:359.8436814212864,weather_outHumidity:79.980120704645,weather_inHumidity:29.973503315930706,weather_radiation_Wpm2:812.8234758335742,weather_UV:11.379528661670046,weather_rain_in:0.0,weather_txBatteryStatus:1.0,weather_windBatteryStatus:0.0,weather_rainBatteryStatus:0.0,weather_outTempBatteryStatus:0.7833333333333333,weather_inTempBatteryStatus:0.0,weather_consBatteryVoltage_volt:12.0,weather_heatingVoltage_volt:11.979658073065167,weather_supplyVoltage_volt:12.083808802074486,weather_referenceVoltage_volt:11.986610424356146,weather_rxCheckPercent:64.90681520527163,weather_altimeter_inHg:31.10217018274096,weather_appTemp_F:27.69922305393938,weather_cloudbase_foot:1241.778124269017,weather_dewpoint_F:26.536809703768032,weather_ET_in:0.0,weather_heatindex_F:32.0006334505517,weather_humidex_F:32.0006334505517,weather_inDewpoint_F:31.069205486578824,weather_maxSolarRad_Wpm2:0.0,weather_rainRate_inch_per_hour:0.0,weather_windchill_F:32.0006334505517,weather_windrun_mile:0.00027610132437542735,weather_interval_minute:5.0,weather_hourRain_in:0.0,weather_rain24_in:0.0,weather_dayRain_in:0.0}'

I did notice that Bob's log snippet did 'not' have the single quotes around the url that was logged and the token looks obfuscated.  Interestingly mine above that was logged had my fake token there verbatim.

Dec 31 10:00:15 RPI5 weewxd[2297446]: DEBUG user.emoncms: url: http://192.168.1.174/emoncms/input/post.json?apikey=XXX&time=1735657200.0&node=0&json={weather_dateTime:1735657200.0,weather_usUnits:1.0,weather_interval_minute:15.0,weather_rxCheckPercent:96.52083333333333,weather_outTemp_F:48.4,weather_highOutTemp_F:48.4,weather_lowOutTemp_F:45.3,weather_rain_in:0.0,weather_rainRate_inch_per_hour:0.0,weather_barometer_inHg:29.842,weather_radiation_Wpm2:180.0,weather_wind_samples:339.0,weather_inTemp_F:76.4,weather_inHumidity:31.0,weather_outHumidity:90.0,weather_windSpeed_mph:2.0,weather_windGust_mph:10.0,weather_windGustDir:0.0,weather_windDir:0.0,weather_UV:0.2,weather_ET_in:0.002,weather_highRadiation:257.0,weather_highUV:0.6,weather_forecastRule:45.0,weather_leafTemp1_F:51.0,weather_leafTemp2_F:74.0,weather_soilTemp1_F:51.0,weather_soilTemp2_F:74.0,weather_soilTemp4_F:52.0,weather_extraTemp1_F:61.0,weather_signal1_cpm:13.0,weather_signal2_??Sv:0.07500000000000001,weather_extraTemp6_F:55.85,weather_pressure_inHg:29.61099854624957,weather_altimeter_inHg:29.839532373389698,weather_appTemp_F:46.247784786074845,weather_cloudbase_foot:845.5697143376447,weather_dewpoint_F:45.60349325691436,weather_heatindex_F:47.17,weather_humidex_F:48.82204783548069,weather_inDewpoint_F:43.51152058233191,weather_maxSolarRad_Wpm2:287.78108246176845,weather_windchill_F:48.4,weather_windrun_mile:0.5,weather_windSpeed10_mph:2.0,weather_stormRain_in:0.0,weather_dayRain_in:0.0,weather_monthRain_in:1.73,weather_yearRain_in:43.46,weather_dayET:0.0,weather_monthET:0.84,weather_yearET:23.91,weather_insideAlarm:0.0,weather_rainAlarm:0.0,weather_outsideAlarm1:0.0,weather_outsideAlarm2:0.0,weather_extraAlarm1:0.0,weather_extraAlarm2:0.0,weather_extraAlarm3:0.0,weather_extraAlarm4:0.0,weather_extraAlarm5:0.0,weather_extraAlarm6:0.0,weather_extraAlarm7:0.0,weather_extraAlarm8:0.0,weather_soilLeafAlarm1:0.0,weather_soilLeafAlarm2:0.0,weather_soilLeafAlarm3:0.0,weather_soilLeafAlarm4:0.0,weather_txBatteryStatus:0.0,weather_consBatteryVoltage_volt:4.54,weather_forecastIcon:6.0,weather_sunrise:1735651500.0,weather_sunset:1735686060.0,weather_pm1_0_microgram_per_meter_cubed:8.313559999999981,weather_pm2_5_microgram_per_meter_cubed:5.636224000000019,weather_pm10_0_microgram_per_meter_cubed:12.72895999999996,weather_pm2_5_aqi_aqi:23.232,weather_pm2_5_aqi_color_aqi_color:32768.0,weather_hourRain_in:0.0,weather_rain24_in:0.0}

I can't speculate on why the stuff before the url: data differs so much between the two systems.  FWIW, I installed mine on the mac in a venv via:


I did add the recommended macos logging stanza to weewx.conf, if that matters...

[Logging]

    [[root]]
        handlers = timed_rotate,

    [[handlers]]
        [[[timed_rotate]]]
            level = DEBUG
            formatter = verbose
            class = logging.handlers.TimedRotatingFileHandler
            filename = log/{process_name}.log
            when = midnight
            backupCount = 7

bgra...@umw.edu

unread,
Dec 31, 2024, 1:59:43 PM12/31/24
to weewx-user
Thanks, Tom, I "sort of" understand what you are saying but have no idea how to do what you suggest. Sorry but I'm not a programmer. I'm using the same emoncms extension (0.17) as I have been running for 8 years on ubuntu weewx 4.10.2 with no problems (it was running up until 4 days ago) and posting correctly (node 0) to my emoncms server. All of this is done on the same LAN. 
I tried limiting the data from weewx to emoncms to 2 items to see if that helped anything:

 [[EmonCMS]]
        token = 3bff2182121fbefca8f0xxxxxxxxxxxx
        prefix = weather
        server_url = http://192.168.1.174/emoncms/input/post.json
        [[[inputs]]]
            [[[[barometer]]]]
                units = inHg
                name = barometer_inHg
                format = %.3f
            [[[[outTemp]]]]
                units = degree_F
                name = outTemp_F
                format = %.1f

Still having problems. I am posting a debug=2 output in the attached file .
Thanks.
Cheers,
Bob
weewx.log.emoncms1.txt

bell...@gmail.com

unread,
Dec 31, 2024, 4:31:41 PM12/31/24
to weewx-user

Bob,
At the risk of adding another cook… I do think you are on to something with µ character. If I am understanding the code correctly, you have a few options to try.
1. If you want to continue down the path you started, along with adding the [[[inputs]] section try adding ‘obs_to_upload = none’. So you would have something like this:

[[EmonCMS]]
        token = 3bff2182121fbefca8f0xxxxxxxxxxxx
        prefix = weather
        server_url = http://192.168.1.174/emoncms/input/post.json
        obs_to_upload = none

        [[[inputs]]]
            [[[[barometer]]]]
                units = inHg
                name = barometer_inHg
                format = %.3f
            [[[[outTemp]]]]
                units = degree_F
                name = outTemp_F
                format = %.1f

   2. Try setting ‘append_units_label = false’. This will change the data being uploaded, so it will probably break the processing on the server. But it should get past the upload error.

[[EmonCMS]]
        token = 3bff2182121fbefca8f0xxxxxxxxxxxx
        prefix = weather
        server_url = http://192.168.1.174/emoncms/input/post.json
        append_units_label = false

   3. You could try overriding the ‘weather_signal2’ observation (I think that is the one with the µ in the units). This is the one I am least sure of, but probably ultimately what you will want to do. It would be something like this

[[EmonCMS]]
        token = 3bff2182121fbefca8f0xxxxxxxxxxxx
        prefix = weather
        server_url = http://192.168.1.174/emoncms/input/post.json
        obs_to_upload = none
        [[[inputs]]]
            [[[[weather_signal2]]]]
                name = weather_signal2
 
All of these are based on reqding the code, so I am not 100% sure. If you try one and it doesn’t work, post the log with debug set. It should at least provide some more information.

As to why it stopped working. My GUESS is that when you upgraded WeeWX you also upgraded Python. This resulted in one of the libraries being updated...
rich

bell...@gmail.com

unread,
Dec 31, 2024, 4:34:40 PM12/31/24
to weewx-user
Whoops, option 3 should not have 'obs_to_upload = none'. It should be

[[EmonCMS]]
        token = 3bff2182121fbefca8f0xxxxxxxxxxxx
        prefix = weather
        server_url = http://192.168.1.174/emoncms/input/post.json
        [[[inputs]]]
            [[[[weather_signal2]]]]
                name = weather_signal2

Just trying to override the name for weather_signal2.
rich

vince

unread,
Dec 31, 2024, 4:47:35 PM12/31/24
to weewx-user
Signal2 in the logged url has a value of ?? if that matters, but I lean toward the missing quotes being somehow significant

bell...@gmail.com

unread,
Dec 31, 2024, 4:57:46 PM12/31/24
to weewx-user

In one of the log files I see, weather_signal2_µSv:0.07500000000000001

The log also states,
Dec 31 10:00:15 RPI5 weewxd[2297446]: CRITICAL weewx.restx: EmonCMS: Thread terminating. Reason: 'ascii' codec can't encode character '\xb5' in position 904: ordinal not in range(128)

The hex value for µ is x’00b5’.

My guess is the log file showing the ?? attempted to convert from utf-8 to ascii…. Not sure where that happend, cut and paste, copy, etc...
rich

bgra...@umw.edu

unread,
Jan 1, 2025, 11:02:53 AM1/1/25
to weewx-user
OK, thanks to everyone who contributed to my problem. The winner is:

[[EmonCMS]]
        token = xxxxxx

        prefix = weather
        server_url = http://192.168.1.174/emoncms/input/post.json
        obs_to_upload = none
        [[[inputs]]]
            [[[[barometer]]]]
                units = inHg
                name = barometer_inHg
                format = %.3f
            [[[[outTemp]]]]
                units = degree_F
                name = outTemp_F
                format = %.1f

This was #1 in Rich's suggestions to try. It seems to have avoided the "µ" problem that was causing the transfer to emoncms to stop. It was working in 4.10.2 (ubuntu) so something must have changed in Bookworm (RPI5) that it didn't like.

Much appreciated to all and best wishes for this new year. I'm off to a good start!

Cheers,
Bob



bell...@gmail.com

unread,
Jan 1, 2025, 11:26:02 AM1/1/25
to weewx-user
Bob,
If I am understanding the code correctly,  you could set ‘obs_to_upload’ to any value except ‘all’ (or any variation of its capitalization). I picked ‘none’ because it ‘reads’ well.
Also, you might be able to slightly simplify your configuration settings. I believe that the values for ‘units’, ‘name’ and ‘format’ override the defaults for these. So something like the following would only upload barometer and outTemp with the default values for ‘units’, ‘name’ and ‘format’.


[[EmonCMS]]
        token = xxxxxx
        prefix = weather
        server_url = http://192.168.1.174/emoncms/input/post.json
        obs_to_upload = none
        [[[inputs]]]
            [[[[barometer]]]]
            [[[[outTemp]]]]

Again, all of this based on reading the code. I have never tried this extension.
rich
Reply all
Reply to author
Forward
0 new messages