amyren
Posts: 91
Joined: Tue Jun 12, 2012 10:49 am

USB wireless keyboard connection issues

Fri Sep 28, 2012 9:33 am

I do have the Logitech k400 wireless keyboard (integrated touchpad) connected to the Pi.
Most times it works ok. But often (say 1 out of 3 times) the keyboard/mouse doesnt connect. on boot.

It looks like the usb dongle is detected (from the console text output). If I dont touch anything, it does boot into xbmc by default.
To check I press space on the keyboard to see if the keyboard responds during bootup. If it doesnt respond it does help to quickly unplug and plug the usb dongle. Then the keyboard starts working again.
If I let it launch xbmc without working keyboard it doesnt seem to help to replug the dongle.

I have the dongle plugged in the powered usb-hub, but it does behave the same if I plug it directly in the Pi usb.

This will happen both if I reboot or from a cold start. But for the reboot, it looks like the situation have improved a bit after some of the later firmware updates. Because before it happened almost every time after a reboot, now not so often.

Does anyone else experience similar problems, or have a solution for this?

Genius23008
Posts: 54
Joined: Sun Jun 03, 2012 6:50 am

Re: USB wireless keyboard connection issues

Fri Sep 28, 2012 8:02 pm

Try running XBMC off the new Wheezy image. The Wheezy image now has USB fixes to stop interruptions, so I think that's worth a shot. But before that, are you running the dongle off the Pi or off a hub? You should run it off a hub, since the Pi is unlikely to give enough power to it (I think each port is 120mAH, I dunno).

amyren
Posts: 91
Joined: Tue Jun 12, 2012 10:49 am

Re: USB wireless keyboard connection issues

Sat Sep 29, 2012 9:14 am

Genius23008 wrote:Try running XBMC off the new Wheezy image. The Wheezy image now has USB fixes to stop interruptions, so I think that's worth a shot. But before that, are you running the dongle off the Pi or off a hub? You should run it off a hub, since the Pi is unlikely to give enough power to it (I think each port is 120mAH, I dunno).
Thanks for the reply. I do think I have these latest fixes. I have done updating my raspian wheezy regularly by apt-get update/upgrade and also ran the rpi-update tool. I think this equals the latest image.
I have noticed that the problem have gotten better after some of these updates. But the problem is not entirely gone.

As for powered hub, I do use one. Although the dongle does work the same way if connected directly to the Pi. I think I stated this in my first post already.

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: USB wireless keyboard connection issues

Sat Sep 29, 2012 9:30 am

Yes, you stated it in your first post.
Similar problems, yes...
A solution? You could try to set the Pi usb system to usb 1.1 speed.
It will also decrease the network speed.
Some say a power supply with a bit higher voltage helps. I doubt about that, but if you have some it's worth a try.
If you care reading about the usb packet loss and the usb elephant, you might get a better understanding of the issue.

MaxK1
Posts: 1043
Joined: Sun Aug 26, 2012 11:34 pm

Re: USB wireless keyboard connection issues

Sat Sep 29, 2012 12:00 pm

I posted a possible workaround for this in another thread
http://www.raspberrypi.org/phpBB3/viewt ... 28&t=16307

I don't know if it worked reliably for everyone, but it did for at least a few people.
You are in a maze of twisty little passages, all alike.
When General Failure and Major Disaster get together, Private Parts usually suffers.

amyren
Posts: 91
Joined: Tue Jun 12, 2012 10:49 am

Re: USB wireless keyboard connection issues

Sat Sep 29, 2012 6:34 pm

MaxK1 wrote:I posted a possible workaround for this in another thread
http://www.raspberrypi.org/phpBB3/viewt ... 28&t=16307

I don't know if it worked reliably for everyone, but it did for at least a few people.
Thanks. That was a long thread, I dont have time to read the full thread now, but I noticed these three suggestions in some of the later posts.

Was it this you was refering to?

Maybe something like this in /etc/rc.local: (just for somewhere to put it so it can be tested)
rmmod hid-logitech-dj
modprobe hid-logitech-dj
****
Try adding dwc_otg.fiq_fix_enable=1 and/or dwc_otg.microframe_schedule=1 to /boot/cmdline.txt (all on one line)
****
I'll assume(!) everything is up-to-date. One last shot - try putting
sleep 10
before the rmmod and modprobe.

MaxK1
Posts: 1043
Joined: Sun Aug 26, 2012 11:34 pm

Re: USB wireless keyboard connection issues

Sat Sep 29, 2012 6:41 pm

Yep - that's it. Like I said, it worked pretty well for most. Fixing the USB driver _should_ fix it
properly. Good luck!
You are in a maze of twisty little passages, all alike.
When General Failure and Major Disaster get together, Private Parts usually suffers.

amyren
Posts: 91
Joined: Tue Jun 12, 2012 10:49 am

Re: USB wireless keyboard connection issues

Mon Oct 01, 2012 6:27 am

MaxK1 wrote:Yep - that's it. Like I said, it worked pretty well for most. Fixing the USB driver _should_ fix it
properly. Good luck!
I did try all three, ut it didnt change anything.

btw. When is that rc.local executed anyway?
I did try to set the sleep to 20, just to see what happens, but I cant say I notice any 20 second delay any place in the booting time.
I have set my installation to boot into xbmc by default, unless I type anything the keyboard to interupt it. Maybe my rc.local doesnt execute at all because of this?

MaxK1
Posts: 1043
Joined: Sun Aug 26, 2012 11:34 pm

Re: USB wireless keyboard connection issues

Mon Oct 01, 2012 9:12 am

What distro are you using? /etc/rc.local is usually the last startup script that runs before you get
the login prompt. That you don't see a 20 second delay suggests it isn't being executed. How and where do you have it set up to run XBMC?
You are in a maze of twisty little passages, all alike.
When General Failure and Major Disaster get together, Private Parts usually suffers.

amyren
Posts: 91
Joined: Tue Jun 12, 2012 10:49 am

Re: USB wireless keyboard connection issues

Mon Oct 01, 2012 6:01 pm

MaxK1 wrote:What distro are you using? /etc/rc.local is usually the last startup script that runs before you get
the login prompt. That you don't see a 20 second delay suggests it isn't being executed. How and where do you have it set up to run XBMC?
I'm using the raspian wheezy from 16 aug. And have made updates regularly on this image.
First I used raspi config to set it to launch startx in boot. Later I installed the xbmc (tomaz version) from a guide I found. "How to install xbmc on Raspian" or something. During installing xbmc I set it to launch xbmc automaticly on boot (unless iterupted with keyboard). There is a 5 second delay after all regular startup messages and at this time I must press a key to go to the prompt instead of xbmc.

.. I can see where this is going now... You guys will probably suggest I start from scratch againg with the latest raspian wheezy and I have to try to set up everything all over again :)

MaxK1
Posts: 1043
Joined: Sun Aug 26, 2012 11:34 pm

Re: USB wireless keyboard connection issues

Mon Oct 01, 2012 6:17 pm

Not at all... Just trying to figure out where else you could put the rmmod/insmod to be sure it is executed.
From what you have described, it _should_ be running it. Unless rc.local is not executable, I can't think of a reason it wouldn't run. Could you check that?
You are in a maze of twisty little passages, all alike.
When General Failure and Major Disaster get together, Private Parts usually suffers.

amyren
Posts: 91
Joined: Tue Jun 12, 2012 10:49 am

Re: USB wireless keyboard connection issues

Thu Oct 04, 2012 4:13 pm

MaxK1 wrote:Not at all... Just trying to figure out where else you could put the rmmod/insmod to be sure it is executed.
From what you have described, it _should_ be running it. Unless rc.local is not executable, I can't think of a reason it wouldn't run. Could you check that?
sorry for the delay, I've been away for a few days.
The file is executable.
But it was my fault, because now I noticed that I have added those two lines at the end of the file, instead of putting them before the exit 0 line. Putting them at the end of the file obviously prevented them to be executed. I have edited the file, and put a sleep 10 just so I could check that it did wait for ten seconds.
On the first reboot the keyboard worked fine, I will try this for a few days and see how it works out.

MaxK1
Posts: 1043
Joined: Sun Aug 26, 2012 11:34 pm

Re: USB wireless keyboard connection issues

Thu Oct 04, 2012 4:17 pm

Blame it on the keyboard.... :D

Glad it worked for you!
You are in a maze of twisty little passages, all alike.
When General Failure and Major Disaster get together, Private Parts usually suffers.

amyren
Posts: 91
Joined: Tue Jun 12, 2012 10:49 am

Re: USB wireless keyboard connection issues

Fri Oct 05, 2012 6:26 am

MaxK1 wrote:Blame it on the keyboard.... :D

Glad it worked for you!
I did some "stress test" today, I must have restarting the system more than 10 times (plus about 5 times yesterday) and it does work 100% every time.
I even tested this morning when cold booting to just let the Pi finish booting up, and waited until xbmc was fully loaded before switching on the keyboard. This was to check what happended if it didnt get a chance to pair the keyboard and the dongle units during startup. It still worked as soon as I swicthed the keyboard on.
Thanks for all help :)

Return to “Troubleshooting”