Hello forumers,
I am using RPi3 and I would like to use internet and receive calls at the same time.
I already tried that with USB modem HUAWEI E220 but there was no success. I also have HUAWEI E3531.
I just need internet connection to be running all the time and when I receive call I just get its number and cancel it without answering. When I get its number I need to check if it exists in database.
Do you know which USB modem / shield / modem should I use to perform this action?
----
I can read the number via AT commands, but I cannot use the internet connection at the same time because ports are busy.
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'
while 1:
buffer = ser.read(ser.inWaiting()).strip()
buffer = buffer.replace("\n","")
if((str(buffer)).startswith('+CLIP')):
print(str(buffer)) # number
if(command_channel.isOpen() == False):
command_channel.open()
else:
print 'Port is already open'
# cancel the call
command_channel.write('AT+CVHU=0'+'\r\n')
command_channel.write('ATH'+'\r\n')
command_channel.close()
And I can connect to internet with VW dial using this config:
[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
And the connection output:
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
The problem is that I use ttyUSB0 to send AT command and ttyUSB1 to read the CLIP and RING messages, so I cannot use WVDIAL on these ports.
Should I buy a new modem or any other solution exists?
BR, Matevz





