python - control a fermentor using pySerial -
i have fermentor (nbs bioflo 3000) connected pc (windows xp) via rs232 cable. have downloaded free software (http://www.foxylogic.com) monitor fermentor.
it works, know fact, hardware, cable, etc, good.
the free software not open source, , old. i'd use pyserial monitor fermentor. know port com1, 8 bit data, parity, baudrate=9600. paper saw (http://dx.doi.org/10.1371/journal.pone.0092108, supplement s1, page 2) says should using "afs communication protocol" , string requesting information looks like: (md#)ra(cr)
(md#) number of reactor (0 in case) , (cr) carriage return. based on that, did, in ipython terminal:
import serial ser = serial.serial(0) ser.parity = serial.parity_even ser.timeout = 1 print ser
i get: serial<id=0x1976cb0, open=true>(port='com1', baudrate=9600, bytesize=8, parity='e', stopbits=1, timeout=1, xonxoff=false, rtscts=false, dsrdtr=false)
ser.write('0ra\r') print ser.read(9999)
..., , nothing @ - empty string. tried change timeout (up 15 s, , know cannot take longer that), tried readline() , read(1), did not change of other parameters. tried alter string:
b'0ra\r' '0ra\r'.encode() '00ra\r' '0ra\r\n' '0ra\n' 'md0ra\r' '(0)ra\r' '0ra\r'
and many others, don't remember them all. nothing works, empty string. no errors.the serial device silent.
the time else empty string is, when ser.read(1)
in loop, no writing, , physically turn fermentor either off or on. 1 space.
i googled extensively, appears dealing quite unique problem, don't expect find simple answer here. can't test combinations of strings , settings, question rather is:
where start troubleshooting?
(my python 2.7)
thanks!
you start troubleshooting checking if being communicated. in windows, utilities capable of include portmon sysinternals suite , serialmon.
Comments
Post a Comment