Bad HCI Event : Number of Completed Packets - bluetooth-lowenergy
I am trying to run a BLE server that transmits around 35-40KBytes/sec through notifications. I have the server and notifications up and running with BlueZ-5.54 interfacing over HCI with BT860 Laird bluetooth module that leverages CYW20704 A2 Chipset.
The problem is with HCI Event: Number of Completed Packets. From what I understand the bluetooth controller will send this event once it has transmitted buffered packets to indicate available capacity. Also it is manufacture specific and cannot be controlled.
The chipset can buffer up to 15 packets of length 251 each. I confirmed that by sending raw command using hcitool.
All good so far, here is the problem description:
The applications sends 15 packets to the controller
After 2 x connection_interval_ms Controller replies with HCI Event: Number of Completed Packets = 2
This continues until all packets are sent. At the end, controller sends 8 HCI Event: Number of Completed Packets = 2/1, all 2 x connection_interval_ms apart
I am pasting output from "btmon" here for a better understanding of the situation(the important sections are separated by /******** break-lines ******/).
From the output it is clear that the controller only transmits 2 ACL packet at a time and then waits 2xconnection_interval_ms. This really is the bottleneck of my BLE server, please let me know how I can improve it!
I have tried different connection intervals, mtu sizes and even different client apps(nRF connect and RaspberryPi gatt client) all give me the same results. As well as gone through documentation for BT860 and CYW20704.
Can someone please help me understand how I can fix this? Essentially,
Why are the packets buffered and not transmitted?
If they are being transmitted, why is it not reported by the controller? How do I know if this is a bug in the controller?
Why are "Number of Completed Packets" HCI event always 2 x connection intervals apart? How can I control its frequency?
/********************************************Initiate Connection and GATT Service discovery*****************************************/
> HCI Event: LE Meta Event (0x3e) plen 19 #289 [hci0] 1767.983447
LE Connection Complete (0x01)
Status: Success (0x00)
Handle: 64
Role: Slave (0x01)
Peer address type: Random (0x01)
Peer address: F5:2F:BD:4D:B4:A1 (Static)
Connection interval: 7.50 msec (0x0006)
Connection latency: 0 (0x0000)
Supervision timeout: 4000 msec (0x0190)
Master clock accuracy: 0x07
# MGMT Event: Device Connected (0x000b) plen 13 {0x0002} [hci0] 1767.983514
LE Address: F5:2F:BD:4D:B4:A1 (Static)
Flags: 0x00000000
Data length: 0
# MGMT Event: Device Connected (0x000b) plen 13 {0x0001} [hci0] 1767.983514
LE Address: F5:2F:BD:4D:B4:A1 (Static)
Flags: 0x00000000
Data length: 0
< HCI Command: LE Read Remote Used Features (0x08|0x0016) plen 2 #290 [hci0] 1767.983782
Handle: 64
> HCI Event: Command Status (0x0f) plen 4 #291 [hci0] 1767.985754
LE Read Remote Used Features (0x08|0x0016) ncmd 1
Status: Success (0x00)
> ACL Data RX: Handle 64 flags 0x02 dlen 11 #292 [hci0] 1768.003893
ATT: Read By Group Type Request (0x10) len 6
Handle range: 0x0001-0xffff
Attribute group type: Primary Service (0x2800)
> HCI Event: LE Meta Event (0x3e) plen 12 #293 [hci0] 1768.020620
LE Read Remote Used Features (0x04)
Status: Unsupported Remote Feature / Unsupported LMP Feature (0x1a)
Handle: 64
Features: 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00
LE Encryption
Connection Parameter Request Procedure
Extended Reject Indication
Slave-initiated Features Exchange
LE Ping
LE Data Packet Length Extension
LL Privacy
Extended Scanner Filter Policies
< ACL Data TX: Handle 64 flags 0x00 dlen 16 #294 [hci0] 1768.020769
LE L2CAP: Connection Parameter Update Request (0x12) ident 1 len 8
Min interval: 24
Max interval: 40
Slave latency: 0
Timeout multiplier: 400
< ACL Data TX: Handle 64 flags 0x00 dlen 18 #295 [hci0] 1768.034943
ATT: Read By Group Type Response (0x11) len 13
Attribute data length: 6
Attribute group list: 2 entries
Handle range: 0x0001-0x0006
UUID: Generic Access Profile (0x1800)
Handle range: 0x0007-0x000a
UUID: Generic Attribute Profile (0x1801)
> HCI Event: LE Meta Event (0x3e) plen 11 #296 [hci0] 1768.043019
LE Data Length Change (0x07)
Handle: 64
Max TX octets: 251
Max TX time: 2120
Max RX octets: 251
Max RX time: 2120
> ACL Data RX: Handle 64 flags 0x02 dlen 10 #297 [hci0] 1768.050522
LE L2CAP: Connection Parameter Update Response (0x13) ident 1 len 2
Result: Connection Parameters accepted (0x0000)
> HCI Event: Number of Completed Packets (0x13) plen 5 #298 [hci0] 1768.058490
Num handles: 1
Handle: 64
Count: 2
> ACL Data RX: Handle 64 flags 0x02 dlen 11 #299 [hci0] 1768.065527
ATT: Read By Group Type Request (0x10) len 6
Handle range: 0x000b-0xffff
Attribute group type: Primary Service (0x2800)
< ACL Data TX: Handle 64 flags 0x00 dlen 26 #300 [hci0] 1768.065867
ATT: Read By Group Type Response (0x11) len 21
Attribute data length: 20
Attribute group list: 1 entry
Handle range: 0x000b-0x0012
UUID: Vendor specific (a79ef145-bde1-4bbd-8fbd-28d5dad70a97)
> ACL Data RX: Handle 64 flags 0x02 dlen 11 #301 [hci0] 1768.081234
ATT: Read By Group Type Request (0x10) len 6
Handle range: 0x0013-0xffff
Attribute group type: Primary Service (0x2800)
< ACL Data TX: Handle 64 flags 0x00 dlen 9 #302 [hci0] 1768.081687
ATT: Error Response (0x01) len 4
Read By Group Type Request (0x10)
Handle: 0x0013
Error: Attribute Not Found (0x0a)
> ACL Data RX: Handle 64 flags 0x02 dlen 7 #303 [hci0] 1768.095555
ATT: Read Request (0x0a) len 2
Handle: 0x000b
< ACL Data TX: Handle 64 flags 0x00 dlen 21 #304 [hci0] 1768.095684
ATT: Read Response (0x0b) len 16
Value: 970ad7dad528bd8fbd4be1bd45f19ea7
> HCI Event: Number of Completed Packets (0x13) plen 5 #305 [hci0] 1768.096516
Num handles: 1
Handle: 64
Count: 2
> HCI Event: LE Meta Event (0x3e) plen 10 #306 [hci0] 1768.103986
LE Connection Update Complete (0x03)
Status: Success (0x00)
Handle: 64
Connection interval: 30.00 msec (0x0018)
Connection latency: 0 (0x0000)
Supervision timeout: 4000 msec (0x0190)
> ACL Data RX: Handle 64 flags 0x02 dlen 11 #307 [hci0] 1768.163413
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0001-0x0006
Attribute type: Characteristic (0x2803)
< ACL Data TX: Handle 64 flags 0x00 dlen 20 #308 [hci0] 1768.163731
ATT: Read By Type Response (0x09) len 15
Attribute data length: 7
Attribute data list: 2 entries
Handle: 0x0002
Value: 820300002a
Handle: 0x0005
Value: 020600012a
> ACL Data RX: Handle 64 flags 0x02 dlen 7 #309 [hci0] 1768.223048
ATT: Read Request (0x0a) len 2
Handle: 0x0003
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #310 [hci0] 1768.223324
ATT: Read Response (0x0b) len 22
Value: 427261696e436f205261737062657272795069205374
> HCI Event: Number of Completed Packets (0x13) plen 5 #311 [hci0] 1768.223995
Num handles: 1
Handle: 64
Count: 2
> ACL Data RX: Handle 64 flags 0x02 dlen 7 #312 [hci0] 1768.313032
ATT: Read Request (0x0a) len 2
Handle: 0x0006
< ACL Data TX: Handle 64 flags 0x00 dlen 7 #313 [hci0] 1768.313294
ATT: Read Response (0x0b) len 2
Value: 8000
> ACL Data RX: Handle 64 flags 0x02 dlen 9 #314 [hci0] 1768.373681
ATT: Find Information Request (0x04) len 4
Handle range: 0x0004-0x0006
< ACL Data TX: Handle 64 flags 0x00 dlen 18 #315 [hci0] 1768.373818
ATT: Find Information Response (0x05) len 13
Format: UUID-16 (0x01)
Handle: 0x0004
UUID: Characteristic Extended Properties (0x2900)
Handle: 0x0005
UUID: Characteristic (0x2803)
Handle: 0x0006
UUID: Appearance (0x2a01)
> HCI Event: Number of Completed Packets (0x13) plen 5 #316 [hci0] 1768.373932
Num handles: 1
Handle: 64
Count: 2
> ACL Data RX: Handle 64 flags 0x02 dlen 7 #317 [hci0] 1768.433025
ATT: Read Request (0x0a) len 2
Handle: 0x0004
< ACL Data TX: Handle 64 flags 0x00 dlen 7 #318 [hci0] 1768.433350
ATT: Read Response (0x0b) len 2
Value: 0100
> ACL Data RX: Handle 64 flags 0x02 dlen 9 #319 [hci0] 1768.493683
ATT: Find Information Request (0x04) len 4
Handle range: 0x0007-0x0006
< ACL Data TX: Handle 64 flags 0x00 dlen 9 #320 [hci0] 1768.493961
ATT: Error Response (0x01) len 4
Find Information Request (0x04)
Handle: 0x0007
Error: Invalid Handle (0x01)
> HCI Event: Number of Completed Packets (0x13) plen 5 #321 [hci0] 1768.493965
Num handles: 1
Handle: 64
Count: 2
> ACL Data RX: Handle 64 flags 0x02 dlen 7 #322 [hci0] 1768.553023
ATT: Read Request (0x0a) len 2
Handle: 0x0003
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #323 [hci0] 1768.553275
ATT: Read Response (0x0b) len 22
Value: 427261696e436f205261737062657272795069205374
> ACL Data RX: Handle 64 flags 0x02 dlen 9 #324 [hci0] 1768.613688
ATT: Read Blob Request (0x0c) len 4
Handle: 0x0003
Offset: 0x0016
< ACL Data TX: Handle 64 flags 0x00 dlen 21 #325 [hci0] 1768.614021
ATT: Read Blob Response (0x0d) len 16
61 72 6b 20 47 41 54 54 20 53 65 72 76 65 72 00 ark GATT Server.
> HCI Event: Number of Completed Packets (0x13) plen 5 #326 [hci0] 1768.614029
Num handles: 1
Handle: 64
Count: 2
> HCI Event: Number of Completed Packets (0x13) plen 5 #327 [hci0] 1768.904932
Num handles: 1
Handle: 64
Count: 1
> HCI Event: LE Meta Event (0x3e) plen 10 #328 [hci0] 1776.593921
LE Connection Update Complete (0x03)
Status: Success (0x00)
Handle: 64
Connection interval: 7.50 msec (0x0006)
Connection latency: 0 (0x0000)
Supervision timeout: 4000 msec (0x0190)
> ACL Data RX: Handle 64 flags 0x02 dlen 11 #329 [hci0] 1788.592219
ATT: Read By Type Request (0x08) len 6
Handle range: 0x000b-0x0012
Attribute type: Characteristic (0x2803)
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #330 [hci0] 1788.592438
ATT: Read By Type Response (0x09) len 22
Attribute data length: 21
Attribute data list: 1 entry
Handle: 0x000c
Value: 100d00072c6b8a1e1aeda86b47cec24ebcd4e8
> ACL Data RX: Handle 64 flags 0x02 dlen 11 #331 [hci0] 1788.607574
ATT: Read By Type Request (0x08) len 6
Handle range: 0x000d-0x0012
Attribute type: Characteristic (0x2803)
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #332 [hci0] 1788.607721
ATT: Read By Type Response (0x09) len 22
Attribute data length: 21
Attribute data list: 1 entry
Handle: 0x0010
Value: 0c110008c6a6034ef06baf8549343533924732
> ACL Data RX: Handle 64 flags 0x02 dlen 11 #333 [hci0] 1788.622590
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0011-0x0012
Attribute type: Characteristic (0x2803)
< ACL Data TX: Handle 64 flags 0x00 dlen 9 #334 [hci0] 1788.622708
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0011
Error: Attribute Not Found (0x0a)
> HCI Event: Number of Completed Packets (0x13) plen 5 #335 [hci0] 1788.623156
Num handles: 1
Handle: 64
Count: 2
> ACL Data RX: Handle 64 flags 0x02 dlen 7 #336 [hci0] 1788.637230
ATT: Read Request (0x0a) len 2
Handle: 0x000c
< ACL Data TX: Handle 64 flags 0x00 dlen 24 #337 [hci0] 1788.637352
ATT: Read Response (0x0b) len 19
Value: 100d00072c6b8a1e1aeda86b47cec24ebcd4e8
> ACL Data RX: Handle 64 flags 0x02 dlen 7 #338 [hci0] 1788.652248
ATT: Read Request (0x0a) len 2
Handle: 0x0010
< ACL Data TX: Handle 64 flags 0x00 dlen 24 #339 [hci0] 1788.652361
ATT: Read Response (0x0b) len 19
Value: 0c110008c6a6034ef06baf8549343533924732
> HCI Event: Number of Completed Packets (0x13) plen 5 #340 [hci0] 1788.653195
Num handles: 1
Handle: 64
Count: 2
> ACL Data RX: Handle 64 flags 0x02 dlen 9 #341 [hci0] 1788.697157
ATT: Find Information Request (0x04) len 4
Handle range: 0x000e-0x0012
< ACL Data TX: Handle 64 flags 0x00 dlen 18 #342 [hci0] 1788.697287
ATT: Find Information Response (0x05) len 13
Format: UUID-16 (0x01)
Handle: 0x000e
UUID: Characteristic User Description (0x2901)
Handle: 0x000f
UUID: Client Characteristic Configuration (0x2902)
Handle: 0x0010
UUID: Characteristic (0x2803)
> ACL Data RX: Handle 64 flags 0x02 dlen 7 #343 [hci0] 1788.712242
ATT: Read Request (0x0a) len 2
Handle: 0x000e
< ACL Data TX: Handle 64 flags 0x00 dlen 18 #344 [hci0] 1788.712447
ATT: Read Response (0x0b) len 13
Value: 4545472052656164696e677300
> HCI Event: Number of Completed Packets (0x13) plen 5 #345 [hci0] 1788.712787
Num handles: 1
Handle: 64
Count: 2
> ACL Data RX: Handle 64 flags 0x02 dlen 7 #346 [hci0] 1788.727224
ATT: Read Request (0x0a) len 2
Handle: 0x000f
< ACL Data TX: Handle 64 flags 0x00 dlen 5 #347 [hci0] 1788.727405
ATT: Read Response (0x0b) len 0
Value:
> HCI Event: Number of Completed Packets (0x13) plen 5 #348 [hci0] 1788.749650
Num handles: 1
Handle: 64
Count: 2
> ACL Data RX: Handle 64 flags 0x02 dlen 9 #349 [hci0] 1788.764653
ATT: Find Information Request (0x04) len 4
Handle range: 0x0012-0x0012
< ACL Data TX: Handle 64 flags 0x00 dlen 10 #350 [hci0] 1788.764773
ATT: Find Information Response (0x05) len 5
Format: UUID-16 (0x01)
Handle: 0x0012
UUID: Characteristic User Description (0x2901)
> ACL Data RX: Handle 64 flags 0x02 dlen 7 #351 [hci0] 1788.779703
ATT: Read Request (0x0a) len 2
Handle: 0x0012
< ACL Data TX: Handle 64 flags 0x00 dlen 18 #352 [hci0] 1788.779898
ATT: Read Response (0x0b) len 13
Value: 4545472052656164696e677300
> HCI Event: Number of Completed Packets (0x13) plen 5 #353 [hci0] 1788.794650
Num handles: 1
Handle: 64
Count: 2
> ACL Data RX: Handle 64 flags 0x02 dlen 9 #354 [hci0] 1790.062100
ATT: Write Request (0x12) len 4
Handle: 0x000f
Data: 0100
/************************************************** START THE NOTIFICATIONS **********************************************************/
> ACL Data RX: Handle 64 flags 0x02 dlen 9 #354 [hci0] 1790.062100
ATT: Write Request (0x12) len 4
Handle: 0x000f
Data: 0100
< ACL Data TX: Handle 64 flags 0x00 dlen 5 #355 [hci0] 1790.062426
ATT: Write Response (0x13) len 0
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #356 [hci0] 1790.063602
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 54f003008bce915f8bce915f8bce915f5483ac7e
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #357 [hci0] 1790.064609
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #358 [hci0] 1790.065696
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #359 [hci0] 1790.066768
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #360 [hci0] 1790.067887
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #361 [hci0] 1790.068955
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #362 [hci0] 1790.070077
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #363 [hci0] 1790.071196
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #364 [hci0] 1790.072277
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #365 [hci0] 1790.073346
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #366 [hci0] 1790.074458
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #367 [hci0] 1790.075560
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #368 [hci0] 1790.076665
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #369 [hci0] 1790.077775
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
> HCI Event: Number of Completed Packets (0x13) plen 5 #370 [hci0] 1790.084497
Num handles: 1
Handle: 64
Count: 2
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #371 [hci0] 1790.084532
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #372 [hci0] 1790.084546
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
> HCI Event: Number of Completed Packets (0x13) plen 5 #373 [hci0] 1790.099497
Num handles: 1
Handle: 64
Count: 2
/*******************************************BREAK: SKIP TO END OF TRANSFER ************************************************/
> HCI Event: Number of Completed Packets (0x13) plen 5 #493 [hci0] 1790.736984
Num handles: 1
Handle: 64
Count: 2
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #494 [hci0] 1790.737022
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #495 [hci0] 1790.737037
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
> HCI Event: Number of Completed Packets (0x13) plen 5 #496 [hci0] 1790.751975
Num handles: 1
Handle: 64
Count: 2
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #497 [hci0] 1790.752012
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
< ACL Data TX: Handle 64 flags 0x00 dlen 27 #498 [hci0] 1790.752027
ATT: Handle Value Notification (0x1b) len 22
Handle: 0x000d
Data: 0000000030b6510100000000e8b651015483ac7e
> HCI Event: Number of Completed Packets (0x13) plen 5 #499 [hci0] 1790.766970
Num handles: 1
Handle: 64
Count: 2
> HCI Event: Number of Completed Packets (0x13) plen 5 #500 [hci0] 1790.782000
Num handles: 1
Handle: 64
Count: 2
> HCI Event: Number of Completed Packets (0x13) plen 5 #501 [hci0] 1790.796968
Num handles: 1
Handle: 64
Count: 2
> HCI Event: Number of Completed Packets (0x13) plen 5 #502 [hci0] 1790.811970
Num handles: 1
Handle: 64
Count: 2
> HCI Event: Number of Completed Packets (0x13) plen 5 #503 [hci0] 1790.826973
Num handles: 1
Handle: 64
Count: 2
> HCI Event: Number of Completed Packets (0x13) plen 5 #504 [hci0] 1790.841972
Num handles: 1
Handle: 64
Count: 2
> HCI Event: Number of Completed Packets (0x13) plen 5 #505 [hci0] 1790.856964
Num handles: 1
Handle: 64
Count: 2
> HCI Event: Number of Completed Packets (0x13) plen 5 #506 [hci0] 1791.031954
Num handles: 1
Handle: 64
Count: 1
To get better throughput you should make use of the data length extension by setting a longer mtu and use longer notifications.
Anyway, this side runs as the "slave" role. But it's the master that controls how long the connection interval should stay open in the first place, so better check out the master setup and make sure it uses a long "connection event length". When this is equal to the connection interval you get maximum throughput.
A slave can abort a connection event earlier by stopping to listen to packets from the master. This is generally only done if the radio scheduler decides a more important radio event needs the radio right now.
Related
How to send Read By Group Type request from Raspberry Pi?
I'm using Raspberry Pi to connect with Minew S1 Temperature and Humidity Sensor, in order to connect with my sensor I need to send some data to connect with sensor, so at first I tried connect with BeaconSet+ app with sensor, and I captured all those packets and tried to decode those using wireshark, so the first data sent from mobile to sensor is "Read By Group Type Request", what does it mean and how can I mirror it in Raspberry Pi using gatttool or bluetoothctl. this link has packet screenshot > HCI Event: Command Complete (0x0e) plen 4 #37 [hci0] 23.110065 LE Set Scan Enable (0x08|0x000c) ncmd 1 Status: Success (0x00) < HCI Command: LE Create Connection (0x08|0x000d) plen 25 #38 [hci0] 23.110095 Scan interval: 60.000 msec (0x0060) Scan window: 60.000 msec (0x0060) Filter policy: White list is not used (0x00) Peer address type: Public (0x00) Peer address: AC:23:3F:AB:7B:D8 (Shenzhen Minew Technologies Co., Ltd.) Own address type: Public (0x00) Min connection interval: 30.00 msec (0x0018) Max connection interval: 50.00 msec (0x0028) Connection latency: 0 (0x0000) Supervision timeout: 420 msec (0x002a) Min connection length: 0.000 msec (0x0000) Max connection length: 0.000 msec (0x0000) > HCI Event: Command Status (0x0f) plen 4 #39 [hci0] 23.110613 LE Create Connection (0x08|0x000d) ncmd 1 Status: Success (0x00) > HCI Event: LE Meta Event (0x3e) plen 19 #40 [hci0] 23.210757 LE Connection Complete (0x01) Status: Success (0x00) Handle: 64 Role: Master (0x00) Peer address type: Public (0x00) Peer address: AC:23:3F:AB:7B:D8 (Shenzhen Minew Technologies Co., Ltd.) Connection interval: 48.75 msec (0x0027) Connection latency: 0 (0x0000) Supervision timeout: 420 msec (0x002a) Master clock accuracy: 0x00 # MGMT Event: Device Connected (0x000b) plen 37 {0x0001} [hci0] 23.210785 LE Address: AC:23:3F:AB:7B:D8 (Shenzhen Minew Technologies Co., Ltd.) Flags: 0x00000000 Data length: 24 Flags: 0x06 LE General Discoverable Mode BR/EDR Not Supported 16-bit Service UUIDs (complete): 1 entry Unknown (0xffe1) Service Data (UUID 0xffe1): a101641cfd48e6d87bab3f23ac < HCI Command: LE Read Remote Used Features (0x08|0x0016) plen 2 #41 [hci0] 23.210905 Handle: 64 > HCI Event: Command Status (0x0f) plen 4 #42 [hci0] 23.211771 LE Read Remote Used Features (0x08|0x0016) ncmd 1 Status: Success (0x00) > HCI Event: Command Complete (0x0e) plen 14 #43 [hci0] 23.211775 LE Read Remote Used Features (0x08|0x0016) ncmd 1 Status: Success (0x00) 00 00 00 00 00 00 00 00 00 00 .......... > HCI Event: LE Meta Event (0x3e) plen 12 #44 [hci0] 23.337233 LE Read Remote Used Features (0x04) Status: Success (0x00) Handle: 64 Features: 0x21 0x00 0x00 0x00 0x00 0x00 0x00 0x00 LE Encryption LE Data Packet Length Extension < ACL Data TX: Handle 64 flags 0x00 dlen 7 #45 [hci0] 23.337677 ATT: Exchange MTU Request (0x02) len 2 Client RX MTU: 517 > ACL Data RX: Handle 64 flags 0x02 dlen 7 #46 [hci0] 23.532018 ATT: Exchange MTU Response (0x03) len 2 Server RX MTU: 23 < ACL Data TX: Handle 64 flags 0x00 dlen 7 #47 [hci0] 23.532452 ATT: Read Request (0x0a) len 2 Handle: 0x0003 > HCI Event: Number of Completed Packets (0x13) plen 5 #48 [hci0] 23.580957 Num handles: 1 Handle: 64 Count: 2 > ACL Data RX: Handle 64 flags 0x02 dlen 10 #49 [hci0] 23.629552 ATT: Read Response (0x0b) len 5 Value: 6e52463578 < ACL Data TX: Handle 64 flags 0x00 dlen 7 #50 [hci0] 23.629713 ATT: Read Request (0x0a) len 2 Handle: 0x0005 > ACL Data RX: Handle 64 flags 0x02 dlen 7 #51 [hci0] 23.727010 ATT: Read Response (0x0b) len 2 Value: 0000 < ACL Data TX: Handle 64 flags 0x00 dlen 7 #52 [hci0] 23.727179 ATT: Read Request (0x0a) len 2 Handle: 0x0027 > HCI Event: Number of Completed Packets (0x13) plen 5 #53 [hci0] 23.775948 Num handles: 1 Handle: 64 Count: 2 > HCI Event: Disconnect Complete (0x05) plen 4 #54 [hci0] 32.502249 Status: Success (0x00) Handle: 64 Reason: Remote User Terminated Connection (0x13) # MGMT Event: Device Disconnected (0x000c) plen 8 {0x0001} [hci0] 32.502320 LE Address: AC:23:3F:AB:7B:D8 (Shenzhen Minew Technologies Co., Ltd.) Reason: Connection terminated by remote host (0x03) Thank you.
Problem reading the Content Sequence tag of DICOM file using DCMTK
Using DCMTK, I am trying to get the entire node of Content Sequence of .dcm SR files to extract measurements related to obstetrical scans. I use C-Find query. I am able to get the entire Content Sequence with Toshiba ultrasound machine but not with other brands. I don't think that this is a brand issue but the way I have set up the C-Find process. I am very new to this and am struggling to resolve the issue. I have included 2 log files below: one for the working case that successfully gets the entire node of Content Sequence tag, and another log for the non-working case that stops the process with an error "DIMSE Status: 0xc000: Error: Failed - Unable to process error". I appreciate any help or your insightful advice. This the log for the non-working query D: Request Parameters: D: ====================== BEGIN A-ASSOCIATE-RQ ===================== D: Our Implementation Class UID: 1.2.276.0.7230010.3.0.3.6.5 D: Our Implementation Version Name: OFFIS_DCMTK_365 D: Their Implementation Class UID: D: Their Implementation Version Name: D: Application Context Name: 1.2.840.10008.3.1.1.1 D: Calling Application Name: KATIBA D: Called Application Name: ORTHANC D: Responding Application Name: ORTHANC D: Our Max PDU Receive Size: 16384 D: Their Max PDU Receive Size: 0 D: Presentation Contexts: D: Context ID: 1 (Proposed) D: Abstract Syntax: =FINDStudyRootQueryRetrieveInformationModel D: Proposed SCP/SCU Role: Default D: Proposed Transfer Syntax(es): D: =LittleEndianExplicit D: =BigEndianExplicit D: =LittleEndianImplicit D: Requested Extended Negotiation: none D: Accepted Extended Negotiation: none D: Requested User Identity Negotiation: none D: User Identity Negotiation Response: none D: ======================= END A-ASSOCIATE-RQ ====================== I: Requesting Association T: DUL FSM Table: State: 1 Event: 0 T: DUL Event: A-ASSOCIATE request (local user) T: DUL Action: AE 1 Transport Connect D: setting network send timeout to 60 seconds D: setting network receive timeout to 60 seconds T: checking whether environment variable TCP_BUFFER_LENGTH is set T: environment variable TCP_BUFFER_LENGTH not set, using the system defaults T: checking whether environment variable TCP_NODELAY is set T: environment variable TCP_NODELAY not set, using the default value (0) T: DUL FSM Table: State: 4 Event: 1 T: DUL Event: Transport conn confirmation (local) T: DUL Action: AE 2 Send Associate RQ PDU D: Constructing Associate RQ PDU T: setting timeout for first PDU to be read to 30 seconds T: Read PDU HEAD TCP: 02 00 00 00 00 ba T: Read PDU HEAD TCP: type: 02, length: 186 (ba) T: DUL FSM Table: State: 5 Event: 2 T: DUL Event: A-ASSOCIATE-AC PDU (on transport) T: DUL Action: AE 3 Associate Confirmation Accept D: PDU Type: Associate Accept, PDU Length: 186 + 6 bytes PDU header D: 02 00 00 00 00 ba 00 01 00 00 4f 52 54 48 41 4e D: 43 20 20 20 20 20 20 20 20 20 4b 41 54 49 42 41 D: 20 20 20 20 20 20 20 20 20 20 00 00 00 00 00 00 D: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D: 00 00 00 00 00 00 00 00 00 00 10 00 00 15 31 2e D: 32 2e 38 34 30 2e 31 30 30 30 38 2e 33 2e 31 2e D: 31 2e 31 21 00 00 1b 01 00 00 00 40 00 00 13 31 D: 2e 32 2e 38 34 30 2e 31 30 30 30 38 2e 31 2e 32 D: 2e 31 50 00 00 3a 51 00 00 04 00 00 40 00 52 00 D: 00 1b 31 2e 32 2e 32 37 36 2e 30 2e 37 32 33 30 D: 30 31 30 2e 33 2e 30 2e 33 2e 36 2e 34 55 00 00 D: 0f 4f 46 46 49 53 5f 44 43 4d 54 4b 5f 33 36 34 D: D: Parsing an A-ASSOCIATE PDU T: PDU type: 2 (A-ASSOCIATE AC), PDU Length: 186 T: DICOM Protocol: 1 T: Called AP Title: ORTHANC T: Calling AP Title: KATIBA T: Parsing remaining 118 bytes of A-ASSOCIATE PDU T: Next item type: 10 T: Subitem parse: Type 10, Length 0021, Content: 1.2.840.10008.3.1.1.1 T: Successfully parsed Application Context T: Parsing remaining 93 bytes of A-ASSOCIATE PDU T: Next item type: 21 T: Parsing Presentation Context: (21), Length: 27 T: Presentation Context ID: 01 T: Parsing remaining 23 bytes of Presentation Context T: Next item type: 40 T: Subitem parse: Type 40, Length 0019, Content: 1.2.840.10008.1.2.1 T: Successfully parsed Transfer Syntax T: Successfully parsed Presentation Context T: Parsing remaining 62 bytes of A-ASSOCIATE PDU T: Next item type: 50 T: Parsing user info field (50), Length: 58 T: Parsing remaining 58 bytes of User Information T: Next item type: 51 T: Maximum PDU Length: 16384 T: Successfully parsed Maximum PDU Length T: Parsing remaining 50 bytes of User Information T: Next item type: 52 T: Subitem parse: Type 52, Length 0027, Content: 1.2.276.0.7230010.3.0.3.6.4 T: Parsing remaining 19 bytes of User Information T: Next item type: 55 T: Subitem parse: Type 55, Length 0015, Content: OFFIS_DCMTK_364 T: Successfully parsed User Information D: Association Parameters Negotiated: D: ====================== BEGIN A-ASSOCIATE-AC ===================== D: Our Implementation Class UID: 1.2.276.0.7230010.3.0.3.6.5 D: Our Implementation Version Name: OFFIS_DCMTK_365 D: Their Implementation Class UID: 1.2.276.0.7230010.3.0.3.6.4 D: Their Implementation Version Name: OFFIS_DCMTK_364 D: Application Context Name: 1.2.840.10008.3.1.1.1 D: Calling Application Name: KATIBA D: Called Application Name: ORTHANC D: Responding Application Name: ORTHANC D: Our Max PDU Receive Size: 16384 D: Their Max PDU Receive Size: 16384 D: Presentation Contexts: D: Context ID: 1 (Accepted) D: Abstract Syntax: =FINDStudyRootQueryRetrieveInformationModel D: Proposed SCP/SCU Role: Default D: Accepted SCP/SCU Role: Default D: Accepted Transfer Syntax: =LittleEndianExplicit D: Requested Extended Negotiation: none D: Accepted Extended Negotiation: none D: Requested User Identity Negotiation: none D: User Identity Negotiation Response: none D: ======================= END A-ASSOCIATE-AC ====================== I: Association Accepted (Max Send PDV: 16372) I: Sending Find Request D: ===================== OUTGOING DIMSE MESSAGE ==================== D: Message Type : C-FIND RQ D: Presentation Context ID : 1 D: Message ID : 1 D: Affected SOP Class UID : FINDStudyRootQueryRetrieveInformationModel D: Data Set : present D: Priority : medium D: ======================= END DIMSE MESSAGE ======================= I: Request Identifiers: I: I: # Dicom-Data-Set I: # Used TransferSyntax: Little Endian Explicit I: (0008,0016) UI (no value available) # 0, 0 SOPClassUID I: (0008,0018) UI (no value available) # 0, 0 SOPInstanceUID I: (0008,0020) DA [20210218-] # 10, 1 StudyDate I: (0008,0021) DA [20210218-] # 10, 1 SeriesDate I: (0008,0030) TM [0000-2359] # 10, 1 StudyTime I: (0008,0031) TM [0000-2359] # 10, 1 SeriesTime I: (0008,0050) SH (no value available) # 0, 0 AccessionNumber I: (0008,0052) CS [SERIES] # 6, 1 QueryRetrieveLevel I: (0008,0061) CS [SR] # 2, 1 ModalitiesInStudy I: (0008,0070) LO (no value available) # 0, 0 Manufacturer I: (0008,0080) LO (no value available) # 0, 0 InstitutionName I: (0008,0090) PN (no value available) # 0, 0 ReferringPhysicianName I: (0008,1030) LO (no value available) # 0, 0 StudyDescription I: (0008,103e) LO (no value available) # 0, 0 SeriesDescription I: (0008,1040) LO (no value available) # 0, 0 InstitutionalDepartmentName I: (0008,1048) PN (no value available) # 0, 0 PhysiciansOfRecord I: (0010,0010) PN (no value available) # 0, 0 PatientName I: (0010,0020) LO [200167394] # 10, 1 PatientID I: (0010,0030) DA (no value available) # 0, 0 PatientBirthDate I: (0010,0040) CS (no value available) # 0, 0 PatientSex I: (0010,1010) AS (no value available) # 0, 0 PatientAge I: (0010,21b0) LT (no value available) # 0, 0 AdditionalPatientHistory I: (0020,000d) UI (no value available) # 0, 0 StudyInstanceUID I: (0020,0010) SH (no value available) # 0, 0 StudyID I: (0032,1032) PN (no value available) # 0, 0 RequestingPhysician I: (0040,a730) SQ (Sequence with explicit length #=0) # 0, 1 ContentSequence I: (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem I: T: DcmItem::insert() Element (0000,0000) VR="UL" inserted at beginning T: DcmItem::insert() Element (0000,0100) VR="US" inserted T: DcmItem::insert() Element (0000,0110) VR="US" inserted T: DcmItem::insert() Element (0000,0800) VR="US" inserted T: DcmItem::insert() Element (0000,0002) VR="UI" inserted T: DcmItem::insert() Element (0000,0700) VR="US" inserted T: DIMSE Command to be sent on Presentation Context ID: 1 T: DIMSE Command to send: T: T: # Dicom-Data-Set T: # Used TransferSyntax: Little Endian Explicit T: (0000,0000) UL 0 # 4, 1 CommandGroupLength T: (0000,0002) UI =FINDStudyRootQueryRetrieveInformationModel # 28, 1 AffectedSOPClassUID T: (0000,0100) US 32 # 2, 1 CommandField T: (0000,0110) US 1 # 2, 1 MessageID T: (0000,0700) US 0 # 2, 1 Priority T: (0000,0800) US 1 # 2, 1 CommandDataSetType T: T: DIMSE sendDcmDataset: sending 88 bytes T: DUL FSM Table: State: 6 Event: 8 T: DUL Event: P-DATA request primitive T: DUL Action: DT 1 Send P DATA PDU T: DIMSE sendDcmDataset: sending 270 bytes T: DUL FSM Table: State: 6 Event: 8 T: DUL Event: P-DATA request primitive T: DUL Action: DT 1 Send P DATA PDU T: DIMSE receiveCommand T: Read PDU HEAD TCP: 04 00 00 00 00 5e T: Read PDU HEAD TCP: type: 04, length: 94 (5e) T: DUL FSM Table: State: 6 Event: 9 T: DUL Event: P-DATA-TF PDU (on transport) T: DUL Action: DT 2 Indicate P DATA PDU Received D: DcmDataset::read() TransferSyntax="Little Endian Implicit" T: DcmItem::insert() Element (0000,0000) VR="UL" inserted at beginning T: DcmItem::readSubItem() returns error = Normal T: DcmItem::insert() Element (0000,0002) VR="UI" inserted T: DcmItem::readSubItem() returns error = Normal T: DcmItem::insert() Element (0000,0100) VR="US" inserted T: DcmItem::readSubItem() returns error = Normal T: DcmItem::insert() Element (0000,0120) VR="US" inserted T: DcmItem::readSubItem() returns error = Normal T: DcmItem::insert() Element (0000,0800) VR="US" inserted T: DcmItem::readSubItem() returns error = Normal T: DcmItem::insert() Element (0000,0900) VR="US" inserted T: DcmItem::readSubItem() returns error = Normal T: DcmItem::read() returns error = Normal T: DcmDataset::read() returns error = Normal T: DIMSE receiveCommand: 1 PDVs (88 bytes), PresID=1 T: DIMSE Command Received: T: T: # Dicom-Data-Set T: # Used TransferSyntax: Little Endian Implicit T: (0000,0002) UI =FINDStudyRootQueryRetrieveInformationModel # 28, 1 AffectedSOPClassUID T: (0000,0100) US 32800 # 2, 1 CommandField T: (0000,0120) US 1 # 2, 1 MessageIDBeingRespondedTo T: (0000,0800) US 257 # 2, 1 CommandDataSetType T: (0000,0900) US 49152 # 2, 1 Status T: T: DcmItem::searchSubFromHere() Element (0000,0100) found T: DcmItem::searchSubFromHere() Element (0000,0100) found T: DcmItem::searchSubFromHere() Element (0000,0120) found T: DcmItem::searchSubFromHere() Element (0000,0800) found T: DcmItem::searchSubFromHere() Element (0000,0900) found T: DcmItem::searchSubFromHere() Element (0000,0002) found I: Received Final Find Response D: ===================== INCOMING DIMSE MESSAGE ==================== D: Message Type : C-FIND RSP D: Message ID Being Responded To : 1 D: Affected SOP Class UID : FINDStudyRootQueryRetrieveInformationModel D: Data Set : none D: DIMSE Status : 0xc000: Error: Failed - Unable to process D: ======================= END DIMSE MESSAGE ======================= I: Releasing Association T: DUL FSM Table: State: 6 Event: 10 T: DUL Event: A-RELEASE request primitive T: DUL Action: AR 1 Send Release RQ T: Read PDU HEAD TCP: 06 00 00 00 00 04 T: Read PDU HEAD TCP: type: 06, length: 4 (04) T: DUL FSM Table: State: 7 Event: 12 T: DUL Event: A-RELEASE-RP PDU (on transport) T: DUL Action: AR 3 Confirm Release And this is the log for the working query: D: Request Parameters: D: ====================== BEGIN A-ASSOCIATE-RQ ===================== D: Our Implementation Class UID: 1.2.276.0.7230010.3.0.3.6.5 D: Our Implementation Version Name: OFFIS_DCMTK_365 D: Their Implementation Class UID: D: Their Implementation Version Name: D: Application Context Name: 1.2.840.10008.3.1.1.1 D: Calling Application Name: KATIBA D: Called Application Name: ORTHANC D: Responding Application Name: ORTHANC D: Our Max PDU Receive Size: 16384 D: Their Max PDU Receive Size: 0 D: Presentation Contexts: D: Context ID: 1 (Proposed) D: Abstract Syntax: =FINDStudyRootQueryRetrieveInformationModel D: Proposed SCP/SCU Role: Default D: Proposed Transfer Syntax(es): D: =LittleEndianExplicit D: =BigEndianExplicit D: =LittleEndianImplicit D: Requested Extended Negotiation: none D: Accepted Extended Negotiation: none D: Requested User Identity Negotiation: none D: User Identity Negotiation Response: none D: ======================= END A-ASSOCIATE-RQ ====================== I: Requesting Association T: DUL FSM Table: State: 1 Event: 0 T: DUL Event: A-ASSOCIATE request (local user) T: DUL Action: AE 1 Transport Connect D: setting network send timeout to 60 seconds D: setting network receive timeout to 60 seconds T: checking whether environment variable TCP_BUFFER_LENGTH is set T: environment variable TCP_BUFFER_LENGTH not set, using the system defaults T: checking whether environment variable TCP_NODELAY is set T: environment variable TCP_NODELAY not set, using the default value (0) T: DUL FSM Table: State: 4 Event: 1 T: DUL Event: Transport conn confirmation (local) T: DUL Action: AE 2 Send Associate RQ PDU D: Constructing Associate RQ PDU T: setting timeout for first PDU to be read to 30 seconds T: Read PDU HEAD TCP: 02 00 00 00 00 ba T: Read PDU HEAD TCP: type: 02, length: 186 (ba) T: DUL FSM Table: State: 5 Event: 2 T: DUL Event: A-ASSOCIATE-AC PDU (on transport) T: DUL Action: AE 3 Associate Confirmation Accept D: PDU Type: Associate Accept, PDU Length: 186 + 6 bytes PDU header D: 02 00 00 00 00 ba 00 01 00 00 4f 52 54 48 41 4e D: 43 20 20 20 20 20 20 20 20 20 4b 41 54 49 42 41 D: 20 20 20 20 20 20 20 20 20 20 00 00 00 00 00 00 D: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D: 00 00 00 00 00 00 00 00 00 00 10 00 00 15 31 2e D: 32 2e 38 34 30 2e 31 30 30 30 38 2e 33 2e 31 2e D: 31 2e 31 21 00 00 1b 01 00 00 00 40 00 00 13 31 D: 2e 32 2e 38 34 30 2e 31 30 30 30 38 2e 31 2e 32 D: 2e 31 50 00 00 3a 51 00 00 04 00 00 40 00 52 00 D: 00 1b 31 2e 32 2e 32 37 36 2e 30 2e 37 32 33 30 D: 30 31 30 2e 33 2e 30 2e 33 2e 36 2e 34 55 00 00 D: 0f 4f 46 46 49 53 5f 44 43 4d 54 4b 5f 33 36 34 D: D: Parsing an A-ASSOCIATE PDU T: PDU type: 2 (A-ASSOCIATE AC), PDU Length: 186 T: DICOM Protocol: 1 T: Called AP Title: ORTHANC T: Calling AP Title: KATIBA T: Parsing remaining 118 bytes of A-ASSOCIATE PDU T: Next item type: 10 T: Subitem parse: Type 10, Length 0021, Content: 1.2.840.10008.3.1.1.1 T: Successfully parsed Application Context T: Parsing remaining 93 bytes of A-ASSOCIATE PDU T: Next item type: 21 T: Parsing Presentation Context: (21), Length: 27 T: Presentation Context ID: 01 T: Parsing remaining 23 bytes of Presentation Context T: Next item type: 40 T: Subitem parse: Type 40, Length 0019, Content: 1.2.840.10008.1.2.1 T: Successfully parsed Transfer Syntax T: Successfully parsed Presentation Context T: Parsing remaining 62 bytes of A-ASSOCIATE PDU T: Next item type: 50 T: Parsing user info field (50), Length: 58 T: Parsing remaining 58 bytes of User Information T: Next item type: 51 T: Maximum PDU Length: 16384 T: Successfully parsed Maximum PDU Length T: Parsing remaining 50 bytes of User Information T: Next item type: 52 T: Subitem parse: Type 52, Length 0027, Content: 1.2.276.0.7230010.3.0.3.6.4 T: Parsing remaining 19 bytes of User Information T: Next item type: 55 T: Subitem parse: Type 55, Length 0015, Content: OFFIS_DCMTK_364 T: Successfully parsed User Information D: Association Parameters Negotiated: D: ====================== BEGIN A-ASSOCIATE-AC ===================== D: Our Implementation Class UID: 1.2.276.0.7230010.3.0.3.6.5 D: Our Implementation Version Name: OFFIS_DCMTK_365 D: Their Implementation Class UID: 1.2.276.0.7230010.3.0.3.6.4 D: Their Implementation Version Name: OFFIS_DCMTK_364 D: Application Context Name: 1.2.840.10008.3.1.1.1 D: Calling Application Name: KATIBA D: Called Application Name: ORTHANC D: Responding Application Name: ORTHANC D: Our Max PDU Receive Size: 16384 D: Their Max PDU Receive Size: 16384 D: Presentation Contexts: D: Context ID: 1 (Accepted) D: Abstract Syntax: =FINDStudyRootQueryRetrieveInformationModel D: Proposed SCP/SCU Role: Default D: Accepted SCP/SCU Role: Default D: Accepted Transfer Syntax: =LittleEndianExplicit D: Requested Extended Negotiation: none D: Accepted Extended Negotiation: none D: Requested User Identity Negotiation: none D: User Identity Negotiation Response: none D: ======================= END A-ASSOCIATE-AC ====================== I: Association Accepted (Max Send PDV: 16372) I: Sending Find Request D: ===================== OUTGOING DIMSE MESSAGE ==================== D: Message Type : C-FIND RQ D: Presentation Context ID : 1 D: Message ID : 1 D: Affected SOP Class UID : FINDStudyRootQueryRetrieveInformationModel D: Data Set : present D: Priority : medium D: ======================= END DIMSE MESSAGE ======================= I: Request Identifiers: I: I: # Dicom-Data-Set I: # Used TransferSyntax: Little Endian Explicit I: (0008,0016) UI (no value available) # 0, 0 SOPClassUID I: (0008,0018) UI (no value available) # 0, 0 SOPInstanceUID I: (0008,0020) DA [20210218-] # 10, 1 StudyDate I: (0008,0021) DA [20210218-] # 10, 1 SeriesDate I: (0008,0030) TM [0000-2359] # 10, 1 StudyTime I: (0008,0031) TM [0000-2359] # 10, 1 SeriesTime I: (0008,0050) SH (no value available) # 0, 0 AccessionNumber I: (0008,0052) CS [SERIES] # 6, 1 QueryRetrieveLevel I: (0008,0061) CS [SR] # 2, 1 ModalitiesInStudy I: (0008,0070) LO (no value available) # 0, 0 Manufacturer I: (0008,0080) LO (no value available) # 0, 0 InstitutionName I: (0008,0090) PN (no value available) # 0, 0 ReferringPhysicianName I: (0008,1030) LO (no value available) # 0, 0 StudyDescription I: (0008,103e) LO (no value available) # 0, 0 SeriesDescription I: (0008,1040) LO (no value available) # 0, 0 InstitutionalDepartmentName I: (0008,1048) PN (no value available) # 0, 0 PhysiciansOfRecord I: (0010,0010) PN (no value available) # 0, 0 PatientName I: (0010,0020) LO [01TEST12] # 8, 1 PatientID I: (0010,0030) DA (no value available) # 0, 0 PatientBirthDate I: (0010,0040) CS (no value available) # 0, 0 PatientSex I: (0010,1010) AS (no value available) # 0, 0 PatientAge I: (0010,21b0) LT (no value available) # 0, 0 AdditionalPatientHistory I: (0020,000d) UI (no value available) # 0, 0 StudyInstanceUID I: (0020,0010) SH (no value available) # 0, 0 StudyID I: (0032,1032) PN (no value available) # 0, 0 RequestingPhysician I: (0040,a730) SQ (Sequence with explicit length #=0) # 0, 1 ContentSequence I: (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem I: T: DcmItem::insert() Element (0000,0000) VR="UL" inserted at beginning T: DcmItem::insert() Element (0000,0100) VR="US" inserted T: DcmItem::insert() Element (0000,0110) VR="US" inserted T: DcmItem::insert() Element (0000,0800) VR="US" inserted T: DcmItem::insert() Element (0000,0002) VR="UI" inserted T: DcmItem::insert() Element (0000,0700) VR="US" inserted T: DIMSE Command to be sent on Presentation Context ID: 1 T: DIMSE Command to send: T: T: # Dicom-Data-Set T: # Used TransferSyntax: Little Endian Explicit T: (0000,0000) UL 0 # 4, 1 CommandGroupLength T: (0000,0002) UI =FINDStudyRootQueryRetrieveInformationModel # 28, 1 AffectedSOPClassUID T: (0000,0100) US 32 # 2, 1 CommandField T: (0000,0110) US 1 # 2, 1 MessageID T: (0000,0700) US 0 # 2, 1 Priority T: (0000,0800) US 1 # 2, 1 CommandDataSetType T: T: DIMSE sendDcmDataset: sending 88 bytes T: DUL FSM Table: State: 6 Event: 8 T: DUL Event: P-DATA request primitive T: DUL Action: DT 1 Send P DATA PDU T: DIMSE sendDcmDataset: sending 268 bytes T: DUL FSM Table: State: 6 Event: 8 T: DUL Event: P-DATA request primitive T: DUL Action: DT 1 Send P DATA PDU T: DIMSE receiveCommand T: Read PDU HEAD TCP: 04 00 00 00 00 5e T: Read PDU HEAD TCP: type: 04, length: 94 (5e) T: DUL FSM Table: State: 6 Event: 9 T: DUL Event: P-DATA-TF PDU (on transport) T: DUL Action: DT 2 Indicate P DATA PDU Received D: DcmDataset::read() TransferSyntax="Little Endian Implicit" T: DcmItem::insert() Element (0000,0000) VR="UL" inserted at beginning T: DcmItem::readSubItem() returns error = Normal T: DcmDataset::read() returns error = Normal T: DIMSE receiveCommand: 1 PDVs (88 bytes), PresID=1 T: DIMSE Command Received: T: T: # Dicom-Data-Set T: # Used TransferSyntax: Little Endian Implicit T: (0000,0002) UI =FINDStudyRootQueryRetrieveInformationModel # 28, 1 AffectedSOPClassUID T: (0000,0100) US 32800 # 2, 1 CommandField T: (0000,0120) US 1 # 2, 1 MessageIDBeingRespondedTo T: (0000,0800) US 1 # 2, 1 CommandDataSetType T: (0000,0900) US 65280 # 2, 1 Status T: T: DcmItem::searchSubFromHere() Element (0000,0100) found T: DcmItem::searchSubFromHere() Element (0000,0100) found T: DcmItem::searchSubFromHere() Element (0000,0120) found T: DcmItem::searchSubFromHere() Element (0000,0800) found T: DcmItem::searchSubFromHere() Element (0000,0900) found T: DcmItem::searchSubFromHere() Element (0000,0002) found T: Read PDU HEAD TCP: 04 00 00 00 3f f8 T: Read PDU HEAD TCP: type: 04, length: 16376 (3ff8) T: DUL FSM Table: State: 6 Event: 9 T: DUL Event: P-DATA-TF PDU (on transport) T: DUL Action: DT 2 Indicate P DATA PDU Received D: DcmDataset::read() TransferSyntax="Little Endian Explicit" T: DcmSequenceOfItems::read() returns error = Normal T: DcmItem::insert() Element (0040,a043) VR="SQ" inserted T: DcmItem::readSubItem() returns error = Normal T: DIMSE receiveDataSetInMemory: 11642 bytes read (last: YES) T: DcmItem::searchSubFromHere() Element (0008,0018) found T: DcmItem::searchSubFromHere() Element (0008,0016) found T: DcmItem::searchSubFromHere() Element (0040,a730) found T: DcmItem::searchSubFromHere() Element (0040,a010) found T: DcmItem::searchSubFromHere() Element (0040,a040) found T: DcmItem::searchSubFromHere() Element (0040,a043) found //more truncated repetitive log T: DIMSE receiveCommand T: Read PDU HEAD TCP: 04 00 00 00 00 5e T: Read PDU HEAD TCP: type: 04, length: 94 (5e) T: DUL FSM Table: State: 6 Event: 9 T: DUL Event: P-DATA-TF PDU (on transport) T: DUL Action: DT 2 Indicate P DATA PDU Received D: DcmDataset::read() TransferSyntax="Little Endian Implicit" T: DcmItem::insert() Element (0000,0000) VR="UL" inserted at beginning T: DcmItem::readSubItem() returns error = Normal T: DcmItem::insert() Element (0000,0002) VR="UI" inserted T: DcmItem::readSubItem() returns error = Normal T: DcmItem::insert() Element (0000,0100) VR="US" inserted T: DcmItem::readSubItem() returns error = Normal T: DcmItem::insert() Element (0000,0120) VR="US" inserted T: DcmItem::readSubItem() returns error = Normal T: DcmItem::insert() Element (0000,0800) VR="US" inserted T: DcmItem::readSubItem() returns error = Normal T: DcmItem::insert() Element (0000,0900) VR="US" inserted T: DcmItem::readSubItem() returns error = Normal T: DcmItem::read() returns error = Normal T: DcmDataset::read() returns error = Normal T: DIMSE receiveCommand: 1 PDVs (88 bytes), PresID=1 T: DIMSE Command Received: T: T: # Dicom-Data-Set T: # Used TransferSyntax: Little Endian Implicit T: (0000,0002) UI =FINDStudyRootQueryRetrieveInformationModel # 28, 1 AffectedSOPClassUID T: (0000,0100) US 32800 # 2, 1 CommandField T: (0000,0120) US 1 # 2, 1 MessageIDBeingRespondedTo T: (0000,0800) US 257 # 2, 1 CommandDataSetType T: (0000,0900) US 0 # 2, 1 Status T: T: DcmItem::searchSubFromHere() Element (0000,0100) found T: DcmItem::searchSubFromHere() Element (0000,0100) found T: DcmItem::searchSubFromHere() Element (0000,0120) found T: DcmItem::searchSubFromHere() Element (0000,0800) found T: DcmItem::searchSubFromHere() Element (0000,0900) found T: DcmItem::searchSubFromHere() Element (0000,0002) found I: Received Final Find Response D: ===================== INCOMING DIMSE MESSAGE ==================== D: Message Type : C-FIND RSP D: Message ID Being Responded To : 1 D: Affected SOP Class UID : FINDStudyRootQueryRetrieveInformationModel D: Data Set : none D: DIMSE Status : 0x0000: Success D: ======================= END DIMSE MESSAGE ======================= I: Releasing Association
Your requests only differ in that your non-working query queries for a different patient ID. An obvious mistake in both queries is that for a SERIES-level request in STUDY-ROOT, you must not include a value for the Patient ID, but for the Study Instance UID. This is wrong in terms of DICOM, but Orthanc seems to be capable of handling it in general. This is however the only hint that I can obtain from your logs, so I would give it a try. Please note, that the Content Sequence is not a mandatory Return Key for the C-FIND, so you can never rely on the SCP supporting it.
How to find the record size in berkley database?
Is there any tool which can help in finding record size in berkley DB? https://www.oracle.com/in/database/technologies/related/berkeleydb.html
db_dump (1) has them. For example, on an RHEL/Centos Linux system, use -da to dump all debug information: db_dump -da /var/lib/rpm/Name | head -100 ... [000] 4088 len: 5 data: CUnit [001] 4076 len: 8 data: 8d05000000000000 [002] 4060 len: 11 data: CUnit-devel [003] 4048 len: 8 data: 5006000000000000 [004] 4040 len: 5 data: GeoIP [005] 4028 len: 8 data: 7105000000000000 [006] 4008 len: 14 data: NetworkManager [007] 3996 len: 8 data: d705000000000000
Why are my serial readings not accurate? Using 2 xbees
I have one XBee-Arduino transmitting a simple int counter to a receiver XBee-Arduino. The receiver prints fine until it gets to 16 and beyond. This is an example of my outputs: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 48 17 50 19 52 21 54 23 56 25 26 59 28 61 62 63 64 65 98 67 68 69 I have tried new XBees and the XBees do not seem to be the problem. Transmitter Code: #include "SoftwareSerial.h" int count = 1; // RX: Arduino pin 2, XBee pin DOUT. TX: Arduino pin 3, XBee pin DIN SoftwareSerial XBee(2, 3); void setup() { XBee.begin(115200); Serial.println ("Initializing..."); } void loop() { XBee.write(count); delay(1000); count++; } Receiver Code: #include "SoftwareSerial.h" // RX: Arduino pin 2, XBee pin DOUT. TX: Arduino pin 3, XBee pin DIN SoftwareSerial XBee(2, 3); void setup() { // put your setup code here, to run once: Serial.begin(115200); Serial.println("Started Ground station"); XBee.begin(115200); } void loop() { // put your main code here, to run repeatedly: if (XBee.available()) { int c = XBee.read(); Serial.println(c); delay(1000); } else { Serial.println("XBee not available."); delay(1000); } } I just want the receiver to print the counter as it is. Not sure why I am getting those random numbers after 15. Any help is appreciated.
The incorrect numbers are different by one bit. This could be caused by different timing when reading the serial line, especially at high baud rates (Software serial isn't particularly reliable at the higher baud rates). You can see where a bit has drifted into the timing for an adjacent bit e.g. 16 = 0001 0000 was interpreted as 0011 0000 = 48 18 = 0001 0010 was interpreted as 0011 0010 = 50 20 = 0001 0100 was interpreted as 0011 0100 = 52 27 = 0001 1011 was interpreted as 0011 1011 = 59 34 = 0010 0010 was interpreted as 0110 0010 = 98 Try using a lower baud rate so that the timing isn't as critical and the bits are less likely to drift into the timing for adjacent bits.
why round-trip time different between two test host?
I have written one http put client(use libcurl libarary) to put file into apache webdav server, and use tcpdump catch the packet at the server side, then use tcptrace (www.tcptrace.org) to analysis the dump file, below is the result: Host a is the client side, Host b is the server side: a->b: b->a: total packets: 152120 total packets: 151974 ack pkts sent: 152120 ack pkts sent: 151974 pure acks sent: 120 pure acks sent: 151854 sack pkts sent: 0 sack pkts sent: 0 dsack pkts sent: 0 dsack pkts sent: 0 max sack blks/ack: 0 max sack blks/ack: 0 unique bytes sent: 3532149672 unique bytes sent: 30420 actual data pkts: 152000 actual data pkts: 120 actual data bytes: 3532149672 actual data bytes: 30420 rexmt data pkts: 0 rexmt data pkts: 0 rexmt data bytes: 0 rexmt data bytes: 0 zwnd probe pkts: 0 zwnd probe pkts: 0 zwnd probe bytes: 0 zwnd probe bytes: 0 outoforder pkts: 0 outoforder pkts: 0 pushed data pkts: 3341 pushed data pkts: 120 SYN/FIN pkts sent: 0/0 SYN/FIN pkts sent: 0/0 req 1323 ws/ts: N/Y req 1323 ws/ts: N/Y urgent data pkts: 0 pkts urgent data pkts: 0 pkts urgent data bytes: 0 bytes urgent data bytes: 0 bytes mss requested: 0 bytes mss requested: 0 bytes max segm size: 31856 bytes max segm size: 482 bytes min segm size: 216 bytes min segm size: 25 bytes avg segm size: 23237 bytes avg segm size: 253 bytes max win adv: 125 bytes max win adv: 5402 bytes min win adv: 125 bytes min win adv: 5402 bytes zero win adv: 0 times zero win adv: 0 times avg win adv: 125 bytes avg win adv: 5402 bytes initial window: 15928 bytes initial window: 0 bytes initial window: 1 pkts initial window: 0 pkts ttl stream length: NA ttl stream length: NA missed data: NA missed data: NA truncated data: 0 bytes truncated data: 0 bytes truncated packets: 0 pkts truncated packets: 0 pkts data xmit time: 151.297 secs data xmit time: 150.696 secs idletime max: 44571.3 ms idletime max: 44571.3 ms throughput: 23345867 Bps throughput: 201 Bps RTT samples: 151915 RTT samples: 120 RTT min: 0.0 ms RTT min: 0.1 ms RTT max: 0.3 ms RTT max: 40.1 ms RTT avg: 0.0 ms RTT avg: 19.9 ms RTT stdev: 0.0 ms RTT stdev: 19.8 ms RTT from 3WHS: 0.0 ms RTT from 3WHS: 0.0 ms RTT full_sz smpls: 74427 RTT full_sz smpls: 60 RTT full_sz min: 0.0 ms RTT full_sz min: 39.1 ms RTT full_sz max: 0.3 ms RTT full_sz max: 40.1 ms RTT full_sz avg: 0.0 ms RTT full_sz avg: 39.6 ms RTT full_sz stdev: 0.0 ms RTT full_sz stdev: 0.3 ms post-loss acks: 0 post-loss acks: 0 segs cum acked: 89 segs cum acked: 0 duplicate acks: 0 duplicate acks: 0 triple dupacks: 0 triple dupacks: 0 max # retrans: 0 max # retrans: 0 min retr time: 0.0 ms min retr time: 0.0 ms max retr time: 0.0 ms max retr time: 0.0 ms avg retr time: 0.0 ms avg retr time: 0.0 ms sdv retr time: 0.0 ms sdv retr time: 0.0 ms According the result above, the RTT of client to server is small, but the server side to client side is large. Can anyone help explain this from me?
Because this unique bytes sent: 3532149672 unique bytes sent: 30420 actual data pkts: 152000 actual data pkts: 120 actual data bytes: 3532149672 actual data bytes: 30420 a->b is sending a steady flow of data, which ensures buffers get filled and things get pushed. b->a is only sending a few acks etc, doing next to nothing at all, so as a result things get left in buffers for a while (a few ms). In addition to that, RTT is round trip time. It's the time from when the application queues a packet for sending and when the corresponding response is received. Since the host on a is busy pushing data, and probably filling its own buffers, there's going to be a small amount of additional overhead for something from b to get acknowledged.
Firstly host b sent very little data (a very small sample size). Secondly, I suspect that host a has an asymmetrical Internet connection (e.g. 10MB/1MB).