Page 1 of 1

Serial while debugging

Posted: Mon Mar 05, 2018 1:42 pm
by cefn
Hi all,

I am trying to figure out the proper way to 'free' the UART pins from the primary UART on an ESP8266, (so it can be used to communicate with hardware), while being able to get at least debug output and preferably two-way REPL communication with the board.

I am considering two configurations to be able to use the primary TX and RX pins on a NodeMCUv2 for hardware communication...

* Don't use UART at all for shell input or debugging output - depend only on WebREPL.
* Switch the REPL debugging output to the secondary UART (which only has transmit) which would be wired with a separate USB-UART to see the output on a laptop

Is there any reference information how to achieve these configurations?
* I don't know if the WebREPL can be brought up without a hardware UART at all, or if it can be switched later
* I don't know if the primary TX/RX pins are just inherently hobbled for communication with external hardware (within the micropython build, or within the hardware wiring to the CP2102)

I note some commentary about dupterm() but struggle to understand whether it duplicates or redirects, when and how to switch UART configuration to prevent crosstalk with the UART connection with external hardware.

Is this something which can be attempted? If so, how?