A few thoughts on improvements:
- Retry connection when booted without network
- have a "last will" message set up so that when the node disconnects, it announces itself as disconnected (Octoprint does this)
- Make sure it handles reconnections properly when things go down