wokwi-features
wokwi-features copied to clipboard
Allow using multiple serial monitor terminals
https://github.com/wokwi/wokwi-features/issues/732 seems related, but this request about just about multiple serial monitor terminals in the UI, without needing to create a local serial port and connect to it through websockets or another interface.
Is your feature request related to a problem? Please describe. I sometimes need to use multiple serial devices with an MCU. I may have one using one hardware serial, another using another software serial, as well as debug messages being printed to the primary serial device.
For debugging, it can be useful to see a log of what's being sent on each of these serial ports. If all of these serial ports operate at the same baud rate, then this could work by just connecting all of them to serialMonitor in diagram.json. It is difficult to read, but at least it works, and doing this does not lead to any cross-talk/interference between serials (so it behaves differently then actually connecting the serial wires to the same monitor "pins", which is a good thing).
But if the serial ports operate at different baud rates, this no longer works.
Describe the solution you'd like
Instead of having only one serialMonitor terminal, have multiple. In diagram.json:
[ "esp01:TX", "$serialMonitor1:RX", "", [] ],
[ "esp01:RX", "$serialMonitor1:TX", "", [] ],
[ "uno:1", "$serialMonitor2:RX", "", [] ],
[ "uno:0", "$serialMonitor2:TX", "", [] ],
Using serialMonitor without a number could be an alias for serialMonitor1, to not break compatibility.
I would expect that when running a simulation like this, instead of a single serial monitor terminal, I would see tabs, where each tab showed each serial monitor.