> 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/water-insight/sensor-technology/irrigation-telemetry-unit/configure.md).

# Configure an ITU

Set up an ITU in the podlist or in IMS, and change its settings with Workbench or the INC command shell.

The ITU is configured using QTech Workbench via the USB interface. The sensor must be added to the Farm associated with the user's IMS account. The ITU is configured into the INC pod-list via the pod configuration file, similar to a regular IPC.

{% hint style="info" %}
**Applies to:** ITU flow loggers, pulse flow meters, level sensors and water level meters. From the ITU Devices Configuration Guide v1.1, the ITU Pulse Flow Meter Quick Start Guide v1 and the ITU Water Level Meter User Guide V1.0. The product can be shipped pre-configured to the radio channel requirements for the user.
{% endhint %}

## Water level meter: add it to IMS

1. Sign in to IMS and select the farm card
2. Click the settings icon (cog) in the top right corner of the card. Then click **Manage Sensors** from the pop up menu
3. This lists all the sensors on the farm. Now click the **Add New Sensor** button
4. This shows the details card and a map (the details yet to be filled in)
5. Click on the map to place a dot where the sensor is located (water tank) this will update the GPS location
6. Provide a name for the sensor
7. Enter the serial number for the device as displayed in Workbench or on a label on the unit
8. Enter the radio MAC address as displayed in Workbench or on a label on the unit
9. Select the gateway to be used (usually there is only one already installed)
10. Select the sensor type (choose **Level-mm**) for units that have a millimetric scaling output
11. Input the offset from the probe tip to base of tank
12. Input the top water level
13. Input the volume of the tank (accounting for the top water level)
14. Click **Create**.
15. Update the gateway if directed to do so, by clicking the **Update Gateway** button.
16. Return to the top level and display the dashboard to start displaying water levels.

Once the ITU is installed it will direct readings to the gateway and these are displayed automatically on the dashboard in IMS.

## Water level meter: change settings with Workbench

The application can be installed onto a Microsoft Windows compatible pc running Windows 7 or later. Ensure that Microsoft .NET framework V4.0 or later is installed before installing the software. Version 2.07 or later is required. See [QTech Workbench](https://help.qtech.co.nz/qtech/qtech-workbench.md).

1. Note. The first time you connect you must wait for the USB drivers to install
2. Make sure the ITU is power up, connect one end of the USB cable to the ITU
3. Press the **MODE** switch until the yellow **STAT** led changes to a fast flashing mode
4. Plug the USB cable into the laptop
5. Click the **Connect** button in the Workbench application
6. The device will be discovered and appears as a Wireless RTU operating in Irrigation Telemetry Unit mode.
7. The current settings are read from the device.
8. If the unit fails to connect unplug and replug the USB cable (make sure that the USB drivers have finished installing), then click **Connect** again. Otherwise repower the ITU and start again.
9. Make the required changes
10. When done click **Write to device** to update the ITU
11. Important: the USB connection can supply enough power to operate the ITU. In order for the settings to take effect you should unplug the USB cable from the laptop then cycle the power on the ITU by removing and reinserting its power connector.

The Gateway radio channel must match the Qtech radio channel in the ITU. Ascertain the radio channel number for the gateway by contacting Qtech support, if necessary or inspect the labels attached to the gateway device itself. Select the **Wireless** category in the left hand pane of Workbench then change the **QTech Radio Channel** to match the gateway Channel. Click **Write to device** when done.

The Advanced radio settings for the device can only be modified by QTech technicians. This section is provided for instances where a) the radio transmission from the ITU to the gateway is suffering from irregular or sporadic drop out and b) if the water levels are inaccurate requiring the ITU output to be rescaled.

| Setting            | Where    | Notes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Reporting interval | Advanced | The default reporting interval is set to 15 minutes between each sampling and transmission of the water level. This can be adjusted to more or less frequently. Note that increasing the frequency of transmission can result in excessive battery drain.                                                                                                                                                                                                                                                                                                           |
| Spreading factor   | Advanced | If the device is situated in difficult terrain where line of sight operation is not feasible then the range of the radio can sometimes be extended to circumvent communication reliability issues. The spreading factor is set to 7 by default. However, by setting the spreading factor to 10, the over the air data rate is lowered, sometimes enabling a greater transmission range. Note that the gateway spreading factor must be changed to match the spreading factor in the ITU. This change should only be made under consultation with QTech technicians. |
| Scaling            | Advanced | The probe scaling factors are predefined so that the output reading from the ITU is a millimetric value of the probe depth. Other options are available as follows:                                                                                                                                                                                                                                                                                                                                                                                                 |

| Raw min | Raw max | Scaled min | Scaled max | Use                                                                                            |
| ------- | ------- | ---------- | ---------- | ---------------------------------------------------------------------------------------------- |
| 199     | 1803    | 0          | 3000       | 3.0m probe output in mm (default)                                                              |
| 200     | 1800    | 0          | 4500       | 4.5m probe output in mm                                                                        |
| 0       | 4095    | 0          | 4095       | Output the ADC count from the analogue to Digital Converter                                    |
| 0       | 4095    | 0          | 1000       | Output the measurement as a scalar percentage of full scale (1000 equals an ADC count of 4095) |

The **Overview** category displays the current firmware version and product identifier. The **Wireless** category also shows the device Serial number. If you require service from QTech please record and supply the serial number and firmware version.

### Update the water level meter's firmware

From time to time the firmware in the ITU may need to be upgraded.

1. Disconnect the USB cable if connected. And remove the power connector
2. Press and hold the **MODE** pushbutton on the device circuit board
3. Insert the USB cable
4. Release the mode button when the **STAT** led on the circuit board is illuminated
5. Ignore the auto-play dialogue box if it appears on the PC screen
6. Press the **Start** button in Workbench (**Firmware Upgrade** form)
7. Browse and select the new firmware file. Opening the file will commence the upgrade process.
8. On completion eject the device (this can happen automatically but if not select the drive using Windows Explorer, right click and choose eject from the pop-up menu.
9. Remove the USB cable
10. Reconnect the power

## INC-connected ITUs: the podlist entry

The ITU is configured into the INC pod-list via the pod configuration file, similar to a regular IPC. Naturally the schedule field does not need to be included for this device. The INC knows that the device is an ITU by the presence a "type = x" line. The INC treats ITUs differently from regular IPCs and repeaters, in that there is a separate task that sends logging data requests to ITUs, and the communications messages are different. The device type defaults to "IPC" if it is not explicitly specified in the file. This means that configuration file entries for existing IPCs won't need to be changed. The type value can be one of "Logger" or "Flow" for an ITU1, or "Level" for an ITU2.

An example entry (example values):

```
[pod1]
address = 00:00:00:00:00:03
channel = 3
name = F1
serial = 1003
mode = local
type = flow
```

It is important to read the address and keep a record of it, as this value is used by the INC and EP3 to communicate with the particular device.

## INC-connected ITUs: settings

Various categories of configuration data can be read and written to/from the device EEPROM using an EP2 and terminal application (eg PuTTY). The serial port settings to use for this connection are 115200, n, 8, 1.

WARNING: DO NOT ATTEMPT TO USE THE DEBUG INTERFACE UNLESS INSTRUCTED TO BY QTECH, INCORRECT USE MAY RESULT IN OPERATIONAL FAILURE OF THE INC AND CONNECTED DEVICES.

| Setting    | Range                                                      | What it does                                                                                                               |
| ---------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `interval` | Number: 2, 65535                                           | Logging interval in seconds.                                                                                               |
| `deadband` | Number: 1, 4095                                            | Logging deadband in raw counts. To ignore deadband logging set the deadband to the maximum value (4095)                    |
| `channel`  | Number: 0, 25                                              | Radio channel to use.                                                                                                      |
| `power`    | Number: 0, 7                                               | Radio Transmitter Power. Typically 7                                                                                       |
| `serial`   | Number: 0, 65535                                           | Device Serial Number.                                                                                                      |
| `scaling`  | 4 x Numbers: a,b,c,d                                       | Measurement scaling parameters with no spaces (raw\_min,raw\_max,scaled\_min,scaled\_max).                                 |
| `itu_mode` | `flow`, `level_ultrasonic`, `flow_pulse`, `level_pressure` | ITU operating mode (must match hardware setup).                                                                            |
| `vol_pp`   | Number                                                     | Volume per pulse typically 10 litres per pulse or 100 litres per pulse                                                     |
| `win_len`  | Number                                                     | Number of pulses over which to calculate the average volume                                                                |
| `max_freq` | Number (Hz)                                                | Safety Threshold. Pulses collected at greater than this frequency will be discarded as suspected glitches or noise. 255 Hz |

The general command format is detailed in the table below.

| Command                  | Meaning                                                                                                                                                     |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `get all`                | Print a list of all configuration values to the terminal.                                                                                                   |
| `get <category>`         | Print a specific configuration or constant value to the terminal.                                                                                           |
| `set <category> <value>` | Write a specific configuration value to EEPROM.                                                                                                             |
| `reload`                 | Restart and processes that use configuration values. This makes the device begin to use the updated values. Alternatively the device can just be repowered. |

The categories `version` (`<major>.<minor>.<build>`, Device Firmware version) and `address` (MAC: xx:xx:xx:xx:xx:xx, The MAC address of the Flow-Logger) are read only.

The INC has a set of commands to make it communicate with a Flow-Logger. Most comms with the flow logger can be sent via Local or Mesh comms methods, but for brevity, only the Local (-l) switch option is shown below.

| Command                                             | Meaning                                                                                                                                                    |
| --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `telem -l <name> config`                            | Request device configuration values.                                                                                                                       |
| `telem –l <name> config write <category> <value>`   | Change device configuration. Values can be read, but aren't used until reloaded.                                                                           |
| `telem -l/m <Devicename> config <category> <value>` | Writes a Device configuration parameter (per the categories in the table above) with a value which must be valid for that parameter for it to be accepted. |
| `telem –l <name> config reload`                     | Force the ITU to begin using the config values.                                                                                                            |
| `telem -l <name> status`                            | Request the ITU internal status. This include the time value, and number of pending data records.                                                          |
| `telem -l <name> poll`                              | Request device IO values (ITU1 only).                                                                                                                      |

For solar panel operation of the ITU2 beware that excessive polling of the device will discharge the battery faster than it can be charged via solar energy. 60 minute intervals are recommended and 15 minute is recommended as the absolute minimum interval.

## Firmware for INC-connected ITUs

In application firmware version 1.5 the ITU was modified to include a bootloader to allow support for OTA firmware upgrade. As part of the factory run-up process, the bootloader is flashed into the ITU board via the ISP port. The Application firmware can then be flashed into the board using an EP3 in the same way as for an IPC. The ITU does not have a reed switch, so must be in the IPC list for this to work as the only way that the ITU can be triggered into bootloader active mode is via an OTA command. Consequentially, if the Application firmware upgrade fails the ITU will remain in bootloader active state (where it will blink an error code explaining why it is not able to boot the application).
