Hello,
I have a Huawei E220 modem which a am using on Rasberry Pi3.
The question is if it is possible to use modem's internet connection at the same time and cancel the incoming call (get its number and cancel it).
I have only two ports: /dev/ttyUSB0 and /dev/ttyUSB1
I am able to receive a call, cancel it and get its number with this python script:
And I am also able to create a PPP with wvdial hspa with this config:
And after running "sudo wvdial hsdpa" I get this after successfull connection:
The problem is I cannot do both things at the same time, because port are busy.
Is this even possible with this modem, or I should buy other one?
Thank you for your help!
Best regards, Matevz
I have a Huawei E220 modem which a am using on Rasberry Pi3.
The question is if it is possible to use modem's internet connection at the same time and cancel the incoming call (get its number and cancel it).
I have only two ports: /dev/ttyUSB0 and /dev/ttyUSB1
I am able to receive a call, cancel it and get its number with this python script:
Code:
import serial, re
command_channel = serial.Serial(
port='/dev/ttyUSB0',
baudrate=115200,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS
)
if(command_channel.isOpen() == False):
command_channel.open()
else:
print 'Port is already open'
#enable caller id
command_channel.write("AT+CLIP=1" + "\r\n")
# command_channel.close()
ser = serial.Serial(
port='/dev/ttyUSB1',
baudrate=9600,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS
)
if(ser.isOpen() == False):
ser.open()
else:
print 'Port is already open'
pattern = re.compile('.*CLIP.*"\+([0-9]+)",.*')
while 1:
buffer = ser.read(ser.inWaiting()).strip()
buffer = buffer.replace("\n","")
if((str(buffer)).startswith('+CLIP')):
print(str(buffer))
if(command_channel.isOpen() == False):
command_channel.open()
else:
print 'Port is already open'
# cancel call
command_channel.write('AT+CVHU=0'+'\r\n')
command_channel.write('ATH'+'\r\n')
command_channel.close()
And I am also able to create a PPP with wvdial hspa with this config:
Code:
[Dialer defaults] Phone = *99***1# Username = username Password = password Stupid Mode = 1 Dial Command = ATDT [Dialer hsdpa] Modem = /dev/ttyUSB0 Baud = 460800 Init2 = ATZ Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ISDN = 0 Modem Type = Analog Modem
Code:
pi@raspberrypi:~ $ sudo wvdial hsdpa --> WvDial: Internet dialer version 1.61 --> Initializing modem. --> Sending: ATZ OK --> Sending: ATZ ATZ OK --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 OK --> Modem initialized. --> Sending: ATDT*99***1# --> Waiting for carrier. ATDT*99***1# CONNECT --> Carrier detected. Starting PPP immediately. --> Starting pppd at Mon Feb 6 15:54:35 2017 --> Pid of pppd: 2206 --> Using interface ppp0 --> local IP address 172.17.245.69 --> remote IP address 10.64.64.64 --> primary DNS address 109.239.187.4 --> secondary DNS address 109.239.187.20
Is this even possible with this modem, or I should buy other one?
Thank you for your help!
Best regards, Matevz
Comment