Can I get a linux system to listen for data on a serial port and then validate it?

Hi!

We have a very ancient Parking system running on an NT server. We encode our guests keys for their hotel room on magnetic key cards with a series of strings of data like 00000000555500000120000130000201100000120000014000002011. Previously, we would encode their room keys and then go on another machine to encode their parking system key. The machine that encode the parking keys in dead and the software is no longer supported.  BUT, the server that communicates with the gates and tells them that a key is valid is still working. I am not sure I wanna do anything with that.

Is there any program that I can use to listed to the gates like their server those which I can have look at the data being read which is basically 0s and room number 0s arrival date 0s departure and reply back asking them to open?

If not then I will even settle for a program that can tell if anything is written on a specific track and reply to open.

Any ideas would be use full!

Thanks
kaosmadnessAsked:
Who is Participating?
 
roundel35Commented:
Can you just read the serial port as a file:

# replace aux0 with the linux name of the serial port that you're connected to
open(CARDREADER, "</dev/aux0") || die "Cannot open card reader: $!";

while (my $line = <CARDREADER>) {
    # do stuff here
    #
}

close(CARDREADER);

Open in new window


0
 
venloftCommented:
Hi,

You may archive your goal by using some serial port connection libraries, and write your rutine for your particular use, hope the following links could help you or be a starting point

libraries for:

PHP http://www.phpclasses.org/package/3679-PHP-Communicate-with-a-serial-port.html

Perl http://search.cpan.org/~bbirth/Win32-SerialPort-0.22/lib/Win32/SerialPort.pm

Phyton http://sourceforge.net/projects/pyserial/

C++  http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html
0
 
kaosmadnessAuthor Commented:
uhmmm. Thanks. I think it might take me a while since I don't know c or python. Maybe someone can give me a hint on a simple script that would set the com port at a certain setting, open/begin listening and reply a predefined answer to all queries. The first part would have been great if it could make sense of the hotel room key information but at  this time we are kinda in a bind because even if we pay to purchase a new parking system it will take a while to install. My temporary solution has been to clone a valid parking card's mag stripe encode the room information on another track. Thanks for the info though!!
0
 
kaosmadnessAuthor Commented:
Thanks for pinging me on the right direction! I finally got it to work!!!
0
 
roundel35Commented:
Glad to be of assistance!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.