Multiple messages to same node, seems to miss one.
-
@crankycoder You didn't describe your hardware, but if it's based on nRF24 the issue could be that this radio has a 3 level deep queue for incoming messages. If more than 3 messages come in faster than the node can handle, the last message(s) will get lost.
You can counter this by either sending the messages with more time inbetween or turn on message buffering by defining MY_RX_MESSAGE_BUFFER_FEATURE (make sure the nRF24 IRQ pin is connected!)
There's some discussion on the topic here: https://www.mysensors.org/build/serial_gateway@yveaux is this something that could be a problem at the repeater and the node itself? I don't think it's the gateway as the messages aren't coming in, it's being delivered to the node.
-
@mfalkvidd That is good to hear. What should I do to have that enabled?
@electrik It should have been sufficient to follow the documentation, but it seems like MY_RX_MESSAGE_BUFFER_FEATURE is only available for atmega328 (or perhaps also for SAMD and Linux/Raspberry Pi but definitely not for esp8266).
I have created an issue to clarify the documentation.
Thanks to @Yveaux for notifying me.
-
@electrik It should have been sufficient to follow the documentation, but it seems like MY_RX_MESSAGE_BUFFER_FEATURE is only available for atmega328 (or perhaps also for SAMD and Linux/Raspberry Pi but definitely not for esp8266).
I have created an issue to clarify the documentation.
Thanks to @Yveaux for notifying me.
@mfalkvidd all right thanks. Is there an alternative to avoid losing messages on an ESP8266 MQTT gateway?
-
@mfalkvidd all right thanks. Is there an alternative to avoid losing messages on an ESP8266 MQTT gateway?
-
@yveaux What is a rate that is still expected to be possible? Or, how often is the buffer from the NRF emptied?
-
@electrik that's a tough one... Every time loop() executes, or if you call eg wait() the queue is emptied.
So it all depends on what you do in your sketch. -
@Yveaux do you know if there are plans to support this buffering on the ESP8266 or the ESP32? Is it all related to SoftSPI?
-
@electrik the problem is the arduino port, not the mySensors stack. Last time I checked the issue on GitHub was still unresolved...
-
@yveaux This seems to be the original issue, which is closed: https://github.com/esp8266/Arduino/issues/1943
That sounds hopeful, but no time to check it right now...