Best practice to check LTE connection programmatically

Hello,
what is the best and reliable practice to check programmatically that ppp0 LTE connection was established well.

thanks in advance,

Hi @dima,
The easiest way to do this:
You can write a script that checks the ping statistics using the ppp0 interface with the ping command.

ping -I ppp0 -c 5 8.8.8.8

sweet. I believe that make sures it pings through the particular network interface.
thank you very much!!

Maybe try speedtest, you can install it with sudo apt-get install speedtest-cli and run speedtest

pi@portal:~ $ speedtest
Retrieving speedtest.net configuration...
Testing from Verizon Wireless (IP Hidden for privacy)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by (Hidden for privacy) [26.17 km]: 49.507 ms
Testing download speed................................................................................
Download: 3.49 Mbit/s
Testing upload speed......................................................................................................
Upload: 8.09 Mbit/s

In my question I meant just to make sure that device is on PPP0 connection, but thanks for additional information. appreciated.