December 7, 2017 at 3:24 pm #2107
at the GCP project, where we’re testing the TrueRNG v3 cards at Linux (Raspebby Pi 3b), we’re having some trouble.
While the DD+diehard test works succesfully, and it is created a /dev/TrueRNG device that works properly, we try to open the device in a C program with a line “r = usb_claim_interface(handle, 0);” and we get an error “-1″. It is dismaying. We have three questions:
a) do you have any feedback or tip with this? How can we debug it?
b) with the Araneus card works properly. I’ve tried to cheat the program so it should think the TrueRNG was an Araneus but didn’t work. Do you imagine any solution in this way?
c) If not, we would be interested in simulate a COM or serial device with the TrueRNG, how can we do it? reading directly from /dev/TrueRNG?
Thanks.December 7, 2017 at 3:50 pm #2108December 7, 2017 at 3:51 pm #2109
Correction on prev msg:
the library “truerng-3.0″ is available at
Denis/December 7, 2017 at 4:14 pm #2111
Ok let me see if I’m following here;
usb_claim_interface sounds like is a libhid or libusb function. libusb lets you send raw usb urb’s from userland. Typically you would use libusb if a device had no kernel driver, or enumerated as a hid device just to satisfy the driver requirement but does the real work through special endpoint packets.
So to answer a) I’m not sure what library you’re using, but -1 means it couldn’t claim it, probably because the linux driver has a hold of it. Typically you would have to unload the usb serial driver / cdc_acm driver to make the claim happen.
which leads us to b) the Araneus Alea uses libusb to talk to the device, this isn’t needed with the Truerng.
c) The TrueRNG is already a virtual com port. You can open it and treat it like a standard serial port (with open / serial open apis) or use the library above that dgv suggested.
/dev/TrueRNG is a symlink to /dev/ttyACMx (x is 0-9) which is the same as a usb to serial connection.December 7, 2017 at 9:58 pm #2112
I confirm that usb_claim_interface is part of libusb.
What makes things fuzzy is that cenicero explicitly refers to /dev/TrueRNG, which is typically created by udev(7) on Linux.
It is then probable that libudev is installed on the system. Check with “pkg-config –cflags –libs libudev”.
If present, then using libusb is questionable; use libudev instead, or open directly /dev/TrueRNG for reading.
BTW, the configure script from the above library installation process chooses the best available method for opening/reading.
Denis/December 10, 2017 at 7:30 am #2113
Thank you. The fact that TrueRNG v3 can be read as a serial device helped a lot. I have written an article about how to use a TrueRNG with the GCP at this link:
Thanks for your quick and deep support.
You must be logged in to reply to this topic.