1ATINOUT(1) ATINOUT(1)
2
3
4
6 atinout - Send AT commands to modem, capturing the response
7
9 atinout input_file|- modem_device output_file|-
10 atinout --version
11 atinout --usage
12 atinout --help
13
15 Atinout reads a list of AT commands. It sends those commands one by one
16 to the modem, waiting for the final result code for the currently run‐
17 ning command before continuing with the next command in the list. The
18 output from the commands is saved.
19
20 Notice that atinout is strictly about sending AT commands only; it can‐
21 not be used for AT commands that expect additional input data (e.g.
22 AT+CMGS etc).
23
25 Atinout expects input_file to be a list of AT command to be run. If the
26 file name - is used then standard input is read.
27
28 Although the above states a list of AT commands it is actually not just
29 a list of command but more generally a list of AT command lines. How‐
30 ever the rest of the man page will just refer to AT commands; running
31 several commands in one command line offers no benefits, and if one of
32 them fails you have no idea of which one failed. So unless maybe for a
33 single run on the command line (see EXAMPLES), I recommend against
34 putting more than one command on each command line.
35
36 And if the distinction between AT command and AT command line was not
37 something you were deeply familiar with you should read the ITU V.250
38 specification about AT commands. In fact, unless you already have read
39 V.250 before, you absolutely should go to
40 http://www.itu.int/rec/T-REC-V.250-200307-I/en and do so right away.
41
42 The modem is identified with modem_device (e.g. /dev/ttyS0 (COM1),
43 /dev/ttyACM0 (USB phone serial interface), ...). No serial configura‐
44 tion (e.g. speed, parity) is done before opening the device.
45
46 The responses from the AT commands are written to output_file, or stan‐
47 dard output i the file name - is given.
48
50 The following list of options are supported:
51
52 -h, --help
53 Prints explanation and gives an example on usage.
54
55 --usage
56 Prints information about arguments and options.
57
58 --version
59 Print version information. If this is the only option given,
60 also prints copyright/licensing information.
61
63 Check that the modem is connected and alive.
64
65
66
67 $ echo AT | atinout - /dev/ttyACM0 -
68 AT
69 OK
70 $
71
72
73
74 Hang up any calls.
75
76
77
78 $ echo ATH | atinout - /dev/ttyACM0 -
79 ATH
80 OK
81 $
82
83
84
85 Query how many entries the phone book has for ME storage.
86
87
88
89 $ echo ´AT+CPBS="ME"; +CPBR=?´ | atinout - /dev/ttyACM0 -
90 AT+CPBS="ME"; +CPBR=?
91
92 +CPBR: (1-7000),80,62
93
94 OK
95 $
96
97
98
99 Backup all phone numbers. This will most likely not be the same as a
100 full backup of all contact information, but at least the names and num‐
101 bers are saved which is the most vital information.
102
103
104
105 $ cat > save-phonebooks <<EOF
106 AT+CSCS="UTF-8"
107 AT+CGMI
108 AT+CGMR
109 AT+CPBS="SM"
110 AT+CPBR=1,240
111 AT+CPBS="ME"
112 AT+CPBR=1,7000
113 EOF
114 $ atinout save-phonebooks /dev/ttyACM0 phonebook_backup.`date "+%Y-%m-%d_%H-%M"`
115 $
116
117
118
119 List current calls. The information text format is (see 27.007 for de‐
120 tails):
121
122
123
124 +CLCC: <id1>,<dir>,<stat>,<mode>,<mpty>[,<number>,<type>[,<alpha>[,<priority>]]]
125
126 # No active calls
127 $ echo AT+CLCC | atinout - /dev/ttyACM0 -
128 AT+CLCC
129 OK
130 $
131
132 # One active call
133 $ echo AT+CLCC | atinout - /dev/ttyACM0 -
134 AT+CLCC
135 +CLCC: 1,0,3,0,0,"0123456789",129,"",0
136
137 OK
138 $
139
140
141
143 No environmental variables are used.
144
146 Atinout does not support reading response lines longer than 4095 char‐
147 acters.
148
149 Atinout does not do any serial port configuration, it just opens the
150 device as is.
151
153 Atinout is Copyright (C) 2013 Håkon Løvdal hlovdal@users.source‐
154 forge.net
155
157 V.250 (http://www.itu.int/rec/T-REC-V.250-200307-I/en), 27.007
158 (http://www.3gpp.org/ftp/Specs/html-info/27007.htm), 27.005
159 (http://www.3gpp.org/ftp/Specs/html-info/27005.htm)
160
161
162
163 September 2013 ATINOUT(1)