separate thread for raspberry pi