{"id":5328,"date":"2018-04-09T22:42:04","date_gmt":"2018-04-09T20:42:04","guid":{"rendered":"https:\/\/michlstechblog.info\/blog\/?p=5328"},"modified":"2020-07-15T14:52:49","modified_gmt":"2020-07-15T12:52:49","slug":"eib-knx-knxnet-ip-gateway-with-calimero-server-on-raspberry-pi-orange-pi-pc","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/eib-knx-knxnet-ip-gateway-with-calimero-server-on-raspberry-pi-orange-pi-pc\/","title":{"rendered":"EIB\/KNX: KNXNet\/IP Gateway with calimero server on Raspberry Pi\/Orange Pi PC"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_5328 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_5328')){$('.twoclick_social_bookmarks_post_5328').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"EIB%2FKNX%3A%20KNXNet%2FIP%20Gateway%20with%20calimero%20server%20on%20Raspberry%20Pi%2FOrange%20Pi%20PC\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0Aas%20an%20alternative%20to%20knxd%20the%20calimero%20project%20also%20supplies%20an%20KNXnet%2FIP%20server.%0D%0A%0D%0A%20%28more%26hellip%3B%29\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/eib-knx-knxnet-ip-gateway-with-calimero-server-on-raspberry-pi-orange-pi-pc\\\/\",\"post_id\":5328,\"post_title_referrer_track\":\"EIB%2FKNX%3A+KNXNet%2FIP+Gateway+with+calimero+server+on+Raspberry+Pi%2FOrange+Pi+PC\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>as an alternative to knxd the calimero project also supplies an KNXnet\/IP server.<\/p>\n<p><!--more--><br \/>\nThe calimero server is based on Java so you have to ensure that the device which should host the server has enough CPU\/RAM. A Raspberry Pi or Orange Pi PC should be sufficient.<\/p>\n<p>I&#8217;ve written a script which do all necessary tasks to get the server running.<\/p>\n<p>The requirements:<\/p>\n<ul>\n<li>A running Debian 10 installed, i.e. raspbian (Raspberry Pi) or armbian (Orange Pi),<\/li>\n<li>A TPUART modul as descripted <a href=\"https:\/\/michlstechblog.info\/blog\/raspberry-pi-eibknx-ip-gateway-or-router-with-the-pi\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a> is connected. <a href=\"https:\/\/michlstechblog.info\/blog\/download\/electronic\/Raspberry-eibd.zip\" target=\"_blank\" rel=\"noopener noreferrer\">PCB and schematic<\/a>\n<figure id=\"attachment_1783\" aria-describedby=\"caption-attachment-1783\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2014\/02\/raspberry-knx.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-1783\" src=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2014\/02\/raspberry-knx-300x176.png\" alt=\"Raspberry KNX IP Gateway\/Router\" width=\"300\" height=\"176\" srcset=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2014\/02\/raspberry-knx-300x176.png 300w, https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2014\/02\/raspberry-knx.png 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1783\" class=\"wp-caption-text\">Raspberry KNX IP Gateway\/Router<\/figcaption><\/figure>\n<p><figure id=\"attachment_1767\" aria-describedby=\"caption-attachment-1767\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2014\/02\/raspberry-knx-board-schematic.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-1767\" src=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2014\/02\/raspberry-knx-board-schematic-300x70.png\" alt=\"Raspberry Pi KNX Board Schematic\" width=\"300\" height=\"70\" srcset=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2014\/02\/raspberry-knx-board-schematic-300x70.png 300w, https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2014\/02\/raspberry-knx-board-schematic.png 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1767\" class=\"wp-caption-text\">Raspberry Pi KNX Board Schematic<\/figcaption><\/figure><\/li>\n<li>You can also use KNX USB devices or an IP Tunnel connection but I have not tested it yet. Any experiences or feedback are welcome.<\/li>\n<\/ul>\n<p>What the script does:<\/p>\n<ul>\n<li>Recognition on which platform the script runs<\/li>\n<li>Setup the serial device depending on the platform<\/li>\n<li>Gets all sources for <a href=\"http:\/\/calimero-project.github.io\/\" target=\"_blank\" rel=\"noopener noreferrer\">calimero<\/a> <a href=\"https:\/\/github.com\/calimero-project\/calimero-server\" target=\"_blank\" rel=\"noopener noreferrer\">server<\/a> and &#8211;<a href=\"https:\/\/github.com\/calimero-project\/calimero-tools\" target=\"_blank\" rel=\"noopener noreferrer\">tools<\/a> from <a href=\"https:\/\/github.com\/calimero-project\" target=\"_blank\" rel=\"noopener noreferrer\">github<\/a><\/li>\n<li>Complies all sources<\/li>\n<li>Patches calimero server to run in background(detached stdin)<\/li>\n<li>Installs binaries to \/opt\/calimero-server<\/li>\n<li>Moves\/installs config files to \/etc\/calimero<\/li>\n<li>Alters config to use a TPUART Module<\/li>\n<li>Adds 8 KNX Client Addresses<\/li>\n<li>Sets the Servername<\/li>\n<li>Creates a user and group knx under which the server runs<\/li>\n<li>Adds a systemd service knx.service<\/li>\n<li>Installs calimero tools and a wrapper script <strong>knxtools <\/strong>to \/usr\/local\/bin<\/li>\n<li>New: The script can configure calimero to use a KNX USB device or a Tunnel connection<\/li>\n<\/ul>\n<p>To install calimero KNXNet\/IP server download the script. In the header adjust the variables<\/p>\n<ul>\n<li>KNX_ADDRESS<\/li>\n<li>KNX_CLIENT_ADDRESS_START<\/li>\n<li>LISTEN_NETWORK_INTERFACE<\/li>\n<li>KNX_SERVER_NAME<\/li>\n<li>&#8230;.<\/li>\n<\/ul>\n<p>to your needs and run it as root. It can configure calimero server for using TPUART- or KNX USB device and for establish a Tunnel connection. To use a TPUART Module start the script without a parameter<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmichael@debdev ~ # sudo su -\r\nroot@debdev ~ # wget https:\/\/michlstechblog.info\/blog\/download\/shell_scripts\/calimero_2.sh\r\nroot@debdev ~ # bash calimero_2.sh\r\n<\/pre>\n<p>For the use of the first found USB Device:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@debdev ~ # bash calimero_2.sh usb\r\n<\/pre>\n<p>To establish a tunnel connection to 192.168.56.200 start it with:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@debdev ~ # bash calimero_2.sh tunnel 192.168.56.200\r\n<\/pre>\n<p>After script has finshed. Reboot your device. The calimero server starts automatically at boot.<\/p>\n<p>The location of the config file is <strong>\/etc\/calimero\/server-config.xml<\/strong><\/p>\n<figure id=\"attachment_5383\" aria-describedby=\"caption-attachment-5383\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/04\/OrangePiPC.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5383\" src=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/04\/OrangePiPC-300x185.png\" alt=\"OrangePi PC with TPUART\" width=\"300\" height=\"185\" srcset=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/04\/OrangePiPC-300x185.png 300w, https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/04\/OrangePiPC-768x473.png 768w, https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/04\/OrangePiPC-1024x630.png 1024w, https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2018\/04\/OrangePiPC.png 1400w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-5383\" class=\"wp-caption-text\">OrangePi PC with TPUART<\/figcaption><\/figure>\n<p>Some basic checks after reboot<br \/>\nCheck if the java process is running<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@debdev ~ # ps ax|grep tuwien.auto.calimero.server.Launcher\r\n 429 ? Ssl 0:04 \/usr\/bin\/java -cp \/opt\/calimero-server\/* tuwien..........\r\n<\/pre>\n<p>Check systemd log<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@debdev ~ # journalctl -xu knx\r\njava&#x5B;429]: 19:02:45:852 WARN calimero.server - network interface eth0 not found, using system default\r\njava&#x5B;429]: 19:02:47:090 INFO calimero.server - KNXnet\/IP discovery network interfaces: listen on &#x5B;all], send on &#x5B;all]\r\njava&#x5B;429]: 19:02:47:127 INFO calimero.server - Service container '\/dev\/ttyS0':\r\njava&#x5B;429]:         listen on any, KNXnet\/IP routing multicast group 224.0.23.12\r\njava&#x5B;429]:         tpuart connection: TP1 medium, device 3.1.0\r\njava&#x5B;429]:         Group address filter &#x5B;]\r\njava&#x5B;429]: 19:02:47:178 INFO calimero.server - connect to \/dev\/ttyS0\r\njava&#x5B;429]: 19:02:47:378 INFO calimero.serial.tpuart:\/dev\/ttyS0 - setup serial port: baudrate 19200, even parity, 8 databits, 1 stopbits, timeou\r\njava&#x5B;429]: 19:02:47:393 INFO calimero.link.tpuart:\/dev\/ttyS0 - hop count set to 6\r\njava&#x5B;429]: 19:02:47:579 INFO calimero.server.gateway.knx-server - main-line group address forward setting set to 1\r\njava&#x5B;429]: 19:02:47:581 INFO calimero.server.gateway.knx-server - sub-line group address forward setting set to 1\r\njava&#x5B;429]: type 'stop' to stop the gateway and shutdown the server\r\njava&#x5B;429]: Detached from STDIN. Running in daemon mode\r\njava&#x5B;429]: 19:02:47:587 INFO calimero.server.knx-server - launch KNXnet\/IP server 'Calimero KNXnet\/IP Server'\r\njava&#x5B;429]: 19:02:47:724 INFO calimero.knxnetip.KNXnet\/IP routing service 224.0.23.12 - multicast loopback mode enabled\r\njava&#x5B;429]: 19:02:47:726 INFO calimero.server.knx-server - KNXnet\/IP discovery listens on interface enp0s8\r\njava&#x5B;429]: 19:02:47:739 INFO calimero.server.knx-server - KNXnet\/IP discovery listens on interface enp0s3\r\njava&#x5B;429]: 19:02:47:739 INFO calimero.server.knx-server - KNXnet\/IP discovery listens on interface lo\r\n<\/pre>\n<p>Check if the KNXnet\/IP gateway is found.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@debdev :~# knxtools discover\r\nUsing \/127.0.0.1 at lo\r\n----------------------\r\nControl endpoint 192.168.200.1:3671 (IPv4 UDP) &quot;Calimero KNXnet\/IP Server&quot;\r\nKNX address 1.1.150\r\nKNX medium TP1\r\nInstallation 0 - Project 0 (ID 0)\r\nKNX IP multicast address 0.0.0.0\r\nMAC address 8a:e4:30:04:f1:81\r\nS\/N 0x000000000000\r\nSupported services: Core (v1), Device Management (v1), Tunneling (v1)\r\n\r\nUsing \/172.16.1.200 at eth0\r\n---------------------------\r\nControl endpoint 192.168.200.1:3671 (IPv4 UDP) &quot;Calimero KNXnet\/IP Server&quot;\r\nKNX address 1.1.150\r\nKNX medium TP1\r\nInstallation 0 - Project 0 (ID 0)\r\nKNX IP multicast address 0.0.0.0\r\nMAC address 8a:e4:30:04:f1:81\r\nS\/N 0x000000000000\r\nSupported services: Core (v1), Device Management (v1), Tunneling (v1)\r\n\r\n<\/pre>\n<p>Check if groupmonitor can connect and see packets on the bus.\u00a0 Replace 192.168.200.1 with the IP Address of your calimero server.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@debdev :~# knxtools groupmon -m knxip 192.168.200.1\r\n19:26:50:994 INFO calimero.knxnetip.KNXnet\/IP Tunneling 192.168.200.1:3671 - establish connection from \/127.0.0.1:58235 to \/192.168.200.1:3671\r\n19:26:51:123 INFO calimero.knxnetip.KNXnet\/IP Tunneling 192.168.200.1:3671 - connection established (channel 1)\r\n19:26:51:132 INFO calimero.knxnetip.KNXnet\/IP DevMgmt 192.168.200.1:3671 - establish connection from \/127.0.0.1:58045 to \/192.168.200.1:3671\r\n19:26:51:137 INFO calimero.knxnetip.KNXnet\/IP DevMgmt 192.168.200.1:3671 - connection established (channel 2)\r\n19:27:03.600 0.0.1-&gt;5\/3\/1 A_Group.write 00: 0 counter pulses &#x5B;5.010], 0 % &#x5B;6.001], 0 &#x5B;17.001], activate 0 &#x5B;18.001], inactive (no message sent) &#x5B;20.606], &#x5B;21.106], &#x5B;28.001]\r\n19:27:03.745 1.1.59-&gt;2\/2\/26 A_Group.write 0c 7c: 31960 ms &#x5B;7.003], 22.96 mV &#x5B;9.020]\r\n<\/pre>\n<p>Script is also available at <a href=\"https:\/\/github.com\/Race666\/calimero-server\" target=\"_blank\" rel=\"noopener noreferrer\">github<\/a>. Any feedback is welcome. If you have improvments feel free to send a pull request.<\/p>\n<p>Michael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, as an alternative to knxd the calimero project also supplies an KNXnet\/IP server.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1109,330],"tags":[1164,342,331,453,182,341,864,1163,1105,863,454,551,640,455,1165],"class_list":["post-5328","post","type-post","status-publish","format-standard","hentry","category-orange-pi","category-raspberry-pi","tag-calimero","tag-eib","tag-eibd","tag-gateway","tag-ip","tag-knx","tag-knxd","tag-knxnet","tag-orange-pi","tag-raspberry-pi","tag-router","tag-routing","tag-server","tag-tunnel","tag-tunneling"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=5328"}],"version-history":[{"count":42,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5328\/revisions"}],"predecessor-version":[{"id":7144,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5328\/revisions\/7144"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=5328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=5328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=5328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}