Wi-Fi and keyboard problem


29 posts   Page 1 of 2   1, 2
by godFather89 » Sun Jun 17, 2012 11:12 pm
Hi,

I'm using the image from http://www.raspberrypi.org/phpBB3/viewtopic.php?f=50&t=8071. The setup is just a Pi in a lapdock. Now, sometimes, the last pressed key gets stuck or something like that. When I was using the Debian image from the Download section, the keyboard was working ok.

A 2nd problem is with wireless. When I connect an USB - Wireless adapter (Tp-Link TLWN723N to the lapdock USB port, ethernet drops and dmesg outputs a lot of "kevent 4 may have been dropped" error messages. When I remove the adapter, it goes back to normal (keyboard issue remains). Also tried connecting the USB adapter directly to the Pi USB (shorted the fuse) but it's the same issue. The voltage on the USB is a steady 4.88V (using a multimeter), when connected directly to the Pi, so I doubt it to be a power issue.

Thanks
Posts: 150
Joined: Fri May 18, 2012 9:40 am
Location: Timisoara, RO
by godFather89 » Mon Jun 18, 2012 9:51 am
I did some more researching and it's not a power issue. If I leave the power from the lapdock but the data lines (to the lapdock internal hub) are disconnected and the Wireless adapter connected to the Pi it works just fine! Of course I can't use the keyboard on the lapdock...

Could this be caused by improper shielding on the USB data lines?
Posts: 150
Joined: Fri May 18, 2012 9:40 am
Location: Timisoara, RO
by RaTTuS » Mon Jun 18, 2012 9:58 am
key press issues are power related.
I have a setup where with one keyboard [keysonic micro one] works fine, if I use a dell with usb ports it will kernel panic and a full sized simple one it works 90% of the time and 10% will give me repeated keys
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX - Prosliver FTW
"That's not right, the badgers have moved the goalposts."
User avatar
Posts: 4166
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
by godFather89 » Mon Jun 18, 2012 10:04 am
My problem is not power related.
Setup1:
-raspberry draws power from lapdock
-lapdock USB data lines connected to RPI
-Wi-Fi stick connected to raspberry

Setup 2:
-raspberry draws power from lapdock
-lapdock USB data lines not connected to RPI
-Wi-Fi stick connected to raspberry

Setup 2 works but Setup 1 does not (a lot of error messages in dmesg)! Voltage is the same in both cases.
Posts: 150
Joined: Fri May 18, 2012 9:40 am
Location: Timisoara, RO
by piglet » Mon Jun 18, 2012 10:12 am
You're quite lucky that your WiFi dongle works when plugged directly into the pi in any configuration. Most people can't get that working as dongles tend to draw more than the 100mA allowed.

There are real problems with the USB part of the Pi. The driver has been identified as accounting for about 20% of CPU use, and there are threads all over the forum detailing various issues and partial workarounds.
User avatar
Posts: 538
Joined: Sat Aug 27, 2011 1:16 pm
by godFather89 » Mon Jun 18, 2012 10:16 am
Not really. I wrote in the 1st post that I shorted the fuse on that USB port.
Posts: 150
Joined: Fri May 18, 2012 9:40 am
Location: Timisoara, RO
by godFather89 » Mon Jun 18, 2012 11:23 am
And again some more testing:

I connected the USB - Wireless adapter to the lapdock and connected the lapdock USB to my computer. Everything works well (Wireless adapter, keyboard, touchpad).

Just removed the cable from my computer and attached it to the Pi and it does not work anymore (keyboard with glitches, wireless no, a lot of error messages: eth0 could not read register...).

So this is surely a software problem, or the onboard USB hub is problematic.

Is there a way to jump over the USB hub on the board so I could rule out a possibility?
Posts: 150
Joined: Fri May 18, 2012 9:40 am
Location: Timisoara, RO
by godFather89 » Mon Jun 18, 2012 11:33 am
I just took a look over the schematics and it seems that shorting R36 R37 will give the USB connection from the SoC to a USB port. Should this be ok?
Posts: 150
Joined: Fri May 18, 2012 9:40 am
Location: Timisoara, RO
by godFather89 » Mon Jun 18, 2012 3:47 pm
So, is there any way to bypass the onboard USB hub?
Posts: 150
Joined: Fri May 18, 2012 9:40 am
Location: Timisoara, RO
by godFather89 » Mon Jun 18, 2012 7:13 pm
Got it working finally!!!

I removed the onboard USB HUB (+ethernet) and everything works perfect now. I just did an update over wireless.
So, I turned my model B in a model A.This is good in 2 ways: wireless works and power consumption should be much lower, since the chip was drawing lots of power (dissipating lot of heat).
So, again, it was not a power problem!

I think that this is a very big issue that needs to be fixed!
Posts: 150
Joined: Fri May 18, 2012 9:40 am
Location: Timisoara, RO
by Nizze » Wed Jun 20, 2012 6:23 am
godFather89 wrote:Got it working finally!!!

I removed the onboard USB HUB (+ethernet) and everything works perfect now. I just did an update over wireless.
So, I turned my model B in a model A.This is good in 2 ways: wireless works and power consumption should be much lower, since the chip was drawing lots of power (dissipating lot of heat).
So, again, it was not a power problem!

I think that this is a very big issue that needs to be fixed!


Can u tell how u did that ??

Br
Nizze
Posts: 3
Joined: Tue Jun 12, 2012 8:57 am
by godFather89 » Wed Jun 20, 2012 8:40 am
I used my hot air soldering station to remove the chip near USB. Because Ethernet was built in the chip, I also removed the Ethernet port and the chip's oscillator (didn't verify if it was an oscillator or just a quartz). Also the USB ports were useless (I routed USB to micro USB connector) so I removed them too. RCA and Audio jack were removed because I have no use for either and they where big. Maybe I will adapt some smaller connectors.

I will post some images with the stripped board.

I don't recommend anyone to do it themselves, especially if they are not experienced with electronics.
Posts: 150
Joined: Fri May 18, 2012 9:40 am
Location: Timisoara, RO
by hehe2 » Thu Jun 21, 2012 12:44 pm
Hi,

I received my RPi (model 2) yesterday (including the SD with the pre-installed image) and I couldn't login :x

I have "sticky" keys (mostly the ENTER key) which prevents me from log in...

I will try to use another USB keyboard tonight (since mine, the new QPAD MK-85 with illuminated keys must be too power consuming ;) and I hope this will work since this is sad to be stuck on the login prompt...

I wish I could get the RPi some more juice...

Do you know if I could try the "asus transformer TF101" charging plug ?
It has a USB conector but delivers much, much more power (voltage -- around 15/19V I think -- and power as well).

I don't want to burn the Pi doing it so...

Otherwise, is there some "compatibility" keyboards list somewhere ?

Regards,
Posts: 4
Joined: Thu Jun 21, 2012 12:32 pm
Location: Paris, FRANCE
by godFather89 » Mon Jun 25, 2012 8:30 am
The keyboard problem is likely to be a power problem. Try using a powered USB hub.

Do you know if I could try the "asus transformer TF101" charging plug ?
It has a USB conector but delivers much, much more power (voltage -- around 15/19V I think -- and power as well).

Are you sure it has an USB connector with 15/19V? I don't think so, this could be very risky since you could plug it into different devices and blow them apart.
If it's over 5.25V, don't use it!
Posts: 150
Joined: Fri May 18, 2012 9:40 am
Location: Timisoara, RO
by rrolsbe » Thu Jun 28, 2012 3:06 pm
I posted this on one of the LapDock Raspberry Pi blogs. Thought I would post it in this thread to get more exposure and hopefully help out others and solve my final problem.

My USB Wifi adapter does work when directly plugged into one of the Pi's USB ports but only if I do NOT have a USB data only cable (from the other Pi USB hub port) connection to the Lapdock microUSB port. With this configuration, I can only use the LapDock as a display device (ie.. no keyboard/trackpad). There is a conflict somewhere?? If anyone has their Wifi device functioning with the LapDock and can use the LapDock keyboard/trackpad please chime in. I can confirm that the two standard LapDock USB ports appear to supply enough power to operate the Pi; however, not enough power when my Wifi adapter is plugged into one of the Pi USB hub ports.

If the USB conflict described above can be resolved, I think the Wifi adapter would work plugged into one of the LapDock standard USB ports (dmesg shows the Wifi was identified but I get firmware load/kernel errors). NOTE: I can plug any other USB device (SSD/Flash Drive/Mouse/Keyboard) into the LapDock and they all work as expected. Since the WiFi device should be getting enough power when plugged into the standard LapDock USB ports and all other devices work fine, what is different with the Wifi device????

Regards, Ron
Posts: 40
Joined: Fri Aug 12, 2011 4:09 pm
by twasiluk » Wed Jul 04, 2012 9:01 pm
godFather89 wrote:I will post some images with the stripped board.


Could you post some pictures of the removed chip and how you routed usb to the microusb port? Did you have any more problems connecting many usb devices to your lapdock afterwards?

I'm having the same issues that you were having. Connecting more than 2 devices caused some other devices to stop working (be it other usb dongles or the ethernet device). I'm also thinking of getting that chip removed from my pi. I only have traditional soldering skills, but I'm willing to give hot air a chance to ruin my pi since it doesn't work anyway. Evaluating switching to MK802.
Posts: 5
Joined: Fri Jun 29, 2012 6:21 pm
by godFather89 » Wed Jul 04, 2012 9:17 pm
Unfortunately the board is pretty much covered in duct tape (to hold the battery and a switching 3.3V regulator) so there is not much to see (I really need to make a case). All you need to do is unsolder the hub/ethernet chip and short R36/R37 (double check on the schematics because I'm not sure). This will give you the USB connection in the bottom USB connector.
I have no USB ports on the board anymore so I routed those 2 data lines from the USB to the micro USB specific pins (pinout can be found on Internet).
I have absolutely no problem with the USB now. Everything works just fine and I have keyboard + touchpad (internal lapdock connection), wi-fi dongle and memory stick (when I need it) all connected to USB.
Posts: 150
Joined: Fri May 18, 2012 9:40 am
Location: Timisoara, RO
by Robpol86 » Wed Jul 18, 2012 7:34 pm
Sorry about reviving this semi-old thread but I think I found a software solution: disable the ethernet adapter.

Run this command before plugging in your wifi adapter:
Code: Select all
echo 1-1.1:1.0 > /sys/bus/usb/drivers/smsc95xx/unbind


Immediately afterwards the ethernet adapter will stop functioning, and inserting a WiFi adapter (I used an RTL8187 adapter, specifically the Alfa AWUS036H) didn't cause the smsc95xx errors in dmesg, and I was able to do iwlist wlan0 scan!

I'm not too familiar with debian yet so I'm not sure which file, but you'll have to insert that echo command in some start-up script, since it does not persist over reboots.

Finally I can use the USB ports for WiFi on my Atrix Lapdock!

My source: viewtopic.php?t=10945&p=121684
User avatar
Posts: 9
Joined: Wed Jul 18, 2012 7:29 pm
Location: Austin, TX
by Robpol86 » Thu Jul 19, 2012 6:18 am
I wrote an init script so I can easily enable/disable the NIC:

To enable the script during boot, run: sudo insserv disable-ethernet
To disable the script from running during boot: sudo insserv -r disable-ethernet
To disable Ethernet and fix WiFi, run: sudo service disable-ethernet start
To re-enable Ethernet (be sure to remove the WiFi device before running), run: sudo service disable-ethernet stop

Here is the script. Save it in /etc/init.d/disable-ethernet and then run sudo chmod 755 /etc/init.d/disable-ethernet:
Code: Select all
#!/bin/bash
 
### BEGIN INIT INFO
# Provides:          disable-ethernet
# Required-Start:    $local_fs
# Required-Stop:     
# Default-Start:     S
# Default-Stop:     
# Short-Description: Disables on-board Ethernet to fix WiFi+Lapdock
# Description:       When using the Raspberry Pi Model B on the
#                    Motorola Atrix Lapdock, inserting certain WiFi
#                    adapters into either the RPi's spare USB port or
#                    the Lapdock's USB ports causes the on-board
#                    Ethernet and WiFi adapter to malfunction.
#                    Disabling the on-board Ethernet driver allows
#                    the WiFi adapter to work simultaneously with the
#                    Lapdock.
### END INIT INFO
 
. /lib/lsb/init-functions
 
DEVICE_DIR=/sys/bus/usb/drivers/smsc95xx
BUS_ID="1-1.1:1.0"
INT_TOGGLE=true #issue ifdown and ifup?
#INT_TOGGLE=false
 
is_enabled () {
    [ -L "$DEVICE_DIR/$BUS_ID" ] && return 0 || return 1
}
 
toggle_int () {
    is_enabled || return 0 #ethernet not enabled
    [ "$(ls -1 "$DEVICE_DIR/$BUS_ID/net" |wc -l)" -eq "1" ] || return 0 #something wrong
    $INT_TOGGLE || return 0 #user doesn't want this
    [ ! -f /run/network/ifstate ] && return 0 #run level S
    int_name=$(ls -1 "$DEVICE_DIR/$BUS_ID/net")
    if [ "$1" == "up" ]; then
        log_action_begin_msg "Bringing on-board interface up"
        ifup $int_name
    else
        log_action_begin_msg "Bringing on-board interface down"
        ifdown $int_name
    fi
    log_action_end_msg $?
}
 
case "$1" in
    start)
        if ! is_enabled; then
            log_failure_msg "Service already running. Exiting."
            exit 0
        fi
        toggle_int down
        log_action_begin_msg "Disabling on-board network interface"
        echo "$BUS_ID" > $DEVICE_DIR/unbind
        log_action_end_msg $?
        exit $?
        ;;
    restart|reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;
    stop)
        if is_enabled; then
            log_failure_msg "Service not running. Exiting."
            exit 0
        fi
        log_action_begin_msg "Enabling on-board network interface"
        echo "$BUS_ID" > $DEVICE_DIR/bind
        log_action_end_msg $?
        toggle_int up
        exit $?
        ;;
    status)
        if is_enabled; then
            echo "Service is NOT running: on-board interface enabled" >&2
            exit 1
        else
            echo "Service is running: on-board interface disabled"
            exit 0
        fi
        ;;
    *)
        echo "Usage: $0 start|stop|status" >&2
        exit 3
        ;;
esac
User avatar
Posts: 9
Joined: Wed Jul 18, 2012 7:29 pm
Location: Austin, TX
by gregeric » Fri Jul 20, 2012 9:09 am
Hi Robpol86 & many thanks for this fix - finally got wifi on my Pi + Lapdock.

Will post a link pointing here in the main Lapdock thread.
Posts: 73
Joined: Mon Nov 28, 2011 10:08 am
by Lob0426 » Fri Jul 20, 2012 3:42 pm
@Robpol86: Good work. I will give it a try. It will be nice to lose the last hindrance to going totally mobile with my RasPi.
Back-powered 256MB as WordPress Server
Motorola Lapdock with 512MB
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!
User avatar
Posts: 1868
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
by Lob0426 » Fri Jul 20, 2012 5:06 pm
I tried the command and it works well. I will try the script a little later.
Again Good work.
Back-powered 256MB as WordPress Server
Motorola Lapdock with 512MB
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!
User avatar
Posts: 1868
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
by gregeric » Tue Jul 24, 2012 8:28 am
Finally got round to trying the script - works flawlessly. Thanks again.

I did have an issue copy/pasting the init script from Raspbian/Midori - rogue C2 A0 hex characters appeared after line breaks and between spaces, stopping he script from running. Copy/pasting from Chromium and all is well :D
Posts: 73
Joined: Mon Nov 28, 2011 10:08 am
by kzkz » Tue Aug 07, 2012 8:05 pm
Thanks for the solution, you saved my life! :)

But I have problem with the script, I get errors:

root@raspberrypi:/etc/init.d# service disable-ethernet stop
: not found/disable-ethernet: 2: /etc/init.d/disable-ethernet:
: not found/disable-ethernet: 19: /etc/init.d/disable-ethernet:
/etc/init.d/disable-ethernet: 20: .: Can't open /lib/lsb/init-functions
Posts: 1
Joined: Tue Aug 07, 2012 8:02 pm
by Robpol86 » Thu Aug 09, 2012 11:32 pm
That's odd. Are you running the 2012-07-15-wheezy-raspbian image?

Can you post the output of:
ls -lah /etc/init.d/disable-ethernet
file /etc/init.d/disable-ethernet
User avatar
Posts: 9
Joined: Wed Jul 18, 2012 7:29 pm
Location: Austin, TX