USB driver and functions

I am new here, and just received my new router from Amazon. Apparently it is the 6416 model, although that’s not on the label.

I really like that the router supports sharing USB devices connected to it, and I would like to extend that if possible. When I connect a USB storage device, I see that device appear immediately in the router’s web interface. However, when I connect the USB port of my camera to the router, it is not recognized - I see nothing.

Can this be added? If so, what changes are needed?

Thank You!

I will try self-help, posting here as I move forward.

Since the router runs Linux, it should be possible to create driver for camera. I will assume this to be kernel driver, and proceed accordingly.

When I connect camera to Ubuntu, it seems that no driver currently registered for it. I assume this is also true for router. Attached picture shows Ubuntu reaction to camera connection to USB port, and lsusb gives some information.

Then I run lsusb -v to get more details (see below)

So it seems the correct line to pursue is to develop a Linux kernel driver that will talk to camera. I hope that will be enough to allow the GL-iNet router to serve as a wifi interface to the camera. If anyone thinks differently, please let me know.

lsusb -v
Bus 001 Device 008: ID 04a9:323a Canon, Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x04a9 Canon, Inc.
idProduct 0x323a
bcdDevice 0.02
iManufacturer 1 Canon Inc.
iProduct 2 Canon Digital Camera
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 2mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 6 Imaging
bInterfaceSubClass 1 Still Image Capture
bInterfaceProtocol 1 Picture Transfer Protocol (PIMA 15470)
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0001
Self Powered

I saw you have a canon camera, does it support UVC or YUV?
In openwrt there are a lot of drivers, but only UVC/YUV is installed. You can search kmod-video in the web UI soft repo page and you may find and install other drivers and have a try.

I do not believe that Canon supports UVC or YUV*, but will take more effort to verify. Zach Poff states that Canon (and other DSLR mfrs) use various proprietary formats for their Live View functions. He references two projects that claim to do this using Syphon, but both appear non-maintained. Also mentioned is possibility of using libraries supplied by Canon, but license incompatibility would prevent its inclusion in open source projects.

*dmesg output:
[33431.104068] usb 1-1: new high-speed USB device number 9 using ehci-pci
[33431.238650] usb 1-1: New USB device found, idVendor=04a9, idProduct=323a
[33431.238658] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[33431.238664] usb 1-1: Product: Canon Digital Camera
[33431.238670] usb 1-1: Manufacturer: Canon Inc.

Possible work-arounds:

  1. The magic lantern project has developed their own Magic Lantern Video format (MLV). This may be one way to deliver Live View function to new applications.

  2. To support existing commercial applications (Canon EOS Utility, Capture One), it is possible to pack & ship raw data over wifi, and reformat as USB at receiving end. This may require spoofing a USB interface at PC to look like camera.

I am posting to close this thread. There is a product named “VirtualHere” that does what I wanted. It is not open source, but here is how to get it:

From the command line/SSH:

wget http://www.virtualhere.com/sites/default/files/usbserver/vhusbdmips
sudo chmod +x ./vhusbdmips
sudo ./vhusbdmips -b 

If you wish to start it each time your system boots, there are further instructions at the VirtualHere website that may help.

VirtualHere allows USB devices to be used remotely over a network just as if they were locally connected!

So, it doesn’t need a local USB video driver on openwrt, right?

I’m not sure of that statement. I guess it depends on what you are trying to do.

@alzhao: According to their website you’re right: https://www.virtualhere.com/

VirtualHere allows USB devices to be used remotely over a network just as if they were locally connected!

And on this page they say you don’t need to compile or add kernel modules: Linux USB Server | VirtualHere

This is interesting because I don’t know how can a user space program connect to the hardware without a kernel driver. Maybe need to test.

Have you been able to build this into a custom firmware?

AFAIK, it is not necessary to build VirtualHere into the router’s firmware. I simply downloaded and “installed” the “VirtualHere” binary on my router. With this setup, I am able to remotely control my camera over a wifi link to my iPhone or Mac, including getting the LiveView on my iPhone/Mac.

I’ve forgotten many of the details, as this was some time ago, and I’ve not needed or used this much since then. But I do recall getting this working was not difficult. In fact, the hardest part was working with the clunky Ethernet setup in my Canon camera!

Has anyone made a headway with an elementary cookbook for how to integrate VirtualHere into ever changing versions of OpenWRT? Or is there yet any software packages that offer a similar function? The author’s price is $49 for supporting more than one device is a single use license which is beyond the common hobbyist budget since you need a license everywhere you use it. That software cost is often twice the price of the router itself.