Try separate thread for polling.
Avoid sync issues with thread.
Tune for slow raspberry pi.