profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/zuckschwerdt/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

merbanan/rtl_433 2958

Program to decode radio transmissions from devices on the ISM bands (and other frequencies)

triq-org/bitbench 119

Visually dissect and analyze bit strings

merbanan/rtl_433_tests 72

This repository contains the regressions test suite for rtl_433

zuckschwerdt/asciidoc.tmbundle 46

AsciiDoc TextMate bundle

triq-org/tx_tools 12

tx_sdr tool for transmitting data to SDRs using SoapySDR

zuckschwerdt/openobex 10

OpenOBEX

zuckschwerdt/b64fast 9

Fast Base64 encoding/decoding NIF for Erlang

triq-org/sdr-spectrogram 7

Generate spectrogram thumbnails for SDR data.

pull request commentmerbanan/rtl_433

Tasmotized Sonoff RF-Bridge decoding support

I hope I'll have some time in the near future to rework this PR. :-)

halfbakery

comment created time in 3 hours

issue commentdeweller/switchaudio-osx

Also as a binary file?

Hi @deweller,

I've noticed that the latest version is 1.1.0, but the one posted here for the premade binaries is still 1.0.0. I've tried looking at the JSON in Homebrew website, but it seems to link to the same source files that are here (not the binaries). I've tried replacing the "1.0.0" in the URL for "1.1.0" but the file can't be found there neither.

Are the premade binaries posted somewhere? Can those be downloading from the JSON Homebrew file or Homebrew compiles on the fly when one installs an app; hence the binaries are not already uploaded?

Thanks for your support and maintaining these project!

UnixCro

comment created time in 5 hours

PR closed merbanan/rtl_433

HTTP POST output wip

Proof of concept for REST (HTTP POST) output in JSON format. Introduces libcurl dependency.

+174 -2

3 comments

8 changed files

vhuk

pr closed time in 12 hours

pull request commentmerbanan/rtl_433

Added support for Honeywell Wireless Doorbell

it's a Friedland Libra+ D915S Doorbell. Hopefully i will find some minutes on next weekend to give feedback.

Thanks!

merbanan

comment created time in 14 hours

issue commentmerbanan/rtl_433

Weather Sensor EMOS 6016 equipped with Temp, Hum, Winddirection, Windspeed

Morning, more tests mor in the wild shows -> the sensors delivers 16 cardinal wind directions. from 00,01 ... 0e,0f . i was wondering that i have after deconding no value for "WD". and the raw show me the secret. :)

AutomGuy

comment created time in 20 hours

issue commentpothosware/SoapySDR

[low-priority] Swig compile failure

FYI pythonbegin was added in Version 2.0.11 (15 Sep 2013) http://swig.org/Release/CHANGES

xloem

comment created time in a day

issue commentpothosware/SoapySDR

[low-priority] Swig compile failure

Looks related to the %pythonbegin %{ ... %} section. Perhaps its a swig 3.0 thing. I can add a version check but im not 100% sure thats the reason. Do you have a version of swig3.0 in the package manager to try, for example ubuntu is apt-get install swig3.0

xloem

comment created time in a day

issue openedpothosware/SoapySDR

[low-priority] Swig compile failure

after cmake .. on git master today:

[ 94%] Swig compile /home/user/src/SoapySDR/build/python/SoapySDR.i for python
/home/user/src/SoapySDR/build/python/SoapySDR.i:38: Error: Syntax error in input(1).

created time in a day

issue closedpothosware/SoapySDR

Undefined symbol: _ZN5boost6chrono12steady_clock3nowEv

Hi! Get error when start CubicSdr, or SdrAngel, or even gnuradio-companion:

[INFO] [UHD] linux; GNU C++ version 10.2.1 20201207; Boost_107400; UHD_3.15.0.0-4+b1
[ERROR] SoapySDR::loadModule(/usr/lib/x86_64-linux-gnu/SoapySDR/modules0.7/librfspaceSupport.so)
  dlopen() failed: /usr/lib/x86_64-linux-gnu/SoapySDR/modules0.7/librfspaceSupport.so: undefined symbol: _ZN5boost6chrono12steady_clock3nowEv
Hash collision!!! Fatal error!!
pure virtual method called
terminate called without an active exception
Aborted

Can anybody help me?

gnuradio version: 3.8.2.0 (Python 3.9.2)

closed time in a day

izabarovsky

issue commentpothosware/SoapySDR

Undefined symbol: _ZN5boost6chrono12steady_clock3nowEv

Fixed with installation from sources Install gnuradio v3.10 Install gr-osmosdr gr-osmosdr 0.2.0.0 Custom path used: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/gnuradio-release -DPYTHON_EXECUTABLE=/usr/bin/python ../ cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../ -DCMAKE_INSTALL_PREFIX=/opt/gr-osmosdr-release So some magic required in .bashrc export PYTHONPATH=/opt/gnuradio-release/lib/python3/dist-packages:$PYTHONPATH export LD_LIBRARY_PATH=/opt/gnuradio-release/lib:$LD_LIBRARY_PATH export GRC_BLOCKS_PATH=/opt/gr-osmosdr-release/share/gnuradio/grc/blocks

And link sudo ln -s /opt/gnuradio-release/bin/gnuradio-companion /usr/bin/gnuradio-companion

Now gnuradio-companion + HackRf transmitt whithout any errors. But any another soft (like CubicSdr or sdrangel) reinstall required

izabarovsky

comment created time in a day

issue openedmerbanan/rtl_433

running it with hackrf via soapysdr cause type overflow.

it throws overflow exception when using the cs16 sampling size.

I am seeing this with hackrf device. rtl_433 -d driver=hackrf here is the stacktrace.

signed integer overflow: 1431655765 + 2147483646 cannot be represented in type 'int' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/bl/workspaces/rtl_433/src/baseband.c:327:50 in

created time in a day

pull request commentmerbanan/rtl_433

Add Tech-433 temperature sensor.

Hello I recoded the tech_433 device 'normally' without adding the pulse_demod_ppm_spe function.

tech_433.txt

marco402

comment created time in 2 days

issue commentmerbanan/rtl_433

11.5 Gig txt file

Thanks but why remove thread?Sent from SpaceOn 16 May 2021 8:37 pm, "Christian W. Zuckschwerdt" ***@***.***> wrote: Closed #1716.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.

krill074

comment created time in 2 days

issue openedmerbanan/rtl_433

11.5 Gig txt file

Hello Im new to this software and only recently got it running during daytime only, nitetime seems to stop weather beacons. I left this to record overnight and write the information to a txt file using -w 6 to 7 hours later the program had exited. The txt file was so large I couldnt open it, it was over 11Gig in size. Im using the windows compiled version too..

Why does it do this?

rtl_433 -w - âzü}é⌂Ç{é|ä{ä~⌂⌂}}Ç~üÇü⌂|⌂Ç~âü⌂{|}ü{⌂⌂⌂åzé{Ç}⌂Ç{ü|{}~Ç~⌂yz~üÇ⌂~}üÇé}|Ç}Çé|⌂üüâÇz|{}Çé|Ç}üàÇüüâ~â|ä}ü⌂⌂⌂}~Ç⌂}Ç⌂~äézü{é~⌂âÇéééüÇéÇÇü}|~ü~üÇü}ÇâàÇéüÇ}{{Çü|ü~⌂ÇäÇééå~éÇâ Times a Billion.

Is this because its not process through Demodulator option?

Grant

created time in 2 days

issue commentpothosware/SoapySDR

Undefined symbol: _ZN5boost6chrono12steady_clock3nowEv

May be installation from src will help?

Maybe, im not sure whats wrong with the package. But I would at least try to uninstall just the deb package that provides the librfspaceSupport.so module first. Maybe its just one bad lib, and everything else is fine. You can always install an individual rfspace module from source if its needed.

izabarovsky

comment created time in 2 days

issue commentpothosware/SoapySDR

Undefined symbol: _ZN5boost6chrono12steady_clock3nowEv

purge all previously installed packages, then install from debian repos:

...
apt install sdrangelove

Same error May be installation from src will help?

izabarovsky

comment created time in 2 days

issue commentpothosware/SoapySDR

Undefined symbol: _ZN5boost6chrono12steady_clock3nowEv

I didnt get a lot of information about what you installed, so this is all just a guess

Its possible that librfspace from the package manager is just kind of funny, so you could try to uninstall it

More likely this is just some abi library error from a bad install, I would encourage you to read:

  • https://github.com/pothosware/SoapySDR/wiki/ConfigGuide#what-to-install
  • https://github.com/pothosware/SoapySDR/wiki/ConfigGuide#avoid-simultaneous-installs
izabarovsky

comment created time in 2 days

issue closedmerbanan/rtl_433

problem running rtl_433 on RB Pi4 in container under docker

Dear Fellows,

On my RB Pi4 i'm running IoTstack so docker with number of containers. One of the containers is rtl_433. When i enter the rtl_433 container via container manager (i'm using Portainer) and start its console and enter: rlt_433 i'm getting: usb_claim_interface error -6 rlt_433 issue1 I've read that it might be the problem that other piece of software accessed this usb prior rtl_433. But everything is inside container and i can not figure out how to obey this issue. I'm not Linux expert:(

I've connected to my headless Pi with Putty and tried to use "rtl_433" there but i got "-bash: rtl_433: command not found" which is not surprising for me as rtl is hidden inside container... Please direct me toward good direction. Thank you

closed time in 2 days

bogus105

issue commentmerbanan/rtl_433

problem running rtl_433 on RB Pi4 in container under docker

i'm confused. I put "ps -ef | grep rtl_433" via Putty terminal. Not in docker. I got this: rtl5

Does is mean the process is running?

bogus105

comment created time in 2 days

issue openedpothosware/SoapySDR

Undefined symbol: _ZN5boost6chrono12steady_clock3nowEv

Hi! Get error when start CubicSdr, or SdrAngel, or even gnuradio-companion:

[INFO] [UHD] linux; GNU C++ version 10.2.1 20201207; Boost_107400; UHD_3.15.0.0-4+b1
[ERROR] SoapySDR::loadModule(/usr/lib/x86_64-linux-gnu/SoapySDR/modules0.7/librfspaceSupport.so)
  dlopen() failed: /usr/lib/x86_64-linux-gnu/SoapySDR/modules0.7/librfspaceSupport.so: undefined symbol: _ZN5boost6chrono12steady_clock3nowEv
Hash collision!!! Fatal error!!
pure virtual method called
terminate called without an active exception
Aborted

Can anybody help me?

gnuradio version: 3.8.2.0 (Python 3.9.2)

created time in 2 days

issue commentmerbanan/rtl_433

problem running rtl_433 on RB Pi4 in container under docker

The docker image is probably already running rtl_433 check to see if you see any processes returned with: ps -ef | grep rtl_433

If you see one and you want to try it interactively instead rather than the service the docker image starts run killall rtl_433

bogus105

comment created time in 2 days

issue commentmerbanan/rtl_433

problem running rtl_433 on RB Pi4 in container under docker

additional information: by using rtl_test -t i'm getting: `root@d4ee0ea9ec80:/# rtl_test -t Found 1 device(s): 0: Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM usb_claim_interface error -6 Failed to open rtlsdr device #0. root@d4ee0ea9ec80:/# ^C root@d4ee0ea9ec80:/# `

bogus105

comment created time in 2 days

issue commentmerbanan/rtl_433

problem running rtl_433 on RB Pi4 in container under docker

This is my portainer with containers: rtl4

Have no idea how to check if something else is using rtl_433 already:/

bogus105

comment created time in 3 days

issue commentmerbanan/rtl_433

problem running rtl_433 on RB Pi4 in container under docker

I did it then rebooted and did lsmod again this this result: rtl1 rtl2 no more rtl's in the listing, then i went back to portainer and rtl_433 container and put: "rtl_433" and this is the output: rtl3

looks like something is still blocking the driver or i did something wrong?

bogus105

comment created time in 3 days

issue commentmerbanan/rtl_433

problem running rtl_433 on RB Pi4 in container under docker

Thank you zuckschwerdt for reply. Where should i disable it? Rtl_433 is running in docker container. Should i disable DVB-T driver directly under my pi user account via Putty? Not in IoTstack/container? Just did this: logged in to my Pi via putty and put "sudo lsmod" and this is the output: lsmod output1 lsmod output2

so i can see lines mentioning rtl/dvb related things: rtl2832 20480 0 i2c_mux 16384 1 rtl2832 regmap_i2c 16384 1 rtl2832 dvb_usb_rtl28xxu 28672 0 dvb_usb_v2 28672 1 dvb_usb_rtl28xxu mc 40960 8 bcm2835_isp,bcm2835_codec,videobuf2_common,video dev,dvb_core,dvb_usb_v2,v4l2_mem2mem,videobuf2_v4l2

Lost in the forest:/

bogus105

comment created time in 3 days

issue openedmerbanan/rtl_433

problem running rtl_433 on RB Pi4 in container under docker

Dear Fellows,

On my RB Pi4 i'm running IoTstack so docker with number of containers. One of the containers is rtl_433. When i enter the rtl_433 container via container manager (i'm using Portainer) and start its console and enter: rlt_433 i'm getting: usb_claim_interface error -6 rlt_433 issue1 I've read that it might be the problem that other piece of software accessed this usb prior rtl_433. But everything is inside container and i can not figure out how to obey this issue. I'm not Linux expert:(

I've connected to my headless Pi with Putty and tried to use "rtl_433" there but i got "-bash: rtl_433: command not found" which is not surprising for me as rtl is hidden inside container... Please direct me toward good direction. Thank you

created time in 3 days

pull request commentmerbanan/rtl_433_tests

"Emax" branded remote control tests

Sorry, I think I'm messing something up.

Pressing one button (A "on") I get this message 8 times (using rtl_433 -A -a 4)

Detected OOK package    2021-05-13 21:21:36
Analyzing pulses...
Total count:   34,  width: 37.76 ms             ( 9440 S)
Pulse width distribution:
 [ 0] count:   15,  width:  832 us [828;848]    ( 208 S)
 [ 1] count:   19,  width:  316 us [312;324]    (  79 S)
Gap width distribution:
 [ 0] count:   15,  width:  296 us [296;308]    (  74 S)
 [ 1] count:   18,  width:  812 us [808;820]    ( 203 S)
Pulse period distribution:
 [ 0] count:   33,  width: 1132 us [1124;1144]  ( 283 S)
Level estimates [high, low]:  15961,    374
RSSI: -0.1 dB SNR: 16.3 dB Noise: -16.4 dB
Frequency offsets [F1, F2]:    3929,      0     (+15.0 kHz, +0.0 kHz)
Guessing modulation: Pulse Width Modulation with fixed period
Attempting demodulation... short_width: 316, long_width: 832, reset_limit: 824, sync_width: 0
Use a flex decoder with -X 'n=name,m=OOK_PWM,s=316,l=832,r=824,g=0,t=204,y=0'
pulse_demod_pwm(): Analyzer Device
bitbuffer:: Number of rows: 1
[00] {34} 4a f6 f0 4b c0 : 01001010 11110110 11110000 01001011 11

After the eight repeated similar messages (with only small variation between times which I believe is expected), I get this message which is shown only once:

*** signal_start = 23406648, signal_end = 23519791, signal_len = 113143, pulses_found = 272
Iteration 1. t: 143    min: 79 (152)    max: 208 (120)    delta 13
Iteration 2. t: 143    min: 79 (152)    max: 208 (120)    delta 0
Pulse coding: Short pulse length 79 - Long pulse length 208

Short distance: 74, long distance: 203, packet distance: 2522

p_limit: 143
bitbuffer:: Number of rows: 8
[00] {34} b5 09 0f b4 00 : 10110101 00001001 00001111 10110100 00
[01] {34} b5 09 0f b4 00 : 10110101 00001001 00001111 10110100 00
[02] {34} b5 09 0f b4 00 : 10110101 00001001 00001111 10110100 00
[03] {34} b5 09 0f b4 00 : 10110101 00001001 00001111 10110100 00
[04] {34} b5 09 0f b4 00 : 10110101 00001001 00001111 10110100 00
[05] {34} b5 09 0f b4 00 : 10110101 00001001 00001111 10110100 00
[06] {34} b5 09 0f b4 00 : 10110101 00001001 00001111 10110100 00
[07] {34} b5 09 0f b4 00 : 10110101 00001001 00001111 10110100 00

The hexadecimals are different from the original messages, so I don't know what that means? Is this just some kind of summary of the previous messages? If so, the captures I've committed should be ok.

salleq

comment created time in 4 days

Pull request review commentmerbanan/rtl_433

Roja Flex support

 RTL\-SDR device driver is available. To set gain for RTL\-SDR use \-g <gain> to set an overall gain in dB. .RE .RS-SoapySDR device driver is available.+SoapySDR device driver is not available.

It seems to be that the *.1 is a local generated file? And its coming from #ifdef SOAPYSDR "\tSoapySDR device driver is available.\n" #else "\tSoapySDR device driver is not available.\n" #endif

I can correct the Readme.md or what should I do?

Hofyyy

comment created time in 4 days

Pull request review commentmerbanan/rtl_433

Roja Flex support

+/** @file+    Rojaflex shutter and remote devices.++    Copyright (c) 2021 Sebastian Hofmann <sebastian.hofmann+rtl433@posteo.de>++    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+    the Free Software Foundation; either version 2 of the License, or+    (at your option) any later version.+ */++#include "decoder.h"++/**+Frequency: 433.92MH+.modulation  = FSK_PULSE_PCM,+.short_width = 100,+.long_width  = 100,+.reset_limit = 102400,+*/++/**+Signal documentation++Default signal layout+0xaaaaaaaa d391d391 SS KKKKKK ?CDDDD TTTT CCCC++4 Bytes Preamble+4 Bytes Sync Word+1 Byte  Size       "S" is always "0x08"+3 Bytes ID         "Seems to be the static ID for the Homeinstallation"+3 Bytes Data       "See docu below"+2 Bytes Token      "It seems to be a message token which is used for the shutter answer."+2 Bytes CRC-16/CMS "Seems optional, because this is missing from commands via bridge P2D."+19 Byte Summe      "Only 17 Bytes without CRC (from bridge)"++Data documentation+0xFF     - Size always "0x8"+0xFFFFFF - ID, I assume that differs per installation, but is static then+0xF      - Unknown (is static 0x2) - Not sure if it is also the HomeID+0xF      - Channel: 1-15 single channels (one shutter is registert to one channel), 0 means all+0xFF     - Command ID    (0x0a = stop, 0x1a = up,0x8a = down, 0xea = Request)+0xFF     - Command Value (in status from shutter this is the percent value. 0% for open 100% for close)++Message Token documentation+See generator function, no clue how to calculate it dynamic++To get raw data:+./rtl_433 -f 433920000 -X n=rojaflex,m=FSK_PCM,s=100,l=100,r=102400+*/++// Message Defines+#define DATAFRAME_BITCOUNT_INCL_CRC 88+#define DATAFRAME_BYTECOUNT_INCL_CRC 11 //Including CRC but no pramble+#define LENGTH_OFFSET 0+#define LENGTH_BITCOUNT 8+#define ID_OFFSET 1 // HomeID which I assume is static for one Remote Device+#define ID_BITCOUNT 28+#define CHANNEL_OFFSET 4         // Mask 0x0F+#define UNKNOWN_CHANNEL_OFFSET 5 // Mask 0xF0+#define COMMAND_ID_OFFSET 5+#define COMMAND_ID_BITCOUNT 8+#define COMMAND_VALUE_OFFSET 6+#define COMMAND_VALUE_BITCOUNT 8+#define MESSAGE_TOKEN_OFFSET 7+#define MESSAGE_TOKEN_BITCOUNT 16+#define MESSAGE_CRC_OFFSET 9+#define MESSAGE_CRC_BITCOUNT 16++//Command Defindes+#define COMMAND_ID_STOP 0x0a+#define COMMAND_ID_UP 0x1a+#define COMMAND_ID_DOWN 0x8a+#define COMMAND_ID_SAVE_UNSAVE_POS 0x9a+#define COMMAND_ID_GO_SAVED_POS 0xda+#define COMMAND_ID_REQUESTSTATUS 0xea++// Done+static char *getCommandString(uint8_t *msg)+{+    switch (msg[COMMAND_ID_OFFSET]) {+    case COMMAND_ID_STOP:+        return "0x0a - Stop     ";+    case COMMAND_ID_UP:+        return "0x1a - Up       ";+    case COMMAND_ID_DOWN:+        return "0x8a - Down     ";+    case COMMAND_ID_SAVE_UNSAVE_POS:+        // 5 x Stop on remote set inclined pos.+        // Command is complete identical for set and unset+        // - If nothing is saved it will set.+        // - If something is saved and the position is identical it will reset.+        //   The P2D bridge is beeping in that case.+        return "0x9a - Save/Unsave position";+    case COMMAND_ID_GO_SAVED_POS:+        // Hold Stop for 5 seconds to drive to saved pos.+        return "0xda - Go saved position";+    case COMMAND_ID_REQUESTSTATUS:+        // I am not sure if that is true.+        // I know that the remote is sending the message and not the shutter.+        // I know that the bridge is not sending this message after e.g.0x1a.+        // I know that the shutter sends a Position status right after this message.+        // After the normal 0x1a command from a bridge, the position status+        // will be send wenn the stutter is completely up but not before.+        // So I think this is a "Request Shutter Status Now".+        return "0xea - Request Status    ";+    case 0x85: //  0%+        return "0x85 - Pos. Status -   0%";+    case 0x95: // 20%+        return "0x95 - Pos. Status -  20%";+    case 0xA5: // 40%+        return "0xA5 - Pos. Status -  40%";+    case 0xB5: // 60%+        return "0xB5 - Pos. Status -  60%";+    case 0xC5: // 80%+        return "0xC5 - Pos. Status -  80%";+    case 0xD5: //100%+        return "0xD5 - Pos. Status - 100%";+    }+    return "unknown";+}++static int rojaflex_decode(r_device *decoder, bitbuffer_t *bitbuffer)+{+    uint8_t const message_preamble[] = {+            /*0xaa, 0xaa,*/ 0xaa, 0xaa, // preamble+            0xd3, 0x91, 0xd3, 0x91      // sync word+    };++    data_t *data;+    uint8_t msg[DATAFRAME_BYTECOUNT_INCL_CRC];+    uint8_t dataframe_bitcount = 0;++    if (bitbuffer->num_rows != 1) {+        return DECODE_ABORT_EARLY;+    }++    int row = 0;+    // Validate message and reject it as fast as possible : check for preamble+    unsigned start_pos = bitbuffer_search(bitbuffer, row, 0, message_preamble, sizeof(message_preamble) * 8);++    if (start_pos < bitbuffer->bits_per_row[row]) {+        // Save bitcount of total message including preamble+        dataframe_bitcount = (bitbuffer->bits_per_row[row] - start_pos - sizeof(message_preamble) * 8) & 0xFE;+    }+    else {+        return DECODE_ABORT_EARLY; // no preamble detected+    }++    if (dataframe_bitcount < (DATAFRAME_BITCOUNT_INCL_CRC - MESSAGE_CRC_BITCOUNT) || (dataframe_bitcount > DATAFRAME_BITCOUNT_INCL_CRC)) {+        // check min and max length+        return DECODE_ABORT_LENGTH;+    }++    //Extract raw line+    bitbuffer_extract_bytes(bitbuffer, row, start_pos + sizeof(message_preamble) * 8, msg, dataframe_bitcount);+    if (decoder->verbose > 1) {+        bitrow_printf(msg, dataframe_bitcount, "%s: frame data: ", __func__);+    }++    // Check CRC if available+    if (dataframe_bitcount == DATAFRAME_BITCOUNT_INCL_CRC) {+        // Thanks to: ./reveng -w 16 -s $msg1 $msg2 $msg3+        // width=16  poly=0x8005  init=0xffff  refin=false  refout=false  xorout=0x0000  check=0xaee7  residue=0x0000  name="CRC-16/CMS"+        uint16_t crc_message = (msg[MESSAGE_CRC_OFFSET] << 8 | msg[MESSAGE_CRC_OFFSET + 1]);+        uint16_t crc_calc    = crc16(&msg[LENGTH_OFFSET], 9, 0x8005, 0xffff);++        if (crc_message != crc_calc) {+            if (decoder->verbose)+                fprintf(stderr, "%s: CRC invalid message:%04x != calc:%04x\n", __func__, crc_message, crc_calc);++            return DECODE_FAIL_MIC;+        };+    }++    // Build the default terminal output+    {+        char tokenString[7] = "";+        char id[10]         = "";+        char *deviceType    = "unknown";+        sprintf(tokenString, "0x%02x%02x", msg[MESSAGE_TOKEN_OFFSET], msg[MESSAGE_TOKEN_OFFSET + 1]);+        sprintf(id, "0x%02x%02x%02x%01x", msg[ID_OFFSET], msg[ID_OFFSET + 1], msg[ID_OFFSET + 2], (msg[ID_OFFSET + 3] >> 4));++        if ((msg[COMMAND_ID_OFFSET] & 0xF) == 0x5) {+            deviceType = "RojaFlex-Shutter";+        }+        else if ((msg[COMMAND_ID_OFFSET] & 0xF) == 0xa) {+            // Rojaflex Bridge clones a remote signal but does not send an CRC!?!?+            // So we can detect if it a real remote or a bridge on the message length.+            if (dataframe_bitcount == DATAFRAME_BITCOUNT_INCL_CRC) {+                deviceType = "RojaFlex-Remote";+            }+            else {+                deviceType = "RojaFlex-Bridge";+            }+        }++        /* clang-format off */+        data = data_make(+                    "model",        "Model",     DATA_STRING, deviceType,+                    "id",           "ID",        DATA_STRING, id,+                    "channel",      "Channel",   DATA_INT,    msg[CHANNEL_OFFSET] & 0xF,+                    "token",        "Msg Token", DATA_STRING, tokenString,+                    "commandtype",  "Command ",  DATA_STRING, getCommandString(&msg[0]),+                    "commandvalue", "Value",     DATA_INT,    msg[COMMAND_VALUE_OFFSET],+                    "mic",          "Integrity", DATA_STRING, (dataframe_bitcount == DATAFRAME_BITCOUNT_INCL_CRC) ? "CRC" : "",

Done

Hofyyy

comment created time in 4 days

Pull request review commentmerbanan/rtl_433

Roja Flex support

+/** @file+    Rojaflex shutter and remote devices.++    Copyright (c) 2021 Sebastian Hofmann <sebastian.hofmann+rtl433@posteo.de>++    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+    the Free Software Foundation; either version 2 of the License, or+    (at your option) any later version.+ */++#include "decoder.h"++/**+Frequency: 433.92MH+.modulation  = FSK_PULSE_PCM,+.short_width = 100,+.long_width  = 100,+.reset_limit = 102400,+*/++/**+Signal documentation++Default signal layout+0xaaaaaaaa d391d391 SS KKKKKK ?CDDDD TTTT CCCC++4 Bytes Preamble+4 Bytes Sync Word+1 Byte  Size       "S" is always "0x08"+3 Bytes ID         "Seems to be the static ID for the Homeinstallation"+3 Bytes Data       "See docu below"+2 Bytes Token      "It seems to be a message token which is used for the shutter answer."+2 Bytes CRC-16/CMS "Seems optional, because this is missing from commands via bridge P2D."+19 Byte Summe      "Only 17 Bytes without CRC (from bridge)"++Data documentation+0xFF     - Size always "0x8"+0xFFFFFF - ID, I assume that differs per installation, but is static then+0xF      - Unknown (is static 0x2) - Not sure if it is also the HomeID+0xF      - Channel: 1-15 single channels (one shutter is registert to one channel), 0 means all+0xFF     - Command ID    (0x0a = stop, 0x1a = up,0x8a = down, 0xea = Request)+0xFF     - Command Value (in status from shutter this is the percent value. 0% for open 100% for close)++Message Token documentation+See generator function, no clue how to calculate it dynamic++To get raw data:+./rtl_433 -f 433920000 -X n=rojaflex,m=FSK_PCM,s=100,l=100,r=102400+*/++// Message Defines+#define DATAFRAME_BITCOUNT_INCL_CRC 88+#define DATAFRAME_BYTECOUNT_INCL_CRC 11 //Including CRC but no pramble+#define LENGTH_OFFSET 0+#define LENGTH_BITCOUNT 8+#define ID_OFFSET 1 // HomeID which I assume is static for one Remote Device+#define ID_BITCOUNT 28+#define CHANNEL_OFFSET 4         // Mask 0x0F+#define UNKNOWN_CHANNEL_OFFSET 5 // Mask 0xF0+#define COMMAND_ID_OFFSET 5+#define COMMAND_ID_BITCOUNT 8+#define COMMAND_VALUE_OFFSET 6+#define COMMAND_VALUE_BITCOUNT 8+#define MESSAGE_TOKEN_OFFSET 7+#define MESSAGE_TOKEN_BITCOUNT 16+#define MESSAGE_CRC_OFFSET 9+#define MESSAGE_CRC_BITCOUNT 16++//Command Defindes+#define COMMAND_ID_STOP 0x0a+#define COMMAND_ID_UP 0x1a+#define COMMAND_ID_DOWN 0x8a+#define COMMAND_ID_SAVE_UNSAVE_POS 0x9a+#define COMMAND_ID_GO_SAVED_POS 0xda+#define COMMAND_ID_REQUESTSTATUS 0xea++// Done+static char *getCommandString(uint8_t *msg)+{+    switch (msg[COMMAND_ID_OFFSET]) {+    case COMMAND_ID_STOP:+        return "0x0a - Stop     ";+    case COMMAND_ID_UP:+        return "0x1a - Up       ";+    case COMMAND_ID_DOWN:+        return "0x8a - Down     ";+    case COMMAND_ID_SAVE_UNSAVE_POS:+        // 5 x Stop on remote set inclined pos.+        // Command is complete identical for set and unset+        // - If nothing is saved it will set.+        // - If something is saved and the position is identical it will reset.+        //   The P2D bridge is beeping in that case.+        return "0x9a - Save/Unsave position";+    case COMMAND_ID_GO_SAVED_POS:+        // Hold Stop for 5 seconds to drive to saved pos.+        return "0xda - Go saved position";+    case COMMAND_ID_REQUESTSTATUS:+        // I am not sure if that is true.+        // I know that the remote is sending the message and not the shutter.+        // I know that the bridge is not sending this message after e.g.0x1a.+        // I know that the shutter sends a Position status right after this message.+        // After the normal 0x1a command from a bridge, the position status+        // will be send wenn the stutter is completely up but not before.+        // So I think this is a "Request Shutter Status Now".+        return "0xea - Request Status    ";+    case 0x85: //  0%+        return "0x85 - Pos. Status -   0%";+    case 0x95: // 20%+        return "0x95 - Pos. Status -  20%";+    case 0xA5: // 40%+        return "0xA5 - Pos. Status -  40%";+    case 0xB5: // 60%+        return "0xB5 - Pos. Status -  60%";+    case 0xC5: // 80%+        return "0xC5 - Pos. Status -  80%";+    case 0xD5: //100%+        return "0xD5 - Pos. Status - 100%";+    }+    return "unknown";+}++static int rojaflex_decode(r_device *decoder, bitbuffer_t *bitbuffer)+{+    uint8_t const message_preamble[] = {+            /*0xaa, 0xaa,*/ 0xaa, 0xaa, // preamble+            0xd3, 0x91, 0xd3, 0x91      // sync word+    };++    data_t *data;+    uint8_t msg[DATAFRAME_BYTECOUNT_INCL_CRC];+    uint8_t dataframe_bitcount = 0;++    if (bitbuffer->num_rows != 1) {+        return DECODE_ABORT_EARLY;+    }++    int row = 0;+    // Validate message and reject it as fast as possible : check for preamble+    unsigned start_pos = bitbuffer_search(bitbuffer, row, 0, message_preamble, sizeof(message_preamble) * 8);++    if (start_pos < bitbuffer->bits_per_row[row]) {+        // Save bitcount of total message including preamble+        dataframe_bitcount = (bitbuffer->bits_per_row[row] - start_pos - sizeof(message_preamble) * 8) & 0xFE;+    }+    else {+        return DECODE_ABORT_EARLY; // no preamble detected+    }++    if (dataframe_bitcount < (DATAFRAME_BITCOUNT_INCL_CRC - MESSAGE_CRC_BITCOUNT) || (dataframe_bitcount > DATAFRAME_BITCOUNT_INCL_CRC)) {+        // check min and max length+        return DECODE_ABORT_LENGTH;+    }++    //Extract raw line+    bitbuffer_extract_bytes(bitbuffer, row, start_pos + sizeof(message_preamble) * 8, msg, dataframe_bitcount);+    if (decoder->verbose > 1) {+        bitrow_printf(msg, dataframe_bitcount, "%s: frame data: ", __func__);+    }++    // Check CRC if available+    if (dataframe_bitcount == DATAFRAME_BITCOUNT_INCL_CRC) {+        // Thanks to: ./reveng -w 16 -s $msg1 $msg2 $msg3+        // width=16  poly=0x8005  init=0xffff  refin=false  refout=false  xorout=0x0000  check=0xaee7  residue=0x0000  name="CRC-16/CMS"+        uint16_t crc_message = (msg[MESSAGE_CRC_OFFSET] << 8 | msg[MESSAGE_CRC_OFFSET + 1]);+        uint16_t crc_calc    = crc16(&msg[LENGTH_OFFSET], 9, 0x8005, 0xffff);++        if (crc_message != crc_calc) {+            if (decoder->verbose)+                fprintf(stderr, "%s: CRC invalid message:%04x != calc:%04x\n", __func__, crc_message, crc_calc);++            return DECODE_FAIL_MIC;+        };+    }++    // Build the default terminal output+    {+        char tokenString[7] = "";+        char id[10]         = "";+        char *deviceType    = "unknown";+        sprintf(tokenString, "0x%02x%02x", msg[MESSAGE_TOKEN_OFFSET], msg[MESSAGE_TOKEN_OFFSET + 1]);+        sprintf(id, "0x%02x%02x%02x%01x", msg[ID_OFFSET], msg[ID_OFFSET + 1], msg[ID_OFFSET + 2], (msg[ID_OFFSET + 3] >> 4));++        if ((msg[COMMAND_ID_OFFSET] & 0xF) == 0x5) {+            deviceType = "RojaFlex-Shutter";+        }+        else if ((msg[COMMAND_ID_OFFSET] & 0xF) == 0xa) {+            // Rojaflex Bridge clones a remote signal but does not send an CRC!?!?+            // So we can detect if it a real remote or a bridge on the message length.+            if (dataframe_bitcount == DATAFRAME_BITCOUNT_INCL_CRC) {+                deviceType = "RojaFlex-Remote";+            }+            else {+                deviceType = "RojaFlex-Bridge";+            }+        }++        /* clang-format off */+        data = data_make(+                    "model",        "Model",     DATA_STRING, deviceType,+                    "id",           "ID",        DATA_STRING, id,+                    "channel",      "Channel",   DATA_INT,    msg[CHANNEL_OFFSET] & 0xF,+                    "token",        "Msg Token", DATA_STRING, tokenString,+                    "commandtype",  "Command ",  DATA_STRING, getCommandString(&msg[0]),+                    "commandvalue", "Value",     DATA_INT,    msg[COMMAND_VALUE_OFFSET],+                    "mic",          "Integrity", DATA_STRING, (dataframe_bitcount == DATAFRAME_BITCOUNT_INCL_CRC) ? "CRC" : "",+                    NULL);+        /* clang-format on */++        decoder_output_data(decoder, data);+    }++// You can use this defines to clone / generate all commands for other bridges+#define GENERATE_COMMANDS_FOR_CURRENT_CHANNEL 0+#define GENERATE_COMMANDS_FOR_ALL_CHANNELS 0++    if (GENERATE_COMMANDS_FOR_CURRENT_CHANNEL || GENERATE_COMMANDS_FOR_ALL_CHANNELS) {+        uint8_t const remote_commands[] = {+                COMMAND_ID_STOP,+                COMMAND_ID_UP,+                COMMAND_ID_DOWN,+                COMMAND_ID_SAVE_UNSAVE_POS,+                COMMAND_ID_GO_SAVED_POS,+                COMMAND_ID_REQUESTSTATUS};++        uint8_t channel = GENERATE_COMMANDS_FOR_CURRENT_CHANNEL ? msg[CHANNEL_OFFSET] & 0xF : 0;+        uint8_t command = 0;+        uint8_t msg_new[19];+        uint16_t sum = 0;++        fprintf(stderr, "\n");+        fprintf(stderr, "%s: Signal cloner\n", __func__);+        fprintf(stderr, "%s: \n", __func__);

done

I did not do this before, because this is special code, which you need to activate by a define. This will not happen during normal usage.

Hofyyy

comment created time in 4 days