How do I disable sys console on ttyS0 for a WRT150n V1.1?

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
fun_4_me_now20012000
DD-WRT Novice


Joined: 18 Sep 2008
Posts: 3

PostPosted: Thu Oct 16, 2008 9:24    Post subject: How do I disable sys console on ttyS0 for a WRT150n V1.1? Reply with quote
Hi All.

How do I disable the system console output to ttyS0 on DD-WRT? Also the login.


The dmesg output tells me that it is set on the kernel command line, as follows:
Kernel command line: root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200

My google searches lead me to i386 based tutorials where the command line can be edited in grub or lilo. How do I change it in DD-WRT? I was hoping it could be set using an nvram var. That would be great because I could reset it to default easily should I need emergency access to the console output.


I am wanting to use ttyS0 on my WRT150n V1.1 as a regular rs232 (3.3V) serial port. I have constructed a max3237 based interface so I can view the system console output (and login) using minicom (or hyperterm) from a pc. My interface seems to work well.

My ultimate goal is to use the router as an interface between simple "8/16 bit" micros and the internet. Talk about the tail wagging the dog! A router can provide comunication, storage for logging (mmc and/or network), and power. The uC can do the low level interface with the real world. A $40 linux box that I can easily attach to a $1 uC seems a bargain in saved development time for hobby style throwaway apps.

Anyway, I am stuck now because the port is being used and I need a clean serial line for my uC interface. The output from dmesg shows that there is a ttyS1 also, but there is no header on the PCB.


I am using a Linksys WRT150N v1.1 with DD-WRT v24-sp1 (07/27/0Cool std - build 10011.
Sponsor
jrodgers
DD-WRT Novice


Joined: 21 Oct 2008
Posts: 6

PostPosted: Tue Oct 21, 2008 15:25    Post subject: Reply with quote
Hi, I have the same problem. I am using a Buffalo WHR-G125, which has only one serial port, and that port is attached to the console because of the kernel command line as you point out.

I have found 2 possible approaches. The first involves re-compiling DD-WRT from source. I don't really have the linux experience to be trying this out.

The other involves a busybox app called setconsole. It does not come in the standard binaries with DD-WRT, but if someone can compile it for mips processors then we could us it like this:

$>setconsole /dev/null

and this would redirect kernel output to null.

Can someone out there complie this app or explain how to do so easily?
soulstace
DD-WRT Guru


Joined: 04 Aug 2007
Posts: 6427

PostPosted: Tue Oct 21, 2008 15:52    Post subject: Reply with quote
I compiled a version of busybox with setconsole, but dd-wrt doesn't allow setting it to /dev/null

Code:

root@DD-WRT:~# wget http://192.168.1.10/busybox
Connecting to 192.168.1.10 (192.168.1.10:80)
busybox              100% |*******************************|   755k 00:00:00 ETA
root@DD-WRT:~# chmod +x ./busybox
root@DD-WRT:~# ./busybox setconsole /dev/null
setconsole: TIOCCONS: Inappropriate ioctl for device
root@DD-WRT:~#
jrodgers
DD-WRT Novice


Joined: 21 Oct 2008
Posts: 6

PostPosted: Tue Oct 21, 2008 22:17    Post subject: Reply with quote
Can you set it to /dev/ttyS1

Apparently on my router (Buffalo WHR-G125) there are 2 serial ports, but only one is brought out to pins on the PCB (ttyS0). So if I can redirect the console there it would hopefully free up ttyS0.

Also, can you please attach the binary for setconsole so I can download it?
fun_4_me_now20012000
DD-WRT Novice


Joined: 18 Sep 2008
Posts: 3

PostPosted: Wed Oct 22, 2008 16:33    Post subject: Reply with quote
The first option, compiling a custom kernel, seems doable, but it also seems that compiling DD-WRT is not automated or for the novice. I will try to compile svn 10011 (v24sp1) again when I can spend more time on it.

Setconsole seems like it should be worth looking at. The port would still be flooded with garbage until setconsole is run, so it is not an ideal solution.

Any luck so far?


Also, by way of friendly advice, it is important to test that your CFE can actually restore an image before messing with custom firmware. My CFE is broken and I can only recover from a bad flash via jtag. I am very glad I took the time to back the thing up prior to playing.
v_mark
DD-WRT Novice


Joined: 29 Dec 2010
Posts: 1

PostPosted: Thu Dec 30, 2010 11:55    Post subject: Reply with quote
I have exactly the same problem.
I would like to have a real serial to connect my I2C device. (USB to RS232 is not good).
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    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