# USB RFID reader

**URL:** <https://discourse.nodered.org/t/usb-rfid-reader/92927>\
**Category:** General\
**Created:** [5 November 2024 16:36 UTC](https://discourse.nodered.org/t/usb-rfid-reader/92927 "2024-11-05T16:36:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Buzzylogic](https://avatars.discourse-cdn.com/v4/letter/b/f17d59/32.png) [@Buzzylogic](https://discourse.nodered.org/u/Buzzylogic)\
**Post date:** [5 November 2024 16:36 UTC](https://discourse.nodered.org/t/usb-rfid-reader/92927/1 "2024-11-05T16:36:30Z")

</div>

I bought a reader off Amazon, it is reading with @gdziuba/node-red-usbhid, but the output appears to be gibberish even using the hex to string in the example flow. Any ideas? It outputs 22 values, the card scan value is 0461851553  
[0,0,39,0,0,0,0,0]  
[0,0,0,0,0,0,0,0]  
[0,0,33,0,0,0,0,0]  
[0,0,0,0,0,0,0,0]  
[0,0,35,0,0,0,0,0]  
[0,0,0,0,0,0,0,0]  
[0,0,30,0,0,0,0,0]  
[0,0,0,0,0,0,0,0]  
[0,0,37,0,0,0,0,0]  
[0,0,0,0,0,0,0,0]  
[0,0,34,0,0,0,0,0]  
[0,0,0,0,0,0,0,0]  
[0,0,30,0,0,0,0,0]  
[0,0,0,0,0,0,0,0]  
[0,0,34,0,0,0,0,0]  
[0,0,0,0,0,0,0,0]  
[0,0,32,0,0,0,0,0]  
[0,0,0,0,0,0,0,0]  
[0,0,40,0,0,0,0,0]  
[0,0,0,0,0,0,0,0]

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/c/9caa2d5b266dc64c601aa96f8233fb7ecf31f82a.png)

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [5 November 2024 19:11 UTC](https://discourse.nodered.org/t/usb-rfid-reader/92927/2 "2024-11-05T19:11:51Z")

</div>

I like ones like this.

As this is a USBHID device:  
Let's first put up the USBHID Map.

 ![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/9/79f2c6e4652ce68d76768748e0615e0669d1cc81.png)  
The arrays are HID Reports, each representing the following:

```auto
[Modifier, Reserved, Keycode1, Keycode2, Keycode3, Keycode4, Keycode5, Keycode6]

```

And finally....

39: "0"  
33: "4"  
35: "6"  
30: "1"

See where I am going with this 🤓

- For each array you receive, extract the 3rd element (where 0 - can be ignored)
- Once you have hit the length of elements you're expecting
  - Convert each HID code to its ASCII value (you may need to find a better table, then my image)

There might be better ways here of course, but I fancied getting dirty

**EDIT**

* * *

Code 40 is **ENTER** - Therefore you might not need to know the length, but instead stop/convert when you get this code in the array- as it seems to be present

- For each array you receive, extract the 3rd element (where 0 - can be ignored)
- When you get the code **40** - convert each element that you extracted / convert them = your card value

---

<div class="post-metadata">

**Author:** ![Buzzylogic](https://avatars.discourse-cdn.com/v4/letter/b/f17d59/32.png) [@Buzzylogic](https://discourse.nodered.org/u/Buzzylogic)\
**Post date:** [5 November 2024 20:30 UTC](https://discourse.nodered.org/t/usb-rfid-reader/92927/3 "2024-11-05T20:30:28Z")

</div>

Thank you so much! I knew this was the right place to ask 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [3 February 2025 20:30 UTC](https://discourse.nodered.org/t/usb-rfid-reader/92927/4 "2025-02-03T20:30:59Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
