I am very new to NFC devices reading but I have managed to implement in my own project using the code from nfc-mfultralight.c (libnfc).
What I don't understand is that when I read the data from a MIFARE Ultralight band, I get lots of garbage.
For example, I have the number 255555574558888 in the tag (I used an Android device to write this number to the tag).
Now when I run:
nfc-mfultralight r /home/user/dump
I get this
d▒r▒!▒ H▒▒U255555574558888▒-67644-67546-2346
This is from the examples of libnfc, so shouldn't this program just read the correct data? The Android app I am using just sees the value 255555574558888. The value -67644-67546-2346 is part of what I had written before.
How do I know just the correct data I need to read? What should I change in the example code so that it works correctly?
I am using an ACR122 to read the data from the tags.
PS: This is my first project with NFC devices, libnfc and MIFARE Ultralight tags, so any things you think I should read please do tell me.
Edit 1
So I have found this question: Reading a NFC Mifare card with NXP Reader Library
Which I think helps me out a bit. I printed out the hex value of another test string and got this
04 64 13 fb
72 f7 21 84
20 48 00 00
e1 11 06 00
03 0a d1 01
06 54 02 65
6e 68 65 79
fe 00 00 79
35 35 38 38
38 38 fe 00
2d 36 37 36
34 34 2d 36
37 35 34 36
2d 32 33 34
36 fe 00 00
00 00 00 00
00
I see the 3d
followed by 0a
and then d1
, but what is all the values before the 3d
? Is this something because of libnfc?