Ir blaster using node mcu

Hello Everyone,

I want to make a IR Blaster, using node MCU/esp32 with the help of new blynk 2.0.

I already made it before- put the hex/dec code in sketch and run on the webserver.

but i am trying to make a ir blaster professionally like
[OakRemote: WiFi Universal IR Blaster Remote - Oakter]

Try this library

1 Like

Thanks, #John93 i know about this library little bit,

But my Que is which example

I guess this will be a good start

1 Like

Thank John93, I will read and reserch about this code and then see how it will work in my project.

1 Like

Another good thing to try is store the received IR code in a global variable and use it in your sketch

1 Like

Do you mean something like this…

Pete,

2 Likes

i already made it on MIT APP Inventor

this project has a limitation firstly we need to find HEX/DEC Code then put it on our sketch.

Actually i want to make it for market or we can say for user friendly where user just point out his remote in front of device and user can create own custom remote with he help of app

in our case start at 6:03

You’re not going to be able to recreate that type of functionality within Blynk, in a way that could be used in a commercial product.

Pete.

i am ready to purchase a business plan sir if my project is ready

and yes I am not able to create this type of function on blynk 2.0
I already made it this project with blynk legacy too just find hex/dec code and put it into the sketch

#define BLYNK_PRINT Serial

#if defined(ESP8266)
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#else
#include <WiFi.h>
#endif  // ESP8266
#if defined(ESP32)
#include <BlynkSimpleEsp32.h>
#endif  // ESP32

// IR library
#include <IRremoteESP8266.h>
#include <IRsend.h>

const uint16_t kIrLed = 4;  // ESP8266 GPIO pin to use. Recommended: 4 (D2).
IRsend irsend(kIrLed);  // Set the GPIO to be used to sending the message.

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";

  BLYNK_WRITE(V51) {  // Power button
    if (param.asInt() == 0) {
      // Serial.println("NEC");
      irsend.sendNEC(0x1FE50AF);
    }
  }

  BLYNK_WRITE(V52) {  // Mute button
    if (param.asInt() == 0) {
      // Serial.println("NEC");
      irsend.sendNEC(0x1FE30CF);
    }
  }

  BLYNK_WRITE(V53) {  // Song Forward
    if (param.asInt() == 0) {
      // Serial.println("NEC");
      irsend.sendNEC(0x1FEE01F);
    }
  }

  BLYNK_WRITE(V54) {  // Song Backward
    if (param.asInt() == 0) {
      // Serial.println("NEC");
      irsend.sendNEC(0x1FEA05F);
      delay(10);  // double tap back button to back one song
      irsend.sendNEC(0x1FEA05F);
    }
  }

  BLYNK_WRITE(V55) {  // Volume --
    if (param.asInt() == 0) {
      // Serial.println("NEC");
      irsend.sendNEC(0x1FEC03F);
    }
  }

  BLYNK_WRITE(V56) {  // Volume ++
    if (param.asInt() == 0) {
      // Serial.println("NEC");
      irsend.sendNEC(0x1FE40BF);
    }
  }

  BLYNK_WRITE(V57) {  // Play/Pause
    if (param.asInt() == 0) {
      // Serial.println("NEC");
      irsend.sendNEC(0x1FE32CD);
    }
  }

void setup() {
#if defined(BLYNK_PRINT)
  // Debug console
  Serial.begin(115200);
#endif  // BLYNK_PRINT

  Blynk.begin(auth, ssid, pass);
}

void loop() {
  Blynk.run();
}

I don’t see how that sketch can help you to find the IR codes.

For that you’d need an IR receiver and a way of capturing the received codes and assigning them to a particular virtual pin handler.

Pete.

this sketch works after receiving hex code and we all know how to find hex /dec code using simple sketch

#include <Arduino.h>
#include <IRremoteESP8266.h>
#include <IRrecv.h>
#include <IRutils.h>

// An IR detector/demodulator is connected to GPIO pin 14(D5 on a NodeMCU
// board).
// Note: GPIO 16 won't work on the ESP8266 as it does not have interrupts.
const uint16_t kRecvPin = 14;

IRrecv irrecv(kRecvPin);

decode_results results;

void setup() {
  Serial.begin(115200);
  irrecv.enableIRIn();  // Start the receiver
  while (!Serial)  // Wait for the serial connection to be establised.
    delay(50);
  Serial.println();
  Serial.print("IRrecvDemo is now running and waiting for IR message on Pin ");
  Serial.println(kRecvPin);
}

void loop() {
  if (irrecv.decode(&results)) {
    // print() & println() can't handle printing long longs. (uint64_t)
    serialPrintUint64(results.value, HEX);
    Serial.println("");
    irrecv.resume();  // Receive the next value
  }
  delay(100);
}

So what’s the point that you’re trying to make?

There isn’t a way to replicate the functionality in the video within Blynk, unless you’re prepared to do some manual editing of the dashboard layout and functionality, and probably add entries into the Blynk rules engine when it becomes available. In addition, Alexa / Google Home integration isn’t available in Blynk yet either.

I guess that if you were willing to pay for a white label product then Blynk may be able to add the functionality that you need, but in reality that would make your product unaffordable.

Pete.

1 Like

Thankyou pete let try another way I think mqtt will work for me

I use MQTT for all of my Home Automation projects, but I don’t see how it will help you create a customer friendly solution.

My approach to IR control is to send the appropriate control code via an MQTT message to an ESP8266 based IR sender. It works very well, and by utilising Node-Red I have Amazon Alexa integration, and I have the option to use Blynk as a front-end too.
However, that’s far from being a commercially viable and simple to set-up solution like the one you appear to be looking for.

Pete.

1 Like

Let’s hope for the best
i will definitely try as you are saying.