/atcmd-go

Send AT Commands to a cellular modem.

Primary LanguageGoISC LicenseISC

Send AT Commands to a cellular modem

This utility sends AT commands to the MultiTech MTD-H5-2.0 cellular module. Should work with other modems but this is the only one I've tested with. It can send commands either from the command line or from a file (with one AT command per line).

ISC License Go Report Card GoDoc

To Build

go build

To Run

Send commands from the command line.

./atcmd -device /dev/ttyACM0 -cmd AT+CIMI  #Returns International Mobile Subscriber Identity
./atcmd -device /dev/ttyACM0 -cmd AT+CGMR  #Returns software revision number

Send commands from a file (the extension of the file does not matter).

./atcmd -device /dev/ttyACM0 -file cmds.at
./atcmd -device /dev/ttyACM0 -file cmds.txt

Command file format

ATZ
AT+CMEE=1
AT#SIMDET?
AT+CIMI
AT+CGMR
AT+CPIN

Example

./atcmd -device /dev/ttyACM0 -cmd "AT#QSS?"

#QSS: 0,1

OK

./atcmd -device /dev/ttyACM0 -cmd "AT+CGMR"

12.00.024

OK