Page 1 of 1

sakis3g sim800 reconnect on disconnect

Posted: Thu Feb 16, 2017 2:53 pm
by Davies
hi all, following many of guides from 2012+ ive managed to get a sim800 working with the rpi3.
ppp0 shows on ifconfig, i have web connectivity and the ability to send emails.
i auto start my connection on boot by adding to etc/rc.local before the exit line

Code: Select all

sudo /home/pi/sakis3g connect OTHER="CUSTOM_TTY" APN="CUSTOM_APN" CUSTOM_APN="everywhere" APN_USER="eesecure" APN_PASS="secure"
but what id like to do is write a script which says if the sim800 disconnects, reconnect.. if its turned off, turn it on.
i usually write in python but i dont believe i can re-initiate sakis3g from a python script? i know i can turn the device on from a python script, but could a init.d script manage both the turning on and the reconnection?
how would i go about automatically reconnecting the device when it drops off the network?

Re: sakis3g sim800 reconnect on disconnect

Posted: Thu Feb 16, 2017 5:38 pm
by Davies
or maybe the answer lays in python.. i could perhaps call an AT command to check status then use

Code: Select all

import os
os.system("sudo /home/pi/sakis3g connect OTHER="CUSTOM_TTY" APN="CUSTOM_APN" CUSTOM_APN="everywhere" APN_USER="eesecure" APN_PASS="secure"")
to reconnect.. maybe :/

Re: sakis3g sim800 reconnect on disconnect

Posted: Fri Feb 17, 2017 11:15 am
by Davies
that command failed to run, im now using UMTSkeeper to maintain my connection.

if you come across this post looking for setup instructions on a sim800 these web pages are which helped me.(5days of googling, reading and trying yielded these..)

https://hallard.me/enable-serial-port-on-raspberry-pi/
https://shkspr.mobi/blog/2012/07/3g-int ... i-success/
https://shkspr.mobi/blog/2012/06/raspbe ... les-oh-my/ on this page the sms send script is missing a \ slash
use

Code: Select all

def sendatcmd(cmd):
    dongle.write('AT'+cmd+'\r')
instead of what is listed.
https://www.modmypi.com/blog/how-to-con ... 3g-network
http://mintakaconciencia.net/squares/umtskeeper/#

n i think thats all that i found useful.

also on rc.local i now call..

Code: Select all

sudo home/pi/umtskeeper --sakisoperators "OTHER='CUSTOM_TTY' APN='CUSTOM_APN' CUSTOM_APN='everywhere' APN_USER='eesecure' APN_PASS='secure'" --sakisswitches "--sudo --console" --log --nat 'no'
the apn user and pass are EE MMS user and pass as when i left them blank i had a consistent packet loss on a ping test, once i used the MMS settings i had a consistent 0 packet loss, ive seen a max of 1% packet loss whilst using these settings... could be coincidence but internet is running so ill keep these settings.

Re: sakis3g sim800 reconnect on disconnect

Posted: Thu Sep 07, 2017 9:12 pm
by FernandoAguirre
Hi.

I cant connect to internet using sakis3g and sim800L module, sakis detect the modem but when it tries to connect, fails.

After searching over internet, I got success using pppd, there is an option named "persistent" that reconnects when the intener has gone.

Does "persistent" option works as UMTSkeeper works?
Will I have internet all the time?

Thank you!