453 | | |
454 | | |
| 446 | == 問題発生 == |
| 447 | |
| 448 | しばらく動かして値をcamonitorしていると、あるタイミングで止まってしまう。[[br]] |
| 449 | camonitorだけではわからず、IOCのasynログを出力してみると、温度レジスタのLSBに0x00が入った時以降、データが出力されなくなっていることが判明した。[[br]] |
| 450 | |
| 451 | |
| 452 | {{{ |
| 453 | 2017/09/07 07:20:18.514 HID1 write 5 |
| 454 | ツH |
| 455 | \302H\006\004\000 |
| 456 | |
| 457 | c2 48 06 04 00 |
| 458 | 2017/09/07 07:20:18.517 HID1 write(raw) 65 |
| 459 | ツH |
| 460 | \302H\006\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 |
| 461 | |
| 462 | c2 48 06 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
| 463 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
| 464 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
| 465 | 00 00 00 00 00 |
| 466 | 2017/09/07 07:20:18.544 HID1: wrote 5 bytes to 403:6030:FT27KQDF, return asynSuccess |
| 467 | 2017/09/07 07:20:18.545 HID1 addr -1 queueRequest priority 0 from lockHolder |
| 468 | 2017/09/07 07:20:18.546 HID1 schedule queueRequest timeout |
| 469 | 2017/09/07 07:20:18.548 asynManager::portThread port=HID1 callback |
| 470 | 2017/09/07 07:20:18.549 HID1: read 8 bytes from 403:6030:FT27KQDF, return asynSuccess |
| 471 | 2017/09/07 07:20:18.551 HID1 read(raw) 8 |
| 472 | ミ |
| 473 | |
| 474 | \320\004\016\n\200\200\000\000 |
| 475 | |
| 476 | d0 04 0e 0a 80 80 00 00 |
| 477 | 2017/09/07 07:20:19.500 HID1 addr -1 queueRequest priority 0 not lockHolder |
| 478 | 2017/09/07 07:20:19.501 HID1 schedule queueRequest timeout |
| 479 | 2017/09/07 07:20:19.502 asynManager::portThread port=HID1 callback |
| 480 | 2017/09/07 07:20:19.503 HID1 addr -1 queueRequest priority 0 not lockHolder |
| 481 | 2017/09/07 07:20:19.505 HID1 schedule queueRequest timeout |
| 482 | 2017/09/07 07:20:19.506 asynManager::portThread port=HID1 callback |
| 483 | 2017/09/07 07:20:19.506 HID1: read 0 bytes from 403:6030:FT27KQDF, return asynSuccess |
| 484 | 2017/09/07 07:20:19.507 HID1 read(raw) 0 |
| 485 | |
| 486 | 2017/09/07 07:20:19.508 HID1 write 5 |
| 487 | ツH |
| 488 | \302H\006\004\000 |
| 489 | |
| 490 | c2 48 06 04 00 |
| 491 | 2017/09/07 07:20:19.510 HID1 write(raw) 65 |
| 492 | ツH |
| 493 | \302H\006\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 |
| 494 | |
| 495 | c2 48 06 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
| 496 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
| 497 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
| 498 | 00 00 00 00 00 |
| 499 | 2017/09/07 07:20:19.527 HID1: wrote 5 bytes to 403:6030:FT27KQDF, return asynSuccess |
| 500 | 2017/09/07 07:20:19.529 HID1 addr -1 queueRequest priority 0 from lockHolder |
| 501 | 2017/09/07 07:20:19.529 HID1 schedule queueRequest timeout |
| 502 | 2017/09/07 07:20:19.529 asynManager::portThread port=HID1 callback |
| 503 | 2017/09/07 07:20:19.530 HID1: read 8 bytes from 403:6030:FT27KQDF, return asynSuccess |
| 504 | 2017/09/07 07:20:19.531 HID1 read(raw) 8 |
| 505 | ミ |
| 506 | \320\004\016\000\200\200\000\000 |
| 507 | |
| 508 | d0 04 0e 00 80 80 00 00 |
| 509 | 2017/09/07 07:20:20.501 HID1 addr -1 queueRequest priority 0 not lockHolder |
| 510 | 2017/09/07 07:20:20.503 HID1 schedule queueRequest timeout |
| 511 | 2017/09/07 07:20:20.505 asynManager::portThread port=HID1 callback |
| 512 | 2017/09/07 07:20:20.506 HID1 addr -1 queueRequest priority 0 not lockHolder |
| 513 | 2017/09/07 07:20:20.507 HID1 schedule queueRequest timeout |
| 514 | 2017/09/07 07:20:20.508 asynManager::portThread port=HID1 callback |
| 515 | 2017/09/07 07:20:20.509 HID1: read 0 bytes from 403:6030:FT27KQDF, return asynSuccess |
| 516 | 2017/09/07 07:20:20.511 HID1 read(raw) 0 |
| 517 | |
| 518 | 2017/09/07 07:20:20.511 HID1 write 5 |
| 519 | ツH |
| 520 | \302H\006\004\000 |
| 521 | |
| 522 | c2 48 06 04 00 |
| 523 | 2017/09/07 07:20:20.513 HID1 write(raw) 65 |
| 524 | ツH |
| 525 | \302H\006\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 |
| 526 | |
| 527 | c2 48 06 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
| 528 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
| 529 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
| 530 | 00 00 00 00 00 |
| 531 | 2017/09/07 07:20:20.529 HID1: wrote 5 bytes to 403:6030:FT27KQDF, return asynSuccess |
| 532 | 2017/09/07 07:20:20.530 HID1 addr -1 queueRequest priority 0 from lockHolder |
| 533 | 2017/09/07 07:20:20.531 HID1 schedule queueRequest timeout |
| 534 | 2017/09/07 07:20:20.531 asynManager::portThread port=HID1 callback |
| 535 | 2017/09/07 07:20:22.535 HID1: read 0 bytes from 403:6030:FT27KQDF, return asynSuccess |
| 536 | 2017/09/07 07:20:22.535 HID1 read(raw) 0 |
| 537 | |
| 538 | 2017/09/07 07:20:24.538 HID1: read 0 bytes from 403:6030:FT27KQDF, return asynSuccess |
| 539 | 2017/09/07 07:20:24.538 HID1 read(raw) 0 |
| 540 | |
| 541 | 2017/09/07 07:20:26.541 HID1: read 0 bytes from 403:6030:FT27KQDF, return asynSuccess |
| 542 | 2017/09/07 07:20:26.541 HID1 read(raw) 0 |
| 543 | |
| 544 | }}} |
| 545 | |
| 546 | この状態になると、IOCを止めるだけではダメで、USBコネクタを挿抜して再認識させないと復活しない。[[br]] |
| 547 | |
| 548 | 始めは、HIDAPIの方の問題かと考え、pythonでテストプログラムを書いて実行してみたが、LSBが0x00になっても止まることはなかった。[[br]] |
| 549 | その時のスクリプトがこれ。[[br]] |
| 550 | |
| 551 | {{{ |
| 552 | import hid |
| 553 | import time |
| 554 | import logging |
| 555 | |
| 556 | h = hid.device() |
| 557 | h.open(0x0403, 0x6030, u"FT27KQDF") |
| 558 | h.set_nonblocking(1) |
| 559 | |
| 560 | logging.basicConfig(format='[%(asctime)s]: %(message)s', |
| 561 | level=logging.DEBUG) |
| 562 | h.write([0xD0, 0x48, 0x06, 0x02, 0x03,0x80,0x00,0x00]) |
| 563 | |
| 564 | while True: |
| 565 | try: |
| 566 | wr = h.write([0xC2, 0x48, 0x06, 0x04, 0x00]) |
| 567 | logging.debug("[W]" + str(wr)) |
| 568 | |
| 569 | rd = h.read(64) |
| 570 | logging.debug("[R]" + str(rd)) |
| 571 | time.sleep(1) |
| 572 | except: |
| 573 | break |
| 574 | |
| 575 | h.close() |
| 576 | }}} |
| 577 | |
| 578 | asynかstreamdeviceのどちらかの問題の可能性が高いが、詳細は追っていないので現時点では原因は不明。 |