• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


sonoff RF
#1
I am trying to decode my sonoff remote control. http://www.itead.cc/wireless-4-buttons-p...oller.html

I understand the protocol, and added sonoff_rf.[ch] files.
The init function is called, but neither validate() nor parse() are executed.

How do i need to initialise min and maxgap in the protocol structure?
Code:
       sonoff_rf->maxgaplen = 10000;
       sonoff_rf->mingaplen = 100;
       sonoff_rf->minrawlen = 50;
       sonoff_rf->maxrawlen = 50;

This is a sample captures packet:

Code:
time:           Sun Jun 24 06:54:19 2018
hardware:       433gpio
pulse:          3
rawlen:         50
pulselen:       235

Raw code:
212 815 724 320 715 327 710 329 703 322 196 833 712 335 183 844 704 323 711 321 198 836 194 834 199 827 726 325 183 837 195 826 723 317 196 834 713 324 193 836 196 834 195 828 720 320 197 828 206 7996



Protocol details:
Lets define L=200-350, H=700-850, V=7000-9000.
The message consists of 49 L or H values that are followed by a V value.
Pairs of L and H can be decoded to binary 0 or 1

RAW LH -> BINARY 0
RAW HL -> BINARY 1

so the binary message is
BINARY: 011110101100010010100010 

The first 20 bits can be used to identify the remote.
Bits 20 to 23 correspond to the four buttons.
 
Reply
#2
Can you put your files on github somewhere?
 
Reply
#3
(06-24-2018, 09:55 AM)curlymo Wrote: Can you put your files on github somewhere?

Files are here:

github.com/mknj/pilight/blob/master/libs/pilight/protocols/433.92/sonoff_rf.c
github.com/mknj/pilight/blob/master/libs/pilight/protocols/433.92/sonoff_rf.h

i did a copy of secudo_smoke. The parser is not implemented yet. 

I see the log HALLO1 when starting pilight-debug, but i can't see HALLO2 or HALLO3 when i press the button
 
Reply
#4
Validate isn't called in pilight-debug only in the daemon.
 
Reply
#5
(06-24-2018, 12:30 PM)curlymo Wrote: Validate isn't called in pilight-debug only in the daemon.

sorry, i meant to say "pilight-daemon -D"

i am totally new to pilight.
I have the receiver enabled in config.json and logs show that sonoffRfInit() is called at startup. I have no idea why validate and parse are not called.

Do i have to enable the protocol somewhere else too?


Are there any support documents for protocol developers?
 
Reply
#6
The validate function is called here by the daemon. Check if your protocol is being evaluated.
 
Reply
#7
The problem was mingap.

github.com/mknj/pilight contains a working version.

Buttonsmapping is

A -> buttonmask=4
B -> buttonmask=1
C -> buttonmask=8
D -> buttonmask=2

Multiple buttons can be pressed simultaneously

@curlymo should i create a PR?
 
Reply
#8
Yes, but do read the PR rules (and use staging instead of development).
 
Reply
#9
code can be found here: github.com/pilight/pilight/pull/419
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Owsoo Wall Switch (Push Button / Sold for Sonoff devices with 433MHz)) hawkeyexp 0 90 10-14-2019, 10:32 PM
Last Post: hawkeyexp

Forum Jump:


Browsing: 1 Guest(s)