When Serial connection is made should the Serial gateway do reset itself?

  • This is the question to developers of MySensors: when Serial connection is made should the Serial gateway do reset itself always in any case? We have the discussion about in this thread. One part is sure, it must, i'm not thinking the same. Who is right? The docs say nothing about this.

  • Mod

    @MaximumSU I don't think there is a way for the gateway to detect that something started listening on the serial connection. If the gateway cannot detect that something started listening, the gateway cannot reset itself (regardless if it should reset or not).

  • @mfalkvidd This question is rised because of this message:
    "I_GATEWAY_READY - Send by gateway to controller when startup is complete."
    It generated only after startup is completed, so, who is a target of such message? Gateway do not know, is anybody listening the connection or not, controller also do not know about gateway - is it listening, restarted or do something else. It looks like useles, except the controller know's, what after he opened the connection to gateway, gateway must do reset and emmit this "I Ready" message. This is possible by RTS or DTR lines of Serial connection on some Arduino boards and some Serials on board, but not any. So, the question about this message (I_READY) - is developer of MySensor had such behavior (autoreset of Arduino board after Serial connection made and using the RTS/DTR lines) in mind, or not?

  • Mod

    @MaximumSU I have no idea about the intentions.

    This could be a case that nobody thought about. There are so many different ways a gateway and a controller can be connected. Some would allow detection, some don't.

    type gateway can detect connection?
    serial depends on Arduino, depends on host system
    tcp controller->gateway yes
    tcp gateway->controller yes
    mqtt controller -> gateway yes
    mqtt gateway -> broker <- controller no
    mqtt controller -> gateway yes

    Maybe there should be more rows in this table.

  • Ok. So, answer will be "for some cases he can, but not must". Thanks for participations.

Log in to reply

Suggested Topics