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


● (No.1127) CAS-5A(FO-118) jpg trick? (2023年3月5日)
 ---------------------------------------------------

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!!

(訳)
トリックがあるわけではないです.... 簡単そうに聞こえるかもしれませんが、
(そうではないのに)、私たちはただ 全てのパケットを取得する必要があります。
パケット#1(含'FF D8' bytes)を取り逃すと、Decoder は次のように表示します。
 "Synchronization code not received".  次は、昨晩の#22の例です。N6RFM局
によるデコードです。 (ax.25ヘッダが削除されていますが、私のエディタでは
シーケンス番号が各行の先頭に付いています。)



...番号'008e'までは彼は全てのパケットを取得しているが、その後は失敗して
いることがわかります。そこで 完全な画像を得るために、私のデコードを見る
と、欠けているパケットがあったのです。コピー/貼付操作で、私のデコードか
らBobの欠落したパケットをすべて埋めることができたのです。大変幸運でした。

少なくとも一回のパスで、パケットの欠落がない100%完璧な画像が取れるのは、
一人の局としては本当に快挙だと思います。しかし 他の局からパケットを得ら
れなかったとしても、次のパスで または翌日でも、いつでも再度ダウンロード
できます。2-3回以上のパスで全てのパケットを蓄積し、不足しているパケット
を埋めることができます。幸運を!!

(参考)
@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.

(訳)
まず、追加のヒントを1つ....
いくつかの異なる画像をダウンロードする代わりに、(パスに時間があるならば)
同じ画像をできるだけ何度もダウンロードすることをお勧めします。そうすれば
ダウンロード#1 で見逃したパケットをダウンロード#2 から取得できる可能性が
あります。私は、Windows上の FRHED hex editor を好んで使っています。

https://frhed.sourceforge.net/en/

しかし、部分的なファイルを扱いやすくするために、私は TEXT に変換し、全て
のコピー/貼付操作に GEANY text editor を使用しています。全てのパケットを
取得したら、全ての INFO バイト(行#1 の「FF D8」までの全てと1行ごとに同じ
バイト数)を削除します。次に 改行を削除して、「FF D8」から「FF D9」までの
1行のテキストを作成します。最後に バイナリ16進数ファイルに変換して、一つ
の JPG file にします!

大まかな手順は次のようになります。(コマンドの例を含む)
-------------------------------------------------------
- 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
------------------------------------------------------------------

参考までに、昨夜は #23 のほとんどを取得しました。残りのバイトを取得する
ために、今日もう一度試してみます。 #23 は巨大で 794パケットもあります!
私が衛星アンテナと共に投稿した素敵な #22 の写真は、408パケット程度だった
と思います。だから、レンズフレアだけでなくて、#23 が良い写真であることを
願っています。 https://twitter.com/scott23192


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!

(訳)
KSS (Kiss) ファイルは、多くのアプリケーションが入力として取り込んだり、
出力として書き込んだりすることができる非常に一般的な形式です。いくつかの
ドキュメントをオンラインで検索しましたが、形式が古いためあまり見つかりま
せん。 一つの概要は次のとおりです。

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

...しかし、それはハードウェアTNCと通信するために KSSフォーマットを使用す
ることで知られています。ここではそういう話ではないのです。 KSSファイルに
は特定の形式があるために、KSS ファイルで使用されている余分な文字を除いて
16進数バイトのみを引き出すソフトウェア(GNU Radio または DK3WN KissDump+)
が必要です。

私の how-toコマンドはすべて Linuxシステム用で、'cat' はLinuxで非常に一般
的なコマンドです。'xxd' も同様です。 'cat' は単にファイルをリストします。

改行を削除するコマンドは、そのコメントの下に示されています。..ファイルの
内容を (cat コマンドを使って) 'tr'コマンドにパイプ(pipe)すると、望む任意
の文字を削除できます。エスケープ コード '\n' が改行です。 これらすべての
コマンドを Google で検索してそれらに慣れ、例を確認することをお勧めします。
これが私にできることです!

つまり、元のバイナリファイルは KSS形式です。それを バイナリhexファイルに
変換してから、編集を容易にするためにTEXTに変換します。すべてのパケットが
揃ったら、バイナリhexに変換して JPGファイルを作成します。この方法で ファ
イルを操作することに慣れていない場合は、とても複雑で難しいように聞こえる
かもしれませんが、そうではありません。ツールを学ぶだけです。
お役に立てば幸いです。



トップ へ戻る.
前のページ へ戻る.
次のページ へ移る.
ホームページ(目次) へ戻る.