-
Notifications
You must be signed in to change notification settings - Fork 335
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
100% cpu usage of RFSniffer #16
Comments
You can have a look at https://github.com/sui77/rc-switch/wiki/List_KnownDevices to get some ideas of wait time. I think a sleep of 1-2 ms will work, the codes my FHT-7901 devices send are in the vicinity of 3,6-4,6 ms so by polling every second millisecond RFSniffer should be able to detect them. Making RFSniffer interrupt based probably requires modifying the underlying rc-switch library. |
Looks like there is one solution here: UrbaneChimp@3f2517e |
If you want a reliable way to receive/send radio without heavy cpu use, you should really look into pilight. It tried it with only the receiver/transmitter and it also works fine (but cpu usage is higher). Once pilight is installed, you can send/receive code from a network socket. If you install pilight on a Raspberry Pi without receiver, it will ,without any configuration, become a client to any Raspberry Pi with pilight installed. There is also a web interface to manage home automation with it, I didn't really try it. In a nutshell it is pretty awesome. |
Adding a usleep(10000) in the while loop drops CPU usage to 11% from 100% (on rpi3). it does adds up to 10ms delay, which imho is acceptable for majority of the cases. Also most 433 transmitters repeat signal, checking a repeated signal before printing makes it a lot better. |
the rfsniffer uses 100% cpu when running. Adding a usleep definitely helps, but I need to test if it degrades the receiving accuracry.
The text was updated successfully, but these errors were encountered: