Skip to content
Chapman Flack edited this page Apr 26, 2015 · 3 revisions

Welcome to the usbnetpower wiki!

Notes for different platforms

I've started this page to supply tips on using this code to control the 8800 device on different platforms.

First, a few notes about the device itself that may affect getting it to work on various platforms.

  • To build the device, the manufacturer uses a Prolific 2303 USB-to-serial converter chip as the USB interface.

  • The Prolific chip (recent versions anyway) contains One-Time-Programmable ROM allowing its vendor and product IDs, description string, and serial number to be written (up to twice, in fact, not just once) as described in section 6.0 of its datasheet.

  • But the vendor of the USB Net Power 8800 has not bothered to write non-default values into the chip, so each 8800 device will show up by default as vendor 0x067b, product 0x2303 - that is, a vanilla, off-the-shelf USB-to-serial converter, and will have no serial number set.

  • Those defaults may cause problems where built-in drivers in the OS try to make the device into a regular serial port before libusb and this code can touch it.

  • The lack of a serial number may also make it difficult to use more than one 8800 device on a system and tell this code which one to control.

  • If multiple 8800 devices will be used in such a setting, the cleanest solution might be to obtain Prolific's OTPROM writer software and program distinct serial numbers into different 8800s, and then edit this code to allow specifying which serial number to connect to.

Solaris

Solaris has a usbsprl driver for Prolific USB-to-serial converters. So, because the vendor and product IDs weren't changed, usbsprl immediately claims the device and makes it a serial port, and libusb will not even list it as an available device. The usbsprl driver can be told not to claim the device with these vendor and product IDs, with this command:

update_drv -d -i '"usb67b,2303"' usbsprl

followed by a reboot. After that, the device will be visible to libusb. However, if the system also has any real Prolific USB-to-serial converters with the same vendor and product ID, usbsprl will stop attaching them too. The best way to solve that problem might be to use the OTPROM writer and change the 8800's IDs to something else, and edit this code to match.

Installing prerequisites

The Solaris extra code repository OpenCSW can be used to install the python2.7 and py_pip packages, and then pip can be used to install pyusb. Changes needed in pyusb have been sent upstream in a pull request and will, ideally, already be in the version you install.

The Solaris libusb shared object is in a strange place and currently not automatically found (that may also have been handled in a fix to pyusb). If not fixed in pyusb, this code can load it explicitly, by changing this line:

self.dev = usb.core.find(idVendor=0x067b, idProduct=0x2303)

to this:

bx = usb.backend.libusb0.get_backend(
      find_library=lambda x: "/usr/sfw/lib/libusb.so.1")
self.dev = usb.core.find(idVendor=0x067b, idProduct=0x2303, backend=bx)
Clone this wiki locally