NK3 often stopp working

Hi,
the device often stops working, which can be seen in the kernel log:

2024-12-30T07:46:32+01:00 kernel: usb 3-2: USB disconnect, device number 23

The only solution is to pull out the key and reinsert it.
FW: 1.8.0
Variant: LPC55
Model: NFC USB-C

This problem never occurred before FW 1.8.0.

Any ideas?

Thanks

Maybe start hunting failure:

  • another usb port?
  • another nk3 key?
  • energy settings?

The biggest change in v1.8.0 is the new PIV application. Maybe some process tries to access it in the background. Does the problem still occur if you disable PIV with the following command?

$ nitropy nk3 set-config piv.disabled true

it will reported as an Unknown config value:

nitropy nk3 set-config piv.disabled true
Command line tool to interact with Nitrokey devices 0.6.0
Changing configuration values can have unexpected side effects, including data loss.
This should only be used for development and testing.
Critical error:
Unknown config values can only be set if the --force/-f flag is set.  Aborting.

I have a very similar behaviour with a Nitrokey Passkey USB-A device.
Sometimes it works directly but soon after it drops out.
Replugging the nitrokey several times makes the device reappear.

[thomas@roamer ~]$ sudo whoami
Please touch the device.
root
[thomas@roamer ~]$ sudo whoami
Das hat nicht funktioniert, bitte nochmal probieren.
Das hat nicht funktioniert, bitte nochmal probieren.
sudo: 3 Fehlversuche bei der Passwort-Eingabe
[thomas@roamer ~]$

dmesg shows then the following:

[Mo,  6. Jan 2025, 07:16:37] usb 3-1: reset full-speed USB device number 2 using xhci_hcd
[Mo,  6. Jan 2025, 07:16:37] usb 3-1: device descriptor read/64, error -71
[Mo,  6. Jan 2025, 07:16:37] usb 3-1: device descriptor read/64, error -71
[Mo,  6. Jan 2025, 07:16:37] usb 3-1: reset full-speed USB device number 2 using xhci_hcd
[Mo,  6. Jan 2025, 07:16:37] usb 3-1: device descriptor read/64, error -71
[Mo,  6. Jan 2025, 07:16:37] usb 3-1: device descriptor read/64, error -71
[Mo,  6. Jan 2025, 07:16:38] usb 3-1: reset full-speed USB device number 2 using xhci_hcd
[Mo,  6. Jan 2025, 07:16:38] usb 3-1: Device not responding to setup address.
[Mo,  6. Jan 2025, 07:16:38] usb 3-1: Device not responding to setup address.
[Mo,  6. Jan 2025, 07:16:38] usb 3-1: device not accepting address 2, error -71
[Mo,  6. Jan 2025, 07:16:38] usb 3-1: WARN: invalid context state for evaluate context command.
[Mo,  6. Jan 2025, 07:16:38] usb 3-1: reset full-speed USB device number 2 using xhci_hcd
[Mo,  6. Jan 2025, 07:16:43] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[Mo,  6. Jan 2025, 07:16:49] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[Mo,  6. Jan 2025, 07:16:49] usb 3-1: device not accepting address 2, error -62
[Mo,  6. Jan 2025, 07:16:49] usb 3-1: USB disconnect, device number 2
[Mo,  6. Jan 2025, 07:16:49] usb 3-1: new full-speed USB device number 6 using xhci_hcd
[Mo,  6. Jan 2025, 07:16:49] usb 3-1: device descriptor read/64, error -71
[Mo,  6. Jan 2025, 07:16:49] usb 3-1: device descriptor read/64, error -71
[Mo,  6. Jan 2025, 07:16:49] usb 3-1: new full-speed USB device number 7 using xhci_hcd
[Mo,  6. Jan 2025, 07:16:50] usb 3-1: device descriptor read/64, error -71
[Mo,  6. Jan 2025, 07:16:50] usb 3-1: device descriptor read/64, error -71
[Mo,  6. Jan 2025, 07:16:50] usb usb3-port1: attempt power cycle
[Mo,  6. Jan 2025, 07:16:50] usb 3-1: new full-speed USB device number 8 using xhci_hcd
[Mo,  6. Jan 2025, 07:16:50] usb 3-1: Device not responding to setup address.
[Mo,  6. Jan 2025, 07:16:50] usb 3-1: Device not responding to setup address.
[Mo,  6. Jan 2025, 07:16:51] usb 3-1: device not accepting address 8, error -71
[Mo,  6. Jan 2025, 07:16:51] usb 3-1: WARN: invalid context state for evaluate context command.
[Mo,  6. Jan 2025, 07:16:51] usb 3-1: new full-speed USB device number 9 using xhci_hcd
[Mo,  6. Jan 2025, 07:16:51] usb 3-1: Device not responding to setup address.
[Mo,  6. Jan 2025, 07:16:51] usb 3-1: Device not responding to setup address.
[Mo,  6. Jan 2025, 07:16:51] usb 3-1: device not accepting address 9, error -71
[Mo,  6. Jan 2025, 07:16:51] usb 3-1: WARN: invalid context state for evaluate context command.
[Mo,  6. Jan 2025, 07:16:51] usb usb3-port1: unable to enumerate USB device

System is ArchLinux (EndeavourOS) with latest patch level.

After several tries of replugging the device shows up again:

[Mo,  6. Jan 2025, 07:31:22] usb 3-1: New USB device found, idVendor=20a0, idProduct=42f3, bcdDevice= 1.06
[Mo,  6. Jan 2025, 07:31:22] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Mo,  6. Jan 2025, 07:31:22] usb 3-1: Product: Nitrokey Passkey
[Mo,  6. Jan 2025, 07:31:22] usb 3-1: Manufacturer: Nitrokey
[Mo,  6. Jan 2025, 07:31:22] hid-generic 0003:20A0:42F3.0004: hiddev96,hidraw0: USB HID v1.11 Device [Nitrokey Nitrokey Passkey] on usb-0000:00:14.0-1/input1

and it also reappears in lsusb:

[thomas@roamer ~]$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 003: ID 27c6:550a Shenzhen Goodix Technology Co.,Ltd. FingerPrint
Bus 003 Device 004: ID 5986:2160 Bison Electronics Inc. Integrated Camera
Bus 003 Device 005: ID 8087:0026 Intel Corp. AX201 Bluetooth
Bus 003 Device 086: ID 20a0:42f3 Clay Logic Nitrokey Passkey
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
[thomas@roamer ~]$ 

Some minutes later it will drop out again.
I found Nitrokey very unreliable on my system. Is it a hardware or a software issue?

The option has been added in pynitrokey v0.7.0.

Thanks,
after updating pynitrokey now the line works.
I also reboot the key as requested by the tool.
Now I will be in the watch.

Should

nitropy nkpk set-config piv.disabled true

also work for my Nitrokey Passkey device?

No. The Nitrokey Passkey only supports FIDO2 anyway, so there is no PIV application to disable. At first glance, your problem looks more like a hardware issue to me. I’ll get back to you shortly.

Thx.
And sorry for jumping into this thread. Can the be separated by one of the admins?

Now it was happens again. So the PIV part was not the problem.

2025-01-06T13:54:04+01:00 kernel: usb 3-2: USB disconnect, device number 43
2025-01-06T13:54:05+01:00 kernel: usb 3-2: new full-speed USB device number 44 using xhci_hcd
2025-01-06T13:54:05+01:00 kernel: usb 3-2: device descriptor read/64, error -71
2025-01-06T13:54:06+01:00 systemd[3100]: Stopped target smartcard.target - Smart Card.
2025-01-06T13:54:06+01:00 systemd[1]: Stopped target smartcard.target - Smart Card.
2025-01-06T13:54:07+01:00 kernel: usb 3-2: new full-speed USB device number 45 using xhci_hcd
2025-01-06T13:54:07+01:00 kernel: usb 3-2: device descriptor read/64, error -71
2025-01-06T13:54:08+01:00 kernel: usb 3-2: device descriptor read/64, error -71
2025-01-06T13:54:08+01:00 kernel: usb 3-2: new full-speed USB device number 46 using xhci_hcd
2025-01-06T13:54:09+01:00 kernel: usb 3-2: new full-speed USB device number 47 using xhci_hcd
2025-01-06T13:54:09+01:00 kernel: usb 3-2: device descriptor read/64, error -71
2025-01-06T13:54:10+01:00 kernel: usb 3-2: device descriptor read/64, error -71
2025-01-06T13:54:10+01:00 kernel: usb 3-2: new full-speed USB device number 48 using xhci_hcd

Do you have other USB Ports to try out? Such errors could be found when a USB port has a weak connection with a plug or when on the same port multiple devices are attached that in total draw too much power. Do you use an extension cord?

@Thomas_Braun If you can rule out connection problems as mentioned by @nku, please send a mail to support@nitrokey.com describing the problem and including your order number and a link to this thread.

@nku There will be only one device on the port itself and the device don’t have another USB-C port. But I can test it on an other system and report it back.

Hi!

I did try both USB-A-Ports that are available on the machine and also operated the key with a USB-Extension and a (passive) USB-Hub.
No stable operation was possible and the nitrokey was dropping out sooner or later.

Will write to customer support and ask for a replacement.

Thx!