Tagged with yosemite

Fix USB Serial Console on Raspberry Pi for Yosemite

My favorite way to talk with Raspberry Pi devices is using the PL2303 based USB Serial cable from Adafruit. The convenience of not needing a monitor or keyboard, as well as not needing a network connection for SSH, is significant as I often want to work with my devices in varied environments, and have several devices deployed “in the wild” where other options would be very inconvenient.

The Problem

Unfortunately this functionality recently stopped working for me. A number of variables had changed; I had upgraded my laptop to OS X 10.10 (Yosemite), I was using a new USB Serial cable I hadn’t used previously, and I was using a Model B+ Raspberry Pi which I hadn’t worked with before. As anyone who’s done much debugging will be all top familiar with, having this many variables change creates a nightmare for debugging, particularly as I had no available hardware to put any of the variables back to a known-good state.

After a lot of digital multi-metering and loopback testing I was convinced the Raspberry Pi was functioning correctly, so I was able to turn my focus to the USB serial adapter itself. I had used these cables successfully in the past, so I had faith in the concept, but for some reason when I attempted to use one using screen (screen /dev/cu.PL2303-00001014 115200) with my Raspberry Pi I merely received a blank screen with a blinking cursor.

When I installed the drivers for the PL2303, I had followed a link from this page in Adafruit’s article on using the cable to a package installer. Returning a saw a large amount of discussion around issues with using the drivers on Yosemite, with a number of suggestions for fixing the issue. I tried all of the suggested fixes, removing and reinstalling the driver using the supplied package several times, without positive results. At some point during the process I discovered that as long as the cable was connected during boot it would function properly, but as soon as it was removed and replugged into a USB port while the computer was running it would give me the black screen, and the following errors would show in my dmesg log:

➜  ~  cat dmesg | grep PL2303
nl_bjaelectronics_driver_PL2303(0xffffff801da83200)::dequeueDataGated - INTERRUPTED
nl_bjaelectronics_driver_PL2303(0xffffff801d55d800)::allocateResources failed - no fpInterface.
nl_bjaelectronics_driver_PL2303(0xffffff801d55d800)::start Allocate resources failed
nl_bjaelectronics_driver_PL2303(0xffffff801d55d800)::CheckSerialState - StartSerial failed
nl_bjaelectronics_driver_PL2303(0xffffff801d55d800)::enqueueDataGated fTerminate set
nl_bjaelectronics_driver_PL2303(0xffffff801d55d800)::enqueueDataGated fTerminate set
nl_bjaelectronics_driver_PL2303(0xffffff801d55d800)::enqueueDataGated fTerminate set
nl_bjaelectronics_driver_PL2303(0xffffff801d55d800)::enqueueDataGated fTerminate set
nl_bjaelectronics_driver_PL2303(0xffffff801d55d800)::enqueueDataGated fTerminate set
nl_bjaelectronics_driver_PL2303(0xffffff801d55d800)::enqueueDataGated fTerminate set

The Solution

Finally I decided to try giving up on the package installer and going to the manufacturers driver page here. Fortunately the manufacturer now actually supplies it’s own package installer. I removed the existing install of the driver using these steps:

  1. Disconnect the USB cable from the computer
  2. Run these commands:
    sudo kextunload /System/Library/Extensions/osx-pl2303.kext
    sudo rm -r /System/Library/Extensions/osx-pl2303.kext
  3. Remove any instances of “USB Serial Controller …” from Network Preferences.

I then used the installer from the above link to prolific’s website, and then rebooted.

The device identifier changed from it’s previous value of /dev/cu.PL2303-00001014 to a more intuitive /dev/cu.usbserial, but more importantly I was able to consistently connect to my Raspberry Pi, even without the cable connected during my laptops boot:

➜  ~  screen /dev/cu.usbserial 115200
 
 
Raspbian GNU/Linux 7 raspberrypi ttyAMA0
 
raspberrypi login:
Tagged , , , , , , , , ,