adding threads to connect, start acclerometer and pass data to the server