Author Topic: Fingerprint UART serial configuration  (Read 808 times)

0 Members and 1 Guest are viewing this topic.

Offline Marvin_G

  • Jr. Member
  • **
  • Posts: 8
  • Karma: 0
  • I've just joined!
    • View Profile
    • Awards
Fingerprint UART serial configuration
« on: April 08, 2013, 04:08:09 am »
Hello guys, i'm new here. i have a fingerprint UART reader and i wanna communicate with it through serial port.

To set the serial port configuration i used this command:

stty -F /dev/ttyUSB0 cs8 -cstopb -ixon raw speed 19200

To send command to the device:

perl -e'print "\xF5\x01\x00\x01\x03\x00\x03\xF5"'>/dev/ttyUSB0

To retrieve the data from the device and put it into .txt file:

cat </dev/ttyUSB0 > output.txt

problem: i got the incorrect format for the output which is this =>> . i've attahced the photo along with this thread( the output in the image quite blur, is actually /F5/'box'/00/00/00/00/'box'/F5)

p/s: its HEX input and output. whenever i get 01,02.03 or other than 00,then it will appear as boxes. please help me experts!

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 13221
  • Karma: 323
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Fingerprint UART serial configuration
« Reply #1 on: April 08, 2013, 08:22:55 pm »
Are those (hex) escaped extended ASCII control characters ?

If so .. 00 to 32 aren't printable

See here:
http://www.ascii-code.com/

depending on what you want to do with the output, you could possibly pipe the output through hexdump (?)

Code: [Select]
cat </dev/ttyUSB0 | hexdump -c > output.txt



Open gedit and try typing

Right_Ctrl+Shift+u then 02

and you'll see what I mean.

« Last Edit: April 08, 2013, 09:14:46 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'

logging in as 'insane' is the only safe option.

Offline Marvin_G

  • Jr. Member
  • **
  • Posts: 8
  • Karma: 0
  • I've just joined!
    • View Profile
    • Awards
Re: Fingerprint UART serial configuration
« Reply #2 on: April 10, 2013, 08:55:51 am »
I tried the code u gave me but nothing happened. The device output this kinda of format data, is there any way to change the format without altering the original data?

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal