Script to check prepaid balance 3g modem Huaweii E220

Problems and successes with specific brands/models of networking hardware.
Post Reply
Message
Author
daarek5
Posts: 27
Joined: Mon 21 Sep 2015, 15:36

Script to check prepaid balance 3g modem Huaweii E220

#1 Post by daarek5 »

Hello

I found simple way that almost work (when PDU not needed):
USSD message e.g balance check one shall execute

# echo "AT+CUSD=1,*101#^M" > /dev/ttyUSB1; cat /dev/ttyUSB1

IMPORTANT: ^M (Carriage Return character) is typed as CTRL+v and CTRL+m
got answer something like this
code not supported

Checked AT codes with minicom - it works fine, answer is correct, but I want just simple script to do prepaid balance check.

Is there error in this script?
^M (Carriage Return character) looks suspicious, or I do something wrong
Anyone help?

april

#2 Post by april »

Carriage return has always been CR for me see here though
http://www.theasciicode.com.ar/ascii-co ... de-13.html

^M....cant find that anywhere?

daarek5
Posts: 27
Joined: Mon 21 Sep 2015, 15:36

#3 Post by daarek5 »

^M. :?: ..or something that "emulate" Enter key pressed there

Code

Code: Select all

AT+CUSD=1,*101#
works in minicom, so I think it's wrong syntax in bash.

Do you know how script with "echo" should look like to achieve "Enter key pressed"?

echo(parametr maybe) "AT+CUSD=1,*101#(Enter here)" > /dev/ttyUSB1

Post Reply