Programming Motorola Radios
with the Raspberry Pi

Introduction

For many years hams have been using Motorola commercial radios modified for amateur radio use. Since the commercial changeover to narrow-band some years ago a great deal of the now unusable commercial equipment is available to the amateur community. One of the sticking points of using these radios has been the programming which required access to the software and more importantly a computer and hardware that was able to do it. It was widely accepted that you would need an old slow computer with a dedicated serial port to do this and trying anything else either did not work or was very finicky. Most would either not have the software or proper hardware. Because of this we have implemented a novel approach that should work consistently using a Raspberry Pi, the hamvoip software, and a couple of inexpensive cables. This works on the hamvoip Archlinux installation and can be used in conjunction with a running Allstar system in fact I have used a node on the same server while I was programming without any problems. This also could add the ability to program a radio at a remote site without being there.

Technical Description

The hamvoip programming package uses dosbox a program to simulate MSDOS. The Raspberry Pi is an excellent platform to do this as it is readily available and provides a consistent environment to run the code. Because it was not desirable to install the entire graphics package in the hamvoip installation, which would be necessary to run DOSBOX directly on the Pi, we instead do X11 forwarding to an X11 server where the program is displayed. The Motorola programming packages run under this MSDOS environment. All timings and configurations have been preset and so far have worked with all tested radios. Be aware that this uses a supplied custom compiled dosbox which works with the FTDI controller to supply the required custom baudrates that the Motorola radios require.

Hardware

Here are the suggested parts required for programming

Software Downloading and Configuration

Assuming you already have a configured hamvoip V1.5 system that has been updated to the latest version you will need to download the dosprogs package from the hamvoip repository using the following command at the Linux prompt -

pacman -Syu hamvoip-dosprogs

Then execute the following commands at the Linux prompt -

echo "AddressFamily inet" >> /etc/ssh/sshd_config
echo "X11Forwarding yes" >> /etc/ssh/sshd_config
echo "X11UseLocalhost no" >> /etc/ssh/sshd_config
echo "XAuthLocation /usr/bin/xauth" >> /etc/ssh/sshd_config
systemctl restart sshd

It is important that these commands are executed as shown. Ensure that you type them in properly. If you can it is best to cut and paste each line separately to the Pi Linux prompt.

This completes the programming of the Pi's software configuration. Do not attempt to run dosbox or any of the DOS programs at the Pi end. They are meant to be run from an ssh connection with an X11 server as descibed later in this document.

Hardware configuration

The FTDI USB to serial converter should be plugged into the Pi. This is preconfigured in the software as ttyUSB0. If you have other USB to serial adapters plugged into your Pi the adapter may show up as ttyUSB1,2,etc. Remove all other USB to serial adapters and plug in the FTDI programming adapter first. To see what device was assigned to your adpater type "dmesg" at the Linux prompt after plugging the cable in. It should look like this -

[56407.323686] ftdi_sio 1-1.2:1.0: FTDI USB Serial Device converter detected
[56407.324042] usb 1-1.2: Detected FT232RL
[56407.326162] usb 1-1.2: FTDI USB Serial Device converter now attached to ttyUSB0


In this case it shows ttyUSB0 which is the proper port for the dosbox configuration.

Note that this has to be an FTDI interface and clones while reporting FT232RL may not work. Clones cost less than $10 often $3 or less. Expect to pay more than $10-$12 for a real interface. The reason the Genuine FTDI FT232RL adapter is specified is that programming some old radios, like the Maxtrac, require non-standard serial data rates, for example: 952 BPS (Bits Per Second) or 7680 BPS. These oddball serial speeds don't work with most USB-serial adapters, even including genuine PL2303 adapters. However, real FT232RL chips very accurately emulate features found in the original PC computer 8250/16450/16550 UART chips, allowing these odd data rates to be generated.

Connecting to your Pi and using DOSBOX

Linux

DOSBOX is a graphical program and since we do not have nor want the graphical interface in the hamvoip Allstar release we do X11 forwarding via SSH. You need to use an X11 server at the display end in order to connect and use DOSBOX. To do this on a Linux computer with a graphical interface you can use ssh in a command window on the server. The server is defined as the computer you use to display the output of the dosbox program. The dosbox program is actually running on the Pi which is connected to the radio being programmed with it display running on the X11 server.

Here is an ssh example, use your own values for IP address or domain and port. The IP address and port will be those of the Pi used to program the radio. While the two computers are usually located nearby one could conceivably be halfway around the world. The -X is probably not needed but it does not hurt to use it and it may be necessary on some systems.

ssh -X root@192.168.1.100 -p 222

Login to your Allstar server as normal and the Admin menu will be displayed. Select Item 9, start bash shell. At the Linux prompt type "dosbox" and this will open another window on your desktop. When dosbox is run Norton Commander is started to navigaate the directories and files and execute the programs. If you want to navigate manually you can exit Norton Commander using the F10 key. When you are finished type EXIT at the dosbox prompt.

Windows

The preferred program in MS Windows is MobaXterm. Select the free and installer edition. Once installed select session, ssh, and enter your hostname or IP address, login username, and port. Login to your Allstar system and you will get the Admin menu. Select Item 9, start bash shell. At the Linux prompt type "dosbox" and this will open another window on your desktop. When dosbox is run Norton Commander is started to navigaate the directories and files and execute the programs. If you want to navigate manually you can exit Norton Commander using the F10 key. When you are finished type EXIT at the dosbox prompt.

I have used a virtualbox win7 running in Ubuntu and it works fine.

Apple Mac

X11 support no longer exists on the Mac. This link gives an alternative for Mac users - X11 for the Apple Mac

Mac users will also need to make the following change to eliminate crazy key mappings - change the line "usescancodes=true" to "usescancodes=false" in the /root/.dosbox/dosbox-0.74.conf file on your Pi. This line is about 34 lines down from the top of the file.

You can define the dosbox config file on the command line - dosbox -conf filename - So if you want to be able to use it with both mac and non-mac systems you could copy the existing config file to a new name and change the above usecancodes parameter and then use the -conf command line directive to use that file when using a mac. This would preserve the normal behavior when not using the -conf directive.

Application Notes

The base package load adds the files (radios) - EFJOHNSON GM300V5 MARATRC5 MAX5LAB MAXTRC6 VERTEX X9000

An additional package of radios has been added on 12/9/17. To get the additional radios execute the following line -

pacman -Syu hamvoip-dosmisc1

This package adds the files (radios) - GM300V4, GP300, HT1000, HT50, HT600, MT1000, Mtsx, P110, P200, QUANTAR, R100ham, RADM100, specham, Spectra

This method does require two computers but it could be just two Pi's. I run a Pi 3 in the workshop running a full blown graphical system like Ubuntu Mate 16.04. The Ubuntu Pi with monitor and keyboard would be used to connect via LAN to the programming Pi which is running the hamvoip code.

As a side benefit the X11 forwarding setup on the hamvoip Pi will work for other graphical programs running on the hamvoip V1.5 system like fldigi, chirp, etc. Like the dosbox program they would be viewed remotely on the server computer.

You could remotely program a radio at a distant site using these methods.

Some users may want to use a dedicated non-Allstar Pi to do the programming. It is cheap enough to dedicate another Pi. You can disable the loading of Allstar by commenting the "/usr/local/etc/rc.allstar" line in /etc/rc.local. Putting a # at the beginning of this line comments it. In addition you can disable the Admin menu by commenting the "exec /usr/local/sbin/admin.sh" line in /root/.bash_profile. It is the last line in the file. Reboot after making these changes. When you login to your programming Pi you will now go directly to the Linux prompt where you can type "dosbox"

The application works equally well on a Pi2 although noticeably slower. A good use for your old Pi2's.

Acknowledgements

Thanks to Dave, KB4FXC for his assistance and perseverance in getting this going.

© 2017, 2018 - hamvoip.org