概要

  • 普段からAPRSのネットワークにはお世話になっているので還元するためにも受信専用I-Gateを立ち上げます。
  • 自宅に24時間稼働のLinuxサーバがあるのでそこで動かします。

リグ

DELL PowerEdge T320の背面にRTL-SDRのドングルを挿しています。

初期設定

便利なことに、パッケージでdirewolfがあるので入れます。

> sudo apt install rtl-sdr -y
Reading package lists... Done
Building dependency tree
Selecting previously unselected package librtlsdr0:amd64.
(Reading database ... 125680 files and directories currently installed.)
Preparing to unpack .../librtlsdr0_0.6-2_amd64.deb ...
Unpacking librtlsdr0:amd64 (0.6-2) ...
Selecting previously unselected package rtl-sdr.
Preparing to unpack .../rtl-sdr_0.6-2_amd64.deb ...
Unpacking rtl-sdr (0.6-2) ...
Setting up librtlsdr0:amd64 (0.6-2) ...
Setting up rtl-sdr (0.6-2) ...
Processing triggers for libc-bin (2.30-0ubuntu2) ...
Processing triggers for man-db (2.8.7-3) ...

rtl_fmコマンドによって、USBのSDRドングルから音声データを読むのでインストール

> sudo apt install rtl-sdr -y
Reading package lists... Done
Building dependency tree
Selecting previously unselected package librtlsdr0:amd64.
(Reading database ... 125680 files and directories currently installed.)
Preparing to unpack .../librtlsdr0_0.6-2_amd64.deb ...
Unpacking librtlsdr0:amd64 (0.6-2) ...
Selecting previously unselected package rtl-sdr.
Preparing to unpack .../rtl-sdr_0.6-2_amd64.deb ...
Unpacking rtl-sdr (0.6-2) ...
Setting up librtlsdr0:amd64 (0.6-2) ...
Setting up rtl-sdr (0.6-2) ...
Processing triggers for libc-bin (2.30-0ubuntu2) ...
Processing triggers for man-db (2.8.7-3) ...

rtl_testコマンドでUSBドングルが見えているかを確認します。

> sudo rtl_test -t |nkf -w
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Detached kernel driver
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
[R82XX] PLL not locked!
Sampling at 2048000 S/s.
No E4000 tuner found, aborting.
Reattached kernel driver

音声関連のライブラリに依存しているようなので、alsa-utilsをインストールします。

matsu@dell ~> sudo apt install alsa-utils -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libfftw3-single3 libsamplerate0
Suggested packages:
  libfftw3-bin libfftw3-dev
The following NEW packages will be installed:
  alsa-utils libfftw3-single3 libsamplerate0
0 upgraded, 3 newly installed, 0 to remove and 11 not upgraded.
Need to get 2,713 kB of archives.
After this operation, 6,265 kB of additional disk space will be used.
Get:1 http://ftp.riken.jp/Linux/ubuntu eoan/main amd64 libfftw3-single3 amd64 3.3.8-2 [757 kB]
Get:2 http://ftp.riken.jp/Linux/ubuntu eoan/main amd64 libsamplerate0 amd64 0.1.9-2 [939 kB]
Get:3 http://ftp.riken.jp/Linux/ubuntu eoan/main amd64 alsa-utils amd64 1.1.9-0ubuntu1 [1,017 kB]
Fetched 2,713 kB in 14s (188 kB/s)
Selecting previously unselected package libfftw3-single3:amd64.
(Reading database ... 125706 files and directories currently installed.)
Preparing to unpack .../libfftw3-single3_3.3.8-2_amd64.deb ...
Unpacking libfftw3-single3:amd64 (3.3.8-2) ...
Selecting previously unselected package libsamplerate0:amd64.
Preparing to unpack .../libsamplerate0_0.1.9-2_amd64.deb ...
Unpacking libsamplerate0:amd64 (0.1.9-2) ...
Selecting previously unselected package alsa-utils.
Preparing to unpack .../alsa-utils_1.1.9-0ubuntu1_amd64.deb ...
Unpacking alsa-utils (1.1.9-0ubuntu1) ...
Setting up libfftw3-single3:amd64 (3.3.8-2) ...
Setting up libsamplerate0:amd64 (0.1.9-2) ...
Setting up alsa-utils (1.1.9-0ubuntu1) ...
alsa-restore.service is a disabled or a static unit, not starting it.
alsa-state.service is a disabled or a static unit, not starting it.
Processing triggers for systemd (242-7ubuntu3.2) ...
Processing triggers for man-db (2.8.7-3) ...

Processing triggers for libc-bin (2.30-0ubuntu2) ...
 create mode 100755 init.d/alsa-utils
 create mode 120000 rc0.d/K01alsa-utils
 create mode 120000 rc1.d/K01alsa-utils
 create mode 120000 rc6.d/K01alsa-utils
 create mode 120000 rcS.d/S01alsa-utils

設定の差分はこちらです。サンプルの設定ファイルのコメントにある英語を読んでいけばだいたいわかります。

matsu@dell ~> diff /usr/share/doc/direwolf/examples/direwolf.conf direwolf.conf
78c78
<
---
> ADEVICE stdin null
132c132
< MYCALL N0CALL
---
> MYCALL JE1WFV-10
143c143
< MODEM 1200
---
> #MODEM 1200
145c145
< #MODEM 9600
---
> MODEM 9600
348c348
< #IGSERVER noam.aprs2.net
---
> IGSERVER asia.aprs2.net
353c353
< #IGLOGIN WB2OSZ-5 123456
---
> IGLOGIN JE1WFV-10 000000
363c363
< #PBEACON sendto=IG delay=0:30 every=60:00 symbol="igate" overlay=R lat=42^37.14N long=071^20.83W
---
> PBEACON sendto=IG delay=0:30 every=60:00 symbol="igate" overlay=R lat=35^00.00N long=139^00.00E comment="Minato-ku 144.64MHz 9600bps rsv only"

1点だけ作業が必要です。IGLOGINで指定するパスコードを以下のURL上から取得します。自分のコールサインを入れるとすぐに表示されます。

http://apps.magicbug.co.uk/passcode/

試しに立ち上げてみます。rtl_fmコマンドで音声データのストリームを取得して、標準入力からdirewolfは読んで処理します。

% sudo rtl_fm -M fm -f 144.64M -p 36 -s 48000 -g 42 - | direwolf -c ./direwolf.conf -B 9600 -d u -r 48000 -D 1 -

以下のような出力が表示されます。

コンソールに表示される、接続先サーバのステータス表示で自分のホストが登録されているかどうかを確認できます。

テスト

自分のFT-3Dでビーコンを送ってみると、コンソールにログが表示されることを確認できます。

aprs.fi上でも自分の局が表示されます。APRS.fiのJE1WFV-10のページ。

https://aprs.fi/info/a/JE1WFV-10
アンテナの設置場所が悪いので数キロ先の電波しか拾えない様子。

自動起動の設定

せっかくなので、この記事を参考にしてsystemdを使ってサービスを管理させます。

/etc/direwolf/start.sh に起動用スクリプトを作ります。権限は755にしておきます。ログはsyslogに投げちゃいます。

ファイルの中身は以下です。

#!/bin/sh

rtl_fm -M fm -f 144.64M -p 36 -s 48000 -g 42 - | direwolf -c /etc/direwolf/direwolf.conf -B 9600 -d u -r 48000 -D 1 - | logger -t direwolf -i

以下で、systemdに登録してsystemd経由で起動します。

root@dell /e/direwolf# systemctl list-unit-files --type=service|grep direwolf
direwolf.service                           disabled
root@dell /e/direwolf# systemctl list-unit-files --type=service|grep direwolf
direwolf.service                           disabled
root@dell /e/direwolf# systemctl enable direwolf
Created symlink /etc/systemd/system/multi-user.target.wants/direwolf.service → /etc/systemd/system/direwolf.service.
root@dell /e/direwolf# systemctl start direwolf
root@dell /e/direwolf# systemctl status  direwolf
● direwolf.service - APRS igate server by direwolf
   Loaded: loaded (/etc/systemd/system/direwolf.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2020-01-25 23:55:53 JST; 54s ago
 Main PID: 38537 (start.sh)
    Tasks: 22 (limit: 7372)
   Memory: 6.1M
   CGroup: /system.slice/direwolf.service
           ├─38537 /bin/sh /etc/direwolf/start.sh
           ├─38543 rtl_fm -M fm -f 144.64M -p 36 -s 48000 -g 42 -
           ├─38544 direwolf -c /etc/direwolf/direwolf.conf -B 9600 -d u -r 48000 -D 1 -
           └─38545 logger -t direwolf -i

Jan 25 23:55:59 dell direwolf[38545]:
Jan 25 23:56:03 dell direwolf[38545]: [ig] # javAPRSSrvr 3.15b08
Jan 25 23:56:03 dell direwolf[38545]: [ig] # logresp JE1WFV-10 verified, server T2SAPPORO
Jan 25 23:56:07 dell direwolf[38545]:
Jan 25 23:56:07 dell direwolf[38545]: JE1WFV-7 audio level = 58(+70/-25)   [NONE]   |||||||||
Jan 25 23:56:07 dell direwolf[38545]: [0.4] JE1WFV-7>SUSYT5,WIDE1-1:`CGFl!O[/`"4I}_0<0x0d>
Jan 25 23:56:07 dell direwolf[38545]: MIC-E, Human, Mic-Emsg, Off Duty
Jan 25 23:56:07 dell direwolf[38545]: N 35 39.4500, E 139 43.4200, 0 MPH, course 151, alt 164 ft
Jan 25 23:56:07 dell direwolf[38545]: _0
Jan 25 23:56:24 dell direwolf[38545]: [ig] JE1WFV-10>APDW15:!3539.44NR13943.45E&

direwolfのプロセスは、大したことをしていないはずなのに、そこそこCPUの負荷が高いです。

同じようなissueが書かれています。おそらくですが、音声データからパケット情報を受けるための変換に持っていかれているのかと思います。

それでは、Happy Radio Life!

カテゴリー: APRS

1件のコメント

matsu · 2020年3月7日 2:22 AM

若干CPUを食うし、アンテナを高いところに上げられなくて、あまり貢献できないので運用を停止します。
“`
sudo systemctl disable direwolf
“`

matsu へ返信する コメントをキャンセル

アバタープレースホルダー

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください