Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: wb2osz/direwolf
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1ede482bcfc25087c5bbe50bd543ea3f9b101251
Choose a base ref
..
head repository: wb2osz/direwolf
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ce08f0e8d3c20a17355ea1a6bf14e15ed9163dd1
Choose a head ref
5 changes: 4 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -7,6 +7,9 @@

### New Features: ###


- New variable speed option for gen_packets. For example, "-v 5,0.1" would generate packets from 5% too slow to 5% too fast with increments of 0.1. Some implementations might have imprecise timing. Use this to test how well TNCs tolerate sloppy timing.

- Improved Layer 2 Protocol [(IL2P)](https://en.wikipedia.org/wiki/FX.25_Forward_Error_Correction). Use "-I 1" on command line to enable transmit for first channel. Compatible with Nino TNC for 1200 and 9600 bps.

- Limited support for CM109/CM119 GPIO PTT on Windows.
@@ -17,7 +20,7 @@

- The BEACON configuration now recognizes the SOURCE= option. This replaces the AX.25 source address rather than using the MYCALL value for the channel. This is useful for sending more than 5 analog telemetry channels. Use two, or more, source addresses with up to 5 analog channels each.

- For more flexibility, the FX.25 transmit property can now be set individually by channel, rather than having a global setting for all channels. The -X on the command line applies only to channel 0. For other channels you need to add a new line to the configuration file.
- For more flexibility, the FX.25 transmit property can now be set individually by channel, rather than having a global setting for all channels. The -X on the command line applies only to channel 0. For other channels you need to add a new line to the configuration file. You can specify a specific number of parity bytes (16, 32, 64) or 1 to choose automatically based on packet size.

> After: "CHANNEL 1" (or other channel)
>
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ Why waste $200 and settle for mediocre receive performance from a 1980's technol

![](tnc-test-cd-results.png)

Dire Wolf now includes [FX.25](https://en.wikipedia.org/wiki/FX.25_Forward_Error_Correction) which adds Forward Error Correction (FEC) in a way that is completely compatible with existing systems. If both ends are capable of FX.25, your information will continue to get through under conditions where regular AX.25 is completely useless.
Dire Wolf now includes [FX.25](https://en.wikipedia.org/wiki/FX.25_Forward_Error_Correction) which adds Forward Error Correction (FEC) in a way that is completely compatible with existing systems. If both ends are capable of FX.25, your information will continue to get through under conditions where regular AX.25 is completely useless. This was originally developed for satellites and is now seeing widespread use on HF.

![](fx25.png)

@@ -80,7 +80,21 @@ It can also be used as a virtual TNC for other applications such as [APRSIS32](h



- **Standard 300, 1200 & 9600 bps modems and more.**
- **Modems:**

300 bps AFSK for HF

1200 bps AFSK most common for VHF/UHF

2400 & 4800 bps PSK

9600 bps GMSK/G3RUH

AIS reception

EAS SAME reception



- **DTMF ("Touch Tone") Decoding and Encoding.**

2 changes: 1 addition & 1 deletion cmake/modules/FindAvahi.cmake
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ if(AVAHI_CLIENT_LIBRARY)
set(AVAHI_CLIENT_FOUND TRUE)
endif()

FIND_PACKAGE_HANDLE_STANDARD_ARGS(AVAHI DEFAULT_MSG AVAHI_COMMON_FOUND AVAHI_CLIENT_FOUND)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Avahi DEFAULT_MSG AVAHI_COMMON_FOUND AVAHI_CLIENT_FOUND)

if (AVAHI_FOUND)
set(AVAHI_INCLUDE_DIRS ${AVAHI_UI_INCLUDE_DIR})
2 changes: 1 addition & 1 deletion cmake/modules/Findhamlib.cmake
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ find_library(HAMLIB_LIBRARY
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(HAMLIB
find_package_handle_standard_args(hamlib
DEFAULT_MSG
HAMLIB_LIBRARY
HAMLIB_INCLUDE_DIR
2 changes: 1 addition & 1 deletion cmake/modules/Findudev.cmake
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ find_path(UDEV_INCLUDE_DIR
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(UDEV
find_package_handle_standard_args(udev
DEFAULT_MSG
UDEV_LIBRARY
UDEV_INCLUDE_DIR
7 changes: 4 additions & 3 deletions conf/generic.conf
Original file line number Diff line number Diff line change
@@ -369,10 +369,11 @@
%W%
%C%#
%C%# It is sometimes possible to recover frames with a bad FCS.
%C%# This applies to all channels.
%C%# This is not a global setting.
%C%# It applies only the the most recent CHANNEL specified.
%C%#
%C%# 0 [NONE] - Don't try to repair.
%C%# 1 [SINGLE] - Attempt to fix single bit error. (default)
%C%# 0 - Don't try to repair.
%C%# 1 - Attempt to fix single bit error. (default)
%C%# ... see User Guide for more values and in-depth discussion.
%C%#
%C%
6 changes: 5 additions & 1 deletion man/gen_packets.1
Original file line number Diff line number Diff line change
@@ -100,9 +100,13 @@ Send output to .wav file.
8 bit audio rather than 16.

.TP
.B "-2"
.BI "-2"
2 channels of audio rather than 1.

.TP
.BI "-v" "max[,incr]"
Variable speed with specified maximum error and optional increment.


.SH EXAMPLES
.P
2 changes: 1 addition & 1 deletion src/agwlib.c
Original file line number Diff line number Diff line change
@@ -365,7 +365,7 @@ static void * tnc_listen_thread (void *arg)
}

/*
* Call to/from fields are 10 bytes but contents must not exceeed 9 characters.
* Call to/from fields are 10 bytes but contents must not exceed 9 characters.
* It's not guaranteed that unused bytes will contain 0 so we
* don't issue error message in this case.
*/
32 changes: 25 additions & 7 deletions src/atest.c
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
//
// This file is part of Dire Wolf, an amateur radio packet TNC.
//
// Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016, 2019, 2021 John Langner, WB2OSZ
// Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016, 2019, 2021, 2022 John Langner, WB2OSZ
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -23,11 +23,11 @@
*
* Name: atest.c
*
* Purpose: Test fixture for the AFSK demodulator.
* Purpose: Test fixture for the Dire Wolf demodulators.
*
* Inputs: Takes audio from a .WAV file instead of the audio device.
*
* Description: This can be used to test the AFSK demodulator under
* Description: This can be used to test the demodulators under
* controlled and reproducible conditions for tweaking.
*
* For example
@@ -68,6 +68,7 @@
#include <string.h>
#include <time.h>
#include <getopt.h>
#include <ctype.h>


#define ATEST_C 1
@@ -107,7 +108,7 @@ struct wav_header { /* .WAV file header. */
/* 8 bit samples are unsigned bytes */
/* in range of 0 .. 255. */

/* 16 bit samples are signed short */
/* 16 bit samples are little endian signed short */
/* in range of -32768 .. +32767. */

static struct {
@@ -765,7 +766,7 @@ void dlq_rec_frame (int chan, int subchan, int slice, packet_t pp, alevel_t alev
unsigned char *pinfo;
int info_len;
int h;
char heard[AX25_MAX_ADDR_LEN];
char heard[2 * AX25_MAX_ADDR_LEN + 20];
char alevel_text[AX25_ALEVEL_TO_TEXT_SIZE];

packets_decoded_one++;
@@ -810,6 +811,23 @@ void dlq_rec_frame (int chan, int subchan, int slice, packet_t pp, alevel_t alev
}
ax25_alevel_to_text (alevel, alevel_text);

/* As suggested by KJ4ERJ, if we are receiving from */
/* WIDEn-0, it is quite likely (but not guaranteed), that */
/* we are actually hearing the preceding station in the path. */

if (h >= AX25_REPEATER_2 &&
strncmp(heard, "WIDE", 4) == 0 &&
isdigit(heard[4]) &&
heard[5] == '\0') {

char probably_really[AX25_MAX_ADDR_LEN];
ax25_get_addr_with_ssid(pp, h-1, probably_really);

strlcat (heard, " (probably ", sizeof(heard));
strlcat (heard, probably_really, sizeof(heard));
strlcat (heard, ")", sizeof(heard));
}

if (my_audio_config.achan[chan].fix_bits == RETRY_NONE && my_audio_config.achan[chan].passall == 0) {
dw_printf ("%s audio level = %s %s\n", heard, alevel_text, spectrum);
}
@@ -877,7 +895,7 @@ void dlq_rec_frame (int chan, int subchan, int slice, packet_t pp, alevel_t alev



#if 1 // temp experiment TODO: remove this.
#if 0 // temp experiment

#include "decode_aprs.h"
#include "log.h"
@@ -886,7 +904,7 @@ void dlq_rec_frame (int chan, int subchan, int slice, packet_t pp, alevel_t alev

decode_aprs_t A;

decode_aprs (&A, pp, 0, 0);
decode_aprs (&A, pp, 0, NULL);

// Temp experiment to see how different systems set the RR bits in the source and destination.
// log_rr_bits (&A, pp);
2 changes: 1 addition & 1 deletion src/audio.c
Original file line number Diff line number Diff line change
@@ -1532,7 +1532,7 @@ int audio_flush (int a)
* (3) Call this function, which might or might not wait long enough.
* (4) Add (1) and (2) resulting in when PTT should be turned off.
* (5) Take difference between current time and desired PPT off time
* and wait for additoinal time if required.
* and wait for additional time if required.
*
*----------------------------------------------------------------*/

4 changes: 2 additions & 2 deletions src/audio.h
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ struct audio_s {

struct adev_param_s {

/* Properites of the sound device. */
/* Properties of the sound device. */

int defined; /* Was device defined? */
/* First one defaults to yes. */
@@ -102,7 +102,7 @@ struct audio_s {
/* This is the probability, in per cent, of randomly corrupting it. */
/* Normally this is 0. 25 would mean corrupt it 25% of the time. */

int recv_error_rate; /* Similar but the % probablity of dropping a received frame. */
int recv_error_rate; /* Similar but the % probability of dropping a received frame. */

float recv_ber; /* Receive Bit Error Rate (BER). */
/* Probability of inverting a bit coming out of the modem. */
22 changes: 18 additions & 4 deletions src/audio_portaudio.c
Original file line number Diff line number Diff line change
@@ -213,7 +213,21 @@ static int pa_devNN(char *deviceStr, char *_devName, size_t length, int *_devNo)
while(*cPtr) {
cVal = *cPtr++;
if(cVal == ':') break;
if(((cVal >= ' ') && (cVal <= '~')) && (count < length)) {

// See Issue 417.
// Originally this copied only printable ASCII characters (space thru ~).
// That is a problem for some locales that use UTF-8 characters in the device name.
// original: if(((cVal >= ' ') && (cVal <= '~')) && (count < length)) {

// At first I was thinking we should keep the test for < ' ' but then I
// remembered that char type can be signed or unsigned depending on implementation.
// If characters are signed then a value above 0x7f would be considered negative.

// It seems to me that the test for buffer full is off by one.
// count could reach length, leaving no room for a nul terminator.
// Compare has been changed so count is limited to length minus 1.

if(count < length - 1) {
_devName[count++] = cVal;
}

@@ -1149,7 +1163,7 @@ int audio_put (int a, int c)
static double start = 0, end = 0, diff = 0;

if(adev[a].outbuf_len == 0)
start = dtime_now();
start = dtime_monotonic();
#endif

if(c >= 0) {
@@ -1178,7 +1192,7 @@ int audio_put (int a, int c)
#ifdef __TIMED__
count += frames;
if(c < 0) { // When the Ax25 frames are flushed.
end = dtime_now();
end = dtime_monotonic();
diff = end - start;
if(count)
dw_printf ("Transfer Time:%3.9f No of Frames:%d Per frame:%3.9f speed:%f\n",
@@ -1246,7 +1260,7 @@ int audio_flush (int a)
* (3) Call this function, which might or might not wait long enough.
* (4) Add (1) and (2) resulting in when PTT should be turned off.
* (5) Take difference between current time and desired PPT off time
* and wait for additoinal time if required.
* and wait for additional time if required.
*
*----------------------------------------------------------------*/

1 change: 0 additions & 1 deletion src/audio_stats.c
Original file line number Diff line number Diff line change
@@ -65,7 +65,6 @@

#include "audio_stats.h"
#include "textcolor.h"
#include "dtime_now.h"
#include "demod.h" /* for alevel_t & demod_get_audio_level() */


4 changes: 2 additions & 2 deletions src/audio_win.c
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ static struct audio_s *save_audio_config_p;
*/

/*
* Originally, we had an abitrary buf time of 40 mS.
* Originally, we had an arbitrary buf time of 40 mS.
*
* For mono, the buffer size was rounded up from 3528 to 4k so
* it was really about 50 mS per buffer or about 20 per second.
@@ -1074,7 +1074,7 @@ int audio_flush (int a)
* (3) Call this function, which might or might not wait long enough.
* (4) Add (1) and (2) resulting in when PTT should be turned off.
* (5) Take difference between current time and desired PPT off time
* and wait for additoinal time if required.
* and wait for additional time if required.
*
*----------------------------------------------------------------*/

4 changes: 2 additions & 2 deletions src/ax25_link.c
Original file line number Diff line number Diff line change
@@ -347,7 +347,7 @@ typedef struct ax25_dlsm_s {
// Sometimes the flow chart has SAT instead of SRT.
// I think that is a typographical error.

float t1v; // How long to wait for an acknowlegement before resending.
float t1v; // How long to wait for an acknowledgement before resending.
// Value used when starting timer T1, in seconds.
// "FRACK" parameter in some implementations.
// Typically it might be 3 seconds after frame has been
@@ -6049,7 +6049,7 @@ static void check_need_for_response (ax25_dlsm_t *S, ax25_frame_type_t frame_typ
*
* Outputs: S->srt New smoothed roundtrip time.
*
* S->t1v How long to wait for an acknowlegement before resending.
* S->t1v How long to wait for an acknowledgement before resending.
* Value used when starting timer T1, in seconds.
* Here it is dynamically adjusted.
*
6 changes: 4 additions & 2 deletions src/ax25_pad.c
Original file line number Diff line number Diff line change
@@ -1866,7 +1866,7 @@ packet_t ax25_get_nextp (packet_t this_p)
*
* Inputs: this_p - Current packet object.
*
* release_time - Time as returned by dtime_now().
* release_time - Time as returned by dtime_monotonic().
*
*------------------------------------------------------------------------------*/

@@ -2923,7 +2923,9 @@ int ax25_alevel_to_text (alevel_t alevel, char text[AX25_ALEVEL_TO_TEXT_SIZE])

snprintf (text, AX25_ALEVEL_TO_TEXT_SIZE, "%d(%+d/%+d)", alevel.rec, alevel.mark, alevel.space);
}
else if (alevel.mark == -1 && alevel.space == -1) { /* PSK - single number. */
else if ((alevel.mark == -1 && alevel.space == -1) || /* PSK */
(alevel.mark == -99 && alevel.space == -99)) { /* v. 1.7 "B" FM demodulator. */
// ?? Where does -99 come from?

snprintf (text, AX25_ALEVEL_TO_TEXT_SIZE, "%d", alevel.rec);
}
14 changes: 12 additions & 2 deletions src/config.c
Original file line number Diff line number Diff line change
@@ -2864,6 +2864,9 @@ void config_init (char *fname, struct audio_s *p_audio_config,

/*
* CFILTER from-chan to-chan filter_specification_expression
*
* Why did I put this here?
* What would be a useful use case? Perhaps block by source or destination?
*/

else if (strcasecmp(t, "CFILTER") == 0) {
@@ -4987,7 +4990,7 @@ void config_init (char *fname, struct audio_s *p_audio_config,

text_color_set(DW_COLOR_ERROR);
dw_printf ("Config file, line %d: Old style 'BEACON' has been replaced with new commands.\n", line);
dw_printf ("Use PBEACON, OBEACON, or CBEACON instead.\n");
dw_printf ("Use PBEACON, OBEACON, TBEACON, or CBEACON instead.\n");

}

@@ -5002,6 +5005,9 @@ void config_init (char *fname, struct audio_s *p_audio_config,
* New style with keywords for options.
*/

// TODO: maybe add proportional pathing so multiple beacon timing does not need to be manually constructed?
// http://www.aprs.org/newN/ProportionalPathing.txt

else if (strcasecmp(t, "PBEACON") == 0 ||
strcasecmp(t, "OBEACON") == 0 ||
strcasecmp(t, "TBEACON") == 0 ||
@@ -5455,7 +5461,7 @@ void config_init (char *fname, struct audio_s *p_audio_config,
for (j=0; j<MAX_CHANS; j++) {
if (p_audio_config->chan_medium[j] == MEDIUM_RADIO || p_audio_config->chan_medium[j] == MEDIUM_NETTNC) {
if (p_digi_config->filter_str[MAX_CHANS][j] == NULL) {
p_digi_config->filter_str[MAX_CHANS][j] = strdup("i/60");
p_digi_config->filter_str[MAX_CHANS][j] = strdup("i/180");
}
}
}
@@ -5822,6 +5828,10 @@ static int beacon_options(char *cmd, struct beacon_s *b, int line, struct audio_

/*
* Process symbol now that we have any later overlay.
*
* FIXME: Someone who used this was surprised to end up with Solar Powser (S-).
* overlay=S symbol="/-"
* We should complain if overlay used with symtab other than \.
*/
if (strlen(temp_symbol) > 0) {

Loading