Ready-made GPIO-RS232 cable


49 posts   Page 1 of 2   1, 2
by tawalker » Wed Jun 13, 2012 1:25 pm
I'd like to be able to add an RS232 (serial) port to my RasPi, for serial console access, such as when using the regular display/keyboard and/or SSH-ing into the machine via Ethernet/WiFi isn't possible. I've searched this forum, but am frankly baffled by the "hardcore electronics" discussions I've found (I just about know the business end of a soldering iron, but only so I don't burn myself ;) ).

Basically: has anyone made a "ready-to-go" serial port/adapter for the Pi, that I could buy, plug in (e.g. to the GPIO) and start a serial console? There seems to be plenty of talk here about how one might make such a cable, but I'm asking if there's somewhere yet that I could order a ready-made Pi serial cable (e.g. with a 9-pin female (D9?) connector).

BTW, I know about USB-serial adapter cables - I own one, and would probably use it with my netbook as a serial terminal - but I'd rather bypass USB on the Pi for this, in case I meet a scenario where USB/Ethernet is part of the problem (or otherwise unresponsive).

Sorry if I'm overlooking the obvious - I checked the FAQ too ;)

Many thanks for your help.
---
Raspberry Pi Model B ("ryo-ohki") - Arch Linux/ARM (hard float)
Visit Eee 701 Planetoid (http://eee701planetoid.wordpress.com/) for continuing adventures with an Eee 701SD and Raspberry Pi...
---
Posts: 180
Joined: Tue Jan 17, 2012 9:02 am
by bbb » Wed Jun 13, 2012 1:36 pm
I was looking for something similar too spent a while reading threads and checking the wiki- but could not work if its possible to get the serial pins on the GPIO header to talk standard RS232 that can be hooked up to a PCs serial port - not bother about having to make the lead myself, just need a simple schematic and instructions what to do in software to get it working :)
Posts: 51
Joined: Sat Jun 02, 2012 9:52 am
by abishur » Wed Jun 13, 2012 1:46 pm
I haven't seen any ready to buy cables out there, but I have heard of several people doing it, perhaps one of them would be kind enough to post a detailed part list and instructions for assembly?
Dear forum: Play nice ;-)
User avatar
Forum Moderator
Forum Moderator
Posts: 4313
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
by rurwin » Wed Jun 13, 2012 2:28 pm
The serial port on the GPIO header works and it is already configured to let you log in on it.

However you have two problems:
1. It is not RS232, it is 3.3V logic
2. The pin-out of the serial pins on the GPIO port is like nothing else in the world.

So you need a 3.3V logic to RS232 converter, which manifests as a little circuit board. Those are available -- I saw one last weekend for £5. I almost bought it. You can get them off eBay.

But you will need to do the wiring between the GPIO pins and the little circuit board, because nothing is available right now that has the right connectors on.

Here's a couple of eBay links. I've not used these devices, nor bought anything from the suppliers, just done a search.
This one at least lets you connect it up without needing to solder.
This one is even better -- it connects with USB on the PC end.
User avatar
Forum Moderator
Forum Moderator
Posts: 2936
Joined: Mon Jan 09, 2012 3:16 pm
by bredman » Wed Jun 13, 2012 2:42 pm
Here is a tutorial. It is based on the MAX232 which is a 5v interface, but change it for the MAX3232 (the 3.3v version) and it will be perfect for the Raspberry Pi.
http://justanotherlanguage.org/content/ ... port_board

Search the internet for "MAX232 tutorial" to find lots more similar.
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by ukscone » Wed Jun 13, 2012 2:50 pm
you could chop the end of a nokia ca-42 cable (they are pretty cheap, pretty common and instructions on how to do it are all over the place http://buffalo.nas-central.org/index.ph ... inkstation) and put some test hooks (or female connectors on it)
User avatar
Forum Moderator
Forum Moderator
Posts: 2877
Joined: Fri Jul 29, 2011 2:51 pm
by tawalker » Wed Jun 13, 2012 3:16 pm
Thanks for your suggestions - it would seem to confirm my original suspicion, that at least at the moment, there may not be a "ready-made" native serial interface for the Pi, that I can just plug in and use with no assembly required.

Perhaps I'm a bit unusual in the first cohort of Pi-folk, in that I'm a computer user (albeit with a Linux/UNIX bias) rather than an electronics buff. As I mentioned, I have barely a layman's understanding of electrical science, know just enough about a soldering iron not to pick it up by the shiny metal end, and wouldn't know what to do with a multimeter even if I owned one.

That said: the Raspberry Pi is supposed to be an educational project, so perhaps it is gently encouraging me to seek out an "Electronics For Dummies" book and start teaching myself this stuff ;)
---
Raspberry Pi Model B ("ryo-ohki") - Arch Linux/ARM (hard float)
Visit Eee 701 Planetoid (http://eee701planetoid.wordpress.com/) for continuing adventures with an Eee 701SD and Raspberry Pi...
---
Posts: 180
Joined: Tue Jan 17, 2012 9:02 am
by tawalker » Wed Jun 13, 2012 3:17 pm
abishur wrote:I haven't seen any ready to buy cables out there, but I have heard of several people doing it, perhaps one of them would be kind enough to post a detailed part list and instructions for assembly?


I second this :)
---
Raspberry Pi Model B ("ryo-ohki") - Arch Linux/ARM (hard float)
Visit Eee 701 Planetoid (http://eee701planetoid.wordpress.com/) for continuing adventures with an Eee 701SD and Raspberry Pi...
---
Posts: 180
Joined: Tue Jan 17, 2012 9:02 am
by bredman » Wed Jun 13, 2012 3:19 pm
If you are not willing to make your own hardware, would a USB-connected serial port be suitable for you?

This is one I use with Debian all the time www.dx.com/p/24799
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by tawalker » Wed Jun 13, 2012 3:30 pm
bredman wrote:If you are not willing to make your own hardware, would a USB-connected serial port be suitable for you?

This is one I use with Debian all the time http://www.dx.com/p/24799


It's more a case of "probably not able" rather than "not willing" ;) My original post referred to USB-serial cables:

BTW, I know about USB-serial adapter cables - I own one, and would probably use it with my netbook as a serial terminal - but I'd rather bypass USB on the Pi for this, in case I meet a scenario where USB/Ethernet is part of the problem (or otherwise unresponsive).


Also, the most likely "serial terminal" I'd be using, would be my netbook via... the aforementioned USB-serial cable. Even if I bought another one, I'd need to add a gender-changer to one of the cables to join them together - also, are there likely to be any issues with two computers both communicating over a USB-serial-USB link? Might be interesting to try :)
---
Raspberry Pi Model B ("ryo-ohki") - Arch Linux/ARM (hard float)
Visit Eee 701 Planetoid (http://eee701planetoid.wordpress.com/) for continuing adventures with an Eee 701SD and Raspberry Pi...
---
Posts: 180
Joined: Tue Jan 17, 2012 9:02 am
by bredman » Wed Jun 13, 2012 3:41 pm
In this case, I recommend the Nokia cable mentioned above. It seems to be suitable for 3.3v. If you need a source, see http://www.dx.com/p/446

In case anybody needs to know, this cable includes a PL2303 3.3v to RS232 chip.
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by jbeale » Wed Jun 13, 2012 4:11 pm
If you search for PL2303HX on Ebay, you can find modules under $5 that take logic-level UART (eg. from the Pi) and convert to USB for your laptop, netbook etc. They even come with female-female jumper wires so you can connect directly to the Pi GPIO header pins, with no soldering needed. Here is one example:

http://www.ebay.com/itm/350568364250

This chip is made by Prolific, here's some info on it:
http://prolificusa.com/portfolio/pl-230 ... ontroller/
http://prolificusa.com/docs/2303/hx/ds_ ... X_v15F.pdf

My understanding from the data sheet is that the UART-facing output of this device is configurable through pin 4 ("VDD_325") to have 3.3V or 1.8 V logic levels. Hopefully the module is configured for 3.3V output, otherwise it would not work with the Pi. I have one on order, but it will be a while before it gets here.
User avatar
Posts: 2099
Joined: Tue Nov 22, 2011 11:51 pm
by bbb » Wed Jun 13, 2012 4:30 pm
Thanks a lot everyone for the help.

I just happen to have a Nokia DKU-5 cable spare - hurray for no-cost DIY solutions :)

EDIT: is there a Poc connector to Serial 9-pin version of this cable ?
Posts: 51
Joined: Sat Jun 02, 2012 9:52 am
by Gert van Loo » Wed Jun 13, 2012 6:43 pm
tawalker wrote:....
BTW, I know about USB-serial adapter cables - I own one, and would probably use it with my netbook as a serial terminal - but I'd rather bypass USB on the Pi for this, in case I meet a scenario where USB/Ethernet is part of the problem (or otherwise unresponsive).

Sorry if I'm overlooking the obvious - I checked the FAQ too ;)

Many thanks for your help.


I came late to this dicussion.
I think there is a misunderstanding here. When we talk about "USB-serial adapter" for the Raspberry pi, we mean a cable which plugs into the GPIO header on one side, and has a USB at the other side. So that does not use, and works independent from any USB/Ethernet plugs on the raspberry-pi side.
I happen ;-) to have one and use it with the Pi.

See picture:
Attachments
usb_ftdi.JPG
Pi with RS232 <=> USB cable.
usb_ftdi.JPG (79.79 KiB) Viewed 12012 times
User avatar
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2099
Joined: Tue Aug 02, 2011 7:27 am
by Joe Schmoe » Wed Jun 13, 2012 7:03 pm
Gert:

Where did you buy that cable? That sounds like exactly what we are all looking for.
Never answer the question you are asked. Rather, answer the question you wish you had been asked.

- Robert S. McNamara - quoted in "Fog of War" -
Posts: 2873
Joined: Sun Jan 15, 2012 1:11 pm
by asb » Wed Jun 13, 2012 7:08 pm
Joe Schmoe wrote:Gert:

Where did you buy that cable? That sounds like exactly what we are all looking for.


I use this guy: http://www.amazon.co.uk/gp/product/B004ROOPK6/

Came with a 4 pin jumper cable. Removed one wire and connect TX/RX/GND.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 799
Joined: Fri Sep 16, 2011 7:16 pm
by Gert van Loo » Wed Jun 13, 2012 7:39 pm
FTDI.:
http://www.ftdichip.com/Products/Cables ... Serial.htm

The cable must be 3V3. Then you can take the cheapest.
I think they are sold in many places.
User avatar
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2099
Joined: Tue Aug 02, 2011 7:27 am
by rurwin » Wed Jun 13, 2012 8:53 pm
I posted a link to one above.
User avatar
Forum Moderator
Forum Moderator
Posts: 2936
Joined: Mon Jan 09, 2012 3:16 pm
by Grumpy Mike » Thu Jun 14, 2012 8:22 am
rurwin wrote:The serial port on the GPIO header works and it is already configured to let you log in on it.

Do you know what commands to use to access this from a language, like Python or C? Or is it just the normal input stuff?
User avatar
Posts: 791
Joined: Sat Sep 10, 2011 7:49 pm
Location: Manchester (England England)
by tawalker » Thu Jun 14, 2012 8:48 am
Thanks Gert - yes, this is indeed getting a bit confusing :?

The cable you referred to, still doesn't look quite like what I had in mind, as USB is involved. I am thinking of a "pure" RS232 serial port on the RasPi end - my imagined setup for a serial console is something like this:

[RasPi] <-> GPIO* <-> female DE-9 connector <-> male DE-9 <-> USB-serial cable <-> [netbook]

* GPIO, or other more suitable I/O on the RasPi

Really, there are two separate things I am trying to find out here:

(1) Is it possible to add a "traditional" serial port with a female DE-9 connector to the Pi, for serial console access? ("Yes", it would seem.)
(2) Is there a ready-made cable for the Pi for this purpose, which doesn't require the user to hack it together themselves? ("Not yet", is the idea I get from this thread ;) )

HTH - thanks again to everyone for their thoughts so far; much appreciated!

Tim
---
Raspberry Pi Model B ("ryo-ohki") - Arch Linux/ARM (hard float)
Visit Eee 701 Planetoid (http://eee701planetoid.wordpress.com/) for continuing adventures with an Eee 701SD and Raspberry Pi...
---
Posts: 180
Joined: Tue Jan 17, 2012 9:02 am
by domesday » Thu Jun 14, 2012 8:56 am
tawalker what Gert has posted achieves essentialy the same thing as you have asked.

USB on the PC end and serial on the Raspberry Pi GPIO connector, the cable has the USB to Serial convertor built-in to the USB plug.
Posts: 258
Joined: Fri Oct 21, 2011 5:53 pm
Location: UK
by bredman » Thu Jun 14, 2012 8:57 am
tawalker wrote:[RasPi] <-> GPIO* <-> female DE-9 connector <-> male DE-9 <-> USB-serial cable <-> [netbook]


Why are you adding in the extra complexity? The solution from Gert is simpler.
[RasPi] <-> GPIO* <-> USB-serial cable <-> USB <-> [netbook]
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by rurwin » Thu Jun 14, 2012 9:07 am
Using Gert's device, or mine, the RaspPi still uses serial through its existing UART which, if I remember correctly is /dev/ttyAMA0 or something similar.

The USB is on the PC end, where the connection looks like a USB-serial convertor, which it is.

On the RaspPi end it is a normal RS232 connection, except that you never get around to changing the voltages to +/- 12V.

You can get Raspi to DE-9 convertors, see my first link, but it costs more and you have to find a cable with two DE-9 plugs and a PC with a serial port.
User avatar
Forum Moderator
Forum Moderator
Posts: 2936
Joined: Mon Jan 09, 2012 3:16 pm
by Joe Schmoe » Thu Jun 14, 2012 11:03 am
Of course, one advantage to having an actual, real, 9 (or 25) pin serial connector involved is that it would work with a serial terminal (e.g., a VT100).

Those were the days...
Never answer the question you are asked. Rather, answer the question you wish you had been asked.

- Robert S. McNamara - quoted in "Fog of War" -
Posts: 2873
Joined: Sun Jan 15, 2012 1:11 pm
by tawalker » Thu Jun 14, 2012 12:33 pm
My apologies - I didn't understand that Gert's suggested solution combined the USB and Pi-end RS232 in one, so it might well do for what I'm interested in.

Thanks for clarifying that - if any further proof were needed that I'm not very electronically-minded :oops:
---
Raspberry Pi Model B ("ryo-ohki") - Arch Linux/ARM (hard float)
Visit Eee 701 Planetoid (http://eee701planetoid.wordpress.com/) for continuing adventures with an Eee 701SD and Raspberry Pi...
---
Posts: 180
Joined: Tue Jan 17, 2012 9:02 am