Author Topic: 4G router - connection disappearing after a while, and keep-alive suggestions  (Read 1893 times)

0 Members and 1 Guest are viewing this topic.

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 3694
  • Country: gb
  • Doing electronics since the 1960s...
I have an embedded target going online via a RUT240 4G modem/router.

The RUT240 config is straight out of the box, latest firmware, factory defaults. It is a DHCP server for my board (192.168.1.155 or some such) and via the Vodafone SIM card it goes online nicely and basically all works. It is a NAT router, like all the other standard (ADSL etc) ones. It has a fantastic array of features but a) most of them aren't needed and b) I am pretty sure some of them don't actually work (par for the source for a chinese linux box).

I have it sitting there, and my board is pinging healthchecks.io every hour.

It works for hours or even days but eventually the connectivity is lost, until the RUT240 is power cycled.

Can anyone guess what might be happening?

I know that a GPRS/3G/4G network closes the connection after (IME) 180 secs. I found this out when trying to implement VOIP on a phone, supporting incoming calls (various hacks for that have been developed e.g. STUN). But here we are going freshly online every hour. And the GSM+4G signal is strong.

I am thinking that one needs a keep-alive process, which pings some URL say every minute. The data used up will be tiny and irrelevant and anyway even PAYG SIMs have a huge data allowance nowadays. Any real application of this will use a CONTRACT SIM anyway. Can anyone suggest what site or address to ping? I reckon pinging the default gateway (192.168.1.1 or some such) will not do anything because it won't bring up the 4G. Could one just send a UDP packet to 8.8.8.8 - in this case it could be a DNS request for google.com?
« Last Edit: December 25, 2021, 02:02:25 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 3694
  • Country: gb
  • Doing electronics since the 1960s...
Can anyone recommend a good reliable 4G router?

The RUT box has no support - just yet another "forum" :) And I don't think it is reliable.

I'd think most of this stuff is Chinese made anyway.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16841
  • Country: lv
The simplest solution is a timer socket repowering it once in a day. You may look at Mikrotik products for a reliable router.
 

Offline Ed.Kloonk

  • Super Contributor
  • ***
  • Posts: 4000
  • Country: au
  • Cat video aficionado
Not wishing be the tin foil hat guy today, but this..

4G modem/router.
Quote
Can anyone guess what might be happening?

It's no mistake that a time-based auto reset setting isn't included in the firmware. For that matter a setting for maintaining a persistent connection.
Quote
Can anyone suggest what site or address to ping?
I had problems with a terrible ADSL router refusing to keep a connection or at least start a new one. I had a server box laying around and I made a script go grab random live web cam JPGs. The nearby house security system had a relay port that the script used to power cycle the router. Just awful.

That was a fair while ago and I doubt there are too many webcams that offer up small still pics anymore. And I would warn that exposing your IP to such things for that purpose may attract attention on your network you mightn't want.

What about a bit of server space somewhere offsite? It could send a ping to your network or vice versa and a do a horrendous raspberry pi power control solution that actives when it doesn't receive enough chirps from the offsite server.

Use the server space and encrypt and store some of your important stuff and solve the offsite backup predicament as well!

iratus parum formica
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Can anyone guess what might be happening?
Shitty software.

Can anyone recommend a good reliable 4G router?
Depends on your budget. For remote units you don't go near a lot, use an EWON Cosy or Tosibox.
However, these are quite high up in price. But worth it. They do work reliably and safely and behind any CGNAT.
https://www.ewon.biz/products/cosy

If that's too expensive you have to pay with some learning and time. You can use Mikrotik WAP LTE kit.
https://mikrotik.com/product/wap_lte_kit
The also have more robust version with multiple sim for failover and such.
https://mikrotik.com/product/ltap_mini_lte_kit
The software won't crap itself, if you lose connection you can configure the netwatch to reboot it. Or run custom scripts.
You can have it do many more things, but you have to put in some effort, because it's not a TP-Link click&config.
Very capable units for a low price.
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 3694
  • Country: gb
  • Doing electronics since the 1960s...
Thank you for the pointers.

The Ewon are "reassuringly expensive", at £600+. I think that might be a bit too much.

The Microtik are similar to RUT at about half that.

I just want a GPRS/3G/4G router which works out of the box as a normal router. The RUT boxes do that. This is for a project where the customer will be purchasing and attaching the router so it needs to "just work" once the SIM card is inserted. It would be something I would just specify, and hope it remains available for a while so I don't have to re-test another one soon again. The Ewon boxes state "available in 2022" which is a concern.

Most Chinese routers have whole functions which don't work and have never worked. The RUT240 seems to have a fair few of these. Even the "better" stuff like Draytek has these (used Draytek for years). But I would hope the basic "4G router" feature should work. Unfortunately while the RUT might have a periodic reboot feature (I don't remember and can't get to mine right now; in fact it has almost certainly already crashed; it never runs for more than a day ;) ) that would need a customer config step, which is a hassle.

Someone is writing a keep-alive module for the product which will do a dummy DNS to 8.8.8.8 say ever 2 mins, and that will narrow down the problem. It might even eliminate it. It's a good feature to have on any "internet" (whoops I should have said "IOT" ;) ;) - my marketing BS dictionary is getting out of date) box anyway.
« Last Edit: December 29, 2021, 09:35:41 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline nali

  • Frequent Contributor
  • **
  • Posts: 657
  • Country: gb
Cellular routers or modems "dropping off" the network is a problem as old as the hills. Sometimes it's the modem, sometimes it's the cellular network forgetting about the modem until it re-registers for whatever reason.

That's why a lot of routers have the option to set a keepalive IP address to ping and reboot if it fails. It's also common practice in the sector I worked with (roadside or on-street displays) to incorporate an actual power switch when using an external 2/3/4G terminal to force them to re-register on the network when comms fail.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
The EWON boxes automatically reboot when the lose connection to their cloud infrastructure. I don't know what you are planning to do with them. But if it's for remote access and the customer is providing SIM cards, you will inevitably end up behind CGNAT or have to tell the customer to pay more for their subsription to have a routable IP. The cloud approach fixes that, the box connects to the could. You connect to you the cloud. And that's how you connect to devices behind them, lik PLC and such. So part of the 600$ was one perpetual cloud licence when we got a few.

If it's to provide local wifi, anyting will work, just reboot the interface once in a while.
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 3694
  • Country: gb
  • Doing electronics since the 1960s...
Yes; I think most users will be connecting to a private server - what you call "the cloud" :) - because then authentication is easy. If one connects to some "public" host then you have the issue of how to store, and keep securely updating, the whole load of root certificates (if you want to do the job properly).

I don't think I will be providing the private server, but it is possible. It has challenges; for example it needs to have 24/7 availability so you need two of them, with failover etc. It's probably a good revenue stream :) But how they stay in the server business by selling hardware one-off is a mystery; it relies on constantly selling more and more boxes.

Also a lot of people won't trust it.

All very interesting. I did also wonder how the roadside displays (including the bus route / arrival time ones) work reliably.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline nali

  • Frequent Contributor
  • **
  • Posts: 657
  • Country: gb
All very interesting. I did also wonder how the roadside displays (including the bus route / arrival time ones) work reliably.

Just because they display something isn't a guarantee they're online... there's often a fallback whereas the dislpay caches the timetable data so if comms fail they'll still display a scheduled arrival rather than a real time tracked arrival. There's a convention (at least in this country not sure about elsewhere) whereas if an arrival is shown as say 22 minutes it's real time data whereas an arrival shown as say 13:25 it's just scheduled data.
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 3694
  • Country: gb
  • Doing electronics since the 1960s...
Well, I have a 60 sec keep-alive ping implemented (pinging a web server of mine, out on the net and deffo not on the local LAN) and still the RUT240 stopped working - after about 5hrs.

But then it seems to restart after a few hours, and works for a few more hours.
« Last Edit: January 05, 2022, 09:15:11 am by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 3694
  • Country: gb
  • Doing electronics since the 1960s...
Well, I did something and it's been running all night!

I put another £10 on the SIM card! It should not have been needed but perhaps Voda are expiring their PAYG SIMs (I originally put about £50 on this one; it was supposed to be good for 20GB and I used maybe 1/1000000 of that) after much less than the usual 90 days.

But how can this possibly work at all?

About 20 years ago, when contracts were expensive and I had Voda PAYG SIMs in various devices I was travelling with, I discovered that Vodafone allow very small packets through on expired SIMs. Very small - probably under 100 bytes. But not always; it works perhaps once an hour.

So a DNS lookup tends to work, but longer stuff, like doing a WGET from an HTTPS website (TLS involves some kbytes of data for anything), no way.

Smallest possible topup appears to be £10.

For any real commercial use, people will use a contract SIM, of course. You can get them down to £3/month. PAYG still makes sense in many very low usage scenarios but the networks try to block that usage, so things like alarms have a feature to send an SMS or make a call every say 89 days, and then a £50 or so topup should work for ever. So they block that by requiring a topup every 90 days, etc... Currently, with Vodafone, an SMS every x days does seem to work for years (I had one such system running). Mobile data usage does not extend the SIM activity.

I also configured the RUT240 to reboot every day at 2300, as recommended by lots of people. It's a good procedure, because it deals with bugs like memory leaks. It seems to be a linux box, with an extremely slow file system (any config save takes tens of seconds) so perhaps implemented in the CPU FLASH. A lot of chinese boxes are like that... very very slow config page loading, saving, etc.
« Last Edit: January 07, 2022, 12:11:12 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline nali

  • Frequent Contributor
  • **
  • Posts: 657
  • Country: gb
Well, I did something and it's been running all night!

I put another £10 on the SIM card! It should not have been needed but perhaps Voda are expiring their PAYG SIMs (I originally put about £50 on this one; it was supposed to be good for 20GB and I used maybe 1/1000000 of that) after much less than the usual 90 days.

You might want to check how you're sending data and how it's charged. Voda may well have something like a 1Kb minimum data block, so for example if you're sending 10 byte packets you may well be paying 100x what you think you are.
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 3694
  • Country: gb
  • Doing electronics since the 1960s...
That's possible, but a) I could not have used up 20GB and b) the fact is that a few small packets were getting through while bigger ones were not.

I can see why a cellco might want to allow tiny packets. It enables oddball things like SIM card telemetry / reconfig, so that when the customers pays up the card again, the device works right away, otherwise the system would be unable to make contact with a "totally dead" device (obviously) because such a device could not even communicate with the towers. There is basically no such thing as a "totally dead" SIM card because if there was, you could never get a phone going again just by doing an online topup. The foregoing is related to GSM, not 3G/4G/5G, but there is a general trend to move from GSM to 4G. Not sure how far it's got; AFAIK voice calls and SMS are still 100% over GSM.

What I found in the past is that lots of people know how it all works but all keep very quiet about it, for obvious reasons. Very occassionally, something comes out, like a way to hack the femtocell system (e.g. Vodafone Sure Signal, just shut down).
« Last Edit: January 07, 2022, 02:05:17 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf