IRSEND with SONY type and 3 times repeat

Moderators: BertB, rtenklooster, Voyager, Stuntteam, Martinus

Post Reply
Message
Author
cobalt78
Normal user
Posts: 2
Joined: 15 May 2018, 15:40

IRSEND with SONY type and 3 times repeat

#1 Post by cobalt78 » 15 May 2018, 15:59

Hi,

I would like to understand how to send IR remote in http with 3 times repeat for sony device ?

On Arduino UNO :

Code: Select all

#include <IRremote.h>

IRsend irsend;

void setup()
{
}

void loop() {
	for (int i = 0; i < 3; i++) {
		irsend.sendSony(0xa81, 12);
		delay(40);
	}
	delay(5000); //5 second delay between each signal burst

}
Work perfectly

If I use :
192.168.0.131/control?cmd=IRSEND,SONY,a81,12
Or:
192.168.0.131/control?cmd=IRSEND,SONY,a81,12,2
Not working ....

It is working with my samsumg device:
I check on IRremoteESP8266.cpp

Code: Select all

void ICACHE_FLASH_ATTR IRsend::sendSony(unsigned long data, int nbits,
                                        unsigned int repeat) {
  // Send an IR command to a compatible Sony device.
  //
  // Args:
  //   data: IR command to be sent.
  //   nbits: Nr. of bits of the IR command to be sent.
  //   repeat: Nr. of additional times the IR command is to be sent.
  //
  // sendSony() should typically be called with repeat=2 as Sony devices
  // expect the code to be sent at least 3 times.
  //
  // Timings and details are taken from:
  //   http://www.sbprojects.com/knowledge/ir/sirc.php

  enableIROut(40);  // Sony devices use a 40kHz IR carrier frequency.
  IRtimer usecs = IRtimer();

  for (uint16_t i = 0; i <= repeat; i++) {  // Typically loop 3 or more times.
    usecs.reset();
    // Header
    mark(SONY_HDR_MARK);
    space(SONY_HDR_SPACE);
    // Data
    sendData(SONY_ONE_MARK, SONY_HDR_SPACE, SONY_ZERO_MARK, SONY_HDR_SPACE,
             data, nbits, true);
    // Footer
    // The Sony protocol requires us to wait 45ms from start of a code to the
    // start of the next one. A 10ms minimum gap is also required.
    space(max(10000u, 45000 - usecs.elapsed()));
  }
  // A space() is always performed last, so no need to turn off the LED.
}
On _P035_IRTX.ino

Code: Select all

if (IrType.equalsIgnoreCase(F("SONY"))) Plugin_035_irSender->sendSony(IrCode, IrBits);
On IRremoteESP8266.h

Code: Select all

#define SEND_PROTOCOL_SONY     case SONY: sendSony(data, nbits); break;
Why on the cpp file there is the repeat option but not on header nor ino ?


My ESPEasy version v2.0-20180322

cobalt78
Normal user
Posts: 2
Joined: 15 May 2018, 15:40

Re: IRSEND with SONY type and 3 times repeat

#2 Post by cobalt78 » 23 May 2018, 09:26

It seams that noboby use Sony device ....

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest