Local Control (Preview)
ESP RainMaker was primary built to offer remote connectivity to ESP Devices. However, if the phone and the device are connected to the same Wi-Fi network, controlling the device directly on the local network is much faster and reliable.
ESP IDF already provides a component called ESP Local Control which uses mDNS based discovery and HTTP based control. This has now been integrated into ESP RainMaker. Since the cloud is no more in picture here, it can work even when there is no Internet.
This feature is disabled by default, especially because of the security considerations discussed below.
To enable, please set CONFIG_ESP_RMAKER_LOCAL_CTRL_ENABLE=y
(or idf.py menuconfig -> ESP RainMaker Config -> ESP RainMaker Local Control).
Please ensure that you have the latest phone apps and you are good to go. Whenever a device is available to control on the local network, it will show as Reachable on WLAN in the phone apps.
Note that you still need Internet connectivity while adding a new device. A device will be shown as available on local network only if the user-node association process was successful.
Security Considerations
Currently, the local control feature relies only on the Wi-Fi level security. Any client on the same Wi-Fi network can discover and control the devices over HTTP (even though the phone apps will only show the devices actually linked to the user).
Why not HTTPS?
Using HTTPS in itself isn't sufficient without mutual authentication. This requires unique certificates to be provisioned on the devices and the users (phone-apps).
- For the users, the same certificate should be propagated across all the phones/clients corresponding to the same user
- Some phone operating systems (iOS) do not allow self-signed server certificates. This makes provisioning device certificates more complex.
We are working on supporting local control using application layer security. This will be released once we are satisfied with the level of security that we build into the transport. We will update here once we are ready with this.