-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read record from RFID card string UUID via nfc scan reader #653
Comments
Can you share the model of the NFC device and some of your code so that we can help you? |
Hi,
I am using Sunmi V2 pro device.
I created a small html page and wrote javascript code. and i scan rfid card
through NFC device.
Can you help me to read the hexadecimal, decimal (UUID) from the RFID card?
Thanks,
Ankit Raut.
…On Mon, Feb 20, 2023 at 1:49 PM François Beaufort ***@***.***> wrote:
Can you share the model of the NFC device and some of your code so that we
can help you?
Do you get at least one NDEF record when you try
https://googlechrome.github.io/samples/web-nfc/?
—
Reply to this email directly, view it on GitHub
<#653 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A57W2VK4HTTKWUDHTFXW7SLWYMSINANCNFSM6AAAAAAVA2OIHQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
*Thanks & Regards,*
*Ankit N. Raut.*
*Contact : +91-9764210234*
|
Can you share a screenshot of what kind of results you get? |
PFA.
…On Mon, Feb 20, 2023 at 3:19 PM François Beaufort ***@***.***> wrote:
Can you share a screenshot of what kind of results you get?
—
Reply to this email directly, view it on GitHub
<#653 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A57W2VM2MZFZIJRULE4JEVDWYM425ANCNFSM6AAAAAAVA2OIHQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
*Thanks & Regards,*
*Ankit N. Raut.*
*Contact : +91-9764210234*
|
Thank you! Now, where's the value you're trying to read? It looks like you only have one NDEF record for now. const ndef = new NDEFReader();
await ndef.write(0x1234); And for reading it, you could do: const textDecoder = new TextDecoder(record.encoding);
const text = textDecoder.decode(record.data);
console.log(text.toString(16)); // 1234
} FYI https://developer.chrome.com/articles/nfc/#read-and-write-a-text-record contains plenty of code examples. |
When i write data to card the i getting message "Argh! Network Error :
Failed to write due to an IO error : null"
Thanks,
Ankit.
…On Mon, Feb 20, 2023 at 4:15 PM François Beaufort ***@***.***> wrote:
Thank you! Now, where's the value you're trying to read? It looks like you
only have one NDED record for now.
If you wanted to write an hexadecimal value for instance, you could do
something like below:
const ndef = new NDEFReader();await ndef.write(0x1234);
And for reading it, you could do:
const textDecoder = new TextDecoder(record.encoding);const text = textDecoder.decode(record.data);console.log(text.toString(16)); // 1234}
FYI
https://developer.chrome.com/articles/nfc/#read-and-write-a-text-record
contains plenty of code examples.
—
Reply to this email directly, view it on GitHub
<#653 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A57W2VIWFBUDKTJP6DB5P7LWYNDLNANCNFSM6AAAAAAVA2OIHQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
*Thanks & Regards,*
*Ankit N. Raut.*
*Contact : +91-9764210234*
|
Then it means you can't write to this device right? Can you copy/paste the result of NDEF records you successfully read? |
Hi,
NDEF Record successfully read on device and running properly.
Can i running NDEF record without https.means can i run on http.
…On Mon, Feb 20, 2023 at 5:13 PM François Beaufort ***@***.***> wrote:
Then it means you can't write to this device right? Can you copy/paste the
result of NDEF records you successfully read?
—
Reply to this email directly, view it on GitHub
<#653 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A57W2VO3ENRDT7OK7TCSY6DWYNKELANCNFSM6AAAAAAVA2OIHQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
*Thanks & Regards,*
*Ankit N. Raut.*
*Contact : +91-9764210234*
|
It's only available in secure context, @ankitraut05 I'm using VSCode and using Ngrok and Live Server to make it work when developing. Just a little work the first time, and then it works smoothly. Here's a little bit more about the setup I use. |
#WebNFC I am using Web NFC in my project. i coming difficulties to read values from RFID card through scan card on nfc reader in Web application. can you help me for how to read hexadecimal, decimal (UUID) from RFID card.
The text was updated successfully, but these errors were encountered: