espressif / esp-rainmaker

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

Adding an option to bypass WiFi (MEGH-1983) #58

Open Maldus512 opened 3 years ago

Maldus512 commented 3 years ago

I am developing a solution that can use either WiFi or Ethernet connectivity. Unfortunately the rainmaker main task is dependent on WiFi connection and waits for one before doing anything (https://github.com/espressif/esp-rainmaker/blob/37b6a24dfa22303dcf591c121d95ae80af0bb1ef/components/esp_rainmaker/src/core/esp_rmaker_core.c#L243). For now I'll probably add some workaround in a fork, but I think that having the device connected via Ethernet is not so farfetched. There should be an API that allows to skip the WiFi check.

shahpiyushv commented 3 years ago

Adding link to the forum post for some context. Also copying the relevant comment here:

At the specification level, user node mapping is independent of Wi-Fi provisioning. The esp_rmaker_start_user_node_mapping() API can be used on the device side to trigger the device side workflow. Even on the phone app side, you just need to invoke the add user-node mapping REST API. All the required support is already available in the apps, but since this isn't the usual workflow, as of now, you will have to make your own customisations in our Android/iOS source code. We can help out with information regarding actual APIs to be called and their ordering if you want to take that path.

Of course, an additional change w.r.t the event handling will also be required for Ethernet connections.

bbinet commented 2 years ago

+1 for adding an option to bypass WiFi: this would also be useful when using 4G modem instead of ethernet connectivity (see: #107)

Maldus512 commented 7 months ago

I need to come back to this because it's still an issue. Now I have a custom application that initiates the node mapping, but the procedure does not work (the mapping request times out on the server) unless the node has been claimed (I'm using self claiming), and that part is locked behind a WiFi connection. However, my device has also an ethernet interface.

Would you be willing to accept a PR? I could add an API to bypass WiFi or listen for ethernet events as well.

shahpiyushv commented 7 months ago

@Maldus512 , yes, of course, a PR to wait on Ethernet events would be fine, but the end to end workflow could still be tricky because user-node mapping workflow itself happens during the Wi-Fi provisioning.