Coder Social home page Coder Social logo

How to add new protocol about rf433recv HOT 13 CLOSED

buxtonpaul avatar buxtonpaul commented on August 23, 2024
How to add new protocol

from rf433recv.

Comments (13)

sebmillet avatar sebmillet commented on August 23, 2024

Hello

the first version of my response was completely out of tracks (I thought it was in RF433any).

will re-write a correct response.

Reg, Seb

from rf433recv.

sebmillet avatar sebmillet commented on August 23, 2024

Hello

Actually RF433recv does allow to decode a signal where only one band has variable length.
You can see it in 04_rcswitch_recv.ino (https://github.com/sebmillet/RF433recv/blob/main/examples/04_rcswitch_recv/04_rcswitch_recv.ino), for protocols 8 and 9.

You don't need a decoder different from tribit/tribit_inverted. Given what you say, it looks like you need either:

  • A tribit decoder with seq=8000, high_short = 2000, high_long = 4000, low_short = 500, low_long = 500.

  • Or maybe (this depends on the exact signal characteristics ; would need to see a low-level recording to conclude) a tribit_inverted decoder with the same signal timings as above. But then with tribit_inverted, comes the question of the initial low signal duration (coming after the 8000us start pulse), that is not part of encoding.

The library https://github.com/sebmillet/rf433snif may help in this matter. There's other similar libraries around. It is fairly straightforward: the code simply listens for initial pulse duration, then record signal timings and finally prints it out...

I hope this time, my response will help ;-)

Reg, Seb

from rf433recv.

buxtonpaul avatar buxtonpaul commented on August 23, 2024

Hi,
Yes I used rf433snif which produced the timing data I am using. I had managed to get rc_switch to see the signal but fail to decode it. After a bit of digging I realised that RCSwitch only handled 32 bit codes, whilst mine was 42 bits. My changes in RCSwitch aren't very clean or well integrated so I might come back and see if I can do a cleaner job with RD433Recv.

from rf433recv.

sebmillet avatar sebmillet commented on August 23, 2024

Hello

If you post rcswitch code timings that you use i can show you what rf433recv it corresponds to.

Reg, Seb

from rf433recv.

buxtonpaul avatar buxtonpaul commented on August 23, 2024

Hi
The RC Switch entry looks like
{ 500, { 16, 1 }, { 4, 1 }, { 8, 1 }, true }

Although RCSwitch doesn't always work, as it depends on consecutive transmissions with a certain duration between them and no noise.

Example sniffed transmission.
drv:0x00,wp_Waiting for signal...
Signal duration: 826212 us
N LOW, HIGH
-----BEGIN RF433 LOW HIGH SEQUENCE-----
, 7991
000 536, 1956
001 524, 1976
002 512, 1988
003 492, 2012
004 488, 3964
005 496, 2060
006 496, 3948
007 504, 1996
008 504, 1992
009 508, 4004
010 512, 1988
011 512, 1988
012 512, 1984
013 512, 3996
014 516, 3932
015 520, 1972
016 520, 3928
017 524, 2036
018 524, 3924
019 516, 1972
020 524, 3924
021 528, 2028
022 520, 1972
023 524, 3924
024 528, 1968
025 528, 3984
026 528, 1968
027 528, 1968
028 528, 1972
029 528, 2032
030 524, 1972
031 524, 1972
032 524, 1976
033 524, 2036
034 524, 1976
035 524, 1976
036 520, 1976
037 520, 3992
038 524, 1976
039 524, 3928
040 524, 1972
041 524, 2036
042 520, 8016
043 528, 8012
044 528, 1968
045 528, 1972
046 524, 1972
047 528, 1972
048 524, 3928
049 524, 2032
050 524, 3924
051 528, 1972
052 528, 1972
053 524, 3984
054 528, 1972
055 524, 1972
056 524, 1972
057 524, 3984
058 524, 3924
059 528, 1972
060 524, 3924
061 528, 2032
062 528, 3924
063 528, 1968
064 528, 3924
065 528, 2032
066 524, 1972
067 524, 3924
068 528, 1968
069 528, 3984
070 528, 1972
071 524, 1972
072 524, 1972
073 524, 2036
074 524, 1976
075 520, 1976
076 520, 1976
077 520, 2040
078 520, 1976
079 520, 1980
080 516, 1980
081 516, 3992
082 520, 1976
083 520, 3932
084 520, 1976
085 520, 2040
086 520, 8020
087 520, 8016
088 524, 1972
089 524, 1976
090 524, 1976
091 520, 1976
092 520, 3928
093 524, 2036
094 524, 3928
095 524, 1976
096 520, 1976
097 520, 3992
098 524, 1976
099 520, 1976
100 520, 1976
101 512, 3992
102 524, 3928
103 524, 1972
104 524, 3928
105 524, 2032
106 524, 3928
107 524, 1972
108 524, 3928
109 524, 2032
110 524, 1976
111 524, 3928
112 524, 1972
113 524, 3988
114 524, 1972
115 520, 1976
116 524, 1976
117 520, 2040
118 520, 1976
119 520, 1980
120 516, 1980
121 516, 2040
122 516, 1984
123 516, 1984
124 516, 1980
125 516, 3996
126 516, 1980
127 516, 3932
128 520, 1980
129 520, 2040
130 516, 8020
131 520, 8016
132 524, 1972
133 524, 1976
134 520, 1976
135 520, 1976
136 520, 3932
137 520, 2040
138 520, 3928
139 524, 1976
140 520, 1976
141 520, 3992
142 524, 1976
143 520, 1976
144 516, 1980
145 516, 3992
146 520, 3928
147 524, 1976
148 520, 3928
149 524, 2036
150 520, 3928
151 524, 1972
152 524, 3928
153 524, 2036
154 524, 1976
155 524, 3928
156 524, 1972
157 520, 3992
158 524, 1976
159 520, 1976
160 520, 1976
161 520, 2040
162 520, 1980
163 520, 1980
164 516, 1980
165 516, 2040
166 516, 1980
167 516, 1980
168 516, 1984
169 512, 3996
170 516, 1980
171 516, 3932
172 520, 1980
173 516, 2040
174 516, 8020
175 520, 8020
176 524, 1972
177 524, 1972
178 524, 1976
179 520, 1976
180 516, 3932
181 524, 2036
182 520, 3928
183 524, 1976
184 520, 1976
185 520, 3988
186 524, 1976
187 520, 1976
188 520, 1976
189 520, 3992
190 520, 3928
191 524, 1976
192 520, 3928
193 524, 2036
194 524, 3928
195 524, 1976
196 520, 3928
197 524, 2036
198 520, 1976
199 520, 3928
200 524, 1976
201 524, 3988
202 524, 1972
203 524, 1976
204 520, 1980
205 520, 2036
206 520, 1980
207 512, 1980
208 516, 1980
209 516, 2040
210 516, 1980
211 512, 1984
212 516, 1980
213 516, 3996
214 520, 1980
215 516, 3932
216 520, 1980
217 520, 2040
218 516, 8020
219 520, 8016
220 524, 1972
221 524, 1976
222 524, 1976
223 520, 1976
224 520, 3932
225 520, 2036
226 520, 3928
227 524, 1976
228 520, 1976
229 520, 3992
230 524, 1976
231 520, 1976
232 520, 1980
233 520, 3992
234 520, 3928
235 524, 1972
236 520, 3928
237 524, 2036
238 520, 3928
239 524, 1972
240 524, 3928
241 524, 2036
242 524, 1976
243 520, 3928
244 524, 1972
245 520, 3988
246 524, 1972
247 520, 1976
248 524, 1976
249 516, 2040
-----END RF433 LOW HIGH SEQUENCE-----
Waiting for signal...

--- exit ---

I did try a couple of combinations with rf433recv but they didn't seem to work.

Paul

from rf433recv.

sebmillet avatar sebmillet commented on August 23, 2024

Hello.

A priori, looks like receiver is to be called this way:
rf.register_Receiver(RFMOD_TRIBIT_INVERTED, 8000, 0, 0, 500, 500, 500, 2000, 4000, 0, 8000, 42, callback, 0);

I don't remember if equality of short and long duration on the low band is possible (I tested it for such an equality on the high band for sure, to decode RCSwitch' protocol 9).

If it doesn't work I'll have to implement emission and corresponding reception to test it live... will do it this week-end if need be.

Reg, Seb

from rf433recv.

buxtonpaul avatar buxtonpaul commented on August 23, 2024

So that appears to be working. Although I beleive I have seen cases where there is no end pulse and it just drops to what I think is noise. But at the moment I seem to be receiving codes :-)

A couple of other things worth mentioning. The sample for RF433recv seems to have different values for PIN_RFINPUT and INT_RFINPUT. At least for me running on an ESP32 these need to be the same.
Might also be worth mentioning that the ESP isn't as limited on which pins can generate interrupts.

Thanks for the help!
Paul

from rf433recv.

sebmillet avatar sebmillet commented on August 23, 2024

Hello

Thanks for feedback - I'll have to add these mentions about ESP then.

By the way I think replacing 'INT_RFINPUT' with 'digitalPinToInterrupt(PIN_RFINPUT)' would be cleaner.
Would this approach work on ESP32 too?

This could then be an update of the lib, where the secondary parameter would be optional, the interrupt number being most often simply derived from the pin number.

Reg, Seb

from rf433recv.

buxtonpaul avatar buxtonpaul commented on August 23, 2024

I can confirm using RF_manager rf(PIN_RFINPUT, digitalPinToInterrupt(PIN_RFINPUT));
works.

from rf433recv.

sebmillet avatar sebmillet commented on August 23, 2024

Hello

just published v0.3.0 of the lib, that updates some comments about interrupts and makes the interrupt number optional when creating the decoder object.

Reg, Seb

from rf433recv.

buxtonpaul avatar buxtonpaul commented on August 23, 2024

from rf433recv.

sebmillet avatar sebmillet commented on August 23, 2024

Hello

I'm glad I could help.
About library.properties file, what is the name of the board to add to library.properties?

Reg, Seb

from rf433recv.

sebmillet avatar sebmillet commented on August 23, 2024

I finally added esp32 to library.properties, separated from avr with a comma and space character.

from rf433recv.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.