0

I might have read every possible post regarding this topic, but I have never found a clear answer.
I face the following scenario: I have a remote Raspberry Pi 4 connected to an actively powered USB hub with 7 positions. 6 brand new USB webcams are connected to this hub and the hub is plugged into the Raspberry Pi. This is a remote situation and I can not just plug in and out the power cable whenever I want.

Important: Yes this setup does work. It is not limited by USB or power bandwidth limitations because I set this up two days ago, and it worked until now.
Today I have rebooted the Pi. Now only 2 of my 6 webcams are shown when using lsusb. Output here:

Bus 002 Device 003: ID 0bda:0411 Realtek Semiconductor Corp.
Bus 002 Device 002: ID 0bda:0411 Realtek Semiconductor Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 009: ID 1224:2a25
Bus 001 Device 004: ID 0bda:5411 Realtek Semiconductor Corp.
Bus 001 Device 011: ID 1224:2a25
Bus 001 Device 003: ID 0bda:5411 Realtek Semiconductor Corp.
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I know that the ones with 1224:2a15 are my webcams because previously 6 of these were shown and i looked into it via v4l2.
Even more weird is the output of ls -l /dev/video*:

crw-rw---- 1 root video 81,  7 Mar 31 17:01 /dev/video0
crw-rw---- 1 root video 81,  8 Mar 31 17:01 /dev/video1
crw-rw---- 1 root video 81,  0 Mar 31 16:18 /dev/video10
crw-rw---- 1 root video 81,  5 Mar 31 16:18 /dev/video11
crw-rw---- 1 root video 81,  6 Mar 31 16:18 /dev/video12
crw-rw---- 1 root video 81,  1 Mar 31 16:18 /dev/video13
crw-rw---- 1 root video 81,  2 Mar 31 16:18 /dev/video14
crw-rw---- 1 root video 81,  3 Mar 31 16:18 /dev/video15
crw-rw---- 1 root video 81,  4 Mar 31 16:18 /dev/video16
crw-rw---- 1 root video 81,  9 Mar 31 17:02 /dev/video2
crw-rw---- 1 root video 81, 10 Mar 31 17:02 /dev/video3   

There are many more devices than there are actual webcams but only two give me images when I use fswebcam -d /dev/video*

My Question:

  1. Is there any way such that I can make my Raspberry Pi find the missing webcams without the need to physically interact with it.
  2. If 1. is not the case, is there any way such that I can setup the raspberry such that I only have to physically interact with it once and from that point on it finds the webcams until it gets rebooted. Because I know I already had this problem in the past with a different Raspberry and the only method to get it working was "Rebooting and praying until it works".
    Please Help.
Pascal
  • 1
  • 1
  • "It is not limited by USB or power" -> Possibly it is; the cameras keep going offline then coming back on again (which is when they get a new dev node). The system logs (check /var/log/syslog and dmesg) probably have more clues about this. – goldilocks Mar 31 '21 at 19:37
  • To clarify: The behaviour you describe does not appear. No going offline and coming back online of any kind. I am taking images periodically. 20 images per camera over a period of 120 seconds. Then the next camera in a continuous loop. This went on for 2 days without any camera every failing. Followed by exactly one reboot. Since the reboot only 2 of the 6 cameras appear in lsusb. I have 2 days of logs that tell me that power is not the issue but the reboot is. – Pascal Mar 31 '21 at 19:51
  • Why do you need that many webcams? xD – Achak Claw Mar 31 '21 at 20:38
  • Unpublished research from the veterinary faculty of the university of Munich so forgive me if I spare the details of the purpose. – Pascal Mar 31 '21 at 20:44
  • 1
    You can power the USB ports of the Pi on and off in software (differs by Pi version but https://github.com/mvp/uhubctl is a starting point) and that may help. Be aware this may kill the connection to the Pi as some models have shared hubs onboard. As for why? No ideas I am afraid other than Linux USB is poor in my opinion. It may be worth looking to a controllable hub and bring each webcam up individually with a few seconds between them at power on. –  Mar 31 '21 at 21:37
  • So, after trying many things, bringing them up individually was after all the only thing that worked, but I tried out uhubctl, and it actually managed to activate and deactivate individual USB ports. Sadly this did not solve the problem. Still, it is exactly what I was looking for. Could formulate this again as an answer, so I can verify it as being the correct answer for everyone in the future running into similar issues? – Pascal Apr 15 '21 at 07:09

0 Answers0