OpenWrt Forum Archive

Topic: Serial Ports

The content of this topic has been archived on 29 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi

Has anybody got the second serial port working ?

With cat/echo... i could write text on the first, but the second seems to be uninitialized.

dmesg says:
(...)
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
(...)

Is the irq=0 correct ?

cu Thomas

ps: With the new version of openwrt the problems with mips/mipsel and configure-scripts in a mountet buildroot have been gone and all is working very well. Thanks!

Hi

Has anybody got the second serial port working ?

With cat/echo... i could write text on the first, but the second seems to be uninitialized.

dmesg says:
(...)
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
(...)

Is the irq=0 correct ?

cu Thomas

ps: With the new version of openwrt the problems with mips/mipsel and configure-scripts in a mountet buildroot have been gone and all is working very well. Thanks!

Hmm - I designed the dual port mod, and I haven't been able to test it yet.

I've been trying to compile minicom or mingetty or something simple like that, but have had no success.

So I don't even know whether my second serial port works or not!

-- Rod

Hi

Hmm - I designed the dual port mod, and I haven't been able to test it yet.

I've been trying to compile minicom or mingetty or something simple like that, but have had no success.

So I don't even know whether my second serial port works or not!

On the first port a echo "foo" >/dev/tts/0 does work, a cat /dev/tts/0 also.. But on the second not.

I compiled setserial already, but its output seems correct...

cu Thomas

Second port works fine, but (at least with the stock firmware) seems to be initialized to 9600 baud by default. Configure it as a DCE port (or use a null modem cable), set your comm software to 9600 baud, no hw handshake. Then run

  /bin/sh > /dev/tts/1 2>&1 < /dev/tts/1

and you should get a shell on the second port. It's obviously best to install a proper getty/login combo, tho.

One strange thing I've encountered is when I do run getty/login on both ports and set them to 115200 baud. Then the second port feels significantly slower than the first one, even though they run at the same baudrate. Not that I've tried to  find out what causes this... Any ideas why?

/Hans

I have added a USB-serial adaptor to my WL500g and am attempting to get a serial console up with it.

I can plug two adaptors in at once and they appear as /dev/usb/tts/0 and /dev/usb/tts/1 and I can send and receive data on both of them - I tested this by echo-ing text to them, and cat-ing text from them using a null-modem cable attached to my PC.

My PC is Windows XP and I've been using two terminal programs - Hyperterminal and Token 2.
I've been attempting to get a serial console up on my PC using these programs.  I've been using

/bin/sh > /dev/usb/tts/0 2>&1 < /dev/usb/tts/0

or the getty included in the TinyLogin package on the WL500g.

In all cases, I get a serial console, but there are no newlines or carraige returns in the resulting text, making for frustrating and difficult reading on my screen.

Can anyone suggest why there are no newlines or carraige returns?  Is the ash shell on OpenWRT not sending them, or (more likely) are Hyperterminal and Token 2 not interpreting them correctly?  How can I fix this?

Just an update to say I've tried again with this and not much luck.

I'm still seeing text in my serial console with no linefeeds at all - the text just wraps when it gets to the end of each line making for an almost unreadable console.  I've installed Terra Term and it has the same problem as Hyperterminal and Token 2 - so I'm starting to think it's a problem I'm having with OpenWRT.  I've been setting all my terminal programs to vt100 emulation or autodetect, but nothing seems to work.

I've installed the terminfo package so I now have terminfo files for vt100, etc.
I have added this line to /etc/profile

export TERMINFO=/usr/share/terminfo

And I am executing my serial console like this:

root@OpenWrt:/# getty -L 9600 /dev/usb/tts/0 vt100

But still I get no linefeeds on the console.

My wl500g is connected to my pc via a PL2303-chipset USB-serial adaptor, and I'm using a 3-wire homemade null-modem cable - the wires are TD-RD, RD-TD and SG-SG.  I didn't think I'd need any of the handshaking or hardware flow control lines, and I still don't think I need them.

The only getty program that I can get to work at all is the Getty in the Tinylogin package.  The agetty package in the hansliss repository and the mgetty package in the freifunk repository seem to not work under WhiteRussian RC2.

The discussion might have continued from here.