Line buffered serial input

前端 未结 4 1309
轮回少年
轮回少年 2020-12-11 17:46

I have a serial device that I\'m trying to read input from. I sent it a string \"ID\\r\", and it returns \"ID XX\\r\" (where \\r is an ASCII carriage return, hex 0x0d).

4条回答
  •  余生分开走
    2020-12-11 18:01

    This would be hard to debug without actually being there to see it. But see if you can use my tty module.

    http://code.google.com/p/pycopia/source/browse/trunk/aid/pycopia/tty.py

    Try the SerialPort object in there. I've successfully used this to interact with serial instruments, where "that other serial module" had lots of problems similar to what you describe. This one can also tell you if you have data in the FIFO.

    Let me now how it goes.

提交回复
热议问题