Modem Troubleshooting
LTE modems must be considered as self running, autonomous systems and as such carry a host of potential problems to be aware of. Most problems when operating a cellular links can usually be traced to down to the network registration getting into a "confused" state or problems with getting or maintaining a functioning network connection.
Modem Registration Problems
Pre-Connection Checklist
Before attempting to establish a connection, ensure the following:
-
SIM Card Functionality:
- Verify that the SIM card is communicating properly with the modem.
- Check for issues such as PIN locks or blocked status.
- Check that the SIM card has been activated by the supplier before usage.
- Signal Strength: Confirm that the system has adequate signal strength.
- Network Detection and Registration: Ensure that the network is detected and the modem is successfully registered.
Addressing Signal Strength Issues
If the modem detects low signal strength (below 10 out of 31):
- Reorient the Antenna: Adjust the antenna's position to capture the best possible signal.
- Consider a Directional Aerial: In areas with particularly poor coverage, install a Yagi directional aerial, pointing it towards the nearest base station.
-
Be Aware of Signal Thresholds:
- Below 10: Likely to experience problems with LTE connectivity, the system may fall back to 3G/EDGE/GPRS modes or have issues with data transfers.
Resolving Registration Problems
If the modem is stuck in "Not registered, Not Searching" mode, e.g. due to intermittent signal strength issues, or reporting unusual signal strength values e.g.99/32:
-
Soft Reset via AT Commands: Issue one of the following commands (depending on your modem type):
AT+CFUN=1
AT+CFUN=1,1
This typically reboots the modem firmware and restarts the network registration process. - Toggle Airplane Mode: If the soft reset is ineffective, try toggling the device in and out of airplane mode.
- Hardware Reset: As a last resort, perform a hardware reset using the hardware reset GPIO line (Refer to your device's GPIO documentation for the specific lines to toggle)
By following these steps, you can systematically troubleshoot and resolve most modem registration issues, ensuring a stable and reliable connection.
Modem Status Information
To help with checking these details we have created a simple script to detail some of the key points to take note of regarding network registration, you can download this script from the github repository here
Preventing and Resolving "Silent Disconnects"
Cellular network providers often manage their base stations by "muting" connections that appear to be using a disproportionate amount of resources relative to their data transfer, so in cases where IoT devices are connected for long periods and only sending very small amounts of data. This practice, while optimizing overall service availability, can lead to a phenomenon known as a "silent disconnect" or "stale connection."
In these cases, your device may show an active connection, but attempts to transfer data or access remote servers (such as VPN links) will fail. To maintain a stable connection, it's crucial to implement periodic connectivity checks and have a strategy for connection renewal
To ensure your cellular connection remains active and functional, consider the following approach:
- Perform regular end-to-end checks: This is particularly important if your modem uses standard consumer APN credentials.
- Use HTTP requests for validation: A reliable method to check connectivity is using a curl HTTP request. This approach uses minimal data while still performing a standard web request:
curl -I -s --connect-timeout 5 --max-time 10 http://www.msftncsi.com/ncsi.txt | grep "HTTP/1.1 200 OK"
This command checks the last modified timestamp of a webpage, ideally one on your target server that you control.
- Interpret results: Use the success/fail error code of the grep command to determine the viability of your connection. This method is often more reliable than ping as some network operators break this functionality
If your connectivity check fails, follow these steps:
- Retry the check: If the initial check fails, attempt it two more times.
- Reset the connection: If three consecutive checks fail, consider the internet connection compromised. Bring the connection down and up again to re-establish connectivity.
- Software reset: If the problem persists, perform a software reboot of the modem using the appropriate AT command.
- Hardware reset: As a last resort, give the modem a hardware reset using the relevant GPIO line. Allow sufficient time for both the modem and OS to react before and after the reset.
Connection Manager
To automate this process we have created a connection management script which you can read about and download from the github link here
Modem Cellular Connection Failure Due To APN Name Error
A common "gotcha" is getting the APN details wrong, sometimes the error messages received can be a bit cryptic, see below example of what results of an incorrect APN name :
Modem Registration Fail Due To Antenna Connected To Wrong Port
Modem gets valid LTE signal, but will not register on the network
In this case the antenna was connected to the DIV (diversity) antenna port and not the MAIN port