Optimizing Device Configuration
Many of our customers develop their own IoT hardware, and a critical aspect of their design is ensuring reliable and efficient connectivity. In this guide, we will cover best practices for setting up an optimal connection process for your hardware, tailored specifically for roaming conditions. We’ll dive into strategies that help your devices seamlessly connect to available networks, maintain stable data sessions, and handle network interruptions gracefully. Following these guidelines will enhance your device’s ability to connect effectively and efficiently across different regions and network environments, ultimately improving performance and user experience
1. Implementing Network Retry Logic and Prioritization
Network selection: Device vs SIM card
It’s important to understand that the decision of which network to connect to is made by the device, not the SIM card. The SIM simply provides access to multiple carriers, but it’s the device’s internal logic and configuration that dictate which network it will connect to. The device uses parameters such as signal strength, availability, and preferred network lists to determine the best carrier to connect to. Therefore, configuring the device correctly to prioritize certain networks is crucial for ensuring stable and reliable connectivity, especially when multiple networks are available in the area.
Preferred Network Approach with Flexible Switching:
Many of our customers have specific requirements for different carriers. For example, if your device is certified for Carrier A but not for Carrier B, it’s important to use a preferred network list to ensure optimal connectivity. If the preferred network is unavailable or the connection attempt fails, the device should automatically switch to the next available network on the list. This approach ensures that your device consistently maintains connectivity while adhering to carrier-specific certifications and preferences.
Step 1: Attempt to connect to the first preferred network.
Step 2: If that fails, move to the next preferred network.
Step 3: Continue switching to the next available network in the priority list until all options have been tried.
Step 4: Attempt to a network that is not on the preferred list.
Looping Back: After attempting each network once, restart from the first preferred network if none were successful.
Retry Mechanism with Progressive Intervals:
It is important to implement progressively increasing wait times between connection attempts to avoid overwhelming the network with frequent retries. Finding the right balance is crucial—retrying too quickly can lead to your device being temporarily or permanently banned by the roaming partner. By spacing out retries, you reduce the risk of network rejection while still ensuring that your device reconnects as soon as possible when a network becomes available.
Example Retry Pattern:
First try after a 1-minute wait.
Second try with a 2-minute wait.
Third try with a 4-minute wait.
Extended Waits: After failing to connect through multiple rounds, allow the device to wait an hour or more, depending on connection needs, before retrying.
This setup allows the device to methodically cycle through networks, improving the chances of establishing a stable connection without triggering network rejection policies.
Our view on blacklists
Some devices use a blacklist to prevent connections to certain networks, which can be helpful in specific cases where a network consistently underperforms or is incompatible. However, we generally advise caution with blacklist configurations, especially for devices in roaming environments. Overly restrictive blacklists can limit the number of available networks, which may lead to reduced connectivity options and greater vulnerability during service outages. Instead, we recommend a flexible approach that prioritizes preferred networks but allows your device to connect to any available network as needed. This method ensures more reliable connectivity without completely blocking access to networks that might be essential in certain areas.
2. Verifying Connectivity with Ping Tests
Ping tests are a highly effective method for verifying that a device maintains a stable and active connection to the network. By sending small data packets to a reliable server—such as Google DNS at 8.8.8.8—and measuring the response time, devices can detect whether they are truly connected to the internet or just showing a local connection. This approach helps to identify issues like connection drops, packet loss, or latency spikes, which can impact performance, especially in roaming scenarios
We strongly recommend that our customers perform a ping test at least every hour and use any failed ping as a prompt for the device to reconnect.
Set the ping test frequency based on your data usage and connection requirements; frequent tests can drain resources.
3. Maintaining an Open Data Session with Scheduled Network Reconnects
In cellular connectivity, connecting to a network and starting a data session are two distinct steps that together establish full internet access for a device.
Connecting to a Network:
This is the first step where the device attaches itself to a cellular network, similar to how a mobile phone connects to a nearby cell tower. In this stage, the device registers with the network and gains basic connectivity without data transfer capabilities.
Example AT Command: AT+COPS=0
This command lets the device automatically connect to the strongest available network, which establishes a basic connection to the mobile infrastructure. However, at this point, the device is not yet ready to send or receive internet data.
Starting a PDP Session:
Once connected to the network, the device needs to initiate a Packet Data Protocol (PDP) session to enable data transmission. The PDP session effectively opens an internet “gateway” that allows data to flow between the device and the internet.
Example AT Command: AT+CGDCONT=1,"IP","APN_NAME"
This command configures the PDP context by specifying the Access Point Name (APN), which is necessary for routing internet data.
Activate the PDP Session: AT+CGACT=1,1
This command activates the PDP session, allowing the device to exchange data packets over the internet.
Open and Stable PDP Sessions
Keeping PDP (Packet Data Protocol) sessions open can greatly benefit devices by enabling seamless data transfers without the overhead of reconnecting each time. Note that data sessions are rounded up to 1 KB and billed with a minimum charge of 0.0001. For applications with low data usage, maintaining an open session can help reduce costs significantly.
Daily Network Reauthorization for Roaming Stability:
While it’s beneficial to maintain the PDP session, it’s equally important to reconnect to the network itself periodically—preferably every 24 hours. This reconnection allows the device to reauthorize on the network, reducing the likelihood of network-enforced reauthorization, which can disrupt connectivity.
4. Firmware Updates and Continuous Improvement
Regular Firmware Updates for Optimal Roaming Performance:
Firmware updates from modem manufacturers often bring enhancements in network compatibility, security, and roaming capabilities. Keeping your devices updated helps ensure reliable performance across various networks and regions. However, it’s wise not to rush into the latest updates immediately—new software can sometimes introduce unexpected bugs. Let others be the early testers, and update once the release has proven stable.
Monitor and Adjust Settings Based on Real-World Performance:
After setting up your connection logic, it’s important to continuously monitor key metrics such as retry success rates, connection durations, and overall roaming performance. By analyzing these data points, you can fine-tune your retry intervals, adjust network prioritization, and optimize connection strategies over time. Regularly reviewing this information will help you identify patterns, respond to connectivity issues more effectively, and ensure that your device’s performance remains reliable and efficient across different network conditions. This proactive approach can significantly improve the user experience and reduce operational costs associated with connectivity issues.
Example Configuration for U.S. Use Case
This example demonstrates a recommended setup for a device using a roaming SIM card on major U.S. networks—Verizon, T-Mobile, and AT&T. It outlines a sample registration process, handling network rejections, and responding to service interruptions or failed connectivity checks.
1. Initial Registration Process and Network Prioritization
Preferred Network List:
1. Verizon
2. T-Mobile
3. AT&T
Connection Attempt Sequence:
Step 1: The device attempts to register with Verizon.
If successful, the device establishes a data session and begins operating normally.
If unsuccessful: The device waits 1 minute before moving to T-Mobile.
Step 2: The device attempts to register with T-Mobile.
If successful, it establishes a data session.
If unsuccessful: Wait 2 minutes and try connecting to AT&T.
Step 3: The device attempts to register with AT&T.
If successful, the device establishes a data session.
If unsuccessful: The device waits 4 minutes, then begins a new cycle by returning to Verizon.
2. Handling a Service Incident (All Networks Unavailable)
In this scenario, assume all networks have been rejecting the connection attempts due to a service interruption or SIM disablement:
Extended Retry Pattern:
After each network has been tried once in the initial cycle, extend the wait intervals to prevent excessive retries:
First Extended Interval: After the 4-minute retry, wait 1 hour before trying Verizon, T-Mobile, and AT&T in the preferred order.
Further Extended Intervals: If no networks are available for an hour, switch to 4-hour wait intervals to minimize network strain and retry at a sustainable pace.
3. Connectivity Check (Ping Test)
Using Google DNS for Connectivity Verification:
After establishing a data session, the device periodically performs a ping test to Google DNS (8.8.8.8) to ensure the connection remains active.
If Ping Test Fails: The device will assume the connection has dropped.
Response: The device disconnects from the current network and restarts the network selection process from Step 1 (Verizon), attempting to re-establish a stable connection.
4. Daily Network Reauthorization
To maintain optimal network performance and allow for any necessary reauthorization, the device is programmed to disconnect and reconnect to the network every 24 hours.
Daily Reconnection Process: The device will disconnect from its current network, then follow the initial prioritization sequence (Verizon, T-Mobile, AT&T) to re-establish its connection.
This ensures continued authorization and minimizes the risk of forced reauthorizations by the network due to prolonged inactivity.
Last updated