Git Product home page Git Product logo

openc3-cosmos-cfdp's Introduction

Welcome to OpenC3 COSMOS

"Open Source, Open Architecture - Command, Control and Communication"

OpenC3 5 Playwright Tests
OpenC3 5 Ruby Unit Tests
OpenC3 5 Python Unit Tests
OpenC3 5 API Tests
Code Climate
codecov

Documentation

OpenC3 COSMOS provides all the functionality needed to send commands to and receive data from one or more embedded systems referred to as "targets". Out of the box functionality includes: Telemetry Display, Telemetry Graphing, Operational and Test Scripting, Command Sending, Logging, Log File Playback, and more.

So what can you use this for? We use it to test about everything we create and OpenC3 COSMOS is great for automating embedded systems testing or operation. It can provide a fully featured user interface to any piece of hardware that provides an electronic way of communicating with it (TCP/IP, UDP, Serial, etc). Potential uses range from testing embedded systems, to home automation, to verifying cell phones, to helping you make that next great thing that changes the world! The sky is the limit...

After configuring OpenC3 COSMOS to talk to your hardware, you immediately can use the following tools:

  1. Command and Telemetry Server

    • This provides status of all the target connections within the OpenC3 COSMOS system. It provides allows interfaces to be connected and disconnected and allows raw packet data to be viewed.
  2. Limits Monitor

    • The Limits Monitor tool provides an overview of all telemetry points in the system that are currently out of limits. It also maintains a log of limits changes and continues to display items that have gone out of limits even after they have been restored to green status.
  3. Command Sender

    • Command Sender allows you to manually send one-off commands with conventient drop downs and descriptions of each command and command parameter.
  4. Script Runner

    • Script Runner allows for running OpenC3 COSMOS test procedures or any other Ruby code from a graphical environment that highlights each line as it executes. At anytime during execution, the script can be paused or stopped. If a telemetry check fails or any other exception occurs, the script is immediately stopped and the user notified.

    • Script Runner also allows you to break your operational or test procedures down into discreet test cases that each complete with either SUCCESS or FAILURE. After running, a script report is automatically created for you. Convenient features such as the ability to loop testing help get the kinks out of your system before formal runs.

  5. Packet Viewer

    • Packet Viewer provide a simple key value list of each telemetry item in the system giving you full view of the most recent realtime value of any telemetry point.
  6. Telemetry Viewer

    • Create custom organized telemetry screens using a wide variety of available telemetry widgets for display. Provide exactly the views that your users need to see for each subsystem in you system.
  7. Telemetry Grapher

    • Realtime and offline line graphing of telemetry points. Multiple telemetry points per graphs and multiple graphs per window allow you to efficiently organize your data. Great for graphing temperatures and voltages both in realtime and post-test.
  8. Extractor

    • Used for offline analysis of command and telemetry data. Extracts a given list of items into a CSV file for further analysis in other tools such as Excel or Matlab.

OpenC3 COSMOS is built and maintained by Ryan Melton (ryanmelt) and Jason Thomas (jmthomas) at OpenC3, Inc.

Getting Started

  1. See the Installation Guide for detailed instructions.

  2. Follow the Getting Started to start developing your configuration.

Contributing

We encourage you to contribute to OpenC3 COSMOS!

Contributing is easy.

  1. Fork the project
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

YOU MUST AGREE TO OUR CONTRIBUTOR LICENSE AGREEMENT TO SUBMIT CODE TO THIS PROJECT: See CONTRIBUTING.txt

Most importantly:

FOR ALL CONTRIBUTIONS TO THE OPENC3 COSMOS PROJECT, OPENC3, INC. MAINTAINS ALL RIGHTS TO ALL CODE CONTRIBUTED TO THE OPENC3 PROJECT INCLUDING THE RIGHT TO LICENSE IT UNDER OTHER TERMS.

License

OpenC3 COSMOS is released under the AGPL v3 with a few addendums. See LICENSE.txt

openc3-cosmos-cfdp's People

Contributors

jmthomas avatar ryanmelt avatar

Watchers

 avatar  avatar  avatar

Forkers

havencarlson

openc3-cosmos-cfdp's Issues

Fails on some binary files

Receive failure when receiving (UNACK) binary files:

UndefinedConversionError : "\xC0" from ASCII-8BIT to UTF-8
/usr/lib/ruby/3.2.0/delegate.rb:349:in `write'
/usr/lib/ruby/3.2.0/delegate.rb:349:in `block in delegating_block'
/tmp/d20230914-15-52ebm9/app/models/cfdp_receive_transaction.rb:580:in `handle_pdu'
/tmp/d20230914-15-52ebm9/app/models/cfdp_user.rb:74:in `block (2 levels) in start'
/usr/lib/ruby/gems/3.2.0/gems/openc3-5.10.1/lib/openc3/utilities/store_autoload.rb:153:in `block (3 levels) in read_topics'
/usr/lib/ruby/gems/3.2.0/gems/openc3-5.10.1/lib/openc3/utilities/store_autoload.rb:151:in `each'
/usr/lib/ruby/gems/3.2.0/gems/openc3-5.10.1/lib/openc3/utilities/store_autoload.rb:151:in `block (2 levels) in read_topics'
/usr/lib/ruby/gems/3.2.0/gems/openc3-5.10.1/lib/openc3/utilities/store_autoload.rb:150:in `each'
/usr/lib/ruby/gems/3.2.0/gems/openc3-5.10.1/lib/openc3/utilities/store_autoload.rb:150:in `block in read_topics'
/usr/lib/ruby/gems/3.2.0/gems/connection_pool-2.4.1/lib/connection_pool.rb:110:in `block (2 levels) in with'
/usr/lib/ruby/gems/3.2.0/gems/connection_pool-2.4.1/lib/connection_pool.rb:109:in `handle_interrupt'
/usr/lib/ruby/gems/3.2.0/gems/connection_pool-2.4.1/lib/connection_pool.rb:109:in `block in with'
/usr/lib/ruby/gems/3.2.0/gems/connection_pool-2.4.1/lib/connection_pool.rb:106:in `handle_interrupt'
/usr/lib/ruby/gems/3.2.0/gems/connection_pool-2.4.1/lib/connection_pool.rb:106:in `with'
/usr/lib/ruby/gems/3.2.0/gems/openc3-5.10.1/lib/openc3/utilities/store_autoload.rb:146:in `read_topics'
/usr/lib/ruby/gems/3.2.0/gems/openc3-5.10.1/lib/openc3/utilities/store_autoload.rb:58:in `public_send'
/usr/lib/ruby/gems/3.2.0/gems/openc3-5.10.1/lib/openc3/utilities/store_autoload.rb:58:in `method_missing'
/usr/lib/ruby/gems/3.2.0/gems/openc3-5.10.1/lib/openc3/topics/topic.rb:29:in `public_send'
/usr/lib/ruby/gems/3.2.0/gems/openc3-5.10.1/lib/openc3/topics/topic.rb:29:in `method_missing'
/tmp/d20230914-15-52ebm9/app/models/cfdp_user.rb:54:in `block in start'

This case traces to using the default w+ here:

Looks like there's a few other uses that default to w+ but I haven't dug into which ones matter.

Not clear how to set up for two receive channels

Use case is there's two interfaces over which cosmos receives CFDP PDU's. We've got it working for one, and set up the second but I suspect there's an issue with cfdp_port use within the microservice. I expected to see that port set via the inputs to the microservice config such that two different ones would be used. Or should the same cfdp_port be used on both?

Can't say I follow the design yet so I'm not really sure how it all works, or is supposed to work. Any chance there's a design diagram or similar somewhere that details the data flow on the cosmos side?

rails s -b 0.0.0.0 -p <%= cfdp_port %>

port ENV.fetch("PORT") { <%= cfdp_port %> }

Our config (note the inability to use a separate port on the two microservices):

VARIABLE source_entity_id_sc 23
VARIABLE source_entity_id_radio 22
VARIABLE destination_entity_id 25
VARIABLE root_path_sc /host/chan1_poll0
VARIABLE root_path_radio /host/chan0_poll0

VARIABLE cfdp_port 2905

MICROSERVICE CFDP CFDP_SC
  WORK_DIR .
  ROUTE_PREFIX /cfdp_sc
  ENV OPENC3_ROUTE_PREFIX /cfdp_sc
  ENV SECRET_KEY_BASE 324973597349867207430793759437697498769349867349674
  PORT 2905
  CMD rails s -b 0.0.0.0 -p 2905 -e production
  # MIB Options Follow -
  OPTION source_entity_id <%= source_entity_id_sc %>
  OPTION crcs_required false
  OPTION tlm_info CFS_SC CFDP_TLM_PDU_CHAN1 PDU
  OPTION destination_entity_id <%= destination_entity_id %>
  OPTION cmd_info CFS_SC CFDP_CMD_PDU_CHAN1 PDU
  OPTION root_path <%= root_path_sc %>

MICROSERVICE CFDP CFDP_RADIO
  WORK_DIR .
  ROUTE_PREFIX /cfdp_radio
  ENV OPENC3_ROUTE_PREFIX /cfdp_radio
  ENV SECRET_KEY_BASE 324973597349867207430793759437697498769349867349674
  PORT 2906
  CMD rails s -b 0.0.0.0 -p 2906 -e production
  # MIB Options Follow -
  OPTION source_entity_id <%= source_entity_id_radio %>
  OPTION crcs_required false
  OPTION tlm_info CFS_RADIO CFDP_TLM_PDU_CHAN1 PDU
  OPTION destination_entity_id <%= destination_entity_id %>
  OPTION cmd_info CFS_RADIO CFDP_CMD_PDU_CHAN1 PDU
  OPTION root_path <%= root_path_radio %>

File Directive PDU data length field is off by 1

From the code, it looks like the "PDU data length" for the File Directive does not include the directive code. From CCSDS 727.0-B-5 Section 5.2.1.1

The data field of File Directives shall consist of a Directive Code octet followed by a Directive Parameter field

Example from cfdp_pdu_eof.rb:

pdu = build_initial_pdu(type: "FILE_DIRECTIVE", destination_entity: destination_entity, transmission_mode: transmission_mode, file_size: file_size, segmentation_control: segmentation_control)
pdu_header_part_1_length = pdu.length # Measured here before writing variable data
pdu_header = pdu.build_variable_header(source_entity_id: source_entity['id'], transaction_seq_num: transaction_seq_num, destination_entity_id: destination_entity['id'], directive_code: "EOF")
pdu_header_part_2_length = pdu_header.length
pdu_contents = pdu.build_eof_pdu_contents(condition_code: condition_code, file_checksum: file_checksum, file_size: file_size, canceling_entity_id: canceling_entity_id)
pdu.write("VARIABLE_DATA", pdu_header + pdu_contents)
pdu.write("PDU_DATA_LENGTH", pdu.length - pdu_header_part_1_length - pdu_header_part_2_length)

Feature Request to add - OPTION: Frequency

Based on the current rate at which packets are created and pushed out of the interface, it appears that it is at the max speed of the while loop itself. It is highly likely that ground to space CFDP would be working at a much lower rate than that.

Could you add in a sleeper with an adjustable rate and allow the rate to be included as an OPTION?

PDU CRC length not included in the data length field

According to the blue book 727.0-B-5 section 4.1.3.2, the CRC is supposed to be included in the data length field. It looks like the CFDP engine is not taking into account the CRC length (if calculated).

4.1.3.2 The CRC value shall be placed in the final octets of the PDU data field, and its
length shall be included in the PDU data field length. The CRC algorithm shall be applied
from the first octet of the PDU header to the last octet of the PDU data field prior to the CRC
value. 

Example:

pdu = build_initial_pdu(type: "FILE_DATA", destination_entity: destination_entity, file_size: file_size, segmentation_control: segmentation_control, transmission_mode: transmission_mode)
pdu_header_part_1_length = pdu.length # Measured here before writing variable data
pdu_header = pdu.build_variable_header(source_entity_id: source_entity['id'], transaction_seq_num: transaction_seq_num, destination_entity_id: destination_entity['id'])
pdu_header_part_2_length = pdu_header.length
pdu_contents = pdu.build_file_data_pdu_contents(offset: offset, file_data: file_data, record_continuation_state: record_continuation_state, segment_metadata: segment_metadata)
pdu.write("VARIABLE_DATA", pdu_header + pdu_contents)
pdu.write("PDU_DATA_LENGTH", pdu.length - pdu_header_part_1_length - pdu_header_part_2_length)
if destination_entity['crcs_required']
crc16 = OpenC3::Crc16.new
pdu.write("CRC", crc16.calc(pdu.buffer(false)[0..-3]))
end
return pdu.buffer(false)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.