SharKNX reaches your KNX installation through a KNX IP interface or router on your network. This guide shows how to find a gateway and connect to it, save it for next time, and add one by hand. It also covers how to choose between UDP and TCP tunneling, and how to use multicast routing.
Everything here happens on the Connect page - the first tab in the bottom navigation bar.
Option A - Scan and connect
The quickest way on a local network.
Open the Connect page and its Discover tab.
Tap the scan button. SharKNX searches the network and lists every KNX IP interface and router that answers.
Each gateway card shows its name, IP address, and what it supports:
Chip Meaning Tunneling You can connect to it with a tunnel Version 2 It also supports tunneling over TCP (KNXnet/IP Tunneling v2) Routing It is a router that can also carry multicast routing IP Secure It requires KNX IP Secure - see Set Up KNX IP Secure 2/4 available Free tunnel slots out of the total, when the gateway reports them Tap Select on the gateway you want. SharKNX selects it and connects straight away.
The gateway then appears under Last used gateway at the top of the page. On your next visit, tap it to reselect it without scanning, or tap Forget to clear it.
Save it for next time: tap Save on the card to keep the gateway on the Config tab. Saving a Version 2 gateway also switches it to the Auto connection mode, so it uses TCP when it can - see UDP or TCP?.
Option B - Add a gateway manually
Use this when the gateway cannot be discovered - it is on another subnet, behind a VPN, or reached over the internet.
On the Connect page, open the Config tab and tap +.
Fill in the form:
Field Description Friendly Name A label for the list, e.g. Living Room Gateway IP Address or Hostname An IPv4 address, or a hostname such as myhome.dyndns.orgPort Usually 3671KNX Address The interface's individual address. Needed for KNX IP Secure, so SharKNX can find its credentials in the keyring NAT Mode Turn on when a router between you and the gateway translates addresses, e.g. remote access over the internet KNX IP Secure Turn on if the gateway requires a secure tunnel Connection Mode UDP, Auto, or TCP - see below Tap Save. The gateway appears on the Config tab.
Tap Select on it to connect.
Saved gateways can be changed with Edit or deleted with Remove. The Config tab holds up to 50 gateways.
UDP or TCP?
Classic KNXnet/IP tunneling runs over UDP. Newer interfaces that show the Version 2 chip also accept tunneling over TCP, and SharKNX supports both:
| Mode | What SharKNX does | Use it when |
|---|---|---|
| UDP | Plain UDP tunneling | The gateway only supports classic tunneling. This is also what a discovered gateway uses until you save it. |
| Auto | Tries TCP first, falls back to UDP if TCP cannot connect | You are not sure, or the gateway supports Version 2. The default when you save a Version 2 gateway. |
| TCP | Always TCP, never falls back | You know the gateway supports it and want TCP every time |
Why TCP? TCP delivers every frame in order and retransmits lost packets itself. That makes tunnels noticeably more stable on busy Wi-Fi, over VPNs, and across the internet, where UDP packets are easily lost or delayed and a tunnel may drop.
KNX IP Secure tunnels always use TCP, whatever the connection mode says - see KNX IP Secure.
Option C - Multicast routing
If your installation has KNX IP routers, SharKNX can join the routing multicast group instead of opening a tunnel to one device.
- On the Discover tab, the multicast options appear once a router with routing capability is found. To always show them, turn on Always show multicast options in Discover Settings.
- Tap Select on the multicast option. SharKNX uses the multicast address and port from Discover Settings - by default
224.0.23.12and3671. - For secure routing, choose the secure multicast option. It shows Ready when a backbone key is loaded and No backbone key otherwise - see Set Up KNX IP Secure.
Connecting from other pages
You don't have to visit the Connect page first. When you start the monitor, run a Shark Hunt, or use a device tool without a connection, SharKNX shows a gateway picker listing your saved gateways, discovered gateways, and multicast options - pick one and carry on.
Troubleshooting
| Symptom | What to check |
|---|---|
| No gateways found | Your device and the gateway may be on different subnets, or the Wi-Fi drops multicast. Enable Force Unicast Subnet Scan in Discover Settings, or add the gateway manually. |
| Connection times out | Wrong IP address or port, or all tunnel slots are in use - check the available chip, or close other clients (ETS, visualisations) connected to the gateway. |
| Tunnel keeps dropping on Wi-Fi or VPN | Switch the saved gateway to Auto or TCP if it shows the Version 2 chip. |
| TCP mode fails to connect | The gateway does not support TCP tunneling. Use Auto or UDP. |
| Remote connection fails, local works | Turn on NAT Mode for that gateway. |
| Secure gateway will not connect | Credentials missing or wrong - see Set Up KNX IP Secure. |
Related
- KNX IP Secure - how secure tunneling and routing work
- Discover Settings - multicast address, timeouts, and unicast scanning