OpenWrt Forum Archive

Topic: alternative for stty?

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

Is there an alternative to stty for setting baud rate and other serial parameters?

I have an NSLU2 which has all the code I need on it, except for a way to set baud rate.  I've tried a new build with stty checked on in busybox, but while I can telnet in, this version won't allow ssh access after the password is changed (see other recent thread). 

Any suggestions?

Thank you for the response.  Per the referenced thread, I tried "empty -f picocom -b 2400 -p n -f n -l -r /dev/ttyUSB0", but got "empty not found".  I searched but could not find a reference to an "empty" command.  What is it and where would it be found?

picocom does enable me to set the parameters and control my serial device within the picocom terminal, and when I exit with the option for no reset, I am able to write to the serial port, for instance, "echo "0" > /dev/ttyUSB0".  I assume that the "empty" part of the command above is supposed to cause picocom to exit immediately.  How else might I do that, or how might I get the "empty" command.

smile

root@OpenWrt:~# opkg list |grep empty
empty - 0.6.15b-1 - empty is an utility that provides an interface to execute and/or interact

Thanks--I did "opkg install empty" and ran "empty -f picocom -b 2400 -p n -f n -l -r /dev/ttyUSB0" and was able to control my device.  I put the "empty" command in a startup script and rebooted, and immediately have control of my device, so the answer to the question in the thread subject (for my device) is:

empty -f picocom -b 2400 -p n -f n -l -r /dev/ttyUSB0

Installing coreutils, if there is space enough in flash, might also work as a way to get stty.

(Last edited by lizby on 24 Oct 2009, 14:29)

The discussion might have continued from here.