OpenWrt Forum Archive

Topic: Serial port change baud rate

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

I have a working dual serial port mod. My goal here is to send serial data to some embedded applications, like a PIC or Basic Stamp for general development. Basically they need 9600 bps. I can get this fine by default from serial port 1, having successfully communicated to a PIC controlling an LCD. However, this is not the case on serial port 0. My initial response was I hooked something up wrong, so I used my oscilloscope and saw a faint spike when I sent commands via port 0. I changed my timing and when my window was made much shorter, I got what looked like normal serial data. This means the port is configured to run at a much faster setting, and may realted to the serial console. To change the speed I tried typing stty or setserial, but neither exist in OpenWRT, so I'm at a bit of a loss here.

if your router got an internetconnection, you can use

ipkg install setserial

to install setserial.

cat /proc/tty/driver/serial
setserial /dev/tts/1 baud_base 1843200
cat /proc/tty/driver/serial

Change the /dev/tts/1 to 1843200/16 = 115200 baud

(Last edited by Mana on 10 Apr 2006, 16:52)

The discussion might have continued from here.