> 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/qtech/datscan-and-data-loggers/q48-cellular-remote-data-logger/text-commands.md).

# Text commands

Every text message the Q48 logger understands, and what it replies.

Text these messages to the logger's SIM phone number. These Text Messages are not case sensitive. The quote marks are not required in the message. Commands that change a setting start with the PIN number as specified in QTech Workbench.

{% hint style="info" %}
**Applies to:** Q48 Cellular Remote Data Logger (PD8600). New SMS commands were added in user guide v2.0 (March 2019), which supports firmware V1.06, and the debounce command in user guide v3.0 (July 2019), which supports firmware V1.08.
{% endhint %}

## Summary

| Text                      | What it does                                                                                    |
| ------------------------- | ----------------------------------------------------------------------------------------------- |
| `Request status`          | Return current status information from the device, including number of records                  |
| `Request config`          | Return the current configuration including the IP and port address of DATAHost                  |
| `Request debug`           | Return diagnostic information to determine if data records transfers are occurring correctly    |
| `Connect now`             | Transfers all log records to the server immediately                                             |
| `Connect at hhmm`         | Sets the time of day for each scheduled transfer of records                                     |
| `<PIN> <setting> <value>` | Changes a configuration parameter such as the IP address of the destination base station server |
| `<PIN> Debounce <time>`   | Sets the input debounce time for all inputs, where the time value is in milliseconds            |
| `<PIN> Reboot`            | Remote reinitialization of the device (if it is receiving SMS messages ok)                      |

## Request status

The logger replies like this:

| Line                | Meaning                                                   |
| ------------------- | --------------------------------------------------------- |
| `Addr:`             | The Q48-CRDL's Device Number                              |
| `Vers:`             | The Q48-CRDL's software revision number                   |
| `Time:` and `Date:` | The Q48-CRDL's current time and date                      |
| `LgTm:`             | The logon to base station time                            |
| `Last:`             | The last logon to base station date                       |
| `Recds:`            | The number of logging records currently stored            |
| `Gprs:`             | This indicates that the logon to base function is enabled |
| `Rssi:`             | The cellular network signal strength                      |

## Connect now

This command requests that the Q48-CRDL logon to the base station immediately. A reply text message of "Connecting to Database now" will be received. If the connection to base function is disabled, then a reply text message of "Base Logon DISABLED" will be received.

When the device is transferring data records to the base station (data transfer mode) the device does not respond to SMS messages. Any SMS sent during this time may be disregarded by the device. It can take at least 3 minutes to transfer logs and if thousands of logs are transferred the user may need to wait up to 15m before attempting SMS communications.

## Connect at hhmm

This command requests that the Q48-CRDL logon to the base station at a defined time each day. Where "hh" is the hours value (in 24-hour format) and "mm" is the minutes value of the time to logon at. E.g. connect at 13:15. A reply text message of "New connect time accepted" will be received. If an invalid logon time is specified, then a reply text of "Invalid connect time specified" will be received.

## Request config

The logger replies with its connection settings:

| Line                                             | Meaning                                                                                                                                                   |
| ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `IP addr:`                                       | The IP address and port number of the DATAHost Server                                                                                                     |
| `Use PDP:`, `PDP addr:`, `PDP user:`, `PDP pwd:` | The Packet data Protocol (PDP) settings may be required by the Cellular network provider to enable mobile data connections to be routed onto the internet |
| `Login enabled:`                                 | The DATAHost connection can be enabled or disabled                                                                                                        |
| `Login time:`                                    | The scheduled connection time (which can be changed using the "connect at" message)                                                                       |
| `Debounce:`                                      | The debounce time in milliseconds                                                                                                                         |

## Change a setting

Text `<PIN> <setting> <value>`. The setting name and value format is the same as that in the `Request config` message (case insensitive). For example:

* `<PIN> ip addr <address>:<port>` changes the DATAHost address and port.
* `<PIN> login time 13:00` changes the daily connection time.

When changing a setting issue `Request config` afterwards to confirm the setting has changed. The PIN cannot be changed via SMS.

## Request debug

This command is used primarily by Technicians and QTech to verify that the connection process to DATAHost is proceeding as expected. The response includes the date and time of the last attempt to contact the server, and the transition values of the internal state machine. Normally this is an ordinal sequence of numbers starting at 0 and ending at 14. In general, a successful data transfer will list a set of numbers from 0 to 14 separated by commas, returning to 0. This information can be provided to QTech to determine if there is a network issue connecting to DATAHost.

## Reboot

`<PIN> Reboot` forces the device to execute a warm restart, which will reinitialise communications modems. It is a remote reinitialization of the device (if it is receiving SMS messages ok).

## SIM balance

Texting the balance request to the device will forward the message from the device to the cellular network and return the balance from that account back to the originating phone. The facility to check the balance on an account varies across Mobile Network Operators (MNO). See [It won't tell me the SIM balance](https://help.qtech.co.nz/qtech/datscan-and-data-loggers/q48-cellular-remote-data-logger/troubleshooting/sim-balance.md).
