espressif / esp-rainmaker

ESP RainMaker Agent for firmware development
Apache License 2.0
455 stars 152 forks source link

Access to WiFi client (MEGH-2237) #74

Open JohnMacrae opened 3 years ago

JohnMacrae commented 3 years ago

It would be useful to have easy access to the wifi client so that other protocols might be used such as UDP or even another MQTT client.

shahpiyushv commented 3 years ago

@JohnMacrae , this query isn't really clear to me.

The entire Wi-Fi client code is contained in this file. However, since we need the Assisted claiming and user node association workflows during provisioning, it is hard to completely de-couple RainMaker from the ESP IDFs Wi-Fi provisioning. However, if a device is already claimed, the assisted claiming is not required. User node association also has it's own APIs which can be called from elsewhere, if the default WI-Fi provisioning is to be skipped.

Even MQTT client can be replaced by defining APIs similar to this mqtt glue layer.

Is this what you were looking for?

JohnMacrae commented 3 years ago

Sorry Piyush,

I envisage using the wifi connection (once the device has completed provisioning) to provide, for example an additional MQTT client so that a device can continue to log and report data locally while still maintaining a Rainmaker node for remote monitoring and control. So rather than replacing the existing RM MQTT and wifi client connection, I would look fo a safe way of adding an additional MQTT client.