home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / sequent / 635 < prev    next >
Encoding:
Internet Message Format  |  1992-11-14  |  5.3 KB

  1. Path: sparky!uunet!know!mips2!news.bbn.com!noc.near.net!news.Brown.EDU!qt.cs.utexas.edu!cs.utexas.edu!zaphod.mps.ohio-state.edu!caen!mtu.edu!rossi
  2. From: rossi@mtu.edu (Rossi)
  3. Newsgroups: comp.sys.sequent
  4. Subject: Direct Connected Device Questions
  5. Summary: Help with serial port
  6. Message-ID: <1992Nov13.184921.3615@mtu.edu>
  7. Date: 13 Nov 92 18:49:21 GMT
  8. Organization: Michigan Technological University
  9. Lines: 180
  10.  
  11. Hi There!
  12.  
  13. Help!
  14.  
  15. Summry:
  16.  
  17.    System - Sequent S2000/700 running Dynix/Ptx V1.3
  18.  
  19.    Problem: It's not a: terminal, modem or printer and it's not a 
  20.             direct connection to another Unix system.  It's a 
  21.             nightmare!  (not really it's kinda fun actually) 
  22.             Or I'm just missing something obvious (most likely).
  23.             Also I'm not a certified Unix guru, just trying to
  24.             learn about this stuff and having fun at the same
  25.             time.  :-)
  26.  
  27.  
  28. Details:
  29.  
  30.    I need to connect this device to a serial port.  I currently have
  31. a null modem cable from the device (a scanner) to the port on the
  32. S2000.  It is currently connected through an A/B switch (verified 
  33. working on A - the connection to our mainframe).  I need to read 
  34. each character without any interference or translation.
  35.  
  36.  
  37. My current approach:
  38.  
  39.    What I would like to do is communicate with this device by sending
  40. characters to the device (as in cat file > /dev/ttyGA/GAAI) instead
  41. of writing a C program (which I know).  Is this possible using stty
  42. to set the port and then writing and reading from it?  I'd probably
  43. be using csh so I'd have to also set it's stdin to the same parameters
  44. via stty.  The major question with this is the character translation
  45. from 7 to 8 bits (or doesn't it matter?).  The characters read from
  46. the device are either status messages or data, all straight 7 bit 
  47. ascii.  Any data characters get stuffed into a file.  How does all
  48. this sound?  Do you see any pitfalls with this approach? (other than
  49. the 7 to 8 bit stuff).
  50.  
  51.  
  52. Other things I've looked at:
  53.  
  54.    cu - Doesn't look like it will handle the 7 bit stuff otherwise
  55.         this was my favorite option. 
  56.  
  57.    getty - I don't want a login process.  The scanner can't send a 
  58.            response to this stuff.  Plus getty doesn't look like it
  59.            can be configured to match the communications parameters
  60.            of the device.
  61.  
  62.    uucp - Nope.  Doesn't seem to be appropriate.  Nor uugetty for that
  63.           matter.
  64.  
  65.    kermit - Don't have it.  Not sure it'd help.
  66.  
  67.    C - Don't want to do in case someone else around here needs to
  68.        mess with it.  (Not many C programmers in this place.  
  69.        I'm not into job security through obscurity. :)
  70.  
  71.    Device driver - as in write your own.
  72.  
  73.  
  74. Observations:
  75.  
  76.    No books or manuals I've read (about a half dozn so far) really 
  77. give a good example of stty being used this way.  Some have shown
  78. it being used for a printer (where I got the stty params < dev idea
  79. from).  Maybe I'm using the wrong tool for the right job!?  Also
  80. none of these books talk very much about devices other than
  81. printers, modems (rarely without tangling it with uucp stuff), 
  82. terminals, disks, etc. when all I really want is a simple character
  83. at a time I/O to(and from) a very dumb device.  Suggest any general 
  84. references that will help me out here!  The more complete and gory
  85. the better.  Most references so far seem to dance (dances with
  86. surreal ports!) around this subject.
  87.  
  88.  
  89. General:
  90.  
  91. I'm in group grader.
  92.  
  93.  
  94. Device Communication Specs:
  95.  
  96.   Even parity
  97.   2 stop bits
  98.   character length 7 bits
  99.   baud rate 2400
  100.   half duplex
  101.  
  102.  
  103. Device name and permissions:
  104.  
  105.   /dev/ttyGA/GAAI
  106.  
  107.   ls -l /dev/ttyGA/GAAI
  108.  
  109.   crw-rw----   1 root      grader    6,   8  Nov 9 13:28 /dev/ttyGA/GAAI
  110.  
  111.  
  112. Inittab entry:
  113.  
  114.   GAAI:234:off:/etc/getty ttyGA/GAAI 2400 vt100 # grader
  115.  
  116. I understand that this is just a documentation line to keep someone else
  117. from accidentally using this port so getty is not really active (the off
  118. action).  I hope my understanding is correct.
  119.  
  120.  
  121. Set it by:
  122.  
  123.   stty (control modes) (input modes) (output modes) < /dev/ttyGA/GAAI
  124.  
  125.  
  126. Other Questions:
  127.  
  128.    Do I need to own the device in order to change it via stty?  (I think
  129. so, but not sure.)
  130.  
  131.  
  132. stty stuff:  (everything but the kitchen sink)
  133.  
  134.  control modes  (I don't understand stty well you know any good
  135.                  references other than man pages?  Is a control
  136.                  mode parameter sufficient if you want it on 
  137.                  both input and output modes or do I need to
  138.                  put the parameters there too?)
  139.  
  140.   parenb
  141.   -parodd
  142.   cs7
  143.   2400
  144.   cstopb
  145.  
  146.  
  147.  input modes
  148.  
  149.   -ignbrk
  150.   brkint
  151.   ignpar
  152.   -parmrk
  153.   inpck
  154.   istrip
  155.   -inlcr
  156.   igncr
  157.   -icrnl 
  158.   -iuclc
  159.   -ixon
  160.  
  161.  
  162.  output modes
  163.  
  164.   -opost (Or do I need to specify all of the other parameters?)
  165.  
  166.  
  167.  local modes  (What are these?)
  168.  control assignments  (What are these?)
  169.  
  170.  screen size assignments  (Ignore?)
  171.  
  172.  
  173.  combination modes (Hmmmm)
  174.  
  175.   evenp
  176.   raw  (looks like sushi to me :)
  177.  
  178.  
  179.  
  180. What else now that I've written a book?  Maybe a movie...  Revenge of
  181. the Dynixors?  Well any input will be appreciated  (even a quick get
  182. lost is nice when your mailbox is empty at times.  heh)  Thanks much
  183. and be careful.
  184.  
  185.  
  186. Steve
  187.  
  188.          Stephan Rossi               Michigan Technological University
  189. Internet Address: rossi@mtu.edu   (906) 487-2223     Fax: (906) 487-2787
  190. Snail Mail: MTU, Admin Bldg 210, 1400 Townsend Drive, Houghton, MI  49931
  191.