vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I am trying to send strings of data to a customer display connect to /dev/tty2a in Openserver 5.0.5. The use manual explains how to do this in dos, but I want to test in out in unix. The manual says to do the following dos commands: mode com1 96,n,8,1 type con>com1 then type "!#1ABCDEFGH" and press enter. The display will show "ABCDEFGH" on the first line. Press Ctrl-C to end. In dos, I can sit there all day and type in various strings and it works, but I don't know how to do this in unix. I believe that I have the settings for tty2a set correctly as I can type echo $string > /dev/tty2a and it displays. The problem with this testing is that the device has to be reset after each line because it needs a cr/lf to end one line and begin accepting another. Any help is greatly appreciated. Justin --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/03 |
| |||
| "justin" <justin_robbs@NO_SPAMhotmail.com> wrote in message news:bdcjh4$n87$1@news.tdl.com... > I am trying to send strings of data to a customer display connect to > /dev/tty2a in Openserver 5.0.5. The use manual explains how to do this in > dos, but I want to test in out in unix. The manual says to do the following > dos commands: > > mode com1 96,n,8,1 > type con>com1 > > then type "!#1ABCDEFGH" and press enter. The display will show "ABCDEFGH" > on the first line. Press Ctrl-C to end. > > In dos, I can sit there all day and type in various strings and it works, > but I don't know how to do this in unix. I believe that I have the settings > for tty2a set correctly as I can type echo $string > /dev/tty2a and it > displays. The problem with this testing is that the device has to be reset > after each line because it needs a cr/lf to end one line and begin accepting > another. > > Any help is greatly appreciated. > Read the man page for echo echo $string\r\n Ron |
| |||
| On Wed, Jun 25, 2003 at 10:44:19AM -0600, justin wrote: >I am trying to send strings of data to a customer display connect to >/dev/tty2a in Openserver 5.0.5. The use manual explains how to do this in >dos, but I want to test in out in unix. The manual says to do the following >dos commands: > >mode com1 96,n,8,1 >type con>com1 > >then type "!#1ABCDEFGH" and press enter. The display will show "ABCDEFGH" >on the first line. Press Ctrl-C to end. > >In dos, I can sit there all day and type in various strings and it works, >but I don't know how to do this in unix. I believe that I have the settings >for tty2a set correctly as I can type echo $string > /dev/tty2a and it >displays. The problem with this testing is that the device has to be reset >after each line because it needs a cr/lf to end one line and begin accepting >another. The ususal answer is ``there's more than one way to do it''. The Unix ``write'' command is traditionally the way this is done. Writing directly to a user's tty device may work, but probably won't on a properly configured system since it has many security implications. (how would you like to be running as root and have your F1 key reprogrammed to send ``rm -fr /'')? Things are muth more compilicated in a multi-user environment than on the average DOS/Windows machine where there's only one user with one console device. Even if I'm running an *ix box from the console, there are 12 different ttys I might be on so how do you know which one to write to (when I was running Xenix I used all 12 of them)? Bill -- INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software LLC UUCP: camco!bill PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 URL: http://www.celestial.com/ ``It is better to die on your feet than to live on your knees!'' -- Emiliano Zapata. |
| |||
| -snip- > Writing directly to a user's tty device may work, but probably won't on a > properly configured system since it has many security implications. I am just trying to write a string of data to an output only device connected via a serial port. >(how would you like to be running as root and have your F1 key >reprogrammed to send ``rm -fr /'')? That would suck. I have done enough stupid stuff myself without having to worry about that. One time running as root I typed l /tmp and thought I don't need that stuff so I typed rm -fr * and walked away to get a drink, unfortunately, local dir was / not pretty. However, since this is just a customer display for a cash register, I don't think there is anything to worry about. justin --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/03 |
| |||
| On Wed, Jun 25, 2003 at 12:19:51PM -0600, justin wrote: > >-snip- > >> Writing directly to a user's tty device may work, but probably won't on a >> properly configured system since it has many security implications. > >I am just trying to write a string of data to an output only device >connected via a serial port. .... >However, since this is just a customer display for a cash register, I don't >think there is anything to worry about. Writing to a serial port compilicates things a bit since one has to insure that it's parameters are set correctly (e.g. baud rate, parity, etc.) -- something like: stty 9600 cs8 -onlcr clocal < /dev/tty1a The stty command allows you to set how the end-of-line stuff is handled as well, and can be used to automatically supply CRLF. Bill -- INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software LLC UUCP: camco!bill PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 URL: http://www.celestial.com/ Government is actually the worst failure of civilized man. There has never been a really good one, and even those that are most tolerable are arbitrary, cruel, grasping and unintelligent. -- H. L. Mencken |
| |||
| "Bill Campbell" <bill@celestial.com> wrote in message news:20030625114331.B26393@barryg.mi.celestial.com ... > On Wed, Jun 25, 2003 at 12:19:51PM -0600, justin wrote: > > > >-snip- > > > >> Writing directly to a user's tty device may work, but probably won't on a > >> properly configured system since it has many security implications. > > > >I am just trying to write a string of data to an output only device > >connected via a serial port. > ... > >However, since this is just a customer display for a cash register, I don't > >think there is anything to worry about. > > Writing to a serial port compilicates things a bit since one has > to insure that it's parameters are set correctly (e.g. baud rate, > parity, etc.) -- something like: > > stty 9600 cs8 -onlcr clocal < /dev/tty1a > > The stty command allows you to set how the end-of-line stuff is > handled as well, and can be used to automatically supply CRLF. > Is there any way to write to it without using echo. In dos, once I ran "type con>com1", I was able to send data that I typed directly to it. I guess I could put the strings in a file and use pg or more to send it to tty2a. However, I would really like to play around with the different command sequences that it accepts and figure out how to make it do what I want. Thanks, Justin --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/03 |
| |||
| In article <bdcvkl$qir$1@news.tdl.com>, justin <justin_robbs@NO_SPAMhotmail.com> wrote: >Is there any way to write to it without using echo. In dos, once I ran >"type con>com1", I was able to send data that I typed directly to it. I >guess I could put the strings in a file and use pg or more to send it to >tty2a. However, I would really like to play around with the different >command sequences that it accepts and figure out how to make it do what I >want. Configure the device as a direct uucp device, and then connect to it with cu. For example, put in /usr/lib/uucp/Devices: Direct tty2a - 9600 dir Then: chown uucp:uucp /dev/tty2a cu -l tty2a dir Use ~. at the start of a line to exit cu (probably best to read the cu man page before you use it). John -- John DuBois spcecdt@armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/ |
| |||
| In article <bdcp5h$oq5$1@news.tdl.com>, justin <justin_robbs@NO_SPAMhotmail.com> wrote: > >-snip- > >> Writing directly to a user's tty device may work, but probably won't on a >> properly configured system since it has many security implications. > >I am just trying to write a string of data to an output only device >connected via a serial port. > >>(how would you like to be running as root and have your F1 key >>reprogrammed to send ``rm -fr /'')? > >That would suck. I have done enough stupid stuff myself without having to >worry about that. > >One time running as root I typed >l /tmp >and thought I don't need that stuff so I typed >rm -fr * >and walked away to get a drink, unfortunately, local dir was / >not pretty. This is why even on SCO systems I change root's home directory to /root. I just don't think any local directory should be / anymore. I've walked into too many places where I got called for help and / was full of things from user aps, etc. Making /root the home for root will ensure than an accidental cd with no arguments will not place you in a dangerous place. -- Bill Vermillion - bv @ wjv . com |
| ||||
| Thanks for all the helpful responses. That got me what I needed. I appreciate you guys. Have a good day and God Bless. Justin --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/03 |