Shop OBEX P1 Docs P2 Docs Learn Events
Reading from cygwin — Parallax Forums

Reading from cygwin

papoanayapapoanaya Posts: 2
edited 2006-02-21 20:52 in General Discussion
I have the following code on the BOE

DO
  DEBUG "FOO", CR
LOOP



The following python code works on linux to read data from BOE.
#it writes "FOO\r"
fp=open("/dev/ttyS0")
print fp.readline()



However I run the same code using python on cygwin, which is supposed to posify the serial ports and it hangs.


Does anybody has any idea on what's going on or at least give me some idea of what to look?

Papo

Comments

  • chzchz Posts: 8
    edited 2006-02-21 20:52
    i'm lookin for assistance as well in the python to stamp realm, BUT i've tried your same methods and have noticed that if you just do a fp.read() it will read the current character being printed. so if you do fp.read(5) you'll see the debug bein pushed out.

    heres what i did on the python side
    import serial
    
    ser = serial.Serial('/dev/tty.usbserial-1B1')
    print ser.read()
    print ser.read(5)
    
    
Sign In or Register to comment.