> For the complete documentation index, see [llms.txt](https://help.qtech.co.nz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.qtech.co.nz/datran/datran-telemetry/datran-xl4-plus-rtu/troubleshooting/cm910-wont-connect.md).

# The RTU won't connect to DATRAN over the CM910

Slow or failed cellular connections, comms fail that lasts minutes, and CME errors 553 and 567.

The problem manifests when the RTU attempts to initialise the modem (e.g. after a power cycle) to establish a data connection to DATRAN. The problem is attributed to a combination of CM910 firmware (older versions of the firmware supplied by the manufacturer of the modem chip to QTech) and versions of XL4 Plus firmware that only partially fix or circumvent the problem. If the diagnostics show CME Error 553 or 567, it could be that the APN name has not been correctly configured in the modem module.

{% hint style="info" %}
**Applies to:** XL4 Plus with a CM910 4G cellular modem (LE910 module).
{% endhint %}

## What you see

* The initialisation sequence can fail and it may take some minutes and reattempts before a modem initialises and a stable connection is formed. DATRAN Operators may also notice that it takes a long time for the Site (RTU) to come out of Comms fail.
* Workbench diagnostics with **DATRAN Slave** and **Modem Comms** (DBG\_QCOMMS\_SLAVE and DBG\_MODEM) debug categories turned on show repeated attempts to reinitialise with varying results, often "modem timed out" or "connection failed" messages.

## 1. Check the RTU and modem firmware

Use Workbench diagnostics to look at the modem response when it is requested for its firmware version (`AT+CGMR`):

* Firmware in the form `25.26.255` (xxx.xxx.xxx) is **old** firmware.
* Firmware in the form `M0F.280010` (M0F.xxxx) is **new** firmware.

The firmware is provisioned by the Modem chip manufacturer and is not currently upgradeable by QTech.

| RTU firmware                  | Older modem firmware | Newer modem firmware | What to do                                                                                                                                                                        |
| ----------------------------- | -------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| V7.16 or older                | Problem likely       | Problem likely       | Install the V7.17.100 Service pack                                                                                                                                                |
| V7.17 (application issue 900) | Problem likely       | Problem unlikely     | Install the V7.17.100 Service pack                                                                                                                                                |
| V7.18                         | Problem likely       | Problem unlikely     | Verify that the CM910 is using older firmware and replace with a newer model (running M0F.280010) by swapping units around, or install V7.19, or contact Techsupport for guidance |

V7.19: Fixes to the CM910 cellular interface on the RTU where it fails to connect to the DATRAN Server and does not obey the initialisation sequence. Cellular connections to DATRAN have been improved. There is a small likelihood that the issue could occur with M0F.280006 but may also depend on the SIM being used. The update can be confirmed by connecting the Device to QTech Workbench and verifying the Firmware version and Application issue number on the **Overview** page.

To update the firmware, see [Update the firmware](https://help.qtech.co.nz/datran/datran-telemetry/datran-xl4-plus-rtu/update-firmware.md).

## 2. CME error 553 or 567: set the default APN

If either of these errors occur it could be that the APN name has not been correctly configured in the modem module:

* `CME Error: 553`: the (PDP) context is already active
* `CME Error: 567`: wrong APN, or IP version type incompatible

This tends to happen with the newer LE910C1-AP (4G) modules used in the CM910 and less so with the older HE910 module which is now obsolete. If the errors occur and the XL4 Plus firmware cannot automatically resolve the issue, the solution is to manually store the default APN in the modem module (context ID 1) using a terminal emulation programme. The procedure that follows is specific to the LE910 module.

### Connect to the modem

1. Using a Type A-B USB cable (typically the same as used for a printer) power up the modem and plug it into a spare USB port on a PC running Microsoft Windows 7 or Windows 10. Do not attempt to communicate with the device until it has fully installed the USB drivers for the modem. It may take several minutes for Windows to download and install the drivers so be patient.
2. Open the Windows Device Manager. Scroll down to the **Ports (COM & LPT)** category and expand it then note the virtual com port number of the USB connection to the modem e.g. USB Serial port (COM5).
3. If you don't have a terminal emulator application installed, download and install PuTTY. Launch PuTTY and in the session settings category open a serial connection to the COM port (e.g. COM5 from above). Use the baud rate of 115200, other values are default (8,n,1). In settings you may wish to force local echo on (terminal settings category), click open to make the connection.
4. Type `AT` on your keyboard. The modem should respond with `OK`.

### Set the APN

1. Enter the following commands one after the other and note the responses, this will establish what the current configuration settings are: `AT+CGACT?`, `AT+CGDCONT?` and `AT#SGACT?`.
2. The modem must be detached from the network before changing the context settings otherwise you may get error 553 (context already active) or a similar error. If the response to `AT+CGACT?` is `+CGACT: 1,0` the modem is detached. If the response is `+CGACT: 1,1` the modem is attached and must be detached: type `AT+CGATT=0`. It can take about 15s to do this; it will respond with `OK` when complete.
3. If the `AT+CGDCONT?` response does not say `+CGDCONT: 1,"IP","INTERNET","",0,0,0,0`, where the word INTERNET should be the APN name for your network (e.g. "TELSTRA.INTERNET"), then you need to set the new default. Also the IP type must be "IP" (to use IPV4 addresses exclusively). If it says something like "IPV6 or IPV4V6" then change it. Type `AT+CGDCONT=1,"IP","TELSTRA.INTERNET"`. This is the required setting. It should respond with `OK`.
4. Reattach the modem: `AT+CGATT=1`.
5. Verify the APN settings: `AT+CGCONTRDP=1`. The modem has now been given an IP address.
6. Activate the context: `AT#SGACT=1,1`. The response will be the IP address.
7. Test a connection to DATRAN: `AT#SD=1,0,<port>,"<DATRAN IP address>",0,0,1`, using the same TCP port and IP address you enter in Workbench. As long as the response is `OK` then we are done.
8. Close the terminal and re-power the modem.

QTech can supply a complete script of AT commands to follow for use with PuTTY to emulate the connection sequence that the XL4 Plus RTU follows.

### Check the RTU

1. Connect the XL4 Plus to QTech Workbench and select CM910 as the equipment type then enter the DATRAN IP address, TCP port and APN (PDP address). See [CM910 4G cellular modem](https://help.qtech.co.nz/datran/datran-telemetry/datran-xl4-plus-rtu/communications/cm910-cellular-modem.md).
2. Reconnect the modem to the XL4 Plus via its serial cable.
3. Turn on RTU diagnostics and monitor the boot sequence of the RTU, this time it should connect to DATRAN but you may still get error 553 because the RTU will try to initialise the APN settings with the same values that we have just programmed as the default ones. They will be rejected because the default context is already active and attached to the network. But the RTU will carry on regardless and this time the connection to the server will be made because the default APN settings are correct.

For more help, email <techsupport@qtech.co.nz>.
