kivijakola / hitager

Other
60 stars 19 forks source link

Hitager reading very unreliable #8

Closed tusker-tools closed 2 years ago

tusker-tools commented 2 years ago

I observed that sometimes reading of data is very unreliable. For example when reading BMW 5WK49125 memory blocks, I have suddenly a reading error in one of the 4byte page (see following example):

image

Below are the captured pulse length for the faulty page:

Sending: i0aC1C0
transfer
ISRcnt:3F
42, 25, 40, 25, 40, 29, 32, 47, 18, 37, 36, 59, 36, 29, 30, 43, 62, 63, 30, 41, 60, 31, 38, 67, 64, 67, 64, 67, 60, 33, 32, 35, 32, 33, 38, 61, 30, 39, 60, 31, 38, 65, 62, 31, 32, 33, 34, 31, 40, 65, 60, 31, 32, 33, 32, 33, 40, 1911, 122, 139, 340, 39,
XXXXXXXXXXXXXXXXX
RESP:NORESP

Problem: The pulse times representing a "short"-pulse show a hughe variation. Some pulse times of a short pulse are so long that they are considered as long pulse by Hitaguino's manchester decoder. Looking at the example above, decreasing the length of the 8th pulse from 47 to 45 would result in a correct decoding of the sequence (which is 0x89ABCDEF).

Possible Solution:

  1. Improve reader's signal quality, e.g. by finding a better setting for the PCF7991 ABIC
  2. Improve robustness of the manchester decoder. E.g. introduce a continuous pulse length adaptation, which continuously adapts detection threshold of a long pulse
tusker-tools commented 2 years ago

Solution 2. was implemented in c70e02aadb6e76bc1ec608e1c04bb50935e5c0cd

This seemed to do the magic. In several tries I did not see a single reading error anymore! The same for Hitag2 pages.

Feel free to reopen if you have issues.