ws28xx: ValueError: The device has no langid (debian in LXC)

181 views
Skip to first unread message

michael.k...@gmx.at

unread,
Mar 2, 2021, 3:21:34 PM3/2/21
to weewx-user
I've just tried to get my ws28xx running on a debian installation running in a LXC on a QNAP NAS.

dmesg shows the dongle was connected:
[297714.611821] usb 1-2: new full-speed USB device number 4 using xhci_hcd
[297714.893545] hid-generic 0003:6666:5555.0002: hiddev0: USB HID v1.11 Device [LA CROSSE TECHNOLOGY Weather Direct Light Wireless Device] on usb-0001:01:00.0-2/input0
[297714.938043] [usb.001.004] /sys/devices/platform/soc/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/usb1/1-2 added.

lsusb:

Bus 002 Device 001: ID 1d6b:0003
Bus 001 Device 004: ID 6666:5555
Bus 001 Device 001: ID 1d6b:0002


When I start wee_device or weewx I get this exception:
Mar  2 21:06:34 debianNAS weewx[23083] INFO weewx.drivers.ws28xx: found transceiver at bus= device=
Mar  2 21:06:34 debianNAS weewx[23083] ERROR weewx.engine: Import of driver failed: The device has no langid (<class 'ValueError'>)
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****  Traceback (most recent call last):
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/engine.py", line 119, in setupStation
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****      self.console = loader_function(config_dict, self)
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/ws28xx.py", line 948, in loader
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****      return WS28xxDriver(**config_dict[DRIVER_NAME])
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/ws28xx.py", line 1294, in __init__
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****      self.startUp()
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/ws28xx.py", line 1415, in startUp
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****      self.serial, comm_interval=self.comm_interval)
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/ws28xx.py", line 4020, in setup
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****      self.shid.open(vendor_id, product_id, device_id, serial)
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/ws28xx.py", line 3072, in open
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****      self._open_device(device)
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/ws28xx.py", line 3113, in _open_device
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****      log.info('manufacturer: %s' % self.devh.getString(dev.iManufacturer,30))
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****    File "/usr/lib/python3/dist-packages/usb/legacy.py", line 283, in getString
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****      return util.get_string(self.dev, index, langid).encode('ascii')
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****    File "/usr/lib/python3/dist-packages/usb/util.py", line 314, in get_string
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****      raise ValueError("The device has no langid")
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL weewx.engine:     ****  ValueError: The device has no langid
Mar  2 21:06:34 debianNAS weewx[23083] CRITICAL __main__: Unable to load driver: The device has no langid

Is this related to the LXC? Any ideas?


F. S.

unread,
May 24, 2021, 11:33:09 AM5/24/21
to weewx-user
Same Problem.
I try to change from WS-2300 to WS-2816

It's a problem of accessrights.

For my WS-2300 I have to add following to the lxc config file to have full access to the USB2Serial Adapter bind to /dev/ttyUSB0:
lxc.cgroup.devices.allow: c 188:* rwm

lxc.cgroup.devices.allow: c 189:* rwm

lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file

But I don't know what should be configured for the WS-2816, because in the syslog there is no Information, which Device I have to use to configure in the lxc configfile

F. S.

unread,
May 24, 2021, 1:03:42 PM5/24/21
to weewx-user
For me, I solved the problem.

lsusb on the server (Proxmox, QNAP,...)
Bus 001 Device 004: ID 6666:5555 Prototype product Vendor ID

ls -l /dev/bus/usb/001/004
crw-rw-rw- 1 root root 189, 3 May 24 18:48 /dev/bus/usb/001/004

Then in the lxc configfile: <CT#>.conf enter these two lines:

lxc.cgroup.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb/001/004 dev/bus/usb/001/004 none bind,optional,create=file

In weex.conf:

[Station]
............
station_type = WS28xx

[WS28xx]
    # This section is for the La Crosse WS-2800 series of weather stations.
    # Radio frequency to use between USB transceiver and console: US or EU
    # US uses 915 MHz, EU uses 868.3 MHz.  Default is US.
    transceiver_frequency = EU
   # The station model, e.g., 'LaCrosse C86234' or 'TFA Primus'
    model = LaCrosse WS28xx
    # The pressure calibration offset, in hPa (millibars)
    pressure_offset = 0
    # The driver to use:
    driver = weewx.drivers.ws28xx

reboot weewx Container

wee_device --pair
press Arrow DOWN on WS-2816 DisplayUnit until Syn will displayed
Reply all
Reply to author
Forward
0 new messages