This guide will get you up and running with your first KNX IoT application! Little to no prior knowledge is needed, all that is required is to have the correct hardware, and to follow the steps of the guide exactly as described.
This guide showcases KNX IoT over Thread by enabling the two devboards to talk to each other. At the end of the guide, and following configuration with ETS or the Linker, you will be able to toggle an LED on one devboard with a button press on the other.
Here is the network topology that will be created as a result of the guide:
The KNX IoT Hub firmware is based on OpenWRT. Its purpose is to provide a link between your computer and the Thread mesh network. At the same time, if connected to the Internet it forwards said internet connection to your computer, just like a residential WiFi router would.
Please ensure you have the following hardware and software requirements before proceeding any further.
chilictl.exe
and serial-adapter.exe
.NOTE: This part of the guide will make use of the Cascoda Windows Tools that you have installed as part of the software requirements. By default, these tools are added to your PATH
, enabling their execution in a shell in any directory. However, if this did not occur, you will only be able to execute the tools from within the directory in which they are installed. The default installation directory is C:\Program Files (x86)\Cascoda Windows Tools
.
Download the latest KNX IoT Hub image and update the firmware on the hub using System -> Backup/Flash Firmware
, by following the guide on the OpenWRT wiki.
To ensure that the devboards are running the latest firmware, you will have to download the latest firmware and flash it onto both devices.
embedded_secured.zip
archive.embedded_secured/build_win_bin/bin
.chilictl list
command. PS C:\Users\Administrator> chilictl.exe list
2023-05-25 12:40:32.502 NOTE: Host Cascoda SDK v0.23-6-gefd3f47 May 22 2023
Device Found:
Device: Chili2
App: knx_iot_example_240523_e730064
Version: v0.23-6-gefd3f47
Serial No: 82830D8702A7566B
Path: \\?\hid#vid_0416&pid_5020#a&13e664b5&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Available: Yes
External Flash Chip Available: Yes
Device Found:
Device: Chili2
App: knx_iot_example_240523_e730064
Version: v0.23-6-gefd3f47
Serial No: 60F373F8446594E6
Path: \\?\hid#vid_0416&pid_5020#a&235ac66c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Available: Yes
External Flash Chip Available: Yes
Please note down the serial numbers of the two devices, in this case 82830D8702A7566B and 60F373F8446594E6.
Flash the devices one by one using the chilictl flash -f knx_iot_example_reed.bin -s <SERIAL_NUMBER>
, using the serial numbers obtained from chilictl list
. For example, here is what the result of flashing the device with serial number 82830D8702A7566B would look like:
PS C:\Users\Administrator\Downloads\embedded_secured\build_win_bin\bin> chilictl flash -f .\knx_iot_example_reed.bin -s 82830D8702A7566B
Last write time of .\knx_iot_example_reed.bin is: 07/04/2023 15:07
2023-07-05 11:49:26.584 NOTE: Host Cascoda SDK v0.24-44-g38f1b1a3 Jun 20 2023
1 devices found.
Flasher [82830D8702A7566B]: INIT -> REBOOT
Flasher [82830D8702A7566B]: REBOOT -> ERASE
Flasher [82830D8702A7566B]: ERASE -> FLASH
Flasher [82830D8702A7566B]: FLASH -> VERIFY
Flasher [82830D8702A7566B]: VERIFY -> VALIDATE
Flasher [82830D8702A7566B]: VALIDATE -> COMPLETE
Network
, and click on Thread
.Create
.Save & Apply
. (If you have some Thread knowledge, feel free to change any of the fields to your liking before saving.)Network -> Thread
!chilictl.exe list
. If an error occurs, try prepending the path, e.g.
& 'C:\Program Files (x86)\Cascoda Windows Tools\chilictl.exe' list
If that still doesn’t work, then it is likely that the Cascoda Windows Tools haven’t been installed.
PS C:\Users\Administrator> chilictl.exe list
2023-05-25 12:40:32.502 NOTE: Host Cascoda SDK v0.23-6-gefd3f47 May 22 2023
Device Found:
Device: Chili2
App: knx_iot_example_240523_e730064
Version: v0.23-6-gefd3f47
Serial No: 82830D8702A7566B
Path: \\?\hid#vid_0416&pid_5020#a&13e664b5&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Available: Yes
External Flash Chip Available: Yes
Device Found:
Device: Chili2
App: knx_iot_example_240523_e730064
Version: v0.23-6-gefd3f47
Serial No: 60F373F8446594E6
Path: \\?\hid#vid_0416&pid_5020#a&235ac66c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Available: Yes
External Flash Chip Available: Yes
knx_iot_example_ddmmyy_xxxxxxx
. Each devboard also has a unique serial number. Copy and paste both serial numbers somewhere, as you will need them later. In our example here, the serial numbers are: 82830D8702A7566B and 60F373F8446594E6.serial-adapter.exe
followed by one of the serial numbers, i.e.
PS C:\Users\Administrator> serial-adapter.exe 82830D8702A7566B
This will open up a serial communication channel with that devboard.
PS C:\Users\Administrator> serial-adapter.exe 82830D8702A7566B
2023-05-25 15:18:50.757 NOTE: Host Cascoda SDK v0.23-6-gefd3f47 May 22 2023
Rx: Trying to join Thread network...
Rx: Thread Joining Credential: YR5XH9X3, EUI64: 6a56a702870d8382
Keep this serial-adapter open for the time being.
Network -> Thread
in the hub web GUI.View
on the side of the network formed by your hub.Add
in the bottom right corner of the page. You will now see two input fields, one that says New Joiner Credential
and one that says Restrict to a Specific Joiner
.Thread Joining Credential
(in this case YR5XH9X3) and paste it into the New Joiner Credential
field, replacing the default text there. Likewise, copy the EUI64
(in this case 6a56a702870d8382) from the serial-adapter output and paste it into the Restrict to a Specific Joiner
field.Add
.Rx: === QR Code: KNX:S:00FA10010710;P:4N6AFK6T83YWDUTW23U2 ===
Network -> Thread
, click on View
, then Topology Graph
. You should see something that looks like this (NOTE: this will only work if you’ve successfully connected to the internet via the hub):As stated in the intro, this can be done via ETS or via’s Cascoda’s Linker.
If the device does not join after two minutes, you may need to restart the Border Agent. On the KNX IoT Hub UI, Please navigate to System -> Startup
, scroll down until you find otbr-agent
, then press Restart on the otbr-agent
row. Afterwards, add the devices to the Thread network once more, according to steps 7 through 12 of
A devboard can only be controlled by one Cascoda tool at any given time. This means that you will not be able to flash a device if you have serial-adapter communicating to the same device - you must close serial-adapter first. Likewise, only one serial-adapter instance can be used per device, and serial-adapter cannot be opened on a device while it is being flashed.
To see if a particular device is available, use chilictl list
and look at the “Version” field. Available devices will have a version number such as “v0.23-6-gefd3f47”, whereas unavailable devices will show “???” under the Version field.