Closed apogeecmb closed 1 year ago
I've never seen this CCSDS header field before:
ITEM CCSDS_REALTIME 5 1 UINT "Realtime or playback flag" BIG_ENDIAN
STATE REALTIME 0
STATE STORED 1
Do you have other packets that have the standard 11-bit APID?
If so you might need to use the UNIQUE_ID_MODE flags in your target.txt file: https://openc3.com/docs/v5/target#tlm_unique_id_mode
Are any of your packets actually marked "STORED"? We logged stored and realtime packets into different files.
How are you reading back the packets?
Otherwise, it might be a bug, but I haven't seen this yet, and everything in our demo appears to be logging correctly.
Ryan,
We're using the standard 11-bit APID field but repurposing the 11th bit to indicate whether the telemetry is stored or realtime. It's a carryover implementation from a spacecraft vendor we've used in the past. All packets are using the same ID, so I wouldn't expect the UNIQUE_ID_MODE flag to be required.
For this test, there are only realtime packets. I am parsing the log file using a custom python script. I'm pretty confident my parser is working correctly. And when I look at the raw log file just in a text editor, I can clearly see the MGR_STATUS packet identifier followed by one raw packet and then the CFDP_SERVER_TLM identifier followed by all the rest of the packets.
The log file format changed quite a bit in the 5.1 release to support reducing file sizes....
Try this ruby script (or something like it) that will read a log with our code and see what it sees:
# Fix these paths to your file system
ENV['RUBYLIB'] = '/Users/ryanmelt/git/openc3/cosmos/openc3/lib'
ENV['OPENC3_DEVEL'] = '/Users/ryanmelt/git/openc3/cosmos/openc3'
require 'openc3'
require 'openc3/logs/packet_log_reader'
plr = OpenC3::PacketLogReader.new
plr.each(ARGV[0]) do |packet|
puts "#{packet.read('RECEIVED_TIMEFORMATTED')} #{packet.target_name} #{packet.packet_name}"
end
Usage: ruby read_test.rb <filename>
Filename should not be gziped.
I just created the parser this morning using the current documentation on openc3.com, so I'm pretty confident it is parsing correctly. I tried your code snippet, but ruby is having issues finding the openc3 module.
Here's the first part of an example log file for reference to show what I'm seeing. The actual target name is actually MIDNIGHT.
b'COSMOS5_\x00\x00\x00\n\x10\x00MIDNIGHT\x00\x00\x00\x0e \x00\x00\x00MGR_STATUS\x00\x00\x00\x1c0\x00\x00\x00\x17-\x03WP\x8f\xba\xad\t\x10\xc0\x00\x00\t\xd6\x18\x8ac\x03\x00\x00\x00\x00\x00\x00\x00\x00\x13 \x00\x00\x00CFDP_SERVER_TLM\x00\x00\x00 0'
Actually here's the whole log.
Confirmed file is good. Has alternating packets throughout. Also confirmed our log file format documentation is out of date, but I don't think that is your problem either because this is a raw log file, and it was the decom files that changed.
2022-12-02 08:25:10 -0700 MIDNIGHT MGR_STATUS
2022-12-02 08:25:10 -0700 MIDNIGHT CFDP_SERVER_TLM
2022-12-02 08:25:11 -0700 MIDNIGHT MGR_STATUS
2022-12-02 08:25:11 -0700 MIDNIGHT CFDP_SERVER_TLM
2022-12-02 08:25:12 -0700 MIDNIGHT MGR_STATUS
2022-12-02 08:25:12 -0700 MIDNIGHT CFDP_SERVER_TLM
2022-12-02 08:25:13 -0700 MIDNIGHT MGR_STATUS
2022-12-02 08:25:13 -0700 MIDNIGHT CFDP_SERVER_TLM
2022-12-02 08:25:14 -0700 MIDNIGHT MGR_STATUS
2022-12-02 08:25:14 -0700 MIDNIGHT CFDP_SERVER_TLM
2022-12-02 08:25:15 -0700 MIDNIGHT MGR_STATUS
2022-12-02 08:25:15 -0700 MIDNIGHT CFDP_SERVER_TLM
2022-12-02 08:25:16 -0700 MIDNIGHT MGR_STATUS
2022-12-02 08:25:16 -0700 MIDNIGHT CFDP_SERVER_TLM
etc.
Here is an updated script with our code that works:
require 'openc3'
require 'openc3/logs/packet_log_reader'
plr = OpenC3::PacketLogReader.new
plr.each(ARGV[0], false) do |packet|
puts "#{packet.received_time} #{packet.target_name} #{packet.packet_name}\n#{packet.buffer.formatted}\n"
end
Usage:
RUBYLIB=/Users/ryanmelt/git/openc3/cosmos/openc3/lib OPENC3_DEVEL=/Users/ryanmelt/git/openc3/cosmos/openc3 ruby read_test.rb tlm_test3.bin
You might have to rake build
in your cosmos/openc3 folder before it will work.
Apologize for wasting your time! Guess I haven't totally wrapped my mind correctly around how to parse this logging convention. Thanks for confirming the data looks accurate though.
I'm having an issue with the contents of telemetry log files. I currently have two periodic telemetry packets being output by my target. Both packets are correctly being received by COSMOS and displayed in the packet viewer in COSMOS. However when I parse the raw binary telemetry log files, there is only one instance of one of the packet types but multiple (i assume all) instances of the other packet type.
I tried a couple telemetry definition changes to see if I could determine what the cause was or affect the behavior. My packet types have a single ID_ITEM UINT field. The packet that has only one instance is the packet with the smaller ID_ITEM value. As a test, I intentionally swapped the ID_ITEM values for the two packets. That caused the log file to flip which packet had just one instance. So I can change the behavior of the bug, but I'm not sure the cause.
My original telemetry definition file is shown below for reference. Originally I was seeing one instance of the MGR_STATUS packet and multiple of the CFDP_SERVER_TLM packet. And then when I switched the ID_ITEM values, I saw multiple MGR_STATUS packets but only one CFDP_SERVER_TLM packet.
Any clue as to what might be going on? Do I have some configuration error or is this a bug? Thanks for any help you can provide.
I'm running COSMOS version 5.1.1 on an Ubuntu 22.04 VM. Both my target and COSMOS are running within the VM.