titusece
Posts: 12
Joined: Sat Sep 10, 2016 3:24 pm

SIM800 GSM modem SMS receive and Internet

Tue May 30, 2017 2:11 am

Hello Experts,
I have interfaced the SIM800 GSM module to raspberry pi3 board.
And I'm running python script which will waiting for the "Receiving the SMS", its working.
If SMS received command to reboot the board then raspberry board will reboot and so on.
Also I need internet connection too.

So I have used 'ppp' connection (pon sim800) and able to get the internet.
Now I want to run both the things parallel but it seems its not allowing since SMS receive script is already occupied with serial port and internet connection is not working.
If internet is working then SMS receive script is getting crashed.
So anyone can help me out ?
Need to run both the things i.e internet and SMS receive (Like our mobile phone)

Thanks for the help.

MaddogBailey
Posts: 27
Joined: Mon Feb 04, 2013 6:17 pm
Location: Southend-on Sea, Essex

Re: SIM800 GSM modem SMS receive and Internet

Tue May 30, 2017 2:17 am

Don't wait continuously to receive SMS.
Instead, check often if the SMS is queued and unread. Read it, then act on it. Maybe then delete it.
It's a long time since I used GSM Modems and can't remember the exact command to check for SMS but should have some code somewhere.

titusece
Posts: 12
Joined: Sat Sep 10, 2016 3:24 pm

Re: SIM800 GSM modem SMS receive and Internet

Wed May 31, 2017 5:45 pm

Thanks MaddogBailey for your reply.
Actually I can't send/receive SMS once I enabled the internet on SIM800 modem.

Ex:
I've enabled the internet using 'sudo pon sim800_int' command as I have script mentioned location.
/etc/ppp/peers/sim800_int
And got 'ppp0' entry in 'ifconfig' and was able to ping and surf.

Code: Select all

pi@raspberrypi:~ $ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:4b:f0:05
          inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::66c4:ed67:1c02:db99/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2362 errors:0 dropped:1 overruns:0 frame:0
          TX packets:893 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:325475 (317.8 KiB)  TX bytes:146324 (142.8 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:200 errors:0 dropped:0 overruns:0 frame:0
          TX packets:200 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:16656 (16.2 KiB)  TX bytes:16656 (16.2 KiB)

ppp0      Link encap:Point-to-Point Protocol
          inet addr:100.90.175.226  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:72 (72.0 B)  TX bytes:111 (111.0 B)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:1e:a5:50
          inet6 addr: fe80::c5a8:fc40:1dfb:9115/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

pi@raspberrypi:~ $
pi@raspberrypi:~ $
pi@raspberrypi:~ $
pi@raspberrypi:~ $ ping -I ppp0 www.google.com
PING www.google.com (172.217.24.68) from 100.90.175.226 ppp0: 56(84) bytes of data.
64 bytes from sin10s06-in-f4.1e100.net (172.217.24.68): icmp_seq=2 ttl=51 time=633 ms
64 bytes from sin10s06-in-f4.1e100.net (172.217.24.68): icmp_seq=3 ttl=51 time=775 ms
64 bytes from sin10s06-in-f4.1e100.net (172.217.24.68): icmp_seq=4 ttl=51 time=717 ms
After that I tried to run some basic SMS scripts which will send/receive SMS.
By the way, I'm not able to access the /dev/ttyAMA0 port since its attached to ppp0 ??

Connect: ppp0 <--> /dev/ttyAMA0

Code: Select all

May 31 17:33:46 raspberrypi pppd[1495]: Serial connection established.
May 31 17:33:46 raspberrypi pppd[1495]: Using interface ppp0
May 31 17:33:46 raspberrypi pppd[1495]: Connect: ppp0 <--> /dev/ttyAMA0
May 31 17:33:47 raspberrypi pppd[1495]: PAP authentication succeeded
May 31 17:33:48 raspberrypi pppd[1495]: Could not determine remote IP address: defaulting to 10.64.64.64
May 31 17:33:48 raspberrypi pppd[1495]: not replacing default route to eth0 [192.168.0.1]
May 31 17:33:48 raspberrypi pppd[1495]: local  IP address 100.90.175.226
May 31 17:33:48 raspberrypi pppd[1495]: remote IP address 10.64.64.64
May 31 17:33:48 raspberrypi pppd[1495]: primary   DNS address 112.110.241.1
May 31 17:33:48 raspberrypi pppd[1495]: secondary DNS address 112.110.249.5
I can't open the port to type AT commands.

Can you please help me on this ?
How its handled in mobile phones ?
Like both internet and SMS send/receive calls etc.,

Thanks for your help.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 9666
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: SIM800 GSM modem SMS receive and Internet

Sat Jun 03, 2017 12:22 pm

nothing to do with the accessibility for the disabled, therefore moving to off-topic.

Jcdunn1972
Posts: 1
Joined: Sat Oct 28, 2017 11:49 pm

Re: SIM800 GSM modem SMS receive and Internet

Sun Oct 29, 2017 1:09 am

I am brand new to python and raspberry pi 3b, I have a gsm module 2g (sim800 SIM800L Quad-band Network GPRS GSM Breakout Module TTL Serial Port With Micro Sim Card Antenna IPEX Interface for Arduino Raspberry Pi ARM MCU), from Amazon, and need to transmit a text message to a phone, currently, I have the Pi3 b, a small the 2G module(sim 800) listed above, and a GPS module and have to send a GPS location via text to a cell phone with the (Makerfocus Raspberry PI GPS Module USB to GPS Converter USB-Port-GPS Module for Raspberry Pi 3 Model B Pi 2 B+ A+)(from Amazon). I have my pi recognizing my bme280 sensor(High Precision BMP280-3.3 Atmospheric Pressure Sensor Replace BMP180/BMP186 by Atomic )(except humidity).... but am lost on what I need for this expedition........ any help would be gratefully appreciated. I am kinda on a time crunch, I have 2 weeks, I tried to go raspberry when I was more familiar with Arduino....I have till 11/13/2017..... and can give credit and cite all help...... thanks in advance if you can help.

zog
Posts: 189
Joined: Sun Nov 20, 2011 5:43 pm
Contact: Website

Re: SIM800 GSM modem SMS receive and Internet

Wed Nov 01, 2017 8:17 pm

I have not used this particular module, but it's usual when working with cellular modems for them to present multiple serial devices. You can have an internet connection established on one device and be listening or sending text messages on another device. This usually involves using multiple threads of execution. I have experience with telit modules. You may also receive unsolicted information from time to time. You need to study the AT command reference for this module and work out it's capabilities. Note you could also send text messages indirectly by using a third party sms service if you have establised an internet connection.

Return to “Off topic discussion”

Who is online

Users browsing this forum: No registered users and 10 guests