Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Ubuntu 16.04.3 + How to autoreload wifi-module when waking from suspend?

  1. #11
    Join Date
    Apr 2012
    Beans
    Hidden!

    Re: Ubuntu 16.04.3 + How to autoreload wifi-module when waking from suspend?

    what do you mean by ?
    "I will. But I have no way to run that rc.local automatically." ???

    Would you like a terminal command line way ??
    Craving anchovy, herring and squid pizza.....with clam sauce

  2. #12
    Join Date
    Sep 2010
    Beans
    95

    Re: Ubuntu 16.04.3 + How to autoreload wifi-module when waking from suspend?

    Now that I have repeater disconnected and did what you told, still wireless does not start. In fact now running /etc/rc.local manually nothing happens to the wireless (but calculator starts in 10 sec)

    Manually running:
    Code:
    sudo rmmod mt7601u
    sudo modprobe mt7601u
    starts wireless fine.

  3. #13
    Join Date
    Sep 2010
    Beans
    95

    Re: Ubuntu 16.04.3 + How to autoreload wifi-module when waking from suspend?

    I know how to run /etc/rc.local manually, but how do I get it to run when my computer wakes up from suspend? That is when the problem occurs
    Last edited by Janiporo; November 14th, 2017 at 08:11 PM.

  4. #14
    Join Date
    Sep 2010
    Beans
    95

    Re: Ubuntu 16.04.3 + How to autoreload wifi-module when waking from suspend?

    According to this --> https://mariogalan.com/en/content/ex...nd-ubuntu-1604
    I should make a script that runs rc.local when waking from suspend. It does not say how to make it to run, and all details are missing, can you help about that?

    Should it be:
    Code:
    #!/bin/sh
    
    # Execute fancontrol
    
    case "$1" in
            post)
              /etc/rc.local 
                    ;;
    esac
    
    EDIT: how do I make it to execute, what should be the name? Full instructions, please
    Last edited by Janiporo; November 14th, 2017 at 08:49 PM.

  5. #15
    Join Date
    Apr 2012
    Beans
    Hidden!

    Re: Ubuntu 16.04.3 + How to autoreload wifi-module when waking from suspend?

    ok here are step-by-step instructions to build a script to do the same
    commands as you are doing manually, we will be writing the script to
    your home directory. and activating it from rc.local file.

    The script name is start-wifi it will be written to your home directory.
    The command in /etc/rc.local executes the start-wifi in the home directory.
    From your home directory.
    Open a terminal and do..
    Code:
     gedit start-wifi
    *Then Copy and Paste all 4 lines of the script to the gedit editor.
    ^Replace 'your-password' with your password
    *The Script
    Code:
    #!bin/bash
    PATH=$PATH:~/usr/bin
    echo 'your-password' | sudo -S rm -rf mt7601u
    echo 'your-password' | sudo -S modprobe mt7601u
    *After you have copied the 4 lines of the script to gedit
    *Save and close gedit.

    *Back to the terminal and do..
    Code:
     sudo chmod u+x start-wifi
    *Then do ...
    Code:
    sudo gedit /etc/rc.local
    *Delete all the lines and replace with..
    Code:
    /home/Janiporo/start-wifi
    gnome-calculator
    exit 0
    *Save and close gedit.

    ***REMOVE Wired connection ***
    *Back to terminal and do..
    Code:
    sudo reboot
    It should fly.
    ***I assumed this would be correct.../home/Janiporo/start-wifi
    If it is not "Janiporo" please change it to match what is on your home directory prompt.
    Last edited by Hadaka; November 15th, 2017 at 03:57 AM.
    Craving anchovy, herring and squid pizza.....with clam sauce

  6. #16
    Join Date
    Sep 2010
    Beans
    95

    Re: Ubuntu 16.04.3 + How to autoreload wifi-module when waking from suspend?

    I am 100% sure this will not work, since rc.local is not executed at any point. And I need it to run when coming back from suspend.

    Can you tell me how to run /etc/rc.local when waking from suspend?

  7. #17
    Join Date
    Apr 2012
    Beans
    Hidden!

    Re: Ubuntu 16.04.3 + How to autoreload wifi-module when waking from suspend?

    Try this method..
    https://askubuntu.com/questions/7481.../748130#748130

    hope this works for you.
    Craving anchovy, herring and squid pizza.....with clam sauce

  8. #18
    Join Date
    Sep 2010
    Beans
    95

    Re: Ubuntu 16.04.3 + How to autoreload wifi-module when waking from suspend?

    It seemed the last one helped, but it does not work after 10 suspend/resume-cycles. (So I am back at the starting point)

    I really want to run /etc/rc.local automatically when resuming from suspend, do you have any idea how to make it do that in ubuntu 16.04?

    And I need it to run as sudo, since rmmod needs that.

    Remember, when problem occurs, no SSID is available in network manager.

    I am back with this in rc.local (Since this is only way I get it to work, your suggestions for rmmod-substitute settings did not work)

    Code:
    #!/bin/sh
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
    
    sleep 5
    
    rmmod mt7601u
    
    sleep 1
    
    modprobe mt7601u
    
    sleep 1
    
    gnome-calculator
    
    exit 0
    I am trying some other settings, please tell me, if you can help more.
    Last edited by Janiporo; November 15th, 2017 at 06:03 PM.

  9. #19
    Join Date
    Sep 2010
    Beans
    95

    Re: Ubuntu 16.04.3 + How to autoreload wifi-module when waking from suspend?

    I found the solution to run /etc/rc.local when resuming from suspend. It is here --> https://ubuntuforums.org/showthread.php?t=2377764

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •