Setting up AX.25 over 1200bps was easy enough. For 9600 I got kernel panics on the raspberry pi, so I wrote my own AX.25 stack.

But I also want to try to run AX.25 over D-Star. Why? Because then I can use radios not capable of 9600 AX.25, and because it’s fun.

It seems that radios (at least the two I’ve been working with) expose the D-Star data channel as a byte stream coming over a serial connection. Unlike working with a TNC you don’t have to talk KISS to turn the byte stream into packets, and vice versa.

IC9700 setup

The first hurdle to overcome, because we want to send binary data, is to escape the XON/XOFF flow control characters that the IC9700 mandates. Otherwise we won’t be able to send 0x13 or 0x11. Other bytes seem to go through just fine.

So I wrote a wrapper for that, taking /dev/ttyUSB1 on one side, and turning it into (e.g.) /dev/pts/20 for use with kissattach.

$ ./dsax /dev/ttyUSB1
/dev/pts/20
$ kissattach /dev/pts/20 radio
$ kissattach -p radio -c 2     # See below

Set Menu>Set>DV/DD Set>DV Data TX to Auto, for “automatic PTT”. As soon as there’s even one byte written to the serial port, it’ll start to transmit. Also you probably want to turn on Menu>Set>Dv/DD Set>DV Fast Data>Fast Data, to increase speed from (according to the manual) about 950bps to 3480bps.

Kenwood TH-D74 setup

D74 does not use XON/XOFF (Operating Tips manual section 3.3), but because we escaped/unescaped the characters on the IC9700 side, we need to do the same on the D74 side.

D-Star data is delivered on Bluetooth channel 2, so a serial decive can be created using rfcomm bind /dev/rfcomm0 $D74_MAC_ADDR 2.

On KISS

Note that I’m actually speaking KISS between the two kernels. There’s no real TNC, just a byte stream.

Collision avoidance

In my testing it seems that both radios are clever enough not to start transmitting in the middle of receiving, and wait nicely for their turn.

Bug: No flow control actually used by IC9700

The IC9700 does not seem to actually use its XON/XOFF to slow down the data it’s being sent. If I set the serial port to 9600 it’ll lose a lot of data. If I set it to 1200 it’ll actually still lose a lot of data (even when in Fast Data mode).

It seems to have a really shallow buffer, too. If I set manual PTT mode (Menu>Set>DV/DD Set>DV Data TX to PTT and write a bunch to the serial port, then trigger PTT, only the last 430-474 or so seem to actually be sent.

$ stty -F /dev/ttyUSB1 raw -echo ixon ixoff 9600
$ cat dsax.cc > /dev/ttyUSB1          # Takes a while
$  # press PTT now

In fact I had to turn on CRC because parts of frames were being dropped. kissparms -p radio -c 2 (on both sides)

According to Operating Manual 3.2.2 the D74 has transmit and receive buffer sizes are 3kB and 4kB respectively. That’s for KISS mode, so I’m just assuming the same for D-Star data.

Bug: The D74 turns off the rx light and stops beeping if tx while rx

If the D74 is receiving, and you send it data, then it’ll turn off the receive light for the remainder of the reception. It will also turn off the speaker, which until then went beep once a second while data was being transferred.

Bug: The D74 does not send data that was queued during a receive

So while it doesn’t interfere with what’s in progress, it does drop packets on collision. This is a bug I have to work around in my XON/XOFF wrapper.

Until that’s implemented expect lots of dropped packets.

Conclusion

So is this a good idea? Maybe. If you want to do AX.25 over a D-Star reflector then yes. If you want data access over a D-Star repeater, then this is where the data channel is.

Of course, it may be better in that case to implement a protocol (maybe AX.25) over AX.25 UI frames and use the standard AX.25 infrastructure for your point to point.

D-Star is faster, 3480bps vs 1200bps. But then again if you have the right radio you can run AX.25 over G3RUH at 9600bps. But D-Star takes only 6.25kHz and these other FM modulations take 10-15kHz.

D-Star does support higher speeds (3480bps, and even 128kbps at 1.2Ghz), so could be worth playing with.

But I wouldn’t do it with the IC9700. The bug where it loses data (presumably due to not actually sending XON/XOFF) makes it about half the speed it should be, on the retransmits.

Everything was fine between two D74s. So as soon as I work around the bug where it won’t queue a send if it’s currently receiving, seems pretty cool.

The firmware on the radios were the latest. 1.31 for IC9700, and 1.11 for D74.

Future

Since this is how pictures are sent over D-Star, I’d like to be able to decode the image format.