Posted: Mon Feb 25, 2008 20:27 Post subject: Turn off serial console, stty
Hello,
I have Linksys WRT54G V2 router. Can I detach SERIAL PORT 0 (/dev/tts/0) from Console (ash/BusyBox) in DDWRT (in OpenWrt I can detach with inittab)? And also is there any DD-WRT compilation wich have working STTY command? In DDWRT v23 I have error: can't resolve: 'setlocale' command when running STTY.
I am looking for an answer on how to detach the console from the serial port too.
As for your stty issue, after previously researching stty's availability in DD-WRT I found that the latest release of DD-WRT that still includes stty is v24 RC3. I have been using the Fonera-specific version however, so your results may be different.
I need to detach the serial from the console too. I came across the busybox app setconsole, but it's not included in DD-WRT. Anyone know how to compile this for us? It can be used like this:
Without arguments, prints baud rate, line discipline,
and deviations from stty sane.
Options:
-F DEVICE open device instead of stdin
-a print all current settings in human-readable form
-g print in stty-readable form
[SETTING] see manpage
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?
I dropped the busybox in this thread in my jffs directory, and ran the command I mentioned above, which puts the console on /dev/tts/1 instead of /dev/tts/0
Now you can use /dev/tts/0 for serial communications.
I never know how detailed to be in my explanations here since some folks have no idea and some people are old hats, so let me know if you need more detail.
I did tried to put the busybox into my Asus using wget, after giving permission to run (chmod), I can do the setconsole to /dev/tts/1, however, I still failed to read anything from /dev/tts/0 (or which command you used to read data?). TX is always working even without setconsole to /dev/tts/1
Is that mandatory to put the new busybox into jffs?
And if it is hardware or DDWRT version specific?
FYI, I am using dd-wrt.v24-13577_NEWD_mini_usb_ftp.bin on WL520gu.
Sounds like you're having a problem reading from the serial port. I'm not the right person to help you with that... Why don't you google 'linux shell serial read'