Thanks Grant,
Can you verify that the device is actually responding by
watching the data line with an oscilloscope?
I don't have an oscilloscope but the device does respond (LED blinks)
when I send it a test command (44H).
I take it that means that other programs are able to read from
the device?
Yes, the device comes with a little GUI program to read the logged
temperatures, calibrate, etc... Works fine, but I would like to read
distributed loggers over the network with python and sockets.
Logs of the serial traffic would be helpful.
Here they are. First a log of the traffic generated by the T-logger GUI
program, abtained with Portmon.
### TRAFFIC WHEN THE PROGRAM IS LAUNCHED:
0 0.00000000 TLogger.exe IRP_MJ_CREATE Serial0 Options: Open
0 0.00006174 SUCCESS
1 0.00000000 TLogger.exe IOCTL_SERIAL_SET_WAIT_MASK Serial0 Mask:
RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
1 0.00000726 SUCCESS
2 0.00000000 TLogger.exe IOCTL_SERIAL_PURGE Serial0 Purge: TXABORT
RXABORT TXCLEAR RXCLEAR
2 0.00000698 SUCCESS
3 0.00000000 TLogger.exe IOCTL_SERIAL_SET_TIMEOUTS Serial0 RI:-1
RM:0 RC:0 WM:0 WC:5000
3 0.00000168 SUCCESS
4 0.00000000 TLogger.exe IOCTL_SERIAL_GET_BAUD_RATE Serial0
4 0.00000279 SUCCESS
5 0.00000000 TLogger.exe IOCTL_SERIAL_GET_LINE_CONTROL Serial0
5 0.00000196 SUCCESS
6 0.00000000 TLogger.exe IOCTL_SERIAL_GET_CHARS Serial0
6 0.00000223 SUCCESS
7 0.00000000 TLogger.exe IOCTL_SERIAL_GET_HANDFLOW Serial0
7 0.00000196 SUCCESS
8 0.00000000 TLogger.exe IOCTL_SERIAL_GET_BAUD_RATE Serial0
8 0.00000196 SUCCESS
9 0.00000000 TLogger.exe IOCTL_SERIAL_GET_LINE_CONTROL Serial0
9 0.00000168 SUCCESS
10 0.00000000 TLogger.exe IOCTL_SERIAL_GET_CHARS Serial0
10 0.00000168 SUCCESS
11 0.00000000 TLogger.exe IOCTL_SERIAL_GET_HANDFLOW Serial0
11 0.00000168 SUCCESS
12 0.00000000 TLogger.exe IOCTL_SERIAL_SET_BAUD_RATE Serial0 Rate:
9600
12 0.00001285 SUCCESS
13 0.00000000 TLogger.exe IOCTL_SERIAL_CLR_RTS Serial0
13 0.00000782 SUCCESS
14 0.00000000 TLogger.exe IOCTL_SERIAL_SET_DTR Serial0
14 0.00000810 SUCCESS
15 0.00000000 TLogger.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial0
StopBits: ERROR Parity: NONE WordLength: 8
15 0.00000698 SUCCESS
16 0.00000000 TLogger.exe IOCTL_SERIAL_SET_CHAR Serial0 EOF:1a
ERR:0 BRK:0 EVT:0 XON:11 XOFF:13
16 0.00000531 SUCCESS
17 0.00000000 TLogger.exe IOCTL_SERIAL_SET_HANDFLOW Serial0
Shake:1 Replace:0 XonLimit:8 XoffLimit:8
17 0.00000754 SUCCESS
18 0.00000000 TLogger.exe IOCTL_SERIAL_SET_WAIT_MASK Serial0 Mask:
RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
18 0.00001145 SUCCESS
19 0.00000000 TLogger.exe IOCTL_SERIAL_SET_WAIT_MASK Serial0 Mask:
RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
19 0.00000531 SUCCESS
20 0.00000000 TLogger.exe IOCTL_SERIAL_WAIT_ON_MASK Serial0
### TRAFFIC WHEN THE PROGRAM READS CURRENT TEMP FROM DEVICE:
21 0.00000000 TLogger.exe IOCTL_SERIAL_GET_COMMSTATUS Serial0
21 0.00001034 SUCCESS
22 0.00000000 TLogger.exe IRP_MJ_WRITE Serial0 Length 1: 33
22 0.00003269 SUCCESS
20 9.28649032 SUCCESS
23 0.00000000 TLogger.exe IOCTL_SERIAL_GET_COMMSTATUS Serial0
23 0.00000587 SUCCESS
24 0.00000000 TLogger.exe IOCTL_SERIAL_GET_COMMSTATUS Serial0
24 0.00000559 SUCCESS
25 0.00000000 TLogger.exe IOCTL_SERIAL_GET_PROPERTIES Serial0
25 0.00000168 SUCCESS
26 0.00000000 TLogger.exe IRP_MJ_WRITE Serial0 Length 1: 00
27 0.00000000 TLogger.exe IOCTL_SERIAL_SET_WAIT_MASK Serial0 Mask:
RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
27 0.00000726 SUCCESS
28 0.00000000 TLogger.exe IOCTL_SERIAL_WAIT_ON_MASK Serial0
26 0.00107611 SUCCESS
28 0.00097666 SUCCESS
29 0.00000000 TLogger.exe IOCTL_SERIAL_GET_COMMSTATUS Serial0
29 0.00000587 SUCCESS
30 0.00000000 TLogger.exe IOCTL_SERIAL_GET_COMMSTATUS Serial0
30 0.00000503 SUCCESS
31 0.00000000 TLogger.exe IOCTL_SERIAL_GET_PROPERTIES Serial0
31 0.00000196 SUCCESS
32 0.00000000 TLogger.exe IRP_MJ_WRITE Serial0 Length 1: 00
33 0.00000000 TLogger.exe IOCTL_SERIAL_SET_WAIT_MASK Serial0 Mask:
RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
33 0.00000531 SUCCESS
34 0.00000000 TLogger.exe IOCTL_SERIAL_WAIT_ON_MASK Serial0
32 0.00102583 SUCCESS
34 0.00098811 SUCCESS
35 0.00000000 TLogger.exe IOCTL_SERIAL_GET_COMMSTATUS Serial0
35 0.00000559 SUCCESS
36 0.00000000 TLogger.exe IOCTL_SERIAL_GET_COMMSTATUS Serial0
36 0.00000726 SUCCESS
37 0.00000000 TLogger.exe IOCTL_SERIAL_GET_COMMSTATUS Serial0
37 0.00000559 SUCCESS
38 0.00000000 TLogger.exe IOCTL_SERIAL_SET_WAIT_MASK Serial0 Mask:
RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
38 0.00001173 SUCCESS
39 0.00000000 TLogger.exe IOCTL_SERIAL_WAIT_ON_MASK Serial0
39 0.00934281 SUCCESS
40 0.00000000 TLogger.exe IOCTL_SERIAL_SET_WAIT_MASK Serial0 Mask:
RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
40 0.00000922 SUCCESS
41 0.00000000 TLogger.exe IOCTL_SERIAL_WAIT_ON_MASK Serial0
41 0.00001034 SUCCESS
42 0.00000000 TLogger.exe IOCTL_SERIAL_SET_WAIT_MASK Serial0 Mask:
RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
42 0.00000531 SUCCESS
43 0.00000000 TLogger.exe IOCTL_SERIAL_WAIT_ON_MASK Serial0
43 0.00905059 SUCCESS
44 0.00000000 TLogger.exe IOCTL_SERIAL_SET_WAIT_MASK Serial0 Mask:
RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
44 0.00000782 SUCCESS
45 0.00000000 TLogger.exe IOCTL_SERIAL_WAIT_ON_MASK Serial0
45 0.00000978 SUCCESS
46 0.00000000 TLogger.exe IOCTL_SERIAL_SET_WAIT_MASK Serial0 Mask:
RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
46 0.00000531 SUCCESS
47 0.00000000 TLogger.exe IOCTL_SERIAL_WAIT_ON_MASK Serial0
47 0.00906735 SUCCESS
48 0.00000000 TLogger.exe IOCTL_SERIAL_SET_WAIT_MASK Serial0 Mask:
RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
48 0.00000838 SUCCESS
49 0.00000000 TLogger.exe IOCTL_SERIAL_WAIT_ON_MASK Serial0
49 0.00001006 SUCCESS
50 0.00000000 TLogger.exe IOCTL_SERIAL_SET_WAIT_MASK Serial0 Mask:
RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
50 0.00000531 SUCCESS
51 0.00000000 TLogger.exe IOCTL_SERIAL_WAIT_ON_MASK Serial0
51 0.00907238 SUCCESS
52 0.00000000 TLogger.exe IOCTL_SERIAL_SET_WAIT_MASK Serial0 Mask:
RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
52 0.00000978 SUCCESS
53 0.00000000 TLogger.exe IOCTL_SERIAL_WAIT_ON_MASK Serial0
53 0.00000950 SUCCESS
54 0.00000000 TLogger.exe IOCTL_SERIAL_SET_WAIT_MASK Serial0 Mask:
RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
54 0.00000531 SUCCESS
55 0.00000000 TLogger.exe IOCTL_SERIAL_WAIT_ON_MASK Serial0
55 0.00676706 SUCCESS
56 0.00000000 TLogger.exe IOCTL_SERIAL_SET_WAIT_MASK Serial0 Mask:
RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
56 0.00001006 SUCCESS
57 0.00000000 TLogger.exe IOCTL_SERIAL_WAIT_ON_MASK Serial0
57 0.00001006 SUCCESS
58 0.00000000 TLogger.exe IOCTL_SERIAL_SET_WAIT_MASK Serial0 Mask:
RXCHAR TXEMPTY CTS DSR RLSD BRK ERR RING
58 0.00000531 SUCCESS
59 0.00000000 TLogger.exe IOCTL_SERIAL_WAIT_ON_MASK Serial0
60 0.00000000 TLogger.exe IOCTL_SERIAL_GET_COMMSTATUS Serial0
60 0.00000978 SUCCESS
61 0.00000000 TLogger.exe IRP_MJ_READ Serial0 Length 1
61 0.00000978 SUCCESS Length 1: 26
62 0.00000000 TLogger.exe IOCTL_SERIAL_GET_COMMSTATUS Serial0
62 0.00000587 SUCCESS
63 0.00000000 TLogger.exe IRP_MJ_READ Serial0 Length 1
63 0.00000615 SUCCESS Length 1: 35
64 0.00000000 TLogger.exe IOCTL_SERIAL_GET_COMMSTATUS Serial0
64 0.00000531 SUCCESS
65 0.00000000 TLogger.exe IRP_MJ_READ Serial0 Length 1
65 0.00000559 SUCCESS Length 1: 14
66 0.00000000 TLogger.exe IOCTL_SERIAL_GET_COMMSTATUS Serial0
66 0.00000503 SUCCESS
67 0.00000000 TLogger.exe IRP_MJ_READ Serial0 Length 1
67 0.00000587 SUCCESS Length 1: 02
I'm cutting here but 32 bytes of data are acquired.
And here is the traffic when I'm using pyserial:
0 0.00006230 python.exe IRP_MJ_CREATE Serial0 SUCCESS Options: Open
1 0.00000363 python.exe IOCTL_SERIAL_SET_QUEUE_SIZE Serial0 SUCCESS InSize:
4096 OutSize: 4096
2 0.00000223 python.exe IOCTL_SERIAL_GET_TIMEOUTS Serial0 SUCCESS
3 0.00000251 python.exe IOCTL_SERIAL_SET_TIMEOUTS Serial0 SUCCESS RI:0
RM:0 RC:0 WM:0 WC:0
4 0.00000698 python.exe IOCTL_SERIAL_SET_WAIT_MASK Serial0 SUCCESS Mask:
ERR
5 0.00000223 python.exe IOCTL_SERIAL_GET_BAUD_RATE Serial0 SUCCESS
6 0.00000196 python.exe IOCTL_SERIAL_GET_LINE_CONTROL Serial0 SUCCESS
7 0.00000196 python.exe IOCTL_SERIAL_GET_CHARS Serial0 SUCCESS
8 0.00000168 python.exe IOCTL_SERIAL_GET_HANDFLOW Serial0 SUCCESS
9 0.00000196 python.exe IOCTL_SERIAL_GET_BAUD_RATE Serial0 SUCCESS
10 0.00000196 python.exe IOCTL_SERIAL_GET_LINE_CONTROL Serial0 SUCCESS
11 0.00000196 python.exe IOCTL_SERIAL_GET_CHARS Serial0 SUCCESS
12 0.00000168 python.exe IOCTL_SERIAL_GET_HANDFLOW Serial0 SUCCESS
13 0.00001285 python.exe IOCTL_SERIAL_SET_BAUD_RATE Serial0 SUCCESS Rate:
9600
14 0.00000810 python.exe IOCTL_SERIAL_SET_RTS Serial0 SUCCESS
15 0.00000810 python.exe IOCTL_SERIAL_SET_DTR Serial0 SUCCESS
16 0.00000698 python.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial0 SUCCESS StopBits:
1 Parity: NONE WordLength: 8
17 0.00000559 python.exe IOCTL_SERIAL_SET_CHAR Serial0 SUCCESS EOF:1a
ERR:0 BRK:0 EVT:0 XON:11 XOFF:13
18 0.00001062 python.exe IOCTL_SERIAL_SET_HANDFLOW Serial0 SUCCESS Shake:1
Replace:40 XonLimit:2048 XoffLimit:512
19 0.00000698 python.exe IOCTL_SERIAL_PURGE Serial0 SUCCESS Purge:
TXABORT RXABORT TXCLEAR RXCLEAR
20 0.00003716 python.exe IRP_MJ_WRITE Serial0 SUCCESS Length 1: 33
21 0.00003632 python.exe IRP_MJ_WRITE Serial0 SUCCESS Length 1: 00
22 0.00003632 python.exe IRP_MJ_WRITE Serial0 SUCCESS Length 1: 00
23 0.00001145 python.exe IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS
24 0.00000978 python.exe IRP_MJ_READ Serial0 SUCCESS Length 1: 00
25 0.00001062 python.exe IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS
26 32.01253595 python.exe IRP_MJ_READ Serial0 CANCELLED Length 1
alex