Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validating what's sent #3

Open
larrywal opened this issue Sep 26, 2018 · 23 comments
Open

Validating what's sent #3

larrywal opened this issue Sep 26, 2018 · 23 comments

Comments

@larrywal
Copy link

So I've got my Mega sending out just fireplace.on as a test. I encapsulated a box with tin foil; and I put my receiver in it (it's driven from an Uno).

I'm trying to figure out a good way to validate that it's working. The Mega sending out fireplace.on is not starting the fireplace. I even soldered an antennae on, so it's not that - my basic RF transmit programs using RadioHead are working fine.

So either my fireplace's RF codes are different, or I'm doing something wrong.

If I run your test RF programs and have the receiver on an Uno in the foil box, what should I see? If I run your test receiver on the Uno and fireplace.on from the mega and have both in the foil box, what would you expect to see?

Tomorrow I'm ordering an SDF and will try to use audacity to reverse engineer things better.

@milksteakmatt
Copy link
Owner

milksteakmatt commented Sep 26, 2018

The mega should be on the receiving end. Reason being, the message is so big, you'll run out of memory before you record it all. What's the model number of your remote?

@milksteakmatt
Copy link
Owner

I'll send you an example of what the message looks like.

@milksteakmatt
Copy link
Owner

Here's what the values from a single message should look like. These are repeated 10 times for each button press. An explanation of the values is in the header file.

875
425
375
425
875
425
375
1250
375
700
875
700
875
700
375
700
375
700
375
700
375
700
875
1525
375
700
875
700
375
700
375
700
875
700
875
700
875
700
375
1525
375
700
375
700
875
700
875
700
375
700
375
700
875
700
875
1525
375
700
875
700
375
700
375
700
375
700
375
700
375
700
875
1525
375
700
875
700
875
700
875
700
875
700
375
700
375
700
375
1525
875
700
375
700
375
700
375
700
375
700
875
700
875
700
875
92350

@milksteakmatt
Copy link
Owner

This explains how the signal works to transmit the data:
https://en.m.wikipedia.org/wiki/Frequency-shift_keying

@larrywal
Copy link
Author

Thanks so much Matt - really appreciate the help. Your message makes sense from what I read of the code.

I put the Mega on the receiving end and changed MAX to 800. Mega has pin 2 as receiving data pin. Uno has pin 3 as sending data pin.

Below is a snapshot of the output of RF_tester, with the transmitter just running fireplace.on(); in the loop. I also ran with the transmitter unplugged and the receiver in my 3-sided tinfoil box. Those results are below as well (not what I would've expected). Note - I also tried commenting out the if(printed + 1 < changes) just to make a constant receiver....I think that didn't work though because variables probably overflow....

Receiver 433MHz setup
0 1 40
1 0 37260
2 1 280
3 0 1520
4 1 444
5 0 640
6 1 180
7 0 108
8 1 60
9 0 384
10 1 20
11 0 184
12 1 80
13 0 9104
14 1 48
15 0 984
16 1 52
17 0 1044
18 1 56
19 0 364
20 1 184
21 0 1488
22 1 36
23 0 768
24 1 40
25 0 9924
26 1 20
27 0 324
28 1 172
29 0 404
30 1 256
31 0 248
32 1 196
33 0 84
34 1 56
35 0 116
36 1 376
37 0 1588
38 1 240
39 0 92
40 1 460
41 0 252
42 1 48
43 0 484
44 1 788
45 0 384
46 1 96
47 0 84
48 1 432
49 0 736
50 1 320
51 0 204
52 1 40
53 0 1536
54 1 16
55 0 2060
56 1 28
57 0 2844
58 1 140
59 0 472
60 1 44
61 0 132
62 1 72
63 0 220
64 1 108
65 0 300
66 1 64
67 0 1088
68 1 256
69 0 132
70 1 3160
71 0 140
72 1 320
73 0 300
74 1 280
75 0 204
76 1 500
77 0 96
78 1 132
79 0 560
80 1 56
81 0 184
82 1 180
83 0 2408
84 1 256
85 0 1052
86 1 300
87 0 476
88 1 52
89 0 2324
90 1 128
91 0 840
92 1 120
93 0 2352
94 1 720
95 0 872
96 1 84
97 0 748
98 1 40
99 0 144
100 1 144
101 0 644
102 1 3292
103 0 568
104 1 160
105 0 564
106 1 2516
107 0 108
108 1 96
109 0 420
110 1 80
111 0 200
112 1 172
113 0 1276
114 1 240
115 0 112
116 1 284
117 0 44
118 1 200
119 0 812
120 1 156
121 0 400
122 1 28
123 0 632
124 1 28
125 0 340
126 1 6584
127 0 404
128 1 1320
129 0 136
130 1 212
131 0 80
132 1 856
133 0 156
134 1 1940
135 0 88
136 1 284
137 0 1328
138 1 160
139 0 188
140 1 804
141 0 248
142 1 744
143 0 300
144 1 128
145 0 128
146 1 140
147 0 1288
148 1 3064
149 0 460
150 1 48
151 0 904
152 1 1592
153 0 1364
154 1 60
155 0 184
156 1 16
157 0 52
158 1 3440
159 0 1404
160 1 76
161 0 108
162 1 244
163 0 240
164 1 740
165 0 940
166 1 32
167 0 264
168 1 784
169 0 184
170 1 1840
171 0 168
172 1 4784
173 0 384
174 1 2364
175 0 28
176 1 376
177 0 104
178 1 768
179 0 40
180 1 20
181 0 56
182 1 716
183 1 16
184 1 32
185 0 1500
186 1 72
187 0 244
188 1 40
189 0 96
190 1 68
191 0 24
192 1 816
193 0 20
194 1 284
195 0 108
196 1 1824
197 0 328
198 1 316
199 0 1032
200 1 5388
201 0 1272
202 1 1636
203 0 252
204 1 1388
205 0 876
206 1 4972
207 0 804
208 1 6740
209 0 64
210 1 1332
211 0 376
212 1 1540
213 0 832
214 1 796
215 0 184
216 1 2896
217 0 36
218 1 2488
219 0 1020
220 1 3408
221 0 276
222 1 4660
223 0 972
224 1 36
225 0 116
226 1 1888
227 0 292
228 1 56
229 0 980
230 1 664
231 0 152
232 1 6904
233 0 1352
234 1 768
235 0 20
236 1 84
237 0 16
238 1 164
239 0 24
240 1 512
241 0 176
242 1 984
243 0 1668
244 1 1192
245 0 16
246 1 20
247 0 88
248 1 824
249 0 256
250 1 824
251 0 100
252 1 4168
253 0 52
254 1 212
255 0 1928
256 1 568
257 0 1416
258 1 472
259 0 704
260 1 1460
261 0 340
262 1 60
263 0 32
264 1 52
265 0 244
266 1 500
267 0 944
268 1 664
269 0 632
270 1 4384
271 0 164
272 1 4852
273 0 1624
274 1 1488
275 0 332
276 1 220
277 0 184
278 1 120
279 0 52
280 1 960
281 0 1304
282 1 668
283 0 76
284 1 7204
285 0 100
286 1 296
287 0 1232
288 1 1072
289 0 1604
290 1 572
291 0 416
292 1 36
293 0 232
294 1 136
295 0 96
296 1 1648
297 0 1152
298 1 228
299 0 144
300 1 712
301 0 580
302 1 5460
303 0 796
304 1 464
305 0 232
306 1 80
307 0 876
308 1 60
309 0 864
310 1 388
311 0 10108
312 1 5064
313 0 280
314 1 388
315 0 2076
316 1 24
317 0 168
318 1 3204
319 0 1512
320 1 2676
321 0 112
322 1 3132
323 0 728
324 1 3736
325 0 340
326 1 3596
327 0 176
328 1 676
329 0 888
330 1 232
331 0 536
332 1 2492
333 0 124
334 1 2472
335 0 428
336 1 124
337 0 116
338 1 3728
339 0 172
340 1 120
341 0 300
342 1 308
343 0 1812
344 1 2796
345 0 1236
346 1 208
347 0 164
348 1 856
349 0 116
350 1 112
351 0 332
352 1 312
353 0 392
354 1 7196
355 0 18424
356 1 100
357 0 1712
358 1 244
359 0 152
360 1 708
361 0 92
362 1 988
363 0 1252
364 1 64
365 0 216
366 1 480
367 0 400
368 1 1388
369 0 392
370 1 96
371 0 96
372 1 3732
373 0 204
374 1 544
375 1 16
376 1 444
377 0 356
378 1 64
379 0 92
380 1 136
381 0 400
382 1 1084
383 0 176
384 1 28
385 0 116
386 1 236
387 0 564
388 1 28
389 0 104
390 1 80
391 0 192
392 1 48
393 0 688
394 1 1196
395 0 584
396 1 560
397 0 176
398 1 60
399 0 172
400 1 156
401 0 2644
402 1 44
403 0 224
404 1 472
405 0 168
406 1 812
407 0 972
408 1 44
409 0 1940
410 1 1368
411 0 324
412 1 364
413 0 364
414 1 1688
415 0 684
416 1 688
417 0 64
418 1 92
419 0 196
420 1 108
421 0 2064
422 1 28
423 0 168
424 1 240
425 0 84
426 1 28
427 0 332
428 1 44
429 0 3408
430 1 240
431 0 96
432 1 3872
433 0 108
434 1 112
435 0 808
436 1 100
437 0 228
438 1 304
439 0 376
440 1 192
441 0 364
442 1 1964
443 0 300
444 1 440
445 0 344
446 1 2892
447 0 2472
448 1 656
449 0 116
450 1 1732
451 0 144
452 1 820
453 0 176
454 1 6896
455 0 236
456 1 2400
457 0 3052
458 1 244
459 0 636
460 1 9504
461 0 120
462 1 5104
463 0 2456
464 1 128
465 0 408
466 1 3016
467 0 120
468 1 5696
469 0 1256
470 1 3224
471 0 2100
472 1 312
473 0 120
474 1 140
475 0 484
476 1 9196
477 0 552
478 1 60
479 0 1524
480 1 2516
481 0 1168
482 1 3096
483 0 104
484 1 7924
485 0 1952
486 1 2048
487 0 88
488 1 260
489 0 2256
490 1 312
491 0 56
492 1 1300
493 0 232
494 1 576
495 0 620
496 1 5216
497 0 160
498 1 152
499 0 412
500 1 92
501 0 108
502 1 36
503 0 272
504 1 4864
505 0 1188
506 1 7260
507 0 996
508 1 2456
509 0 304
510 1 4460
511 0 836
512 1 356
513 0 152
514 1 92
515 0 136
516 1 252
517 0 1016
518 1 60
519 0 812
520 1 348
521 0 24
522 1 68
523 0 204
524 1 2828
525 0 148
526 1 2828
527 0 180
528 1 848
529 0 2256
530 1 724
531 0 20
532 1 2280
533 0 52
534 1 140
535 0 1228
536 1 268
537 0 104
538 1 5396
539 0 532
540 1 104
541 0 92
542 1 2792
543 0 116
544 1 900
545 0 304
546 1 4880
547 0 1028
548 1 1048
549 0 76
550 1 288
551 0 988
552 1 112
553 0 680
554 1 412
555 0 164
556 1 156
557 0 496
558 1 6284
559 0 1668
560 1 356
561 0 116
562 1 1956
563 0 108
564 1 676
565 0 900
566 1 256
567 0 68
568 1 2892
569 0 132
570 1 2368
571 0 236
572 1 248
573 0 160
574 1 3912
575 0 240
576 1 4660
577 0 160
578 1 464
579 0 864
580 1 520
581 0 152
582 1 860
583 0 132
584 1 1000
585 0 1968
586 1 56
587 0 736
588 1 56
589 0 180
590 1 552
591 0 112
592 1 232
593 0 92
594 1 56
595 0 92
596 1 1728
597 0 108
598 1 1888
599 0 456
600 1 2508
601 0 356
602 1 704
603 0 44
604 1 1136
605 0 1240
606 1 156
607 0 148
608 1 1224
609 0 144
610 1 856
611 0 276
612 1 1772
613 0 92
614 1 1864
615 0 264
616 1 836
617 0 1192
618 1 1692
619 0 1352
620 1 1636
621 0 164
622 1 116
623 0 116
624 1 16
625 0 3156
626 1 812
627 0 124
628 1 516
629 0 132
630 1 2524
631 0 2072
632 1 3232
633 0 192
634 1 808
635 0 540
636 1 1904
637 0 748
638 1 820
639 0 212
640 1 404
641 0 1888
642 1 256
643 0 116
644 1 3564
645 0 224
646 1 196
647 0 184
648 1 3928
649 0 336
650 1 708
651 0 1324
652 1 72
653 0 40
654 1 504
655 0 184
656 1 268
657 0 368
658 1 52
659 0 388
660 1 748
661 0 188
662 1 492
663 0 180
664 1 452
665 0 2244
666 1 432
667 0 300
668 1 112
669 0 108
670 1 520
671 0 172
672 1 1224
673 0 324
674 1 208
675 0 268
676 1 164
677 0 172
678 1 224
679 0 920
680 1 140
681 0 1268
682 1 1240
683 0 124
684 1 1504
685 0 544
686 1 456
687 0 172
688 1 252
689 0 1388
690 1 188
691 0 1388
692 1 32
693 0 96
694 1 196
695 0 164
696 1 76
697 0 1340
698 1 392
699 0 88
700 1 180
701 0 260
702 1 1784
703 0 188
704 1 256
705 0 256
706 1 332
707 0 112
708 1 3852
709 0 156
710 1 2852
711 0 728
712 1 108
713 0 324
714 1 764
715 0 204
716 1 156
717 0 168
718 1 112
719 0 292
720 1 924
721 0 116
722 1 44
723 0 504
724 1 40
725 0 180
726 1 60
727 0 2036
728 1 176
729 0 196
730 1 492
731 0 20
732 1 804
733 0 712
734 1 2824
735 0 368
736 1 264
737 0 960
738 1 128
739 0 756
740 1 316
741 0 88
742 1 1072
743 0 1500
744 1 24
745 0 64
746 1 428
747 0 160
748 1 112
749 0 240
750 1 464
751 0 192
752 1 852
753 0 108
754 1 368
755 0 16
756 1 444
757 0 2900
758 1 88
759 0 236
760 1 268
761 0 496
762 1 24
763 0 356
764 1 6920
765 0 2040
766 1 344
767 0 192
768 1 2512
769 0 48
770 1 228
771 0 64
772 1 224
773 0 1308
774 1 212
775 0 212
776 1 316
777 0 104
778 1 60
779 0 100
780 1 76
781 0 972
782 1 1692
783 0 224
784 1 3772
785 0 10724
786 1 260
787 0 2572
788 1 528
789 0 104
790 1 928
791 0 684
792 1 160
793 0 528
794 1 232
795 0 140
796 1 52
797 0 264
798 1 36

PARTIAL RESULTS WITH TRANSMITTER UNPLUGGED AND RECEIVER IN BOX
eceiver 433MHz setup
0 1 72
1 0 1420
2 1 364
3 0 112
4 1 300
5 0 176
6 1 760
7 0 156
8 1 692
9 0 2492
10 1 116
11 0 1932
12 1 280
13 0 220
14 1 84
15 0 440
16 1 336
17 0 5612
18 1 100
19 0 148
20 1 148
21 0 128
22 1 80
23 0 1460
24 1 44
25 0 152
26 1 84
27 0 60
28 1 196
29 0 240
30 1 812
31 0 164
32 1 2932
33 0 176
34 1 1768
35 0 408
36 1 116
37 0 72
38 1 380
39 0 72
40 1 968
41 0 100
42 1 16
43 0 80
44 1 680
45 0 1664
46 1 32
47 0 208
48 1 36
49 0 428
50 1 72
51 0 1116
52 1 228
53 0 184
54 1 56
55 0 616
56 1 44
57 0 864
58 1 60
59 0 72
60 1 252
61 0 312
62 1 520
63 0 92
64 1 176
65 0 60
66 1 3944
67 0 292
68 1 2796
69 0 1236
70 1 348
71 0 104
72 1 84
73 0 188
74 1 240
75 0 92
76 1 388
77 0 1772
78 1 72
79 0 192
80 1 68
81 0 408
82 1 24
83 0 256
84 1 40
85 0 4672
86 1 428
87 0 48
88 1 80
89 0 448
90 1 676
91 0 232
92 1 1744
93 0 3984
94 1 48
95 0 204
96 1 1240
97 0 1264
98 1 24
99 0 156
100 1 64
101 0 224
102 1 108
103 0 96
104 1 180
105 0 152
106 1 148
107 0 1328
108 1 300
109 0 132
110 1 64
111 0 236
112 1 32
113 0 288
114 1 116
115 0 48
116 1 408
117 0 296
118 1 92
119 0 48
120 1 564
121 0 68
122 1 7248
123 0 168
124 1 2720
125 0 140
126 1 52
127 0 1260
128 1 40
129 0 272
130 1 112
131 0 504
132 1 160
133 0 172
134 1 208
135 0 328
136 1 208
137 0 140
138 1 28
139 0 216
140 1 120
141 0 164
142 1 180
143 0 52
144 1 56
145 0 100
146 1 280
147 0 88
148 1 44
149 0 1780
150 1 208
151 0 452
152 1 232
153 0 500
154 1 72
155 0 160
156 1 5660
157 0 1392
158 1 1460
159 0 980
160 1 72
161 0 1216
162 1 796
163 0 192
164 1 732
165 0 120
166 1 456
167 0 100
168 1 476
169 0 76
170 1 152
171 0 236
172 1 2520
173 0 136
174 1 5884
175 0 208
176 1 760
177 0 72
178 1 412
179 0 76
180 1 136
181 0 300
182 1 508
183 0 1340
184 1 44
185 0 568
186 1 44
187 0 216
188 1 32
189 0 512
190 1 60
191 0 212
192 1 92
193 0 136
194 1 44
195 0 224
196 1 48
197 0 144
198 1 48
199 0 240
200 1 268
201 0 420
202 1 64
203 0 140
204 1 284
205 0 80
206 1 96
207 0 652
208 1 172
209 0 1008
210 1 1304
211 0 80
212 1 4888
213 0 700
214 1 148
215 0 708
216 1 1708
217 0 960
218 1 260
219 0 60
220 1 108
221 0 152
222 1 660
223 0 140
224 1 144
225 0 16
226 1 176
227 0 124
228 1 80
229 0 84
230 1 244
231 0 84
232 1 360
233 0 1452
234 1 156
235 0 128
236 1 164
237 0 212
238 1 172
239 0 64
240 1 1740
241 0 92
242 1 848
243 0 236
244 1 232
245 0 180
246 1 4396
247 0 240
248 1 428
249 0 68
250 1 264
251 0 244
252 1 556
253 0 40
254 1 24
255 0 452
256 1 356
257 0 1940
258 1 52
259 0 116
260 1 56
261 0 508
262 1 56
263 0 84
264 1 48
265 0 180
266 1 104
267 0 284
268 1 244
269 0 108
270 1 48
271 0 64
272 1 28
273 0 68
274 1 60
275 0 76
276 1 20
277 0 240
278 1 908
279 0 148
280 1 800
281 0 560
282 1 108
283 0 1048
284 1 324
285 0 160
286 1 4448
287 0 280
288 1 44
289 0 216
290 1 820
291 0 340
292 1 2336
293 0 1532
294 1 32
295 0 116
296 1 268
297 0 56
298 1 116
299 0 36
300 1 180
301 0 32
302 1 36
303 0 108
304 1 452
305 0 172
306 1 72
307 0 160
308 1 84
309 0 324
310 1 56
311 0 356
312 1 76
313 0 268
314 1 604
315 0 80
316 1 416
317 0 44
318 1 5652
319 0 132
320 1 2932
321 0 1108
322 1 1156
323 0 1436
324 1 88
325 0 44
326 1 32
327 0 296
328 1 88
329 0 88
330 1 292
331 0 136
332 1 88
333 0 180
334 1 1028
335 0 96
336 1 736
337 0 272
338 1 716
339 0 252
340 1 1764
341 0 2644
342 1 1384
343 0 84
344 1 1876
345 0 432
346 1 604
347 0 128
348 1 1884

@larrywal
Copy link
Author

Also - the fireplace is model RC300. FCC ID: ULE-RC300

@larrywal
Copy link
Author

It's so weird that with your RF_Tester file I seem to get the same values whether or not the first board is transmitting. Maybe I have an older version of your files, since I needed to rename the const start (in the .h file) to make it compile, and because you have constants defined as XX = 880 and OO = 380 (vs. 875 and 375 you have in your example values listed on what I should be receiving).

@milksteakmatt
Copy link
Owner

The values are timings and since a lot can happen to an RF signal between TX and RX, they won't be exact but should be within an acceptable range. If transmitting 880, you might see it received as 892 or 876, for example. Timing can also be affected by your code. Try using the receiver test code and press a button on your remote to see what you get.

@milksteakmatt
Copy link
Owner

I also wouldn't put either transmitter or receiver in a foil box. You could be getting signal scattering or multipathing. RF interference should be minimal in your house. Minimal enough to see it happen.

@larrywal
Copy link
Author

Thanks Matt - the first group of numbers I sent above was from me pushing the reset button on both transmitter and receiver at the same time, not in the box....

@larrywal
Copy link
Author

larrywal commented Sep 27, 2018 via email

@larrywal
Copy link
Author

larrywal commented Sep 27, 2018

Ok - did a test with the fireplace's remote - pressed reset and then turned the fireplace on. Got this:

Receiver 433MHz setup
0 1 876
1 0 700
2 1 876
3 0 796
4 1 624
5 0 952
6 1 52
7 0 468
8 1 248
9 0 84564
10 1 196
11 0 76
12 1 168
13 0 336
14 1 36
15 0 5600
16 1 148
17 0 888
18 1 888
19 0 404
20 1 372
21 0 448
22 1 856
23 0 444
24 1 360
25 0 1260
26 1 868
27 0 712
28 1 348
29 0 732
30 1 348
31 0 700
32 1 372
33 0 696
34 1 852
35 0 760
36 1 40
37 0 160
38 1 240
39 0 100
40 1 276
41 0 776
42 1 324
43 0 684
44 1 960
45 0 1300
46 1 24
47 0 76
48 1 744
49 0 332
50 1 1436
51 0 136
52 1 1064
53 0 516
54 1 1032
55 0 540
56 1 928
57 0 684
58 1 408
59 0 640
60 1 1136
61 0 416
62 1 428
63 0 1468
64 1 820
65 0 188
66 1 716
67 0 264
68 1 1076
69 0 648
70 1 956
71 0 644
72 1 364
73 0 696
74 1 400
75 0 700
76 1 880
77 0 648
78 1 912
79 0 1516
80 1 388
81 0 648
82 1 416
83 0 636
84 1 436
85 0 636
86 1 472
87 0 624
88 1 388
89 0 680
90 1 388
91 0 712
92 1 328
93 0 788
94 1 832
95 0 1468
96 1 952
97 0 612
98 1 440
99 0 624
100 1 444
101 0 620
102 1 928
103 0 664
104 1 392
105 0 692
106 1 388
107 0 680
108 1 412
109 0 632
110 1 440
111 0 1432
112 1 392
113 0 692
114 1 948
115 0 608
116 1 992
117 0 600
118 1 396
119 0 684
120 1 896
121 0 660
122 1 920
123 0 692
124 1 888
125 0 656
126 1 932
127 0 38416
128 1 632
129 0 2292
130 1 52
131 0 1440
132 1 364
133 0 236
134 1 688
135 0 508
136 1 52
137 0 4008
138 1 160
139 0 180
140 1 32
141 0 288
142 1 220
143 0 152
144 1 1424
145 0 412
146 1 1528
147 0 164
148 1 2652
149 0 928
150 1 1616
151 0 420
152 1 248
153 0 412
154 1 84
155 0 420
156 1 1116
157 0 140
158 1 1020
159 0 432
160 1 872
161 0 164
162 1 1328
163 0 112
164 1 876
165 0 156
166 1 1896
167 0 880
168 1 60
169 0 708
170 1 1360
171 0 204
172 1 104
173 0 812
174 1 296
175 0 932
176 1 1804
177 0 376
178 1 268
179 0 192
180 1 1856
181 0 396
182 1 696
183 0 2540
184 1 1468
185 0 100
186 1 884
187 0 400
188 1 604
189 0 112
190 1 852
191 0 196
192 1 2984
193 0 852
194 1 1096
195 0 228
196 1 1436
197 0 396
198 1 1796
199 0 276
200 1 536
201 0 320
202 1 188
203 0 200
204 1 216
205 0 160
206 1 1124
207 0 480
208 1 500
209 0 232
210 1 160
211 0 160
212 1 456
213 0 620
214 1 448
215 0 644
216 1 896
217 0 668
218 1 924
219 0 700
220 1 488
221 0 176
222 1 16
223 0 144
224 1 72
225 0 132
226 1 888
227 0 1096
228 1 40
229 0 344
230 1 480
231 0 280
232 1 44
233 0 68
234 1 72
235 0 132
236 1 944
237 0 632
238 1 916
239 0 664
240 1 924
241 0 656
242 1 664
243 0 188
244 1 32
245 0 968
246 1 104
247 0 708
248 1 892
249 0 700
250 1 356
251 0 1520
252 1 368
253 0 688
254 1 396
255 0 660
256 1 896
257 0 676
258 1 972
259 0 592
260 1 436
261 0 632
262 1 468
263 0 604
264 1 908
265 0 704
266 1 868
267 0 1492
268 1 408
269 0 656
270 1 436
271 0 632
272 1 400
273 0 712
274 1 348
275 0 708
276 1 392
277 0 644
278 1 420
279 0 652
280 1 440
281 0 636
282 1 888
283 0 1488
284 1 956
285 0 628
286 1 452
287 0 608
288 1 452
289 0 616
290 1 908
291 0 676
292 1 408
293 0 664
294 1 412
295 0 656
296 1 384
297 0 896
298 1 104
299 0 1608
300 1 340
301 0 672
302 1 924
303 0 656
304 1 956
305 0 660
306 1 344
307 0 680
308 1 936
309 0 640
310 1 944
311 0 636
312 1 924
313 0 668
314 1 912
315 0 28720
316 1 104
317 0 13328
318 1 20
319 0 188
320 1 332
321 0 3660
322 1 216
323 0 20
324 1 28
325 0 116
326 1 104
327 0 532
328 1 104
329 0 416
330 1 40
331 0 888
332 1 84
333 0 628
334 1 40
335 0 11200
336 1 220
337 0 168
338 1 560
339 0 152
340 1 1152
341 0 932
342 1 20
343 0 308
344 1 184
345 0 320
346 1 336
347 0 32
348 1 36
349 0 140
350 1 216
351 0 10088
352 1 116
353 0 252
354 1 292
355 0 1676
356 1 132
357 0 1124
358 1 704
359 0 324
360 1 612
361 0 168
362 1 624
363 0 180
364 1 444
365 0 196
366 1 184
367 0 172
368 1 120
369 0 1344
370 1 188
371 0 220
372 1 240
373 0 1348
374 1 68
375 0 236
376 1 28
377 0 232
378 1 92
379 0 168
380 1 288
381 0 124
382 1 164
383 0 928
384 1 100
385 0 1072
386 1 84
387 0 292
388 1 28
389 0 80
390 1 668
391 0 632
392 1 92
393 0 2664
394 1 3008
395 0 372
396 1 520
397 0 200
398 1 124
399 0 136
400 1 108
401 0 120
402 1 48
403 0 376
404 1 988
405 0 584
406 1 412
407 0 664
408 1 488
409 0 580
410 1 512
411 0 552
412 1 924
413 0 660
414 1 912
415 0 652
416 1 532
417 0 540
418 1 1180
419 0 1228
420 1 432
421 0 608
422 1 988
423 0 600
424 1 928
425 0 644
426 1 948
427 0 628
428 1 948
429 0 640
430 1 444
431 0 632
432 1 916
433 0 648
434 1 412
435 0 1496
436 1 356
437 0 716
438 1 396
439 0 636
440 1 956
441 0 632
442 1 484
443 0 252
444 1 144
445 0 824
446 1 276
447 0 692
448 1 436
449 0 632
450 1 892
451 0 648
452 1 924
453 0 1472
454 1 388
455 0 704
456 1 364
457 0 712
458 1 360
459 0 700
460 1 384
461 0 672
462 1 392
463 0 684
464 1 384
465 0 692
466 1 360
467 0 680
468 1 916
469 0 1500
470 1 896
471 0 648
472 1 416
473 0 652
474 1 432
475 0 628
476 1 936
477 0 692
478 1 328
479 0 728
480 1 368
481 0 700
482 1 376
483 0 672
484 1 400
485 0 1476
486 1 384
487 0 696
488 1 884
489 0 688
490 1 872
491 0 712
492 1 368
493 0 708
494 1 860
495 0 760
496 1 588
497 0 136
498 1 88
499 0 912
500 1 676
501 0 704
502 1 868
503 0 26876
504 1 56
505 0 19372
506 1 124
507 0 1676
508 1 204
509 0 468
510 1 352
511 0 84
512 1 360
513 0 2564
514 1 100
515 0 5652
516 1 132
517 0 16
518 1 16
519 0 196
520 1 164
521 0 328
522 1 168
523 0 416
524 1 1180
525 0 2428
526 1 64
527 0 944
528 1 40
529 0 220
530 1 80
531 0 604
532 1 28
533 0 192
534 1 452
535 0 3456
536 1 224
537 0 580
538 1 312
539 0 5020
540 1 120
541 0 360
542 1 2172
543 0 1008
544 1 532
545 0 140
546 1 2072
547 0 196
548 1 548
549 0 432
550 1 796
551 0 340
552 1 664
553 0 152
554 1 256
555 0 116
556 1 28
557 0 208
558 1 208
559 0 6508
560 1 1012
561 0 244
562 1 440
563 0 364
564 1 936
565 0 384
566 1 428
567 0 196
568 1 116
569 0 188
570 1 200
571 0 120
572 1 188
573 0 172
574 1 924
575 0 672
576 1 428
577 0 624
578 1 556
579 0 528
580 1 396
581 0 708
582 1 868
583 0 688
584 1 884
585 0 704
586 1 380
587 0 656
588 1 908
589 0 1520
590 1 372
591 0 644
592 1 1072
593 0 184
594 1 264
595 0 56
596 1 936
597 0 644
598 1 944
599 0 512
600 1 1128
601 0 572
602 1 452
603 0 612
604 1 944
605 0 640
606 1 448
607 0 1476
608 1 364
609 0 668
610 1 432
611 0 624
612 1 936
613 0 656
614 1 896
615 0 676
616 1 408
617 0 672
618 1 420
619 0 624
620 1 900
621 0 676
622 1 964
623 0 1432
624 1 420
625 0 648
626 1 436
627 0 628
628 1 448
629 0 632
630 1 384
631 0 708
632 1 336
633 0 716
634 1 292
635 0 788
636 1 368
637 0 672
638 1 908
639 0 1504
640 1 892
641 0 656
642 1 416
643 0 652
644 1 396
645 0 696
646 1 944
647 0 608
648 1 404
649 0 668
650 1 436
651 0 632
652 1 432
653 0 640
654 1 412
655 0 1484
656 1 396
657 0 652
658 1 908
659 0 672
660 1 912
661 0 660
662 1 400
663 0 704
664 1 852
665 0 704
666 1 884
667 0 692
668 1 872
669 0 728
670 1 868
671 0 47212
672 1 92
673 0 2160
674 1 76
675 0 172
676 1 100
677 0 288
678 1 368
679 0 100
680 1 300
681 0 120
682 1 184
683 0 1416
684 1 52
685 0 11540
686 1 52
687 0 4644
688 1 584
689 0 76
690 1 456
691 0 816
692 1 204
693 0 280
694 1 48
695 0 8716
696 1 172
697 0 460
698 1 824
699 0 1564
700 1 1396
701 0 2092
702 1 696
703 0 464
704 1 60
705 0 444
706 1 68
707 0 3684
708 1 1696
709 0 328
710 1 2168
711 0 808
712 1 924
713 0 696
714 1 376
715 0 664
716 1 416
717 0 648
718 1 680
719 0 372
720 1 1104
721 0 480
722 1 1028
723 0 556
724 1 464
725 0 600
726 1 944
727 0 1448
728 1 432
729 0 660
730 1 904
731 0 652
732 1 896
733 0 776
734 1 812
735 0 676
736 1 888
737 0 708
738 1 496
739 0 532
740 1 1096
741 0 232
742 1 740
743 0 1396
744 1 432
745 0 644
746 1 392
747 0 676
748 1 940
749 0 628
750 1 952
751 0 632
752 1 444
753 0 652
754 1 380
755 0 684
756 1 904
757 0 644
758 1 924
759 0 1484
760 1 392
761 0 700
762 1 356
763 0 712
764 1 360
765 0 672
766 1 412
767 0 668
768 1 404
769 0 656
770 1 384
771 0 712
772 1 360
773 0 704
774 1 880
775 0 1488
776 1 908
777 0 664
778 1 384
779 0 708
780 1 380
781 0 660
782 1 916
783 0 684
784 1 280
785 0 808
786 1 104
787 0 132
788 1 100
789 0 724
790 1 368
791 0 676
792 1 404
793 0 1464
794 1 420
795 0 644
796 1 916
797 0 668
798 1 892

@larrywal
Copy link
Author

Matt - if it helps, I got a radio hooked up to my computer and grabbed the wave form from the remote. Here is the "On" signal.

image

I tried using a library called RC Switch to simulate the wave form but I can't make it work. Any suggestions to modifying your code to maybe do it?

@milksteakmatt
Copy link
Owner

The signal after you hit reset on the remote looks correct. I see similar values. My guess is that there's both something wrong with your transmitter and you have a lot of RF from somewhere else being picked up. It helps to put the signals in spreadsheet columns and compare them. You'll see the values from your remote align with those in the code but from your TX test, they aren't even close. Maybe set up a test with a very distinct transmission signal to ensure your chip is working.

@milksteakmatt
Copy link
Owner

If you want to try and get rid of the RF noise, you'll need things that absorb RF rather than reflect it. Or, you can drive out to a remote location.

@larrywal
Copy link
Author

larrywal commented Sep 29, 2018

Thanks Matt - the reason I thought my transmitter was working properly (and also able to deal with the noise) is I ran the below two programs - one as transmitter, one as receiver. And the message was picked up fine (per screenshot). I'm using a cheap 433 mhz transmitter from amazon, and I soldered on this antennae. If/since the below works, do you still think something could be wrong with the transmitter?

image

Send code (from Arduino Uno):
image

Receive Code (Mega)
image

Also - here is a pic of my transmitter setup
2018-09-29 07 43 11
2018-09-29 07 43 15

@larrywal
Copy link
Author

Also, I'm confident it's not interference because when I use the radio on the PC to listen and record what's coming through on the frequency, I only get hits from the arduino transmitter. When that's not running it's just solid static.

@larrywal
Copy link
Author

Ha! Major breakthrough! I got the fireplace to turn on. Looks like the protocol your device was following is just different. I took your constant definitions and functions defined in the cpp file and put them into my file, then screwed around with the XX and OO to make the pattern match up. That did it! Now to investigate further....though I guess my library doesn't need to be as robust. Just on off initially.

@milksteakmatt
Copy link
Owner

Excellent. I wonder if they vary the pattern so you can control multiple fireplaces. Send me your code when you can.

@larrywal
Copy link
Author

larrywal commented Sep 29, 2018

Sure - the code isn't at all cleaned up yet (I just dropped it into one file since I'm still not sure how libraries really work with the IDE -- any pointers?).

Code is below - IIRC the only differences with your code are in the startBlock, onOff, and the value block for on (the second block of three rows). Off looks the same so far. Note: When I did my test, I didn't play around with different values of thermostat, fan speed, or flame height. Not sure if those will adjust anything or not.

PS - did you ever try to get this running on a nodeMCU? For some reason this works fine on my Mega, but when I move the transmitter and code to a nodeMCU, the signal strength is super low and not working really.

`
/*
433 MHz RF Module Transmitter Demonstration 1
RF-Xmit-Demo-1.ino
Demonstrates 433 MHz RF Transmitter Module
Use with Receiver Demonstration 1

DroneBot Workshop 2018
https://dronebotworkshop.com

//Assumes data PIN 12
*/

// High/Low microsecond timings, first value is high timing, the rest alternate low/high

 // High and Low delay values.  Represented by XX and OO for visibility 
  const unsigned int XX = 880;
  const unsigned int OO = 380;

  // Fixed bit delay as the second value in each header pair
  const unsigned int HEAD_BYTE = 420;

  // Combined with the HEAD_BYTE, the delay after each header segment
  const unsigned int HEAD_BREAK = 830;

  // Number of 2 bit pairs in the header segment
  const unsigned int HEAD_SIZE = 4;

  // Fixed bit delay for the second value in each body pair
  const unsigned int BODY_BYTE = 700;

  // Combined with the BODY_BYTE, the delay after each body segment
  const unsigned int BODY_BREAK = 820;

  // Number of 2 bit pairs in the function segment of the body
  const unsigned int FUNC_SIZE = 5;

  // Number of 2 bit pairs in the value segment of the body used to represent values 0 to 5
  const unsigned int VAL_SIZE = 3;

  // Combined with the BODY_BYTE, the delay after each message
  const unsigned long MSG_BREAK = 90900;

  // Message is repeated multiple times
  const unsigned int MSG_REPEAT = 5;

  // Number of 2 bit pairs in the body segment of the message
  const unsigned long BODY_SIZE = 8;

  // Body is the last 3 segments that change each message
  const unsigned int BODY_REPEAT = 3;

  // Convenience value to use the same transmit and separate function from value
  const unsigned int NO_BREAK = 0;

  // Max reliable delay for Arduino delayMicroseconds
  const unsigned long MAX_DELAY = 16383;

  const unsigned long header[4] = {860, 380, 880, 380};

  const unsigned long startBlock[3][8] = {
    {XX, OO, OO, OO, XX, XX, OO, XX},
    {OO, XX, XX, XX, XX, OO, XX, OO},
    {OO, OO, XX, XX, OO, OO, XX, XX}
  };

  const unsigned long onOff[3][5] = {
    {OO, OO, OO, OO, OO},
    {XX, OO, OO, XX, OO},
    {OO, XX, XX, OO, XX}
  };

  const unsigned long flame[3][5] = {
    {OO, OO, XX, XX, OO},
    {OO, XX, XX, OO, XX},
    {XX, OO, OO, XX, OO}
  };

  const unsigned long fan[3][5] = {
    {OO, XX, OO, OO, OO},
    {OO, XX, XX, XX, OO},
    {XX, OO, OO, OO, XX}
  };

  const unsigned long value[6][3][3] = {
    { {OO, OO, OO},
      {XX, XX, XX},
      {OO, OO, OO}
    },
    { {OO, OO, XX},
      {OO, OO, OO},
      {XX, XX, XX}
    },
    { {OO, XX, OO},
      {OO, OO, XX},
      {XX, XX, OO}
    },
    { {OO, XX, XX},
      {OO, XX, OO},
      {XX, OO, XX}
    },
    { {XX, OO, OO},
      {OO, XX, XX},
      {XX, OO, OO}
    },
    { {XX, OO, XX},
      {XX, OO, OO},
      {OO, XX, XX}
    }
    
  };

  byte pinState;

const int pinChangeDelay = 0; // Value to subtract from numbers to compensate for instruction timings
const int outPin = 2; // Transmitter output pin
const int ledPin = 13; // LED output pin

bool done = false;

void setup() {
pinMode(ledPin,OUTPUT);
pinMode(outPin,OUTPUT);
digitalWrite(outPin,LOW);
delayMicroseconds(13000);
done = false;
}

void loop() {
if (!done)
{
start();
done = true;
}
}

void transmit(const unsigned long msg[], const unsigned int msgSize, const unsigned int msgByte, const unsigned int endDelay)
{
for (int y = 0; y < msgSize; y++){
digitalWrite(outPin,pinState);
unsigned long z = msg[y];
delayMicroseconds(z);
pinState = !pinState;
digitalWrite(outPin,pinState);
delayMicroseconds(msgByte);
pinState = !pinState;
}
delayMicroseconds(endDelay);
}

void sendMsg(int msg, int val)
{
// msg: ON = 0, OFF = 1, FAN = 2, FLAME = 3
pinState = 1;
noInterrupts();
for (int x = 1; x <= MSG_REPEAT; x++) {
transmit(header, HEAD_SIZE, HEAD_BYTE, HEAD_BREAK);
for (int y = 0; y < 3; y++) {
transmit(startBlock[y], BODY_SIZE, BODY_BYTE, BODY_BREAK);
}
for (int z = 0; z < 3; z++) {
switch(msg) {
case 0 :
transmit(onOff[z], FUNC_SIZE, BODY_BYTE, NO_BREAK);
val = 1;
break;
case 1:
transmit(onOff[z], FUNC_SIZE, BODY_BYTE, NO_BREAK);
val = 2;
break;
case 2:
transmit(fan[z], FUNC_SIZE, BODY_BYTE, NO_BREAK);
break;
case 3:
transmit(flame[z], FUNC_SIZE, BODY_BYTE, NO_BREAK);
break;
}
transmit(value[val][z], VAL_SIZE, BODY_BYTE, BODY_BREAK);
}
if (x < MSG_REPEAT) {
unsigned long END_DELAY = MSG_BREAK;
while (END_DELAY > MAX_DELAY) {
delayMicroseconds(MAX_DELAY);
END_DELAY = END_DELAY - MAX_DELAY;
}
delayMicroseconds(END_DELAY);
}
}
interrupts();
}

void start()
{
sendMsg(0,1);
delayMicroseconds(1000);
sendMsg(2,0);
delayMicroseconds(1000);
sendMsg(3,1);
}

void stop()
{
sendMsg(2,3);
delayMicroseconds(1000);
sendMsg(1,2);
}

void on()
{
sendMsg(0,1);
}

void off()
{
sendMsg(1,2);
}

void setFan(int speed)
{
sendMsg(2,speed);
}

void setFlame(int level)
{
sendMsg(3,level);
}
`

@wQQhce2g93Ei
Copy link

wQQhce2g93Ei commented Nov 30, 2020

FYI for anyone who makes it this far. I updated a bunch of stuff with respect to Ardufuego in my fork. Namely I figured out more about the rhyme and reason for the commands and values. See the table in FireplaceRf.h.

The last 3 message segments are basically the following.
[Command] [CommandOffset1] [CommandOffset2]

CommandOffset1 and 2 seem to vary per remote (along with the first two segments of the start message). In my case CommandOffset1 and 2 can be found like this.

CommandOffset1 = (Command + 253) % 256;
CommandOffset2 = ~CommandOffset1;

For PowerOn my last 3 message segments look like this. (purely coincidence that Command and CommandOffset2 are the same)

[Command]  [CommandOffset1] [CommandOffset2]
0000 0001    1111 1110        0000 0001

After figuring this out the code was able to be simplified greatly and I was able to map more functionality like Pilot, AUX1, and AUX2 easily.

@larrywal
Copy link
Author

larrywal commented Dec 1, 2020

Wow - fantastic that you figured it out. My basic solution has been working well for years. I barely remember how. Maybe at some point I'll dust it off and try to upgrade... :)

@milksteakmatt
Copy link
Owner

Just getting back to this project to update it with voice control and super excited to see the additions. I'll be sure to update once I get my phase 2 running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants