title: Convert Hex to (RFID) tag ID
body: <p>I have purchased simple active RFID Reader which is connected through RS232 Serial Port to my Raspberry Pi 3 using <a href="https://www.sparkfun.com/products/retired/12827" rel="nofollow noreferrer">RS232 Shield</a>. I want to read the tag id using the reader. I wrote a piece of code which meant to read the data from serial device. When I run it it is just waiting for something, (no error message). How do I read the tags using this reader with python code or shell script? </p>
  
  <pre><code>import serial                           
  
  ser = serial.Serial ("/dev/ttyAMA0")    
  ser.baudrate = 9600                     
  data = ser.read(8)                       
  print (data)                            
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I was able to read the tag using:</p>
  
  <pre><code>ser = serial.Serial("/dev/ttyS0") 
  </code></pre>
  
  <p>as the <code>ttyAMA0</code> is Bluetooth in Raspberry Pi 3 (this only works on python 3.4. when I try python 2.7 the string is blank). My problem is that I have one tag and the ID of it is 02160323 but when I run this code the output is: <code>b'\xec</code>, <code>b'\xfe</code>, <code>b\xf6</code>, <code>b\xfc</code> and similar (not sure what those values are). How do I recognise the actual id?  </p>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>I was able to convert the text into HEX and then convert it to numeric values.</p>
  
  <pre><code>import serial
  
  ser = serial.Serial("dev/ttyS0", 9600)
  data = ser.read()
  hexo = data.encode('hex')
  i = ord(data)
  
  print(i)
  print(hexo)
  </code></pre>
  
  <p>The full ID is 8 integers long, and given output has not much to do with the ID on the card. How do I convert it to display 02160323?</p>
  
  <p><strong>UPDATE 3</strong></p>
  
  <p>My baundrate was wrong all this time, it should be <code>115200</code>. Now I receive value:
  4000021603237440 and as clearly visible I have ID within it. Now I have to retrieve the data writing appropriate algorithm. Can someone help me with that?</p>