1. I cannot send control characters
2. I cannot read data streaming from the serial port
I have been doing fine with:
os.system("echo '5' >/dev/tty00")
os.system("echo '8' >/dev/tty00")
and the like to the remote machine, but I need to be able to send control characters the same way to scroll through menus. I have tried pyserial and pexpect with mixed (mostly horrible) results (not the fault of the module builders!), thus far the simple act of echoing the strings to the serial port is the only reliable method I have found.
Reading from the serial port has also been problematic. I find that simply opening the port /dev/tty00 file and using readlines(), read() or whatever gives me empty strings or lists. Pbth.
So first: how should I go about adding the hex escape sequences (\x0a and \x50) to the above strings in their raw form?
second: what method should I use to read a raw stream from the serial port for a given period?
I have looked carefully at the neat and tidy miniterm.py example in the pyserial examples directory, and see how one can continuously read via a thread from the port, but have not been able to replicate it thus far.
Any help whatsoever would be great! I'm beginning to feel a little lightheaded. Thanks!
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor