Backup remote site connectivity with U410


#1

Hi Foxs,

I looking for a script in Pi 3 for enabling ppp0 when eth0 is disconnected!

I found this article on the Internet but working on Huawei modem, I try to change the script but did not work on U410 modem.

Any help?


#2

Which modem are you using? whats the manufacturer and model number?

Honestly, I suggest just buying the Hologram Nova Cat-M1 for ~50-65$ from digikey (out of stock) or direct from hologram (in stock). It will be much easier to get support, you can use Hologram’s native sdk to get get the ppp connection setup and any debugging- it will work much smoother across the board and be easier to get support.

Otherwise I think your going to have to go to the author of the script you are using or the help forum for the modem you are using.

Step 1 would be to just use AT commands (ignoring PPP) to verify the modem is configured correctly and can register on the network.


#3

Hi Andrew,

Thanks, I was the guy that bought all Digi-key modems! lol

Yes I used the python-SDK for connection but the issue is after many call “connect” and “disconnect” command,modem stop working! and cannot initialize the ppp0 port and need a restart!

I used python to ping eth0 if did not reply going to connect the modem and when ever eth0 is available disconnect the modem, but after 10 or 20 call the function, modem stop responding! :frowning:
I should get update each 5 min from cloud server.


#4

Hmm, you shouldnt need to repeatedly call connect / disconnect. You can connect and stay connected. Think of the connect/disconnect like connecting to wifi. You dont disconnect from wifi each time you load a webpage, you connect once, stay connected for a long time as you send/receive data. Then if you have an issue with the wifi, or it disconnects on its own then you connect / disconnect again.

You may be confusing connect/disconnect to the network with connect/disconnect to the server (like a socket command).

So try modifying your code to be like:

connect
while (True):
    send_result = send_data()
    sleep(300)
disconnect

Or something along those lines, atleast that is the flow you should use. Definitely dont disconnect / connect every 5 minutes.


#5

No I use the code like this

if not ping eth0
if not ping ppp0
hologram network connect
getdata() // take time more than 300ms
if ping eth0
hologram network disconnect

OK, by the way, I won to leave the modem connected always because I founded Rpi eth0 is the first priority for internet connection.
I wanna just to know if hologram charged us for just connected modem! :disappointed_relieved:


#6

checkout: https://hologram.io/pricing/details/

There is no fee for time connected, there is only for data (and sms). So you can leave the modem connected indefinitely without charge. You do have to be careful that only your desired network traffic goes through the Nova as if your rpi tries to download updates / etc you will be charged for that data as well. You should be able to solve this with the builtin (to linux) routing table.


#7

Thank you Andrew, Can you refer me a source for setup the routing table on Rpi?


#8

implementing routing is beyond the scope of this forum but look here for a start: https://www.computerhope.com/unix/route.htm

When googling around (which I suggest you do next). remember you can treat the Nova with ppp just as another network port, so you don’t have go google for cell communication, also the rpi is just a linux box, so anything that works for an ubuntu server as far as routing tables go will work for the rpi. Basically your challenge now is the same as a high end server with multiple ethernet ports. Look at it from that lens.