Seneye Sensor met linux en OpenHAB


#1

Controleer het juiste adres van de USB sensor. In ons voorbeeld zie je dat hij (24f7:2204) adres 4-2 gekregen heeft.

server# lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 24f7:2204
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 0658:0200 Sigma Designs, Inc.
Bus 003 Device 002: ID 0658:0200 Sigma Designs, Inc.
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0627:0001 Adomax Technology Co., Ltd
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Vervolgens meer info met udevadm:

server# udevadm info -a -p $(udevadm info -q path -n /dev/bus/usb/004/002)

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

looking at device ‘/devices/pci0000:00/0000:00:1d.1/usb4/4-1’:
KERNEL==“4-1”
SUBSYSTEM==“usb”
DRIVER==“usb”
ATTR{authorized}==“1”
ATTR{avoid_reset_quirk}==“0”
ATTR{bConfigurationValue}==“1”
ATTR{bDeviceClass}==“00”
ATTR{bDeviceProtocol}==“02”
ATTR{bDeviceSubClass}==“00”
ATTR{bMaxPacketSize0}==“64”
ATTR{bMaxPower}==“250mA”
ATTR{bNumConfigurations}==“1”
ATTR{bNumInterfaces}==" 1"
ATTR{bcdDevice}==“0125”
ATTR{bmAttributes}==“80”
ATTR{busnum}==“4”
ATTR{configuration}==""
ATTR{devnum}==“2”
ATTR{devpath}==“1”
ATTR{idProduct}==“2204”
ATTR{idVendor}==“24f7”
ATTR{ltm_capable}==“no”
ATTR{manufacturer}==“Seneye ltd”
ATTR{maxchild}==“0”
ATTR{product}==“Seneye SUD v 2.0.16”
ATTR{quirks}==“0x0”
ATTR{removable}==“unknown”
ATTR{serial}==“F50020C659CDE564AF1C18001200801D”
ATTR{speed}==“12”
ATTR{urbnum}==“17”
ATTR{version}==" 2.00"

looking at parent device ‘/devices/pci0000:00/0000:00:1d.1/usb4’:
KERNELS==“usb4”
SUBSYSTEMS==“usb”
DRIVERS==“usb”
ATTRS{authorized}==“1”
ATTRS{authorized_default}==“1”
ATTRS{avoid_reset_quirk}==“0”
ATTRS{bConfigurationValue}==“1”
ATTRS{bDeviceClass}==“09”
ATTRS{bDeviceProtocol}==“00”
ATTRS{bDeviceSubClass}==“00”
ATTRS{bMaxPacketSize0}==“64”
ATTRS{bMaxPower}==“0mA”
ATTRS{bNumConfigurations}==“1”
ATTRS{bNumInterfaces}==" 1"
ATTRS{bcdDevice}==“0415”
ATTRS{bmAttributes}==“e0”
ATTRS{busnum}==“4”
ATTRS{configuration}==""
ATTRS{devnum}==“1”
ATTRS{devpath}==“0”
ATTRS{idProduct}==“0001”
ATTRS{idVendor}==“1d6b”
ATTRS{interface_authorized_default}==“1”
ATTRS{ltm_capable}==“no”
ATTRS{manufacturer}==“Linux 4.15.0-24-generic uhci_hcd”
ATTRS{maxchild}==“2”
ATTRS{product}==“UHCI Host Controller”
ATTRS{quirks}==“0x0”
ATTRS{removable}==“unknown”
ATTRS{serial}==“0000:00:1d.1”
ATTRS{speed}==“12”
ATTRS{urbnum}==“27”
ATTRS{version}==" 1.10"

looking at parent device ‘/devices/pci0000:00/0000:00:1d.1’:
KERNELS==“0000:00:1d.1”
SUBSYSTEMS==“pci”
DRIVERS==“uhci_hcd”
ATTRS{broken_parity_status}==“0”
ATTRS{class}==“0x0c0300”
ATTRS{consistent_dma_mask_bits}==“32”
ATTRS{d3cold_allowed}==“0”
ATTRS{device}==“0x2935”
ATTRS{dma_mask_bits}==“32”
ATTRS{driver_override}=="(null)"
ATTRS{enable}==“1”
ATTRS{irq}==“10”
ATTRS{local_cpulist}==“0-11”
ATTRS{local_cpus}==“fff”
ATTRS{msi_bus}==“1”
ATTRS{numa_node}=="-1"
ATTRS{revision}==“0x03”
ATTRS{subsystem_device}==“0x1100”
ATTRS{subsystem_vendor}==“0x1af4”
ATTRS{vendor}==“0x8086”

looking at parent device ‘/devices/pci0000:00’:
KERNELS==“pci0000:00”
SUBSYSTEMS==""
DRIVERS==""

/etc/udev/rules.d/10-local.rules
SUBSYSTEMS==“usb”, ATTRS{idProduct}==“24f7”, ATTRS{idVendor}==“2204”, MODE=“666”, GROUP="pl

usermod -a -G plugdev openhab