In my efforts to decode the telemetry from FalconSat-3 I have been examining the formats of the BL (Broadcast log) files, the AL (Activity Log) files and the EL (Error Log) files. The formats of these files are "somewhere on the internet" I was told. Check the AMSAT archives, check the TAPR archives. I did and found a lot of files but not the ones I wanted. I did locate the DOS utilities to decode the files and can run them in a DosBox. ALOGDISP.exe gives an output like this:
FTL0 Activity Log for Mon Dec 30 00:04:26 2019
Time Activity Call Rx Session
1191230 00:04:26 BCST ON KC7MG-0 2 f#2bbd dur:0 l:244
1191230 00:04:29 BCST ON KC7MG-0 2 f#2bbd dur:0 l:244
1191230 00:04:57 ADEL OK f#2a70 (exp: (5df03753) 1191211 00:24:51)
1191230 00:05:01 BCST ON KC7MG-0 2 f#2bbd dur:0 l:244
1191230 00:12:14 BCST ON AC2CZ-0 2 f#2bca dur:0 l:244
1191230 00:12:18 LOGIN N8MH-0 2 005668
1191230 00:12:18 UPLOAD N8MH-0 f#2bd8 off:0 l#210
1191230 00:12:29 BCST ON N8MH-0 2 f#2bd5 dur:0 l:244
1191230 00:12:49 BCST ON N8MH-0 2 f#2bc6 dur:0 l:244
1191230 00:12:52 UPLOAD N8MH-0 f#2bdb off:0 l#216
1191230 00:12:55 LOGOUT N8MH-0 005668 user disconnect
1191230 00:13:36 ADEL OK f#2a63 (exp: (5df05120) 1191211 02:14:56)
1191230 00:13:38 ADEL OK f#2a73 (exp: (5df057ed) 1191211 02:43:57)
1191230 00:14:19 BCST ON N1RCN-0 2 f#2bd4 dur:0 l:244
1191230 00:14:39 BLOWOFF N8MH-0 Unexpected input (uplink data)
1191230 00:14:40 LOGOUT N8MH-0 005670 server disconnect
Incomplete U/L @ 642 bytes
1191230 00:14:45 ADEL OK f#2a75 (exp: (5df07888) 1191211 05:03:04)
1191230 00:14:48 LOGIN N8MH-0 2 005671
1191230 00:15:45 BLOWOFF N8MH-0 Unexpected input (uplink command)
1191230 00:17:53 FREE DISK 14018256 bytes
The first few input bytes are shown below and it is not obvious how to go from one to the other:
To understand these types of records I looked at the distance from one callsign to the next. It is often 20 bytes, suggesting the records are 20 bytes long, but sometimes it is longer and sometimes shorter. So the format is variable in length. It does not look like there is a byte offset that correspond to the length of the records, so there must be some other byte that tells the decoder what format to use. There are also a lot of keywords such as "BCAST ON", "ADEL OK", "LOGOUT" and I will need a lookup table for them all. Building it by hand by reverse engineering a few files will be painful.
So I set out looking for the source code.
Initially I found http://vectorbd.vectorbd.com/bfd/oscar/index.html when searching for "alogdisp.exe source". That had a file called alogdisp.lzh which when decompressed (with 7zip) revealed the source code for ALOGDISP.exe. Great, but where are the others? A further search for BLOGDISP.C took me to http://ring.u-toyama.ac.jp/archives/misc/ham/funet/00Index.all which showed a huge listing of amateur radio files including entries like:
alogdisp.zip UoSAT/Microsat Activity Log Display - NK6K & G0/K8KA
ao16chrt.zip AO-16 statistics for 1991 in chart format (GIFs)
blogdisp.zip UoSAT/Microsat Broadcast Log Display
display.zip View/decode raw CCD imagers from UO-22 (by VK5HI)
eltdisp.zip Microsoat ELTLOG decode and display
That's what I want! But the actual files were not there on the site. But now I have a clear set of file names. I searched with that and ended up back at the AMSAT archive, which I had searched by hand once before. The key diretory, which I had missed, is: ftp://ftp.amsat.org/amsat/software/PC/pacsat/. That contains zip files for all of the DOS programs, with their source code! So now I have what I need.
These have a huge amount of information in them. I pasted some example output above and we see see some entries that say things like " Unexpected input (uplink data)". That could well be a bug in the Pacsat Groundstation, so I want to better understand what it means. The c source code and header file show the layouts that can exist. There seems to be two types of records in these structures and then each can also have some additional long integers that can be variable in length:
struct ALOG_1 {
unsigned char event; /* event code */
unsigned char len; /* length of entry */
unsigned long tstamp; /* time stamp */
unsigned int serial_no; /* serial number */
unsigned char rxchan; /* rx channel */
};
struct ALOG_2 {
unsigned char event; /* event code */
unsigned char len; /* length of entry */
unsigned long tstamp; /* time stamp */
unsigned int serial_no; /* serial number */
unsigned char rxchan; /* rx channel */
unsigned char call[6]; /* callsign */
unsigned char ssid; /* ssid */
};
I will port the C code to java as it looks straightforward. Given the different layouts I will have a couple of classes for the different layouts. From the code it looks like I just need ALOG_1F and ALOG_2F.
As an example let's look at the first record. It has these bytes:
07 20 0A 3F 09 5E 00 00 02 4B 43 37 4D 47 00 00 BD 2B 00 00 00 00 00 00 00 00
The first bytes is 07 and this is the event. The code translates that to ALOG_BCAST_START and notes it is "added to the list". It prints the event out as "BCST ON". The full first line is translated by the program to:
1191230 00:04:26 BCST ON KC7MG-0 2 f#2bbd dur:0 l:244
The date looks screwy, with an extra 1 at the front, but otherwise it is 2019-12-30 at 4 mins past midnight. And it is indeed a BCST ON event from KC7MG. Some fiddling with Java and I am able to get exactly the same result. Here are the first few lines from the Java port:
FTL0 Activity Log. Length: 6590 bytes
Time Activity Call Rx Session
30 Dec 19 00:04:26 BCST ON KC7MG-0 2 File:2bbd 0s broadcast, with Pkt Len:244
30 Dec 19 00:04:29 BCST ON KC7MG-0 2 File:2bbd 0s broadcast, with Pkt Len:244
30 Dec 19 00:04:57 ADEL OK File:2a70 (exp: (5df03753) 11 Dec 19 00:24:51
30 Dec 19 00:05:01 BCST ON KC7MG-0 2 File:2bbd 0s broadcast, with Pkt Len:244
30 Dec 19 00:05:04 BCST ON KC7MG-0 2 File:2bbd 0s broadcast, with Pkt Len:244
30 Dec 19 00:07:02 BCST ON KC7MG-0 2 File:2bd7 0s broadcast, with Pkt Len:244
30 Dec 19 00:07:07 BCST ON KC7MG-0 2 File:2bd4 0s broadcast, with Pkt Len:244
30 Dec 19 00:07:47 BCST ON KC7MG-0 2 File:2bca 0s broadcast, with Pkt Len:244
30 Dec 19 00:07:48 BCST ON KC7MG-0 2 File:2bc9 0s broadcast, with Pkt Len:244
I will put this into release 0.37. So on to the BL and EL logs??
73
Chris
g0kla/ac2Cz
Enter Comments Here:
Copyright 2001-2021 Chris Thompson
Send me an email