-
Notifications
You must be signed in to change notification settings - Fork 49
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
Received packets are sometimes lost if they are recevied during handling of another one #2
Comments
Hi, I think introducing ROUTING_BUSY could resolve this issue. |
Hi, while this is interesting, I don't think it will help much. The problem is the UDP stack of the ESP Arduino library. My library simply uses that and calls parsePacket() and the method simply returns no packets even though some were send. So somewhere inside the UDP stack is either a buffer to small or some other problem. I did not have the time to look into this in more detail. I noticed that with v2.3.0 of the ESP libraries this happens very rarely for me. However, with v2.4.0, I experienced >50% packet loss while receiving, so at some point the changed some internal stuff and it got worse, at least in my case. Maybe I'm simply missing a configuration option to tell the ESP to put packets into some buffer while I'm processing something. |
I have a second branch called async-udp that uses the ESPAsyncUDP library. With this I got 100% packet reception with v2.4.0 of the board libraries even when holding down the send button in the ETS. However, answering/sending was kind of weird when I had IGMP snooping enabled on my switch as it took up to 5 minutes before the first packet was let through. I have to investige this further. But I think this is the right way, as ESPAsyncUDP directly talks to lwip. Maybe I can even integrate the code, its not that much code. |
Great! 👍 |
GIRA IP Routers have a mode called "KNX Reliable Communication" especially for WiFi multicast. |
Looking forward to see ESPAsyncUDP on the library ! 👍 |
Hi, I tested the branch async-udp and works really good. I found that sometimes I lost some packets in both approaches (master and async-udp) but just because my overloaded wifi router. So, I think this losts can be mitigated using the ACK and the ACK response. So, if ESP-KNX-IP sends a telegram and no ACK answer is received on a time-out time, ESP-KNX-IP can re sends the telegram. What do you think? |
Hi @envy , I'm using a lot your library. Like it a lot!!! 👍 I'm just having a reliability issue due to some telegrams lost from time to time. What do you think of adding the ACK for resend telegrams? |
Hi, do you mean setting the |
yep, You are right. In KNX IP multicast, there is no ACK. I thought KNX-IP was like KNX-TP. I found an explanation of this on https://knx.org/media/docs/Partners/scientific/events/Session%202.pdf And also on the brochure of this KNX Router https://www.ekinex.com/media/fprod/MAEKBBC1TP_EN.pdf I don't understand why is that. It could follow the same protocol structure than TP and PL. So, How can be ensured the transmission of telegrams? What I was thinking is to add (on the application layer side - i.e. Tasmota KNX Driver) an option to:
But will be as a workaround the protocol issue and only for Tasmota_KNX to Tasmota_KNX device, or any KNX IP Device configured with some logic like that. I made some listening on KNX Multicast and I found that sometimes my router don't send the packet. Does not happens often but sometimes happens. This problem is device independent. From your library or from HomeAssistant. Does not matter who. So, What do you think. How can be ensured the transmission of telegrams? |
Hi @envy Any ideas? |
For KNXnet/IP via UDP multicast, you simply can't as there is no ACK.
This is not really relevant for the library, as you said, you would do this at the application layer. The last option would be the best, but that implies a specific KNX setup and may not always be possible. I personally would not think that much about it, UDP multicast is unreliable by design and KNXnet/IP made no improvement on that. So as long as the KNX people don't change something, I will not change anything. There is this GIRA IP Router I mentioned above that has "KNX Reliable Communication", whatever that is, but I couldn't find any documentation about this, whether it is proprietary or part of the KNX standard. |
A brief explanation of what GIRA Routers do with their Reliable KNX Communication is here. |
If we are currently handling a packet while another packet arrives, that packet is sometimes lost.
Don't know if it is a problem of the UDP library or my code.
Might be fixed by calling parsePacket() multiple times and saving multiple packets before working on them.
However, this increases the time we work on packets so might miss other ones again :/
The text was updated successfully, but these errors were encountered: