Hello all,
I'm new to micropython and don't really understand a lot of things about micropython. I'm trying to write a string using UART(1,9600).write('abc') on serial port COM4 and read it at the PC's python using serial.read(). But when I try to read the data and print it, nothing happens, not even any error message pops up.
Here is the code from micropython and PC's python.
Not able to read the serial port using serial module of PC's python
Re: Not able to read the serial port using serial module of PC's python
How is UART1 on the Pyboard connected to your PC? Do you have an additional FTDI cable or something? Or is COM4 the USB/UART that the REPL runs on?
What type of board are you using? Looks like STM32, but is it a pyboard or a ST dev kit or something else?
What type of board are you using? Looks like STM32, but is it a pyboard or a ST dev kit or something else?
Re: Not able to read the serial port using serial module of PC's python
Thank you for your reply! No, I don't have any additional cable. COM4 is the USB/UART that the REPL runs on.
Yes the board that I'm using is pyboard v1.1.
Yes the board that I'm using is pyboard v1.1.
Re: Not able to read the serial port using serial module of PC's python
UART (1) is a regular UART, i.e. not connected to the USB in any way. It's on pins X9 and X9.
If you want to write to the "virtual" UART that's made available by USB, then you need to use pyb.USB_VCP -- https://docs.micropython.org/en/latest/ ... B_VCP.html
If you want to write to the "virtual" UART that's made available by USB, then you need to use pyb.USB_VCP -- https://docs.micropython.org/en/latest/ ... B_VCP.html
Re: Not able to read the serial port using serial module of PC's python
Thanks a lot Jimmo!
Virtual UART provided by USB is working fine.
