merbanan / rtl_433

Program to decode radio transmissions from devices on the ISM bands (and other frequencies)
GNU General Public License v2.0
6.04k stars 1.31k forks source link

Different data for Apollo Ultrasonic Oil Tank Sensor #2720

Open matt5mith opened 10 months ago

matt5mith commented 10 months ago

Hello

I have an Apollo Ultrasonic Oil Tank Sensor and was hoping to take advantage of the Oil Smart decoder but I seem to be getting slightly different data which means it doesn't get decoded. Here is an example of what's coming back:

{158}555558a966955956a6aa55a996a656a966aa9a3c

As per https://github.com/merbanan/rtl_433/discussions/2244, if I run:

rtl_433 -R 0 -X 'n=name,m=FSK_PCM,s=500,l=500,g=2000,r=9000,preamble=5558'

... then I get back this format:

{134}a966955956a6aa55a996a656a966aa9a3c

If I add this value into the existing BitBench then it appears to decode to 26cm properly.

So, it appears that the existing decoder will work, but for whatever reason, it's not being used.

Any help or guidance would be hugely appreciated. The end goal is to get the data into Home Assistant via MQTT, but I'm quite comfortable with that side of things. It's just the decoding which I'm struggling with.

zuckschwerdt commented 10 months ago

After decoding we expect the first bytes (perhaps a model code) to be 55 58. In your sample it's 1a7d. You can disable (comment) this line https://github.com/merbanan/rtl_433/blob/master/src/devices/oil_smart.c#L71

It would be great if you can watch the codes you get and report maybe after a week a list. Run with -R 235:v to see raw codes.

zuckschwerdt commented 10 months ago

Or to get the "model number" along the normal report insert these lines below line 98:

            "unknown_0",        "Unknown 0",    DATA_FORMAT, "%04x", DATA_INT, (b[0] << 8) | b[1],
matt5mith commented 10 months ago

Thank you @zuckschwerdt. I will report back my findings.

matt5mith commented 10 months ago

Here is the result of doing both suggestions together:

image

klohner commented 8 months ago

Here's some info that may be useful:

Previous issue thread regarding this device (started by @StarMonkey1)

BitBench (including examples in oil_smart.c)

CRC confirmation:

reveng -w 8 -s 1a7de20f162e1a04 1a7de20f163a1ad3 5558bd01563e6136 5558bd0156420497
width=8  poly=0x31  init=0x00  refin=true  refout=true  xorout=0x00  check=0xa1  residue=0x00  name="CRC-8/MAXIM-DOW"

Flex decoder that doesn't enforce the 0x5558 "Preamble" like oil_smart.c does: rtl_433 -R 0 -X "n=OIL,m=FSK_PCM,s=500,l=500,g=2000,r=9000,bits=158,preamble={16}5558,symbol_one={2}4,symbol_zero={2}8,get=PREAMBLE?:@0:{16}:%04x,get=ID:@16:{16}:%04x,get=FLAGS?:@32:{8}:%02x,get=COUNTER?:@40:{8}:,get=DEPTH_CM:@48:{8}:,get=CRC:@56:{8}:%02x" -y {158}555558a966955956a6aa55a996a656a966aa9a3c

or suitable for rtl_433.conf:

decoder {
    name=Apollo_Ultrasonic_Oil,
    modulation=FSK_PCM,
    short=500,
    long=500,
    gap=2000,
    reset=9000,
    bits=158,
    preamble={16}5558,
    symbol_one={2}4,
    symbol_zero={2}8,
    get=PREAMBLE?:@0:{16}:%04x,
    get=ID:@16:{16}:%04x,
    get=FLAGS?:@32:{8}:%02x,
    get=COUNTER?:@40:{8}:,
    get=DEPTH_CM:@48:{8}:,
    get=CRC:@56:{8}:%02x
}