I am trying to read data from a USB serial RFID device in Ubuntu.
The device is: https://www.sparkfun.com/products/8852
The device is recognised under Ubuntu as:
/dev/ttyUSB0
If I use programs such as 'screen' or 'minicom' when I touch an RFID tag to the reader, a unique number is shown on screen.
I want to be able to get this data through terminal. Then when I have this data process if however necessary.
My question is, how can I get the data like I see it in these programs? I would like to either write a bash or PHP script to get at the data.
Thanks
If you are going to use PHP (*nix/Windows) then you are looking for the PHP dio
(Direct I/O) extension:
http://php.net/manual/en/book.dio.php
From PHP manual:
PHP supports the direct io functions as described in the Posix Standard (Section 6) for performing I/O functions at a lower level than the C-Language stream I/O functions (fopen(), fread(),..). The use of the DIO functions should be considered only when direct control of a device is needed. In all other cases, the standard filesystem functions are more than adequate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With