i am using a Wemos mini D1 conntected to a ext circuit using the alternative pins of uart0.
uart.setup(0, 9600, 8, uart.PARITY_NONE, uart.STOPBITS_1, 0)
uart.alt(1)
uart.write(0, "Hello external circuit")
To get all debug print() messages to my debug console and NOT to my external circuit i use
uart.setup(1, 9600, 8, uart.PARITY_NONE, uart.STOPBITS_1, 0)
node.output(function(p_debug) uart.write(1, p_debug) end, 0)
Works fine BUT:
When Lua crashes it sends a message like "PANIC: unprotected error in call to Lua API..." to uart0 and not to uart1. How can i change that? I need to get these errors at my debug port to fix the lua code in long term tests.
Any idea?
I tried to connect my ext circuit to uart1 TX and uart0 RX without using alternative pins, but then i do not receive anything, because the CH340C TX is stronger then my external TX port With this solution the PANIC messages at uart0 TX would be ok.
Edit: Same problem discussed here too: https://github.com/nodemcu/nodemcu-firmware/issues/2033