Comments (8)
Hi Denoo, this is a good question. Currently the output of rtl_433 is rather free-format and is determined by the writers of the callback routines. If you are interested in adapting it for specific sensors it wouldn't be too hard to make the output more structured (like csv) yourself. Another possibility is to parse the current output using a scripting language like perl or python and generate csv from that.
At this moment I'm working on a version of rtl_433 that implements plugins for the different callbacks. Once I have the plugin infrastruture ready I planned on creating a generic output interface that can be used from the individual callbacks for writing output in different output formats (like csv). I think also (epoch) timestamps needs to be added so when parsing the output on a later time it is still possible to generate historic data (like required when feeding data in rdd files or graphite/whisper files).
Is this kind of what you are looking for?
from rtl_433.
This is, i'm still not enought educated about programing to do it my self.
Using fprintf ?
from rtl_433.
Ok got succes.
Using fprintf I start to create a txt file for each protocol, and it works, each time a callback give a result, it create a txt file (by overwriting the one create before).
First Probleme :
On this kind of line
fprintf(stderr, "battery = %s\n",bb[1][1]&0x80?"OK":"Low")
- stderr is replace by f
fprintf(f, "battery = %s\n",bb[1][1]&0x80?"OK":"Low")
the string is well write on the txt file but nothng is shown on the rtl_433 screen, how can do both ?
from rtl_433.
Please send me a personal message and I will try to help: github at atilas . nl
from rtl_433.
i send you a mail, did you recieve it ?
from rtl_433.
You can disable the buffering for stdin and stderr, to get grep/awk working
(root|~/rtl_433/src) git diff
diff --git a/src/rtl_433.c b/src/rtl_433.c
index fc85f0d..48406ef 100644
--- a/src/rtl_433.c
+++ b/src/rtl_433.c
@@ -987,6 +987,9 @@ int main(int argc, char **argv) {
char vendor[256], product[256], serial[256];
int have_opt_R = 0;
+ setbuf(stdout, NULL);
+ setbuf(stderr, NULL);
+
demod = malloc(sizeof (struct dm_state));
memset(demod, 0, sizeof (struct dm_state));
from rtl_433.
(root|~) cat rtl_433.sh
#!/bin/bash
dir=/var/www/meteo
/usr/local/bin/rtl_433 \
| tee >(stdbuf -o0 fgrep 'Weather Sensor THGR810 Channel 1' > $dir/TH1.txt) \
| tee >(stdbuf -o0 fgrep 'Weather Sensor THGR810 Channel 2' > $dir/TH2.txt) \
| tee >(stdbuf -o0 fgrep 'Weather Sensor THGR810 Channel 3' > $dir/TH3.txt) \
| tee >(stdbuf -o0 fgrep 'Weather Sensor UVN800 Channel 1' > $dir/UV.txt) \
| tee >(stdbuf -o0 fgrep 'Weather Sensor WGR800' > $dir/WG.txt)
(root|/var/www/meteo) cat TH1.txt
Weather Sensor THGR810 Channel 1 Temp: 9.1C 48.4F Humidity: 90%
Weather Sensor THGR810 Channel 1 Temp: 9.1C 48.4F Humidity: 90%
Weather Sensor THGR810 Channel 1 Temp: 9.1C 48.4F Humidity: 90%
(root|/var/www/meteo) cat WG.txt
Weather Sensor WGR800 Wind Gauge Gust Wind Speed : 0 m/s Wind direction 180 dgrs
Weather Sensor WGR800 Wind Gauge Gust Wind Speed : 2 m/s Wind direction 202 dgrs
Weather Sensor WGR800 Wind Gauge Gust Wind Speed : 1 m/s Wind direction 248 dgrs
And for Cacti :
(root|~) cat /usr/share/cacti/site/scripts/meteo.sh
#!/bin/bash
dir=/var/www/meteo
a=$(cat $dir/TH1.txt | tail -n 1 | tr 'C' ' ' | tr '%' ' ' | awk '{print $7}')
b=$(cat $dir/TH1.txt | tail -n 1 | tr 'C' ' ' | tr '%' ' ' | awk '{print $10}')
c=$(cat $dir/TH2.txt | tail -n 1 | tr 'C' ' ' | tr '%' ' ' | awk '{print $7}')
d=$(cat $dir/TH2.txt | tail -n 1 | tr 'C' ' ' | tr '%' ' ' | awk '{print $10}')
e=$(cat $dir/TH3.txt | tail -n 1 | tr 'C' ' ' | tr '%' ' ' | awk '{print $7}')
f=$(cat $dir/TH3.txt | tail -n 1 | tr 'C' ' ' | tr '%' ' ' | awk '{print $10}')
g=$(cat $dir/UV.txt | tail -n 1 | awk '{print $8}')
h=$(cat $dir/WG.txt | tail -n 1 | awk '{print $10}')
i=$(cat $dir/WG.txt | tail -n 1 | awk '{print $14}')
echo -n T1:$a H1:$b T2:$c H2:$d T3:$e H3:$f UV:$g WS:$h WD:$i
(root|/usr/share/cacti/site/scripts) ./meteo.sh
T1:9.0 H1:90 T2:12.0 H2:71 T3:11.9 H3:62 UV:0 WS:1 WD:248
Result : http://www.serveurperso.net/meteo/
from rtl_433.
CSV support is added now which should take care of this issue.
from rtl_433.
Related Issues (20)
- Problem with RTL_433 HOT 5
- Running RTL_433 on Raspberry Pi HOT 1
- Add Acurite 515 and Craftsman CMXWDCR00514 to the list of supported devices under Protocol 40 HOT 1
- TPMS Sensors not detected HOT 11
- Weird problem with rtl_433 HOT 5
- Ecowitt WN34L Help HOT 7
- BRESSER-11-Tage-4CAST-CV-WLAN-Wetterstation-7-in-1 HOT 6
- New device Bresser CO2 sensor, PN 7009977
- New device Bresser HCHO/VOC sensor, PN 7009978 HOT 4
- Bresser Air Quality sensors, ignore first packet HOT 10
- Integrate: TST-507 TPMS sensors HOT 12
- rtlsdr_read_reg failed with -7 after Ctrl+C in previous session HOT 2
- BMW Gen5 TPMS support HOT 23
- [R82XX] PLL not locked! HOT 1
- `rtl_443 --help` output barely readable on bright colour scheme terminals. HOT 4
- Terminal output ignores terminal capabilities (termcap). HOT 3
- Build of documentation fails with `srsmith_pool_srs_2c_tx.c:1: error: explicit link request to 'SRS' could not be resolved (warning treated as error, aborting now)`. HOT 1
- Build of LaTeX documentation fails with `! Dimension too large.` in `bitbuffer_8h.tex`. HOT 3
- `/usr/etc/` is not a standards conforming directory for configuration files. Please use `/etc/` or `/usr/lib/rtl_433/`.
- IDEA: rtl_433 device database HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rtl_433.