0

I've been trying to find a solution for a problem I've been having with my laptop on 16.04 LTS for a few days now. I can only get the wifi to work after coming out of standby by typing these 2 lines which,as far as I know,reloads the driver for the wifi pcb:

modprobe -rf rt73usb  
modprobe -v rt73usb  

I've tried a few methods to try and get this to happen automatically.One was from this thread which gave me this:

!/bin/bash  
case "$1" in  
thaw|resume)  
sudo modprobe -rf rt73usb  
sudo modprobe -v rt73usb  
;;  
*)  
;;  
esac  
exit $  

I put this in a file called wakenet, details:

ls -al 

drwxr-xr-x 2 root root 4096 nov 27 16:48 .  
drwxr-xr-x 5 root root 4096 ago  5  2015 ..  
-rwxr-xr-x 1 root root  210 giu 26  2015 10_grub-common  
-rwxr-xr-x 1 root root  660 dic  6  2013 10_unattended-upgrades-hibernate  
-rwxr-xr-x 1 root root 1260 mag 23  2012 novatel_3g_suspend  
-rwxr-xr-x 1 root root  112 nov 27 16:48 wakenet.sh  

Please could someone tell me where I'm going wrong because when coming out of standby I still get the same problem? I've only got the basics of what's happening so if you could help I would greatly appreciate it.I guess I've made a fundamental error with the script?Cheers.Mark

ps some more info:

 lshw -c network  
  *-usb DISABLED            
       description: Wireless interface  
       product: 802.11 bg WLAN  
       vendor: Ralink  
       physical id: 3  
       bus info: usb@1:3  
       logical name: wlx0019db03e22d  
       version: 0.01  
       serial: 00:19:db:03:e2:2d  
       capabilities: usb-2.00 ethernet physical wireless  
       configuration: broadcast=yes driver=rt73usb driverversion=4.4.0-47-generic firmware=1.7 link=no maxpower=300mA multicast=yes speed=480Mbit/s wireless=IEEE 802.11bg 
  *-network  
       description: Ethernet interface  
       product: RTL-8100/8101L/8139 PCI Fast Ethernet Adapter  
       vendor: Realtek Semiconductor Co., Ltd.  
       physical id: 5  
       bus info: pci@0000:06:05.0  
       logical name: eth0  
       version: 10  
       serial: 00:03:0d:5b:75:87  
       size: 10Mbit/s  
       capacity: 100Mbit/s 
       width: 32 bits  
       clock: 33MHz  
       capabilities: pm bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation  
       configuration: autonegotiation=on broadcast=yes driver=8139too driverversion=0.9.28 duplex=half latency=32 link=no maxlatency=64 mingnt=32 multicast=yes port=MII speed=10Mbit/s  
       resources: irq:16 ioport:2000(size=256) memory:b0200000-b02000ff

output of lsusb:

Bus 001 Device 002: ID 0db0:6877 Micro Star International RT2573  
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub  
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub  
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub  
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub  
6
  • Can you please check this thread askubuntu.com/questions/226278/run-script-on-wakeup
    – Bidyut
    Commented Nov 27, 2016 at 17:34
  • @Bidyut Tried that but couldn't get it to work.My script was:#!/bin/bash case "$1" in thaw|resume) sudo modprobe -rf rt73usb sudo modprobe -v rt73usb ;; *) ;; esac exit $ I put this in an executable file in this location /usr/lib/pm-utils/sleep.d .Is the above ok?
    – user620334
    Commented Nov 27, 2016 at 19:55
  • Not sure if I understand @Bidyut.The above that I mentioned was in the executable file.Although it's difficult to read.
    – user620334
    Commented Nov 27, 2016 at 21:29
  • Ya, you need to put it inside the /usr/lib/pm-utils/sleep.d if you are using Ubuntu 14.04, if you are using Ubuntu release greater than 14.04.
    – Bidyut
    Commented Nov 27, 2016 at 21:42
  • Yes,that's what I've done @Bidyut,put an executable file,with the above script,in the folder /usr/lib/pm-utils/sleep.d .I'm using 16.04 .
    – user620334
    Commented Nov 27, 2016 at 22:21

1 Answer 1

0

Many thanks @Bidyut ,that was it!From this I did the following:

sudo touch /lib/systemd/system-sleep/wakeup  
sudo chmod a+x /lib/systemd/system-sleep/wakeup  
sudo gedit /lib/systemd/system-sleep/wakeup     

then used the following script:

#!/bin/sh  
case $1/$2 in post/*)  
    modprobe -rf rt73usb  
    modprobe -v rt73usb  
    ;;  
esac 

Also thanks to @Spmp

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .