PDA

Bekijk de volledige versie : Howto add serial port to WL-500gx/gp



Josephus
23-03-2005, 16:15
The Asus wl500g deluxe has uart pinout onboard, so 2 serial ports can be added to the unit.
The only difference between wl500g and wl500gx that the deluxe does not require a UART chip, so a simple RS232 transceiver will do the trick.

Here are my experiences adding a single serial port to the router
The parts you need:
- 1 MAX3232 IC (SO-IC)
- 5 1uF capacitors
- cables, connectors

I attached the PCB layout I made, and a few pictures that might help.
There are 2 jumpers on the pcb, which switches between the Tx-Rx, so it doesn't matter what kind of serial cable you actually use.
Good juper configurations:
._ ._ and _. _.
Don't mix them! Next time i'm going to use a switch instead :)

You need to connect the router's 3.3v, GND, UART_TX0, UART_RX0 pins to the left side of the pcb, set the jumpers, and connect a DB9 connector to the right side.

Note: Actually i was able to add the serial port without actually removing the warranty sticker. I left the screw with the sticker untouched, and stretched the unit just enough to get the connector on the pins.

Important: Don't try this, unless you know what you are doing. I take no responsibility for damaging your router



CFE version 1.0.37 for BCM947XX (32bit,SP,LE)
Build Date: ¤* 7¤ë 16 19:48:38 CST 2004 (root@PaNLinux)
Copyright (C) 2000,2001,2002,2003 Broadcom Corporation.

Initializing Arena.
Initializing Devices.
et0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller 1.3.2.0
rndis0: Broadcom USB RNDIS Network Adapter (P-t-P)
CPU type 0x29007: 200MHz
Total memory: 0x1000000 bytes (16MB)

Total memory used by CFE: 0x80300000 - 0x80436CF0 (1273072)
Initialized Data: 0x803311B0 - 0x80333540 (9104)
BSS Area: 0x80333540 - 0x80334CF0 (6064)
Local Heap: 0x80334CF0 - 0x80434CF0 (1048576)
Stack Area: 0x80434CF0 - 0x80436CF0 (8192)
Text (code) segment: 0x80300000 - 0x803311B0 (201136)
Boot area (physical): 0x00437000 - 0x00477000
Relocation Factor: I:00000000 - D:00000000

Device eth0: hwaddr 00-11-D8-XX-XX-XX, ipaddr 192.168.1.1, mask 255.255.255.0
gateway not set, nameserver not set
Rescue Flag disable.
Reading :: TFTP Server.
Failed.: Timeout occured
Loader:raw Filesys:raw Dev:flash0.os File: Options:(null)
Loading: ...... 1748992 bytes read
Entry at 0x80001000
Closing network.
Starting program at 0x80001000
CPU revision is: 00029007

Primary instruction cache 8kB, physically tagged, 2-way, linesize 16 bytes.

Primary data cache 4kB, 2-way, linesize 16 bytes.

Linux version 2.4.29 (josephus@arrakis) (gcc version 3.3.5) #1 Sun Mar 6 02:01:59 CET 2005

rwhitby
12-04-2005, 10:53
I have successfully connected to the serial port on J5.

I've used a small converter board from a usb->serial cable (an old phone data cable), and will mount that board inside the case, with just a USB device port added to the back panel. Pictures later ...

Here is the output from the serial console on boot (running Oleg's firmware).



CFE version 1.0.37 for BCM947XX (32bit,SP,LE)
Build Date: ¤G 3¤ë 1 16:49:41 CST 2005 (root@PaNLinux)
Copyright (C) 2000,2001,2002,2003 Broadcom Corporation.

Initializing Arena.
Initializing Devices.
et0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller 1.3.2.0
rndis0: Broadcom USB RNDIS Network Adapter (P-t-P)
CPU type 0x29007: 200MHz
Total memory: 0x2000000 bytes (32MB)

Total memory used by CFE: 0x80300000 - 0x80436F10 (1273616)
Initialized Data: 0x803313D0 - 0x80333760 (9104)
BSS Area: 0x80333760 - 0x80334F10 (6064)
Local Heap: 0x80334F10 - 0x80434F10 (1048576)
Stack Area: 0x80434F10 - 0x80436F10 (8192)
Text (code) segment: 0x80300000 - 0x803313D0 (201680)
Boot area (physical): 0x00437000 - 0x00477000
Relocation Factor: I:00000000 - D:00000000

Device eth0: hwaddr 00-11-D8-??-??-??, ipaddr 192.168.??.??, mask 255.255.255.0
gateway not set, nameserver not set
Rescue Flag disable.
Reading :: TFTP Server.
Failed.: Timeout occured
Loader:raw Filesys:raw Dev:flash0.os File: Options:(null)
Loading: .. 3560 bytes read
Entry at 0x80001000
Closing network.
Starting program at 0x80001000
cpu probe
prom init
cpu report
CPU revision is: 00029007
Primary instruction cache 8kb, linesize 16 bytes (2 ways)
Primary data cache 4kb, linesize 16 bytes (2 ways)
Linux version 2.4.20 (root@omnibook) (gcc version 3.2.3 with Broadcom modifications) #62 Mon Mar 14 21:39:22 MSK 2005
Setting the PFC value as 0x15
Determined physical RAM map:
memory: 02000000 @ 00000000 (usable)
On node 0 totalpages: 8192
zone(0): 8192 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/mtdblock2 noinitrd init=/linuxrc console=ttyS0,115200
CPU: BCM5365 rev 1 at 200 MHz
Calibrating delay loop... 199.47 BogoMIPS
Memory: 30128k/32768k available (1755k kernel code, 2640k reserved, 220k data, 68k init, 0k highmem)
Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
Checking for 'wait' instruction... unavailable.
POSIX conformance testing by UNIFIX
PCI: Fixing up bus 0
PCI: Fixing up bridge
PCI: Fixing up bus 1
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Journalled Block Device driver loaded
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
NTFS driver v1.1.22 [Flags: R/O]
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
ttyS00 at 0xb8000300 (irq = 3) is a 16550A
ttyS01 at 0xb8000400 (irq = 0) is a 16550A
loop: loaded (max 8 devices)
PPP generic driver version 2.4.2
PPP Deflate Compression module registered
PPP BSD Compression module registered
MPPE/MPPC encryption/compression module registered
Amd/Fujitsu Extended Query Table v1.1 at 0x0040
number of CFI chips: 1
Flash device: 0x400000 at 0x1c000000
Physically mapped flash: squashfs filesystem found at block 936
Creating 5 MTD partitions on "Physically mapped flash":
0x00000000-0x00040000 : "pmon"
0x00040000-0x003e0000 : "linux"
0x000ea190-0x003e0000 : "rootfs"
0x003f0000-0x00400000 : "nvram"
0x003e0000-0x003f0000 : "config"
sflash: found no supported devices
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 2048 bind 4096)
ip_conntrack version 2.1 (256 buckets, 2048 max) - 344 bytes per conntrack
ip_conntrack_pptp version 1.9 loaded
ip_nat_pptp version 1.5 loaded
ip_tables: (C) 2000-2002 Netfilter core team
ipt_time loading
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
IPv6 v0.8 for NET4.0
IPv6 over IPv4 tunneling driver
NET4: Ethernet Bridge 008 for NET4.0
802.1Q VLAN Support v1.7 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
FAT: bogus logical sector size 38400
FAT: bogus logical sector size 38400
NTFS: Unable to set blocksize 512.
VFS: Mounted root (squashfs filesystem) readonly.
Mounted devfs on /dev
Freeing unused kernel memory: 68k freed
Algorithmics/MIPS FPU Emulator v1.5
eth0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller 1.3.2.0
robosw_attach_ocp: no Robo device on OCP bus
PCI: Enabling device 01:03.0 (0004 -> 0006)
eth1: Broadcom BCM4320 802.11 Wireless Controller 3.90.7.0
device eth1 entered promiscuous mode
eth0.1: No such device
device eth0 entered promiscuous mode
br0: port 2(eth0) entering learning state
br0: port 1(eth1) entering learning state
br0: port 2(eth0) entering forwarding state
br0: topology change detected, propagating
br0: port 1(eth1) entering forwarding state
br0: topology change detected, propagating
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
usb-uhci.c: $Revision: 1.275 $ time 20:26:03 Mar 3 2005
usb-uhci.c: High bandwidth mode enabled
PCI: Enabling device 01:02.0 (0000 -> 0001)
usb-uhci.c: USB UHCI at I/O 0x100, IRQ 2
usb-uhci.c: Detected 2 ports
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
PCI: Enabling device 01:02.1 (0000 -> 0001)
usb-uhci.c: USB UHCI at I/O 0x120, IRQ 2
usb-uhci.c: Detected 2 ports
usb.c: new USB bus registered, assigned bus number 2
hub.c: USB hub found
hub.c: 2 ports detected
usb-uhci.c: v1.275:USB Universal Host Controller Interface driver
PCI: Enabling device 01:02.2 (0000 -> 0002)
ehci_hcd 01:02.2: PCI device 1106:3104
ehci_hcd 01:02.2: irq 2, pci mem c00af000
usb.c: new USB bus registered, assigned bus number 3
PCI: 01:02.2 PCI cache line size set incorrectly (0 bytes) by BIOS/FW, correcting to 32
ehci_hcd 01:02.2: USB 2.0 enabled, EHCI 1.00, driver 2003-Dec-29/2.4
hub.c: USB hub found
hub.c: 4 ports detected
usb.c: registered new driver usblp
printer.c: v0.13: USB Printer Device Class driver
usb.c: registered new driver audio
audio.c: v1.0.0:USB Audio Class driver
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
PCI devices found:
Class 0501: PCI device 14e4:0800 (rev 1).
Class 0200: PCI device 14e4:4713 (rev 1).
Class 1000: PCI device 14e4:4718 (rev 1).
Class 0c03: PCI device 14e4:4715 (rev 1).
Class 0604: PCI device 14e4:0804 (rev 1).
Class 0b30: PCI device 14e4:0816 (rev 1).
Class 0500: PCI device 14e4:080f (rev 1).
Class 0600: PCI device 14e4:5365 (rev 0).
Class 0c03: PCI device 1106:3038 (rev 97).
Class 0c03: PCI device 1106:3038 (rev 97).
Class 0c03: PCI device 1106:3104 (rev 99).
Class 0280: PCI device 14e4:4320 (rev 3).
echo for PaN ::: &&&PaN

palbeda
12-04-2005, 12:46
Hi,

I was wondering if you manage to send output to your serial port.
There is another thread about adding USB serial ports and all people I heard (including myself) trying to actually use the port found out that the wl500 reboots after sending a few characters to that port. Maybe you run into problems just like us actually using the port. Unfortunately I do not know of any fixes for this problem.

Regards

Peter

rwhitby
13-04-2005, 15:20
I've used a small converter board from a usb->serial cable (an old phone data cable), and will mount that board inside the case, with just a USB device port added to the back panel. Pictures later ...

Operation is confirmed, and here are the promised pictures. I left room between the ethernet ports and the new usb device port just in case I decide to add the extra two USB host ports later ...

-- Rod

sodb
13-04-2005, 21:58
It took me a few seconds to understand the config. Related to palbeda's remark, this set-up is the other way around. Where palbeda connected a serial<->USB to the USB port of the Asus, in this set-up you connect the serial of the asus to the USB of e.g. a PC. Therefore, no max232 voltage convertor is needed. On the other hand, for home automation applications, a native serial port on the ASUS is to be prefered.

rwhitby
13-04-2005, 23:26
It took me a few seconds to understand the config. Related to palbeda's remark, this set-up is the other way around. Where palbeda connected a serial<->USB to the USB port of the Asus, in this set-up you connect the serial of the asus to the USB of e.g. a PC. Therefore, no max232 voltage convertor is needed. On the other hand, for home automation applications, a native serial port on the ASUS is to be prefered.

If you want a non-console serial port on the wl500g (e.g. for home automation), then the easiest way is to just plug in a pl2303-based usb to serial converter cable). I have sent Oleg a patch to enable such usage in his firmware, and I hope it will be included in the next version he releases.

-- Rod

Oleg
14-04-2005, 12:11
If you want a non-console serial port on the wl500g (e.g. for home automation), then the easiest way is to just plug in a pl2303-based usb to serial converter cable). I have sent Oleg a patch to enable such usage in his firmware, and I hope it will be included in the next version he releases.

-- Rod
yes, pl2303 support would be in the next firmware. So it would be possible to connect some cellular phones, which use pl2303 in their data cables.

sodb
21-05-2005, 21:42
I have a 500gx running 1.9.2.7-5a. Before opening the case and possible break warranty I wanted to check how the internal serials are controlled.
I see the following:

[admin@wl500gx root]$ more /proc/tty/driver/serial
serinfo:1.0 driver:5.05c revision:2001-07-08
0: uart:16550A port:B8000300 irq:3 baud:115740 tx:630 rx:0 RTS|DTR
1: uart:16550A port:B8000400 irq:0 tx:0 rx:0 CTS|DSR|CD
That shows that two ports are available. Usually (in other Linux systsems) the serials devices have names /dev/ttyS0 and /dev/ttyS1. In de asus I only see /dev/tts/0 and /dev/tts/1.
trying to set baud rate using busybox stty applet results in the following:

[admin@wl500gx harddisk]$ ./busybox stty 9600 < /dev/tts/0
[admin@wl500gx harddisk]$ more /proc/tty/driver/serial
serinfo:1.0 driver:5.05c revision:2001-07-08
0: uart:16550A port:B8000300 irq:3 baud:9615 tx:630 rx:0 RTS|DTR
1: uart:16550A port:B8000400 irq:0 tx:0 rx:0 CTS|DSR|CD
It seems that the baud rate is only approximately set on the device. Probably accurate enough. Echoing some characters shows:

before
0: uart:16550A port:B8000300 irq:3 baud:9615 tx:630 rx:0 RTS|DTR
after echo "1234567890" > /dev/tts/0 it reads:
0: uart:16550A port:B8000300 irq:3 baud:9615 tx:642 rx:0 RTS|DTR
showing that the charaters are being transmitted.

Stty changes can also be made to second port; however, echoing to the second port /dev/tts/1 results in a full hang-up of the system. Need to power cycle.

Does anyone has experimence with sending/receiving messages through both the serials from the shell (thus not as default serial terminal at boot-up as is shown earlier in this thread)?

Another question is about the logical levels of this interface. Is it based on 3.3V or normal TTL 5V signals? In other words, can I connect a normal MAX232 for the signal conversion between RS-232 and the uart ports of the WL500G?

sodb
01-06-2005, 22:14
I installed the MAX3232 on serial 0 (/dev/tts/0) and it worked immediately. I used a flat cable with a dual row connector and I was able, as suggested by Josephus, to hook the connector to the internal PCB connector without removing the middle 'guarantee' screw. I even could easely close the box again and lead the flat cable out of the side of the box.
While booting I see the same messages in serial console as shown earlier in this thread. For some experiments I want to disable the console mapped to serial0. I read that console is enable in firmware (1.9.2.7-cr5). Does anyone know how to disable the console or how to kill the proces driving the consoleso that the serial port can be freed for own applications?
I see output appearing in the terminal session when I do an echo "Hello" > /dev/tts/0 . I can even reset the terminal baud rate using busybox stty 9600 < /dev/tts/0 and output characters on this baudrate. However, as soon as I type a character in the serial terminal, the terminal is reset back to the original speed of 115200 baud as shown below
[admin@wl500gx harddisk]$ ./busybox stty 9600 < /dev/tts/0
[admin@wl500gx harddisk]$ ./busybox stty -a < /dev/tts/0
speed 9600 baud; rows 0; columns 0;
intr = <undef>; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon ixoff
-iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

<type a Carriage Return in terminal session>

[admin@wl500gx harddisk]$ ./busybox stty -a < /dev/tts/0
speed 115200 baud; rows 0; columns 0;
intr = <undef>; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon ixoff
-iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

It seems that a process whatches the serial port and resets its baudrate when receiving input. Any suggestions? I tried the second serial port (UART_RX1/TX1) , but as described earlier, the systems hangs as soon as output is sent to this port. Has that anything to to with IRQ 0 used by this port?

sodb
03-06-2005, 22:14
I recompiled kernel with the following change in kernel.config
CONFIG_CMDLINE="root=/dev/mtdblock2 noinitrd init=/linuxrc console=null"
Now the console is disabled and is free to use for own purposes. Directly writing and reading to and from device /dev/tts/0 works fine.
Still, accessing second port /dev/tts/1 causes hang-up of asus.

Oleg
16-06-2005, 21:47
have you disabled flow control on the tts/1?

sodb
16-06-2005, 22:42
Hey, thanks Oleg,

i just typed
/tmp/harddisk/busybox stty -crtscts < /dev/tts/1 and now I can input and output to /dev/tts/1. However, after disabling the console I actually did not try the second port anymore. Currently I can not reboot, but later I will check the status.
This is what I see when doing
[admin@wl500gx root]$ more /proc/tty/driver/serial
serinfo:1.0 driver:5.05c revision:2001-07-08
0: uart:16550A port:B8000300 irq:3 baud:9615 tx:7 rx:0
1: uart:16550A port:B8000400 irq:3 baud:115740 tx:49 rx:24 CTS|DSR|CDI wonder what caused the change from IRQ:0 to IRQ:3 for dev/tts/1? After reboot I will check defaults and compare. From the tx and rx counters one can see if the interface really works.
Currently, I am happy with two simulaneous serial ports on the wl500gx.

Duke
17-06-2005, 05:07
Can you check please both ports working well at the same time? If such, maybe the patching of the kernel with disabling IRQ masking at tts/1 when ttys/0 is a console port isn't a bad idea.
I'll try o check 18xx GPL sources located on utilities CD, if Oleg didn't do so yet :)

sodb
17-06-2005, 20:32
On two sessions I started cat /dev/tts/0 and cat /dev/tts/1 respectively. Because I only have a single serial port on my laptop I can only test alternatevely. That works.
Then I did a test where I connected Rx0 to Tx1 and Rx1 to Tx0. Then 4 sessions, 2 as described before, other two with echo commands to the respective ports. On echo from /tts/1 to /tts/0 works. When I issue an echo the other way around, the cat sessions keep scrolling and the echo sessions take a long time to finish. I can CRTL-C all the sessions. I think there is a conflict with the same IRQ3 for both lines. Is there another free IRQ available and could that be used for serial /tts/1?

Oleg
17-06-2005, 20:46
Is there another free IRQ available and could that be used for serial /tts/1?
No, both uarts use the same irq.

sodb
17-06-2005, 21:06
When serial ports share same interrupt, do we need to explicitly enable
CONFIG_SERIAL_SHARE_IRQ Or is that done automatically. What about IRQ 1,5 and 6. I do not see them in /proc/interrupts? Could those be used?

Duke
29-06-2005, 20:51
sodb
So, have you any progress?

P.S. Just soldered my TTL-RS232 converter for my -Deluxe. I used RS-232/RJ-45 pinout to save space, so both serials or serial and 2 additional USB ports can fit between Ethernet ports and external antenna.
RTS/CTS and DTR/DSR lines are shortened to work as a NULL-modem, so hardware flow control can be used on the terminal side.
First time I forgot to solder ground to V+/V- charge pump capacitors, so many symbols was damaged :confused:. I was thinking that 0.1mF capacitors is not enough, but finally that's ok ;)

Patrik
03-08-2005, 21:13
I had trouble with /dev/tts/1 hanging my router, even with flow control disabled. I solved it recently.

I use both serial ports -- one port for the console, one for a serial graphic LCD. For some reason, the second serial port (/dev/tts/1) did not work by default in my firmware (Oleg's excellent 1.9.2.7-6b). /proc/tty/driver/serial showed /dev/tts/1 as mapped to IRQ 0 (instead of IRQ 3).

Here's what I did:


Compiled setserial (http://setserial.sourceforge.net/) for mipsel
Enabled stty in busybox
Enabled the CONFIG_SERIAL_SHARE_IRQ flag in the kernel, as suggested by user sodb below (I haven't verified whether this is necessary)
Added the following lines to /usr/local/sbin/post-boot:

/usr/local/bin/setserial /dev/tts/1 irq 3
/bin/stty -crtscts 19200 < /dev/tts/1 # or whatever rate you prefer



NOTE: make sure you supply the complete absolute path to the setserial binary; /usr/local/bin is not in the default path for the post-boot script. If you are not careful, any access to /dev/tts/1 will hang your router, and you do not want this to happen on boot.

-- Patrik

sodb
03-08-2005, 22:05
That's good news. Can you please post the binary of the setserial util? I will try without the CONFIG_SERIAL_SHARE_IRQ flag first.

Patrik
06-08-2005, 21:54
As requested,

here is the setserial binary I use on my WL-500G deluxe.

Setserial was written by Theodore Ts'o. Please refer to http://setserial.sourceforge.net for source code and documentation.

Best regards,

-- Patrik

mangodan
29-08-2005, 03:48
Does anybody know of any serial uart i/o pins are exposed on the pcb of this beast? I don;t care for RS232 levels, they'll do me fine at 3.3V as long as they are accesible.

Also i've not managed to find any info as regards to the cpu..Anybody know what it is?

Cheers

dan

Edit: OPk, i found answers to my own questions now :). If anybody else is wondering check this (http://wl500g.info/showthread.php?t=1993&page=2&pp=15)

WVR
31-08-2005, 11:40
The Asus wl500g deluxe has uart pinout onboard, so 2 serial ports can be added to the unit.
The only difference between wl500g and wl500gx that the deluxe does not require a UART chip, so a simple RS232 transceiver will do the trick.

Here are my experiences adding a single serial port to the router
The parts you need:
- 1 MAX3232 IC (SO-IC)
- 5 1uF capacitors
- cables, connectors

...
[/CODE]
There is an alternate way. All these parts are built into a Nokia serial data cable which can be bought quite cheap now. Just connect up 3 wires tx, rx and ground that used to go to the phone to the connector in the WL500gx.
The other end of the cable has a 9-pin to connect to the PC.

Duke
05-09-2005, 11:44
There is an alternate way. All these parts are built into a Nokia serial data cable which can be bought quite cheap now. Just connect up 3 wires tx, rx and ground that used to go to the phone to the connector in the WL500gx.
The other end of the cable has a 9-pin to connect to the PC.
Well, there is yet another way with single 74HC14N ;)

galmiche
27-09-2005, 15:22
Hi all,
Just for your information. I'll post a schematic later on.
Hervé

galmiche
27-09-2005, 16:11
Dear All,
Well I would like now to check my serials.
I did not found any stty in the directories neither in the busybox.Is this one missing in the latest Oleg firmware.
How to get stty?
Can you descrivbe a test procedure. I looped my serial pins 2 to 3 , so if I send something, it should be back...
Thanks for help
Hervé

galmiche
27-09-2005, 21:12
Hi all,

This is the schematic to create links USB and serial.
For the MAX chip use a 3V3 model named MAX3232
Thanks to all of you who already made pictures, that helped me.

CU
Hervé


Bonjour à tous,

Ci joint le schema de montage USB et series
Pour le max bien prendre un modèle 3V3
donc un MAX3 232 (avec un TROIS en premier chiffre!)

Merci à ceux qui ont sur ce Post fais les images que j'ai reprises
pour éclairer le schéma.

@+
Hervé

Duke
28-09-2005, 15:40
By default, Oleg's firmware is using the first serial as terminal, and the second one is disabled.

tscoreninja
13-11-2005, 15:24
From those people who hooked up a serial console to the WL500gx, has anybody tried to interrupt the ordinary boot process and get to the CFE Bootloader Prompt?

I have built and setup the serial console and correctly get all the boot messages captured, first from the CFE bootloader and then from the Linux Kernel. However, if I enter "CTRL-C" at the very beginning of the boot process, it just continues as without intervention. Other Broadcom routers will stop at a CFE commandline interface (Linksys, Netgear,.., google for CFE and "CTRL-C" will show several hits). I have tried this multiple times, so timing is not the problem. Of course it could be my soldering skill while putting together the MAX232 converter.

Why do I want to do this? Via CFE, one can seemingly boot a kernel over network. As the WL-500gx does not have a JTAG, it would be the safest way to try to get Linux 2.6 running temporarily for development, without having to flash back and forth between a stable and development system (USB would allow for different root filesystems).

Also, I noticed a NVRAM setting "rescueflag=disable", and the corresponding CFE output "Rescue Flag disable." In the CFE binary of Olegs updated bootloader, there seems to be the string "rescueflag enable". Any idea whether this is possibly the option to allow the CFE CLI? How big do you think is the chance of messing up if I just try that out?

Thanks a lot for any input,
TSCoreNinja

vlad75
22-12-2005, 11:57
Dear All,
Well I would like now to check my serials.
I did not found any stty in the directories neither in the busybox.Is this one missing in the latest Oleg firmware.
How to get stty?
Can you descrivbe a test procedure. I looped my serial pins 2 to 3 , so if I send something, it should be back...
Thanks for help
Hervé

I have the same problem as galmiche. How do I enable stty? :confused:

pavrda
25-12-2005, 19:46
I have the same problem as galmiche. How do I enable stty? :confused:
Hi!
I have done it with 1.9.2.7 version:
1. download: GPL_1927.zip and wl500g-1.9.2.7-6b.tar.bz2
2. extract GPL: tar xzvf GPL_1927.zip
3. extract patch: tar -C broadcom/src -xjvf wl500g-1.9.2.7-6b.tar.bz2
4. cd broadcom/src/wl500g-1.9.2.7-6b
5. create workspace: make
6. cd ../gateway
7. try to make own build: make
8. make install
9. this should create WL500gx-1.9.2.7-6b.trx image, try to flash it to be sure compilation process was well
10. now change busybox settings: cd busybox, make menuconfig
11. configure your busybox: Coreutils->stty
12. exit & save
13. cd .. (to .../gateway)
14. make, make install

You don't need to configure kernel CONFIG_SERIAL_SHARE_IRQ

--- Jarda

Duke
05-01-2006, 13:52
So, finally, is it possible to use both serials simultaneously or not?

pavrda
05-01-2006, 14:06
So, finally, is it possible to use both serials simultaneously or not?

Yes, of course. Have you experienced any problems?

--- jp

Duke
05-01-2006, 19:25
I have tried only with default Oleg's firmware, and there was an IRQ sharing problem, as you know. The latter posts shows that it is possible to enable IRQ sharing to use both ports, but i'm not sure how both port may work simultaneously for receiving if there is only one physical IRQ line and no flow controll at all. So is it enough to recompile kernel with IRQ sharing enabled to simultaneously use both serials for transmitting and receiving at the same time (not just only for transmitting by both, and receiving only by one port)

sodb
05-01-2006, 21:17
When using the setserial command as suggested earlier in this thread (patrik) you can use both ports simultaneously without a problem. Only with default compile options, the port 0 is used as a terminal @ 115200. I once recompiled the firmware where I disabled this function in the kernel config and could used both ports for my own purposes.

Duke
05-01-2006, 23:43
So switching IRQ via setserial and configuring busybox with stty switched on will be enough? Now it's clear, i'll try.

Duke
10-01-2006, 12:29
Just checked -7b firmware - there is no need for setserial for now, and stty is enabled by default. I conneted both ports to each other and tried minicom @ /dev/tts/1, so there was a router console passed thru two ports and it works fine.

armkbdotcom
11-06-2009, 14:35
Small tutorial on how to connect to serial interface of Asus WL-500W.

http://acid.armkb.com/2009/06/11/asus-wl-500w-serial-port-com/

uncletall
27-07-2009, 02:51
Does anybody know how to connect the second serial port on the WL500GP V2?
I would like to connect a Sparkfun SERLCD to the router but when it is connected to the first serial port the high speed message cause it to go mad. Therefor I would like to connect it to the second serial port.

Any tips?

suckmypin9
31-12-2009, 02:14
Hi,

I have Asus WL-500G Premium V1, which is bricked.

I have read that it's possible to access it through a serial connection.

What are the software requirements for the serial connection on the Asus side? Obviously I cannot install anything to the Asus because it's bricked. So I would like to know if the original Asus firmware has the appropriate serial software listening by default? How about Oleg's firmware?

al37919
31-12-2009, 06:40
yes, broadcom's bootloader (if it is still alive) has everything needed to connect over system console and restore firmware. You just need to make RS232 level converter. See, e.g.: http://wl500g.info/showpost.php?p=136652&postcount=4

suckmypin9
31-12-2009, 12:47
Thanks, I will solder the converter today.

Is it possible to use screen to connect through the serial cable?
Like

screen 115200 /dev/ttys0

Or do I need some other program. In the thread you linked you have posted the right settings for the serial connection: 115200, 8N1, flow control: none

How to enable 8-n-1 with screen? How about flow control?

suckmypin9
04-01-2010, 00:36
I got the serial connection working through screen.


screen /dev/ttyUSB0 115200,cs8,-ixon,-ixon,istrip

stereo47
05-02-2012, 18:28
Hello,

I would like to know if the Asus WL-500gP V2's serial port is locked (for the bootloader/kernel), or if it can be used like a normal ttl serial port? I think the serial port can be used like a terminal if telnet/ssh doesn't work, but can it also be used for example to connect a microcontroller to it?
Or would I have to switch off the terminal output? I think I wouldn't like to do that if something sometimes fails and I need to get in by serial. I don't mind if the serial port outputs any text at boot, I would just like to read temperature data through it.
I also probably need a level shifter if I want to connect a 5 volt microcontroller as I think the WL500gPV2 serial port is 3.3v TTL.

And no, I can't really use a usb->rs232 converter, I use a 3G dongle as my WAN connection and it connects as a ttyUSB0-2 device and if I have the serial converter attached it will disturb the 3G modem and it won't connect until I remove the usb-serial converter.


So my question is, is the serial port (the pins on the circuit board) locked, or can they be used to read output from another device? I'm actually using openwrt at the moment, but they should handle the serial port in the same way...

ryzhov_al
09-02-2012, 10:26
Jack pinout (http://www.wl500g.info/showpost.php?p=72231&postcount=1),
Console unbinding (http://www.wl500g.info/showpost.php?p=128202&postcount=60),
Level shifting scheme (http://www.wl500g.info/showpost.php?p=179430&postcount=122).

stereo47
09-02-2012, 19:13
Hey thanks, that information will definitely help me.

Still one question, is it so that the serial port cannot be used if terminal output is on (left as "console=ttyS0,115200")? And if I set it to console=null, would that make it impossible to flash the Asus from serial? Or does it only switch off terminal output after the bootloader, or what?

ryzhov_al
10-02-2012, 05:11
Still one question, is it so that the serial port cannot be used if terminal output is on (left as "console=ttyS0,115200")?Sorry, can't test for now.

And if I set it to console=null, would that make it impossible to flash the Asus from serial?No! Bootloader still works. But if you don't believe me:), you can always clean NVRAM settings by Reset button.

Or does it only switch off terminal output after the bootloader, or what?Yes. Bootloader is still using those port. So your Arduino device must ignore some garbage and wait till router finish booting. console=null is a kernel switch, so port will be silent only when CFE (http://en.wikipedia.org/wiki/Common_Firmware_Environment) starts kernel.

stereo47
10-02-2012, 20:48
Okay, great! Then this is just what I need, thanks!

Actually I'm using Openwrt Backfire at the moment, and I'm quite sure it works in the same way, here is the command for openwrt if someone else needs it: https://forum.openwrt.org/viewtopic.php?id=15165

lama from czech
27-06-2012, 02:07
wl500gp v2


hi, I have a problem with my wl500gp v2. I am successfully connected to the router via serial port, but I dont know how to rescue nvram. My question is, how upload firmware via serial port. I use nokia cable dku-5. I add to the supplication of the putty log. I do not know what to do. my English is not very good. Please help, thanks a lot.


=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2012.06.27 00:27:29 =~=~=~=~=~=~=~=~=~=~=~=
Connection dropped...
Attempting connect...
Decompressing..........done


CFE version 1.0.37 for BCM947XX (32bit,SP,LE)
Build Date: Mon Jan 28 10:52:32 CST 2008 (root@localhost.localdomain)
Copyright (C) 2000,2001,2002,2003 Broadcom Corporation.

Initializing Arena
Initializing Devices.
Boot partition size = 131072(0x20000)
et0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller 4.130.31.0
CPU type 0x29029: 240MHz
Total memory: 32768 KBytes

Total memory used by CFE: 0x80400000 - 0x80497FF0 (622576)
Initialized Data: 0x8042F370 - 0x80431830 (9408)
BSS Area: 0x80431830 - 0x80431FF0 (1984)
Local Heap: 0x80431FF0 - 0x80495FF0 (409600)
Stack Area: 0x80495FF0 - 0x80497FF0 (8192)
Text (code) segment: 0x80400000 - 0x8042F370 (193392)
Boot area (physical): 0x00498000 - 0x004D8000
Relocation Factor: I:00000000 - D:00000000

Device eth0: hwaddr BC-AE-C5-C4-29-9F, ipaddr 192.168.0.1, mask 255.255.255.0
gateway not set, nameserver not set
Null Rescue Flag.
Loader:raw Filesys:tftp Dev:eth0 File:: Options:(null)
Loading: TFTP Server.
Failed.
Could not load :: Timeout occured
Loader:raw Filesys:raw Dev:flash0.os File: Options:(null)
Loading: .. 3740 bytes read
Entry at 0x80001000
Closing network.
Starting program at 0x80001000
CPU revision is: 00029029

Linux version 2.4.35 (root@dd-wrt) (gcc version 3.4.6 (OpenWrt-2.0)) #2097 Sat May 24 14:47:53 CEST 2008

Setting the PFC to its default value

Determined physical RAM map:

memory: 02000000 @ 00000000 (usable)

On node 0 totalpages: 8192

zone(0): 8192 pages.

zone(1): 0 pages.

zone(2): 0 pages.

Kernel command line: root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200

CPU: BCM5354 rev 3 at 240 MHz

Using 120.000 MHz high precision timer.

Calibrating delay loop... 239.20 BogoMIPS

Page-cache hash table entries: 8192 (order: 3, 32768 bytes)

Checking for 'wait' instruction... unavailable.

POSIX conformance testing by UNIFIX

PCI: no core

PCI: Fixing up bus 0

Initializing RT netlink socket

Starting kswapd

pty: 256 Unix98 ptys configured

Broadcom Watchdog Timer: 0.05, timer margin: 30 sec

sb_doattach: incoming bus is PCI but it's a lie, switching to SB devid:0x4318

Flash device: 0x800000 at 0x1c000000

bootloader size: 131072

Physically mapped flash: Filesystem type: squashfs, size=0x4dad0a

mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-only

ip_conntrack version 2.1 (512 buckets, 4096 max) - 336 bytes per conntrack

ip_tables: (C) 2000-2002 Netfilter core team

ipt_random match loaded

netfilter PSD loaded - (c) astaro AG

ipt_IPV4OPTSSTRIP loaded

VFS: Mounted root (squashfs filesystem) readonly.

Booting device: Linksys WRT54G/GL/GS
boardflags are 0x0750
sh: cannot create /proc/switch/eth1/reset: nonexistent directory
Unlocking ddwrt ...
set port 0 to AUTO
set port 1 to AUTO
set port 2 to AUTO
set port 3 to AUTO
set port 4 to AUTO
register_vlan_device: ALREADY had VLAN registered

vconfig: ioctl error for add: Invalid argument
ifconfig: SIOCSIFADDR: No such device
register_vlan_device: ALREADY had VLAN registered

vconfig: ioctl error for add: Invalid argument
ifconfig: SIOCSIFADDR: No such device
set port 5 to AUTO
eth1: Operation not supported
wl0.2: No such device
wl0.3: No such device
eth1: Invalid argument
eth1: Invalid argument
br0: Bad file descriptor
vlan0: dev_set_promiscuity(master, 1)

device eth0 entered promiscuous mode

device vlan0 entered promiscuous mode

br0: Bad file descriptor
eth1: Operation not supported
wl0.2: No such device
wl0.3: No such device
eth1: Invalid argument
eth1: Invalid argument
device eth1 entered promiscuous mode

device wl0.1 entered promiscuous mode

SIOCGIFFLAGS: No such device
SIOCGIFFLAGS: No such device
SIOCGIFFLAGS: No such device
SIOCGIFFLAGS: No such device
Key is a RSA key
Wrote key to '/tmp/root/.ssh/ssh_host_rsa_key'
Key is a DSS key
Wrote key to '/tmp/root/.ssh/ssh_host_dss_key'
device vlan1 entered promiscuous mode

vlan1: Setting MAC address to bc ae c5 c4 29 a0.

vlan1: dev_set_promiscuity(master, 1)

vlan1: dev_set_allmulti(master, 1)

vlan1: dev_set_promiscuity(master, -1)

device vlan1 left promiscuous mode

vlan1: dev_set_allmulti(master, -1)

vlan1: No such process
SIOCGIFFLAGS: No such device
SIOCGIFFLAGS: No such device
SIOCGIFFLAGS: No such device
SIOCGIFFLAGS: No such device
SIOCGIFFLAGS: No such device
SIOCGIFFLAGS: No such device
SIOCGIFFLAGS: No such device
SIOCGIFFLAGS: No such device
sh: /tmp/.rc_startup: not found
/tmp/smbshare
The Milkfish Router Services
ERROR: Necessary service setting not found: milkfish_username - aborting.
The Milkfish Router Services
Restoring SIP ddsubscriber database from NVRAM...
Empty.
The Milkfish Router Services
Restoring SIP ddaliases database from NVRAM...
Empty.
n
DD-WRT v24 mega (c) 2008 NewMedia-NET GmbH
Release: 05/24/08 (SVN revision: 9526)
˙
Etasix login: Launching VPN process
Process launched
Waiting.......
Decompressing..........done


CFE version 1.0.37 for BCM947XX (32bit,SP,LE)
Build Date: Mon Jan 28 10:52:32 CST 2008 (root@localhost.localdomain)
Copyright (C) 2000,2001,2002,2003 Broadcom Corporation.

Initializing Arena
Initializing Devices.
Boot partition size = 131072(0x20000)
et0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller 4.130.31.0
CPU type 0x29029: 240MHz
Total memory: 32768 KBytes

Total memory used by CFE: 0x80400000 - 0x80497FF0 (622576)
Initialized Data: 0x8042F370 - 0x80431830 (9408)
BSS Area: 0x80431830 - 0x80431FF0 (1984)
Local Heap: 0x80431FF0 - 0x80495FF0 (409600)
Stack Area: 0x80495FF0 - 0x80497FF0 (8192)
Text (code) segment: 0x80400000 - 0x8042F370 (193392)
Boot area (physical): 0x00498000 - 0x004D8000
Relocation Factor: I:00000000 - D:00000000

Device eth0: hwaddr BC-AE-C5-C4-29-9F, ipaddr 192.168.0.1, mask 255.255.255.0
gateway not set, nameserver not set
Null Rescue Flag.
Hello!! Enter Rescue Mode: (by Force)

Reading :: TFTP Server.
Failed.: Timeout occured
Reading :: TFTP Server.
Failed.: Timeout occured
Reading :: TFTP Server.
Failed.: Timeout occured
Reading :: TFTP Server.
Failed.: Timeout occured
Reading :: TFTP Server.
Failed.: Timeout occured
Reading :: TFTP Server.
Decompressing..........done


CFE version 1.0.37 for BCM947XX (32bit,SP,LE)
Build Date: Mon Jan 28 10:52:32 CST 2008 (root@localhost.localdomain)
Copyright (C) 2000,2001,2002,2003 Broadcom Corporation.

Initializing Arena
Initializing Devices.
Boot partition size = 131072(0x20000)
et0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller 4.130.31.0
CPU type 0x29029: 240MHz
Total memory: 32768 KBytes

Total memory used by CFE: 0x80400000 - 0x80497FF0 (622576)
Initialized Data: 0x8042F370 - 0x80431830 (9408)
BSS Area: 0x80431830 - 0x80431FF0 (1984)
Local Heap: 0x80431FF0 - 0x80495FF0 (409600)
Stack Area: 0x80495FF0 - 0x80497FF0 (8192)
Text (code) segment: 0x80400000 - 0x8042F370 (193392)
Boot area (physical): 0x00498000 - 0x004D8000
Relocation Factor: I:00000000 - D:00000000

Device eth0: hwaddr BC-AE-C5-C4-29-9F, ipaddr 192.168.0.1, mask 255.255.255.0
gateway not set, nameserver not set
Null Rescue Flag.
Hello!! Enter Rescue Mode: (by Force)


Failed.: Timeout occured
Reading :: TFTP Server.
Failed.: Timeout occured

welcomb
05-11-2012, 11:26
The power supply for my wl500gx was busted so I bought a new switching 5v/2A supply. Usually on start up I think it doesn't supply enough current and all the LEDs started flickering. Turning the power on and off a couple times resolves this. However, I recently forgot the password and tried to reset the router. But I think the NVRAM values got corrupted because now there's no power or WiFi LED, and the WAN + LAN acts like a switch.

So I'm thinking of using the serial port to unbrick it. I went to buy a PL2303 USB module. Can I just connect the headers on the module to the headers on the wl500gx and the USB end to my PC?

pavrda
05-11-2012, 11:29
yes, of course. Use of 3 wires (GND, TxD, RxD) is ok ;)

welcomb
05-11-2012, 11:32
yes, of course. Use of 3 wires (GND, TxD, RxD) is ok ;)

Thanks. I'll try once my new 5V/3A power supply and PL2303 module arrives. :D