IR Transmitter ?

Moderators: Voyager, BertB, rtenklooster, Stuntteam, grovkillen, TD-er

Message
Author
GusPS
Normal user
Posts: 23
Joined: 28 Feb 2017, 15:59

Re: IR Transmitter ?

#62 Post by GusPS » 08 Mar 2017, 00:17

Hi.

I finish the RAW Code implementation.

The URL to invoke this method is:

http://192.168.1.101/control?cmd=IRSEND ... 38,512,256

IRSEND: Command Control
Type of IR: RAW
RAW Code as base2hex: 3U0GGL8AGGK588A22K58ALALALAGL1A22LAK45ALALALALALALALALAL1AK5
kHz: 38
Pulse Length: 512
Space Length: 256

Here is the modified _P035_IRTX.ino:

Code: Select all

//#######################################################################################################
//#################################### Plugin 035: Output IR ############################################
//#######################################################################################################

#include <IRremoteESP8266.h>
IRsend *Plugin_035_irSender;

#define PLUGIN_035
#define PLUGIN_ID_035         35
#define PLUGIN_NAME_035       "Infrared Transmit"

boolean Plugin_035(byte function, struct EventStruct *event, String& string)
{
  boolean success = false;

  switch (function)
  {
    case PLUGIN_DEVICE_ADD:
      {
        Device[++deviceCount].Number = PLUGIN_ID_035;
        Device[deviceCount].Type = DEVICE_TYPE_SINGLE;
        Device[deviceCount].SendDataOption = false;
        break;
      }

    case PLUGIN_GET_DEVICENAME:
      {
        string = F(PLUGIN_NAME_035);
        break;
      }

    case PLUGIN_GET_DEVICEVALUENAMES:
      {
        break;
      }

    case PLUGIN_INIT:
      {
        int irPin = Settings.TaskDevicePin1[event->TaskIndex];
        if (Plugin_035_irSender == 0 && irPin != -1)
        {
          addLog(LOG_LEVEL_INFO, "INIT: IR TX");
          Plugin_035_irSender = new IRsend(irPin);
          Plugin_035_irSender->begin(); // Start the sender
        }
        if (Plugin_035_irSender != 0 && irPin == -1)
        {
          addLog(LOG_LEVEL_INFO, "INIT: IR TX Removed");
          delete Plugin_035_irSender;
          Plugin_035_irSender = 0;
        }
        success = true;
        break;
      }

    case PLUGIN_WRITE:
      {
        String IrType;
        unsigned long IrCode;
        unsigned int IrBits;
        char log[120];

        char command[120];
        command[0] = 0;
        char TmpStr1[100];
        TmpStr1[0] = 0;
        string.toCharArray(command, 120);

        String cmdCode = string;
        int argIndex = cmdCode.indexOf(',');
        if (argIndex) cmdCode = cmdCode.substring(0, argIndex);

        if (cmdCode.equalsIgnoreCase("IRSEND") && Plugin_035_irSender != 0)
        {
          success = true;
          if (irReceiver != 0) irReceiver->disableIRIn(); // Stop the receiver

          if (GetArgv(command, TmpStr1, 2)) IrType = TmpStr1;

          if (IrType.equalsIgnoreCase("RAW")) {
            String IrRaw;
            unsigned int IrHz;
            unsigned int IrPLen;
            unsigned int IrBLen;

            if (GetArgv(command, TmpStr1, 3)) IrRaw = TmpStr1;
            if (GetArgv(command, TmpStr1, 4)) IrHz = str2int(TmpStr1);
            if (GetArgv(command, TmpStr1, 5)) IrPLen = str2int(TmpStr1);
            if (GetArgv(command, TmpStr1, 6)) IrBLen = str2int(TmpStr1);

            printWebString += F("<a href='https://en.wikipedia.org/wiki/Base32#base32hex'>Base32Hex</a> RAW Code: ");
            printWebString += IrRaw;
            printWebString += F("<BR>");

            printWebString += F("kHz: ");
            printWebString += IrHz;
            printWebString += F("<BR>");

            printWebString += F("Pulse Len: ");
            printWebString += IrPLen;
            printWebString += F("<BR>");

            printWebString += F("Blank Len: ");
            printWebString += IrBLen;
            printWebString += F("<BR>");

            unsigned int buf[200];
            unsigned int idx = 0;
            unsigned int c0 = 0;
            unsigned int c1 = 0;

            printWebString += F("Interpreted RAW Code: ");
            for(int i = 0; i < IrRaw.length(); i++)
            {
              char c = ((IrRaw[i] | ('A' ^ 'a')) - '0') % 39;

              for (unsigned int shft = 1; shft < 6; shft++)
              {
                if ((c & 16) != 0) {
                  c1++;
                  if (c0 > 0) {
                    buf[idx++] = c0 * IrBLen;
                    for (uint t = 0; t < c0; t++)
                      printWebString += F("0");
                  }
                  c0 = 0;
                } else {
                  if (c0+c1 != 0) {
                    c0++;
                    if (c1 > 0) {
                      buf[idx++] = c1 * IrPLen;
                      for (uint t = 0; t < c1; t++)
                        printWebString += F("1");
                    }
                    c1 = 0;
                  }
                }
                c <<= 1;
              }
            }

            if (c0 > 0) {
              buf[idx] = c0 * IrBLen;
              for (uint t = 0; t < c0; t++)
                printWebString += F("0");
            }
            if (c1 > 0) {
              buf[idx] = c1 * IrPLen;
              for (uint t = 0; t < c1; t++)
                printWebString += F("1");
            }

            printWebString += F("<BR>");

            Plugin_035_irSender->sendRaw(buf, idx+1, IrHz);

            //sprintf_P(log, PSTR("IR Params1: Hz:%u - PLen: %u - BLen: %u"), IrHz, IrPLen, IrBLen);
            //addLog(LOG_LEVEL_INFO, log);
            //sprintf_P(log, PSTR("IR Params2: RAW Code:%s"), IrRaw.c_str());
            //addLog(LOG_LEVEL_INFO, log);
          } else {
            if (GetArgv(command, TmpStr1, 2)) IrType = TmpStr1;
            if (GetArgv(command, TmpStr1, 3)) IrCode = strtoul(TmpStr1, NULL, 16); //(long) TmpStr1
            if (GetArgv(command, TmpStr1, 4)) IrBits = str2int(TmpStr1);

            if (IrType.equalsIgnoreCase("NEC")) Plugin_035_irSender->sendNEC(IrCode, IrBits);
            if (IrType.equalsIgnoreCase("JVC")) Plugin_035_irSender->sendJVC(IrCode, IrBits, 2);
            if (IrType.equalsIgnoreCase("RC5")) Plugin_035_irSender->sendRC5(IrCode, IrBits);
            if (IrType.equalsIgnoreCase("RC6")) Plugin_035_irSender->sendRC6(IrCode, IrBits);
            if (IrType.equalsIgnoreCase("SAMSUNG")) Plugin_035_irSender->sendSAMSUNG(IrCode, IrBits);
            if (IrType.equalsIgnoreCase("SONY")) Plugin_035_irSender->sendSony(IrCode, IrBits);
            if (IrType.equalsIgnoreCase("PANASONIC")) Plugin_035_irSender->sendPanasonic(IrBits, IrCode);
          }

          addLog(LOG_LEVEL_INFO, "IR Code Sent");
          if (printToWeb)
          {
            printWebString += F("IR Code Sent ");
            printWebString += IrType;
            printWebString += F("<BR>");
          }

          if (irReceiver != 0) irReceiver->enableIRIn(); // Start the receiver
        }
        break;
      }
  }
  return success;
}
I've tested it with 2 buttons on different remotes.

1)
The red on/off button on "Top House" control:
Image
Here is the Hex Bin file generated by IR Toy:
http://filebin.ca/3En22WfhfTDj/onoff_tophouse.bin

2)
The blue on/off button on Delonghi Air Conditioner:
Image
Here is the Hex Bin file generated by IR Toy:
http://filebin.ca/3En2d3V91y99/onoff_delonghi.bin
In this case, the control sends a different code to turn on and to turn off. The file corresponds to "turn on".


The bin files format are described here: http://dangerousprototypes.com/docs/USB ... pling_mode
I save those files as .bin using GTKTerm on Linux.

To convert the .bin file into a base32hex string, I run (previously the variables pulse_len ad blank_len must be seted):

Code: Select all

#!/usr/bin/python

b32 = "0123456789ABCDEFGHIJKLMNOPQRSTUV"
b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

def bits32(bits):
    rdo = ""
    while len(bits) > 0:
        subBits = bits[-5:]
        bits = bits[:-5]
        rdo = b32[int(subBits,2)] + rdo
    return rdo

def bits64(bits):
    rdo = ""
    while len(bits) > 0:
        subBits = bits[-6:]
        bits = bits[:-6]
        rdo = b64[int(subBits,2)] + rdo
    return rdo

bits = ""
#pulse_len = 550
#blank_len = 550
pulse_len = 533
blank_len = 277

idx = 0
with open("onoff_delonghi.bin", "rb") as f:
    byte = f.read(1)
    while byte != "":
        idx += 1
        if idx % 4 == 1 or idx % 4 == 3:
            byte_h = ord(byte)
        if idx % 4 == 2 or idx % 4 == 0:
            measure = ord(byte) + (byte_h << 8)
            if measure != 0xFFFF:
                ms = measure * 21.3333
                mtype = "Blank"
                bv = "0"
                ds = blank_len
                if idx % 4 == 2:
                    mtype = "Pulse"
                    bv = "1"
                    ds = pulse_len
                cbits = round(ms / ds,0)
                print "%s: %s - %u ms - cbits: %.3g" % \
                    (mtype, format(measure, '04x'), ms, cbits)

                for i in range (0, int(cbits)):
                    bits += bv

        # Do stuff with byte.
        byte = f.read(1)

print "Rdo: %s\nHex: %s\nB32: %s\nB64: %s" % (bits,hex(int(bits,2)),bits32(bits), bits64(bits))
The things about base 64 where just for testing purpouses.

The resulting output is like:
Pulse: 0018 - 511 ms - cbits: 1
Blank: 000e - 298 ms - cbits: 1
Pulse: 0018 - 511 ms - cbits: 1
Blank: 0030 - 1023 ms - cbits: 4
Pulse: 0018 - 511 ms - cbits: 1
Blank: 000e - 298 ms - cbits: 1
Pulse: 0018 - 511 ms - cbits: 1
Rdo: 111111000000100001000010101010000101010000100001010000101010000100001010000100001010100001010100001010101010101010101010101010101010100001010100001010100001000010101010101010100001000010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010100001010101010000101
Hex: 0x1f8108550a8428542142150a85555555550a85421555421555555555555555555555550aa85L
B32: 3U0GGL8AGGK588A22K58ALALALAGL1A22LAK45ALALALALALALALALAL1AK5
B64: H4EIVQqEKFQhQhUKhVVVVVUKhUIVVUIVVVVVVVVVVVVVVVUKqF
The base32hex string that should be used is "B32".

For now, I think it's a start.

Things to improve:
  • Improve Python script to accept params instead of setting it in the code.
  • Improve Python script to read "space / pulse" text files
  • Improve Python script to automatically determine pulse and blank length
  • Improve _P016_IR.ino to inform a base32hex in case an Unkown Type is received.
  • Suggest the _P035_IRTX.ino diffs to be accepted on master branch. (I've to read about how to do it)
Any doubts, suggestion, comments, etc, are welcome!
Gustavo.

GusPS
Normal user
Posts: 23
Joined: 28 Feb 2017, 15:59

Re: IR Transmitter ?

#63 Post by GusPS » 08 Mar 2017, 04:48

GusPS wrote:
08 Mar 2017, 00:17
  • Suggest the _P035_IRTX.ino diffs to be accepted on master branch. (I've to read about how to do it)
Done!. Forked on https://github.com/GusPS/ESPEasy and created a Pull Request. ;)

lacco
Normal user
Posts: 7
Joined: 19 Mar 2017, 00:46

Re: IR Transmitter ?

#64 Post by lacco » 19 Mar 2017, 01:04

Hey everyone,
I've tried to use the send RAW function but without success so far. The hardware part should be okay, it works with other devices.

From the raw data (see below) I thought that these were the correct parameters:
Blank: 450
Pulse: 1200 (I also tried 400 without success)
Binary: 001010100100110000000010100001100100100011001100
(using https://www.translatorscafe.com/unit-co ... bers/4-35/ to convert)
Base32: 1040G04012000000104000480200G008G0480
URL: http://192.168.1.180/control?cmd=IRSEND ... 8,1200,450

Heres what I recorded with the IRRemote library from the button (its from an Denon AVR-1612 receiver):

Code: Select all

Encoding  : UNKNOWN
Code      : 77DE9340 (32 bits)
Timing[99]: 
     +3300, -1650     + 450, - 400     + 450, - 400     + 400, -1250
     + 450, - 400     + 400, -1250     + 400, - 450     + 400, -1250
     + 400, - 450     + 400, - 400     + 450, -1200     + 450, - 400
     + 400, - 450     + 400, -1200     + 450, -1250     + 400, - 450
     + 400, - 400     + 400, - 450     + 400, - 450     + 400, - 400
     + 450, - 350     + 450, - 400     + 450, - 400     + 400, -1250
     + 450, - 400     + 400, -1250     + 400, - 450     + 400, - 400
     + 450, - 400     + 400, - 450     + 400, -1250     + 400, -1250
     + 400, - 450     + 400, - 400     + 450, -1200     + 450, - 400
     + 400, - 450     + 400, -1250     + 400, - 450     + 400, - 400
     + 450, - 400     + 400, -1250     + 400, -1250     + 450, - 400
     + 400, - 400     + 450, -1200     + 450, -1200     + 450, - 450
     + 400, - 400     + 450
unsigned int  rawData[99] = {3300,1650, 450,400, 450,400, 400,1250, 450,400, 400,1250, 400,450, 400,1250, 400,450, 400,400, 450,1200, 450,400, 400,450, 400,1200, 450,1250, 400,450, 400,400, 400,450, 400,450, 400,400, 450,350, 450,400, 450,400, 400,1250, 450,400, 400,1250, 400,450, 400,400, 450,400, 400,450, 400,1250, 400,1250, 400,450, 400,400, 450,1200, 450,400, 400,450, 400,1250, 400,450, 400,400, 450,400, 400,1250, 400,1250, 450,400, 400,400, 450,1200, 450,1200, 450,450, 400,400, 450};  // UNKNOWN 77DE9340
I guess I didn't really understand how to derive the binary code from the raw timings - could someone help me out here?

GusPS
Normal user
Posts: 23
Joined: 28 Feb 2017, 15:59

Re: IR Transmitter ?

#65 Post by GusPS » 19 Mar 2017, 16:15

Hi lacco,

Try with "VS58KA58L25AMKA5AH2KAHAH2K8L"

URL:
http://192.168.1.180/control?cmd=IRSEND ... 38,400,400

I've calculated these values:

Code: Select all

Pulse: 3300 ms - cbits: 8
Space: 1650 ms - cbits: 4
Pulse: 450 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 450 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 1250 ms - cbits: 3
Pulse: 450 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 1250 ms - cbits: 3
Pulse: 400 ms - cbits: 1
Space: 450 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 1250 ms - cbits: 3
Pulse: 400 ms - cbits: 1
Space: 450 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 450 ms - cbits: 1
Space: 1200 ms - cbits: 3
Pulse: 450 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 450 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 1200 ms - cbits: 3
Pulse: 450 ms - cbits: 1
Space: 1250 ms - cbits: 3
Pulse: 400 ms - cbits: 1
Space: 450 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 450 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 450 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 450 ms - cbits: 1
Space: 350 ms - cbits: 0
Pulse: 450 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 450 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 1250 ms - cbits: 3
Pulse: 450 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 1250 ms - cbits: 3
Pulse: 400 ms - cbits: 1
Space: 450 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 450 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 450 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 1250 ms - cbits: 3
Pulse: 400 ms - cbits: 1
Space: 1250 ms - cbits: 3
Pulse: 400 ms - cbits: 1
Space: 450 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 450 ms - cbits: 1
Space: 1200 ms - cbits: 3
Pulse: 450 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 450 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 1250 ms - cbits: 3
Pulse: 400 ms - cbits: 1
Space: 450 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 450 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 1250 ms - cbits: 3
Pulse: 400 ms - cbits: 1
Space: 1250 ms - cbits: 3
Pulse: 450 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 450 ms - cbits: 1
Space: 1200 ms - cbits: 3
Pulse: 450 ms - cbits: 1
Space: 1200 ms - cbits: 3
Pulse: 450 ms - cbits: 1
Space: 450 ms - cbits: 1
Pulse: 400 ms - cbits: 1
Space: 400 ms - cbits: 1
Pulse: 450 ms - cbits: 1
Rdo: 11111111000010101000101000101000101010001010100010001010101010110101000101000101010101000100010101000101010001010101000100010101000100010101
Hex: 0xff0a8a28a8a88aab5145544545455115115L
B32: VS58KA58L25AMKA5AH2KAHAH2K8L


Let me know it it works. Also check if "38" is the correct Hz. Also try 36 or 40.

As you can see, i've used 400ms for both space & pulse. This would lead to not so precise values. If I choose 50ms, i get this b32 string: 3VVVVVVVVVVVVU0000007VG1VS0FU00001VS0FU00001VO0FU00001VO0FU07VG0000VU07V01VO0000FV00000VS07V03VG0VS07V03VO1VS0FV03VG0000FV03VG0000FU03VG1VS0FU03VG0000FU00001VO0FU07VG0000VU07V01VO00007V01VO0VU07V00000VS00003VO0VS0FV00001VS00007VG0VS0FV

That would replicate EXACT timings, BUT it is too large (235 chars) for ESPEasy URL. :(

lacco
Normal user
Posts: 7
Joined: 19 Mar 2017, 00:46

Re: IR Transmitter ?

#66 Post by lacco » 19 Mar 2017, 23:58

Hey GusPS,
thanks for your effort! Unfortunately I couldnt get it to work yet :(
I've tried your suggestions, plus I replaced "cbits: 0" with "cbits: 1" because I thought there should be a space as well, but no luck so far. 36 or 40 Hz didn't work either.

I've created a spreadsheet to generate the binary code automatically, so others might use that, too:
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Any other ideas would be appreciated!

GusPS
Normal user
Posts: 23
Joined: 28 Feb 2017, 15:59

Re: IR Transmitter ?

#67 Post by GusPS » 20 Mar 2017, 00:49

Didn't notice there where one "cbits=0"!!!!... That's important. Luckly you saw it.

Very good spreadsheet! Thanks!

A few Qs:

1. How are you getting the byte array? Is weird to me that the timings are so precise!. IRRemote library can be so precise like that? I use IR Toy, and the Sampling Mode always gives me some minimal differences between tests.
2. If you use the ESPEasy with the base32 value against the IRRemote library, which result do you get?
3. What about using 150 as "space" and "pulse? That's giving me ---> FVVVS01PPG1PG1HG1HJG1PHG1O0OPHHJJJJ03J03376606066E0766066EC0C0ECS0E0737
That's 71 chars and I think is enough for the URL buffer.
4. As stated in this page (http://mc.mikrocontroller.com/de/IR-Pro ... .php#DENON - Use google to translate it to English), the Denon protocol uses 32Khz. Try all those tests, even the previous ones, changing it.
5. Also, try to get more info about your controller in http://irdb.tk

Let me know when you test it.
As the last resort, if you are sure that the protocol is the Denon, there's the possibility to implement it like the RC5 or Panasonic, etc... in which case you could finally use the 32 bits code (in your example the number 77DE9340)

PD: More info about Denon protocol -----> http://read.pudn.com/downloads157/sourc ... ts%202.PDF

Shardan
Normal user
Posts: 1002
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: IR Transmitter ?

#68 Post by Shardan » 30 Mar 2017, 20:01

Hello all,

for those who have difficulties with the hardware here is the schematic and PCB layout
including silks for the IR-TX-RX shown in post #57.
IRTXRX-v2.1.pdf.zip
(139.12 KiB) Downloaded 307 times
The version has some slight changes over the photos from #57 to improve the IR-receiver.
I've five of these modules running atm so i can say it is proven to work.

You may use different IR LED types. Beware, you have to adapt R4 and R5 to your LED type!
Most LEDs can take 20..30 mA. As they are pulse driven here they can take much more, but
be carefull.

The PCB is designed for four LEDs to give high IR power. You may ommit one of the paths, for example D1/D2/R4.

R3 is optional, some FET transistor types need it, some not. So i designed it into the PCB
The IRLL014 does not need it.

For easy flashing RX, TX and reset are lead out to pins.
The jumper P6 gives GND for flashing and allows jumpering to flash mode.

Happy tinkering :)

Regards
Shardan
Regards
Shardan

nick-head
Normal user
Posts: 41
Joined: 15 Nov 2016, 11:09
Location: North East UK

Re: IR Transmitter ?

#69 Post by nick-head » 16 Apr 2017, 11:06

How about an IR Repeater ?

Then it doesn't matter about protocols , does it ?

Many of us have lots of ESP's that we can put around the house and utilise a common receiver to control
appliances in a different room.

Or am I being too presumptuous?
ESP32, Arduino's,Raspberry Pi's, ESP8266's, Nextion's, Sonoff's, LightWaveRF's, RFXCom 433, and a headache
And a HackRF One, as a present to myself.

NietGiftig
Normal user
Posts: 103
Joined: 16 Sep 2015, 20:32

Re: IR Transmitter ?

#70 Post by NietGiftig » 16 Apr 2017, 13:26

nick-head wrote:
16 Apr 2017, 11:06
How about an IR Repeater ?
Many of us have lots of ESP's that we can put around the house and utilise a common receiver to control
appliances in a different room.
Would like to have that !!

bobbybeans
Normal user
Posts: 115
Joined: 26 Feb 2017, 17:30

Re: IR Transmitter ?

#71 Post by bobbybeans » 08 May 2017, 23:16

Hey there wow ! lots of work has been done since a few months ago i love it!. I already use this plugin for some IR LED RGB candles. have them working great. However I just bought a Future 40watt air purifier and decoded the signals exactly the same way i did in my original post for the candles
https://www.letscontrolit.com/forum/vie ... php?t=2761

however.. this is not identified as any standard protocol by the arduino or the raspberry pi.
It does give me a hex but it wont work as it doesn't know the protocol. So I thought id check back up on this and sure enough its been updated. However I am having trouble with even just compiling it. then i was going to use the raw output to see if i could get it working
I have taken your for Gusps that has seemed to be updated 26 days ago and i updated the IR libraries. is that the final version? because i get errors when trying to compile it and i have updated to the latest IR library as well
here is what I am getting. Suggestions?

Code: Select all


_P035_IRTX:14: error: missing terminating " character
_P035_IRTX:23: error: stray '\' in program
_P035_IRTX:23: error: stray '\' in program
_P035_IRTX:130: error: missing terminating ' character
_P035_IRTX:167: error: missing terminating " character
_P035_IRTX:369: error: too many decimal points in number
_P035_IRTX:379: error: too many decimal points in number
_P035_IRTX:389: error: too many decimal points in number
_P035_IRTX:399: error: too many decimal points in number
_P035_IRTX:409: error: too many decimal points in number
_P035_IRTX:440: error: exponent has no digits
_P035_IRTX:447: error: stray '\' in program
_P035_IRTX:538: error: stray '#' in program
_P035_IRTX:547: error: stray '#' in program
_P035_IRTX:560: error: stray '#' in program
_P035_IRTX:564: error: stray '#' in program
_P035_IRTX:568: error: stray '#' in program
_P035_IRTX:816: error: stray '#' in program
_P035_IRTX:816: error: stray '#' in program
_P035_IRTX:841: error: stray '#' in program
_P035_IRTX:849: error: stray '#' in program
_P035_IRTX:913: error: stray '#' in program
_P035_IRTX:1014: error: stray '#' in program
_P035_IRTX:1014: error: stray '#' in program
_P035_IRTX:1014: error: stray '#' in program
_P035_IRTX:1014: error: stray '#' in program
_P035_IRTX:1014: error: stray '#' in program
_P035_IRTX:1014: error: stray '#' in program
_P035_IRTX:1294: error: stray '#' in program
_P035_IRTX:1302: error: stray '#' in program
_P035_IRTX:1335: error: stray '#' in program
_P035_IRTX:1345: error: missing terminating ' character
_P035_IRTX:1363: error: missing terminating " character
_P035_IRTX:1395: error: missing terminating ' character
_P035_IRTX:7: error: expected unqualified-id before '<' token
_P035_IRTX:547: error: expected unqualified-id before '<' token
_P035_IRTX:547: error: expected unqualified-id before '<' token
_P035_IRTX:551: error: expected unqualified-id before '<' token
_P035_IRTX:568: error: expected unqualified-id before '<' token
_P035_IRTX:568: error: expected unqualified-id before '<' token
_P035_IRTX:577: error: 'string' does not name a type

Edit: i am an idiot. i right click saved as on the new plugin and it saved the htm file not the plugin... however still having trouble with compiling
now i get this, and it never finishes compiling just stays and does this forever

Code: Select all

 java.util.regex.Pattern$GroupTail.match(Pattern.java:4717)
	at java.util.regex.Pattern$BranchConn.match(Pattern.java:4568)
	at java.util.regex.Pattern$CharProperty.match(Pattern.java:3777)
	at java.util.regex.Pattern$Branch.match(Pattern.java:4604)
	at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
	at java.util.regex.Pattern$Loop.match(Pattern.java:4785)
	at java.util.regex.Pattern$GroupTail.match(Pattern.java:4717)

GusPS
Normal user
Posts: 23
Joined: 28 Feb 2017, 15:59

Re: IR Transmitter ?

#72 Post by GusPS » 09 May 2017, 00:09

That java stuff seems weird.
I remember not having any problems compiling using Atom following the guide that's on the site: https://www.letscontrolit.com/wiki/inde ... Platformio

I'll double check everything in your case.
Regards!

bobbybeans
Normal user
Posts: 115
Joined: 26 Feb 2017, 17:30

Re: IR Transmitter ?

#73 Post by bobbybeans » 09 May 2017, 12:42

yeah I thought that was weird too. I removed the plugin and it compiled fine
I put back my original ir library as well

I will try again tonight starting from scratch. I copied the raw code from github into notepad then saved it
could have been tired not sure

I will also follow thi guide

bobbybeans
Normal user
Posts: 115
Joined: 26 Feb 2017, 17:30

Re: IR Transmitter ?

#74 Post by bobbybeans » 19 May 2017, 20:57

Well I got the ir plugin working. I just gave up on compiling and downloaded the easy esp mega 2.0.0 dev8 branch bin file and flashed....
now I am a big confused
I was using the excel doc provided back a page and i am not getting anything to work main because it looks like my IR code is a lot shorter than what you guys have

While yes I would like to know the answer. More importantly I would like to know how you figured it out with the info below as I have other buttons I want to convert. This is pulled from my arduino using irrecdumpv2

Code: Select all


Encoding  : UNKNOWN
Code      : A32AB931 (32 bits)
Timing[23]: 
     +1350, - 300     +1350, - 300     + 550, -1150     +1350, - 300
     +1350, - 350     + 500, -1150     + 550, -1100     + 550, -1150
     + 500, -1150     + 550, -1100     + 550, -1150     +1350
unsigned int  rawData[23] = {1350,300, 1350,300, 550,1150, 1350,300, 1350,350, 500,1150, 550,1100, 550,1150, 500,1150, 550,1100, 550,1150, 1350};  // UNKNOWN A32AB931


I also added a receiver on the esp and piped it into domoticz dummy text to track the stuff it was sending. Here it is, 4140943054 is the most common which is similar to what I was getting with my arduino. Not in a sense of the same number but it was not the same every single time and there was a common them of 1 out of maybe 3-4 times I hit the button it would be A32AB931 or in domoticz case 4140943054. I dont know what this number is. is this hex? just a number? if so how would I send it?

Code: Select all

2017-05-19 20:06:03	2582915280
2017-05-19 20:06:02	4140943054
2017-05-19 20:05:53	3658147960
2017-05-19 20:05:52	4140943054
2017-05-19 20:05:45	3117192660
2017-05-19 20:05:44	4140943054
2017-05-19 20:05:38	2737486129
2017-05-19 20:05:37	4140943054

GusPS
Normal user
Posts: 23
Joined: 28 Feb 2017, 15:59

Re: IR Transmitter ?

#75 Post by GusPS » 19 May 2017, 22:35

Try this URL:

http://x.x.x.x/control?cmd=IRSEND,RAW,7 ... 38,170,150

7VJVPO1VSVUE0E0E0E0E0E0FV es de Base32 if this sequence: 111111111001111111110011100000001111111110011111111100111000000011100000001110000000111000000011100000001110000000111111111
having 170 and 150 as pulse and silence respectively.

If it doesn't work, make sure you have a 38khz sender. If not, change that number to your khz control.
Other thing to try is to be closer to the decive.

Let us know if it work.

bobbybeans
Normal user
Posts: 115
Joined: 26 Feb 2017, 17:30

Re: IR Transmitter ?

#76 Post by bobbybeans » 19 May 2017, 23:26

GusPS wrote:
19 May 2017, 22:35
Try this URL:

http://x.x.x.x/control?cmd=IRSEND,RAW,7 ... 38,170,150

7VJVPO1VSVUE0E0E0E0E0E0FV es de Base32 if this sequence: 111111111001111111110011100000001111111110011111111100111000000011100000001110000000111000000011100000001110000000111111111
having 170 and 150 as pulse and silence respectively.

If it doesn't work, make sure you have a 38khz sender. If not, change that number to your khz control.
Other thing to try is to be closer to the decive.

Let us know if it work.
Unfortunately that did not work. :( I moved my device within about half a meter to the IR. I have confirmed that it actually sending via putting the led next to the receiver and it does catch something.
It is 38khz sender and receiver. I have no clue if my remote is though however based on googling A32AB931
This code is an on off switch for a heater which is the same on off for my air purifier
http://www.remotecentral.com/cgi-bin/mb ... d.cgi?9724
and another thread confirmed it was 38 khz
https://arduino.stackexchange.com/quest ... ote-heater
this is not definitive proof that my remote is 38khz but it at least seems plasible

how did you calculate the 170 and 150 pulse? I dont see that anywhere in the raw data? also how did you come up with the binary? I realize you probably took the raw and converted it somehow but how? once I have the binary I can easily use a base32 converter online

angelosub
Normal user
Posts: 9
Joined: 26 Jan 2017, 12:59
Location: Italy

Re: IR Transmitter ?

#77 Post by angelosub » 28 May 2017, 21:32

I have don't understand extrapolate a RAW data from IR transmitter.
I have try to receive a IR code with a P016 plugin "Infrared Receiv - TSOP4838". In house I have TSOP4136 ad I have used this, the difference is the IR frequencies. TSOP4838 38kHz TSOP4136 36kHz. I hope isn't a problem.

When I push the on/off button of the IR transmitter the ESPEasy receive 2 codes HEX:
800ff and ffffffff

I don't understand how convert this HEX values to a RAW for sending the code with a ESPEasy.
http://<ip address>/control?cmd=IRSEND,RAW,code,kHZ,Pulse Len, Blank Len
kHZ = 38 It's correct?

thanks for help.

GusPS
Normal user
Posts: 23
Joined: 28 Feb 2017, 15:59

Re: IR Transmitter ?

#78 Post by GusPS » 29 May 2017, 01:19

bobbybeans wrote:
19 May 2017, 23:26
GusPS wrote:
19 May 2017, 22:35
Try this URL:

http://x.x.x.x/control?cmd=IRSEND,RAW,7 ... 38,170,150

7VJVPO1VSVUE0E0E0E0E0E0FV es de Base32 if this sequence: 111111111001111111110011100000001111111110011111111100111000000011100000001110000000111000000011100000001110000000111111111
having 170 and 150 as pulse and silence respectively.

If it doesn't work, make sure you have a 38khz sender. If not, change that number to your khz control.
Other thing to try is to be closer to the decive.

Let us know if it work.
Unfortunately that did not work. :( I moved my device within about half a meter to the IR. I have confirmed that it actually sending via putting the led next to the receiver and it does catch something.
It is 38khz sender and receiver. I have no clue if my remote is though however based on googling A32AB931
This code is an on off switch for a heater which is the same on off for my air purifier
http://www.remotecentral.com/cgi-bin/mb ... d.cgi?9724
and another thread confirmed it was 38 khz
https://arduino.stackexchange.com/quest ... ote-heater
this is not definitive proof that my remote is 38khz but it at least seems plasible

how did you calculate the 170 and 150 pulse? I dont see that anywhere in the raw data? also how did you come up with the binary? I realize you probably took the raw and converted it somehow but how? once I have the binary I can easily use a base32 converter online
Hi bobbybeans,

The IR code is just a few PULSE and BLANK sequence, where PULSE is a 38khz burst of IR light, and BLANK is no light at all. Viewing at your rawData array, you can see that your remote is sending 1350 millisecs of PULSE and then 300 ms of BLANK, then again 1350 of PULSE and the 300 of BLANK, 550 of PULSE, and 1150 of BLANK, and so on.
When you know the Protocol that is being used, you can "compress" the PULSE and BLANK data according to the protocol spec, which can be written with a few chars.
The RAW option I've added to the _P035_IRTX plugin, aims to address the situation where you can't decode or don't know the used protocol. If you were able to just send in the ESPEasy URL your array (1350,300, 1350,300, 550,1150, 1350,300, 1350,350, 500,1150, 550,1100, 550,1150, 500,1150, 550,1100, 550,1150, 1350), your remote signal will most likely to work ok. BUT, that URL has some limit on the length, being necesary to reduce it as much as possible.
That's why that array of PULSE and BLANK will be written in base32.

Take a look at this post #62 : https://www.letscontrolit.com/forum/vie ... 030#p14030

The key is to find the best length for PULSE and BLANK. If your array were 1400 and 500 only, you should use 1400 for pulse and 500 for blank (that's too obvious). So the binary expression will be "10". If you choose 700 and 500, then the binary will be: "110".
But, when you have in your array different values, the selected values should be the closest higher multiplier possible. That's why I choose 170 and 150. Of course you could lower those values, but the resulting B32 will be longer and maybe you reach the URL limit. (I don't recall what it is).

Seeing at the resulting binary I gave you, I saw that the first sequence of "1" count 9 instead of 8. 8 will be more accurate (8*170=1360). Maybe that's the reason why it doesn't work. This could mean a bug in the Python script.
You could also use the Excel converter the other member uploaded a few post earlier and see what's the result.

Then, after you have the binary sequence, this is just writter as base32 as a compression method to be less in length for the URL.

Have a look at it, check the Python script, and ask me if you need more detail.
Regards.
Gustavo.

GusPS
Normal user
Posts: 23
Joined: 28 Feb 2017, 15:59

Re: IR Transmitter ?

#79 Post by GusPS » 29 May 2017, 01:30

angelosub wrote:
28 May 2017, 21:32
I have don't understand extrapolate a RAW data from IR transmitter.
I have try to receive a IR code with a P016 plugin "Infrared Receiv - TSOP4838". In house I have TSOP4136 ad I have used this, the difference is the IR frequencies. TSOP4838 38kHz TSOP4136 36kHz. I hope isn't a problem.

When I push the on/off button of the IR transmitter the ESPEasy receive 2 codes HEX:
800ff and ffffffff

I don't understand how convert this HEX values to a RAW for sending the code with a ESPEasy.
http://<ip address>/control?cmd=IRSEND,RAW,code,kHZ,Pulse Len, Blank Len
kHZ = 38 It's correct?

thanks for help.
Hi angelusb,
You need to grab the PULSE and BLANK timings to be able to generate the RAW data.
To do this, I use the http://dangerousprototypes.com/docs/USB_Infrared_Toy
Other people use IRrecvDump for Arduino.
The P016 is not good to get the timings for unkown protocols.

After you have those values, you can use the Python script or the Excel sheet to generate de Base32 chars.

Let me know about any doubts.
Gustavo.

ged
Normal user
Posts: 8
Joined: 15 Oct 2016, 07:04

Re: IR Transmitter ?

#80 Post by ged » 30 May 2017, 18:22

I'm now struggling with this as well... Trying to get a Bionaire Space Heater to do my bidding.

I took a hack on the spreadsheet and added some code to do the Bin to Base32 in the sheet and used GCD to look for Pulse and Space... (my work is here: https://docs.google.com/spreadsheets/d/ ... AB3Kbq7vWU)

My data looks like this (captured from ESP8266 IRrecvDumpV2):
unsigned int rawData[47] = {1300,400, 1300,400, 450,1250, 1300,400, 1300,450, 450,1300, 450,1250, 450,1250, 450,1250, 1300,450, 450,1250, 450,7850, 1300,400, 1300,400, 450,1250, 1300,450, 1300,450, 450,1250, 450,1250, 450,1250, 450,1250, 1300,450, 450,1250, 450}; // UNKNOWN DE7C1C3
It's obvious that the pulse and space are all multiples of 50 (could that be the limit of timing resolution on the ESP8266?), GCD confirms that multiple for this data.
Pulse (Greatest Common Denominator) 50
Blank/Space GCD 50

Binary String 11111111111111111111111111000000001111111111111111111111111100000000111111111000000000000000000000000011111111111111111111111111000000001111111111111111111111111100000000011111111100000000000000000000000000111111111000000000000000000000000011111111100000000000000000000000001111111110000000000000000000000000111111111111111111111111110000000001111111110000000000000000000000000111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111000000001111111111111111111111111100000000111111111000000000000000000000000011111111111111111111111111000000000111111111111111111111111110000000001111111110000000000000000000000000111111111000000000000000000000000011111111100000000000000000000000001111111110000000000000000000000000111111111111111111111111110000000001111111110000000000000000000000000111111111
Binary String -> Base32 FVVVVO0VVVVVG1VS00003VVVVU07VVVVS07VG00007VG0000FV00000VU00001VVVVV01VS00003VO0000000000000000000000000000001VVVVV03VVVVU07VG0000FVVVVO0FVVVVO0FV00000VU00001VS00003VO00007VVVVS07VG0000FV
Path + Query String /control?cmd=IRSEND,RAW,FVVVVO0VVVVVG1VS00003VVVVU07VVVVS07VG00007VG0000FV00000VU00001VVVVV01VS00003VO0000000000000000000000000000001VVVVV03VVVVU07VG0000FVVVVO0FVVVVO0FV00000VU00001VS00003VO00007VVVVS07VG0000FV,38,50,50

Length < 2048 chars Should be ok (http says the max size of path+query string must be less than 2KB)
URL http://esp4/control?cmd=IRSEND,RAW,FVVV ... V,38,50,50
The trouble with this is the get request to the esp4 doesn't give a response, eventually curl times out. A smaller payload does go through and ESP2.0.0-dev8 echos back the binary string (so I know the bin2base32 code works okay).

Obviously, pulse and blank have to be bigger than 50 to result in a small enough payload that the ESP doesn't choke. Not really sure how to make to make them bigger without giving a float to the ESP for Pulse/Blank. How much fuzzing does IR typically tolerate for pulse/blank intervals? (+/- 25%?)
Last edited by ged on 30 May 2017, 19:22, edited 1 time in total.

GusPS
Normal user
Posts: 23
Joined: 28 Feb 2017, 15:59

Re: IR Transmitter ?

#81 Post by GusPS » 30 May 2017, 19:00

Try using 1250 for pulse and 400 for space.
It seems there's only 3 values there. The other one ~7500.
That should reduce the b32 length.

GusPS
Normal user
Posts: 23
Joined: 28 Feb 2017, 15:59

Re: IR Transmitter ?

#82 Post by GusPS » 30 May 2017, 19:01

Sorry.... 400 and 400 for both. I've replied too fast.

angelosub
Normal user
Posts: 9
Joined: 26 Jan 2017, 12:59
Location: Italy

Re: IR Transmitter ?

#83 Post by angelosub » 30 May 2017, 19:54

GusPS wrote:
29 May 2017, 01:30
angelosub wrote:
28 May 2017, 21:32
I have don't understand extrapolate a RAW data from IR transmitter.
I have try to receive a IR code with a P016 plugin "Infrared Receiv - TSOP4838". In house I have TSOP4136 ad I have used this, the difference is the IR frequencies. TSOP4838 38kHz TSOP4136 36kHz. I hope isn't a problem.

When I push the on/off button of the IR transmitter the ESPEasy receive 2 codes HEX:
800ff and ffffffff

I don't understand how convert this HEX values to a RAW for sending the code with a ESPEasy.
http://<ip address>/control?cmd=IRSEND,RAW,code,kHZ,Pulse Len, Blank Len
kHZ = 38 It's correct?

thanks for help.
Hi angelusb,
You need to grab the PULSE and BLANK timings to be able to generate the RAW data.
To do this, I use the http://dangerousprototypes.com/docs/USB_Infrared_Toy
Other people use IRrecvDump for Arduino.
The P016 is not good to get the timings for unkown protocols.

After you have those values, you can use the Python script or the Excel sheet to generate de Base32 chars.

Let me know about any doubts.
Gustavo.
Thank you GusPS for your fast response, I have try the IRrecvDump for Arduino. And with one IR tx on power button pressed receive this message:
Encoding : NEC
Code : 800FF (32 bits)
Timing[67]:
+9000, -4400 + 600, - 550 + 600, - 500 + 600, - 550
+ 550, - 600 + 550, - 550 + 600, - 500 + 600, - 550
+ 600, - 550 + 600, - 500 + 600, - 550 + 600, - 550
+ 600, - 500 + 600, -1650 + 600, - 550 + 600, - 500
+ 600, - 550 + 600, - 550 + 600, - 500 + 600, - 550
+ 600, - 500 + 600, - 550 + 600, - 550 + 600, - 500
+ 600, - 550 + 600, -1650 + 600, -1650 + 600, -1600
+ 600, -1650 + 600, -1650 + 600, -1650 + 550, -1650
+ 600, -1650 + 600
unsigned int rawData[67] = {9000,4400, 600,550, 600,500, 600,550, 550,600, 550,550, 600,500, 600,550, 600,550, 600,500, 600,550, 600,550, 600,500, 600,1650, 600,550, 600,500, 600,550, 600,550, 600,500, 600,550, 600,500, 600,550, 600,550, 600,500, 600,550, 600,1650, 600,1650, 600,1600, 600,1650, 600,1650, 600,1650, 550,1650, 600,1650, 600}; // NEC 800FF
unsigned int data = 0x800FF;
I suppose the code for IR transmitter with ESPEasy is NEC 800FF -> http://<ip address>/control?cmd=IRSEND,NEC,800FF
It's correct?

another question:
I have tried whit a DAIKIN conditioner IR TX and the message received is:
Encoding : UNKNOWN
Code : B3E2CB06 (32 bits)
Timing[11]:
+ 500, - 400 + 450, - 400 + 450, - 400 + 450, - 400
+ 450, - 400 + 450
unsigned int rawData[11] = {500,400, 450,400, 450,400, 450,400, 450,400, 450}; // UNKNOWN B3E2CB06

IR code too long. Edit IRremoteInt.h and increase RAWLEN
Timing[100]:
+3450, -1700 + 450, -1250 + 450, - 400 + 450, - 400
+ 450, - 400 + 450, -1250 + 500, - 350 + 500, - 350
+ 500, - 350 + 500, - 350 + 500, -1250 + 450, - 400
+ 450, -1250 + 450, -1250 + 450, - 400 + 500, -1200
+ 500, -1250 + 450, -1250 + 450, -1250 + 450, -1250
+ 450, - 400 + 500, - 350 + 500, -1200 + 500, - 400
+ 450, - 400 + 450, - 400 + 450, - 400 + 450, - 400
+ 450, - 400 + 450, - 400 + 450, - 400 + 500, - 350
+ 500, - 350 + 500, - 350 + 500, - 400 + 450, - 400
+ 450, - 400 + 450, - 400 + 450, - 400 + 450, - 400
+ 450, - 400 + 450, -1250 + 500, - 350 + 500, - 350
+ 500, -1250 + 450, -1250 + 450, -1250 + 450, - 400
+ 450, - 400 + 450, - 400
unsigned int rawData[100] = {3450,1700, 450,1250, 450,400, 450,400, 450,400, 450,1250, 500,350, 500,350, 500,350, 500,350, 500,1250, 450,400, 450,1250, 450,1250, 450,400, 500,1200, 500,1250, 450,1250, 450,1250, 450,1250, 450,400, 500,350, 500,1200, 500,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,400, 500,350, 500,350, 500,350, 500,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,1250, 500,350, 500,350, 500,1250, 450,1250, 450,1250, 450,400, 450,400, 450,400 }; // SANYO FFFFFFFF
unsigned int data = 0xFFFFFFFF;
The 32bits code is B3E2CB06? -> http://<ip address>/control?cmd=IRSEND,RAW,B3E2CB06 ... and how punt in the KHz, in the Pulse Len and in the Blank Len?

thanks
Angelo

ged
Normal user
Posts: 8
Joined: 15 Oct 2016, 07:04

Re: IR Transmitter ?

#84 Post by ged » 30 May 2017, 19:59

Yup okay, 400 works for both... So I guess the at the receiving end the signal is being processed as roughly a multiple of the pulse length (~ the min value)... that makes sense.

Thanks for your help.

GusPS
Normal user
Posts: 23
Joined: 28 Feb 2017, 15:59

Re: IR Transmitter ?

#85 Post by GusPS » 30 May 2017, 20:07

ged wrote:
30 May 2017, 19:59
Yup okay, 400 works for both... So I guess the at the receiving end the signal is being processed as roughly a multiple of the pulse length (~ the min value)... that makes sense.

Thanks for your help.
So... did it work? Your device is working using the ESPEasy? I hope so!... :D

ged
Normal user
Posts: 8
Joined: 15 Oct 2016, 07:04

Re: IR Transmitter ?

#86 Post by ged » 30 May 2017, 20:10

Gustavo helped me, let me see if I can help you a bit... :)
I suppose the code for IR transmitter with ESPEasy is NEC 800FF -> http://<ip address>/control?cmd=IRSEND,NEC,800FF
It's correct?
The syntax as documented suggests you need to provide the number of bits on the end of that.
another question:
I have tried whit a DAIKIN conditioner IR TX and the message received is:
Encoding : UNKNOWN
Code : B3E2CB06 (32 bits)
Timing[11]:
+ 500, - 400 + 450, - 400 + 450, - 400 + 450, - 400
+ 450, - 400 + 450
unsigned int rawData[11] = {500,400, 450,400, 450,400, 450,400, 450,400, 450}; // UNKNOWN B3E2CB06

IR code too long. Edit IRremoteInt.h and increase RAWLEN
Timing[100]:
+3450, -1700 + 450, -1250 + 450, - 400 + 450, - 400
+ 450, - 400 + 450, -1250 + 500, - 350 + 500, - 350
+ 500, - 350 + 500, - 350 + 500, -1250 + 450, - 400
+ 450, -1250 + 450, -1250 + 450, - 400 + 500, -1200
+ 500, -1250 + 450, -1250 + 450, -1250 + 450, -1250
+ 450, - 400 + 500, - 350 + 500, -1200 + 500, - 400
+ 450, - 400 + 450, - 400 + 450, - 400 + 450, - 400
+ 450, - 400 + 450, - 400 + 450, - 400 + 500, - 350
+ 500, - 350 + 500, - 350 + 500, - 400 + 450, - 400
+ 450, - 400 + 450, - 400 + 450, - 400 + 450, - 400
+ 450, - 400 + 450, -1250 + 500, - 350 + 500, - 350
+ 500, -1250 + 450, -1250 + 450, -1250 + 450, - 400
+ 450, - 400 + 450, - 400
unsigned int rawData[100] = {3450,1700, 450,1250, 450,400, 450,400, 450,400, 450,1250, 500,350, 500,350, 500,350, 500,350, 500,1250, 450,400, 450,1250, 450,1250, 450,400, 500,1200, 500,1250, 450,1250, 450,1250, 450,1250, 450,400, 500,350, 500,1200, 500,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,400, 500,350, 500,350, 500,350, 500,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,1250, 500,350, 500,350, 500,1250, 450,1250, 450,1250, 450,400, 450,400, 450,400 }; // SANYO FFFFFFFF
unsigned int data = 0xFFFFFFFF;
The 32bits code is B3E2CB06? -> http://<ip address>/control?cmd=IRSEND,RAW,B3E2CB06 ... and how punt in the KHz, in the Pulse Len and in the Blank Len?
I'm guessing you are holding the button down for a while and triggering a repeat (or your doing it while someone else is messing with a different remote in the same room). 0xFFFFFF in NEC means repeat last command. Try tapping the once button quickly, wait for a bit and do it again. Do that a couple of times until you see an UNKNOWN code that is corresponding to your taps.

Make a copy of the spreadsheet I posted, paste your rawData over mine, mess with the pulse/blank values and you'll see the binary string and base32 strings get generated.

Then its a good idea to emit the payload back into your receiver and see if you get the same UNKNOWN code value.

ged
Normal user
Posts: 8
Joined: 15 Oct 2016, 07:04

Re: IR Transmitter ?

#87 Post by ged » 30 May 2017, 20:15

GusPS wrote:
30 May 2017, 20:07
ged wrote:
30 May 2017, 19:59
Yup okay, 400 works for both... So I guess the at the receiving end the signal is being processed as roughly a multiple of the pulse length (~ the min value)... that makes sense.

Thanks for your help.
So... did it work? Your device is working using the ESPEasy? I hope so!... :D
Yup it does indeed... The range is only about 3 ft, so I'll have to figure out if I can boost it a bit for what I want to do, but if I hold it dead on and send the url "http://esp/control?cmd=IRSEND,RAW,ET3N8 ... 38,400,400", power toggles on.

bobbybeans
Normal user
Posts: 115
Joined: 26 Feb 2017, 17:30

Re: IR Transmitter ?

#88 Post by bobbybeans » 30 May 2017, 21:23

Gus
Thanks for the wonderful detailed explanation that all makes sense now (i believe)
so just one clarification, the two numbers you get are the end of it, are the averages of the pulse /blanks just to help shorten it?
I have looked at both the spreadsheet and the new one created on page 8 and both seem fairly consistent however no luck
angelosub wrote:
30 May 2017, 19:54


IR code too long. Edit IRremoteInt.h and increase RAWLEN
Timing[100]:
+3450, -1700 + 450, -1250 + 450, - 400 + 450, - 400
+ 450, - 400 + 450, -1250 + 500, - 350 + 500, - 350
+ 500, - 350 + 500, - 350 + 500, -1250 + 450, - 400
+ 450, -1250 + 450, -1250 + 450, - 400 + 500, -1200
+ 500, -1250 + 450, -1250 + 450, -1250 + 450, -1250
+ 450, - 400 + 500, - 350 + 500, -1200 + 500, - 400
+ 450, - 400 + 450, - 400 + 450, - 400 + 450, - 400
+ 450, - 400 + 450, - 400 + 450, - 400 + 500, - 350
+ 500, - 350 + 500, - 350 + 500, - 400 + 450, - 400
+ 450, - 400 + 450, - 400 + 450, - 400 + 450, - 400
+ 450, - 400 + 450, -1250 + 500, - 350 + 500, - 350
+ 500, -1250 + 450, -1250 + 450, -1250 + 450, - 400
+ 450, - 400 + 450, - 400
unsigned int rawData[100] = {3450,1700, 450,1250, 450,400, 450,400, 450,400, 450,1250, 500,350, 500,350, 500,350, 500,350, 500,1250, 450,400, 450,1250, 450,1250, 450,400, 500,1200, 500,1250, 450,1250, 450,1250, 450,1250, 450,400, 500,350, 500,1200, 500,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,400, 500,350, 500,350, 500,350, 500,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,1250, 500,350, 500,350, 500,1250, 450,1250, 450,1250, 450,400, 450,400, 450,400 }; // SANYO FFFFFFFF
unsigned int data = 0xFFFFFFFF;
The 32bits code is B3E2CB06? -> http://<ip address>/control?cmd=IRSEND,RAW,B3E2CB06 ... and how punt in the KHz, in the Pulse Len and in the Blank Len?

thanks
Angelo
i am getting similar short lengths that you described. based on what you found here are you suggesting i should increase the rawlen? as this might be why mine is not working because it seems very very short comparatively to everyone elses

I looked into the IRremoteInt.h and i can't find RAWLEN or rawlen. I find one reference to it being "uint8_t rawlen; // counter of entries in rawbuf"

Edit ermm... not sure maybe i read that wrong

angelosub
Normal user
Posts: 9
Joined: 26 Jan 2017, 12:59
Location: Italy

Re: IR Transmitter ?

#89 Post by angelosub » 30 May 2017, 21:43

ged wrote:
30 May 2017, 20:10
Gustavo helped me, let me see if I can help you a bit... :)
I suppose the code for IR transmitter with ESPEasy is NEC 800FF -> http://<ip address>/control?cmd=IRSEND,NEC,800FF
It's correct?
The syntax as documented suggests you need to provide the number of bits on the end of that.
another question:
I have tried whit a DAIKIN conditioner IR TX and the message received is:
Encoding : UNKNOWN
Code : B3E2CB06 (32 bits)
Timing[11]:
+ 500, - 400 + 450, - 400 + 450, - 400 + 450, - 400
+ 450, - 400 + 450
unsigned int rawData[11] = {500,400, 450,400, 450,400, 450,400, 450,400, 450}; // UNKNOWN B3E2CB06

IR code too long. Edit IRremoteInt.h and increase RAWLEN
Timing[100]:
+3450, -1700 + 450, -1250 + 450, - 400 + 450, - 400
+ 450, - 400 + 450, -1250 + 500, - 350 + 500, - 350
+ 500, - 350 + 500, - 350 + 500, -1250 + 450, - 400
+ 450, -1250 + 450, -1250 + 450, - 400 + 500, -1200
+ 500, -1250 + 450, -1250 + 450, -1250 + 450, -1250
+ 450, - 400 + 500, - 350 + 500, -1200 + 500, - 400
+ 450, - 400 + 450, - 400 + 450, - 400 + 450, - 400
+ 450, - 400 + 450, - 400 + 450, - 400 + 500, - 350
+ 500, - 350 + 500, - 350 + 500, - 400 + 450, - 400
+ 450, - 400 + 450, - 400 + 450, - 400 + 450, - 400
+ 450, - 400 + 450, -1250 + 500, - 350 + 500, - 350
+ 500, -1250 + 450, -1250 + 450, -1250 + 450, - 400
+ 450, - 400 + 450, - 400
unsigned int rawData[100] = {3450,1700, 450,1250, 450,400, 450,400, 450,400, 450,1250, 500,350, 500,350, 500,350, 500,350, 500,1250, 450,400, 450,1250, 450,1250, 450,400, 500,1200, 500,1250, 450,1250, 450,1250, 450,1250, 450,400, 500,350, 500,1200, 500,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,400, 500,350, 500,350, 500,350, 500,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,1250, 500,350, 500,350, 500,1250, 450,1250, 450,1250, 450,400, 450,400, 450,400 }; // SANYO FFFFFFFF
unsigned int data = 0xFFFFFFFF;
The 32bits code is B3E2CB06? -> http://<ip address>/control?cmd=IRSEND,RAW,B3E2CB06 ... and how punt in the KHz, in the Pulse Len and in the Blank Len?
I'm guessing you are holding the button down for a while and triggering a repeat (or your doing it while someone else is messing with a different remote in the same room). 0xFFFFFF in NEC means repeat last command. Try tapping the once button quickly, wait for a bit and do it again. Do that a couple of times until you see an UNKNOWN code that is corresponding to your taps.

Make a copy of the spreadsheet I posted, paste your rawData over mine, mess with the pulse/blank values and you'll see the binary string and base32 strings get generated.

Then its a good idea to emit the payload back into your receiver and see if you get the same UNKNOWN code value.
thanks ged, I have try and this is the result:
Encoding : UNKNOWN
Code : B3E2CB06 (32 bits)
Timing[11]:
+ 450, - 450 + 400, - 400 + 500, - 400 + 400, - 450
+ 400, - 450 + 450
unsigned int rawData[11] = {450,450, 400,400, 500,400, 400,450, 400,450, 450}; // UNKNOWN B3E2CB06

Encoding : SANYO
Code : FFFFFFFF (0 bits)
Timing[100]:
+3450, -1750 + 400, -1250 + 450, - 450 + 400, - 450
+ 400, - 450 + 450, -1250 + 450, - 400 + 450, - 400
+ 400, - 450 + 400, - 450 + 450, -1250 + 450, - 450
+ 400, -1300 + 450, -1250 + 450, - 400 + 450, -1250
+ 450, -1250 + 450, -1300 + 400, -1300 + 400, -1300
+ 400, - 450 + 400, - 450 + 400, -1300 + 400, - 450
+ 500, - 350 + 450, - 450 + 400, - 450 + 400, - 450
+ 400, - 450 + 450, - 350 + 450, - 450 + 400, - 450
+ 400, - 450 + 450, - 400 + 450, - 400 + 450, - 400
+ 450, - 450 + 400, - 450 + 400, - 450 + 400, - 450
+ 450, - 400 + 400, - 400 + 500, - 400 + 400, - 450
+ 450, -1250 + 450, -1250 + 450, -1300 + 400, - 450
+ 400, - 450 + 400, - 450
unsigned int rawData[100] = {3450,1750, 400,1250, 450,450, 400,450, 400,450, 450,1250, 450,400, 450,400, 400,450, 400,450, 450,1250, 450,450, 400,1300, 450,1250, 450,400, 450,1250, 450,1250, 450,1300, 400,1300, 400,1300, 400,450, 400,450, 400,1300, 400,450, 500,350, 450,450, 400,450, 400,450, 400,450, 450,350, 450,450, 400,450, 400,450, 450,400, 450,400, 450,400, 450,450, 400,450, 400,450, 400,450, 450,400, 400,400, 500,400, 400,450, 450,1250, 450,1250, 450,1300, 400,450, 400,450, 400,450 }; // SANYO FFFFFFFF
unsigned int data = 0xFFFFFFFF;

the correct code is B3E2CB06 (32 bits)? rawData[11] = {450,450, 400,400, 500,400, 400,450, 400,450, 450}

ged
Normal user
Posts: 8
Joined: 15 Oct 2016, 07:04

Re: IR Transmitter ?

#90 Post by ged » 30 May 2017, 22:21

thanks ged, I have try and this is the result:
Encoding : UNKNOWN
Code : B3E2CB06 (32 bits)
Timing[11]:
+ 450, - 450 + 400, - 400 + 500, - 400 + 400, - 450
+ 400, - 450 + 450
unsigned int rawData[11] = {450,450, 400,400, 500,400, 400,450, 400,450, 450}; // UNKNOWN B3E2CB06

Encoding : SANYO
Code : FFFFFFFF (0 bits)
Timing[100]:
+3450, -1750 + 400, -1250 + 450, - 450 + 400, - 450
+ 400, - 450 + 450, -1250 + 450, - 400 + 450, - 400
+ 400, - 450 + 400, - 450 + 450, -1250 + 450, - 450
+ 400, -1300 + 450, -1250 + 450, - 400 + 450, -1250
+ 450, -1250 + 450, -1300 + 400, -1300 + 400, -1300
+ 400, - 450 + 400, - 450 + 400, -1300 + 400, - 450
+ 500, - 350 + 450, - 450 + 400, - 450 + 400, - 450
+ 400, - 450 + 450, - 350 + 450, - 450 + 400, - 450
+ 400, - 450 + 450, - 400 + 450, - 400 + 450, - 400
+ 450, - 450 + 400, - 450 + 400, - 450 + 400, - 450
+ 450, - 400 + 400, - 400 + 500, - 400 + 400, - 450
+ 450, -1250 + 450, -1250 + 450, -1300 + 400, - 450
+ 400, - 450 + 400, - 450
unsigned int rawData[100] = {3450,1750, 400,1250, 450,450, 400,450, 400,450, 450,1250, 450,400, 450,400, 400,450, 400,450, 450,1250, 450,450, 400,1300, 450,1250, 450,400, 450,1250, 450,1250, 450,1300, 400,1300, 400,1300, 400,450, 400,450, 400,1300, 400,450, 500,350, 450,450, 400,450, 400,450, 400,450, 450,350, 450,450, 400,450, 400,450, 450,400, 450,400, 450,400, 450,450, 400,450, 400,450, 400,450, 450,400, 400,400, 500,400, 400,450, 450,1250, 450,1250, 450,1300, 400,450, 400,450, 400,450 }; // SANYO FFFFFFFF
unsigned int data = 0xFFFFFFFF;

the correct code is B3E2CB06 (32 bits)? rawData[11] = {450,450, 400,400, 500,400, 400,450, 400,450, 450}
Don't really know... based on the few codes I've captured that data looks kind of screwed up... In the raw data I have, the first number in the code is 2 or 3 times the size pulse value... that rawData[11] is so small you could use 50 for the pulse and blank...

I duplicated the sheet on my spreadsheet and put that in and it spit out this: http://esp4/control?cmd=IRSEND,RAW,VU03 ... V,38,50,50 .... You can try it, but I'd think your actual code more likely starts in the rawData[100]

angelosub
Normal user
Posts: 9
Joined: 26 Jan 2017, 12:59
Location: Italy

Re: IR Transmitter ?

#91 Post by angelosub » 30 May 2017, 22:37

ged wrote:
30 May 2017, 22:21
thanks ged, I have try and this is the result:
Encoding : UNKNOWN
Code : B3E2CB06 (32 bits)
Timing[11]:
+ 450, - 450 + 400, - 400 + 500, - 400 + 400, - 450
+ 400, - 450 + 450
unsigned int rawData[11] = {450,450, 400,400, 500,400, 400,450, 400,450, 450}; // UNKNOWN B3E2CB06

Encoding : SANYO
Code : FFFFFFFF (0 bits)
Timing[100]:
+3450, -1750 + 400, -1250 + 450, - 450 + 400, - 450
+ 400, - 450 + 450, -1250 + 450, - 400 + 450, - 400
+ 400, - 450 + 400, - 450 + 450, -1250 + 450, - 450
+ 400, -1300 + 450, -1250 + 450, - 400 + 450, -1250
+ 450, -1250 + 450, -1300 + 400, -1300 + 400, -1300
+ 400, - 450 + 400, - 450 + 400, -1300 + 400, - 450
+ 500, - 350 + 450, - 450 + 400, - 450 + 400, - 450
+ 400, - 450 + 450, - 350 + 450, - 450 + 400, - 450
+ 400, - 450 + 450, - 400 + 450, - 400 + 450, - 400
+ 450, - 450 + 400, - 450 + 400, - 450 + 400, - 450
+ 450, - 400 + 400, - 400 + 500, - 400 + 400, - 450
+ 450, -1250 + 450, -1250 + 450, -1300 + 400, - 450
+ 400, - 450 + 400, - 450
unsigned int rawData[100] = {3450,1750, 400,1250, 450,450, 400,450, 400,450, 450,1250, 450,400, 450,400, 400,450, 400,450, 450,1250, 450,450, 400,1300, 450,1250, 450,400, 450,1250, 450,1250, 450,1300, 400,1300, 400,1300, 400,450, 400,450, 400,1300, 400,450, 500,350, 450,450, 400,450, 400,450, 400,450, 450,350, 450,450, 400,450, 400,450, 450,400, 450,400, 450,400, 450,450, 400,450, 400,450, 400,450, 450,400, 400,400, 500,400, 400,450, 450,1250, 450,1250, 450,1300, 400,450, 400,450, 400,450 }; // SANYO FFFFFFFF
unsigned int data = 0xFFFFFFFF;

the correct code is B3E2CB06 (32 bits)? rawData[11] = {450,450, 400,400, 500,400, 400,450, 400,450, 450}
Don't really know... based on the few codes I've captured that data looks kind of screwed up... In the raw data I have, the first number in the code is 2 or 3 times the size pulse value... that rawData[11] is so small you could use 50 for the pulse and blank...

I duplicated the sheet on my spreadsheet and put that in and it spit out this: http://esp4/control?cmd=IRSEND,RAW,VU03 ... V,38,50,50 .... You can try it, but I'd think your actual code more likely starts in the rawData[100]

I have try increase the rawlen in the arduino library to uint64_t but the message it's same "IR code too long. Edit IRremoteInt.h and increase RAWLEN".
I don't now. It's probable the DAIKIN code too long the 64bit?

angelosub
Normal user
Posts: 9
Joined: 26 Jan 2017, 12:59
Location: Italy

Re: IR Transmitter ?

#92 Post by angelosub » 30 May 2017, 23:37

I don't understand why, but in the IRremoteESP8266 library it's presents a DAIKIN sample IR command and in the _P35_IRTX.ino the DAIKIN code is not integrated.
see below
if (IrType.equalsIgnoreCase("NEC")) Plugin_035_irSender->sendNEC(IrCode, IrBits);
if (IrType.equalsIgnoreCase("JVC")) Plugin_035_irSender->sendJVC(IrCode, IrBits, 2);
if (IrType.equalsIgnoreCase("RC5")) Plugin_035_irSender->sendRC5(IrCode, IrBits);
if (IrType.equalsIgnoreCase("RC6")) Plugin_035_irSender->sendRC6(IrCode, IrBits);
if (IrType.equalsIgnoreCase("SAMSUNG")) Plugin_035_irSender->sendSAMSUNG(IrCode, IrBits);
if (IrType.equalsIgnoreCase("SONY")) Plugin_035_irSender->sendSony(IrCode, IrBits);
if (IrType.equalsIgnoreCase("PANASONIC")) Plugin_035_irSender->sendPanasonic(IrBits, IrCode);

in the example directory of IRremoteESP8266 library I'm find the "TurnOnDaikinAC" example:
#include <IRDaikinESP.h>

IRDaikinESP dakinir(D1);

void setup(){
dakinir.begin();
Serial.begin(115200);
}


void loop(){
Serial.println("Sending...");

// Set up what we want to send. See IRDaikinESP.cpp for all the options.
dakinir.on();
dakinir.setFan(1);
dakinir.setMode(DAIKIN_COOL);
dakinir.setTemp(25);
dakinir.setSwingVertical(0);
dakinir.setSwingHorizontal(0);

// Now send the IR signal.
dakinir.send();

delay(5000);
}

It's possible integrate IRDaikinESP.h in the _P35_IRTX.ino?
It's possible integrate with if (IrType.equalsIgnoreCase("DAIKIN")) Plugin_035_irSender_DAIKIN->Daikin.send(command); ?
command: IRDaikinESP.on, IRDaikinESP.setFan(value), IRDaikinESP.setMode(char), IRDaikinESP.setTemp(value), IRDaikinESP.setSwingVertical(value), IRDaikinESP.setSwingHorizontal(value)

I'm not a programmer :? and I don't know if really possible integrate this function. Do you have Ideas? :?:

by
Angelo

angelosub
Normal user
Posts: 9
Joined: 26 Jan 2017, 12:59
Location: Italy

Re: IR Transmitter ?

#93 Post by angelosub » 30 May 2017, 23:58

ged wrote:
30 May 2017, 20:10
Gustavo helped me, let me see if I can help you a bit... :)
I suppose the code for IR transmitter with ESPEasy is NEC 800FF -> http://<ip address>/control?cmd=IRSEND,NEC,800FF
It's correct?
The syntax as documented suggests you need to provide the number of bits on the end of that.
another question:
I have tried whit a DAIKIN conditioner IR TX and the message received is:
Encoding : UNKNOWN
Code : B3E2CB06 (32 bits)
Timing[11]:
+ 500, - 400 + 450, - 400 + 450, - 400 + 450, - 400
+ 450, - 400 + 450
unsigned int rawData[11] = {500,400, 450,400, 450,400, 450,400, 450,400, 450}; // UNKNOWN B3E2CB06

IR code too long. Edit IRremoteInt.h and increase RAWLEN
Timing[100]:
+3450, -1700 + 450, -1250 + 450, - 400 + 450, - 400
+ 450, - 400 + 450, -1250 + 500, - 350 + 500, - 350
+ 500, - 350 + 500, - 350 + 500, -1250 + 450, - 400
+ 450, -1250 + 450, -1250 + 450, - 400 + 500, -1200
+ 500, -1250 + 450, -1250 + 450, -1250 + 450, -1250
+ 450, - 400 + 500, - 350 + 500, -1200 + 500, - 400
+ 450, - 400 + 450, - 400 + 450, - 400 + 450, - 400
+ 450, - 400 + 450, - 400 + 450, - 400 + 500, - 350
+ 500, - 350 + 500, - 350 + 500, - 400 + 450, - 400
+ 450, - 400 + 450, - 400 + 450, - 400 + 450, - 400
+ 450, - 400 + 450, -1250 + 500, - 350 + 500, - 350
+ 500, -1250 + 450, -1250 + 450, -1250 + 450, - 400
+ 450, - 400 + 450, - 400
unsigned int rawData[100] = {3450,1700, 450,1250, 450,400, 450,400, 450,400, 450,1250, 500,350, 500,350, 500,350, 500,350, 500,1250, 450,400, 450,1250, 450,1250, 450,400, 500,1200, 500,1250, 450,1250, 450,1250, 450,1250, 450,400, 500,350, 500,1200, 500,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,400, 500,350, 500,350, 500,350, 500,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,400, 450,1250, 500,350, 500,350, 500,1250, 450,1250, 450,1250, 450,400, 450,400, 450,400 }; // SANYO FFFFFFFF
unsigned int data = 0xFFFFFFFF;
The 32bits code is B3E2CB06? -> http://<ip address>/control?cmd=IRSEND,RAW,B3E2CB06 ... and how punt in the KHz, in the Pulse Len and in the Blank Len?
I'm guessing you are holding the button down for a while and triggering a repeat (or your doing it while someone else is messing with a different remote in the same room). 0xFFFFFF in NEC means repeat last command. Try tapping the once button quickly, wait for a bit and do it again. Do that a couple of times until you see an UNKNOWN code that is corresponding to your taps.

Make a copy of the spreadsheet I posted, paste your rawData over mine, mess with the pulse/blank values and you'll see the binary string and base32 strings get generated.

Then its a good idea to emit the payload back into your receiver and see if you get the same UNKNOWN code value.


I have try with another IRremote library for Arduino and tray with dedicated IRecvDump. This is the result:

Raw (584): -25248 450 -400 450 -400 500 -350 500 -350 500 -350 500 -25100 3450 -1700 450 -1250 450 -400 450 -400 450 -400 450 -1250 500 -350 500 -350 500 -350 500 -400 450 -1250 450 -400 450 -1250 450 -1250 500 -350 500 -1200 500 -1250 450 -1250 450 -1250 450 -1250 450 -400 500 -350 500 -1200 500 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 500 -350 500 -350 500 -1250 450 -400 450 -1250 450 -400 450 -400 450 -400 450 -1250 500 -1200 500 -350 500 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 500 -350 500 -350 500 -350 500 -400 450 -400 450 -400 450 -400 450 -1250 450 -1250 500 -1200 500 -350 500 -1250 450 -400 450 -1250 450 -1250 450 31086 3500 -1650 450 -1250 500 -350 500 -350 500 -350 500 -1250 450 -400 450 -400 450 -400 450 -400 450 -1250 500 -350 500 -1200 500 -1250 450 -400 450 -1250 450 -1250 450 -1250 500 -1200 500 -1250 450 -400 450 -400 450 -1250 450 -400 450 -400 500 -350 500 -350 500 -350 500 -350 500 -400 450 -400 450 -400 450 -400 450 -400 450 -1250 450 -400 500 -350 500 -350 500 -350 500 -1250 450 -400 450 -400 450 -400 450 -1250 450 -400 500 -1200 500 -350 500 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 500 -350 500 -350 500 -350 500 -400 450 -400 450 -1250 450 -400 450 -1250 450 -1250 500 -350 500 31136 3500 -1650 500 -1200 500 -400 450 -400 450 -400 450 -1250 450 -400 450 -400 450 -400 500 -350 500 -1200 500 -400 450 -1250 450 -1250 450 -400 450 -1250 500 -1200 500 -1250 450 -1250 450 -1250 450 -400 450 -400 450 -1250 500 -350 500 -350 500 -350 500 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 500 -350 500 -350 500 -350 500 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -1250 500 -1200 500 -1250 450 -400 450 -400 450 -400 450 -1250 450 -1250 500 -350 500 -350 500 -1250 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 500 -350 500 -350 500 -350 500 -400 450 -400 450 -400 450 -400 450 -400 450 -1250 450 -400 500 -1200 500 -350 500 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 500 -350 500 -350 500 -350 500 -400 450 -400 450 -400 450 -400 450 -1250 450 -1250 500 -350 500 -350 500 -350 500 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -1250 500 -1200 500 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 500 -350 500 -350 500 -350 500 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 500 -350 500 -350 500 -350 500 -1250 450 -1250 450 -400 450 -400 450 -400 450 -400 500 -350 500 -350 500 -350 500 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 450 -400 500 -350 500 -1200 500 -1250 450 -400 450 -1250 450 -1250 450 -400 500 -350 500

Whit this RAW it's possible send IR code with ESPEasy?

angelosub
Normal user
Posts: 9
Joined: 26 Jan 2017, 12:59
Location: Italy

Re: IR Transmitter ?

#94 Post by angelosub » 10 Jun 2017, 21:21

Hi, I have try the "TurnOnDaikinAC" example of library IRremoteESP8266 It's perfect.
This is the example:
#include <IRDaikinESP.h>

IRDaikinESP dakinir(5); //D1 GPIO5

void setup(){
dakinir.begin();
Serial.begin(115200);
}
void loop(){
Serial.println("Sending...");

// Set up what we want to send. See IRDaikinESP.cpp for all the options.
dakinir.on(); //dakinir.off();
dakinir.setFan(0); //0=AUTO, 1-5 Fan vel
dakinir.setMode(DAIKIN_COOL); //DAIKIN_COOL, DAIKIN_HEAT, DAIKIN_FAN, DAIKIN_AUTO, DAIKIN_DRY
dakinir.setTemp(25);
dakinir.setSwingVertical(1); //0= off, 1= on
dakinir.setSwingHorizontal(0); //0= off, 1= on

// Now send the IR signal.
dakinir.send();

delay(5000);
}

I have not idea then I ask you: In the _P35_IRTX.ino it's possible integrate the DAIKIN function of the IRDaikinESP.h?

thanks
Angelo

GusPS
Normal user
Posts: 23
Joined: 28 Feb 2017, 15:59

Re: IR Transmitter ?

#95 Post by GusPS » 13 Jun 2017, 03:06

angelosub wrote:
10 Jun 2017, 21:21
I have not idea then I ask you: In the _P35_IRTX.ino it's possible integrate the DAIKIN function of the IRDaikinESP.h?
Well... it is possible for sure. But it would take some time, obviously. Maybe it should be a differente plugin.

marko67
Normal user
Posts: 7
Joined: 20 Jan 2017, 06:40

Re: IR Transmitter ?

#96 Post by marko67 » 25 Jun 2017, 11:43

## Text translate via Google form German to English ##

Good Morning,

My goal was to control my air conditioning system from Mitsubishi via FHEM with IR and EspEasy. I have already managed years ago with the Raspberry my system (codes then about Lirc) later I wanted to try it with Mysensors, now I wanted to do it simply via Wifi.


Problem was and is that the remote control (FB) only outputs these RAW codes. There are different approaches here (FHEM Forum) and also in the EspEasy forum, but I did not go further or to the goal. My FB "remembers" the old settings. That is, I really need only the On or Off button. With On starts it with 22 ° -AutoSpeedFan-3D-air direction.


Since I am only hobbyist, I need a way (code) to implement this easily and comprehensibly. I would like to briefly present this for all who are looking for a way to search RAW code. Maybe you can use it for yourself.


My code, which I had first transferred from Raspberry to Mysensors, looked like this:

Code: Select all

#include <IRremote.h>

IRsend irsend;
unsigned int an[180] = {3250,1450,500,300,450,1100,500,300,450,350,450,1100,500,300,450,1100,500,300,500,300,450,1100,500,1050,500,1100,500,300,450,1100,450,350,500,1050,500,1100,450,1100,500,300,450,300,500,300,500,300,450,1100,500,1100,450,300,500,1100,450,1100,450,350,500,300,450,1100,500,300,500,300,450,1100,450,350,450,300,500,1100,450,1100,500,300,500,1050,500,1100,450,1100,450,1150,450,1100,450,1150,450,1100,500,1050,500,1100,450,300,500,300,500,300,450,350,450,300,500,300,450,350,450,300,500,1100,500,1050,500,1100,450,1100,500,300,450,350,450,1100,450,1100,500,1100,500,300,450,300,450,350,500,1050,500,1100,500,300,450,300,500,300,450,350,450,1100,500,1050,500,300,500,300,450,1100,500,1100,500,1050,450,1150,450,300,500,300,500,1050,500,1100,500,300,450,300,500,300,500,};
unsigned int aus[180] = {3200,1500,450,300,500,1100,450,300,500,300,500,1050,500,300,500,1100,450,300,500,300,500,1050,500,1100,450,1100,500,300,500,1050,500,300,450,1150,450,1100,450,1100,500,300,500,300,500,300,450,300,500,1100,450,1100,500,300,500,1050,450,1150,450,300,500,300,450,1150,450,300,500,300,450,1100,500,300,450,350,450,1100,500,1100,450,300,500,1100,450,1100,450,1150,450,1100,450,1100,500,1100,500,1050,500,1100,450,1100,500,300,500,300,450,300,500,300,450,350,450,300,500,300,450,350,450,1100,500,1100,450,1100,450,1150,450,300,500,300,500,1050,500,1100,450,1100,500,300,450,350,450,300,500,1100,450,1100,500,300,500,300,450,300,500,300,500,1050,500,1100,450,1100,500,300,500,1050,500,1100,450,1100,500,1100,450,300,500,300,450,350,500,1050,500,300,500,300,450,300,500,};
void setup()
{
  Serial.begin(9600);
}

void loop() {
  //if (Serial.read() != -1) //{
    for (int i = 0; i < 3; i++) {
      irsend.sendRaw(an,180,38);
      delay(1000);
      irsend.sendRaw(aus,180,38);
      delay(5000);
    //}
  }
}




I have changed in EspEasy in the "Plugin_035" the following:

Code: Select all

//#######################################################################################################
//#################################### Plugin 035: Output IR ############################################
//#######################################################################################################

#include <IRremoteESP8266.h>
IRsend *Plugin_035_irSender;

#define PLUGIN_035
#define PLUGIN_ID_035         35
#define PLUGIN_NAME_035       "Infrared Transmit"

boolean Plugin_035(byte function, struct EventStruct *event, String& string)
{
  boolean success = false;

  switch (function)
  {
    case PLUGIN_DEVICE_ADD:
      {
        Device[++deviceCount].Number = PLUGIN_ID_035;
        Device[deviceCount].Type = DEVICE_TYPE_SINGLE;
        Device[deviceCount].SendDataOption = false;
        break;
      }

    case PLUGIN_GET_DEVICENAME:
      {
        string = F(PLUGIN_NAME_035);
        break;
      }

    case PLUGIN_GET_DEVICEVALUENAMES:
      {
        break;
      }

    case PLUGIN_INIT:
      {
        int irPin = Settings.TaskDevicePin1[event->TaskIndex];
        if (Plugin_035_irSender == 0 && irPin != -1)
        {
          addLog(LOG_LEVEL_INFO, "INIT: IR TX");
          Plugin_035_irSender = new IRsend(irPin);
          Plugin_035_irSender->begin(); // Start the sender
        }
        if (Plugin_035_irSender != 0 && irPin == -1)
        {
          addLog(LOG_LEVEL_INFO, "INIT: IR TX Removed");
          delete Plugin_035_irSender;
          Plugin_035_irSender = 0;
        }
        success = true;
        break;
      }

    case PLUGIN_WRITE:
      {
        String IrType;
        unsigned long IrCode;
        unsigned int IrBits;
        char command[80];
        command[0] = 0;
        char TmpStr1[80];
        TmpStr1[0] = 0;
        string.toCharArray(command, 80);

        unsigned int an[180] = {3250,1450,500,300,450,1100,500,300,450,350,450,1100,500,300,450,1100,500,300,500,300,450,1100,500,1050,500,1100,500,300,450,1100,450,350,500,1050,500,1100,450,1100,500,300,450,300,500,300,500,300,450,1100,500,1100,450,300,500,1100,450,1100,450,350,500,300,450,1100,500,300,500,300,450,1100,450,350,450,300,500,1100,450,1100,500,300,500,1050,500,1100,450,1100,450,1150,450,1100,450,1150,450,1100,500,1050,500,1100,450,300,500,300,500,300,450,350,450,300,500,300,450,350,450,300,500,1100,500,1050,500,1100,450,1100,500,300,450,350,450,1100,450,1100,500,1100,500,300,450,300,450,350,500,1050,500,1100,500,300,450,300,500,300,450,350,450,1100,500,1050,500,300,500,300,450,1100,500,1100,500,1050,450,1150,450,300,500,300,500,1050,500,1100,500,300,450,300,500,300,500,};
        unsigned int aus[180] = {3200,1500,450,300,500,1100,450,300,500,300,500,1050,500,300,500,1100,450,300,500,300,500,1050,500,1100,450,1100,500,300,500,1050,500,300,450,1150,450,1100,450,1100,500,300,500,300,500,300,450,300,500,1100,450,1100,500,300,500,1050,450,1150,450,300,500,300,450,1150,450,300,500,300,450,1100,500,300,450,350,450,1100,500,1100,450,300,500,1100,450,1100,450,1150,450,1100,450,1100,500,1100,500,1050,500,1100,450,1100,500,300,500,300,450,300,500,300,450,350,450,300,500,300,450,350,450,1100,500,1100,450,1100,450,1150,450,300,500,300,500,1050,500,1100,450,1100,500,300,450,350,450,300,500,1100,450,1100,500,300,500,300,450,300,500,300,500,1050,500,1100,450,1100,500,300,500,1050,500,1100,450,1100,500,1100,450,300,500,300,450,350,500,1050,500,300,500,300,450,300,500,};


        String tmpString = string;
        int argIndex = tmpString.indexOf(',');
        if (argIndex) tmpString = tmpString.substring(0, argIndex);

        if (GetArgv(command, TmpStr1, 2)) IrType = TmpStr1;
        if (GetArgv(command, TmpStr1, 3)) IrCode = strtoul(TmpStr1, NULL, 16); //(long) TmpStr1
        if (GetArgv(command, TmpStr1, 4)) IrBits = str2int(TmpStr1);

        if (tmpString.equalsIgnoreCase("IRSEND") && Plugin_035_irSender != 0)
        {
          success = true;
          

          if (IrType.equalsIgnoreCase("NEC")) Plugin_035_irSender->sendNEC(IrCode, IrBits);
          if (IrType.equalsIgnoreCase("JVC")) Plugin_035_irSender->sendJVC(IrCode, IrBits, 2);
          if (IrType.equalsIgnoreCase("RC5")) Plugin_035_irSender->sendRC5(IrCode, IrBits);
          if (IrType.equalsIgnoreCase("RC6")) Plugin_035_irSender->sendRC6(IrCode, IrBits);
          if (IrType.equalsIgnoreCase("SAMSUNG")) Plugin_035_irSender->sendSAMSUNG(IrCode, IrBits);
          if (IrType.equalsIgnoreCase("SONY")) Plugin_035_irSender->sendSony(IrCode, IrBits);
          if (IrType.equalsIgnoreCase("PANASONIC")) Plugin_035_irSender->sendPanasonic(IrBits, IrCode);

          if (IrType.equalsIgnoreCase("Kliman")) Plugin_035_irSender->sendRaw(an,180,38);
          if (IrType.equalsIgnoreCase("Klimaus")) Plugin_035_irSender->sendRaw(aus,180,38);

          addLog(LOG_LEVEL_INFO, "IR Code Sent");
          if (printToWeb)
          {
            printWebString += F("IR Code Sent ");
            printWebString += IrType;
            printWebString += F("<BR>");
          }

          
        }
        break;
      }
  }
  return success;
}




Now I can control via: http: // IP / control? Cmd = IRSEND, Kliman or http: // IP / control? Cmd = IRSEND,

I know this is not the big solution but for me a sufficient success, since we make more settings also not over the FB.





Greeting Marko

helio58
Normal user
Posts: 20
Joined: 11 Mar 2017, 10:21

Re: IR Transmitter ?

#97 Post by helio58 » 26 Jun 2017, 20:35

marko67 wrote:
25 Jun 2017, 11:43
## Text translate via Google form German to English ##

Good Morning,

My goal was to control my air conditioning system from Mitsubishi via FHEM with IR and EspEasy. I have already managed years ago with the Raspberry my system (codes then about Lirc) later I wanted to try it with Mysensors, now I wanted to do it simply via Wifi.


Problem was and is that the remote control (FB) only outputs these RAW codes. There are different approaches here (FHEM Forum) and also in the EspEasy forum, but I did not go further or to the goal. My FB "remembers" the old settings. That is, I really need only the On or Off button. With On starts it with 22 ° -AutoSpeedFan-3D-air direction.


Since I am only hobbyist, I need a way (code) to implement this easily and comprehensibly. I would like to briefly present this for all who are looking for a way to search RAW code. Maybe you can use it for yourself.


My code, which I had first transferred from Raspberry to Mysensors, looked like this:

Code: Select all

#include <IRremote.h>

IRsend irsend;
unsigned int an[180] = {3250,1450,500,300,450,1100,500,300,450,350,450,1100,500,300,450,1100,500,300,500,300,450,1100,500,1050,500,1100,500,300,450,1100,450,350,500,1050,500,1100,450,1100,500,300,450,300,500,300,500,300,450,1100,500,1100,450,300,500,1100,450,1100,450,350,500,300,450,1100,500,300,500,300,450,1100,450,350,450,300,500,1100,450,1100,500,300,500,1050,500,1100,450,1100,450,1150,450,1100,450,1150,450,1100,500,1050,500,1100,450,300,500,300,500,300,450,350,450,300,500,300,450,350,450,300,500,1100,500,1050,500,1100,450,1100,500,300,450,350,450,1100,450,1100,500,1100,500,300,450,300,450,350,500,1050,500,1100,500,300,450,300,500,300,450,350,450,1100,500,1050,500,300,500,300,450,1100,500,1100,500,1050,450,1150,450,300,500,300,500,1050,500,1100,500,300,450,300,500,300,500,};
unsigned int aus[180] = {3200,1500,450,300,500,1100,450,300,500,300,500,1050,500,300,500,1100,450,300,500,300,500,1050,500,1100,450,1100,500,300,500,1050,500,300,450,1150,450,1100,450,1100,500,300,500,300,500,300,450,300,500,1100,450,1100,500,300,500,1050,450,1150,450,300,500,300,450,1150,450,300,500,300,450,1100,500,300,450,350,450,1100,500,1100,450,300,500,1100,450,1100,450,1150,450,1100,450,1100,500,1100,500,1050,500,1100,450,1100,500,300,500,300,450,300,500,300,450,350,450,300,500,300,450,350,450,1100,500,1100,450,1100,450,1150,450,300,500,300,500,1050,500,1100,450,1100,500,300,450,350,450,300,500,1100,450,1100,500,300,500,300,450,300,500,300,500,1050,500,1100,450,1100,500,300,500,1050,500,1100,450,1100,500,1100,450,300,500,300,450,350,500,1050,500,300,500,300,450,300,500,};
void setup()
{
  Serial.begin(9600);
}

void loop() {
  //if (Serial.read() != -1) //{
    for (int i = 0; i < 3; i++) {
      irsend.sendRaw(an,180,38);
      delay(1000);
      irsend.sendRaw(aus,180,38);
      delay(5000);
    //}
  }
}




I have changed in EspEasy in the "Plugin_035" the following:

Code: Select all

//#######################################################################################################
//#################################### Plugin 035: Output IR ############################################
//#######################################################################################################

#include <IRremoteESP8266.h>
IRsend *Plugin_035_irSender;

#define PLUGIN_035
#define PLUGIN_ID_035         35
#define PLUGIN_NAME_035       "Infrared Transmit"

boolean Plugin_035(byte function, struct EventStruct *event, String& string)
{
  boolean success = false;

  switch (function)
  {
    case PLUGIN_DEVICE_ADD:
      {
        Device[++deviceCount].Number = PLUGIN_ID_035;
        Device[deviceCount].Type = DEVICE_TYPE_SINGLE;
        Device[deviceCount].SendDataOption = false;
        break;
      }

    case PLUGIN_GET_DEVICENAME:
      {
        string = F(PLUGIN_NAME_035);
        break;
      }

    case PLUGIN_GET_DEVICEVALUENAMES:
      {
        break;
      }

    case PLUGIN_INIT:
      {
        int irPin = Settings.TaskDevicePin1[event->TaskIndex];
        if (Plugin_035_irSender == 0 && irPin != -1)
        {
          addLog(LOG_LEVEL_INFO, "INIT: IR TX");
          Plugin_035_irSender = new IRsend(irPin);
          Plugin_035_irSender->begin(); // Start the sender
        }
        if (Plugin_035_irSender != 0 && irPin == -1)
        {
          addLog(LOG_LEVEL_INFO, "INIT: IR TX Removed");
          delete Plugin_035_irSender;
          Plugin_035_irSender = 0;
        }
        success = true;
        break;
      }

    case PLUGIN_WRITE:
      {
        String IrType;
        unsigned long IrCode;
        unsigned int IrBits;
        char command[80];
        command[0] = 0;
        char TmpStr1[80];
        TmpStr1[0] = 0;
        string.toCharArray(command, 80);

        unsigned int an[180] = {3250,1450,500,300,450,1100,500,300,450,350,450,1100,500,300,450,1100,500,300,500,300,450,1100,500,1050,500,1100,500,300,450,1100,450,350,500,1050,500,1100,450,1100,500,300,450,300,500,300,500,300,450,1100,500,1100,450,300,500,1100,450,1100,450,350,500,300,450,1100,500,300,500,300,450,1100,450,350,450,300,500,1100,450,1100,500,300,500,1050,500,1100,450,1100,450,1150,450,1100,450,1150,450,1100,500,1050,500,1100,450,300,500,300,500,300,450,350,450,300,500,300,450,350,450,300,500,1100,500,1050,500,1100,450,1100,500,300,450,350,450,1100,450,1100,500,1100,500,300,450,300,450,350,500,1050,500,1100,500,300,450,300,500,300,450,350,450,1100,500,1050,500,300,500,300,450,1100,500,1100,500,1050,450,1150,450,300,500,300,500,1050,500,1100,500,300,450,300,500,300,500,};
        unsigned int aus[180] = {3200,1500,450,300,500,1100,450,300,500,300,500,1050,500,300,500,1100,450,300,500,300,500,1050,500,1100,450,1100,500,300,500,1050,500,300,450,1150,450,1100,450,1100,500,300,500,300,500,300,450,300,500,1100,450,1100,500,300,500,1050,450,1150,450,300,500,300,450,1150,450,300,500,300,450,1100,500,300,450,350,450,1100,500,1100,450,300,500,1100,450,1100,450,1150,450,1100,450,1100,500,1100,500,1050,500,1100,450,1100,500,300,500,300,450,300,500,300,450,350,450,300,500,300,450,350,450,1100,500,1100,450,1100,450,1150,450,300,500,300,500,1050,500,1100,450,1100,500,300,450,350,450,300,500,1100,450,1100,500,300,500,300,450,300,500,300,500,1050,500,1100,450,1100,500,300,500,1050,500,1100,450,1100,500,1100,450,300,500,300,450,350,500,1050,500,300,500,300,450,300,500,};


        String tmpString = string;
        int argIndex = tmpString.indexOf(',');
        if (argIndex) tmpString = tmpString.substring(0, argIndex);

        if (GetArgv(command, TmpStr1, 2)) IrType = TmpStr1;
        if (GetArgv(command, TmpStr1, 3)) IrCode = strtoul(TmpStr1, NULL, 16); //(long) TmpStr1
        if (GetArgv(command, TmpStr1, 4)) IrBits = str2int(TmpStr1);

        if (tmpString.equalsIgnoreCase("IRSEND") && Plugin_035_irSender != 0)
        {
          success = true;
          

          if (IrType.equalsIgnoreCase("NEC")) Plugin_035_irSender->sendNEC(IrCode, IrBits);
          if (IrType.equalsIgnoreCase("JVC")) Plugin_035_irSender->sendJVC(IrCode, IrBits, 2);
          if (IrType.equalsIgnoreCase("RC5")) Plugin_035_irSender->sendRC5(IrCode, IrBits);
          if (IrType.equalsIgnoreCase("RC6")) Plugin_035_irSender->sendRC6(IrCode, IrBits);
          if (IrType.equalsIgnoreCase("SAMSUNG")) Plugin_035_irSender->sendSAMSUNG(IrCode, IrBits);
          if (IrType.equalsIgnoreCase("SONY")) Plugin_035_irSender->sendSony(IrCode, IrBits);
          if (IrType.equalsIgnoreCase("PANASONIC")) Plugin_035_irSender->sendPanasonic(IrBits, IrCode);

          if (IrType.equalsIgnoreCase("Kliman")) Plugin_035_irSender->sendRaw(an,180,38);
          if (IrType.equalsIgnoreCase("Klimaus")) Plugin_035_irSender->sendRaw(aus,180,38);

          addLog(LOG_LEVEL_INFO, "IR Code Sent");
          if (printToWeb)
          {
            printWebString += F("IR Code Sent ");
            printWebString += IrType;
            printWebString += F("<BR>");
          }

          
        }
        break;
      }
  }
  return success;
}




Now I can control via: http: // IP / control? Cmd = IRSEND, Kliman or http: // IP / control? Cmd = IRSEND,

I know this is not the big solution but for me a sufficient success, since we make more settings also not over the FB.





Greeting Marko
Hi take a look at https://www.letscontrolit.com/forum/vie ... f=2&t=1915

ToniA have add Mitsubishi support. I don't use FHEM but with his plugin you can control via cmd or mqtt.

marko67
Normal user
Posts: 7
Joined: 20 Jan 2017, 06:40

Re: IR Transmitter ?

#98 Post by marko67 » 28 Jun 2017, 10:04

Ok and thank you for this Tipp. I have change to ToniA integration "HeatpumIR". It works fine after a while as well with FHEM.

Thank you.

brainhunt
Normal user
Posts: 2
Joined: 02 Jul 2017, 13:22

Re: IR Transmitter ?

#99 Post by brainhunt » 02 Jul 2017, 13:33

I need some help because it seems I am missing something.

I have created an IR transmitter and an IR receiver with two ESP8266 chips and of course the required additional hardware. I have installed esp easy (2) at both ESP's and it seems to work fine. I have tested it with my Samsung tv, reading the IR signal with the receiver and then sending it with the transmitter.

However my ultimate goal is to control a Sony receiver (old version, working with an RM-U242 remote control) in the garage that controls the music in the garden. However, I can read the IR code from the remote control (for instance IR : Code 841 - Type: 4 - Bits: 12 for switching to the tuner) but when I send that same command to the transmitter (http://esp_ip/control?cmd=IRSEND,SONY,0x841,12), nothing happens??? :(

I have fixed the IR receiver next to the transmitter and it shows exactly the same result (IR : Code 841 - Type: 4 - Bits: 12) as from the remote control. The receiver does by the way respond to the signal from the remote control. I have send the signal from various distances at the receiver, but still without any result.

Anyone any ideas/suggestions?

brainhunt
Normal user
Posts: 2
Joined: 02 Jul 2017, 13:22

Re: IR Transmitter ?

#100 Post by brainhunt » 04 Jul 2017, 19:01

I think I'm a bit closer to a solution. Some additional searching delivered that the Sony signal needs to be send twice or three times with a delay of about 40ms. Unfortunately, sending the command through http is too slow and I don't see an option to repeat the command automatically at the ESP itself. Rules seem to offer only delays of seconds, not msecs.

Any thoughts/suggestions? Otherwise I will probably drop espeasy in this case and replace it by an arduino core with more dedicated ir pacakge.

StefanD
Normal user
Posts: 13
Joined: 28 Jan 2017, 20:07

Re: IR Transmitter ?

#101 Post by StefanD » 07 Jul 2017, 23:23

Hi all,
I modified the plugin in the way Marko explain previously in this post to be able to control my LG air conditioning unit. It is working very well from the beginning and it is so simple to make it working. Just use IRrecvDumpV2 to record the raw signal parameters and use them to modify the plugin in the way it was explained before and this is all...
A new library for your AC conditioning unit or TV set it is not needed.
Marko, many thanks!

neykov_t
Normal user
Posts: 15
Joined: 21 Jan 2017, 22:10

Re: IR Transmitter ?

#102 Post by neykov_t » 17 Jul 2017, 19:29

Hi friends,
i found that ins irSend lib we already have support for Fujitsu. Can we update this plugin to use this nice new features ? I don't want use irsend.sendRaw() as we got ready for use commands.

Please advice what can we do ?

000
Normal user
Posts: 2
Joined: 21 Jul 2017, 22:34

Re: IR Transmitter ?

#103 Post by 000 » 25 Jul 2017, 18:17

Hello, I read the before post, but I don't know how to do to control LG Air.

I have installed the ESPEASY, with IR Receiver, and read the HEX Code from remote, type and bits. I have and IR Transmitter ready, I use the command http://xxx.xxx.x.xxx/control?cmd=IRSEND,LG,8800808,28, and I say the info command send, but the IR receiver does not see it, and the LG device neither.

I think I send not a good command, but I am stuck here.

I read you can use a circuit with arduino and extract the raw code, and before modify the lib of esp easy to implement. Really it is necessary ?? It is the only way??

Pleas help me!

StefanD
Normal user
Posts: 13
Joined: 28 Jan 2017, 20:07

Re: IR Transmitter ?

#104 Post by StefanD » 27 Jul 2017, 21:50

Hello,
for LG AC your LG TV code will not work. Try to compile espeasy with a modified plugin 035 that I will post it below. It is working with my model of LG AC. Example of the command to power on the AC unit in cool mode with 22 deg will be something like http://192.168.x.x/control?cmd=IRSEND,LG_ON . With this plugin you have available the following commands: LG_ON,LG_OFF,LG_FAN2,LG_FAN3,LG_L and LG_LL (low low power saving). Try it to see if is working for you
Best regards

//#######################################################################################################
//#################################### Plugin 035: Output IR ############################################
//#######################################################################################################

#include <IRremoteESP8266.h>
IRsend *Plugin_035_irSender;

#define PLUGIN_035
#define PLUGIN_ID_035 35
#define PLUGIN_NAME_035 "Infrared Transmit"

boolean Plugin_035(byte function, struct EventStruct *event, String& string)
{
boolean success = false;

switch (function)
{
case PLUGIN_DEVICE_ADD:
{
Device[++deviceCount].Number = PLUGIN_ID_035;
Device[deviceCount].Type = DEVICE_TYPE_SINGLE;
Device[deviceCount].SendDataOption = false;
break;
}

case PLUGIN_GET_DEVICENAME:
{
string = F(PLUGIN_NAME_035);
break;
}

case PLUGIN_GET_DEVICEVALUENAMES:
{
break;
}

case PLUGIN_INIT:
{
int irPin = Settings.TaskDevicePin1[event->TaskIndex];
if (Plugin_035_irSender == 0 && irPin != -1)
{
addLog(LOG_LEVEL_INFO, "INIT: IR TX");
Plugin_035_irSender = new IRsend(irPin);
Plugin_035_irSender->begin(); // Start the sender
}
if (Plugin_035_irSender != 0 && irPin == -1)
{
addLog(LOG_LEVEL_INFO, "INIT: IR TX Removed");
delete Plugin_035_irSender;
Plugin_035_irSender = 0;
}
success = true;
break;
}

case PLUGIN_WRITE:
{
String IrType;
unsigned long IrCode;
unsigned int IrBits;
char command[120];
command[0] = 0;
char TmpStr1[100];
TmpStr1[0] = 0;
string.toCharArray(command, 120);

unsigned int an[59] = {8750,4150, 500,1600, 450,550, 450,600, 450,600, 450,1600, 450,600, 400,600, 500,550, 500,500, 500,550, 500,550, 450,600, 450,550, 500,550, 450,550, 500,550, 450,1650, 450,600, 400,600, 450,550, 450,600, 450,550, 450,600, 450,600, 450,1600, 450,600, 450,550, 450,600, 450};
unsigned int aus[59] = {8750,4150, 500,1600, 450,550, 450,600, 450,600, 400,1650, 450,550, 450,600, 450,550, 450,1650, 450,1600, 450,600, 450,550, 450,600, 450,550, 450,600, 450,600, 450,550, 450,600, 450,600, 400,600, 450,550, 450,1600, 450,600, 450,1600, 450,600, 450,600, 450,550, 450,1600, 450};
unsigned int an01[59] = {8750,4150, 500,1550, 500,550, 500,550, 500,500, 500,1550, 500,550, 500,500, 500,500, 500,550, 500,550, 500,550, 500,500, 500,550, 500,500, 500,550, 500,500, 500,550, 500,1550, 500,1600, 500,1550, 500,500, 500,550, 500,1600, 500,500, 500,1550, 500,550, 500,500, 550,1550, 500};
unsigned int an02[59] = {8700,4150, 500,1600, 450,550, 500,550, 450,550, 500,1600, 450,600, 450,550, 450,600, 450,550, 450,600, 450,550, 500,550, 450,600, 450,550, 450,600, 450,550, 500,550, 450,1600, 500,1600, 450,1600, 450,600, 450,1600, 450,600, 400,600, 450,1600, 450,600, 450,1600, 450,1600, 450};
unsigned int an03[59] = {8800,4100, 500,1550, 500,550, 500,550, 500,500, 500,1550, 550,500, 500,550, 500,500, 500,1550, 500,1550, 500,550, 500,500, 500,550, 500,500, 500,500, 550,550, 450,550, 500,1600, 500,1550, 500,1550, 500,1550, 500,1550, 500,550, 450,1550, 550,500, 550,500, 500,550, 500,550, 450};
unsigned int an04[59] = {8800,4100, 500,1600, 450,600, 450,550, 500,550, 450,1600, 450,600, 450,550, 500,550, 450,1600, 500,1600, 450,550, 500,550, 450,550, 500,550, 450,550, 500,550, 500,550, 450,1600, 450,1600, 450,1600, 500,1550, 500,1600, 450,1600, 450,550, 500,550, 450,600, 450,600, 400,1600, 450};
unsigned int an1[99] = {3450,1700, 450,450, 400,1300, 450,450, 400,450, 400,450, 450,400, 450,400, 450,400, 450,450, 400,450, 400,450, 450,400, 450,450, 400,1300, 400,450, 450,450, 400,450, 400,450, 450,400, 450,400, 450,450, 400,450, 400,450, 450,1300, 400,450, 450,400, 450,400, 450,400, 450,450, 400,450, 450,400, 450,400, 450,1300, 450,400, 450,1300, 400,1300, 400,1300, 450,1300, 450,400, 450,400, 450,1300, 400,450, 450,1300, 400,1300, 450,1300, 400,1300, 450,400, 450,1300, 400};
unsigned int aus1[99] = {3500,1700, 400,450, 400,1300, 450,450, 400,450, 400,450, 450,400, 450,450, 400,450, 400,450, 400,500, 400,450, 400,450, 400,450, 400,1300, 450,450, 400,450, 400,450, 400,450, 450,450, 400,450, 400,450, 400,450, 450,450, 400,1300, 400,500, 400,450, 400,450, 400,450, 400,450, 400,450, 450,450, 400,450, 400,1300, 450,450, 400,1300, 400,1300, 450,1300, 400,1300, 450,450, 400,450, 400,1300, 450,450, 400,1300, 400,1300, 450,1300, 400,1300, 450,450, 400,1300, 400};
unsigned int an2[67] = {8900,4450, 550,550, 550,600, 550,1650, 550,550, 550,550, 550,550, 600,500, 600,550, 550,1650, 550,1650, 550,600, 550,1700, 500,1650, 550,1700, 550,1650, 600,1600, 600,550, 550,550, 550,550, 600,1600, 600,550, 550,550, 550,550, 600,500, 600,1650, 550,1650, 550,1650, 600,550, 550,1650, 550,1700, 500,1700, 550,1650, 550};




String tmpString = string;
int argIndex = tmpString.indexOf(',');
if (argIndex) tmpString = tmpString.substring(0, argIndex);

if (GetArgv(command, TmpStr1, 2)) IrType = TmpStr1;
if (GetArgv(command, TmpStr1, 3)) IrCode = strtoul(TmpStr1, NULL, 16); //(long) TmpStr1
if (GetArgv(command, TmpStr1, 4)) IrBits = str2int(TmpStr1);

if (tmpString.equalsIgnoreCase("IRSEND") && Plugin_035_irSender != 0)
{
success = true;


if (IrType.equalsIgnoreCase("NEC")) Plugin_035_irSender->sendNEC(IrCode, IrBits);
if (IrType.equalsIgnoreCase("JVC")) Plugin_035_irSender->sendJVC(IrCode, IrBits, 2);
if (IrType.equalsIgnoreCase("RC5")) Plugin_035_irSender->sendRC5(IrCode, IrBits);
if (IrType.equalsIgnoreCase("RC6")) Plugin_035_irSender->sendRC6(IrCode, IrBits);
if (IrType.equalsIgnoreCase("SAMSUNG")) Plugin_035_irSender->sendSAMSUNG(IrCode, IrBits);
if (IrType.equalsIgnoreCase("SONY")) Plugin_035_irSender->sendSony(IrCode, IrBits);
if (IrType.equalsIgnoreCase("PANASONIC")) Plugin_035_irSender->sendPanasonic(IrBits, IrCode);

if (IrType.equalsIgnoreCase("LG_ON")) Plugin_035_irSender->sendRaw(an,59,38);
if (IrType.equalsIgnoreCase("LG_OFF")) Plugin_035_irSender->sendRaw(aus,59,38);
if (IrType.equalsIgnoreCase("LG_FAN2")) Plugin_035_irSender->sendRaw(an01,59,38);
if (IrType.equalsIgnoreCase("LG_FAN3")) Plugin_035_irSender->sendRaw(an02,59,38);
if (IrType.equalsIgnoreCase("LG_L")) Plugin_035_irSender->sendRaw(an03,59,38);
if (IrType.equalsIgnoreCase("LG_LL")) Plugin_035_irSender->sendRaw(an04,59,38);
if (IrType.equalsIgnoreCase("PN_ON")) Plugin_035_irSender->sendRaw(an1,99,35);
if (IrType.equalsIgnoreCase("PN_OFF")) Plugin_035_irSender->sendRaw(aus1,99,35);
if (IrType.equalsIgnoreCase("LG_TV")) Plugin_035_irSender->sendRaw(an2,67,38);

addLog(LOG_LEVEL_INFO, "IR Code Sent");
if (printToWeb)
{
printWebString += F("IR Code Sent ");
printWebString += IrType;
printWebString += F("<BR>");
}


}
break;
}
}
return success;
}

000
Normal user
Posts: 2
Joined: 21 Jul 2017, 22:34

Re: IR Transmitter ?

#105 Post by 000 » 04 Aug 2017, 23:12

Thank you Stefan!!!

I have been reviewing the p35, and I have managed to make it work, after getting it I have seen your post, the solution is very similar to yours, adding the lines with LG.

Thank You!! Now working!

olleman
Normal user
Posts: 39
Joined: 27 Aug 2017, 08:10

Re: IR Transmitter ?

#106 Post by olleman » 27 Aug 2017, 08:18

I've got this information for a remote code for my Optoma HD 65 which I confirmed working when I tried it with "Unified remote control" for Android with my Samsung S6.

But my questions is, how can I get from this code to the b32 code mentioned in this thread? I should be able to convert it, right?
Power NEC2 Device Code: 79.80 (0x4F.0x50) Function: 2 (0x02)
0000 006D 0000 0022 0157 00AC 0015 0041 0015 0041 0015 0041 0015 0041 0015 0016 0015 0016 0015 0041 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0041 0015 0016 0015 0041 0015 0016 0015 0016 0015 0041 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0041 0015 0016 0015 0041 0015 0041 0015 0041 0015 0041 0015 0041 0015 0041 0015 0689
Thanks in advance!

GusPS
Normal user
Posts: 23
Joined: 28 Feb 2017, 15:59

Re: IR Transmitter ?

#107 Post by GusPS » 28 Aug 2017, 13:44

Hi olleman,

What are those numbers? Are them Pulse & Blank timings? Seems weir that the firsts "pulses" are 0000. Can you confirm it? If you have other way to get the pulses & blanks, you could try it.

Also, did you try to use the NEC protocol? I remmembet that this plugin has this protocol implemented.

olleman
Normal user
Posts: 39
Joined: 27 Aug 2017, 08:10

Re: IR Transmitter ?

#108 Post by olleman » 29 Aug 2017, 08:03

Hello,

It's "Pronto hex". It's some kind of raw format since this can be used without selecting a protocol. More information here: http://www.remotecentral.com/features/irdisp2.htm

My Optoma seems to be using "NEC2" but I'd like tro try to use the NEC protocol, the problem is that I have no idea what shorter HEX I should use and I don't have an IR receiver at this moment. I need a format that looks like this:
http://192.168.4.138/control?cmd=IRSEND,NEC,4bb620df,32

Any ideas?

GusPS
Normal user
Posts: 23
Joined: 28 Feb 2017, 15:59

Re: IR Transmitter ?

#109 Post by GusPS » 29 Aug 2017, 16:25

I don't know how to go from pulse & blanks to de mini-hex that espeasy-nec2 protocol needs. But, if you can convert that pronto hex to the sequence of timings that RAW protocol expect, then you can create the Base32 string and use with that protocol (RAW). There is, in this same forum-topic, a python script and an Excel spreedsheet to convert from Pulse & Blank to Base32. Is not always easy and possible the convertion, but at least is a way to try if an unknown protocol can be used.
Maybe other user can explain the NEC protocol and the numbers that you gave in the example. Let me know if you have any doubt.

olleman
Normal user
Posts: 39
Joined: 27 Aug 2017, 08:10

Re: IR Transmitter ?

#110 Post by olleman » 29 Aug 2017, 19:00

Thanks, I have ordered an ir receiver so i Can try the route with raw code but I'll probably be back for some support regarding that matter:)

siod
Normal user
Posts: 1
Joined: 08 Jan 2018, 17:17

Re: IR Transmitter ?

#111 Post by siod » 08 Jan 2018, 17:31

ThinkPad wrote:
20 Aug 2016, 10:45
I got the _P106_IRTX.ino plugin working! It works really good!

How to do it:
- Download ESPEasy source (from .zip or from GitHub)
- Download the plugin and place it in the same folder as 'ESPEasy.ino' and the other *.ino files
- Download the IRremoteESP8266.h and also put in same folder as above
- Compile & upload to your device (i used a Wemos D1 Mini board)
- Then under 'Devices' in ESPEasy, select 'Infrared Transmit' and choose the GPIO pin that you have the IR Transmitter connected to. For Wemos D1 Mini i connected the transmitter to pin 'D1', which is GPIO5 in ESPEasy.
Could someone pls explain how I can compile this using Arduino IDE? I get compiling errors, e.g. 'FreeMem' was not declared in this scope

When trying to open ESPEasy.ino Arduino IDE says "ESP must have it´s own folder..."

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests