Skip to content
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

switch.py keeps radio in use after it's finished. #87

Open
lukew151 opened this issue Feb 22, 2017 · 3 comments
Open

switch.py keeps radio in use after it's finished. #87

lukew151 opened this issue Feb 22, 2017 · 3 comments
Labels

Comments

@lukew151
Copy link

I have both legacy green button switches & newer purple button miHome adapters. There is a difference in behaviour between the two programs legacy.py and switch.py which operate my two different types switches:
legacy.py “closes” the radio correctly when it exits.
switch.py doesn't “close” the radio. It was obvious using it that the LEDs remain on, even when you exit the program loop. I later discovered that should you exit the loop while the program is transmitting, it continues to transmit – jamming everything in my flat which uses 433MHz!

Solution (I'm no coder, I just tried something and it fixed my issue, but I'm unsure as to possible side effects!): I have added a line to /drv/radio.c at 522:
radio_standby();
so it tucks into the function radio_finished(void). This appears to take the radio out of transmit/receive mode gracefully.

@whaleygeek
Copy link
Owner

Sorry for the delay in replying and thanks for the fix, that was an oversight on my part! I'll roll this into the next set of changes, so I'll leave this issue open until I get round to doing that, thanks!

@whaleygeek whaleygeek added the bug label Aug 9, 2017
Minimad-Diver added a commit to Minimad-Diver/pyenergenie that referenced this issue Sep 14, 2018
@whaleygeek
Copy link
Owner

Waiting for @Minimad-Diver to confirm if this works with the gpio_finished after the radio_standby, as that seems the more obvious way round to do it. Please send me a PR once you confirm that and I'll merge to master, thanks!

@whaleygeek
Copy link
Owner

I have recently added energenie.cleanup() that rolls up the GPIO closures into a nice function.

However, this still needs to be retro-fitted to all demo scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants