(Solved) IRTX plugin help

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

Post Reply
Message
Author
bobbybeans
Normal user
Posts: 119
Joined: 26 Feb 2017, 17:30

(Solved) IRTX plugin help

#1 Post by bobbybeans » 01 Mar 2017, 18:58

Hey guys I'm am hoping you can help me with a predicament

I bought some multicolor LED candles that are controlled by an IR remote. These are a no name brand that I bought from a shop and it has a remote with no brand on it. I wanted to integrate this into my home automation of domoticz and I am ALMOST there. I have everything else working just can't get the IRTx plugin to work.

Here is a breakdown of what I did for some background information
bought these candles and remote
https://www.amazon.co.uk/Benross-Anika- ... B00M35B4RI

purchased
https://www.aliexpress.com/item/Digital ... 67671.html
https://www.aliexpress.com/item/Compati ... 15940.html

I hooked all the stuff up to my raspberry pi and followed this guide
http://www.instructables.com/id/How-To- ... /?ALLSTEPS

I used Lirc and created a config for my remote and mapped the keys to the hex values
I then tested it by sending ir signals from the LED to my candles 1 meter away from rpi to candles. This works 100% I have all the buttons working like they should be on my raspberry pi


Here is the config of my remote.

Code: Select all

          
begin remote
  bits    16
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100

  header       9197  4553
  one           581  1679
  zero          581   594
  ptrail        583
  repeat       9204  2266
  pre_data_bits   16
  pre_data       0x1FE
  gap          108815
  toggle_bit_mask 0x0

      begin codes
          KEY_POWER                0x48B7
          KEY_POWER2               0x58A7
          KEY_M                    0x7887
          KEY_KP0                  0x7887
          KEY_KP1                  0x807F
          KEY_KP2                  0x40BF
          KEY_KP3                  0xC03F
          KEY_FN_F1                0x20DF
          KEY_FN_F2                0xA05F
          KEY_FN_F3                0x609F
          KEY_FN_F4                0xE01F
          KEY_FN_F5                0x10EF
          KEY_FN_F6                0x906F
          KEY_FN_F7                0x50AF
          KEY_FN_F8                0xD827
          KEY_FN_F9                0xF807
          KEY_FN_F10               0x30CF
          KEY_FN_F11               0xB04F
          KEY_FN_F12               0x708F
      end codes

end remote



I then took a ESP12F loaded easy esp R140 which contains the IRTX plugin. I then removed my irled but left the receiver on the raspberry pi. I hooked up my LED to the esp and configured the IRTX plugin with correct GPIO.
I made sure the LED was working as I put a hex code in it and hit enter. I watched the LED on my camera and I could see it blink purple confirming that it is hooked up correctly
I was using this format to send Hex codes http://192.168.0.xxx/control?cmd=IRSEND,NEC,0x48B7,16
But it doesn’t actually turn on my candles even at 1 cm from it
I have tried 16 and 32 bit
I have also tried all different remote settings NEC, RC4, RC5, Samsung etc
Any suggestions?

with lirc on my rpi I ran mode2 -d /dev/lirc0 to capture the original raw power on from my remote signal here it is ,

Code: Select all

space 16777215
pulse 8899
space 4632
pulse 438
space 671
pulse 527
space 643
pulse 443
space 674
pulse 470
space 697
pulse 438
space 682
pulse 461
space 671
pulse 475
space 674
pulse 463
space 1811
pulse 457
space 1808
pulse 474
space 1803
pulse 404
space 1895
pulse 489
space 1779
pulse 499
space 1770
pulse 498
space 1750
pulse 496
space 1803
pulse 494
space 619
pulse 490

when I run the hex version of the-power on command via the IRTX plugin I capture it with the same command but it is different which is why it doesn’t turn on. I don’t understand why it is different. here os the code Any suggestions from people who know IR better than me?

Code: Select all

space 16777215
pulse 9184
space 4577
pulse 604
space 536
pulse 610
space 623
pulse 548
space 599
pulse 576
space 568
pulse 646
space 560
pulse 575
space 608
pulse 577
space 585
pulse 585
space 1684
pulse 574
space 1684
pulse 575
space 1686
pulse 582
space 1679
pulse 581
space 1686
pulse 580
space 1719
pulse 536
space 1684
pulse 576
space 1710
pulse 549
space 596
pulse 586
space 592
pulse 577
space 1683
pulse 580
space 637
pulse 536
space 592
pulse 592
space 1675
pulse 576
space 616
pulse 560
space 563
pulse 614
space 587
pulse 586
space 1685
pulse 577
space 640
pulse 535
space 1683
pulse 575
space 1692
pulse 575
space 591
pulse 584
space 1655
pulse 606
space 1682
pulse 577
space 1657
pulse 607
space 39744
pulse 9218
space 2274
pulse 575
space 96708
pulse 9206
space 2247
pulse 653


I am guessing I am entering the hex code wrong but I also don’t know how to correct it either if I am doing that. Here is the one that I capture doing the plugin I know it looks like crap but if you take both of them and compare them side by side with excel you can see the differences quite clearly, some of the pauses and sends are the same or close to each other, some aren’t even close
Help?


I also tried irw which correlates button presses with the full hex and did the supposed full 16 bit hex into the plugin and still nothing here is the irw output for the hex I used
0000000001fe48b7 01 KEY_POWER rgb

All last night I tried to flash IRrecDumpV2 onto my uno (Chinese copy) but it keeps erroring out and I have no clue why either. I thought the library I could just easily flash without much hassle and try getting the hex that way to try a secondary way instead of lirc but no luck

Code: Select all

Arduino: 1.8.1 (Windows 10), Board: "Arduino/Genuino Uno"

IRtest:64: error: expected class-name before '{' token

 {

 ^

C:\Program Files (x86)\Arduino\libraries\Robot_Control\Arduino-IRremote-master\examples\IRtest\IRtest.ino: In constructor 'IRsendDummy::IRsendDummy()':

IRtest:71: error: class 'IRsendDummy' does not have any field named 'IRsend'

   IRsend() {

   ^

C:\Program Files (x86)\Arduino\libraries\Robot_Control\Arduino-IRremote-master\examples\IRtest\IRtest.ino: In function 'void testNEC(long unsigned int, int)':

IRtest:137: error: 'class IRsendDummy' has no member named 'sendNEC'

   irsenddummy.sendNEC(val, bits);

               ^

C:\Program Files (x86)\Arduino\libraries\Robot_Control\Arduino-IRremote-master\examples\IRtest\IRtest.ino: In function 'void testSony(long unsigned int, int)':

IRtest:142: error: 'class IRsendDummy' has no member named 'sendSony'

   irsenddummy.sendSony(val, bits);

               ^

C:\Program Files (x86)\Arduino\libraries\Robot_Control\Arduino-IRremote-master\examples\IRtest\IRtest.ino: In function 'void testRC5(long unsigned int, int)':

IRtest:147: error: 'class IRsendDummy' has no member named 'sendRC5'

   irsenddummy.sendRC5(val, bits);

               ^

C:\Program Files (x86)\Arduino\libraries\Robot_Control\Arduino-IRremote-master\examples\IRtest\IRtest.ino: In function 'void testRC6(long unsigned int, int)':

IRtest:152: error: 'class IRsendDummy' has no member named 'sendRC6'

   irsenddummy.sendRC6(val, bits);

               ^

exit status 1
expected class-name before '{' token

Suggestions?
Last edited by bobbybeans on 09 Mar 2017, 13:24, edited 1 time in total.

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

Re: IRTX plugin help

#2 Post by Shardan » 01 Mar 2017, 20:50

Hello,

I use IRrecDumpV2 on a original Arduino without problems.
I ran into several problems to flash the routine on my Uno when using my Arduino IDE usually used for compiling ESPEasy.
Seems some Libraries conflict. Installing it cleanly on another computer made it work like a charme.

I can't say much about how to send codes from Raspberry, i usse a ESP-01 for that.

Regards
Shardan
Regards
Shardan

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

Re: IRTX plugin help

#3 Post by bobbybeans » 01 Mar 2017, 20:57

Shardan wrote:Hello,

I use IRrecDumpV2 on a original Arduino without problems.
I ran into several problems to flash the routine on my Uno when using my Arduino IDE usually used for compiling ESPEasy.
Seems some Libraries conflict. Installing it cleanly on another computer made it work like a charme.

I can't say much about how to send codes from Raspberry, i usse a ESP-01 for that.

Regards
Shardan

Thanks for that. I have completely removed it and updated to the latest version. I will continue to bash away at it tonight.
I think you may have understood me for the IR codes. I did originally set it up and got it fully working sending codes with Lirc from the raspberry pi to the candles. However I do not have the IRtx plugin (on the esp8266 12f) working with the codes. Can you maybe elaborate what you did with the esp01? as really in theory (someone correct me if i am wrong) it shouldn't matter what esp i put it on as long as it has enough pins for what i want to do and the correct firmware.

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

Re: IRTX plugin help

#4 Post by GusPS » 02 Mar 2017, 02:22

Hi. Do you have the chance to add an IR Receiver on the ESPEasy to check which code is receiving? ESPEasy has a IRRec plugin.

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

Re: IRTX plugin help

#5 Post by bobbybeans » 02 Mar 2017, 10:20

GusPS wrote:Hi. Do you have the chance to add an IR Receiver on the ESPEasy to check which code is receiving? ESPEasy has a IRRec plugin.
I can certainly do this, I didn't really think about it. I was sort of burnt out on the projoct last night so I didn't do anything
I will do this when I get home. will the reciever output a hex value or the raw code? does anybody know?

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

Re: IRTX plugin help

#6 Post by GusPS » 02 Mar 2017, 14:06

Will output HEX.
I've modified the version to also inform about used protocol and bits. Will show you the diffs when I get home too. :P

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

Re: IRTX plugin help

#7 Post by bobbybeans » 02 Mar 2017, 15:56

GusPS wrote:Will output HEX.
I've modified the version to also inform about used protocol and bits. Will show you the diffs when I get home too. :P
you mean you took the branch of IR receive and compiled it yourself to add those?
I don't think it will detect the protocol for mine :( because lirc seems fairly complex and it wasn't even able to determine it, bit I'll give it a shot. it got the bits right though.
if you did compile it yourself can you send the binary so I can flash it really quick? or attach it

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

Re: IRTX plugin help

#8 Post by GusPS » 02 Mar 2017, 18:25

Yes, I've compiled it from branch using PlatformIO. I will send the resulting .bin but have in mind that it is based on the dev branch, so it is not stable. But will help you identify the Code unless it is RAW. I'm working to get RAW code implemented. So far a few hangs... Have written something about it in another thread.

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

Re: IRTX plugin help

#9 Post by Shardan » 02 Mar 2017, 20:25

GusPS wrote:Hi. Do you have the chance to add an IR Receiver on the ESPEasy to check which code is receiving? ESPEasy has a IRRec plugin.
Definitely you can.
I have designed a printed circuit board that carries an ESP-01, 4 IR-LED's and a TSOP 4838 IR-Receiver.
Stückseite_IR-Modul.jpg
Stückseite_IR-Modul.jpg (33.13 KiB) Viewed 6559 times
Lötseite_IR-Modul.jpg
Lötseite_IR-Modul.jpg (34.8 KiB) Viewed 6559 times
But be aware that the IR Rec plugin seems to give back a raw value. ATM i can't use it for e. g. forwarding IR commands.

Regards
Shardan.
Regards
Shardan

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

Re: IRTX plugin help

#10 Post by bobbybeans » 02 Mar 2017, 20:35

GusPS wrote:Yes, I've compiled it from branch using PlatformIO. I will send the resulting .bin but have in mind that it is based on the dev branch, so it is not stable. But will help you identify the Code unless it is RAW. I'm working to get RAW code implemented. So far a few hangs... Have written something about it in another thread.
ahhh nice ok well i shall await that. so here is the diagnoses of me attaching the ir receiver. upon adding it with the correct GPIO and having it pulled up it does read my remote which it doesn't look like any of my other codes so here is a breakdown

when I press the "on" button, while I am on the devices tab of the easy esp it will display a IR code number 716107913 but if i go to the log section of easy esp it will display 2aaef089. so I am confused as to why they are different.
I take either of those numbers and pipe it into a command like
http://192.168.0.13/control?cmd=IRSEND,NEC,2aaef089,16
or http://192.168.0.13/control?cmd=IRSEND,NEC,716107913 ,16

both of them fail to turn it on, I have also tried combinations of 16 or 32 bits and changing NEC to something else with no luck

I then took off both the resistors I have on the led to maybe give it more power with nothing , it still blinks briefly though confirmed through camera

I then also pointed the ir transmitter towards the ir receiver and it showed that it sent the command, i confirmed it with a blink by looking at a camera. It also blinked on the board of the receiver but in the logs it never gathered a code. nor in the devices it shows "0"

I wanted to make sure it was 100% working so i send the same exact commands from above while pointing both raspberry pi reciever at it and the easy esp at it . I send the command both blink red to acknowledge i sent it. easy reports it sents the command , raspberry pi registers that it sent the pulses ( i can give you the logs if you want) but the easy esp IR receive plugin did not register anything.

Suggestions would be appreciated as I am massivley confused on a ton of parts on this, why didn't it gather the code or report it gathered the code even though i confirmed 100% it sent.
Why are there 2 different ir codes, 1 in devices and 1 in the logs. ?


Edit
Shardan wrote:
GusPS wrote:Hi. Do you have the chance to add an IR Receiver on the ESPEasy to check which code is receiving? ESPEasy has a IRRec plugin.
Definitely you can.
I have designed a printed circuit board that carries an ESP-01, 4 IR-LED's and a TSOP 4838 IR-Receiver.

Stückseite_IR-Modul.jpg
Lötseite_IR-Modul.jpg

But be aware that the IR Rec plugin seems to give back a raw value. ATM i can't use it for e. g. forwarding IR commands.

Regards
Shardan.
Nice Shardan. Would you mind sharing the schematic because I have a copper board and acid await to make it. What are the components on the bottom of the board? I was using a 2n2222 transistor to drive my one led with a 1k resistor on the base and 1 k on the collector then the emitter goes to ground


Just to confirm 100% this is the plugin youre talking about for receiving right?
Capture.PNG
Capture.PNG (8.86 KiB) Viewed 6556 times
Last edited by bobbybeans on 02 Mar 2017, 20:45, edited 2 times in total.

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

Re: IRTX plugin help

#11 Post by Shardan » 02 Mar 2017, 20:37

bobbybeans wrote:
Shardan wrote:Hello,

I use IRrecDumpV2 on a original Arduino without problems.
I ran into several problems to flash the routine on my Uno when using my Arduino IDE usually used for compiling ESPEasy.
Seems some Libraries conflict. Installing it cleanly on another computer made it work like a charme.

I can't say much about how to send codes from Raspberry, i usse a ESP-01 for that.

Regards
Shardan

Thanks for that. I have completely removed it and updated to the latest version. I will continue to bash away at it tonight.
I think you may have understood me for the IR codes. I did originally set it up and got it fully working sending codes with Lirc from the raspberry pi to the candles. However I do not have the IRtx plugin (on the esp8266 12f) working with the codes. Can you maybe elaborate what you did with the esp01? as really in theory (someone correct me if i am wrong) it shouldn't matter what esp i put it on as long as it has enough pins for what i want to do and the correct firmware.
Sorry for misunderstanding.
I can't say much about lirc on the RPi, as said, i don't use it.
On the IRrecvDumpV2 you get a lot of output. You will need only the top three values from that.

First the protocol ("Encoding", 1st line). It can be NEC, JVC, RC5, RC6, SAMSUNG, SONY, PANASONIC. If you get another protocol, it can't be used with ESPEasy atm.
If you get a "Protocol unknown" the IRrecvDUMP can't decode it.

Second you get a hex code, usually with six or more digits.

Third is the code length, e.g. NEC usually has 32 Bits length. (Both as "Code" on the second line)
signal.png
signal.png (7.46 KiB) Viewed 6507 times
(Pic from the internet)

With these data you may send a HTTP command to the ESP:

Code: Select all

http://<IP of your ESP>/control?cmd=IRSEND,<protocol>,<hex code>,<lenght>
For example, to switch my hifi receiver i send

Code: Select all

http://192.168.123.234/control?cmd=IRSEND,NEC,7E81542B,32
The type of the ESP does not matter, any ESP8266-Type should do the job, even the small ESP-01.

Regards
Shardan
Regards
Shardan

paxi
Normal user
Posts: 121
Joined: 02 Feb 2017, 00:48
Location: Germany

Re: IRTX plugin help

#12 Post by paxi » 02 Mar 2017, 20:56

bobbybeans wrote:...
when I press the "on" button, while I am on the devices tab of the easy esp it will display a IR code number 716107913 but if i go to the log section of easy esp it will display 2aaef089. so I am confused as to why they are different.
I take either of those numbers and pipe it into a command like
http://192.168.0.13/control?cmd=IRSEND,NEC,2aaef089,16
or http://192.168.0.13/control?cmd=IRSEND,NEC,716107913 ,16

both of them fail to turn it on,
...
Why are there 2 different ir codes, 1 in devices and 1 in the logs. ?
Hopefully Shardan sees your edit, a new post referring to an answer is always better. ;)

Pull out your calculator: decimal 716107913 = 2aaef089 hex. Two representations of the same number. :D

Edit: a little reminder - 4 bits are one hex digit so your code has a length of 32 bits.

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

Re: IRTX plugin help

#13 Post by bobbybeans » 02 Mar 2017, 21:52

paxi wrote:
bobbybeans wrote:...
when I press the "on" button, while I am on the devices tab of the easy esp it will display a IR code number 716107913 but if i go to the log section of easy esp it will display 2aaef089. so I am confused as to why they are different.
I take either of those numbers and pipe it into a command like
http://192.168.0.13/control?cmd=IRSEND,NEC,2aaef089,16
or http://192.168.0.13/control?cmd=IRSEND,NEC,716107913 ,16

both of them fail to turn it on,
...
Why are there 2 different ir codes, 1 in devices and 1 in the logs. ?
Hopefully Shardan sees your edit, a new post referring to an answer is always better. ;)

Pull out your calculator: decimal 716107913 = 2aaef089 hex. Two representations of the same number. :D

Edit: a little reminder - 4 bits are one hex digit so your code has a length of 32 bits.
haha ohhh didn't even think of this earlier at work i was trying to convert stuff like this, looks like someone failed their computing class years ago at uni , ooooppsie

I finally got IrrecDumpv2 to compile and upload I will be trying this out right now just need to figure out how to wire it up

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

Re: IRTX plugin help

#14 Post by Shardan » 02 Mar 2017, 22:06

Hello again,

maybe some things should be mentioned.
I described what I did - it works for me for some months now.

Do your LEDs really send an IR signal? You can check easily with a webcam, webcams usually can see "near infrared" at 940 nm - this should be used for IR remotes.
Maybe a smartphone cam can do, i never tried that. If a smartphone works for it? Check with a working IR remote. It should show some short flashes when a key is pressed.

Which LED type do you use? Does it have 940nm or 850nm? The second one may cause troubles, i didn't check that yet.

Did you use the codes from IRrecvDumpV2? This is important!

Remember, the value shown from ESPeasy's IRrecv are "raw" code - the number you get is NOT the code you can send with the IRSEND command!
Further ESPEasy does not say anything about the encoding used. Is it really NEC?

To be honest, i'm not really sure if the ESP IR recv gives correct values at all. I just tested and get different values for the same key.
It seems the TSOP-Receiver is somewhat sensitive to environment light, as i get a reading every some seconds without any IR remote.

Do not connect a LED directly to the ESP. The ESP can deliver up to 12 mA so the IR signal will be very weak.

Even with the transistor circuit mentioned in the ESPEasy wiki you may run into ugly surprises.
The current amplification of these transistors varies heavily, there are many different IR LEDs on the market which have different parameters too.
As described above do a check with a cam if the LED really sends anything. You should see a bright flash inside the LED on the cam screen.

I had some bad issues with differing LEDs and transistors, that's why I use a MOSFET and a bunch of LEDs nowadays.
Even with that I have to adapt the resistor in serial to the LED for every LED type.
Edit: a little reminder - 4 bits are one hex digit so your code has a length of 32 bits.
Don't be too sure about that calculation. I have some cheap LED stripes with IR remote from the DIY market.
The decoding shows 6 hex digits and 32 Bit length. I suppose they use leading zeros and the IRrecvDump does not show them.
So always use the shown lenght value from IRrecvDump even if the hex code seems to be shorter.

Regards
Shardan
Regards
Shardan

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

Re: IRTX plugin help

#15 Post by bobbybeans » 03 Mar 2017, 00:27

Shardan wrote:Hello again,

maybe some things should be mentioned.
I described what I did - it works for me for some months now.

Do your LEDs really send an IR signal? You can check easily with a webcam, webcams usually can see "near infrared" at 940 nm - this should be used for IR remotes.
Maybe a smartphone cam can do, i never tried that. If a smartphone works for it? Check with a working IR remote. It should show some short flashes when a key is pressed.
yes I have confirmed this, that was in reference to when i said i confirmed it with a camera, it was just a point and shoot. That was the first thing i did :)
Shardan wrote: Which LED type do you use? Does it have 940nm or 850nm? The second one may cause troubles, i didn't check that yet.
not sure actually i just ordered one from the first link
Shardan wrote: Did you use the codes from IRrecvDumpV2? This is important!
I just literally got it IRrecvDumpV2 compiling right now. I will be doing this soon
Shardan wrote: Remember, the value shown from ESPeasy's IRrecv are "raw" code - the number you get is NOT the code you can send with the IRSEND command!
Further ESPEasy does not say anything about the encoding used. Is it really NEC?
will be looking into this tomorrow
Shardan wrote: To be honest, i'm not really sure if the ESP IR recv gives correct values at all. I just tested and get different values for the same key.
It seems the TSOP-Receiver is somewhat sensitive to environment light, as i get a reading every some seconds without any IR remote.
I dont think it does give the correct values at least compared to lirc on the rpi
Shardan wrote: Do not connect a LED directly to the ESP. The ESP can deliver up to 12 mA so the IR signal will be very weak.
I had it on a bread board with a seperate PSU :)
Shardan wrote: Even with the transistor circuit mentioned in the ESPEasy wiki you may run into ugly surprises.
The current amplification of these transistors varies heavily, there are many different IR LEDs on the market which have different parameters too.
As described above do a check with a cam if the LED really sends anything. You should see a bright flash inside the LED on the cam screen.
yup yup i have :)


So i have everything prepared for tomorrow to try the lights again and well see if it works. im tired and going to bed :P to much thinking. Thanks

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

Re: IRTX plugin help

#16 Post by GusPS » 03 Mar 2017, 00:33

Hi all.

Here is the diff I did to see what type of IR Rec protocol/bits the TSOP receives:

Code: Select all

diff --git a/_P016_IR.ino b/_P016_IR.ino
index 81e1c40..d695f6d 100644
--- a/_P016_IR.ino
+++ b/_P016_IR.ino
@@ -73,8 +73,8 @@ boolean Plugin_016(byte function, struct EventStruct *event, String& string)
           irReceiver->resume();
           UserVar[event->BaseVarIndex] = (IRcode & 0xFFFF);
           UserVar[event->BaseVarIndex + 1] = ((IRcode >> 16) & 0xFFFF);
-          String log = F("IR   : Code ");
-          log += String(IRcode, HEX);
+          char log[80];
+          sprintf_P(log, PSTR("IR - Type: %u Bits: %u Code: %s"), results.decode_type, results.bits, String(IRcode, HEX).c_str());
           addLog(LOG_LEVEL_INFO, log);
Can't send a .bin right now because I've a non-working compilation because I was playing with the RAW send routine I'm coding. As soon as I can, will tell some news.
Remember, the value shown from ESPeasy's IRrecv are "raw" code - the number you get is NOT the code you can send with the IRSEND command!
The plugin P016_IR.ino seems to process the received code checking first if it is a known protocol. See int IRrecv::decode(decode_results *results) on file IRRemoteESP8266.cpp
Of course, if there is a bug that disrupt the expected length of the pulses-spaces this will not work.
I'll try to check this using a remote control who is using a known protocol.
Shardan: are you sure it is always RAW?

btw... here is a good site that explain the differences about some protocols: http://www.sbprojects.com/knowledge/ir/index.php (i believe I grab it from another thread... don't remember really)

Lets keep in touch. I guess we can get to send a RAW signal.

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

Re: IRTX plugin help

#17 Post by Shardan » 03 Mar 2017, 01:57

I'm not sure if it is the "Raw" code you find on some IR descriptions.
Anyways, i just tested for some real values, lights off at night to reduce noise, sending from about 10 cm distance.

My LED stripes use a NEC encoding, 32 Bit length and the code F7C03F (16236607) for switching on. This works with IRSEND definitely.

The ESP-sketch gives back FA34C27F (4197761663)
This value does not change when the "Inversed" option is set.

What ever this is - it is not the NEC code the remote sends.

Sadly I'm not able to check the code itself. My programming knowledge is +20 years old :mrgreen:
Regards
Shardan

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

Re: IRTX plugin help

#18 Post by bobbybeans » 04 Mar 2017, 01:00

Well I havent tested all the buttons but I got it working with IRrecvDumpv2 at least for the power button
I will write up something more later once I have time on a full compilation of what and how to get something like this working.

However 1 thing to note. I think a big problem is actually my remote since its so cheap it doesn't give the right signals all the time. With the arduino reading it, I would press a button and it would give multipe readings, sometimes it would be NEC, other times JVC other times unknown. There was zero consistency. I just kept pressing the button till it output NEC protocol hex format and gave that a try.

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

Re: IRTX plugin help

#19 Post by Shardan » 04 Mar 2017, 10:15

Congrats :)

My LED remote is a cheap thing too (see pic).
LED-Remote_640.jpg
LED-Remote_640.jpg (84.4 KiB) Viewed 6447 times
I have the same problem with the arduino / IRrecvDumpV2 and the ESPEasy.
But I'm not sure about the issue is caused by the remote as other remotes of
better quality (Yamaha, LG, Samsung) run into same troubles.

Even without any remote button pressed i get some readings from the sensor permanently.
A temporarily created logfile from fhem looks like this:

Code: Select all

2017-03-04_10:02:39 ESPEasy_ir1 ir_rx1: 4197761663
2017-03-04_10:02:39 ESPEasy_ir1 ir_rx1: 4197761663
2017-03-04_10:02:43 ESPEasy_ir1 ir_rx1: 4197761663
2017-03-04_10:02:47 ESPEasy_ir1 ir_rx1: 3870259595
2017-03-04_10:02:53 ESPEasy_ir1 ir_rx1: 3870259595
2017-03-04_10:02:57 ESPEasy_ir1 ir_rx1: 1251341184
2017-03-04_10:03:11 ESPEasy_ir1 ir_rx1: 833731234
2017-03-04_10:03:18 ESPEasy_ir1 ir_rx1: 2781221105
2017-03-04_10:03:21 ESPEasy_ir1 ir_rx1: 2831553963
2017-03-04_10:03:37 ESPEasy_ir1 ir_rx1: 2577067277
I'll take one of my receivers and put my oscilloscope on the output to see if
the receiver produces this noise or if it comes from the ESP sketch.

Regards
Shardan
Regards
Shardan

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

Re: IRTX plugin help

#20 Post by Shardan » 04 Mar 2017, 11:36

As announced i did some checking.

Definitely the TSOP4838 produces some spike pulses at the output.
If these cross with a ir signal the decoded results are obviously wrong.

As far as i can say now the pulses are caused by some even small noise on the TSOP's power supply line.
The data sheet recommends a 0,1µF in parallel to the sensors power supply and a 100 Ohm resitor in the Vs-line.
This did not give any better result to me.

@bobbyneans:
Try a capacitor of 220 µF connected directly to the Vs / GND pins of the TSOP sensor.
I just did that and the receiver massively calmed down.
I don't see any false codes for half an hour now.

Can you try this? Would be nice if another one could verify the result.

Regards
Shardan
Regards
Shardan

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

Re: IRTX plugin help

#21 Post by GusPS » 04 Mar 2017, 14:59

Shardan wrote: Try a capacitor of 220 µF connected directly to the Vs / GND pins of the TSOP sensor.
Hi Shardan.
I always use 100Ohm from 3.3v to TSOP-VCC, and a 4.7uF between (near) TSOP-VCC and GND.

And in case you haven't seen it, in the other thread I mention that I was able to send RAW code. I hope to have a working code in the next days.

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

Re: IRTX plugin help

#22 Post by bobbybeans » 08 Mar 2017, 13:15

Ok here is finally a write up of how I got it working so tldr just use IRrecDumpv2 not Lirc on the Rpi
the Rpi lirc DOES WORK however the codes it produce I could not use for the easy esp firmware for the IRTX Plugin.

Go buy a cheap chinese Uno Clone wait a month for it to arrive then load IRrecDumpv2 onto it. add a IR receiver to the gnd,5v and pin 11 like it says in the code. The IR receiver i got it listed in my first post.
I had problems compiling it. So what I did to fix it was remove the IRrobots library from the arduino as I read a post that it had some same functions and it would mess up compiling. Also you have to rename the folder to "IRremote"
once compiled open up the serial monitor and start pushing buttons on your remote. for my remote it is SO CRAPPY that it continually gives different codes for the same button. so really this is a guess and try that you'll have to do. However, mine did output the NEC protocol format after a few times of pressing the buttons and I did that to all the buttons and just wrote them on the note pad.
The type of candles i bought can be found in some of the previous posts.
Here are the codes for my remote incase anybody else buys them. I have no clue if me giving you the codes will work, it could be randomly programmed and they're not the same, honestly have no clue not an expert in IR.
These are the hex that you need and it is protocol NEC with 32 bits.

Code: Select all

Power on 1FE48B7
Power Off 1FE58A7
Mode 1FE7887
4hr 1FE807F
8hr 1FE40BF
Multicolor 1FEC03F
Red  1FE20DF
Dark Green 1FEA05F
Dark Blue 1FE609F
White  1FEE01F
Light Green 1FE10EF
Pastel Blue 1FE906F
Yellow 1FE50AF
Light Blue 1FED827
Pink 1FEF807
Light Pink 1FE30CF
Blue 1FEB04F
Purple 1FE708F
Once you have mapped all the HEX codes flash your ESP (doesnt matter what version) with ESP Easy r135 or above, I believe 135 has IRTX plugin. please someone correct me if I am wrong. I used r147 which has it.
once you flashed it configured the esp like you normally do with ip's and other crap you want then add a device with the IRTX plugin. Select the Pin you want to use your IR LED. i used GPIO 15 any will work. Hook up your IR LED with 2 resistors and a 2n2222 transistor. 1 resistor on middle pin of the transistor 1 resistor on the collector. hook up the collector to the gpio you chose and emitter to ground and middle with resistor to IR Led
To confirm you have everything running properly
run a command you just made with your IRrecDumpv2 take the hex of that and put it into 192.168.0.13/control?cmd=IRSEND,NEC,E01F,21
the IP needs to be your esp IP and the NEC needs to be the protocol irdump says it is, the E01F needs to be the hex you gathered from IRdump when pressing a button. the 16 is how many bits the remote it, IRdump will tell you. Mine is 32

If you execute it and your IR candle or w/e you have to control works/turns on then congrats you have it working. if not confirm the LED is working by holding up a camera to the led and executing a command. if you dont see it flash purple for a split second then you probably hooked up the LED wrong. You may have setup the emitter and collector backwards. try flipping the legs. if that doesn't work. Remove the resistors as you might have them too high. I had 1k resistors and it worked fine. If this doesn't work. then trouble shoot it will either be the way you setup the ESP8266 or you have your HEX code wrong.

hope this helps to anyone dealing with IR doesnt have to be these dumb candles

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests