I'm designing on an IoT device that connects to a web server and publishes/subscribes to the MQTT service. Users download an iOS app to setup/register/use their device.

Question: What's the recommended way of registering a user and connecting their IoT device to that account?

Here's my first architecture to achieve this user/IoT onboard flow:

Apps required for connect flow:

  • iOS app (User interface)
  • IoT app (node on a RPI3)
  • web server w/MQTT

On-boarding flow:

  1. User downloads iOS/Android App
  2. User creates account online (through web server)
  3. User turns on IoT device
  4. IoT device (RPI) launches app, tries to connect to any existing wifi network.
  5. After X attempts to connect to a wifi, RPI switches into AP mode (starts broadcasting a SSID)
  6. User connects phone to RPI’s broadcasted SSID
  7. User gets a list of nearby wifi SSIDs and selects a SSID and enters password for home SSID.
  8. User submits wifi ssid/password to the RPI (submit includes a token with user ID)
  9. RPI stops AP mode, connects to home wifi, registers itself online using user ID and RPI device ID.
  10. RPI continues node app (for MQTT pub/sub)
  11. User uses iOS app to communicate with web server, web server publishes changes (MQTT), IoT device receives the message.

I'm sure there are lots of ways to do this but I'm looking for the simplest secure implementation.

Is there anything inherently wrong with this approach and what are the best practices when creating new users and registering devices to users?

1 Answer 1


There is nothing wrong in this approach. It's not simple, but should work even if user will change home wifi settings.

You should have running webserver on the device to serve user with wifi connection page and the only problem is that in order to change the connection you should disconnect the user first, this is not very friendly. I recommend to install diode that shows current connection state onto device because you need some kind of feedback channel for the user.

May be you also will allow to use WPS as an option, in that case connection can be extremely easy. I think quite a lot of people have WPS-enabled home routers nowadays. And you may transmit to the server router MAX and/or SSID from both iOS app and the device and detect device belonging.

Other connectivity methods are based on Bluetooth, but they may require more actions and installations for user so I think your approach is a way to go.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.