Raspaaja
Posts: 7
Joined: Sun Feb 10, 2019 6:46 pm

Raspberry not booting if USB keyboard not connected

Sun Feb 10, 2019 7:03 pm

I thought that Raspberry can boot without a keyboard but I cannot get my Pi booting unless I connect the Logitech USB keyboard to it.
Actually, it is not even the keyboard but just the Logitech Universal Receiver USB dongle (keyboard can be switched off).

I have Debian Stretch installed with the latest versions of all packages installed. Boot device is USB2 memory stick (SanDisk 64GB) and I also have a (self powered) HD connected to another USB port. Everything works just fine as long as I keep the Logitech dongle connected. If I remove it, no boot (red light turn on but the green light never flashes and it seems like Pi cannot find the boot device).

I have tried all different combinations to connect the USB memory stick and the USB HD to PI's USB ports thinking that maybe this has something to do with USB device enumeration but that does not help either.

I must be missing something simple. Anybody else having the same problem? I do not need the keyboard or display (can do everything remotely with VNC/WebMin/terminal).
Last edited by Raspaaja on Wed Feb 13, 2019 7:58 am, edited 1 time in total.

tempest766
Posts: 105
Joined: Sun Jan 07, 2018 3:44 pm

Re: Raspberry not booting if USB keyboard not connected

Sun Feb 10, 2019 8:59 pm

so you really don't know at what stage the boot is hanging?

you're just using the LED indicator to determine that it's not booting?

Have you tried ping or ssh ?

You don't mention if it is headless (no hdmi monitor)?

tried a different (wired) USB keyboard?

Start trying to rule things out by swapping components and observing.

User avatar
sconemad
Posts: 228
Joined: Thu Apr 28, 2016 1:47 pm
Location: Cambridge, UK
Contact: Website

Re: Raspberry not booting if USB keyboard not connected

Sun Feb 10, 2019 11:28 pm

There is a known issue with some services failing to start with no USB input devices connected, for example this issue with VNC: https://www.raspberrypi.org/forums/view ... 8&t=230779

Raspaaja
Posts: 7
Joined: Sun Feb 10, 2019 6:46 pm

Re: Raspberry not booting if USB keyboard not connected

Mon Feb 11, 2019 9:08 am

Thank you very much for all your replies. A few answers:
  • It is a headless system (used keyboard and a monitor to set it up but after that it has been sitting in my closet headless)
  • There is not much to go on in terms of "evidence" except the led lights. When the Logitech Universal Receiver is plugged in everything works fine. When I unplug it the computer does not boot (does not even start to read from the USB flash drive where the OS is
  • I have tried plugging in the monitor but there is nothing on the screen when I try to boot it without the Logitech dongle. When I plug the dongle in the OS comes up beautifully.
  • I have checked the kern, sys etc. logs but there is nothing there (no indication of a failed boot).
  • All I have is the red and green leds and their behavior.
  • Ping times out and naturally ssh is a no go.
  • I do not know how connecting another keyboard would help when all I am trying to do it get rid of the one I have now.
Some things I have tried:
  • (As I said) I have tried swapping the USB flash memory and USB Hard Disk places in the 4 available USB ports. No combination helps.
  • I added the program_usb_boot_timeout=1 to the config.txt file thinking that maybe Pi needs more time to figure out the USB devices. No change.
  • I also tried replacing the Logitech dongle with USB flash memory stick thinking that maybe my Pi just needs to see something in the USB port to be able to boot but no luck with that either.
  • I also tried another USB keyboard (not with a transmitting dongle but with a cable) but even that does not help. It seems like my Pi requires the Logitech dongle.
  • Checked https://elinux.org/R-Pi_Troubleshooting and https://www.raspberrypi.org/forums/view ... hp?t=58151 to see if there is anything related but no luck.
  • As suggested, installed haveged (an entropy generator that does not need a mouse): sudo apt-get install haveged.
    No change. Perhaps because I think that the entropy generator would not be run until much later in the boot sequence. My Pi does not even seem to run the initial boot code without the dongle (at least I do not get any early boot messages if the dongle is not in place).
The version of hw is Raspberry Pi 3 Model B v1.2. My fstab just in case that might help (even though I do not think it even reaches the point where it starts reading that):
proc /proc proc defaults 0 0
PARTUUID=d21475da-01 /boot vfat defaults,noatime 0 2
PARTUUID=d21475da-02 / ext4 defaults,noatime,commit=60 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
PARTUUID=357a9415-b622-48cb-9ec3-dd5862d3bdcf /mnt/hd ext4 defaults,noatime 0 2
Firmware (/opt/vc/bin/vcgencmd version):
Nov 4 2018 16:31:07
Copyright (c) 2012 Broadcom
version ed5baf9520a3c4ca82ba38594b898f0c0446da66 (clean) (release)
Last edited by Raspaaja on Mon Mar 04, 2019 1:56 pm, edited 1 time in total.

Raspaaja
Posts: 7
Joined: Sun Feb 10, 2019 6:46 pm

Re: Raspberry not booting if USB keyboard not connected

Wed Feb 13, 2019 4:19 pm

A few additional observations:
  • I can plug in other USB keyboards and USB mice and they work nicely parallel with Logitech K400 (Wireless Touch keyboard)
  • If I leave the other USB mouse and keyboard connected and remove the Logitech dongle => no boot
  • If I add the Logitech dongle => The system boots nicely :?
It seems like somewhere there is a hard wired (config) setting that points to Logitech and does not allow me to boot without it.
Any idea where that could be and how to reset it? cmdline.txt and config.txt do not have anything related to USB devices :?:

Raspaaja
Posts: 7
Joined: Sun Feb 10, 2019 6:46 pm

Re: Raspberry not booting if USB keyboard not connected

Mon Mar 04, 2019 12:38 pm

Since without the Logitech dongle the boot does NOT seem to proceed beyond a certain point I tried the following:
  • Connected the serial port (UART) to my PC and used Putty to view the boot messages
  • When the Logitech dongle is connected I get a regular list of boot messages but
    when I remove the dongle I get no boot messages what so ever
  • I modified the bootcode.bin to allow me to see the early boot messages through the serial console, too (see: https://www.raspberrypi.org/documentati ... bootmodes/), thinking that since nothing happens if the dongle is not in place the problem has to happen before the CPU starts executing boot
  • Once again, if the dongle is in place I get a lot of early boot messages plus the standard ones,
    no dongle and I get nothing!
Thus, it seems like my hardware requires the Logitech dongle to be connected or otherwise it will not boot no matter what :cry:
Last edited by Raspaaja on Mon Mar 04, 2019 1:07 pm, edited 1 time in total.

User avatar
HawaiianPi
Posts: 4532
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Raspberry not booting if USB keyboard not connected

Mon Mar 04, 2019 12:56 pm

Have you checked the firmware in your Logitech Dongle (and any devices paired with it)? It might need an update.

I have a couple of Logitech K400r keyboards and several different mice (all Unifying). None have ever caused me any boot problems. I just shutdown the Pi 3B+ on my desk and pulled the dongle (and everything else connected to it, so it was truly headless). It booted right up and connected to my wireless network, and I was able to connect with SSH and RealVNC.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

Raspaaja
Posts: 7
Joined: Sun Feb 10, 2019 6:46 pm

Re: Raspberry not booting if USB keyboard not connected

Mon Mar 04, 2019 1:16 pm

Thanks! I had no idea that Logitech supports firmware updates on their dongles but I will check it out. Who knows, perhaps it helps even though you would think that since I am trying to boot the Pi without the dongle its firmware at that point should not matter (and with the dongle the Pi works just fine).

I do not need the keyboard/mouse pad to be turned on for the Pi to boot up normally. All this d*mn Pi needs is the dongle to be plugged in.
:shock:

UPDATE: I could not find any firmware updates for the dongle, there are some updates for specific Logitech keyboards and touchpads but not the one I have => No luck with this but thanks for the suggestion anyways!
Last edited by Raspaaja on Mon Mar 04, 2019 1:24 pm, edited 1 time in total.

klricks
Posts: 6544
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Raspberry not booting if USB keyboard not connected

Mon Mar 04, 2019 1:19 pm

Raspaaja wrote:
Mon Feb 11, 2019 9:08 am
....
Some things I have tried:
...
I don't see in your list the solution posted by sconemad above......
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

Raspaaja
Posts: 7
Joined: Sun Feb 10, 2019 6:46 pm

Re: Raspberry not booting if USB keyboard not connected

Mon Mar 04, 2019 1:30 pm

Sorry, tried that, too => Installed haveged (an entropy generator that does not need a mouse): sudo apt-get install haveged.
No change. Perhaps because I think that the entropy generator would not be run until much later in the boot sequence. My Pi does not even seem to run the initial boot code without the dongle (at least I do not get any early boot messages if the dongle is not in place).

Raspaaja
Posts: 7
Joined: Sun Feb 10, 2019 6:46 pm

Re: Raspberry not booting if USB keyboard not connected

Tue Mar 05, 2019 12:31 pm

I think this thing is starting to resolve itself. The suggestion to upgrade the firmware of the dongle made me think about the other (4TB ext4) HD connected to my Pi via Sabrent USB 3.0 flat HD dock. It has been working fine but then I checked if there are firmware updates for it and sure enough there was one. Updated the firmware and, voila, no need for the dongle anymore (however, now the HD is not recognized anymore, looks like the GPT would be corrupted). So the problem turned out to be Sabrent and not Logitech. Problem solved! Thanks to all who tried to help!

Plutogen
Posts: 1
Joined: Sun Mar 24, 2019 10:40 pm

Re: Raspberry not booting if USB keyboard not connected

Tue Mar 26, 2019 8:55 pm

Hi,

I have almost the same problem.
My RBP 3 with LAMP have trouble when I disconnect the keyboard from USB.
But in my case, RBP continues working except PHP. PHP pages stop working.
After three days testing conditions, I found that:
- when USB keyboard is attached, all work fine.
- when I disconnect keyboard (after smoothly shutdown RBP), and turn RBP on, PHP doesn´t work.

At this time, is working fine with keyboard connected, SSH putty, phpmyadmin, remote desktop, filezilla, webmin, all of them from internet, besides inside my LAN.

In my case, RBPi is booting without keyboard, but PHP doesn't work.
I don't know what it could be. I hope you can help me.


My RBP3 is configured with:

PHP 7.0
Apache 2
MariaDB (MySQL) 10.1.37
Debian version: 9.8
Kernel version: Linux raspberrypi2 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux

Return to “Troubleshooting”