1

I have an Opticon OPN-3002i that I would like to have working on Linux, currently my computer runs Kali Linux. Unfortunately, the device doesn't show up as ttyUSB0, despite me setting it to USB-VCP mode. Here is the dmesg when I unplug and plug in the device.

[754566.684401] usb 2-1: USB disconnect, device number 17
[754570.040249] usb 2-1: new full-speed USB device number 18 using uhci_hcd
[754570.213170] usb 2-1: New USB device found, idVendor=065a, idProduct=a002
[754570.213185] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[754570.213196] usb 2-1: Product: USB Code Reader
[754570.213205] usb 2-1: Manufacturer: Optoelectronics Co., Ltd.
[754608.100374] usb 2-1: USB disconnect, device number 18
[754611.968205] usb 2-1: new full-speed USB device number 19 using uhci_hcd
[754612.142243] usb 2-1: New USB device found, idVendor=065a, idProduct=a002
[754612.142260] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[754612.142271] usb 2-1: Product: USB Code Reader
[754612.142280] usb 2-1: Manufacturer: Optoelectronics Co., Ltd.
[754853.620426] usb 2-1: USB disconnect, device number 19
[754858.460183] usb 2-1: new full-speed USB device number 20 using uhci_hcd
[754858.634224] usb 2-1: New USB device found, idVendor=065a, idProduct=a002
[754858.634240] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[754858.634250] usb 2-1: Product: USB Code Reader
[754858.634259] usb 2-1: Manufacturer: Optoelectronics Co., Ltd.

lsusb entry

Bus 002 Device 020: ID 065a:a002 Optoelectronics Co., Ltd 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x065a Optoelectronics Co., Ltd
  idProduct          0xa002 
  bcdDevice            1.00
  iManufacturer           1 Optoelectronics Co., Ltd.
  iProduct                2 USB Code Reader
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4 USB VCP Code Reader  
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               5
Device Status:     0x0000
  (Bus Powered)

My research on it lead me to these two pages

The issue with the first link (Installing USB-VCP) is that my computer doesn't have a /proc/bus/usb folder, and I can't make one or mount it using mount -t usbfs procbususb /proc/bus/usb. From my understanding usbfs has been phased out. I really need this device in a ttyUSB mode so I can send commands via serial. The device itself is set to USB-VCP mode according to lsusb.

EDIT:

Ran the usb-devices program from terminal and got this for my device.

T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 23 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=065a ProdID=a002 Rev=01.00
S:  Manufacturer=Optoelectronics Co., Ltd.
S:  Product=USB Code Reader
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
0

You need to force the opticon device to use the opticon driver. See this answer: https://stackoverflow.com/questions/442833/forcing-driver-to-device-match#442867

It's as easy as echoing the vendor id and product id into the new_id file.

echo 0x065a 0xa002 > /sys/bus/usb-serial/drivers/opticon/new_id Unplug and replug to ensure the driver works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.