Migration to Blynk 2.0 on ESP8266 Board with Infrared IR sketch

It’s #include <IRremote.h> not #include <IRsend.h>

If you have a nodemcu board it should work just fine.

  1. I need #include <IRsend.h>; I’m using it like this to send NEC compatible IR codes:
    BLYNK_WRITE(V17)
    {
    if ( param.asInt() != 0 ) { // debounce
    irsend.sendNEC(0xFF4AB5,32); // “DOWN”
    //-
    Serial.println(“DV17”);
    }
    }
  2. if I change IRremote8266.h to just IRremote.h, I get a compile error
    with no specific error message listed:
    exit status 1
    Error compiling for board NodeMCU 1.0 (ESP-12E Module).

Quick test: Include the library IRsend.h and see if you get a clean compile.
Thanks,
Mike

You’re talking about the IRremoteESP8266 library
right ?

I’m talking about IRremote library.

I’m gonna try the IRremoteESP8266 library, I’ll let you know if I get a clean compile.

1 Like

Hi Mike,
The IRremoteESP8266 library has changed quite a bit in recent releases, and I wonder if you’ve updated the library in the IDE since you uploaded the original code to your Wemos?
Also, I guess you’re using a much later version of the ESP core now.
Have you tried uploading the original sketch to your working board and testing that it still works with your legacy app?

Pete.

I have IRremoteESP8266 version 2.7.20 installed, the latest one showing in my IDE Library.

Not yet …

That was released in August, and you should probably read the “upgrading from pre-V2.0” and “…pre-V2.5” sections of the release notes…

Pete.

1 Like

The older IRremoteESP8266 2.7.15 is what was installed for the legacy Blynk App (I kept notes!!); I bumped to 2.7.20 for Blynk R2. The old “15” worked fine on my project all these months; maybe version “20” is incompatible with Blynk R2. I’ll check out “CrankyOldGIT” in the meantime. Thanks, Pete.

1 Like

1 Like

@John93 OK, clean compile, yes, I get the same thing.
Another test:
Use this statement irsend.sendNEC(0xFF4AB5,32);
in a loop with a delay and plug an IR LED with a current-limiting resistor on GPIO4 and see if you get anything on the LED.
I’m going to do the same thing here. If I don’t, I will look at the CrankyOldGIT updates.
Thanks,
Mike

I couldn’t find an ir led, I’m gonna buy some in the morning and I will keep you updated.

Greetings.

1 Like

My test worked; I disabled all the BLYNK stuff and ran just this loop below.
See pic of my Wemos D1; the RED LED is the status led on the Keyes IR board when it receives a signal flashing every second. This proves all the hardware and the IRsend library are all working like I would expect them to.

void loop()
{
//Blynk.run(); // Fireup the engines …
//timer.run(); // Initiates BlynkTimer
irsend.sendNEC(0xFF4AB5,32); // “DOWN”
delay(1000);
}

Now everything works fine am I right ?

NO – all the BLYNK code is disabled and commented out. Blynk.run is commented out.
All the libraries I used are also included in this simple test sketch but not used…

So it’s blynk issue not library issue.

Well, we don’t know what we don’t know at this point. All my code and hardware work for the classic “0.1” Blynk, just not “2.0”. I’m going to keep playing after dinner here (California) and keep plugging along … thanks for your interest. We’ll figure it out sooner or later.

You don’t have to thank me buddy, I didn’t do anything.

I will keep searching as well.

Have a great day :+1:
Good luck.

1 Like

Success - one of the things that has been updated over the months (years?) was the Arduino IDE itself. Something in the old IDE and the internal libraries it uses assumes that if the hardware pinmode is not defined, output mode is assumed. When I did the preparation for the B2 conversion I made sure I was on the latest IDE (1.8.16 for Windows). Then I updated all my own sketch libraries and did the conversion for B2. But then IR output on pin 4 wasn’t working. The clue was that it was failing the same way on all the different ESP boards I have, so that eliminated hardware. By finally adding the following two statements to the setup void() loop in my code sketch made the sketch come to life and do what it is supposed to:

#define D4 4
pinMode(D4, OUTPUT);

I surmise on the newer IDE compiler, pinmode has to be explicitly defined rather than assumed like it used to work before.

@John93 We captured the flag, John, game over. Pleasure to meet you online.
@PeteKnight Thanks for stopping by; your two cents of advice is always worth much more.
A round of beers on me for everybody in the Lounge now …

Goodnight.

1 Like

I’m so glad your problem has been solved.

1 Like