No broker and no credentials are compiled into the GX5s firmware. Each device gets its login over the air the first time it connects.
How it works
- Announce. A new device connects anonymously to a bootstrap broker and
announces itself on
discovery/<id>, with its firmware version. - Login. Your backend replies on
device/<id>with a broker login and configuration, such as its location and CAN setup. - Reconnect. The device applies the configuration and tries the new broker straight away. It stores the login only if that connection succeeds; otherwise it goes back to the broker it came from and reports the failure.
- Run. From then on it connects with its stored login and publishes under
device/<id>/<location>/.
The same message re-provisions a device that is already in service. If a device can't reach its stored broker several times in a row, it checks in with the bootstrap broker once, then tries its stored broker again. The stored login is never erased by this.
Security
- Authorisation is enforced by the broker: broker permissions decide who may send commands to a device.
- TLS runs in the modem and authenticates the broker.
Factory reset
Five resets in a row (reset button or power cycle), each within about five seconds of the previous boot, erase the stored login, the CAN setup and the offline queue. The power LED blinks five times and the device starts unprovisioned.
Source: firmware decisions (ADR 0001) in the gx5s repository.