pyserial-asyncio icon indicating copy to clipboard operation
pyserial-asyncio copied to clipboard

writer doesn't write anything

Open anormalrobot opened this issue 3 years ago • 3 comments

Hello,

When i was trying to send a data with following code nothing happens:

from asyncio import get_event_loop from serial_asyncio import open_serial_connection

async def run(): reader, writer = await open_serial_connection(url='/dev/ttyUSB1', baudrate=115200) writer.write(b'Hello World')

loop = get_event_loop() loop.run_until_complete(run())

But when i want to read and write everything works perfectly. Is there any way to write only async serial.

Have a great day :)

anormalrobot avatar Feb 05 '22 08:02 anormalrobot

How do you now that nothing happens?
The message is send to /dev/ttyUSB1 and should the device do something when it receives b'Hello World'?
Is there some physical response or lack of that?

nlhnt avatar Oct 13 '22 08:10 nlhnt

I had an arduino connected on /dev/ttyUSB1 and if it receives any data (if(Serial.available()>0)) it has to blink. So nothing blinks. I solved problem with write than read structure. But still nothing works with only write structure.

anormalrobot avatar Oct 14 '22 09:10 anormalrobot