How to Setup Serial Console Cable Over the Rock64 SBC
#1
Information 
Greetings,

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.  

Procedure

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 ). 

Shy
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! )
  Reply
#2
   


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.

Shy
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! )
  Reply
#3
Greetings,

  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.


Notes:  

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.


Shy
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! )
  Reply
#4
   


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! )
  Reply
#5
(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 :-)
  Reply
#6
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)
   
  Reply
#7
Hi.
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?

Thanks
Best regards.
  Reply
#8
The Photon has been connected to Rock64 via TX and RX pin crossover at each end.
But I am not getting any message on the serial console here is the attached putty and mincom console screen
https://ibb.co/mxYpJe 

Connection
Rock 64            Photon          Nextion Display
GPIO6(gnd)-------gnd pin------------Gnd pin
GPIO8(TX)---------RX pin-------------TX pin
GPIO10(RX)-------TX pin-------------RX pin

Here is the circuit diagram using Fertilizing https://ibb.co/ebtOeU

The code is located in the Photon Memory and it send data via serial com to both RX pins (rock64 and Nextion display) the nextion touch display acts as a control panel for photon
  Reply
#9
(10-05-2018, 05:14 PM)Mpoint Wrote: The Photon has been connected to Rock64 via TX and RX pin crossover at each end.
But I am not getting any message on the serial console here is the attached putty and mincom console screen
https://ibb.co/mxYpJe 

Connection
Rock 64            Photon          Nextion Display
GPIO6(gnd)-------gnd pin------------Gnd pin
GPIO8(TX)---------RX pin-------------TX pin
GPIO10(RX)-------TX pin-------------RX pin

Here is the circuit diagram using Fertilizing https://ibb.co/ebtOeU

The code is located in the Photon Memory and it send data via serial com to both RX pins (rock64 and Nextion display) the nextion touch display acts as a control panel for photon

I'm confused - are you trying to use the photon to see what the Rock64 is doing, or are you trying to use the Rock64 to see what the photon is doing? (I don't know anything about the photon but I assume it works like an Arduino).
  Reply
#10
Looks like the issue may be with macOS.

I tried in Mojave with minicom and screen, and I got the Linux login prompt after a hitting enter a few times.

Strangely, every time I hit enter, odd serial characters came up until about the 5th or 6th time, then I got the normal login prompt.

On the HDMI-connected monitor, I saw a SysRq prompt come up.

It seems like hitting enter must have hit the magic key combo for the linux sysrq prompt.

So, I loaded up Kali in a VM and passed the USB device (FT232 with RXD/TXD/GND connected) and ran minicom (turned off HW flow and turned on SW flow) and was able to see everything including the SPI boot messages.

Let me know how it goes for you.
_____________________________
Nu-Way Bin Rentals
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Are HW design files available for ROCK64? irenek 3 4,427 12-11-2023, 09:31 PM
Last Post: tllim
  Rock64 is unreliable after 3 years of service - power problem? ReleaseTheGeese 0 263 11-23-2023, 05:05 AM
Last Post: ReleaseTheGeese
  Rock64 PoE compatbility with Pi4 Hatt recent Single Board Computer offering from PINE kharak 1 947 04-26-2023, 11:38 PM
Last Post: tllim
  Case for the rock64 that supports the POE hat. o1CRiMSON1o 0 562 03-21-2023, 03:48 PM
Last Post: o1CRiMSON1o
Brick Rock64 usb2.0 Power Control Floating GPIO Tutorial Files & Notes MarkHaysHarris777 6 12,954 01-15-2023, 10:36 AM
Last Post: ds00
  rock64 totally brick dakobg 2 1,613 11-07-2022, 05:45 PM
Last Post: olivercfc
  3D-Printable Button Pegs for the ROCK64 Aluminium Case CounterPillow 2 3,364 08-04-2022, 01:31 AM
Last Post: Vicky Weimann PhD
  Where can I find the ROCK64 POE HAT Zoz 2 2,460 06-08-2022, 12:44 AM
Last Post: Zoz
Smile wooden case for ROCK64 killor 13 16,105 03-04-2022, 06:56 AM
Last Post: killor
  1wire DS18b20 on Rock64? mypineme 6 6,760 09-28-2021, 03:07 PM
Last Post: TRS-80

Forum Jump:


Users browsing this thread: 1 Guest(s)