jojygv
Posts: 3
Joined: Mon Jul 01, 2013 2:09 am

Console output on USB port

Mon Jul 01, 2013 2:17 am

Hi
I am trying to setup pi for a project where I will be using the ttyAMA serial port. I cannot use network port for the project. I need the linux console for debugging and access to the root file system. I would be connecting to pi from my pc/laptop's serial/USB port. So I bought myself a serial-usb converter cable so that the usb ports talk serial. So now my setup looks like :

pc --> usb-serial --> serial-usb --> pi's usb port.

When i turn on pi with the above setup and ttyAMA0 as tje console, I can see /dev/ttyUSB0 on pi.

So the next step was to eliminate ttyAMA0 from being used as console.

My instinct was to change the command line (boot/cmdline.txt) and replace all ttyAMA0 with ttyUSB0. When i do this, I dont get any console output on my PC (using minicom).

I was wondering if anyone has had any success with this kind of setup or had any suggestions.

thanks in advance

ghans
Posts: 7819
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Console output on USB port

Mon Jul 01, 2013 7:06 am

Why don't you use a TTL-to-USB convertor instead ?
Only one device , and it's even cheaper.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

jojygv
Posts: 3
Joined: Mon Jul 01, 2013 2:09 am

Re: Console output on USB port

Mon Jul 01, 2013 3:04 pm

From what i understand looking at the GPIO pinout, TTL is available only on GPIO pins 14 and 15 on the pi. I intend to use them for one of my devices. I needed console access also. Essentially I needed two serial ports and dont know how to achieve this.

thanks !

6677
Posts: 382
Joined: Wed Mar 14, 2012 9:23 pm

Re: Console output on USB port

Sun Jul 07, 2013 6:42 pm

jojygv wrote:From what i understand looking at the GPIO pinout, TTL is available only on GPIO pins 14 and 15 on the pi. I intend to use them for one of my devices. I needed console access also. Essentially I needed two serial ports and dont know how to achieve this.

thanks !
connect the USB>TTL adaptor on your laptop into the pi GPIO and leave the pi defaulting to console access on its GPIO. Connect the second USB>serial adaptor to the pi USB and the device you need serial access on. Then configure the application running on the pi which needs serial access to use the USB adaptor instead of GPIO.


Or, why cant you use ethernet? is it because its a model A, in that case, USB hub + USB wifi, tap in that way and use SSH.
Even if the pi is using its ethernet for something else it can still be used for SSH at the same time. It doesnt care.

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Console output on USB port

Sun Jul 07, 2013 7:21 pm

That is a tough one. It certainly is possible to ssh in to the Pi over USB, I do it all the time. But it requires a special module or driver, and I do not know if there are any for PCs.

I ssh in to my Pi from a Zaurus PDA using usb, and this connection uses the zaurus module. It works on many Zaurus PDAs (not all), as well as many cellphones use the driver to connect to their PCs. I know the driver is in Arch for the Pi, I do not know about other distributions. And doubt it would work without rewriting the driver so your PC would be the remote device and the Pi the local device.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

jojygv
Posts: 3
Joined: Mon Jul 01, 2013 2:09 am

Re: Console output on USB port

Sun Jul 14, 2013 9:18 pm

Thanks for the responses guys. So my choice seems to be limited to using the GPIO based console and using USB-ttl interface for driving my serial device. In my case the serial device is a xbee module and was wondering if anyone had done it.

User avatar
jojopi
Posts: 3042
Joined: Tue Oct 11, 2011 8:38 pm

Re: Console output on USB port

Sun Jul 14, 2013 9:48 pm

jojygv wrote:My instinct was to change the command line (boot/cmdline.txt) and replace all ttyAMA0 with ttyUSB0.
That requests that kernel boot and crash messages be sent to ttyUSB0. It does not work, because the console is initialised before the usbserial module. To make it work you would have to configure a kernel with CONFIG_USB_SERIAL compiled in (not as a module), and CONFIG_USB_SERIAL_CONSOLE set.

If you want to log in over the USB serial line, however, all you need to do is find the T0 line in /etc/inittab and add a corresponding U0 line:

Code: Select all

#Spawn a getty on Raspberry Pi serial line
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
#Same thing for USB serial
U0:23:respawn:/sbin/getty -L ttyUSB0 115200 vt100

hen
Posts: 11
Joined: Tue Apr 11, 2017 8:39 am

Re: Console output on USB port

Mon May 29, 2017 10:20 am

jojopi wrote: If you want to log in over the USB serial line, however, all you need to do is find the T0 line in /etc/inittab and add a corresponding U0 line:

Code: Select all

#Spawn a getty on Raspberry Pi serial line
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
#Same thing for USB serial
U0:23:respawn:/sbin/getty -L ttyUSB0 115200 vt100
Hi all, sorry for reviving an old thread.

How can I do this same thing (log in over USB serial line) on Raspbian Jessie, that uses systemd (and there's no more /etc/inittab in the system)?

Thanks!

Return to “Linux Kernel”