Python Forum
SMS sending using USRobotics modem
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SMS sending using USRobotics modem
#1
Question 
# 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...')
Larz60+ write Feb-27-2021, 02:51 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.

Fixed for you this time. Please use bbcode tags on future posts
Reply
#2
Is there a question here?
Reply
#3
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Send SMS with gsm modem mariolopes 3 4,818 Oct-15-2019, 08:22 PM
Last Post: micseydel
  get and reuse the token value with huawei modem Reims 1 4,572 Oct-02-2019, 04:29 AM
Last Post: Reims
  Dialup Modem using pyserial - Need it to show response from the other end. Rython 1 3,533 Jun-20-2019, 10:09 PM
Last Post: roy
  Read data of Wireless Modem in Byte Format barry76 2 2,635 Jan-31-2019, 11:26 AM
Last Post: barry76
  How to detect wireless modem connected serially to my laptop in python barry76 3 3,546 Jan-08-2019, 06:18 AM
Last Post: Gribouillis
  Help to activate the "USB Modem" with Python karlo123 4 4,865 Sep-17-2017, 08:40 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020