register device and send a message