4G router - connection disappearing after a while, and keep-alive suggestions - Page 1
Forum section: electronics / general

author: peter-h
author_rank: Super Contributor
timestamp: December 25, 2021, 07:55:45 am
content: 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, supportingincomingcalls (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?

author: peter-h
author_rank: Super Contributor
timestamp: December 29, 2021, 08:02:26 am
content: 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.

author: wraper
author_rank: Unknown
timestamp: December 29, 2021, 08:15:31 am
content: The simplest solution is a timer socket repowering it once in a day. You may look at Mikrotik products for a reliable router.

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: December 29, 2021, 08:43:42 am
content: Not wishing be the tin foil hat guy today, but this..Quote from: peter-h on December 25, 2021, 07:55:45 amQuoteIt'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.QuoteI 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!

author: Jeroen3
author_rank: Super Contributor
timestamp: December 29, 2021, 09:05:56 am
content: Quote from: peter-h on December 25, 2021, 07:55:45 amShitty software.Quote from: peter-h on December 29, 2021, 08:02:26 amDepends 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/cosyIf 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_kitThe also have more robust version with multiple sim for failover and such.https://mikrotik.com/product/ltap_mini_lte_kitThe 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.

author: peter-h
author_rank: Super Contributor
timestamp: December 29, 2021, 09:14:27 pm
content: 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.

author: nali
author_rank: Frequent Contributor
timestamp: December 29, 2021, 09:39:24 pm
content: 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.

author: Jeroen3
author_rank: Super Contributor
timestamp: December 30, 2021, 07:01:59 am
content: 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 andthe customeris 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.

author: peter-h
author_rank: Super Contributor
timestamp: December 30, 2021, 08:19:30 am
content: 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 keepsecurelyupdating, 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 streamBut 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.

author: nali
author_rank: Frequent Contributor
timestamp: December 30, 2021, 10:07:11 am
content: Quote from: peter-h on December 30, 2021, 08:19:30 amJust 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.

author: peter-h
author_rank: Super Contributor
timestamp: January 04, 2022, 06:44:58 pm
content: 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) andstillthe RUT240 stopped working - after about 5hrs.But then it seems to restart after a few hours, and works for a few more hours.

author: peter-h
author_rank: Super Contributor
timestamp: January 07, 2022, 12:07:51 pm
content: 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 anextremelyslow 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.

author: nali
author_rank: Frequent Contributor
timestamp: January 07, 2022, 12:22:26 pm
content: Quote from: peter-h on January 07, 2022, 12:07:51 pmYou 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.

author: peter-h
author_rank: Super Contributor
timestamp: January 07, 2022, 01:58:52 pm
content: 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).