OpenWrt Forum Archive

Topic: Yet another Newbie with a WRTSL54GS and the urge to hack

The content of this topic has been archived between 1 Apr 2018 and 27 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all,

just thought I'd post up and say my linksys WRTSL54GS is in the mail. Can't wait to stick on a serial port and do this mod. This will be my first "HW" hack, usually I'm all software and PC parts at home. I am very familiar with Solaris / jumpstart / gcc, I'm hoping to get up to speed with others in this forum and contribute something useful to the collective...

Bought an IDC-10 at Frys today, looks like I'll finally get a chance to practice those soldering & dremel skills.

goodnight!
JV

Welcome!

I used a right-angle IDC-10, since after cutting a small hole in the front edge it nicely projects out the front so I can hook up my MAX233 adapter when I need it.  I just bought one assembled serial-converter kit, on the idea I could move this among several units.

The IDC-10 connectors are the cheap part and it always seemed ridiculous to me to leave an expensive serial adapter permanently attached into a single router when you use it only during development and maybe rescue from a bad flash.  I work with a community WiFi project and we have a dozen WRT54GL units as purely AP's and a few WRTSL54GS units as routers (WiFi actually disabled).

Again, welcome!

(Last edited by vincentfox on 25 Feb 2007, 19:09)

I've been temped to stick a serial port on my SL too but haven't been able to find enough information on the nitty gritty details to attempt it myself (being a complete hardware hacking n00b).  Any instructions/advice/pictures/should-be-obvious-warnings would be greatly appreciated.  Thanks!

I didn't find it really difficult.  I'm not sure how everyone does this, but my steps:

1) Get someone handy with a soldering iron to attach an IDC-10 socket.  I can solder big wires but anything finer details like a PCB I got an associate to do this for me.  These routers all seem to have the 2x5=10-pin spot for it, it's just a matter of someone fitting a connector to that spot.  The connector is 50 cents at Fry's, and if you have a friend handy with a soldering iron this part is something I think it's good to do just in case.  If you think you will need it rarely I would probably use a "straight" connector so you open the case when you need it. I chose a right-angle connector and cut a hole in the plastic so it sticks out and I can hook up more easily.

2) Order a MAX233 kit from somewhere, these guys are popular:
http://www.compsys1.com/workbench/On_to … apter.html
I contacted them and asked could I get it already fully assembled and they said extra $6 for all soldered up so I bought that.

3) The only bit of real work I had to do, buy some connectors and some ribbon cable and make one cable.
I used the cheap plastic connectors that just squeeze onto ribbon cable, again to avoid fiddly soldering. So I used a
couple of IDC-10 females to give me my link to the MAX233 kit. I just hooked everything flat at the router end and did all
my wire-flipping at the MAX233 end of the cable to give me the right pin at the right places. I hook the bottom row
of the IDC-10 into the MAX233 if I want ttyS0 and the top row if I want ttyS1.  I only needed a single serial port really
I just played around with the other one a few times although they do have a version that will give you both at once.
The other side of the MAX233 kit is a standard DB-9 serial port so cables for that to your computer are easy to find.

I have read you can also use certain Nokia cell-phone adapter cables and just butcher up a new end for it so you end up with a solution
that will go straight into a USB port on your computer, look around for that if you are interested.

(Last edited by vincentfox on 25 Feb 2007, 23:13)

Unless this is the only router you're planning to modify, save yourself the hassle of wiring up a MAX IC (to each prospective router) and buy a USB to TTL adapter (Prolific, FTDI, ark3116, etc. based chipset).  That way you'll only need to make a jumper from the circuit board to your interface (DB9, pin header, etc.).

Stay away from Cypress adapters, I haven't bought a working one yet.

http://www.nslu2-linux.org/wiki/HowTo/AddASerialPort

One thought I had which would be a relatively clean hack is instead of the IDC-10 being soldered to the logic board, instead wire up a 3.5mm stereo jack, which can be added to the enclosure easily because of its size, then from there all you would need is a custom cable to whatever serial adapter you're using for when you need it.  Since all you need is three wires, this should work great.

Well my setup uses 4 wires. There's the 5V, GND, and the TX and RX pins. How would you power the circuit doing the signal conversion otherwise?

With ordinary serial you can get away with only 3 wires, but that's because the signals are already at the right level.  The output of routers is at 3V instead of 12V hence the need for a small circuit to adapt to accepted RS-232 standard.

(Last edited by vincentfox on 26 Feb 2007, 03:52)

Ah, I'd forgotten the +5, my setup didn't need it as my receiver could handle the lower voltage.  My original thought was an RJ-11 jack, which is a 4 wire setup, but I didn't see an easy way to mount the jack.

I read the NSLU page at :
http://www.nslu2-linux.org/wiki/HowTo/AddASerialPort
but it still seems to me that a "TTY to USB" Nokia cell-phone cable requires rewiring and soldiering just the same. Unless you got a nice picture of your setup, KillaB?


So this page: http://wiki.openwrt.org/OpenWrtDocs/Har … 97fcd4d4b6

tells me JP4+JP3 look like:

connector   1        2   3   4    5
JP4(ttyS0) 3.3v TX RX NC GND
JP3(ttyS1) 3.3v TX RX NC GND

Is there a functional difference between the two? "NC" stands for "No Connection"? That's why everyone uses a four wire CDROM cable?

I am going with the MAX233 assembled kit from compsys1.com for $25, because I suffer from the urge to be both lazy and neat like that. I am counting on the serial port as my magic charm against bricking my router.


superkaybee, the autopsy photos are what you need but the site appears to be down at 1pm Pacific Time 2/26/2007:
http://www.linksysinfo.org/forums/showt … hp?t=47389

vincentfox, are you the former president of Mexico?

JV

On my ark3116 based USB cable all I did was hack off the end that connects to the phone (exposing the wires) and then soldered on a pin header.  You only need to solder up three wires.  Rx, Tx and GND.  The IC is powered by USB.

In any case, I don't see why you would need to spend anywhere near $25 on a 232 cct.  The IC's are very cheap, free if you order samples from Maxim.

Personally, I used to use MAX3233 IC's since they don't require any extra caps, but now I prefer the USB cable (for console access).

Are you looking to make dual DTE and DCE ports, or just a DCE (Console) port?

(Last edited by KillaB on 27 Feb 2007, 05:08)

OK, I think better with visual aids:

Cable choice #1 is a 4 wire cdrom cable I had in my box o' parts.
If I combine this with the MAX233 & the IDC-10 female header and I think I'll have a working serial cable
http://home.comcast.net/~jv711/linksys/cdrom.4wire.cable.JPG


Cable choice #2, if you say I can skip the $25 MAX233 part, and magically I don't need the 3.3V voltage regulator?
I don't know how to address the USB port with minicom.
http://home.comcast.net/~jv711/linksys/USB.8wire.cable.JPG



I have a separate USB-to-serial DB9 from Airlink, (I use for laptop to Sun server consoles) but it requires drivers to work in Windows:
http://www.airlinkplus.com/usb/acusbs.htm

I think I want 'just a DCE (Console) port', how are people using a 'dual DTE and DCE port'?

JV

This is how I did it: I used a clone Nokia DKU-5 USB-to-serial cable, and replaced the Nokia connector with a 5-pin connector built from two pieces of a SIL strip glued together, covered with heath shrink tube:
http://www.xs4all.nl/~dicks/wifi/usb-cable.jpg
I poked 5 holes in the back of my Asus WL-500g Deluxe router:
http://www.xs4all.nl/~dicks/wifi/wl500g-external.jpg
and glued a connector on the inside, which is connected to the serial header:
http://www.xs4all.nl/~dicks/wifi/wl500g-internal.jpg
Incidently, my Fonera router already has holes in a 0.1" grid. Using two headers glued together, I can also connect my cable to the Fonera without the need to modify the case:
http://www.xs4all.nl/~dicks/wifi/fonera-side.jpg

Both serial ports on all Linksys routers are wired the same way, I'm not sure you'd consider the router end as particularly supporting either DTE or DCE as you would actually see that distinction only at the other end of your serial adapter circuit.  The only difference for ttyS1 is it defaults to a much lower baud-rate, and isn't running a console shell.  I used ttyS1 to play around with a GPS at one point, but never really finished the project.

I continue to be annoyed that neither port supports software or hardware flow control.  The console at 115K sometimes I lose characters.  I wish there were enough of a market for a hobbyist version of these boards from BroadCom, because there are a couple of things I'd like see in a "PLUS" version like real serial ports or double the amount of RAM.  Oh well.

I added a couple of pics of my serial-port setup to the Wiki page:

http://wiki.openwrt.org/OpenWrtDocs/Har … /WRTSL54GS

Perhaps I should have put it off on a separate HowTo page, may do that later if I add more details.

(Last edited by vincentfox on 27 Feb 2007, 20:27)

This thread inspired me to install my first serial console, so I just wanted to post my results.  I have very poor soldering skills, so I wanted to avoid soldering as much as possible.  With that in mind, I bought this cable:

http://www.ftdichip.com/Products/Evalua … 3V3-AJ.htm

It has a chip in the usb end which takes care of the usb to ttl level serial conversion.  All I had to do was run 3 wires from the serial header to a 3.5mm jack I screwed into the router.  Here are some pictures, I'm pretty happy with the results.

http://www.psyc.vt.edu/openwrt/serial_and_cable.jpg
http://www.psyc.vt.edu/openwrt/3.5mm_serial.jpg

That is a wrt350n.  If I had it to do over, I would not put the jack there again because I had to cut off one of the supports inside the router.  I would probably put it on the side opposite of the antennas. 

Thanks to everyone who posted here.

Sweet!  And they have Mac drivers as well.  I'll likely be ordering one of these soon for myself and ditch my hacked cable/interface.

netprince wrote:

This thread inspired me to install my first serial console, so I just wanted to post my results.

Wow, dude, that's impressive! I'm new to all this serial port thing, so may I ask you something? I have a WTR54G and it got 5 pins sticking out of the board (forgot where I'd put the picture), but the usb to serial cable only has 3 leads -- how did you find out where they are supposed to go on the board of your router?
I don't want to solder anything on the router (the case is just too small), I just want to get in there once to be able to flash it.
thanks in advance!

stangri wrote:

Wow, dude, that's impressive! I'm new to all this serial port thing, so may I ask you something? I have a WTR54G and it got 5 pins sticking out of the board (forgot where I'd put the picture), but the usb to serial cable only has 3 leads -- how did you find out where they are supposed to go on the board of your router?
I don't want to solder anything on the router (the case is just too small), I just want to get in there once to be able to flash it.
thanks in advance!

Thanks.  You wire TX,RX, and Ground.  You dont have to wire the +3 because the cable gets that from the USB port.  Check the wiki for your router's serial location.

(Last edited by netprince on 11 Apr 2007, 13:45)

stangri wrote:
netprince wrote:

This thread inspired me to install my first serial console, so I just wanted to post my results.

Wow, dude, that's impressive! I'm new to all this serial port thing, so may I ask you something? I have a WTR54G and it got 5 pins sticking out of the board (forgot where I'd put the picture), but the usb to serial cable only has 3 leads -- how did you find out where they are supposed to go on the board of your router?
I don't want to solder anything on the router (the case is just too small), I just want to get in there once to be able to flash it.
thanks in advance!

I'm assuming you mean the WRT54GS, you might want to post over in this thread:  http://forum.openwrt.org/viewtopic.php?id=8534

There are two sets of connectors, I'm going to assume that the one labeled 3.3v is the power input, judging from the parts surrounding it, and that the other set of 4 (not 5) pins could be for a serial interface.  The Wiki doesn't have any details on this model, so I'd check with the folks already hacking on it for help.

In other news, my TTL-232R-3V3-AJ cable arrived (thanks again, netprince, for this recommendation!), and my WRTSL54GS is sporting a nice clean serial jack.

http://www.themailshack.com/WRTSL54GS/wrt_jack_cable.jpg

http://www.themailshack.com/WRTSL54GS/Serial_hack.jpg

That's a nice clean setup!

I may cull some pix and info out of this thread, and add them to the Wiki page for the SL unit.

Device is not cheap after shipping from UK to USA but at least it will be a little cleaner install.

It looks like Linux kernels >2.6.9 have driver support for this cable, have you tried it?  I have an old Fedora Core4 box that I'd like to be able to log the serial console data from a total of 3 WRT units.  It'd be nice if I could just cable them up this way. It'd be easy to add a USB hub for 3 devices so this looks more elegant of a solution. Do you think having multiple of them attached would present any problems as far as enumerating COM device numbers?

I'm trying to catch red-handed the "OpenWRT v0.9 GL crashing problem" and this would really help.

@netprince: Is that WRT350N working with OpenWRT?  The Wiki Hardware table still says WRT350N=UNTESTED.

(Last edited by vincentfox on 23 Apr 2007, 00:04)

The wrt350n is not supported yet.  I managed to talk my boss into donating one to OpenWRT, so we could see support in the not too distant future.  The reason I installed the serial port on mine was to test any beta code.

WRT the GL crashing problem, I have been watching that closely.  I really wish you luck vincentfox, it seems to be bugging quite a few people, including me occasionally.

vincentfox wrote:

Device is not cheap after shipping from UK to USA but at least it will be a little cleaner install.

Yeah, the price was a little high, but considering the RS232 chip built into the cable, etc, it didn't seem that bad.  I had checked the US distributors listed on FTDI's site, but none listed it online, but the cables actually shipped from Mouser Electronics.  I was going to call them to see if it could be ordered directly, and for how much, I'll let you know what I find out.

http://www.mouser.com/ftdi/


vincentfox wrote:

It looks like Linux kernels >2.6.9 have driver support for this cable, have you tried it?

Do you think having multiple of them attached would present any problems as far as enumerating COM device numbers?

No Linux here at the moment, but since I had ordered two cables, I plugged the second one into my hub and it did appar as an additional com port (under OS X), the chip apparently has a unique serial number internally, so it would seem that using several cables to talk with multiple devices simultaneously would not be a problem.

Good info, thanks.  I went ahead and ordered 4 cables from the FTDI web-shop as I need this ASAP.  Although I suppose I could cancel that tomorrow if there's a big difference ordering direct from Mouser.

I'm equipping 3 GL & 1 SL unit as soon as they arrive.  As this mod is a simpler 3-wire solder job I will probably start putting the stereo-jack on any new WRT units in our community WISP.   NetPrince and JimWright, good work!  This is a superior and elegant design.

I added JimWright pix to the Wiki hardware page for WRTSL54GS.

(Last edited by vincentfox on 23 Apr 2007, 06:01)

vincentfox wrote:

I added JimWright pix to the Wiki hardware page for WRTSL54GS.

W00t!  wink

One quick note on the 3.5 stereo jack, when you're shopping around for parts, assuming you're doing this locally, you'll want to be sure that the threaded end is at least 3/16" long.  I had bought a different jack earlier in the week but I hadn't expected the case on the SL to be as thick as it was, and there was no way to secure it to the case.  My fault for not measuing first, and of course now I don't know how long the threaded end is on the part that I used, but here's a link to the part at the local shop I picked mine up from:

http://www.altex.com/product_info.php?c … ts_id=4009

I just got my cables today via DHL. Quicker than I thought!

You were right though, I went to local Radio Shack and the few stereo-jacks they had on hand all had very short threaded section.  Went to Fry's Electronics in Sacramento.  Their part #3343172, Philmore 3.5mm stereo phone jack looks the right part. Bit more length on the threaded section.  Cost was US$1.69 and looks the same as the one pictured in your link.

Forgive a silly question, but the cable diagram on FTDI site shows:

TIP=TX
RING=RX
SLEEVE=GND

I will assume you wire it so TX goes to pin4=TX on the board? Just want to make sure it's not TX for one device is RX for the other.  Will be doing soldering tomorrow.

Again, great work!

(Last edited by vincentfox on 27 Apr 2007, 08:29)