[April 06] Volumio (2.390-2018-03-27) ROCK64 | [April 06] Q4OS (2.4-r3) PINE A64(+) Pinebook | [Jan 06] Arch Linux (20171225-1) PINE A64(+) Pinebook A64-LTS/SOPINE | [Jan 04] Linux (0.5.15-136) ROCK64 | [Jan 04] Android (20171204) ROCK64 | [Dec 22] Stretch Mate (0.5.15-136-20171222) ROCK64 | [Dec 21] openHAB 2 (v1.4) PINE A64(+)

Project Inspiration | Get Started | IRC Logs | Forum Rules/Policy

How to Setup Serial Console Cable Over the Rock64 SBC

The purpose of this photo blog is to provide a tutorial on setting up a serial console over the Rock64 ( or any other SBC ) from the Pinebook ( or any other notebook ) !

Materials & Preparation

You will need a usb extension cable ( two 1m cables will do ) and the CH340g usb to serial ttl bridge adapter carried by the Pine store.  Also you will need to have three  6"  F-F  jumper wires;  the ch340g is placed in short proximity to the Rock64 board and is attached to the Rock64 via the three F-F 6" jumper wires to the PI-2 bus, pins ( 6, 8, 10 ) covered later.  The usb extension cable(s) then run from the ch340g adapter to the notebook computer;  in this case the Pinebook.  You will also need to make sure you have serial terminal software installed ( I recommend the old standby minicom ).  We'll talk about that later as well.

Theory and Pinebook caveats

The theory is fairly straight-forward;  the Rock64 has a uart serial console port on the PI-2 bus pins (6, 8, 10) which allows another computer ( Pinebook ) to connect from usb port via the serial console adapter ( ch340g ).  

With the terminal software running , and all connections correct , you will be able to see the console messages from the Rock64 when the SBC boots, on the serial console terminal.  You can debug boot-up messages, also shutdown messages, as well logon to the Rock64 from the serial console after boot-up. 


The Pinebook usb ports are not identical.  For one thing the correct port ( pic on right ) is on a usb hub, and is designed to be used as a console.  The "incorrect" port to use ( pic on the left ) should not be used as a console.  Failure to heed the warning to use only the correct port ( the right-hand usb port ) will cause you endless frustration, grumpiness, and probably hair loss.  


Make the Connections to the CH340g


The pic at the left shows the connections on the CH340g;  the pic at the right shows the connections at the Rock64 SBC.  I like to Scotch tape the CH340g to the table top in close proximity to the Rock64;  so that the 6" F-F jumper wires can easily be connected.  The Tx, Rx, and gnd are in reference to the Rock64 SBC.  You will notice that the Rock64 Tx is connected to the CH340g Rx, and the Rock64 Rx is connected to the CH340g Tx.  The ground from the Rock64 is connected to the ground on the CH340g.  

                Rx-->Tx,   Tx-->Rx,    ground--ground

Notice that the gold jumper on the CH340g is set to select 3v3 logic level for the adapter.  This is critical.  Failure to observe this will irrevocably damage your Rock64 !  (words to the wise) 

The red LED on the CH340g is a power indicator;  there are other green LED(s) by the connectors which flicker during comms.  

Do not plug in the green Rx wire at this time;  this is the transmit (Tx) line from the CH340g and usually carries 3v3 even in idle which will "back feed" or bleed current into the Rock64 often keeping it from booting up !  We will wait to plug in the Rx line until after the boot-up and when we have a logon prompt on the console.

Plug in the usb cable extension into the CH340g;  this will run over to the Pinebook ( or other notebook ).

Plug in the USB Cable on the Pinebook and Start the Terminal Software 

Plug the other end of the usb extension cable into the Pinebook right-hand usb port ( note that the left-hand usb port is not suitable as a console port ).  Open a terminal on the Pinebook.  This terminal will become the serial console.  For now issue the following command to verify that the Pinebook can "see" the  CH340g serial adapter:

          dmesg  |tail  -n  10

You should see a line that says, " usb ch341-uart converter now attached to ttyUSBx ".  Pay attention to the ttyUSBx!  This will probably be ttyUSB0,  but it may be another value;  this is the device that you will enter when you start the minicom terminal emulation software for serial comms with the Rock64.

Start the console terminal emulation software ( minicom ) with the following command sequence:

          sudo  minicom  -s  -D  /dev/ttyUSB0  -b  1500000  --color=on

The  -s  flag will open the configuration menu when minicom initiates;  select "Serial Port Setup" and press enter.  On the serial port setup dialogue check your defaults ( 1500000 8N1  /dev/ttyUSB0 ) and make sure that hardware and software flow control are both NO;  then press the enter key.

Select  'Exit'  from the menu, and press the enter key;  the terminal emulation software will be running.

Note:   If your device ( found with dmesg ) was not /dev/ttyUSB0 then use your device in the minicom initialization command sequence !

Boot the Rock64 SBC

Apply power to the Rock64 SBC board and almost immediately the Rock64 boot-up messages will begin scrolling down the serial console terminal emulation software running on the Pinebook.  Congratulations! --  you have setup a serial console over your Rock64, using your Pinebook !   ... nice job.

When the logon prompt appears on the serial console then plug the green Rx line from the Rock64 into the CH340g Tx pin, and then logon to the Rock64 from the serial console on the Pinebook.  To shutdown the Rock64 enter:

                 sudo halt

You will be able to see the shutdown messages as well ! 


The pic above is the serial console running on my Pinebook over my production Rock64 running xenial-mate 0.4.16 #83.  You will notice the RED status bar at the bottom of the terminal.  You will not see this unless you grab the bottom edge of your terminal with your mouse and pull the bottom of the terminal down ONE line  ( 80x25 ). 

marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )

The pic above is my PineA64 desktop machine connecting to my Pinebook machine via ssh;  which is then connecting to my Rock64 SBC desktop machine via serial console cable and minicom terminal emulation software !

Notice the pinout chart for the PI-2 bus behind;  showing the uart pins( 6, 8, & 10 ).

There are several combinations and permutations on a theme possible. Experiment, hav'fun.

marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )

  This photo blog shows how to setup a direct uart serial console connection using the uart(s) from another SBC like the PineA64+;  or any other SBC, like the Raspberry PI, or the Rock64.  This is a variation on a theme using our old friend the modified cat5 cable ( RJ45 plugs have been removed and replaced with standard header pins ).  The same cable carries two uart connections ( in this case one to Rock64-A and the other to Rock64-B ).  The host serial controller is, in this case, the PineA64+ desktop machine.

Preparation and Materials

Besides the remote machines ( the Rocks ) and the host controller ( the Pine ) you will also need one cat5 cable ( 1.8m works well ) and twelve(12) standard F-F 6" bread-board jumper wires to make the connections.  An adapter board is not necessary in this use case because the uart connections are direct;  Rx-->Tx,  Tx-->Rx,  gnd--gnd,  for each remote machine. 


In the picture(s) above you can see the details of the connections on the remote side of the comm link.  The cat5 cable has been opened and the RJ45 plugs have been replaced with header pins;  the orange pair was removed for hook-up wire.  I'm using the blue pair for ( Tx Rx ) on the Rock64-A, and the green pair for the ( Tx Rx ) on the Rock64-B.  The brown pair is being used for the ground returns;  all three wires are necessary for each machine uart direct connection.

At this juncture I'll point out that each pair has a solid and striped color for the pair ( blue brown or green ). For a given machine if the Tx of the remote is connected to the solid color, the Tx of the host for that connection must be connected to the striped wire.  This guarantees that Rx-->Tx, Tx-->Rx, gnd--gnd  is true for both machines.  Of course it is entirely arbitrary which way you do this, as long as you're logically (and color wise) consistent !

Modifying the cat5 cable is straight-forward and the easiest approach.  You might alternatively decide to use a juntion box of some sort containing header pins and RJ45 connectors;  this does not require modifying the cat5 cable but is more involved ( and more expensive ) in terms of time and money.

The pic above right shows the big picture;  again, I like to tape the transmission line to the table top and keep it out of the way, and its best to keep the jumper wires organized and neat.


In the enlarged inset detail above I am showing the host controller connections on the PineA64+ , utilizing the uart(3) and uart(4) , /dev/ttyS3  &  /dev/ttyS4 respectively.

The transmission cable ( modded cat5 ) comes into the pic on the top right-hand side.  I have labeled the wires as carefully as possible because it is hard to see how they terminate at the euler bus visually. Again, each uart connection is direct and each connection requires three wires; Rx-->Tx,  Tx-->Rx,  gnd--gnd.

I will be using the PineA64+ uart devices  /dev/ttyS3  &  /dev/ttyS4;  these devices live physically on the euler bus, the pinouts of which may be seen in this diagram.

Again, its important to note ( even repeat pedantically ) that the Tx and Rx lines of each connection MUST cross;  the easiest way to keep this straight is that if you connect Tx to solid blue on one end, connect Tx to striped blue on the other end !

Once the connections are made you can start the vt102 terminal emulation software in minicom;  for all intents and purposes this is the same here as in our previous adapter use case(s).

   important note:    If the transmit line from the host controller is connected to the Rock64 board at boot-up often the Rock64 will not boot.    The simple solution is to wait to plug in the Tx line from the host controller until after the Rock64 has booted and the logon prompt appears on the console.

Start the VT102 Terminal Emulation Software in Minicom

Open a terminal on the host controller ( PineA64+ in this case )  and drag the bottom of the window frame until the indicator shows  80 x 25.  This is important if you want to see the status bar on your minicom session!  Start the VT102 terminal emulation software with the following command:

       sudo   minicom  -s  -D  /dev/ttyS3  -b  1500000  --color=on

Note:  the baud rate is 1.5M  (1500000)  and the device is the uart(3);  Rock64-A in my case here.  

When the minicom opens and presents the config dialogue choose Serial Port Setup and press the enter key.  Make sure the defaults are correct, and also make sure that hardware & software flow control are off !  Press the enter key, and then select 'Exit' and press the enter key;  congratulations the VT102 terminal is running.  At this time ( if the remote machine is running ) you may press the enter key to get the logon prompt, and logon.  Otherwise, if the remote machine is NOT running, then apply power to the remote Rock64 and watch the boot-up messages scroll down the VT102 terminal.


Of course both of these connections ( Rock64-A  &  Rock64-B ) can be running at the same time;  to start the second connection open a tab on your terminal window and use the same command found above;  this time choosing the /dev/ttyS4 device ( everything else remains the same ).

In the left pic above you can see the Rock64-A connection running , and in the pic to the right you can see the Rock64-B connection running.  Both of these connections are running at 1.5 baud and without any adapters because the connections are direct uart-to-uart.


The host controller can be ANY SBC that you happen to have, another Rock64, a Raspberry PI, and Odroid, etc.  Also, the connection does not have to be dual;  a single connection works fine on the same modded cat5;  however, I will add this final caution :  the Rock64 uses a very fast connection speed ( for serial ) and 1.5M baud is subject to radio frequency impedance and transmission rules and mathematics;  due to reflections in the line, impedance mismatches may occur that will require you to perhaps modify the length of your transmission line;  although, in my setup a line length of about 1.8m works well.

Just for completeness, Rock64-A is my pre production board, and Rock64-B is my recent production test board.

marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )

Rock64 lab at night    Shy

( both labs controlled via console controller;  see this thread previous post #3 )
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
(08-27-2017, 09:40 PM)MarkHaysHarris777 Wrote: Rock64 lab at night    Shy

( both labs controlled via console controller;  see this thread previous post #3 )

nice and impressive :-)
Following the instructions of MarkHaysHarris777 including minicom, I was successful setting up a Serial Console Cable to a 4G production Rock64 running ayufan's Xenial Mate Build 92. In my case I used a USB Serial Console cable from adafruit that I already had (adafruit product id 954). The computer was an old MS Vista laptop now upgraded to Ubuntu 16.04 LTS. Many thanks to MarkHaysHarris777!

Attached Files Thumbnail(s)
Can I connect the "CH340g usb to serial ttl bridge adapter" to a standard PC running Linux?
I don't have a Pinebook.
On a Pinebook there is a specific port to be used. Is it a special port or a standard USB port?

Best regards.

Possibly Related Threads...
Thread Author Replies Views Last Post
  Very disappointed with ROCK64 USB WIFI 802.11B/G/N Danielsan 0 96 04-23-2018, 09:51 AM
Last Post: Danielsan
  GPIO extension cable fault viguzzz 0 26 04-23-2018, 04:08 AM
Last Post: viguzzz
Star Rock64 Webserver / NAS project mikedhoore 7 725 04-21-2018, 12:35 PM
Last Post: mikedhoore
  LED Status Rock64 Dayve 4 292 04-19-2018, 05:25 AM
Last Post: pfeerick
  eth does not exist on my ROCK64 armsby 0 53 04-15-2018, 04:13 PM
Last Post: armsby
Heart Rock64 NAS project mikedhoore 27 7,468 04-13-2018, 10:28 AM
Last Post: LrdShaper
  rock64 bonnie results with patriot burst ssd edwinbmiller 0 60 04-13-2018, 06:07 AM
Last Post: edwinbmiller
Bug Rock64 Boot-up Bug with Serial Console Cable MarkHaysHarris777 1 502 04-13-2018, 03:45 AM
Last Post: Z80
Question Rock64 GPIO Nak64Rbit 5 504 04-04-2018, 12:53 AM
Last Post: hryst
  Latest Rock64 board hardware revision Ryan 3 426 03-14-2018, 05:42 AM
Last Post: petec

Forum Jump:

Users browsing this thread: 1 Guest(s)