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

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
User avatar
AmirJ
Posts: 18
Joined: Tue Sep 03, 2019 9:48 am

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

Post by AmirJ » Tue Sep 03, 2019 11:01 am

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.

User avatar
AmirJ
Posts: 18
Joined: Tue Sep 03, 2019 9:48 am

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

Post by AmirJ » Sun Sep 08, 2019 8:18 am

How to enable UART Flow control in ESP32 or ESP8266?

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

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

Post by Roberthh » Sun Sep 08, 2019 8:37 am

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

User avatar
AmirJ
Posts: 18
Joined: Tue Sep 03, 2019 9:48 am

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

Post by AmirJ » Sun Sep 08, 2019 9:24 am

Thank you.
this is very bad for me :(

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

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

Post by Roberthh » Mon Sep 09, 2019 10:03 am

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.

Post Reply