Skip to content

Commit

Permalink
Integrated new decoders + fixed compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dbdexter-dev committed Apr 24, 2022
1 parent 307ad32 commit add2896
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
submodules: recursive

- name: Install dependencies
run: sudo apt-get install libfftw3-dev libglfw3-dev libglew-dev libvolk2-dev libsoapysdr-dev libairspyhf-dev libairspy-dev libiio-dev libad9361-dev librtaudio-dev libhackrf-dev librtlsdr-dev libbladerf-dev liblimesuite-dev p7zip-full wget portaudio19-dev libcodec2-dev libssl-dev
run: sudo apt-get install libfftw3-dev libglfw3-dev libglew-dev libvolk2-dev libsoapysdr-dev libairspyhf-dev libairspy-dev libiio-dev libad9361-dev librtaudio-dev libhackrf-dev librtlsdr-dev libbladerf-dev liblimesuite-dev p7zip-full wget portaudio19-dev libcodec2-dev libssl-dev libzstd-dev

- name: Patch CMakeLists.txt
run: cp ${{github.workspace}}/decoder_modules/sdrpp_radiosonde/.github/workflows/CMakeLists.txt ${{github.workspace}}
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
run: mkdir "C:/Program Files/PothosSDR" ; 7z x ${{runner.workspace}}/pothos.exe -o"C:/Program Files/PothosSDR/"

- name: Install vcpkg dependencies
run: vcpkg install fftw3:x64-windows glew:x64-windows glfw3:x64-windows portaudio:x64-windows openssl-windows:x64-windows
run: vcpkg install fftw3:x64-windows glfw3:x64-windows portaudio:x64-windows zstd:x64-windows

- name: Install rtaudio
run: git clone https://github.com/thestk/rtaudio ; cd rtaudio ; git checkout 2f2fca4502d506abc50f6d4473b2836d24cfb1e3 ; mkdir build ; cd build ; cmake .. ; cmake --build . --config Release ; cmake --install .
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ Compatibility:
| Manufacturer | Model | GPS | Temperature | Humidity |
|--------------|----------|--------------------|--------------------|--------------------|
| Vaisala | RS41-SG | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| Meteomodem | M10 | :heavy_check_mark: | | |
| Meteomodem | M10/M20 | :heavy_check_mark: | | |
| GRAW | DFM06/09 | :heavy_check_mark: | :heavy_check_mark: | |
| Meisei | iMS-100 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| InterMet | iMet-1/4 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |


Installing
Expand All @@ -20,9 +21,9 @@ Installing
Binary releases for Windows and Linux (both x86-64 only) are available from
[the Releases page](https://github.com/dbdexter-dev/sdrpp_radiosonde/releases).

- **Windows**: download the `.dll` file from the latest release, and place it in
- **Windows**: download the `.dll` file from the latest release, and place it in
the `modules` directory within your SDR++ installation.
- **Linux**: download the `.so` file from the latest release, and place it in
- **Linux**: download the `.so` file from the latest release, and place it in
the `/usr/lib/sdrpp/plugins` folder.

The plugin can then be enabled from the module manager in SDR++, under the name
Expand All @@ -46,7 +47,7 @@ option(OPT_BUILD_RADIOSONDE_DECODER "Build the radiosonde decoder module (no dep
```
if (OPT_BUILD_RADIOSONDE_DECODER)
add_subdirectory("decoder_modules/sdrpp_radiosonde")
endif(OPT_BUILD_RADIOSONDE_DECODER)
endif (OPT_BUILD_RADIOSONDE_DECODER)
```
4. Navigate to the `decoder_modules` folder, then clone this repository: `git clone https://github.com/dbdexter-dev/sdrpp_radiosonde --recurse-submodules`
5. Build and install SDR++ following the guide in the original repository
Expand Down
8 changes: 8 additions & 0 deletions src/decode/decoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ extern "C" {
#include "sondedump/include/rs41.h"
#include "sondedump/include/ims100.h"
#include "sondedump/include/m10.h"
#include "sondedump/include/imet4.h"
}

#define LEN(x) (sizeof(x)/sizeof(*x))
Expand Down Expand Up @@ -40,6 +41,13 @@ namespace radiosonde {
dsp::generic_block<Decoder<T, decoder_init, decoder_deinit, decoder_get>>::_block_init = true;
}

void deinit(void) {
dsp::generic_block<Decoder<T, decoder_init, decoder_deinit, decoder_get>>::stop();
dsp::generic_block<Decoder<T, decoder_init, decoder_deinit, decoder_get>>::unregisterInput(m_in);

decoder_deinit(m_decoder);
}

int run() {
SondeData fragment;
int count;
Expand Down
13 changes: 7 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include <core.h>
#include <config.h>
#include <gui/gui.h>
#include <gui/style.h>
#include <imgui.h>
#include <module.h>
#include <signal_path/signal_path.h>
#include <time.h>
#include <options.h>
#include "main.hpp"
#include "utils.hpp"

Expand All @@ -20,7 +20,7 @@ SDRPP_MOD_INFO {
/* Name: */ "radiosonde_decoder",
/* Description: */ "Radiosonde decoder for SDR++",
/* Author: */ "dbdexter-dev",
/* Version: */ 0, 7, 0,
/* Version: */ 0, 8, 0,
/* Max instances */ -1
};

Expand Down Expand Up @@ -67,6 +67,7 @@ RadiosondeDecoderModule::RadiosondeDecoderModule(std::string name)
dfm09decoder.init(&resampler.out, OUT_SAMPLE_RATE, sondeDataHandler, this);
ims100decoder.init(&resampler.out, OUT_SAMPLE_RATE, sondeDataHandler, this);
m10decoder.init(&resampler.out, OUT_SAMPLE_RATE, sondeDataHandler, this);
imet4decoder.init(&resampler.out, OUT_SAMPLE_RATE, sondeDataHandler, this);

fmDemod.start();
resampler.start();
Expand Down Expand Up @@ -126,7 +127,8 @@ void
RadiosondeDecoderModule::menuHandler(void *ctx)
{
RadiosondeDecoderModule *_this = (RadiosondeDecoderModule*)ctx;
const float width = ImGui::GetContentRegionAvailWidth();
const ImVec2 wh = ImGui::GetContentRegionAvail();
const float width = wh.x;
char time[64];
bool gpxStatusChanged, ptuStatusChanged;

Expand Down Expand Up @@ -157,7 +159,7 @@ RadiosondeDecoderModule::menuHandler(void *ctx)
ImGui::Text("Serial no.");
if (_this->enabled) {
ImGui::TableNextColumn();
ImGui::Text(_this->lastData.serial.c_str());
ImGui::Text("%s", _this->lastData.serial.c_str());
}

ImGui::TableNextRow();
Expand Down Expand Up @@ -386,7 +388,6 @@ RadiosondeDecoderModule::onTypeSelected(void *ctx, int selection)
config.conf[_this->name]["sondeType"] = selection;
config.release(true);


/* Get new bandwidth */
bw = std::get<1>(_this->supportedTypes[selection]);

Expand All @@ -410,7 +411,7 @@ RadiosondeDecoderModule::onTypeSelected(void *ctx, int selection)
/* Module exports {{{ */
MOD_EXPORT void _INIT_() {
json def = json({});
config.setPath(options::opts.root + "/radiosonde_decoder_config.json");
config.setPath(core::args["root"].s() + "/radiosonde_decoder_config.json");
config.load(def);
config.enableAutoSave();
}
Expand Down
6 changes: 4 additions & 2 deletions src/main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ class RadiosondeDecoderModule : public ModuleManager::Instance {
radiosonde::Decoder<DFM09Decoder, dfm09_decoder_init, dfm09_decoder_deinit, dfm09_decode> dfm09decoder;
radiosonde::Decoder<IMS100Decoder, ims100_decoder_init, ims100_decoder_deinit, ims100_decode> ims100decoder;
radiosonde::Decoder<M10Decoder, m10_decoder_init, m10_decoder_deinit, m10_decode> m10decoder;
radiosonde::Decoder<IMET4Decoder, imet4_decoder_init, imet4_decoder_deinit, imet4_decode> imet4decoder;

const sondespec_t supportedTypes[4] = {
const sondespec_t supportedTypes[5] = {
sondespec_t("RS41", 1e4, &rs41decoder),
sondespec_t("DFM06/09", 1.5e4, &dfm09decoder),
sondespec_t("IMS100", 2e4, &ims100decoder),
sondespec_t("M10", 2.5e4, &m10decoder),
sondespec_t("M10/M20", 2.5e4, &m10decoder),
sondespec_t("iMet-4", 2e4, &imet4decoder),
};
int selectedType = -1;
dsp::generic_unnamed_block *activeDecoder;
Expand Down

0 comments on commit add2896

Please sign in to comment.