日別アーカイブ: 2024年11月10日

Install RTL_SDR Support

https://gist.github.com/derme302/a702e421b7cd133753e5ab87101a01c4

https://github.com/merbanan/rtl_433/tree/master

データの取得例

$ rtl_433  2>/dev/null
[SDR] Using device 0: Realtek, RTL2838UHIDIR, SN: 00000001, "Generic RTL2832U OEM"
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2024-11-12 21:58:45
model     : Emax-W6      id        : dd9
Channel   : 4            Battery_OK: 1             Temperature: 59.3 F       Humidity  : 81 %
Wind avg speed: 0.0 km/h Wind Direction: 228       Total rainfall: 0.2 mm    UV Index  : 1             Lux       : 0
Integrity : CHECKSUM
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2024-11-12 21:59:15
model     : Emax-W6      id        : dd9
Channel   : 4            Battery_OK: 1             Temperature: 59.1 F       Humidity  : 80 %
Wind avg speed: 0.0 km/h Wind Direction: 229       Total rainfall: 0.2 mm    UV Index  : 1             Lux       : 0
Integrity : CHECKSUM

$ rtl_433 2>/dev/null | python t.py

$ cat t.py
#!/usr/bin/python
import sys
for line in sys.stdin:
    #print(line.strip())
    res=line.split()
    if len(res) == 34:
        TT=round((float(res[6])-32)/1.8,1)
        HH=res[10]
        WS=round(float(res[15])/3600,1)
        WD=res[19]
        RR=res[22]
        UV=res[27]
        UL=res[30]
        print(TT,HH,WS,WD,RR,UV,UL)
mars@pi4Bu:~/rtl_433 $ rtl_433   2>/dev/null |python t.py
18.4 69 0.0 229 0.2 1 0
18.4 69 0.0 229 0.2 1 0
18.4 69 0.0 229 0.2 1 0
18.4 69 0.0 229 0.2 1 0
18.5 69 0.0 229 0.2 1 0
18.4 69 0.0 229 0.2 1 0
18.4 69 0.0 229 0.2 1 0
18.4 69 0.0 229 0.2 1 0