Hi folks, I recently got my hands on an MED100KX8 100 kHz device (Thanks Scott). I’ve invested so far an immense amount of time in trying to get it working, and could use some help.
I think it’s important to first highlight that I am using a Macbook Pro with an M2 chip. The M2 chips use an ARM64 architecture, which generally results in lots of compatibility issues with older software as they only have x86 or x64 drivers (sometimes even i386, but rarely arm64). Natively I am running macOS 13.3.1, but using Parallels have created virtual machines that run Windows 11 and Ubuntu Linux 22.04. I’d ideally like to get the RNG working in macOS, but at this point would settle for getting it working anywhere.
Summary of where I’m at by operating system:
Windows 11: I can successfully run QNG360_SETUP.exe, but get an error that QWQNG.DLL failed to load. The QNG Meter program opens but am not able to get it to find the device. When I try to run either QNG File Maker or QNG Report a terminal window pops up and immediately closes. I can see the MED100KX8100 device in Device Manager with a driver error. When I check the driver options there are various architecture options but none for ARM64. I can successfully load generic SB Serial Converter drivers, but that doesn’t really help me run any of the programs (QNGmeter still finds no devices). Interestingly, I tried this also on an older Macbook that has an Intel (x86) chip. I used Bootcamp to install Windows 10. I am seeing all the same behaviors (only able to load generic serial drivers).
macOS: I tried to manually build libqwqng in macOS. After modifying the makefile and manually copying ftdi.h I was able to get cmake to complete, but then the subsequent “make” command fails due to missing libftdi1.so and libusb-1.0.so in /usr/local/lib/. I was never able to resolve this, even after using brew to install packages: libftdi, libftdi0, libfido2, libomp, llvm, libusp, and also manually building and installing the libftdi and libusb packages in macOS. I noticed that the two missing files (libftdi1.so and libusb-1.0.so) were present in my Ubuntu instance and so copied them over to macOS but then received errors for unsupported file formats and lots of missing references. Stuck there.
Ubuntu: The linux software for libqwqng contains a script to build/install packages for Ubuntu, which is why I went with Ubuntu. After working through a number of errors I got the script to complete successfully and was able to manually build libqwqng (which I never succeeded in doing in macOS). However, what I’m left with are C++ files (not compiled files as the documentation suggests), and so far have not been able to get the C++ files to compile using G++. I’ve worked through at least a dozen different errors but in the end am stuck on this error: here.
Interestingly, if I copy the entire directly from Ubuntu over to macOS and try to compile there with G++ (using the qwqng build done by Ubuntu) then I get very similar errors, but fewer. That looks like this.
Starting now to get a little creative, and in response to one of Scott’s suggestions, I head back to macOS and try a different approach. Perhaps I can avoid using libqwqng altogether and directly interact with the device. I have two other RNG devices that work by simply using Python code to listen for input on the serial port. I am able to connect to the MED100KX8100 device like this also, but it produces no output. It seems that, unlike my other devices, I need to send some command to have the device transmit data. I expect I need to use some FTDI library for this. I installed the following packages: ftdi-vcp-driver, pyftdi, ftd2xx, pylibftdi. I’m able to use each of this in different ways to successfully connect to the device and get device info, serial, product ID, etc. So that’s a good sign.
Interestingly, one of them in particular seems to cause data to start flowing immediately after connection. This Python code…
import pyftdi.serialext
# Open a serial port on the second FTDI device interface (IF/2) @ 3Mbaud
port = pyftdi.serialext.serial_for_url('ftdi://ftdi:232:QWR4E010/1', baudrate=3000000)
# Receive bytes
data = port.read(1024)
print(f'{data}')
…produces output that looks like this. That looks like bytecode, and should be bytecode, but whenever I try to convert it to ASCII or string, or anything readable it fails for syntax errors.
Looking through the various sources files I found qwqng.hpp, which seems to have raw instructions for sending to the FTDI device. For example line 48 is:
#define FTDIDEVICE_START_COMMAND_ 0x96U
I tried sending some of these commands via the .write function but I wasn’t seeing anything happen different.
So, my questions…
- Do I need to send these commands, and if so using what syntax?
- Is the bytecode I’m receiving really bytecode, and if so can I use this somehow?
- Any other advice for getting qwqng working on any of my three operating systems rather than trying to hack it like this?
I think I’m basically stuck at this point and would really appreciate any help. Thanks in advance.