How to prevent wifi sleep after suspend





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







13















Every time I open my notebook lid I have to wait a few seconds for wifi to reconnect. I remember that in Windows it was already connected. I need a way to prevent wifi from disconneting on suspend.



The closest answer I found was https://askubuntu.com/a/961460/613425 but it didn't work. I also tried the iwconfig wlan0 poweroff in the answer but it didn't work even before reboot.










share|improve this question























  • So, unlike the question you linked above, your WiFi is not unstable. It connects and works fine after you open the lid and wake up the laptop from sleep. You want WiFi to connect more quickly. What would happen when you move your laptop 20 miles while it was sleeping? Would it still remain connected?

    – user68186
    May 8 '18 at 14:47











  • @user68186 it never remains connected, even in the same place after I reopen the lid. I have to wait for it to connect again.

    – Guerlando OCs
    May 8 '18 at 15:03











  • Do you mean it never remains connected while it sleeps? I once knew someone who used to talk while sleeping, but my laptop doesn't do that. I don't think what you want is possible unless you stop your laptop from sleeping altogether.

    – user68186
    May 8 '18 at 15:07






  • 1





    @SebastianStark Razer Blade Stealth 2016 12.5". It had the desired behavior on windows

    – Guerlando OCs
    May 8 '18 at 19:51






  • 1





    What's the output to iwconfig? Please edit your question to provide the output there instead of here in the comments.

    – Fabby
    May 9 '18 at 17:48


















13















Every time I open my notebook lid I have to wait a few seconds for wifi to reconnect. I remember that in Windows it was already connected. I need a way to prevent wifi from disconneting on suspend.



The closest answer I found was https://askubuntu.com/a/961460/613425 but it didn't work. I also tried the iwconfig wlan0 poweroff in the answer but it didn't work even before reboot.










share|improve this question























  • So, unlike the question you linked above, your WiFi is not unstable. It connects and works fine after you open the lid and wake up the laptop from sleep. You want WiFi to connect more quickly. What would happen when you move your laptop 20 miles while it was sleeping? Would it still remain connected?

    – user68186
    May 8 '18 at 14:47











  • @user68186 it never remains connected, even in the same place after I reopen the lid. I have to wait for it to connect again.

    – Guerlando OCs
    May 8 '18 at 15:03











  • Do you mean it never remains connected while it sleeps? I once knew someone who used to talk while sleeping, but my laptop doesn't do that. I don't think what you want is possible unless you stop your laptop from sleeping altogether.

    – user68186
    May 8 '18 at 15:07






  • 1





    @SebastianStark Razer Blade Stealth 2016 12.5". It had the desired behavior on windows

    – Guerlando OCs
    May 8 '18 at 19:51






  • 1





    What's the output to iwconfig? Please edit your question to provide the output there instead of here in the comments.

    – Fabby
    May 9 '18 at 17:48














13












13








13


4






Every time I open my notebook lid I have to wait a few seconds for wifi to reconnect. I remember that in Windows it was already connected. I need a way to prevent wifi from disconneting on suspend.



The closest answer I found was https://askubuntu.com/a/961460/613425 but it didn't work. I also tried the iwconfig wlan0 poweroff in the answer but it didn't work even before reboot.










share|improve this question














Every time I open my notebook lid I have to wait a few seconds for wifi to reconnect. I remember that in Windows it was already connected. I need a way to prevent wifi from disconneting on suspend.



The closest answer I found was https://askubuntu.com/a/961460/613425 but it didn't work. I also tried the iwconfig wlan0 poweroff in the answer but it didn't work even before reboot.







networking wireless suspend






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 5 '18 at 10:13









Guerlando OCsGuerlando OCs

3111722




3111722













  • So, unlike the question you linked above, your WiFi is not unstable. It connects and works fine after you open the lid and wake up the laptop from sleep. You want WiFi to connect more quickly. What would happen when you move your laptop 20 miles while it was sleeping? Would it still remain connected?

    – user68186
    May 8 '18 at 14:47











  • @user68186 it never remains connected, even in the same place after I reopen the lid. I have to wait for it to connect again.

    – Guerlando OCs
    May 8 '18 at 15:03











  • Do you mean it never remains connected while it sleeps? I once knew someone who used to talk while sleeping, but my laptop doesn't do that. I don't think what you want is possible unless you stop your laptop from sleeping altogether.

    – user68186
    May 8 '18 at 15:07






  • 1





    @SebastianStark Razer Blade Stealth 2016 12.5". It had the desired behavior on windows

    – Guerlando OCs
    May 8 '18 at 19:51






  • 1





    What's the output to iwconfig? Please edit your question to provide the output there instead of here in the comments.

    – Fabby
    May 9 '18 at 17:48



















  • So, unlike the question you linked above, your WiFi is not unstable. It connects and works fine after you open the lid and wake up the laptop from sleep. You want WiFi to connect more quickly. What would happen when you move your laptop 20 miles while it was sleeping? Would it still remain connected?

    – user68186
    May 8 '18 at 14:47











  • @user68186 it never remains connected, even in the same place after I reopen the lid. I have to wait for it to connect again.

    – Guerlando OCs
    May 8 '18 at 15:03











  • Do you mean it never remains connected while it sleeps? I once knew someone who used to talk while sleeping, but my laptop doesn't do that. I don't think what you want is possible unless you stop your laptop from sleeping altogether.

    – user68186
    May 8 '18 at 15:07






  • 1





    @SebastianStark Razer Blade Stealth 2016 12.5". It had the desired behavior on windows

    – Guerlando OCs
    May 8 '18 at 19:51






  • 1





    What's the output to iwconfig? Please edit your question to provide the output there instead of here in the comments.

    – Fabby
    May 9 '18 at 17:48

















So, unlike the question you linked above, your WiFi is not unstable. It connects and works fine after you open the lid and wake up the laptop from sleep. You want WiFi to connect more quickly. What would happen when you move your laptop 20 miles while it was sleeping? Would it still remain connected?

– user68186
May 8 '18 at 14:47





So, unlike the question you linked above, your WiFi is not unstable. It connects and works fine after you open the lid and wake up the laptop from sleep. You want WiFi to connect more quickly. What would happen when you move your laptop 20 miles while it was sleeping? Would it still remain connected?

– user68186
May 8 '18 at 14:47













@user68186 it never remains connected, even in the same place after I reopen the lid. I have to wait for it to connect again.

– Guerlando OCs
May 8 '18 at 15:03





@user68186 it never remains connected, even in the same place after I reopen the lid. I have to wait for it to connect again.

– Guerlando OCs
May 8 '18 at 15:03













Do you mean it never remains connected while it sleeps? I once knew someone who used to talk while sleeping, but my laptop doesn't do that. I don't think what you want is possible unless you stop your laptop from sleeping altogether.

– user68186
May 8 '18 at 15:07





Do you mean it never remains connected while it sleeps? I once knew someone who used to talk while sleeping, but my laptop doesn't do that. I don't think what you want is possible unless you stop your laptop from sleeping altogether.

– user68186
May 8 '18 at 15:07




1




1





@SebastianStark Razer Blade Stealth 2016 12.5". It had the desired behavior on windows

– Guerlando OCs
May 8 '18 at 19:51





@SebastianStark Razer Blade Stealth 2016 12.5". It had the desired behavior on windows

– Guerlando OCs
May 8 '18 at 19:51




1




1





What's the output to iwconfig? Please edit your question to provide the output there instead of here in the comments.

– Fabby
May 9 '18 at 17:48





What's the output to iwconfig? Please edit your question to provide the output there instead of here in the comments.

– Fabby
May 9 '18 at 17:48










3 Answers
3






active

oldest

votes


















10





+25









There are two ways of enabling WiFi after sleep. The first is a common patch to Network Manager as you can see I've made by listing the file:




Turn off or enable power savings as illustrated below:



$ cat /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
[connection]
wifi.powersave = 3
# Slow sleep fix: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1670041
#wifi.powersave = 2



  • Edit the Network Manager file shown above.

  • Change WiFi.powersave from 2 to 3 (Enable power saving).

  • If it's already set to 3 try setting it to 2 (Disable power saving).

  • After saving the file run sudo systemctl restart NetworkManager


The second is a systemd script which reloads the WiFi kernel module when resuming from suspend. It comes from this answer: Wifi available networks not showing up suddenly:



This script is written for iwlwifi` which is the common Intel driver name. If your's is different change that name below:



#!/bin/sh

# NAME: /lib/systemd/system-sleep/iwlwifi-reset
# DESC: Resets Intel WiFi which can be flakey after a long suspend.
# DATE: Apr 1, 2017. Modified August 30, 2017.

MYNAME=$0

restart_wifi() {
/usr/bin/logger $MYNAME 'restart_wifi BEGIN'
/sbin/modprobe -v -r iwldvm # This removes iwlwifi too
/sbin/modprobe -v iwlwifi # This starts iwldvm too
# systemctl restart NetworkManager.service
/usr/bin/logger 'systemctl restart NetworkManager.service (SUPPRESSED)'
/usr/bin/logger $MYNAME 'restart_wifi END'
}

/usr/bin/logger $MYNAME 'case=[' ${1}' ]'
case "${1}/${2}" in
hibernate|suspend|pre*)
;;
resume|thaw|post*)
restart_wifi;;
esac


NOTE: Sometimes simply resetting network manager is all that is needed. In that case un-comment the line above by removing #. Then comment out the two lines above it by putting # at the beginning of those two lines.



You'll need to create this script, called iwlwifi-reset, with sudo powers and save it into the directory /lib/systemd/system-sleep. Then mark it executable using:



chmod a+x /lib/systemd/system-sleep/iwlwifi-reset





share|improve this answer

































    2














    I think it is related to systemd. You can make a script that starts the wifi device after suspend. Just try to do so manually first.






    share|improve this answer































      2














      First ceate a new script and make it executable.



      sudo touch /usr/lib/pm-utils/sleep.d/wakewifi
      sudo chmod a+x /usr/lib/pm-utils/sleep.d/wakewifi


      Then edit the script



      sudo nano /usr/lib/pm-utils/sleep.d/wakewifi


      and make it look something like this.



       #!/bin/sh

      case "$1" in
      resume)
      nmcli radio wifi on
      esac


      to make sure that nmcli radio wifi on is the correct command, try to go into sleep mode, start the computer up and do



      sudo nmcli radio wifi on


      if your computer then connect to the correct wifi, then this might be a optional solution for you. your computer should auto-connect. to your saved wi-fi access point.






      share|improve this answer
























        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "89"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1022203%2fhow-to-prevent-wifi-sleep-after-suspend%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        10





        +25









        There are two ways of enabling WiFi after sleep. The first is a common patch to Network Manager as you can see I've made by listing the file:




        Turn off or enable power savings as illustrated below:



        $ cat /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
        [connection]
        wifi.powersave = 3
        # Slow sleep fix: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1670041
        #wifi.powersave = 2



        • Edit the Network Manager file shown above.

        • Change WiFi.powersave from 2 to 3 (Enable power saving).

        • If it's already set to 3 try setting it to 2 (Disable power saving).

        • After saving the file run sudo systemctl restart NetworkManager


        The second is a systemd script which reloads the WiFi kernel module when resuming from suspend. It comes from this answer: Wifi available networks not showing up suddenly:



        This script is written for iwlwifi` which is the common Intel driver name. If your's is different change that name below:



        #!/bin/sh

        # NAME: /lib/systemd/system-sleep/iwlwifi-reset
        # DESC: Resets Intel WiFi which can be flakey after a long suspend.
        # DATE: Apr 1, 2017. Modified August 30, 2017.

        MYNAME=$0

        restart_wifi() {
        /usr/bin/logger $MYNAME 'restart_wifi BEGIN'
        /sbin/modprobe -v -r iwldvm # This removes iwlwifi too
        /sbin/modprobe -v iwlwifi # This starts iwldvm too
        # systemctl restart NetworkManager.service
        /usr/bin/logger 'systemctl restart NetworkManager.service (SUPPRESSED)'
        /usr/bin/logger $MYNAME 'restart_wifi END'
        }

        /usr/bin/logger $MYNAME 'case=[' ${1}' ]'
        case "${1}/${2}" in
        hibernate|suspend|pre*)
        ;;
        resume|thaw|post*)
        restart_wifi;;
        esac


        NOTE: Sometimes simply resetting network manager is all that is needed. In that case un-comment the line above by removing #. Then comment out the two lines above it by putting # at the beginning of those two lines.



        You'll need to create this script, called iwlwifi-reset, with sudo powers and save it into the directory /lib/systemd/system-sleep. Then mark it executable using:



        chmod a+x /lib/systemd/system-sleep/iwlwifi-reset





        share|improve this answer






























          10





          +25









          There are two ways of enabling WiFi after sleep. The first is a common patch to Network Manager as you can see I've made by listing the file:




          Turn off or enable power savings as illustrated below:



          $ cat /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
          [connection]
          wifi.powersave = 3
          # Slow sleep fix: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1670041
          #wifi.powersave = 2



          • Edit the Network Manager file shown above.

          • Change WiFi.powersave from 2 to 3 (Enable power saving).

          • If it's already set to 3 try setting it to 2 (Disable power saving).

          • After saving the file run sudo systemctl restart NetworkManager


          The second is a systemd script which reloads the WiFi kernel module when resuming from suspend. It comes from this answer: Wifi available networks not showing up suddenly:



          This script is written for iwlwifi` which is the common Intel driver name. If your's is different change that name below:



          #!/bin/sh

          # NAME: /lib/systemd/system-sleep/iwlwifi-reset
          # DESC: Resets Intel WiFi which can be flakey after a long suspend.
          # DATE: Apr 1, 2017. Modified August 30, 2017.

          MYNAME=$0

          restart_wifi() {
          /usr/bin/logger $MYNAME 'restart_wifi BEGIN'
          /sbin/modprobe -v -r iwldvm # This removes iwlwifi too
          /sbin/modprobe -v iwlwifi # This starts iwldvm too
          # systemctl restart NetworkManager.service
          /usr/bin/logger 'systemctl restart NetworkManager.service (SUPPRESSED)'
          /usr/bin/logger $MYNAME 'restart_wifi END'
          }

          /usr/bin/logger $MYNAME 'case=[' ${1}' ]'
          case "${1}/${2}" in
          hibernate|suspend|pre*)
          ;;
          resume|thaw|post*)
          restart_wifi;;
          esac


          NOTE: Sometimes simply resetting network manager is all that is needed. In that case un-comment the line above by removing #. Then comment out the two lines above it by putting # at the beginning of those two lines.



          You'll need to create this script, called iwlwifi-reset, with sudo powers and save it into the directory /lib/systemd/system-sleep. Then mark it executable using:



          chmod a+x /lib/systemd/system-sleep/iwlwifi-reset





          share|improve this answer




























            10





            +25







            10





            +25



            10




            +25





            There are two ways of enabling WiFi after sleep. The first is a common patch to Network Manager as you can see I've made by listing the file:




            Turn off or enable power savings as illustrated below:



            $ cat /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
            [connection]
            wifi.powersave = 3
            # Slow sleep fix: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1670041
            #wifi.powersave = 2



            • Edit the Network Manager file shown above.

            • Change WiFi.powersave from 2 to 3 (Enable power saving).

            • If it's already set to 3 try setting it to 2 (Disable power saving).

            • After saving the file run sudo systemctl restart NetworkManager


            The second is a systemd script which reloads the WiFi kernel module when resuming from suspend. It comes from this answer: Wifi available networks not showing up suddenly:



            This script is written for iwlwifi` which is the common Intel driver name. If your's is different change that name below:



            #!/bin/sh

            # NAME: /lib/systemd/system-sleep/iwlwifi-reset
            # DESC: Resets Intel WiFi which can be flakey after a long suspend.
            # DATE: Apr 1, 2017. Modified August 30, 2017.

            MYNAME=$0

            restart_wifi() {
            /usr/bin/logger $MYNAME 'restart_wifi BEGIN'
            /sbin/modprobe -v -r iwldvm # This removes iwlwifi too
            /sbin/modprobe -v iwlwifi # This starts iwldvm too
            # systemctl restart NetworkManager.service
            /usr/bin/logger 'systemctl restart NetworkManager.service (SUPPRESSED)'
            /usr/bin/logger $MYNAME 'restart_wifi END'
            }

            /usr/bin/logger $MYNAME 'case=[' ${1}' ]'
            case "${1}/${2}" in
            hibernate|suspend|pre*)
            ;;
            resume|thaw|post*)
            restart_wifi;;
            esac


            NOTE: Sometimes simply resetting network manager is all that is needed. In that case un-comment the line above by removing #. Then comment out the two lines above it by putting # at the beginning of those two lines.



            You'll need to create this script, called iwlwifi-reset, with sudo powers and save it into the directory /lib/systemd/system-sleep. Then mark it executable using:



            chmod a+x /lib/systemd/system-sleep/iwlwifi-reset





            share|improve this answer















            There are two ways of enabling WiFi after sleep. The first is a common patch to Network Manager as you can see I've made by listing the file:




            Turn off or enable power savings as illustrated below:



            $ cat /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
            [connection]
            wifi.powersave = 3
            # Slow sleep fix: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1670041
            #wifi.powersave = 2



            • Edit the Network Manager file shown above.

            • Change WiFi.powersave from 2 to 3 (Enable power saving).

            • If it's already set to 3 try setting it to 2 (Disable power saving).

            • After saving the file run sudo systemctl restart NetworkManager


            The second is a systemd script which reloads the WiFi kernel module when resuming from suspend. It comes from this answer: Wifi available networks not showing up suddenly:



            This script is written for iwlwifi` which is the common Intel driver name. If your's is different change that name below:



            #!/bin/sh

            # NAME: /lib/systemd/system-sleep/iwlwifi-reset
            # DESC: Resets Intel WiFi which can be flakey after a long suspend.
            # DATE: Apr 1, 2017. Modified August 30, 2017.

            MYNAME=$0

            restart_wifi() {
            /usr/bin/logger $MYNAME 'restart_wifi BEGIN'
            /sbin/modprobe -v -r iwldvm # This removes iwlwifi too
            /sbin/modprobe -v iwlwifi # This starts iwldvm too
            # systemctl restart NetworkManager.service
            /usr/bin/logger 'systemctl restart NetworkManager.service (SUPPRESSED)'
            /usr/bin/logger $MYNAME 'restart_wifi END'
            }

            /usr/bin/logger $MYNAME 'case=[' ${1}' ]'
            case "${1}/${2}" in
            hibernate|suspend|pre*)
            ;;
            resume|thaw|post*)
            restart_wifi;;
            esac


            NOTE: Sometimes simply resetting network manager is all that is needed. In that case un-comment the line above by removing #. Then comment out the two lines above it by putting # at the beginning of those two lines.



            You'll need to create this script, called iwlwifi-reset, with sudo powers and save it into the directory /lib/systemd/system-sleep. Then mark it executable using:



            chmod a+x /lib/systemd/system-sleep/iwlwifi-reset






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 5 at 10:58









            kai

            32




            32










            answered May 12 '18 at 15:32









            WinEunuuchs2UnixWinEunuuchs2Unix

            48.5k1198187




            48.5k1198187

























                2














                I think it is related to systemd. You can make a script that starts the wifi device after suspend. Just try to do so manually first.






                share|improve this answer




























                  2














                  I think it is related to systemd. You can make a script that starts the wifi device after suspend. Just try to do so manually first.






                  share|improve this answer


























                    2












                    2








                    2







                    I think it is related to systemd. You can make a script that starts the wifi device after suspend. Just try to do so manually first.






                    share|improve this answer













                    I think it is related to systemd. You can make a script that starts the wifi device after suspend. Just try to do so manually first.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered May 12 '18 at 12:47









                    Ramy SamyRamy Samy

                    314




                    314























                        2














                        First ceate a new script and make it executable.



                        sudo touch /usr/lib/pm-utils/sleep.d/wakewifi
                        sudo chmod a+x /usr/lib/pm-utils/sleep.d/wakewifi


                        Then edit the script



                        sudo nano /usr/lib/pm-utils/sleep.d/wakewifi


                        and make it look something like this.



                         #!/bin/sh

                        case "$1" in
                        resume)
                        nmcli radio wifi on
                        esac


                        to make sure that nmcli radio wifi on is the correct command, try to go into sleep mode, start the computer up and do



                        sudo nmcli radio wifi on


                        if your computer then connect to the correct wifi, then this might be a optional solution for you. your computer should auto-connect. to your saved wi-fi access point.






                        share|improve this answer




























                          2














                          First ceate a new script and make it executable.



                          sudo touch /usr/lib/pm-utils/sleep.d/wakewifi
                          sudo chmod a+x /usr/lib/pm-utils/sleep.d/wakewifi


                          Then edit the script



                          sudo nano /usr/lib/pm-utils/sleep.d/wakewifi


                          and make it look something like this.



                           #!/bin/sh

                          case "$1" in
                          resume)
                          nmcli radio wifi on
                          esac


                          to make sure that nmcli radio wifi on is the correct command, try to go into sleep mode, start the computer up and do



                          sudo nmcli radio wifi on


                          if your computer then connect to the correct wifi, then this might be a optional solution for you. your computer should auto-connect. to your saved wi-fi access point.






                          share|improve this answer


























                            2












                            2








                            2







                            First ceate a new script and make it executable.



                            sudo touch /usr/lib/pm-utils/sleep.d/wakewifi
                            sudo chmod a+x /usr/lib/pm-utils/sleep.d/wakewifi


                            Then edit the script



                            sudo nano /usr/lib/pm-utils/sleep.d/wakewifi


                            and make it look something like this.



                             #!/bin/sh

                            case "$1" in
                            resume)
                            nmcli radio wifi on
                            esac


                            to make sure that nmcli radio wifi on is the correct command, try to go into sleep mode, start the computer up and do



                            sudo nmcli radio wifi on


                            if your computer then connect to the correct wifi, then this might be a optional solution for you. your computer should auto-connect. to your saved wi-fi access point.






                            share|improve this answer













                            First ceate a new script and make it executable.



                            sudo touch /usr/lib/pm-utils/sleep.d/wakewifi
                            sudo chmod a+x /usr/lib/pm-utils/sleep.d/wakewifi


                            Then edit the script



                            sudo nano /usr/lib/pm-utils/sleep.d/wakewifi


                            and make it look something like this.



                             #!/bin/sh

                            case "$1" in
                            resume)
                            nmcli radio wifi on
                            esac


                            to make sure that nmcli radio wifi on is the correct command, try to go into sleep mode, start the computer up and do



                            sudo nmcli radio wifi on


                            if your computer then connect to the correct wifi, then this might be a optional solution for you. your computer should auto-connect. to your saved wi-fi access point.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered May 12 '18 at 13:02









                            BD BearBD Bear

                            14013




                            14013






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Ask Ubuntu!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1022203%2fhow-to-prevent-wifi-sleep-after-suspend%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                數位音樂下載

                                When can things happen in Etherscan, such as the picture below?

                                格利澤436b