Thanks, driver seems good, (no complains at the logger anyway) On Saturday, 10 April 2021 at 12:48:20 UTC+1 [email protected] wrote:
> Too many years using Python 2, not enough on Python 3. Try this version of > ultimeter.py. > > On Sat, Apr 10, 2021 at 1:35 AM Chris Thompstone <[email protected]> > wrote: > >> So I manually deleted all the files from the remote ftp server to make it >> upload a fresh. >> it tries to ftp ALL files twice, but fails on the first NOAA txt file, >> the partial file from 2014-10 when station started up. >> because this fails (although I can see it on the ftp server), it tries a >> 2nd time to upload everything, then quits on this file again. >> the whole process takes 3 minutes to upload as it tries to upload >> everything (twice on every 5min cycle) because that 1 file fails. >> any ideas on a fix for this? >> >> On Saturday, 10 April 2021 at 08:51:23 UTC+1 Chris Thompstone wrote: >> >>> Also why when ftp happens 1 of the files gives this: >>> Uploaded file /var/www/daybarometer.png to /daybarometer.png >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> ftpgenerator: (2): caught exception '<class 'ftplib.error_perm'>': 553 >>> Prohibited directory name >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> **** Traceback (most recent call last): >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> **** File "/home/weewx/bin/weewx/reportengine.py", line 331, in run >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> **** n = ftp_data.run() >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> **** File "/home/weewx/bin/weeutil/ftpupload.py", line 154, in run >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> **** _make_remote_dir(ftp_server, remote_dir_path) >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> **** File "/home/weewx/bin/weeutil/ftpupload.py", line 269, in >>> _make_remote_dir >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> **** ftp_server.mkd(remote_dir_path) >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> **** File "/usr/lib/python3.7/ftplib.py", line 643, in mkd >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> **** resp = self.voidcmd('MKD ' + dirname) >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> **** File "/usr/lib/python3.7/ftplib.py", line 278, in voidcmd >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> **** return self.voidresp() >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> **** File "/usr/lib/python3.7/ftplib.py", line 251, in voidresp >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> **** resp = self.getresp() >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> **** File "/usr/lib/python3.7/ftplib.py", line 246, in getresp >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> **** raise error_perm(resp) >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> **** ftplib.error_perm: 553 Prohibited directory name >>> Apr 10 08:45:37 weewx weewx[5576] ERROR weewx.reportengine: >>> ftpgenerator: Upload failed >>> >>> the file seems to be on the ftp server (I tried deleting everything on >>> the ftp to see if it uploads it) >>> only happens for this 1 file. >>> I notice that all my files in /var/www that upload are set with root >>> permissions, does that have anything to do with it? >>> Not sure how to make weewx change set these to www-data permissions >>> >>> On Saturday, 10 April 2021 at 08:35:17 UTC+1 Chris Thompstone wrote: >>> >>>> Sorry it doesn't like that one: >>>> Apr 10 08:32:33 weewx weewx[5327] DEBUG weewx.drivers.ultimeter: Decode >>>> failed for 'b'----'': invalid literal for int() with base 16: b'----' >>>> it prefers mine, lol >>>> Chris >>>> >>>> On Friday, 9 April 2021 at 23:05:13 UTC+1 [email protected] wrote: >>>> >>>>> You had the right idea, but we have to be careful about values that >>>>> are encoded in only two bytes. >>>>> >>>>> Try this version. >>>>> >>>>> -tk >>>>> >>>>> On Fri, Apr 9, 2021 at 8:50 AM Chris Thompstone <[email protected]> >>>>> wrote: >>>>> >>>>>> Don't worry, I think I may have patched it. I'm not really much of a >>>>>> coder (although can do some stuff)... >>>>>> Modded your file. see line 345 onwards. >>>>>> See attached >>>>>> >>>>>> On Friday, 9 April 2021 at 16:36:35 UTC+1 [email protected] wrote: >>>>>> >>>>>>> Sorry. I’ll try to get an update out later today. >>>>>>> >>>>>>> On Fri, Apr 9, 2021 at 8:18 AM Chris Thompstone < >>>>>>> [email protected]> wrote: >>>>>>> >>>>>>>> >>>>>>>> just tried that and get: >>>>>>>> Apr 9 16:17:18 weewx weewx[1719] DEBUG weewx.drivers.ultimeter: >>>>>>>> Close serial port /dev/ttyUSB0 >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: Caught >>>>>>>> unrecoverable exception: >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> startswith first arg must be bytes or a tuple of bytes, not str >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> Traceback (most recent call last): >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> File "/home/weewx/bin/weewx/drivers/ultimeter.py", line 346, in _decode >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> v = int(s, 16) >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> ValueError: invalid literal for int() with base 16: b'----' >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> During handling of the above exception, another exception occurred: >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> Traceback (most recent call last): >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> File "/home/weewx/bin/weewxd", line 157, in main >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> engine.run() >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> File "/home/weewx/bin/weewx/engine.py", line 208, in run >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> for packet in self.console.genLoopPackets(): >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> File "/home/weewx/bin/weewx/drivers/ultimeter.py", line 132, in >>>>>>>> genLoopPackets >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> data = Station.parse_readings(readings) >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> File "/home/weewx/bin/weewx/drivers/ultimeter.py", line 317, in >>>>>>>> parse_readings >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> data['inHumidity'] = Station._decode(buf[28:32], 0.1) # percent >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> File "/home/weewx/bin/weewx/drivers/ultimeter.py", line 354, in _decode >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> if not s. startswith('--'): >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> TypeError: startswith first arg must be bytes or a tuple of bytes, not >>>>>>>> str >>>>>>>> Apr 9 16:17:19 weewx weewx[1719] CRITICAL __main__: **** >>>>>>>> Exiting. >>>>>>>> >>>>>>>> On Friday, 9 April 2021 at 16:03:24 UTC+1 [email protected] wrote: >>>>>>>> >>>>>>>>> The driver should work fine with Python 3. >>>>>>>>> >>>>>>>>> However, the driver has a small, non-functional bug that causes it >>>>>>>>> to emit that error message when it encounters a "dash" value. It's >>>>>>>>> non-functional because it emits the right value ("None"). It just >>>>>>>>> shouldn't >>>>>>>>> log an error. >>>>>>>>> >>>>>>>>> Try this version. I've taken the occasion of having a real, live >>>>>>>>> Ultimeter user to also fix some ambiguities around byte array types. >>>>>>>>> Let me >>>>>>>>> know if it works. >>>>>>>>> >>>>>>>>> -tk >>>>>>>>> >>>>>>>>> On Fri, Apr 9, 2021 at 7:26 AM Chris Thompstone < >>>>>>>>> [email protected]> wrote: >>>>>>>>> >>>>>>>>>> Oh, the ultimeter isn't supported on Python 3 and ver 4 weewx ? >>>>>>>>>> Is that what your saying? >>>>>>>>>> Oh, had not planned on that. >>>>>>>>>> I found some sort of error in my template, which I've kind of >>>>>>>>>> resolved. >>>>>>>>>> But the Ultimeter driver... not sure on this one. >>>>>>>>>> Thanks >>>>>>>>>> Chris >>>>>>>>>> >>>>>>>>>> On Friday, 9 April 2021 at 15:20:41 UTC+1 [email protected] >>>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>>> Looks like you switched to Python 3 from Python 2.7 and the >>>>>>>>>>> driver isn't compatible, based on the error message. >>>>>>>>>>> >>>>>>>>>>> On Fri, Apr 9, 2021 at 6:56 AM Chris Thompstone < >>>>>>>>>>> [email protected]> wrote: >>>>>>>>>>> >>>>>>>>>>>> Hi Guys, >>>>>>>>>>>> I have been trying to upgrade to version 4 since my Pi decided >>>>>>>>>>>> to throw a strop. >>>>>>>>>>>> Anyway, it's been fairly hardwork. >>>>>>>>>>>> >>>>>>>>>>>> I have this message continuous in the logs: >>>>>>>>>>>> DEBUG weewx.drivers.ultimeter: Decode failed for '----': >>>>>>>>>>>> invalid literal for int() with base 16: '----' >>>>>>>>>>>> just coming every 1s or so. >>>>>>>>>>>> >>>>>>>>>>>> I also have some other issue which I can't seem to find: >>>>>>>>>>>> ERROR weewx.cheetahgenerator: Generate failed with exception >>>>>>>>>>>> '<class 'TypeError'>' >>>>>>>>>>>> Apr 9 14:45:16 weewx weewx[868] ERROR weewx.cheetahgenerator: >>>>>>>>>>>> **** Ignoring template /home/weewx/skins/Standard/index.html.tmpl >>>>>>>>>>>> Apr 9 14:45:16 weewx weewx[868] ERROR weewx.cheetahgenerator: >>>>>>>>>>>> **** Reason: '>' not supported between instances of 'NoneType' and >>>>>>>>>>>> 'float' >>>>>>>>>>>> Apr 9 14:45:16 weewx weewx[868] ERROR weewx.cheetahgenerator: >>>>>>>>>>>> **** Traceback (most recent call last): >>>>>>>>>>>> Apr 9 14:45:16 weewx weewx[868] ERROR weewx.cheetahgenerator: >>>>>>>>>>>> **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line >>>>>>>>>>>> 326, in >>>>>>>>>>>> generate >>>>>>>>>>>> Apr 9 14:45:16 weewx weewx[868] ERROR weewx.cheetahgenerator: >>>>>>>>>>>> **** unicode_string = compiled_template.respond() >>>>>>>>>>>> Apr 9 14:45:16 weewx weewx[868] ERROR weewx.cheetahgenerator: >>>>>>>>>>>> **** File "_home_weewx_skins_Standard_index_html_tmpl.py", line >>>>>>>>>>>> 1378, in >>>>>>>>>>>> respond >>>>>>>>>>>> Apr 9 14:45:16 weewx weewx[868] ERROR weewx.cheetahgenerator: >>>>>>>>>>>> **** TypeError: '>' not supported between instances of 'NoneType' >>>>>>>>>>>> and >>>>>>>>>>>> 'float' >>>>>>>>>>>> >>>>>>>>>>>> My wind vein has blown off the roof, so wind direction and >>>>>>>>>>>> speed are probably both None. >>>>>>>>>>>> Whether this is something to do with it I don't know, but I >>>>>>>>>>>> can't get the index template generated. >>>>>>>>>>>> Thanks >>>>>>>>>>>> Chris >>>>>>>>>>>> >>>>>>>>>>>> -- >>>>>>>>>>>> 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 on the web visit >>>>>>>>>>>> https://groups.google.com/d/msgid/weewx-user/dd2cd2fd-515b-47b3-a8c5-cb1692508eb8n%40googlegroups.com >>>>>>>>>>>> >>>>>>>>>>>> <https://groups.google.com/d/msgid/weewx-user/dd2cd2fd-515b-47b3-a8c5-cb1692508eb8n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>>>>>>>> . >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>>> Peter Quinn >>>>>>>>>>> (415)794-2264 <(415)%20794-2264> >>>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> 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 on the web visit >>>>>>>>>> https://groups.google.com/d/msgid/weewx-user/c4ef6c55-ddee-4c9e-a7d6-23cc1f5beb2an%40googlegroups.com >>>>>>>>>> >>>>>>>>>> <https://groups.google.com/d/msgid/weewx-user/c4ef6c55-ddee-4c9e-a7d6-23cc1f5beb2an%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 on the web visit >>>>>>>> https://groups.google.com/d/msgid/weewx-user/1d9b03d2-037f-4519-88db-292d0dff8d76n%40googlegroups.com >>>>>>>> >>>>>>>> <https://groups.google.com/d/msgid/weewx-user/1d9b03d2-037f-4519-88db-292d0dff8d76n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>>>> . >>>>>>>> >>>>>>> -- >>>>>>> -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 [email protected]. >>>>>> >>>>> To view this discussion on the web visit >>>>>> https://groups.google.com/d/msgid/weewx-user/cfde7b17-3890-467f-a3ab-e612ae625facn%40googlegroups.com >>>>>> >>>>>> <https://groups.google.com/d/msgid/weewx-user/cfde7b17-3890-467f-a3ab-e612ae625facn%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 on the web visit >> https://groups.google.com/d/msgid/weewx-user/b8b762e9-298d-4228-99e0-cae912cc8404n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/weewx-user/b8b762e9-298d-4228-99e0-cae912cc8404n%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 on the web visit https://groups.google.com/d/msgid/weewx-user/67ed32ed-45aa-45bd-8a77-50f08f25d9b9n%40googlegroups.com.
