Showing posts with label USB. Show all posts
Showing posts with label USB. Show all posts

Monday, 4 October 2021

Have you tried turning it (VirtualBox) off and on again?

I had a strange problem where USB devices were detected on the host system (Linux) but did not appear as available devices for a VirtualBox guest (XP). The strange thing was that I could use the devices normally on Linux, but they just didn't appear to the guests, not just XP but also a Debian guest.

I searched high and low for reports of the problem but nobody else seemed to have had it. And it was working before, although I was not sure if there was an intervening Linux kernel upgrade.

Finally in desperation I decided to reboot the system. Lo and behold, after that the devices became available to the guest. My best guess it that somehow the part of VirtualBox handling the USB forwarding got wedged. So give the old The IT Crowd advice a try.

Thursday, 5 January 2017

Installing the Brother HL2130 printer driver on Linux

I recently upgraded to openSUSE Leap 42.2. Since I did a fresh install, one of the things I had to get working again was my Brother HL2130 laser printer. It's a very basic model but does what I want and is cheap to run. It connects to the host computer with USB.

Brother supplies drivers for Linux as both RPM and DEB packages, do a web search to find a download server. These are actually filters that convert Postscript to Brother printer language. They integrate with the CUPS or the old LPD spooler systems.

After I did the install, nothing would print. The log showed the printer connecting and disconnecting from the USB port.

I looked at the files installed by the Brother packages and found in the directory /usr/local/Brother/Printer/HL2130/cupswrapper/ the file cupswrapperHL2130-2.0.4 I ran this manually with sh -x cupswrapperHL2130-2.0.4 -i and noticed that it ran a lpinfo towards the end to get some information. I ran lpinfo manually and found that it didn't detect the printer. I switched on the printer and this time the printer was detected with the path: usb://Brother/HL-2130%20series?serial=XXXXXXXX I reran the install script and this time the installation worked. This time it had edited /etc/cups/printers.conf with the correct DeviceURI.

So the short solution is: Switch on the printer before installing the Brother driver packages so that detection and configuration of the printer can happen.

This probably also applies to other Brother printer models using USB connectivity.

Later on a search showed somebody with the same problem and a manual solution.

Thursday, 11 August 2016

Adventures with USB to SATA/PATA bridges

If you have a spare SATA hard drive or DVD burner, or a PATA DVD burner lying around, you may be tempted, like me, to connect it to your computer using a USB adaptor, to function as an outboard drive, using one of the many identical adaptors you can buy on eBay for a few dollars. You will need an external power supply of course, and I'm assuming you have one lying around too. All these experiments were done on a Raspberry Pi 2.


The first one I bought looked like this. It also came with a SATA cable and a Molex to SATA power adapter cable. Note the there are two PATA interfaces, one for 3.5 inch HDs and DVDs and one for 2.5 inch HDs on opposite sides. For the 2.5 inch HDs no power supply is needed, as the power comes from USB.

The lsusb command shows that this uses the JMicron 20337 chip:

ID 152d:2338 JMicron Technology Corp. / JMicron USA Technology Corp. JM20337 Hi-Speed USB to SATA & PATA Combo Bridge


There are a couple of quirks with it. The first is that the chip will not be detected unless the HD/DVD side is plugged in and powered up. The other is that the 40 pin (3.5 inch) PATA side can be plugged into the HD/DVD offset by one pin if you are not careful, because the plug is slightly narrower than the socket, and the key is also a bit smaller than the slot. The second is that the Molex power connector may jam against the PATA connector. In fact this is a cause of accidental offset if you plug the Molex connector in first. The problem is a wing on the connector near the wire end that makes it take up more room. I snipped off one wing with cutters.

Using this adaptor with a DVD burner was fine, the drive appeared as /dev/sr0, and I was able to use brasero to burn optical media. However experience with 3.5 inch SATA HDs was unsatisfactory. If data rates are too fast, the chip is apt to disconnect and then the Linux driver tries to reset the USB interface but this never works. It seemed to work ok with 2.5 inch laptop PATA drives. The disk appears as /dev/sda, as the SD card drive is /dev/mm-something.


I bought a second USB adaptor, this time only for SATA devices. This one came as a rather fat USB dongle with SATA and e-SATA sockets on the side. You may have to use a hub if it blocks other USB sockets on your computer from being used. The lsusb command shows that this uses the JMicron 20329 chip.

ID 152d:2329 JMicron Technology Corp. / JMicron USA Technology Corp. JM20329 SATA Bridge

There is an intriguing message in the system log:

Quirks match for vid 152d pid 2329: 8020

I haven't looked at the driver source, but the message seems to suggest that the driver copes with this one better. When I used it with a SATA HD, there were no disconnects and resets. So this is the one I will use to interface to the HD, using the 20337 only for the DVD drive.

You may see USB adapters that plug directly onto the back of the drive. Those are for 2.5 inch drives only as the power comes from USB.

All the devices mentioned here are USB 2.0. USB 3.0 adapters are available, and only worth it for SATA HDs, but I don't have a great need for speed so I'll let them get cheaper before I buy one.