knx icon indicating copy to clipboard operation
knx copied to clipboard

IP router

Open Avenitos opened this issue 2 years ago • 11 comments

Hello!

is it possible to make a router between TP and IP? are there any examples?

Avenitos avatar Dec 24 '21 19:12 Avenitos

See the *coupler examples. I didn't try them. @nanosonde is the routing expert here.

thelsing avatar Dec 25 '21 09:12 thelsing

there's almost no code there :)

It is necessary to call the callback when passing telegrams and filter them when passing to another interface

Avenitos avatar Dec 25 '21 12:12 Avenitos

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.

nanosonde avatar Dec 25 '21 13:12 nanosonde

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.

nanosonde avatar Dec 25 '21 13:12 nanosonde

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

Avenitos avatar Dec 25 '21 13:12 Avenitos

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.

thelsing avatar Dec 25 '21 16:12 thelsing

OK, let's start with a simple one. I connected tpuart, how do I logging all the telegrams in the log? Thanks!

Avenitos avatar Dec 26 '21 17:12 Avenitos

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

nanosonde avatar Dec 26 '21 17:12 nanosonde

Oh… Do I need to edit the sdk to output telegrams to the log?

Avenitos avatar Dec 26 '21 18:12 Avenitos

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

nanosonde avatar Jul 05 '22 15:07 nanosonde

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!

mgoeller avatar Feb 06 '23 11:02 mgoeller