latest code to receive data from pi