This forum is in archive mode. You will not be able to post new content.

Author Topic: Connect to 3G modem using Pyserial  (Read 728 times)

0 Members and 1 Guest are viewing this topic.

Offline Gicharu

  • NULL
  • Posts: 1
  • Cookies: 0
    • View Profile
Connect to 3G modem using Pyserial
« on: April 05, 2014, 02:51:32 PM »
The following code is supposed to work on my modem, ie dial #777 and start a PPP connection. Am using Pyserial on Python3. However, all I get is " 'b" on CMD, and the modem doesnt do anything. Any ideas?

Code: [Select]
import serial
from time import sleep
ser = serial.Serial('COM25')
ser.write('+++'.encode())
sleep(1)
ser.write('+++'.encode())
sleep(1)
at_command='ATDT#777\r\n'
ser.write(at_command.encode())
sleep(1)
« Last Edit: April 05, 2014, 04:09:40 PM by Phage »

 



Want to be here? Contact Ande, Factionwars or Kulverstukas on the forum or at IRC.