Using HamLib with Arduino

Greets to all! :slight_smile:

I've gotten a project for the Battleship New Jersey museum-ship radio club to develop an Arduino interface to a (currently unsupported) ham radio. I've found a C library system called "hamlib": (Ham Radio Control Libraries download | SourceForge.net)

...and it looks to be just the ticket - but there is no mention of Arduino. Has anyone here used this or have any ideas how such a library can be brought in - and even if possible... :fearful:

=Alan R.

A brief look at the code suggests to me that it was written with the assumption that it was being run on a machine that had a large amount of ram to spare - on the order of MB or even GB, rather than kB.
It would be very difficult to get it to run on an Arduino. Just their driver for an ICOM rig, for example, would be too big for an Arduino.

Which rig are you trying to connect to and what do you want the Arduino to do?

Pete

Pete - I'm just getting involved with this project. I've joined the radio club at the Battleship New Jersey museum, and they have a Navy radio in use as part of their ham station (3 positions). Naturally none of the logging and control software 'knows' about this radio. I've done a fair amount of programming and so they asked if I could build some sort of 'translator' that would take info from the Navy radio (don't have it's number at the moment) and some way map the data so it can be sent to a standard logging package.
The ship gets a lot of ham calls and having the extra station tied to the logging software would be a big help.

I'm a former ham, but haven't been active for many years, and all the (VERY COOL) digital stuff that has emerged is quite fascinating - but I don't know all the names yet! :~

AFAIK the Navy radio can be accessed with the CAT protocol - not even sure yet about all that! AND - I never thought about the huge size that hamlib might be as well! So - I'm prob way off base with this... just casting about for ideas how to approach this. Maybe hamlib could be tied to Access 2010... or the like.

=Alan R.

If you can get the spec of the protocol used by the Navy radio, you could (with some effort) use the Arduino to translate between that protocol and one of the more common ones so that the Navy radio looks like an IC735, for example, to the logging software.

Pete

Thanks - sounds like a good idea. Will dig in further...

Alan,
I have a bit of experience with HamLib and also using embedded systems (not so much with the Arduino but I'm learning). I have also written my own programs for my iMac to control my IC-706, IC91AD, IC9100, IC7100 and IC51A (at various times) to communicate over a serial line.
I would recommend that you don't try to use too many *nix-based libraries as they tend to assume capabilities (such as dynamic memory allocation from a very large heap). Embedded systems are typically memory and CPU (power) poor.
The CAT protocol is (if I remember correctly) fairly well documented (unlike the CI-V used by Icom that changes with each radio!!!) and it is far better to write your own code to perform the communication.
Susan VK3ANZ

Thanks Susan! I'm still coming to grips with all this - just becoming aware of the CAT protocol. I've found a PDF of the CAT commands - they look fairly simple - I'm guessing they might come out of a COMM port on the receiver? If so it shouldn't be to hard to capture them with the Arduino code, then do a translation to make the Navy radio look like some other, standard radio...

Much to learn!!

What did you use to write your Mac programs - Objective C?

=A.

Yes - I used Objective-C but that is just a super-set of C and you can write "standard" C and it will compile OK.
However there are other programs such as CHIRP that are written on other languages (CHIRP is in Python if I remember correctly) that are open source and might also be a useful model for you to use. However, the same caution applies in that many of these are written to handle multiple makes and models of radio and run from non-embedded environments.
In the end I would still recommend that you select the suitable language (C???) and start by writing the code to get a basic level of communication going with the radio (send a byte, receive a byte sort of thing- probably not hard as there are a number of low level libraries available for the Arduino) and then slowly build up the CAT (or whatever) level protocol on top of that to suit your specific radio.
Susan

Susan - Since I first wrote, I've learned more about this project. HamLib is def NOT needed!

It appears that all that is required is to translate the commands coming from and going to the transceiver (a Harris RF-350 aka RT-1446 aka AN/URR-119) to make it appear as a commonly defined radio as used in logging programs such as Win-EQF.

A command set for this radio has been deduced from looking at data-streams in a terminal program. I think setting up the Arduino's UART to monitor the RS-232 interface between the PC and radio and do table lookup's for the conversion.

Since I don't have the radio here I guess I'll have to set up an Arduino as an "RF-350 emulator" to talk to. The Devil is in the details... XD

=Alan R.