charles linquist
New Member
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.
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.