VecH
Posts: 41
Joined: Tue Dec 09, 2014 5:30 pm

pigpiod + wiegand = incorrect read

Sat Oct 24, 2015 2:34 pm

I have the keys wiegand with number (read and verify in other devices) and these numbers are written on the keys themselves:
0009030510
0009487621
0009236067
0009328295
I am git clone pigpiod library, maked and installed
I use modified example: /pigpio/EXAMPLES/Python/WIEGAND_CODE/wiegand.py

Code: Select all

   def callback(bits, value):
      print("bits={} value={}".format(bits, value))
to

Code: Select all

   def callback(bits, value):
      print("bits={} value={}".format(bits, value))
      print(int(bin(value)[3:27],2))
for remove CRC bits and convert to integer and print

Only first key 0009030510 correct read and print

Code: Select all

bits=26 value=51615453
9030510
other keys returns an incorrect value
0009487621 return 2198027
0009236067 return 1694918
0009328295 return 1879374

I tried to understand what the problem is, not work
translation into binary values, is evident that they are shifted

Code: Select all

0009030510=9030510
100010011100101101101110
100010011100101101101110
---------
0009487621=2198027
100100001100010100000101
   1000011000101000001011
---------
0009236067=1694918
100011001110111001100011
    110011101110011000110
---------
0009328295=1879374
100011100101011010100111
    111001010110101001110
p.s. I can get values in bits for keys Wiegand with CRC or without

Return to “General discussion”