I'm still stumped. What I'm trying to do is call Telnet.setConsole(true) in order to prevent the console from jumping back to Serial1 as soon as I disconnect. I have a Nextion display on Serial1 so I have to prevent anything from being output there that is console-related.
I'm actually not sure that setting the console to Telnet works. I think it'll block once the buffer is full. If I do Serial2.setConsole(true) it's OK in that characters just go out that device and there's nothing listening, but the problem is that then it's unrecoverable via telnet. Maybe something I could do is when disconnecting telnet to only reset the console to the "old_console" if console==EV_TELNET. This way I can do Serial2.setConsole(false), have stuff go out there (which is the debug TTY anyway) but not prevent reconnecting via Telnet.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I'm still stumped. What I'm trying to do is call
Telnet.setConsole(true)
in order to prevent the console from jumping back to Serial1 as soon as I disconnect. I have a Nextion display on Serial1 so I have to prevent anything from being output there that is console-related.I'm actually not sure that setting the console to Telnet works. I think it'll block once the buffer is full. If I do
Serial2.setConsole(true)
it's OK in that characters just go out that device and there's nothing listening, but the problem is that then it's unrecoverable via telnet. Maybe something I could do is when disconnecting telnet to only reset the console to the "old_console" ifconsole==EV_TELNET
. This way I can doSerial2.setConsole(false)
, have stuff go out there (which is the debug TTY anyway) but not prevent reconnecting via Telnet.