The other day I wanted to connect to my PinePhone from my desktop computer. Since USB tethering is not functional yet on KDE Neon that runs on the phone, a wifi connection should have been established on the phone side to get access to a terminal. But if you would like to debug the booting process or wifi is not an option, serial communication is the way to go.

PinePhone offers serial connectivity through the headphones connector. In specific, the earphone jack works as expected -as an audio jack- if the 6th hardware switch on the back of the phone is ON. Switch it off, and the audio jack works as a serial adapter; a USB-to-jack serial console cable is also needed.

Unfortunately, ordering such a cable during the covid-19 lock down would mean long delays. Luckily, after asking on the Plasma Mobile matrix channel, Bhushan suggested I create my own converter cable, using an old USB to serial adapter -which I already had- and a spare audio cable. Let’s see how to make it.

USB to serial adapter USB to serial adapter

At first, cut the audio cable. What I found after cutting was a copper wire ground sheath wrapped around two insulated audio signal wires. It is easy to bring out the wires by applying some fire.

Audio cable Audio cable wires

Next, connect the audio cable wires to the USB serial cable endpoints. In my case, there are four connection points on the USB cable side:

  • Red +3.3 V
  • Black GND
  • White RXD
  • Green TXD

According to the information found at the pine64 wiki, the cables should be connected like this:

  • Left audio to TXD
  • Right audio to RXD
  • Ground connection

I also used some spare jump wires with solid tips to make the construction more stable, but that’s not required. After insulating the connection with some tape, the serial cable is ready to use.

Ready to use cable Ready to use cable

So, it’s time to test our construction. A friendly utility for serial connection is picocom. Enter:

sudo picocom -b 115200 /dev/ttyUSB0 

Then, switch on the PinePhone, and the booting process is shown on the terminal. It’s also possible to login to an interactive shell. E.g., open another terminal and type:

sudo bash -c "echo phablet > /dev/ttyUSB0"
sudo bash -c "echo 1234 > /dev/ttyUSB0"

That’s all. Happy PinePhone hacking!

This post was originally published in May 2020. On 1 Feb 2022 it has been updated: the voltage of the cable has been changed from 5 to 3.3.