Is it possible to request an ACK from the controller?



  • I'm just another nubie at home automation, Arduinos and certainly MySensors.

    Thanks for the MySensors software.... sure makes it simple compared to what I was attempting to do...

    I'm using MySensors 2.0.0-beta and the serial gateway to Domoticz.

    I'm creating (yet another variant) of the relay sketch. I'm not using signing but otherwise I'm trying to make this robust. Everything seems to be working fine but I have concerns relating to how I should handle ACKs.

    Domoticz always seems to request an ACK when it sets a switch. So when Domoticz sends a command to turn a relay ON|OFF, MySensors internally sends back an ACK. Too easy!

    The problem I face, is how to request an ACK from the controller when my sketch sends a status update? Initially I thought that I could simply test the return value of the send() call. However, it appears that this simply indicates that the message successfully made the next hop (and not its destination). My sketch sets the request ACK flag in the message but an ACK can never be returned because the serial protocol doesn't allow it to be passed through to the controller. The way I see it, it is a one way street. Have I missed something really basic?

    It seems to me that when controlling actuators, ACKs are necessary yet I cannot see how they can be sent both ways.

    Can anyone shed some light on this.

    Thanks
    Chris


  • Admin

    The ack was designed back when we only had wired serial/ethernet connection which is fairly safe to presume message actually reached the final destination (controller) when gateway had received the message.

    Nowadays we have the WiFi option which changes this a bit. But we would need something that breaking the current serial protocol to archive it. So the plan is to introduce this kind of changes in a later version... the current proposition/discussion is to move over to something more binary when we make the big leap. This would lead to much smaller sketches all the way out to the nodes as we can skip some converter functions used today (i.e. atoi).

    But the current protocol will probably still be possible to use for backward compatibility.


  • Mod

    @OnBokBeach thr discussion in http://forum.mysensors.org/topic/3346/discussion-reliable-delivery/2 might help shine a light on what ack functionality is available in MySensors. The best you can do with the current protocol is to get an ack from the gateway.


  • Admin

    Yeah, forgot... @tbowmo started a doc some time ago..

    https://docs.google.com/document/d/1A853QT1mQhjJCmCKW1-zIylFOQTHYCNG2Sz22CGd8Qg/edit#heading=h.a87wwm5smzb

    Not much in it just yet though 🙂


  • Mod

    @hek: not sure where you eant input on the new protocol but I think there should be a message sequence number. That would make de-duplication possible, which makes it possible to support exactly-once end to end reliable delivery.


  • Admin

    Yep, add a comment. But to realise that it would require change of the OTA protocol as well.

    But we might already make future space for it in the serial protocol.



  • @hek Thanks for the quick reply.
    Now that I understand that things are operating as intended it is not really an issue. The serial GW appears to be very reliable and I plan to have it and the controller on a UPS. From my perspective, I'll treat the GW as part of the controller. Providing the controller is reliable then I'm OK....

    On a side note, in your other posts you point to your example which uses the ACK to set the relay. Although this is very elegant it does not suit my case where I want the relays to be stand alone such that they continue to operate the lights, extractor fan,etc. when the GW/controller is down. This is way more important (to me) than the possibility of the controller getting out of sync occasionally. I have been considering using Z-Wave for some of the relays but there does seem to be plenty of issues with that protocol .... sigh!

    @mfalkvidd Thank you for the link. Unfortunately my searching skills aren't too good...it's an age thing 😉
    I agree that documentation is the important thing here. If we understand how the protocols work then we can live within their limitations. MySensors already does way more then I expected and way easier too. If I have to use some Z-Wave or even hard wire something, it's no big deal (well now that Domoticz, OpenHAB, etc. can bring them all together). Well that's my theory for now 😉

    Cheers
    Chris


Log in to reply
 

Suggested Topics

  • 4
  • 2
  • 2
  • 933
  • 14
  • 9

17
Online

11.2k
Users

11.1k
Topics

112.5k
Posts