Community
cancel
Showing results for 
Search instead for 
Did you mean: 
JTurn12
New Contributor II
1,321 Views

Initiate USB connection without plugging in

Jump to solution

Hi there,

I have a webcam on the galileo that always shows up as /dev/video0 when i plug the USB in.

However, if i have to reboot the Galileo that device is no longer recognized, so I have to unplug the usb, then plug it back in. Is there any way to initiate that connection again through the command line?

Thanks

1 Solution
Sergio_A_Intel
Employee
167 Views

Hi,

You can try the option to load the kernel module at boot. First, make sure the kernel module is loaded using lsmod. The module used for USB should be called usb_storage or something similar. Now, the kernel modules that are loaded at boot are listed under /etc/modules-load.d/. Each configuration file is in the style of /etc/modules-load.d/.conf. In my case I just have a file named bsp.conf. So, create a .conf file and write the name of the kernel module. This will make that specific module load at boot.

Let me know your results.

Sergio

View solution in original post

7 Replies
Sergio_A_Intel
Employee
168 Views

Hi,

You can try the option to load the kernel module at boot. First, make sure the kernel module is loaded using lsmod. The module used for USB should be called usb_storage or something similar. Now, the kernel modules that are loaded at boot are listed under /etc/modules-load.d/. Each configuration file is in the style of /etc/modules-load.d/.conf. In my case I just have a file named bsp.conf. So, create a .conf file and write the name of the kernel module. This will make that specific module load at boot.

Let me know your results.

Sergio

View solution in original post

JTurn12
New Contributor II
167 Views

So several modules load once pluggin in the USB camera.

Here is a before and after.

I created .conf files for all the ones that showed up after plugging in, but that might not have been smart. It didn't work.

Before plugging in

root@galileo:~# lsmod

Module Size Used by

rfcomm 33127 2

bnep 17673 2

g_acm_ms 34390 5

libcomposite 24064 1 g_acm_ms

usbhid 23097 0

arc4 12536 2

usb_storage 46592 0

pppoe 17501 0

pppox 12980 1 pppoe

ppp_generic 23216 2 pppoe,pppox

slhc 12965 1 ppp_generic

iwldvm 128284 0

led_class 13282 1 iwldvm

pch_udc 31342 0

stmmac 48256 0

mac80211 413153 1 iwldvm

udc_core 14227 2 libcomposite,pch_udc

ohci_hcd 26434 0

iwlwifi 81402 1 iwldvm

cfg80211 432893 3 iwlwifi,mac80211,iwldvm

gpio_sch 17990 0

evdev 17377 2

ehci_pci 12656 0

ehci_hcd 44417 1 ehci_pci

adc1x8s102 12766 0

industrialio_triggered_buffer 12686 1 adc1x8s102

kfifo_buf 13032 1 industrialio_triggered_buffer

industrialio 43200 3 industrialio_triggered_buffer,adc1x8s102,kfifo_buf

spi_pxa2xx 21680 0

spi_pxa2xx_pci 13049 1 spi_pxa2xx

spidev 13053 0

efivars 22958 0

i2c_dev 13142 0

btusb 17915 0

pca9685 13582 0

regmap_i2c 12714 1 pca9685

gpio_pca953x 17384 3

bluetooth 196274 26 bnep,btusb,rfcomm

rfkill 20731 5 cfg80211,bluetooth

intel_qrk_gip 20101 3

usbcore 144164 6 btusb,usb_storage,ohci_hcd,ehci_hcd,ehci_pci,usbhid

uio 18508 2 intel_qrk_gip,gpio_sch

usb_common 12481 3 udc_core,libcomposite,usbcore

at24 12949 0

ipv6 252405 20

After..............................................................................................................................

root@galileo:~# lsmod

Module Size Used by

snd_usb_audio 114864 0

snd_usbmidi_lib 24085 1 snd_usb_audio

snd_rawmidi 24209 1 snd_usbmidi_lib

snd_hwdep 13232 1 snd_usb_audio

snd_pcm 73516 1 snd_usb_audio

uvcvideo 71190 0

snd_page_alloc 13852 1 snd_pcm

videobuf2_vmalloc 12875 1 uvcvideo

snd_timer 23716 1 snd_pcm

videobuf2_memops 12873 1 videobuf2_vmalloc

videobuf2_core 37680 1 uvcvideo

snd 47628 6 snd_usb_audio,snd_hwdep,snd_timer,snd_pcm,snd_rawmidi,snd_usbmidi_lib

soundcore 12562 1 snd

videodev 91716 2 uvcvideo,videobuf2_core

rfcomm 33127 2

bnep 17673 2

g_acm_ms 34390 5

libcomposite 24064 1 g_acm_ms

usbhid 23097 0

arc4 12536 2

usb_storage 46592 0

pppoe 17501 0

pppox 12980 1 pppoe

ppp_generic 23216 2 pppoe,pppox

slhc 12965 1 ppp_generic

iwldvm 128284 0

led_class 13282 1 iwldvm

pch_udc 31342 0

stmmac 48256 0

mac80211 413153 1 iwldvm

udc_core 14227 2 libcomposite,pch_udc

ohci_hcd 26434 0

iwlwifi 81402 1 iwldvm

cfg80211 432893 3 iwlwifi,mac8021...

Sergio_A_Intel
Employee
167 Views

You only need to create the .conf file for the module you need to be enabled at boot, in this case usb_storage. Create a file named usb_storage.conf inside of /etc/modules-load.d/. This usb_storage.conf should contain just the name of the kernel module you need to have enabled, in this case usb_storage.

You can see more information here https://wiki.archlinux.org/index.php/kernel_modules https://wiki.archlinux.org/index.php/kernel_modules

Sergio

JTurn12
New Contributor II
167 Views

Thanks Sergio,

I suppose I'm asking the wrong question. The usb_storage module loads on boot.

What I'm trying to get to load on boot is my usb webcam. The /dev/video0 device is not listed when i reboot, even when I created a usb_storage.conf file.

idata
Community Manager
167 Views

I believe this is a known issue. Other users have reported the same behavior. There are no guides to specifically resolve this issue. There is, however a workaround that you might find useful. I haven't done this myself but the general idea is to create a small circuit between the USB port and the USB device that acts as a switch that receives on/off signals from a gpio. This gpio would then be configured so that every time the board reboots, simulate as if the USB port has just been connected by toggling it from low to high and vice versa.

 

 

Sergio

 

JTurn12
New Contributor II
167 Views

Yeah I was thinking of something like that as well.

I also found this reference from the raspi guys, a very similar issue there. I'm pretty sure the problem lies with the order at boot loading.

I tried these steps, but didn't manage to get it. I may have to give it a few more attempts, i'll report back if i get it.

http://ubuntuforums.org/archive/index.php/t-1686635.html [SOLVED] USB Webcam - must unplug and plug after boot up [Archive] - Ubuntu Forums

idata
Community Manager
167 Views

Hi BMEJ,

 

 

Please keep us updated with the progress of your project.

 

 

Sergio

 

Reply