ad: hrd-2

Decode off-the-air Winlink message - request for programming help

Discussion in 'Working Different Modes' started by KX4O, Aug 6, 2019.

ad: L-HROutlet
ad: l-rl
ad: Left-3
ad: Left-2
ad: Subscribe
ad: L-MFJ
  1. KX4Z

    KX4Z Ham Member QRZ Page

    No. The only things I have running linux....are rasspberry pi's.
    After a good night's sleep: I'm going to see if I can get the newly-installed gcc compiler on this PC that I'm typing on, to compile. Windows is a different environment, but it is possible that the sample code I found may work here.

    I also have another raspberry or two laying around and I can switch the chips and see if it is a hardware issue on the one raspberry that can't seem to read the pactor even with minicom, microcom and putty. Hours and Hours have gone into this already......
  2. KX4Z

    KX4Z Ham Member QRZ Page

    Again, at this point I just don't have anything with Linux....other than Raspberry Pi's. I've always wanted a linux machine....built a few over the years but none here now.

    I have now gotten gcc installed on the pc.
    Totally different environment. Using mingw.....sure hope it came with all the new libraries (.h etc) that will be required.
    Found an example file that is supposed to be able to read serial port in windows. It compiles......can't test it here at McDonalds.....but that's a step in the right direction. Trying to avoid having to purchase some gargantuan compile system for windows......used to have theBorland compiler 3 decades ago....long since gone with Windows 2.11

    Windows is such a pain to me. But if it works, and I gain the ability to read the serial port.....that's the hardware that I have to have access to.

  3. KX4Z

    KX4Z Ham Member QRZ Page

    OK....who will be the first person to read the output of a pactor modem inside a programming environment?

  4. KX4Z

    KX4Z Ham Member QRZ Page


    Hans-Peter had Peter Mack come alongside to tutor me a bit and explain their custom baudrate stuff --- and pointed me to the very simple code routine they had already publilshed --- and I was able to take term.c and lock.c and the .h file -- and it COMPILED AN RAN on my tiny raspberry pi!!!!!

    It is now reading the modem!!!!

    I can see full ascii just the way they wrote it, and with a little twiddling I should be able to see the hex of the payload. All on the little Raspberry.

    In order to do this test, and move along more quieckly, I have two pactor stations set up to talk to each other, and a third station monitoring with a 7800 pactor modem. It all looks like an ungodlly mess, but it is the only way I could move this along. Every step of the way is PAINFUL. I literally have to sit here with a copy of kernighan & ritchie, and n additional computer so I can google commands, every time I need to write a new command in C. It has literallly been almost 30 years since I did this......I can''t even remember things like do you put a comma or a semicolon in a for speciffication???

    Then the keyboard I'm using on the raspberry is all screwed up, and I cannot even FIND the | mark. I'm going to find another keyboard here and finally have access to the key I need.......I tried changing it (it seems to want to be a spanish keyboard -- keeps defaulting to that, I dont even speak spanish) -- and this is the best I could find so far. It won't work AT ALL well if I try to tell it to be a USA keyboard. Then the QUOTE symbol is screwed up and the compiler complains.

    in other words: you have a rank beginner here working on this......
    (and someone thought I was bragging???)

  5. KX4Z

    KX4Z Ham Member QRZ Page

  6. KX4Z

    KX4Z Ham Member QRZ Page

    Now, I have spent an hour studying Kernighan and Ritchie, to reduce stupid mistakes, and I have investigated the various combinations of PMON VERBOSE and PMON HEX.

    The attached file shows what I figured out.

    Verbose three gives a ton of information about the packets, which should make it easy for a brilliant person (not me!!) to match them up properly

    Hex 2, seems to give everything out as ASCII 2character-represented hex.

    In other words, Two bytes 2d Will not be printed as a carriage return but instead as ā€œ2dā€ in the output of PMON Hex 2. That makes it really easy to see the hex characters on a screen . But to get back to the actual value, you have to do a conversion.

    I also managed to find a keyboard that works a ton better....
  7. KX4Z

    KX4Z Ham Member QRZ Page

    First primitive effort to capture pactor code into a file, using PMON. As this gets finished, then I start writing code to read and decode.

    Attached Files:

  8. KX4Z

    KX4Z Ham Member QRZ Page

    I just achieved my FIRST goal is decoding: I can find the FC EM file transfer proposal, and correctly capture the uncompressed size of the file to be uncompressed. (this little number was key to Huggins' ability to decode)
    In order to upload the file, I had to append ".txt" to it. Strip this out before you compile with gcc.

    tomorrow, I move further forward.

    The code is novice-written. The capturefile to be decoded MUST be


    Attached Files:

    KX4O likes this.
  9. KX4Z

    KX4Z Ham Member QRZ Page

    it took me two hours to wrap my head around the fact that the file needed by lzhuf.exe should have BINARY [0-255] characters, and that PMON HEX 1 produces 2-character hexadecimal representations of BINARY 1-byte [0-255] values sent over the radio. Quite a bit of time was wasted writing code to do the wrong thing until I understood that..... and now we have the grandkids over while their mother recovers from a minor medical thing....

    But now I have properly constructed the little-endian format of the unencoded file size, and have opened an lzhuf.exe-compatible output file and managed to write the first 8 bytes into it, the first three (I stopped at 64kbyte) being the little-endian format of the unencode file size.

    THANKS TO HUGGINS I was able to use hexdump -C in order to inspect my handiwork and show that I had succeeded.

    NEXT is to locate the beginning of the file. I'll have to capture a better capture than what I was working on to test this, but that shouldn't be difficult. In the hours of confusion last night and this mornng I re-learned how to count the bytes and so I think I understand it properly now. That will save precious time. While one can actually use either PMON HEX 1 [hexadecimal, comma separated representations of any binary PAYLOAD2 contents] or PMON HEX 2 [I think this is pure binary of PAYLOAD2 -- haven't tried it yet] -- I think it may be easier for me to use PMON HEX2 if it works on my modem. The diffference is merely a character re-configuration either for storing, or alternately for dsplaying. I'm on a simple 3B Raspberry Pi ($35 on Amazon) so I want SPEEDY CODE.

    Attached is the current readcapture.c (as a text file to allow upload) and it will take input precisely from

    and writes binary precisely to

    Attached Files:

    KX4O likes this.
  10. KX4O

    KX4O Ham Member QRZ Page

    There is no end of line in the frame data coming from the modem although there will be at the end of every string of data that leaves the modem. Remember, you only care about the contents of the modem data, not how this data is printed to the screen in PMON format.
    PMON HEX 2 is comma delimited output for all characters, not just the non-ascii ones as in PMON HEX 1.

    Hence use PMON HEX 2 to get everything as the byte values represented as two nibble hex characters... ie 'A5' = 10100101.

    You still have to convert this to a real binary value before writing it to a file. That's the step I perform using xxd in reverse mode.

Share This Page