Sorry, but this post is not easy to understand because there is no detail or context and the post is written in strange English.
Assuming this is the product supplier you are talking about, have you tried contacting the supplier at http://www.minicom.com/ ? KVM over IP � Switches & Extender � Minicom
It is not possible to post suitable unix Script solution based the detail you have posted. We have no idea what "Screen" is or any details about your computer hardware or its Operating System or the modem. Any modem commands would have to be sent to a modem port on your computer.
The Minicom for Linux program is interesting, but still ancient technology. What real-world problem are you trying to solve?
Still suggest that you contact the authors of the software for advice. If you have trouble with scripting the solution please post as much detail as you can complete with lots and lots of detail and examples.
Afterthought:
If the O/P does not have modem software is is easy to write AT commands directly to the modem port. We'd need to know the Linux name for the modem port /dev/.... and what Operating System and Shell the O/P has. The process writing to the modem must not add extra characters, so we need to avoid sending a line terminator.
# A sort of solution in a Bourne-type Shell might be:
echo -n "AT+CGREG" > /dev/<name of the device>
echo -n "AT!PADCONF?1" > /dev/<name of the device>
#Or if it's the other syntax for echo on whatever O/S the O/P has:
echo "AT+CGREG\c" > /dev/<name of the device>
echo "AT!PADCONF?1\c" > /dev/<name of the device>
Hi,
on my board i have only u-boot, kernel and rootfs! I haven't a Gui interface..
The modem is the SL8092 which is connected to the card via USB port /dev/ttyUSB3.
Screen is a program like minicom.
I have write this script on my PC with UBUNTU 11.10 and modem plugged:
modem.sh:
#! /bin/bash
#Or if it's the other syntax for echo on whatever O/S the O/P has:
echo "AT+CGREG\c" > /dev/ttyUSB3
echo "AT!PADCONF?1\c" > /dev/ttyUSB3
but when i run sh modem.sh:
giuseppe@giuseppe-K53SV:~/Scrivania$ sh modem.sh
giuseppe@giuseppe-K53SV:~/Scrivania$
Sounds like you need an alternative program to screen if you want to automate this.
If you have the Linux script command that might be able to control the screen session.
I wrote this a while ago to interact with a serial modem, it might work for you, or might not. It should at least do the CR-NL translation and such by messing with stty. If the subroutine doesn't work, you can rip out the stty and exec bits and talk to the modem how you please through FD 5.
#!/bin/bash
function get_response
{
local ECHO
# cat will read the response, then die on timeout
cat <&5 >$TMP &
echo "$1" >&5
# wait for cat to die
wait $!
exec 6<$TMP
read ECHO <&6
if [ "$ECHO" != "$1" ]
then
exec 6<&-
return 1
fi
read ECHO <&6
read RESPONSE <&6
exec 6<&-
return 0
}
stty -F /dev/ttyUSB3 115200 -echo igncr -icanon onlcr ixon min 0 time 5
# Open modem on FD 5
exec 5<>/dev/ttyUSB3
get_response "AT" || echo "Bad response"
echo "Response was '${RESPONSE}'" ; cat $TMP
exec 5<&-