jhereg
Posts: 25
Joined: Fri Jun 15, 2012 6:28 am

Serial via the GPIO

Fri Jul 20, 2012 3:14 pm

I want to use my PIs to connect to some of the Cisco devices on my network at home. From what I've been readingI should be able to take an adapter that works w/ TTL and go to RS232. A couple of devices I've found on Ebay are

http://www.ebay.com/itm/150760914459?ss ... 081wt_1314

http://www.ebay.com/itm/290698076539?ss ... 735wt_1314

Any warnings or better suggestions? My understanding is I should be able to plug those in, configure the serial port and then telnet across it. Am I on the right path with those?

User avatar
Gert van Loo
Posts: 2486
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Serial via the GPIO

Fri Jul 20, 2012 8:31 pm

I have never heard of a converter that does not need power.
Neither of those pages tell me if it is 5V or 3V3.
The adapter must produce 3V3 signals only.

jhereg
Posts: 25
Joined: Fri Jun 15, 2012 6:28 am

Re: Serial via the GPIO

Fri Jul 20, 2012 8:42 pm

Gert van Loo wrote:I have never heard of a converter that does not need power.
Neither of those pages tell me if it is 5V or 3V3.
The adapter must produce 3V3 signals only.
That's why I was asking. It appears they both have a connector for power, ground, TXD, and RXD. One of them is showing a MAX 3232 chip which is what I *THOUGHT* was mentioned as the proper chip to use, but I'm not an electronic guy. I can make it work once I connect it but I prefer not to let the magic smoke out. :shock: Does anyone know of a premade solution that would give me a serial port on a PI?

User avatar
Gert van Loo
Posts: 2486
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Serial via the GPIO

Sat Jul 21, 2012 7:45 pm

Do you need a DB9 connector?
We are using TTL directly to USB from FTDI.
(You PC does not see that it is USB, your PC sees it as a standard COM port so you
can use it will all existing serial software).
FTDI nowadays even have a "Raspberry-Pi" version which has all the instructions how
to connect it to your board.

jhereg
Posts: 25
Joined: Fri Jun 15, 2012 6:28 am

Re: Serial via the GPIO

Sat Jul 21, 2012 7:52 pm

I've got a less than favorable opinion of USB -> Serial adapters when used for long term use. They seem to flake out. I've got several of them. I know I could use them. I was hoping to take advantage of the GPIO and get a real serial port.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12410
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Serial via the GPIO

Sat Jul 21, 2012 8:08 pm

Gert van Loo wrote:I have never heard of a converter that does not need power.
Neither of those pages tell me if it is 5V or 3V3.
The adapter must produce 3V3 signals only.
This adapter is probably "powered" with power extracted from an RS232 handshake line, an old trick really, but in the past it was done with just a few transistors, I have built several of those, even built a 300 Baud modem powered by the RS232 port.
Its easy enough to measure if the output is 3V3 or 5V, but if its 5V just use two resistors (2K2 and 3K3) do divide it to 3V. The 3V3 GPIO TxD output will directly drive a MAX(3)232 chip.

raven_squire
Posts: 23
Joined: Fri Jun 29, 2012 8:39 am

Re: Serial via the GPIO

Sat Jul 28, 2012 2:13 pm

Hello, I orederd this from e-bay

http://www.ebay.co.uk/itm/Pi-RS232-cabl ... 4aba4b7218

Item number: 320953086488

I dont understand alot about electronics eg 3.3v/5v and I wanted a complete solution. Do you think I will have any issues?

Thanks
Steve

User avatar
TonyD
Posts: 448
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: Serial via the GPIO

Mon Jul 30, 2012 12:48 pm

jhereg wrote:I want to use my PIs to connect to some of the Cisco devices on my network at home. From what I've been readingI should be able to take an adapter that works w/ TTL and go to RS232.
If you want to connect directly to the RPi Expansion Header I've made a small MAX3232 board which plugs directly onto it, see below. The schematic is on my blog as well if you want to build your own.

Image
Tony

wjousts
Posts: 1
Joined: Tue Jul 31, 2012 2:41 pm

Re: Serial via the GPIO

Tue Jul 31, 2012 2:51 pm

jhereg wrote:Does anyone know of a premade solution that would give me a serial port on a PI?
I have the same question. I want to use the RPi to interface with a proprietary device we have and provide a web interface to it (allowing us to ditch the Windows laptop and connect directly through the web from any web enabled device).

I can possibly try assembling something myself (this link looks interesting: http://codeandlife.com/2012/07/01/raspb ... ax3232cpe/) for a prototype, but ultimately I'd like something pre-assembled once I've worked everything out.

I saw an interesting suggestion on using this: http://www.suntekstore.com/goods-140026 ... oard_.html from here http://www.trainelectronics.com/RaspberryPi/, which is at least minimum assembly required.

Finally, from what I understand, there are actually two serial ports. I only need Tx and Rx (and Gnd, of course), but I do need to be able to configure the speed, parity, etc.

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Serial via the GPIO

Wed Aug 01, 2012 12:45 am

Another pre-assembled alternative along very similar lines http://www.tronisoft.com/prod.php?id=4205

doghousedean
Posts: 3
Joined: Wed Aug 08, 2012 10:46 am

Re: Serial via the GPIO

Wed Aug 08, 2012 10:48 am

just one thing you don't 'telnet' across the serial link, the cisco device will output directly to the console port, it will give you a prompt if you have login enabled or just let you in.

jhereg
Posts: 25
Joined: Fri Jun 15, 2012 6:28 am

Re: Serial via the GPIO

Wed Aug 08, 2012 1:57 pm

doghousedean wrote:just one thing you don't 'telnet' across the serial link, the cisco device will output directly to the console port, it will give you a prompt if you have login enabled or just let you in.
Yep. That was a bad way to phrase it. I normally use putty which is what I use for ssh and telnet. I suppose I should double check my post better before I hit submit. :lol:

jfornango
Posts: 113
Joined: Fri Sep 14, 2012 7:46 pm
Location: St. Louis, MO USA
Contact: Yahoo Messenger

Re: Serial via the GPIO

Thu Jan 17, 2013 11:53 pm

I was considering using my Pi as a small-form terminal for configuring Ciscos. I figure it beats lugging a laptop out to client sites all the time. Anyway, I was trying to decide what the best software to use under Raspian would be. Like any good geek, I started by searching the forums, which brought me here.

In the course of reading this thread, a question came to mind. It's more for Gert (our resident Pi expert), but if anyone knows, feel free to speak up.

With all this discussion of building expansion boards for a serial interface, why not just run a DB-9 to the expansion header directly? (kinda thought that was what the UART was for)

Personally, my TrendNet USB serial port has served me well for years. I need to see if they have LINUX drivers for it.

Oh, so back to my original question, what would be the best program to use to get from a Pi to the Console port on a SUP?
I'm only wearing black until they find something darker.

User avatar
TonyD
Posts: 448
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: Serial via the GPIO

Fri Jan 18, 2013 10:50 am

The UART on the Pi is a 3.3v interface while RS232 is nominally +/-12V interface, so connecting a DB9 connector and cable direct to your Pi and then hooking it to a RS232 port would be bad for your Pi.
Tony

User avatar
Gert van Loo
Posts: 2486
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Serial via the GPIO

Fri Jan 18, 2013 12:57 pm

TonyD wrote:The UART on the Pi is a 3.3v interface while RS232 is nominally +/-12V interface, so connecting a DB9 connector and cable direct to your Pi and then hooking it to a RS232 port would be bad for your Pi.
Indeed. You might think "I just clip it to 0..3V" but that is not enough.
Most RS232 inputs need more then a 3V3 swing at their input. Even a 0-5V swing rarely work.
So I am afraid you really need a R232 converter.

jfornango
Posts: 113
Joined: Fri Sep 14, 2012 7:46 pm
Location: St. Louis, MO USA
Contact: Yahoo Messenger

Re: Serial via the GPIO

Fri Jan 18, 2013 3:13 pm

Well... duh! :roll:
Wow.. haven't worked at the circuit level in almost 20 years. It's amazing the things you can forget.

I (and my Pi) thank both of you fine gentlemen for saving us from an inpromptu barbeque. :lol:
I'm only wearing black until they find something darker.

User avatar
TonyD
Posts: 448
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: Serial via the GPIO

Sun Jan 20, 2013 9:12 pm

Glad to help :-)
Tony

Return to “HATs and other add-ons”