IOT over 4G/LTE using Raspberry pi

charles linquist

New Member
Joined
Oct 27, 2018
Messages
11
Reaction score
1
Credits
0
I am using a Raspberry pi for an IOT project. The Raspberry connects to an Amazon ec2 server over SSH. The connection uses a 4G/LTE USB "dongle".

I can get the connection made (using wvdial, pppd and autoSSH) - so that all works, but my issue is - sometimes the 4G connection drops, and I need it to automatically reconnect.

I'm sending a lot of data, so I need the connection to be restarted quickly (5-10 seconds) after it fails. I'm struggling to get this working and I need some help.

The contents of my rc.local f file is:

ifdown ppp0 > dev/null
sleep 12 && ifup ppp0 && sleep12
/home/pi/start-autossh.sh &
exit 0

The contents of my wvdial.conf file is:

Init1 = ATZ
Stupid Mode =1
Dial Command = adtd
Carrier Check = yes

[Dialer Verizon ]
Modem = /dev/ttyACM0
Baud =100000000
Phone = *99***3#
Username = 1
Password = 1

The contents of start-autossh.sh is:

autossh -N -R 0.0.0.0:9090:localhost:80 -R 0.0.0.0:9999:localhost:2000 (login name).

As I stated before, this works. But sometimes the 4G connection is lost and I need to get it automatically restarted as quickly as possible.
 


There may be other ways to handle this, but I'm using a Novatel 551 and a Pantech 291 modem. Both of them respond to "atdt" in order to establish a connection. I also have a Pantech UML295VW, a HUAWEI E397U, a Novatel MC620 and a Novatel MiFi 6620, but I haven't been able to get these to work. If there are other/better options that will work, I'm open to that. Apparently, there are some modems that appear to the system as Ethernet devices, but I have yet to find a tutorial on the net that is clear enough for me to follow.I need as much bandwidth as I can get - I'm sending video.
 
If no one jumps in, however, i'll look up some info and see if i can help.

We'll hold you to that, @Rob :). I ain't jumping in where the water is over my head :eek::rolleyes:

And welcome to linux.org @charles linquist , another 60-plusser to add to our ranks :D

Chris Turner
wizardfromoz
 

Members online


Top