How can I read and write a radio connected to the computer with a serial port with python, the same way a hyperterminal does ?
I wrote this:
from Tkinter import *
import serial
se = serial.Serial()
se.baudrate = 9600
se.bytesize = 8
se.parities = 0
se.stopbits = 1
se.xonxoff = 0
se.rtscts = 0
se.timeout = 1
se.port = 0
print se.portstr
print se
se.close()
It seems to work, but when I try to communicate using
se.write('at')
se.readl([20])
I don't receive the expected answer, and it just reads what I wrote.
Someone can help me?
I wrote this:
from Tkinter import *
import serial
se = serial.Serial()
se.baudrate = 9600
se.bytesize = 8
se.parities = 0
se.stopbits = 1
se.xonxoff = 0
se.rtscts = 0
se.timeout = 1
se.port = 0
print se.portstr
print se
se.close()
It seems to work, but when I try to communicate using
se.write('at')
se.readl([20])
I don't receive the expected answer, and it just reads what I wrote.
Someone can help me?
Comment