wifi dongle and ethernet side by side


10 posts
by rndbit » Sat Dec 22, 2012 9:04 am
I cant figure out how to get wifi dongle and ethernet cable connections work side by side.

When i connect ethernet cable it acquires ip via dhcp and everything works nice and dandy. However when i connect wifi dongle (RTL8188CU-based) then ethernet connection dies. Any way to make them both work at the same time?

Actual problem is this: i have no hdmi monitor and i want to set up wireless. However as soon as dongle is connected i loose any access to rpi and cant do thing. So i am limited to sort of blind guesswork that consists of connecting ethernet, doing changes via ssh, disconnecting ethernet, connecting dongle and testing. Spent good part of day doing that unsuccessfully.
Since new raspbian image contains drivers it seems everything should work just fine when set up via GUI, but im locked out of it since i have no hdmi monitor and no access to vnc when dongle is connected..
Posts: 5
Joined: Fri Dec 21, 2012 6:21 pm
by Mobius » Sat Dec 22, 2012 3:36 pm
The easy way to resolve the issue is to set both devices to use different static IP addresses instead of using DHCP. I actually have that set up on my pi and can use both ethernet and wireless connections at the same time if I so desire.
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA
by Joe Schmoe » Sat Dec 22, 2012 4:32 pm
Re: Your actual problem: You will get it working eventually. That's really all any of these things ever boil down to: Keeping banging on it until it starts to work.

But, here's a suggestion: Get serial working. This solves the "how do I access the board when I don't have a monitor and I don't have (reliable) network connections (yet)" problem.

Start by buying one of these:

http://www.suntekstore.com/goods-140026 ... p2102.html


($4.35). With the Pi, that's all you need. It comes with the jumpers you need - connect them to your GPIO and you're good to go.
Never answer the question you are asked. Rather, answer the question you wish you had been asked.

- Robert S. McNamara - quoted in "Fog of War" -
Posts: 2267
Joined: Sun Jan 15, 2012 1:11 pm
by rndbit » Sat Dec 22, 2012 8:17 pm
Mobius wrote:The easy way to resolve the issue is to set both devices to use different static IP addresses instead of using DHCP. I actually have that set up on my pi and can use both ethernet and wireless connections at the same time if I so desire.


i tried that but still this odd thing is happening.
/etc/network/interfaces
Code: Select all
auto lo

iface lo inet loopback
iface eth0 inet static
address 192.168.0.110
netmask 255.255.255.0
gateway 192.168.0.1

allow-hotplug wlan0
iface wlan0 inet static
address 192.168.0.111
netmask 255.255.255.0
gateway 192.168.0.1

wpa-ssid roxnet
wpa-ap-scan 1
wpa-proto RSN
wpa-pairwise CCMP
wpa-group CCMP
wpa-key-mgmt WPA-PSK
wpa-psk 34670cbbd674a92d4027a7f01a88141990a2f44b816c7fbde72fbbada4e6a2f8

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp


/var/log/dmsg - looks like it means dongle is recognized fine
Code: Select all
[    2.333098] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    2.342092] Indeed it is in host mode hprt0 = 00001101
[    2.563311] usb 1-1: New USB device found, idVendor=0424, idProduct=9512
[    2.572360] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.582726] hub 1-1:1.0: USB hub found
[    2.588973] hub 1-1:1.0: 3 ports detected
[    2.873191] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    2.993580] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    3.002812] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    3.015740] smsc95xx v1.0.4
[    3.078397] smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:54:af:ca
[    3.173211] usb 1-1.3: new high-speed USB device number 4 using dwc_otg
[    3.295118] usb 1-1.3: New USB device found, idVendor=0bda, idProduct=8176
[    3.307943] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.322267] usb 1-1.3: Product: 802.11n WLAN Adapter
[    3.333056] usb 1-1.3: Manufacturer: Realtek
[    3.339783] usb 1-1.3: SerialNumber: 00e04c000001
[    6.251860] EXT4-fs (mmcblk0p2): recovery complete
[    6.350726] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    6.363851] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    6.373621] devtmpfs: mounted
[    6.379856] Freeing init memory: 124K
[    7.693155] udevd[138]: starting version 175
[   10.336255] usbcore: registered new interface driver rtl8192cu
[   15.075180] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   15.525561] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   16.275522] bcm2835 ALSA card created!


/var/log/daemon.log - almost jackpot: "Listen normally on 2 wlan0 192.168.0.111 UDP 123"
Looks like setting up static ips manually pushed things forward. Problem is - still ethernet dies when dongle is connected, still can not ping device when its on wifi, it stays unreachable. Any ideas?
Code: Select all
Dec 16 19:50:08 raspberrypi ntpd[1974]: ntpd 4.2.6p5@1.2349-o Fri May 18 20:30:57 UTC 2012 (1)
Dec 16 19:50:08 raspberrypi ntpd[1984]: proto: precision = 1.000 usec
Dec 16 19:50:08 raspberrypi ntpd[1984]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Dec 16 19:50:08 raspberrypi ntpd[1984]: Listen normally on 1 lo 127.0.0.1 UDP 123
Dec 16 19:50:08 raspberrypi ntpd[1984]: Listen normally on 2 wlan0 192.168.0.111 UDP 123
Dec 16 19:50:08 raspberrypi ntpd[1984]: peers refreshed
Dec 16 19:50:08 raspberrypi ntpd[1984]: Listening on routing socket on fd #19 for interface updates
Dec 16 19:50:08 raspberrypi ntpd[1984]: restrict: error in address '::' on line 38. Ignoring...
Dec 16 19:50:08 raspberrypi ntpd[1984]: restrict: error in address '::1' on line 42. Ignoring...
Dec 16 19:50:11 raspberrypi dbus[1944]: [system] Activating service name='org.freedesktop.ConsoleKit' (using servicehelper)
Dec 16 19:50:11 raspberrypi dbus[1944]: [system] Activating service name='org.freedesktop.PolicyKit1' (using servicehelper)
Dec 16 19:50:12 raspberrypi polkitd[2135]: started daemon version 0.105 using authority implementation `local' version `0.105'
Dec 16 19:50:12 raspberrypi dbus[1944]: [system] Successfully activated service 'org.freedesktop.PolicyKit1'
Dec 16 19:50:12 raspberrypi dbus[1944]: [system] Successfully activated service 'org.freedesktop.ConsoleKit'
Dec 16 19:50:29 raspberrypi ntpd[1984]: Deferring DNS for 0.debian.pool.ntp.org 1
Dec 16 19:50:49 raspberrypi ntpd[1984]: Deferring DNS for 1.debian.pool.ntp.org 1
Dec 16 19:51:09 raspberrypi ntpd[1984]: Deferring DNS for 2.debian.pool.ntp.org 1
Dec 16 19:51:29 raspberrypi ntpd[1984]: Deferring DNS for 3.debian.pool.ntp.org 1
Dec 16 19:51:29 raspberrypi ntpd[2155]: signal_no_reset: signal 17 had flags 4000000
Dec 16 19:50:09 raspberrypi ntpd[2002]: ntpd 4.2.6p5@1.2349-o Fri May 18 20:30:57 UTC 2012 (1)
Dec 16 19:50:09 raspberrypi ntpd[2011]: proto: precision = 1.000 usec
Dec 16 19:50:09 raspberrypi ntpd[2011]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Dec 16 19:50:09 raspberrypi ntpd[2011]: Listen normally on 1 lo 127.0.0.1 UDP 123
Dec 16 19:50:09 raspberrypi ntpd[2011]: Listen normally on 2 wlan0 192.168.0.111 UDP 123
Dec 16 19:50:09 raspberrypi ntpd[2011]: peers refreshed
Dec 16 19:50:09 raspberrypi ntpd[2011]: Listening on routing socket on fd #19 for interface updates
Dec 16 19:50:09 raspberrypi ntpd[2011]: restrict: error in address '::' on line 38. Ignoring...
Dec 16 19:50:09 raspberrypi ntpd[2011]: restrict: error in address '::1' on line 42. Ignoring...
Dec 16 19:50:17 raspberrypi dbus[1963]: [system] Activating service name='org.freedesktop.ConsoleKit' (using servicehelper)
Dec 16 19:50:17 raspberrypi dbus[1963]: [system] Activating service name='org.freedesktop.PolicyKit1' (using servicehelper)
Dec 16 19:50:18 raspberrypi polkitd[2165]: started daemon version 0.105 using authority implementation `local' version `0.105'
Dec 16 19:50:18 raspberrypi dbus[1963]: [system] Successfully activated service 'org.freedesktop.PolicyKit1'
Dec 16 19:50:18 raspberrypi dbus[1963]: [system] Successfully activated service 'org.freedesktop.ConsoleKit'
Dec 16 19:50:29 raspberrypi ntpd[2011]: Deferring DNS for 0.debian.pool.ntp.org 1
Dec 16 19:50:34 raspberrypi ifplugd(wlan0)[1500]: Exiting.
Dec 16 19:50:34 raspberrypi ntpd[2011]: Deferring DNS for 1.debian.pool.ntp.org 1
Dec 16 19:50:34 raspberrypi ntpd[2011]: Deferring DNS for 2.debian.pool.ntp.org 1
Dec 16 19:50:34 raspberrypi ntpd[2011]: Deferring DNS for 3.debian.pool.ntp.org 1
Dec 16 19:50:34 raspberrypi ntpd[2248]: signal_no_reset: signal 17 had flags 4000000
Dec 16 19:50:36 raspberrypi ntpd[2011]: Deleting interface #2 wlan0, 192.168.0.111#123, interface stats: received=0, sent=0, dropped=0, active_time=2 secs
Dec 16 19:50:36 raspberrypi ntpd[2011]: peers refreshed


Joe Schmoe wrote:Re: Your actual problem: You will get it working eventually. That's really all any of these things ever boil down to: Keeping banging on it until it starts to work.

just not totally blindly, thats why i ask for assistance :)

Joe Schmoe wrote:But, here's a suggestion: Get serial working. This solves the "how do I access the board when I don't have a monitor and I don't have (reliable) network connections (yet)" problem.

Start by buying one of these:

http://www.suntekstore.com/goods-140026 ... p2102.html


($4.35). With the Pi, that's all you need. It comes with the jumpers you need - connect them to your GPIO and you're good to go.

honestly - i have no idea what that is. quick google revealed just some blog posts on how to connect it and not how to use it. maybe have any links with more noob-friendly details by hand?
Posts: 5
Joined: Fri Dec 21, 2012 6:21 pm
by Joe Schmoe » Sat Dec 22, 2012 8:59 pm
honestly - i have no idea what that is. quick google revealed just some blog posts on how to connect it and not how to use it. maybe have any links with more noob-friendly details by hand?


Well, the obvious question is: Have you ever used a serial cable (or modem) connection in the past? Assuming the answer is "Yes", ...

The next thing is to search for a thread with a title something like "Getting started with the serial connection", started by yours truly, a month or so back. Short summary of that experience is, yeah, nobody really wants to tell you exactly how to do it. You do have to figure it out by yourself (as I did, painfully). Most of the details of how exactly this is done, are in that thread.

In any case, if you have access to another Linux machine, that has a USB port, the above mentioned part will connect to 3 of your GPIO pins (6,8,10) on one end, and to the USB port of your Linux host on the other end. Then you run "screen" on the Linux host to get connected to (and login on) the serial port of the Pi. It all works very well, once you get it hooked up.
Never answer the question you are asked. Rather, answer the question you wish you had been asked.

- Robert S. McNamara - quoted in "Fog of War" -
Posts: 2267
Joined: Sun Jan 15, 2012 1:11 pm
by efflandt » Sun Dec 23, 2012 2:31 am
Don't try to plug anything into the Raspberry Pi USB ports on the fly, that can draw a surge of power that can disrupt things. You might get away with that on a powered hub, but anything connected directly to the Pi USB ports should be done before booting.

I have mini-WiFi with the same Realtek chip, and yours appears to be properly recognized and loads the proper module. Assuming that you have a recent model without polyfuses on the USB ports, your problem likely has something to do with your WiFi configuration.

Normally you should not have any WiFi keys in /etc/network/interfaces because that is readable by anyone. When using dhcp for either ethernet or WiFi my /etc/network/interfaces only contains:
Code: Select all
auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Information for WiFi keys would go in /etc/wpa_supplicant/wpa_supplicant.conf which is only readable by root. But my old DSL wireless/router/modem uses WEP, so I would not know how to configure wpa_supplicant.conf for wpa-psk.

If I boot with WiFi attached, but ethernet disconnected, wlan0 comes up working. If I then plug in ethernet, it automatically takes down wlan0 IP and brings up working eth0 (expected to be faster). If I unplug ethernet, eth0 IP is removed and wlan0 automatically comes back up with an IP. Having both up at the same time on the same network with static IP's could be confusing because both IP's would answer on both interfaces and applications may not know which IP to bind to or which interface to route through.

If you could temporarily connect monitor and keyboard, it would be easiest to configure WiFi with the WiFi Config app in X.
Posts: 359
Joined: Mon Dec 03, 2012 2:47 am
Location: Elgin, IL USA
by rndbit » Sun Dec 23, 2012 9:57 am
Joe Schmoe wrote:The next thing is to search for a thread with a title something like "Getting started with the serial connection", started by yours truly, a month or so back. Short summary of that experience is, yeah, nobody really wants to tell you exactly how to do it. You do have to figure it out by yourself (as I did, painfully). Most of the details of how exactly this is done, are in that thread.

Hint to that thread was all i need. You could spare that moralizing about noone wanting to tell anyone how to do things because people have technology not because everyone kept knowledge to himself. :) Again thanks for the hint!
That thread in first minute led me to nice link: http://www.savagehomeautomation.com/pro ... visit.html
It should prove useful to other fresh meat like me.

efflandt wrote:Don't try to plug anything into the Raspberry Pi USB ports on the fly, that can draw a surge of power that can disrupt things. You might get away with that on a powered hub, but anything connected directly to the Pi USB ports should be done before booting.

I have mini-WiFi with the same Realtek chip, and yours appears to be properly recognized and loads the proper module. Assuming that you have a recent model without polyfuses on the USB ports, your problem likely has something to do with your WiFi configuration.

Normally you should not have any WiFi keys in /etc/network/interfaces because that is readable by anyone. When using dhcp for either ethernet or WiFi my /etc/network/interfaces only contains:
Code: Select all
auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Information for WiFi keys would go in /etc/wpa_supplicant/wpa_supplicant.conf which is only readable by root. But my old DSL wireless/router/modem uses WEP, so I would not know how to configure wpa_supplicant.conf for wpa-psk.

If I boot with WiFi attached, but ethernet disconnected, wlan0 comes up working. If I then plug in ethernet, it automatically takes down wlan0 IP and brings up working eth0 (expected to be faster). If I unplug ethernet, eth0 IP is removed and wlan0 automatically comes back up with an IP. Having both up at the same time on the same network with static IP's could be confusing because both IP's would answer on both interfaces and applications may not know which IP to bind to or which interface to route through.

If you could temporarily connect monitor and keyboard, it would be easiest to configure WiFi with the WiFi Config app in X.

Thanks for the hint about hot-plugging. It did not solve anything but still good to know!
Could you also show me contents of your wpa_supplicant.conf? Im curious if there are any other info i might have not thought about. Found this useful manpage detailing wpa_supplicant.conf setup: http://linux.die.net/man/5/wpa_supplicant.conf

Also did you do anything else besides modification of wpa_supplicant.conf and /etc/network/interfaces? Or are these two the only thing needed to set everything up? Or did you set it up using GUI? Sadly i have no quick access to anything that could output some video for me. No tv and monitor oddly does not support hdmi.

Another idea is to hook it up to old tv, ill get a cable from store today and try. Will let you know of a progress
Posts: 5
Joined: Fri Dec 21, 2012 6:21 pm
by efflandt » Sun Dec 23, 2012 7:00 pm
I only have an example of /etc/wpa_supplicant/wpa_supplicant.conf for WEP (real WEP key where x'd out). This is what the gui WiFi Config tool put there:
Code: Select all
update_config=1

network={
        ssid="2WIRE106"
        key_mgmt=NONE
        auth_alg=OPEN
        wep_key0=xxxxxxxxxx
}

If you do not find clues about wpa-psk config from other posts in this forum, look through troubleshooting forum.
Posts: 359
Joined: Mon Dec 03, 2012 2:47 am
Location: Elgin, IL USA
by rndbit » Sun Dec 23, 2012 7:46 pm
I see, thanks for the info! Ill see if i get lucky enough to blindly hit jackpot.

I also got RCA cable and hooked rpi to that old tv here. All is nice and cool expect when wifi dongle is connected - neither mouse nor keyboard would work. I suppose this is because lacking power supply which is 850ma.
So even if i get visual feedback i cant do anything with the board because all my limbs are cut-off :)
Maybe power starvation is also reason for wifi not working alongside with ethernet plugged in.

Gonna order powered usb hub and better power supply and see what happens then.
Posts: 5
Joined: Fri Dec 21, 2012 6:21 pm
by rndbit » Sun Dec 23, 2012 9:12 pm
Alright i got it working. Turns out it indeed was fault of power supply. I had galaxy s2 charger around, but label said it provides 0.7A, where power supply i used had lable with proud 850 mA. That is why i never considered trying phone charger before. But i got desperate enough to a point where random things that dont make sense are tested, and you know what - using phone charger i could get mouse or keyboard working along with wifi dongle. Also dongle alone did not even work due to lack of power. Now everything works.

Moral of the story - cant get your wifi working? Check your power supply. Do not trust labels on products manufactured in china by unknown brands.
Posts: 5
Joined: Fri Dec 21, 2012 6:21 pm