Skip to content

Naguissa/IR-MQTT-ESP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IR-MQTT-ESP, IR multiple repeater using MQTT for ESP8266 and ESP32 microcontrollers

This is an Arduino sketch created in order to connect several devices and be able to retransmit IR signals among all devices using my ForoElectro.Net MQTT server.

You need one MQTT account: https://www.foroelectro.net/arduino/en/mqtt-doc

You can register it for free.

Important: Dependencies

This library requires several libraries.

Libraries available on IDE Library Manager:

Libraries included in the sketch:

Compilation

You can compile the sketch using Arduino IDE with ESP8266 or ESP32 support.

Sketch upload

This sketch uses LittleFS in order to store configurations. You need to set a minimal SPIFFS space when uploading. It only needs few kbytes.

Configuration is not encrypted, so take it in mind.

Usage

Once uploaded it will be a new WiFi open network available, called IR-MQTT-AP.

Connect to that AP, navigate to http://192.168.4.1, set correct values and save.

After resetting itself it will be connected to your network.

If you enable debug functionality at configuration page you will see a lot of info, as its IP, via serial monitor. If debug is not enabled Serial will not be initialized, letting you use these pins (i.e.: in ESP8266 ESP01)

Hardware

You need one IR emitter (940nm) and one IR receiver. Also, an generic NPN transistor (BC547, 2N3904 or A42 are good examples).

In order to IR emitter work correctly you need the NPN transistor as stated here: https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending

schematic

Configuration

You can change several configurations using following variables on setup page (access ESP IP using same network, by default it's http://192.168.4.1 ):

  • wifi_mode - WiFi mode (C=Client, other=Access Point). By default it starts as AP

  • wifi_ssid - WiFi SSID. By default it's IR-MQTT-ESP

  • wifi_password - WiFi password. By default if's empty, no password

  • mqtt_server - Mqtt server address. By default it's foroelectro.net

  • mqtt_port - Mqtt server port. Byd efault it's 1883

  • clientName - Mqtt client name. It's used to skip resending own messages, each device has to have a different name. By default it's IrMqttEsp

  • ApiKey - ApiKey from https://www.foroelectro.net/arduino/en/mqtt-doc. Get one for free on https://www.foroelectro.net/arduino/en/mqtt-doc

  • email - Email corresponding to your ApiKey. Get one for free on https://www.foroelectro.net/arduino/en/mqtt-doc

  • topic - Subtopic where messages are directed; can be empty if you want. It's empty by default

  • kRecvPin - Pin number where IR demodulator is connected. By default it's 14 (D5 on a NodeMCU board)

  • kIrLed - Pin number where base of NPN transistor to IR emitter is connected. By dfault it's 4 (D2 on a NodeMCU board)

  • kMinLen - Signal minimal length. Default: 10

  • kTimeout - Milli-Seconds of no-more-data before we consider a message ended. By default it's 50

  • debugActive - Serial port debug (1=enabled, other=disabled). By default it's disabled.

Who do I talk to?

Contribute

Any code contribution, report or comment are always welcome. Don't hesitate to use GitHub for that.

Thanks for your support.

Contributors hall of fame: https://www.foroelectro.net/hall-of-fame-f32/contributors-contribuyentes-t271.html

About

IR-MQTT-ESP, IR multiple repeater using MQTT for ESP8266 and ESP32 microcontrollers

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors