Problem retrieving serial number from webcam


#1

Hey lovely people. First post here, sorry to be a pain.
I have a pi3 connected to 2 printers, and now I am trying to connect 2 webcams for the 2 printers. I found This Tutorial by Chris https://youtu.be/sCxvW1XX44U and I'm already stuck. I'm trying to get info off my webcams to write a couple udev rules to distinguish between the 2.
My webcams are both logitech c170, so the only difference would be the serial number. I'm running the command "tail -F /var/log/messages", plug my camera one at a time and I get the log, but no serial number. When Chris does it in the video, it shows the serial number (although he's using the C270 cams).
Am I missing something?

This is what I get when I plug the cam in (I haven't included the whole lot, just the bit where the serial number is supposed to be in).

May 29 05:13:19 octopi kernel: [ 259.048906] usb 1-1.2: new high-speed USB device number 8 using dwc_otg
May 29 05:13:19 octopi kernel: [ 259.252416] usb 1-1.2: New USB device found, idVendor=046d, idProduct=082b
May 29 05:13:19 octopi kernel: [ 259.252430] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
May 29 05:13:19 octopi kernel: [ 259.252438] usb 1-1.2: Product: Webcam C170
May 29 05:13:19 octopi kernel: [ 259.252446] usb 1-1.2: Manufacturer:
May 29 05:13:19 octopi kernel: [ 259.254713] uvcvideo: Found UVC 1.00 device Webcam C170 (046d:082b)
May 29 05:13:19 octopi kernel: [ 259.264977] uvcvideo 1-1.2:1.0: Entity type for entity Processing 2 was not initialized!
May 29 05:13:19 octopi kernel: [ 259.264997] uvcvideo 1-1.2:1.0: Entity type for entity Extension 6 was not initialized!
May 29 05:13:19 octopi kernel: [ 259.265009] uvcvideo 1-1.2:1.0: Entity type for entity Camera 1 was not initialized!
May 29 05:13:19 octopi kernel: [ 259.265567] input: Webcam C170 as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/input/input2

I have tried running this command with printers un-plugged as well, with same results.
At the end of the day I need to create 2 dev rules just like I did with my printers and I have nothing that's different to be able to use.

Any help would be awesome
Thanks guys


#2

normally with only 2 cams serials are not needed / you can create udev rules based on the bus id.

to check on which ports they are connected type:

lsusb -t

but it also looks like the cam is not initialized.
If you are using a ARM based Computer use an active usb hub.


#3

Both the printers and cams are connected directly to the pi, all 4 ports


#4

I'm using the pi3B, and using all 4 ports, 2 for the cams and 2 for the printers


#5

I have just found out that the C170 does not have serial numbers and will have to just use the dev paths. Because I am very new to this, I don't know how to get the dev path, and I ran that command you said and I got this

Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
|__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
|__ Port 2: Dev 11, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 2: Dev 11, If 3, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 2: Dev 11, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 2: Dev 11, If 2, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 3: Dev 12, If 2, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 3: Dev 12, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 3: Dev 12, If 3, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 3: Dev 12, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 5: Dev 6, If 0, Class=Vendor Specific Class, Driver=ftdi_sio, 12M

How would I put that as a rule?


#6

you got:

then you can do:

ACTION=="add", DEV=="/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0", SYMLINK+="CamPrinter1"

you have to check out where the other cams shows up -> port 3
maybe

ACTION=="add", DEV=="/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0", SYMLINK+="CamPrinter1"
ACTION=="add", DEV=="/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0", SYMLINK+="CamPrinter2"

#7

Thanks danielkrah,
I will check it out. Seems like I can't power both webcams at the same time. I might see if I can find a powered hub and try that.
So as long as I get this right

I should be able to just change the SYMlink name and add those rules to 99-usb.rules??? or another file?
Also, if this works for me, will I need to have each webcam plugged into the same USB port or it won't matter?


#8

if you leave them always in the same port it should not matter and it should work.

I had issues with cubieboards and older raspberries with usb dvb sticks, usb hdd's.
the got lost after some weeks of usage / and then i didn't get them to work unless i reinstalled the OS.
A external powered usb Hub solved this issue.
So it is always a good idea to use an active hub.

Yes you can name it as you want and the place should be the right one.


#9

Thanks. I will let you know. You're a champ