I have a question or two about using MQTT with ESP8266-12 or ESP32 with MIT App Inventor 2.
What I have in mind is a project in which a Android application would accept voice input, then send command(s) to ESP module and the module would perform the command and return a reply. I could do this with HTTP however, in order to lighten the load I am wondering if it is posable to setup the Android and ESP module to communicate bi-directional over MQTT without a third device acting as a broker?
Both Phone and ESP module would be worn on a person’s body so transmission distance would not be very far.
You always need a broker when using MQTT. In your case, because you don’t want another device, the only solution would be running an MQTT broker on your smartphone. I’ve never tried running an MQTT broker on my smartphone, so I don’t know if it works well or not.
There are some applications to run an MQTTT broker on your smartphone: https://play.google.com/store/apps/details?id=server.com.mqtt&hl=en you can try them and see how they perform.
Alternatively, you can use Bluetooth.