A little closer inspection, this kernel patch should fix it, so either
apply... or, just wait for a backport. In any event, acurite isn't going
to work on a Pi5 which requires the broken kernel (6.12) right now.
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index aac0051a2cf6..758eb21430cd 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -985,6 +985,7 @@ static int usbhid_parse(struct hid_device *hid)
struct usb_device *dev = interface_to_usbdev (intf);
struct hid_descriptor *hdesc;
struct hid_class_descriptor *hcdesc;
+ __u8 fixed_opt_descriptors_size;
u32 quirks = 0;
unsigned int rsize = 0;
char *rdesc;
@@ -1015,7 +1016,21 @@ static int usbhid_parse(struct hid_device *hid)
(hdesc->bNumDescriptors - 1) * sizeof(*hcdesc)) {
dbg_hid("hid descriptor invalid, bLen=%hhu bNum=%hhu\n",
hdesc->bLength, hdesc->bNumDescriptors);
- return -EINVAL;
+
+ /*
+ * Some devices may expose a wrong number of descriptors compared
+ * to the provided length.
+ * However, we ignore the optional hid class descriptors entirely
+ * so we can safely recompute the proper field.
+ */
+ if (hdesc->bLength >= sizeof(*hdesc)) {
+ fixed_opt_descriptors_size = hdesc->bLength - sizeof(*hdesc);
+
+ hid_warn(intf, "fixing wrong optional hid class descriptors count\n");
+ hdesc->bNumDescriptors = fixed_opt_descriptors_size / sizeof(*hcdesc) + 1;
+ } else {
+ return -EINVAL;
+ }
}
hid->version = le16_to_cpu(hdesc->bcdHID);
--
2.51.1
---
On Wednesday, 25 February 2026 at 16:01:48 UTC-8 Craig (craiger) wrote:
> Hi weewx folks!
>
> Per title, connecting an Acurite USB station to a Raspberry P5 running
> Raspberry Pi OS Trixie results in failure,
>
> [33809.965648] usb 1-2: Product: Chaney Instrument
> [33809.977730] usbhid 1-2:1.0: can't add hid device: -22
> [33809.977742] usbhid 1-2:1.0: probe with driver usbhid failed with error
> -22
>
>
> On Raspberry Pi OS Bookworm, it works as expected
>
> [ 2.558137] usbcore: registered new interface driver usbhid
> [ 2.560725] usbhid: USB HID core driver
>
>
> I know this isn't exactly a weewx thing, but I thought I'd mention it in
> the event somebody has a workaround, otherwise, the best plan is to stay on
> an old/unsupported OS because the debian developers appeared to have done
> something I'm sure they thought was clever in libusb/udev for Trixie.
>
> best,
> -edfardos
>
>
>
--
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 visit
https://groups.google.com/d/msgid/weewx-user/6ca922df-bc18-4ada-b32e-65ee5cf9833bn%40googlegroups.com.