Why does JMRI send the <s> command repeatedly only on Ethernet?

FlightRisk Dec 24, 2020

Tags:
  1. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    @Atani and anyone else who may remember. Looking through the JMRI source code, we found that JMRI sends the <s> status command every 30 seconds. But it doesn't do this for a direct USB connection. Why? My guess is that it has something to do with picking up turnout and sensor changes, but I don't know that. Maybe a heartbeat of some kind or to account for a dropped connection?
     
    rjthomas909 likes this.
  2. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    I believe this is the reason for it. When operating over a non-direct connection (USB) the connection may go bad and JMRI may not detect and reconnect automatically.
     
    rjthomas909 and FlightRisk like this.
  3. rkmAT

    rkmAT New Member

    8
    3
    1
    DCC++ EX droppes the TCP/IP connection after some minutes if you don't send a heartbeat. In my case on a Wifi connection. Thought it was wanted? Maybe to prevent death connections?
     
    rjthomas909 likes this.
  4. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    There may be an AT command to tell the ESP8266 to not timeout. I'll look. But Ethernet would probably not have this. Engine Driver has a keep alive for its connection. More research required! ;)
     
    rjthomas909 likes this.
  5. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    There does seem to be a normal timeout with any TCP connection. I think the default is 30 seconds. So we can send a heartbeat to keep it connected.
     

Share This Page