Disable UART1 boot messages

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
User avatar
rdagger
Posts: 87
Joined: Tue Feb 28, 2017 6:16 pm
Contact:

Disable UART1 boot messages

Post by rdagger » Sat Jun 17, 2017 9:46 pm

I'm using an ESP8266 with a serial sound module on UART1. I've got it working (transmit only). However, it only works if I connect the TX1 line after boot. Otherwise the boot data on the TX1 line crashes the sound module which requires a hard reset.

Is there any way to prevent the system from dumping data to TX1?

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: Disable UART1 boot messages

Post by pfalcon » Sun Jun 18, 2017 2:48 pm

Bootloader messages, no. Otherwise, docs: http://docs.micropython.org/en/latest/e ... rd-control
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

User avatar
rdagger
Posts: 87
Joined: Tue Feb 28, 2017 6:16 pm
Contact:

Re: Disable UART1 boot messages

Post by rdagger » Sun Jun 18, 2017 4:55 pm

That's too bad. The debug messages were off by default.
Is there a reason you can't disable the bootloader messages on UART1?
Are there any Micropython compatible boards that have an unused UART?

User avatar
Roberthh
Posts: 1702
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Disable UART1 boot messages

Post by Roberthh » Sun Jun 18, 2017 6:06 pm

If you do not need WiFi, try the Pyboard. If you need WiFi, you could try WiPy 1. Even if it is not manufactured any more, you may still be able to get one. You can also try one of the new ESP32 boards like WiPy2, Wemos LoLin32, Adafruit Feather ESp32, ... For ESP32 devices there the Micrpython.org port and the port by pycom.io.

User avatar
kfricke
Posts: 342
Joined: Mon May 05, 2014 9:13 am
Location: Germany

Re: Disable UART1 boot messages

Post by kfricke » Sun Jun 18, 2017 10:04 pm

Possible you could try to power on the sound module with a GPIO pin? That should need a Mosfet because of a higher load than the pin can provide, but that way you could power on the sound module a little more controlled manually after booting the board.

Or maybe you could reset the module after booting MicroPythpon and disabling the debug messages?

User avatar
rdagger
Posts: 87
Joined: Tue Feb 28, 2017 6:16 pm
Contact:

Re: Disable UART1 boot messages

Post by rdagger » Sun Jun 18, 2017 10:12 pm

Roberthh wrote:For ESP32 devices there the Micrpython.org port and the port by pycom.io.
I picked up a generic ESP32 and will take a shot. Is one port better than the other?

User avatar
Roberthh
Posts: 1702
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Disable UART1 boot messages

Post by Roberthh » Mon Jun 19, 2017 5:13 am

Is one port better than the other?
That's hard to say. While the pycom.io port seems more complete, the micropython.org port seems more stable and has the larger stack size. But the impression of robustness may also only results from a smaller user community. If it offers all features, I personally would start with the micropython.org port.

User avatar
pythoncoder
Posts: 3659
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Disable UART1 boot messages

Post by pythoncoder » Mon Jun 19, 2017 6:06 am

If these messages occur only on boot and not in operation I'd suggest a logic OR gate on the TX line. One input goes to TX, the other to a GPIO line with a pullup to 3.3V. The output goes to your device. This relies on the fact that a pin is configured as an input until your code changes it to an output. When your code runs, set it to be a low output. Avoid pin 15.

A solution using a transistor rather than a gate is here viewtopic.php?f=16&t=2078. Ignore the text in that posting which has confused some readers - the circuit does as I describe. I'd suggest 1KΩ for the lower resistor and 1-3.3KΩ for the one between GPIO and 3V3.
Peter Hinch

User avatar
rdagger
Posts: 87
Joined: Tue Feb 28, 2017 6:16 pm
Contact:

Re: Disable UART1 boot messages

Post by rdagger » Mon Jun 19, 2017 10:52 pm

@pythoncoder Thanks, that is a very clever solution but I already went ahead and switched to the ESP32. The one I picked up has a UART2 that has both RX and TX and does not appear to receive any boot or debug data.

It works great. The only thing I haven't figured out is after I initialize the UART2, the first 2 bytes written disappear. After the 2 lost bytes, it works as expected.
IMG_20170619_141106.jpg
IMG_20170619_141106.jpg (224.68 KiB) Viewed 2962 times

User avatar
kfricke
Posts: 342
Joined: Mon May 05, 2014 9:13 am
Location: Germany

Re: Disable UART1 boot messages

Post by kfricke » Tue Jun 20, 2017 6:48 am

If the two lost bytes are reproduceable when using other devices, you should file a bug report!

Post Reply