I'm not sure why you are using Dynamic Subscription.
Try changing the Action to Subscribe to single topic and enter homeassistant/sensor/# as the topic in the MQTT-In node ?
Edit: Just checking - are you using HomeAssistant rather than Node-RED
The broker and Node-RED are on the same Pi aren't they? If so, the broker's address in Node-RED is localhost:1883 or 127.0.0.1:1883.
Using a 192.168.* address forces Node-RED to try to go out to your LAN, through the router to find the right place - back on the Pi. Not what you want.
I didn't understand, that it is important that a MQTT client has to subscribe to the topics of messages and that the '#' in mosquitto_sub -v -t '#' is a wildcard for all topics, why it worked in the SSH but not in Node-Red.
After setting the correct topic / using the wildcard in the mqtt in node, it works perfectly:
Would you still be willing to help me read data via the serial interface?
I reckon I’ll need to use the following device on the ESP32 for this.
But the first question is:
Which micro-USB port should I connect my USB-to-serial adapter to, and
which serial port should I select for this?
ESP32-S2 USB Port
ESP32-S2 full-speed USB OTG interface, compliant with the USB 1.1 specifications. The interface is used for power supply to the board, for flashing applications to the chip, and for communication with the chip using USB 1.1 protocols.
USB-to-UART Port
A Micro-USB port used for power supply to the board, for flashing applications to the chip, as well as the communication with the chip via the on-board USB-to-UART bridge.
USB-to-UART Bridge
Single USB-to-UART bridge chip provides transfer rates up to 3 Mbps.
I reckon you need to use the pins on the chip - NOT the USB sockets.
The pinouts for the ESP32 show 3 UART controllers.
GPIO43 and GPIO44 look like suitable candidates to try.