¿ªÔÆÌåÓý

f32_i16.c


 

Compilation is: gcc f32_i16.c -o f32_i16 -lm
?
You can find the code at
?
I run it as a system service with the following .service file (installed in /etc/systemd/system, with $ sudo systemctl enable --now f32_i16_1.service. One of these is needed for each of the channels. Service file would be something like. It could probably be improved.
?
[Unit]
Description=Sample conversion for Direwolf Instance #1
Wants=network.target
After=network.target
?
[Service]
Type=simple
ExecStart=/bin/sh -c '/usr/local/bin/f32_i16 7355 7455'
WorkingDirectory=/home/dragnet
Restart=no
User=dragnet
?
[Install]
WantedBy=multi-user.target
?
Sample for airband.service
?
[Unit]
Description=SDR AM/NFM demodulator
Documentation=https://github.com/charlie-foxtrot/RTLSDR-Airband/wiki
Wants=network.target
After=network.target

# Dependencies:
# ??RTLSDR-Airband binary is assumed to be in /usr/local/bin
# ??The configuration file is assumed to be in /usr/local/etc/rtl_airband.conf

[Service]
Type=simple
ExecStart=/usr/local/bin/rtl_airband -Fe -c /usr/local/etc/rtl_airband.conf
WorkingDirectory=/mnt/sftp/ve3nrt

# Bumping the dongle sometimes causes a read failure which will cause the program
# to exit. Tell it to restart, with a small delay in case of presistent failure.
Restart=always
RestartSec=60

User=ve3nrt

[Install]
WantedBy=multi-user.target

Sample for aprs.service (direwolf). You will need to create the airband directory in /var/log with permissions the program can access, or put the file somewhere else.
?
[Unit]
Description=AX.25 APRS Packet Monitor on port 7455 & 7456
Wants=network.target
After=network.target

[Service]
Type=simple
ExecStart=/bin/sh -c '/usr/local/bin/direwolf -t 0 -c /usr/local/etc/aprs.conf >> /var/log/airband/aprs.log'
WorkingDirectory=/home/dragnet
Restart=no
User=dragnet

[Install]
WantedBy=multi-user.target

?
?
?
?


 

I thought my previous post was a reply to the one before that. Maybe because I change the subject it made it a new post. Sorry.
?
Here's some configuration files.
?
First certain bits of the rtl_airband.conf file.
?
/*
???Global Settings
*/
# This fft size provides 4 kHz channel spacing - seems to be close enough.
fft_size = 512;
multiple_demod_threads = true;

/*
???Devices
*/

devices: ?
(
???{
???????type = "rtlsdr";
???????index = 0;
???????gain = 35;
???????sample_rate = 2.048;
???????buffers = 10;
???????centerfreq = 145.0;
???????correction = 0;
???????mode = "multichannel";

???????channels:
???????(
{
???????????????# 1. APRS UDP for Direwolf
???????????????freq = 144.39;
???????????????modulation = "nfm";
???????????????# afc = 0;
???????????????# lowpass = 3000;
???????????????# highpass = 300;
???????????????outputs:
???????????????(
???????????????????{
???????????????????????type = "udp_stream";
???????????????????????dest_address = "127.0.0.1";
???????????????????????# Dest port is audio translator for Direwolf int16.
???????????????????????dest_port = 7355;
???????????????????????continuous = true;
???????????????????}
???????????????);
???????????},
???????????{
???????????????# 2. ISS APRS UDP for Direwolf
???????????????freq = 145.825;
???????????????modulation = "nfm";
???????????????# afc = 0;
???????????????# lowpass = 3000;
???????????????# highpass = 300;
???????????????outputs:
???????????????(
???????????????????{
???????????????????????type = "udp_stream";
???????????????????????dest_address = "127.0.0.1";
???????????????????????# Dest port is audio translator for Direwolf int16.
???????????????????????dest_port = 7356;
???????????????????????continuous = true;
???????????????????}
???????????????);
???????????}
???????);
???}
);


================================================================================
?
2. configuration file for Direwolf (aprs.conf). IGATE credentials have been hidden.
?
# Receive audio stream from stdin at 16kbps on a single channel.
ADEVICE0 udp:7455 default
ARATE 16000
ACHANNELS 1

ADEVICE1 udp:7456 default
ARATE 16000
ACHANNELS 1

# Log to a data directory
LOGDIR /home/dragnet/direwolf_log

# Set up a single decoder channel, specifying call sign, 1200 bps data rate with DTMF decoding.
CHANNEL 0
MYCALL VE3NRT-1
MODEM 1200
DTMF

CHANNEL 2
MYCALL VE3NRT-1
MODEM 1200
DTMF


# Set up ports for other applications
# Moved from 8000/8001 to 8800/8801 to make room for Gunicorn Django Dragnet
AGWPORT ?8800 ?
KISSPORT 8801

# Connect to IGATE to report on what is heard and let them know where we are.
IGSERVER noam.aprs2.net
IGLOGIN
PBEACON sendto=IG delay=0:30 every=60:00 symbol="igate" overlay=R lat=43.998248N long=079.494796W

?
?