# 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
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
