Posted: Mon Dec 15, 2008 11:53 Post subject: Trying to recover a DIR-300 via serial, need some help
Sorry to make a separate thread about this. About a week ago I screwed up my DIR300 while I was flashing it. My mistake, I restarted Firefox in the middle of the upgrade.
Since I couldn't telnet into Redboot I am trying RS232.
I connected pins 1,3 and 4 on the serial port to a max232 and then to my pc via a FTDI USB-RS232 adapter, but I am not getting any output on my computer.
I'd like to know if the router outputs on the serial console during the boot process automatically. I suppose it does, but I just want to be sure.
Can somebody that's already connected to a DIR300 or AR430W via serial console confirm this for me?
How did you power the MAX232 ? If you connected 3 wires, I suppose you used some other source.
Keep in mind MAX232 is a +5V chip, and might not translate well the levels if the logic in the router is 3.3 V based. I did not have any problem with my bricked WRT55AG, though. I used an external regulated +5V supply for the max and only 3 wires to router. But later I thought it was better to use the +3.3 V present on the router RS232 header, because using external 5V on MAX232 could kill the serial interface (based on 3.3V). For this, I should really use the MAX 3232 that is optimized for 3.3V. Anyway, my analog devices ADM232L worke ok with 3.3V :)
For you to debug the problem, I think it would b best either to try or serial "kit" with another source known to be ok, or separate it and keep only the MAX 232 part and get a computer with true serial port. Don't use the USB adaptor for now. They are known to not work OK in all cases.
The 232 is powered by a 7805 regulator at 5V. My business partner and I sell automation solutions for gasoline dispensers. I do the software and he does the hardware.
This 232 circuit is from a board that was RMA'd by a customer, the serial circuit is fine, the problem was somewhere else and the board was going to be scrapped. I am piggybacking on the pre-existing circuit. The capacitors for the 232 are already there, and so is an RJ45 socket that allows me to connect an RJ45-DB9 cable straight to my PC. So I just wired the serial lines from the DIR-300 to the right pins on the MAX. That should be enough, but it is not working.
The datasheet for MAX232ECN states that the logic is 0-0.8V and 2-5V for the signals on the TTL side, so receiving from the DIR300 should not be a problem at 3.3V. I hope I have not fried the circuit with 5V!
I have generated some noise on purpose on the TX line of the DIR-300 just to see if my PC is receiving anything, and it did. Obviously parity and framing did not match but it did show some garbage on putty in serial mode. So the pinout on the RJ45-DB9 cable is fine, the MAX232 is powered correctly apparently.
The FTDI RS232-USB converter works just fine. FTDI makes great chipsets and this particular USB implementation has always worked 100% for me.
My original question was if Redboot starts transmitting automatically through the console on boot or do I need to do anything like press the reset button or something.
Another question, when I disassembled the DIR300, I found an additional led with a switch button hidden inside right beside the serial lines. What does that do?
Joined: 30 Nov 2008 Posts: 206 Location: Wherever the wind blows.
Posted: Sun Dec 21, 2008 7:35 Post subject:
Alex
where did you get the pinout info for the 300 ? are you sure it is correct ?
For a test, just use the tx data in to the max232, and ignore rx, try different pins on the header at boot time with the tx in cable (You wont do any harm.
IF you use the max 232 in a 3.3v circuit, it is best to use a 100 ohm resistor on the rx out line from the max 232 to the rx line on the board you are testing.
You could even look for data the dirty way - just to test for an output.. connect pin 2 of the usb to 232 converter 9 pin d header to a 100 ohm resistor and a length of cable
connect pin 5 to ground on the circuit in test, thats it.. using your terminal program set at 9600 n 8 1 to start with.. just hook up the ground and poke around the port header with the wire..
You will not get a clear ascii text due to the signal line being inverted, but at least you can tell if its transitting ANYTHING.. on the line that gives output, then add the max232, or a simple transistor inverter.
Makes a good dirty quick tester.
Rudds. _________________ I would rather have a bottle in front of me than a frontal labotomy
I broke my DIR-300 a while ago playing with DD-WRT.
So while I have holidays and wanted a new project, I thought I would have a go at talking to it from the serial port.
So to just confirm the rumours, yes it works.
How I did it was by using a TTL converter that I made years ago when I had a Casio Organiser.
I continually find myself playing with different products that require me to talk to them in TTL.
e.g. Amateur Radios, Satellite receivers and PIC based projects.
It's a very useful tool to have, so when I jet a new device to play with, I just make up an adaptor patch lead and plug it onto the end of the adaptor which has a 3.5mm stereo plug.
The Circuit I use is this:
The finished product looks like this
It's made on a piece of Veroboard and fits into an extended back shell.
I added some jumpers to the PCB and made up and adaptor lead to suit.
Dear Jamie (vk3jme)
I really appreciate your post with all pictures about how to build a cable to connect via serial to DIR-300.
I am just an amateur on doing this stuff. So, I would like to ask you if you could post (or send me) the final printed circuit, so I could made it in the exact size to fit in the DB-25 cover, as you did.
Another thing: I would like to know what do I have to do, i.e. what commands, once I got connected on DIR-300? Are the same commands as if you were connected wired?
Thanks in advance.
Dear vk3jme,
i have Dlink Dir300 and i want to flash it with other firmware, but i cannot access the Redboot :(
i did read a lot of manuals- i tried it but without success. Today i bought the parts for the Your tool.
Can You please explain to me or please post a picture how should be wired the tool with the router (without 3.5mm stereo plug)
ARxxxW/DIR-300:
+-----+ +---+ +-----------------+ +---+
|Power| |Wan| |Ethernet x4 ports| |Ant|
+-------------------------------------+
|TXD|
|GND|
|VCC|
| . |
|RXD|
+-------------------------------------+
this are the pins of the serial port of the router
Sorry about not promptly responding to the questions guys.
My Dir-300 has been behaving very well with DD-WRT for months now, so I don't visit the site all that much anymore.
Quote:
I would like to ask you if you could post (or send me) the final printed circuit, so I could made it in the exact size to fit in the DB-25 cover, as you did.
My TTL converter was originally made on Veroboard, so I have no PCB artwork to offer you. It is a really simply schematic, so you should be able to work out for yourself how to make your own using Veroboard too.
Quote:
I would like to know what do I have to do, i.e. what commands, once I got connected on DIR-300? Are the same commands as if you were connected wired?
But instead of using Putty to connect to the DIR-300 via SSH, connect to it a serial connection. Just set your connection to 9600,n,8,1
Turn the DIR-300 on and you will see it talk. From there you should be able to follow the instructions as normal
Quote:
Can You please explain to me or please post a picture how should be wired the tool with the router (without 3.5mm stereo plug)
To connect the DIR-300 to the TTL converter schematic I posted previously, connect the pins of P2 of the convertor to the following pins of the DIR-300
i follow strict the steps, but i cannot access the Redboot prompt
my current firmware version is 1.04 (the original firmware)
>> may be it's a problem?
->i did set my ip address/mask 192.168.20.80/255.255.255.0
-> i pressed the reset button
-> i plugged on the router while holding the reset button for 30s
-> release the reset button
-> open telnet session on 192.168.20.81 on port: 9000
-> the output on the screen: NOTHING :(
this stuff drive me crazy ... i cannot access the Redboot.
Don't forget to modify either script to the ips and what not that you need. _________________ Linksys WRT610n v1 - DD-WRT K26 v24-sp2 (03/24/10) mini-usb
(SVN revision 14144)
Linksys WRT350n(with WPC600N) - DD-WRT v24-sp2 (01/02/10) mini-usb-ftp (SVN revision 13577M NEWD Eko)
Sorry about not promptly responding to the questions guys.
My Dir-300 has been behaving very well with DD-WRT for months now, so I don't visit the site all that much anymore.
Quote:
I would like to ask you if you could post (or send me) the final printed circuit, so I could made it in the exact size to fit in the DB-25 cover, as you did.
My TTL converter was originally made on Veroboard, so I have no PCB artwork to offer you. It is a really simply schematic, so you should be able to work out for yourself how to make your own using Veroboard too.
Quote:
I would like to know what do I have to do, i.e. what commands, once I got connected on DIR-300? Are the same commands as if you were connected wired?
But instead of using Putty to connect to the DIR-300 via SSH, connect to it a serial connection. Just set your connection to 9600,n,8,1
Turn the DIR-300 on and you will see it talk. From there you should be able to follow the instructions as normal
Quote:
Can You please explain to me or please post a picture how should be wired the tool with the router (without 3.5mm stereo plug)
To connect the DIR-300 to the TTL converter schematic I posted previously, connect the pins of P2 of the convertor to the following pins of the DIR-300
I made your TTL but I've some problem, In my putty window I just some symbols and no communication between the DIR and my laptop (like this : ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ).
So I just want some precisions :
-> the earth (GND) is linked to what?
-> Should I connect the 3,3V (VCC) in the DIR because in your schematic, it isn't.
-> If yes, the 3,3V can be connected to the + of a couple of LR06 battery? and the ground to the -?
I made your TTL but I've some problem, In my putty window I just some symbols and no communication between the DIR and my laptop (like this : ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ).
So I just want some precisions :
-> the earth (GND) is linked to what?
-> Should I connect the 3,3V (VCC) in the DIR because in your schematic, it isn't.
-> If yes, the 3,3V can be connected to the + of a couple of LR06 battery? and the ground to the -?
Thanks a lot
GND is connected to GND of the TTL convertor
VCC is left unconnected. The TTL Converter is self powered from the RS-232 port.
Sorry about the delay, My DIR-300 is still working fine, and I haven't broken it since I started playing with DD-WRT, so I haven't had any need to access it via the console port.
I would think if you are just getting ÿÿÿÿÿÿ when you attempt to talk to it via console, I would think that you might have the speed and handshaking set wrong on your computer.
Just maybe the voltages from your laptop are not true RS-232 voltages.
Try using the interface from a desktop PC and see if you get the same results.
One more thought:
I never bricked my DIR-300 with the original firmware.
When I bricked it I had already managed to get the suggested version of Redboot onto it using the telnet method.
So I'm not too sure what speed the factory firmware talks from the console port.
Might be worth while trying some different speeds like 2400,n,8,1 19200,n,8,1 etc.