Using the Serial Port
RPi900 connects the DNT900 radio to your Raspberry Pi using the
ttyAMA0 serial port. Some familiarity with the use of TTY ports under Linux will be beneficial. Once your serial port and radio are properly configured, communicating with the radio is as simple as writing to and reading from a TTY device.
In these tutorials, Arch Linux ARM is the preferred distribution to use. It’s well-suited to running as a headless server (a likely arrangement when operating your RPi900 as a base or remote station).
It is convenient to give yourself the correct permissions to access
/dev/ttyAMA0 serial device. Do so by adding yourself to the
On the next login, you should now be able to work with
/dev/ttyAMA0 without root privileges:
Disabling the Serial Console
The Raspberry Pi Arch Linux distribution is pre-configured to provide a system console over the serial port. You are unlikely to want this, as the serial port will be permanently attached to the DNT900 radio.
Disabling the serial console requires editing
/boot/cmdline.txt. Remove any references to
ttyAMA0 in this file. You’ll also need to disable the terminal service.
Note that if you install the rpi900 package (as described in the next tutorial), this step is performed automatically.
Sending Data Manually
By default, the DNT900 is initially configured in transparent mode. In this mode, any characters it receives on the serial lines are transmitted via the radio link to the remote radio. The radio essentially operates as a ‘serial cable replacement’.
stty command to configure the serial port prior to use in transparent mode. At a minimum, the data rate needs to be set; this will initially be 9600 b/s, the DNT900 default. (You can change this later.)
Depending on what device is attached to the remote radio, you may also need to set other parameters –
raw mode, for example. For more information on
stty, and a glimpse of the arcane world of TTY:
Sending and receiving characters is then as simple as writing to and reading the
If you intend to send large amounts of data at high speeds using transparent mode, you will also need to enable hardware flow control on the serial port. This prevents data loss caused by overflow of the radio’s storage buffers. The rpirtscts utility lets you do this.
DNT900 Line Discipline
Instead of using the DNT900 in transparent mode, I recommend using the DNT900 line discipline to access all the features of the radio. This and other RPi900 software is available as pacman packages which are simple to download and install. The RPi900 package repository is the subject of the next tutorial.