Looking at the code, it seems to me that outputting to Serial1 and Serial2 ought to work. Does it not (sorry, no esp8266 handy)?
In order to make input on Serial1 work, I believe all that's needed is to change https://github.com/espruino/Espruino/blob/master/targets/esp8266/user_main.c#L195 to use EV_SERIAL1 (or whatever the right constant is to put the characters into the Serial1 input queue instead of the console).
There's also an issue when you disconnect from a telnet console in that it resets the espruino console back to the default and that's Serial1. Not sure how to fix that. Maybe it needs to remember what it was before changing to EV_TELNET? See https://github.com/espruino/Espruino/blob/master/libs/network/telnet/jswrap_telnet.c#L212
In order to set baud rates and such, someone has to implement jshUSARTSetup here: https://github.com/espruino/Espruino/blob/master/targets/esp8266/jshardware.c#L654 The functions to do the work are all in uart.c, so it's mostly a "wiring-up" job.
© Espruino, powered by microcosm.
Report a problem