motom001 / DoorPi

OpenSource VoIP Door-Intercomstation
https://www.doorpi.org/forum/
241 stars 86 forks source link

Keyboard 'rdm6300' sometimes stop working #154

Closed msmolny closed 8 years ago

msmolny commented 8 years ago

Manchmal stoppt der RFID Lese-Thread. Ich habe (zumindest einen) Grund dafür gefunden. Hier der Ausschnitt aus dem Log:

2016-03-13 11:16:33,999 [DEBUG]         [doorpi.keyboard.from_rdm6300] new char r read
2016-03-13 11:16:34,003 [DEBUG]         [doorpi.keyboard.from_rdm6300] new char 6 read
2016-03-13 11:16:34,006 [DEBUG]         [doorpi.keyboard.from_rdm6300] new char 0 read
2016-03-13 11:16:34,010 [DEBUG]         [doorpi.keyboard.from_rdm6300] new char 0 read
2016-03-13 11:16:34,013 [DEBUG]         [doorpi.keyboard.from_rdm6300] new char 4 read
2016-03-13 11:16:34,017 [DEBUG]         [doorpi.keyboard.from_rdm6300] new char 8 read
2016-03-13 11:16:34,020 [DEBUG]         [doorpi.keyboard.from_rdm6300] new char 1 read
2016-03-13 11:16:34,024 [DEBUG]         [doorpi.keyboard.from_rdm6300] new char 3 read
2016-03-13 11:16:34,027 [DEBUG]         [doorpi.keyboard.from_rdm6300] new char 7 read
2016-03-13 11:16:34,030 [DEBUG]         [doorpi.keyboard.from_rdm6300] new char 7 read
2016-03-13 11:16:34,036 [DEBUG]         [doorpi.keyboard.from_rdm6300] new char 2 read
2016-03-13 11:16:34,040 [DEBUG]         [doorpi.keyboard.from_rdm6300] new char A read
2016-03-13 11:16:34,043 [DEBUG]         [doorpi.keyboard.from_rdm6300] new char ^C read
2016-03-13 11:16:34,047 [ERROR]         [doorpi.keyboard.from_rdm6300] invalid literal for int() with base 16: 'r'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/DoorPi-2.4.1.6-py2.7.egg/doorpi/keyboard/from_rdm6300.py", line 125, in readUART
    if newChar == STOP_FLAG and chars[0] == START_FLAG and len(chars) == MAX_LENGTH and RDM6300.check_checksum(chars):
  File "/usr/local/lib/python2.7/dist-packages/DoorPi-2.4.1.6-py2.7.egg/doorpi/keyboard/from_rdm6300.py", line 104, in check_checksum
    return given_checksum == RDM6300.calculate_checksum(string)
  File "/usr/local/lib/python2.7/dist-packages/DoorPi-2.4.1.6-py2.7.egg/doorpi/keyboard/from_rdm6300.py", line 98, in calculate_checksum
    checkSum = checkSum ^ ((int(string[I], 16)) << 4) + int(string[I+1], 16)
ValueError: invalid literal for int() with base 16: 'r'
2016-03-13 11:16:34,056 [DEBUG]         [doorpi.keyboard.from_rdm6300] readUART thread ended

Ich schau mal nach, einen generischen Fix zu machen, der den readUART thread auf jeden Fall am Leben hält - auch bei andersartigen Fehlern.

msmolny commented 8 years ago

Fix is merged into master with pull request 156, closing this issue now.