pat compose form

61 views
Skip to first unread message

Jerry Davis

unread,
Mar 13, 2025, 12:38:47 PM3/13/25
to pat-users
I have been successful with scripting the pat compose cli command, but I have tried every way possible to get pat composeform to work.

So, has anyone successfully done a script to make pat composeform work?

If no one has done a script, so, exactly what does pat composeform do? I assumed that it would be like pat compose, and compose a message with the form data in it like in the http version. But all it does is error out.

Jerry WF5W

Jerry Davis

unread,
Mar 14, 2025, 7:01:34 PM3/14/25
to pat-users
ok. This command is REALLY REALLY PAINFUL. But I sorta got it to work.
This is what I did:

1. I went into pat via the website:
2. Created a message, filled in the from, the to, and the subject line
3. while in the compose I clicked the Templates button, which took me into the form
4. I chose the ICS 213 form, filled it all in, and SAVED the data to a file.

5. I did a pat composeform (what a mess!!!!!)

here is the command line, I finally figured out to use:

$ /usr/bin/cat SAVED.data.txt | pat composeform --template <full path to the ICS213 General txt>

6. at this point it DOES post it. But the posted message will ERROR out, so you must edit it!
7. cd to your out/ folder (in linux it is: ~/.local/share/pat/mailbox/<YOUR CALLSIGN>/out
8. I used vi to edit the latest file in the list (its a .b2f file)

edit the FROM field, from { to your callsign
edit the To field, from "" to SMTP:your...@yourdomain.com, making sure you don't have the quotes

9. do a pat connect telnet

ALL of this FINALLY worked. This sub command needs a LOT of work to make it work correctly. A LOT of work.

This should not have been so hard. But it was.

Jerry WF5W



73,
Jerry
----
Extra Ham Radio Operator: WF5W
Registered Linux User: 275424
3D CAD designer (FreeCAD)

The most exciting phrase to hear in science - the one that heralds new discoveries - is not "Eureka" but "That's funny...". - Isaac. Asimov


--
You received this message because you are subscribed to the Google Groups "pat-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pat-users+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/pat-users/3d2e8859-27d0-41da-ab6a-702e0d2200fen%40googlegroups.com.

Martin Hebnes Pedersen

unread,
Mar 15, 2025, 5:36:53 AM3/15/25
to Jerry Davis, pat-users
Hi Jerry,

Can you please explain what you are attempting to achieve?

The winlink templates are really designed to prompt a _user_ for input. It's a highly interactive process, by design.

It might be easier to write a program that outputs the appropriate XML, and use a script to send this using pat compose. You could basically get the same resulting message, but without the hassle of scripting the template prompt.

-- 
73 de LA5NTA / Martin

Jerry Davis

unread,
Mar 15, 2025, 7:20:42 AM3/15/25
to Martin Hebnes Pedersen, pat-users
Yes, Martin. I will attempt to explain.

Our club has quite a few ARES members. A lot of us live within 1 mile of the Gulf and hurricane season will be upon us once again on June 1st.

Although, the http version, is nice and is pretty well thought out, the interface is NOT for the uninitiated. This year, we plan to do an exercise at either a Walmart, or Lowes that will use a new interface I designed to just send email (for health and welfare). I have 2 interfaces. A web form, and a python QT GUI. Both interfaces have 3 inputs (to, subject [ partially filled in ], and a message box), and a "Send" button. This posts the message, blanks the screen waiting for the next person in line. Later on, after reviewing the messages, we do a pat connect {whatever} to send the messages.

The above exercise, is so that the common person, can type in a "health and welfare" message to their loved ones, if for some reason, we have another major (God forbid) hurricane like Katrina, or if the cell towers are either flooded with too many simultaneous calls or down otherwise, and if internet is generally down.

We, as part of ARES, need to send forms (especially the ICS 213), to various other parties, and I thought I could modify the email script I had written to do that with the pat composeform. But it is not ready for prime time. If we did that, I would have to do all the steps I outlined in steps 5-8 via a script to make this work. I'm not sure how to do that UNLESS I assume that the last message posted in (time wise) in the OUT box is the message posted, because when I do the command, if all is ok, it only says "Message posted", and not the filename that it posted it to. Well, we all know what it means to ASSUME something. So here we are. 

Also, I am an old school, (long retired), programmer, and I like to do a lot of things by scripting, instead of always using a GUI. I have other CLI scripts that use my code as well. The above was only 1 example.

I hope this helps clarify.

Jerry WF5W




73,
Jerry
----
Extra Ham Radio Operator: WF5W
Registered Linux User: 275424
3D CAD designer (FreeCAD)

The most exciting phrase to hear in science - the one that heralds new discoveries - is not "Eureka" but "That's funny...". - Isaac. Asimov

Jan Peterson

unread,
Mar 15, 2025, 1:56:12 PM3/15/25
to pat-...@googlegroups.com
I think Martin is suggesting that you have your script produce the same information that the form would (the form turns into an XML file that is actually sent by winlink... the format of the message itself).  Just generate the same format of message that the form would and send it with the normal pat compose command.

cat your_xml_file | pat compose -s subject destination_addresses

Of course, your script can open pat compose and print directly to it. 

I don't know the particulars for the ICS 213 off the top of my head, but compose one of them with the form and look at the message in your outbox and mimic the format you see in the message itself.  You will need to update it if the format of the 213 form changes, but that's unlikely.

Hope this helps.

73 de KD7ZWV
  -jan-

Jerry Davis

unread,
Mar 15, 2025, 8:09:38 PM3/15/25
to Jan Peterson, pat-...@googlegroups.com

Yes. I could do that.bthat was a lot more scripting and work than I was planning on. That's what I was hoping that the Pat composeform would do.

Perhaps the Pat composeform could be used to instead of posting a message be changed to output to stdout the message body, and the I could then do a part compose to create the message later? That might actually work

Jerry


Wiley Sanders

unread,
Mar 16, 2025, 2:06:54 PM3/16/25
to pat-users
You should be able to drop a properly formatted message in
.local/share/pat/mailbox/<callsign>/out and pat will deliver it. The b2f file
format is documented here: https://winlink.org/B2F

You will need to include the form data in whatever format Winlink uses. The form uses a
lump of XML that is attached as a base64 encoded MIME type. If you send a 
form to some non-Winlink email address you'll be able to see this. 

I last researched this 5 or more years ago and IIRC, and the documentation for forms
didn't really exist. There wasn't a public group to get help with Winlink
development at the time, so I didn't get any answers to my questions. 

I use Winlink over AREDN mesh. Given the bandwidth of AREDN, attaching
a PDF file is fine for my purposes.
Reply all
Reply to author
Forward
0 new messages