Contribute
Register

Broadcom WiFi/Bluetooth [Guide]

Joined
Jul 26, 2012
Messages
30
Motherboard
GB Z490M Gaming X
CPU
Intel Intel Core i7-10700
Graphics
Sapphire RX560 4Gb
Mac
  1. iMac
Classic Mac
  1. Power Mac
Mobile Phone
  1. Android
I lost 2 days for set up sleepwatcher. Let check readme.txt bro. You need to install sleepwatcher app, set up location for rc.wakeup, and copy plist file for work
I am check readme, what plist is? In folder 2 plists. And where to copy?
 
Joined
Jul 26, 2012
Messages
30
Motherboard
GB Z490M Gaming X
CPU
Intel Intel Core i7-10700
Graphics
Sapphire RX560 4Gb
Mac
  1. iMac
Classic Mac
  1. Power Mac
Mobile Phone
  1. Android
I lost 2 days for set up sleepwatcher. Let check readme.txt bro. You need to install sleepwatcher app, set up location for rc.wakeup, and copy plist file for work
log show -last 1000 | grep sleepwatcher
021-12-09 10:59:17.836041+0200 0x115c Default 0x0 561 0 sleepwatcher: (HIDAnalytics) HIDAnalytics Unregister Send event com.apple.hid.queueUsage
2021-12-09 10:59:17.836084+0200 0xa8c Default 0x0 404 0 sleepwatcher: (HIDAnalytics) HIDAnalytics Unregister Send event com.apple.hid.queueUsage
2021-12-09 10:59:20.407264+0200 0xa8c Activity 0x17a13 404 0 sleepwatcher: (TCC) TCCAccessRequest() IPC
2021-12-09 10:59:20.407276+0200 0x115c Activity 0x17a04 561 0 sleepwatcher: (TCC) TCCAccessRequest() IPC
 
Joined
Jan 15, 2018
Messages
61
Motherboard
ASUS Rampage VI Apex X299
CPU
i9-7900X
Graphics
Radeon VII
Mac
  1. MacBook Pro
Mobile Phone
  1. iOS
for user in `echo 'show State:/Users/ConsoleUser' | scutil | awk '/kCGSSessionUserNameKey/ { print $3 }'`; do home=`eval echo ~$user` if [ -x "$home/.wakeup" ]; then logger -t $0 "executing .wakeup of user $user" su - $user -c "\"$home/.wakeup\"" fi done sleep 5 pkill bluetoothd
Hello, I did exactly what the sleepwatcher readme told, and modified rc.wakeup as yours.
But still can't get it running properly.
log show -last 1000 | grep sleepwatcher showed some error.
Could you please look at it and give me some advices.
Thanks~
 

Attachments

  • Screen Shot 2021-12-17 at 12.20.45 AM.png
    Screen Shot 2021-12-17 at 12.20.45 AM.png
    910.9 KB · Views: 21
Joined
Jul 26, 2012
Messages
30
Motherboard
GB Z490M Gaming X
CPU
Intel Intel Core i7-10700
Graphics
Sapphire RX560 4Gb
Mac
  1. iMac
Classic Mac
  1. Power Mac
Mobile Phone
  1. Android
Hello, I did exactly what the sleepwatcher readme told, and modified rc.wakeup as yours.
But still can't get it running properly.
log show -last 1000 | grep sleepwatcher showed some error.
Could you please look at it and give me some advices.
Thanks~
With this instruction all work:
If not have directoris:
$ sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8
Copy:
$ sudo cp sleepwatcher /usr/local/sbin
$ sudo cp sleepwatcher.8 /usr/local/share/man/man8

Copy and load the launch script to make sure SleepWatcher starts on boot:
sudo cp config/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist
sudo launchctl load -w -F /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist
Swears at security, we allow it in System settings.

You can then add your scripts to /etc/rc.wakeup and /etc/rc.sleep:
sudo touch /etc/rc.wakeup
sudo touch /etc/rc.sleep
sudo chmod +x /etc/rc.sleep /etc/rc.wakeup
Edit rc.wakeup and add script:
#!/bin/sh
for user in `echo 'show State:/Users/ConsoleUser' | scutil | awk '/kCGSSessionUserNameKey/ { print $3 }'`; do
home=`eval echo ~$user`
if [ -x "$home/.wakeup" ]; then
logger -t $0 "executing .wakeup of user $user"
su - $user -c "\"$home/.wakeup\""
fi
done

sleep 5
pkill bluetoothd

At me work! :)
 
Joined
Jun 8, 2019
Messages
6
Motherboard
z170x
CPU
i5
Graphics
radeon 580x
Mac
  1. iMac
Hello, I did exactly what the sleepwatcher readme told, and modified rc.wakeup as yours.
But still can't get it running properly.
log show -last 1000 | grep sleepwatcher showed some error.
Could you please look at it and give me some advices.
Thanks~
I also have this exact same error, struggling to get sleepwatcher to work. I have disabled SIP and gone through my privacy settings to ensure that sleepwatcher has the right access but really struggling to understand why its not working!
 
Joined
Jan 15, 2018
Messages
61
Motherboard
ASUS Rampage VI Apex X299
CPU
i9-7900X
Graphics
Radeon VII
Mac
  1. MacBook Pro
Mobile Phone
  1. iOS
With this instruction all work:
If not have directoris:
$ sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8
Copy:
$ sudo cp sleepwatcher /usr/local/sbin
$ sudo cp sleepwatcher.8 /usr/local/share/man/man8

Copy and load the launch script to make sure SleepWatcher starts on boot:
sudo cp config/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist
sudo launchctl load -w -F /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist
Swears at security, we allow it in System settings.

You can then add your scripts to /etc/rc.wakeup and /etc/rc.sleep:
sudo touch /etc/rc.wakeup
sudo touch /etc/rc.sleep
sudo chmod +x /etc/rc.sleep /etc/rc.wakeup
Edit rc.wakeup and add script:
#!/bin/sh
for user in `echo 'show State:/Users/ConsoleUser' | scutil | awk '/kCGSSessionUserNameKey/ { print $3 }'`; do
home=`eval echo ~$user`
if [ -x "$home/.wakeup" ]; then
logger -t $0 "executing .wakeup of user $user"
su - $user -c "\"$home/.wakeup\""
fi
done

sleep 5
pkill bluetoothd

At me work! :)
Thanks. Will try this and report back
 
Joined
Jun 8, 2019
Messages
6
Motherboard
z170x
CPU
i5
Graphics
radeon 580x
Mac
  1. iMac
Thanks. Will try this and report back
just to confirm, i also followed the steps posted by creo2005 and still got the same error. From what i can see it looks like sleepwatcher is installed but there is an access/security error which is preventing sleepwatch from executing the script
 
Joined
Jan 15, 2018
Messages
61
Motherboard
ASUS Rampage VI Apex X299
CPU
i9-7900X
Graphics
Radeon VII
Mac
  1. MacBook Pro
Mobile Phone
  1. iOS
just to confirm, i also followed the steps posted by creo2005 and still got the same error. From what i can see it looks like sleepwatcher is installed but there is an access/security error which is preventing sleepwatch from executing the script
Same here.
I figure out an alternative by using Eventscripts to accomplish this.
It works well.
You can give it a try.
If you and others need further details, I will post here.
The only downside is that Eventscripts isn't free.
 
Joined
Jul 26, 2012
Messages
30
Motherboard
GB Z490M Gaming X
CPU
Intel Intel Core i7-10700
Graphics
Sapphire RX560 4Gb
Mac
  1. iMac
Classic Mac
  1. Power Mac
Mobile Phone
  1. Android
just to confirm, i also followed the steps posted by creo2005 and still got the same error. From what i can see it looks like sleepwatcher is installed but there is an access/security error which is preventing sleepwatch from executing the script
Delete all installed file, after repeat my steps exactly, it helped me, after the original instructions.
And check file permissions, my is:
rc.wakeup 0755
sleepwatcher 0755
sleepwatcher.8 0644
de.bernhard-baehr.sleepwatcher.plist 0644
 
Last edited:
Joined
Jun 8, 2019
Messages
6
Motherboard
z170x
CPU
i5
Graphics
radeon 580x
Mac
  1. iMac
Delete all installed file, after repeat my steps exactly, it helped me, after the original instructions.
And check file permissions, my is:
rc.wakeup 0755
sleepwatcher 0755
sleepwatcher.8 0644
de.bernhard-baehr.sleepwatcher.plist 0644
Thanks for this, I have checked my permissions and they were all correct however I deleted everything and started again following your instructions however still got the same problem :( Have taken a screenshot of my log file. Seems that I am getting an error after running:
sudo launchctl load -w -F /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist

(2021-12-19 11:06:29.459399+0000 0x373ba)
tccd: [com.apple.TCC:access] Failed to validate dynamic code signature of accessing process <TCCDProcess: identifier=<ID of InvalidCode>, pid=1017, auid=0, euid=0, binary_path=/usr/local/sbin/sleepwatcher>: #-67062: Error Domain=NSOSStatusErrorDomain Code=-67062 "(null)"


Then I tried putting my system to sleep and get this error when waking up:

kernel: (IOHIDFamily) IOHIDLibUserClient:0x1000009af sleepwatcher is not entitled for IOHIDLibUserClient keyboard access
(2021-12-19 11:10:06.986798+0000 0x160)
 

Attachments

  • Screenshot 2021-12-19 at 11.12.20.png
    Screenshot 2021-12-19 at 11.12.20.png
    500.2 KB · Views: 8
Top