Page 1 of 1

Script to check prepaid balance 3g modem Huaweii E220

Posted: Thu 11 Jan 2018, 10:07
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?

Posted: Sun 14 Jan 2018, 09:14
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?

Posted: Tue 16 Jan 2018, 14:02
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