ArduinoOTA over Firewall, ESP32: Invitation is failing

While the original problem has been solved I’d like to add a new idea for a slightly different solution.
Opening up ports and forwarding them is always kind of messy. If your device would initiate an outgoing connection, that would be the way to go. But how? Simply: not with ArduinoOTA but there are other ways.

I always liked the idea of MQTT and yes, while MQTT adds another infrastructure component, this can add way more manageability to your devices.
Using premade open solutions like Homie you get a nice standardized and well documented (https://homieiot.github.io/) way of communication to and from your device and it adds another nice feature: OTA over MQTT. So you don’t need access to each device but simply to an MQTT server they all use in common. That one does not even need to be within the remote site but it could.
Homie adds autmatically sending telemetry data of the device and its connection, you may add additional data if you want to. Also there are libs to log stack traces on exceptions and reboot reasons. So if your device is remote, you can gather a lot of information remotely and can even send OTA Updates. This works with any size of installation as it relys only on MQTT which was built for large scale infrastructures - but also works like a charm in small environments.

Just my 2c

Here are those two libs (both available on github):

homie-esp8266 (old name - it supports ESP8266 and ESP32!)
EspSaveCrash

If you want to use Homie add these lines to platformio.ini lib_deps:
ArduinoJson @ 6.16.1
Homie
(There seems to be a small incompatibility with newest Homie lib and the newest ArduinoJson lib!)

Hi @miq19 … do you think your solution could work also for a different ethernet shield ENC28J60 …
I have already a modified version of the lib EthernetENC which works…
What do you thinK?

Thanks

I would think so, as long as the shield’s library will provide the standard calls.

This was originally for W5500 for but you have a Ethernet.h library working for the ENC28J60, it should work the same.

1 Like

Thanks a lot @miq19 can you please sharte the link to the repo ?
Again Thanks

@maxgerhardt as usual thanks for your huge support

No repo necesary for just 4 lines to be changes. There was a PR I created for it, but it was rejected by me-no-dev.

The changes are listed here