This is a discussion on problem with data reception through serial port within the Linux Networking forums, part of the Linux Forums category; Hello, I try to 'catch' a message send by a remote PC. Using minicom I don't have problem : the ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello,
I try to 'catch' a message send by a remote PC. Using minicom I don't have problem : the modem is setting to wait a call with ats0=2 and I see RING RING CONNECT and MY MESSAGE . But I don't have to use minicom and I would like to write a script, so I try it but it don't work properly: can somebody help me ? I set the serial port with stty and use chat command to set the modem in wait call (that seem ok) and the cat command to catch my message : ( stty ispeed 9600 stty cs8 stty -parenb stty -parodd stty -clocal stty -crtscts ) chat -v '' 'ats0=2' connect </dev/cua0>/dev/cua0 cat /dev/ttyS0 > /home/test please who can help me or give me a script to understand, I am linux beginner. Or is it possible to store the message received in the minicom window in a personal folder? thanks for your answers and excuse me for my bad english |
|
|||
|
"Pilatus" <radio.mnt@freesurf.fr> wrote in message news:1069753538.35845.0@demeter.uk.clara.net... > Hello, > > I try to 'catch' a message send by a remote PC. Using minicom I don't have > problem : the modem is setting to wait a call with ats0=2 and I see RING > RING CONNECT and MY MESSAGE . > But I don't have to use minicom and I would like to write a script, so I > try it but it don't work properly: can somebody help me ? > I set the serial port with stty and use chat command to set the modem in > wait call (that seem ok) and the cat command to catch my message : > ( > stty ispeed 9600 > stty cs8 > stty -parenb > stty -parodd > stty -clocal > stty -crtscts > ) Why did you turn OFF crtscts ?? Isnt that a good thing to have ON ? It does depend on your modem, but hey,what sort of modem are you using that doesnt support RTSCTS flow control? > chat -v '' 'ats0=2' connect </dev/cua0>/dev/cua0 > cat /dev/ttyS0 > /home/test > > please who can help me or give me a script to understand, I am linux > beginner. What you have is a good start. You want to make the chat script more complex. it should try to wake up the modem, with send "AT", expect "OK". It should have TIMEOUT variable set. Also, you might like to check the modem settings, and send a command like ATV1 to turn on verbal messages (eg CONNECT), and others to turn on rtscts flow control. However you can do this once off and store it with AT&W, and dont worry.. (trust the modem can remember - but many dont , so good software always sends a comprehensive setup. ) Also you have little idea of how to debug this system. You havent said what is actually occuring , or what you think could be wrong. |