MQTT IR transmiter/receiver

I already have mosquitto running TLS secured and really like to keep it that way.
Is there any chance to use your fine tool via mqtts (TLS)? I don’t mean certificate based authentication, but an encrypted connection to the broker would be great.

Hello,

I will try to do this, but I can’t guarantee that it will happen in 2 or 3 weeks :slight_smile:
As I know TLS support with MQTT on ESP it should work.

1 Like

It took more then 3 weeks :slight_smile: but I’ve just uploaded TLS-enabled version of code.

1 Like

I can send the NEC and SAMSUNG codes, but I could not send the raw codes through the broker. Could you give me an example of the topic and message to be published?

Take a look at esp easy has a IR option with sending raw code

1 Like

Either with @mix_at_pl implementation or OpenMQTTGateway you should take a look also to the sendGC function. Global cache database contains a lot of IR codes that you will be able to send with both gateways.

https://irdb.globalcache.com

I followed your short guide, but cannot compile the project. :frowning:

[06/19/17 20:49:34] Processing esp01_1m (build_flags: -DMQTT_MAX_PACKET_SIZE=1500; lib_install: 89, 567, 64; platform: espressif8266; board: d1_mini;
framework: arduino; upload_port: com5; lib_deps: https://github.com/markszabo/IRremoteESP8266/archive/master.zip)
 
Detected non-PlatformIO `lib_install` option in `[env:]` section
Verbose mode can be enabled via `-v, --verbose` option
Collected 28 compatible libraries
Looking for dependencies...

Library Dependency Graph
|-- <IRremoteESP8266> v2.0.3
|-- <EEPROM> v1.0
|-- <DNSServer> v1.1.0
|   |-- <ESP8266WiFi> v1.0
|-- <PubSubClient> v2.6
|-- <WifiManager> v0.12
|   |-- <DNSServer> v1.1.0
|   |   |-- <ESP8266WiFi> v1.0
|   |-- <ESP8266WiFi> v1.0
|   |-- <ESP8266WebServer> v1.0
|   |   |-- <ESP8266WiFi> v1.0
|-- <ArduinoJson> v5.10.1
|-- <ESP8266httpUpdate> v1.1
|   |-- <ESP8266HTTPClient> v1.1
|   |   |-- <ESP8266WiFi> v1.0
|   |-- <ESP8266WiFi> v1.0
|-- <ESP8266WiFi> v1.0
|-- <ESP8266WebServer> v1.0
|   |-- <ESP8266WiFi> v1.0
Compiling .pioenvs\esp01_1m\src\common.o
Compiling .pioenvs\esp01_1m\src\debug.o
Compiling .pioenvs\esp01_1m\src\globals.o
Compiling .pioenvs\esp01_1m\src\main.o
In file included from src\common.cpp:1:0:
src\globals.h:99:9: error: 'IRrecv' does not name a type
extern IRrecv irrecv;
^
src\globals.h:100:9: error: 'IRsend' does not name a type
extern IRsend irsend;
^
src\globals.h:114:22: error: variable or field 'getIrEncoding' declared void
void  getIrEncoding (decode_results *results, char * result_encoding);

src\globals.h:114:22: error: 'decode_results' was not declared in this scope
src\globals.h:114:38: error: 'results' was not declared in this scope
void  getIrEncoding (decode_results *results, char * result_encoding);
^
src\globals.h:114:47: error: expected primary-expression before 'char'

void  getIrEncoding (decode_results *results, char * result_encoding);
^
src\common.cpp:139:22: error: variable or field 'getIrEncoding' declared void
void  getIrEncoding (decode_results *results, char * result_encoding)
^
src\common.cpp:139:22: error: 'decode_results' was not declared in this scope
src\common.cpp:139:38: error: 'results' was not declared in this scope
void  getIrEncoding (decode_results *results, char * result_encoding)
^
src\common.cpp:139:47: error: expected primary-expression before 'char'
void  getIrEncoding (decode_results *results, char * result_encoding)
^
In file included from src\globals.cpp:1:0:
src\globals.h:99:9: error: 'IRrecv' does not name a type
extern IRrecv irrecv;
^
src\globals.h:100:9: error: 'IRsend' does not name a type
extern IRsend irsend;
^
src\globals.h:114:22: error: variable or field 'getIrEncoding' declared void
void  getIrEncoding (decode_results *results, char * result_encoding);
^
src\globals.h:114:22: error: 'decode_results' was not declared in this scope
src\globals.h:114:38: error: 'results' was not declared in this scope
void  getIrEncoding (decode_results *results, char * result_encoding);
^
src\globals.h:114:47: error: expected primary-expression before 'char'
void  getIrEncoding (decode_results *results, char * result_encoding);
^
src\globals.cpp:41:1: error: 'IRrecv' does not name a type
IRrecv irrecv(RECV_PIN);

[..]


src\main.cpp:270:37: error: 'getIrEncoding' was not declared in this scope
getIrEncoding (&results, myTmp);
^
src\main.cpp:292:43: error: 'USECPERTICK' was not declared in this scope
myString+= (results.rawbuf[i] * USECPERTICK);
^
src\main.cpp:330:7: error: 'irsend' was not declared in this scope
irsend.sendRaw(rawIR1, rawIR1size, TRANSMITTER_FREQ);
^
src\main.cpp:346:7: error: 'irsend' was not declared in this scope
irsend.sendRaw(rawIR2, rawIR2size, TRANSMITTER_FREQ);
^
src\main.cpp:361:9: error: 'irsend' was not declared in this scope
irsend.sendRaw(rawIR2, rawIR2size, TRANSMITTER_FREQ);
^
src\main.cpp:377:9: error: 'irsend' was not declared in this scope
irsend.sendRaw(rawIR1, rawIR1size, TRANSMITTER_FREQ);
^
*** [.pioenvs\esp01_1m\src\common.o] Error 1
*** [.pioenvs\esp01_1m\src\debug.o] Error 1
*** [.pioenvs\esp01_1m\src\globals.o] Error 1
*** [.pioenvs\esp01_1m\src\main.o] Error 1
 [ERROR] Took 1.60 seconds

I have no experiance with PlatformIO, yet
What am I doing wrong?

markszabo released a new version of IRremoteESP8266 in June. v2.0 is a complete rewrite hence all the compile errors. You will need to reference the old IRremoteESP8266 code in the PlatformIO.ini file. Change
lib_deps = https://github.com/markszabo/IRremoteESP8266/archive/master.zip
to
lib_deps = https://github.com/markszabo/IRremoteESP8266/archive/v1.2.0.zip

You will of course not be able to take advantage of all markszabo’s continuing improvements.
The alternative is follow markszabo’s notes on how to update (mix_at_pl’s) code - beyond my skills but perhaps mix_at_pl would like to take a look at it…

Yes - thats reason of problem. Temporarly I’ll update repo and start work on mingration to the new version of IRemote. Thanks toggsiii.

Module now works with current version of IRremoteESP8266 library.

1 Like

I cannot compile the project:



Project
mqttir001
.vscode
docs
lib
src
.gitignore
.travis.yml
platformio.ini
README.md
You can split a pane with pane:split-right
16.7 s
platformio run
[01/24/18 10:37:51] Processing esp01_1m (platform: espressif8266; lib_deps: 89, 567, 64, https://github.com/markszabo/
IRremoteESP8266.git; build_flags: -DMQTT_MAX_PACKET_SIZE=1500; board: esp01_1m; framework: arduino)
 
Verbose mode can be enabled via `-v, --verbose` option
Collected 35 compatible libraries
Scanning dependencies...

Library Dependency Graph ( http://bit.ly/configure-pio-ldf )
|-- <PubSubClient> v2.6
|-- <WifiManager> v0.12
|   |-- <ESP8266WiFi> v1.0
|   |-- <ESP8266WebServer> v1.0
|   |   |-- <WiFi> v1.2.7
|   |   |   |-- <SPI> v1.0
|   |   |-- <ESP8266WiFi> v1.0
|   |-- <DNSServer> v1.1.0
|   |   |-- <WiFi> v1.2.7
|   |   |   |-- <SPI> v1.0
|-- <ArduinoJson> v5.13.0
|-- <IRremoteESP8266> v2.3.1 #fce4ccf
Linter
Severity 	Provider 	Description	Line 

interesting
sadly got an IRrecv does not name a type, have to do some further digging

Hi. More than 2 days I’m trying to confugure IR mqtt transmitter using guide from github. I am stucked after boot my ESP-01. Building and uploading were without errors and everything seems ok.

But after connecting VCC to the ESP-01 I have only this message on serial port (74880 baudrate):

ets Jan  8 2013,rst cause:1, boot mode:(3,0)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v614f7c32
~ld

WiFi AP not brings up.
Anybody can help?

ESP-01 wiring connection: VCC 3.3, GND, RX, CH_PD to VCC 3.3. GPIOs free.

Did you ever get this to build? This doesn’t seem to work anymore. Yea… I know… It’s been over a year!

Hi. Leave it out… I’m using IR<>MQTT server from examples of IRremoteESP8266 lib. Just clone this repo from github and flash example IRMQTTServer to your ESP-01 or etc. This is really powerful lib with detalied AC control