Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6342
  • Last Modified:

How to program RFID reader to post data via HTTP

I am looking at building a system for use at an exhibition where all guests will check in at each stand with an RFID wrist band. I want to post the data to a webserver database.

I have come across this reasonable priced reader:  
iDTRONIC USB Desktop Reader EVO - HF Multitag

I need a kick in the right direction when using SDKs/DLLs etcs as I get a bit lossed.

Can someone help my starting me in the right direction?

I am happy to program a simple PHP get request and INSERT the data into a mySQL database.

Any advice would be great!!!!!!

Many Thanks

Steve Tinsley
0
Steve Tinsley
Asked:
Steve Tinsley
  • 8
  • 8
1 Solution
 
grahamnonweilerCommented:
The majority of RFID (and all handheld scanners including Barcode & MSR) usually insert the captured data in to the keyboard chain - meaning the data is read as if typed in to the keyboard. You will probably find the USB scanner comes with "keyboard wedge" driver, and when plugged in to a MS/Windows PC will appear as a "human interface device" HID.

When the RFID tag is read by the scanner, the data will be terminated with a CR/LF (depression of the Enter key) and thus you can use this within a simple HTML form field to POST to a back end PHP script that updates your Database.

The RFID data will include all characters read from the tag, and normally has start & end of field markers that you will need to strip in your back end script.

Once you have the scanner installed, open a text editor and then scan an RFID tag. The data from the tag wil be inserted in to the text editor, from there you will be able to establish which characters you need to strip.

In your HTML form, you should place the "focus" on the input field after page load automatically, then as the tag is scanned, the CR/LF will cause the form to POST.

Your back end script processes the input and then reloads the HTML form.

This is quick and easy solution, but the basic principal can be applied to any programming environment.
0
 
Steve TinsleyAuthor Commented:
Thanks for the solution Graham.
I am a little conserned about the reliability of the system.
The reader could have people queing up to check in at the stand.

I suppose for speed I would use Ajax to submit data.

Is there faster and more reliable way of doing this?
0
 
grahamnonweilerCommented:
We have used the HTML/PHP scenario in a multitude of environments, including a Point of Sale environment.

What will determine the speed will be the connection between the PC's that are grabbing the data and server. If that is over the Internet then you may face problems depending on the Internet connection.

If however you have the PCs locally networked at the event, and the server in the same local network, then speed will not be an issue.

Depending on how big the event is, and the budget you have, you could set up the registration PCs locally networked to a local server handling the registrations, and the local server then uploads the registrations in batch to a remote server.

The reliability of the HTML form and back-end PHP script is far greater than attempting to write something in C/C++ (or any of the visual platforms) becuase there is less to go wrong!

Using AJAX would not be advisable, and wouldn't help speed wise, the page "reload" after POST will ensure the field comes back in to focus immediately.

We have one installation that is using exactly this type of scenario where there are 24 PCs locally networked to a small local server running Apache/MySQL handling overhead RFID scanners reading car mounted RFID tags. This system typcially handles around 45 scan + post per second.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Steve TinsleyAuthor Commented:
How do you deal with 2 scans within 1 second??
i.e.....
Chip 1 is scanned and submitted (may take 1.5 second to submit and reload back to input page)
Chip 2 is scanned during that 1.5 second. The RFID scanner outputs the characters (like a keyboard would) to no where.

User doesn't know their input hasn't submitted.

We miss Chip 2's input.....
0
 
Steve TinsleyAuthor Commented:
Have you also any thoughts on readers to use?
It only needs to be short range (1cm or so).
0
 
grahamnonweilerCommented:
I think you have missed that there are multiple scanners operating in the environment I described above - each PC has a scanner attached - thus 24 PCs and 24 scanners. As the entire process I described is "automated" - in that there is no human involvement - the scan and post takes place in less than a second.

What I was attempting to highlight for you is that the actual scan and post can be "processed" easily and quickly.

Introducing the "human" element will obviously affect the process, and it will depened on how many PCs (plus scanner) with human operator you have planned for your event.

As for which scanner you use, it all depends upon your available budget.
0
 
Steve TinsleyAuthor Commented:
I understand its automated...
But we all know SOMETIMES an html post can take 1 second (even when the webserver&database is local.)

What happens if the same scanner catches 2 rfid chips within 1 second? Is one chip not recorded?

ALSO: I assume the input screen is just a very basic html page with just 1 text box..
Which browser do you use?
0
 
grahamnonweilerCommented:
In the automated scenario we are not using a browser - we have a C++ routine running. However, in any case, the scanned tag is placed in the keyboard buffer, and the limitation is purely the size of that buffer. The C++ routine simply looks for a keyboard input terminated by CR/LF and loops the POST. The OS handles the keyboard buffer.

In a local environment, a simple insertion in to a MySQL databse (regardless of its size) is unlikely to exceed 1 second, reading back that inserted data would be a different matter.

In your scenario, you will have someone sitting at a PC using either a handheld or surface mounted scanner. In this case the scan + post will take approximately 1 to 1.5 seconds excluding the "human" aspect.

Where we have adopted "scanning" techniques (barcode, MSR and RFID) we have usually recommended Internet Explorer - purely because the scanners are easier to attach to Windows based PCs due to supplied drivers.  

The HTML form does not use a TEXTAREA but a normal TEXT <input> field - this is so that the CR/LF at the end of the scan forces the FORM to SUBMIT (your FORM should not have a SUBMIT button).
0
 
Steve TinsleyAuthor Commented:
My process needs to be automated as well. The scanners will be on each exhibition stand unman. People will walk onto the stand can scan in. No data will need to be fed-back, we are just recording how many people visit each stand.

Would you still use an html page? I guess I would hide a laptop behind the exhibition stand and just have the scanner on view.
0
 
grahamnonweilerCommented:
If I understand correctly then, what you are trying to do is "track" people as they move around the exhibition. As they enter a stand, the RFID tag is scanned to log that they entered the stand.

If you were to use scanners that are capable of reading tags at a distance (which is the normal route for an automated scenario) then you will be likely to have situations were the same tag is repeatedly read and recorded, possibly even a situation where one person stops in front of the reader and causes a continual loop.

There would be no easy way to prevent such a situation from happening, without "human" intervention of course.

Thus you would really need to use proximity based scanners, that will require the wearer to physically place the tag within 1cm or 2cm of the scanner. In turn that will require that the wearer has some incentive (or reason) to do so.

Assuming you are going for the latter, then rather than rely on a local network, each scanner could run on a PC (laptop) in a standalone mode, capturing the data that at the end of the event could be processed in batch at a central point.

If you have the budget available, then Touch Screens with the reader attached to it, and a carefully designed HTML page with FORM, would be more likely to attract the attention of the wearer of the tag, and in turn encoorage them to use it.
0
 
Steve TinsleyAuthor Commented:
Yes we are going to use proximity scanners but the data does need to be recorded to a central database straight away so we can query during the event.

Just to clarify, the way I think this may work is....
- USB proximity scanner attached to a hidden un-maned laptop
- Laptop has open web form on IE with 1 textbox and the cursor forced to it.
- When the chip is scanned the characters are placed in the text box automatically and the CR/LF submits the form.
- The PHP script inserts the data to the database
- The browser returns to the blank textbox input screen with the cursor in the textbox.

Do you think this method will work OK?

Lets also assume the don't need an incentive to scan and everyone does it.
0
 
grahamnonweilerCommented:
Correct, the basics you listed above will work.

When the tag is read before the page reloads, the data will be in the keyboard buffer and thus populate the form when it reloads and start the process off again.
0
 
Steve TinsleyAuthor Commented:
OHHH! I See.... I didnt understand that bit about the keyboard buffer.
So whilst the page is posting chip 1 and chip 2 comes along, the id from chip2 will be stored in the buffer untill there is somewhere to put it...

Can you see any problems I might have with this system????

Thanks so much for the help!
0
 
grahamnonweilerCommented:
Can you see any problems I might have with this system????

There will be problems for sure, but none of them "game over" type problems.

I would advise against hiding the laptop - or else - set the laptops up so that you can access them remotely to make sure they are working and have not hung up.

You will also need to ensure you have some error handling in place on your back-end scripts so that the HTML page is loaded even if the back-end rejects the tag data.

You should obtain a scanner and a couple of tags as soon as possible and experiment with your solution so that you can fine tune it well before the "live" use.
0
 
grahamnonweilerCommented:
As an extra thought, instead of laptops you might be better to use "headless" minature PCs - meaning small form factor PCs running without screen/keyboard etc, just the scanners.

They can be accessed remotely (over your local network) to start/stop - and there is less chance of them being interferred with.

We regularly use Atom based Zotac small form factor PCs running embedded Windows XP pro.
0
 
Steve TinsleyAuthor Commented:
FANTASTIC ANSWERS. VERY HELPFUL!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 8
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now