nulldev
Posts: 23
Joined: Sat Mar 05, 2016 3:39 am

shh hangs after a short time

Sun Mar 12, 2017 4:38 am

I have a raspberry pi 3.
I am using the built in wifi to act as both a an access point and a client.
As a client the pi connects to my home wifi.
I can then connect to the pi from my laptop over the pi's wifi interface.
So it is a client and access point simultaneously.

The problem comes up when I am connected as described above and then I attempt to ssh to the Raspberry Pi from the laptop.
The ssh session will intermittently hang.
I have read threads where people have trouble connecting over ssh due to IPQoS. In those cases it seems the system hangs immediately after the password is given. I get past the password and can usually issue 2 to 3 commands before it hangs.
Sometime I can work for several minutes before it hangs.
Does anyone have an idea as to what the problem could be?
What logs should I review to help me diagnose this issue?
Thanks

epoch1970
Posts: 3363
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: shh hangs after a short time

Sun Mar 12, 2017 2:16 pm

nulldev wrote:I am using the built in wifi to act as both an access point and a client.
...
Sometime I can work for several minutes before it hangs.
Congratulations.
However given the way the virtual AP works on the Pi, i.e. use the same channel (and same encryption?) for both networks, (i) I would set hostapd in verbose mode and (ii) I would consider investing in an extra USB interface.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

nulldev
Posts: 23
Joined: Sat Mar 05, 2016 3:39 am

Re: shh hangs after a short time

Sun Mar 12, 2017 4:22 pm

Thanks for your reply.
You are correct.
I have set the pi to broadcast on the same channel that my home wifi is on. I also set the encryption the same (I think) and the password for both the home wifi and the pi's broadcasted ap the same. Doing all of this seemed to help my initial issue of lost packets and disconnects.

I also set the power saving feature of the wifi interface off. This helped the second issue I encountered (the wifi connection to the pi would drop after a short time if unused).

I am beginning to suspect it may have to do with QoS settings but I am just guessing.

How do you enable verbose mode as suggested and where is the info logged?

Thanks

epoch1970
Posts: 3363
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: shh hangs after a short time

Sun Mar 12, 2017 6:45 pm

nulldev wrote:How do you enable verbose mode as suggested and where is the info logged?
What I do in this case is start hostapd from the command-line in debug mode.
You'd could run this from the console: "sudo hostapd -d /etc/hostapd.conf" (adding more "d"s, e.g. -dd or -ddd makes hostapd log more).

Also it would be interesting to verify your problem happens with any long-lived connection (my assumption) or with SSH only. Perhaps you can try streaming something light, like low-quality radio, or maybe simply use netcat on both machines, type on the remote keyboard for a while and see if the connection breaks?

EDIT: an o.k. how-to netcat.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

User avatar
emgi
Posts: 357
Joined: Thu Nov 07, 2013 4:08 pm
Location: NL

Re: shh hangs after a short time

Sun Mar 12, 2017 6:55 pm

Crappy power supply?

nulldev
Posts: 23
Joined: Sat Mar 05, 2016 3:39 am

Re: shh hangs after a short time

Mon Mar 13, 2017 4:42 am

epoch1970 wrote:
nulldev wrote:How do you enable verbose mode as suggested and where is the info logged?
What I do in this case is start hostapd from the command-line in debug mode.
You'd could run this from the console: "sudo hostapd -d /etc/hostapd.conf" (adding more "d"s, e.g. -dd or -ddd makes hostapd log more).

Also it would be interesting to verify your problem happens with any long-lived connection (my assumption) or with SSH only. Perhaps you can try streaming something light, like low-quality radio, or maybe simply use netcat on both machines, type on the remote keyboard for a while and see if the connection breaks?

EDIT: an o.k. how-to netcat.

Thanks,
I will report back.

nulldev
Posts: 23
Joined: Sat Mar 05, 2016 3:39 am

Re: shh hangs after a short time

Mon Mar 13, 2017 5:00 am

emgi wrote:Crappy power supply?
Do you really think that could be it?
I am using an apple 10W USB Power Adapter that came with an ipad.
The input is 100–240V~ 0.45A.
The output is 5.1V 2.1A.

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

Re: shh hangs after a short time

Mon Mar 13, 2017 5:52 pm

nulldev wrote:
emgi wrote:Crappy power supply?
Do you really think that could be it?
I am using an apple 10W USB Power Adapter that came with an ipad.
The input is 100–240V~ 0.45A.
The output is 5.1V 2.1A.
FWIW, you may find the variation in load behaviour between two Apple 5W iphone chargers of interest:
http://www.cpmspectrepi.uk/raspberry_pi ... rger_A1399
(also "beware the clone" shown in the next section below that data)
Also compare this 10W tablet charger:
http://www.cpmspectrepi.uk/raspberry_pi ... KP10001001
with the (original) official power supply:
http://www.cpmspectrepi.uk/raspberry_pi ... _Models.29
Trev.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

nulldev
Posts: 23
Joined: Sat Mar 05, 2016 3:39 am

Re: shh hangs after a short time

Tue Mar 14, 2017 3:18 am

Thank you for the links.
An official power supply certainly couldn't hurt and at least would rule power out as a possible cause.
From one of the links you posted I see brownout can be expected when the power drops to 4.6V.
Although my power supply was not listed in the links you posted I did find a test of it here:
http://www.righto.com/2012/10/a-dozen-u ... le-is.html

Mine is the A1357.
Their test indicates that under load I can expect a voltage sag to 4.4V at 2.3A.
Maybe that is my problem.
I'm not really sure how much of a strain I am putting on the system at this point. I don't really have the pi doing anything. I have configured the wifi as described and I do have apache running, but I have no web app running.
I only connect to the ap from my one laptop and then attempt to ssh which freezes intermittently. As I mentioned I am not serving a web app yet - (its difficult to write anything when the system freezes up every few commands).

Thanks for the info.

epoch1970
Posts: 3363
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: shh hangs after a short time

Tue Mar 14, 2017 9:02 am

I don't think power is the problem.
I use official PSUs but I also have an iPad PSU lying around, so I don't remember which I used when I was playing with the virtual AP capability of Pi 3. But for sure, it was marginally operational and quite awkward to set up.
In my case ssh wasn't more problematic than anything else.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “Networking and servers”