Contribute
Register

Not Shy's Guide - Potentially Fix Bluetooth Sleep/Wake

Status
Not open for further replies.
big_slim said:
Hi, I've kind of got a Belkin F8T016NG working on my hackintosh with a magic mouse and aluminium keyboard.
Originally I enabled the grey option in bluetooth preferences by adding product/vendor info, but I found that didn't make any difference. I was running into trouble waking the mighty mouse after coming out of sleep. The only way I could get it working again was by removing and reinserting the bluetooth adapter. On trial and error I accidentally removed my IOBluetoothFamily kext and suddenly I was able to re-use the mouse after sleep, however it lacked scrolling and the keyboard lacked special buttons, volume etc.
After copying IOBluetoothFamily back to S/L/E I was unable to use the mouse after waking from sleep.??

Can someone explain this, or help getting my mouse working as it should?

Thanks

Dan

Follow this to fix your bluetooth:
1. run this commands in terminal to copy and repair permisions
Code:
sudo copy /your-vanila-kext-location/IOBluetoothFamily.kext /System/Library/Extensions
sudo chown -R root:wheel /System/Library/Extensions/IOBluetoothFamily.kext
sudo chmod -R 755 /System/Library/Extensions/IOBluetoothFamily.kext
2. Use notshy´s method to fix vendor and product id (this will allow you to turn on/off bluetooth with little script after wake up=solution)
3.Look at page 9 in this thread for D-an-W´s post about blueutil utility and to that.
 
bought the trust 2400p that is used in the op.

product id and vendor id dont even show up lol. they are like 0x1 and 0x34 or similar.

however, on wake up from sleep (magic mouse cannot wake it) the mouse continues to work fine so that is not a big problem
 
sumsaykra-z said:
Hey man. I checked out that guide and while it's a great idea to connect it to USB header (that's what I'm going to do) that 5v to 3.3v converter isn't necessary. If you check out our discussion Here you'll see we're using a simple diode to drop the voltage to 3.6v which works great, is cheaper and can just be picked up at like a RadioShack or simple electrical hobby shop. I'm sure the other method is fine as well but the parts look bulky and unnecessary. Cheers.

anyone kind enough to post a picture with a diode in it? or a quick how to.. my Apple bluetooth is on the way but no idea what to do when it arrives :p

really appreciate it...
 
Firstly thanks to Notshy for getting me started. I just want to share my experience getting my Trust 2400p mini dongle working to help those that experienced the same problem as me. I see from the thread that Sudds had the same issue, namely that under system profiler vendor and product ID were marked as 0.

So here is my fix.

Step 1. Download and install PlistEdit pro from the Apple website. It helps with kext editing as you can see exactly which section you need to be editing.

Step 2. As the system profiler Bluetooth section does not identify product and vendor ID, get this information under the USB section in system profiler and convert to numerical using a converter.

Step 3. Navigate to system/library/extensions and find IOBluetoothFamilyKext. Copy it to an alternative location in case you make a mistake and need to restore it later. Also copy this kext to the desktop. Trash the IOBluetoothFamilyKext for the S/L/E folder.

Step 4. Working with the IOBluetoothFamilyKect on the desktop, open “contents” then open “plugins” then open the folder: “BroadcomUSBBluetoothHCIController” then open “contents” and navigate to info.plist.

Step 5. Open info.plist using PlistEdit pro you installed earlier and navigate to IOKitPersonalities. Click the horizontal arrow and find Broadcom2045FamilyUSBBluetoothHCIController_Dongle. Click the horizontal arrow next to that and then further down the list you need to change the values next to idProduct (in my case to 8449) and idVendor (2652). Save the file.

Step 6. Place kextbeast on your desktop (IOBluetoothFamilyKext is already there). Run Kextbest which will install the modified kext under S/L/E.

Restart the Mac.

This is where the fun started for me as I needed to remove the Bluetooth dongle to get it to start. After restart reinsert the Bluetooth dongle. The correct vendor and product ID is visible under system profiler / Bluetooth.

However I wasn’t finished. The keyboard and trackpad didn’t work. I had to remove them from System preferences / Bluetooth by deleting them. After that I used system preferences / Bluetooth /advanced to resync them to the system.

Everything works, the box is no longer greyed out. The trackpad puts the mac to sleep (only one thing I noticed is that you need to leave a finger resting on the surface of the trackpad or the system awakes straight away) Really happy. Now my Mac is fully functional in every respect.
 
frey said:
I'm not sure if this is the right place to post this, but I seem to have fixed a bluetooth busted-on-wake issue with my Mighty Mouse. Wake using bluetooth has never worked, but normal wake would leave Bluetooth seeming to be on but actually being off.

Using Sleepwatcher installed as a system daemon (not a user agent), and with this in /etc/rc.sleep:
Code:
#!/bin/sh
/usr/local/sbin/blueutil off

and this in /etc/rc.wakeup:

Code:
#!/bin/sh
/usr/local/sbin/blueutil on
sleep 5
/usr/local/sbin/blueutil off
sleep 1
/usr/local/sbin/blueutil on

I have things working.

The key seems to to turn off BlueTooth before sleep, then to do the double dance off/on again at wake up. Important to note that blueutil must be run as root.

Hi Frey

I was having similar problems so thought I would try your method. I don't think the rc.wakeup script is being run on wakeup - any suggestions as to what I should look at? I have sleep enabler running from the default script that it comes with - it is located in /Library/LaunchDaemons

rc.sleep seems to work as my keyboard gets disconnected before the machine sleeps and when I wake it up bluetooth is actually disabled.

I'm wondering if I have missed a step somewhere.

Chris
 
Chris, try setting it up as my post on page 9. If that doesn't work, edit your files to look like below (I found the sleep 1 and double toggle helps stubborn dongles), also check the Console logs for any permission errors that might be preventing access to the files...


rc.WakeUp
Code:
#!/bin/sh
# sleep 1
# /usr/sbin/BlueUtil off
sleep 1
/usr/sbin/BlueUtil on
sleep 1
/usr/sbin/BlueUtil off
sleep 1
/usr/sbin/BlueUtil on

rc.Sleep
Code:
#!/bin/sh
/usr/sbin/BlueUtil off
sleep 1

BlueUtil.plist
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>de.bernhard-baehr.sleepwatcher</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/sbin/SleepWatcher</string>
		<string>-s /Library/SleepWatcher/rc.Sleep</string>			<string>-w /Library/SleepWatcher/rc.WakeUp</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
	<key>KeepAlive</key>
	<true/>
</dict>
</plist>
 
D-an-W said:
Chris, try setting it up as my post on page 9. If that doesn't work, edit your files to look like below (I found the sleep 1 and double toggle helps stubborn dongles), also check the Console logs for any permission errors that might be preventing access to the files...


rc.WakeUp
Code:
#!/bin/sh
# sleep 1
# /usr/sbin/BlueUtil off
sleep 1
/usr/sbin/BlueUtil on
sleep 1
/usr/sbin/BlueUtil off
sleep 1
/usr/sbin/BlueUtil on

rc.Sleep
Code:
#!/bin/sh
/usr/sbin/BlueUtil off
sleep 1

BlueUtil.plist
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>de.bernhard-baehr.sleepwatcher</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/sbin/SleepWatcher</string>
		<string>-s /Library/SleepWatcher/rc.Sleep</string>			<string>-w /Library/SleepWatcher/rc.WakeUp</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
	<key>KeepAlive</key>
	<true/>
</dict>
</plist>


Hi D-an-W

I changed my setup to be the same as the one above but the problem would appear to be with permissions. I will see if I can get the permissions set correctly.

Chris
 
If I remember right it was something like "chmod 644 BlueUtil" when I was having permission problems, I had manually installed BlueUtil thought so using the installer might set them for you.
 
D-an-W said:
If I remember right it was something like "chmod 644 BlueUtil" when I was having permission problems, I had manually installed BlueUtil thought so using the installer might set them for you.


The problem was with the permissions on the rc scripts and Sleepwatcher. I've fixed this and BT is now working perfectly when my hack comes out of sleep :)

Chris
 
Status
Not open for further replies.
Back
Top