Page 1 of 1

How to Programing UART Flow Control xon/xof AND rts/cts

Posted: Tue Sep 03, 2019 11:01 am
by AmirJ
Hi
I want send and receive big file from RS232 with esp-WROOM-32.
I should Flow Control but it is Disable By default!
please help me for Enable and use Hardware and Software Flow Control in micropython with ESP32.

Re: How to Programing UART Flow Control xon/xof AND rts/cts

Posted: Sun Sep 08, 2019 8:18 am
by AmirJ
How to enable UART Flow control in ESP32 or ESP8266?

Re: How to Programing UART Flow Control xon/xof AND rts/cts

Posted: Sun Sep 08, 2019 8:37 am
by Roberthh
AFAIK, there is no UART flow control for ESP32 and ESP8266. You have to implement that in your protocol, by sending the data in chunks and then waiting for confirmation. You can set the receive buffer size with rxbuf, which should be larger than the data chunks. You can also use the existing implementation of transfer protocols like xmodem. A base implementation is here, which requires the platform specific implementation of two functions.
If you target device is a PC, you can use pyboard.py from https://github.com/micropython/micropyt ... ster/tools

Re: How to Programing UART Flow Control xon/xof AND rts/cts

Posted: Sun Sep 08, 2019 9:24 am
by AmirJ
Thank you.
this is very bad for me :(

Re: How to Programing UART Flow Control xon/xof AND rts/cts

Posted: Mon Sep 09, 2019 10:03 am
by Roberthh
You could try to use the Pycom firmware for you ESP32 device. The firmware for the WIPy works should do. I use it myself on generic ESP32 devices, Their UART driver supports hardware flow control with RTS and CTS. There are a few aspects to consider:
Pin numbering is different, they use Pxx or Gxx numbers, but in the pinout at https://docs.pycom.io/gitbook/assets/wipy3-pinout.pdf you can see the GPIO numbers, which are printed on generic modules. The firmware Images are here: https://software.pycom.io/downloads/WiPy.html
For uploading their firmware to your module you can use their command line uploader https://software.pycom.io/downloads/linux-1.16.0.html, with pycom-fwtool-cli. The option -r will make use of the "espressif" mode for starting the bootloader.