Hello everyone. I'd like to ask a question to the experts here, in case anyone has a good idea that I could use ! If you got the time to take a look at my situation I'd greatly appreciate it !!!
Me and a buddy of mine, have launched a product, that uses:
- An ESP32 Device as the main unit
- An Android Tablet as the controller device with our own app.
- An Android app for phones, as a secondary controller (remote).
Our set of devices communicate with each other using 3 protocols.
- Websockets for real-time commands/updates when the devices are on the same network
- HTTP Requests/API as a fallback solution (a Webserver is also available on the ESP32 device)
- MQTT (using our own Cloud Server) for Remote Access/Control
So, in short our products MUST be on a local network as a minimum, but preferably on a network that also has internet access although this, is not mandatory.
Internet access is good to have since it provides:
- MQTT (Remote) controlling of the device.
- Datalogging and Error Logging from us to find out issues with our devices, maybe even before they happen
- And most importantly, firmware updates to our boards.
[ some history ]
We first, designed the Controller board and App, to send UDP packets, on the broadcast address of the network, and then, upon receiving the reply, save that address, and use it for websockets.
But we faced 1 trillion problems, as we have no knowledge of how our client's networks are built and what devices they are using. Some of them have routers that don't allow UDP Broadcasts, some have Client Isolation turned on, so local peer-to-peer traffic is blocked, etc etc.
So, Mikrotik to the rescue, we now ship all our devices, bundled with a Mikrotik hAP Lite that is already pre-setup by us, and has a static IP set for the ESP32 board.
This way, the app always uses the same, pre-set, IP address to communicate with it.
We also have WAN setup on ETH1, so if the client connects an Ethernet cable from their current router there, both our devices get internet connectivity.
This works flawlessly but has some limitations.
[ the problem ]
SOME of our clients, sadly only have a Wireless connection available on-site.
And from what I've found online, the hAP Lite can't act as both a STATION and ACCESS POINT at the same time, and get WAN from the WiFi. It's one or the other. I've read that we need a device with Dual Radios for that.
That being said, even with a Dual Radio device, I'm not sure if the client will be using a 2.4G or 5G or a mix, and thus, I don't have a way to PRESET the device from factory.
The ULTIMATE solution would be to have some way, for our bundled router, to first and foremost act as the bridge between the two devices (the ESP32 and the APP) but also as the bridge between them and the client's network, whether that is wired, or wireless. BUT, we also need to keep the cost down. We can't ship with a 200$ device just for networking. ![]()
Also, in our original solution (with using the client's router) our ESP32 device created its own hotspot that acted as a captive portal for first device config. It was easy and understandable.
A similar way would be really welcome. We can't expect our clients to install Winbox and setup a MT device. ![]()
[ extra thoughts ]
I've thought about solutions using Raspberry Pi Zeros as gateways. I've also setup the ESP32 with dual STA, but that way it's the ONLY device to get internet. The tablet still stays offline.
I've thought about adding a local MQTT on a RPi and bridge that to the cloud MQTT.
I don't know which is best. Currently, the (only-wired) solution with Mikrotik works great, as it is super-fast, super-reliable, super-predictable, super-customizable, and as a bonus, I've also setup a Wireguard network that the Mikrotik connects to as a client, so I also have "local access" remotely for troubleshooting.
Anyway, ANY IDEAS are really welcome.
