IR - xoseperez/espurna GitHub Wiki

IR

IR Receiver & Transmitter support, based on the IRremoteESP8266

Configuration

Configuration key Build flag Description
IR_RX_SUPPORT (default: 1)
IR_RX_PRESET (default: 0) Which of the predefined IR button sets to use, see config/general.h and ir.cpp for more information
irRx IR_RX_PIN Receiver pin
irRxPullup IR_RX_PULLUP Set INPUT_PULLUP when updating pin mode
irRxBufSize IR_RX_BUFFER_SIZE (internal) Setup u16[] of the specified size
irRxTimeout IR_RX_TIMEOUT (ms) amount of time of no IR signal before the library stops capturing any data
irRxUnknown IR_RX_UNKNOWN Enable UNKNOWN protocols processing, required for simple FNV1 codes and RAW
irRxDelay IR_RX_DELAY (ms) minimum amount of time inbetween processing received messages
IR_TX_SUPPORT (default: 1)
irTx IR_TX_PIN Transmitter pin
irTxInv IR_TX_INVERTED (boolean) whether the LED will turn ON when GPIO is LOW and OFF when it's HIGH
irTxMod IR_TX_MODULATION (boolean)
irTxRepeats IR_TX_REPEATS (internal, may be controlled by the protocol) number of times that the message will be sent immediately
irTxSeries IR_TX_SERIES number of times that the message will be scheduled for sending
irTxDelay IR_TX_DELAY (ms)

Protocols

Simple

Simple messages that transmit the numeric 'value' (up to 8 bytes)

Transmitting

Payload: <protocol>:<value>:<bits>[:<repeats>][:<delay>][:<times>]

Required parameters:

  • PROTOCOL - decimal ID, will be converted into a named 'decode_type_t' (ref. IRremoteESP8266.h and it's protocol descriptions)
  • VALUE - hexadecimal representation of the value that will be sent (big endian, maximum 8bytes / 64bit. byte is always zero-padded)
  • BITS - number of bits associated with the protocol (ref. IRremoteESP8266.h and it's protocol descriptions)

Optional payload parameters:

  • REPEATS - how many times the message will be sent immediatly (defaults to 0 or the value set by the PROTOCOL type)
  • SERIES - how many times the message will be scheduled for sending (defaults to 1 aka once, [1...120))
  • DELAY - minimum amount of time (ms) between queued messages (defaults is IR_TX_DELAY, applies to every message in the series)

Receiving

Payload: 2:AABBCCDD:32 (<protocol>:<value>:<bits>)

RAW

Transmitting

Payload: <frequency>:<series>:<delay>:<μs>,<μs>,<μs>,<μs>,... | Options | | Message |

  • FREQUENCY - modulation frequency, either in kHz (<1000) or Hz (>=1000)
  • SERIES - how many times the message will be scheduled for sending [1...120)
  • DELAY - minimum amount of time (ms) between queued messages

Receiving

Payload: <μs>,<μs>,<μs>,<μs>,...

The message is encoded as time in microseconds for the IR LED to be in a certain state. First one is always ON, and the second one - OFF.

State

State messages transmit an arbitrary amount of bytes, by using the assosicated protocol method Repeats are intended to be handled via the respective PROTOCOL method automatically (and, there's no reliable way besides linking every type with it's method from our side)

Transmitting

Payload: <protocol>:<value>[:<series>][:<delay>]

Required parameters:

  • PROTOCOL - decimal ID, will be converted into a named 'decode_type_t' (ref. IRremoteESP8266.h and it's protocol descriptions)
  • VALUE - hexadecimal representation of the value that will be sent (big endian, maximum depends on the protocol settings)

Optional payload parameters:

  • SERIES - how many times the message will be scheduled for sending (defaults to 1 aka once, [1...120))
  • DELAY - minimum amount of time (ms) between queued messages (defaults is IR_TX_DELAY, applies to every message in the series)

Receiving

Payload: 52:112233445566778899AABB (<protocol>:<value>)

⚠️ **GitHub.com Fallback** ⚠️