Control Arduino Uno over mobile Internet (MiFi) using ESP8226 Serial Comms

Hi everyone,

I have been searching for a long time and not found a workable solution to my requirement yet so hoping someone can help.

I have an existing project running on an Arduino Uno and connecting to an ESP8226 via serial. I use this serial link for monitoring, control, config and debugging (sending and receiving strings). The Esp is running Esp-link firmware meaning I have access over wifi to serial console etc.

All was well when I was building/testing this at my home on the same WiFi. But I am now about to deploy this at a very remote site where the WiFi will be replaced by a MiFi device (like a mobile 4G wifi dongle - MiFi - Wikipedia) meaning I now need a way to connect to this remotely over the public internet. This remote access will not be required eventually but will for a few months for final testing in-situ. Security is also not a major concern at this point as this is temporary and low risk.

All the potential solutions I have read about involve making the Esp8226 directly internet facing using static IP address of WiFi and port forwarding. But with the MiFi none of this will be possible as its just locked down.

I was thinking the easiest solution would be to flash something on the Esp that just forwarded its inbound serial comms (from the Uno) to an MQTT server as MQTT messages and subscribed to another MQTT channel to receive serial comms remotely and forward this as real outbound serial comms to the Uno. But it seems nothing like this exists that I can find already or only in 1 direction.

Any pointers here would be much appreciated. I cant be the first...


Not sure if this is what you are looking for, but I have recently installed a few esp projects in a remote building (in the U.K.) which is only required for a few months and I used a cheap (from eBay) Huawei E5332 Mobile Wi-Fi with a standard Three pay as you go sim, buying monthly data packages. I then use to give a virtual fixed ip address (ddns).
Note: Most other networks do not assign a unique IP address to the device so it is impossible to connect to it from the internet. The free option on is fine, you just have to respond to an email once a month.
There is a library for updating but I could not get this to work (I believe this has now been fixed) so I wrote the code myself to do this.
see: GitHub - ayushsharma82/EasyDDNS: Easy to Use ESP8266 & ESP32 DDNS Update Client Library.

Thanks for the suggestion I will certainly look into that. Did it just work out of the box with that midi device or did you need to setup port forwarding etc as well?

I am just so surprised no one has wanted to send serial Comms over mqtt before? Has anyone seen this done?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.