Skip to content

Bound but not started TcSleLink links cause failure to send commands #17

@merose

Description

@merose

Description

The TcSleLink currently returns true in isCommandingAvailable() if it is in the READY or ACTIVE state. However, this causes problems, because the LinkManager in Yamcs will send a command to any link that returns true. If the link is in the READY state, it cannot send commands, and so the command times out in TcSleLink.run() waiting for the uplink to be available.

To reproduce

  • Clone the Yamcs quickstart repository.
  • In the quickstart POM, update the Yamcs version to the latest release (5.12.0, as of this writing).
  • In the quickstart POM, add a dependency to yamcs-sle and jsle.
    <dependency>
      <groupId>org.yamcs</groupId>
      <artifactId>yamcs-sle</artifactId>
      <version>1.6.0</version>
    </dependency>
    <dependency>
      <groupId>org.yamcs</groupId>
      <artifactId>jsle</artifactId>
      <version>1.1.0</version>
    </dependency>
  </dependencies>
  • In quickstart, in src/main/yamcs/mdb/xtce.xml, add a SpaceSystem at the bottom which adds a single command with no arguments.
	<SpaceSystem name="Test">
		<CommandMetaData>
			<MetaCommandSet>
				<MetaCommand name="Start">
					<CommandContainer name="StartContainer">
						<EntryList>
							<FixedValueEntry binaryValue="01" sizeInBits="8"/>
						</EntryList>
					</CommandContainer>
				</MetaCommand>
			</MetaCommandSet>
		</CommandMetaData>
	</SpaceSystem>
  • In quickstart, in src/main/yamcs/etc/yamcs.myproject.yaml, add these two SLE FCLTU data links. Note that both links are set not to start SLE when enabling. (In SLE parlance, enabling the link will execute a BIND, but not a START.) When the data links are enabled, they will bind and go to the READY state (not the active STATE).
  - name: sle-out1
    class: org.yamcs.sle.TcSleLink
    sleProvider: jsle-out
    enabledAtStartup: false
    startSleOnEnable: false
    spacecraftId: 0x339
    maxFrameLength: 1115
    errorDetection: NONE
    # Pad CLTUs to 128 bytes. (Eventually this CLTU generator will also
    # insert the security header and trailer and optionally encrypt the
    # uplink frame.)
    cltuEncoding: BCH
    virtualChannels:
      # The main use of VCID 1 for uplink. This listens to commands on the
      # tc_adjusted stream and uses COP-1.
      - vcId: 1
        service: "PACKET"
        commandPostprocessorClassName: org.yamcs.tctm.GenericCommandPostprocessor
        stream: "tc_realtime" # Which yamcs stream to get the data from
        multiplePacketsPerFrame: false
        useCop1: false # Enable FOP1 (the transmitter part of COP1, see CCSDS 232.1-B-2) for this VC

  - name: sle-out2
    class: org.yamcs.sle.TcSleLink
    sleProvider: jsle-out
    enabledAtStartup: false
    startSleOnEnable: false
    spacecraftId: 0x339
    maxFrameLength: 1115
    errorDetection: NONE
    # Pad CLTUs to 128 bytes. (Eventually this CLTU generator will also
    # insert the security header and trailer and optionally encrypt the
    # uplink frame.)
    cltuEncoding: BCH
    virtualChannels:
      # The main use of VCID 1 for uplink. This listens to commands on the
      # tc_adjusted stream and uses COP-1.
      - vcId: 1
        service: "PACKET"
        commandPostprocessorClassName: org.yamcs.tctm.GenericCommandPostprocessor
        stream: "tc_realtime" # Which yamcs stream to get the data from
        multiplePacketsPerFrame: false
        useCop1: false # Enable FOP1 (the transmitter part of COP1, see CCSDS 232.1-B-2) for this VC
  • In quickstart, add this SLE configuration for talking to the jsle udp-sle bridge as the file src/main/yamcs/etc/sle.yaml.
Providers:

    jsle-out:
        hashAlgorithm: "SHA-1"
        versionNumber: 4
        initiatorId: "mertens"
        myUsername: "mertens"
        myPassword: 000102030405060708090a0b0c0d0e0f
        responderId: "jsle-bridge"
        peerUsername: "jsle-bridge"
        peerPassword: AB0102030405060708090a0b0c0d0e0f
        heartbeatInterval: 30
        heartbeatDeadFactor: 3
        authLevel: BIND
        unbindReason: SUSPEND
        responderPortId: dss05
        cltu:
            serviceInstance: sagr=SAGR.spack=SPACK.fsl-fg=FSL-FG.cltu=cltu1
            endpoints:
              - host: localhost
                port: 25711
  • Clone the Yamcs jsle repository.
  • Use Maven to package jsle to a tar-ball, and unpack to a place where you can run the udp-sle bridge. (I found it easiest to comment out some executions in the jsle-release profile, and add a dir format to the assembly descriptor.)
  • Run the jsle udp-sle bridge: cd <unpacked-location>; ./udp-sle-bridge.sh
  • Run quickstart Yamcs: cd <quickstart>; mvn yamcs:run
  • Go to the Yamcs web UI in a browser.
  • Navigate to the Links page in Yamcs.
  • Disable the udp-out link.
  • Enable the sle-out1 link.

Expected and actual result: sle-out1 Link is enabled and shows the Detail SLE READY. (Note that no link is actually ready to receive commands.)

  • Navigate to Commands > Send a command, and select the command /myproject/Test/Start.
  • Click Send to attempt to send the command.

Expected result: Command fails immediately with "FAILURE: no link available" because no link is available.
Actual result: Command tries to send, but fails after a few seconds with "FAILURE: SLE uplink not available".

  • Navigate to the LInks page again and enable the sle-out2 link.

Expected and actual result: Both sle-out1 and sle-out2 show SLE READY.

  • Select sle-out2 and use the "More" drop-down to choose "Start SLE".

Expected and actual result: sle-out1 shows SLE READY; sle-out2 shows SLE ACTIVE. Note that at this point sle-out2 is available for sending commands.

  • Navigate to Commands > Send a command, and select the command /myproject/Test/Start.
  • Click Send to attempt to send the command.

Expected result: Command shows a green Sent indication, and the extra acknowledgements SLE_REQ and SLE_RADIATED also appear green.
Actual result: After a few seconds the command fails with "FAILURE: SLE uplink not available".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions