Okay, so I was really challenged and determined by this thread to get the setup working. I installed Home Assistant and set up the Mosquitto MQTT add-on. Long story short, I was able to get multiple topics subscribed and working on 3 different devices. Two M5Stacks and one iPhone app called MQTTool. All three devices are publishing and receiving data to/from MQTTT.
Here are my uiFlows:
M5Stack #1 has an ENV unit providing Temperature, Pressure, and Humidity to MQTT, is reading the status of the LIGHT unit from M5Stack #2, and is reading the status of the iPhone app providing fake sensor/thermostat data. M5Stack #2 has a LIGHT unit providing the digital status of the light sensor (on/off) to MQTT, is reading the T/P/H values provided by M5Stack #1, and is reading the status of the iPhone app providing fake sensor/thermostat data.
Troubleshooting the black screen: REPL is your friend for errors. That is ultimately how I figured out what was not working. On a Mac, I opened Terminal and typed this to get to the REPL:
screen -port /dev/tty.SLAB_USBtoUART -b 115200
As I was building the setup, trying a slightly modified flow on each device, I forgot to connect the unit on the other M5stack. If you have a unit added in uiFlow UI (left side panel) and the unit blocks added to your flow, but the unit is not physically connected to the M5stack, this causes a black screen when attempting to connect to MQTT. No on screen error at all, but the REPL said something like "env0 not found" when I rebooted the M5stack and looked at the startup logs. It would just sit there and hang.
Another issue is that the Unit number might be changing on you when you add/remove it from your device or program (i.e. env0 changes to env1 or light0 changes to light1), especially when you don't refresh the entire uiFlow webpage before connecting each new device.
Anyway, I hope this helps someone. If you have other scenarios you want me to test, let me know.