How to disable UART on the ESP8266

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
Hasenradball
Posts: 15
Joined: Tue May 21, 2019 12:52 pm
Location: Germany
Contact:

How to disable UART on the ESP8266

Post by Hasenradball » Fri Jul 05, 2019 6:46 am

Hi guys,

I am using an ESP 8266 with micropython and I want to use the pins of the UART for other purposes.
How is the correct way to switch of the UART?

Just reconfigure the Pins?
Or is there an need to Switch off the UART before?

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: How to disable UART on the ESP8266

Post by jimmo » Fri Jul 05, 2019 7:17 am

Hi,

Did you try Damien's suggestion from your question on https://github.com/micropython/micropython/pull/3784

Seems to work for me. My USB/UART adaptor has LEDs on TX/RX, so when I run this I see a flashing LED on the RX LED (TX from the ESP8266's perspective)

Code: Select all

import machine
print('hello')
p = machine.Pin(1, mode=machine.Pin.OUT)
import time
while True:
  p.value(0)
  time.sleep_ms(200)
  p.value(1)
  time.sleep_ms(200)

User avatar
Hasenradball
Posts: 15
Joined: Tue May 21, 2019 12:52 pm
Location: Germany
Contact:

Re: How to disable UART on the ESP8266

Post by Hasenradball » Fri Jul 05, 2019 2:41 pm

Hi Thanks for you repley,

do you mean this like:

Code: Select all

uos.dupterm(None, 1)
I thought it removes the REPL from the UART but not disable the UART itself.
Or do I have a misunderstanding?

Or do I only need to reconfigure the Pin for the purpose I need?
If it is so, then it is also possible to keep the RX Pin and only reconfigure the TX Pin, right?

Frank

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: How to disable UART on the ESP8266

Post by jimmo » Fri Jul 05, 2019 2:52 pm

You can use dupterm to disconnect the REPL from the UART. But that's not really necessary for what you're trying to do, unless you want to receive data from the UART for a different purpose?

Yes, you can just reconfigure one pin (that's what my example does), leaving the RX pin still connected to the UART.

Post Reply