Hi,
I need to save the NFC reading result to a file or database and append timestamp and after continue waiting for a reading.
It's easy to do? Anyone can help me?
Thank's
Hi,
I need to save the NFC reading result to a file or database and append timestamp and after continue waiting for a reading.
It's easy to do? Anyone can help me?
Thank's
Thank's for your answer Clem,
I'm a newbie, and I don't know how to start. Can you guide me?
Thank's crjeder,
Now i'm using raspbian. I'm not sure what language can I choose... I'm confortable using bash script. It's possible?
Finally, mysql or mariadb as db it's ok. If it's easy save the reading to a file, it's ok too, after i know how to export to a db.
Thank's again
UNIX has a very powerful concept named "pipes" which is was you need. You can read more about it e. g. here: Linux Tutorial - 11. Learn Piping and Redirection
Basically to redirect the output of "nfc-read" to a file you do:
nfc-read > file
If you want to redirect to an other program do:
nfc-read | db-import
I already know about Pipes, but you give me a great idea. Thank's!
By now I'm using this bash script...
#!/bin/bash
explorenfc-basic > temp_file.txt
input=`grep UID temp_file.txt | cut -d " " -f 3`
mplayer beep-07.wav
mysql -u MYSQL_USERNAME -pMYSQL_PASSWORD -e "INSERT INTO table_name (field1,field2,field3) VALUES (NULL,'$input',CURRENT_TIMESTAMP)" database_name
Thank's again!