This is a program that allows you to execute and read AT commands for the Vodafone Huawei K4203 USB Modem. The program is written in Python and uses the serial
library to communicate with the modem. For headless execution use maincli.py
and for the GUI version use main.py
file.
To use the program, you need to have Python 3 installed on your computer. You also need to connect the Vodafone Huawei K4203 USB Modem to your computer via USB.
- Clone or download the repository to your computer.
sudo nano /etc/usb_modeswitch.conf
and set DisableSwitching flag to 1.- Open a terminal or command prompt and navigate to the directory where the program is located.
- Run the program by typing
python3 maincli.py
orpython3 main.py
and pressing Enter. - Follow the on-screen instructions to select an option and enter any required parameters.
The program provides the following features:
- Execute AT commands: You can enter any AT command and the program will send it to the modem and display the response.
- Get all SMS PDU's: You can retrieve all SMS PDU's stored on the modem and display their information.
- Get unread SMS PDU's: You can retrieve only the unread SMS PDU's stored on the modem and display their information.
- Send text SMS: You can send a text SMS to a recipient by entering their phone number and the message.
- Send PDU SMS: You can send a PDU SMS to a recipient by entering the CMGS number and the PDU message.
The program accepts the following command-line arguments in the CLI:
1 <AT Command>
Execute AT Command2
Get all SMS PDU's3
Get unread SMS PDU's4 phone_num messsage
Send text SMS5 cmgs pdu
Send PDU SMS
However setup is not done automatically if command-line arguments are used, first do the setup with:
s
Only do modem setup
To use a command-line argument, run the program with the argument followed by any required additional arguments. For example:
python3 maincli.py s
python3 maincli.py 1 AT