Libusb-compat package fails to install usb.h

This is either a problem with the LEDE libusb-compat package, or user error.
I installed the libusb-compat-0.1 package but it did not put the usb.h file on the system.

Some distros, put usb.h in a separate devel package, but I did not see one for LEDE, so I expect it to be in libusb-compat.

GL-AR300M ext with 2.27 nand firmware. Goal to connect and program a Teensy 3.2 via usb. Doing that first requires compiling from source a small loader program at I decided to do that right on the GL-AR300M.
Added packages libudev, yunbridge, nano, usbutils, binutils, gcc, libusb-1.0, libusb-compat-0.1
Hello World compiled fine. Compiling the loader failed with fatal error: usb.h: No such file or directory. Further details here.
find -name “usb.h” returned only the usb.h file intended for the teensy target inside rebootor directory. Not the one I need.

Didn’t have time to try. Hope I can try tomorrow

Seems you want to compile the program directly on the router. You should cross compile via toolchain.

I have tried and this works. Please check the source code. You need to put the package in your openwrt in your Linux machine and compile this package.

I compile a binary but I have no idea of how it work. Pls check by your own.

I think you missed the point in the title. I installed the libusb-compat package via luci. Among other things, that package should have installed a file called usb.h (somewhere in /usr ) which my project requires at runtime as well as during compilation. I believe it cross compiled because the development machine has its own architecture dependent usb.h. I require a usb.h path on the target, the AR-300M, which will later become a host, used to reprogram microcontrollers in the field.

I am a first time user of this library, so I may have misconceptions, but others have run up against the same roadblock and been unable to proceed for this same reason. Any guidance here could help serve as missing user documentation. I would appreciate any input from someone familiar with the use of the library.

Let’s make it simple,

are you trying to run teensy_loader_cli on AR300M?

If yes, then it is what I have told you to do. To compile the program, you should have a cross compile toolchain rather than compile it directly on the router.

But as you have done this I hope it can work. You can just download the usb.h from libusb-compat and put it in /usr/include, but I cannot confirm it will work. The reason that there is no usb.h in the firmware is that, the router is a lightweight linux. It is used to run program but not compile program.

Thanks, I really appreciate your help. I need one more detail so I can test. How do I include the makefile you wrote into the firmware build?

I’ve downloaded GitHub - gl-inet/lede-17.01: Cloning from;a=summary and adding patches for GL's new devices to lede-17.01.
followed instructions here Overview - GL.iNet Docs to build the toolchain, sdk, image builder, and select the nand target, that build was successful.
Found the libusb-compat package and added it to my .config.
Confirmed I was able to generate firmware compatible with my hardware.
Updated and downloaded the feeds which brought in gli-pub/teensyloader at master · gl-inet/gli-pub · GitHub
However, I cannot find the teensyloader package in menuconfig. How do I select it to add to the firmware build.

I’m sure it is very simple and probably explained somewhere, but after 2 days searching I still haven’t found it. Me feeling really dumb right now, but very grateful.

edit: Yes, I am trying to run teensy_loader_cli on AR300M. It is used to load a precompiled .elf file onto an Arduino compatible called Teensy which has a different bootloader than other Arduinos. If this works, we will next be able to port over GitHub - PaulStoffregen/BridgeUSB which will complete a journey started at Combining teensies with the Arduino Yun to make a better 2 piece Arduino Yun