Second Serial Port

Posted on
  • I have an Adafruit Huzzah Feather board that I've loaded the 1v89 firmware onto, and wanted to use their GPS FeatherWing.

    It looks like the Espruino console is interfering with the Serial1 interface (as expected), but I was wondering if there is a way to run the serial console plus the equivalent of "software serial" on another set of pins. The fact that there is no USB interface on this board complicates matters, because on a normal Espruino board I could route the console to USB while running the Serial interface for the GPS. However as far as the ESP8266 is concerned, it just has the Serial1 interface which is brought out to the USB-Serial converter.

    If I could set up serial on another pair of pins, I'd be set. Is there any other way to accomplish this?

    The only workaround I've found so far is to force the console over Telnet with Telnet.setConsole(true) and to continue using the GPS on the Serial1 pins. Then at least I could see the console, assuming the board is connected to WiFi.

  • Any time oriented activity - such as software serial - is not going well with the single processor ESP8266... except you modify the Espruino kernel to take JavaScript 'interpretation' loop/processing into account. Therefore - even it is possible to run soft-USART on any two pins - the timing may mess with you, especially with GPS-es, which just burst the data... But you can give it a try!

  • There was a branch for Software Serial support, but it's not really reliable enough to use at the moment. You can use digitalPulse to send serial, but receiving is a different matter - I think you'd struggle.

    So it's either normal ESP8266, cut the tracks on yours, or go for something like Espruino Wifi that has USB + multiople Serial ports

  • Yes - On ESP you can connect over telnet, so console get switched and Serial1 can be used for communication with serial devices.

    Take a look at the Nextion display example

  • Thanks for the responses. I'll continue using Telnet as the workaround. It's tricky because I'm working on something that'll connect to any available AP, so it's not always easy to get a Telnet connection to the board when it's gallivanting on various hotspots.

    I guess I should add a fallback mode where it will fire up the ESP AP mode at some point to allow me back in. I've been stuck with reflashing the device several times when I couldn't get back to the console to send new code.

  • You could set up to watch the flash button on the board, and when this is pressed, reinstate the console back to serial...., or a long press or double press to turn on the access point.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Second Serial Port

Posted by Avatar for RichDunajewski @RichDunajewski