> 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/ims-and-gateways/ims-gateway/ims-gateway-network-equipment.md).

# Network equipment for the IMS Gateway

For installers. Set up a Teltonika RUT240 cellular modem/router, or a pair of TP-Link CPE220 outdoor Wi-Fi units, to give the IMS Gateway its internet connection.

{% hint style="info" %}
**Applies to:** an [IMS Gateway](https://help.qtech.co.nz/water-insight/ims-and-gateways/ims-gateway.md). From application notes AN25 (Teltonika RUT240/241/202 Modem Router Configuration, Rev 01) and AN24 (Setup Guide for TP-Link CPE220 Outdoor CPE, Rev 01). AN24 was written for IMS hardware (NUC) devices.
{% endhint %}

## Which one do I need?

| Your site                                                      | Device                                                                                                                                                                                                                |
| -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Ethernet cable plugged directly into the existing modem/router | This always gives the most reliable and easy to diagnose connection. Connection via LAN cable or WiFi to the farm network. See [IMS Gateway](https://help.qtech.co.nz/water-insight/ims-and-gateways/ims-gateway.md). |
| Cellular Data Connection                                       | An optional RUT240 (Application Note AN25) device can be used if there is a strong cellular signal where the IMS gateway will be installed.                                                                           |
| Wi-Fi Point to Point Link                                      | Using a pair of low-cost Wi-Fi Point to Point link modules such as the TP-Link CPE modules, creates an access point at the remote farm building from your existing internet connection.                               |

## Teltonika RUT240 cellular modem/router

The RUT240/241/202 can be used for cellular internet connections (especially in rural areas) for Water-Insight IMS installations. The RUT240 covers the NZ 4G frequencies of all providers, including the 700MHz 4G frequency which is commonly used in rural areas.

### Log in and change the administrator password

1. Connect via LAN to the device.
2. Open a browser and connect to <http://192.168.1.1> (the default IP address of the device).
3. Log in with the username **admin** and the password printed on the back of the modem.
4. Go to **System** > **Administration** > **General**.
5. Change the administrator password.

### Update the firmware

It is a good idea to upgrade to the latest firmware. The firmware upgrade can be sourced from the Teltonika server or from an image uploaded from your computer.

**RUT240 accesses new firmware from Teltonika server**

1. Login to RUT240 web UI. Open a browser and connect to <http://192.168.1.1>
2. Select **System** > **Firmware**.
3. Select **Check for new FW** to see if there is an update available.

![The RUT240 Firmware page, with Check for new FW under Firmware Available On Server](https://3621580088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa5hMAUl7E1cWeN5Rghg0%2Fuploads%2FwbihMF5uJ9RB3euUVlp0%2Frut240-firmware-check-server.png?alt=media)

**Manually download firmware and upload to RUT240**

1. Download the latest firmware version <https://wiki.teltonika-networks.com/view/RUT240_Firmware_Downloads>
2. Login to RUT240 web UI. Open a browser and connect to <http://192.168.1.1>
3. Select **System** > **Firmware**.
4. Check **Keep all settings**.
5. Select **Upgrade from File**, choose the file, and select **Upgrade**.
6. Expect a firmware verification success message, then select **Upgrade**.

![The RUT240 Firmware page set to Upgrade from file, with Keep all settings ticked](https://3621580088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa5hMAUl7E1cWeN5Rghg0%2Fuploads%2Fpd1BL6uaXgXCt0eSebFQ%2Frut240-firmware-upgrade-from-file.png?alt=media)

### Set the time zone

1. Go to **System** > **Administration** > **Date/Time**.
2. Select **Pacific/Auckland**.
3. Select **Save & Apply**.

### Check the plan allows tethering

When a RUT is connected to the IMSG it is recognised as being tethered. This is important as a number of standard phone plans do not allow tethering or hotspotting and the connection to IMS will not succeed. We recommend choosing only mobile plans that allow Hotspotting or is enabled as an added extra.

### Set a data limit warning

The modem has a feature that allows a daily, weekly or monthly data limit to be applied and can send a txt message when the limit is exceeded. However, this feature is not cumulative, i.e monthly data consumption is reset every month, whereas prepay systems limit the overall data to a maximum amount irrespective of the period. Therefore, this feature is good for SIMs on a monthly plan but not prepay.

This feature could be used to provide a notification if the average monthly use is exceeded. The average monthly use would first need to be estimated based on review of actual use. Configuration: **Network** > **Mobile** > **Mobile data limit**.

Spark and Vodafone offer apps and web interfaces for account holders to obtain balance information of sims.

### Check the modem is working

Text the word "status" (without the quotes) to the modem's phone number. You will receive a status report in reply.

Do this if you don't know the SIM phone number:

1. Connect via LAN to the device.
2. Open a browser and connect to <http://192.168.1.1> (the default IP address of the device) and log in.
3. Send a sample txt message to your phone to verify its working (**Services** > **SMS Utilities** > **SMS Management** > **Send SMS**).
4. Send a status request via sms to the device using the modem's phone number (txt status to phone number).

## TP-Link CPE220 outdoor Wi-Fi units

The CPE220 provides point to point IP (WiFi) connections over 2.4 GHz radio, providing a number of configuration options to extend internet connections to IMS hardware (NUC) devices that may be installed in pump sheds or in locations remote to the internet router on a farm.

Additional documentation includes: the Installation Guide, the Pharos User Guide, and the [web site](https://www.tp-link.com/au/download/CPE220.html). The web site holds links to the latest document versions.

### Before you start

* The devices are mounted in pairs: one at the router end of the link and one at the remote NUC end of the link. The local end is configured as an **access point** and the remote end is configured as a **client**.
* When assigning static IP addresses it will pay to use IP address spaces that have been reserved by the router for use without DHCP control. If you assign IP addresses in the same space as can be allocated by the routers DHCP server then IP conflicts with other devices on the LAN may occur.
* Antennas must be correctly aligned in order to achieve maximum signal to noise ratio and overall data transfer rate optimisation. This is probably a two-man job. One person must align the antenna to the corresponding device (follow the installation guide). There are signal strength indicators that can be viewed but for best results the second person should monitor the SNR and transmit CCQ settings via the web interface to the device, to maximise these values whilst the person at the antenna adjusts the pointing direction. In the absence of a CPE at the remote end, point the antenna in the direction of the remote end by eye.

### Set up the unit at the router end

1. Install the CPE at the router end.
2. If you are unsure of the CPE configuration condition follow the installation steps to restore the device to factory defaults (reset button on bottom, hold for about 8s).
3. Connect a laptop via lan cable directly to the CPE.
4. Change the adaptor settings on the laptop (IPV4) to use an IP address in the same subnet range as the default CPE e.g. 192.168.0.10 (subnet mask 255.255.255.0).
5. Open a web browser and connect to the CPE web interface (192.168.0.254).
6. Use the default login. You will be prompted to change it.
7. Use the configuration wizard to define an **access point**.
8. Set the IP address to have a static IP in the same subnet as the LAN side of the router.
9. Also note the router gateway IP address.
10. If you want you can also configure the wifi SSID, WPA password at this stage or later (step 14).
11. Logout of the CPE interface, disconnect the laptop cable and change the adaptor settings on the laptop to get an assigned IP (DHCP) from the router. Plug the laptop into the LAN and the CPE into the LAN. The router will assign an IP address to the laptop and the CPE will have a static IP on the same subnet.
12. Ping the CPE IP address from the laptop to ensure that you have a connection.
13. Open the laptop web browser and log in to the CPE web interface.
14. Complete configuration of the wireless interface if required:
    * SSID name
    * WPA password key
    * Enable **MAXtream**
    * Leave channel settings as default (for starters anyway)
    * Set the distance roughly to the remote end (tip: use google maps to get an approximate distance using pins and directions)
15. If you are planning on having one person remain at this end then go to the status page and monitor the wireless signal quality (looking for good SNR, good transmit CCQ and radio status connected stations = 1 once the remote end can connect).

### Set up the unit at the gateway end

It may be useful to do this whilst still in the vicinity of the local unit to get a connection set up before moving to the remote site and mounting the CPE.

1. Repeat steps 1 to 6 from above with the second CPE.
2. Use the configuration wizard to configure the CPE as a **client**.
3. Assign a static IP address to the CPE with the same IP address space and subnet mask.
4. Enter the wireless client settings.
5. Survey the wireless network looking for the SSID of the local unit. Lock to the AP.
6. Enter WPA details, set the distance.
7. Go to the network page and configure other LAN parameters:
   * Enter the router gateway IP address
   * Enter the primary and secondary DNS IP addresses provided by the ISP
   * Don't enable IPMG or DHCP
8. If you can connect to the local unit the local unit will report that there is one station connected.
9. If the laptop is connected to the remote unit LAN and has an IP address in the same space then change its device adaptor settings to add the router gateway address and if necessary a primary DNS server.
10. If this works you should be able to ping the router from the laptop over the wireless link. If the internet connection is good you should be able to ping google ([www.google.com](http://www.google.com)).
11. Now you will have to move to the remote end if you haven't already and mount the CPE.
12. Change the IP address of the NUC to sit on the same subnet, enter the router gateway IP address and enter the DNS server addresses. Restart the NUC.
13. Login in to the remote CPE web interface and monitor the wireless signal quality.
14. Point the antenna to maximise the SNR and CCQ values and if connected to the local CPE connected station will be 1.
15. See **The lights when it's working** in [IMS Gateway](https://help.qtech.co.nz/water-insight/ims-and-gateways/ims-gateway.md).

### If the link doesn't work

You can use tracert (open a command prompt on the NUC by pressing Windows+r then type cmd and press Enter). The first hop should be the router gateway IP address. If not then there is something wrong with the IP assignments on the NUC or the CPEs. If you get nothing beyond that the problem may lie with the DNS server addresses.

From the NUC:

1. Ping the router.
2. Ping a website by name (this will show dns is working).

## Still not working?

See [The gateway isn't online](https://help.qtech.co.nz/water-insight/ims-and-gateways/ims-gateway/gateway-offline.md). Then [contact Water-Insight](https://www.waterinsight.co.nz/contact-us/) with how the gateway connects (cellular or CPE220 link), which lights are on, and what you've tried.
