2

I have a Dell Mini 9 running Ubuntu 14. The wifi seems to work well, but only as long as I use it. I've noticed that if I leave it idle, and then try to ping or SSH into it, it's disconnected from the network.

When I manually log in to it, nmcli nm reports its disconnected and won't reconnect. If I reboot the network-manager service, it immediately reconnects.

Is this normal behavior? If so, how do I fix it?

I was thinking of making a cronjob that periodically checks the connection and restarts NM if it's down, but that seems a little hacky.

Cerin
  • 6,485

2 Answers2

3

You can try placing a line in this file: /etc/crontab (using sudo)

For example: 10 * * * * root /etc/init.d/networking restart OR you can also use the ping command instead of restarting networking (2 * * * * root ping [ex. google.com]) When you save the file this command will automatically (no reboot needed) run as root every 10 minutes by the process "cron" (locate the process using this command: ps -aux | grep cron).

EDIT: Also, try these commands in order to reconnect your network interface:

sudo nmcli nm enable false && nmcli nm enable true

OR

sudo ifconfig wlan0 down && sudo ifconfig wlan0 up 

There is also an ubuntu forums thread.

llrs
  • 109
  • 1
  • 7
theoko
  • 56
  • 3
  • This is essentially what I did, although my script instead checked NetworkManager's connection status, and restarted it if it reported no connection. – Cerin Oct 19 '15 at 16:27
  • Add the -c property to the ping command. Ex. ping -c 5 google.com so that the process exits after sending 5 packets. – theoko Nov 09 '15 at 19:39
0

Here is a method that works very well: Use wavemon.

Install it like this:

sudo apt-get update
sudo apt-get install wavemon

Then go to a secondary desktop workspace.

Open a terminal window.

Issue the command:

sudo wavemon

It will show the connection strength (which is handy for placement of antennas, among other things)

sudo is not required to run this command but allows it to gather more information such as the F3 Scan function that shows other Access Points in range.

Wavemon continually generates ping-like packets.

When this is used it is safe to lock the screen with the Command-L keystroke. The program will continue to run.

Try it out and post comments with your experiences.

SDsolar
  • 3,169