Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More examples please #4

Open
mrWheel opened this issue Nov 12, 2017 · 9 comments
Open

More examples please #4

mrWheel opened this issue Nov 12, 2017 · 9 comments

Comments

@mrWheel
Copy link

mrWheel commented Nov 12, 2017

Hi Nico,

Could you please add some more examples?

I have trouble figuring out where param’s come from and where they go to ....

Thanks!!!

@envy
Copy link
Owner

envy commented Nov 12, 2017

Hi,

I don't quite understand your question. What parameters are you referring to?
I added a simple environment sensor example that might help you getting started.

Cheers, Nico

@mrWheel
Copy link
Author

mrWheel commented Nov 12, 2017 via email

@envy
Copy link
Owner

envy commented Nov 12, 2017

I don't know which video you are referring to.
Basically it works like this:

  1. You register a callback function with register_callback.
  2. Using the integrated webserver, you assign a group address to the callback.
  3. Everytime a knx telegram is received, we loop through all registered callbacks and check if the recevier group address matches. If yes, we call that function.

This allows you to flash the same firmware onto multiple devices and then configure them differently over wifi. No hardcoded addresses are used.

Inside the callback you get access to the payload and the method, i.e., the type of telegram (write, read, answer) and can act accordingly.

Are you still developing the library?

Yes, every now and then I update something. Currently I don't have a KNX installation therefore development is a bit stalled, however this will change at some point next year.

@mrWheel
Copy link
Author

mrWheel commented Nov 12, 2017 via email

@mrWheel
Copy link
Author

mrWheel commented Nov 13, 2017

Nico,

This is a great library!!!

Still some questions ...

I have programmed two ESP's

  • one as a sender (sends a telegram every 10 seconds)
  • one as a receiver

If I configure the same callback address and the same GA address the Receiver receives (most) of the packages send from te sender.

But not all .. Is there a way to transmit an "acknowledge" telegram to the sender so that he knows the telegram was received and processed and if there is no acknowledgement he can transmit the same telegram again?

An example of how to implement that (on both sides) would be fantastic!

As a side note: I realise those questions are part due to my little understanding of KNX (but it's growing!).

Thanks in advance!

@envy
Copy link
Owner

envy commented Nov 14, 2017

If I configure the same callback address and the same GA address the Receiver receives (most) of the packages send from te sender.

Yeah, I had similar problems if I send too many telegrams in a short timespan. Sometimes the receiver would not get them, if it's currently handling a previously received telegram. I found that disabling debug serial output helped.

But not all .. Is there a way to transmit an "acknowledge" telegram to the sender so that he knows the telegram was received and processed and if there is no acknowledgement he can transmit the same telegram again?

That is a good question. I'm not an expert so my understanding of KNX is not that good but as far as I know telegrams are not acknowledged. There is a ACK type for telegrams, but I don't know how/when to use it. From the parts of the specification I've read, it seems to not be used for normal communication. But I could be wrong.

@mrWheel
Copy link
Author

mrWheel commented Nov 15, 2017

Yeah, I had similar problems if I send too many telegrams in a short timespan. Sometimes the receiver would not get them, if it's currently handling a previously received telegram. I found that disabling debug serial output helped.

This can hardly be the case as I only send 1 telegram every 10 seconds ... Even if the debug serial output is disabled ..

@envy
Copy link
Owner

envy commented Nov 15, 2017

Hm, then I sadly don't know what happens. Do you have a delay() in your loop() or are you doing any other things in loop()? I sadly don't know what happens inside the ESP arduino framework when a UDP packet arrives. I found that sending from an ESP works quite reliable but receiving is sometimes weird. Maybe I'm missing some config options.

@sisamiwe
Copy link

sisamiwe commented Feb 18, 2018

Hi,
there was the request for more examples.

Here is a forum having some examples already done.
@envy
Do you think there is a change to bring them to your repository?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants