Last active
July 1, 2019 13:41
-
-
Save b-alidra/98054a543114f564763c83443c76a26a to your computer and use it in GitHub Desktop.
Send AT commands using atinout to Huawei E3531 modem after Kannel service has started
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/sh | |
SERVICE=kannel | |
ATINOUT_BIN=/usr/bin/atinout | |
TTY=/dev/gsmmodem | |
while ! sudo systemctl is-active --quiet $SERVICE; do | |
echo "waiting the $SERVICE service to start" | |
sleep 10 | |
done; | |
echo "$SERVICE service started" | |
echo "Wait 30 more seconds for initialization" | |
sleep 30; | |
# Select Message Service | |
echo "Setting CSMS..." | |
echo "AT+CSMS=1" | $ATINOUT_BIN - $TTY - | |
echo "" | |
echo "Checking CSMS..." | |
echo "AT+CSMS?" | $ATINOUT_BIN - $TTY - | |
echo "" | |
# Indicate new messages to TE | |
echo "Setting CNMI..." | |
echo "AT+CNMI=1,2,0,1,0" | $ATINOUT_BIN - $TTY - | |
echo "" | |
echo "Checking CNMI..." | |
echo "AT+CNMI?" | $ATINOUT_BIN - $TTY - | |
echo "" | |
# Report Mobile Termination Error | |
echo "Setting CMEE..." | |
echo "AT+CMEE=1" | $ATINOUT_BIN - $TTY - | |
echo "" | |
echo "Checking CMEE..." | |
echo "AT+CMEE?" | $ATINOUT_BIN - $TTY - | |
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/home/pi/init_e3531.sh > /home/pi/e3531_init.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment