mphi-rc / pi-zero-security-key

A FIDO2 USB security key implementation for the Raspberry Pi Zero
Apache License 2.0
67 stars 7 forks source link

Chosen USB device controller is unavailable #4

Open yukifolf opened 3 years ago

yukifolf commented 3 years ago

Hi I have a little problem with code:

Exception in thread "main" java.lang.IllegalStateException: Chosen USB device controller is unavailable at com.google.common.base.Preconditions.checkState(Preconditions.java:508) at com.github.mphi_rc.usb.gadget.UsbDeviceController.check(UsbDeviceController.java:30) at com.github.mphi_rc.usb.gadget.ImmutableUsbDeviceController.validate(ImmutableUsbDeviceController.java:109) at com.github.mphi_rc.usb.gadget.ImmutableUsbDeviceController.of(ImmutableUsbDeviceController.java:105) at com.github.mphi_rc.usb.gadget.UsbDeviceController.raspberryPiZero(UsbDeviceController.java:17) at com.github.mphi_rc.fido2.Configuration.usbDeviceController(Configuration.java:49) at com.github.mphi_rc.fido2.ImmutableConfiguration.usbDeviceControllerInitialize(ImmutableConfiguration.java:266) at com.github.mphi_rc.fido2.ImmutableConfiguration.access$1600(ImmutableConfiguration.java:35) at com.github.mphi_rc.fido2.ImmutableConfiguration$InitShim.usbDeviceController(ImmutableConfiguration.java:203) at com.github.mphi_rc.fido2.ImmutableConfiguration.(ImmutableConfiguration.java:73) at com.github.mphi_rc.fido2.ImmutableConfiguration.(ImmutableConfiguration.java:35) at com.github.mphi_rc.fido2.ImmutableConfiguration$Builder.build(ImmutableConfiguration.java:868) at com.github.mphi_rc.fido2.ConfigurationFile.readFromDisk(ConfigurationFile.java:172) at com.github.mphi_rc.fido2.ConfigurationFile.(ConfigurationFile.java:63) at com.github.mphi_rc.fido2.ConfigurationFile.defaultPath(ConfigurationFile.java:46) at com.github.mphi_rc.fido2.Fido2AuthenticatorCli.main(Fido2AuthenticatorCli.java:14)

And it can't run

mphi-rc commented 3 years ago

This error happens when your configuration points to an invalid or missing USB device controller.

If you are running this on a Pi Zero, make sure USB gadget support is enabled:

If you are running this on a host without USB device controller hardware then you can use a software emulator. This great article explains how to do this using the dummy_hcd kernel module.

To verify whether you've set up your UDC correctly, look under /sys/class/udc/. The Pi Zero controller will appear as file 20980000.usb and the emulated controller as dummy_udc.0.