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 On Tue, Dec 31, 2024 at 7:47 AM [email protected] <[email protected]> wrote: > 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 > On Monday, December 30, 2024 at 10:28:30 PM UTC-5 vince wrote: > >> 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. >> >> On Monday, December 30, 2024 at 12:58:40 PM UTC-8 [email protected] wrote: >> >>> 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 >>> >>> >>> On Sunday, December 29, 2024 at 3:21:38 PM UTC-5 vince wrote: >>> >>>> Try it and see. >>>> >>>> On Sunday, December 29, 2024 at 11:58:42 AM UTC-8 [email protected] >>>> wrote: >>>> >>>>> 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 >>>>> >>>> -- > 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 [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/weewx-user/0dc773bd-347a-45ad-8a93-29c18e7694dan%40googlegroups.com > <https://groups.google.com/d/msgid/weewx-user/0dc773bd-347a-45ad-8a93-29c18e7694dan%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion visit https://groups.google.com/d/msgid/weewx-user/CAPq0zEBgUthnzxkwwhiUa6ocy2qPZ5X8_%2B2noOCkym0X4vSDHw%40mail.gmail.com.
