> 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/update-firmware/upgrade-to-v7-18.md).

# Upgrade to V7.18

Upgrade from V7.17 or older to V7.18, which needs bootloader V3.04 and a new data log database.

The installer must upgrade both the bootloader software on the RTU and the application software when upgrading to V7.18. When the Bootloader is installed it will destroy the old Datalog Database (V2) and it will overwrite the RTU configuration. But it will retain the calibration settings and the license keys for running the application.

{% hint style="info" %}
**Applies to:** XL4 Plus RTUs on V7.17 or older. QTech Workbench V2.15 is recommended. For RTUs running V7.18 or later the maximum number of points that can be logged is 255. DATRAN itself must be running V6.78 or later to accomplish this.
{% endhint %}

{% hint style="warning" %}
The RTU Bootloader firmware must be upgraded to V3.04 **before** upgrading the application firmware to V7.18.
{% endhint %}

## What changes

Older RTU firmware versions (V7.17 and older) use database version V2, which stores up to about 64,000 data records (0.5 MB) in the onboard flash memory chip on the RTU. V7.18 introduces a new version of the Datalog Database (V3), used for logging point data in the RTU for use by DATRAN.

* The capacity of the log has been increased to 1.5 MB or 5.5 MB depending on the memory chip fitted to the board, at least a threefold increase in logging capacity.
* More data points can be logged (up from 35 to 255 points).
* Faster retrieval of log records back to DATRAN.
* More accurate timestamped data down to one second logging intervals.
* The Database can be uploaded (copied) to a USB memory drive or to QTech Workbench over a serial USB connection.

For the full list of changes, see [Release notes](https://help.qtech.co.nz/datran/datran-telemetry/datran-xl4-plus-rtu/release-notes.md).

## Before you start

1. **Collect the log.** Retrieve any outstanding logged data from the RTU to DATRAN via DATRAN Browser if you are a qualified DATRAN Operator. Or in emergency manually retrieve the log using Workbench: see [Recover logged data manually](https://help.qtech.co.nz/datran/datran-telemetry/datran-xl4-plus-rtu/data-logging/recover-logged-data.md).
2. **Save the configuration.** Save the RTU configuration to a file (via Workbench) (**File > Save**) so that it can be reloaded to the RTU after the upgrade is complete.
3. Have ready: QTech Workbench installed on a Windows 10 (or 11) machine, a USB Type A -B cable, the bootloader file (.hex), and a USB drive with the V7.18 application files (.elf and .md5).

## Upgrade

1. Install bootloader V3.04 with Workbench and the ISP jumpers. See [Update the firmware](https://help.qtech.co.nz/datran/datran-telemetry/datran-xl4-plus-rtu/update-firmware.md).
2. Once the Bootloader is programmed it looks for the application software and will find it has been erased as part of the upgrade. This is indicated by Error Flash Code 2 (2 quick flashes on the error led) to show that the application is missing. At this point it is safe to turn off the RTU (remove power) and continue with programming the application.
3. Remove the ISP jumpers.
4. Insert a USB drive in the RTU containing the application file and MD5 application signature file and power on the RTU, which will detect the application and upgrade the firmware to V7.18. When that is complete the OK led starts its characteristic fade on and off to show that the application is running.
5. Remove the USB drive.

{% hint style="info" %}
It is important to not interrupt the power to the RTU during the programming part of the bootloader or the application until the procedure says you should, though in most cases the process can be restarted if this happens but there is a risk of failure if the RTU is powered down or rebooted while this copy is in progress:

* before modifying anything, the bootloader scans the (legacy V2) file system and builds up a buffer of what it's going to copy. Loss of power during this period has no impact (no writes have been performed) and it will just start the process again when re-powered.
* once that scan is complete and the buffer is ready, it writes out the license and calibration factors in the new format. This part is a destructive update and there is a risk of the backups being lost here. They are small files, so the time window to lose power while writing these out is small (< 100ms)
* even if these backups are lost it's unlikely to cause a problem because they're only backups of data stored in NVRAM and if they're not found when the new application firmware starts up they're recreated from NVRAM
  {% endhint %}

## After the upgrade

Connect Workbench and:

1. Configure the RTU or reinstate it by reloading a previously saved config file (**File > Open**, then **Write to Device**).
2. Check that the RTU serial number and licencing is all in order. If it has been lost for some reason then it can sometimes be recovered using QTech Workbench licence recovery: see [The error light flashes fast, or the serial number shows ?????](https://help.qtech.co.nz/datran/datran-telemetry/datran-xl4-plus-rtu/troubleshooting/licence-or-serial-number-lost.md).
3. Click the **Data Logging** sidebar menu option in Workbench. The new V3 version of the database displays statistics about the data log but it will show the amount of capacity based on the chip size in the **Database Capacity** statistic.
4. If the RTU is reconnected to DATRAN and the logging configuration set (from the HDI Historical Data Interface) then the Data logging category statistics will be periodically updated to show that logging is occurring.
5. Other useful statistics to check are **Newest record time** (to show that logging is occurring based on the expected intervals (often 1 minute)) and **Estimated time to overwrite**.

It is not necessary to reformat the log after upgrade but Workbench has a feature to enable the Database to be erased and reformatted. All log data will be lost in the process so proceed with caution.

If you are planning on logging more data using V7.18 than previously, consider using the QTech XL4 Plus Database Capacity Estimator (available on request). See [Data logging and the archive log](https://help.qtech.co.nz/datran/datran-telemetry/datran-xl4-plus-rtu/data-logging.md).
