Giter Site home page Giter Site logo

irmp's Introduction

IRMP - Infrared Multi Protocol Decoder + Encoder

A library enabling the sending & receiving of infra-red signals with a low memory footprint.
Supports 50 different protocols.

Badge License: GPLv3     Badge Version     Badge Commits since latest     Badge Build Status     Badge Hit Counter

Stand With Ukraine

Available as Arduino library "IRMP".

Button Install     Button Changelog

If you find this library useful, please give it a star.

🌎 Google Translate


Features

  • Total of 50 IR protocols supported.
  • Up to 39 protocols can be enabled for receive at the same time, because some of the 50 protocols are quite similar and conflicts with each other.
  • 39 protocols are available for send.
  • Low memory footprint. FLASH usage in bytes: 1500 for one protocol, 4300 for 15 main and 8000 for all 39 protocols.
  • RAM usage in bytes: 52, 73 and 100.

Nano running AllProtocol example YouTube Video Instructable
Nano running AllProtocol example YouTube Video Instructable

List of protocols

Sony SIRCS     NEC + APPLE + ONKYO     Samsung + Samsg32     Kaseikyo

JVC     NEC16 + NEC42     Matsushita     DENON     Sharp     RC5     RC6 & RC6A     IR60 (SDA2008) Grundig     Siemens Gigaset     Nokia

BOSE     Kathrein     NUBERT     FAN (ventilator)     SPEAKER (~NUBERT)     Bang & Olufsen     RECS80 (SAA3004)
    RECS80EXT (SAA3008)     Thomson     NIKON camera     Netbox keyboard     ORTEK (Hama)     Telefunken 1560
    FDC3402 keyboard     RC Car     iRobot Roomba     RUWIDO     T-Home     A1 TV BOX    LEGO Power RC
    RCMM 12,24, or 32     LG Air Condition     Samsung48     Merlin     Pentax     S100     ACP24     TECHNICS
    PANASONIC Beamer     Mitsubishi Aircond     VINCENT     SAMSUNG AH     GREE CLIMATE     RCII T+A
    RADIO e.g. TEVION     METZ

NEC     Kaseiko     Denon     RC6     Samsung + Samsg32   were successfully tested in interrupt mode, but there are many protocols which in principle cannot be decoded in this mode.


Features

  • You may use every pin for input or output.
  • Interrupt mode for major protocols.
  • Callback after successful receive of a command.
  • Support for inverted feedback LED (for send and receive feedback).
  • Support for inverted IR output for LED connected to VCC.
  • Unmodulated IR signal output enables direct replacment of an IR receiver circuit.
  • Compatible with Arduino tone library.
  • Send can also also wait for trailing space/gap.

Restrictions

  • Send IR frequency is fixed at 38 kHz.

Minimal version

For applications only requiring NEC protocol, there is a receiver which has very small codesize of 500 bytes and does NOT require any timer. See the MinimalReceiver and IRDispatcherDemo example how to use it. Mapping of pins to interrupts can be found here.

Schematic for Arduino Uno

The VS1838B is used as receiver for all examples and tests. This module has a 120 µs on/low and a 100 µs off/high delay between received signal and output. So it shortens the mark and extends the space by 20 µs.

IR-Receiver connection Serial LCD connection
Fritzing schematic for Arduino Uno Fritzing schematic for Arduino Uno + LCD

Supported Arduino architectures / CPU's / boards

For ESP8266/ESP32, this library supports an impressive set of protocols and a lot of air conditioners

ATtiny and Digispark boards are tested with the recommended ATTinyCore using New Style pin mapping for the pro board.

Architecture CPU Board
avr ATmega16, ATmega328P, ATmega32U4, ATtinyX5, ATtinyX7 Uno, Nano, Leonardo, Sparkfun Pro Micro, Digispark etc.
megaavr ATmega4809 Uno WiFi Rev 2, Nano Every
samd SAMD21G18A Zero, MKR*, etc. but not DUE, which is sam architecture
esp8266 All protocols does not fit in IRAM all
esp32 % all
stm32 STM32F1xx BluePill
STM32F1 STM32F1xx BluePill
apollo3 Ambiq Apollo3 Sparkfun Apollo3 + Artemis
mbed nRF528x Nano 33 BLE
Teensiduino all - but limited support >= Teensy 3

Quick comparison of 5 Arduino IR receiving libraries

This is a short comparison and may not be complete or correct.

I created this comparison matrix for myself in order to choose a small IR lib for my project and to have a quick overview, when to choose which library.
It is dated from 24.06.2022 and updated 10/2023. If you have complains about the data or request for extensions, please send a PM or open a discussion.

Here you find an ESP8266/ESP32 version of IRremote with an impressive list of supported protocols.

Subject IRMP IRLremote IRLib2
mostly unmaintained
IRremote TinyIR IRsmallDecoder
Number of protocols 50 Nec + Panasonic + Hash * 12 + Hash * 17 + PulseDistance + Hash * NEC + FAST NEC + RC5 + Sony + Samsung
Timing method receive Timer2 or interrupt for pin 2 or 3 Interrupt Timer2 or interrupt for pin 2 or 3 Timer2 Interrupt Interrupt
Timing method send PWM and timing with Timer2 interrupts Timer2 interrupts Timer2 and blocking wait PWM with Timer2 and/or blocking wait with delay
Microseconds()
blocking wait with delay
Microseconds()
%
Send pins All All All ? Timer dependent All %
Decode method OnTheFly OnTheFly RAM RAM OnTheFly OnTheFly
Encode method OnTheFly OnTheFly OnTheFly OnTheFly or RAM OnTheFly %
Callback suppport x % % x x %
Repeat handling Receive + Send (partially) % ? Receive + Send Receive + Send Receive
LED feedback x % x x Receive %
FLASH usage (simple NEC example with 5 prints) 1820
(4300 for 15 main / 8000 for all 40 protocols)
(+200 for callback)
(+80 for interrupt at pin 2+3)
1270
(1400 for pin 2+3)
4830 1770 900 ?1100?
RAM usage 52
(73 / 100 for 15 (main) / 40 protocols)
62 334 227 19 29
Supported platforms avr, megaavr, attiny, Digispark (Pro), esp8266, ESP32, STM32, SAMD 21, Apollo3
(plus arm and pic for non Arduino IDE)
avr, esp8266 avr, SAMD 21, SAMD 51 avr, attiny, esp8266, esp32, SAM, SAMD All platforms with attach
Interrupt()
All platforms with attach
Interrupt()
Last library update 5/2023 4/2018 11/2022 9/2023 5/2023 2/2022
Remarks Decodes 40 protocols concurrently.
39 Protocols to send.
Work in progress.
Only one protocol at a time. Consists of 5 libraries. *Project containing bugs - 63 issues, 10 pull requests. Universal decoder and encoder.
Supports Pronto codes and sending of raw timing values.
Requires no timer. Requires no timer.

* The Hash protocol gives you a hash as code, which may be sufficient to distinguish your keys on the remote, but may not work with some protocols like Mitsubishi


Pin usage

You may use every pin for input or output, just define it like #define IRMP_INPUT_PIN 2 and #define IRSND_OUTPUT_PIN 3. The PWM of the output pin is generated by software bit banging.

Dynamic pins numbers

If you want to use pin numbers for input, output and LED feedback specified at runtime, you must define IRMP_IRSND_ALLOW_DYNAMIC_PINS. See ReceiveAndSendDynamicPins example.
The irmp_init and irsnd_init function then allows up to 3 parameters uint_fast8_t aIrmpInputPin/aIrsndOutputPin, uint_fast8_t aIrmpFeedbackLedPin, bool aIrmpLedFeedbackPinIsActiveLow.
Be aware, only one pin and enable flag for receive and send feedback LED is supported.


Receiving and sending simultaneously

Receiving and sending is possible with this library, but since we use only 1 timer, receiving is inhibited while sending the IR signal.
Sending the IR signal starts with saving current timer configuration, setting the timer to the send configuration / frequency, sending the signal (and waiting for the gap after the signal) and then automatically reset the timer to its previous (receiving) configuration.


API

IRMP

// Init functions
void irmp_init (void);
void irmp_init(uint_fast8_t aIrmpInputPin);
void irmp_init(uint_fast8_t aIrmpInputPin, uint_fast8_t aIrmpFeedbackLedPin);
void irmp_init(uint_fast8_t aIrmpInputPin, uint_fast8_t aIrmpFeedbackLedPin, bool aIrmpLedFeedbackPinIsActiveLow);
void irmp_register_complete_callback_function(void (*aCompleteCallbackFunction)(void));

// Info function
bool irmp_IsBusy();
void irmp_print_active_protocols(Print *aSerial);

// Main check for result function used in loop()
bool irmp_get_data (IRMP_DATA *)

// Result print functions
void irmp_result_print(Print *aSerial, IRMP_DATA * aIRMPDataPtr);
void irmp_result_print(IRMP_DATA *aIRMPDataPtr);

IRSND

// Init functions
void irsnd_init (void);
// 3 additional init functions if IRMP_IRSND_ALLOW_DYNAMIC_PINS is defined
void irsnd_init(uint_fast8_t aIrsndOutputPin);
void irsnd_init(uint_fast8_t aIrsndOutputPin, uint_fast8_t aIrmpFeedbackLedPin);
void irsnd_init(uint_fast8_t aIrsndOutputPin, uint_fast8_t aIrmpFeedbackLedPin, bool aIrmpLedFeedbackPinIsActiveLow);

// Send function - sends frame AND trailing space
bool irsnd_send_data (IRMP_DATA *, uint8_t);

// Info functions
bool irsnd_is_busy (void);

void irsnd_stop (void);

IRMP and IRSND

// LED feedback function
void irmp_irsnd_LEDFeedback(bool aEnableBlinkLed);

// Timer management functions for 
void disableIRTimerInterrupt(void);
void enableIRTimerInterrupt(void);
void storeIRTimer(void);
void restoreIRTimer(void);

Examples

In order to fit the examples to the 8K flash of ATtiny85 and ATtiny88, the Arduino library ATtinySerialOut is required for this CPU's.

AllProtocols

Receives up to 40 protocols concurrently and displays the short result on a 1602 LCD. The LCD can be connected parallel or serial (I2C).

SimpleReceiver + SimpleSender

This examples are a good starting point.
SimpleReceiver can be tested online with WOKWI. Click on the receiver while simulation is running to specify individual IR codes.

MinimalReceiver + MinimalSender

If code size matters, look at these examples.
The MinimalReceiver example uses the TinyReceiver library which can only receive NEC and FAST codes, but does not require any timer.
MinimalReceiver can be tested online with WOKWI. Click on the receiver while simulation is running to specify individual IR codes.

SmallReceiver

If the protocol is not NEC and code size matters, look at this example.
MinimalReceiver can be tested online with WOKWI. Click on the receiver while simulation is running to specify individual IR codes.

ReceiverTimingAnalysis

This example analyzes the signal delivered by your IR receiver module. Values can be used to determine the stability of the received signal as well as a hint for determining the protocol.
It also computes the MARK_EXCESS_MICROS value, which is the extension of the mark (pulse) duration introduced by the IR receiver module.
It can be tested online with WOKWI. Click on the receiver while simulation is running to specify individual IR codes.


Compile options / macros for this library

To customize the library to different requirements, there are some compile options / macros available, which must be set before including the library e.g. with #include <irmp.hpp>.
Modify it by setting the value to 1 or 0. Or define the macro with the -D compiler option for global compile (the latter is not possible with the Arduino IDE, so consider using Sloeber.

Name Default value Description
IRMP_INPUT_PIN 2 The pin number which gets compiled in, if not using IRMP_IRSND_ALLOW_DYNAMIC_PINS. See also PinDefinitionsAndMore.h
IRMP_FEEDBACK_LED_PIN LED_BUILTIN The pin number for the feedback led which gets compiled in, if not using IRMP_IRSND_ALLOW_DYNAMIC_PINS.
FEEDBACK_LED_IS_ACTIVE_LOW disabled Required on some boards (like my like my BluePill and my ESP8266 board), where the feedback LED is active low.
NO_LED_FEEDBACK_CODE disabled Enable it to disable the feedback LED function. Saves 30 bytes program memory.
IRMP_IRSND_ALLOW_DYNAMIC_PINS disabled Allows to specify pin number at irmp_init() - see above. This requires additional program memory.
IRMP_PROTOCOL_NAMES 0 / disabled Enable protocol number mapping to protocol strings - needs some program memory.
IRMP_USE_COMPLETE_CALLBACK 0 / disabled Use Callback if complete data was received. Requires call to irmp_register_complete_callback_function().
IRMP_ENABLE_PIN_CHANGE_INTERRUPT disabled Use Arduino attachInterrupt() and do no polling with timer ISR. This restricts the available input pins and protocols. The results are equivalent to results acquired with a sampling rate of 15625 Hz (chosen to avoid time consuming divisions). For AVR boards an own interrupt handler for INT0 or INT1 is used instead of Arduino attachInterrupt().
IRMP_ENABLE_RELEASE_DETECTION 0 / disabled If user releases a key on the remote control, last protocol/address/command will be returned with flag IRMP_FLAG_RELEASE set.
IRMP_HIGH_ACTIVE 0 / disabled Set to 1 if you use a RF receiver, which has an active HIGH output signal.
IRMP_32_BIT 0 / disabled This enables MERLIN protocol, but decreases performance for AVR. Enabled by default for 32 bit platforms.
F_INTERRUPTS 15000 The IRMP sampling frequency.
USE_ONE_TIMER_FOR_IRMP_AND_IRSND disabled Must be defined if you use receiving and sending simultaneously, since both use the same timer resource. Must not be enabled if you only use receiving.
IRSND_USE_CALLBACK 0 / disabled Calls a function if send output signal changes to active (sending the IR signal).
IR_OUTPUT_IS_ACTIVE_LOW disabled Output LOW for active IR signal. Use it if IR LED is connected between VCC and output pin.
IRSND_GENERATE_NO_SEND_RF disabled Do not generate the carrier frequency (of 38 kHz), just simulate an active low receiver signal.
IRSND_IR_FREQUENCY 38000 The modulation frequency for sent signal. The send signal is generated by bit banging, so the internal interrupt frequency is IRSND_IR_FREQUENCY * 2. The send control function is called at a rate of IRSND_IR_FREQUENCY / 2, resulting in a send packet signal resolution of 2 on/off periods.
- - -
IRMP_MEASURE_TIMING + IR_TIMING_TEST_PIN enabled For development only. The test pin is switched high at the very beginning and low at the end of the ISR.

These next macros for TinyIRReceiver must be defined in your program before the line #include <TinyIRReceiver.hpp> to take effect.

Name Default value Description
IR_RECEIVE_PIN 2 The pin number for TinyIRReceiver IR input, which gets compiled in.
IR_FEEDBACK_LED_PIN LED_BUILTIN The pin number for TinyIRReceiver feedback LED, which gets compiled in.
NO_LED_FEEDBACK_CODE disabled Enable it to disable the feedback LED function. Saves 14 bytes program memory.

Changing include (*.h) files with Arduino IDE

First, use Sketch > Show Sketch Folder (Ctrl+K).
If you have not yet saved the example as your own sketch, then you are instantly in the right library folder.
Otherwise you have to navigate to the parallel libraries folder and select the library you want to access.
In both cases the library source and include files are located in the libraries src directory.
The modification must be renewed for each new library version!

Modifying compile options with Sloeber IDE

If you are using Sloeber as your IDE, you can easily define global symbols with Properties > Arduino > CompileOptions.
Sloeber settings


The IRMP receive library works by polling the input pin at a rate of 10 to 20 kHz. Default is 15 kHz.
Some protocols (NEC, Kaseiko, Denon, RC6, Samsung + Samsg32) can be received without timer usage, just by using interrupts from the input pin by defining IRMP_ENABLE_PIN_CHANGE_INTERRUPT. There are many protocols which in principle cannot be decoded in this mode. See Interrupt example.
In interrupt mode, the micros() function is used as timebase.

The IRMP send library works by bit banging the output pin at a frequency of 38 kHz. This avoids blocking waits and allows to choose an arbitrary pin, you are not restricted to PWM generating pins like pin 3 or 11. The interrupts for send pin bit banging require 50% CPU time on a 16 MHz AVR.
If both receiving and sending is required, the timer is set up for receiving and reconfigured for the duration of sending data, thus preventing receiving in polling mode while sending data.
The tone library (using timer 2) is still available. You can use it alternating with IR receive and send, see ReceiveAndSend example.

  • For AVR timer 2 (Tone timer) is used for receiving and sending. For variants, which have no timer 2 like ATtiny85 or ATtiny167, timer 1 (or timer 0 for digispark core) is used.
  • For SAMD TC3 is used.
  • For Apollo3 Timer 3 segment B is used.
  • For ESP8266 and ESP32 timer1 is used.
  • For STM32 (BluePill) timer 3 (Servo timer) channel 1 is used as default.

Tips and tricks

  • To port the library to another device, you merely have to extend IRTimer.hpp.
  • The minimal CPU clock required for receiving is 8MHz.
  • To save power, you can use the interrupt mode or polling mode with no-sending detection and power down sleep. This is not available for ATtiny85 running with the High Speed PLL clock (as on Digispark boards) because of the high startup time from sleep of 4 to 5 ms for this clock. You have to use the ISP to rewrite the CKSEL fuses and to load the program.
  • The best way to increase the IR power is to use 2 or 3 IR diodes in series. One diode requires 1.1 to 1.5 volt so you can supply 3 diodes with a 5 volt output.To keep the current, you must reduce the resistor by (5 - 1.3) / (5 - 2.6) = 1.5 e.g. from 150 Ω to 100 Ω for 25 mA and 2 diodes with 1.3 volt and a 5 volt supply. For 3 diodes it requires factor 2.5 e.g. from 150 Ω to 60 Ω.
  • A lot of recent IR diodes can be powered with max. 200 mA at 50% duty cycle, but for this you will require an external driver / transistor / (mos)fet.
  • In order to fit the examples to the 8K flash of ATtiny85 and ATtiny88, the Arduino library ATtinySerialOut is required for this CPU's.

AllProtocols example

Serial LCD output Arduino Serial Monitor output
LCD start Serial Monitor

Sample Protocols

NEC NEC42 RC5 KASEIKYO
DENON GRUNDIG IR60 MATSUSHITA
NUBERT ONKYO RECS80 RUWIDO
SAMSUNG SIEMENS TELEFUNKEN TELEFUNKEN

Documentation at mikrocontroller.net

English

http://www.mikrocontroller.net/articles/IRMP_-_english
http://www.mikrocontroller.net/articles/IRSND_-_english

German

http://www.mikrocontroller.net/articles/IRMP
http://www.mikrocontroller.net/articles/IRSND

German Forum

https://www.mikrocontroller.net/topic/irmp-infrared-multi-protocol-decoder?goto=6996113#6996137


Revision History

Version 3.6.4

Version 3.6.3

  • Fixed ESP32 send timer bug.

Version 3.6.2

  • Fixed FEEDBACK_LED_IS_ACTIVE_LOW bug.
  • Added Kaseikyo Panasonic decode.
  • Added ATtiny88 / AVR timer1 timer support.
  • Fixed unexpected leading space for irsnd_send_data(...,false).

Version 3.6.1

  • Fixed NO_LED_FEEDBACK_CODE bug.

Version 3.6.0

  • Improved timings by J�rg R.
  • Support for NEC 8 bit address.
  • Fixed ATmega4809 bug.
  • RP2040 support added.

Version 3.5.1

  • Fixed ESP8266 F_CPU error introduced with 3.4.1.

Version 3.5.0

  • Renamed *.c.h and *.cpp.h to .hpp. You must change: #include <irmp.c.h> to: #include <irmp.hpp>!
  • Fix Timer1 initialization for ATtinyX7 parts for ATTinyCore.
  • Modifying digitalWriteFast.h to be compatible with ATTinyCore Digispark Pro default pin mapping.
  • Renamed initPCIInterrupt() to enablePCIInterrupt() and added disablePCIInterrupt().
  • Changed return value for irsnd_send_data() to be false on error conditions.
  • Fixed ICACHE_RAM_ATTR error introduced with 3.4.1.

Version 3.4.1

  • Changed default pins for ATmega328 platform from 3,4,5 to 2,3,4.
  • Adapted to TinyCore 0.0.7.
  • Renamed macro IRMP_TIMING_TEST_PIN to IR_TIMING_TEST_PIN.
  • Changed pins in PinDefinitionsAndMore.h.
  • Never send a trailing space for Arduino.
  • ATTiny88 support.

Version 3.4.0

  • Added ATtiny3217 / TinyCore support.
  • Added Melinera protocol and single repeat for NEC from upstream.

Version 3.3.5

  • Added TinyIRReceiver and updated IRDispatcherDemo examples.
  • Fixed "enabling OUTPUT for dynamic pin" bug.
  • Improved Apollo3 and MegaCore support.

Version 3.3.4

  • Removed convenience function irmp_tone(), since it statically allocates the tone interrupt vector.

Version 3.3.3

  • Added ATmega8 support.
  • Added IRSND_GENERATE_NO_SEND_RF compile switch.
  • Added function irsnd_data_print().
  • New SendAllProtocols example.
  • New DispatcherDemo example.
  • Added IRMP_FEEDBACK_LED_PIN compile switch.
  • Removed IRMP16 protocol from the all list.
  • Added missing Leonardo support.

Version 3.3.2

  • Added missing Medion entry in irmp_protocol_names.
  • Added function irmp_print_protocol_name().
  • Added Teensyduino support.
  • Fixed macro redefinitions in IRSND.

Version 3.3.1

  • Fix for function bool irmp_IsBusy() if IRMP_ENABLE_PIN_CHANGE_INTERRUPT is defined.

Version 3.3.0

  • Added function bool irmp_IsBusy().

Version 3.2.3

  • Fixed warning for missing USE_ONE_TIMER_FOR_IRMP_AND_IRSND macro.

Version 3.2.2

  • Removed blocking wait for ATmega32U4 Serial in examples.
  • Restored missing line reset interrupt flags found by user yumkam.
  • Fixed bug for sending only on no AVR platforms.

Version 3.2.1

  • Fixed bug in feedback LED handling for dynamic pins for send and receive.
  • Fixed wrong timer selection for STM32F1xx / ARDUINO_ARCH_STM32.

Version 3.2.0

  • MBED support for Arduino Nano 33 BLE.
  • Added ARDUINO_ARCH_STM32 definition.
  • Fixed ESP8266 wrong memcpy_p definition introduced in 3.0.0.

Version 3.1.2

  • Fixed interrupt mode bug introduced by merging upstream code for version 3.1.0.
  • Fixed ESP8266 wrong memcpy_p definition introduced in 3.0.0. - Fix was not complete :-(. Use 3.2.0.

Version 3.1.1

  • Added MinimalReceiver example.

Version 3.1.0

  • Added RF_MEDION protocol
  • IRAM attribute etc.
  • Fixed bug irmp_init used instead of irsnd_init
  • New function irmp_print_active_protocols().
  • Use timer3 for ESP32.
  • Fix missing check for LED pin == 0.
  • Merged upstream v3.2.2 + IRMP_ENABLE_RELEASE_DETECTION.
  • Dynamic pin for feedback LED added.

Version 3.0.0

  • Support of RF (433MHz) remotes. 2 protocols Generic 24 bit format and X10 format added.
  • MegaAVR (ATmega4809) support.
  • Added IRMP_IRSND_ALLOW_DYNAMIC_PINS and extended irmp_init() and irsnd_init()to allow input, output and LED feedback pin selection at runtime.
  • Support more protocols simultaneously on 32 bit CPUs.
  • Use same pin and enable flag for receive and send feedback LED.
  • New function irmp_print_active_protocols().

Version 2.2.1

  • Improved pin layout.
  • Fixed bug with stm32duino 1.9.
  • Version number.
  • Blink13 -> LEDFeedback.

Version 2.2.0

  • Supported Apollo3 platform.
  • Fixed DigisparkPro bug.

Version 2.1.0

  • Supported SAMD platform.
  • IRSND enabled for non AVR platforms.

Version 2.0.0

  • Added IR send fuctionality (IRSND).
  • Use TIMER2_COMPB_vect to be compatible with tone library.
  • No longer required to call initPCIInterrupt() manually if IRMP_ENABLE_PIN_CHANGE_INTERRUPT is set.
  • Separated code for timer to IRTimer.hpp.
  • Separated code for Pin change interrupt to irmpPinChangeInterrupt.hpp.
  • Fixed wrong pin numbers for BluePill.

Version 1.2.2

  • Fixed bugs introduced in 1.2.1.

Version 1.2.1

  • Bug for AVR architecture fixed.
  • ATtiny85 + ATtiny167 support for ATTinyCore and Digistump core.
  • Support for "Generic STM32F1 series" from "STM32 Boards (selected from submenu)" of Arduino Board manager.

Version 1.2.0 - This version contains a bug for the AVR architecture

  • Added STM32 M3 (BluePill) support.

Version 1.1.0

  • Added functions irmp_disable_timer_interrupt() and irmp_enable_timer_interrupt().
  • Added function irmp_result_print(Print *aSerial).
  • Improved examples.

Version 1.0.1

  • Added ESP8266 + ESP32 support.

CI

The library examples are tested with GitHub Actions for the following boards:

  • arduino:avr:uno
  • arduino:avr:leonardo
  • arduino:avr:mega
  • arduino:megaavr:nona4809:mode=off
  • arduino:samd:arduino_zero_native
  • arduino:mbed:nano33ble
  • arduino:mbed_rp2040:pico
  • rp2040:rp2040:arduino_nano_connect
  • digistump:avr:digispark-tiny:clock=clock16
  • ATTinyCore:avr:attinyx5micr:LTO=enable,sketchclock=8pll
  • ATTinyCore:avr:attinyx7micr:LTO=enable,sketchclock=16external,pinmapping=new,millis=enabled
  • ATTinyCore:avr:attinyx8micr:LTO=enable,sketchclock=16external,pinmapping=mhtiny,millis=enabled # ATtiny88 China clone board @16 MHz
  • TinyCore:avr:tiny32
  • esp8266:esp8266:d1_mini:eesz=4M3M,xtal=80
  • esp32:esp32:featheresp32:FlashFreq=80
  • STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8
  • STMicroelectronics:stm32:GenL0:pnum=THUNDERPACK_L072
  • stm32duino:STM32F1:genericSTM32F103C
  • SparkFun:apollo3:sfe_artemis_nano

irmp's People

Contributors

arminjo avatar drechc avatar lapmk avatar marsfan avatar per1234 avatar ukw100 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

irmp's Issues

stm32 support

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

Additional documentation for DigiSpark boards

Bug Report

Board

  • Digispark board

IDE

  • Arduino IDE

IR-Protocol

  • NEC

Example to reproduce the issue

  • SimpleReceiver

Version

Current behavior

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.

Expected behavior

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:

  • I have read the README.md file thoroughly.
  • I have searched existing issues to see if there is anything I have missed.
  • I have browsed the examples for one, that matches my use case.
  • Any code referenced is provided and if over 30 lines a gist is linked INSTEAD of it being pasted in here.
  • The title of the issue is helpful and relevant.
  • I checked, if at least one of the examples was working.

** 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!**

Arduino simulations for the examples 😀 - feature update

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.

image

[Question] Use 2 or more IR leds to send

  • Arduino ATmega328* board (UNO, Nano)

IDE

  • PlatformIO IDE

IR-Protocol

  • NEC

Example to reproduce the issue

  • AllProtocols

Version

Expected behavior

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?

Arduino Due compatibility

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!

Multiple definitions of Vector 3 when building with Servo_Attinycore - Tone-cpp.o?

Bug Report

Arduino Platform

  • Arduino ATmega328* board (UNO, Nano)
  • Arduino ATmega2560 board (Mega)
  • Arduino ATmega32U4 board (Leonardo)
  • Arduino megaAVR board (NanoEvery)
  • Arduino SAM board (Due)
  • Arduino SAMD board (Zero, MKR*)
  • [ x] ATtiny85 board (ATTinyCore by Spence Conde)
  • Digispark board
  • ATmega8 board
  • ESP8266 board
  • ESP32 board
  • STM32 board with "STM32 Boards (selected from submenu)" core
  • STM32 board with "STM32F1 Boards (STM32duino.com)" core
  • Apollo3 board
  • Teensy board
  • Other - please specify

IDE

  • [ x] Arduino IDE
  • Arduino Pro IDE
  • Sloeber IDE
  • PlatformIO IDE
  • Other - please specify

IR-Protocol

  • Unknown
  • Sony
  • [ x] NEC
  • Samsung
  • RC5, RC6
  • Kaseikyo
  • Denon
  • JVC
  • Lego
  • Matsushita
  • Mitsubishi
  • Panasonic
  • Sanyo
  • Sharp
  • Telefunken
  • Other - please specify

Example to reproduce the issue

  • AllProtocols
  • Callback
  • Interrupt
  • OneProtocol
  • ReceiveAndSend
  • ReceiveAndSendDynamicPins
  • RFProtocols
  • SimpleReceiver
  • SimpleSender
  • [ x] MinimalReceiver

Pin(s) used for IR-receive, if not default

Version

  • [x ] Yes I use the latest release and verified this!
  • Other - please specify

Current behavior

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 behavior

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.

Error output

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).

Additional context

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)

Teensy 4.0 - cannot detect IR codes

Bug Report

Arduino Platform

  • Arduino ATmega328* board (UNO, Nano)
  • Arduino ATmega2560 board (Mega)
  • Arduino ATmega32U4 board (Leonardo)
  • Arduino megaAVR board (NanoEvery)
  • Arduino SAM board (Due)
  • Arduino SAMD board (Zero, MKR*)
  • ESP8266 board
  • ESP32 board
  • STM32 board with "STM32 Boards (selected from submenu)" core
  • STM32 board with "STM32F1 Boards (STM32duino.com)" core
  • Apollo3 board
  • Teensy board
  • Other - please specify

IDE

  • Arduino IDE
  • Arduino Pro IDE
  • Sloeber IDE
  • PlatformIO IDE
  • Other - please specify

IR-Protocol

  • Unknown
  • Sony
  • NEC
  • Samsung
  • RC5, RC6
  • Kaseikyo
  • Denon
  • JVC
  • Lego
  • Matsushita
  • Mitsubishi
  • Panasonic
  • Sanyo
  • Sharp
  • Telefunken
  • Other - please specify

Example to reproduce the issue

  • AllProtocols
  • Callback
  • Interrupt
  • OneProtocol
  • ReceiveAndSend
  • ReceiveAndSendDynamicPins
  • RFProtocols
  • SimpleReceiver
  • SimpleSender
  • Other

Pin(s) used for IR-receive, if not default

22 (tried also 2 and 3)

Version

  • Yes I use the latest release and verified this!
  • Other - please specify

Current behavior

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.

Expected behavior

Should detect IR codes.

Error output

No error.

Additional context

Using Teensy 4.0 (Cortex-M7)

'Serial' was not declared in this scope (ATTiny)

'Serial' was not declared in this scope (ATTiny)

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?

Way to reproduce the problem

Board

ATtiny85 Digispark board
Arduino Nano as ISP

IDE

Arduino IDE

Version

IRMP 3.4.1

Settings

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"

Sketch

#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); 
  }
}

Error

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

Code to overcome the problem

#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); 
  }
}

Alternative way to overcome the problem

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
}

Related code

#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); 
  }
}

Send NEC repeat command

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?

CANNOT decode RC6 (TATASKY), PANASONIC AC & Ogeneral AC

If you have handling problems or questions, consider to open a discussion https://github.com/Arduino-IRremote/Arduino-IRremote/discussions instead of an issue.

Bug Report

Board

  • Arduino ATmega328* board (UNO, Nano)

IDE

  • Arduino IDE

IR-Protoco

  • RC5, RC6
  • Panasonic

Example to reproduce the issue

  • AllProtocols
  • OneProtocol

Version

Please delete all unchecked lines above :-)

Pin(s) used for IR-receive, if not default

Current behavior

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

Expected behavior

Also while enabling Panasonic codec initially i had trouble because it didnt display a compile time warning in SelectALLProtocols example to disable KASEIKYO protocol .

Additional context

checklist:

  • I have read the README.md file thoroughly.
  • I have searched existing issues to see if there is anything I have missed.
  • I have browsed the examples for one, that matches my use case.
  • [] Any code referenced is provided and if over 30 lines a gist is linked INSTEAD of it being pasted in here.
  • The title of the issue is helpful and relevant.
  • I checked, if at least one of the examples was working.

** 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 missing from irmp_protocol_names

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

Not all pins working on Arduino Nano (dynamic sending pins)

Bug Report

Arduino Platform

  • Arduino ATmega328* board (UNO, Nano)

IDE

  • PlatformIO IDE

IR-Protocol

  • NEC

Example to reproduce the issue

  • Other

Pin(s) used for IR-receive, if not default

Version

Current behavior

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.

ESP8266: crash of device

Bug Report

Arduino Platform

  • ESP8266 board

IDE

  • Arduino IDE
  • PlatformIO IDE (VS Code)
    (checked with both)

IR-Protocol

  • NEC (probably unrelated)

Example to reproduce the issue

  • SimpleReceiver

Pin(s) used for IR-receive, if not default

D5 (14)

Version

Current behavior

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.

Expected behavior

Should work as with 2.2.1 in any newer version.

Error output

--------------- 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

ESP32; irsnd_send_data(...)

Bug Report

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).

Arduino Platform

Willing to test on breadboard with a leaner esp32 dev board connected to IR unit above.

IDE

  • Arduino IDE

IR-Protocol

  • NEC (primary issue; Oon Soundbar IR remote right now)
  • Samsung (maybe later;have a remote on hand)

Example to reproduce the issue

  • ReceiveAndSend

Pin(s) used for IR-receive, if not default

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.

Version

  • Yes I use the latest release and verified this!

  • Other - please specify

  • "version": "3.3.4",

Current behavior

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);
}

BluePill don't work well

Bug Report

Arduino Platform

  • Arduino ATmega328* board (UNO, Nano)
  • Arduino ATmega2560 board (Mega)
  • Arduino ATmega32U4 board (Leonardo)
  • Arduino megaAVR board (NanoEvery)
  • Arduino SAM board (Due)
  • Arduino SAMD board (Zero, MKR*)
  • ESP8266 board
  • ESP32 board
  • STM32 board BluePill
  • Apollo3 board
  • Teensy board
  • Other - please specify

IDE

  • Arduino IDE
  • Arduino Pro IDE
  • Sloeber IDE
  • PlatformIO IDE
  • Other - please specify

IR-Protocol

  • Unknown
  • Sony
  • NEC
  • Samsung
  • RC5, RC6
  • Kaseikyo
  • Denon
  • JVC
  • Lego
  • Matsushita
  • Mitsubishi
  • Panasonic
  • Sanyo
  • Sharp
  • Telefunken
  • Other - please specify

Example to reproduce the issue

  • AllProtocols
  • Callback
  • Interrupt
  • OneProtocol
  • ReceiveAndSend
  • ReceiveAndSendDynamicPins
  • RFProtocols
  • SimpleReceiver
  • SimpleSender
  • Other

Pin(s) used for IR-receive, if not default

Default

Version

  • Yes I use the latest release and verified this!
  • Other - please specify

Current behavior

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.

[FR] Make PIN configuration at runtime

To make IRMP integrable into the Tasmota project, it must be possible to assign the pins at runtime.

There is another project that offers this possibility and is even already integrated in Tasmota, but does not offer the protocol support of IRMP by far. I would like to integrate IRMP into Tasmota.

freertos with receive and send IR

Question

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

Arduino Platform

  • Arduino ATmega328* board (UNO, Nano)
  • Arduino ATmega2560 board (Mega)
  • Arduino ATmega32U4 board (Leonardo)
  • Arduino megaAVR board (NanoEvery)
  • Arduino SAM board (Due)
  • Arduino SAMD board (Zero, MKR*)
  • ESP8266 board
  • ESP32 board
  • STM32 board
  • Apollo3 board
  • Teensy board
  • Other - please specify
  • bluepill_f103c8
  • blackpill_f401cc

IDE

  • Arduino IDE
  • Arduino Pro IDE
  • Sloeber IDE
  • PlatformIO IDE
  • Other - please specify

IR-Protocol

  • Unknown
  • Sony
  • NEC
  • Samsung
  • RC5, RC6
  • Kaseikyo
  • Denon
  • JVC
  • Lego
  • Matsushita
  • Mitsubishi
  • Panasonic
  • Sanyo
  • Sharp
  • Telefunken
  • Other - please specify

Example to reproduce the issue

  • AllProtocols
  • Callback
  • Interrupt
  • OneProtocol
  • ReceiveAndSend
  • ReceiveAndSendDynamicPins
  • RFProtocols
  • SimpleReceiver
  • SimpleSender
  • Other

Pin(s) used for IR-receive, if not default

Version

  • Yes I use the latest release and verified this!
  • Other - please specify

Wrong / misleading input pin definition for STM32 in all examples

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.

bugs in irmpArduinoExt.cpp.h irmp_print_protocol_name

Bug Report

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

#endif
aSerial->print(F("0x"));
aSerial->print(aProtocolNumber, HEX);
}

To fix change to:

endif

else

aSerial->print(F("0x"));
aSerial->print(aProtocolNumber, HEX);

#endif
}

May be useful for ya.

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.

stm32duino core ver 1.9 compile error

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

Timer problems on Leonardo

Bug Report

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

Arduino Platform

  • Arduino ATmega328* board (UNO, Nano)
  • Arduino ATmega2560 board (Mega)
  • Arduino ATmega32U4 board (Leonardo)
  • Arduino megaAVR board (NanoEvery)
  • Arduino SAM board (Due)
  • Arduino SAMD board (Zero, MKR*)
  • ATtiny85 board (ATTinyCore by Spence Conde)
  • Digispark board
  • ATmega8 board
  • ESP8266 board
  • ESP32 board
  • STM32 board with "STM32 Boards (selected from submenu)" core
  • STM32 board with "STM32F1 Boards (STM32duino.com)" core
  • Apollo3 board
  • Teensy board
  • Other - please specify

IDE

  • Arduino IDE
  • Arduino Pro IDE
  • Sloeber IDE
  • PlatformIO IDE
  • Other - please specify

IR-Protocol

  • Unknown
  • Sony
  • NEC
  • Samsung
  • RC5, RC6
  • Kaseikyo
  • Denon
  • JVC
  • Lego
  • Matsushita
  • Mitsubishi
  • Panasonic
  • Sanyo
  • Sharp
  • Telefunken
  • Other - please specify

Example to reproduce the issue

  • AllProtocols
  • Callback
  • Interrupt
  • OneProtocol
  • ReceiveAndSend
  • ReceiveAndSendDynamicPins
  • RFProtocols
  • SimpleReceiver
  • SimpleSender
  • Other

Pin(s) used for IR-receive, if not default

Version

  • Yes I use the latest release and verified this!
  • Other - please specify

Current behavior

Expected behavior

Error output

Additional context

Detect if IRMP is currently receiving

Question / Feature request

Arduino Platform

  • Arduino ATmega328* board (UNO, Nano)

IDE

  • Arduino IDE

IR-Protocol

  • NEC

Example to reproduce the issue

  • Interrupt

Pin(s) used for IR-receive, if not default

Version

  • Yes I use the latest release and verified this!
  • Other - please specify

Additional context

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)

stm32 non interrupt mode

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?

ATmega8A, any chance?

Bug Report

Arduino Platform

  • Other - please specify: atmega8a barebone

IDE

  • Arduino IDE

IR-Protocol

  • Kaseikyo

Example to reproduce the issue

  • Other

Pin(s) used for IR-receive, if not default

Version

  • Yes I use the latest release and verified this!
  • Other - please specify

Current behavior

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.

R repeat displaying even when pressing different buttons in a rapid manner

If you have handling problems or questions, consider to open a discussion https://github.com/Arduino-IRremote/Arduino-IRremote/discussions instead of an issue.

Bug Report

Board

  • Arduino ATmega328* board (UNO, Nano)

IDE

  • Arduino IDE

IR-Protocol

  • NEC

Example to reproduce the issue

  • AllProtocols

Version

Please delete all unchecked lines above :-)

Pin(s) used for IR-receive, if not default

Current behavior

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

Expected behavior

when pressing different buttons in a fast manner it shouldnt print R anywhere (neither serial monitor nor lcd)

Additional context

checklist:

  • I have read the README.md file thoroughly.
  • I have searched existing issues to see if there is anything I have missed.
  • I have browsed the examples for one, that matches my use case.
  • Any code referenced is provided and if over 30 lines a gist is linked INSTEAD of it being pasted in here.
  • The title of the issue is helpful and relevant.
  • I checked, if at least one of the examples was working.

** 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!**

Defining NO_LED_FEEDBACK_CODE breaks compiliation

Bug Report

Board

  • ESP8266 board

IDE

  • PlatformIO IDE

Example to reproduce the issue

  • Other

Version

Current behavior

#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:

  • I have read the README.md file thoroughly.
  • I have searched existing issues to see if there is anything I have missed.
  • [] I have browsed the examples for one, that matches my use case.
  • Any code referenced is provided and if over 30 lines a gist is linked INSTEAD of it being pasted in here.
  • The title of the issue is helpful and relevant.
  • [] I checked, if at least one of the examples was working.

** 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!**

interrupt mode do not compile with stm32

Bug Report

Arduino Platform

  • Arduino ATmega328* board (UNO, Nano)
  • Arduino ATmega2560 board (Mega)
  • Arduino ATmega32U4 board (Leonardo)
  • Arduino megaAVR board (NanoEvery)
  • Arduino SAM board (Due)
  • Arduino SAMD board (Zero, MKR*)
  • ESP8266 board
  • ESP32 board
  • Apollo3 board
  • Teensy board
  • Other - please specify
    STM32duino

IDE

  • Arduino IDE
  • Arduino Pro IDE
  • Sloeber IDE
  • PlatformIO IDE
  • Other - please specify

IR-Protocol

  • Unknown
  • Sony
  • NEC
  • Samsung
  • RC5, RC6
  • Kaseikyo
  • Denon
  • JVC
  • Lego
  • Matsushita
  • Mitsubishi
  • Panasonic
  • Sanyo
  • Sharp
  • Telefunken
  • Other - please specify

Example to reproduce the issue

  • AllProtocols
  • Callback
  • Interrupt
  • OneProtocol
  • ReceiveAndSend
  • ReceiveAndSendDynamicPins
  • RFProtocols
  • SimpleReceiver
  • SimpleSender
  • Other

Pin(s) used for IR-receive, if not default

Version

Current behavior

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

Forward Declare IRMP_DATA

Bug Report

Arduino Platform

  • Arduino ATmega328* board (UNO, Nano)
  • Arduino ATmega2560 board (Mega)
  • Arduino ATmega32U4 board (Leonardo)
  • Arduino megaAVR board (NanoEvery)
  • Arduino SAM board (Due)
  • Arduino SAMD board (Zero, MKR*)
  • ATtiny85 board (ATTinyCore by Spence Conde)
  • Digispark board
  • ATmega8 board
  • ESP8266 board
  • [ X ] ESP32 board
  • STM32 board with "STM32 Boards (selected from submenu)" core
  • STM32 board with "STM32F1 Boards (STM32duino.com)" core
  • Apollo3 board
  • Teensy board
  • Other - please specify

IDE

  • Arduino IDE
  • Arduino Pro IDE
  • Sloeber IDE
  • [ X ] PlatformIO IDE
  • Other - please specify

IR-Protocol

  • Unknown
  • Sony
  • [ X ] NEC
  • Samsung
  • RC5, RC6
  • Kaseikyo
  • Denon
  • JVC
  • Lego
  • Matsushita
  • Mitsubishi
  • Panasonic
  • Sanyo
  • Sharp
  • Telefunken
  • Other - please specify

Example to reproduce the issue

  • AllProtocols
  • Callback
  • Interrupt
  • OneProtocol
  • ReceiveAndSend
  • ReceiveAndSendDynamicPins
  • RFProtocols
  • SimpleReceiver
  • SimpleSender
  • [ X ] Other

Pin(s) used for IR-receive, if not default

25

Version

  • [ X ] Yes I use the latest release and verified this!
  • Other - please specify

Current behavior

`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.

Expected behavior

To be able to forward declare the IRMP_DATA struct in my header file.

Error output

^ 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

Additional context

How use IRMP16 protocol, send and recieve example?

If you have handling problems or questions, consider to open a discussion https://github.com/ukw100/IRMP/discussions instead of an issue.

Bug Report

Board

  • Arduino ATmega328* board (UNO, Nano)
  • Arduino ATmega2560 board (Mega)
  • Arduino ATmega32U4 board (Leonardo)
  • Arduino megaAVR board (NanoEvery)
  • Arduino SAM board (Due)
  • Arduino SAMD board (Zero, MKR*)
  • ATtiny85 board (ATTinyCore by Spence Conde)
  • Digispark board
  • ATtiny3217 board (TinyCore)
  • ATmega8 board
  • ESP8266 board
  • ESP32 board
  • STM32 board with "STM32 Boards (selected from submenu)" core
  • STM32 board with "STM32F1 Boards (STM32duino.com)" core
  • Apollo3 board
  • Teensy board
  • Other - please specify

IDE

  • Arduino IDE
  • Arduino Web Editor
  • Arduino Pro IDE
  • Sloeber IDE
  • PlatformIO IDE
  • Other - please specify

IR-Protocol

  • Unknown
  • Sony
  • NEC
  • Samsung
  • RC5, RC6
  • Kaseikyo
  • Denon
  • JVC
  • Lego
  • Matsushita
  • Mitsubishi
  • Panasonic
  • Sanyo
  • Sharp
  • Telefunken
  • Other - please specify

Example to reproduce the issue

  • AllProtocols
  • Callback
  • Interrupt
  • OneProtocol
  • ReceiveAndSend
  • ReceiveAndSendDynamicPins
  • RFProtocols
  • SimpleReceiver
  • SimpleSender
  • Other

Version

Please delete all unchecked lines above :-)

Pin(s) used for IR-receive, if not default

Current behavior

Expected behavior

Additional context

checklist:

  • [] I have read the README.md file thoroughly.
  • [] I have searched existing issues to see if there is anything I have missed.
  • [] I have browsed the examples for one, that matches my use case.
  • [] Any code referenced is provided and if over 30 lines a gist is linked INSTEAD of it being pasted in here.
  • [] The title of the issue is helpful and relevant.
  • [] I checked, if at least one of the examples was working.

** 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!**

esp8266 resets in non intrrupt mode

Bug Report

Board

  • ESP8266 board

IDE

  • Arduino IDE

IR-Protocol

  • NEC

Example to reproduce the issue

  • OneProtocol

Version

Please delete all unchecked lines above :-)

Pin(s) used for IR-receive, if not default

gpio 12

Current behavior

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

Expected behavior

as far as i know main problem is in this function:
irmp_init();

Additional context

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:

  • [y] I have read the README.md file thoroughly.
  • [y] I have searched existing issues to see if there is anything I have missed.
  • [y] I have browsed the examples for one, that matches my use case.
  • [] Any code referenced is provided and if over 30 lines a gist is linked INSTEAD of it being pasted in here.
  • [] The title of the issue is helpful and relevant.
  • [] I checked, if at least one of the examples was working.

** 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!**

IRQ2 and 3 on Mega2560 on 2nd UART

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?

Nano 33 BLE - IRSND does not work

Bug Report

Arduino Platform

  • Arduino ATmega328* board (UNO, Nano)
  • Arduino ATmega2560 board (Mega)
  • Arduino ATmega32U4 board (Leonardo)
  • Arduino megaAVR board (NanoEvery)
  • Arduino SAM board (Due)
  • Arduino SAMD board (Zero, MKR*)
  • ESP8266 board
  • ESP32 board
  • STM32 board with "STM32 Boards (selected from submenu)" core
  • STM32 board with "STM32F1 Boards (STM32duino.com)" core
  • Apollo3 board
  • Teensy board
  • Other - please specify

Arduino Nano 33 BLE

IDE

  • Arduino IDE
  • Arduino Pro IDE
  • Sloeber IDE
  • PlatformIO IDE
  • Other - please specify

IR-Protocol

  • Unknown
  • Sony
  • NEC
  • Samsung
  • RC5, RC6
  • Kaseikyo
  • Denon
  • JVC
  • Lego
  • Matsushita
  • Mitsubishi
  • Panasonic
  • Sanyo
  • Sharp
  • Telefunken
  • Other - please specify

Example to reproduce the issue

  • AllProtocols
  • Callback
  • Interrupt
  • OneProtocol
  • ReceiveAndSend
  • ReceiveAndSendDynamicPins
  • RFProtocols
  • SimpleReceiver
  • SimpleSender
  • Other

Pin(s) used for IR-receive, if not default

Version

  • Yes I use the latest release and verified this!
  • Other - please specify

Current behavior

Code
/*
 *  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
}
IRMP output for power button
#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.

Expected behavior

Toogle power of my device every five seconds.

Error output

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

Additional context

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.

my current layout

IMG_9329

Second IRMP sending crashes on ESP32 with "register interrupt service failed"

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

Resuming from sleep

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)

Sending IR codes without modulation / carrier frequency

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.

Library not working on STM32L Series

Bug Report

Arduino Platform

  • STM32 board

IDE

  • Arduino IDE

IR-Protocol

  • Samsung

Example to reproduce the issue

  • SimpleSender

Pin(s) used for IR-receive, if not default

Version

Current behavior

/*

  • 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 modifiers we can include the code and compile it.
    */
    #include <irsnd.c.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.

Expected behavior

I am expecting that the connecter IR LED should blink when IR code is being emitted.

Error output

Additional context

Bang and Olufsen send frequency seems to be wrong, and send is not working

Bug Report

Board

  • Arduino ATmega328* board (UNO, Nano)
  • Arduino ATmega2560 board (Mega)
  • Arduino ATmega32U4 board (Leonardo)
  • Arduino megaAVR board (NanoEvery)
  • Arduino SAM board (Due)
  • Arduino SAMD board (Zero, MKR*)
  • ATtiny85 board (ATTinyCore by Spence Conde)
  • Digispark board
  • ATtiny3217 board (TinyCore)
  • ATmega8 board
  • ESP8266 board
  • ESP32 board (M5STACK)
  • STM32 board with "STM32 Boards (selected from submenu)" core
  • STM32 board with "STM32F1 Boards (STM32duino.com)" core
  • Apollo3 board
  • Teensy board
  • Other - please specify

IDE

  • Arduino IDE V.1.8.13
  • Arduino Web Editor
  • Arduino Pro IDE
  • Sloeber IDE
  • PlatformIO IDE
  • Other - please specify

IR-Protocol

  • Unknown
  • Sony
  • NEC
  • Samsung
  • RC5, RC6
  • Kaseikyo
  • Denon
  • JVC
  • Lego
  • Matsushita
  • Mitsubishi
  • Panasonic
  • Sanyo
  • Sharp
  • Telefunken
  • Other - please specify (Bang and Olufsen)

Example to reproduce the issue

  • AllProtocols
  • Callback
  • Interrupt
  • OneProtocol
  • ReceiveAndSend
  • ReceiveAndSendDynamicPins
  • RFProtocols
  • SimpleReceiver
  • SimpleSender
  • Other

Pin(s) used for IR-receive, if not default

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)

Version

  • Yes I use the latest repo version and verified this!
  • Other - please specify (library version 3.4.0)

Current behavior

IRMP_ReceiveAndSend.zip

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

Expected behavior

This is just a send test,
If button A is clicked, send something
If button A is clicked, send something else

Error output

No errors are outputed

Additional context

Benchmark Media protocol

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:

  • first bit pulse: 2.59ms
  • first bit pause: 2.59ms
  • pulse: 1.20ms
  • short pause: 1.11ms
  • long pause: 2.84ms
  • data: 16bit
  • stop bit: yes (pulse only)
  • fsb/lsb: unknown
  • interframe pause: 58ms

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.

Screenshot 2021-02-03 at 00 25 23

Screenshot 2021-02-03 at 00 25 33

Screenshot 2021-02-03 at 00 25 44

Screenshot 2021-02-03 at 00 25 55

RX Feedback LED wrong polarity

Bug Report

Board

  • Other - please specify
  • I designed my own board, based on ATMega328PB. It has an active low built-in LED

Current behavior

LED is ON when idle, OFF when I press a remote's button

Expected behavior

should be vice versa, as FEEDBACK_LED_IS_ACTIVE_LOW was given

Additional context

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:

  • I have read the README.md file thoroughly.

Thank you!

SIEMENS protocol not detected

Bug Report

Arduino Platform

  • Arduino ATmega328* board (UNO, Nano)
  • Arduino ATmega2560 board (Mega)
  • Arduino ATmega32U4 board (Leonardo)
  • Arduino megaAVR board (NanoEvery)
  • Arduino SAM board (Due)
  • Arduino SAMD board (Zero, MKR*)
  • ESP8266 board
  • ESP32 board
  • STM32 board with "STM32 Boards (selected from submenu)" core
  • STM32 board with "STM32F1 Boards (STM32duino.com)" core
  • Apollo3 board
  • Teensy board
  • Other - please specify

IDE

  • Arduino IDE
  • Arduino Pro IDE
  • Sloeber IDE
  • PlatformIO IDE
  • Other - please specify

IR-Protocol

  • Unknown
  • Sony
  • NEC
  • Samsung
  • RC5, RC6
  • Kaseikyo
  • Denon
  • JVC
  • Lego
  • Matsushita
  • Mitsubishi
  • Panasonic
  • Sanyo
  • Sharp
  • Telefunken
  • Siemens + Nokia

Example to reproduce the issue

  • AllProtocols
  • Callback
  • Interrupt
  • OneProtocol
  • ReceiveAndSend
  • ReceiveAndSendDynamicPins
  • RFProtocols
  • SimpleReceiver
  • SimpleSender
  • Other

Pin(s) used for IR-receive, if not default

I use dynamic PINs (GPIO5) with Tasmota configuration.

Version

  • Yes I use the latest release and verified this!
  • Other - please specify

Current behavior

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

Expected behavior

Siemens and Nokia protocols are always correctly detected.

Error output

No serial output on Tasmota :(

The Siemens protocol is not detected at all.
The Nokia protocol is sometimes detected as SIEMENS.

Additional context

only picking up every 10-20 key press on Bang & Olufsen Beo4

Bug Report

Arduino Platform

  • Arduino ATmega328* board (UNO, Nano)
  • Arduino ATmega2560 board (Mega)
  • Arduino ATmega32U4 board (Leonardo)
  • Arduino megaAVR board (NanoEvery)
  • Arduino SAM board (Due)
  • Arduino SAMD board (Zero, MKR*)
  • ATtiny85 board (ATTinyCore by Spence Conde)
  • Digispark board
  • ATmega8 board
  • ESP8266 board
  • [ X] ESP32 board
  • STM32 board with "STM32 Boards (selected from submenu)" core
  • STM32 board with "STM32F1 Boards (STM32duino.com)" core
  • Apollo3 board
  • Teensy board
  • Other - please specify

IDE

  • [ X] Arduino IDE
  • Arduino Pro IDE
  • Sloeber IDE
  • PlatformIO IDE
  • Other - please specify

IR-Protocol

  • Unknown
  • Sony
  • NEC
  • Samsung
  • RC5, RC6
  • Kaseikyo
  • Denon
  • JVC
  • Lego
  • Matsushita
  • Mitsubishi
  • Panasonic
  • Sanyo
  • Sharp
  • Telefunken
  • [ X] Other - please specify Bang & Olufsen

Example to reproduce the issue

  • AllProtocols
  • Callback
  • Interrupt
  • OneProtocol
  • ReceiveAndSend
  • ReceiveAndSendDynamicPins
  • RFProtocols
  • SimpleReceiver
  • SimpleSender
  • [X ] Other
    SimpleSender modified to use irmpSelectAllProtocols.h

Pin(s) used for IR-receive, if not default

default

Version

Current behavior

SimpleSender with line 56 modified to #include <irmpSelectAllProtocols.h> and 57 commented out

only every 10-20 key press is being detected

Expected behavior

I expected every key press to be detected

Error output

"P=BANG OLU0xE A=0x0 C=0x80" every 10-20 time I press TV on the remote

Additional context

irsnd_send_data() crashes ESP32

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?

Redefinitions causing code to fail compilation on Sparkfun Artemis Boards (Apollo 3)

Bug Report

Arduino Platform

  • Apollo3 board

IDE

  • Arduino IDE

IR-Protocol

  • Other - Not relavent

Example to reproduce the issue

  • AllProtocols
  • SendAllProtocols
  • Callback
  • Interrupt
  • OneProtocol
  • ReceiveAndSend
  • ReceiveAndSendDynamicPins
  • RFProtocols
  • SimpleReceiver
  • SimpleSender
  • Other

Pin(s) used for IR-receive, if not default

Version

  • Yes I use the latest release and verified this!
  • Other - please specify

Current behavior

Code is the AllProtocols example with no changes made to it

Output
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 fails during compilation due to redefinition of `am_ctimer_isr(void)` and `F(a)`

Expected behavior

Code Compiles correctly.

Additional context

It seems that Sparkfun added their own functions that implement the interrupts and F(a) substitution.

  • Interrupt function: Identical to the interrupt function that that this repository has implemented.
  • Flash String Helper: Differs from this repo's implementation by using the true Arduino implementation.

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.

Interrupt example not working with arduino uno.

Bug Report

Arduino Platform

  • Arduino ATmega328* board (UNO, Nano)
  • Arduino ATmega2560 board (Mega)
  • Arduino ATmega32U4 board (Leonardo)
  • Arduino megaAVR board (NanoEvery)
  • Arduino SAM board (Due)
  • Arduino SAMD board (Zero, MKR*)
  • ESP8266 board
  • ESP32 board
  • STM32 board
  • Apollo3 board
  • Teensy board
  • Other - please specify

IDE

  • Arduino IDE
  • Arduino Pro IDE
  • Sloeber IDE
  • PlatformIO IDE
  • Other - please specify

IR-Protocol

  • Unknown
  • Sony
  • NEC
  • Samsung
  • RC5, RC6
  • Kaseikyo
  • Denon
  • JVC
  • Lego
  • Matsushita
  • Mitsubishi
  • Panasonic
  • Sanyo
  • Sharp
  • Telefunken
  • Other - please specify

Example to reproduce the issue

  • AllProtocols
  • Callback
  • Interrupt
  • OneProtocol
  • ReceiveAndSend
  • ReceiveAndSendDynamicPins
  • RFProtocols
  • SimpleReceiver
  • SimpleSender
  • Other

Pin(s) used for IR-receive, if not default

3

Version

  • Yes I use the latest release and verified this!
  • Other - please specify

Current behavior

Interrupt example verbatim

The callback function is never called, but the feedback light blinks proving it's receiving signals.

Expected behavior

I expect the callback function to be called.

Additional context

I've tested 2 remotes, both of which work with the non-interrupt example verbatim.

IRTimer.hpp needs small corectoin for __AVR_ATmega4809__

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.

AllProtocols compilation errors and warnings with serial LCD

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)

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.