irmp-org / irmp Goto Github PK
View Code? Open in Web Editor NEWInfrared Multi Protocol Decoder
License: GNU General Public License v3.0
Infrared Multi Protocol Decoder
License: GNU General Public License v3.0
hi in stm32duino version 1.9 i get this compile error(https://github.com/stm32duino/Arduino_Core_STM32)
In file included from /home/conrad/Arduino/libraries/IRMP/src/irmp.c.h:30,
from /home/conrad/Arduino/libraries/IRMP/examples/AllProtocols/AllProtocols.ino:114:
/home/conrad/Arduino/libraries/IRMP/src/IRTimer.cpp.h: In function 'void initIRReceiveTimer()':
/home/conrad/Arduino/libraries/IRMP/src/IRTimer.cpp.h:174:43: error: no matching function for call to 'HardwareTimer::attachInterrupt(void (&)(HardwareTimer*))'
174 | sSTM32Timer.attachInterrupt(irmp_timer_ISR); // this sets update interrupt enable
this error does not exist in version 1.8 stm32duino
D5 (14)
Setup with V1838B on ESP8266 W1 Mini (1M) connected to D5 (pin 14) with 3.3 Volt the device crashes reproducable with versions above 2.2.1. With 2.1.1 decoding works, no crash at all.
Should work as with 2.2.1 in any newer version.
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
Exception (3):
epc1=0x4000e041 epc2=0x00000000 epc3=0x00000000 excvaddr=0x4023800d depc=0x00000000
stack>>>
ctx: sys
sp: 3fffec50 end: 3fffffb0 offset: 0190
3fffede0: 4021b278 3fffee80 00000000 40100208
3fffedf0: 4021b2d9 3fffee80 3fffee80 00000000
3fffee00: 3fffc200 40100f28 00000020 00000001
3fffee10: 40100f28 00000020 40100e7c 00000022
3fffee20: 3fffc200 40100f28 00000020 40100e7c
3fffee30: 3fffc200 40100f28 00000020 40100f70
3fffee40: 4022454e 00000020 3fffc230 4000050c
3fffee50: 40101b50 00000030 00000010 ffffffff
3fffee60: 40201dac 3fffefa0 00000001 00000000
3fffee70: 3fffdab0 00000000 3fffd9d0 3ffee3b0
3fffee80: 00000000 00000000 00000001 3ffe84e8
3fffee90: 00000000 3fffdad0 3ffee3b0 00000030
3fffeea0: 00000000 3fffdad0 3ffee3b0 00000030
3fffeeb0: 00000000 00000000 4bc6a7f0 4020a215
3fffeec0: 00139ba9 000010f5 00000020 4020a254
3fffeed0: 00000000 00000000 0000002e 4020af11
3fffeee0: 4020af6c 000010f5 3ffee4bc 4020af9f
3fffeef0: 4023a230 0014ae7c 3ffecd80 4020a279
3fffef00: 00423e19 3ffe8800 3ffe87e4 4020b114
3fffef10: 40102365 0014ae7c 3ffe8800 60000600
3fffef20: 40224574 3ffe87e4 3ffe8800 00423e19
3fffef30: 4022459a 3fffdab0 00000000 3ffe84e8
3fffef40: 00000000 3fffdad0 3ffee3b0 40201da4
3fffef50: 40000f49 40000f49 3fffdab0 40000f49
3fffef60: 40000e19 00000005 00042880 00000000
3fffef70: 00000000 aa55aa55 000000a1 40101d55
3fffef80: 40101d5b 00042880 00000000 00000000
3fffef90: 4010000d 00000000 00000000 00000000
3fffefa0: 00000000 3fffef3c 00000000 3fffff68
3fffefb0: 3fffffc0 00000000 00000000 feefeffe
3fffefc0: feefeffe feefeffe feefeffe feefeffe
3fffefd0: feefeffe feefeffe feefeffe feefeffe
3fffefe0: feefeffe feefeffe feefeffe feefeffe
3fffeff0: feefeffe feefeffe feefeffe feefeffe
3ffff000: feefeffe feefeffe feefeffe feefeffe
3ffff010: feefeffe feefeffe feefeffe feefeffe
3ffff020: feefeffe feefeffe feefeffe feefeffe
3ffff030: feefeffe feefeffe feefeffe feefeffe
3ffff040: feefeffe feefeffe feefeffe feefeffe
3ffff050: feefeffe feefeffe feefeffe feefeffe
3ffff060: feefeffe feefeffe feefeffe feefeffe
3ffff070: feefeffe feefeffe feefeffe feefeffe
3ffff080: feefeffe feefeffe feefeffe feefeffe
3ffff090: feefeffe feefeffe feefeffe feefeffe
3ffff0a0: feefeffe feefeffe feefeffe feefeffe
3ffff0b0: feefeffe feefeffe feefeffe feefeffe
3ffff0c0: feefeffe feefeffe feefeffe feefeffe
3ffff0d0: feefeffe feefeffe feefeffe feefeffe
3ffff0e0: feefeffe feefeffe feefeffe feefeffe
3ffff0f0: feefeffe feefeffe feefeffe feefeffe
3ffff100: feefeffe feefeffe feefeffe feefeffe
3ffff110: feefeffe feefeffe feefeffe feefeffe
3ffff120: feefeffe feefeffe feefeffe feefeffe
3ffff130: feefeffe feefeffe feefeffe feefeffe
3ffff140: feefeffe feefeffe feefeffe feefeffe
3ffff150: feefeffe feefeffe feefeffe feefeffe
3ffff160: feefeffe feefeffe feefeffe feefeffe
3ffff170: feefeffe feefeffe feefeffe feefeffe
3ffff180: feefeffe feefeffe feefeffe feefeffe
3ffff190: feefeffe feefeffe feefeffe feefeffe
3ffff1a0: feefeffe feefeffe feefeffe feefeffe
3ffff1b0: feefeffe feefeffe feefeffe feefeffe
3ffff1c0: feefeffe feefeffe feefeffe feefeffe
3ffff1d0: feefeffe feefeffe feefeffe feefeffe
3ffff1e0: feefeffe feefeffe feefeffe feefeffe
3ffff1f0: feefeffe feefeffe feefeffe feefeffe
3ffff200: feefeffe feefeffe feefeffe feefeffe
3ffff210: feefeffe feefeffe feefeffe feefeffe
3ffff220: feefeffe feefeffe feefeffe feefeffe
3ffff230: feefeffe feefeffe feefeffe feefeffe
3ffff240: feefeffe feefeffe feefeffe feefeffe
3ffff250: feefeffe feefeffe feefeffe feefeffe
3ffff260: feefeffe feefeffe feefeffe feefeffe
3ffff270: feefeffe feefeffe feefeffe feefeffe
3ffff280: feefeffe feefeffe feefeffe feefeffe
3ffff290: feefeffe feefeffe feefeffe feefeffe
3ffff2a0: feefeffe feefeffe feefeffe feefeffe
3ffff2b0: feefeffe feefeffe feefeffe feefeffe
3ffff2c0: feefeffe feefeffe feefeffe feefeffe
3ffff2d0: feefeffe feefeffe feefeffe feefeffe
3ffff2e0: feefeffe feefeffe feefeffe feefeffe
3ffff2f0: feefeffe feefeffe feefeffe feefeffe
3ffff300: feefeffe feefeffe feefeffe feefeffe
3ffff310: feefeffe feefeffe feefeffe feefeffe
3ffff320: feefeffe feefeffe feefeffe feefeffe
3ffff330: feefeffe feefeffe feefeffe feefeffe
3ffff340: feefeffe feefeffe feefeffe feefeffe
3ffff350: feefeffe feefeffe feefeffe feefeffe
3ffff360: feefeffe feefeffe feefeffe feefeffe
3ffff370: feefeffe feefeffe feefeffe feefeffe
3ffff380: feefeffe feefeffe feefeffe feefeffe
3ffff390: feefeffe feefeffe feefeffe feefeffe
3ffff3a0: feefeffe feefeffe feefeffe feefeffe
3ffff3b0: feefeffe feefeffe feefeffe feefeffe
3ffff3c0: feefeffe feefeffe feefeffe feefeffe
3ffff3d0: feefeffe feefeffe feefeffe feefeffe
3ffff3e0: feefeffe feefeffe feefeffe feefeffe
3ffff3f0: feefeffe feefeffe feefeffe feefeffe
3ffff400: feefeffe feefeffe feefeffe feefeffe
3ffff410: feefeffe feefeffe feefeffe feefeffe
3ffff420: feefeffe feefeffe feefeffe feefeffe
3ffff430: feefeffe feefeffe feefeffe feefeffe
3ffff440: feefeffe feefeffe feefeffe feefeffe
3ffff450: feefeffe feefeffe feefeffe feefeffe
3ffff460: feefeffe feefeffe feefeffe feefeffe
3ffff470: feefeffe feefeffe feefeffe feefeffe
3ffff480: feefeffe feefeffe feefeffe feefeffe
3ffff490: feefeffe feefeffe feefeffe feefeffe
3ffff4a0: feefeffe feefeffe feefeffe feefeffe
3ffff4b0: feefeffe feefeffe feefeffe feefeffe
3ffff4c0: feefeffe feefeffe feefeffe feefeffe
3ffff4d0: feefeffe feefeffe feefeffe feefeffe
3ffff4e0: feefeffe feefeffe feefeffe feefeffe
3ffff4f0: feefeffe feefeffe feefeffe feefeffe
3ffff500: feefeffe feefeffe feefeffe feefeffe
3ffff510: feefeffe feefeffe feefeffe feefeffe
3ffff520: feefeffe feefeffe feefeffe feefeffe
3ffff530: feefeffe feefeffe feefeffe feefeffe
3ffff540: feefeffe feefeffe feefeffe feefeffe
3ffff550: feefeffe feefeffe feefeffe feefeffe
3ffff560: feefeffe feefeffe feefeffe feefeffe
3ffff570: feefeffe feefeffe feefeffe feefeffe
3ffff580: feefeffe feefeffe feefeffe feefeffe
3ffff590: feefeffe feefeffe feefeffe feefeffe
3ffff5a0: feefeffe feefeffe feefeffe feefeffe
3ffff5b0: feefeffe feefeffe feefeffe feefeffe
3ffff5c0: feefeffe feefeffe feefeffe feefeffe
3ffff5d0: feefeffe feefeffe feefeffe feefeffe
3ffff5e0: feefeffe feefeffe feefeffe feefeffe
3ffff5f0: feefeffe feefeffe feefeffe feefeffe
3ffff600: feefeffe feefeffe feefeffe feefeffe
3ffff610: feefeffe feefeffe feefeffe feefeffe
3ffff620: feefeffe feefeffe feefeffe feefeffe
3ffff630: feefeffe feefeffe feefeffe feefeffe
3ffff640: feefeffe feefeffe feefeffe feefeffe
3ffff650: feefeffe feefeffe feefeffe feefeffe
3ffff660: feefeffe feefeffe feefeffe feefeffe
3ffff670: feefeffe feefeffe feefeffe feefeffe
3ffff680: feefeffe feefeffe feefeffe feefeffe
3ffff690: feefeffe feefeffe feefeffe feefeffe
3ffff6a0: feefeffe feefeffe feefeffe feefeffe
3ffff6b0: feefeffe feefeffe feefeffe feefeffe
3ffff6c0: feefeffe feefeffe feefeffe feefeffe
3ffff6d0: feefeffe feefeffe feefeffe feefeffe
3ffff6e0: feefeffe feefeffe feefeffe feefeffe
3ffff6f0: feefeffe feefeffe feefeffe feefeffe
3ffff700: feefeffe feefeffe feefeffe feefeffe
3ffff710: feefeffe feefeffe feefeffe feefeffe
3ffff720: feefeffe feefeffe feefeffe feefeffe
3ffff730: feefeffe feefeffe feefeffe feefeffe
3ffff740: feefeffe feefeffe feefeffe feefeffe
3ffff750: feefeffe feefeffe feefeffe feefeffe
3ffff760: feefeffe feefeffe feefeffe feefeffe
3ffff770: feefeffe feefeffe feefeffe feefeffe
3ffff780: feefeffe feefeffe feefeffe feefeffe
3ffff790: feefeffe feefeffe feefeffe feefeffe
3ffff7a0: feefeffe feefeffe feefeffe feefeffe
3ffff7b0: feefeffe feefeffe feefeffe feefeffe
3ffff7c0: feefeffe feefeffe feefeffe feefeffe
3ffff7d0: feefeffe feefeffe feefeffe feefeffe
3ffff7e0: feefeffe feefeffe feefeffe feefeffe
3ffff7f0: feefeffe feefeffe feefeffe feefeffe
3ffff800: feefeffe feefeffe feefeffe feefeffe
3ffff810: feefeffe feefeffe feefeffe feefeffe
3ffff820: feefeffe feefeffe feefeffe feefeffe
3ffff830: feefeffe feefeffe feefeffe feefeffe
3ffff840: feefeffe feefeffe feefeffe feefeffe
3ffff850: feefeffe feefeffe feefeffe feefeffe
3ffff860: feefeffe feefeffe feefeffe feefeffe
3ffff870: feefeffe feefeffe feefeffe feefeffe
3ffff880: feefeffe feefeffe feefeffe feefeffe
3ffff890: feefeffe feefeffe feefeffe feefeffe
3ffff8a0: feefeffe feefeffe feefeffe feefeffe
3ffff8b0: feefeffe feefeffe feefeffe feefeffe
3ffff8c0: feefeffe feefeffe feefeffe feefeffe
3ffff8d0: feefeffe feefeffe feefeffe feefeffe
3ffff8e0: feefeffe feefeffe feefeffe feefeffe
3ffff8f0: feefeffe feefeffe feefeffe feefeffe
3ffff900: feefeffe feefeffe feefeffe feefeffe
3ffff910: feefeffe feefeffe feefeffe feefeffe
3ffff920: feefeffe feefeffe feefeffe feefeffe
3ffff930: feefeffe feefeffe feefeffe feefeffe
3ffff940: feefeffe feefeffe feefeffe feefeffe
3ffff950: feefeffe feefeffe feefeffe feefeffe
3ffff960: feefeffe feefeffe feefeffe feefeffe
3ffff970: feefeffe feefeffe feefeffe feefeffe
3ffff980: feefeffe feefeffe feefeffe feefeffe
3ffff990: feefeffe feefeffe feefeffe feefeffe
3ffff9a0: feefeffe feefeffe feefeffe feefeffe
3ffff9b0: feefeffe feefeffe feefeffe feefeffe
3ffff9c0: feefeffe feefeffe feefeffe feefeffe
3ffff9d0: feefeffe feefeffe feefeffe feefeffe
3ffff9e0: feefeffe feefeffe feefeffe feefeffe
3ffff9f0: feefeffe feefeffe feefeffe feefeffe
3ffffa00: feefeffe feefeffe feefeffe feefeffe
3ffffa10: feefeffe feefeffe feefeffe feefeffe
3ffffa20: feefeffe feefeffe feefeffe feefeffe
3ffffa30: feefeffe feefeffe feefeffe feefeffe
3ffffa40: feefeffe feefeffe feefeffe feefeffe
3ffffa50: feefeffe feefeffe feefeffe feefeffe
3ffffa60: feefeffe feefeffe feefeffe feefeffe
3ffffa70: feefeffe feefeffe feefeffe feefeffe
3ffffa80: feefeffe feefeffe feefeffe feefeffe
3ffffa90: feefeffe feefeffe feefeffe feefeffe
3ffffaa0: feefeffe feefeffe feefeffe feefeffe
3ffffab0: feefeffe feefeffe feefeffe feefeffe
3ffffac0: feefeffe feefeffe feefeffe feefeffe
3ffffad0: feefeffe feefeffe feefeffe feefeffe
3ffffae0: feefeffe feefeffe feefeffe feefeffe
3ffffaf0: feefeffe feefeffe feefeffe feefeffe
3ffffb00: feefeffe feefeffe feefeffe feefeffe
3ffffb10: feefeffe feefeffe feefeffe feefeffe
3ffffb20: feefeffe feefeffe feefeffe feefeffe
3ffffb30: feefeffe feefeffe feefeffe feefeffe
3ffffb40: feefeffe feefeffe feefeffe feefeffe
3ffffb50: feefeffe feefeffe feefeffe feefeffe
3ffffb60: feefeffe feefeffe feefeffe feefeffe
3ffffb70: feefeffe feefeffe feefeffe feefeffe
3ffffb80: feefeffe feefeffe feefeffe feefeffe
3ffffb90: feefeffe feefeffe feefeffe feefeffe
3ffffba0: feefeffe feefeffe feefeffe feefeffe
3ffffbb0: feefeffe feefeffe feefeffe feefeffe
3ffffbc0: feefeffe feefeffe feefeffe feefeffe
3ffffbd0: feefeffe feefeffe feefeffe feefeffe
3ffffbe0: feefeffe feefeffe feefeffe feefeffe
3ffffbf0: feefeffe feefeffe feefeffe feefeffe
3ffffc00: feefeffe feefeffe feefeffe feefeffe
3ffffc10: feefeffe feefeffe feefeffe feefeffe
3ffffc20: feefeffe feefeffe feefeffe feefeffe
3ffffc30: feefeffe feefeffe feefeffe feefeffe
3ffffc40: feefeffe feefeffe feefeffe feefeffe
3ffffc50: feefeffe feefeffe feefeffe 40100208
3ffffc60: feefeffe feefeffe feefeffe 00000001
3ffffc70: feefeffe feefeffe feefeffe 40100208
3ffffc80: feefeffe feefeffe feefeffe 00000001
3ffffc90: 3fffc200 40100f28 00000020 40100e7c
3ffffca0: feefeffe feefeffe feefeffe 00000022
3ffffcb0: 3fffc200 40100f28 00000020 40100e7c
3ffffcc0: 40100e8c 00000030 0000001f 40100f70
3ffffcd0: 4010587e 00000004 3fffc230 4000050c
3ffffce0: 40100e92 00000030 0000001f fffffffe
3ffffcf0: 4010587e 00000000 3ffee39c 3ffe92ac
3ffffd00: 00000000 3ffe8e60 20110486 00000000
3ffffd10: 00000000 00000000 00000000 00000004
3ffffd20: 3ffe8e30 00000001 00000000 00000030
3ffffd30: 401069c6 00000030 0000001f fffffffe
3ffffd40: 4000050c 00000000 00000000 00000000
3ffffd50: 00000000 3ffef4a4 3ffe8e60 00000000
3ffffd60: 00000000 00000000 00000001 3fffc278
3ffffd70: 401067dc 3fffc200 00000022 00000030
3ffffd80: 4000050c 3ffe9b7c 3fffc228 401024a5
3ffffd90: 4000050c 00000030 00000012 fffffc00
3ffffda0: 00000000 00000000 00000020 40100ef0
3ffffdb0: 4000050c 6000060c 00000000 401058b4
3ffffdc0: 3ffe92f0 4010514f 3ffef4a4 40100ef0
3ffffdd0: 00000001 4010431e 3ffe8e60 40100ef0
3ffffde0: 4010478f 00000000 00000020 40100ef0
3ffffdf0: 3ffe92f0 4010514f 00000005 40100208
3ffffe00: 40104257 0000007f 00000000 00000001
3ffffe10: 00000000 3ffecd80 00040000 40100208
3ffffe20: 40106af4 00080000 3ffed508 00000022
3ffffe30: 3fffc200 40100f28 00000020 40100208
3ffffe40: 40104053 2c9f0300 4000050c 00000001
3ffffe50: 3fffc200 40100f28 3fffc230 4000050c
3ffffe60: 40203399 00000030 00000010 00000022
3ffffe70: 3fffc200 40100f28 00000020 40100e7c
3ffffe80: 00000000 00000000 00000000 40100f70
3ffffe90: 3ffee317 3fffc6fc 3fffc230 4000050c
3ffffea0: 40203374 00000030 00000010 ffffffff
3ffffeb0: 40201f19 00000000 3ffee317 00000000
3ffffec0: 00000000 00000000 00000000 fffffffe
3ffffed0: 3ffee317 3fffc6fc 00000001 3ffee370
3ffffee0: 00000000 3fffdad0 3ffee3b0 00000030
3ffffef0: 00000000 3fffdad0 3ffee3b0 00000030
3fffff00: 00000000 3fffdad0 3ffee3b0 00000030
3fffff10: 6f746f72 736c6f63 7372203a 206e6f69
3fffff20: 3ffe8612 00000000 28000a0d 40202ca5
3fffff30: 3ffe8612 0001c200 00000000 00000000
3fffff40: 007a1200 09e32d78 ffffff00 3ffee3b0
3fffff50: 40201540 3ffee348 3ffe8610 4020154c
3fffff60: 007a1200 14b94121 3ffe8600 40201749
3fffff70: 00000000 00000009 3ffee348 40201810
3fffff80: 00000000 00000000 00000001 40100ef0
3fffff90: 3fffdad0 00000000 3ffee370 40100f11
3fffffa0: feefeffe feefeffe 3ffee370 40201f55
<<<stack<<<
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
Crash decoded:
Exception 3: LoadStoreError: Processor internal physical address or data error during load or store
PC: 0x4000e041
EXCVADDR: 0x4023800d
Decoding stack results
0x40100208: irmp_ISR() at C:\Users\kposa\Documents\Arduino\libraries\IRMP\src/irmp.c.h line 3211
0x40100f28: timer1_isr_handler(void*) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_timer.cpp line 36
0x40100f28: timer1_isr_handler(void*) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_timer.cpp line 36
0x40100e7c: irmp_timer_ISR() at C:\Users\kposa\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h line 622
0x40100f28: timer1_isr_handler(void*) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_timer.cpp line 36
0x40100e7c: irmp_timer_ISR() at C:\Users\kposa\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h line 622
0x40100f28: timer1_isr_handler(void*) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_timer.cpp line 36
0x40100f70: timer1_isr_handler(void*) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_timer.cpp line 43
0x40101b50: cont_check(cont_t*) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\cont_util.cpp line 46
0x40201dac: loop_task(ETSEvent*) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_main.cpp line 205
0x4020a215: do_memp_malloc_pool at core/memp.c line 255
0x4020a254: memp_malloc at core/memp.c line 356
0x4020af11: sys_timeout_abs at core/timeouts.c line 189
0x4020af6c: lwip_cyclic_timer at core/timeouts.c line 233
0x4020af9f: lwip_cyclic_timer at core/timeouts.c line 261
0x4020a279: memp_free at core/memp.c line 447
0x4020b114: sys_check_timeouts at core/timeouts.c line 390
0x40201da4: loop_task(ETSEvent*) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_main.cpp line 205
0x40100208: irmp_ISR() at C:\Users\kposa\Documents\Arduino\libraries\IRMP\src/irmp.c.h line 3211
0x40100208: irmp_ISR() at C:\Users\kposa\Documents\Arduino\libraries\IRMP\src/irmp.c.h line 3211
0x40100f28: timer1_isr_handler(void*) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_timer.cpp line 36
0x40100e7c: irmp_timer_ISR() at C:\Users\kposa\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h line 622
0x40100f28: timer1_isr_handler(void*) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_timer.cpp line 36
0x40100e7c: irmp_timer_ISR() at C:\Users\kposa\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h line 622
0x40100e8c: ets_intr_lock() at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_main.cpp line 155
0x40100f70: timer1_isr_handler(void*) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_timer.cpp line 43
0x40100e92: ets_intr_lock() at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_main.cpp line 155
0x40100ef0: ets_post(uint8, ETSSignal, ETSParam) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_main.cpp line 177
0x40100ef0: ets_post(uint8, ETSSignal, ETSParam) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_main.cpp line 177
0x40100ef0: ets_post(uint8, ETSSignal, ETSParam) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_main.cpp line 177
0x40100ef0: ets_post(uint8, ETSSignal, ETSParam) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_main.cpp line 177
0x40100208: irmp_ISR() at C:\Users\kposa\Documents\Arduino\libraries\IRMP\src/irmp.c.h line 3211
0x40100208: irmp_ISR() at C:\Users\kposa\Documents\Arduino\libraries\IRMP\src/irmp.c.h line 3211
0x40100f28: timer1_isr_handler(void*) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_timer.cpp line 36
0x40100208: irmp_ISR() at C:\Users\kposa\Documents\Arduino\libraries\IRMP\src/irmp.c.h line 3211
0x40100f28: timer1_isr_handler(void*) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_timer.cpp line 36
0x40203399: run_scheduled_functions() at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\Schedule.cpp line 125
0x40100f28: timer1_isr_handler(void*) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_timer.cpp line 36
0x40100e7c: irmp_timer_ISR() at C:\Users\kposa\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h line 622
0x40100f70: timer1_isr_handler(void*) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_timer.cpp line 43
0x40203374: run_scheduled_functions() at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\Schedule.cpp line 119
0x40201f19: __loop_end() at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_main.cpp line 184
0x40202ca5: uart_write(uart_t*, char const*, size_t) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\uart.cpp line 509
0x40201540: HardwareSerial::write(unsigned char const*, unsigned int) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266/HardwareSerial.h line 164
0x4020154c: HardwareSerial::write(unsigned char const*, unsigned int) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266/HardwareSerial.h line 165
0x40201749: Print::write(char const*) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266/Print.h line 62
0x40201810: Print::println() at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\Print.cpp line 186
0x40100ef0: ets_post(uint8, ETSSignal, ETSParam) at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_main.cpp line 177
0x40100f11: esp_schedule() at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_main.cpp line 125
0x40201f55: loop_wrapper() at C:\Users\kposa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_main.cpp line 199
25
`typedef struct IRMP_DATA;
class IRTester
{
IRMP_DATA *data;
public:
IRTester
}`
I am trying to forward declare IRMP_DATA which will be include in my cpp file. But on the ESP32 the struct doesn't have a name so I can not forward declare it. I modify the source irmpsystem.h to include a name on the struct and that allowed me to compile.
To be able to forward declare the IRMP_DATA struct in my header file.
^ In file included from C:\Users\user\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/sys/config.h:5:0, from C:\Users\user\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/_ansi.h:16, from C:\Users\user\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/string.h:10, from .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmpsystem.h:105, from .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmp.h:22, from .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmp.c.h:26, from src\IRTester.cpp:6: C:\Users\abrzozowski\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/sys/features.h:25:8: error: expected unqualified-id before string constant extern "C" { ^ In file included from .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmp.h:22:0, from .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmp.c.h:26, from src\IRTester.cpp:6: .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmpsystem.h:231:5: error: 'uint8_t' does not name a type uint8_t protocol; // protocol, e.g. NEC_PROTOCOL ^ .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmpsystem.h:232:5: error: 'uint16_t' does not name a type uint16_t address; // address ^ .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmpsystem.h:233:5: error: 'uint32_t' does not name a type uint32_t command; // command ^ .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmpsystem.h:234:5: error: 'uint8_t' does not name a type uint8_t flags; // flags, e.g. repetition Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-adc.c.o ^ .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmpsystem.h:235:3: error: conflicting declaration 'typedef struct IRMP_DATA IRMP_DATA' } IRMP_DATA; ^ In file included from src\IRTester.cpp:1:0: Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-bt.c.o src\IRTester.h:1:16: note: previous declaration as 'struct IRMP_DATA' typedef struct IRMP_DATA; ^ In file included from src\IRTester.cpp:6:0: .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmp.c.h: In function 'bool irmp_get_data(IRMP_DATA*)': .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmp.c.h:2780:24: error: invalid use of incomplete type 'struct IRMP_DATA' irmp_data_p->protocol = irmp_protocol; ^ In file included from src\IRTester.cpp:1:0: src\IRTester.h:1:16: note: forward declaration of 'struct IRMP_DATA' typedef struct IRMP_DATA; ^ In file included from src\IRTester.cpp:6:0: .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmp.c.h:2781:24: error: invalid use of incomplete type 'struct IRMP_DATA' irmp_data_p->address = irmp_address; ^ In file included from src\IRTester.cpp:1:0: src\IRTester.h:1:16: note: forward declaration of 'struct IRMP_DATA' typedef struct IRMP_DATA; ^ In file included from src\IRTester.cpp:6:0: .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmp.c.h:2782:24: error: invalid use of incomplete type 'struct IRMP_DATA' irmp_data_p->command = irmp_command; ^ In file included from src\IRTester.cpp:1:0: src\IRTester.h:1:16: note: forward declaration of 'struct IRMP_DATA' typedef struct IRMP_DATA; ^ In file included from src\IRTester.cpp:6:0: .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmp.c.h:2783:24: error: invalid use of incomplete type 'struct IRMP_DATA' irmp_data_p->flags = irmp_flags; ^ In file included from src\IRTester.cpp:1:0: src\IRTester.h:1:16: note: forward declaration of 'struct IRMP_DATA' typedef struct IRMP_DATA; ^ In file included from .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmp.c.h:3143:0, from src\IRTester.cpp:6: .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmpArduinoExt.cpp.h: In function 'void irmp_result_print(Print*, IRMP_DATA*)': .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmpArduinoExt.cpp.h:572:52: error: invalid use of incomplete type 'struct IRMP_DATA' aSerial->print(irmp_protocol_names[aIRMPDataPtr->protocol]); ^ In file included from src\IRTester.cpp:1:0: src\IRTester.h:1:16: note: forward declaration of 'struct IRMP_DATA' typedef struct IRMP_DATA; ^ In file included from .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmp.c.h:3143:0, from src\IRTester.cpp:6: .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmpArduinoExt.cpp.h:584:32: error: invalid use of incomplete type 'struct IRMP_DATA' aSerial->print(aIRMPDataPtr->address, HEX); ^ In file included from src\IRTester.cpp:1:0: src\IRTester.h:1:16: note: forward declaration of 'struct IRMP_DATA' typedef struct IRMP_DATA; ^ In file included from .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmp.c.h:3143:0, from src\IRTester.cpp:6: .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmpArduinoExt.cpp.h:586:32: error: invalid use of incomplete type 'struct IRMP_DATA' aSerial->print(aIRMPDataPtr->command, HEX); ^ In file included from src\IRTester.cpp:1:0: src\IRTester.h:1:16: note: forward declaration of 'struct IRMP_DATA' typedef struct IRMP_DATA; ^ In file included from .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmp.c.h:3143:0, from src\IRTester.cpp:6: .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmpArduinoExt.cpp.h:587:21: error: invalid use of incomplete type 'struct IRMP_DATA' if (aIRMPDataPtr->flags & IRMP_FLAG_REPETITION) ^ In file included from src\IRTester.cpp:1:0: src\IRTester.h:1:16: note: forward declaration of 'struct IRMP_DATA' typedef struct IRMP_DATA; ^ In file included from .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmp.c.h:3143:0, from src\IRTester.cpp:6: .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmpArduinoExt.cpp.h: In function 'void irmp_result_print(IRMP_DATA*)': .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmpArduinoExt.cpp.h:616:50: error: invalid use of incomplete type 'struct IRMP_DATA' Serial.print(irmp_protocol_names[aIRMPDataPtr->protocol]); ^ In file included from src\IRTester.cpp:1:0: src\IRTester.h:1:16: note: forward declaration of 'struct IRMP_DATA' typedef struct IRMP_DATA; ^ In file included from .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmp.c.h:3143:0, from src\IRTester.cpp:6: .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmpArduinoExt.cpp.h:628:30: error: invalid use of incomplete type 'struct IRMP_DATA' Serial.print(aIRMPDataPtr->address, HEX); ^ In file included from src\IRTester.cpp:1:0: src\IRTester.h:1:16: note: forward declaration of 'struct IRMP_DATA' typedef struct IRMP_DATA; ^ In file included from .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmp.c.h:3143:0, from src\IRTester.cpp:6: .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmpArduinoExt.cpp.h:630:30: error: invalid use of incomplete type 'struct IRMP_DATA' Serial.print(aIRMPDataPtr->command, HEX); ^ In file included from src\IRTester.cpp:1:0: src\IRTester.h:1:16: note: forward declaration of 'struct IRMP_DATA' typedef struct IRMP_DATA; ^ In file included from .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmp.c.h:3143:0, from src\IRTester.cpp:6: .pio\libdeps\esp32doit-devkit-v1\IRMP\src/irmpArduinoExt.cpp.h:631:21: error: invalid use of incomplete type 'struct IRMP_DATA' if (aIRMPDataPtr->flags & IRMP_FLAG_REPETITION) ^ In file included from src\IRTester.cpp:1:0: src\IRTester.h:1:16: note: forward declaration of 'struct IRMP_DATA' typedef struct IRMP_DATA; ^ src\IRTester.cpp: In constructor 'IRTester::IRTester()': src\IRTester.cpp:10:26: error: invalid use of incomplete type 'struct IRMP_DATA' data = new IRMP_DATA(); ^ In file included from src\IRTester.cpp:1:0: src\IRTester.h:1:16: note: forward declaration of 'struct IRMP_DATA' typedef struct IRMP_DATA; ^ *** [.pio\build\esp32doit-devkit-v1\src\IRTester.cpp.o] Error 1
I can't seem to get sending to work on ESP32's - either my own sketch or the SimpleSender.ino example.
Software: Arduino IDE 1.8.13 and arduino-cli 0.13, using esp32 devkit board definition: fqbn=esp32:esp32:esp32:PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,DebugLevel=none
Hardware: TTGO T Display and TTGO T7 mini.
It crashes as soon as you call irsnd_send_data(&irsnd_data, false);
START /tmp/arduino_modified_sketch_602015/SimpleSender.ino from Sep 22 2020
Using library version 3.2.0
Ready to send IR signals at pin 4
Send 0xFB04
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x400ea743 PS : 0x00060130 A0 : 0x800d0cbc A1 : 0x3ffb1f10
A2 : 0x00000000 A3 : 0x3f400fdb A4 : 0xa5f310fd A5 : 0x3ffc04d0
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x800d29a1 A9 : 0x3ffb1f00
A10 : 0x00000002 A11 : 0x3f400fdb A12 : 0x00000002 A13 : 0x0000ff00
A14 : 0x00ff0000 A15 : 0xff000000 SAR : 0x0000000a EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xffffffff
Backtrace: 0x400ea743:0x3ffb1f10 0x400d0cb9:0x3ffb1f30 0x400d149b:0x3ffb1f50 0x400d20d1:0x3ffb1f80 0x400d2ea7:0x3ffb1fb0 0x40088381:0x3ffb1fd0
Rebooting...
ets Jun 8 2016 00:22:57
According to EspExceptionDecoder this translates to:
PC: 0x400ea743: timerAlarmRead at /home/simon/.arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-timer.c line 103
EXCVADDR: 0x00000000
Decoding stack results
0x400ea743: timerAlarmRead at /home/simon/.arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-timer.c line 103
0x400d0cb9: storeIRTimer() at /home/simon/programming/c++/arduino/libraries/IRMP/src/IRTimer.cpp.h line 334
0x400d149b: irsnd_send_data(IRMP_DATA*, uint8_t) at /home/simon/programming/c++/arduino/libraries/IRMP/src/irsnd.c.h line 1705
0x400d20d1: setup() at /tmp/arduino_modified_sketch_55627/SimpleSender.ino line 87
0x400d2ea7: loopTask(void*) at /home/simon/.arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/main.cpp line 14
0x40088381: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143
Line 87 of the sketch is is irsnd_send_data(&irsnd_data, false);
Even tried 3.2.1 from git and it made no difference.
Receiving works excellently thanks (something that never worked with IRRemote!)
P.S. the ESP32 cores don't seem to define LED_BUILTIN
so the sketches won't compile even if you set irmp_irsnd_LEDFeedback(false);
until you define it in your sketch, that's probably more a bug with the cores, but it may be useful to have a default define or ignore if feedback is false in your lib?
Hello there
huge thanks to the wonderful libraries.
I have been playing with a simple receiver example on the wokwi Arduino simulator(https://github.com/wokwi) and glad that I found these examples.
My request:
I would love to create a collection of examples(with all attributes without failing to mention) using your library on Wokwi Arduino Simulator for all our readers (https://wokwi.com)
Example link: https://wokwi.com/arduino/projects/298945438795432456
I would like to know If you are interested in the online simulation links (as above) for your readers as well. If yes, I will also share the table (examples and the links to the examples). All these links are permanent links.
Thanks a lot for your time.
Please delete all unchecked lines above :-)
gpio 12
in itrrupt mode esp8266 work well but when i try it in non intrrupt mode mcu resets and i get this message in serial console
START OneProtocol.ino from Sep 12 2021
Using library version 3.4.1
ets Jan 8 2013,rst cause:4, boot mode:(3,6)
wdt reset
load 0x4010f000, len 3460, room 16
tail 4
chksum 0xcc
load 0x3fff20b8, len 40, room 4
tail 4
chksum 0xc9
csum 0xc9
v00042bd0
~ld
as far as i know main problem is in this function:
irmp_init();
i am trying to make a dotmatrix clock based on this project
https://github.com/tehniq3/ESP8266-LED-Matrix-Clock
but i have removed dht22 and replaced a vs838 ir sensor
ds3231 and ldr remains
and this is vs838 wiring
http://j5d2v7d7.stackpathcdn.com/wp-content/uploads/2016/11/VS838-application-circuit.gif
checklist:
** We will start to close issues that do not follow these guidelines as it doesn't help the contributors who spend time trying to solve issues if the community ignores guidelines!**
When setting sleep mode to save power, also enabling pin change interrupt to wake up the device as soon as the IR receiver detects an IR stream, I wish to know which is the best way to resume IRMP from sleep, in order to reduce the IR detection time to the minimum.
In fact, I notice that after the device resumes from a sleep (waken up by the IR receiver), I need to keep the IR button of my remote pressed for some additional fractions of second to allow IRMP to detect the code. I expect this, but wish to reduce this detection time if possible. Should I call some IRMP function?
When putting the device to sleep (ATTINY85 at 16,5 Mhz, IR receiver connected to PB2), I use the following function (called after 0.5 seconds of inactivity time):
void sleep() {
cli(); // Disable interrupts to set the configuration
GIMSK |= _BV(PCIE); // Enable Pin Change Interrupts for all pins
PCMSK |= _BV(PCINT2); // Unmask Pin Change Interrupt for pin PB2
ADCSRA &= ~_BV(ADEN); // ADC off (save power when sleeping)
set_sleep_mode(SLEEP_MODE_PWR_DOWN); // Set sleep to the lowest power mode
sleep_enable(); // Sets the Sleep Enable bit in the MCUCR Register (SE BIT)
sei(); // Enable interrupts before sleeping
sleep_cpu(); // sleep
cli(); // Disable interrupts after resuming from sleep
PCMSK &= ~_BV(PCINT2); // Mask Pin Change Interrupt for pin PB2
GIMSK &= ~_BV(PCIE); // Turn off Pin Change Interrupts for all pins
sleep_disable(); // Clear SE bit
ADCSRA |= _BV(ADEN); // Restore ADC on
sei(); // Enable interrupts again
}
EMPTY_INTERRUPT(PCINT0_vect)
I am trying to utilize IRMP on an attiny85 using Attinycore (SpencerKonde core, no bootloader) and it's built-in Servo functionality.
When I add the following defines and headers to the top of the minimalReceiver sketch:
#define F_CPU 8000000
#define __AVR_ATtiny85__
#include <Servo_ATTinyCore.h>
my compile fails.
Expected that this would build successfully.
I am still reading up and learning about Timers and Interrupts, but I suspect this is related to Attinycore's Servo code to be compatible with Tone() and similar compatibility code built into IRMP.
I get this compile eror:
Tone.cpp.o (symbol from plugin): In function
tone(unsigned char, unsigned long, unsigned long)':
(.text+0x0): multiple definition of __vector_3' libraries/Servo_ATTinyCore/avr/Servo_ATTinyCore.cpp.o (symbol from plugin):(.text+0x0): first defined here collect2: error: ld returned 1 exit status exit status 1 Error compiling for board ATtiny25/45/85 (No bootloader).
Is there a way to "disable" this redefinition of Tone() timer definition in IRMP? I'd love to use IRMP along with Attinycore's Servo lib. Thanks for this great library and its many options (eg, Pin change interrupt option especially and ability to minimize protocol config)
default
SimpleSender with line 56 modified to #include <irmpSelectAllProtocols.h> and 57 commented out
only every 10-20 key press is being detected
I expected every key press to be detected
"P=BANG OLU0xE A=0x0 C=0x80" every 10-20 time I press TV on the remote
If you have handling problems or questions, consider to open a discussion https://github.com/Arduino-IRremote/Arduino-IRremote/discussions instead of an issue.
Please delete all unchecked lines above :-)
VCC=4708mV
START /tmp/arduino_modified_sketch_450254/AllProtocols.ino from Jun 6 2021
Using library version 3.4.1
Ready to receive IR signals of protocols: SIRCS, NEC, SAMSUNG, MATSUSH, KASEIKYO, RECS80, RC5, DENON, RC6, SAMSG32, APPLE, RECS80EX, NUBERT, BANG OLU, GRUNDIG, NOKIA, SIEMENS, FDC, RCCAR, JVC, RC6A, NIKON, IR60, KATHREIN, NETBOX, NEC16, NEC42, THOMSON, BOSE, A1TVBOX, TELEFUNKEN, SPEAKER, LGAIR, SAMSG48, PENTAX, TECHNICS, MITSU_HEAVY, VINCENT, SAMSUNGAH, GREE, METZ, ONKYO, MELINERA, at pin 2
VCC=4708mV
P=NEC A=0x7F80 C=0x12
VCC=4708mV
P=NEC A=0x7F80 C=0x1A
P=NEC A=0x7F80 C=0x1E
P=NEC A=0x7F80 C=0x1E R
VCC=4708mV
VCC=4708mV
VCC=4708mV
the third line indicates a R that is a repeat command on serial monitor as well as on lcd display 16x2 whereas it shouldnt because i just pressed different buttons in a fast manner instead of pressing the same buttons repeatedly
when pressing different buttons in a fast manner it shouldnt print R anywhere (neither serial monitor nor lcd)
checklist:
** We will start to close issues that do not follow these guidelines as it doesn't help the contributors who spend time trying to solve issues if the community ignores guidelines!**
Default
First of all, the bluepill circuit was tested with the "SimpleSender" and "SimpleReceiver" examples and it works.The bluepill can send and receive at least NEC and Samsung I.R. codes. The tests was done with a control remote and others Arduino UNO whith IRMP examples.
About my problem with bluepill and "ReceiveAndSend" example, my results over the Serial Monitor when I upload the sketch is:
START C:\Users\Juan\AppData\Local\Temp\arduino_modified_sketch_999079\ReceiveAndSend.ino from Sep 1 2020
Using library version 3.2.0
Ready to receive IR signals of protocols: SAMSUNG, SAMSG32, at pin PA4
Ready to send IR signals at pin PA5
I can lisen a first "pip" of 2000hz and a continuos tone (7500Hz more or less )over the buzzer and nothing hapens if I send a IR code with a remote.
My fisrt thoth thought was "there is a problem with Tone() / noTone() functions (timers)" and there is a mismatching between the pins just read in the console and the pins defined in the "PinDefinitionsAndMore.h" file .
I have wired like "PinDefinitionsAndMore.h" file says and it woks fine with others examples.
If I comment:
/*
tone(TONE_PIN, 2200);
digitalWrite(LED_BUILTIN, HIGH);
delay(400);
digitalWrite(LED_BUILTIN, LOW);
noTone(TONE_PIN);
*/
Then, now the builtin LED flashs when I use a IR remote (any remote Samsung or NEC) and runs "sendSamsungSmartHubMacro(false);" when the STM32 receives the 0xB54A (only the first time) , I lisen strange tones (like before) and the STM32 freezes.
My conclusions at this point is that the circuit is wired correctly but there is a problem with the software (timers).The circuit woks with easy examples ("SimpleSender" and "SimpleReceiver")but not with a litle more complex.
I chage the code of "ReceiveAndSend", and if I delete the use the Tone() functions and I simply send a code when I receive another then it works.
The code:
#include <Arduino.h>
/*
* Set library modifiers first to set input and output pin etc.
*/
#include "PinDefinitionsAndMore.h"
//#define IR_OUTPUT_IS_ACTIVE_LOW
#define IRMP_PROTOCOL_NAMES 1 // Enable protocol number mapping to protocol strings - requires some FLASH.
#define IRMP_SUPPORT_SAMSUNG_PROTOCOL 1
#define IRSND_SUPPORT_SAMSUNG_PROTOCOL 1
/*
* After setting the definitions we can include the code and compile it.
*/
#define USE_ONE_TIMER_FOR_IRMP_AND_IRSND // otherwise we get an error: redefinition of 'void __vector_8()
#include <irmp.c.h>
#include <irsnd.c.h>
IRMP_DATA irmp_data;
IRMP_DATA irsnd_data;
void sendSamsungSmartHubMacro(bool aDoSelect);
void IRSendWithDelay(uint16_t aCommand, uint16_t aDelayMillis);
void setup()
{
#if defined(MCUSR)
MCUSR = 0; // To reset old boot flags for next boot
#endif
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);
delay(2000); // I need time to open the Serial monitor
#if defined(__AVR_ATmega32U4__)
while (!Serial); //delay for Leonardo, but this loops forever for Maple Serial
#endif
#if defined(SERIAL_USB) || defined(SERIAL_PORT_USBVIRTUAL)
delay(2000); // To be able to connect Serial monitor after reset and before first printout
#endif
#if defined(__ESP8266__)
Serial.println(); // to separate it from the internal boot output
#endif
// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRMP));
/*
// This makes that we can't receive nothing and lisen a 7.5 Khz tone
tone(TONE_PIN, 2200);
digitalWrite(LED_BUILTIN, HIGH);
delay(400);
digitalWrite(LED_BUILTIN, LOW);
noTone(TONE_PIN);
*/
irmp_init();
irmp_irsnd_LEDFeedback(true); // Enable receive signal feedback at LED_BUILTIN for receive and send
irsnd_init();
#if defined(ARDUINO_ARCH_STM32)
Serial.print(F("Ready to receive IR signals of protocols: "));
irmp_print_active_protocols(&Serial);
Serial.println(F("at pin PA4")); // the internal pin numbers are crazy for the STM32 Boards library
Serial.println(F("Ready to send IR signals at pin PA5"));// the internal pin numbers are crazy for the STM32 Boards library
#else
Serial.print(F("Ready to receive IR signals of protocols: "));
irmp_print_active_protocols(&Serial);
Serial.println(F("at pin " STR(IRMP_INPUT_PIN)));
Serial.println(F("Ready to send IR signals at pin " STR(IRSND_OUTPUT_PIN)));
#endif
irsnd_data.protocol = IRMP_SAMSUNG32_PROTOCOL;
irsnd_data.address = 0x0707;
irsnd_data.flags = 1; // repeat frame 1 time
}
void loop()
{
if (irmp_get_data(&irmp_data))
{
irmp_result_print(&irmp_data);
switch (irmp_data.command)
{
case 0xB54A: // The pause key on the bottom of my Samsung remote
Serial.println(F("Pause key detected, open SmartHub"));
IRSendWithDelay(0x9768, 1); // To send anything
break;
default:
break;
}
// Flush repeats received
irmp_get_data(&irmp_data);
}
}
void IRSendWithDelay(uint16_t aCommand, uint16_t aDelayMillis)
{
irsnd_data.command = aCommand;
irsnd_send_data(&irsnd_data, true); // true = wait for frame to end. This stores timer state and restores it after sending
delay(aDelayMillis);
}
Other usefull data:
I use the defaults pins that the file "PinDefinitionsAndMore.h" indicate:
#define IRMP_INPUT_PIN PA6
#define IRSND_OUTPUT_PIN PA7
#define TONE_PIN PA3
I use Windows 10
I use Arduino IDE 1.8.13(Windows Store 1.8.42.0)
I use the library IRMP 3.2.0, installed from Library Manager from the Arduino IDE
I have configured the board "Generic STM32F1 series" -> "BluePill F103C8" installed from the Board Manager with the name "STM32 Cores" by STMicroelectronics 1.9.0
If you has read all of this... :) thanks for you patience, I hope I have explained the problem well.
If you have handling problems or questions, consider to open a discussion https://github.com/ukw100/IRMP/discussions instead of an issue.
Please delete all unchecked lines above :-)
checklist:
** We will start to close issues that do not follow these guidelines as it doesn't help the contributors who spend time trying to solve issues if the community ignores guidelines!**
Hi, I want to use 2 IR leds to send to 2 different devices that are at different locations, I don't understant the example of IRMP_IRSND_ALLOW_DYNAMIC_PINS.
How I can put the 2 leds in 2 pins of arduino?
arm-none-eabi-g++ -o .pio/build/nucleo_l432kc/src/irtranslator.ino.cpp.o -c -std=gnu++14 -fno-threadsafe-statics -fno-rtti -fno-exceptions -fno-use-cxa-atexit -fexceptions -mfpu=fpv4-sp-d16 -mfloat-abi=hard -Os -mcpu=cortex-m4 -mthumb -ffunction-sections -fdata-sections -Wall -nostdlib --param max-inline-insns-single=500 -DPLATFORMIO=40400 -DSTM32L432xx -DSTM32L4xx -DARDUINO=10808 -DARDUINO_ARCH_STM32 -DARDUINO_NUCLEO_L432KC -DBOARD_NAME=\"NUCLEO_L432KC\" -DHAL_UART_MODULE_ENABLED -Isrc -I.pio/libdeps/nucleo_l432kc/IRMP/src -I/home/pat1/git/rmap/arduino/sketchbook/libraries/frtosLog/src -I/home/pat1/git/rmap/arduino/sketchbook/libraries/ArduinoLog -I/home/pat1/git/rmap/arduino/sketchbook/libraries/freertos-cpp/src -I/home/pat1/git/rmap/arduino/sketchbook/libraries/STM32duino_FreeRTOS/src -I/home/pat1/.platformio/packages/framework-arduinoststm32/cores/arduino/avr -I/home/pat1/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32 -I/home/pat1/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/LL -I/home/pat1/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/usb -I/home/pat1/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/OpenAMP -I/home/pat1/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/usb/hid -I/home/pat1/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/usb/cdc -I/home/pat1/.platformio/packages/framework-arduinoststm32/system/Drivers/STM32L4xx_HAL_Driver/Inc -I/home/pat1/.platformio/packages/framework-arduinoststm32/system/Drivers/STM32L4xx_HAL_Driver/Src -I/home/pat1/.platformio/packages/framework-arduinoststm32/system/STM32L4xx -I/home/pat1/.platformio/packages/framework-arduinoststm32/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I/home/pat1/.platformio/packages/framework-arduinoststm32/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src -I/home/pat1/.platformio/packages/framework-arduinoststm32/system/Middlewares/OpenAMP -I/home/pat1/.platformio/packages/framework-arduinoststm32/system/Middlewares/OpenAMP/open-amp/lib/include -I/home/pat1/.platformio/packages/framework-arduinoststm32/system/Middlewares/OpenAMP/libmetal/lib/include -I/home/pat1/.platformio/packages/framework-arduinoststm32/system/Middlewares/OpenAMP/virtual_driver -I/home/pat1/.platformio/packages/framework-cmsis/CMSIS/Core/Include -I/home/pat1/.platformio/packages/framework-arduinoststm32/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include -I/home/pat1/.platformio/packages/framework-arduinoststm32/system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc -I/home/pat1/.platformio/packages/framework-cmsis/CMSIS/DSP/Include -I/home/pat1/.platformio/packages/framework-arduinoststm32/cores/arduino -I/home/pat1/.platformio/packages/framework-arduinoststm32/variants/NUCLEO_L432KC -I/home/pat1/.platformio/packages/framework-arduinoststm32/variants/NUCLEO_L432KC src/irtranslator.ino.cpp
In file included from .pio/libdeps/bluepill_f103c8/IRMP/src/irmpArduinoExt.cpp.h:22,
from .pio/libdeps/bluepill_f103c8/IRMP/src/irmp.c.h:3359,
from /home/pat1/git/rmap/platformio/domotica/freertos_irtranslator/src/irtranslator.ino:36:
.pio/libdeps/bluepill_f103c8/IRMP/src/irmpPinChangeInterrupt.cpp.h: In function 'void initPCIInterrupt()':
.pio/libdeps/bluepill_f103c8/IRMP/src/irmpPinChangeInterrupt.cpp.h:197:5: error: 'EICRA' was not declared in this scope
197 | EICRA |= _BV(ISC10);
| ^~~~~
In file included from /home/pat1/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring.h:34,
from /home/pat1/.platformio/packages/framework-arduinoststm32/cores/arduino/Arduino.h:36,
from /tmp/tmp0h4v60xc:1:
.pio/libdeps/bluepill_f103c8/IRMP/src/irmpPinChangeInterrupt.cpp.h:197:18: error: 'ISC10' was not declared in this scope
197 | EICRA |= _BV(ISC10);
| ^~~~~
/home/pat1/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring_constants.h:99:27: note: in definition of macro '_BV'
99 | #define _BV(bit) (1 << (bit))
| ^~~
In file included from .pio/libdeps/bluepill_f103c8/IRMP/src/irmpArduinoExt.cpp.h:22,
from .pio/libdeps/bluepill_f103c8/IRMP/src/irmp.c.h:3359,
from /home/pat1/git/rmap/platformio/domotica/freertos_irtranslator/src/irtranslator.ino:36:
.pio/libdeps/bluepill_f103c8/IRMP/src/irmpPinChangeInterrupt.cpp.h:199:5: error: 'EIFR' was not declared in this scope
199 | EIFR |= 1 << INTF1;
| ^~~~
.pio/libdeps/bluepill_f103c8/IRMP/src/irmpPinChangeInterrupt.cpp.h:199:18: error: 'INTF1' was not declared in this scope
199 | EIFR |= 1 << INTF1;
| ^~~~~
.pio/libdeps/bluepill_f103c8/IRMP/src/irmpPinChangeInterrupt.cpp.h:201:5: error: 'EIMSK' was not declared in this scope
201 | EIMSK |= 1 << INT1;
| ^~~~~
.pio/libdeps/bluepill_f103c8/IRMP/src/irmpPinChangeInterrupt.cpp.h:201:19: error: 'INT1' was not declared in this scope
201 | EIMSK |= 1 << INT1;
| ^~~~
*** [.pio/build/bluepill_f103c8/src/irtranslator.ino.cpp.o] Error 1
I try to receive and send IR inside freertos.
I need some suggestions to do a good configuration.
I am working on this example:
https://github.com/r-map/rmap/blob/master/platformio/domotica/freertos_irtranslator/src/freertos_irtranslator.ino
I use NEC protocol and some STM32 board with official stm32duino framework and freertos from a C++ wrapper.
I think that the better configuration is having interrupt for receiving and a dedicated timer to transmit; this for a multitasking environment where I have to spend CPU for other work too. The received messages are queued in a freertos queue consumed by sender task. I now use this configuration:
#define IRMP_USE_COMPLETE_CALLBACK 1 // Enable callback functionality
#define IRMP_ENABLE_PIN_CHANGE_INTERRUPT 1 // Enable interrupt functionality
#define USE_ONE_TIMER_FOR_IRMP_AND_IRSND // otherwise we get an error: redefinition of 'void __vector_8()
I am not sure about this configuration especially for USE_ONE_TIMER_FOR_IRMP_AND_IRSND
Do you use a timer in interrupt functionality for IRMP ? If yes I think is better to use two timers for IRMP and IRSND
on STM32 but unsetting USE_ONE_TIMER_FOR_IRMP_AND_IRSND stop the work after the first code received. Witch timer do you use? In documentation I found "For STM32 (BluePill) timer 3 (Servo timer) channel 1 is used as default". But seem to me that for IRSND you use timer 4. But I need to change the default PINS (I need to use SPI) so witch timer will be used ?
Thanks in advance for any suggestions
Paolo
None of the examples successfully compile using the "official" (but outdated) Digistump core. (Various errors due to different compiler versions, missing pin definitions, etc).
When using the ATtinyCore by SpenceKonde with the "Micronucleus/Digispark Pro" board and the "DigiSpark Pro" pin mapping, the functions in digitalWriteFast.h do not use the same pin numbers as the rest of the core.
Documentation should include a reference to the newer and better DigiSpark core at:
https://github.com/ArminJo/DigistumpArduino
It would also be helpful to note the "New Style" pin mapping must be selected when using the ATtinyCore and the "Micronucleus/Digispark Pro" board.
checklist:
** We will start to close issues that do not follow these guidelines as it doesn't help the contributors who spend time trying to solve issues if the community ignores guidelines!**
I use dynamic PINs (GPIO5) with Tasmota configuration.
I use a chinese IR TUYA device flashed with Tasmota and my port of IRMP to Tasmota.
For comparison I have a selfmade module on with ATmega32 and native IRMP (no Arduino). This one detects all protocols correctly.
IRMP is compiled with the following settings:
#define IRMP_PROTOCOL_NAMES 1
#define IRMP_IRSND_ALLOW_DYNAMIC_PINS 1
#define F_INTERRUPTS 20000 // Instead of default 15000 to support LEGO + RCMM protocols
#define USE_ONE_TIMER_FOR_IRMP_AND_IRSND 1
#define tone(a,b) void() // no tone() available on ESP32
#define noTone(a) void()
#define IRMP_SUPPORT_GRUNDIG_PROTOCOL 1
#define IRMP_SUPPORT_MATSUSHITA_PROTOCOL 1
#define IRMP_SUPPORT_NEC_PROTOCOL 1
#define IRMP_SUPPORT_NOKIA_PROTOCOL 1
#define IRMP_SUPPORT_NUBERT_PROTOCOL 1
#define IRMP_SUPPORT_ONKYO_PROTOCOL 1
#define IRMP_SUPPORT_RC5_PROTOCOL 1
#define IRMP_SUPPORT_SIEMENS_PROTOCOL 1
#define IRSND_SUPPORT_GRUNDIG_PROTOCOL 1
#define IRSND_SUPPORT_MATSUSHITA_PROTOCOL 1
#define IRSND_SUPPORT_NEC_PROTOCOL 1
#define IRSND_SUPPORT_NOKIA_PROTOCOL 1
#define IRSND_SUPPORT_NUBERT_PROTOCOL 1
#define IRSND_SUPPORT_ONKYO_PROTOCOL 1
#define IRSND_SUPPORT_RC5_PROTOCOL 1
#define IRSND_SUPPORT_SIEMENS_PROTOCOL 1
Siemens and Nokia protocols are always correctly detected.
No serial output on Tasmota :(
The Siemens protocol is not detected at all.
The Nokia protocol is sometimes detected as SIEMENS.
Hi,
I was trying to make IRMP version 1.2.2 working with Arduino 1.8.12 on Bluepill (STM32 cores v1.8.0), but none of your examples worked, because there is wrong input pin definition for STM32 in all of them:
#elif defined(STM32F1xx) || defined(__STM32F1__)
// BluePill in 2 flavors
// STM32F1xx is for "Generic STM32F1 series" from STM32 Boards from STM32 cores of Arduino Board manager
// __STM32F1__is for "Generic STM32F103C series" from STM32F1 Boards (STM32duino.com) of manual installed hardware folder
#define IRMP_INPUT_PIN 4 // PA4
#define BLINK_13_LED_IS_ACTIVE_LOW // The LED on the BluePill is active LOW
The problem is that PA4 is not pin 4 but 24 (or simply PA4).
You need to change this line:
#define IRMP_INPUT_PIN 4 // PA4
to
#define IRMP_INPUT_PIN PA4 // PA4
or (but whyyy?)
#define IRMP_INPUT_PIN 24 // PA4
Then all examples work as expected.
This most probably apply to IRMP v2.0.0 also, as there is the same definition for example here: https://github.com/ukw100/IRMP/blob/737c49f4e8152a744f137bb6a805f1240d58b5ee/examples/SimpleReceiver/SimpleReceiver.ino#L62
Please fix the examples, I wasted about half an hour trying to find out why it does not work.
#define IRMP_IRSND_ALLOW_DYNAMIC_PINS 1
#define USE_ONE_TIMER_FOR_IRMP_AND_IRSND 1
#define NO_LED_FEEDBACK_CODE
#include <irmp.hpp>
#include <irsnd.hpp>
Compile error
lib/lib_div/IRMP/src/irmpArduinoExt.hpp: In function 'void irmp_init(uint_fast8_t, uint_fast8_t, bool)':
lib/lib_div/IRMP/src/irmpArduinoExt.hpp:35:5: error: 'irmp_irsnd_LedFeedbackPin' was not declared in this scope
irmp_irsnd_LedFeedbackPin = aFeedbackLedPin;
^
lib/lib_div/IRMP/src/irmpArduinoExt.hpp:36:5: error: 'irmp_irsnd_LedFeedbackPinIsActiveLow' was not declared in this scope
irmp_irsnd_LedFeedbackPinIsActiveLow = aIrmpLedFeedbackPinIsActiveLow;
^
lib/lib_div/IRMP/src/irmpArduinoExt.hpp: In function 'void irmp_init(uint_fast8_t, uint_fast8_t)':
lib/lib_div/IRMP/src/irmpArduinoExt.hpp:59:47: error: 'irmp_irsnd_LedFeedbackPinIsActiveLow' was not declared in this scope
irmp_init(aIrmpInputPin, aFeedbackLedPin, irmp_irsnd_LedFeedbackPinIsActiveLow);
checklist:
** We will start to close issues that do not follow these guidelines as it doesn't help the contributors who spend time trying to solve issues if the community ignores guidelines!**
If you have handling problems or questions, consider to open a discussion https://github.com/Arduino-IRremote/Arduino-IRremote/discussions instead of an issue.
Please delete all unchecked lines above :-)
i am unable to decode tatasky remote's IR signal which uses RC6 Protocol using your code.
i found the same codes using IRremote library
Also i cannot decode Panasonic AC's IR code as well as of OGeneral(Fujitsu) AC's
Also while enabling Panasonic codec initially i had trouble because it didnt display a compile time warning in SelectALLProtocols example to disable KASEIKYO protocol .
checklist:
** We will start to close issues that do not follow these guidelines as it doesn't help the contributors who spend time trying to solve issues if the community ignores guidelines!**
proto_rf_medion
is missing from irmp_protocol_names
in 3.3.1 (its the only one, i went through them all as part of writing my app!); so P=59
doesn't get converted to P=RF_MEDION
, here's the one-liner fix - didn't bother with a PR:
simon@greivous:~/IRMP/src$ git diff
diff --git a/src/irmp.c.h b/src/irmp.c.h
index d20c214a..e7a46a99 100644
--- a/src/irmp.c.h
+++ b/src/irmp.c.h
@@ -835,7 +835,8 @@ irmp_protocol_names[IRMP_N_PROTOCOLS + 1] PROGMEM =
proto_onkyo,
proto_rf_gen24,
- proto_rf_x10
+ proto_rf_x10,
+ proto_rf_medion
};
#endif
Hello. Its possible to get some examples with sending RC5 codes with different address?
Have a good day!
I would like to add support for the Benchmark remote control, which doesn't seem to be supported by any of the existing protocol, but I don't know exactly how to do that.
I've used a logic analyzer and measured the following timings:
Do they resemble some known protocol?
If not, would it be possible for you to add support for it?
Perhaps you could create a branch for that, so that I can test it, and then submit a PR.
In my project I noticed some IR leds were not detected well by receivers. I created a test project where I loop over D2
- D12
on my Arduino Nano and send some predefined NEC code on it. On the pins themselves I just attach a logic analyzer to test. In the logic analyzer I use an IR NEC decoder to verify what is sent.
This is the code I use:
...
constexpr IRMP_DATA irData= {IRMP_NEC_PROTOCOL, 0xFF00, 0x7};
void loop() {
for (int pin = 0; pin <= 12; pin++) {
irsnd_init(pin);
irsnd_send_data(&irData, true);
irsnd_data_print(&Serial, &irData);
delay(100);
}
...
I notice that for some pins I get the correct output, for other pins I get invalid output.
The pins that work are: D2
, D4
, D8
and D12
.
For the other pins I get different behavior, for some pins it just detects part of the protocol: the AGC pulse and the long pause, but nothing else. For other pins parts of the code seem to be messed up. For other pins nothing can be decoded.
The behavior seems consistent: for the 'working' pins it always works, for the failing pins it always fails. The IR pulses seem "right enough" to be picked up by a receiver sometimes though.
I've flashed the same code to a second Arduino Nano board to verify and get the same result.
Hi, __AVR_ATmega4809__
target has issue when sending data - timer's CCMP
is incorrectly stored/restored. irsnd_send_data
ends in an infinite loop.
Problem is in following part of code:
https://github.com/ukw100/IRMP/blob/9de71e836921afec918f4cb38c231dba49b18bc8/src/IRTimer.hpp#L314-L318
TCB0.CCMP
is 16-bit long, so sTimerOCR
needs to be of uint16_t
type. storeIRTimer
/ restoreIRTimer
do not correctly store / restore timer state currently. (It might be better to create sTimerCCMP
instead and use it in storeIRTimer
/ restoreIRTimer
- so code is more readable ;) ).
Just note: I do not use it with __AVR_ATmega4809__
, I work with AVR32DB28 and https://github.com/SpenceKonde/DxCore - it would be very nice to have support for it ;). It seems it works with __AVR_ATmega4809__
defines correctly - except issue I mentioned here.
I wrote a python decoder/encoder that supports over 150 protocols. It might be helpful to you with this project. Python is a really easy language to read and understand what is going on it is also fairly simple to port to C.
The best part about this library is it's use of a common class to decode the majority of the protocols. If memory serves there are about 4 or 5 protocols are not handled by this common decoder. I can pretty easily add support to this class for "multi bit" timings but seeing as how there are a small number of them I didn't see the need to.
I figured it would help out quite a bit in adding new protocols to your library.
I am still working on it and fine tuning things. I will also be adding in support for air conditioners as well.
Have a look see and if there are any questions I am able to answer I would be more then willing to help out if I am able to.
https://github.com/kdschlosser/pyIRDecoder
There are a couple of protocols that you have in this library that I would be interested in adding to my library if that would be OK with you. I will probably have a few questions if it is OK that I add them.
3
Interrupt example verbatim
The callback function is never called, but the feedback light blinks proving it's receiving signals.
I expect the callback function to be called.
I've tested 2 remotes, both of which work with the non-interrupt example verbatim.
I'm trying to move my sketch from Arduino nano onto barebone 8A, on pages and in the code it is sometimes mentioned that this should work on 8a. I believe it was but it does not now.
I realised that there are some convention on that, further I've found it is sometime used as AVR_ATmega8A, so I tried to modify sources:
san@lati:~/Pobrane/IRMP-master$ diff --suppress-common-lines -y -r vanilla/ modified
diff --suppress-common-lines -y -r vanilla/src/irsndconfig.h modified/src/irsndconfig.h
# define IRSND_OCx IRSND_OC2B |
> # if defined(__AVR_ATmega8A__)
> # define IRSND_OCx IRSND_OC2
> # else
> # define IRSND_OCx IRSND_OC2B
> # endif
diff --suppress-common-lines -y -r vanilla/src/IRTimer.cpp.h modified/src/IRTimer.cpp.h
# if defined(__AVR_ATmega16__) | # if defined(__AVR_ATmega8A__) || defined(__AVR_ATmega16__)
# if defined(__AVR_ATmega16__) | # if defined(__AVR_ATmega8A__) || defined(__AVR_ATmega16__)
|
# if defined(__AVR_ATmega16__) | # if defined(__AVR_ATmega16__) || defined(__AVR_ATmega8A__)
# if defined(__AVR_ATmega16__) | # if defined(__AVR_ATmega16__) || defined(__AVR_ATmega8A__)
# if defined(__AVR_ATmega16__) | # if defined(__AVR_ATmega16__) || defined(__AVR_ATmega8A__)
but, ofcourse it does not work.
I've tried to debug it somehow by this code:
/*
* Set library modifiers first to set output pin etc.
*/
//#include "PinDefinitionsAndMore.h"
#define __AVR_ATmega8A__
#define IRSND_IR_FREQUENCY 38000
#define IRSND_OUTPUT_PIN 2
#define IRSND_SELECT_PROTOCOLS_H
#define IRSND_SUPPORT_KASEIKYO_PROTOCOL 1 // Kaseikyo >= 10000 ~300 bytes
/*
* After setting the definitions we can include the code and compile it.
*/
#include <irsnd.c.h>
IRMP_DATA pan_power, pan_input, pan_volup, pan_voldown;
const int ledIR = IRSND_OUTPUT_PIN;
void setup() {
pinMode(ledIR, OUTPUT);
irsnd_init();
//define data packs for 4 ir commands
pan_power.protocol = IRMP_KASEIKYO_PROTOCOL;
pan_power.address = 0x2002;
pan_power.command = 0x83D0;
pan_power.flags = 10;
Serial.println("Blink!");
digitalWrite(ledIR, HIGH);
delay(1000);
digitalWrite(ledIR, LOW);
delay(1000);
irsnd_send_data(&pan_power, true);
Serial.println("Blink!");
digitalWrite(ledIR, HIGH);
delay(1000);
digitalWrite(ledIR, LOW);
delay(1000);
}
(i've removed som irrelevant stuff)
ATmega blinks once only, so it has to hang on irsnd_send_data(). I have no idea what to do next. I'm trying to compare ATmega16 and 8a datasheets, but no luck.
UPDATE.
I've found in irsnd.c.h:
#elif defined (__AVR_ATmega8__) // ATmega8 uses only OC2 = PB3
# if IRSND_OCx == IRSND_OC2 // OC2
# define IRSND_PORT_LETTER B
# define IRSND_BIT_NUMBER 3
# else
# error Wrong value for IRSND_OCx, choose IRSND_OC2 in irsndconfig.h
# endif // IRSND_OCx
so i changed IRSND_OUTPUT_PIN to 3, and added other output to signal things on port 2. Still blinks once only.
Originally posted by danthepilotman May 29, 2023
Greetings,
While using Arduino IDE V. 2.1.0 I'm seeing an issue where I get a CPU timer_isr_callback fault when trying to transmit IR using an ESP32 Dev Kit 1 board with ESP32 Board Manager version 2.6 or greater. If I revert the board version to 2.5 it works fine. Code snippet below.
Any help in debugging would be appreciated. Might also call for a bug fix in the next library release version.
Error Message:
timer_group: timer_isr_callback_add(236): register interrupt service failed
I'm trying to use IRMP (using interrupts / callback) in conjunction with code which disables interrupts (NeoPixel). For this, I want to skip the code which disables interrupts if IRMP is currently receiving something.
Is there a way to check if IRMP is currently expecting more data? (I tried some flags like irmp_ir_detected, but they didn't seem to have the expected effect)
Is it possible to send a NEC last command repeat code (0xFFFFFF
) directly?
The irsnd_send_data
API allows the repeat flags to be set, so it's possible to send a command and then have it repeated. But is it also possible to just send a repeat code by itself, without a preceding command?
Hi,
A really great library!
I just noticed that the 2nd UART on Atmega2560 is using the same pins for INT2 and INT3. Would it be possible to use IRQ pins other than the first two?
I have a project in which I have a few outputs: IR LEDs and a 3.5mm wire going directly into the IR receiver of another device.
Controlling devices over the IR LEDs works fine, but to control the device over the wire I need to be able to send NEC pulses without modulation (no carrier frequency) and inverted logic.
From the documentation I understand that the macro IRSND_GENERATE_NO_SEND_RF
can be used to send unmodulated data, but this would impact all the pulses I send.
Is there a dynamic way to switch between sending modulated / unmodulated signals? If not, I would be open to having a look at creating a pull request that adds an API for this if other people are also interested.
in irmpArduinoExt.cpp.h - > irmp_print_protocol_name
if IRMP_PROTOCOL_NAMES == 1
print both name and code example: SIRCS0x01
has to be SIRCS
Bug is in lines:
#endif
aSerial->print(F("0x"));
aSerial->print(aProtocolNumber, HEX);
}
To fix change to:
aSerial->print(F("0x"));
aSerial->print(aProtocolNumber, HEX);
#endif
}
I'm a bit lost comparing schematics to see/know if the IR unit is right for this. Eventually I want to disconnect the attached IR unit, and use the built in (pin 9) IR from the base unit (which is an M5Stack M5StickC using esp32 core). RX seems okay. Serial monitor implies IR was sent, but device does not respond (OEM remote is fine).
I have two sets, one running IRMP, the second base/unit pair is counting pulses each second.
The second unit reads 34/34 high/low with a single OEM remote button press (stats refresh/clear each second). Zero activity while aiming retransmit from unit one (code below) to unit two (code MIA kinda).
Willing to test on breadboard with a leaner esp32 dev board connected to IR unit above.
33 RX, 9 or 32 TX, 10 red LED.
START foo/m5-ReceiveAndSend-retry3wip.ino from Dec 29 2020 07:14:08 Using library version 3.3.4 Ready to receive IR signals of protocols: SIRCS, NEC, SAMSUNG, MATSUSH, KASEIKYO, RECS80, RC5, DENON, RC6, SAMSG32, APPLE, RECS80EX, NUBERT, BANG OLU, GRUNDIG, NOKIA, SIEMENS, FDC, RCCAR, JVC, RC6A, NIKON, IR60, KATHREIN, NETBOX, NEC16, NEC42, THOMSON, BOSE, A1TVBOX, TELEFUNKEN, SPEAKER, LGAIR, SAMSG48, MERLIN, PENTAX, TECHNICS, MITSU_HEAVY, VINCENT, SAMSUNGAH, GREE, METZ, ONKYO, at pin 33 Ready to send IR signals at pin 9 setup() done. P=NEC A=0x7F80 C=0x12 key detected, 0x00000012
I have a secondary pair (m5+IR unit) counting IR pulses per minute, with 34 high and 34 low states seen with the same remote button press.
Yes I use the latest release and verified this!
Other - please specify
"version": "3.3.4",
Trying to abuse this call to irsnd_send_data with the object irmp_get_data used to retransmit (button click on m5/esp32).
#elif defined(ESP32) #define IRMP_INPUT_PIN 33 #define IRSND_OUTPUT_PIN 9 // 32 #define FEEDBACK_LED_IS_ACTIVE_LOW #define ALTERNATIVE_IRMP_FEEDBACK_LED_PIN 10; #define tone(a,b) void() // no tone() available on ESP32 #define noTone(a) void() #define TONE_PIN 42 // Dummy for examples using it
#include <M5StickC.h> #include <Arduino.h> /* Set library modifiers first to set input and output pin etc. */ #include "PinDefinitionsAndMore.h" #include <irmpSelectAllProtocols.h> // This enables all possible protocols #define IRSND_IR_FREQUENCY 38000 #define IRMP_PROTOCOL_NAMES 1 // Enable protocol number mapping to protocol strings - requires some FLASH. #define IRSND_PROTOCOL_NAMES 1 // Enable protocol number mapping to protocol strings - requires some FLASH. #define IRMP_SUPPORT_SAMSUNG_PROTOCOL 1 #define IRSND_SUPPORT_SAMSUNG_PROTOCOL 0 /* After setting the definitions we can include the code and compile it. */ #define USE_ONE_TIMER_FOR_IRMP_AND_IRSND // otherwise we get an error on AVR platform: redefinition of 'void __vector_8() #include #include IRMP_DATA irmp_data; IRMP_DATA irsnd_data; void sendSamsungSmartHubMacro(bool aDoSelect); void IRSendWithDelay(uint16_t aCommand, uint16_t aDelayMillis); void IRre_xmit(); void setup() { #if defined(MCUSR) MCUSR = 0; // To reset old boot flags for next boot #endif Serial.begin(115200); delay(2000); M5.begin(); Serial.println("START " __FILE__ " from " __DATE__ " " __TIME__ " Using library version " VERSION_IRMP); irmp_init(); irmp_irsnd_LEDFeedback(true); // Enable receive signal feedback at LED_BUILTIN for receive and send irsnd_init(); Serial.print(F("Ready to receive IR signals of protocols: ")); irmp_print_active_protocols(&Serial); Serial.println(F("at pin " STR(IRMP_INPUT_PIN))); Serial.println(F("Ready to send IR signals at pin " STR(IRSND_OUTPUT_PIN))); Serial.println("setup() done."); } void loop() { yield(); if (irmp_get_data(&irmp_data)) { irmp_result_print(&irmp_data); Serial.printf("key detected, 0x%08X", irmp_data.command); Serial.println(); // Flush repeats received while (irmp_get_data(&irmp_data)) yield(); } delay(20); if (M5.BtnA.wasPressed()) { // aka after button A is released. yield(); IRre_xmit(); /* Serial.printf("Sending 0x%08X",irmp_data.command); Serial.println(); irsnd_data.protocol = irmp_data.protocol; irsnd_data.address = irmp_data.address; irsnd_data.command = irmp_data.command; irsnd_data.flags = irmp_data.flags; IRSendWithDelay(irsnd_data.command, 0); */ Serial.println("Sent."); } if (M5.BtnB.wasPressed()) { yield(); irmp_data.command = int(random(0x100)); // Serial.printf("Sending 0x%08X",irmp_data.command); Serial.println(); irsnd_data.protocol = irmp_data.protocol; irsnd_data.address = irmp_data.address; irsnd_data.command = irmp_data.command; irsnd_data.flags = irmp_data.flags; IRSendWithDelay(irsnd_data.command, 0); // Serial.println("Sent."); } M5.update(); } void IRre_xmit() { irsnd_send_data(&irmp_data, true); // true = wait for frame to end. This stores timer state and restores it after sending irsnd_data_print(&Serial, &irmp_data); } void IRSendWithDelay(uint16_t aCommand, uint16_t aDelayMillis) { irsnd_data.command = aCommand; // For my Samsung, the high byte is the inverse of the low byte, this is not checked here. irsnd_send_data(&irsnd_data, true); // true = wait for frame to end. This stores timer state and restores it after sending irsnd_data_print(&Serial, &irsnd_data); delay(aDelayMillis); }
Yesterday I installed this promising project using the library manager in the arduino IDE 1.18.12.
I attached an IR detector and an I2C display to an arduino nano as shown in your pictures.
I tested the LCD with a hello world sketch and it worked at the default address 0x27.
I tried the simpleReceiver and this also worked well with a NEC remote. But I want to build a standalone IR remote detector.
So I compiled the AllProtocols example with the USE_SERIAL_LCD define and get the errors below.
In file included from D:\Peter\Development\Arduino\libraries\IRMP\src/irmp.c.h:26:0,
from D:\Peter\Development\Arduino\AllProtocols\AllProtocols.ino:54:
D:\Peter\Development\Arduino\libraries\IRMP\src/irmp.h:131:4: warning: #warning MERLIN protocol disabled, IRMP_32_BIT=1 needed [-Wcpp]
# warning MERLIN protocol disabled, IRMP_32_BIT=1 needed
^~~~~~~
D:\Peter\Development\Arduino\libraries\IRMP\src/irmp.h:243:4: warning: #warning F_INTERRUPTS too low, LEGO protocol disabled (should be at least 20000) [-Wcpp]
# warning F_INTERRUPTS too low, LEGO protocol disabled (should be at least 20000)
^~~~~~~
D:\Peter\Development\Arduino\libraries\IRMP\src/irmp.h:279:4: warning: #warning F_INTERRUPTS too low, RCMM protocol disabled (should be at least 20000) [-Wcpp]
# warning F_INTERRUPTS too low, RCMM protocol disabled (should be at least 20000)
^~~~~~~
AllProtocols:63:32: error: 'LCD_COLUMNS' was not declared in this scope
LiquidCrystal_I2C myLCD( 0x27, LCD_COLUMNS, LCD_ROWS ) ; // set the LCD address to 0x27 for a 20 chars and 2 line display
^~~~~~~~~~~
D:\Peter\Development\Arduino\AllProtocols\AllProtocols.ino:63:32: note: suggested alternative: 'LCD_2LINE'
LiquidCrystal_I2C myLCD( 0x27, LCD_COLUMNS, LCD_ROWS ) ; // set the LCD address to 0x27 for a 20 chars and 2 line display
^~~~~~~~~~~
LCD_2LINE
AllProtocols:63:45: error: 'LCD_ROWS' was not declared in this scope
LiquidCrystal_I2C myLCD( 0x27, LCD_COLUMNS, LCD_ROWS ) ; // set the LCD address to 0x27 for a 20 chars and 2 line display
^~~~~~~~
D:\Peter\Development\Arduino\AllProtocols\AllProtocols.ino: In function 'void setup()':
AllProtocols:106:11: error: 'class LiquidCrystal_I2C' has no member named 'init'
myLCD.init() ;
![i2c](https://user-images.githubusercontent.com/10762929/87241092-f1eb9580-c41f-11ea-8e18-b13d43cc50ca.jpg)
Arduino Nano 33 BLE
/*
* SimpleSender.cpp
*
* Sends Samsung protocol frames.
* Is able to send IR protocol data of 15 main protocols.
*
* Sony SIRCS
* NEC + APPLE
* Samsung + Samsg32
* Kaseikyo
*
* Plus 11 other main protocols
* JVC, NEC16, NEC42, Matsushita, DENON, Sharp, RC5, RC6 & RC6A, IR60 (SDA2008) Grundig, Siemens Gigaset, Nokia
*
* To disable one of them or to enable other protocols, specify this before the "#include <irmp.c.h>" line.
* If you get warnings of redefining symbols, just ignore them or undefine them first (see Interrupt example).
* The exact names can be found in the library file irmpSelectAllProtocols.h (see Callback example).
*
* Copyright (C) 2019-2020 Armin Joachimsmeyer
* [email protected]
*
* This file is part of IRMP https://github.com/ukw100/IRMP.
*
* IRMP 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 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
*
*/
#include <Arduino.h>
/*
* Set library modifiers first to set output pin etc.
*/
#include "PinDefinitionsAndMore.h"
//#define IR_OUTPUT_IS_ACTIVE_LOW
#include <irsndSelectMain15Protocols.h>
/*
* After setting the definitions we can include the code and compile it.
*/
#include <irsnd.c.h>
IRMP_DATA irsnd_data;
void setup()
{
Serial.begin(115200);
#if defined(__AVR_ATmega32U4__)
while (!Serial); //delay for Leonardo, but this loops forever for Maple Serial
#endif
#if defined(SERIAL_USB) || defined(SERIAL_PORT_USBVIRTUAL)
delay(2000); // To be able to connect Serial monitor after reset and before first printout
#endif
#if defined(ESP8266)
Serial.println(); // to separate it from the internal boot output
#endif
// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRMP));
irsnd_init();
irmp_irsnd_LEDFeedback(true); // Enable send signal feedback at LED_BUILTIN
#if defined(ARDUINO_ARCH_STM32)
Serial.println(F("Ready to send IR signals at pin " IRSND_OUTPUT_PIN_STRING)); // the internal pin numbers are crazy for the STM32 Boards library
#else
Serial.println(F("Ready to send IR signals at pin " STR(IRSND_OUTPUT_PIN)));
#endif
irsnd_data.protocol = IRSND_SUPPORT_NEC_PROTOCOL;
irsnd_data.address = 0xA002;
irsnd_data.command = 0x80;
irsnd_data.flags = 0; // repeat frame 0 time
Serial.print(F("Send 0x"));
Serial.println(irsnd_data.command, HEX);
irsnd_send_data(&irsnd_data, false);
}
void loop()
{
delay(5000);
uint8_t tNextCommand = irsnd_data.command;
//tNextCommand++;
// For my Samsung the high byte is the negative of the low byte
irsnd_data.command = tNextCommand;
//irsnd_data.command = ((~tNextCommand) << 8) | tNextCommand;
Serial.print(F("Send 0x"));
Serial.println(irsnd_data.command, HEX);
irsnd_send_data(&irsnd_data, false); // This stores timer state and restores it after sending
}
#POWER
P=NEC A=0xA002 C=0x80
If I am not mistaken, this example with slight changes should send the "POWER" command every five seconds.
Toogle power of my device every five seconds.
Everything seems fine. The buildin LED flashed every five seconds and the serial output is fine, too.
START /Users/tom/workspaces/Arduino/SimpleSender/SimpleSender.ino from Sep 29 2020
Using library version 3.3.1
Ready to send IR signals at pin 4
Send 0x80
Send 0x80
I want to replace my LIRC raspberry pi with my arduino therefore I know my layout works and the components are ok, since it works if I plug them into my raspberry.
Reading my original remote with IRMP did work without any issue.
I did measure the voltage at the IR led and there are peaks every five seconds. Therefore I don't think I am using use the wrong pins.
Maybe there is an issue with the different voltage, since the raspberry does output 5V and the arduino only 3,3V?
I am not using the exact same components as in the documentation, if this is relevant, I can search for the exact specs.
And I did test this with another device and protocol (RC5) but no luck either.
22 (tried also 2 and 3)
START src/main.cpp from Oct 7 2020
Using library version 3.3.2
Ready to receive IR signals of protocols: SIRCS, NEC, SAMSUNG, MATSUSH, KASEIKYO, RC5, DENON, RC6, SAMSG32, APPLE, GRUNDIG, NOKIA, SIEMENS, JVC, RC6A, IR60, NEC16, NEC42, ONKYO, at pin 22
No IR code is detected.
Should detect IR codes.
No error.
Using Teensy 4.0 (Cortex-M7)
IR Receive pin 19 (Using TSOP7000)
IR Send pin 16 (IR led 940nm I know that the IR LED is working, since I use some other code now for sending to the B&O, but would like to port to IRMP)
The receive is working without any issues, but I can't get the send to work. If I look at the output with my Logic analyser the frequency is wrong it's about 117KHz
This is just a send test,
If button A is clicked, send something
If button A is clicked, send something else
No errors are outputed
/*
Sony SIRCS
NEC + APPLE
Samsung + Samsg32
Kaseikyo
Plus 11 other main protocols
JVC, NEC16, NEC42, Matsushita, DENON, Sharp, RC5, RC6 & RC6A, IR60 (SDA2008) Grundig, Siemens Gigaset, Nokia
*/
#include <Arduino.h>
/*
#include <irsndSelectMain15Protocols.h>
/*
//#define STM32F1xx
//#define STM32L4xx
#define IRSND_OUTPUT_PIN 3
IRMP_DATA irsnd_data;
void setup()
{
Serial.begin(115200);
#if defined(AVR_ATmega32U4)
while (!Serial); //delay for Leonardo, but this loops forever for Maple Serial
#endif
#if defined(SERIAL_USB) || defined(SERIAL_PORT_USBVIRTUAL)
delay(2000); // To be able to connect Serial monitor after reset and before first printout
#endif
#if defined(ESP8266)
Serial.println(); // to separate it from the internal boot output
#endif
// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRMP));
irsnd_init();
irmp_irsnd_LEDFeedback(true); // Enable send signal feedback at LED_BUILTIN
#if defined(STM32F1xx)
Serial.println(F("Ready to send IR signals at pin PA5")); // the internal pin numbers are crazy for the STM32 Boards library
#else
Serial.println(F("Ready to send IR signals at pin " STR(IRSND_OUTPUT_PIN)));
#endif
irsnd_data.protocol = IRMP_SAMSUNG32_PROTOCOL;
irsnd_data.address = 0x0707;
irsnd_data.command = 0xFB04;
irsnd_data.flags = 0; // repeat frame 0 time
Serial.print(F("Send 0x"));
Serial.println(irsnd_data.command, HEX);
irsnd_send_data(&irsnd_data, false);
}
void loop()
{
delay(5000);
uint8_t tNextCommand = irsnd_data.command;
tNextCommand++;
// For my Samsung the high byte is the negative of the low byte
irsnd_data.command = ((~tNextCommand) << 8) | tNextCommand;
// #if defined(STM32F1xx)
// Serial.println(F("Ready to send IR signals at pin PA5")); // the internal pin numbers are crazy for the STM32 Boards library
//#else
Serial.println(F("Ready to send IR signals at pin " STR(IRSND_OUTPUT_PIN)));
//#endif
Serial.print(F("Send 0x"));
Serial.println(irsnd_data.command, HEX);
irsnd_send_data(&irsnd_data, false); // This stores timer state and restores it after sending
}
I am expecting IR LED to blink when seen from the camera but it was not blinking.
I am expecting that the connecter IR LED should blink when IR code is being emitted.
Hello,
I would like to inquire, is it possible to use this library on an Arduino DUE board?
The Arduino IDE compiler say, it's not compatible with "sam" boards.
Thank you very much for their help!
hi all
i have bluepill and tested many pins of this board all pins work in interrupt mode but could not find any pin that work in non interrupt mode
is that possible to work in non interrupt mode? if possible which pins?
hi
i have a stm32 board based on stm32f103ret6
my arduino core is https://github.com/stm32duino/Arduino_Core_STM32
i tested SimpleReceiver.ino
but i have some problems
i have connected ir sensor output to pin A0
#define IRMP_INPUT_PIN PA0
but serial concole says me 12:21:13.816 -> Ready to receive IR signals at pin 35
i pressed some keys on nec and also rc5 remote but can not see anything in serial console
also tried #define IRMP_INPUT_PIN A0
and also
#define IRMP_PORT_LETTER A
#define IRMP_BIT_NUMBER 0
but no success please help
Compiling the SimpleReceiver example yields the following error message:
n file included from D:\Documents\Arduino\libraries\IRMP\src/irmpArduinoExt.cpp.h:18:0,
from D:\Documents\Arduino\libraries\IRMP\src/irmp.c.h:3143,
from D:\Programming\Projects\Arduino\receive-ir\receive-ir.ino:65:
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h: In function 'void initIRTimerForReceive()':
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:182:5: error: 'TCCR2A' was not declared in this scope
TCCR2A = _BV(WGM21); // CTC mode
^~~~~~
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:182:5: note: suggested alternative: 'TCCR0A'
TCCR2A = _BV(WGM21); // CTC mode
^~~~~~
TCCR0A
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from D:\Programming\Projects\Arduino\receive-ir\receive-ir.ino:47:
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:182:18: error: 'WGM21' was not declared in this scope
TCCR2A = _BV(WGM21); // CTC mode
^
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:182:18: note: suggested alternative: 'WGM41'
In file included from D:\Documents\Arduino\libraries\IRMP\src/irmpArduinoExt.cpp.h:18:0,
from D:\Documents\Arduino\libraries\IRMP\src/irmp.c.h:3143,
from D:\Programming\Projects\Arduino\receive-ir\receive-ir.ino:65:
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:187:5: error: 'TCCR2B' was not declared in this scope
TCCR2B = _BV(CS21); // prescale by 8
^~~~~~
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:187:5: note: suggested alternative: 'TCCR0B'
TCCR2B = _BV(CS21); // prescale by 8
^~~~~~
TCCR0B
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from D:\Programming\Projects\Arduino\receive-ir\receive-ir.ino:47:
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:187:18: error: 'CS21' was not declared in this scope
TCCR2B = _BV(CS21); // prescale by 8
^
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:187:18: note: suggested alternative: 'CS01'
In file included from D:\Documents\Arduino\libraries\IRMP\src/irmpArduinoExt.cpp.h:18:0,
from D:\Documents\Arduino\libraries\IRMP\src/irmp.c.h:3143,
from D:\Programming\Projects\Arduino\receive-ir\receive-ir.ino:65:
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:188:5: error: 'OCR2B' was not declared in this scope
OCR2B = OCR2A = ((F_CPU / 8) / IR_INTERRUPT_FREQUENCY) - 1; // 132 for 15000 interrupts per second
^~~~~
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:188:5: note: suggested alternative: 'OCR4B'
OCR2B = OCR2A = ((F_CPU / 8) / IR_INTERRUPT_FREQUENCY) - 1; // 132 for 15000 interrupts per second
^~~~~
OCR4B
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:188:13: error: 'OCR2A' was not declared in this scope
OCR2B = OCR2A = ((F_CPU / 8) / IR_INTERRUPT_FREQUENCY) - 1; // 132 for 15000 interrupts per second
^~~~~
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:188:13: note: suggested alternative: 'OCR3A'
OCR2B = OCR2A = ((F_CPU / 8) / IR_INTERRUPT_FREQUENCY) - 1; // 132 for 15000 interrupts per second
^~~~~
OCR3A
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:190:5: error: 'TIFR2' was not declared in this scope
TIFR2 = _BV(OCF2B) | _BV(OCF2A) | _BV(TOV2); // reset interrupt flags
^~~~~
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:190:5: note: suggested alternative: 'TIFR4'
TIFR2 = _BV(OCF2B) | _BV(OCF2A) | _BV(TOV2); // reset interrupt flags
^~~~~
TIFR4
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from D:\Programming\Projects\Arduino\receive-ir\receive-ir.ino:47:
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:190:17: error: 'OCF2B' was not declared in this scope
TIFR2 = _BV(OCF2B) | _BV(OCF2A) | _BV(TOV2); // reset interrupt flags
^
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:190:17: note: suggested alternative: 'OCF0B'
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:190:30: error: 'OCF2A' was not declared in this scope
TIFR2 = _BV(OCF2B) | _BV(OCF2A) | _BV(TOV2); // reset interrupt flags
^
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:190:30: note: suggested alternative: 'OCF1A'
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:190:43: error: 'TOV2' was not declared in this scope
TIFR2 = _BV(OCF2B) | _BV(OCF2A) | _BV(TOV2); // reset interrupt flags
^
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:190:43: note: suggested alternative: 'TOV0'
In file included from D:\Documents\Arduino\libraries\IRMP\src/irmpArduinoExt.cpp.h:18:0,
from D:\Documents\Arduino\libraries\IRMP\src/irmp.c.h:3143,
from D:\Programming\Projects\Arduino\receive-ir\receive-ir.ino:65:
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:191:5: error: 'TIMSK2' was not declared in this scope
TIMSK2 = _BV(OCIE2B); // enable TIMER2_COMPB_vect interrupt to be compatible with tone() library
^~~~~~
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:191:5: note: suggested alternative: 'TIMSK0'
TIMSK2 = _BV(OCIE2B); // enable TIMER2_COMPB_vect interrupt to be compatible with tone() library
^~~~~~
TIMSK0
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from D:\Programming\Projects\Arduino\receive-ir\receive-ir.ino:47:
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:191:18: error: 'OCIE2B' was not declared in this scope
TIMSK2 = _BV(OCIE2B); // enable TIMER2_COMPB_vect interrupt to be compatible with tone() library
^
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:191:18: note: suggested alternative: 'OCIE0B'
In file included from D:\Documents\Arduino\libraries\IRMP\src/irmpArduinoExt.cpp.h:18:0,
from D:\Documents\Arduino\libraries\IRMP\src/irmp.c.h:3143,
from D:\Programming\Projects\Arduino\receive-ir\receive-ir.ino:65:
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:192:5: error: 'TCNT2' was not declared in this scope
TCNT2 = 0;
^~~~~
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:192:5: note: suggested alternative: 'TCNT0'
TCNT2 = 0;
^~~~~
TCNT0
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h: In function 'void disableIRTimerInterrupt()':
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:473:5: error: 'TIMSK2' was not declared in this scope
TIMSK2 = 0; // disable interrupt
^~~~~~
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:473:5: note: suggested alternative: 'TIMSK0'
TIMSK2 = 0; // disable interrupt
^~~~~~
TIMSK0
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h: In function 'void enableIRTimerInterrupt()':
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:529:5: error: 'TIMSK2' was not declared in this scope
TIMSK2 = _BV(OCIE2B); // enable interrupt
^~~~~~
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:529:5: note: suggested alternative: 'TIMSK0'
TIMSK2 = _BV(OCIE2B); // enable interrupt
^~~~~~
TIMSK0
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from D:\Programming\Projects\Arduino\receive-ir\receive-ir.ino:47:
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:529:18: error: 'OCIE2B' was not declared in this scope
TIMSK2 = _BV(OCIE2B); // enable interrupt
^
D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:529:18: note: suggested alternative: 'OCIE0B'
exit status 1
Error compiling for board Arduino Leonardo.
I did a bit a googling and appearently the following patch fixed a similar problem for the TTS library: jscrane/TTS@d84cbd2
Code is the AllProtocols example with no changes made to it
In file included from D:\Documents\Arduino\libraries\IRMP\src/irmp.h:31,
from D:\Documents\Arduino\libraries\IRMP\src/irmp.c.h:26,
from C:\Users\Gabe\AppData\Local\Temp\arduino_modified_sketch_266082\AllProtocols.ino:88:
D:\Documents\Arduino\libraries\IRMP\src/irmpArduinoExt.h:84: warning: "F" redefined
#define F(a) a
In file included from C:\Users\Gabe\AppData\Local\Arduino15\packages\SparkFun\hardware\apollo3\2.0.3/cores/arduino/mbed-bridge/core-api/api/Print.h:24,
from C:\Users\Gabe\AppData\Local\Arduino15\packages\SparkFun\hardware\apollo3\2.0.3/cores/arduino/mbed-bridge/core-api/api/Stream.h:25,
from C:\Users\Gabe\AppData\Local\Arduino15\packages\SparkFun\hardware\apollo3\2.0.3/cores/arduino/mbed-bridge/core-api/api/Client.h:22,
from C:\Users\Gabe\AppData\Local\Arduino15\packages\SparkFun\hardware\apollo3\2.0.3/cores/arduino/mbed-bridge/core-api/api/ArduinoAPI.h:29,
from C:\Users\Gabe\AppData\Local\Arduino15\packages\SparkFun\hardware\apollo3\2.0.3/cores/arduino/mbed-bridge/Arduino.h:14,
from C:\Users\Gabe\AppData\Local\Arduino15\packages\SparkFun\hardware\apollo3\2.0.3/cores/arduino/sdk/ArduinoSDK.h:9,
from <command-line>:
C:\Users\Gabe\AppData\Local\Arduino15\packages\SparkFun\hardware\apollo3\2.0.3/cores/arduino/mbed-bridge/core-api/api/String.h:45: note: this is the location of the previous definition
#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))
c:/users/gabe/appdata/local/arduino15/packages/sparkfun/tools/arm-none-eabi-gcc/8-2018-q4-major/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Gabe\AppData\Local\Arduino15\packages\SparkFun\hardware\apollo3\2.0.3\variants\SFE_ARTEMIS_ATP/mbed/libmbed-os.a(isr.o): in function `am_ctimer_isr':
/github/workspace/mbed-builds/artemis-redboard-atp-lib_1/mbed-os/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device/isr.c:6: multiple definition of `am_ctimer_isr'; sketch\AllProtocols.ino.cpp.o:D:\Documents\Arduino\libraries\IRMP\src/IRTimer.cpp.h:657: first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board RedBoard Artemis ATP.
Code Compiles correctly.
It seems that Sparkfun added their own functions that implement the interrupts and F(a)
substitution.
I tested commenting out the function definitions of am_ctimer_isr(void)
and F(a)
in this library and found that the Arduino IDE properly compiles the AllProtocols
example when the configured board is the Sparkfun Artemis Redboard ATP. I will plan to verify that the library works properly with the code commented out, and will submit a PR if I find that it does.
Missing "pinMode(LED_BUILTIN,OUTPUT);" in setup()
LED is ON when idle, OFF when I press a remote's button
should be vice versa, as FEEDBACK_LED_IS_ACTIVE_LOW was given
I've noticed in IRFeedbackLED.hpp:
# if defined(__AVR__) // As far as I know, there is no active-low built in LED for AVR platform boards
digitalWriteFast(IRMP_FEEDBACK_LED_PIN, aSwitchLedOn);
# else
My diy board has active-low built in LED :-( Any objections to implement
# if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
digitalWriteFast(IRMP_FEEDBACK_LED_PIN, !aSwitchLedOn);
# else
digitalWriteFast(IRMP_FEEDBACK_LED_PIN, aSwitchLedOn);
# endif
?
checklist:
Thank you!
In order to avoid the 'Serial' was not declared in this scope
error when uploading to ATTiny microcontroller via programmer (I use "Arduino as ISP"), I added the following code:
#ifdef ARDUINO_attiny
class Fake_serial {
public:
void print(void *, int){};
void print(const void*){};
void print(void *){};
void println(){};
};
Fake_serial Serial;
#endif
Is there a better way to fix this issue?
ATtiny85 Digispark board
Arduino Nano as ISP
Arduino IDE
IRMP 3.4.1
File > Preferences > Additional Board manager IRLs: https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json
Tools > Board: ATTiny25/45/85
Tools > Processor > ATTiny85
Tools > Clock (I use "Internal 8 MHz" after setting lfuse to E2 with avrdude -Cavrdude.conf -v -pattiny85 -cstk500v1 -P... -b19200 -U lfuse:w:0xE2:m
)
Tools > Port (use the one connected to the Arduino Nano used as ISP)
Tools > Programmer: "Arduino as ISP"
#define IRMP_INPUT_PIN 2
#include <irmp.c.h>
IRMP_DATA irmp_data[1];
void setup() {
irmp_init();
}
void loop() {
if (irmp_get_data( & irmp_data[0])) {
digitalWrite(1, HIGH);
delay(100);
digitalWrite(1, LOW);
}
}
In file included from /home/test/arduino/current/Arduino/libraries/IRMP/src/irmp.c.h:3035:0,
from /home/test/arduino/current/Arduino/irmp_test/irmp_test.ino:2:
/home/test/arduino/current/Arduino/libraries/IRMP/src/irmpArduinoExt.cpp.h: In function 'void irmp_result_print(IRMP_DATA*)':
/home/test/arduino/current/Arduino/libraries/IRMP/src/irmpArduinoExt.cpp.h:582:5: error: 'Serial' was not declared in this scope
Serial.print(F("P="));
^~~~~~
/home/test/arduino/current/Arduino/libraries/IRMP/src/irmpArduinoExt.cpp.h:582:5: note: suggested alternative: 'Stream'
Serial.print(F("P="));
^~~~~~
Stream
exit status 1
Error compiling for board ATtiny25/45/85
#ifdef ARDUINO_attiny
class Fake_serial {
public:
void print(void *, int){};
void print(const void*){};
void print(void *){};
void println(){};
};
Fake_serial Serial;
#endif
#define IRMP_INPUT_PIN 2
#include <irmp.c.h>
IRMP_DATA irmp_data[1];
void setup() {
irmp_init();
}
void loop() {
if (irmp_get_data( & irmp_data[0])) {
digitalWrite(1, HIGH);
delay(100);
digitalWrite(1, LOW);
}
}
Edit IRMP/src/irmpArduinoExt.cpp.h and add
void irmp_result_print(IRMP_DATA *aIRMPDataPtr)
{
#ifndef IRMP_NO_RESULT_PRINT
...(original code in the function)...
#endif
}
#define IRMP_NO_RESULT_PRINT
#define IRMP_INPUT_PIN 2
#include <irmp.c.h>
IRMP_DATA irmp_data[1];
void setup() {
irmp_init();
}
void loop() {
if (irmp_get_data( & irmp_data[0])) {
digitalWrite(1, HIGH);
delay(100);
digitalWrite(1, LOW);
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.