Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

Setup IP Networking via Packet Radio with DireWolf and IL2P

By: KN4MKB
17 September 2024 at 17:46

This guide will get you a working TCP/IP network connection over the 2m or 70cm band over just about any radio. This guide will get you a working direwolf installation, a program called tncattach installed, and a network interface connected via IL2P (Improved Layer 2 Protocol). Tncattach is a modern way of creating am IP interface for KISS TNC’s. IL2P is an improvement on the AX.25 protocol to add error correction without the overhead that FX.25 has. Direwolf is a software TNC, eliminating the need for extra hardware.

Prerequisites

Creating a User

Otherwise, follow long to create a user we will use for the rest of the guide.

Swap to the root user if you haven’t already:

#On Debian/Ubuntu
su -l
#On Raspi
sudo su

As root enter the following commands (replace “yourusername” with your chosen username):

apt-get update
apt-get upgrade
apt install sudo
adduser yourusername
sudo usermod -aG pulse-access yourusername
sudo usermod -aG audio yourusername
sudo usermod -aG plugdev yourusername
sudo usermod -aG dialout yourusername
sudo usermod -aG sudo yourusername

Go ahead and reboot the server or relog/ssh into your terminal session as your new user before proceeding.

sudo reboot

Everything from now on will be ran in the context of the new user you just created.

Install Direwolf

This is a quick down and dirty on getting a basic installation of direwolf up and running. It will assume you are using the digirig. For a full guide, with details and all supported sound card interfaces, see this guide (The Ultimate guide to DireWolf)

Issue the following commands to install the latest version of direwolf as a standard user:

sudo apt-get update
sudo apt-get install git
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install make
sudo apt-get install cmake
sudo apt-get install libasound2-dev
sudo apt-get install libudev-dev
sudo apt-get install libavahi-client-dev
sudo apt-get install alsa-utils
cd ~
git clone https://www.github.com/wb2osz/direwolf
cd direwolf
git checkout dev
mkdir build && cd build
cmake ..
make -j4
sudo make install
make install-conf
cd ~

Sound Card Interface

Grab your soundcard device numbers by issuing the following command:

arecord -l

You will see a list of cards, locate the one that has your sound card interface (such as “usb” if using the digirig). Note down the card number, as well as the device number. Most likely 0/0 or 1/0. You will need these numbers for the next part.

Now issue the following command to setup volume levels, and disable AGC:

alsamixer

Press “F6” and use your arrow keys to select your radios sound card interface. Set the speaker volume to 50. If the Microphone seciton has “MM” arrow key to it, and press “M” on your keyboard to unmute it, and set the microphone volume to 10. If a”AGC” bar is present, arrow key to it and Press “M” to mute it. Press escape to close the window, and enter the following command the save the settings:

sudo alsactl store

Serial PTT Setup

We will also need to know the serial port path for PTT. These devices are located in /dev/. If using a usb PTT interface, your PTT serial path will be in the format “/dev/ttyUSBX” .

You can see a list of devices with the following command:

ls -l /dev

Setup the Direwolf Config File for IL2P and Networking

We will now create a new direwolf configuration file. You will need to replace the numbers after “ADEVICE plughw:” with the card and device number found above in the Sound Card Interface section. You will need to replace the serial path after “PTT” with your own. “RTS” used after the path here is for the digirig. This can be RTS or DTR depending on your interface.

Enter the following command to create a new config file:

nano ~/direwolf-network.conf

In the file, paste the following configuration, adjusting the PTT serial path, and ADEVICE card numbers as needed from the results we found previously:

ADEVICE plughw:1,0
CHANNEL 0
IL2PTX 1
MODEM 1200
PTT /dev/ttyUSB0 RTS
AGWPORT 9998
KISSPORT 8001
RETRY 3
FRACK 3
MAXFRAME 7
EMAXFRAME 63
PACLEN 512
DWAIT 0
TXDELAY 20
TXTAIL 10

Press Ctrl+X to Save.

Install tncattach:

sudo apt install git
sudo apt install build-essential
git clone https://github.com/markqvist/tncattach.git
cd tncattach
make
sudo make install

Starting and Testing the Network

We will now need 3 terminal windows to start and test everything. After this, we will move it all to services so that it’s all started on boot automatically.

On Terminal 1, Start Dire Wolf (replacing “youruser” with your own):

direwolf -d kn -c /home/youruser/direwolf-network.conf

On Terminal 2, Start TNC Attach.

Use the following command if you want a Point to Point network (2 IP’s) with no Ethernet overhead:
( The “KN4MKBTNCATTACH” portion of the below needs to contain your own callsign, and must be at least 15 char long) It is used as ID.

sudo tncattach --kisstcp --tcphost=127.0.0.1 --tcpport=8001 -s 'KN4MKBTNCATTACH' -t 600 -m 508 --noipv6 --noup -v

If you instead want to have a network where more than 2 people can communicate, you will need to use the following command instead of the above to add Ethernet frames into the mix (The MTU is adjusted here to leave room for 22 bytes of overhead from the Ethernet frames comapred to the direwolf PACLEN):

sudo tncattach --kisstcp --tcphost=127.0.0.1 --tcpport=8001 -s 'KN4MKBTNCATTACH' -t 600 --ethernet --mtu 490 --noipv6 --ipv4 44.0.0.1/24

In the above command, we give ourselves the IP “44.0.0.1”, and will be able to communicate with anyone on that network via packet.

On Terminal 3, Create the Network Tunnel (Only If using the Point to Point command above):
In the below example, 44.0.0.1 will become your own IP in the radio network, while 44.0.0.2 would be the destination IP. On the other server, connected to a different radio, these IP addresses would be reversed.

sudo ifconfig tnc0 44.0.0.1 pointopoint 44.0.0.2

Testing the network:

If everything goes error free above, you should now be able to ping a distant end, in the example case “44.0.0.2”. You can use the following command to send a single ping:

ping -c 1 44.0.0.2

If all goes well, you should see a reply back. If not, check the direwolf window to make sure the packets are being decoded properly.

Setup Start on Boot

We will now setup the entire network stack to come up when your server is booted.

Install Screen:

sudo apt install screen

Setup Direwolf auto start:

sudo nano /etc/systemd/system/direwolf.service

Paste the following, changing “yourusername” in the three separate areas with your own:

[Unit]
Description=Direwolf
After=network.target

[Service]
Type=forking
ExecStart=screen -S direwolf -dm bash -c "direwolf -d kn -c /home/youruser/direwolf-network.conf; exec sh"
Restart=always
User=kn4mkb
Group=kn4mkb

[Install]
WantedBy=default.target

Press Ctrl+x to Save.

Enable the Service:

sudo systemctl enable direwolf

Setup tncattach to auto start:

sudo nano /etc/systemd/system/tncattach.service

Paste the following, take care to replace the portion in quotes (“”) with your intended tncattach command (the one you used above):

[Unit]
Description=tncattach
After=network.target

[Service]
Type=forking
ExecStartPre=/bin/sleep 30
ExecStart=screen -S tncattach -dm bash -c "sudo tncattach --kisstcp --tcphost=127.0.0.1 --tcpport=8001 -s 'KN4MKBTNCATTACH' -t 600 -m 508 --noipv6 --noup -v; exec sh"
Restart=always
User=root
Group=root

[Install]
WantedBy=default.target

Enable the Service:

sudo systemctl enable tncattach

Auto start the Point to Point Tunnel

This is only needed if your are configuring a point to point tunnel for the tncattach command instead of a /24 network.

sudo nano /etc/systemd/system/tunnel.service

Paste the following:
Take care to replace the IP addresses below with the ones you intend to use with yourself and your packet partner.

[Unit]
Description=tunnel
After=network.target

[Service]
Type=forking
ExecStartPre=/bin/sleep 40
ExecStart=screen -S tunnel -dm bash -c "sudo ifconfig tnc0 44.0.0.1 pointopoint 44.0.0.2; exec sh"
Restart=always
User=root
Group=root

[Install]
WantedBy=default.target

Enable the service:

 sudo systemctl enable tunnel

Restart the Server

sudo reboot

Auto Start Results Verification

Once the server is back up, give it a solid 60 seconds to bring the services up. Afterwards, you can issue the following commands to “check in” on the services by attaching to their console sessions. Take care to use sudo for the tncattach, and tunnel screen commands.

screen -r direwolf
sudo screen -r tncattach
sudo screen -r tunnel

To detach from the screen press Ctrl + A on your keyboard, followed by the “D” key. If all is well, you will be able to ping the distant radio/server.

EXTRA: Optimizing the Network

This is just a few notes on achieving lower latency, and higher throughput in your packet network.

Reducing Latency

The first element to take a look at are the TXDELAY and TXTAIL parameters within the direwolf configuration file. Start these out higher to give plenty of room for your transmitter to “balance” out before sending data, as well as give the transmitter time to finish sending before disabling the PTT. These values are calculated by multiplying the value by 10, and the result is the delay in milliseconds. The above configuration of TXDELAY 20 and TXTAIL 10 will result in a 200ms delay prior to data, and a 100ms delay before stopping the transmission. Slowly turn these values down one at a time, and verify the other end can still decode your packet until your station is no longer understood. Then add a bit back onto it to create a small buffer. This will result in the lowest latency your radio can handle. I’ve found my RT95 will work finer with a TXDELAY 10 and a TXTAIL 0, despite warnings form dire wolf.

Increase Speed

Using a larger PACLEN value in the configuration file, combined with an increase in the MTU supplied to the tnc attach command can allow larger packet sizes. This can result in overall less overhead of the network by sending more data with each frame header. As a general rule, have your PACLEN within direwolf be 4 bytes more than the MTU supplied to tncattach to allow for the IP frame header in point to point networks. If using ethernet frames as well (such as a /24 network) have your PACLEN be at least 20 more than the MTU supplied to tncattach. The draw back to larger packet sizes will be the likelihood of a packet not being decoded due to interference screwing up too many bits in the packet. As such, a more reliable link will allow larger packet sizes.

You can also increase the modem speed within dire wolf from the 1200 supplied in the above example configuration. Keep in mind, this is somewhat limited to your digital sound card interface, and radio. Radios that supply a dedicated data jack often support up to 9600 baud. I’ve found that most radios will be happy with a value of 2400. But this rule has exceptions. Both modems in the network will need the same speed setting. As such, my config usually has “MODEM 2400” as the speed setting as this does well with my RT95.

The post Setup IP Networking via Packet Radio with DireWolf and IL2P appeared first on TheModernHam.

Share Soundcard between Direwolf and VARA on Linux

By: KN4MKB
30 May 2024 at 23:00

I wish I could make this one simple, but we are getting into complex territory. Please read the instructions and follow along carefully. This is not something I recommend doing without knowing your way around Linux, and so the basics are not covered(it would be too long). this should let you share the same soundcard between direwolf and other apps like VARA, and FLDigi as well. I ran into this when I wanted to have VARA and Dire wolf share a soundcard for my BPQ32 node on Linux. By default, Dire wolf takes complete control of the sound card interface, as well as VARA when ran within wine. There are several tweaks and changes needed to make this work, so buckle in. In this guide, I’ve used this post to install VARA within wine on Debian 12. I’ve used this post to install dire wolf.

Splitting the Interface

First, we need to grab your sound cards device name. Enter cat /proc/asound/cards to get a list of sound cards, pay attention to the “Device” or “Device_1” relating to your radios digital audio interface card. I my case, I needed both (one was used for 2m, the other for HF). Note the name somewhere, paying attention to the case as well.

Now, we need to open the “asound” configuration file (or make a new one if it doesn’t exist), and enter some information. First, check if one exists for your current user with : cat ~/.asound. If you get file does not exist, that’s fine. If you instead see file info, enter rm ~/.asound to get rid of it. The reason we did that was because the user configuration file overrides the global (which is the one we will now create/edit).

Enter sudo nano /etc/asound.conf to create/edit the existing global configuration. If your file is empty, awesome. If it contains content, remove everything.

What we will do now, is name our new split soundcard interface. In the following example, I’ve taken the soundcard listed as “Device” from above, and now named it “digirig” in this new interface, and split it into “digirig-rx” for the receive(audio in), and “digirig-tx” for the transmit (audio out)

We will now paste the following template:

Take care to replace the word “Device” with the name you found above (probably the same), and if you would like to rename the interface to something other than “digirig” like I have here, replace all instances of it with something lowercase and simple you will remember.

pcm_slave.digirig {
   pcm {
      type hw
      card Device
   }
   period_time 0
   buffer_size 8192
}

pcm.digirig-dmix {
   type dmix
   ipc_key 2023041901
   slave "digirig"
   bindings.0 0
}

pcm.digirig-dsnoop {
   type dsnoop
   ipc_key 2023041902
   slave "digirig"
   bindings.0 0
}

pcm.digirig-rx {
   type plug
   slave.pcm "digirig-dsnoop"
   hint.description "digirig RX audio plug"
}

pcm.digirig-tx {
   type plug
   slave.pcm "digirig-dmix"
   hint.description "digirig TX audio plug"
}

If you have 2 sound card interfaces, such as I do, you will just paste the above twice, one after the other. You will need to rename all instances of “digirig” (or whatever you called the first one) to something else (to refer to the second card). You will also need to replace “Device” once more with the name of the second sound card (probably “Device_1”).

Great, save that file. Issue the following command to have the changes take effect.

sudo alsa force-reload

If you get command not found, you’re better off rebooting before continuing.

Now, we will now make sure we’ve done this part right. Open up your direrwolf configuration file (probably nano ~/direwolf.conf) and find the “ADEVICE” line and remove it.

Replace it with the following. (Obviously replacing “digirig” if you’ve renamed it in the asound file we made/edited above.

ADEVICE  digirig-rx digirig-tx

Save the file, and restart Dire wolf. Dire wolf should start fine, and your audio device should be working as it did before. If not, stop here, somethings wrong.

Getting VARA to use the Split interface

Now that dire wolf is using our split interface, we now need to get VARA on board, which is a little more involved.

First, we need to get your wine prefix to be configured using ALSA. If using VARA in the default prefix, this could be as simple as running “winetricks sound=alsa“. Give it a try, as it won’t hurt either way. Otherwise, you will run the following command, replacing “.wine32” with the wine prefix you’ve made for VARA.

 env WINEARCH="win32" env WINEPREFIX="/home/aspect/.win32" winecfg

Another way you can try to achieve this is by running “winetricks” within desktop mode, selecting the prefix where VARA is installed, choosing “Change Settings”, finding “sound=alsa” and pressing “Ok”

vara wineprefix config
setting vara to alsa in wine

Next we need to set some registry keys on the Wine prefix to identify our split interfaces. Similar to the above, we will enter the following command to open the registry editor for the VARA prefix:

env WINEARCH="win32" env WINEPREFIX="/home/aspect/.win32" regedit

You can also reach the Registry editor using the “winetricks” command, selecting the prefix, and opening the regedit from there.

You will navigate to the following key and leave it it open:

HKCU->Software->Wine->Drivers->winealsa.drv

set input and output devices for alsa in a wine prefix

Just as in the above screenshot, you will right click the empty space, and select new -> multi-string value.

Create one key called “ALSAInputDevices” and another called “ALSAOutputDevices”. In each of them, for the value, make a list of the relative -rx or -tx devices we made before in the asound file. (If you only have 1 sound card interface to use, you only need the one here). (-rx being in the Input devices, and -tx being in the Output.)

set the digirig as an option for vara to use in wine

Save, and close it all out.

Starting VARA

Now start VARA as you normally do in WINE. In the soundcard settings, now chose the interface we specified in the registry relating to the one we created in the asound configuration file.

vara running on debian 12

Direwolf and VARA should now be able to share the sound interface this way!

The post Share Soundcard between Direwolf and VARA on Linux appeared first on TheModernHam.

Remembering the old school dial-up BBS

By: M0RVB
21 January 2024 at 14:24

All this packet radio progressing around the place reminds me of a time long ago, pre-Internet where dial-up BBSs became the new thing in town. Back then I had a BBC Micro and a modem that ran at two speeds – I forget which now (will edit later!) and I persuaded my mum to get BT in to fit a socket rather than the hard-wired phone we had then. This let me plug the modem in. I used to use a BBS called ‘More Summer Wine’ plus one other but I forgot the name. Much of the activity back then is lost in the mist of time (or rather I just can’t remember) but sending and receiving mail was fun. BBS systems were all a part of the wider FidoNet. Mail would be routed between the various BBS systems, many of which only had the one telephone line and so would be inaccessible while that was happening. Indeed, they were mostly single user anyway, although if the sysop was there you could message them via the console of the BBS which was probably sitting in someone’s bedroom. I am reminded of the many times I would set the BBC and modem up on the hall floor because we only had the one telephone socket. In fact, it would be quite some time between then and when we finally got broadband Internet which for us was not until the later 1990s in our new home.

During that time and working in academia I had routine access to networks and mail and so interest in the BBS systems dwindled. There was a time before the winder Internet became available where we could gain network access to remote systems, all typically mini- or mainframe computers. One such system ran a MUD – Multi-user Dungeons and Dragons – another angle to remote access but this time for gaming rather than BBS. That provided an introduction to online chatrooms because the MUD we used to play on had that feature. One could not only progress through the game but also exchange messages online, the latter becoming the wanted feature vice the game itself.

And here we are. I was never involved in packet radio when it first came to be, but now it has reminded me a lot of those old days of the dial-up BBS.

And FidoNet? It is still there https://www.fidonet.org/

See: https://spectrum.ieee.org/social-medias-dialup-ancestor-the-bulletin-board-system

Packetering

By: M0RVB
12 January 2024 at 20:54

Made some useful progress on packet radio today. I managed to access a node in Scotland and one near the south coast on 40m, 300 baud. This was using QtSoundModem on the Linux box connected to the FT450D via a Signalink, fed into the random length wire in the loft. Access was via EasyTerm running on the Windows PC at first, but then I managed to compile QtTermTCP so ran that on the Linux box instead. A bit of fun but it proves the possibility of using 40m to interconnect where there is currently no VHF or UHF paths here.

Fingers crossed once I get some wire and metal in the air things will only improve.

❌
❌