allampanato
Posts: 14
Joined: Wed Oct 09, 2019 2:06 pm

Problem: RPi Zero and keyboard

Sat Oct 12, 2019 4:19 pm

Hi, I tried ( for the first time ) the RPi Zero today ( I bought the W variant ). If I start it without a keyboard connected, it works ( but without keyboard I cannot even login ). If I connect the USB keyboard ( a logitech bluetooth keyboard ) to one port and the power source to the other, it doesn't start ( no green led, nothing ). If I start the Pi and connect the keyboard to the other usb port, it powers off instantly. The power source is a 5V 2.4A power supply. I have tried with another power supply ( also 5V 2.0A ) but no luck. Keep in mind that I use these power supplies even with RPi 3 and it works like a charm ( ok, it shows warnings about voltage when I start the camera, with wifi on ).

Is this normal behaviour?

User avatar
rpdom
Posts: 15608
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Problem: RPi Zero and keyboard

Sat Oct 12, 2019 4:25 pm

I'd say there was something wrong with the keyboard or the USB cable/adaptor you are using. The Pi Zero W needs less than 300mA to start up and idle.

The power is connected directly from the PWR USB socket to the Data USB socket, and as the problem occurs when you connect the keyboard it definitely points at that.

Why does a Bluetooth keyboard need to be plugged in to the Pi anyway? Surely it just uses a Bluetooth wireless connection.

allampanato
Posts: 14
Joined: Wed Oct 09, 2019 2:06 pm

Re: Problem: RPi Zero and keyboard

Sat Oct 12, 2019 4:43 pm

rpdom wrote:
Sat Oct 12, 2019 4:25 pm
Why does a Bluetooth keyboard need to be plugged in to the Pi anyway? Surely it just uses a Bluetooth wireless connection.
Is Raspbian, in its default configuration, able to recognize and usb a bluetooth keyboard? Because without a keyboard I cannot even configure Raspbian. I was thinking of setting up the net and connect to the RPi through ssh. But with no keyboard, I cannot even configure it.

Also, I have read about problems with otg cables. I don't know if the adapter ( micro-USB/USB ) I am using is otg or not. I bought a kit with everything in it.

Maybe I should try buying another adapter.

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

Re: Problem: RPi Zero and keyboard

Sat Oct 12, 2019 5:13 pm

allampanato wrote:
Sat Oct 12, 2019 4:43 pm
I was thinking of setting up the net and connect to the RPi through ssh. But with no keyboard, I cannot even configure it.
Sure you can.

After writing a Raspbian image to your card with Etcher, remove and re-insert the card into your main PC, ignore/cancel any messages about the card needing to be formatted, and you should see the Raspbian card's "boot" partition in your file manager.

Open that and create a file named ssh (or ssh.txt). The file can be empty, the contents don't matter.

Create another file named wpa_supplicant.conf with the following inside.

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB

network={
	ssid="WiFi SSID"
	psk="WPA/WPA2 passphrase"
	key_mgmt=WPA-PSK
}
Edit country=, ssid= and psk= with your information and save the file.

That's it. Safely eject the card and use it to boot your Pi. Assuming you did everything correctly, your Pi will boot and connect to your WiFi with SSH enabled. You can try SSH into pi@raspberrypi.local (or pi@raspberrypi), and if that doesn't work, you can log into your router and look for your Pi's IP address in the list of connected clients (or use a network scanner app, like Fing for smartphones).


USB Ethernet Gadget Mode:
Another option is to configure the Pi Zero as a USB Ethernet gadget and SSH in over USB. I have a pre-configured Raspbian image for that if you want to try it. Here's the Raspbian Buster Lite 2019-09-26 image with the USB Ethernet Gadget Mode edits pre-applied.
https://drive.google.com...2019-09-26-raspbian-buster-lite_Pi0USB.zip

This image was tested on my Pi Zero W and my Windows 10 laptop.

Notes:
You need to connect the Pi Zero to your main PC with a normal micro USB data cable plugged into the Pi Zero's USB data port, which is the one closest to the HDMI port, and nothing should be connected to the Pi Zero's power port.

Assuming you are using Windows, you should see a new USB Ethernet/RNDIS network adapter in Device Manager.

The Pi Zero can take over a minute to boot the first time, so wait 90 seconds or so before you try and SSH in (pi@raspberrypi.local).

To configure USB Ethernet Gadget Mode yourself, start with a freshly imaged Raspbian SD card and make the following edits.
  1. Add dtoverlay=dwc2 to the bottom of config.txt on a new line.
  2. Edit cmdline.txt and insert modules-load=dwc2,g_ether after rootwait, leaving only a single space before and after.
  3. Create an empty file named ssh (or ssh.txt).
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?

alphanumeric
Posts: 2181
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Problem: RPi Zero and keyboard

Sat Oct 12, 2019 5:47 pm

I connect my Logitech K400 to my Pi Zero's with its Unifying dongle with no issues.
I use the adapter in this kit, https://shop.pimoroni.com/products/pi-z ... rter-kit
And this USB Hub, https://shop.pimoroni.com/products/thre ... onnector
Logitech says its Bluetooth, but I think its a proprietary Bluetooth. I have yet to ever get one that uses Unifying to link without it on a Windows PC.
Its been posted that you can do it on a Pi, I haven't tried to as of yet though. This keyboard gets used on multiple setups so I just move the dongle with it.

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

Re: Problem: RPi Zero and keyboard

Sat Oct 12, 2019 6:02 pm

I also use a Logitech K400r keyboard with trackpad and Unifying dongle. It's nice because you don't really need a hub since the keyboard has an integrated trackpad (and you can even pair an additional mouse to the same dongle if desired). I use one of those shim type OTG adapters that fits insise of a USB-A plug.

FYI:
Logitech Unifying products are not Bluetooth (they do have some products that support both, so that may be where the confusion is).
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?

alphanumeric
Posts: 2181
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Problem: RPi Zero and keyboard

Sat Oct 12, 2019 6:14 pm

The integrated trackpad is why I like the K400. In a pinch its all you need. Not a bad size either.
Yeah, I've bought keyboard mouse combo's, unlinked the keyboard and then linked it to my M570 Trackball. Then gave the mouse and dongle to my father. He then links his Logitech keyboard to his nice shiny new mouse. ;)

One thing I have noticed with a Zero is if its booted up, and you swap or plug something into the USB DATA port it has a habit of rebooting. Kind of depends on the device. It was one reason I switched to using the USB HUB I linked to above. With the HUB in place it doesn't reboot when I plug something into the HUB.

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

Re: Problem: RPi Zero and keyboard

Sat Oct 12, 2019 10:53 pm

alphanumeric wrote:
Sat Oct 12, 2019 6:14 pm
One thing I have noticed with a Zero is if its booted up, and you swap or plug something into the USB DATA port it has a habit of rebooting.
That seems to be a problem with the newer models. There must have been some hardware change that was not accompanied by a revision change (same v1.1 revision number as 2016 model), but they do have a newer date on them (2017), and those are the ones with the rebooting issue when hot swapping USB devices (from what I've been reading in threads here).
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?

allampanato
Posts: 14
Joined: Wed Oct 09, 2019 2:06 pm

Re: Problem: RPi Zero and keyboard

Sun Oct 13, 2019 9:12 am

alphanumeric wrote:
Sat Oct 12, 2019 5:47 pm
I connect my Logitech K400 to my Pi Zero's with its Unifying dongle with no issues.
I use the adapter in this kit, https://shop.pimoroni.com/products/pi-z ... rter-kit
I am using the same hardware. Logitech K400+ and a usb mini/regular size adapter that looks exactly like that one.

alphanumeric
Posts: 2181
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Problem: RPi Zero and keyboard

Sun Oct 13, 2019 9:17 am

HawaiianPi wrote:
Sat Oct 12, 2019 10:53 pm
alphanumeric wrote:
Sat Oct 12, 2019 6:14 pm
One thing I have noticed with a Zero is if its booted up, and you swap or plug something into the USB DATA port it has a habit of rebooting.
That seems to be a problem with the newer models. There must have been some hardware change that was not accompanied by a revision change (same v1.1 revision number as 2016 model), but they do have a newer date on them (2017), and those are the ones with the rebooting issue when hot swapping USB devices (from what I've been reading in threads here).
It's been a while since its happened to me. I'm trying to remember if it was a Zero or Zero w. I think it was a Zero but my memory isn't what it used to be. I had bought one with the adapter kit, only way I could get one all the singles were sold out. Anyway with the adapter / dongle in the kit you only have the one USB port to play with. I think I had forgotten to plug in my keyboard dongle and when I did it immediately rebooted. Like if I had grounded the RUN pin. Happened to me a couple of times and I then bought my HUB with a micro USB jack on it. No having to use the adapter. Hasn't been an issue since.

allampanato
Posts: 14
Joined: Wed Oct 09, 2019 2:06 pm

Re: Problem: RPi Zero and keyboard

Sun Oct 13, 2019 9:19 am

Update: Connected an usb ethernet nic. No problem. Then connected only the usb adapter. No problem. When I connect the Logitech dongle, BOOM! Interesting...

Maybe not enough power!?! The supply is rated at 2.4A, but it is a chinese thing...humm...

alphanumeric
Posts: 2181
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Problem: RPi Zero and keyboard

Sun Oct 13, 2019 9:36 am

Does that dongle / keyboard work OK on a PC?
I've used various supplies with my Zero's without issues. 2A, 2.5A. Some were 5V and some were 5.1V. These days I just buy the official power supply and be done with it. Especially if its a 3B or 4B. One less thing to worry about or wonder about.
That being said, I wouldn't think that dongle draws all that much current? I'm kind of thinking there may be something amiss on that Pi Zero?

BeauSlim
Posts: 71
Joined: Mon Jul 31, 2017 10:02 am

Re: Problem: RPi Zero and keyboard

Sun Oct 13, 2019 5:09 pm

It might be some weird incompatibility. I have a couple Rii keyboards (i28 and k12+), both with little wireless adapters. Both worked fine under Stretch. Only the k12 works under Buster. I haven't had time to debug.

alphanumeric
Posts: 2181
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Problem: RPi Zero and keyboard

Sun Oct 13, 2019 6:40 pm

I have a CanaKit branded Mini Wireless that I believe is a Rii, or Rii clone maybe. Model CK.KB-101. I haven't tried it in Buster yet but it works fine in Jessie and Stretch with its included dongle.
One advantage to the Logitech Unifying dongle is as far as the PC is concerned, its just a USB HID device. It has no idea its wireless. I can access my PC's BIOS with it no problem.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12416
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Problem: RPi Zero and keyboard

Sun Oct 13, 2019 6:55 pm

HawaiianPi wrote:
Sat Oct 12, 2019 10:53 pm
alphanumeric wrote:
Sat Oct 12, 2019 6:14 pm
One thing I have noticed with a Zero is if its booted up, and you swap or plug something into the USB DATA port it has a habit of rebooting.
That seems to be a problem with the newer models. There must have been some hardware change that was not accompanied by a revision change (same v1.1 revision number as 2016 model), but they do have a newer date on them (2017), and those are the ones with the rebooting issue when hot swapping USB devices (from what I've been reading in threads here).
Rebooting when plugging some USB device in, while the PI is already running, is normal with a RPI Zero, the same thing happened with the original RPI 1.
When you "hot plug" an USB device in, on a zero, the zero's boards power collapses, because you suddenly connect a large(-ish) discharged capacitor, (on the 5V rail of the USB device you plug in) in parallel to the similar sized capacitance on the Zero. The zero sees this as a "short" of the 5V line (for a very short time, but long enough to crash a computer).

Charges on both capacitors equal out, and the largest capacitor "wins".

For example with equal capacitances the voltage over both is suddenly reduced to half the original voltage, or 2.5V, which means the PI crashes.

Its called the "inrush current" problem, and later PI's all had some mechanism to reduce the inrush current so USB devices became "hot pluggable".

The are two solutions:

1) don't hot plug in USB devices.
2) do something to mitigate the voltage drop caused by hot plugging.

The second solution in practical terms, as limiting the current isn't really possible without putting a limiting device in between 5V and the USB device, would be to add a low impedance large capacitor over the 5V rail close to the USB connector. With large meaning something like 1000uF.
so that is why its not mounted on the zero already, because it would be physically large as well.

Another solution would be to use an USB hub, these generally have rush in current limitation solutions in place.

Return to “General discussion”