Reputation: 11
I'm trying to develop a program that can interact with the a particular SIM network to send & read SMSs and dial USSD codes.
I built a protoype using an old modem (iBall Airways 3G Modem - Qualcomm chipset).
I installed the driver that came with the modem (in its mass storage) and after that its COM ports were exposed and visible in Device Manager. I then tested AT commands using Ai-Thinker serial tool and then wrote a Python program to interact with the modem.
A simple code snippet illustrating communicating with modem via AT command below:
import serial.tools.list_ports
import serial
import time
ports = serial.tools.list_ports.comports()
modem = ports[0].device
ser = serial.Serial(str(modem), 115200, timeout=0)
ser.write('AT\r'.encode()) # This is for initializing, other commands can be given here
time.sleep(1)
response = ser.read_all()
This also allows me to run various AT commands - to read SMSs, send SMSs and dial USSD codes and get the responses.
Now I've bought a new USB Modem (4G) and i'm not able to send it any commands since it is not exposing any COM ports. In Device Manager, the device shows up as "USB Ethernet RNDIS Gadget". Looking up RNDIS shows me that is a protocol to allow modems to connect as an Ethernet device directly without the need for additional drivers.
Since most of the commercial USB modems available in the market these days are using this protocol and don't seem to provide specific drivers (I tried another modem as well), I just need to know if its possible to run AT commands to perform the actions mentioned above by any method (forcibly creating the COM port somehow?) OR if some other standard is to be used instead of AT commands.
P.S. I'm using Windows 11 Version 23H2 [OS Build 22631.4169]
Upvotes: 0
Views: 255
Reputation: 28100
The short answer is: it depends on the modem. Depending on the manufacturer and model, you may be able to send it commands to put it in "modem mode", where it will expose one or more COM ports - either permanently, or once-each-time-you-insert-it, depending on the method (and the manufacturer/model).
There is a piece of software, USB_ModeSwitch, that is specifically designed for changing the mode of USB modems. It's designed for Linux, but apparently it is possible to get it to run under Windows; it might be worth giving that a try, to see if you can persuade the modem to reveal a COM port or two. (Note: the typical use under Linux is to persuade the USB device to stop pretending to be a CD-ROM drive and behave as a modem, which the driver software that comes with the USB device usually does for you. You may therefore need to uninstall the driver before trying anything else.)
Upvotes: 0