Feb-22-2019, 10:58 PM
Ok so I'm able to open the com port and dial out to my phone number but I can't seem to get a response once the dialup handshake is complete.
after that I'll need to be able to put in a password and then some basic S for system commands but that'll be easy after I can get the python code to show the ( that comes up once the handshake is done.
Normally in hyperterminal you'll see
connect/2400 come up on the screen and then you press the spacebar a bunch of times and then
Enter Keyword
I can't get it show the above so I know when to put in another input.
Here's the code I'm using.
import serial
port = "COM1"
baud = 2400
bytesize=serial.SEVENBITS,
parity=serial.PARITY_EVEN,
stopbits=serial.STOPBITS_ONE
ser = serial.Serial(port, baud, timeout=5)
# open the serial port
if ser.isOpen():
print(ser.name + ' is open type dialit to connect')
while True:
cmd = input("Enter command or 'exit':")
# for Python 2
# cmd = input("Enter command or 'exit':")
# for Python 3
if cmd == 'exit':
ser.close()
exit()
if cmd == 'dialit':
ser.write(b'ATDT6045245320\r\n')
after that I'll need to be able to put in a password and then some basic S for system commands but that'll be easy after I can get the python code to show the ( that comes up once the handshake is done.
Normally in hyperterminal you'll see
connect/2400 come up on the screen and then you press the spacebar a bunch of times and then
Enter Keyword
I can't get it show the above so I know when to put in another input.
Here's the code I'm using.
import serial
port = "COM1"
baud = 2400
bytesize=serial.SEVENBITS,
parity=serial.PARITY_EVEN,
stopbits=serial.STOPBITS_ONE
ser = serial.Serial(port, baud, timeout=5)
# open the serial port
if ser.isOpen():
print(ser.name + ' is open type dialit to connect')
while True:
cmd = input("Enter command or 'exit':")
# for Python 2
# cmd = input("Enter command or 'exit':")
# for Python 3
if cmd == 'exit':
ser.close()
exit()
if cmd == 'dialit':
ser.write(b'ATDT6045245320\r\n')