Console access withouth network or monitor.
#1
Information 
This thread describes a successful connection providing a UART Serial Console on a Linux Host however, this should work on Windows and Mac. The PINE64 board used is a 2GB version (A64-DB-2B-Rev B 2016-02-25). The connection is provided by a USB To RS232 adapter purchased from eBay:
NOTE: you would need 3.3v USB To RS232 adapter, otherwise you may fry your PINE64!
[Image: img4.jpg]

The successful connection is made on the EXP connector:

    Connect the GND (it should be labeled on the USB Module Adapter) to Pin 6 or 9 of the EXP connector.
    Connect the RX (it should be labeled on the USB Module Adapter) to Pin 7 of the EXP connector.
    Connect the TX (it should be labeled on the USB Module Adapter) to Pin 8 of the EXP connector.
[Image: img5.jpg]

Plug the USB end into your Linux host. Find the tty that has been assigned to it by opening a terminal window and typing
Code:
$ dmesg
. The last group of messages will show you how Linux has mapped the USB module to the tty. In my case the output appears as:
Code:
[ 4806.188739] usb 3-1: new full-speed USB device number 6 using uhci_hcd
[ 4806.338823] usb 3-1: New USB device found, idVendor=1a86, idProduct=7523
[ 4806.338828] usb 3-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 4806.338831] usb 3-1: Product: USB2.0-Serial
[ 4806.341875] ch341 3-1:1.0: ch341-uart converter detected
[ 4806.354983] usb 3-1: ch341-uart converter now attached to ttyUSB0
What I'm looking for is:
Code:
[ 4806.354983] usb 3-1: ch341-uart converter now attached to ttyUSB0

The final line of the output indicates the USB Serial Device has been assigned to ttyUSB0 (/dev/ttyUSB0).
There are many ways to connect to serial using Linux OS, I will show you two method that I use.
Method one (terminal):
Code:
$ sudo screeen /dev/ttyUSB0 115200

Method two (UI):
you would still need to run it from terminal as sudo.
Code:
$ sudo gtkterm
1.) Go to Configuration->Port
2.) Select /dev/ttyUSB0 from Port drop down
2.)Change Baud Rate to 115200
3.) Then click OK

Boot the PINE64 and you should see output in the terminal window on your Linux host.
  Reply
#2
Not every UART-to-USB cable will work, you need specifically a 3.3V one, anything else may fry your Pine64.  This one worked for me: Adafruit 954.

Instead of screen, it's better to use tio, it allows scrollback.  You do want to read those boot-up messages that scrolled away...

To be able to login on the console (if ethernet is hosed...), /etc/inittab on the Pine64 should include:

Code:
T0:23:respawn:/sbin/getty -L ttyS0 115200 xterm

The console will mangle output beyond a 80x24 region, to fix this you can compile and run this program:sizetty.c or stty the correct size by hand
  Reply
#3
(08-26-2016, 06:10 PM)KiloByte Wrote: Not every UART-to-USB cable will work, you need specifically a 3.3V one, anything else may fry your Pine64.  This one worked for me: Adafruit 954.

Instead of screen, it's better to use tio, it allows scrollback.  You do want to read those boot-up messages that scrolled away...

To be able to login on the console (if ethernet is hosed...), /etc/inittab on the Pine64 should include:

Code:
T0:23:respawn:/sbin/getty -L ttyS0 115200 xterm

The console will mangle output beyond a 80x24 region, to fix this you can compile and run this program:sizetty.c or stty the correct size by hand

KiloByte, you are correct, the one I used has a jumper to switch between 5v and 3.3v. I'm not sure how I missed that very important piece of information. I will fix it ASAP. In regards which terminal to use, it's a user preference. I can scroll up and down screen in Fedora and CentOS (my desktop and laptop) as well as I can detach and reattach the session without disconnecting.
  Reply
#4
Even the one's that do not provide the jumper are useful. The PL2303 based devices have a voltage reference on pin(4) of the PL2303 chips. If this is set to 5v the device (Tx & Rx ) will operate at 5v. If the pin(4) reference is held at 3v3, the device (Tx Rx ) will operate at 3v3. The PL2303 devices that have 5v on pin(4) can be used; but, first the user needs to move the 5v ref on pin(4) to a 3v3 ref (usually found on the same board). Obviously the devices that have a jumper are sweet because the config happens without and solder. Smile

The 954 device from ada fruit is handy because it is factory preset for 3v3 operation; but, the red lead is still designed to run at 5v-- for use with powering Arduinos or other devices. That lead is not strong enough to power the Pine 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! )
  Reply
#5
I managed to get UART working on EULER pins yesterday, I never got it working before because this diagram uses bad colour coding :
https://4.bp.blogspot.com/-281hfYFPu8U/V..._UART0.jpg

I wasn't sure if that highlight of PIN29 was green or yellow - and I made the assumption - "green" using my Prolific serial/USB dongle...

Turns out that GREEN goes to PIN30, and WHITE to PIN29 - and black to either 34 or 25...

I've now got jumpers on Pine running out through my C4 Labs "tall" case so I can UART to without busting it open...
  Reply
#6
Apparently every cable uses different colouring, so you need to read the manufacturer's webpage to learn yours (no, they didn't include the colors on the piece of paper that came with my cable).

Other than different colors, the EXP connector works for me.
  Reply
#7
(09-07-2016, 04:11 AM)KiloByte Wrote: Apparently every cable uses different colouring, so you need to read the manufacturer's webpage to learn yours (no, they didn't include the colors on the piece of paper that came with my cable).

Typically, just for clarification, most serial ttl bridge cables ( both cp2102 and pl2303 based ) will use standard colors for vcc (red), Tx (green), Rx (white), and Ground (black); however, sometimes this is not the case, and specifically many of the cp2102 modules will not have cables at all !  Instead, you must read the pinouts of your module.  Also, its good practice to read the pinouts of everymodule (regardless of cable color) and also to measure the voltage level of the Tx pin (cable wire), before plugging it into a 3v3 system only to find that the cable is using 5v logic and your board is not toast.
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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Portable USB-Powered Monitor mribunal 4 10,352 02-03-2017, 05:28 AM
Last Post: stevenmeza07
  Touch Screen monitor/module riahim 4 7,190 07-06-2016, 08:07 AM
Last Post: riahim

Forum Jump:


Users browsing this thread: 1 Guest(s)