knx
knx copied to clipboard
IP router
Hello!
is it possible to make a router between TP and IP? are there any examples?
See the *coupler examples. I didn't try them. @nanosonde is the routing expert here.
there's almost no code there :)
It is necessary to call the callback when passing telegrams and filter them when passing to another interface
there's almost no code there :)
It is necessary to call the callback when passing telegrams and filter them when passing to another interface
It is correct that the code examples do not contain any code related to routing.
The code related to routing is included in the stack itself. I have implemented the routing as described in the KNX spec. However, to really use it, you would have to create your ETS product database for a coupler. It could be done, but I did not have any further time to work on this. As soon as you would add this product database to ETS, the idea is to use this coupler like an other coupler. ETS will handle writing the filter tables, etc. This should be part of this stack already.
Concerning the coupler product database, I would recommend to look at a database of an already existing coupler. Should not be to hard to create our own one and use the CreateKNXProd tool.
It's good that the stack can do everything by itself! But with non-standard tasks, it can be difficult.
In my task, it is necessary to make a decision on filtering the telegram from my project, as well as to create a cache for group addresses, the application, which will be accessed from IP KNX, generates a large number of group address value reads at the time of launch, and there is no way to do without a cache.
For this purpose, it is necessary to be able to integrate into the telegram routing process.
project based on ESP 32 + TPUART2 + Ethernet
I think it would be best if you get the default coupler working first. After that you can add caching. You could also add a callback that can be registered for filtering. Or add some properties that influence forwarding to the knxprod like "only forward if value changed". More examples (even more complex ones) are always welcome as pull requests.
OK, let's start with a simple one. I connected tpuart, how do I logging all the telegrams in the log? Thanks!
OK, let's start with a simple one. I connected tpuart, how do I logging all the telegrams in the log? Thanks!
For group addresses look here: https://github.com/thelsing/knx/blob/fb74931bec618c32db48f7b2732a558e083fab16/src/knx/network_layer_coupler.cpp#L79
Oh… Do I need to edit the sdk to output telegrams to the log?
Just for the records. I have added some more (german) comments here: https://knx-user-forum.de/forum/projektforen/openknx/1780408-fragen-zum-routing-im-knx-stack?p=1780447#post1780447
Oh… Do I need to edit the sdk to output telegrams to the log?
@Avenitos did you proceed any further on this? If yes I would appreciate an email to "mailgoe at gmail.com" and have an offer for you. Thank you!