RomChip200 wrote:Matt, I think I know why Consult gets wrong over BT. I just remembered each time you open the corresponding COM port, the BT converter sends out an ASCII string to give info related to version (don't remember the exact string). I noticed that using LookRS232 and opening manually COM4 (BT).
I suppose it screws up Consult input stream in Nistune ...
I suppose other Consult programs don't care about this ASCII bytes input ...
Maybe you send FF FF EF too quickly in Nistune and input stream got corrupted.
Maybe you need to wait more after having opened the BT COM (to let it send its ASCII string ...)
Maybe you should perform 5 attempts .... emptying the COM input FIFO each time ...
Btw, here is a log (by chance, the first connection to COnsult over BT is successful !!, all other following attempts fail), you will notice the different bytes in RX:
nistune-0606-1850.log
Well, well, well, what is written above is not 100% exact.
In BT rs232 converters, there's a feature called "Command response":
Parani-SD has 4 response messages, ‘OK’, ‘ERROR’, ‘CONNECT’, and ‘DISCONNECT’. In some
cases, these responses can affect the host system unexpectedly. To prevent this, user can set the
Command response to ON or OFF.
When you establish BT connection (typically when BT COM port is opened, as BT connection is suspended after a while if COM port is not used ... I suppose for power saving ...), you get an ASCII message on the rs232 side (it may screw up many devices ....)
Here is the dump when connecting:
Code: Select all
0038.266<39 32 34 39 0D 0A
0038.266<30 30 32 34 37 45 41 44
0038.203<43 4F 4E 4E 45 43 54 20
0038.187<0D 0A
0038.172|Signal changed: RLSD(CD):ON
0025.891<43 54 0D 0A
0025.891<44 49 53 43 4F 4E 4E 45
0025.859<0D 0A
0025.828|Signal changed: RLSD(CD):OFF
0000.000|Signal changed: CTS:ON,RLSD(CD):ON
0000.000|Serial port 'COM1' was successfully opened with selected settings
0000.000|Serial port 'COM1' is accessible for using
that means in ASCII
Since, I disabled the "command response" and will check tonight if it really works now.
But what is sure is Nistune performs COM operations very fast. If you introduce delay between "open the port" (that establishes BT connection seamlessly) and "sending FF FF EF D0 F0", it should work better with COnsult.
Here is the sequence of NissanDataScan over BT COM4 (it works each time !), it sends FF FF EF D0 and then, F0:
Code: Select all
1.02515068 Nissan DataScan IRP_MJ_CREATE BtPort0 SUCCESS Options: Open
0.00000670 Nissan DataScan IOCTL_SERIAL_SET_WAIT_MASK BtPort0 SUCCESS Mask: RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
0.00000196 Nissan DataScan IOCTL_SERIAL_SET_QUEUE_SIZE BtPort0 SUCCESS InSize: 2048 OutSize: 512
0.00002067 Nissan DataScan IOCTL_SERIAL_PURGE BtPort0 SUCCESS Purge: TXABORT RXABORT TXCLEAR RXCLEAR
0.00000223 Nissan DataScan IOCTL_SERIAL_SET_TIMEOUTS BtPort0 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:5000
0.00000279 Nissan DataScan IOCTL_SERIAL_GET_BAUD_RATE BtPort0 SUCCESS
0.00000223 Nissan DataScan IOCTL_SERIAL_GET_LINE_CONTROL BtPort0 SUCCESS
0.00000223 Nissan DataScan IOCTL_SERIAL_GET_CHARS BtPort0 SUCCESS
0.00000391 Nissan DataScan IOCTL_SERIAL_SET_WAIT_MASK BtPort0 SUCCESS Mask: RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
0.00000279 Nissan DataScan IOCTL_SERIAL_GET_HANDFLOW BtPort0 SUCCESS
0.00000196 Nissan DataScan IOCTL_SERIAL_GET_BAUD_RATE BtPort0 SUCCESS
0.00000335 Nissan DataScan IOCTL_SERIAL_SET_WAIT_MASK BtPort0 SUCCESS Mask: RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
0.00000223 Nissan DataScan IOCTL_SERIAL_GET_LINE_CONTROL BtPort0 SUCCESS
0.02058809 Nissan DataScan IOCTL_SERIAL_WAIT_ON_MASK BtPort0 SUCCESS
0.00000223 Nissan DataScan IOCTL_SERIAL_GET_CHARS BtPort0 SUCCESS
0.00000223 Nissan DataScan IOCTL_SERIAL_GET_HANDFLOW BtPort0 SUCCESS
0.00001062 Nissan DataScan IOCTL_SERIAL_SET_BAUD_RATE BtPort0 SUCCESS Rate: 9600
0.00007683 Nissan DataScan IOCTL_SERIAL_CLR_RTS BtPort0 SUCCESS
0.00001285 Nissan DataScan IOCTL_SERIAL_CLR_DTR BtPort0 SUCCESS
0.00000223 Nissan DataScan IOCTL_SERIAL_SET_LINE_CONTROL BtPort0 SUCCESS StopBits: 1 Parity: NONE WordLength: 8
0.00000670 Nissan DataScan IOCTL_SERIAL_SET_CHAR BtPort0 SUCCESS EOF:1a ERR:0 BRK:0 EVT:0 XON:11 XOFF:13
0.00001229 Nissan DataScan IOCTL_SERIAL_SET_HANDFLOW BtPort0 SUCCESS Shake:0 Replace:0 XonLimit:512 XoffLimit:512
0.00000587 Nissan DataScan IOCTL_SERIAL_GET_COMMSTATUS BtPort0 SUCCESS
0.01893481 Nissan DataScan IRP_MJ_WRITE BtPort0 SUCCESS Length 4: FF FF EF D0
0.00000754 Nissan DataScan IOCTL_SERIAL_GET_COMMSTATUS BtPort0 SUCCESS
0.00000447 Nissan DataScan IOCTL_SERIAL_SET_WAIT_MASK BtPort0 SUCCESS Mask: RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
0.01991063 Nissan DataScan IOCTL_SERIAL_WAIT_ON_MASK BtPort0 SUCCESS
0.00000559 Nissan DataScan IOCTL_SERIAL_GET_COMMSTATUS BtPort0 SUCCESS
0.00001704 Nissan DataScan IOCTL_SERIAL_PURGE BtPort0 SUCCESS Purge: RXABORT RXCLEAR
0.00000475 Nissan DataScan IOCTL_SERIAL_GET_COMMSTATUS BtPort0 SUCCESS
0.00000447 Nissan DataScan IOCTL_SERIAL_GET_COMMSTATUS BtPort0 SUCCESS
0.00000196 Nissan DataScan IOCTL_SERIAL_GET_PROPERTIES BtPort0 SUCCESS
0.00008213 Nissan DataScan IRP_MJ_WRITE BtPort0 SUCCESS Length 1: F0
0.00000419 Nissan DataScan IOCTL_SERIAL_GET_COMMSTATUS BtPort0 SUCCESS
0.00000447 Nissan DataScan IOCTL_SERIAL_SET_WAIT_MASK BtPort0 SUCCESS Mask: RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
0.00000447 Nissan DataScan IOCTL_SERIAL_GET_COMMSTATUS BtPort0 SUCCESS
0.49397759 Nissan DataScan IOCTL_SERIAL_WAIT_ON_MASK BtPort0 SUCCESS
0.00000670 Nissan DataScan IOCTL_SERIAL_SET_WAIT_MASK BtPort0 SUCCESS Mask: RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
0.00000000 Nissan DataScan IOCTL_SERIAL_WAIT_ON_MASK BtPort0
0.00000754 Nissan DataScan IOCTL_SERIAL_GET_COMMSTATUS BtPort0 SUCCESS
Now, with Nistune, opening configuration panel (scanning the COM4 BT port):
Code: Select all
0.46496496 Nistune.exe IRP_MJ_CREATE BtPort0 SUCCESS Options: Open
0.00000223 Nistune.exe IOCTL_SERIAL_GET_BAUD_RATE BtPort0 SUCCESS
0.00000140 Nistune.exe IOCTL_SERIAL_GET_LINE_CONTROL BtPort0 SUCCESS
0.00000140 Nistune.exe IOCTL_SERIAL_GET_CHARS BtPort0 SUCCESS
0.00000140 Nistune.exe IOCTL_SERIAL_GET_HANDFLOW BtPort0 SUCCESS
0.00000140 Nistune.exe IOCTL_SERIAL_CONFIG_SIZE BtPort0 SUCCESS Size: 0
0.00000112 Nistune.exe IOCTL_SERIAL_GET_BAUD_RATE BtPort0 SUCCESS
0.00000112 Nistune.exe IOCTL_SERIAL_GET_LINE_CONTROL BtPort0 SUCCESS
0.00000112 Nistune.exe IOCTL_SERIAL_GET_CHARS BtPort0 SUCCESS
0.00000140 Nistune.exe IOCTL_SERIAL_GET_HANDFLOW BtPort0 SUCCESS
0.00000140 Nistune.exe IOCTL_SERIAL_SET_QUEUE_SIZE BtPort0 SUCCESS InSize: 4096 OutSize: 4096
0.00000140 Nistune.exe IOCTL_SERIAL_GET_BAUD_RATE BtPort0 SUCCESS
0.00000112 Nistune.exe IOCTL_SERIAL_GET_LINE_CONTROL BtPort0 SUCCESS
0.00000140 Nistune.exe IOCTL_SERIAL_GET_CHARS BtPort0 SUCCESS
0.00000112 Nistune.exe IOCTL_SERIAL_GET_HANDFLOW BtPort0 SUCCESS
0.00000726 Nistune.exe IOCTL_SERIAL_SET_BAUD_RATE BtPort0 SUCCESS Rate: 19200
0.00000335 Nistune.exe IOCTL_SERIAL_SET_RTS BtPort0 SUCCESS
0.00000475 Nistune.exe IOCTL_SERIAL_CLR_DTR BtPort0 SUCCESS
0.00000140 Nistune.exe IOCTL_SERIAL_SET_LINE_CONTROL BtPort0 SUCCESS StopBits: 1 Parity: NONE WordLength: 8
0.00000279 Nistune.exe IOCTL_SERIAL_SET_CHAR BtPort0 SUCCESS EOF:1a ERR:0 BRK:0 EVT:0 XON:11 XOFF:13
0.00000251 Nistune.exe IOCTL_SERIAL_SET_HANDFLOW BtPort0 SUCCESS Shake:0 Replace:40 XonLimit:8192 XoffLimit:2048
0.00000140 Nistune.exe IOCTL_SERIAL_GET_TIMEOUTS BtPort0 SUCCESS
0.00000140 Nistune.exe IOCTL_SERIAL_SET_TIMEOUTS BtPort0 SUCCESS RI:-1 RM:1 RC:10 WM:-1 WC:-1
0.00000251 Nistune.exe IRP_MJ_CLEANUP BtPort0 SUCCESS
0.00001453 Nistune.exe IRP_MJ_CLOSE BtPort0 SUCCESS
With Nistune, trying to connect to Consult:
Code: Select all
0.72421048 Nistune.exe IRP_MJ_CREATE BtPort0 SUCCESS Options: Open
0.00000475 Nistune.exe IOCTL_SERIAL_GET_BAUD_RATE BtPort0 SUCCESS
0.00000223 Nistune.exe IOCTL_SERIAL_GET_LINE_CONTROL BtPort0 SUCCESS
0.00000223 Nistune.exe IOCTL_SERIAL_GET_CHARS BtPort0 SUCCESS
0.00000196 Nistune.exe IOCTL_SERIAL_GET_HANDFLOW BtPort0 SUCCESS
0.00000363 Nistune.exe IOCTL_SERIAL_GET_BAUD_RATE BtPort0 SUCCESS
0.00000223 Nistune.exe IOCTL_SERIAL_GET_LINE_CONTROL BtPort0 SUCCESS
0.00000223 Nistune.exe IOCTL_SERIAL_GET_CHARS BtPort0 SUCCESS
0.00000196 Nistune.exe IOCTL_SERIAL_GET_HANDFLOW BtPort0 SUCCESS
0.00001425 Nistune.exe IOCTL_SERIAL_SET_BAUD_RATE BtPort0 SUCCESS Rate: 9600
0.00000726 Nistune.exe IOCTL_SERIAL_SET_RTS BtPort0 SUCCESS
0.00000643 Nistune.exe IOCTL_SERIAL_SET_DTR BtPort0 SUCCESS
0.00000223 Nistune.exe IOCTL_SERIAL_SET_LINE_CONTROL BtPort0 SUCCESS StopBits: 1 Parity: NONE WordLength: 8
0.00000670 Nistune.exe IOCTL_SERIAL_SET_CHAR BtPort0 SUCCESS EOF:1a ERR:0 BRK:0 EVT:0 XON:11 XOFF:13
0.00000643 Nistune.exe IOCTL_SERIAL_SET_HANDFLOW BtPort0 SUCCESS Shake:1 Replace:40 XonLimit:8192 XoffLimit:2048
0.00000419 Nistune.exe IOCTL_SERIAL_SET_WAIT_MASK BtPort0 SUCCESS Mask: BRK ERR
0.00000251 Nistune.exe IOCTL_SERIAL_SET_QUEUE_SIZE BtPort0 SUCCESS InSize: 4096 OutSize: 4096
0.00000251 Nistune.exe IOCTL_SERIAL_SET_TIMEOUTS BtPort0 SUCCESS RI:20 RM:10 RC:100 WM:0 WC:0
0.03874571 Nistune.exe IRP_MJ_WRITE BtPort0 SUCCESS Length 1: 30
0.00001201 Nistune.exe IOCTL_SERIAL_GET_COMMSTATUS BtPort0 SUCCESS
0.00009917 Nistune.exe IRP_MJ_WRITE BtPort0 SUCCESS Length 3: FF FF EF
0.00000670 Nistune.exe IOCTL_SERIAL_GET_COMMSTATUS BtPort0 SUCCESS
0.39612660 Nistune.exe IOCTL_SERIAL_WAIT_ON_MASK BtPort0 CANCELLED
0.00000615 Nistune.exe IOCTL_SERIAL_GET_COMMSTATUS BtPort0 SUCCESS
0.12990981 Nistune.exe IRP_MJ_READ BtPort0 TIMEOUT Length 0:
0.00001062 Nistune.exe IOCTL_SERIAL_GET_COMMSTATUS BtPort0 SUCCESS
0.13107644 Nistune.exe IRP_MJ_READ BtPort0 TIMEOUT Length 0:
0.00001117 Nistune.exe IOCTL_SERIAL_GET_COMMSTATUS BtPort0 SUCCESS
0.13073589 Nistune.exe IRP_MJ_READ BtPort0 TIMEOUT Length 0:
0.00000587 Nistune.exe IOCTL_SERIAL_SET_WAIT_MASK BtPort0 SUCCESS Mask:
0.00009275 Nistune.exe IOCTL_SERIAL_CLR_DTR BtPort0 SUCCESS
0.00001509 Nistune.exe IOCTL_SERIAL_PURGE BtPort0 SUCCESS Purge: TXABORT RXABORT TXCLEAR RXCLEAR
0.00000475 Nistune.exe IRP_MJ_CLEANUP BtPort0 SUCCESS
0.00004218 Nistune.exe IRP_MJ_CLOSE BtPort0 SUCCESS
Nistune opens the COM port with
InSize: 4096 OutSize: 4096 buffers. I don't know how the BT converter behaves with that (it has internal buffer too ... but I don't use hw flow control, using flow control on COnsult side is no sense, RTS/CTS are not handled):
When hardware flow control is not being used, the Parani-SD clears the buffer to secure room for the
next data when the buffer becomes full. This can mean a loss of data may occur. As the transmission
data becomes large, the possibility of data loss becomes greater.
On the other hand, NissanDataScan specifies
InSize: 2048 OutSize: 512
Moreover, I noticed some delay when opening a BT COM port between the opening of the port and the control lines state being updated (roughly 1 second):
Code: Select all
0005.203|Signal changed: CTS:OFF
0004.297|Signal changed: CTS:ON,DSR:ON,RLSD(CD):ON
0004.266|Serial port 'COM4' was successfully opened with selected settings
0004.266|Serial port 'COM4' is accessible for using