-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a function to send ping packets #461
Conversation
@marcan Thanks for your dedication to this. Is this code working? import broadlink as blk
import time
while True:
blk.keep_alive("192.168.0.17", 80) # Example device
time.sleep(120) |
a0bd583
to
f047ec7
Compare
Any way for me to test this? Just pull the branch and install? |
This test requires a specific environment:
This test is dangerous. We don't know if blocking the device is healthy in the long run. I already have the technology to test, so you don't need to take the risk if you don't want to. |
Okay. I was thinking about testing with the SP4, but I don't control the router I have and your SP4 support PR hasn't been merged yet. Thanks for letting me know. |
I tested. It's working! 🎉 I'm gonna make some fine adjustments and then I release for review... |
Sad that this didn't make it into 0.117, but hopefully this makes it into 0.118! |
b0af1ef
to
0f46280
Compare
Sorry for the late test. I tested this in lieu of my previous crontab hack: import broadlink as blk
import time
while True:
blk.keep_alive("192.168.7.255", 80)
time.sleep(120) (I had to change the parameters from a tuple to separate host/port) It works fine, I can see the packets going out and no reassociations from my devices. |
0f46280
to
ab11cd8
Compare
ab11cd8
to
42a7b2c
Compare
42a7b2c
to
0291492
Compare
2211270
to
4e89464
Compare
4e89464
to
a442e74
Compare
Closing to merge with the dev branch. We no longer merge directly into master in order to keep things clean. |
Some Broadlink firmwares have a watchdog timer to ensure that the device remains connected to the cloud. The devices reboot when they don't receive heartbeat messages from the cloud for more than 3 minutes.
Lots of users want to block access to the internet for privacy reasons and this is causing their devices to reboot periodically. This PR comes to add a function to send heartbeat messages and keep the devices awake even without access to the cloud.
Credits to @marcan, who found the watchdog packet.
Fixes: #458