1

I am using micro python in same board to start a serial communication

from machine import UART
uart = UART(1, 9600)                         
uart.init(9600, bits=8, parity=None, stop=1) 
uart.write('abc')

and reading serial data using usb to serial converter which i plugged on pin 21 and 22. But that is not printing anything i checked with the help of termite.

and also uart.write('abc') prints 3 in python REPL.

Please point out my mistake.is it possible to read serial data using serial converter or not?

PS:I have read many forums but not found anything useful. TIA

  • What dev board you are actually using? ESP32 is not an ESP-12E(which is an ESP-8266). Pin 21 and 22 doesn't mean anything unless we know which board you are using. You should connect it the Serial converter Tx to Rx and Rx to Tx of whatever board you are using. – hcheung Jul 11 '20 at 14:03
  • Yup using ESP-12E from https://www.amazon.in/gp/product/B06XYRS6KC/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1 It has simply written tx and rx pins which i am connecting to rx and tx of serial converter. – Abhishek bhatia Jul 11 '20 at 14:21

1 Answers1

0

Unfortunately, I've never used esp-12E yet but referring to its document here I can see that UART1 has only TX, unlike UART0 (which has both TX and RX). After some search, I found out that RX of UART1 is used to connect the flash chip, that's why UART1 is TX only, unlike UART0. So editing your code to UART(0,9600) Should fix the error, hopefully.

ahmed ashref
  • 145
  • 1
  • 8