Weewx on Raspi Zero with openwrt no ttyUSB0

312 views
Skip to first unread message

Fische Namenlos

unread,
Dec 25, 2021, 6:39:41 AM12/25/21
to weewx-user

Dear,
sorry for this question, maybe simple, but I'm a programmer-nob...

I installed successful openwrt 21.02.1 and weewx 4.5.1with python3 with my old weather station Cresta/Hideki and driver TE923. All works well!

Now I changed to a newer one: renkforce WH2315 alias Froggit with driver ws23xx. Both driver use /dev/ttyUSB0.

Device is recognized at boot as :
[    9.108633] hid-generic 0003:10C4:8468.0001: hiddev96,hidraw0: USB HID v1.01 Device [SLAB HIDtoSPI Slave] on usb-20980000.usb-1.1/input0
[    9.124682] usbcore: registered new interface driver usbhid
[    9.132115] usbhid: USB HID core driver
[    9.145064] usbcore: registered new interface driver usbserial_generic
[    9.153713] usbserial: USB Serial support registered for generic

lsusb:  Bus device 003: ID 10c4:8468 SLAB HIDtoSPI Slave

But there is no ttyUSB0 created, so weewx dies on starting with error:
Sat Dec 25 12:06:07 2021 user.info weewx[1836] INFO weewx.engine: Loading station type WS23xx (weewx.drivers.ws23xx)
Sat Dec 25 12:06:07 2021 user.info weewx[1836] INFO weewx.drivers.ws23xx: driver version is 0.41
Sat Dec 25 12:06:07 2021 user.info weewx[1836] INFO weewx.drivers.ws23xx: serial port is /dev/ttyS0
Sat Dec 25 12:06:07 2021 user.info weewx[1836] INFO weewx.drivers.ws23xx: polling interval is None
Sat Dec 25 12:06:07 2021 user.debug weewx[1836] DEBUG weewx.drivers.ws23xx: create LinuxSerialPort
Sat Dec 25 12:06:07 2021 user.err weewx[1836] ERROR weewx.engine: Import of driver failed: (5, 'I/O error') (<class 'termios.error'>)
Sat Dec 25 12:06:07 2021 user.crit weewx[1836] CRITICAL weewx.engine:     ****  Traceback (most recent call last):
Sat Dec 25 12:06:07 2021 user.crit weewx[1836] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/engine.py", line 119, in setupStation
Sat Dec 25 12:06:07 2021 user.crit weewx[1836] CRITICAL weewx.engine:     ****      self.console = loader_function(config_dict, self)
Sat Dec 25 12:06:07 2021 user.crit weewx[1836] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/drivers/ws23xx.py", line 272, in loader
Sat Dec 25 12:06:07 2021 user.crit weewx[1836] CRITICAL weewx.engine:     ****      return WS23xxDriver(config_dict=config_dict, **config_dict[DRIVER_NAME])
Sat Dec 25 12:06:07 2021 user.crit weewx[1836] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/drivers/ws23xx.py", line 439, in __init__
Sat Dec 25 12:06:07 2021 user.crit weewx[1836] CRITICAL weewx.engine:     ****      self.station = WS23xx(self.port)
Sat Dec 25 12:06:07 2021 user.crit weewx[1836] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/drivers/ws23xx.py", line 641, in __init__
Sat Dec 25 12:06:07 2021 user.crit weewx[1836] CRITICAL weewx.engine:     ****      self.serial_port = LinuxSerialPort(port)
Sat Dec 25 12:06:07 2021 user.crit weewx[1836] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/drivers/ws23xx.py", line 901, in __init__
Sat Dec 25 12:06:07 2021 user.crit weewx[1836] CRITICAL weewx.engine:     ****      self.orig_settings = tty.tcgetattr(self.serial_port)
Sat Dec 25 12:06:07 2021 user.crit weewx[1836] CRITICAL weewx.engine:     ****  termios.error: (5, 'I/O error')
Sat Dec 25 12:06:07 2021 user.crit weewx[1836] CRITICAL __main__: Unable to load driver: (5, 'I/O error')
Sat Dec 25 12:06:07 2021 user.crit weewx[1836] CRITICAL __main__:     ****  Exiting...

any ideas? The ws23xx driver ist the last "modified" for the renkforce weather-station.

Thx

Tom Keffer

unread,
Dec 25, 2021, 6:51:01 AM12/25/21
to weewx-user
It looks like you're trying to connect to /dev/ttyS0, which is generally a serial port, not a USB port.

Check weewx.conf and make sure you got it right.

--
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 on the web visit https://groups.google.com/d/msgid/weewx-user/a131fd19-b8cf-4532-b3b8-2f559f3913b4n%40googlegroups.com.

Fische Namenlos

unread,
Dec 25, 2021, 7:52:07 AM12/25/21
to weewx-user
nope, weex.conf is set to /dev/ttyUSB0, too. I use the wee_config --reconfigure script...

Fische Namenlos

unread,
Dec 25, 2021, 7:53:38 AM12/25/21
to weewx-user
ah, sorry, wrong copy&paste output:

Sat Dec 25 13:46:54 2021 user.info weewx[2776] INFO weewx.engine: Loading station type WS23xx (weewx.drivers.ws23xx)
Sat Dec 25 13:46:54 2021 user.info weewx[2776] INFO weewx.drivers.ws23xx: driver version is 0.41
Sat Dec 25 13:46:54 2021 user.info weewx[2776] INFO weewx.drivers.ws23xx: serial port is /dev/ttyUSB0
Sat Dec 25 13:46:54 2021 user.info weewx[2776] INFO weewx.drivers.ws23xx: polling interval is None
Sat Dec 25 13:46:54 2021 user.debug weewx[2776] DEBUG weewx.drivers.ws23xx: create LinuxSerialPort
Sat Dec 25 13:46:54 2021 user.err weewx[2776] ERROR weewx.engine: Import of driver failed: can't open tty device - [Errno 2] No such file or directory: '/dev/ttyUSB0'. (<class 'weewx.drivers.ws23xx.FatalError'>)
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****  Traceback (most recent call last):
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/drivers/ws23xx.py", line 896, in __init__
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****      self.serial_port = os.open(self.device, os.O_RDWR)
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****  FileNotFoundError: [Errno 2] No such file or directory: '/dev/ttyUSB0'
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****  During handling of the above exception, another exception occurred:
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****  Traceback (most recent call last):
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/engine.py", line 119, in setupStation
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****      self.console = loader_function(config_dict, self)
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/drivers/ws23xx.py", line 272, in loader
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****      return WS23xxDriver(config_dict=config_dict, **config_dict[DRIVER_NAME])
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/drivers/ws23xx.py", line 439, in __init__
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****      self.station = WS23xx(self.port)
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/drivers/ws23xx.py", line 641, in __init__
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****      self.serial_port = LinuxSerialPort(port)
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/drivers/ws23xx.py", line 898, in __init__
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****      raise FatalError(self.device, "can't open tty device - %s." % str(e))
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL weewx.engine:     ****  weewx.drivers.ws23xx.FatalError: can't open tty device - [Errno 2] No such file or directory: '/dev/ttyUSB0'.
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL __main__: Unable to load driver: can't open tty device - [Errno 2] No such file or directory: '/dev/ttyUSB0'.
Sat Dec 25 13:46:54 2021 user.crit weewx[2776] CRITICAL __main__:     ****  Exiting...

Tom Keffer

unread,
Dec 25, 2021, 8:36:48 AM12/25/21
to weewx-user
OK, progress. 

I suspect there is one of three problems:
  1. The port is still wrong. This is probably the least likely.
  2. The kernel is loading the wrong module. This is possible: the little dmesg snippet you included shows no evidence that the kernel is treating the device as a traditional serial device.
  3. You're using the wrong driver. Take a look at this thread: https://groups.google.com/g/weewx-user/c/zsTwFI7tSlw/m/DRlfX1SpAQAJ While it suggests using Matthew Wall's driver, it has not been ported to Python 3 and WeeWX v4. User Edwin has done the port, and offers some tips. See https://github.com/EdwinGH/weewx-wh23xx
Hope that helps.

-tk

Fische Namenlos

unread,
Dec 25, 2021, 9:16:31 AM12/25/21
to weewx-user
success - driver is reading from device... it was the wrong "older" driver.

seems to have other "reading" complications, but it is still working... :)

Thx

Tom Keffer

unread,
Dec 25, 2021, 10:11:26 AM12/25/21
to weewx-user
For the sake of posterity and those who might be reading this thread in the future, which driver worked?

Fische Namenlos

unread,
Dec 25, 2021, 11:56:31 AM12/25/21
to weewx-user
sorry, was offline

For use with station renkforce WH-2315 (and other copies) the driver mod from EdwinGH should work with OpenWRT 21.x and Python3.9.x.

After update with wee_extension ---install You have a "new driver" choice [0] named as WH2315.

see it running at http://weather-server.uk.to:8080

Fische Namenlos

unread,
Dec 28, 2021, 3:44:54 AM12/28/21
to weewx-user
Addendum: polling_interval could be changed in modded "user"-driver-file itself; has no effect in weewx.conf file. Standard is 15sec

Renkforce WH2315 (and clones) has min. sensor intervall from 48sec.
Reply all
Reply to author
Forward
0 new messages