Raspberry Pi 3G/4G&LTE Base HAT - Getting disconnects all the time

Hello Sixfab Forum,

I have bought the Raspberry Pi 3G/4G&LTE Base HAT and it is setup on my Raspberry PI 4 2GB(raspbian Buster) using your ppp tutorial.

Everything is setup and working fine, but I am noticing alot of disconnects from the 4G/LTE Base HAT.
Here is my log from /var/log/messages:

Mar 24 11:57:06 raspberrypi pppd[8350]: pppd options in effect:
Mar 24 11:57:06 raspberrypi pppd[8350]: debug#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: updetach#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: dump#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: noauth#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: remotename 3gppp#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: /dev/ttyUSB3#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: 115200#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: lock#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: connect chat -s -v -f /etc/chatscripts/chat-connect -T vpn.telia.no#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: disconnect chat -s -v -f /etc/chatscripts/chat-disconnect#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: nocrtscts#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: modem#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: asyncmap 0#011#011# (from /etc/ppp/options)
Mar 24 11:57:06 raspberrypi pppd[8350]: lcp-echo-failure 4#011#011# (from /etc/ppp/options)
Mar 24 11:57:06 raspberrypi pppd[8350]: lcp-echo-interval 30#011#011# (from /etc/ppp/options)
Mar 24 11:57:06 raspberrypi pppd[8350]: hide-password#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: novj#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: novjccomp#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: ipcp-accept-local#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: ipcp-accept-remote#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: ipparam 3gppp#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: noipdefault#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: ipcp-max-failure 30#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: defaultroute#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: usepeerdns#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: noccp#011#011# (from /etc/ppp/peers/provider)
Mar 24 11:57:06 raspberrypi pppd[8350]: noipx#011#011# (from /etc/ppp/options)
Mar 24 11:57:06 raspberrypi pppd[8350]: pppd 2.4.7 started by root, uid 0
Mar 24 11:57:06 raspberrypi pppd[8350]: Device ttyUSB3 is locked by pid 698
Mar 24 11:57:06 raspberrypi pppd[8350]: Exit.
Mar 24 12:26:50 raspberrypi pppd[8838]: pppd options in effect:
Mar 24 12:26:50 raspberrypi pppd[8838]: debug#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: updetach#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: dump#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: noauth#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: remotename 3gppp#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: /dev/ttyUSB3#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: 115200#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: lock#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: connect chat -s -v -f /etc/chatscripts/chat-connect -T vpn.telia.no#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: disconnect chat -s -v -f /etc/chatscripts/chat-disconnect#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: nocrtscts#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: modem#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: asyncmap 0#011#011# (from /etc/ppp/options)
Mar 24 12:26:50 raspberrypi pppd[8838]: lcp-echo-failure 4#011#011# (from /etc/ppp/options)
Mar 24 12:26:50 raspberrypi pppd[8838]: lcp-echo-interval 30#011#011# (from /etc/ppp/options)
Mar 24 12:26:50 raspberrypi pppd[8838]: hide-password#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: novj#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: novjccomp#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: ipcp-accept-local#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: ipcp-accept-remote#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: ipparam 3gppp#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: noipdefault#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: ipcp-max-failure 30#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: defaultroute#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: usepeerdns#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: noccp#011#011# (from /etc/ppp/peers/provider)
Mar 24 12:26:50 raspberrypi pppd[8838]: noipx#011#011# (from /etc/ppp/options)
Mar 24 12:26:50 raspberrypi pppd[8838]: pppd 2.4.7 started by root, uid 0
Mar 24 12:26:50 raspberrypi pppd[8838]: Device ttyUSB3 is locked by pid 698
Mar 24 12:26:50 raspberrypi pppd[8838]: Exit.

As you can see, it for some reason disconnects, and then it connects again using the “reconnect.service” script which is working very well. But this is now happening several times pr. hour.

I was wondering if you have some ideas or tips to figure out why it is disconnecting so often?

The 4G/LTE Base HAT is connected directly with the accompanied USB cable to the RPi and the RPi is using original Raspberry PI AC/DC power adapter.
There is a Serial COM-port(MAX3232) connected to the RPI via the GPIO pin 14 and 15 (Rx and Tx), I read that this can cause issues ?
Is it recommended for the 4G/LTE Base HAT to be connected with separate power with for example a Y-USB cable or an external powered USB hub ?

Thank you in advance for any help on this.

Sincerely,
Anders

Hi @anders.hallingstad,

Did you install reconnect service? (sudo systemctl status reconnect.service)
The ttyUSB3 is locked by the auto_reconnect service.
You might have installed the reconnect service.
For the time being, you can stop it till rebooting RPi or restarting the service manually:
sudo systemctl stop reconnect.service

I hope this helps you.

Best regards.

Hi @ensar,

thank you for the prompt reply.

Here is a screenshot of systemctl status reconnect.service.

The reconnect.service was installed when following the ppp tutorial and choosing “yes” on the question if I want the service to automatically reconnect if it looses connection.

The ttyUSB3 is locked by the auto_reconnect service.

I am not familiar with this “Auto_reconnect.service” is this a separate service that reconnects the 4G-LTE connection? Running “systemctl status auto_reconnect.service” just tells me the unit cannot be found.

If I stop the reconnect.service, will it still connect automatically if it looses connection ? The raspberry pi is in a remote location 2hours away.

Thank you for your help so far.

Sincerely,
Anders

Hello again,

I have studied the reconnect.sh script that is stored in /usr/src. This script is created when you install the auto reconnect service from Sixfab(from the Sixfab ppp Tutorial).

I added a bit of logging the reconnect.sh script, to see when pon is being run.

echo “$datenow : Connection down,running pon, reconnecting…” >> /var/log/reconnect_script_run.log

Here is a screenshot of the log file:
logfile

As you can see it is not happing all the time, but several times a day. And as far as I can tell the ip on the ppp interface is not changing, meaning that it should be able to ping 8.8.8.8 and should have to run pon again.

So why is this happening, is it because of bad reception? or is there something wrong with my 4G provider ? If anyone has any suggestions, it would be much appreciated.

Sincerely,
Anders

Just looking at the log file it appears that the connection is timing out for some reason.is there continously traffic on the connection or is the traffic load aperiodically , intermittent . Do you know how far you are from the closest cellular tower? What are the geographical features of the area between you and the cellular tower? The land use land coverage can affect the reception.

Hey Terry,

thank you for taking an interest in this problem :slight_smile:

I am not sure if there is traffic all the time. The Raspberry is hosting Homeassistant and there is also some wifi devices connected.
I will try to look into the cellular coverage in that area. It is in the middle of town, so I am guessing there should be more than plenty coverage. I will also try to find out the nearest cellular tower.

I will reply back once I have the info.

Have a nice day.

Sincerely,

Anders