Hi all,
I have a project where I’m trying to read values from an external (USB-connected) RFID-reader, but I can’t get this working. The reader is a simple hid device that sends a numeric value (the rfid tag) and ‘enter’ on scanning a tag.
I wasn’t able to find anything directly related to this in the forums, which is why I’m posting this.
I’m using balenalib/raspberrypi3-debian-node:8.17.0-jessie-build as the base image. I know it’s old, but hx711 library (which is also required in this project) won’t compile against node 10, so I’m stuck with this at the moment.
I’ve tried using ‘usb’ node library and managed to start polling the reader but I wasn’t able to do anything with the stream (not enough skills on my side…). Also, ‘node-hid’ failed to work with electron (electron-rebuild didn’t help).
At the moment I have a workaround where I’m using Electron (this is used for other purposes as well, not only for the USB device) to read the values (using ‘keydown’ eventlistener) and pass them back to the main process, but I’d like to get this working without Electron as well, as most of the business logic is handled outside Electron and some applications may not require Electron at all.
All hints/tips would be greatly appreciated.
Cheers,
Aleksi