Results 1 to 9 of 9

Thread: Bluetooth doesn't work after resume from sleep/standby

Hybrid View

  1. #1
    Join Date
    Dec 2007
    Beans
    34

    Bluetooth doesn't work after resume from sleep/standby

    Hello


    I just bought a Logitech V470 bluetooth mouse. It's no problem to let it work under Koala 9.10 (gnome), but after shutdown/standby/sleep, it doesn't work anymore.

    With my USB mouse, I have to click the bluetooth icon and select 'switch off bluetooth'. After that, I click 'switch on bluetooth' and bluetooth works again...

    I thought switching on and off bluetooth with the applet is the same as 'sudo /etc/init.d/bluetooth start/stop', but it isn't! The previous command greyes out/in the bluetooth icon, but it doesn't resume my bluetooth.
    If 'sudo /etc/init.d/bluetooth restart' would work, I would be able to add this line into /etc/pm/sleep.d, so it's automatically loaded on resume.



    Does anyone know a solution?
    Thanks!

  2. #2
    Join Date
    Dec 2007
    Beans
    34

    Re: Bluetooth doesn't work after resume from sleep/standby

    OK, after some days of searching, I found the solution myself. Appearantly the command is

    $rfkill block bluetooth

    to stop Bluetooth and

    $rfkill unblock bluetooth

    to resume Bluetooth.

    So, my file in /etc/pm/sleep.d looks like this:

    Code:
    #!/bin/bash
    
    . /usr/lib/pm-utils/functions
    
    case "$1" in
        hibernate|suspend)
        rfkill block bluetooth
        ;;
        thaw|resume)
        rfkill unblock bluetooth
        ;;
        *)
        ;;
    esac
    
    exit

  3. #3
    Join Date
    Sep 2009
    Beans
    18

    SOLVED! Bluetooth doesn't work after resume from sleep/standby

    Thank you so much Ferux! =D> This problem with bluetooth going offline and restarting after an arbitrary timespan has been bothering me for so long! Now it seems to work thanks to your script.

    It took me a while to understand what exactly to do, so here is a more elaborate explanation:

    When the computer hibernate, suspends and resume linux looks in /etc/pm/sleep.d and run all files in there. Thus Ferux' script should be put in there in a file that is readable to all users:

    Code:
    cd /etc/pm/sleep.d
    sudo touch 10_bluetooth
    sudo chmod 0755 10_bluetooth
    sudo kate 10_bluetooth
    Now copy and paste Ferux' script into the new file:

    Code:
    #!/bin/bash
    #Code from http://ubuntuforums.org/showthread.php?t=1387211
    
    . /usr/lib/pm-utils/functions
    
    case "$1" in
        hibernate|suspend)
        rfkill block bluetooth
        ;;
        thaw|resume)
        rfkill unblock bluetooth
        ;;
        *)
        ;;
    esac
    
    exit
    Hit save and you are done! No more waiting for bluetooth!

  4. #4
    Join Date
    Jul 2007
    Beans
    129
    Distro
    Ubuntu

    Re: SOLVED! Bluetooth doesn't work after resume from sleep/standby

    Quote Originally Posted by jeppebundsgaard View Post
    Code:
    cd /etc/pm/sleep.d
    sudo touch 10_bluetooth
    sudo chmod 0755 10_bluetooth
    sudo kate 10_bluetooth
    Now copy and paste Ferux' script into the new file:
    Just wanted to mention that I try to look at all commands before I run a simple script. Those that have Gnome for example should run "gedit" instead of "kate":


    Code:
    cd /etc/pm/sleep.d
    sudo touch 10_bluetooth
    sudo chmod 0755 10_bluetooth
    sudo gedit 10_bluetooth
    Now copy and paste Ferux' script into the new file as described above.


    Oh, and yes thank you Ferux. I now can use my Blue Proximity program after suspend to lock/unlock my desktop without having to manually sign in with my cell phone now! Sweetness! Also, I learned about the case command. I thought the case was a letter case "switcher" (and therefore not sure why it was needed, lol), and I couldn't figure out "esac" lol. But I get it now after some Google-fu.

  5. #5
    Join Date
    Apr 2008
    Beans
    2

    Re: Bluetooth doesn't work after resume from sleep/standby

    Thanks Ferux et al.
    Solution fixed the same frustrating issue I was having on an HP Mini 311 running 10.10

  6. #6
    Join Date
    May 2010
    Location
    Lancaster, CA
    Beans
    23
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Bluetooth doesn't work after resume from sleep/standby

    thank you!! I an going to see if this works for the Rii Mini keyboard/mouse, will let you know if it works.

    **edit**

    Yes it did!!
    Last edited by Protocol84; February 22nd, 2011 at 10:49 PM.

Tags for this Thread

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
  •