Sponsored Content
Operating Systems Linux How do I capture responses from the chat command? Post 302494568 by Corona688 on Monday 7th of February 2011 04:36:41 PM
Old 02-07-2011
Quote:
Originally Posted by Bashingaway
I want to query the modem for it's manufacturer, product id and firmware version using AT commands.
What function does 'chat' serve in this? You should just be able to talk to the modem.

Code:
#!/bin/sh
# set up modem device to translate outgoing \n into \r\n
stty -F /dev/ttyS0 9600 -echo igncr icanon onlcr
# Open modem for reading and writing
exec 5</dev/ttyS0
exec 6>/dev/ttyS0

echo "AT+CGMI" >&6

# Eat the echo, then eat the blank line
read <&5 ; read <&5
# Read the actual response
read RESPONSE <&5

echo "Response was $RESPONSE"

# close the files
exec 5<&-
exec 6>&-

Code:
$ ./modem.sh
Response was ERROR
$

...mine returns 'ERROR' because it's not a cellphone so AT+CGMI means nothing to it. It responds 'OK' to plain 'AT'. Works in BASH, KSH, and ASH. If you have trouble, try 'cat <&5' to see what it's printing.

Last edited by Corona688; 02-07-2011 at 05:42 PM..
 

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

talk command to chat

Hi, Could you please advice on the following query: There are 2 users on a unix box: 1. aaaa 2. bbbb I open 2 putty sessions and login with the above 2 users. Then I type the following using the aaaa user to chat with bbbb. talk bbbb or talk bbbb@hostname Result: the screen goes... (1 Reply)
Discussion started by: miltonkeynesguy
1 Replies

2. UNIX for Dummies Questions & Answers

talk command to chat

Hi, Could you please advice on the following query: There are 2 users on a unix box: 1. aaaa 2. bbbb I open 2 putty sessions and login with the above 2 users. Then I type the following using the aaaa user to chat with bbbb. talk bbbb or talk bbbb@hostname Result: the screen goes... (4 Replies)
Discussion started by: miltonkeynesguy
4 Replies

3. UNIX for Dummies Questions & Answers

Doing a capture while another command is executing?

Basically what i'm trying to do is execute an update command and at the same time have the system do a TCPdump to file for that update traffic. So I would like to connect the two commands so that the tcpdump terminates automatically when the update finishes/fails/whatever. Right now I have... (0 Replies)
Discussion started by: MrEddy
0 Replies

4. Web Development

Can you embed Skype or any other video chat/chat program into a webpage?

Hi, I am trying to embed Skype or any other video chat/chat program into a webpage. Has anyone had success doing this? or know how? Thanks Phil (2 Replies)
Discussion started by: phil_heath
2 Replies

5. What is on Your Mind?

Very Funny and Somewhat Amazing 2006 Chat Bot Chat

Working on the badging system, Just found this old thread for 2006 and started reading it. ROTFL ... what a great discussion between forum members and our chat bot Gollum "back in the good old days"... You must check this out if you want a laugh and big smile: ... (1 Reply)
Discussion started by: Neo
1 Replies
MUCOUS(1)							Museek Daemon Plus							 MUCOUS(1)

NAME
Mucous - Python / Curses client for museek SYNOPSIS
mucous [-c <filename>] [--config <filename>] [-l <directory>] [--log <directory>] [-v] [--version] [-h] [--help] DESCRIPTION
Mucous provides a interface for the Museek Daemon for chatting, transferring files, managing users and browsing shares on the Soulseek P2P network and Soulfind Servers. You will need a configured museekd(1). OPTIONS
Mucous accepts the following options: -c <filename>, --config <filename> Use a different config file. -l <directory>, --log <directory> Use a different chat log directory. -v, --version Display Version and exit. -h, --help Display Help and exit. EXAMPLE
To run this program the standard way type: mucous Alternativly you use a different config file with: mucous --config config Or a different chat logging directory with: mucous --log logdir ENVIRONMENTAL VARIABLES
TERM Specifies the type of Terminal; changes the way mucous displays color. For XTerm: xterm-color For aterm or rxvt: rxvt For urxvt: rxvt-unicode FILES
~/.mucous/config The default location for the mucous config file. ~/.mucous/logs/ The default directory for chat logs. ~/.mucous/logs/room/ The directory where chat room logs are stored. ~/.mucous/logs/private/ The directory where private chat logs are stored. ~/.mucous/$USER.image The file where a user's userinfo image is saved. AUTHORS
daelstorm <daelstorm@gmail.com> SEE ALSO
mulog(1) murmur(1) muscan(1) muscand(1) museekcontrol(1) museekd(1) museeq(1) musetup(1) musetup-gtk(1) daelstorm Release 0.8.0 MUCOUS(1)
All times are GMT -4. The time now is 05:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy