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 1414 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
Parents
  • 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
Reply
  • 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
Children
No Data
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