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


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!

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


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:




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!!
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


Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kaosmadnessAuthor Commented:
Thanks for pinging me on the right direction! I finally got it to work!!!
Glad to be of assistance!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.