Added code so raspi will register with server efore doing anything