Hi Guenther, did you also copy the weewx.rules file from /etc/weewx/udev/ 
to  /etc/udev/rules.d/ ?
And then reboot the system?

I played around a bit yesterday with USB and access rights, and if your 
udev rules work well, the following Python code should show the 
manufacturer and product; when the rules do not work, it complains about a 
langid it can't find (not sure why this error is thrown):

import usb.core
import usb.util
for xdev in usb.core.find(find_all=True):
  print("Raw idVendor = %s, idProduct = %s" % (xdev.idVendor, 
xdev.idProduct))
  vidhex_str = "{:04X}".format(xdev.idVendor)
  pidhex_str = "{:04X}".format(xdev.idProduct)
  try:
    langids_str = usb.util.get_langids(xdev)
    print("Lang raw %s" % langids_str)
  except Exception as e:
    langids_str = e
    print("Lang exception %s" % langids_str)
  try:
    mfr_str = usb.util.get_string(xdev, xdev.iManufacturer)
    print("Mft raw %s" % mfr_str)
  except Exception as e:
    mfr_str = e
    print("Mft exception %s" % mfr_str)
  try:
    prod_str = usb.util.get_string(xdev, xdev.iProduct)
    print("Prod raw %s" % prod_str)
  except Exception as e:
    prod_str = e
    print("Prod exception %s" % prod_str)
  out_str = "VID: 0x{}, PID: 0x{}, Mfr: '{}', Prod: 
'{}'".format(vidhex_str, pidhex_str, mfr_str, prod_str)
  print(out_str)

What you can do is just run python, and paste the above in your shell 
window and press enter until it executes. If you run python as root (sudo 
python) it always shows the USB devices info. 
I did not find another way to check if the udev rules permissions are 
working. One thing I did find out is that the udev rules file is case 
sensitive, also on hex values like 10c4 (10C4 did not work...)

Happy testing!
Edwin

PS Yesterday I also updated my WH23xx code to have more debugging and USB 
info; it will not help you with the above, but I did not like the code to 
show empty strings with the USB device ("bus= device="), so fixed that to 
show Silicon Labs and HIDtoSPI Slave
On Sunday, October 6, 2024 at 11:54:52 AM UTC+2 Günther Wrana wrote:

> Es funktioniert auch nicht wenn ich das in die Datei rules eintrage.
>
> [image: Bildschirmfoto vom 2024-10-06 11-47-02.png]
>
> Wenn ich dann Neustarte kommt wieder diese Meldung.
>
>
> [image: Bildschirmfoto vom 2024-10-06 11-47-22.png]
>
> Vor allem kann ich weewx nicht anhalten auch wenn ich hunderte male sudo 
> systemctl stop weewx schreibe.
>
> Ich weiß nicht wo nun das ganze Problem liegt.
> Danke sehr 
>

-- 
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/afe295ae-a778-4e2c-a6b9-c6462a7fbdc1n%40googlegroups.com.

Reply via email to