Page 2 of 7

Re: [RPi3] SSH not working via wifi

Posted: Wed Mar 09, 2016 10:47 pm
by A350XWB
Hi everybody,

thanks for all your input!

I set up my Android smartphone as a mobile hotspot and connected both my PC and Pi3 to ist. SSH worked ... consistent with your suspicion that interaction between wifi chip on the Pi and router is the source of all problems.

Re: [RPi3] SSH not working via wifi

Posted: Wed Mar 09, 2016 10:59 pm
by chrisoh
A350XWB wrote:Hi everybody,

thanks for all your input!

I set up my Android smartphone as a mobile hotspot and connected both my PC and Pi3 to ist. SSH worked ... consistent with your suspicion that interaction between wifi chip on the Pi and router is the source of all problems.
Thankyou for confirming that A350XWB! Not just me going crazy, phew :lol:

Re: [RPi3] SSH not working via wifi

Posted: Thu Mar 10, 2016 12:13 pm
by pierau
Okay, I have the same SSH problems described above, notably:
  • Connecting via SSH to my Raspbian Raspi3 works fine when eth0 is connected. The connection immediately stops working when I unplug eth0.
  • Not having eth0 plugged in results in either a timeout before or connection hang after providing the password.
  • Symptoms are identical on a WRT54GL and a TP-Link Archer C7-v2. *edit*: Both use dd-wrt.
  • Symptoms are identical whether I use PuTTY on Windows, ssh on a Gentoo box or ssh on a Ubuntu box.
  • Network setup has no influence either. It does not matter if the IP is dhcp or static. IPv6 enabled/disabled does not matter. Different subnets have no influence on the outcome.
I noticed some additional oddities:
  • wlan0 will request an IP via DHCP even if it is set up as static.
  • ACTivity led blinks in regular intervals (~once per second) when I try to connect via SSH on a Wifi-only connection.
  • A connection established via the wlan0 IP continues to work if i down wlan0 with ifconfig. (WHAT?)
That last point had me check what happens with iptraf and I found this:

Code: Select all

TCP Connections (Source Host:Port) qqqqqqqqqq Packets qqq Bytes Flags  Iface 
192.168.150.250:60399                       >      47      2458 --A-   wlan0 
192.168.150.248:22                          =       0         0 ----   wlan0 
192.168.150.248:22                          >      89     23048 -PA-   eth0  
192.168.150.250:60399                       =       0         0 ----   eth0  
Ummm...seriously? My connection from 192.168.150.250 (Gentoo) to 192.168.150.248 (RPie) is split, packets come in via wlan0, packets go out via eth0. I have not seen anything like this happen like ever. No wonder things go south when I unplug eth0. So I check my routes:

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.150.10  0.0.0.0         UG    0      0        0 wlan0
0.0.0.0         192.168.150.10  0.0.0.0         UG    203    0        0 eth0
0.0.0.0         192.168.150.10  0.0.0.0         UG    304    0        0 wlan0
192.168.150.0   0.0.0.0         255.255.255.0   U     203    0        0 eth0
192.168.150.0   0.0.0.0         255.255.255.0   U     304    0        0 wlan0
Err. OK, my route-fu is not really strong but it seems eth0 will be the preferred interface for traffic going out on 192.168.150.0/24. Drats. So well let's add wlan0 again with metric 0 and the problem will be solved:

Code: Select all

sudo route add -net 192.168.150.0 netmask 255.255.255.0 metric 0 wlan0
...after which the connection immediately hangs and it's like I do not have eth0 plugged in. ACTivity LED blinking every second, pinging just fine. Oh well, cold reboot (headless...). Let's try removing the eth0 route then:

Code: Select all

sudo route del -net 192.168.150.0 netmask 255.255.255.0 metric 203 dev eth0
...no dice. Same as before. Bummer. I'm out of time and will continue this fun exercise another time. If anyone has a hint about what I am doing wrong, I'd appreciate a note. For full disclosure, here is my /etc/network/interfaces:

Code: Select all

source-directory /etc/network/interfaces.d

auto lo wlan0
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
post-up iwconfig wlan0 power off

iface <networkname1> inet static
address 192.168.150.248
gateway 192.168.150.10
netmask 255.255.255.0

iface <networkname2> inet static
address 192.168.1.19
gateway 192.168.1.254
netmask 255.255.255.0

Re: [RPi3] SSH not working via wifi

Posted: Thu Mar 10, 2016 12:36 pm
by chrisoh
Great work pierau! There does seem to be something fishy with the WiFi driver! I've just been doing some googling :lol:

One thing I found after noticing "debug2: channel 0: open confirm rwindow 0 rmax 32768" (the last hang point when using ssh -vvv) in the terminal, there is another reported issue, albeit from 2008, about a Broadcom chip similarly not working here, which looked like a case of bad driver. Unfortunately it seems that the then-current version of Ubuntu reached EoL and the issue was closed. Not too familiar with the linux dev-doc world so I can't get any further with that.

For debug sake, my router is Netgear DG834G which uses a Broadcom BCM6348 chipset, I believe.

Re: [RPi3] SSH not working via wifi

Posted: Thu Mar 10, 2016 3:12 pm
by pierau
Well now. Thinking it was maybe something I installed that caused the routing tables to go nuts, I just reimaged Raspbian Jessie *Lite* (instead of the full Raspbian Jessie image) to my RPi3 SD card. Lo and behold, things work just fine now.

This means that quite probably, the Wifi driver is not at fault here.

I will try to retrace the steps that led to the situation described earlier and post updates if I find anything.

Re: [RPi3] SSH not working via wifi

Posted: Thu Mar 10, 2016 3:25 pm
by A350XWB
User @mccarthy had the issue with Jessie Lite also, viewtopic.php?p=920910#p920910 .

Re: [RPi3] SSH not working via wifi

Posted: Thu Mar 10, 2016 3:44 pm
by pierau
Something is still VERY wrong with the network setup. RPi3 stopped responding on its static IP address (192.168.150.248). One suspicious look into DHCP logs later I connect to 192.168.150.183 to log this:

Code: Select all

[email protected]'s password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Mar 10 16:33:49 2016 from 192.168.150.250
[email protected]:~ $ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:**:**:**
          inet6 addr: fe80::56d5:****:****:****/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:260 (260.0 B)  TX bytes:260 (260.0 B)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:**:**:**
          inet addr:192.168.150.248  Bcast:192.168.150.255  Mask:255.255.255.0
          inet6 addr: fe80::ba27:****:****:****/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3475 errors:0 dropped:203 overruns:0 frame:0
          TX packets:1232 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2118707 (2.0 MiB)  TX bytes:180919 (176.6 KiB)

[email protected]:~ $ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.150.10  0.0.0.0         UG    303    0        0 wlan0
192.168.150.0   0.0.0.0         255.255.255.0   U     303    0        0 wlan0
So I logged in to 192.168.150.183 to find out that wlan0 has the IP 192.168.150.248. o_O

Dazed and confused. A schizophrenic Wifi card? (edit:Turns out: no. See below)

Re: [RPi3] SSH not working via wifi

Posted: Thu Mar 10, 2016 4:08 pm
by pierau
Apparently one does not need a virtual network interface (eg. wlan0:1) to have multiple IPs so here goes:

Code: Select all

[email protected]:~ $ sudo ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether b8:27:eb:**:**:** brd ff:ff:ff:ff:ff:ff
    inet6 fe80::56d5:****:****:****/64 scope link tentative
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:**:**:** brd ff:ff:ff:ff:ff:ff
    inet 192.168.150.248/24 brd 192.168.150.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet 192.168.150.183/24 brd 192.168.150.255 scope global secondary wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::ba27:****:****:****/64 scope link
       valid_lft forever preferred_lft forever
So I have two sessions running that are connected to different IPs:

Code: Select all

[email protected]:~ $ netstat -tn
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0    236 192.168.150.183:22      192.168.150.244:46991   ESTABLISHED
tcp        0      0 192.168.150.248:22      192.168.150.244:48840   ESTABLISHED
and the outage I noticed earlier happened when dhcpcd kicked in to add the second IP address. In the process, the static IP address was apparently briefly removed so that all connections on it were dropped.

I am still not convinced this situation is all well. When I configure a "static" IP address I only want that one and not another, gratuitiously provided via DHCP. Let's see about that...

Re: [RPi3] SSH not working via wifi

Posted: Thu Mar 10, 2016 4:28 pm
by chrisoh
pierau wrote:Well now. Thinking it was maybe something I installed that caused the routing tables to go nuts, I just reimaged Raspbian Jessie *Lite* (instead of the full Raspbian Jessie image) to my RPi3 SD card. Lo and behold, things work just fine now.

This means that quite probably, the Wifi driver is not at fault here.

I will try to retrace the steps that led to the situation described earlier and post updates if I find anything.
Just tried a clean Jessie Lite and it doesn't work either

Re: [RPi3] SSH not working via wifi

Posted: Thu Mar 10, 2016 5:28 pm
by Mike Lake
Are we going round in circles? Are the red herrings coming home to roost?

Is this like buying a new smart phone (OK, I don't use a smart phone - but bear with me) and finding it won't link to your car Bluetooth system?

The smart phone manufacturer says: "have you tried buying a different car?"

On RPi3 SSH works with Ethernet.
On RPi3 SSH works with a USB wifi dongle.
On RPi3 SSH does not work with the RPi3 built-in wifi.

QED: the RPi3 has a problem.

Or am I being too simple? Story of my life - I like things simple - that's why I don't have a smart phone <g>

Who's responsible for the wifi driver or wifi setup on the RPi3? How do we let them know there is a problem?

Re: [RPi3] SSH not working via wifi

Posted: Thu Mar 10, 2016 6:55 pm
by DougieLawson
The problem with dual addresses comes from adding static IP stuff to /etc/network/interfaces rather than adding it to /etc/dhcpcd.conf search the forum there's hundreds of posts on this subject.

Re: [RPi3] SSH not working via wifi

Posted: Thu Mar 10, 2016 7:01 pm
by JimmyN
Mine is working fine, so I don't think it's really a hardware or driver issue, or I'd be seeing it too.

Here's what I did as far as setup.
Received RPi3 on Tuesday. Downloaded latest Raspbian and used Win32DiskImager to put it on a new SDCard.
So I'm using

Code: Select all

uname -a
Linux rpi5 4.1.18-v7+ #846 SMP Thu Feb 25 14:22:53 GMT 2016 armv7l GNU/Linux
Plugged in mouse, keyboard, and HDMI monitor and booted up for the first time.
Used the wireless tool in the taskbar to set up both wireless and wired with static IP addresses. Wireless got 192.168.0.11 and wired got 192.168.0.10. Shut it down, plugged in the ethernet cable and booted it for the second time.
Opened Putty in Windows and logged into the wired .10 address, worked OK. Then logged in with Putty using the wireless address and that worked OK too.

Now to see what happens with both interfaces up I logged in with Putty using the wireless address and did an apt-get update. Looking at ifconfig I could see from the RX bytes that it used the wired connection to download the update. With Putty still connected to the wireless I then unplugged the ethernet, and did another apt-get update and this time the RX bytes received showed it used the wireless as expected. No problems though, everything just seemed to work.

Since then I've always been using the wireless for the Putty connection, since I may not always have the ethernet plugged in. But if I do an apt-get update/upgrade or install something I plug in the ethernet for better speed, and I may unplug it again afterward.
I honestly haven't had any problems with Putty using the wireless connection. Yesterday as I was playing around I was thinking about how much I like the built-in wireless, rather than a dongle, especially the interaction with both interfaces up. I can mix and match, use either interface or both at the same time. And all I had to do was use the desktop tool, setup only took a couple of minutes. I really like the RPi3.

The only thing I can think of is maybe using DHCP on one or both interfaces could be causing a problem, since my addresses are static.

Re: [RPi3] SSH not working via wifi

Posted: Thu Mar 10, 2016 7:33 pm
by chrisoh
JimmyN wrote:Mine is working fine, so I don't think it's really a hardware or driver issue, or I'd be seeing it too.
We've already established in the thread, confirmed by potentially 4 users (myself, Mike Lake, pierau, A350XWB, mccarthy), that the same Pi 3 setup works e.g. with a smartphone hotspot but not a regular router, so it is indeed a problem with how the onboard Pi 3 WiFi is communicating with certain routers. It works for your router, hoorah! Others are not so fortunate.

With that said, as yours and I'm sure many other peoples setups, are working with regards to SSH over onboard WiFi, it'll be easy to interpret this as a problem with the routers and fob it off, but seeing as the affected users are apparently using different brands of router, and I haven't experienced any other device connectivity issues in the extensive use of my router (over years), it would mean the most probable cause is that the fault lies with the Pi 3.

With the amount of other threads regarding problems with the new onboard WiFi, I'm going to go out on a limb and say that the drivers are not exactly stable. I'll hold out as long as possible on buying a new router in the hope that the RPF devs can resolve the issues.

Re: [RPi3] SSH not working via wifi

Posted: Thu Mar 10, 2016 7:48 pm
by JimmyN
Sorry to have taken up your time with my needless post, since you've decided it's definitely a driver issue.

But in case it's of interest to anyone, mine works with either my Belkin F5D8235 or my NetGear CG3000D router.

Re: [RPi3] SSH not working via wifi

Posted: Thu Mar 10, 2016 10:45 pm
by chrisoh
After an rpi-update the problem persists FWIW.
The dmesg wireless chip error persists, using:

Code: Select all

dmesg | grep brcm
Although we're discussing SSH, I can't help but think that it's related to the problems discussed in the Pi 3 very poor WiFi performance thread
Googling the above brcm errors returns a lot of info over the past few months regarding woes with the Broadcom chip.

Re: [RPi3] SSH not working via wifi

Posted: Fri Mar 11, 2016 12:10 am
by Dub
FWIW, I'm seeing the same problem. If I try and login from my Android pone (Juice SSH), it tells me my password Authentication succeeded (password) but then nothing happens.... And it continues not to happen for quite some time :(

Re: [RPi3] SSH not working via wifi

Posted: Fri Mar 11, 2016 12:37 am
by chrisoh
Dub wrote:FWIW, I'm seeing the same problem. If I try and login from my Android pone (Juice SSH), it tells me my password Authentication succeeded (password) but then nothing happens.... And it continues not to happen for quite some time :(
Thanks for your input. Which model of router is the Pi is associated with? Will help in building up a picture of hardware related to the problem.

Re: [RPi3] SSH not working via wifi

Posted: Fri Mar 11, 2016 2:45 am
by Dub
chrisoh wrote:Which model of router is the Pi is associated with? Will help in building up a picture of hardware related to the problem.
Pi 3 - Itsown Wifi - Very latest drop of Jessie
[My previous Pi1/2 had worked fine.]

Re: [RPi3] SSH not working via wifi

Posted: Fri Mar 11, 2016 2:50 am
by Dub
Oops. Teach me for scanning too quickly - My Wifi router's quite old Gigaset - 1.07a.00R34 (Oct 26 2009 11:09:11) - Wireless driver d ( d )

Re: [RPi3] SSH not working via wifi

Posted: Fri Mar 11, 2016 8:00 am
by Robster2007
I am having exactly the same issue.

One minor point of interest.

While I get the timeout/hang on the built in WiFi if it is the only WiFi the port DOES work perfectly if I plug in a USB WiFi dongle.

Once I have done this both WiFi ports work fine for SSH.

Also of interest although SSH will not work on WiFi port VNC does connect fine to that port even if it is hanging with SSH.

Lastly I have the same issue on two routers.

Apple Time Machine, latest release and firmware and also Draytek Vigor 2860 latest firmware.

Robster

Re: [RPi3] SSH not working via wifi

Posted: Fri Mar 11, 2016 9:20 am
by pierau
DougieLawson wrote:The problem with dual addresses comes from adding static IP stuff to /etc/network/interfaces rather than adding it to /etc/dhcpcd.conf search the forum there's hundreds of posts on this subject.
Thanks for pointing this out. While it covers what I now think is the most probable effect (dual addresses & borked routing priorities), the problem also seems to occur for pure DHCP users without any static entries in /etc/network/interfaces. (edit:And - well - the sticky "WiFi Issues ? Start here !" still tells people to add stuff to /etc/network/interfaces under 4c).

@chrisoh: Could you try a clean Jessie Lite install, never connect eth0, do not add static IP entries anywhere, only switch off power management in wlan0 and see if the problem persists? If it doesn't, the "fix" for everyone experiencing SSH problems might just be to move static address entries to /etc/dhcpcd.conf and delete the dhcpcd leases file.

In my opinion, the Wifi performance/power management problem and this SSH problem are two distinct problems. I see both and I can reproduce both independently of each other. So this thread should probably be less about Wifi driver problems but rather about quirky network configuration that does not produce helpful logs...

Re: [RPi3] SSH not working via wifi

Posted: Fri Mar 11, 2016 9:23 am
by adam296
Go my Pi3 yesterday - have all the issues in this thread : SSH works with ethernet and WiFI dongle - on board wifi will not hold the connection up. Worst with Apple air-port but a range of other wifi routers also not stable.

Radio level looks to be fine but something it timing out. Have tried all variants of encryption but can't see the problem there.

Re: [RPi3] SSH not working via wifi

Posted: Fri Mar 11, 2016 9:28 am
by Robster2007
I can confirm my system is pure DHCP, no static address's at all and is a brand new re-install of Noobs.

This issue is wider than static address's.
Robster

Re: [RPi3] SSH not working via wifi

Posted: Fri Mar 11, 2016 9:51 am
by chrisoh
Dub wrote:Oops. Teach me for scanning too quickly - My Wifi router's quite old Gigaset - 1.07a.00R34 (Oct 26 2009 11:09:11) - Wireless driver d ( d )
Thankyou!
pierau wrote:
DougieLawson wrote:@chrisoh: Could you try a clean Jessie Lite install, never connect eth0, do not add static IP entries anywhere, only switch off power management in wlan0 and see if the problem persists? If it doesn't, the "fix" for everyone experiencing SSH problems might just be to move static address entries to /etc/dhcpcd.conf and delete the dhcpcd leases file.

In my opinion, the Wifi performance/power management problem and this SSH problem are two distinct problems. I see both and I can reproduce both independently of each other. So this thread should probably be less about Wifi driver problems but rather about quirky network configuration that does not produce helpful logs...
The problem persists using:
  • Jessie
  • Jessie Lite
  • DietPi
I tried using a static IP on Jessie yesterday, just to test it and had same result. I don't normally use static IPs at all.
I'm seeing exactly the same problems as vollmeise states in the post in the "WiFi issues thread". Can't SSH over WiFi and I also noticed UDP is not routing at all as my NTP is not updating.

Re: [RPi3] SSH not working via wifi

Posted: Fri Mar 11, 2016 7:37 pm
by vollmeise
Raspberry Pi 3 onboard wifi, ssh and traceroute udp not working with access points / routers

Hi,

I have missed this thread and posted instead in the sticky wifi thread...sorry
That's what I have found:
Connecting the Pi3 and onboard wifi to a different access point (AVM FritzBox 7390) shows none of the described problems with traceroute and ssh!
So it is the combination of the Pi 3's onboard wifi and the Netgear access point which is making the trouble.
While good to know, it doesn't solve the problem for me (ssh not working in my wlan).
Could this be fixed by a driver update on the Pi 3?
And it is not a problem with ssh configuration or IP routing - it happens in a bridged network in the same IP subnet.

Meanwhile I have bought an USB wifi stick (TP-Link TL-WN722N) for 8€ and made an access point out of my Linux home server (Debian Jessie). The stick works out of the box perfectly as an access point.
And the Pi3's on board wifi works perfectly :D

To help the Raspberry Pi developers, we should list up the "Good, Bad & Ugly" wifi access points for the Pi3.

Good:
  • AVM FritzBox 7390
  • TP-Link TL-WN722N with hostapd on Debian Linux
  • Belkin F5D8235
  • NetGear CG3000D
  • Android Smartphone
Bad:
  • Netgear DG834GB v3 (TI chip set)
  • Gigaset - 1.07a.00R34 (Oct 26 2009 11:09:11) - Wireless driver d ( d )
  • Draytek Vigor 2860 latest firmware
  • 2wire 2701HG-G Gateway
  • Apple Time Capsule, latest generation and firmware
Good luck