1

I created a virtual serial port with based in this post

So I use a python script to write and read in my serial port

>>> import serial
>>> ser = serial.Serial('/dev/pts/3')  
>>> print(ser.name)         
>>> ser.write(b'hello')     
>>> ser.close()             

And this works. But when I tried to read my serial port in doesn't return anything

>>> with serial.Serial('/dev/pts/3') as ser:
...     x = ser.read()          
...     s = ser.read(10)        
...     line = ser.readline()
..      print(line)

I'm doing something wrong ? There is another way to emulate a serial port in linux ?

Juan Topo
  • 49
  • 4

0 Answers0