I'm using loboris' fork with an m5stack. I'm trying to send bytes to and receive bytes from the device using PySerial.
On the m5stack side I've tried
Code: Select all
from machine import UART
import utime
uart = UART(1, tx=22, rx=21)
def main():
while True:
msg = uart.readline()
print(msg)
utime.sleep(1)
if __name__ == '__main__':
main()
Code: Select all
ser = serial.Serial('/dev/ttyUSB0')
ser.write(b"hello, world!")
The m5stack just prints empty strings. Any hints on how to read the bytes PySerial is sending?
I've seen people recommend pyb.USB_VCP but it seems that's not available on esp32 ...
Also I see that loboris defines machine.stdin_get(bytes, timeout) but that only returns "bytes"-many \x00 bytes whenever I try to send it a bytestring from PySerial.
Would appreciate any direction I can get. Thanks!