Everything you Ever Wanted to know about Serial - TTL

Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3 ... 6, 7, 8, 9, 10, 11  Next
Author Message
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11563
Location: Wherever the wind blows- North America

PostPosted: Thu Feb 11, 2010 15:44    Post subject: Reply with quote
It depends on the CFE. Some will start tftp by starting the daemon...like the Netgears units

tftpd

starts the router "listening" for tftp input.

The Linksys routers, will start tftp automatically during the boot process...but can be initiated by the "go" command from the CFE prompt. (checks tftp for input, if it doesn't find it...it starts the boot process)

Asus...needs to have the unit started in restoration mode and the restoration utility is needed to flash it.

hope it helps.

redhawk

_________________
The only stupid question....is the unasked one.
Sponsor
modervador
DD-WRT User


Joined: 07 Sep 2009
Posts: 270

PostPosted: Thu Feb 11, 2010 15:57    Post subject: Reply with quote
redhawk0 wrote:
It depends on the CFE. Some will start tftp by starting the daemon...like the Netgears units

tftpd

starts the router "listening" for tftp input. [snip] hope it helps.


*forehead slap/facepalm combo, followed by slight drooling while saying "duuuuurrrrrrrr" *

tftpd to start the tftp daemon? Seems logical.

Yes, you've helped quite a bit. Thanks.

My inability to see the obvious in some situations can only be matched by my tendency to state the obvious in others.
Taullinis
DD-WRT Novice


Joined: 03 Feb 2010
Posts: 1

PostPosted: Thu Feb 18, 2010 0:08    Post subject: Reply with quote
So is there anything that can be done if the router only responds with

Decompressing..........done


WNDR3300 Boot code V1.0.4
Build date: Sat Aug 30 09:25:06 CST 2008
Boot partition size = 131072(0x20000)
CPU type 0x29006: 200MHz
Total memory: 16384 KBytes

and then stops doing anything?

Edit: Feb 18, 2010 12:25 am
Never mind I unplugged it for a couple of minutes and it started trying to load the bad firmware again.
DHC_DarkShadow
DD-WRT Guru


Joined: 22 Jun 2008
Posts: 2440
Location: Am now Dark_Shadow

PostPosted: Tue Mar 09, 2010 23:25    Post subject: Reply with quote
I figured this is the best place for any serial information.

I have seen it mentioned on server occasions and I think Eko even started a thread about the serial connector on the 610 in the RJ45 port. Couple of questions...

1. (I don't own one) Is it in the WAN port?

2. Does anybody else have a WRT300N v1.1 that has this in the WAN Port?

_________________
The New Me
barryware
DD-WRT Guru


Joined: 26 Jan 2008
Posts: 13049
Location: Behind The Reset Button

PostPosted: Tue Mar 09, 2010 23:38    Post subject: Reply with quote
DHC_DarkShadow wrote:
I figured this is the best place for any serial information.

I have seen it mentioned on server occasions and I think Eko even started a thread about the serial connector on the 610 in the RJ45 port. Couple of questions...

1. (I don't own one) Is it in the WAN port?

2. Does anybody else have a WRT300N v1.1 that has this in the WAN Port?


1). Yes.. the wan port

2). Yes.. The 300 V1.1 has a serial connection in the wan port.

vcc, tx, rx, gnd

_________________
[Moderator Deleted] Shocked
Johny5
DD-WRT Novice


Joined: 02 Dec 2009
Posts: 23

PostPosted: Fri Mar 12, 2010 16:07    Post subject: Reply with quote
I know this thread has tangented away from it's original topic, but I have a question about the wiring up of the serial port.

I'm using a wrt54gl v1.1, which has two serial ports. I'm planning on using one of these serial ports to connect the router to a micro-processor (AVR Butterfly) which will give me 8 additional gpios and a small LED screen for output. The Butterfly has built in UART, but unfortunately it works on rs-232 voltage levels so I need to convert the signal. I'm using a max232 to do this and powering it from the 12v input on the router run through a 7805 voltage regulator.

In order to test my set-up, I'm first trying to get serial communication from my computer to the router so that I know it works...the problem is, it doesn't work.

My question is regarding DTE and DCE. When connecting the router to a computer via serial port, are we using a DTE to DCE setup or a DTE to DTE set up? (I've spent hours googling but I seem to find conflicting information.) I saw Redhawk mention crossing the tx and rx earlier in this thread, so I would assume that he is using a DTE to DTE set-up. I am using a null modem cable to connect the male db9 connector on the computer to the male db9 connector I installed on the router, so I would think that this would take care of the cross connect and I wired everything else straight. Does it matter where the cross connect is? Is it possible that I need to cross connect between the serial header on the router and the max232 instead of between the max232 and the computer? Would it matter? I've tried switching my txs and rxs around serveral times, but I've yet to find a combo that works.

Also, I've read that the serial port 0 on the router is set up as DTE and the serial port 1 is set up as DCE. Does anyone know if this is true, and if so, does it matter? Is this a setting that can be changed? I will need a DTE port to communicate with the microprocessor and if I can't use port 1 as DTE then I will have to "unbind" the terminal session to port 0 so that when the router restarts and posts it won't send all that data to the microprocessor. Of course if I do that and then I ever need the serial port to reflash firmware I'm out of luck.

One last question, how would I go about finding out if the serial port in the router is fried? I've done a lot of other electronic experiments on the router that I'm currently working on, and it's possible that I fried the serial port before I even began working on this project. I have other routers I can use, but I'd like to use this one if the serial port is still working.
modervador
DD-WRT User


Joined: 07 Sep 2009
Posts: 270

PostPosted: Sat Mar 13, 2010 0:10    Post subject: Reply with quote
Johny5 wrote:
My question is regarding DTE and DCE. When connecting the router to a computer via serial port, are we using a DTE to DCE setup or a DTE to DTE set up?

Your head might start to hurt if you try to think of it that way. Since you are dealing with two signals and not the modem-ring and carrier-detect and request-to-send and all that, you just have to understand the direction of the signal flow in these two cases.

On my router (and probably most others) Tx means "serial data out", i.e. the pin is sending a nominal 0-3 volt signal, and Rx means "serial data in", i.e. the pin is accepting a nominal 0-3 volt signal. Technically, this makes it like DTE, but perhaps there's no sense calling it that because it's not RS-232C and you need a level shifter (that's the MAX232) so you're not concerned if it can connect straight through to some other piece of equipment, which was the main purpose behind the DCE and DTE notation.

On the IBM PC COMM port Tx is "serial data out", i.e. the pin is sending a nominal +/-12 volt signal, and Rx is "serial data in", i.e. the pin is accepting a nominal +/-12 volt signal. This is DTE.

If you can't establish communications and you are messing with null modem cables and asking if it matters where the crossover is, you are not probably thinking of it in terms of "data in" and "data out" and you probably haven't measured any voltages with a meter or oscilloscope.

"Serial data out" on the router will hover near Vcc except when data is flowing, and "serial data in" will hover nearer to ground (assuming MOS input, which is likely correct). If it's the console port, "serial data out" voltage will change while the router boots, because data is flowing then, but "serial data in" will not.

On the PC COMM port, "serial data out" will hover near -12V except when data is flowing, like when you send characters via Hyperterminal. "Serial data in" will hover nearer to ground and will not change as you type some gibberish into Hyperterminal.

Check out this page for more interface circuits. I have used the transistor one myself.
http://www.dd-wrt.com/wiki/index.php/LaFonera_Hardware_Serial-Cable-Port

Yes, you might be able to blow your router serial port by connecting it to the wrong pin of the MAX232. Before you hook it to your router, you should do a "loopback test" by connecting the TTL-level Tx and Rx lines that would go to the router to each other instead. The characters should echo on the Hyperterminal screen as you type them.

Once you work some of this out, your other questions might be simpler to discuss.
Johny5
DD-WRT Novice


Joined: 02 Dec 2009
Posts: 23

PostPosted: Sun Mar 14, 2010 0:25    Post subject: Reply with quote
Quote:
"Your head might start to hurt if you try to think of it that way."

That's an understatement.

But now I just feel kinda stupid. (it works now by the way)

I actually started out looking at this in a simple rx and tx way in the first place, but when it didn't work, I assumed I was missing something. I started reading about this mod other places as well as serial ports in general. That's when I got confused about the DTE vs DCE and posted my question. Modervador, your advice was very helpul, so I sat back down at my bench and got back to testing.

I had already verified all the noncommunications pins on the max232 by thier voltages, so I knew the problem was with the tx and rx. Using your advice I tested the votages going into the max232 from the PC and verified my tx and rx were correct from the PC. Then I did a loopback test from the PC, throught the max232, to the receptical for the header pins on the router and back. I got an echo, so that assured me everything from that point back was ok....so now all that leaves is the tx and rx on the serial port (because obviously the loopback test can't tell you if tx and rx are flopped), so I flopped them.....it still didn't work!

I was banging my head on the desk when I realized what I had missed. I reused an old 5x2 pin-header receptical from a usb port on an old PC to connect my db9 on the router to the max232 board. I had hooked the black wire up to ground on the db9 out of habit, but when I looked at the pin header I notice that the black wire was unused and the red wire actually went to ground! Basicly the ground from the pc was not geting through. I wasn't even sure if that was important, but obviously it was because when I fixed that it worked.

Who knows how many hours I wasted all because of the disconnected ground wire. On the bright side, at least I know a lot more about antiquated serial port communications now. Thaks again for the advice Modervador.

Now that it can talk to the PC through the serial port, I'm off to see if I can't get it to talk to my microprocessor........
barryware
DD-WRT Guru


Joined: 26 Jan 2008
Posts: 13049
Location: Behind The Reset Button

PostPosted: Mon Apr 12, 2010 20:52    Post subject: Reply with quote
I didn't see this in this thread and I have typed it a million times in assisting members recover their router(s) using the serial console.

This assumes you have a ttl adapter connected and ready to go. There is reference to stock firmware. This does not apply to router that used to run vxworks. All of those, have jtag tmk..

connect that bitch (the router to your serial adapter).. 115200,8,1,n and no flow control are the com, param's

I use hyperterminal. In the terminal, boot the router.

Immediately start hitting ctrl-c. If you hit it right you will be at the cfe prompt:

cfe>

Get the tftp utility ready to flash the STOCK LINKSYS firmware for your router so all you need to do it hit enter to launch.

You are going to tell the router to accept a tftp flash of firmware. It times out quickly so that is why you need to get the utility ready to launch.

Static ip on your rig.. 192.168.1.10, mask 255.255.255.0, not necessary but gateway 192.168.1.1

at the cfe prompt:

flash -ctheader : flash1.trx

hit enter.. the router will want an upload of the firmware. It will time out after three tries. Don't let it time out, now launch the tftp utility. It will upload, program and then you will be back at the cfe prompt. This will take some time. You will see what is happening in the console.

You will be back at the cfe prompt when it is done:

cfe>

issue a "go" command:

go [enter]

the router will launch its new firmware.

Let it boot. It will boot 2 ~ 3 times.. You are done.

Now install dd-wrt again.

Good Luck..

EDIT: the above is mostly for linksys. I have used this on others also. I also forgot to mention..

Before flashing the kernel (firmware), erase nvram so any bad nvram entries won't screw up the new kernel.

At the cfe prompt:

cfe> nvram erase [enter]

_________________
[Moderator Deleted] Shocked


Last edited by barryware on Tue Apr 13, 2010 0:26; edited 1 time in total
leadboots5
DD-WRT User


Joined: 05 Feb 2010
Posts: 83

PostPosted: Mon Apr 12, 2010 23:05    Post subject: Reply with quote
I was wondering if I could get some buying guidance, both in what I need and an example/link. I bricked my wrt320n and need to revive it, since i dont care to buy another. If someone experienced could direct me to the parts i need. From what I can gather I need:

Chip(usb to ttl)
some sort of wiring to connect the chip to the router board?
headers?(these get soldered into holes on the board?)

If there is a wiki page or something for serial please let me know. I am not above reading.
HardReset
DD-WRT User


Joined: 07 May 2009
Posts: 382

PostPosted: Mon Apr 12, 2010 23:40    Post subject: Reply with quote
leadboots5 wrote:
I was wondering if I could get some buying guidance, both in what I need and an example/link. I bricked my wrt320n and need to revive it, since i dont care to buy another. If someone experienced could direct me to the parts i need. From what I can gather I need:

Chip(usb to ttl)
some sort of wiring to connect the chip to the router board?
headers?(these get soldered into holes on the board?)

If there is a wiki page or something for serial please let me know. I am not above reading.


Read THIS THREAD from post 1. There are pictures, links, everything you could ask for.

_________________
PM for Pin Short Instructions Razz
leadboots5
DD-WRT User


Joined: 05 Feb 2010
Posts: 83

PostPosted: Tue Apr 13, 2010 23:50    Post subject: Reply with quote
HardReset wrote:

Read THIS THREAD from post 1. There are pictures, links, everything you could ask for.


I did read the entire thread, however some liberties are taken when people talk to each other assuming others have experience or know something about it, which i do not. I thought I made my questions specific enough to indicate that. I'll try again. If I am asking something blatantly stupid that is covered please do point out my idiocy.

Things I need:
Chip: Barryware provides a link to one, however it has a new version for half the price, but it doesn't support some voltages?(not exactly sure)
Barry's: http://alldav.com/index.php?main_page=product_info&cPath=9&products_id=11
New Version: http://alldav.com/index.php?main_page=product_info&cPath=0&products_id=28
Quote:
The level shifter it uses only supports Vcc = 5v unlike the MAX 3221 on the v2 which allowed Vcc = 3v - 5.5v.

Does that matter actually?

Otherwise i can get a USB one off of ebay someone said, but it might be fickle like jtag is with usb.

Barry also provides links to a wire kit so i dont actually need that.

He provides a link to snappable headers? Does that mean i dont actually have to solder them?
Peabody
DD-WRT Guru


Joined: 28 Dec 2009
Posts: 1518

PostPosted: Wed Apr 14, 2010 0:07    Post subject: Reply with quote
leadboots5 wrote:
[Things I need:
Chip: Barryware provides a link to one, however it has a new version for half the price, but it doesn't support some voltages?(not exactly sure)
Barry's: http://alldav.com/index.php?main_page=product_info&cPath=9&products_id=11
New Version: http://alldav.com/index.php?main_page=product_info&cPath=0&products_id=28
Quote:
The level shifter it uses only supports Vcc = 5v unlike the MAX 3221 on the v2 which allowed Vcc = 3v - 5.5v.

Does that matter actually?


Yes. If the router is using a 3.3v power and the new version only supports 5v, that matters. It matters a lot. You actually don't want to put 5v into a 3.3v system. It will fry it, which is worse than bricking it.

Read carefully:

Murrkf wrote:
This is a wonderful post by Redhawk in Pock's post about debricking a WL500W by serial:

redhawk0 wrote:
Serial cable is required to possibly debrick units without JTAG port.

Serial cable can be either USB or DB9 connection type.
It must be capable of doing voltage level shift to +3.3V not just +5V.

There are 4 connections that are required for Serial to function properly. +3.3V, GND, Tx and Rx.

redhawk

_________________
I fix "shortcuts". If you don't have time to read thoroughly, I don't have time to re-type what you missed.
barryware
DD-WRT Guru


Joined: 26 Jan 2008
Posts: 13049
Location: Behind The Reset Button

PostPosted: Wed Apr 28, 2010 0:53    Post subject: Reply with quote
Here is a tidbit of info I discovered tonight:

Using winblows & hyperterminal, ctrl-c does not work if the scroll lock is on Shocked

everything was working... after a few initial tests, getting ready to do it again and this time flash, and I could not stop the boot using ctrl-c even though it worked several times before.

After messing around trying to figure out what just went wrong.. Turns out that the scroll lock was on.

The scroll lock on my rig(s) is what switchs between rigs through a kvm switch. So switching back and forth, the scroll lock key was left on..

I verified... scroll lock on, ctrl-c does not work. Dunno why Confused

_________________
[Moderator Deleted] Shocked
ReadtheAnnouncements!
DD-WRT Guru


Joined: 02 Mar 2010
Posts: 1362

PostPosted: Tue May 04, 2010 15:02    Post subject: Reply with quote
Here is a link to how to use the secret serial port inside the WAN port of some newer routers:
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=62998

_________________
If I've said it once, I've must have said it a thousand times! READ the announcements at the start of the broadcom forum!
THESE:
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=54889
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=51486
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=54845
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=52043
(We'll wait....!) Wink
Goto page Previous  1, 2, 3 ... 6, 7, 8, 9, 10, 11  Next Display posts from previous:    Page 7 of 11
Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum