USB RFID reader not recognised by Inkey

Linux specific questions.
Post Reply
Dinosaur
Posts: 1496
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

USB RFID reader not recognised by Inkey

Post by Dinosaur »

Hi all

I have a usb rfid reader that basically shoves the char's into the keyboard buffer.
It is running on a Rpi Zero 2 W.
However in FB using Inkey it takes two attempts after a reboot to start working reliably.
That means the first login of the day has to be done twice.

The char show up as a 10 digit number terminated with a cr.
If I reboot and simply open terminal and scan a Tag, it works immediately.
If I run a Notepad type of program, it works correctly straight away as well.
In Geany it works immediately.

However with FB I need to scan it once , then scan it again to get the result.
After that it will work on the first go all day, until the next reboot.

I have reset the usb port to solve the problem to no avail .
The code below is simple enough.
It is almost like FB needs to see one transaction before it recognises it as keyboard input.

Code: Select all

        Keys = InKey
        If Asc(Keys) > 0 Then
            If Asc(Keys) = 27 Then QuitRun
            If Asc(Keys) >= &H30 Then
            	    Print Keys
                    RfidStr += Keys
                Else
                    If Asc(Keys) = &H0d Then
                        If Len(RfidStr) >= 10 Then
                            '--------------------------------------
This was not a problem when using it on a BeagleBone Black which uses a different FB variant.
Hopefully someone can shed some light on this.

Regards
Dinosaur
Posts: 1496
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: USB RFID reader not recognised by Inkey

Post by Dinosaur »

Hi All

An update on testing.
If I run the same software and the same Rfid reader and the same 3 port usb hub
on my laptop, there is no problem.

So considering that IF I use a Notepad type of app or CLI or Geany it works correctly,
the Rpi hardware is in the clear, leaving only the FB compiler for Rpi as the source of the problem ??

Regards
Edit: Same OS on all, Debian 12, although Raspian is customised.
Post Reply