Software serial?
Software serial?
Is anyone working on a software serial library?
The ESP8266 has two hardware UARTs.
UART 0 - TX and RX is used by the REPL.
UART 1 - TX is free for use, however, RX is used by the onboard spi-flash.
I have a GPS module and I am not sure how I can connect it. I need a free RX pin.
Can I disable console REPL and use WebREPL to free up the UART 0 RX pin?
The ESP8266 has two hardware UARTs.
UART 0 - TX and RX is used by the REPL.
UART 1 - TX is free for use, however, RX is used by the onboard spi-flash.
I have a GPS module and I am not sure how I can connect it. I need a free RX pin.
Can I disable console REPL and use WebREPL to free up the UART 0 RX pin?
Re: Software serial?
I would be happy to help you if you want to start working on this. The easiest way is to use some existing code that provides software serial, and just write the MicroPython module to access it. Do you have a candidate for that? A quick google yields https://github.com/plieningerweb/esp8266-software-uart
Re: Software serial?
I am using and testing a bluetooth module connected to the ESP8266-01 via UART. I use the Webrepl for testing, as my module is wired to RX/TX. It is a bit annoying when you have to restart, reconnect, etc, but overall is "usable".mcauser wrote: Can I disable console REPL and use WebREPL to free up the UART 0 RX pin?
Re: Software serial?
The REPL doesn't start if you put something in startup scripts (main.py) to do something else instead.
The problem is then dealing with the rubbish that comes out and I wrote about that at viewtopic.php?f=16&t=2078
The problem is then dealing with the rubbish that comes out and I wrote about that at viewtopic.php?f=16&t=2078
Re: Software serial?
I need a working UART port on the ESP.
I don't care about the garbage that comes out at the start or whenever, I will be filtering all the data using specific packet protocol with CRC.
My issue is disabling REPL on UART. WebREPL is providing the replacement functionality that I need.
What do you put in main.py to do something else to disable REPL??
I am an application end user still learning python, can someone please provide a step by step guide/workaround on how to implement some sort of usable UART functionality. If it requires a hardware mod and if and how to disable REPL?
UART port on ESP8266 is implemented for most of the other language ports, LUA, Arduino, javascript and even ESPBasic that also has a second software UART implementation. I still don't understand why no priority has been given to implementing formal UART functionality in ESPmicropython.
I don't care about the garbage that comes out at the start or whenever, I will be filtering all the data using specific packet protocol with CRC.
My issue is disabling REPL on UART. WebREPL is providing the replacement functionality that I need.
The REPL doesn't start if you put something in startup scripts (main.py) to do something else instead.
What do you put in main.py to do something else to disable REPL??
I am an application end user still learning python, can someone please provide a step by step guide/workaround on how to implement some sort of usable UART functionality. If it requires a hardware mod and if and how to disable REPL?
UART port on ESP8266 is implemented for most of the other language ports, LUA, Arduino, javascript and even ESPBasic that also has a second software UART implementation. I still don't understand why no priority has been given to implementing formal UART functionality in ESPmicropython.
Re: Software serial?
There is a second UART which is tx-only. It is on one of the gpio pins which varies from one module to another, but you can find it easily enough by attaching a scope of them in turn. (Curiously enough, on my modules it appears to have a blue led wired on the board too, I think it's gpio2)
You can use this uart through micropython, I assume you can't then use the same pin as gpio.
You can use this uart through micropython, I assume you can't then use the same pin as gpio.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Software serial?
One idea might be to use UART 0 for receive and UART 1 for transmit - that way the debug information goes out on U0 and the application data on U1.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Software serial?
The debug information from micropython can be easily disabled. The problem is the bootloader messages at startup, and they get spammed to both uarts.pythoncoder wrote:One idea might be to use UART 0 for receive and UART 1 for transmit - that way the debug information goes out on U0 and the application data on U1.
Re: Software serial?
Any luck with software serial? Bunch of sensors need uart, I hope we will figure out something
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Software serial?
Writing a software UART is a nontrivial task. There are many parameters to accommodate, and timing needs to be quite precise (+-5% or thereabouts) so receive and transmit would need to be interrupt driven. To add to the complexity it needs to be able concurrently to send and receive. The first step is probably to characterise the ESP to determine timing precision, bit-banging in response to an interrupt. This would give a pointer to the likely maximum baud rate.
An interesting project, but if anyone takes it on they won't have it done in a day...
An interesting project, but if anyone takes it on they won't have it done in a day...
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.