Danitegue / PCBRW_OLD

A repository with all the needed things to run and control BREWER instruments software, under a Pyhton enviroment.
0 stars 0 forks source link

Question: purpose of brewlib/serial package #1

Closed robhagemans closed 6 years ago

robhagemans commented 6 years ago

Hey @Danitegue,

I was looking through the two brewer libraries and wondered about the modified serial library. This seems to be a fork of the https://pythonhosted.org/pyserial/ package adapted to the Brewer spectrophotometer.

I was wondering what makes this modified library necessary - does it replace some DOS/Windows XP drivers supplied with the Brewer or is it needed to work around incompatibilities in PC-BASIC?

If it's the latter, we could try to find out what causes the incompatibility and merge the fixes back into PC-BASIC (preferably without having to maintain a fork of pyserial...) Caveat is that I don't have much (any) experience with RS-232 though, and haven't got any serial ports beyond a cheap USB one from ebay that I've never tried.

Cheers, Rob

Danitegue commented 6 years ago

Hi Rob, the history of the serial stuff is the following:

-A previous programmer (Nestor Morales) was trying to make an older version of your pcbasic work with the brewer. ( https://github.com/nestormh/pcbasic/commits/master). This branch is not mantained anymore, I have a copy of it in my repo for now, just to comare some things ( https://github.com/Danitegue/PCBasic_Brewer_Repo/tree/master/pcbasic_nestor) -With your specific version of the pyserial library, (v2.7), and the old version of pcbasic he could not communicate with the instrument. -He did some modifications in the old pcbasic, and in that pyserial library, and he could make it work, but, the software was not able to communicate properly with the instrument after 10 or 15 minutes, when a bad data problem always raise, I suppose because the software was receiving wrong data, or memory issues perhaps. -Also they had the issue of the timer, the program time was loosing some seconds per hour, respect the pc. (I discovered afterwards that some changes done for asking for new characters in the serial buffer massively were slowering the emulator performance).

-Then he had to left this project, and I started with it. -That previous version of pcbasic was horrible for me, in a way that it was very difficult to make debugging. The unique interface that worked was the ansi, so the develop was hard and very slow. -As he recommended me, I started with a newer version of pcbasic (the actual we are working now, which is much better, and I can use pycharm for debugging while viewing through pygame or sdl2). Since I thought that some big changes would be needed, I named it "pcbasic_brewer" -Your actual version of pcbasic is prepaired to work with an specific version of the pyserial (v2.7)(as you indicate in https://github.com/robhagemans/pcbasic/blob/master/INSTALL.md). Since the latest version of pyserial is a little bit newer, (v3.4), I decided to adapt the same modifications that Nestor did to the pyserial v2.7 to this newer v3.4 version. -Then, for not mixing an original pyserial package with a modified one specific for the instrument, I decided to make a folder with the entire pyserial_brewer modified library, to manain these changes appart of the original serial library, and adapt the pcbasic_brewer for being able to switch between the standard pyserial, and the customized one (by just adding this to the launchers: "--use-serial-brewer=True" "--use-serial-brewer-verbose=True")

Actual status: -I can communicate with the instrument now, using my pyserial-brewer customized library, but I have noticed something wrong: The answers that the instrument sends to the program, are not detected by the interpreter until at least 2 seconds later or more in other ocassions. This generate a communication issue after some minutes, the program keeps hanged because is waiting for an answer.

I can replicate exaclty the same with the BrewerSimulator.py program and com0com software, which emulate a pair of bridged com ports in my laptop (com15-com14). (I have not any phisical com port neither). I run the BrewerSimulator.py on python, using the com15, and the brewer program on pcbasic_brewer, using the com15. This program emulate the first signals that the instrument send when the software is connected, and the answers to the pdhp command.

I'm researching now what can be the cause of that issue.

What I would do in your latest version of pcbasic, for now: -We can start updating the ports.py for being able to use the latest pyserial module (v3.4), instead of having to use the old one (v2.4). -I also have modified the loggers in the pcbasic_brewer for writting the dates in them, which is extremely useful to determine when a Com message has been received, and compare it with when it was Sent by the BrewerSimulator.

In config.py

def _prepare_logging(self): """Set up the global logger.""" logfile = self.get('logfile') if self.get('version') or self.get('help'): formatstr = '%(message)s' loglevel = logging.INFO else:

logging setup before we import modules and may need to log errors

    #formatstr = '%(levelname)s: %(message)s'
    formatstr ='%(asctime)s.%(msecs)04d %(levelname)s: %(message)s'
    if self.get('debug'):
        loglevel = logging.DEBUG
    else:
        loglevel = logging.INFO
#logging.basicConfig(format=formatstr, level=loglevel, filename=logfile)
logging.basicConfig(format=formatstr,

level=loglevel,filename=logfile, datefmt='%H:%M:%S')

I attach you a log of a test I did yesterday with the instrument connected, using this modified pyserial version, and in which we can see how are being the serial answers stored in the memory, until I decided to stop it because it was waiting too much for an instrument answer.

I will keep you updated

2018-01-13 9:46 GMT+00:00 Rob Hagemans notifications@github.com:

Hey @Danitegue https://github.com/danitegue,

I was looking through the two brewer libraries and wondered about the modifield serial library. This seems to be a fork of the https://pythonhosted.org/pyserial/ package adapted to the Brewer spectrophotometer.

I was wondering what makes this modified library necessary - does it replace some DOS/Windows XP drivers supplied with the Brewer or is it needed to work around incompatibilities in PC-BASIC?

If it's the latter, we could try to find out what causes the incompatibility and merge the fixes back into PC-BASIC (preferably without having to maintain a fork of pyserial...) Caveat is that I don't have much (any) experience with RS-232 though, and haven't got any serial ports beyond a cheap USB one from ebay that I've never tried.

Cheers, Rob

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Danitegue/PCBasic_Brewer_Repo/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AYutGEK8QYSJUvsodtg0pxACKIl5FuZcks5tKHthgaJpZM4RdKub .

--

Daniel Santana Díaz, Danitegue@gmail.com

Danitegue commented 6 years ago

You can of course make a diff of my current version of ports.py, to notice some changes that Nestor also did in the old version, and I think are needed to handle properly the com ports files inside the new pcbasic, independently of the pyserial version used.

The most imporant, is that I had to add this line:

in ports.py, class COMDevice, def open():

f = COMFile(self.stream, self.field, self.input_methods, lf, self.serial_in_size)

inherit width settings from device file

f.width = self.device_file.width f.col = self.device_file.col

*self*.device_file = f #As nestor discovered, if self.device_file is not updated, there will be a COMFile identifier for events, and another different one for accessing the port.

return f

2018-01-13 15:09 GMT+00:00 Daniel Santana danitegue@gmail.com:

Hi Rob, the history of the serial stuff is the following:

-A previous programmer (Nestor Morales) was trying to make an older version of your pcbasic work with the brewer. ( https://github.com/nestormh/pcbasic/commits/master). This branch is not mantained anymore, I have a copy of it in my repo for now, just to comare some things ( https://github.com/Danitegue/PCBasic_Brewer_Repo/ tree/master/pcbasic_nestor) -With your specific version of the pyserial library, (v2.7), and the old version of pcbasic he could not communicate with the instrument. -He did some modifications in the old pcbasic, and in that pyserial library, and he could make it work, but, the software was not able to communicate properly with the instrument after 10 or 15 minutes, when a bad data problem always raise, I suppose because the software was receiving wrong data, or memory issues perhaps. -Also they had the issue of the timer, the program time was loosing some seconds per hour, respect the pc. (I discovered afterwards that some changes done for asking for new characters in the serial buffer massively were slowering the emulator performance).

-Then he had to left this project, and I started with it. -That previous version of pcbasic was horrible for me, in a way that it was very difficult to make debugging. The unique interface that worked was the ansi, so the develop was hard and very slow. -As he recommended me, I started with a newer version of pcbasic (the actual we are working now, which is much better, and I can use pycharm for debugging while viewing through pygame or sdl2). Since I thought that some big changes would be needed, I named it "pcbasic_brewer" -Your actual version of pcbasic is prepaired to work with an specific version of the pyserial (v2.7)(as you indicate in https://github.com/ robhagemans/pcbasic/blob/master/INSTALL.md). Since the latest version of pyserial is a little bit newer, (v3.4), I decided to adapt the same modifications that Nestor did to the pyserial v2.7 to this newer v3.4 version. -Then, for not mixing an original pyserial package with a modified one specific for the instrument, I decided to make a folder with the entire pyserial_brewer modified library, to manain these changes appart of the original serial library, and adapt the pcbasic_brewer for being able to switch between the standard pyserial, and the customized one (by just adding this to the launchers: "--use-serial-brewer=True" "--use-serial-brewer-verbose=True")

Actual status: -I can communicate with the instrument now, using my pyserial-brewer customized library, but I have noticed something wrong: The answers that the instrument sends to the program, are not detected by the interpreter until at least 2 seconds later or more in other ocassions. This generate a communication issue after some minutes, the program keeps hanged because is waiting for an answer.

I can replicate exaclty the same with the BrewerSimulator.py program and com0com software, which emulate a pair of bridged com ports in my laptop (com15-com14). (I have not any phisical com port neither). I run the BrewerSimulator.py on python, using the com15, and the brewer program on pcbasic_brewer, using the com15. This program emulate the first signals that the instrument send when the software is connected, and the answers to the pdhp command.

I'm researching now what can be the cause of that issue.

What I would do in your latest version of pcbasic, for now: -We can start updating the ports.py for being able to use the latest pyserial module (v3.4), instead of having to use the old one (v2.4). -I also have modified the loggers in the pcbasic_brewer for writting the dates in them, which is extremely useful to determine when a Com message has been received, and compare it with when it was Sent by the BrewerSimulator.

In config.py

def _prepare_logging(self): """Set up the global logger.""" logfile = self.get('logfile') if self.get('version') or self.get('help'): formatstr = '%(message)s' loglevel = logging.INFO else:

logging setup before we import modules and may need to log errors

    #formatstr = '%(levelname)s: %(message)s'
    formatstr ='%(asctime)s.%(msecs)04d %(levelname)s: %(message)s'
    if self.get('debug'):
        loglevel = logging.DEBUG
    else:
        loglevel = logging.INFO
#logging.basicConfig(format=formatstr, level=loglevel, filename=logfile)
logging.basicConfig(format=formatstr, level=loglevel,filename=logfile, datefmt='%H:%M:%S')

I attach you a log of a test I did yesterday with the instrument connected, using this modified pyserial version, and in which we can see how are being the serial answers stored in the memory, until I decided to stop it because it was waiting too much for an instrument answer.

I will keep you updated

2018-01-13 9:46 GMT+00:00 Rob Hagemans notifications@github.com:

Hey @Danitegue https://github.com/danitegue,

I was looking through the two brewer libraries and wondered about the modifield serial library. This seems to be a fork of the https://pythonhosted.org/pyserial/ package adapted to the Brewer spectrophotometer.

I was wondering what makes this modified library necessary - does it replace some DOS/Windows XP drivers supplied with the Brewer or is it needed to work around incompatibilities in PC-BASIC?

If it's the latter, we could try to find out what causes the incompatibility and merge the fixes back into PC-BASIC (preferably without having to maintain a fork of pyserial...) Caveat is that I don't have much (any) experience with RS-232 though, and haven't got any serial ports beyond a cheap USB one from ebay that I've never tried.

Cheers, Rob

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Danitegue/PCBasic_Brewer_Repo/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AYutGEK8QYSJUvsodtg0pxACKIl5FuZcks5tKHthgaJpZM4RdKub .

--

Daniel Santana Díaz, Danitegue@gmail.com

--

Daniel Santana Díaz, Danitegue@gmail.com

robhagemans commented 6 years ago

Hi thanks for the background, I think the suggestion to record time stamps in log files is a good one and I agree it would be better to update to the latest pyserial. Unfortunately the author of pyserial has removed parallel port support form later versions, so I may have to use parts of the old library for that.

Do you have some background of the problem that the device_file edit is meant to fix? A priori I don't think it's the right approach: the device file exists because GW-BASIC distinguishes "default" settings on its devices from ones that happen on open files on the device. For example, there is a separate WIDTH setting for LPT1: and for any files opened on LPT1:, and the same seems to be true for COM1:. This is the reason why there are two different COMFile objects on the port. Apparently this led to a problem, but did Nestor explain what the problem is?

robhagemans commented 6 years ago

I've created a branch topic-serial that for now has the timestamp logging and an update to the PySerial 3 API - have a look if you can. I've done very little testing so far but it's a start... I hope my recent string of unrelated commits don't make it too difficult to merge.

I haven't changed the device file yet. I think there may be two issues: 1) the serial buffer is implemented at the file level, which I think is incorrect - fairly sure GW-BASIC would have only one serial buffer given the memory requirement. I think the best may be to move the buffer to the SerialStream class and refactor the rest. After that, lot of testing will be needed...

2) The serial file is built around a text file, which has a one-byte readahead buffer for all sorts of reasons. But that means the port gets opened rightaway on starting PC-BASIC, which is probably not correct! I imagine I could just feed a single NUL char into the readahead buffer to avoid this...

robhagemans commented 6 years ago

I've applied the self.device_file = f line in the topic-serial branch as well - it will be better in the end to refactor to a single buffer held by the device object, but let's first see if we can make it work this way and then take it from there. It seems the only thing that uses the device file for anything else than the communications buffer is the WIDTH "COM1:", x statement and that's not very important for now.

Danitegue commented 6 years ago

I have cloned your latest master version of pcbasic, and then merged the changes of the topic-serial branch on it.

There is not too much difference between my serialbrewer library, and the latest pyserial, (only a few carriage returns are sent in my library to detect if the instrument is connected). It should work with both.

But I still cannot connect with the instrument for now using this latest version of pyserial, I'm researching the cause.

Respect the fact of having the self.device_file = f added or not:

By adding some debugging lines in the code...:

def open(self, number, param, filetype, mode, access, lock, reclen, seg, offset, length): """Open a file on COMn: """ if not self.stream: raise error.BASICError(error.DEVICE_UNAVAILABLE) logging.debug("Opening a file on COM port, as file number %s", str(number)) logging.debug("Before open, stream: %s", str(self.stream)) logging.debug("Before open, self.device_file: %s", str(self.device_file))

# PE setting not implemented
speed, parity, bytesize, stop, rs, cs, ds, cd, lf, _ =

self.get_params(param)

open the COM port

if self.stream.is_open:
    raise error.BASICError(error.FILE_ALREADY_OPEN)
else:
    try:
        self.stream.open(rs, cs, ds, cd)
    except EnvironmentError as e:
        # device timeout
        logging.debug("Serial exception: %s", e)
        raise error.BASICError(error.DEVICE_TIMEOUT)
try:
    self.stream.set_params(speed, parity, bytesize, stop)
except Exception:
    self.stream.close()
    raise
f = COMFile(self.stream, self.field, self.input_methods, lf,

self.serial_in_size)

inherit width settings from device file

f.width = self.device_file.width
f.col = self.device_file.col

self.device_file = f

logging.debug("After open, stream: %s", str(self.stream))
logging.debug("After open, self.device_file: %s", str(self.device_file))
logging.debug("After open, COMFile: %s", str(f))
time.sleep(0.5)
return f

I can obtain:

My version, without self.device_file = f line included: The software receive something from the com port, but seems that it cannot handle it properly

23:54:28.0576 WARNING: Smooth scaling not available: SDL_GFX extension not found. 23:54:28.0828 DEBUG: Initializating the GWBASIC Com Port 1, with serial_in_size=256 23:54:28.0828 DEBUG: ports.py, COMDevice, init, Initialize the COM port: COM14 23:54:28.0828 DEBUG: ports.py, COMDevice, init, self.device_file= <pcbasic.basic.ports.COMFile object at 0x000000000709AD68> 23:54:28.0828 DEBUG: Initializating the GWBASIC Com Port 2, with serial_in_size=256 23:54:28.0828 DEBUG: ports.py, COMDevice, init, Initialize the COM port: 23:54:28.0828 DEBUG: Aborted, None port to attach to. 23:54:28.0832 DEBUG: Loading prgram C:\PCBasic_Brewer_Repo\brw#185\Program\main.asc 23:54:30.0894 INFO: files.py, open, loading file:init.rtn as file number0 23:54:30.0970 INFO: files.py, open, loading file:scrn: as file number4 23:54:30.0992 INFO: files.py, open, loading file:op_st.fil as file number8 23:54:31.0016 INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 23:54:31.0020 INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 23:54:31.0022 INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 23:54:31.0023 INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 23:54:31.0023 INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 23:54:31.0025 INFO: files.py, open, loading file:d:\185\uvr26104.185 as file number8 23:54:31.0068 INFO: files.py, open, loading file:d:\D31217.185 as file number4 23:54:31.0073 INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 23:54:31.0086 INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 23:54:31.0121 INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 23:54:31.0125 INFO: files.py, open, loading file:d:\185\dcf140~1.CUB as file number8 23:54:31.0127 INFO: files.py, open, loading file:com1:1200,n,8,1,rs,ds,cs,cd as file number7 23:54:31.0127 DEBUG: Opening a file on COM port, as file number 7 23:54:31.0127 DEBUG: Before open, stream: <pcbasic.basic.ports.SerialStream object at 0x000000000709AC88> 23:54:31.0127 DEBUG: Before open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x000000000709AD68> 23:54:31.0127 DEBUG: ports.py, SerialStream, _check_open, Seems that the port is not opened, oppening it -> Here a new COMFile is generated. 23:54:31.0127 INFO: Using SerialBrewer module for oppening communications 23:54:31.0128 INFO: Trying communication (1200), attempt #1 -> 23:54:32.0128 DEBUG: Serialwin32_brewer.py read function1 has read: \r\n\x00\x00\x00\x00\x00\x00-> 23:54:32.0130 INFO: Test Successful 23:54:33.0631 INFO: **** Connection with Brewer Successful!(1200)


23:54:33.0631 DEBUG: After open, stream: <pcbasic.basic.ports.SerialStream object at 0x000000000709AC88> 23:54:33.0631 DEBUG: After open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x000000000709AD68> (Here we can see how self.device_file is not being updated with the latest generated COMFile)

23:54:33.0631 DEBUG: After open, COMFile: <pcbasic.basic.ports.COMFile object at 0x0000000006946F28> 23:54:34.0138 WARNING: SHELL statement disabled. 23:54:34.0150 INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 23:54:34.0151 INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 23:54:34.0171 DEBUG: ports.py, COMFile, _check_read: Checking char waiting to be read in com buffer... 23:54:34.0171 DEBUG: ports.py, COMFile, write, writting string to com port: F,0,2:V,120,1

23:54:34.0395 DEBUG: Serialwin32_brewer.py read function1 has read: \r\n\x00\x00\x00\x00\x00\x00-> 23:54:34.0397 DEBUG: ports.py, COMFile, _check_read: Checking char waiting to be read in com buffer... 23:54:34.0750 DEBUG: ports.py, COMFile, _check_read: Checking char waiting to be read in com buffer... 23:54:49.0357 INFO: files.py, open, loading file:d:\B31217.185 as file number1 23:54:49.0357 INFO: files.py, open, loading file:d:\B31217.185 as file number1 23:54:49.0950 INFO: files.py, open, loading file:re.rtn as file number0 23:54:50.0066 INFO: files.py, open, loading file:com1:1200,n,8,1,rs,ds,cs,cd as file number7 23:54:50.0066 DEBUG: Opening a file on COM port, as file number 7 23:54:50.0066 DEBUG: Before open, stream: <pcbasic.basic.ports.SerialStream object at 0x000000000709AC88> 23:54:50.0066 DEBUG: Before open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x000000000709AD68> 23:54:50.0066 DEBUG: ports.py, SerialStream, _check_open, Seems that the port is not opened, oppening it 23:54:50.0066 INFO: Using SerialBrewer module for oppening communications 23:54:50.0066 INFO: Trying communication (1200), attempt #1 -> 23:54:51.0069 DEBUG: Serialwin32_brewer.py read function1 has read: \r\n\x00\x00\x00\x00\x00\x00-> 23:54:51.0069 INFO: Test Successful 23:54:52.0571 INFO: **** Connection with Brewer Successful!(1200)


23:54:52.0572 DEBUG: After open, stream: <pcbasic.basic.ports.SerialStream object at 0x000000000709AC88> 23:54:52.0572 DEBUG: After open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x000000000709AD68> 23:54:52.0572 DEBUG: After open, COMFile: <pcbasic.basic.ports.COMFile object at 0x0000000006924E80>

(It continues in loop trying to receive the proper key from the instrument for continuing...but it never arrives, as ti would be waiting for a new char the wrong COMFile.)

My version, with self.device_file = f line included: The program can communicate and continue sending and receiving data through the com port:

23:55:36.0763 WARNING: Smooth scaling not available: SDL_GFX extension not found. 23:55:37.0003 DEBUG: Initializating the GWBASIC Com Port 1, with serial_in_size=256 23:55:37.0003 DEBUG: ports.py, COMDevice, init, Initialize the COM port: COM14 23:55:37.0003 DEBUG: ports.py, COMDevice, init, self.device_file= <pcbasic.basic.ports.COMFile object at 0x000000000709BD68> 23:55:37.0005 DEBUG: Initializating the GWBASIC Com Port 2, with serial_in_size=256 23:55:37.0005 DEBUG: ports.py, COMDevice, init, Initialize the COM port: 23:55:37.0005 DEBUG: Aborted, None port to attach to. 23:55:37.0006 DEBUG: Loading prgram C:\PCBasic_Brewer_Repo\brw#185\Program\main.asc 23:55:39.0049 INFO: files.py, open, loading file:init.rtn as file number0 23:55:39.0118 INFO: files.py, open, loading file:scrn: as file number4 23:55:39.0138 INFO: files.py, open, loading file:op_st.fil as file number8 23:55:39.0170 INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 23:55:39.0174 INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 23:55:39.0176 INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 23:55:39.0177 INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 23:55:39.0177 INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 23:55:39.0178 INFO: files.py, open, loading file:d:\185\uvr26104.185 as file number8 23:55:39.0216 INFO: files.py, open, loading file:d:\D31217.185 as file number4 23:55:39.0224 INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 23:55:39.0243 INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 23:55:39.0270 INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 23:55:39.0279 INFO: files.py, open, loading file:d:\185\dcf140~1.CUB as file number8 23:55:39.0282 INFO: files.py, open, loading file:com1:1200,n,8,1,rs,ds,cs,cd as file number7 23:55:39.0282 DEBUG: Opening a file on COM port, as file number 7 23:55:39.0282 DEBUG: Before open, stream: <pcbasic.basic.ports.SerialStream object at 0x000000000709BB70> 23:55:39.0282 DEBUG: Before open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x000000000709BD68> 23:55:39.0282 DEBUG: ports.py, SerialStream, _check_open, Seems that the port is not opened, oppening it -> -> Here a new COMFile is generated. 23:55:39.0283 INFO: Using SerialBrewer module for oppening communications 23:55:39.0283 INFO: Trying communication (1200), attempt #1 -> 23:55:40.0283 DEBUG: Serialwin32_brewer.py read function1 has read: \r\n\x00\x00\x00\x00\x00\x00-> 23:55:40.0285 INFO: Test Successful 23:55:41.0786 INFO: **** Connection with Brewer Successful!(1200)


23:55:41.0786 DEBUG: After open, stream: <pcbasic.basic.ports.SerialStream object at 0x000000000709BB70> 23:55:41.0786 DEBUG: After open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x00000000070B4A90> 23:55:41.0786 DEBUG: After open, COMFile: <pcbasic.basic.ports.COMFile object at 0x00000000070B4A90> (Here we can see how self.devicefile is being updated with the latest ComFile generated. 23:55:42.0290 WARNING: SHELL statement disabled. 23:55:42.0302 INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 23:55:42.0305 INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 23:55:42.0328 DEBUG: ports.py, COMFile, _check_read: Checking char waiting to be read in com buffer... 23:55:42.0328 DEBUG: ports.py, COMFile, write, writting string to com port: F,0,2:V,120,1

23:55:42.0617 DEBUG: Serialwin32_brewer.py read function1 has read: \r\n\x00\x00\x00\x00\x00\x00-> 23:55:42.0617 DEBUG: ports.py, COMFile, _check_read: Checking char waiting to be read in com buffer... 23:55:43.0009 DEBUG: ports.py, COMFile, read_raw, read:

  -> , space in input buffer=256

23:55:43.0552 INFO: files.py, open, loading file:da_lo.rtn as file number0 23:55:43.0632 INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 23:55:43.0671 DEBUG: ports.py, COMFile, write, writting string to com port: ?MOTOR.CLASS[2]

23:55:44.0025 DEBUG: Serialwin32_brewer.py read function1 has read: TRACKERMOTOR\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> 23:55:44.0025 DEBUG: ports.py, COMFile, _check_read: Checking char waiting to be read in com buffer... 23:55:44.0457 DEBUG: ports.py, COMFile, read_raw, read: TRACKERMOTOR

  -> , space in input buffer=256

23:55:44.0849 DEBUG: Serialwin32_brewer.py read function1 has read: \r\n\x00\x00\x00\x00\x00\x00-> 23:55:44.0851 DEBUG: ports.py, COMFile, _check_read: Checking char waiting to be read in com buffer... 23:55:44.0858 DEBUG: ports.py, COMFile, read_raw, read:

  -> , space in input buffer=256

23:55:44.0859 DEBUG: ports.py, COMFile, write, writting string to com port: B,0

...(it continues loading and communicating properly for a long time)...

Your version without the line added: I think there is a more important difference and is that _check_open is oppening the port before it should do it...(I think)

[23:52:19.0861] WARNING: Smooth scaling not available: SDL_GFX extension not found. [23:52:20.0058] DEBUG: ports.py, COMDevice, init, Initialize the COM port: COM14 [23:52:20.0059] DEBUG: ports.py, SerialStream, _check_open, Seems that the port is not opened, oppening it -> It is oppening the port before it should? [23:52:20.0059] DEBUG: ports.py, COMDevice, init, self.device_file= <pcbasic.basic.ports.COMFile object at 0x00000000078492E8> [23:52:20.0059] DEBUG: Initializating the GWBASIC Com Port 1, with serial_in_size=256 [23:52:20.0059] DEBUG: ports.py, COMDevice, init, Initialize the COM port: [23:52:20.0059] DEBUG: Aborted, None port to attach to. [23:52:20.0059] DEBUG: Initializating the GWBASIC Com Port 2, with serial_in_size=256 [23:52:22.0144] INFO: files.py, open, loading file:init.rtn as file number0 [23:52:22.0214] INFO: files.py, open, loading file:scrn: as file number4 [23:52:22.0233] INFO: files.py, open, loading file:op_st.fil as file number8 [23:52:22.0266] INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 [23:52:22.0269] INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 [23:52:22.0272] INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 [23:52:22.0273] INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 [23:52:22.0275] INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 [23:52:22.0276] INFO: files.py, open, loading file:d:\185\uvr26104.185 as file number8 [23:52:22.0318] INFO: files.py, open, loading file:d:\D31217.185 as file number4 [23:52:22.0323] INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 [23:52:22.0339] INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 [23:52:22.0375] INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 [23:52:22.0380] INFO: files.py, open, loading file:d:\185\dcf140~1.CUB as file number8 [23:52:22.0381] INFO: files.py, open, loading file:com1:1200,n,8,1,rs,ds,cs,cd as file number7 [23:52:22.0381] DEBUG: Opening a file on COM port, as file number 7 [23:52:22.0381] DEBUG: Before open, stream: <pcbasic.basic.ports.SerialStream object at 0x00000000065369E8> [23:52:22.0381] DEBUG: Before open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x00000000078492E8> -> After that point something happens in which is created a new COMFile. [23:52:22.0381] DEBUG: After open, stream: <pcbasic.basic.ports.SerialStream object at 0x00000000065369E8> [23:52:22.0381] DEBUG: After open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x00000000078492E8> (Here we can see how self.device_file is not being updated with the latest generated COMFile)> [23:52:22.0381] DEBUG: After open, COMFile: <pcbasic.basic.ports.COMFile object at 0x0000000007134470> [23:52:22.0882] WARNING: SHELL statement disabled. [23:52:22.0891] INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 [23:52:22.0894] INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 [23:52:22.0913] DEBUG: ports.py, COMFile, write, writting string to com port: F,0,2:V,120,1

[23:52:24.0904] INFO: files.py, open, loading file:d:\B31217.185 as file number1 [23:52:24.0904] INFO: files.py, open, loading file:d:\B31217.185 as file number1 [23:52:25.0453] INFO: files.py, open, loading file:re.rtn as file number0 [23:52:25.0561] INFO: files.py, open, loading file:com1:1200,n,8,1,rs,ds,cs,cd as file number7 [23:52:25.0561] DEBUG: Opening a file on COM port, as file number 7 [23:52:25.0561] DEBUG: Before open, stream: <pcbasic.basic.ports.SerialStream object at 0x00000000065369E8> [23:52:25.0561] DEBUG: Before open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x00000000078492E8> [23:52:25.0561] DEBUG: ports.py, SerialStream, _check_open, Seems that the port is not opened, oppening it [23:52:25.0562] DEBUG: After open, stream: <pcbasic.basic.ports.SerialStream object at 0x00000000065369E8> [23:52:25.0562] DEBUG: After open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x00000000078492E8> [23:52:25.0562] DEBUG: After open, COMFile: <pcbasic.basic.ports.COMFile object at 0x0000000007115F28>

(It continues in loop trying to receive the proper key from the instrument for continuing...but it never arrives, as ti would be waiting for a new char the wrong COMFile.)

Your version with the line added:

[23:53:13.0224] WARNING: Smooth scaling not available: SDL_GFX extension not found. [23:53:13.0444] DEBUG: ports.py, COMDevice, init, Initialize the COM port: COM14 [23:53:13.0444] DEBUG: ports.py, SerialStream, _check_open, Seems that the port is not opened, oppening it -> It is oppening the port before it should? [23:53:13.0444] DEBUG: ports.py, COMDevice, init, self.device_file= <pcbasic.basic.ports.COMFile object at 0x00000000074302E8> [23:53:13.0444] DEBUG: Initializating the GWBASIC Com Port 1, with serial_in_size=256 [23:53:13.0444] DEBUG: ports.py, COMDevice, init, Initialize the COM port: [23:53:13.0444] DEBUG: Aborted, None port to attach to. [23:53:13.0444] DEBUG: Initializating the GWBASIC Com Port 2, with serial_in_size=256 [23:53:15.0497] INFO: files.py, open, loading file:init.rtn as file number0 [23:53:15.0569] INFO: files.py, open, loading file:scrn: as file number4 [23:53:15.0589] INFO: files.py, open, loading file:op_st.fil as file number8 [23:53:15.0625] INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 [23:53:15.0638] INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 [23:53:15.0640] INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 [23:53:15.0641] INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 [23:53:15.0641] INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 [23:53:15.0642] INFO: files.py, open, loading file:d:\185\uvr26104.185 as file number8 [23:53:15.0671] INFO: files.py, open, loading file:d:\D31217.185 as file number4 [23:53:15.0677] INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 [23:53:15.0696] INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 [23:53:15.0723] INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 [23:53:15.0730] INFO: files.py, open, loading file:d:\185\dcf140~1.CUB as file number8 [23:53:15.0733] INFO: files.py, open, loading file:com1:1200,n,8,1,rs,ds,cs,cd as file number7 [23:53:15.0733] DEBUG: Opening a file on COM port, as file number 7 [23:53:15.0733] DEBUG: Before open, stream: <pcbasic.basic.ports.SerialStream object at 0x00000000061C59E8> [23:53:15.0733] DEBUG: Before open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x00000000074302E8> -> After that point something happens in which is created a new COMFile. [23:53:15.0733] DEBUG: After open, stream: <pcbasic.basic.ports.SerialStream object at 0x00000000061C59E8> [23:53:15.0733] DEBUG: After open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x000000000745D7F0> [23:53:15.0733] DEBUG: After open, COMFile: <pcbasic.basic.ports.COMFile object at 0x000000000745D7F0> (Here we can see how self.devicefile is being updated with the latest ComFile generated. [23:53:16.0233] WARNING: SHELL statement disabled. [23:53:16.0244] INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 [23:53:16.0253] INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 [23:53:16.0299] DEBUG: ports.py, COMFile, write, writting string to com port: F,0,2:V,120,1

[23:53:18.0308] INFO: files.py, open, loading file:d:\B31217.185 as file number1 [23:53:18.0308] INFO: files.py, open, loading file:d:\B31217.185 as file number1 [23:53:18.0904] INFO: files.py, open, loading file:re.rtn as file number0 [23:53:19.0023] INFO: files.py, open, loading file:com1:1200,n,8,1,rs,ds,cs,cd as file number7 [23:53:19.0023] DEBUG: Opening a file on COM port, as file number 7 [23:53:19.0023] DEBUG: Before open, stream: <pcbasic.basic.ports.SerialStream object at 0x00000000061C59E8> [23:53:19.0023] DEBUG: Before open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x000000000745D7F0> [23:53:19.0023] DEBUG: ports.py, SerialStream, _check_open, Seems that the port is not opened, oppening it [23:53:19.0023] DEBUG: After open, stream: <pcbasic.basic.ports.SerialStream object at 0x00000000061C59E8> [23:53:19.0023] DEBUG: After open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x0000000006D14F60> [23:53:19.0023] DEBUG: After open, COMFile: <pcbasic.basic.ports.COMFile object at 0x0000000006D14F60>

(It continues in loop trying to receive the proper key from the instrument for continuing...but it never arrives, as ti would be waiting for a new char the wrong COMFile.)

I would say the line is necessary.

I think the reason of the port being opened before it should in your version, is that in ports.py, class COMDevice, init, the last line:

self.device_file = COMFile(self.stream, self.field, self.input_methods, False, serial_in_size)

is trying to read something in the file by default. And in the ports.py, class SerialStream, read function, you have a self._check_open() that is oppening the port before it should. (I have disabled this _check_open in my version, but I tried to do it in yours and cannot receive anything through the com port yet... I have to check now the com ports events.)

Here the log files if you need to compare them.

Regards

2018-01-14 18:20 GMT+00:00 Rob Hagemans notifications@github.com:

I've applied the self.device_file = f line in the topic-serial branch as well - it will be better in the end to refactor to a single buffer held by the device object, but let's first see if we can make it work this way and then take it from there. It seems the only thing that uses the device file for anything else than the communications buffer is the WIDTH "COM1:", x statement and that's not very important for now.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Danitegue/PCBasic_Brewer_Repo/issues/1#issuecomment-357530745, or mute the thread https://github.com/notifications/unsubscribe-auth/AYutGA0Tn05qy0denm4U0qDc-gizCWltks5tKkVUgaJpZM4RdKub .

--

Daniel Santana Díaz, Danitegue@gmail.com

[23:53:13.0224] WARNING: Smooth scaling not available: SDL_GFX extension not found. [23:53:13.0444] DEBUG: ports.py, COMDevice, init, Initialize the COM port: COM14 [23:53:13.0444] DEBUG: ports.py, SerialStream, _check_open, Seems that the port is not opened, oppening it [23:53:13.0444] DEBUG: ports.py, COMDevice, init, self.device_file= <pcbasic.basic.ports.COMFile object at 0x00000000074302E8> [23:53:13.0444] DEBUG: Initializating the GWBASIC Com Port 1, with serial_in_size=256 [23:53:13.0444] DEBUG: ports.py, COMDevice, init, Initialize the COM port: [23:53:13.0444] DEBUG: Aborted, None port to attach to. [23:53:13.0444] DEBUG: Initializating the GWBASIC Com Port 2, with serial_in_size=256 [23:53:15.0497] INFO: files.py, open, loading file:init.rtn as file number0 [23:53:15.0569] INFO: files.py, open, loading file:scrn: as file number4 [23:53:15.0589] INFO: files.py, open, loading file:op_st.fil as file number8 [23:53:15.0625] INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 [23:53:15.0638] INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 [23:53:15.0640] INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 [23:53:15.0641] INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 [23:53:15.0641] INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 [23:53:15.0642] INFO: files.py, open, loading file:d:\185\uvr26104.185 as file number8 [23:53:15.0671] INFO: files.py, open, loading file:d:\D31217.185 as file number4 [23:53:15.0677] INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 [23:53:15.0696] INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 [23:53:15.0723] INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 [23:53:15.0730] INFO: files.py, open, loading file:d:\185\dcf140~1.CUB as file number8 [23:53:15.0733] INFO: files.py, open, loading file:com1:1200,n,8,1,rs,ds,cs,cd as file number7 [23:53:15.0733] DEBUG: Opening a file on COM port, as file number 7 [23:53:15.0733] DEBUG: Before open, stream: <pcbasic.basic.ports.SerialStream object at 0x00000000061C59E8> [23:53:15.0733] DEBUG: Before open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x00000000074302E8> [23:53:15.0733] DEBUG: After open, stream: <pcbasic.basic.ports.SerialStream object at 0x00000000061C59E8> [23:53:15.0733] DEBUG: After open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x000000000745D7F0> [23:53:15.0733] DEBUG: After open, COMFile: <pcbasic.basic.ports.COMFile object at 0x000000000745D7F0> [23:53:16.0233] WARNING: SHELL statement disabled. [23:53:16.0244] INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 [23:53:16.0253] INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 [23:53:16.0299] DEBUG: ports.py, COMFile, write, writting string to com port: F,0,2:V,120,1

[23:53:18.0308] INFO: files.py, open, loading file:d:\B31217.185 as file number1 [23:53:18.0308] INFO: files.py, open, loading file:d:\B31217.185 as file number1 [23:53:18.0904] INFO: files.py, open, loading file:re.rtn as file number0 [23:53:19.0023] INFO: files.py, open, loading file:com1:1200,n,8,1,rs,ds,cs,cd as file number7 [23:53:19.0023] DEBUG: Opening a file on COM port, as file number 7 [23:53:19.0023] DEBUG: Before open, stream: <pcbasic.basic.ports.SerialStream object at 0x00000000061C59E8> [23:53:19.0023] DEBUG: Before open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x000000000745D7F0> [23:53:19.0023] DEBUG: ports.py, SerialStream, _check_open, Seems that the port is not opened, oppening it [23:53:19.0023] DEBUG: After open, stream: <pcbasic.basic.ports.SerialStream object at 0x00000000061C59E8> [23:53:19.0023] DEBUG: After open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x0000000006D14F60> [23:53:19.0023] DEBUG: After open, COMFile: <pcbasic.basic.ports.COMFile object at 0x0000000006D14F60>

[23:52:19.0861] WARNING: Smooth scaling not available: SDL_GFX extension not found. [23:52:20.0058] DEBUG: ports.py, COMDevice, init, Initialize the COM port: COM14 [23:52:20.0059] DEBUG: ports.py, SerialStream, _check_open, Seems that the port is not opened, oppening it [23:52:20.0059] DEBUG: ports.py, COMDevice, init, self.device_file= <pcbasic.basic.ports.COMFile object at 0x00000000078492E8> [23:52:20.0059] DEBUG: Initializating the GWBASIC Com Port 1, with serial_in_size=256 [23:52:20.0059] DEBUG: ports.py, COMDevice, init, Initialize the COM port: [23:52:20.0059] DEBUG: Aborted, None port to attach to. [23:52:20.0059] DEBUG: Initializating the GWBASIC Com Port 2, with serial_in_size=256 [23:52:22.0144] INFO: files.py, open, loading file:init.rtn as file number0 [23:52:22.0214] INFO: files.py, open, loading file:scrn: as file number4 [23:52:22.0233] INFO: files.py, open, loading file:op_st.fil as file number8 [23:52:22.0266] INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 [23:52:22.0269] INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 [23:52:22.0272] INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 [23:52:22.0273] INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 [23:52:22.0275] INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 [23:52:22.0276] INFO: files.py, open, loading file:d:\185\uvr26104.185 as file number8 [23:52:22.0318] INFO: files.py, open, loading file:d:\D31217.185 as file number4 [23:52:22.0323] INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 [23:52:22.0339] INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 [23:52:22.0375] INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 [23:52:22.0380] INFO: files.py, open, loading file:d:\185\dcf140~1.CUB as file number8 [23:52:22.0381] INFO: files.py, open, loading file:com1:1200,n,8,1,rs,ds,cs,cd as file number7 [23:52:22.0381] DEBUG: Opening a file on COM port, as file number 7 [23:52:22.0381] DEBUG: Before open, stream: <pcbasic.basic.ports.SerialStream object at 0x00000000065369E8> [23:52:22.0381] DEBUG: Before open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x00000000078492E8> [23:52:22.0381] DEBUG: After open, stream: <pcbasic.basic.ports.SerialStream object at 0x00000000065369E8> [23:52:22.0381] DEBUG: After open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x00000000078492E8> [23:52:22.0381] DEBUG: After open, COMFile: <pcbasic.basic.ports.COMFile object at 0x0000000007134470> [23:52:22.0882] WARNING: SHELL statement disabled. [23:52:22.0891] INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 [23:52:22.0894] INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 [23:52:22.0913] DEBUG: ports.py, COMFile, write, writting string to com port: F,0,2:V,120,1

[23:52:24.0904] INFO: files.py, open, loading file:d:\B31217.185 as file number1 [23:52:24.0904] INFO: files.py, open, loading file:d:\B31217.185 as file number1 [23:52:25.0453] INFO: files.py, open, loading file:re.rtn as file number0 [23:52:25.0561] INFO: files.py, open, loading file:com1:1200,n,8,1,rs,ds,cs,cd as file number7 [23:52:25.0561] DEBUG: Opening a file on COM port, as file number 7 [23:52:25.0561] DEBUG: Before open, stream: <pcbasic.basic.ports.SerialStream object at 0x00000000065369E8> [23:52:25.0561] DEBUG: Before open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x00000000078492E8> [23:52:25.0561] DEBUG: ports.py, SerialStream, _check_open, Seems that the port is not opened, oppening it [23:52:25.0562] DEBUG: After open, stream: <pcbasic.basic.ports.SerialStream object at 0x00000000065369E8> [23:52:25.0562] DEBUG: After open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x00000000078492E8> [23:52:25.0562] DEBUG: After open, COMFile: <pcbasic.basic.ports.COMFile object at 0x0000000007115F28>

23:55:36.0763 WARNING: Smooth scaling not available: SDL_GFX extension not found. 23:55:37.0003 DEBUG: Initializating the GWBASIC Com Port 1, with serial_in_size=256 23:55:37.0003 DEBUG: ports.py, COMDevice, init, Initialize the COM port: COM14 23:55:37.0003 DEBUG: ports.py, COMDevice, init, self.device_file= <pcbasic.basic.ports.COMFile object at 0x000000000709BD68> 23:55:37.0005 DEBUG: Initializating the GWBASIC Com Port 2, with serial_in_size=256 23:55:37.0005 DEBUG: ports.py, COMDevice, init, Initialize the COM port: 23:55:37.0005 DEBUG: Aborted, None port to attach to. 23:55:37.0006 DEBUG: Loading prgram C:\PCBasic_Brewer_Repo\brw#185\Program\main.asc 23:55:39.0049 INFO: files.py, open, loading file:init.rtn as file number0 23:55:39.0118 INFO: files.py, open, loading file:scrn: as file number4 23:55:39.0138 INFO: files.py, open, loading file:op_st.fil as file number8 23:55:39.0170 INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 23:55:39.0174 INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 23:55:39.0176 INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 23:55:39.0177 INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 23:55:39.0177 INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 23:55:39.0178 INFO: files.py, open, loading file:d:\185\uvr26104.185 as file number8 23:55:39.0216 INFO: files.py, open, loading file:d:\D31217.185 as file number4 23:55:39.0224 INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 23:55:39.0243 INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 23:55:39.0270 INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 23:55:39.0279 INFO: files.py, open, loading file:d:\185\dcf140~1.CUB as file number8 23:55:39.0282 INFO: files.py, open, loading file:com1:1200,n,8,1,rs,ds,cs,cd as file number7 23:55:39.0282 DEBUG: Opening a file on COM port, as file number 7 23:55:39.0282 DEBUG: Before open, stream: <pcbasic.basic.ports.SerialStream object at 0x000000000709BB70> 23:55:39.0282 DEBUG: Before open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x000000000709BD68> 23:55:39.0282 DEBUG: ports.py, SerialStream, _check_open, Seems that the port is not opened, oppening it 23:55:39.0283 INFO: Using SerialBrewer module for oppening communications 23:55:39.0283 INFO: Trying communication (1200), attempt #1 -> 23:55:40.0283 DEBUG: Serialwin32_brewer.py read function1 has read: \r\n\x00\x00\x00\x00\x00\x00-> 23:55:40.0285 INFO: Test Successful 23:55:41.0786 INFO: **** Connection with Brewer Successful!(1200)


23:55:41.0786 DEBUG: After open, stream: <pcbasic.basic.ports.SerialStream object at 0x000000000709BB70> 23:55:41.0786 DEBUG: After open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x00000000070B4A90> 23:55:41.0786 DEBUG: After open, COMFile: <pcbasic.basic.ports.COMFile object at 0x00000000070B4A90> 23:55:42.0290 WARNING: SHELL statement disabled. 23:55:42.0302 INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 23:55:42.0305 INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 23:55:42.0328 DEBUG: ports.py, COMFile, _check_read: Checking char waiting to be read in com buffer... 23:55:42.0328 DEBUG: ports.py, COMFile, write, writting string to com port: F,0,2:V,120,1

23:55:42.0617 DEBUG: Serialwin32_brewer.py read function1 has read: \r\n\x00\x00\x00\x00\x00\x00-> 23:55:42.0617 DEBUG: ports.py, COMFile, _check_read: Checking char waiting to be read in com buffer... 23:55:43.0009 DEBUG: ports.py, COMFile, read_raw, read:

-> , space in input buffer=256 23:55:43.0552 INFO: files.py, open, loading file:da_lo.rtn as file number0 23:55:43.0632 INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 23:55:43.0671 DEBUG: ports.py, COMFile, write, writting string to com port: ?MOTOR.CLASS[2]

23:55:44.0025 DEBUG: Serialwin32_brewer.py read function1 has read: TRACKERMOTOR\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> 23:55:44.0025 DEBUG: ports.py, COMFile, _check_read: Checking char waiting to be read in com buffer... 23:55:44.0457 DEBUG: ports.py, COMFile, read_raw, read: TRACKERMOTOR

-> , space in input buffer=256 23:55:44.0849 DEBUG: Serialwin32_brewer.py read function1 has read: \r\n\x00\x00\x00\x00\x00\x00-> 23:55:44.0851 DEBUG: ports.py, COMFile, _check_read: Checking char waiting to be read in com buffer... 23:55:44.0858 DEBUG: ports.py, COMFile, read_raw, read:

-> , space in input buffer=256 23:55:44.0859 DEBUG: ports.py, COMFile, write, writting string to com port: B,0

23:54:28.0576 WARNING: Smooth scaling not available: SDL_GFX extension not found. 23:54:28.0828 DEBUG: Initializating the GWBASIC Com Port 1, with serial_in_size=256 23:54:28.0828 DEBUG: ports.py, COMDevice, init, Initialize the COM port: COM14 23:54:28.0828 DEBUG: ports.py, COMDevice, init, self.device_file= <pcbasic.basic.ports.COMFile object at 0x000000000709AD68> 23:54:28.0828 DEBUG: Initializating the GWBASIC Com Port 2, with serial_in_size=256 23:54:28.0828 DEBUG: ports.py, COMDevice, init, Initialize the COM port: 23:54:28.0828 DEBUG: Aborted, None port to attach to. 23:54:28.0832 DEBUG: Loading prgram C:\PCBasic_Brewer_Repo\brw#185\Program\main.asc 23:54:30.0894 INFO: files.py, open, loading file:init.rtn as file number0 23:54:30.0970 INFO: files.py, open, loading file:scrn: as file number4 23:54:30.0992 INFO: files.py, open, loading file:op_st.fil as file number8 23:54:31.0016 INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 23:54:31.0020 INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 23:54:31.0022 INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 23:54:31.0023 INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 23:54:31.0023 INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 23:54:31.0025 INFO: files.py, open, loading file:d:\185\uvr26104.185 as file number8 23:54:31.0068 INFO: files.py, open, loading file:d:\D31217.185 as file number4 23:54:31.0073 INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 23:54:31.0086 INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 23:54:31.0121 INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 23:54:31.0125 INFO: files.py, open, loading file:d:\185\dcf140~1.CUB as file number8 23:54:31.0127 INFO: files.py, open, loading file:com1:1200,n,8,1,rs,ds,cs,cd as file number7 23:54:31.0127 DEBUG: Opening a file on COM port, as file number 7 23:54:31.0127 DEBUG: Before open, stream: <pcbasic.basic.ports.SerialStream object at 0x000000000709AC88> 23:54:31.0127 DEBUG: Before open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x000000000709AD68> 23:54:31.0127 DEBUG: ports.py, SerialStream, _check_open, Seems that the port is not opened, oppening it 23:54:31.0127 INFO: Using SerialBrewer module for oppening communications 23:54:31.0128 INFO: Trying communication (1200), attempt #1 -> 23:54:32.0128 DEBUG: Serialwin32_brewer.py read function1 has read: \r\n\x00\x00\x00\x00\x00\x00-> 23:54:32.0130 INFO: Test Successful 23:54:33.0631 INFO: **** Connection with Brewer Successful!(1200)


23:54:33.0631 DEBUG: After open, stream: <pcbasic.basic.ports.SerialStream object at 0x000000000709AC88> 23:54:33.0631 DEBUG: After open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x000000000709AD68> 23:54:33.0631 DEBUG: After open, COMFile: <pcbasic.basic.ports.COMFile object at 0x0000000006946F28> 23:54:34.0138 WARNING: SHELL statement disabled. 23:54:34.0150 INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 23:54:34.0151 INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 23:54:34.0171 DEBUG: ports.py, COMFile, _check_read: Checking char waiting to be read in com buffer... 23:54:34.0171 DEBUG: ports.py, COMFile, write, writting string to com port: F,0,2:V,120,1

23:54:34.0395 DEBUG: Serialwin32_brewer.py read function1 has read: \r\n\x00\x00\x00\x00\x00\x00-> 23:54:34.0397 DEBUG: ports.py, COMFile, _check_read: Checking char waiting to be read in com buffer... 23:54:34.0750 DEBUG: ports.py, COMFile, _check_read: Checking char waiting to be read in com buffer... 23:54:49.0357 INFO: files.py, open, loading file:d:\B31217.185 as file number1 23:54:49.0357 INFO: files.py, open, loading file:d:\B31217.185 as file number1 23:54:49.0950 INFO: files.py, open, loading file:re.rtn as file number0 23:54:50.0066 INFO: files.py, open, loading file:com1:1200,n,8,1,rs,ds,cs,cd as file number7 23:54:50.0066 DEBUG: Opening a file on COM port, as file number 7 23:54:50.0066 DEBUG: Before open, stream: <pcbasic.basic.ports.SerialStream object at 0x000000000709AC88> 23:54:50.0066 DEBUG: Before open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x000000000709AD68> 23:54:50.0066 DEBUG: ports.py, SerialStream, _check_open, Seems that the port is not opened, oppening it 23:54:50.0066 INFO: Using SerialBrewer module for oppening communications 23:54:50.0066 INFO: Trying communication (1200), attempt #1 -> 23:54:51.0069 DEBUG: Serialwin32_brewer.py read function1 has read: \r\n\x00\x00\x00\x00\x00\x00-> 23:54:51.0069 INFO: Test Successful 23:54:52.0571 INFO: **** Connection with Brewer Successful!(1200)


23:54:52.0572 DEBUG: After open, stream: <pcbasic.basic.ports.SerialStream object at 0x000000000709AC88> 23:54:52.0572 DEBUG: After open, self.device_file: <pcbasic.basic.ports.COMFile object at 0x000000000709AD68> 23:54:52.0572 DEBUG: After open, COMFile: <pcbasic.basic.ports.COMFile object at 0x0000000006924E80>

robhagemans commented 6 years ago

Hi, thanks for the logs, I'll study them to get an idea of what the difference is.

I think it's clear the old version doesn't work, probably due to having several different buffers. The one-line fix setting the device file to the latest opened file is a bit of a hack though, and it wouldn't work if multiple files are opened on the same com device. I'm working on a more permanent fix along the lines of my previous message and will commit it to the topic branch when I get the basics working. I'm hoping we can then iron out regressions and further issues.

The issue with early opening of the port is due to the readahead, which indeed calls _check_open(). I'll fix that in the update as well.

One difference between our branches that I didn't merge is a sleep(0.5) after opening the connection, which may be why you can't yet connect. If that's the cause, I'd like to understand a bit further why a delay is needed, and what causes GW-BASIC to delay. Perhaps there is some kind of handshake protocol that's being missed or that has a wrong parameter.

The idea is to get to an implementation that works for just as GW-BASIC does, which should enable the brewer to work as well.

One further note on timings: if any of the BASIC code uses for loops for timing, and the device is sensitive to that: it's not going to work, and basically impossible to fix. Loops will not have the same speed as in GW-BASIC; it'll also vary with processor speed. Timer events and using the sound system for pauses should work, in principle.

Danitegue commented 6 years ago

Ok perfect.

All the tests were done with the sleep(0.5) line added, in both versions. But I can connect with and without it in my version, so it is not needed at all. It was only for tests.

I have to research a little bit how is implemented in the brewer software the port listener and the allowed timeouts in the communications. But I know that the brewer software can run and control the instrument using the DOSBOX emulator, which have the same problems with the loops and cpu usage... with the unique issue of having a growing offset appearing in the emulator program time with respect the pc time after some hours working. (Sun tracking instruments should have a good enough time synchronization)

I hope we can deal with that sooner or later in your version, perhaps triggering a synchronize hour event in idle moments. But this is another later step.

Regards

2018-01-15 9:12 GMT+00:00 Rob Hagemans notifications@github.com:

Hi, thanks for the logs, I'll study them to get an idea of what the difference is.

I think it's clear the old version doesn't work, probably due to having several different buffers. The one-line fix setting the device file to the latest opened file is a bit of a hack though, and it wouldn't work if multiple files are opened on the same com device. I'm working on a more permanent fix along the lines of my previous message and will commit it to the topic branch when I get the basics working. I'm hoping we can then iron out regressions and further issues.

The issue with early opening of the port is due to the readahead, which indeed calls _check_open(). I'll fix that in the update as well.

One difference between our branches that I didn't merge is a sleep(0.5) after opening the connection, which may be why you can't yet connect. If that's the cause, I'd like to understand a bit further why a delay is needed, and what causes GW-BASIC to delay. Perhaps there is some kind of handshake protocol that's being missed or that has a wrong parameter.

The idea is to get to an implementation that works for just as GW-BASIC does, which should enable the brewer to work as well.

One further note on timings: if any of the BASIC code uses for loops for timing, and the device is sensitive to that: it's not going to work, and basically impossible to fix. Loops will not have the same speed as in GW-BASIC; it'll also vary with processor speed. Timer events and using the sound system for pauses should work, in principle.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Danitegue/PCBasic_Brewer_Repo/issues/1#issuecomment-357622963, or mute the thread https://github.com/notifications/unsubscribe-auth/AYutGHg-LC7qxZ7xpoypZKhnIuLErDrDks5tKxZhgaJpZM4RdKub .

--

Daniel Santana Díaz, Danitegue@gmail.com

robhagemans commented 6 years ago

OK, good that it's not needed... I think the FOR loops are also not an issue then.

What is the issue with the time offset exactly? Is the internal clock (TIME$) going out of sync? That's very strange, it should just follow the system time unless it's being changed by the program. Do the programs adjust the TIME$ setting?

robhagemans commented 6 years ago

Does it have anything to do with the SHELL "timesync" call in this https://github.com/Danitegue/PCBasic_Brewer_Repo/blob/5357042041cf3ece863085c60d79adb82dde1036/brw%23185/Program/T2.rtn ? Because that will probably not work...

Danitegue commented 6 years ago

Hi Rob. I had to ask about that. I was wrong, sorry.

As an experienced user can answer me, the time sincronization problem of this program happens by default (running it with gwbasic or with DOSBOX), and for correcting these small offsets btw the brewer software and the pc, is used the td routine, a few times per day.

The problem with DOSBOX is only the extension posibilities and programming lenguage. As we commented in the other thread, this will be solved if we can run larger basic routines but from python.

2018-01-15 20:19 GMT+00:00 Rob Hagemans notifications@github.com:

Does it have anything to do with the SHELL "timesync" call in this https://github.com/Danitegue/PCBasic_Brewer_Repo/blob/535704 2041cf3ece863085c60d79adb82dde1036/brw%23185/Program/T2.rtn ? Because that will probably not work...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Danitegue/PCBasic_Brewer_Repo/issues/1#issuecomment-357780421, or mute the thread https://github.com/notifications/unsubscribe-auth/AYutGBaFjc46bmg5wOWmTCRcxku-RvVHks5tK7LegaJpZM4RdKub .

--

Daniel Santana Díaz, Danitegue@gmail.com

robhagemans commented 6 years ago

OK, thanks for the update - so if I understand it correctly it may just be a synchronisation issue between the PC clock and the Brewer. Maybe the OS periodically syncs the clock with network time (Linux does this, I think Windows too), or perhaps the instrument's clock is simply more precise?

I've pushed a re-implementation of the serial buffer to topic-serial, commit cd5e543 . Have a look how this functions for you - I expect there to be further issues or regressions but I hope they can be more easily fixed from this base.

I tested it against standard input and against SocketSerial and it seems to work in those test settings. SocketSerial is strangely slow on my machine (it takes 2 seconds per character at 300 baud setting) but that was also the case in the master branch. I'm not sure what causes this, but I hope it doesn't occur on the real serial port.

I found a linux kernel module https://github.com/freemed/tty0tty which seems to build a virtual serial bridge much like com0com does on Windows, and I might try and get that working so I can test it a bit more through the 'normal' serial code. However, please have a look as well.

robhagemans commented 6 years ago

I found the issue with slowness - I was using pyserial 3.0 which had a bug in tieout handling. Upgrading to 3.4 fixed it. I'm solving some crashes with GET and FIELD now.

Danitegue commented 6 years ago

What I could see with your yesterday version is that it can receive and send COM port messages with the simulator, but after some messages received the brewer software keeps blocked waiting for a instrument answer that never arrives.

researching a little bit, I got with this:

in pcbasic_brewer:

Every line received by the ports.py, COMFile, read_raw function has an empty space at the start and another at the end:

22:22:09.0561 DEBUG: ports.py, COMFile, read_raw, read: TRACKERMOTOR\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in input buffer=256 (Space at start, Space at end) ... 22:22:24.0760 DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in input buffer=256 (Space at start, Space at end) ...

in pcbasic:

In this case, it seems that the final space is cutted, and had into account in the next line:

[22:25:27.0226] DEBUG: ports.py, COMFile, read_raw, read: TRACKERMOTOR\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=246 (Space at start, Space at end)

[22:25:27.0780] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00->, space in COMFile buffer=256 (Space at start, and none space at end)*

[22:26:41.0085] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00->, space in COMFile buffer=256 (two spaces at start, and none at the end)

[22:27:29.0436] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00->, space in COMFile buffer=256 (two spaces at start, and none at the end)

I'm using pyserial 3.4

2018-01-17 19:50 GMT+00:00 Rob Hagemans notifications@github.com:

I found the issue with slowness - I was using pyserial 3.0 which had a bug in tieout handling. Upgrading to 3.4 fixed it. I'm solving some crashes with GET and FIELD now.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Danitegue/PCBasic_Brewer_Repo/issues/1#issuecomment-358422852, or mute the thread https://github.com/notifications/unsubscribe-auth/AYutGArp68lGUSaEoup2zVgz4p6Jq8XGks5tLk8RgaJpZM4RdKub .

--

Daniel Santana Díaz, Danitegue@gmail.com

robhagemans commented 6 years ago

Hi, I managed to set things up so that I can get the brewer simulator to talk to PC-BASIC with the brewer program. I see the following conversation between PC-BASIC (PC) and the bewer simulator (BS):

PC: 'F,0,2:V,120,1\r'
BS: '\r\n\x00\x00\x00\x00\x00\x00-> ' (1 space at the end)
PC: '?MOTOR.CLASS[2]\r'
BS: 'TRACKERMOTOR\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> ' (1 space at end)
(waits)
PC: 'B,0\r'
(waits)
BS: '\r\n\x00\x00\x00\x00\x00\x00-> '
PC: '\r'
BS: '\r\n\x00\x00\x00\x00\x00\x00-> '

Then the program returns to the main menu.

I don't think the problem is with spaces, it seems the strings with spaces are received exactly as they were sent.

I had to change the simulator script because the io.TextIOWrapper appears not to work correctly on Linux, it doesn't translate \r to \n even if I specify newline='\r'. So I removed the wrapper and changed the line = sio.readline() call to the ugly but serviceable

    line = ''
    c = ''
    while c != '\r':
        c = sw.read(1)
        line += c

the write call to

sw.write(a.replace('\n', '\r\n'))

Finally, I changed if '\n' == line and not gotkey: to if '\r' == line and not gotkey:

I'm wondering if similar problems with the TextIOWrapper occur on Windows. It may be useful to compare the command-line output of the brewer simulator on your end as well to see how it deals with line endings...

Danitegue commented 6 years ago

Hi rob I have tested your latest version up today, and respect the missing spaces reported in my last message:

I could see that in COMFile, read_raw, the self.next_char is reading one more character as it should. It is needed to prevent reading more characters than the characters to be read.

Here the proposal.

def read_raw(self, num=-1): """Read num characters as string.""" s = '' while True: if (num > -1 and len(s) >= num): break

check for \x1A (EOF char will actually stop further reading

    # (that's true in disk text files but not on LPT devices)
    #if self.next_char in ('\x1a', ''):
    #    break
    if len(s) < num:
        self.next_char = self.fhandle.read(1)
        s += self.next_char
        self.char = self.next_char
        self.last =self.char
if len(s) > 0:
    free = self.lof()
    logging.debug("ports.py, COMFile, read_raw, read: %s, space in

COMFile buffer=%s", str(s).replace('\r', '\r').replace('\n', '\n').replace('\x00', '\x00'), str(free)) return s

I dont know what to put in next_char when everything is already read...

I tried and now both pcbasic and pcbasic_brewer are working in the same way, with a very slow communication with the simulator, but at least they seems to communicate in the same way, receiving and sending the same COM port messages..

Now I'm going to research why is this communication so slow...

2018-01-17 22:41 GMT+00:00 Daniel Santana danitegue@gmail.com:

What I could see with your yesterday version is that it can receive and send COM port messages with the simulator, but after some messages received the brewer software keeps blocked waiting for a instrument answer that never arrives.

researching a little bit, I got with this:

in pcbasic_brewer:

Every line received by the ports.py, COMFile, read_raw function has an empty space at the start and another at the end:

22:22:09.0561 DEBUG: ports.py, COMFile, read_raw, read: TRACKERMOTOR\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in input buffer=256 (Space at start, Space at end) ... 22:22:24.0760 DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in input buffer=256 (Space at start, Space at end) ...

in pcbasic:

In this case, it seems that the final space is cutted, and had into account in the next line:

[22:25:27.0226] DEBUG: ports.py, COMFile, read_raw, read: TRACKERMOTOR\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=246 (Space at start, Space at end)

[22:25:27.0780] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00->, space in COMFile buffer=256 (Space at start, and none space at end)*

[22:26:41.0085] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00->, space in COMFile buffer=256 (two spaces at start, and none at the end)

[22:27:29.0436] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00->, space in COMFile buffer=256 (two spaces at start, and none at the end)

  • The program keeps blocked waiting for the correct answer in this moment.

I'm using pyserial 3.4

2018-01-17 19:50 GMT+00:00 Rob Hagemans notifications@github.com:

I found the issue with slowness - I was using pyserial 3.0 which had a bug in tieout handling. Upgrading to 3.4 fixed it. I'm solving some crashes with GET and FIELD now.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Danitegue/PCBasic_Brewer_Repo/issues/1#issuecomment-358422852, or mute the thread https://github.com/notifications/unsubscribe-auth/AYutGArp68lGUSaEoup2zVgz4p6Jq8XGks5tLk8RgaJpZM4RdKub .

--

Daniel Santana Díaz, Danitegue@gmail.com

--

Daniel Santana Díaz, Danitegue@gmail.com

Danitegue commented 6 years ago

When any routine is executed in the brewer software, the software write the result of the routine in the file \PCBasic_Brewer_Repo\brw#185\bdata185\B31217.185 (B+julian day+year.Instrument number)

I have uploaded to the repo the file \PCBasic_Brewer_Repo\brw#185\b data185\HP_reference_for_brewersimulator.txt. It is a B file, generated by the original brewer software running from GWBASIC and controlling a real instrument, but cutted for having only the HP results.

I have modified the brewer simulator in order to give the same answers for the HP routine as this reference routine, you can see it here https://github.com/Danitegue/PCBasic_Brewer_Repo/commit/78936f3b544019263aac3a96b72c566cda2f14a2. Why I changed that?: It is supposed that when the software receive a good gaussian signal in this routine, it is performed only two times. The old answers was not good, and the software tried and tried again up to 5 times. Also the simulator com port is now closed and open in order to restart it if I have to close abruptly the simulator, and it has a logger. But sorry in beforehand for the ugly code of the simulator, it is done quickly, only for tests.

So It is supposed that using this new BrewerSimulator we should obtain the same HP results in the generated B31217.85 file than in the reference file.

In the HP reference file we have:

hpscan 04:55:08

0 66347 10 96514 20 127847 30 159928 40 190187 50 215028 60 227272 70 230169 80 230486 90 231098 100 229171 110 217183 120 190595 130 159295 140 128684 150 97926 160 64454

Using pcbasic, running the pdhp routines, we obtain in the B31217.185 file generated:

hpscan 21:59:55

0 0 10 66347 20 96514 30 127847 40 159928 50 190187 60 215028 70 227272 80 230169 90 230486 100 231098 110 96514 120 217183 130 190595 140 159295 150 128684 160 97926

The first entry written in the output file (0) is not the same as the program has received from the com port (66374):

The communication flow of this HP routine is based in the M,9, 0;R, 6, 6,4;O\r - M,9, 10;R, 6, 6,4;O\r - M,9, 20;R, 6, 6,4;O\r orders that the software send to the instrument, or simulator.

PC - [22:47:43.0723] DEBUG: ports.py, COMFile, write, writting string to COM port: M,9, 0;R, 6, 6,4;O\r PC - [22:47:43.0723] DEBUG: ports.py, SerialStream, writting to socket: M,9, 0;R, 6, 6,4;O\r BS - 22:47:43.0930 Line received:M,9, 0;R, 6, 6,4;O\n BS - 22:47:43.0933 Writting to COM port:['66347', '\n', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\n', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '->', ' ', 'flush'] PC - [22:47:44.0733] DEBUG: Serialwin32.py, read, read: 66347 \r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> PC - [22:47:44.0733] DEBUG: ports.py, SerialStream, read from socket: 66347\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> PC - [22:47:44.0733] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. PC - [22:47:44.0740] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. PC - [22:47:44.0746] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. PC - [22:47:45.0443] DEBUG: ports.py, COMFile, read_raw, read: 66347\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256

What can be the cause of receiving one thing in read_raw, and writting a different thing in the output file? Perhaps memory addressing problems?

What could be the cause of having 1 second between the point in which the SerialStream has finished the reading from the socket, and an COM port event really triggered?

Here some logs of the actual communications, between pcbasic, (with the previous next_char quick fix), running a pdhp routine, the respective simulator log, and the B file. (In the B file, look for the hour of the HP).

2018-01-18 22:05 GMT+00:00 Daniel Santana danitegue@gmail.com:

Hi rob I have tested your latest version up today, and respect the missing spaces reported in my last message:

I could see that in COMFile, read_raw, the self.next_char is reading one more character as it should. It is needed to prevent reading more characters than the characters to be read.

Here the proposal.

def read_raw(self, num=-1): """Read num characters as string.""" s = '' while True: if (num > -1 and len(s) >= num): break

check for \x1A (EOF char will actually stop further reading

    # (that's true in disk text files but not on LPT devices)
    #if self.next_char in ('\x1a', ''):
    #    break
    if len(s) < num:
        self.next_char = self.fhandle.read(1)
        s += self.next_char
        self.char = self.next_char
        self.last =self.char
if len(s) > 0:
    free = self.lof()
    logging.debug("ports.py, COMFile, read_raw, read: %s, space in COMFile buffer=%s", str(s).replace('\r', '\\r').replace('\n', '\\n').replace('\x00', '\\x00'), str(free))
return s

I dont know what to put in next_char when everything is already read...

I tried and now both pcbasic and pcbasic_brewer are working in the same way, with a very slow communication with the simulator, but at least they seems to communicate in the same way, receiving and sending the same COM port messages..

Now I'm going to research why is this communication so slow...

2018-01-17 22:41 GMT+00:00 Daniel Santana danitegue@gmail.com:

What I could see with your yesterday version is that it can receive and send COM port messages with the simulator, but after some messages received the brewer software keeps blocked waiting for a instrument answer that never arrives.

researching a little bit, I got with this:

in pcbasic_brewer:

Every line received by the ports.py, COMFile, read_raw function has an empty space at the start and another at the end:

22:22:09.0561 DEBUG: ports.py, COMFile, read_raw, read: TRACKERMOTOR\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in input buffer=256 (Space at start, Space at end) ... 22:22:24.0760 DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in input buffer=256 (Space at start, Space at end) ...

in pcbasic:

In this case, it seems that the final space is cutted, and had into account in the next line:

[22:25:27.0226] DEBUG: ports.py, COMFile, read_raw, read: TRACKERMOTOR\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=246 (Space at start, Space at end)

[22:25:27.0780] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00->, space in COMFile buffer=256 (Space at start, and none space at end)*

[22:26:41.0085] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00->, space in COMFile buffer=256 (two spaces at start, and none at the end)

[22:27:29.0436] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00->, space in COMFile buffer=256 (two spaces at start, and none at the end)

  • The program keeps blocked waiting for the correct answer in this moment.

I'm using pyserial 3.4

2018-01-17 19:50 GMT+00:00 Rob Hagemans notifications@github.com:

I found the issue with slowness - I was using pyserial 3.0 which had a bug in tieout handling. Upgrading to 3.4 fixed it. I'm solving some crashes with GET and FIELD now.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Danitegue/PCBasic_Brewer_Repo/issues/1#issuecomment-358422852, or mute the thread https://github.com/notifications/unsubscribe-auth/AYutGArp68lGUSaEoup2zVgz4p6Jq8XGks5tLk8RgaJpZM4RdKub .

--

Daniel Santana Díaz, Danitegue@gmail.com

--

Daniel Santana Díaz, Danitegue@gmail.com

--

Daniel Santana Díaz, Danitegue@gmail.com

[22:38:17.0877] WARNING: Smooth scaling not available: SDL_GFX extension not found. [22:38:18.0095] DEBUG: Initializating the GWBASIC Com Port 1, with serial_in_size=256 [22:38:18.0095] DEBUG: ports.py, COMDevice, init, Initialize the COM port: COM14 [22:38:18.0095] DEBUG: Initializating the GWBASIC Com Port 2, with serial_in_size=256 [22:38:18.0095] DEBUG: ports.py, COMDevice, init, Initialize the COM port: [22:38:18.0096] DEBUG: Aborted, None port to attach to. [22:38:21.0548] INFO: files.py, open, loading file:init.rtn as file number0 [22:38:21.0634] INFO: files.py, open, loading file:scrn: as file number4 [22:38:21.0657] INFO: files.py, open, loading file:op_st.fil as file number8 [22:38:21.0690] INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 [22:38:21.0703] INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 [22:38:21.0704] INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 [22:38:21.0706] INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 [22:38:21.0707] INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 [22:38:21.0710] INFO: files.py, open, loading file:d:\185\uvr26104.185 as file number8 [22:38:21.0750] INFO: files.py, open, loading file:d:\D31217.185 as file number4 [22:38:21.0753] INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 [22:38:21.0769] INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 [22:38:21.0795] INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 [22:38:21.0802] INFO: files.py, open, loading file:d:\185\dcf140~1.CUB as file number8 [22:38:21.0803] INFO: files.py, open, loading file:com1:1200,n,8,1,rs,ds,cs,cd as file number7 [22:38:21.0805] DEBUG: ports.py, SerialStream, _check_open, Seems that the underlying port is not open, oppening it [22:38:21.0812] WARNING: SHELL statement disabled. [22:38:21.0819] INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 [22:38:21.0822] INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 [22:38:21.0864] DEBUG: ports.py, COMFile, write, writting string to COM port: F,0,2:V,120,1\r [22:38:21.0864] DEBUG: ports.py, SerialStream, writting to socket: F,0,2:V,120,1\r [22:38:22.0095] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> \r\n\x00\x00\x00\x00\x00\x00-> [22:38:22.0095] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> \r\n\x00\x00\x00\x00\x00\x00-> [22:38:22.0095] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:22.0101] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:22.0108] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:22.0520] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=235 [22:38:22.0533] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=236 [22:38:22.0548] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=237 [22:38:22.0562] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=238 [22:38:22.0575] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=239 [22:38:22.0588] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=240 [22:38:22.0601] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=241 [22:38:22.0617] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=242 [22:38:22.0631] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=243 [22:38:22.0644] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=244 [22:38:22.0658] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=245 [22:38:22.0671] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:38:22.0684] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:38:22.0698] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:38:22.0711] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:38:22.0724] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:38:22.0739] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:38:22.0752] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:38:22.0765] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:38:22.0779] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:38:22.0792] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:38:22.0805] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:38:22.0812] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:38:23.0355] INFO: files.py, open, loading file:da_lo.rtn as file number0 [22:38:23.0453] INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 [22:38:23.0502] DEBUG: ports.py, COMFile, write, writting string to COM port: ?MOTOR.CLASS[2]\r [22:38:23.0502] DEBUG: ports.py, SerialStream, writting to socket: ?MOTOR.CLASS[2]\r [22:38:23.0904] DEBUG: Serialwin32.py, read, read: TRACKERMOTOR\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:38:23.0904] DEBUG: ports.py, SerialStream, read from socket: TRACKERMOTOR\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:38:23.0904] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:23.0911] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:23.0917] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:24.0322] DEBUG: ports.py, SerialBuffer, read, read: T, free space in serial buffer=226 [22:38:24.0335] DEBUG: ports.py, SerialBuffer, read, read: R, free space in serial buffer=227 [22:38:24.0348] DEBUG: ports.py, SerialBuffer, read, read: A, free space in serial buffer=228 [22:38:24.0362] DEBUG: ports.py, SerialBuffer, read, read: C, free space in serial buffer=229 [22:38:24.0375] DEBUG: ports.py, SerialBuffer, read, read: K, free space in serial buffer=230 [22:38:24.0388] DEBUG: ports.py, SerialBuffer, read, read: E, free space in serial buffer=231 [22:38:24.0401] DEBUG: ports.py, SerialBuffer, read, read: R, free space in serial buffer=232 [22:38:24.0408] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:38:24.0408] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:38:24.0414] DEBUG: ports.py, SerialBuffer, read, read: M, free space in serial buffer=222 [22:38:24.0428] DEBUG: ports.py, SerialBuffer, read, read: O, free space in serial buffer=223 [22:38:24.0441] DEBUG: ports.py, SerialBuffer, read, read: T, free space in serial buffer=224 [22:38:24.0454] DEBUG: ports.py, SerialBuffer, read, read: O, free space in serial buffer=225 [22:38:24.0467] DEBUG: ports.py, SerialBuffer, read, read: R, free space in serial buffer=226 [22:38:24.0480] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=227 [22:38:24.0493] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=228 [22:38:24.0507] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=229 [22:38:24.0520] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=230 [22:38:24.0533] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=231 [22:38:24.0546] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=232 [22:38:24.0559] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=233 [22:38:24.0572] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=234 [22:38:24.0586] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=235 [22:38:24.0599] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=236 [22:38:24.0612] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=237 [22:38:24.0625] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=238 [22:38:24.0640] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=239 [22:38:24.0653] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=240 [22:38:24.0667] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=241 [22:38:24.0680] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=242 [22:38:24.0693] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=243 [22:38:24.0707] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=244 [22:38:24.0720] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=245 [22:38:24.0727] DEBUG: ports.py, COMFile, read_raw, read: TRACKERMOTOR\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=245 [22:38:24.0788] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:24.0795] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:24.0802] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:25.0269] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:38:25.0282] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:38:25.0296] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:38:25.0309] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:38:25.0322] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:38:25.0335] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:38:25.0348] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:38:25.0362] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:38:25.0377] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:38:25.0391] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:38:25.0404] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:38:25.0411] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:38:25.0417] DEBUG: ports.py, COMFile, write, writting string to COM port: B,0\r [22:38:25.0417] DEBUG: ports.py, SerialStream, writting to socket: B,0\r [22:38:39.0951] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:38:39.0953] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:38:39.0953] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:39.0960] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:39.0966] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:40.0371] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:38:40.0384] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:38:40.0398] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:38:40.0411] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:38:40.0424] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:38:40.0438] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:38:40.0453] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:38:40.0467] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:38:40.0480] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:38:40.0494] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:38:40.0509] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:38:40.0515] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:38:40.0526] DEBUG: ports.py, COMFile, write, writting string to COM port: \r [22:38:40.0528] DEBUG: ports.py, SerialStream, writting to socket: \r [22:38:55.0298] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:38:55.0298] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:38:55.0298] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:55.0305] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:55.0311] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:55.0769] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:38:55.0783] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:38:55.0796] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:38:55.0811] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:38:55.0823] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:38:55.0836] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:38:55.0849] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:38:55.0862] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:38:55.0875] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:38:55.0890] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:38:55.0903] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:38:55.0908] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:38:55.0911] DEBUG: ports.py, COMFile, write, writting string to COM port: \r [22:38:55.0911] DEBUG: ports.py, SerialStream, writting to socket: \r [22:38:58.0834] INFO: files.py, open, loading file:d:\B31217.185 as file number1 [22:38:58.0835] INFO: files.py, open, loading file:d:\B31217.185 as file number1 [22:38:59.0450] INFO: files.py, open, loading file:pdhp.rtn as file number1 [22:39:04.0569] INFO: files.py, open, loading file:d:\D31217.185 as file number4 [22:39:05.0210] INFO: files.py, open, loading file:hp.rtn as file number1 [22:39:05.0266] INFO: files.py, open, loading file:hp.rtn as file number0 [22:39:05.0381] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:39:05.0381] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:39:05.0381] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:39:05.0388] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:39:05.0394] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:39:05.0769] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:39:05.0782] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:39:05.0795] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:39:05.0808] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:39:05.0822] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:39:05.0836] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:39:05.0849] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:39:05.0862] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:39:05.0877] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:39:05.0890] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:39:05.0903] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:39:05.0910] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:39:05.0917] DEBUG: ports.py, COMFile, write, writting string to COM port: B,2\r [22:39:05.0917] DEBUG: ports.py, SerialStream, writting to socket: B,2\r [22:39:06.0357] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:39:06.0357] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:39:06.0369] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:39:06.0384] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:39:06.0398] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:39:06.0411] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:39:06.0424] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:39:06.0437] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:39:06.0450] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:39:06.0464] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:39:06.0479] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:39:06.0492] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:39:06.0503] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:39:06.0512] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:39:06.0517] DEBUG: ports.py, COMFile, write, writting string to COM port: ?TEMP[PMT]\r [22:39:06.0517] DEBUG: ports.py, SerialStream, writting to socket: ?TEMP[PMT]\r [22:39:06.0586] DEBUG: ports.py, COMFile, write, writting string to COM port: ?TEMP[FAN]\r [22:39:06.0588] DEBUG: ports.py, SerialStream, writting to socket: ?TEMP[FAN]\r [22:39:06.0608] DEBUG: Serialwin32.py, read, read: 19.158888\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:39:06.0608] DEBUG: ports.py, SerialStream, read from socket: 19.158888\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:39:06.0608] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:39:06.0615] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:39:06.0622] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:39:07.0006] DEBUG: Serialwin32.py, read, read: 19.633333\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:39:07.0006] DEBUG: ports.py, SerialStream, read from socket: 19.633333\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:39:07.0020] DEBUG: ports.py, SerialBuffer, read, read: 1, free space in serial buffer=201 [22:39:07.0033] DEBUG: ports.py, SerialBuffer, read, read: 9, free space in serial buffer=202 [22:39:07.0046] DEBUG: ports.py, SerialBuffer, read, read: ., free space in serial buffer=203 [22:39:07.0059] DEBUG: ports.py, SerialBuffer, read, read: 1, free space in serial buffer=204 [22:39:07.0073] DEBUG: ports.py, SerialBuffer, read, read: 5, free space in serial buffer=205 [22:39:07.0086] DEBUG: ports.py, SerialBuffer, read, read: 8, free space in serial buffer=206 [22:39:07.0099] DEBUG: ports.py, SerialBuffer, read, read: 8, free space in serial buffer=207 [22:39:07.0115] DEBUG: ports.py, SerialBuffer, read, read: 8, free space in serial buffer=208 [22:39:07.0128] DEBUG: ports.py, SerialBuffer, read, read: 8, free space in serial buffer=209 [22:39:07.0141] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=210 [22:39:07.0155] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=211 [22:39:07.0170] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=212 [22:39:07.0184] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=213 [22:39:07.0197] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=214 [22:39:07.0211] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=215 [22:39:07.0224] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=216 [22:39:07.0240] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=217 [22:39:07.0253] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=218 [22:39:07.0267] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=219 [22:39:07.0282] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=220 [22:39:07.0296] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=221 [22:39:07.0309] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=222 [22:39:07.0325] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=223 [22:39:07.0338] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=224 [22:39:07.0351] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=225 [22:39:07.0365] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=226 [22:39:07.0378] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=227 [22:39:07.0392] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=228 [22:39:07.0405] DEBUG: ports.py, SerialBuffer, read, read: 1, free space in serial buffer=229 [22:39:07.0420] DEBUG: ports.py, SerialBuffer, read, read: 9, free space in serial buffer=230 [22:39:07.0433] DEBUG: ports.py, SerialBuffer, read, read: ., free space in serial buffer=231 [22:39:07.0447] DEBUG: ports.py, SerialBuffer, read, read: 6, free space in serial buffer=232 [22:39:07.0461] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=233 [22:39:07.0474] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=234 [22:39:07.0487] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=235 [22:39:07.0502] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=236 [22:39:07.0515] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=237 [22:39:07.0529] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=238 [22:39:07.0542] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=239 [22:39:07.0555] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=240 [22:39:07.0569] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=241 [22:39:07.0582] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=242 [22:39:07.0596] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=243 [22:39:07.0611] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=244 [22:39:07.0625] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=245 [22:39:07.0640] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:39:07.0653] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:39:07.0665] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:39:07.0680] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:39:07.0693] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:39:07.0706] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:39:07.0720] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:39:07.0734] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:39:07.0749] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:39:07.0762] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:39:07.0776] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:39:07.0783] DEBUG: ports.py, COMFile, read_raw, read: 19.158888\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> 19.633333\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:39:22.0864] DEBUG: ports.py, COMFile, write, writting string to COM port: ?TEMP[BASE]\r [22:39:22.0864] DEBUG: ports.py, SerialStream, writting to socket: ?TEMP[BASE]\r [22:40:21.0210] DEBUG: Serialwin32.py, read, read: 17.637777\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:40:21.0210] DEBUG: ports.py, SerialStream, read from socket: 17.637777\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:40:21.0210] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:40:21.0219] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:40:21.0226] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:40:21.0621] DEBUG: ports.py, SerialBuffer, read, read: 1, free space in serial buffer=229 [22:40:21.0634] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=230 [22:40:21.0648] DEBUG: ports.py, SerialBuffer, read, read: ., free space in serial buffer=231 [22:40:21.0661] DEBUG: ports.py, SerialBuffer, read, read: 6, free space in serial buffer=232 [22:40:21.0676] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=233 [22:40:21.0688] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=234 [22:40:21.0701] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=235 [22:40:21.0714] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=236 [22:40:21.0729] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=237 [22:40:21.0742] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=238 [22:40:21.0756] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=239 [22:40:21.0769] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=240 [22:40:21.0782] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=241 [22:40:21.0796] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=242 [22:40:21.0809] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=243 [22:40:21.0822] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=244 [22:40:21.0835] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=245 [22:40:21.0848] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:40:21.0862] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:40:21.0877] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:40:21.0890] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:40:21.0903] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:40:21.0915] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:40:21.0930] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:40:21.0943] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:40:21.0956] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:40:21.0969] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:40:21.0982] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:40:21.0987] DEBUG: ports.py, COMFile, read_raw, read: 17.637777\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:40:21.0990] DEBUG: ports.py, COMFile, write, writting string to COM port: \r [22:40:21.0990] DEBUG: ports.py, SerialStream, writting to socket: \r [22:40:22.0509] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:40:22.0509] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:40:22.0523] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:40:22.0536] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:40:22.0551] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:40:22.0563] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:40:22.0578] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:40:22.0592] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:40:22.0607] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:40:22.0621] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:40:22.0634] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:40:22.0648] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:40:22.0661] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:40:22.0667] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:40:22.0671] DEBUG: ports.py, COMFile, write, writting string to COM port: ?TEMP[EXTERNAL]\r [22:40:22.0671] DEBUG: ports.py, SerialStream, writting to socket: ?TEMP[EXTERNAL]\r [22:40:22.0733] DEBUG: ports.py, COMFile, write, writting string to COM port: ?RH.SLOPE\r [22:40:22.0734] DEBUG: ports.py, SerialStream, writting to socket: ?RH.SLOPE\r [22:40:22.0782] DEBUG: Serialwin32.py, read, read: -37.777777\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:40:22.0782] DEBUG: ports.py, SerialStream, read from socket: -37.777777\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:40:22.0782] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:40:22.0788] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:40:22.0796] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:40:23.0256] DEBUG: Serialwin32.py, read, read: 0.031088\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:40:23.0256] DEBUG: ports.py, SerialStream, read from socket: 0.031088\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:40:23.0269] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=201 [22:40:23.0282] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=202 [22:40:23.0296] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=203 [22:40:23.0312] DEBUG: ports.py, SerialBuffer, read, read: ., free space in serial buffer=204 [22:40:23.0325] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=205 [22:40:23.0338] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=206 [22:40:23.0354] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=207 [22:40:23.0365] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=208 [22:40:23.0378] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=209 [22:40:23.0391] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=210 [22:40:23.0405] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=211 [22:40:23.0420] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=212 [22:40:23.0433] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=213 [22:40:23.0448] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=214 [22:40:23.0461] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=215 [22:40:23.0474] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=216 [22:40:23.0490] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=217 [22:40:23.0503] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=218 [22:40:23.0516] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=219 [22:40:23.0530] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=220 [22:40:23.0545] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=221 [22:40:23.0559] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=222 [22:40:23.0572] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=223 [22:40:23.0586] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=224 [22:40:23.0601] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=225 [22:40:23.0615] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=226 [22:40:23.0628] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=227 [22:40:23.0641] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=228 [22:40:23.0654] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=229 [22:40:23.0668] DEBUG: ports.py, SerialBuffer, read, read: 0, free space in serial buffer=230 [22:40:23.0681] DEBUG: ports.py, SerialBuffer, read, read: ., free space in serial buffer=231 [22:40:23.0694] DEBUG: ports.py, SerialBuffer, read, read: 0, free space in serial buffer=232 [22:40:23.0709] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=233 [22:40:23.0721] DEBUG: ports.py, SerialBuffer, read, read: 1, free space in serial buffer=234 [22:40:23.0733] DEBUG: ports.py, SerialBuffer, read, read: 0, free space in serial buffer=235 [22:40:23.0747] DEBUG: ports.py, SerialBuffer, read, read: 8, free space in serial buffer=236 [22:40:23.0760] DEBUG: ports.py, SerialBuffer, read, read: 8, free space in serial buffer=237 [22:40:23.0773] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=238 [22:40:23.0788] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=239 [22:40:23.0801] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=240 [22:40:23.0815] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=241 [22:40:23.0828] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=242 [22:40:23.0844] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=243 [22:40:23.0858] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=244 [22:40:23.0871] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=245 [22:40:23.0884] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:40:23.0898] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:40:23.0914] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:40:23.0927] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:40:23.0941] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:40:23.0954] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:40:23.0969] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:40:23.0983] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:40:23.0999] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:40:24.0013] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:40:24.0029] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:40:24.0035] DEBUG: ports.py, COMFile, read_raw, read: -37.777777\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> 0.031088\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:40:39.0102] DEBUG: ports.py, COMFile, write, writting string to COM port: ?RH.ORIGIN\r [22:40:39.0102] DEBUG: ports.py, SerialStream, writting to socket: ?RH.ORIGIN\r [22:41:37.0467] DEBUG: Serialwin32.py, read, read: 0.863000\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:41:37.0467] DEBUG: ports.py, SerialStream, read from socket: 0.863000\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:41:37.0467] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:41:37.0474] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:41:37.0482] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:41:37.0871] DEBUG: ports.py, SerialBuffer, read, read: 0, free space in serial buffer=230 [22:41:37.0882] DEBUG: ports.py, SerialBuffer, read, read: ., free space in serial buffer=231 [22:41:37.0895] DEBUG: ports.py, SerialBuffer, read, read: 8, free space in serial buffer=232 [22:41:37.0908] DEBUG: ports.py, SerialBuffer, read, read: 6, free space in serial buffer=233 [22:41:37.0923] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=234 [22:41:37.0936] DEBUG: ports.py, SerialBuffer, read, read: 0, free space in serial buffer=235 [22:41:37.0950] DEBUG: ports.py, SerialBuffer, read, read: 0, free space in serial buffer=236 [22:41:37.0963] DEBUG: ports.py, SerialBuffer, read, read: 0, free space in serial buffer=237 [22:41:37.0976] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=238 [22:41:37.0990] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=239 [22:41:38.0003] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=240 [22:41:38.0016] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=241 [22:41:38.0029] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=242 [22:41:38.0046] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=243 [22:41:38.0059] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=244 [22:41:38.0072] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=245 [22:41:38.0085] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:41:38.0099] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:41:38.0115] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:41:38.0128] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:41:38.0141] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:41:38.0154] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:41:38.0167] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:41:38.0180] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:41:38.0194] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:41:38.0207] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:41:38.0220] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:41:38.0226] DEBUG: ports.py, COMFile, read_raw, read: 0.863000\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:41:38.0230] DEBUG: ports.py, COMFile, write, writting string to COM port: \r [22:41:38.0230] DEBUG: ports.py, SerialStream, writting to socket: \r [22:41:38.0763] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:41:38.0763] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:41:38.0776] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:41:38.0789] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:41:38.0802] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:41:38.0815] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:41:38.0828] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:41:38.0844] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:41:38.0858] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:41:38.0871] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:41:38.0884] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:41:38.0898] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:41:38.0911] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:41:38.0918] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:41:38.0924] DEBUG: ports.py, COMFile, write, writting string to COM port: ?ANALOG.NOW[20]\r [22:41:38.0924] DEBUG: ports.py, SerialStream, writting to socket: ?ANALOG.NOW[20]\r [22:41:38.0992] DEBUG: ports.py, COMFile, write, writting string to COM port: ?TEMP[FAN]\r [22:41:38.0992] DEBUG: ports.py, SerialStream, writting to socket: ?TEMP[FAN]\r [22:41:39.0157] DEBUG: Serialwin32.py, read, read: 309\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:41:39.0157] DEBUG: ports.py, SerialStream, read from socket: 309\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:41:39.0157] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:41:39.0165] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:41:39.0173] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:41:39.0556] DEBUG: Serialwin32.py, read, read: 19.633333\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:41:39.0556] DEBUG: ports.py, SerialStream, read from socket: 19.633333\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:41:39.0571] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=207 [22:41:39.0584] DEBUG: ports.py, SerialBuffer, read, read: 0, free space in serial buffer=208 [22:41:39.0596] DEBUG: ports.py, SerialBuffer, read, read: 9, free space in serial buffer=209 [22:41:39.0609] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=210 [22:41:39.0625] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=211 [22:41:39.0638] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=212 [22:41:39.0653] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=213 [22:41:39.0667] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=214 [22:41:39.0680] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=215 [22:41:39.0694] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=216 [22:41:39.0707] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=217 [22:41:39.0720] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=218 [22:41:39.0733] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=219 [22:41:39.0746] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=220 [22:41:39.0759] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=221 [22:41:39.0773] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=222 [22:41:39.0786] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=223 [22:41:39.0799] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=224 [22:41:39.0812] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=225 [22:41:39.0828] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=226 [22:41:39.0842] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=227 [22:41:39.0855] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=228 [22:41:39.0869] DEBUG: ports.py, SerialBuffer, read, read: 1, free space in serial buffer=229 [22:41:39.0884] DEBUG: ports.py, SerialBuffer, read, read: 9, free space in serial buffer=230 [22:41:39.0898] DEBUG: ports.py, SerialBuffer, read, read: ., free space in serial buffer=231 [22:41:39.0911] DEBUG: ports.py, SerialBuffer, read, read: 6, free space in serial buffer=232 [22:41:39.0926] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=233 [22:41:39.0940] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=234 [22:41:39.0954] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=235 [22:41:39.0967] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=236 [22:41:39.0982] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=237 [22:41:39.0994] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=238 [22:41:40.0009] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=239 [22:41:40.0023] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=240 [22:41:40.0036] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=241 [22:41:40.0051] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=242 [22:41:40.0063] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=243 [22:41:40.0076] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=244 [22:41:40.0089] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=245 [22:41:40.0102] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:41:40.0117] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:41:40.0131] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:41:40.0144] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:41:40.0158] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:41:40.0171] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:41:40.0186] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:41:40.0198] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:41:40.0211] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:41:40.0224] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:41:40.0237] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:41:40.0244] DEBUG: ports.py, COMFile, read_raw, read: 309\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> 19.633333\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:41:40.0285] INFO: files.py, open, loading file:d:\B31217.185 as file number1 [22:41:40.0286] INFO: files.py, open, loading file:d:\B31217.185 as file number1 [22:41:55.0358] DEBUG: ports.py, COMFile, write, writting string to COM port: M,4,256\r [22:41:55.0358] DEBUG: ports.py, SerialStream, writting to socket: M,4,256\r [22:42:53.0727] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:42:53.0727] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:42:53.0727] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:42:53.0734] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:42:53.0742] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:42:54.0124] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:42:54.0138] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:42:54.0151] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:42:54.0164] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:42:54.0177] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:42:54.0191] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:42:54.0203] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:42:54.0217] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:42:54.0230] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:42:54.0244] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:42:54.0259] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:42:54.0265] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:42:54.0270] DEBUG: ports.py, COMFile, write, writting string to COM port: \r [22:42:54.0270] DEBUG: ports.py, SerialStream, writting to socket: \r [22:42:54.0757] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:42:54.0757] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:42:54.0770] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:42:54.0783] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:42:54.0798] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:42:54.0811] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:42:54.0825] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:42:54.0838] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:42:54.0852] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:42:54.0865] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:42:54.0880] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:42:54.0894] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:42:54.0908] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:42:54.0915] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:42:54.0926] DEBUG: ports.py, COMFile, write, writting string to COM port: M,5,0\r [22:42:54.0926] DEBUG: ports.py, SerialStream, writting to socket: M,5,0\r [22:42:54.0977] DEBUG: ports.py, COMFile, write, writting string to COM port: M,3, 250\r [22:42:54.0977] DEBUG: ports.py, SerialStream, writting to socket: M,3, 250\r [22:42:55.0141] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:42:55.0141] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:42:55.0141] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:42:55.0148] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:42:55.0155] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:42:55.0559] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:42:55.0559] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:42:55.0575] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=235 [22:42:55.0588] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=236 [22:42:55.0604] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=237 [22:42:55.0615] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=238 [22:42:55.0628] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=239 [22:42:55.0641] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=240 [22:42:55.0654] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=241 [22:42:55.0668] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=242 [22:42:55.0681] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=243 [22:42:55.0697] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=244 [22:42:55.0710] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=245 [22:42:55.0726] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:42:55.0739] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:42:55.0753] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:42:55.0767] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:42:55.0782] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:42:55.0796] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:42:55.0809] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:42:55.0822] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:42:55.0836] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:42:55.0851] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:42:55.0865] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:42:55.0872] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:43:10.0904] DEBUG: ports.py, COMFile, write, writting string to COM port: M,1,0\r [22:43:10.0904] DEBUG: ports.py, SerialStream, writting to socket: M,1,0\r [22:44:09.0276] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:44:09.0276] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:44:09.0276] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:44:09.0282] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:44:09.0289] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:44:09.0726] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:44:09.0737] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:44:09.0750] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:44:09.0765] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:44:09.0779] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:44:09.0792] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:44:09.0805] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:44:09.0818] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:44:09.0831] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:44:09.0845] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:44:09.0858] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:44:09.0865] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:44:09.0872] DEBUG: ports.py, COMFile, write, writting string to COM port: \r [22:44:09.0872] DEBUG: ports.py, SerialStream, writting to socket: \r [22:44:10.0309] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:44:10.0311] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:44:10.0325] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:44:10.0338] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:44:10.0351] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:44:10.0364] DEBUG: ports.py, SerialBuffer, read, read: \x00, fr

Danitegue commented 6 years ago

Sorry, a mistake in the previous attached files. Here are the proper ones:

pcabsic_log B31217.185 BrewerSimulator_Log.txt

2018-01-18 23:28 GMT+00:00 Daniel Santana danitegue@gmail.com:

When any routine is executed in the brewer software, the software write the result of the routine in the file \PCBasic_Brewer_Repo\brw#185\bdata185\B31217.185 (B+julian day+year.Instrument number)

I have uploaded to the repo the file \PCBasic_Brewer_Repo\brw#185\b data185\HP_reference_for_brewersimulator.txt. It is a B file, generated by the original brewer software running from GWBASIC and controlling a real instrument, but cutted for having only the HP results.

I have modified the brewer simulator in order to give the same answers for the HP routine as this reference routine, you can see it here https://github.com/Danitegue/PCBasic_Brewer_Repo/commit/78936f3b544019263aac3a96b72c566cda2f14a2. Why I changed that?: It is supposed that when the software receive a good gaussian signal in this routine, it is performed only two times. The old answers was not good, and the software tried and tried again up to 5 times. Also the simulator com port is now closed and open in order to restart it if I have to close abruptly the simulator, and it has a logger. But sorry in beforehand for the ugly code of the simulator, it is done quickly, only for tests.

So It is supposed that using this new BrewerSimulator we should obtain the same HP results in the generated B31217.85 file than in the reference file.

In the HP reference file we have:

hpscan 04:55:08

0 66347 10 96514 20 127847 30 159928 40 190187 50 215028 60 227272 70 230169 80 230486 90 231098 100 229171 110 217183 120 190595 130 159295 140 128684 150 97926 160 64454

Using pcbasic, running the pdhp routines, we obtain in the B31217.185 file generated:

hpscan 21:59:55

0 0 10 66347 20 96514 30 127847 40 159928 50 190187 60 215028 70 227272 80 230169 90 230486 100 231098 110 96514 120 217183 130 190595 140 159295 150 128684 160 97926

The first entry written in the output file (0) is not the same as the program has received from the com port (66374):

The communication flow of this HP routine is based in the M,9, 0;R, 6, 6,4;O\r - M,9, 10;R, 6, 6,4;O\r - M,9, 20;R, 6, 6,4;O\r orders that the software send to the instrument, or simulator.

PC - [22:47:43.0723] DEBUG: ports.py, COMFile, write, writting string to COM port: M,9, 0;R, 6, 6,4;O\r PC - [22:47:43.0723] DEBUG: ports.py, SerialStream, writting to socket: M,9, 0;R, 6, 6,4;O\r BS - 22:47:43.0930 Line received:M,9, 0;R, 6, 6,4;O\n BS - 22:47:43.0933 Writting to COM port:['66347', '\n', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\n', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '->', ' ', 'flush'] PC - [22:47:44.0733] DEBUG: Serialwin32.py, read, read: 66347 \r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> PC - [22:47:44.0733] DEBUG: ports.py, SerialStream, read from socket: 66347\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> PC - [22:47:44.0733] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. PC - [22:47:44.0740] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. PC - [22:47:44.0746] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. PC - [22:47:45.0443] DEBUG: ports.py, COMFile, read_raw, read: 66347 \r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256

What can be the cause of receiving one thing in read_raw, and writting a different thing in the output file? Perhaps memory addressing problems?

What could be the cause of having 1 second between the point in which the SerialStream has finished the reading from the socket, and an COM port event really triggered?

Here some logs of the actual communications, between pcbasic, (with the previous next_char quick fix), running a pdhp routine, the respective simulator log, and the B file. (In the B file, look for the hour of the HP).

2018-01-18 22:05 GMT+00:00 Daniel Santana danitegue@gmail.com:

Hi rob I have tested your latest version up today, and respect the missing spaces reported in my last message:

I could see that in COMFile, read_raw, the self.next_char is reading one more character as it should. It is needed to prevent reading more characters than the characters to be read.

Here the proposal.

def read_raw(self, num=-1): """Read num characters as string.""" s = '' while True: if (num > -1 and len(s) >= num): break

check for \x1A (EOF char will actually stop further reading

    # (that's true in disk text files but not on LPT devices)
    #if self.next_char in ('\x1a', ''):
    #    break
    if len(s) < num:
        self.next_char = self.fhandle.read(1)
        s += self.next_char
        self.char = self.next_char
        self.last =self.char
if len(s) > 0:
    free = self.lof()
    logging.debug("ports.py, COMFile, read_raw, read: %s, space in COMFile buffer=%s", str(s).replace('\r', '\\r').replace('\n', '\\n').replace('\x00', '\\x00'), str(free))
return s

I dont know what to put in next_char when everything is already read...

I tried and now both pcbasic and pcbasic_brewer are working in the same way, with a very slow communication with the simulator, but at least they seems to communicate in the same way, receiving and sending the same COM port messages..

Now I'm going to research why is this communication so slow...

2018-01-17 22:41 GMT+00:00 Daniel Santana danitegue@gmail.com:

What I could see with your yesterday version is that it can receive and send COM port messages with the simulator, but after some messages received the brewer software keeps blocked waiting for a instrument answer that never arrives.

researching a little bit, I got with this:

in pcbasic_brewer:

Every line received by the ports.py, COMFile, read_raw function has an empty space at the start and another at the end:

22:22:09.0561 DEBUG: ports.py, COMFile, read_raw, read: TRACKERMOTOR\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in input buffer=256 (Space at start, Space at end) ... 22:22:24.0760 DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in input buffer=256 (Space at start, Space at end) ...

in pcbasic:

In this case, it seems that the final space is cutted, and had into account in the next line:

[22:25:27.0226] DEBUG: ports.py, COMFile, read_raw, read: TRACKERMOTOR\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=246 (Space at start, Space at end)

[22:25:27.0780] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00->, space in COMFile buffer=256 (Space at start, and none space at end)*

[22:26:41.0085] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00->, space in COMFile buffer=256 (two spaces at start, and none at the end)

[22:27:29.0436] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00->, space in COMFile buffer=256 (two spaces at start, and none at the end)

  • The program keeps blocked waiting for the correct answer in this moment.

I'm using pyserial 3.4

2018-01-17 19:50 GMT+00:00 Rob Hagemans notifications@github.com:

I found the issue with slowness - I was using pyserial 3.0 which had a bug in tieout handling. Upgrading to 3.4 fixed it. I'm solving some crashes with GET and FIELD now.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Danitegue/PCBasic_Brewer_Repo/issues/1#issuecomment-358422852, or mute the thread https://github.com/notifications/unsubscribe-auth/AYutGArp68lGUSaEoup2zVgz4p6Jq8XGks5tLk8RgaJpZM4RdKub .

--

Daniel Santana Díaz, Danitegue@gmail.com

--

Daniel Santana Díaz, Danitegue@gmail.com

--

Daniel Santana Díaz, Danitegue@gmail.com

--

Daniel Santana Díaz, Danitegue@gmail.com

[22:38:17.0877] WARNING: Smooth scaling not available: SDL_GFX extension not found. [22:38:18.0095] DEBUG: Initializating the GWBASIC Com Port 1, with serial_in_size=256 [22:38:18.0095] DEBUG: ports.py, COMDevice, init, Initialize the COM port: COM14 [22:38:18.0095] DEBUG: Initializating the GWBASIC Com Port 2, with serial_in_size=256 [22:38:18.0095] DEBUG: ports.py, COMDevice, init, Initialize the COM port: [22:38:18.0096] DEBUG: Aborted, None port to attach to. [22:38:21.0548] INFO: files.py, open, loading file:init.rtn as file number0 [22:38:21.0634] INFO: files.py, open, loading file:scrn: as file number4 [22:38:21.0657] INFO: files.py, open, loading file:op_st.fil as file number8 [22:38:21.0690] INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 [22:38:21.0703] INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 [22:38:21.0704] INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 [22:38:21.0706] INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 [22:38:21.0707] INFO: files.py, open, loading file:d:\185\op_st.185 as file number8 [22:38:21.0710] INFO: files.py, open, loading file:d:\185\uvr26104.185 as file number8 [22:38:21.0750] INFO: files.py, open, loading file:d:\D31217.185 as file number4 [22:38:21.0753] INFO: files.py, open, loading file:d:\185\icf06617.185 as file number8 [22:38:21.0769] INFO: files.py, open, loading file:d:\185\dcf14013.185 as file number8 [22:38:21.0795] INFO: files.py, open, loading file:d:\185\zsf17802.185 as file number8 [22:38:21.0802] INFO: files.py, open, loading file:d:\185\dcf140~1.CUB as file number8 [22:38:21.0803] INFO: files.py, open, loading file:com1:1200,n,8,1,rs,ds,cs,cd as file number7 [22:38:21.0805] DEBUG: ports.py, SerialStream, _check_open, Seems that the underlying port is not open, oppening it [22:38:21.0812] WARNING: SHELL statement disabled. [22:38:21.0819] INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 [22:38:21.0822] INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 [22:38:21.0864] DEBUG: ports.py, COMFile, write, writting string to COM port: F,0,2:V,120,1\r [22:38:21.0864] DEBUG: ports.py, SerialStream, writting to socket: F,0,2:V,120,1\r [22:38:22.0095] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> \r\n\x00\x00\x00\x00\x00\x00-> [22:38:22.0095] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> \r\n\x00\x00\x00\x00\x00\x00-> [22:38:22.0095] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:22.0101] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:22.0108] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:22.0520] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=235 [22:38:22.0533] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=236 [22:38:22.0548] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=237 [22:38:22.0562] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=238 [22:38:22.0575] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=239 [22:38:22.0588] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=240 [22:38:22.0601] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=241 [22:38:22.0617] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=242 [22:38:22.0631] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=243 [22:38:22.0644] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=244 [22:38:22.0658] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=245 [22:38:22.0671] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:38:22.0684] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:38:22.0698] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:38:22.0711] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:38:22.0724] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:38:22.0739] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:38:22.0752] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:38:22.0765] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:38:22.0779] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:38:22.0792] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:38:22.0805] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:38:22.0812] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:38:23.0355] INFO: files.py, open, loading file:da_lo.rtn as file number0 [22:38:23.0453] INFO: files.py, open, loading file:d:\TODAY.TMP as file number1 [22:38:23.0502] DEBUG: ports.py, COMFile, write, writting string to COM port: ?MOTOR.CLASS[2]\r [22:38:23.0502] DEBUG: ports.py, SerialStream, writting to socket: ?MOTOR.CLASS[2]\r [22:38:23.0904] DEBUG: Serialwin32.py, read, read: TRACKERMOTOR\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:38:23.0904] DEBUG: ports.py, SerialStream, read from socket: TRACKERMOTOR\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:38:23.0904] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:23.0911] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:23.0917] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:24.0322] DEBUG: ports.py, SerialBuffer, read, read: T, free space in serial buffer=226 [22:38:24.0335] DEBUG: ports.py, SerialBuffer, read, read: R, free space in serial buffer=227 [22:38:24.0348] DEBUG: ports.py, SerialBuffer, read, read: A, free space in serial buffer=228 [22:38:24.0362] DEBUG: ports.py, SerialBuffer, read, read: C, free space in serial buffer=229 [22:38:24.0375] DEBUG: ports.py, SerialBuffer, read, read: K, free space in serial buffer=230 [22:38:24.0388] DEBUG: ports.py, SerialBuffer, read, read: E, free space in serial buffer=231 [22:38:24.0401] DEBUG: ports.py, SerialBuffer, read, read: R, free space in serial buffer=232 [22:38:24.0408] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:38:24.0408] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:38:24.0414] DEBUG: ports.py, SerialBuffer, read, read: M, free space in serial buffer=222 [22:38:24.0428] DEBUG: ports.py, SerialBuffer, read, read: O, free space in serial buffer=223 [22:38:24.0441] DEBUG: ports.py, SerialBuffer, read, read: T, free space in serial buffer=224 [22:38:24.0454] DEBUG: ports.py, SerialBuffer, read, read: O, free space in serial buffer=225 [22:38:24.0467] DEBUG: ports.py, SerialBuffer, read, read: R, free space in serial buffer=226 [22:38:24.0480] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=227 [22:38:24.0493] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=228 [22:38:24.0507] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=229 [22:38:24.0520] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=230 [22:38:24.0533] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=231 [22:38:24.0546] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=232 [22:38:24.0559] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=233 [22:38:24.0572] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=234 [22:38:24.0586] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=235 [22:38:24.0599] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=236 [22:38:24.0612] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=237 [22:38:24.0625] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=238 [22:38:24.0640] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=239 [22:38:24.0653] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=240 [22:38:24.0667] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=241 [22:38:24.0680] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=242 [22:38:24.0693] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=243 [22:38:24.0707] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=244 [22:38:24.0720] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=245 [22:38:24.0727] DEBUG: ports.py, COMFile, read_raw, read: TRACKERMOTOR\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=245 [22:38:24.0788] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:24.0795] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:24.0802] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:25.0269] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:38:25.0282] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:38:25.0296] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:38:25.0309] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:38:25.0322] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:38:25.0335] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:38:25.0348] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:38:25.0362] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:38:25.0377] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:38:25.0391] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:38:25.0404] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:38:25.0411] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:38:25.0417] DEBUG: ports.py, COMFile, write, writting string to COM port: B,0\r [22:38:25.0417] DEBUG: ports.py, SerialStream, writting to socket: B,0\r [22:38:39.0951] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:38:39.0953] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:38:39.0953] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:39.0960] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:39.0966] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:40.0371] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:38:40.0384] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:38:40.0398] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:38:40.0411] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:38:40.0424] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:38:40.0438] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:38:40.0453] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:38:40.0467] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:38:40.0480] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:38:40.0494] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:38:40.0509] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:38:40.0515] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:38:40.0526] DEBUG: ports.py, COMFile, write, writting string to COM port: \r [22:38:40.0528] DEBUG: ports.py, SerialStream, writting to socket: \r [22:38:55.0298] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:38:55.0298] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:38:55.0298] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:55.0305] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:55.0311] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:38:55.0769] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:38:55.0783] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:38:55.0796] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:38:55.0811] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:38:55.0823] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:38:55.0836] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:38:55.0849] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:38:55.0862] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:38:55.0875] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:38:55.0890] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:38:55.0903] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:38:55.0908] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:38:55.0911] DEBUG: ports.py, COMFile, write, writting string to COM port: \r [22:38:55.0911] DEBUG: ports.py, SerialStream, writting to socket: \r [22:38:58.0834] INFO: files.py, open, loading file:d:\B31217.185 as file number1 [22:38:58.0835] INFO: files.py, open, loading file:d:\B31217.185 as file number1 [22:38:59.0450] INFO: files.py, open, loading file:pdhp.rtn as file number1 [22:39:04.0569] INFO: files.py, open, loading file:d:\D31217.185 as file number4 [22:39:05.0210] INFO: files.py, open, loading file:hp.rtn as file number1 [22:39:05.0266] INFO: files.py, open, loading file:hp.rtn as file number0 [22:39:05.0381] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:39:05.0381] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:39:05.0381] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:39:05.0388] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:39:05.0394] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:39:05.0769] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:39:05.0782] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:39:05.0795] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:39:05.0808] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:39:05.0822] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:39:05.0836] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:39:05.0849] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:39:05.0862] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:39:05.0877] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:39:05.0890] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:39:05.0903] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:39:05.0910] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:39:05.0917] DEBUG: ports.py, COMFile, write, writting string to COM port: B,2\r [22:39:05.0917] DEBUG: ports.py, SerialStream, writting to socket: B,2\r [22:39:06.0357] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:39:06.0357] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:39:06.0369] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:39:06.0384] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:39:06.0398] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:39:06.0411] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:39:06.0424] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:39:06.0437] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:39:06.0450] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:39:06.0464] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:39:06.0479] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:39:06.0492] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:39:06.0503] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:39:06.0512] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:39:06.0517] DEBUG: ports.py, COMFile, write, writting string to COM port: ?TEMP[PMT]\r [22:39:06.0517] DEBUG: ports.py, SerialStream, writting to socket: ?TEMP[PMT]\r [22:39:06.0586] DEBUG: ports.py, COMFile, write, writting string to COM port: ?TEMP[FAN]\r [22:39:06.0588] DEBUG: ports.py, SerialStream, writting to socket: ?TEMP[FAN]\r [22:39:06.0608] DEBUG: Serialwin32.py, read, read: 19.158888\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:39:06.0608] DEBUG: ports.py, SerialStream, read from socket: 19.158888\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:39:06.0608] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:39:06.0615] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:39:06.0622] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:39:07.0006] DEBUG: Serialwin32.py, read, read: 19.633333\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:39:07.0006] DEBUG: ports.py, SerialStream, read from socket: 19.633333\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:39:07.0020] DEBUG: ports.py, SerialBuffer, read, read: 1, free space in serial buffer=201 [22:39:07.0033] DEBUG: ports.py, SerialBuffer, read, read: 9, free space in serial buffer=202 [22:39:07.0046] DEBUG: ports.py, SerialBuffer, read, read: ., free space in serial buffer=203 [22:39:07.0059] DEBUG: ports.py, SerialBuffer, read, read: 1, free space in serial buffer=204 [22:39:07.0073] DEBUG: ports.py, SerialBuffer, read, read: 5, free space in serial buffer=205 [22:39:07.0086] DEBUG: ports.py, SerialBuffer, read, read: 8, free space in serial buffer=206 [22:39:07.0099] DEBUG: ports.py, SerialBuffer, read, read: 8, free space in serial buffer=207 [22:39:07.0115] DEBUG: ports.py, SerialBuffer, read, read: 8, free space in serial buffer=208 [22:39:07.0128] DEBUG: ports.py, SerialBuffer, read, read: 8, free space in serial buffer=209 [22:39:07.0141] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=210 [22:39:07.0155] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=211 [22:39:07.0170] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=212 [22:39:07.0184] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=213 [22:39:07.0197] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=214 [22:39:07.0211] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=215 [22:39:07.0224] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=216 [22:39:07.0240] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=217 [22:39:07.0253] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=218 [22:39:07.0267] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=219 [22:39:07.0282] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=220 [22:39:07.0296] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=221 [22:39:07.0309] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=222 [22:39:07.0325] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=223 [22:39:07.0338] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=224 [22:39:07.0351] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=225 [22:39:07.0365] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=226 [22:39:07.0378] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=227 [22:39:07.0392] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=228 [22:39:07.0405] DEBUG: ports.py, SerialBuffer, read, read: 1, free space in serial buffer=229 [22:39:07.0420] DEBUG: ports.py, SerialBuffer, read, read: 9, free space in serial buffer=230 [22:39:07.0433] DEBUG: ports.py, SerialBuffer, read, read: ., free space in serial buffer=231 [22:39:07.0447] DEBUG: ports.py, SerialBuffer, read, read: 6, free space in serial buffer=232 [22:39:07.0461] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=233 [22:39:07.0474] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=234 [22:39:07.0487] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=235 [22:39:07.0502] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=236 [22:39:07.0515] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=237 [22:39:07.0529] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=238 [22:39:07.0542] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=239 [22:39:07.0555] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=240 [22:39:07.0569] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=241 [22:39:07.0582] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=242 [22:39:07.0596] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=243 [22:39:07.0611] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=244 [22:39:07.0625] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=245 [22:39:07.0640] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:39:07.0653] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:39:07.0665] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:39:07.0680] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:39:07.0693] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:39:07.0706] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:39:07.0720] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:39:07.0734] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:39:07.0749] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:39:07.0762] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:39:07.0776] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:39:07.0783] DEBUG: ports.py, COMFile, read_raw, read: 19.158888\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> 19.633333\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:39:22.0864] DEBUG: ports.py, COMFile, write, writting string to COM port: ?TEMP[BASE]\r [22:39:22.0864] DEBUG: ports.py, SerialStream, writting to socket: ?TEMP[BASE]\r [22:40:21.0210] DEBUG: Serialwin32.py, read, read: 17.637777\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:40:21.0210] DEBUG: ports.py, SerialStream, read from socket: 17.637777\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:40:21.0210] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:40:21.0219] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:40:21.0226] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:40:21.0621] DEBUG: ports.py, SerialBuffer, read, read: 1, free space in serial buffer=229 [22:40:21.0634] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=230 [22:40:21.0648] DEBUG: ports.py, SerialBuffer, read, read: ., free space in serial buffer=231 [22:40:21.0661] DEBUG: ports.py, SerialBuffer, read, read: 6, free space in serial buffer=232 [22:40:21.0676] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=233 [22:40:21.0688] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=234 [22:40:21.0701] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=235 [22:40:21.0714] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=236 [22:40:21.0729] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=237 [22:40:21.0742] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=238 [22:40:21.0756] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=239 [22:40:21.0769] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=240 [22:40:21.0782] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=241 [22:40:21.0796] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=242 [22:40:21.0809] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=243 [22:40:21.0822] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=244 [22:40:21.0835] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=245 [22:40:21.0848] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:40:21.0862] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:40:21.0877] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:40:21.0890] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:40:21.0903] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:40:21.0915] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:40:21.0930] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:40:21.0943] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:40:21.0956] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:40:21.0969] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:40:21.0982] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:40:21.0987] DEBUG: ports.py, COMFile, read_raw, read: 17.637777\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:40:21.0990] DEBUG: ports.py, COMFile, write, writting string to COM port: \r [22:40:21.0990] DEBUG: ports.py, SerialStream, writting to socket: \r [22:40:22.0509] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:40:22.0509] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:40:22.0523] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:40:22.0536] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:40:22.0551] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:40:22.0563] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:40:22.0578] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:40:22.0592] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:40:22.0607] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:40:22.0621] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:40:22.0634] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:40:22.0648] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:40:22.0661] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:40:22.0667] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:40:22.0671] DEBUG: ports.py, COMFile, write, writting string to COM port: ?TEMP[EXTERNAL]\r [22:40:22.0671] DEBUG: ports.py, SerialStream, writting to socket: ?TEMP[EXTERNAL]\r [22:40:22.0733] DEBUG: ports.py, COMFile, write, writting string to COM port: ?RH.SLOPE\r [22:40:22.0734] DEBUG: ports.py, SerialStream, writting to socket: ?RH.SLOPE\r [22:40:22.0782] DEBUG: Serialwin32.py, read, read: -37.777777\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:40:22.0782] DEBUG: ports.py, SerialStream, read from socket: -37.777777\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:40:22.0782] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:40:22.0788] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:40:22.0796] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:40:23.0256] DEBUG: Serialwin32.py, read, read: 0.031088\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:40:23.0256] DEBUG: ports.py, SerialStream, read from socket: 0.031088\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:40:23.0269] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=201 [22:40:23.0282] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=202 [22:40:23.0296] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=203 [22:40:23.0312] DEBUG: ports.py, SerialBuffer, read, read: ., free space in serial buffer=204 [22:40:23.0325] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=205 [22:40:23.0338] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=206 [22:40:23.0354] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=207 [22:40:23.0365] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=208 [22:40:23.0378] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=209 [22:40:23.0391] DEBUG: ports.py, SerialBuffer, read, read: 7, free space in serial buffer=210 [22:40:23.0405] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=211 [22:40:23.0420] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=212 [22:40:23.0433] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=213 [22:40:23.0448] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=214 [22:40:23.0461] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=215 [22:40:23.0474] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=216 [22:40:23.0490] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=217 [22:40:23.0503] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=218 [22:40:23.0516] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=219 [22:40:23.0530] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=220 [22:40:23.0545] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=221 [22:40:23.0559] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=222 [22:40:23.0572] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=223 [22:40:23.0586] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=224 [22:40:23.0601] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=225 [22:40:23.0615] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=226 [22:40:23.0628] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=227 [22:40:23.0641] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=228 [22:40:23.0654] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=229 [22:40:23.0668] DEBUG: ports.py, SerialBuffer, read, read: 0, free space in serial buffer=230 [22:40:23.0681] DEBUG: ports.py, SerialBuffer, read, read: ., free space in serial buffer=231 [22:40:23.0694] DEBUG: ports.py, SerialBuffer, read, read: 0, free space in serial buffer=232 [22:40:23.0709] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=233 [22:40:23.0721] DEBUG: ports.py, SerialBuffer, read, read: 1, free space in serial buffer=234 [22:40:23.0733] DEBUG: ports.py, SerialBuffer, read, read: 0, free space in serial buffer=235 [22:40:23.0747] DEBUG: ports.py, SerialBuffer, read, read: 8, free space in serial buffer=236 [22:40:23.0760] DEBUG: ports.py, SerialBuffer, read, read: 8, free space in serial buffer=237 [22:40:23.0773] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=238 [22:40:23.0788] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=239 [22:40:23.0801] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=240 [22:40:23.0815] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=241 [22:40:23.0828] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=242 [22:40:23.0844] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=243 [22:40:23.0858] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=244 [22:40:23.0871] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=245 [22:40:23.0884] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:40:23.0898] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:40:23.0914] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:40:23.0927] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:40:23.0941] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:40:23.0954] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:40:23.0969] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:40:23.0983] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:40:23.0999] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:40:24.0013] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:40:24.0029] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:40:24.0035] DEBUG: ports.py, COMFile, read_raw, read: -37.777777\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> 0.031088\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:40:39.0102] DEBUG: ports.py, COMFile, write, writting string to COM port: ?RH.ORIGIN\r [22:40:39.0102] DEBUG: ports.py, SerialStream, writting to socket: ?RH.ORIGIN\r [22:41:37.0467] DEBUG: Serialwin32.py, read, read: 0.863000\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:41:37.0467] DEBUG: ports.py, SerialStream, read from socket: 0.863000\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:41:37.0467] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:41:37.0474] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:41:37.0482] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:41:37.0871] DEBUG: ports.py, SerialBuffer, read, read: 0, free space in serial buffer=230 [22:41:37.0882] DEBUG: ports.py, SerialBuffer, read, read: ., free space in serial buffer=231 [22:41:37.0895] DEBUG: ports.py, SerialBuffer, read, read: 8, free space in serial buffer=232 [22:41:37.0908] DEBUG: ports.py, SerialBuffer, read, read: 6, free space in serial buffer=233 [22:41:37.0923] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=234 [22:41:37.0936] DEBUG: ports.py, SerialBuffer, read, read: 0, free space in serial buffer=235 [22:41:37.0950] DEBUG: ports.py, SerialBuffer, read, read: 0, free space in serial buffer=236 [22:41:37.0963] DEBUG: ports.py, SerialBuffer, read, read: 0, free space in serial buffer=237 [22:41:37.0976] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=238 [22:41:37.0990] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=239 [22:41:38.0003] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=240 [22:41:38.0016] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=241 [22:41:38.0029] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=242 [22:41:38.0046] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=243 [22:41:38.0059] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=244 [22:41:38.0072] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=245 [22:41:38.0085] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:41:38.0099] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:41:38.0115] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:41:38.0128] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:41:38.0141] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:41:38.0154] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:41:38.0167] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:41:38.0180] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:41:38.0194] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:41:38.0207] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:41:38.0220] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:41:38.0226] DEBUG: ports.py, COMFile, read_raw, read: 0.863000\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:41:38.0230] DEBUG: ports.py, COMFile, write, writting string to COM port: \r [22:41:38.0230] DEBUG: ports.py, SerialStream, writting to socket: \r [22:41:38.0763] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:41:38.0763] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:41:38.0776] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:41:38.0789] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:41:38.0802] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:41:38.0815] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:41:38.0828] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:41:38.0844] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:41:38.0858] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:41:38.0871] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:41:38.0884] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:41:38.0898] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:41:38.0911] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:41:38.0918] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:41:38.0924] DEBUG: ports.py, COMFile, write, writting string to COM port: ?ANALOG.NOW[20]\r [22:41:38.0924] DEBUG: ports.py, SerialStream, writting to socket: ?ANALOG.NOW[20]\r [22:41:38.0992] DEBUG: ports.py, COMFile, write, writting string to COM port: ?TEMP[FAN]\r [22:41:38.0992] DEBUG: ports.py, SerialStream, writting to socket: ?TEMP[FAN]\r [22:41:39.0157] DEBUG: Serialwin32.py, read, read: 309\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:41:39.0157] DEBUG: ports.py, SerialStream, read from socket: 309\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:41:39.0157] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:41:39.0165] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:41:39.0173] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:41:39.0556] DEBUG: Serialwin32.py, read, read: 19.633333\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:41:39.0556] DEBUG: ports.py, SerialStream, read from socket: 19.633333\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> [22:41:39.0571] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=207 [22:41:39.0584] DEBUG: ports.py, SerialBuffer, read, read: 0, free space in serial buffer=208 [22:41:39.0596] DEBUG: ports.py, SerialBuffer, read, read: 9, free space in serial buffer=209 [22:41:39.0609] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=210 [22:41:39.0625] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=211 [22:41:39.0638] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=212 [22:41:39.0653] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=213 [22:41:39.0667] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=214 [22:41:39.0680] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=215 [22:41:39.0694] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=216 [22:41:39.0707] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=217 [22:41:39.0720] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=218 [22:41:39.0733] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=219 [22:41:39.0746] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=220 [22:41:39.0759] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=221 [22:41:39.0773] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=222 [22:41:39.0786] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=223 [22:41:39.0799] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=224 [22:41:39.0812] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=225 [22:41:39.0828] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=226 [22:41:39.0842] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=227 [22:41:39.0855] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=228 [22:41:39.0869] DEBUG: ports.py, SerialBuffer, read, read: 1, free space in serial buffer=229 [22:41:39.0884] DEBUG: ports.py, SerialBuffer, read, read: 9, free space in serial buffer=230 [22:41:39.0898] DEBUG: ports.py, SerialBuffer, read, read: ., free space in serial buffer=231 [22:41:39.0911] DEBUG: ports.py, SerialBuffer, read, read: 6, free space in serial buffer=232 [22:41:39.0926] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=233 [22:41:39.0940] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=234 [22:41:39.0954] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=235 [22:41:39.0967] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=236 [22:41:39.0982] DEBUG: ports.py, SerialBuffer, read, read: 3, free space in serial buffer=237 [22:41:39.0994] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=238 [22:41:40.0009] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=239 [22:41:40.0023] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=240 [22:41:40.0036] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=241 [22:41:40.0051] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=242 [22:41:40.0063] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=243 [22:41:40.0076] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=244 [22:41:40.0089] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=245 [22:41:40.0102] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:41:40.0117] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:41:40.0131] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:41:40.0144] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:41:40.0158] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:41:40.0171] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:41:40.0186] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:41:40.0198] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:41:40.0211] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:41:40.0224] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:41:40.0237] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:41:40.0244] DEBUG: ports.py, COMFile, read_raw, read: 309\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> 19.633333\r\n\x00\x00\x00\x00\x00\x00\r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:41:40.0285] INFO: files.py, open, loading file:d:\B31217.185 as file number1 [22:41:40.0286] INFO: files.py, open, loading file:d:\B31217.185 as file number1 [22:41:55.0358] DEBUG: ports.py, COMFile, write, writting string to COM port: M,4,256\r [22:41:55.0358] DEBUG: ports.py, SerialStream, writting to socket: M,4,256\r [22:42:53.0727] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:42:53.0727] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:42:53.0727] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:42:53.0734] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:42:53.0742] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:42:54.0124] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:42:54.0138] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:42:54.0151] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:42:54.0164] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:42:54.0177] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:42:54.0191] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:42:54.0203] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:42:54.0217] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:42:54.0230] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:42:54.0244] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:42:54.0259] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:42:54.0265] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:42:54.0270] DEBUG: ports.py, COMFile, write, writting string to COM port: \r [22:42:54.0270] DEBUG: ports.py, SerialStream, writting to socket: \r [22:42:54.0757] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:42:54.0757] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:42:54.0770] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:42:54.0783] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:42:54.0798] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:42:54.0811] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:42:54.0825] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:42:54.0838] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:42:54.0852] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:42:54.0865] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:42:54.0880] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:42:54.0894] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:42:54.0908] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:42:54.0915] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:42:54.0926] DEBUG: ports.py, COMFile, write, writting string to COM port: M,5,0\r [22:42:54.0926] DEBUG: ports.py, SerialStream, writting to socket: M,5,0\r [22:42:54.0977] DEBUG: ports.py, COMFile, write, writting string to COM port: M,3, 250\r [22:42:54.0977] DEBUG: ports.py, SerialStream, writting to socket: M,3, 250\r [22:42:55.0141] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:42:55.0141] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:42:55.0141] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:42:55.0148] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:42:55.0155] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:42:55.0559] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:42:55.0559] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:42:55.0575] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=235 [22:42:55.0588] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=236 [22:42:55.0604] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=237 [22:42:55.0615] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=238 [22:42:55.0628] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=239 [22:42:55.0641] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=240 [22:42:55.0654] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=241 [22:42:55.0668] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=242 [22:42:55.0681] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=243 [22:42:55.0697] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=244 [22:42:55.0710] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=245 [22:42:55.0726] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:42:55.0739] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:42:55.0753] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:42:55.0767] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:42:55.0782] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:42:55.0796] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:42:55.0809] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:42:55.0822] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:42:55.0836] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:42:55.0851] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:42:55.0865] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:42:55.0872] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer=256 [22:43:10.0904] DEBUG: ports.py, COMFile, write, writting string to COM port: M,1,0\r [22:43:10.0904] DEBUG: ports.py, SerialStream, writting to socket: M,1,0\r [22:44:09.0276] DEBUG: Serialwin32.py, read, read: \r\n\x00\x00\x00\x00\x00\x00-> [22:44:09.0276] DEBUG: ports.py, SerialStream, read from socket: \r\n\x00\x00\x00\x00\x00\x00-> [22:44:09.0276] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:44:09.0282] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:44:09.0289] DEBUG: events.py, ComHandler, check, triggering COM port event by char_waiting. [22:44:09.0726] DEBUG: ports.py, SerialBuffer, read, read: \r, free space in serial buffer=246 [22:44:09.0737] DEBUG: ports.py, SerialBuffer, read, read: \n, free space in serial buffer=247 [22:44:09.0750] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=248 [22:44:09.0765] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=249 [22:44:09.0779] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=250 [22:44:09.0792] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=251 [22:44:09.0805] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=252 [22:44:09.0818] DEBUG: ports.py, SerialBuffer, read, read: \x00, free space in serial buffer=253 [22:44:09.0831] DEBUG: ports.py, SerialBuffer, read, read: -, free space in serial buffer=254 [22:44:09.0845] DEBUG: ports.py, SerialBuffer, read, read: >, free space in serial buffer=255 [22:44:09.0858] DEBUG: ports.py, SerialBuffer, read, read: , free space in serial buffer=256 [22:44:09.0865] DEBUG: ports.py, COMFile, read_raw, read: \r\n\x00\x00\x00\x00\x00\x00-> , space in COMFile buffer

robhagemans commented 6 years ago

Hi @Danitegue Thanks for the comments and setting up the test. It seems e-mail attachments are thrown away by Github - could you post them through the web interface? (link: https://github.com/Danitegue/PCBasic_Brewer_Repo/issues/1) I think they would be useful for me to have, in particular the B31217.185 output file.

While I couldn't quite reproduce the problem before, I do see that the next_char buffer could cause a problem - it doesn't make sense for real-time communications to hold one character back. It was set up that way to support INPUT's behaviour, and INPUT# on text files, where reading ahead causes no harm.

I need to think about how best to fix it; INPUT# has quite strange behaviour in corner cases but it's been well tested, so I'm fairly confident that bit of code is reasonably correct. The question is if/how it can be reproduced without using blocking read-ahead and without keeping two slightly different versions of INPUT code around for text files and serial ports - it seems GW-BASIC wouldn't waste precious bytes on having two slightly different input algorithms, so I'd expect them to be the same at some level.

Simply making next_char take the place of char may fix the issue for now, but it's not quite consistent with how the text-file and com-file classes were set up, so I'll give it some thought. It's possible that this is why the new code incorrectly returns an extra 0 as the first output - perhaps INPUT# is reading some whitespace that it should have skipped, then converting it to a number.

As a bit of background, the weird behaviour of WIDTH and INPUT are major reasons why the devices/files code is so maddeningly messy :)

Not sure about the 1-second delay, it could be a number of things. From the log you post it looks as if the delay is not between the character arriving and the event trigger, but between the event trigger and a call to read_raw. I would guess the read_raw follows from an INPUT# in an event handling subroutine; it would be useful to know what the program code is doing between these two log lines (e.g. using `--debug -e='_trace' which'll show the line numbers being accessed).

I'll see if I can reproduce, but it'll take a bit of time - serial communications are difficult to debug!

Danitegue commented 6 years ago

Hi @robhagemans, here the files attached from github web:

Test20180118.zip

I will test the --debug -e'_trace' options along this weekend.

Regards

robhagemans commented 6 years ago

What seems to cause the extra 0 is that the response to ?MOTOR.CLASS[2], whch is given by this line:

answer = ['TRACKERMOTOR']+deepcopy(brewer_something)+['wait0.5']+deepcopy(brewer_none)

is taken by the program to be two separate responses, with the bit after wait0.5 taken to be a zero response to the next command. All commands after that then read the response to the previous command as theirs.

I don't know why this happens yet, though.

robhagemans commented 6 years ago

I've now also managed a DOSBox setup and can see that it works correctly there. Making progress...

Meanwhile, I've checked in changes to the serial ports code to ensure it doesn't try to read ahead. Apologies for the many moves and name changes, but this code is driving me mad (what on Earth was I thinking? ;)

Danitegue commented 6 years ago

In the BrewerSimulator:

The contents of the list "answer = ['TRACKERMOTOR']+deepcopy( brewer_something)+['wait0.5']+deepcopy(brewer_none)", are:

['TRACKERMOTOR', '\n', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\n', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '->', ' ', 'flush', 'wait0.5', '\n', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '->', ' ', 'flush']

The simulator sends every part of the answer through the COM port in a for loop.

But the "wait" and "flush" commands are only BrewerSimulator features, bor being able to control the transmission of the answer into the COM port: when to flush, and when to stop a little bit before sending the next elements of the answer. They are not really sent to the com port:

if gotkey: log=str(datetime.datetime.now())+ ' - Writting to com port:'+ str(answer) print log logging.info('Writting to COM port:'+ str(answer)) for a in answer: if 'wait' in a: time.sleep(float(a.split('wait')[1])) elif 'flush' in a: sio.flush() print "All data written. Out waiting=", sw.out_waiting else: sio.write(unicode(a))

I have done debug in the line time.sleep(float(a.split('wait')[1])), and for me it not parsing it bad,

the next element sent after this wait it is the '\n', not any 0. Is it happening to you?

2018-01-20 12:15 GMT+00:00 Rob Hagemans notifications@github.com:

What seems to cause the extra 0 is that the response to ?MOTOR.CLASS[2], whis is given by this line:

answer = ['TRACKERMOTOR']+deepcopy(brewer_something)+['wait0.5']+deepcopy(brewer_none)

is taken by the program to be two separate responses, with the bit after wait0.5 taken to be a zero response to the next command; all commands after that then read the response to the previous command as theirs.

I don't know why this happens yet, though.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Danitegue/PCBasic_Brewer_Repo/issues/1#issuecomment-359167217, or mute the thread https://github.com/notifications/unsubscribe-auth/AYutGA7TBvYE_RxU64hRPvekqH9skpPSks5tMdjfgaJpZM4RdKub .

--

Daniel Santana Díaz, Danitegue@gmail.com

robhagemans commented 6 years ago

It sends the correct sequence '\r\n' '\x00' '\x00' '\x00' '\x00' '\x00' '\x00' '->' ' ' after the wait. What I mean is that the BASIC program somehow considers this as the answer to the next command (its VAL is 0), and then all answers are shifted by one.

It's quite baffling, as I've studied the communication between the simulator and PC-BASIC vs DosBox quite closely and as far as I can see they are identical - the same strings are sent and received and even the timings are similar. So I don't understand why the programs run differently.

robhagemans commented 6 years ago

I added some logging to the BASIC file so I could compare what happens in dosbox with what happens in PC-BASIC. See attached, it may clarify what I mean by the answers being shifted. In both cases the BrewerSimulator's behaviour was identical.

Log files: LOGLOG-dosbox.txt LOGLOG-pcbasic.txt

Modified program: main.txt

Note that after B,0 the program reads 22 bytes in DosBox, and returns a value of 0. In PC-BASIC it reads only 11 bytes and returns a value of 0. The other 11 bytes are only read after B,2, again with a value of 0.

robhagemans commented 6 years ago

Some progress: the issue seems to be that the serial buffer does not get filled when no reads are being doen and the ON COM event checker is off. This then means that the data is not available to read when the event is being triggered. Increasing the frequency for the serial buffer to be updated seems to lead to the 0 disappearing.

Danitegue commented 6 years ago

Oh, very interesting....both should give the same output file...

In other hand, I have compared the answers that BrewerSimulator is giving, respect the answers that the instrument gave me in the last test on the field, using pcbasic_brewer (Attached a shortened file, here if you look for "Serialwin32_brewer.py read" you will see all the answers given by the instrument).

pcbasic_brewer_log_izotest20180110 (clean).zip

I noticed that the correct answer for the '?MOTOR.CLASS[2]' question is not answer = ['TRACKERMOTOR']+deepcopy(brewer_something)+['wait0.5']+deepcopy(brewer_none)

is: answer = ['TRACKERMOTOR'] + deepcopy(brewer_something)

I added the second part of this answer afterwards, because when running the main.asc with gwbasic it does not delay too much to have the program loaded. But when running with any of the pcbasic versions, the screen is stuck around 20 seconds in the "merging da_lo.rtn" stage, and if you see in the top right corner of the screen there are two words : "in: " and "out: ". An asterisk is added there when any COM communication is received or sent. When it keeps in the "merging da_lo.rtn", appears a long "in: *", which means that the software is waiting for something from the com port. When adding this second part to the answer, there is no waiting here... But obviously, now I think that the dalay is more related to the delays of the read_raw, than something missing in the answer.

Also other thing I could see in the simulator:

in the latest improvements to the hp routine answers, I noticed that the keyword 'M,9, 10' and 'M,9, 100' can be confused in the in line statement. So I changed the keywords to 'M,9, 10;' and 'M,9, 100;'

But this is not solving that 0 received in the middle of a hp... now I have:

hpscan 18:24:47

0 66347 10 0 -> It shouldnt happen! 20 96514 30 127847 40 159928

I have corrected these answers and pushed the new Simulator to the repo just now. I will wait for your commit in the ON COM event, to test the pdhp routine. This is close to be solved!

The next day on the field, I will test your modified main.asc with the instrument connected.

Danitegue commented 6 years ago

I tried to add the --debug -e='_trace' to the launcher, to see what is the program doing, but I couldn't see nothing different in the log.

Where should I use these arguments, as extra arguments in the .BAT launcher?

robhagemans commented 6 years ago

-e='_trace' is a command-line argument, you can add it to the ones you already have in the launcher or you can add a line to the config file - you'd have to use the long form and no quotes:

[pcbasic]
debug=True
exec=_trace

This just calls the _TRACE extension statement that is enabled (among others) by --debug. It should log the program's line numbers as they are being executed

robhagemans commented 6 years ago

I've committed an updated version, by the way, which seems to produce the correct behaviour.

I don't quite understand yet why this works, to be honest, but it has to do with how the Com event is handled.

robhagemans commented 6 years ago

I checked and it also now works with the correct Simulator reply as per your message.

Let me know if it works on your side as well - I'm going to do some further code cleaning on the devices code...

Danitegue commented 6 years ago

Ok, I've some problems with the last modifications... the program launchs but inmediately I have a Bad file number in 9429...

9425 ON COM(CP%) GOSUB 9300:COM(CP%) ON 9429 O$=O1$+CR$:PRINT#7,O$;

I also tried to re-clone your latest master, and then merge the changes of the topic-serial, but still with the same problem.

The problem seems to be in:

ports.py, init,

self.stream = SerialStream(val, self.input_methods, do_open=False)

then in SerialStream, init:

def __init__(self, port, input_methods, do_open):
    """Initialise the stream."""
    self._serial = serial.serial_for_url(port, timeout=0, do_not_open=not do_open)
    # monkey-patch serial object as SocketSerial does not have this property
    if not hasattr(self._serial, 'out_waiting'):  -> Here it breaks*
        self._serial.out_waiting = 0 
    # for wait()
    self._input_methods = input_methods
    self._url = port
    self.is_open = False

*{AttributeError}'SerialStream' object has no attribute '_serial'

Danitegue commented 6 years ago

No sorry, is the next line what cannot be executed

self._serial.out_waiting = 0

because of a can't set attribute:

image

Danitegue commented 6 years ago

by just commenting both lines,

if not hasattr(self._serial, 'out_waiting'):

    #    self._serial.out_waiting = 0

I could make it work properly.

The program has a fluid communication with the simulator now, and the results of the hp are the same as the hp reference.

I will test the next week with the instrument connected. Very pleased with the today progress! Thanks a lot!

Danitegue commented 6 years ago

Also the baddata problem that the hg routine gave me in the past, is not happening now. This looks very good!

robhagemans commented 6 years ago

Great - there are still a lot of problems, I think INPUT# doesn't work at all at the moment in this version, but it's a good start...