I could not get my QHY cameras detected by the system (fresh install of Rapberry Pi OS + manually built indi + libqhy + indi-qhy). lsusb was showing the camera’s ID but no vendor or product ID like this:
Bus 001 Device 020: ID 1618:0920
Syslog was showing the following message whenever I’d plug the camera in:
systemd-udevd[2166]: 1-1.2.4.2:1.0: Process '/sbin/fxload -t fx2 -I /lib/firmware/qhy/QHY5II.HEX -D ' failed with exit code 1
Trying to execute that command manually quickly revealed that /sbin/fxload was missing, while the fxload package itself was listed as installed:
$ apt list fxload 2>&1 | grep installed
fxload/oldstable,now 0.0.20081013-1+b2 arm64 [installed]
So that is the first strange thing.
Reinstalling the package had an immediate effect of getting the camera recognized:
Bus 001 Device 020: ID 1618:0921 QHY-CCD QHY5-II
This is very much the same experience as what people reported here and here.
I wonder why the device ID has changed from 0920 to 0921.
Syslog at this point looks as following:
Aug 26 16:22:14 0-astropi kernel: [ 2990.663493] usb 1-1.2.4.2: new high-speed USB device number 27 using xhci_hcd
Aug 26 16:22:14 0-astropi kernel: [ 2990.763915] usb 1-1.2.4.2: New USB device found, idVendor=1618, idProduct=0920, bcdDevice= 0.00
Aug 26 16:22:14 0-astropi kernel: [ 2990.763946] usb 1-1.2.4.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Aug 26 16:22:14 0-astropi mtp-probe: checking bus 1, device 27: "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2.4/1-1.2.4.2"
Aug 26 16:22:14 0-astropi mtp-probe: bus: 1, device: 27 was not an MTP device
Aug 26 16:22:14 0-astropi systemd-udevd[2316]: 1-1.2.4.2:1.0: Process '/sbin/fxload -t fx2 -I /lib/firmware/qhy/QHY5II.HEX -D ' failed with exit code 255.
Aug 26 16:22:14 0-astropi mtp-probe: checking bus 1, device 27: "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2.4/1-1.2.4.2"
Aug 26 16:22:14 0-astropi mtp-probe: bus: 1, device: 27 was not an MTP device
Aug 26 16:22:14 0-astropi kernel: [ 2990.954182] usb 1-1.2.4.2: USB disconnect, device number 27
Aug 26 16:22:16 0-astropi kernel: [ 2992.711517] usb 1-1.2.4.2: new high-speed USB device number 28 using xhci_hcd
Aug 26 16:22:16 0-astropi kernel: [ 2992.811988] usb 1-1.2.4.2: config 1 interface 0 altsetting 0 bulk endpoint 0x81 has invalid maxpacket 64
Aug 26 16:22:16 0-astropi kernel: [ 2992.812023] usb 1-1.2.4.2: config 1 interface 0 altsetting 0 bulk endpoint 0x1 has invalid maxpacket 64
Aug 26 16:22:16 0-astropi kernel: [ 2992.812454] usb 1-1.2.4.2: New USB device found, idVendor=1618, idProduct=0921, bcdDevice= 0.00
Aug 26 16:22:16 0-astropi kernel: [ 2992.812475] usb 1-1.2.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Aug 26 16:22:16 0-astropi kernel: [ 2992.812491] usb 1-1.2.4.2: Product: QHY5-II
Aug 26 16:22:16 0-astropi kernel: [ 2992.812506] usb 1-1.2.4.2: Manufacturer: QHY-CCD
Aug 26 16:22:16 0-astropi mtp-probe: checking bus 1, device 28: "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2.4/1-1.2.4.2"
Aug 26 16:22:16 0-astropi mtp-probe: bus: 1, device: 28 was not an MTP device
Aug 26 16:22:16 0-astropi mtp-probe: checking bus 1, device 28: "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2.4/1-1.2.4.2"
Aug 26 16:22:16 0-astropi mtp-probe: bus: 1, device: 28 was not an MTP device
Does this look like it recognizes the device by the original 1618:0920 ID but ends up disconnecting it and reconnecting with the new ID 1618:0921?
A separate question is of the udev rule for the original device ID, which tries to execute fxload and still fails, although not because of fxload missing, but because of missing an argument to the -D parameter.
The rule itself is
ATTRS{idVendor}=="1618", ATTRS{idProduct}=="0920", RUN+="/sbin/fxload -t fx2 -I /lib/firmware/qhy/QHY5II.HEX -D $env{DEVNAME}", so clearly the issue is with $env{DEVNAME}.
As a matter of experiment (not really fully understanding what I am doing) I tried the following:
- Adding a copy of this rule for the idProduct 0921 had no effect. Similarly, the device is being first recognized as 0920, then disconnected, then reconnected as 0921, for which udev tries to execute my new rule, but fails in exactly the same way not having $env{DEVNAME} to feed to the -D parameter of fxload.
- Removing the RUN+=… part of the rule: after all, the command is anyway failing, so I expected that removing it would not have an effect, but indeed without it the rule is just ignored by udev.
- Finally, removing the rule completely threw me back to the very beginning where the camera was not being recognized at all.
Overall it looks like it is necessary to have the rule, but okay to have the fxload fail. Why even have that command in the rule then?
On a side but probably related note: my QHY268m is being recognized by the system as Cypress WestBridge and is not visible by qhy_ccd_test binary.
Aug 26 16:50:42 0-astropi kernel: [ 132.147813] usb 1-1.2.2: USB disconnect, device number 11
Aug 26 16:50:45 0-astropi kernel: [ 134.931139] usb 1-1.2.2: new high-speed USB device number 12 using xhci_hcd
Aug 26 16:50:45 0-astropi kernel: [ 135.032079] usb 1-1.2.2: New USB device found, idVendor=1618, idProduct=c268, bcdDevice= 1.00
Aug 26 16:50:45 0-astropi kernel: [ 135.032114] usb 1-1.2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug 26 16:50:45 0-astropi kernel: [ 135.032132] usb 1-1.2.2: Product: WestBridge
Aug 26 16:50:45 0-astropi kernel: [ 135.032146] usb 1-1.2.2: Manufacturer: Cypress
Aug 26 16:50:45 0-astropi kernel: [ 135.032160] usb 1-1.2.2: SerialNumber: 0000000004BE
Aug 26 16:50:45 0-astropi mtp-probe: checking bus 1, device 12: "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2.2"
Aug 26 16:50:45 0-astropi mtp-probe: bus: 1, device: 12 was not an MTP device
Aug 26 16:50:45 0-astropi systemd-udevd[1363]: 1-1.2.2: Process '/sbin/fxload -t fx3 -I /lib/firmware/qhy/QHY268.img -D /dev/bus/usb/001/012' failed with exit code 255.
Aug 26 16:50:45 0-astropi systemd-udevd[1363]: 1-1.2.2:1.0: Process '/sbin/fxload -t fx3 -I /lib/firmware/qhy/QHY268.img -D ' failed with exit code 255.
Aug 26 16:50:45 0-astropi mtp-probe: checking bus 1, device 12: "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2.2"
Aug 26 16:50:45 0-astropi mtp-probe: bus: 1, device: 12 was not an MTP device