Looking for Scriptable asynchronous communication tools
Anyone know of any scriptable asynchronous communication tools?
The closest so-far appears to be Kermit. It's been around since CP/M, but apparently there's still no centralised language reference and the syntax predates Perl.
I think something like expect also exists for more modern languages, but tcl is still easy enough to learn (just a little unusual, everything is a string)
Kermit on top of FTP can work really well. Kermit has its own communication and transfer protocol, IIRC, but updates in the 1990's allowed it to be used with TCP/IP and FTP. So you can write a script to log into a remote system, run some commands and then initiate a file transfer. The scripting allows you to wait for responses and act on them.
Yes. As I said, I'm aware of Kermit. It's like sendmail, user friendly, just picky who it makes friends with.
I have not discovered a complete language reference for Kermit, neither have I been able to determine if it works asynchronously, since the examples I've found are just polling loops, which is not what I need.
My use case is talking over serial to a CNC to iteratively calibrate it. This requires dealing with asynchronous events, think move, interrupt by edge switch.
Keep in mind that it has been decades since I last used Kermit, but I'm pretty sure the use case it was originally designed for was...
Connect to a serial port, which had a modem attached. Talk to the modem and get it to dial a number. Presumably, the remote end answered and the port attached to its modem would issue a login prompt. Negotiate the login and then issue a bunch of commands to change directories and then launch Kermit on the remote system. After that Kermit to Kermit communications took over until you terminated the session. Finally, log off the remote system and hang up the modem.
All of this stuff could be done via scripts. I seem to remember that it would actually wait for a response, and then parse the response in the script. I don't remember ever doing polling loops.
If you're on a *nix box of some type, it's totally possible to open up a serial port for manual I/O even in something like a bash script. Even if you have to reverse telnet to a terminal server.