Ready-made GPIO-RS232 cable


49 posts   Page 2 of 2   1, 2
by bbb » Thu Jun 14, 2012 12:48 pm
Joe Schmoe wrote: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...


Indeed. I was more interested since I thought it might be easier / cheaper to just convert GPIO straight to serial (just a bit of voltage stepping ...) and my PC(s) all have 9 pin serial ports. I will post up a picture once I've hacked my DKU-5 cable and got it working. I have found 3-pin 12v PC fan plugs fit quite nicely on the PI's GPIO block :)
Posts: 51
Joined: Sat Jun 02, 2012 9:52 am
by bredman » Thu Jun 14, 2012 12:53 pm
bbb wrote:I thought it might be easier / cheaper to just convert GPIO straight to serial (just a bit of voltage stepping ...)


Remember that you also need to invert the sign. RS232 uses opposite polarity to the board-level voltages.

For information, search for information about how the MAX232 converter chip works.
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by tawalker » Thu Jun 14, 2012 2:44 pm
Would this cable (FTDI Cable 5V VCC-3.3V I/O -USB to TTL-Level Serial convertor) from Amazon UK, be suitable, or would it need any further tweaking, voltage-converting, etc.?

Also, I assume it would plug into the GPIO connector (or part of it)? (That is, presumably there isn't another connector I'm overlooking for 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 rurwin » Thu Jun 14, 2012 5:08 pm
It wouldn't plug into the GPIO connector, since the pins you need to wire up are not in a neat row like that wire assumes they are.

The other devices we have pointed out are less than half the price and each wire has a single connector so you can plug them onto the right pins.
User avatar
Forum Moderator
Forum Moderator
Posts: 2913
Joined: Mon Jan 09, 2012 3:16 pm
by Joe Schmoe » Thu Jun 14, 2012 5:39 pm
rurwin wrote:It wouldn't plug into the GPIO connector, since the pins you need to wire up are not in a neat row like that wire assumes they are.

The other devices we have pointed out are less than half the price and each wire has a single connector so you can plug them onto the right pins.


You seem to be at odds with Gert and his picture, then.
Gert seems to be quite happy with the FTDI device.
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: 2669
Joined: Sun Jan 15, 2012 1:11 pm
by rurwin » Thu Jun 14, 2012 7:21 pm
The picture on Amazon has one single plug with all the wires going into it. Gert's picture shows each wire going to a pin on the GPIO port that the Amazon plug would not allow.

Maybe you are right and Gert did use that cable, but if you look closely at the picture Gert posted, you will see that he has extensively modified the plug, cutting each way free and probably resoldering it. Gert is an engineer; he can do that and think nothing of it. On the other hand, the one from eBay that I posted already has each wire going to a separate plug, so that there is no hacking and resoldering to be done.
User avatar
Forum Moderator
Forum Moderator
Posts: 2913
Joined: Mon Jan 09, 2012 3:16 pm
by bircoe » Fri Jun 15, 2012 11:34 am
Posts: 33
Joined: Wed Jul 27, 2011 9:43 pm
by synthaxx » Sat Jun 16, 2012 11:02 pm
I can confirm that a PL2303 usb cable will work on the pi.

The problem is that, if you need to connect 2 and other peripherals (so a hub on on of the USB ports), this happens (at least in Debian):

dmesg output:
Code: Select all
NFO:: periodic_channel_available: Total channels: 8, Periodic: 5, Non-periodic: 3
INFO:: schedule_periodic: No host channel available for periodic transfer.
ERROR::dwc_otg_hcd_urb_enqueue:487: DWC OTG HCD URB Enqueue failed adding QTD. Error status -4008
pl2303 ttyUSB1: pl2303_open - failed submitting interrupt urb, error -4008


I have 3 different devices with a PL2303 connection, none of them will work connected to the extra hub (tried with 2 different hubs).

Probably a bug somewhere, but it still means i can chose to either log my solar inverter serially, or connect my lights through X10. Not both.

This connection could be really handy as a second serial port so i can do both, without having to bake a new kernel.
Posts: 3
Joined: Thu Jun 07, 2012 12:32 pm
by gkmanning » Sun Jun 17, 2012 5:03 pm
I think you could use this to connect to the serial pins of the GPIO connector to USB. It has a built in FTDI chip. If you wanted access to the actual serial port.

http://uk.farnell.com/ftdi/ttl-232r-3v3 ... dp/1740365
Posts: 5
Joined: Sun Jun 17, 2012 10:23 am
by mpfisher » Tue Jun 19, 2012 7:39 pm
Posts: 5
Joined: Sat Mar 03, 2012 9:51 am
by AshSmall » Fri Jun 22, 2012 7:36 pm
Hi, I'm not sure if my question has been answered in this thread already or not, as this thread seems quite convoluted. My Pi hasn't yet arrived, but I'm designing an enclosure for it (and any additional hardware I need to use) while I'm waiting.

I plan on having several 9 pin 'D' ports (serial RS232) on a panel on the enclosure.

I understand from this thread that I can either interface the serial ports via the GPIO or the USB interface (presumably via a hub).

I realise I may well require additional hardware inside the enclosure in order to achieve this, and wish to design the enclosure to accomodate this additional hardware, as well as the Pi.

Is it possible to connect several serial ports to the GPIO, presumably using an additional board/card, and, if so, what should I be 'googling' for?

Is it possible to achieve this via (presumably) a USB hub, and if so, what should I be 'googling' for?

Many thanks in advance,

Ash.
Posts: 4
Joined: Tue Jun 19, 2012 2:56 pm
by domesday » Fri Jun 22, 2012 8:49 pm
It really depends on how much work you are wanting to put into it.

The GPIO UART serial (there is only 1) connection runs at 3.3V and has no hardware handshaking, to use it for RS232/RS422 will require a level convertor.

There are SPI to UART chips but no drivers for the Pi so you would have to build your own circuit and drivers.

USB, you can use as many USB to Serial adaptors as you like via a USB hub and drivers are built-in.
Posts: 258
Joined: Fri Oct 21, 2011 5:53 pm
Location: UK
by AshSmall » Sat Jun 23, 2012 9:06 am
Thanks for your promt reply Domesday.

I found this, which has a USB connector on one end and 8 x 9 pin serial ports on the other end. Apperently it works under Linux:

http://www.usbnow.co.uk/Adapters_&_Conn ... _info.html

Will this allow me to run 8 RS232 devices from one USB port on the Pi?

Ash.
Posts: 4
Joined: Tue Jun 19, 2012 2:56 pm
by domesday » Sat Jun 23, 2012 10:18 am
It would appear so, I'm guessing that you may still need a powered hub though as the power available on the Pi is limited.
Posts: 258
Joined: Fri Oct 21, 2011 5:53 pm
Location: UK
by huaraz » Thu Jul 05, 2012 11:11 pm
Hi

I got the following cable USB - RS232 serial converter http://www.amazon.co.uk/gp/product/B004ROOPK6/ but it does not work.

I use SecurCRT as terminal on XP with the following settings:
• Speed: 115200
• Bits: 8
• Parity: None
• Stop Bits: 1
• Flow Control: None

On the RaspberryPi I see the getty on ttyAMA0.

Any idea how to check / test ?

Thank you
Markus
Posts: 13
Joined: Thu Jul 05, 2012 11:04 pm
by crockysam » Wed Aug 01, 2012 3:44 pm
Can this be used to create valid RS232 Com port?

http://www.benl.ebay.be/itm/RS232-Seria ... 0438518755

Thx
Posts: 6
Joined: Wed Aug 01, 2012 3:42 pm
by rurwin » Thu Aug 02, 2012 6:31 am
That depends what you mean by valid and what you mean by com port.

It will get you a serial data port, but it will not give you any hardware handshaking pins (RTS,CTS,DSR,DTR,CD,RI). You probably don't need them.

And to be pedantic, "COM" is a terminology peculiar to Microsoft.
User avatar
Forum Moderator
Forum Moderator
Posts: 2913
Joined: Mon Jan 09, 2012 3:16 pm
by Joe Schmoe » Thu Aug 02, 2012 10:23 am
FWIW, of all the possibilities I've seen here on the forum for making a usable serial connection to the Pi via the GPIO pins (as opposed to doing it the old-fashioned, USB, way), the best (that is, clearest explanation and "just seems to me like the most likely to just work") is this:

http://www.trainelectronics.com/RaspberryPi/


Scroll down to the words "board is not well documented".
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: 2669
Joined: Sun Jan 15, 2012 1:11 pm
by crockysam » Thu Aug 02, 2012 12:00 pm
Thx, that seems to be the same as the this one:
http://www.ebay.com/itm/380438518755
Except that this one has the extra serial DB9 Female connector.

I just ordered 2, I'll let you know if works ;-)
Posts: 6
Joined: Wed Aug 01, 2012 3:42 pm
by Mr.Dave » Thu Aug 02, 2012 12:12 pm
I bought my USB 2.0 to RS232 TTL Converter Module PL2303 from eBay to unbrick my router about a year ago

Image
User avatar
Posts: 148
Joined: Sat Jun 30, 2012 6:59 pm
by savageautomate » Fri Aug 17, 2012 2:48 am
Here is a blog post where I installed a RS232 port with DB9 connection (not USB) to my Raspberry Pi. This is not technically a "ready-made" GPIO-RS232 cable, but its pretty dang close. Just four wire connections to a ready-made RS232 level-shifter board.
http://www.savagehomeautomation.com/projects/raspberry-pi-installing-a-rs232-serial-port.html

Image

Other Raspberry Pi related posts include:


Cheers! Robert
Robert Savage | Follow me @savageautomate
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com
User avatar
Posts: 187
Joined: Thu Aug 16, 2012 3:20 pm
Location: USA
by ame » Tue Aug 21, 2012 3:02 am
I don't have a source for a ready-made serial interface, but I did modify an off-the-shelf USB serial adapter to work at 3.3V for another project. I will test it on my RPi and report back.

Basically the steps are:
1) Identify and purchase an FTDI-based USB to serial adapter, such as this one:
http://eleparts.co.kr/EPX3H7PB
(Yes, they all look the same, shot in different coloured plastics. It's often hard to tell what's inside. Could be FTDI, could be Prolific).
2) Cut off the plastic moulding to expose the PCB.
3) Desolder the RS232 level shifter (the one that isn't the FTDI chip), support components and 9-pin connector.
4) Study the datasheet for the FTDI chip on the board. It's probably this one:
http://www.ftdichip.com/Support/Documen ... FT232R.pdf
Look at diagram 6.4 on page 26. What you need to do is hack on the board and cut the 5V connection to VCCIO and add a small wire to connect 3V3OUT to VCCIO. You could install a jumper as indicated in the schematic to make it 5V/3V3 switchable.
4) Identify TxD, RxD and ground pins, and solder on a flying lead with 0.1" receptacles (you can get a housing with three in a row, such as the fan power connector mentioned above.)
5) Plug the receptacles onto the RPi GPIO serial port pins. If you use a 3-position housing then make sure the wires are in the right order, and it's plugged in the right way round.
6) Plug the hacked board into your host PC USB port.

No warranty express or implied. Do this at your own risk.
Posts: 939
Joined: Sat Aug 18, 2012 1:21 am
Location: Japan
by CharlieH » Sun Jan 13, 2013 1:30 am
Don't know if you are still looking for this but you might search for "RS232 Serial Port To TTL Converter Module" on ebay. I bought a couple and they work well when connected to the appropriate four pins on the 26-pin connector.
Posts: 2
Joined: Thu Dec 27, 2012 10:57 pm
Location: Ithaca, NY USA
by picom » Mon Jan 21, 2013 9:24 am
Posts: 3
Joined: Mon Jan 21, 2013 9:22 am