somakeit / door-controller2

A new door controller for a new space, where all the previous hardware is broken and we can't replace it.
1 stars 0 forks source link

NoneType got into the maths in soak test #1

Closed brackendawson closed 9 years ago

brackendawson commented 9 years ago
LOG:
Tag is assigned to user 00000 (Bob)
Tag 9b8785b5 authenticated
NFC device presented
Found tag UID: 9b8785b5
Tag is assigned to user 00000 (Bob)
Tag 9b8785b5 authenticated
NFC device presented
Found tag UID: 9b8785b5
Tag is assigned to user 00000 (Bob)
Tag 9b8785b5 authenticated
NFC device presented
Found tag UID: 9b8785b5
Tag is assigned to user 00000 (Bob)
Failed to Read sector: Failed to read sector 1 of Tag 9b8785b5
Tag 9b8785b5 NOT authenticated
NFC device presented
Found tag UID: 9b8785b5
Tag is assigned to user 00000 (Bob)
Tag 9b8785b5 authenticated
NFC device presented
Found tag UID: 9b8785b5
Tag is assigned to user 00000 (Bob)
Tag 9b8785b5 authenticated
NFC device presented
Found tag UID: 9b8785b5
Tag is assigned to user 00000 (Bob)
Failed to update tag: Failed to write sector 2 block 9 of Tag 9b8785b5
Tag 9b8785b5 NOT authenticated
NFC device presented
Found tag UID: 9b8785b5
Tag is assigned to user 00000 (Bob)
Failed to validate sector b: Sector data failed checksum
Traceback (most recent call last):
  File "doord.py", line 550, in <module>
    inst.main()
  File "doord.py", line 33, in main
    if tag.authenticate():
  File "doord.py", line 119, in authenticate
    if self.greater_than(self.count_a, self.count_b) or (not self.sector_b_ok):
  File "doord.py", line 289, in greater_than
    right = (right + (2**16/2)) % (2**16)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

TAG:
Scan card...
Card read UID: 155,135,133,181
[155, 135, 133, 181, 44]
01 C4 01 08 87 E8 85 A2 C8 BE 5A A3 A8 1C EB 90 BD 12 EA 0C C8 C4 CB 07 25 EA 39 EE 95 98 15 F5 09 51 3F 55 65 43 BB 3D 1F F8 EA 08 00 00 A9 EA 00 00 00 00 00 00 7F 07 88 69 00 00 00 00 00 00     ..........Z.............%.9......Q?UeC.=.................i......
01 C5 01 08 2C D3 E1 13 C5 41 8F 2E 0D E2 6B B2 3C 91 71 3B D0 31 55 63 59 FB EF 71 0A 03 10 59 1F FF 48 54 94 C9 A5 18 55 19 C9 30 00 00 94 C7 00 00 00 00 00 00 7F 07 88 69 00 00 00 00 00 00     ....,....A....k.<.q;.1UcY..q...Y..HT....U..0.............i......
brackendawson commented 9 years ago

I'm still testing count > stored count after sectors have known to fail to read. Need to not do that. Setting the count to a value is not an option.

brackendawson commented 9 years ago

Nope, apparently I tested that with an ok sector.