Connecting to a Raspberry Pi via USB/TTL-Serial with Ubuntu Linux

One of the nice features of the Raspberry Pi are all the little pins, connecting something, exposing other things, …

Part of these GPIO ports are all ports necessary for a serial interface, although they are only low voltage (±3.3VDC) TTL signals whereas the „proper” serial port runs on ±5VDC. Additionally, there is also a pin where you can actually power the Raspberry Pi with 5V. :D

So why would you need that? Well, if you do not have a TV or spare monitor around (like for example in a Hackspace or Hosting Center), you will need different means to connect to your Pi. Us oldtimers can even remember the times when a serial port was the only way to connect to a machine. So we are going to use „the ancient ways” to connect our state of the art - no serial ports thanks to Mr. Steve Jobs - machines to the Pi.

So you are guessing that all you need on the hardware side is a converter to step the 3.3 Volts up to 5 Volts, and we are good to go, right? Right and wrong. If you want to talk with proper serial hardware like a Psion 5MX, then yes. There are already several converters available.

But if you just want to connect the Pi to a Computer/Laptop you can use a cheap USB to TTL Serial Cable (if you own a Hacklace, you probably already have one). Just connect it to the serial pins of the Raspberry Pi and the USB port of the computer and you can power the Pi via that cable and you get a „new” serial device on the computer which you can use to talk to the Pi. This will look like this:

Raspberry Pi with connected USB to TTL Serial Cable | picture by AdaFruit


On my Ubuntu 12.04 laptop, the connecting/connected device looks like this:

[   12.633361] usbcore: registered new interface driver usbserial
[   12.633374] USB Serial support registered for generic
[   12.633425] usbcore: registered new interface driver usbserial_generic
[   12.633427] usbserial: USB Serial Driver core
[   12.668865] pl2303: Prolific PL2303 USB to serial adaptor driver

m3@Sculley:~$ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Mär 1 22:11 /dev/ttyUSB0

Due to the security settings in Ubuntu Linux, a „normal” user is not allowed to access the serial ports directly. Although this in generally a good thing (never trust a user), it is not in your case. I mean, we know what we are doing, right? :D

In order to get us access to /dev/USB0, we have to add the user we are working with to the group „dialout” (yeah, the names are rather ancient). This is accomplished by
sudo adduser [the user you want to add] dialout
id -Gn

If the „id” command does not list „dialout”, you need to log off or reboot the machine for the change to take affect.

Once this is done, all that is left to do in order to connect to the Rapsberry Pi via the serial port, is to start „screen” with the right parameters:
screen /dev/ttyUSB0 115200
Just press once or twice, and you should get your login prompt or can even watch the Pi boot.

From here on, it should be obvious, what you can do. :D

Tagged as: , , , , , , , , | Author:
[Freitag, 20130301, 23:10 | permanent link | 0 Kommentar(e)

Comments are closed for this story.


„Leyrers Online Pamphlet“ ist die persönliche Website von mir, Martin Leyrer. Die hier veröffentlichten Beiträge spiegeln meine Ideen, Interessen, meinen Humor und fallweise auch mein Leben wider.
The postings on this site are my own and do not represent the positions, strategies or opinions of any former, current or future employer of mine.


RSS Feed RSS Feed

Tag Cloud

2007, a-trust,, a1, accessability, acta, advent, age, amazon, ankündigung, apache, apple, audio, austria, backup, barcamp, bba, big brother awards, birthday, blog, blogging, book, books, browser, Browser_-_Firefox, buch, bürgerkarte, cars, cartoon, ccc, cfp, christmas, cloud, collection, computer, computing, concert, conference, copyright, database, date, datenschutz, debian, delicious, demokratie, design, desktop, deutsch, deutschland, dev, developer, digitalks, dilbert, disobay, dna, dns, Doctor Who, documentation, Domino, domino, Douglas Adams, download, drm, dsk, dvd, e-card, e-government, e-mail, e-voting, E71, Ein_Tag_im_Leben, email, eu, event, exchange, Extensions, fail, feedback, film, firefox, flightexpress, food, foto, fsfe, fun, future, games, gaming, geek, geld, gleichberechtigung, google, graz, grüne, grüninnen, hack, hacker, handtuch, handy, hardware, HHGTTG, history, how-to, howto, hp, html, humor, IBM, ibm, ical, image, innovation, intel, internet, internet explorer, iphone, ipod, isp, IT, it, java, javascript, job, journalismus, keyboard, knowledge, konzert, language, laptop, law, lego, lenovo, life, links, Linux, linux, linuxwochen, linuxwochenende, living, lol, london, lost+found, Lotus, lotus, Lotus Notes, lotus notes, lotusnotes, LotusNotes, lotusphere, Lotusphere, Lotusphere2006, lotusphere2007, Lotusphere2008, lotusphere2008, lustig, m3_bei_der_Arbeit, mac, mail, marketing, mathematik, media, medien, metalab, microsoft, Microsoft, mITtendrin, mobile, mood, movie, mp3, multimedia, music, musik, männer, nasa, netwatcher, network, netzpolitik, news, nokia, Notes, notes, Notes+Domino, office, online, OOXML, open source, openoffice, opensource, orf, orlando, os, outlook, patents, pc, pdf, perl, personal, php, picture, pictures, podcast, politics, politik, pr, press, presse, privacy, privatsphäre, productivity, programming, protest, qtalk, quintessenz, quote, quotes, radio, rant, recherche, recht, release, review, rezension, rss, science, search, security, server, sf, shaarli, Show-n-tell thursday, sicherheit, silverlight, SnTT, social media, software, sony, sound, space, spam, sprache, spö, ssh, ssl, standards, storage, story, stupid, summerspecial, sun, sysadmin, talk, technology, The Hitchhikers Guide to the Galaxy, theme, think, thinkpad, tip, tipp, tools, topgear, torrent, towel, Towel Day, TowelDay, travel, truth, tv, twitter, ubuntu, uk, unix, update, usa, vds, video, videoüberwachung, vienna, vim, Vim, vista, vorratsdatenspeicherung, vortrag, wahl, wcm, web, web 2.0, web2.0, Web20, web20, webdesign, werbung, wien, wiener linien, wikileaks, windows, windows 7, wired, wishlist, wissen, Wissen_ist_Macht, wlan, work, wow, wtf, Wunschzettel, wunschzettel, www, xbox, xml, xp, zensur, zukunft, zune, österreich, övp, übersetzung, überwachung

AFK Readinglist