You made a mistake when you described the authentication process. According to the documentation, you need to transfer the last 4 bytes of the UID, and you are transferred the first 4 bytes.
This can be fixed as follows:
code
return self._tocard(0x0E, [mode, addr] + sect + ser[:4])[0]
replaced by
return self._tocard(0x0E, [mode, addr] + sect + ser[-4:])[0]
Hello.
You made a mistake when you described the authentication process. According to the documentation, you need to transfer the last 4 bytes of the UID, and you are transferred the first 4 bytes. This can be fixed as follows: code return self._tocard(0x0E, [mode, addr] + sect + ser[:4])[0] replaced by return self._tocard(0x0E, [mode, addr] + sect + ser[-4:])[0]