BobW001
Posts: 5
Joined: Thu May 09, 2013 4:58 am

Problems connecting to my router over wifi

Thu May 09, 2013 5:17 am

After using my RPi for a couple of weeks, connecting to my router via ethernet, things seemed sufficiently stable that I decided to add a USB wifi adapter. Today, I got a TP-Link TL-WN725N V2, which currently has a discussion going on here:
http://www.raspberrypi.org/phpBB3/viewt ... 26&t=29752

I used the info on member pi3g's site to get the adapter configured:
http://blog.pi3g.com/2013/05/tp-link-tl ... pi-driver/
and I believe that part is working. It appears that the wifi adapter is recognized, and the LED blinks during boot up, but it doesn't seem to be able to connect to my wireless router.
My router security is WPA2-personal, but I don't mind switching off security until I've debugged things. The problem is that I have no idea how to configure the system whether security is enabled or not. Doing a Google search for configuration info, I'm surprised to find nothing that's sufficiently clear for a Linux noob like me. I'd very much appreciate it if someone could walk me through this.

Ideally, I'd like to configure the system for simultaneous ethernet and wifi, as it's a headless system that I'm controlling via ssh from the Terminal program on my Mac. Having to switch from ethernet to wifi (when wifi doesn't work) means that I lose communications with it. (I do have a keyboard and an extremely fuzzy old TV monitor that I can connect in an emergency, but it's not much good for doing any more than a reboot or shutdown.)

Edit: Should also mention, I'm running Raspbian/Wheezy, with the latest updates.
Last edited by BobW001 on Thu May 09, 2013 8:43 am, edited 1 time in total.

BobW001
Posts: 5
Joined: Thu May 09, 2013 4:58 am

Re: Problems connecting to my router over wifi

Thu May 09, 2013 7:48 am

Here is a bit more information. Following some information I found on another site, I have switched off the security on my router (to try to simplify things) and set a static IP address. I currently have the following configuration on the pi:

/etc/network/interfaces file:

Code: Select all

auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
address 192.168.1.30
netmask 255.255.255.0
gateway 192.168.1.1
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

/etc/wpa_supplicant/wpa_supplicant.conf file:

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
  ssid="BobW_Net01"
  key_mgmt=NONE
}
With the ethernet cable connected, on boot-up I have network access. When I unplug the ethernet cable, the LED on the wifi adapter starts to blink a few seconds later, but no network access. When I reconnect the ethernet cable the LED on the wifi adapter stops blinking, and my network connect (via ethernet returns). Here is a portion of the system message log file that shows what happens as I connect and disconnect the ethernet cable several times.

Code: Select all

May  9 13:02:13 raspberrypi kernel: [   22.540540] UpdateHalRAMask8188EUsb => mac_id:0, networkType:0x03, mask:0x00000fff
May  9 13:02:13 raspberrypi kernel: [   22.540540] 	 ==> rssi_level:0, rate_bitmap:0x00000ff5
May  9 13:02:13 raspberrypi kernel: [   23.462795] UpdateHalRAMask8188EUsb => mac_id:0, networkType:0x03, mask:0x00000fff
May  9 13:02:13 raspberrypi kernel: [   23.462795] 	 ==> rssi_level:2, rate_bitmap:0x00000ff0
May  9 13:02:15 raspberrypi kernel: [   25.631993] Adding 102396k swap on /var/swap.  Priority:-1 extents:1 across:102396k SS
May  9 13:03:37 raspberrypi kernel: [  107.587080] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
May  9 13:03:37 raspberrypi wpa_action: WPA_IFACE=wlan0 WPA_ACTION=DISCONNECTED
May  9 13:03:37 raspberrypi wpa_action: WPA_ID=0 WPA_ID_STR= WPA_CTRL_DIR=/var/run/wpa_supplicant
May  9 13:03:37 raspberrypi wpa_action: ifdown wlan0
May  9 13:03:37 raspberrypi wpa_action: removing sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
May  9 13:04:23 raspberrypi kernel: [  137.068826] smsc95xx 1-1.1:1.0: eth0: link down
May  9 13:04:36 raspberrypi kernel: [  150.143399] UpdateHalRAMask8188EUsb => mac_id:0, networkType:0x03, mask:0x00000fff
May  9 13:04:36 raspberrypi kernel: [  150.143399] 	 ==> rssi_level:0, rate_bitmap:0x00000ff5
May  9 13:04:36 raspberrypi wpa_action: WPA_IFACE=wlan0 WPA_ACTION=CONNECTED
May  9 13:04:36 raspberrypi wpa_action: WPA_ID=0 WPA_ID_STR= WPA_CTRL_DIR=/var/run/wpa_supplicant
May  9 13:04:36 raspberrypi wpa_action: network settings not defined for default in /etc/network/interfaces
May  9 13:04:36 raspberrypi wpa_action: ifup wlan0=default
May  9 13:04:36 raspberrypi wpa_action: creating sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
May  9 13:04:36 raspberrypi wpa_action: bssid=00:1c:10:46:3c:4b
May  9 13:04:36 raspberrypi wpa_action: ssid=BobW_Net01
May  9 13:04:36 raspberrypi wpa_action: id=0
May  9 13:04:36 raspberrypi wpa_action: mode=station
May  9 13:04:36 raspberrypi wpa_action: pairwise_cipher=NONE
May  9 13:04:36 raspberrypi wpa_action: group_cipher=NONE
May  9 13:04:36 raspberrypi wpa_action: key_mgmt=NONE
May  9 13:04:36 raspberrypi wpa_action: wpa_state=COMPLETED
May  9 13:04:36 raspberrypi wpa_action: address=f8:1a:67:27:12:e9
May  9 13:04:39 raspberrypi kernel: [  153.732376] UpdateHalRAMask8188EUsb => mac_id:0, networkType:0x03, mask:0x00000fff
May  9 13:04:39 raspberrypi kernel: [  153.732376] 	 ==> rssi_level:2, rate_bitmap:0x00000ff0
May  9 13:05:11 raspberrypi kernel: [  185.021978] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
May  9 13:05:12 raspberrypi wpa_action: WPA_IFACE=wlan0 WPA_ACTION=DISCONNECTED
May  9 13:05:12 raspberrypi wpa_action: WPA_ID=0 WPA_ID_STR= WPA_CTRL_DIR=/var/run/wpa_supplicant
May  9 13:05:12 raspberrypi wpa_action: ifdown wlan0
May  9 13:05:12 raspberrypi wpa_action: removing sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
May  9 13:19:59 raspberrypi kernel: [ 1073.268513] smsc95xx 1-1.1:1.0: eth0: link down
May  9 13:20:13 raspberrypi kernel: [ 1086.837544] UpdateHalRAMask8188EUsb => mac_id:0, networkType:0x03, mask:0x00000fff
May  9 13:20:13 raspberrypi kernel: [ 1086.837544] 	 ==> rssi_level:0, rate_bitmap:0x00000ff5
May  9 13:20:13 raspberrypi wpa_action: WPA_IFACE=wlan0 WPA_ACTION=CONNECTED
May  9 13:20:13 raspberrypi wpa_action: WPA_ID=0 WPA_ID_STR= WPA_CTRL_DIR=/var/run/wpa_supplicant
May  9 13:20:13 raspberrypi wpa_action: network settings not defined for default in /etc/network/interfaces
May  9 13:20:13 raspberrypi wpa_action: ifup wlan0=default
May  9 13:20:13 raspberrypi wpa_action: creating sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
May  9 13:20:13 raspberrypi wpa_action: bssid=00:1c:10:46:3c:4b
May  9 13:20:13 raspberrypi wpa_action: ssid=BobW_Net01
May  9 13:20:13 raspberrypi wpa_action: id=0
May  9 13:20:13 raspberrypi wpa_action: mode=station
May  9 13:20:13 raspberrypi wpa_action: pairwise_cipher=NONE
May  9 13:20:13 raspberrypi wpa_action: group_cipher=NONE
May  9 13:20:13 raspberrypi wpa_action: key_mgmt=NONE
May  9 13:20:13 raspberrypi wpa_action: wpa_state=COMPLETED
May  9 13:20:13 raspberrypi wpa_action: address=f8:1a:67:27:12:e9
May  9 13:20:16 raspberrypi kernel: [ 1090.392377] UpdateHalRAMask8188EUsb => mac_id:0, networkType:0x03, mask:0x00000fff
May  9 13:20:16 raspberrypi kernel: [ 1090.392377] 	 ==> rssi_level:2, rate_bitmap:0x00000ff0
May  9 13:20:42 raspberrypi kernel: [ 1116.193367] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
May  9 13:20:42 raspberrypi wpa_action: WPA_IFACE=wlan0 WPA_ACTION=DISCONNECTED
May  9 13:20:42 raspberrypi wpa_action: WPA_ID=0 WPA_ID_STR= WPA_CTRL_DIR=/var/run/wpa_supplicant
May  9 13:20:43 raspberrypi wpa_action: ifdown wlan0
May  9 13:20:43 raspberrypi wpa_action: removing sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
May  9 13:31:44 raspberrypi kernel: [ 1778.441063] smsc95xx 1-1.1:1.0: eth0: link down
May  9 13:31:58 raspberrypi kernel: [ 1791.920177] UpdateHalRAMask8188EUsb => mac_id:0, networkType:0x03, mask:0x00000fff
May  9 13:31:58 raspberrypi kernel: [ 1791.920177] 	 ==> rssi_level:0, rate_bitmap:0x00000ff5
May  9 13:31:58 raspberrypi wpa_action: WPA_IFACE=wlan0 WPA_ACTION=CONNECTED
May  9 13:31:58 raspberrypi wpa_action: WPA_ID=0 WPA_ID_STR= WPA_CTRL_DIR=/var/run/wpa_supplicant
May  9 13:31:58 raspberrypi wpa_action: network settings not defined for default in /etc/network/interfaces
May  9 13:31:58 raspberrypi wpa_action: ifup wlan0=default
May  9 13:31:58 raspberrypi wpa_action: creating sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
May  9 13:31:58 raspberrypi wpa_action: bssid=00:1c:10:46:3c:4b
May  9 13:31:58 raspberrypi wpa_action: ssid=BobW_Net01
May  9 13:31:58 raspberrypi wpa_action: id=0
May  9 13:31:58 raspberrypi wpa_action: mode=station
May  9 13:31:58 raspberrypi wpa_action: pairwise_cipher=NONE
May  9 13:31:58 raspberrypi wpa_action: group_cipher=NONE
May  9 13:31:58 raspberrypi wpa_action: key_mgmt=NONE
May  9 13:31:58 raspberrypi wpa_action: wpa_state=COMPLETED
May  9 13:31:58 raspberrypi wpa_action: address=f8:1a:67:27:12:e9
May  9 13:32:01 raspberrypi kernel: [ 1795.476008] UpdateHalRAMask8188EUsb => mac_id:0, networkType:0x03, mask:0x00000fff
May  9 13:32:01 raspberrypi kernel: [ 1795.476008] 	 ==> rssi_level:2, rate_bitmap:0x00000ff0
May  9 13:32:13 raspberrypi kernel: [ 1807.883452] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
May  9 13:32:14 raspberrypi wpa_action: WPA_IFACE=wlan0 WPA_ACTION=DISCONNECTED
May  9 13:32:14 raspberrypi wpa_action: WPA_ID=0 WPA_ID_STR= WPA_CTRL_DIR=/var/run/wpa_supplicant
May  9 13:32:15 raspberrypi wpa_action: ifdown wlan0
May  9 13:32:15 raspberrypi wpa_action: removing sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
Edit:
I said the the LED on the wifi adapter only starts blinking when the ethernet cable is disconnected. In fact, I just happened to be looking at it at the wrong time. In fact, it goes through a continuous cycle of blinking for a couple of seconds, and then off for about 5 seconds, and then repeating.

BobW001
Posts: 5
Joined: Thu May 09, 2013 4:58 am

Re: Problems connecting to my router over wifi

Thu May 09, 2013 6:38 pm

It appears to be working now. At someone's suggestion, I got hold of a decent HDMI monitor, fired up the GUI desktop, and ran the WIFI config tool. Using this to scan for networks, I was able to see my own router as well as those of several neighbours. So, obviously the wifi adapter was working. Still, after going through the setup, it refused to connect to the network. Eventually, I replaced the SD card with a spare one having a clean copy of Raspbian/Wheezy. Reinstalled the wifi driver, and then went through the Wifi Config again. This time it did connect to the network. So, apparently something had become corrupted somewhere, on the old SD card that Wifi Config wasn't able to correct.

At the moment it's using DHCP to get its IP address dynamically. At some point I'd like to configure it to a static IP address, so that I can ssh into it from my other computer without having to query my router to find what address has been assigned. The Wifi Config tool doesn't appear to have any provision for setting a manual IP address, so I'll wait for another day when I have more patience.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5623
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Problems connecting to my router over wifi

Thu May 09, 2013 9:05 pm

BobW001 wrote: ...
At the moment it's using DHCP to get its IP address dynamically. At some point I'd like to configure it to a static IP address, so that I can ssh into it from my other computer without having to query my router to find what address has been assigned. The Wifi Config tool doesn't appear to have any provision for setting a manual IP address, so I'll wait for another day when I have more patience.
...
You may be able to configure your router to associate a "static" IP address with the Pi's MAC address which it then always assigns via DHCP. Both my old DLink and current getnet wireless routers have this capability. It's usually done via an "admin" login to the router via a browser (ie. a "webtool").
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

BobW001
Posts: 5
Joined: Thu May 09, 2013 4:58 am

Re: Problems connecting to my router over wifi

Thu May 09, 2013 10:59 pm

Thanks for the suggestion. I'm using a Linksys WRT54G. I went into the router configuration via my browser, and unfortunately, after going through all of the different setup pages it doesn't appear to be able to do this.

It's not a big deal at this point. I've now made a backup of my SD card. So now there's no harm experimenting with the configuration files on the Pi. If I make a mess of things, I can restore it back to a working system.

pjc123
Posts: 922
Joined: Thu Mar 29, 2012 3:37 pm
Contact: Website

Re: Problems connecting to my router over wifi

Fri May 10, 2013 10:43 am

BobW001 wrote:Thanks for the suggestion. I'm using a Linksys WRT54G. I went into the router configuration via my browser, and unfortunately, after going through all of the different setup pages it doesn't appear to be able to do this.
I replaced my WRT54G's firmware with one of the tomato firmwares (Shibby Tomato), and now I have and use the capability to issue static ips to my pis (both wired and wifi) from my router via DHCP. The advantage of this method is that you can leave your pi set for DHCP so it works with other access points.
My Raspberry Pi Project Page:

https://www.flaminghellmet.com/launch/

BobW001
Posts: 5
Joined: Thu May 09, 2013 4:58 am

Re: Problems connecting to my router over wifi

Sat May 11, 2013 3:48 am

Giving it some serious second thought, I've decided that it's best to leave it on DHCP. Being able to work with other access points is a major advantage.

Also, it appears that my router attempts to reassign the same IP address to the same device as long as the address is available. So, in most cases I can ssh back in to the Pi using the last address without having to check the router's DHCP table.

Return to “Beginners”