Python Forum

Full Version: SMS sending using USRobotics modem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
# windows 10 Home 64-bit
# python 3.9.2
# modem: USRobotics 5637
# dailing is oke
# no erors
# not sms sending/recieving
# what to do... ?

import serial
import os
import sys
import time

port = serial.Serial("COM4", baudrate=9600, timeout=1)

# check modem status
port.write(b'AT\r')
rcv = port.read(10)
print(rcv)
time.sleep(1)

# calling
port.write(b'ATD06########\r')
print('Calling…')
time.sleep(30)
port.write(b'ATH\r')
print('Hang Call…')

# check modem status
port.write(b'AT\r')
rcv = port.read(10)
print(rcv)
time.sleep(1)

# set modem to text mode
port.write(b'AT+CMGF=1\r')
print ("Modem set to text mode!")
time.sleep(3)

# send sms
port.write(b'AT+CMGS="06########"\r')
msg = 'testing modem'
print ('sending message...')
time.sleep(3)
port.reset_output_buffer()
time.sleep(1)
port.write(str.encode(msg+chr(26)))
time.sleep(3)
print ('message sent...')
Is there a question here?
Do you have some docs we can look at? You're using AT+CMGS to try to text, and I don't see +C in the ref at all: https://support.usr.com/support/5637/563...d_use.html