element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum RPi3 internet and receive calls
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 5 replies
  • Subscribers 707 subscribers
  • Views 1412 views
  • Users 0 members are here
  • raspberrypi.
  • rpi3
  • raspberry pi
  • networking
  • usbmodem
Related

RPi3 internet and receive calls

matevzmrak
matevzmrak over 9 years ago

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?

 

Thank you for your help image

 

BR, Matevz

  • Sign in to reply
  • Cancel
  • balearicdynamics
    0 balearicdynamics over 9 years ago

    Hello Mrak,

     

    intuitively a solution should exist. My question is why you should use two USB ports? Is this a characteristic of the Huawei modem ?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • balearicdynamics
    0 balearicdynamics over 9 years ago

    Hi Again. I took a look on your model and it seems there is a way to setup it in raspbian, Take a look to the link below:

     

    https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=109052

     

    Maybe useful ?

    Enrico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Problemchild
    0 Problemchild over 9 years ago in reply to balearicdynamics

    Hi Enrico, I dont think this one actually uses two physical ports merely has two USB serial logical endpoints, not unusual often one is for command the other for data etc.

     

    That said back when these devices were more power hungry you needed a split lead to get power  from two USB ports to power the device.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Problemchild
    0 Problemchild over 9 years ago

    Voice and data mode support  is dependant on the device most modems this isnt an issue they support.

    Afterall on most smart phones of an age they dont support Data and Voice at the same time.

    I'm afraid you are expecting a bit much of the puny modem ;(

     

    If you need to send voice have you considered using a program like Skype  and just using the datamode you know works!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • clem57
    0 clem57 over 9 years ago

    One modem connected to the RPi3 cannot service the internet and voice calls simultaneously with one account. The connection to the cell tower is limited.Now if you have two modem and two accounts that would be different.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube