Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.




102 posts

Master Geek

Trusted

#195614 26-Apr-2016 17:57
Send private message

I have a Pi running a weather station and four identical cameras (look at nzfi.avmet.nz if interested). The cameras are /dev/video0, /dev/video1,/dev/video2,/dev/video3.  They are identical right down to each having the same serial number.

 

If I reboot the system, the allocation of cameras to video numbers can be a bit random. I would like each camera to always have the same /dev/videox because I treat each pic differently. I understand this calls for a bit of udev rule stuff. I have to make rules that are based on which port the camera is plugged in to - there are no other distinguishing features.

 

I found this .... seems to be just what I am looking for

 

===========================================

 

If you are not going to be rearranging where they're plugged in then you can do something like:
BUS="usb", ID=="1-4.2:1.0", SYMLINK+="ttyUSBport2"
BUS="usb", ID=="1-4.3:1.0", SYMLINK+="ttyUSBport3"
BUS="usb", ID=="1-4.4:1.0", SYMLINK+="ttyUSBport4"
etc. This works as no matter what order they're initialized in their place on the physical bus is not going to change (unless you unplug one and plug it in somewhere else). I think the ID means controller 1, position 4 (which is a hub), hub port 2 (or 3 or 4), device 1.

 

============================================

 

Here is what lsusb tells me

 

Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. 

 

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

Bus 001 Device 012: ID 19d2:0117 ZTE WCDMA Technologies MSM

 

Bus 001 Device 009: ID 0bda:58bb Realtek Semiconductor Corp.

 

Bus 001 Device 011: ID 0bda:58bb Realtek Semiconductor Corp.

 

Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.

 

Bus 001 Device 004: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB

 

Bus 001 Device 005: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB

 

Bus 001 Device 006: ID 1941:8021 Dream Link WH1080 Weather Station / USB Missile Launcher

 

Bus 001 Device 008: ID 0bda:58bb Realtek Semiconductor Corp.

 

Bus 001 Device 010: ID 0bda:58bb Realtek Semiconductor Corp.

 

The cameras are 8,9,10,11

 

Physically this is a Pi model B with four USB ports. One of them is connected to an 8-port hub, the others are empty. The devices (weather station, modem and cameras) are plugged in to the hub.

 

lsusb-t tells me

 

/:  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=vend., Driver=smsc95xx, 480M

 

|__ Port 3: Dev 4, If 0, Class=hub, Driver=hub/4p, 480M

 

|__ Port 1: Dev 5, If 0, Class=hub, Driver=hub/4p, 480M

 

|__ Port 2: Dev 12, If 0, Class=vend., Driver=option, 480M

 

|__ Port 2: Dev 12, If 1, Class=vend., Driver=option, 480M

 

|__ Port 2: Dev 12, If 2, Class=vend., Driver=option, 480M

 

|__ Port 3: Dev 9, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M

 

|__ Port 4: Dev 11, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M

 

|__ Port 2: Dev 6, If 0, Class=HID, Driver=usbfs, 1.5M

 

|__ Port 3: Dev 8, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M

 

|__ Port 4: Dev 10, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M

I can't figure the ID=="a-b.c:d.0" bit of the rule for devices 8,9,10,11 ....

IB

 

 

 

 

 


Create new topic

gzt

11542 posts

Uber Geek

Lifetime subscriber

  #1542383 26-Apr-2016 18:56
Send private message

No idea. This guy did it by incorporating device serial number:

http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/

Advantage you can move host/hub etc but maybe not all devices will have a serial.



102 posts

Master Geek

Trusted

  #1542384 26-Apr-2016 19:02
Send private message

Unfortunately the serial #s are all the same .... the relvant bits from usb-devices ...

 


T: Bus=01 Lev=04 Prnt=05 Port=02 Cnt=02 Dev#= 9 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0bda ProdID=58bb Rev=58.01
S: Manufacturer=Generic
S: Product=FULL HD 1080P Webcam
S: SerialNumber=200901010001
C: #Ifs= 4 Cfg#= 1 Atr=80 MxPwr=500mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=0e(video) Sub=01 Prot=00 Driver=uvcvideo

T: Bus=01 Lev=04 Prnt=05 Port=03 Cnt=03 Dev#= 11 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0bda ProdID=58bb Rev=58.01
S: Manufacturer=Generic
S: Product=FULL HD 1080P Webcam
S: SerialNumber=200901010001
C: #Ifs= 4 Cfg#= 1 Atr=80 MxPwr=500mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=0e(video) Sub=01 Prot=00 Driver=uvcvideo

T: Bus=01 Lev=03 Prnt=04 Port=02 Cnt=03 Dev#= 8 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0bda ProdID=58bb Rev=58.01
S: Manufacturer=Generic
S: Product=FULL HD 1080P Webcam
S: SerialNumber=200901010001
C: #Ifs= 4 Cfg#= 1 Atr=80 MxPwr=500mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=0e(video) Sub=01 Prot=00 Driver=uvcvideo

T: Bus=01 Lev=03 Prnt=04 Port=03 Cnt=04 Dev#= 10 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0bda ProdID=58bb Rev=58.01
S: Manufacturer=Generic
S: Product=FULL HD 1080P Webcam
S: SerialNumber=200901010001
C: #Ifs= 4 Cfg#= 1 Atr=80 MxPwr=500mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=0e(video) Sub=01 Prot=00 Driver=uvcvideo

 

 


 
 
 
 


gzt

11542 posts

Uber Geek

Lifetime subscriber

  #1542394 26-Apr-2016 19:30
Send private message

The address required looks similar to the output of 'udevadm monitor':

http://www.crashcourse.ca/wiki/index.php/Udev

Requires device insertion.

Create new topic




News »

Freeview On Demand app launches on Sony Android TVs
Posted 6-Aug-2020 13:35


UFB hits more than one million connections
Posted 6-Aug-2020 09:42


D-Link A/NZ extends COVR Wi-Fi EasyMesh System series with new three-pack
Posted 4-Aug-2020 15:01


New Zealand software Rfider tracks coffee from Colombia all the way to New Zealand businesses
Posted 3-Aug-2020 10:35


Logitech G launches Pro X Wireless gaming headset
Posted 3-Aug-2020 10:21


Sony Alpha 7S III provides supreme imaging performance
Posted 3-Aug-2020 10:11


Sony introduces first CFexpress Type A memory card
Posted 3-Aug-2020 10:05


Marsello acquires Goody consolidating online and in-store marketing position
Posted 30-Jul-2020 16:26


Fonterra first major customer for Microsoft's New Zealand datacentre
Posted 30-Jul-2020 08:07


Everything we learnt at the IBM Cloud Forum 2020
Posted 29-Jul-2020 14:45


Dropbox launches native HelloSign workflow and data residency in Australia
Posted 29-Jul-2020 12:48


Spark launches 5G in Palmerston North
Posted 29-Jul-2020 09:50


Lenovo brings speed and smarter features to new 5G mobile gaming phone
Posted 28-Jul-2020 22:00


Withings raises $60 million to enable bridge between patients and healthcare
Posted 28-Jul-2020 21:51


QNAP integrates Catalyst Cloud Object Storage into Hybrid Backup solution
Posted 28-Jul-2020 21:40



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.


Support Geekzone »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.