asami
Posts: 5
Joined: Sun May 28, 2017 7:11 am

Wifi shuts off after 1 minutes

Sun May 28, 2017 7:19 am

I'm using a Raspberry Pi 3 Running Raspbian Jesse 8. The wifi was working fine until today. I noticed that when I'd ssh into the device (I'd have to unplug and replug to be able to do this) it would hang. Using an HDMI cable to log in directly to the RPi, I can see that wifi is on and connected shortly after booting up but then strangely turns off.

* I've tried a recommendation from another thread of using sudo iwconfig wlan0 power off
* Checking iwconfig, I see Power Management: off
* Other than the keyboard/mouse, I have unplugged USB devices
* Clicking of on the menu icon to connect to wifi shows "No wireless connections found"
* sudo ifup wlan0 briefly reconnects wifi but then it's gone again quickly
* I'm not having this issue when I swap out SD cards so it doesn't seem to be a hardware issue

wh7qq
Posts: 1448
Joined: Thu Oct 09, 2014 2:50 am

Re: Wifi shuts off after 1 minutes

Sun May 28, 2017 7:37 pm

A quick and dirty approach to fixing the problem would be to clone the "good" uSD card over the "bad" one...use Main Menu>Accessories>SD Card Copier but that doesn't answer the question of "why". I was all set to suggest local interference with the wifi signal until you mentioned that you had good luck with another uSD card. Before you clone the uSD card, compare the contents of /etc/wpa_supplicant/wpa_supplicant.conf on the two cards. You could post them here being sure to identify which is which.

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Wifi shuts off after 1 minutes

Sun May 28, 2017 8:09 pm

When you attempt to login with ssh, where does it hang? Is it after the password prompt?

wh7qq
Posts: 1448
Joined: Thu Oct 09, 2014 2:50 am

Re: Wifi shuts off after 1 minutes

Mon May 29, 2017 2:08 am

When you say
unplug and replug
are you talking about the power connection? That is really scary because if you don't remember to go through a proper poweroff sequence (10 green LED flashes) you can screw up the uSD card so that it won't boot properly. If you have no other way of controlling the Pi (headless) get yourself a GPIO-USB serial console adapter cable...no need for ssh with that. They are cheap...less than $10.

runboy93
Posts: 352
Joined: Tue Feb 28, 2017 1:17 pm
Location: Finland
Contact: Website

Re: Wifi shuts off after 1 minutes

Mon May 29, 2017 3:02 am

Do you use onboard wifi or usb dongle?

asami
Posts: 5
Joined: Sun May 28, 2017 7:11 am

Re: Wifi shuts off after 1 minutes

Mon May 29, 2017 6:46 am

runboy93 wrote:Do you use onboard wifi or usb dongle?

I'm using the Raspberry Pi 3 so it's onboard wifi

asami
Posts: 5
Joined: Sun May 28, 2017 7:11 am

Re: Wifi shuts off after 1 minutes

Mon May 29, 2017 6:48 am

wh7qq wrote:When you say
unplug and replug
are you talking about the power connection? That is really scary because if you don't remember to go through a proper poweroff sequence (10 green LED flashes) you can screw up the uSD card so that it won't boot properly. If you have no other way of controlling the Pi (headless) get yourself a GPIO-USB serial console adapter cable...no need for ssh with that. They are cheap...less than $10.

That was really the only option I felt I had as a headless setup because after I was able to log in via ssh the connection hung and there wasn't anything else I could do to (such as attempt to shut it down properly through the terminal). Later, connecting the pi to a monitor I could see that it was because the wifi connection was being dropped after a minute. If you have a suggestion for another way to handle that sort of situation though, I'm more than happy to try it.
Last edited by asami on Mon May 29, 2017 6:56 am, edited 1 time in total.

asami
Posts: 5
Joined: Sun May 28, 2017 7:11 am

Re: Wifi shuts off after 1 minutes

Mon May 29, 2017 6:49 am

SurferTim wrote:When you attempt to login with ssh, where does it hang? Is it after the password prompt?
No, I'm able to enter the password and get access, and really issue any commands once I'm in but only for about a minute and then I'm out since the connection is dropped. But to clarify, I can only ssh in if I do it shortly after the RPi turns on; if I wait a few minutes, it's already off my network.
Last edited by asami on Mon May 29, 2017 6:59 am, edited 2 times in total.

asami
Posts: 5
Joined: Sun May 28, 2017 7:11 am

Re: Wifi shuts off after 1 minutes

Mon May 29, 2017 6:55 am

wh7qq wrote:A quick and dirty approach to fixing the problem would be to clone the "good" uSD card over the "bad" one...use Main Menu>Accessories>SD Card Copier but that doesn't answer the question of "why". I was all set to suggest local interference with the wifi signal until you mentioned that you had good luck with another uSD card. Before you clone the uSD card, compare the contents of /etc/wpa_supplicant/wpa_supplicant.conf on the two cards. You could post them here being sure to identify which is which.


Thanks, I'll look into that. Part of my concern is about what caused the issue suddenly and if it will happen again. When you say Main Menu>Accessories>SD Card Copier, what app are you talking about?


The wpa_supplicant.conf files are identical since I made changes while attempting to address the wifi issues. Essentially they look like this (which includes my wifi network and my phone hotspot)

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
ssid="XX"
psk="XX"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}

network={
ssid="XX"
psk="XX"
key_mgmt=WPA-PSK
}

wh7qq
Posts: 1448
Joined: Thu Oct 09, 2014 2:50 am

Re: Wifi shuts off after 1 minutes

Tue May 30, 2017 1:09 am

asami wrote:
wh7qq wrote:When you say
unplug and replug
are you talking about the power connection? That is really scary because if you don't remember to go through a proper poweroff sequence (10 green LED flashes) you can screw up the uSD card so that it won't boot properly. If you have no other way of controlling the Pi (headless) get yourself a GPIO-USB serial console adapter cable...no need for ssh with that. They are cheap...less than $10.

That was really the only option I felt I had as a headless setup because after I was able to log in via ssh the connection hung and there wasn't anything else I could do to (such as attempt to shut it down properly through the terminal). Later, connecting the pi to a monitor I could see that it was because the wifi connection was being dropped after a minute. If you have a suggestion for another way to handle that sort of situation though, I'm more than happy to try it.
Here you are, as I suggested: https://learn.adafruit.com/adafruits-ra ... e/overview You take a considerable risk of loosing the uSD card if you cut power or remove the uSD card without a proper shutdown. It is much like windows punishing you for a disorderly termination...BSOD!

Are the files you posted truly identical? There is a tendency to gloss over some minor point of difference and not see it. If you recall, I suggested posting both here with clear ID as to which is which. If you don't wish to post the files here, for your own sake,
You need to use diff command to display line-by-line difference between two files. The general syntax of diff command as follows:
diff FILE1 FILE2
so give the files a distinguishing name and check it out. To my eye, the files are different...several lines not present in one that exist in the other. Also, compare the /etc/network/interfaces files the same way.

Diff quote from https://www.cyberciti.biz/faq/how-do-i- ... x-or-unix/

Finally, with regard to the on board wifi on the RPi3, stay close to the router or AP that you are networked to as the tiny antenna on the 3 isn't good at going through walls or over great distances. Also, sources of local interference such as microwave ovens, cordless phones, etc. can screw up a signal as can a neighbor using the same wifi channel.

It is also possible that interference just popped you out of the ssh session and it can still be restarted anew from the other computer's console with the usual ssh command: ssh yourusername@192.168.1.XX password: yourpasswordhere. Wifi can be flakey...always go with ethernet if possible.

Return to “Troubleshooting”