Re: RS-232 Digital thermometer - interface and driver
From: Frank da Cruz (fdc_at_columbia.edu)
Date: 14 May 2004 16:04:38 GMT
On 2004-05-13, Keith <firstname.lastname@example.org> wrote:
: Thanks for the ideas. I'll have a look at what I've got available. I
: think that at least minicom and gkermit should be there.
Not G-Kermit; the one you need C-Kermit:
G-Kermit does not make connections, does not have a scripting language, etc.
C-Kermit should be included with every Linux distribution, but sometimes
it can be hard to find. For example, with Red Hat 9, you have to choose
Custom Install and then include the Applications/Communications group.
Minicom, last time I looked, does not include any automation or application-
building features; it's strictly interactive.
:> Once you get that working, all you need to do is write a simple
:> C program to send commands and display results... ;-)
: Or a simple C program that can be invoked as a command, so that I can
: use it in a bash script :-)
Or the entire application can be written as a Kermit script, without having
to coordinate with Bash, Expect, Perl, or anything else, and you don't
have to write any C code.
Btw, the disadvantage of programming applications like this yourself in C is
not just that you have to learn all the nutty APIs for accessing serial ports,
but that they are different for every operating system, including every
variation of Unix (Linux, BSD, AIX, Solaris, HP-UX, etc), so your application
won't be portable at all, should it need to be moved or shared with others.
Also, it won't be transport independent, in case your device is moved from a
serial port to, say, a Telnet-accessible reverse terminal server.
Kermit handles all the I/O for you in a transparent manner, and lets you
concentrate on the specifics of the problem at hand -- the commands and
responses of the device. The Kermit script you write to control the device
can move from Linux to BSD to Solaris to VMS to Windows to OS/2, etc, and
the only change required would be the device name. It can be moved from
a serial port to a network device and again, only minimal changes are needed.
I might have mentioned earlier that we keep a big library of Kermit scripts
for people to look at as examples:
If you write your thermometer application in Kermit language, you might
want to contribute it to the library.