Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telemetry, GenericTelemetry, EventMessage UI bugs supporting multiple spacecraft #242

Open
mafoste3 opened this issue Mar 29, 2024 · 0 comments

Comments

@mafoste3
Copy link

Describe the bug
The Telemetry, GenericTelemetry, and EventMessage UIs will not show message data from the 'Selected IP Address' spacecraft telemetry when multiple spacecraft are detected.

To Reproduce
Steps to reproduce the behavior:

  1. Start two or more unique instances of cFS connected to the CFS Ground System network
  2. Start the CFS Ground System
  3. Start the Command System
  4. Enable Telemetry Output for cFS instances
  5. Wait for the CFS Ground System to detect spacecraft telemetry from all running cFS instances
  6. In the Main Window UI click the Selected IP Address dropdown and select the last spacecraft IP address
  7. In the Main Window UI click the Start Telemetry System (no data will appear)
  8. In the Telemetry System Page UI click Event Messages (no data will appear)
  9. In the Telemetry System Page UI click Display Page any Generic Telemetry Subsystem/Page (no data will appear)

Expected behavior
The selected spacecraft data is expected to be correctly displayed in the respective Telemetry, GenericTelemetry, and EventMessage UI - as indicated by the '*No packets? Remember to select the IP address of your spacecraft in the Main Window.' message at the bottom of each GenericTelemetry UI.

Code snips

# Returns the name of the selected spacecraft
def get_selected_spacecraft_name(self):
return self.spacecraft_names[self.ip_addresses_list.index(
self.get_selected_spacecraft_address())].strip()

# Init zeroMQ
self.context = zmq.Context()
self.subscriber = self.context.socket(zmq.SUB)
self.subscriber.connect("ipc:///tmp/GroundSystem")
subscription_string = f"{subscr}.Spacecraft1.TelemetryPackets.{app_id}"
self.subscriber.setsockopt_string(zmq.SUBSCRIBE, subscription_string)

# Init zeroMQ
context = zmq.Context()
self.subscriber = context.socket(zmq.SUB)
self.subscriber.connect("ipc:///tmp/GroundSystem")
my_tlm_pg_apid = subscr.split(".", 1)
my_subscription = f"GroundSystem.Spacecraft1.TelemetryPackets.{my_tlm_pg_apid[1]}"
self.subscriber.setsockopt_string(zmq.SUBSCRIBE, my_subscription)

System observed on:
-Hardware: VirtualBox
-OS: Ubuntu 20.04
-Versions [e.g. cFE v7.0.0, OSAL v6.0.0, PSP v1.5.0, cFS-GroundSystem 3.0]

Additional context
Two sets of fixes are required for proper behavior:

  1. The spacecraft names are stored as bytes, but the list is initialized with the string 'All' for all telemetry. Therefore always return a string in get_selected_spacecraft_name in GroundSystem.py for either case to build the correct subscription sting:
    # Returns the name of the selected spacecraft
    def get_selected_spacecraft_name(self):
        if isinstance(self.spacecraft_names[self.ip_addresses_list.index(self.get_selected_spacecraft_address())], str):
            return self.spacecraft_names[self.ip_addresses_list.index(self.get_selected_spacecraft_address())].strip()
        else:
            return self.spacecraft_names[self.ip_addresses_list.index(self.get_selected_spacecraft_address())].decode("UTF-8")
  1. The subscription is defaulted to always use Spacecraft1, therefore use the subscription string sting passed directly to the EMTlmReceiver class in both GenericTelemetry and EventMessage UIs:
        # Init zeroMQ
        self.context = zmq.Context()
        self.subscriber = self.context.socket(zmq.SUB)
        self.subscriber.connect("ipc:///tmp/GroundSystem")
        self.subscriber.setsockopt_string(zmq.SUBSCRIBE, subscr)

Reporter Info
Mark Foster
NASA / Johnson Space Center / ER6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant