CAS-5A(FO-118) jpg trick?


CAS-5A jpg trick?
JE9PEL, Mineo Wakita
On Sat, Mar 4, 2023 at 7:14 UTC

I downloaded several jpg_file including *A07# or *A09# through the DTMF request
command to the satellite. Then the following message, "Try to get another photos"
or "Synchronization code not received" appears on the cmd_prompt screen and I
cannot proceed. Is there any trick to making an image?


Re: CAS-5A jpg trick?
K4KDR, Scott

No trick, I'm afraid... I know it sounds simple (even though it is NOT), but we
just need to get ALL of the packets.

When you miss packet #1 (with the 'FF D8' bytes), that decoder will show
"Synchronization code not received". Here is an example from #22 last night.
These are the decodes from N6RFM (with the ax.25 header removed so the sequence
numbers are at the start of each line in my editor):



... you can see that he got every packet up until number '008e', but then missed
a number of packets until decodes started again with #00a2.

So, to make a complete picture, I looked at MY decodes and I had the missing packets.
With copy/paste, I was able to fill in all of Bob's missing packets from my decode.
Very lucky!

It would be a real accomplishment for ONE station to get a perfect, 100% picture with
no missing packets... at least on a single pass. But even if you don't get packets
from another station, you can always download again on the next pass - or even on
the next day. Over 2 or 3 passes, you can accumulate all the packets and fill in the
ones that are missing. Good luck!!

(Reference)
@K4KDR




Re^2: CAS-5A jpg trick?
JE9PEL, Mineo Wakita
On Sat, Mar 4, 2023 at 14:07 UTC

Thanks for CAS-5A ipg structure.
I re-edited my site referring to your advice.
Look at the bottom of that site.
By the way, what binary editor are you using?

Re:Re^2: CAS-5A jpg trick?
K4KDR, Scott

First, one additional tip....
Instead of downloading several different pictures, I recommend
(if there is time in a pass) to download the SAME picture as many times as you can.
That way, you might get packets from download #2 that you missed in download #1.

I like the FRHED hex editor (https://frhed.sourceforge.net/en/) on Windows.

But to make it easier to work with partial files, I convert to TEXT & use the GEANY
text editor for all my copy/paste operations.  When I have ALL the packets, remove
all the INFO bytes (everything up to 'FF D8' on line #1 and the same number of bytes
on every other line), THEN I remove the line feeds so that I have a single line of
text going all the way from 'FF D8' to 'FF D9'. The final step is to convert back
to binary hex. Then I have a JPG file!

In a rough form, the steps look like this (with example commands):
------------------------------------------------------------------
- obtain KSS file from live capture

- convert from KSS to true HEX in GNU Radio while removing 1st 16 bytes (ax.25 header)
    from each packet

- in hex editor, verify (or cut) start of file to confirm '03 xx xx' bytes are at
     start of file

- chop file into 256 byte lines & convert to TEXT file:
    
    cat cas-5a_22-n6rfm--cut.hex | xxd -p -c 256 | more
    (confirm that each line starts with '03 xx xx')
    
    cat cas-5a_22-n6rfm--cut.hex | xxd -p -c 256 > cas-5a_22-n6rfm--0301.txt
    
- repeat for any other captures of same JPG file download

- open TEXT files & editor & remove 1st 3 bytes so that each line starts
    w/ sequence # bytes (line #1 should start with '0001' - if you got the 1st packet)

- find missing packets by sequence number & fill from other downloads

- once all packets are present, remove 1st 26 characters from each line so that file
    starts with 'FF D8'
    cat cas-5a_22-combo.txt | cut -c 27- > 22-combo-less-27.txt
    
- remove line feeds so that entire text file (starting w/ 'FF D8') is on a single line

    cat 22-combo-less-27.txt | tr '\n' ' ' > 22-combo-one-line.txt
    
- convert single line TEXT file to binary hex file w/ .JPG extension

    cat 22-combo-one-line.txt | xxd -r -p > 22-combo.jpg
------------------------------------------------------------------

FYI, we got most of #23 last night - I'll try again today to get the remaining bytes.
#23 is HUGE!  794 packets.... that nice #22 picture that I posted with the satellite's
antenna was only something like 408 packets, I think.  So, I hope #23 is good and not
just lens flare.


Re^3: CAS-5A jpg trick?
K4KDR, Scott

Hello!  KSS (Kiss) files are a very common format that many applications can
take as input or write as output. I searched online for some documentation,
but it's such an old format that I am not finding much.  One overview is at:

http://www.ax25.net/kiss.aspx

... but that is talking more about using the KSS format to communicate with
hardware TNCs. That is not what we're talking about here.  A KSS file has a
certain format, so you need software (GNU Radio or DK3WN KissDump+) to pull
out only the hex bytes without the extra characters that are used in KSS files.

All of my how-to commands are for a linux system. 'cat' is a very common
command in linux; so is 'xxd'.  'cat' simply lists out a file.

The command to remove line feeds is shown below that comment... when you pipe
a file's contents (with the cat command) to the 'tr' command, you can remove
any characters you wish.  The escape code ' \n ' is a line feed.
You may wish to Google all these commands to get familiar with them & to see
examples. That is what I do!

So in summary, the original binary file is in the KSS format. That is converted
to a binary hex file, and then to TEXT to make editing easier. When you have all
the packets, convert back to binary hex to create the JPG file. If you are not
familiar with working with files this way, I know that sounds very complicated
and difficult, but it's not. Just need to learn the tools.

I hope that is helpful!



Back to Top
Back to Home Page