Thanks Tom, that driver seems to work OK.

Though now I faced another issue, it looks like the WXT510 is emitting NMEA
strings which the driver is not capable of yet ;(

Oct 13 12:38:49 PusulaServer weewx[1561] DEBUG user.wxt5x0-python3: raw: 24
57 49 58 44 52 2C 41 2C 32 34 32 2C 44 2C 31 2C 41 2C 32 39 33 2C 44 2C 32
2C 53 2C 33 2E 30 2C 53 2C
 31 2C 53 2C 35 2E 32 2C 53 2C 32 2C 43 2C 34 38 2E 39 2C 46 2C 30 2C 48 2C
37 39 2E 37 2C 50 2C 30 2C 50 2C 32 39 2E 37 37 2C 49 2C 30 2C 56 2C 34 2E
30 31 30 2C 49 2C 30 2C 5A
 2C 31 34 36 30 38 2C 73 2C 30 2C 52 2C 30 2E 30 30 2C 49 2C 30 2C 56 2C 30
2C 49 2C 31 2C 5A 2C 30 2C 73 2C 31 2C 52 2C 30 2C 49 2C 31 2C 52 2C 32 2E
37 37 2C 49 2C 32 2C 52 2C
 30 2C 49 2C 33 2C 43 2C 34 38 2E 35 2C 46 2C 32 2C 55 2C 31 33 2E 30 2C 4E
2C 30 2C 55 2C 31 33 2E 35 2C 56 2C 31 2C 55 2C 33 2E 35 32 33 2C 56 2C 32
2A 37 33 0D 0A
Oct 13 12:38:49 PusulaServer weewx[1561] DEBUG user.wxt5x0-python3: parsed:
{}
Oct 13 12:38:49 PusulaServer weewx[1561] DEBUG user.wxt5x0-python3: mapped:
{}

The hex string decodes to an apparent NMEA message of
$WIXDR,A,247,D,1,A,295,D,2,S,3.7,S,1,S,6.5,S,2,C,48.9,F,0,H,79.5,P,0,P,29.77,I,0,V,4.010,I,0,Z,14608,s,0,R,0.00,I,0,V,0,I,1,Z,0,s,1,R,0,I,1,R,2.77,I,2,R,0,I,3,C,48.2,F,2,U,13.9,N,0,U,13.5,V,1,U,3.525,V,2*79

When reconfiguring weewx for NMEA, I get this;
Oct 13 12:39:50 PusulaServer weewx[1691] ERROR weewx.engine: Import of
driver failed: NMEA support not implemented (<class 'NotImplementedError'>)
Oct 13 12:39:50 PusulaServer weewx[1691] CRITICAL weewx.engine:     ****
 Traceback (most recent call last):
Oct 13 12:39:50 PusulaServer weewx[1691] CRITICAL weewx.engine:     ****
 File "/usr/share/weewx/weewx/engine.py", line 103, in setupStation
Oct 13 12:39:50 PusulaServer weewx[1691] CRITICAL weewx.engine:     ****
   self.console = loader_function(config_dict, self)
Oct 13 12:39:50 PusulaServer weewx[1691] CRITICAL weewx.engine:     ****
 File "/usr/share/weewx/user/wxt5x0-python3.py", line 108, in loader
Oct 13 12:39:50 PusulaServer weewx[1691] CRITICAL weewx.engine:     ****
   return WXT5x0Driver(**config_dict[DRIVER_NAME])
Oct 13 12:39:50 PusulaServer weewx[1691] CRITICAL weewx.engine:     ****
 File "/usr/share/weewx/user/wxt5x0-python3.py", line 483, in __init__
Oct 13 12:39:50 PusulaServer weewx[1691] CRITICAL weewx.engine:     ****
   self._station = WXT5x0Driver.STATION.get(protocol)(address, port, baud)
Oct 13 12:39:50 PusulaServer weewx[1691] CRITICAL weewx.engine:     ****
 File "/usr/share/weewx/user/wxt5x0-python3.py", line 392, in __init__
Oct 13 12:39:50 PusulaServer weewx[1691] CRITICAL weewx.engine:     ****
   raise NotImplementedError("NMEA support not implemented")
Oct 13 12:39:50 PusulaServer weewx[1691] CRITICAL weewx.engine:     ****
 NotImplementedError: NMEA support not implemented
Oct 13 12:39:50 PusulaServer weewx[1691] CRITICAL __main__: Unable to load
driver: NMEA support not implemented
Oct 13 12:39:50 PusulaServer weewx[1691] CRITICAL __main__:     ****
 Exiting...

So I think I need to take the WXT510 down from the roof and reconfigure it
for serial data using the service port. It does need cleaning anyway :)

..
Erik



On Mon, 12 Oct 2020 at 16:57, Tom Keffer <[email protected]> wrote:

> Try this version of wxt5x0.py
>
>
>
> On Mon, Oct 12, 2020 at 6:01 AM Tom Keffer <[email protected]> wrote:
>
>> It's definitely the driver. It looks like Matthew never finished the port
>> to Python 3.
>>
>> On Mon, Oct 12, 2020 at 2:36 AM Erik Finskas <[email protected]> wrote:
>>
>>> Hi all.
>>>
>>> Followed up this thread to fix the WXT5x0 driver from GitHub and got bit
>>> forward but got jammed to another issue, apparently something to do with
>>> python3 (?)
>>> Running Ubuntu server 20.04.1 LTS
>>>
>>> Startup log looks like this;
>>> Oct 12 12:30:51 PusulaServer systemd[1]: Starting LSB: weewx weather
>>> system...
>>> Oct 12 12:30:51 PusulaServer weewx[4672]:  * Starting weewx weather
>>> system weewx
>>> Oct 12 12:30:51 PusulaServer weewx[4684] INFO __main__: Initializing
>>> weewx version 4.1.1
>>> Oct 12 12:30:51 PusulaServer weewx[4684] INFO __main__: Using Python
>>> 3.8.5 (default, Jul 28 2020, 12:59:40) #012[GCC 9.3.0]
>>> Oct 12 12:30:51 PusulaServer weewx[4684] INFO __main__: Platform
>>> Linux-5.4.0-48-generic-x86_64-with-glibc2.29
>>> Oct 12 12:30:51 PusulaServer weewx[4684] INFO __main__: Locale is
>>> 'en_US.UTF-8'
>>> Oct 12 12:30:51 PusulaServer weewx[4684] INFO __main__: PID file is
>>> /var/run/weewx.pid
>>> Oct 12 12:30:51 PusulaServer weewx[4687] INFO __main__: Using
>>> configuration file /etc/weewx/weewx.conf
>>> Oct 12 12:30:51 PusulaServer weewx[4687] INFO __main__: Debug is 0
>>> Oct 12 12:30:51 PusulaServer weewx[4687] INFO weewx.engine: Loading
>>> station type WXT5x0 (user.wxt5x0)
>>> Oct 12 12:30:51 PusulaServer weewx[4672]:    ...done.
>>> Oct 12 12:30:51 PusulaServer systemd[1]: Started LSB: weewx weather
>>> system.
>>> Oct 12 12:30:51 PusulaServer weewx[4687] INFO user.wxt5x0: driver
>>> version is 0.5
>>> ...
>>> Oct 12 12:30:51 PusulaServer weewx[4687] INFO weewx.engine: Starting
>>> main packet loop.
>>> Oct 12 12:30:51 PusulaServer weewx[4687] INFO weewx.engine: Main loop
>>> exiting. Shutting engine down.
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__: Caught
>>> unrecoverable exception:
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>> unicode strings are not supported, please encode to bytes: '0R0\r\n'
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>> Traceback (most recent call last):
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>> File "/usr/share/weewx/weewxd", line 154, in main
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>>   engine.run()
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>> File "/usr/share/weewx/weewx/engine.py", line 188, in run
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>>   for packet in self.console.genLoopPackets():
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>> File "/usr/share/weewx/user/wxt5x0.py", line 483, in genLoopPackets
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>>   raw = self._station.get_composite()
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>> File "/usr/share/weewx/user/wxt5x0.py", line 202, in get_composite
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>>   return self.get_data('R0')
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>> File "/usr/share/weewx/user/wxt5x0.py", line 155, in get_data
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>>   self.send_cmd(cmd)
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>> File "/usr/share/weewx/user/wxt5x0.py", line 149, in send_cmd
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>>   self.device.write(cmd)
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>> File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 532, in
>>> write
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>>   d = to_bytes(data)
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>> File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 63, in
>>> to_bytes
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>>   raise TypeError('unicode strings are not supported, please encode to
>>> bytes: {!r}'.format(seq))
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>> TypeError: unicode strings are not supported, please encode to bytes:
>>> '0R0\r\n'
>>> Oct 12 12:30:51 PusulaServer weewx[4687] CRITICAL __main__:     ****
>>> Exiting.
>>>
>>> Any clues how to get forward? The system works OK with the simulation
>>> driver so this might be still to do with the WXT5x0 driver.
>>>
>>> ..
>>> Erik
>>>
>>> On Monday, 17 August 2020 at 14:13:21 UTC+3 [email protected] wrote:
>>>
>>>>
>>>> Thanks!
>>>> That got the driver running.
>>>>
>>>> I have another hurdle.
>>>> I am seeing data from the device but it is in NMEA format.
>>>> The driver is set up for serial format.  So my data is not being parsed.
>>>>
>>>> I see a command/method defined which would
>>>> put it in serial mode as a side effect:   set_automatic_mode()
>>>> but I don't see that method being called anywhere.
>>>> (there is also set_polled_mode() but it has an error and I also don't
>>>> see it being used either.)
>>>>
>>>> I can mangle this up myself... but I thought I should ask: is
>>>> it generally considered kosher to do a re-config on the hardware when
>>>> weewx starts up?  Or does the user have to sort that out
>>>> himself using whatever config tools available to him?
>>>>
>>>>
>>>>
>>>>
>>>> On Thursday, August 13, 2020 at 11:52:56 PM UTC-5, Glenn McKechnie
>>>> wrote:
>>>>>
>>>>> Ah. Thanks Gary, that makes more sense.
>>>>>
>>>>> @Chris
>>>>> Gary's correction has been applied to this attachment
>>>>> wxt5x0-trimmed2.py
>>>>> and has the following diff...
>>>>>
>>>>> --
>>> 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/fdd27793-8376-40cd-90f0-5cc327cdd307n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/weewx-user/fdd27793-8376-40cd-90f0-5cc327cdd307n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "weewx-user" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/weewx-user/t8pTnYHcS68/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/CAPq0zEAjRaRMzqaC1FO0B4ZrPW1ieePTwGR3UXWt4S1t4R%2Bidw%40mail.gmail.com
> <https://groups.google.com/d/msgid/weewx-user/CAPq0zEAjRaRMzqaC1FO0B4ZrPW1ieePTwGR3UXWt4S1t4R%2Bidw%40mail.gmail.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/CAFXPvCLRw3ic%2B9%2BDzkf2iNycz4m7MKXRhYq%3DHe_auNm%2BVP5FNQ%40mail.gmail.com.

Reply via email to