kopia lustrzana https://github.com/weetmuts/wmbusmeters
Use new rtl_wmbus option -f to add flow control. If rtl_sdr stops sending samples to rtl_wmbus it will not exit with an error message. Wmbusmeters detects this and restarts the pipeline. Errors from rtl_sdr can be found in a /tmp/tmp....wmbusmeters_rtlsdr file.
rodzic
704e715582
commit
abad0c8d74
|
@ -1,7 +1,7 @@
|
|||
FROM multiarch/alpine:${TARGETARCH}${TARGETVARIANT}-latest-stable AS build
|
||||
RUN apk add --no-cache alpine-sdk gcc linux-headers librtlsdr-dev libxml2-dev cmake libusb-dev bash
|
||||
RUN git clone https://github.com/wmbusmeters/wmbusmeters.git && \
|
||||
git clone https://github.com/weetmuts/rtl-wmbus.git && (cd rtl-wmbus; git checkout -f AddFlowCheck) ; \
|
||||
git clone https://github.com/weetmuts/rtl-wmbus.git \
|
||||
git clone https://github.com/merbanan/rtl_433.git
|
||||
WORKDIR /wmbusmeters
|
||||
RUN make
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include"wmbus_utils.h"
|
||||
#include"rtlsdr.h"
|
||||
#include"serial.h"
|
||||
#include"shell.h"
|
||||
|
||||
#include<assert.h>
|
||||
#include<algorithm>
|
||||
|
@ -158,15 +159,30 @@ shared_ptr<BusDevice> openRTLWMBUS(Detected detected,
|
|||
rtl_wmbus = "rtl_wmbus";
|
||||
}
|
||||
}
|
||||
|
||||
string out;
|
||||
invokeShellCaptureOutput(rtl_wmbus, { "--help" }, {}, &out, true);
|
||||
debug("(rtlwmbus) help %s\n", out.c_str());
|
||||
string add_f = "";
|
||||
if (out.find("-f exit if flow") != string::npos)
|
||||
{
|
||||
add_f = " -f";
|
||||
}
|
||||
else
|
||||
{
|
||||
warning("Warning! rtl_wbus executable lacks -f option! Without this option rtl_wmbus cannot detect when rtl-sdr stops working.\n"
|
||||
"Please upgrade rtl_wmbus.\n");
|
||||
}
|
||||
|
||||
if (command == "")
|
||||
{
|
||||
if (!force_freq)
|
||||
{
|
||||
command = "ERRFILE=$(mktemp --suffix=_wmbusmeters_rtlsdr) ; echo ERRFILE=$ERRFILE ; date -Iseconds > $ERRFILE ; tail -f $ERRFILE & "+rtl_sdr+" "+ppm+" -d "+to_string(id)+" -f "+freq+" -s 1.6e6 - 2>>$ERRFILE | "+rtl_wmbus+" -s -f";
|
||||
command = "ERRFILE=$(mktemp --suffix=_wmbusmeters_rtlsdr) ; echo ERRFILE=$ERRFILE ; date -Iseconds > $ERRFILE ; tail -f $ERRFILE & "+rtl_sdr+" "+ppm+" -d "+to_string(id)+" -f "+freq+" -s 1.6e6 - 2>>$ERRFILE | "+rtl_wmbus+" -s"+add_f;
|
||||
}
|
||||
else
|
||||
{
|
||||
command = "ERRFILE=$(mktemp --suffix=_wmbusmeters_rtlsdr) ; echo ERRFILE=$ERRFILE ; date -Iseconds > $ERRFILE ; tail -f $ERRFILE & "+rtl_sdr+" "+ppm+" -d "+to_string(id)+" -f "+freq+" -s 1.6e6 - 2>>$ERRFILE | "+rtl_wmbus+" -f";
|
||||
command = "ERRFILE=$(mktemp --suffix=_wmbusmeters_rtlsdr) ; echo ERRFILE=$ERRFILE ; date -Iseconds > $ERRFILE ; tail -f $ERRFILE & "+rtl_sdr+" "+ppm+" -d "+to_string(id)+" -f "+freq+" -s 1.6e6 - 2>>$ERRFILE | "+rtl_wmbus+" "+add_f;
|
||||
}
|
||||
}
|
||||
verbose("(rtlwmbus) using command: %s\n", command.c_str());
|
||||
|
|
Ładowanie…
Reference in New Issue