No internet connection
  1. Home
  2. Technical Support

USB Devices not created

By Nick Pointon @pointonn
    2022-01-18 23:02:55.639Z

    I have just installed TinyPilot on a RPi Zero W, having made a clean (and updated) install of Raspian Lite.
    The USB gadgets are not being created. init-usb-gadget fails on boot. *sudo journalctl -u usb-gadget *provides the following:

    Jan 18 22:05:51 RPi9-keyboard init-usb-gadget[308]: + echo 'Multifunction USB Device'
    Jan 18 22:05:51 RPi9-keyboard init-usb-gadget[308]: + mkdir -p functions/hid.keyboard
    Jan 18 22:05:52 RPi9-keyboard init-usb-gadget[336]: mkdir: cannot create directory ‘functions/hid.keyboard’: No such file or directory
    Jan 18 22:05:52 RPi9-keyboard systemd[1]: usb-gadget.service: Main process exited, code=exited, status=1/FAILURE
    Jan 18 22:05:52 RPi9-keyboard systemd[1]: usb-gadget.service: Failed with result 'exit-code'.
    Jan 18 22:05:52 RPi9-keyboard systemd[1]: Failed to start Initialize USB gadgets.
    
    

    And /dev/hidg0 and /dev/hidg1 have not been created.
    On a clean RPi I can run
    init-usb-gadget
    , by itself, fine and the USB interface works fine for keyboard and mouse. It feels like there is something that happens during the install of TinyPilot that is preventing the gadget working properly.

    Any suggestions as to what to try?
    Thanks, Nick

    • 3 replies
    1. My guess is that something is going wrong in the installation. Can you try installing again and sharing the full logs? It's likely that one of these steps is getting skipped incorrectly:

      https://github.com/tiny-pilot/ansible-role-tinypilot/blob/27c69dc240241af987766be6d60ff6fe11f58b86/tasks/install_usb_gadget.yml

      I have successfully installed TinyPilot on a Pi Zero @ but that was over a year ago, so I'm not sure if changes since then have affected things.

      1. In reply topointonn:

        Also, another user got this working recently, but we need to update the documentation:

        https://github.com/tiny-pilot/tinypilot/issues/881#issuecomment-1008607665

        1. Progress
        2. P
          Nick Pointon @pointonn
            2022-01-19 23:21:25.990Z

            So I did a clean install of Raspian Lite and updated it and then reinstalled TinyPilot from scratch and it works fine. I am only emulating the keyboard and mouse as I don't have another port to do the video as well, but it is working perfectly.

            The only difference from the 2 previous times is that I watched the output of sudo apt-get -y update && sudo apt-get -y upgrade closely and noticed that one module failed to update, so I re-ran the update command to ensure that all the updates installed correctly (it did the 2nd time). After this TinyPilot installed fine (I logged in and noticed no errors) and the USB gadget was created successfully and it is all working fine.

            Thanks for your help. I only wish I'd taken more notice of which package update failed to install the 1st time.