how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
reza
Normal user
Posts: 59
Joined: 13 Jun 2017, 21:14

how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#1 Post by reza » 22 Jul 2020, 15:34

hi guys
i want control other infrared frequency (36 37 39 40...) with ir transmitter with espeasy. before ,i think build other frequency is related to ir transmiiter but some friends told me this is related to espeasy codes... so please help me about change code and build other infrared frequency.thank you
i am beginner in programming and hardware and software....

TD-er
Core team member
Posts: 2886
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#2 Post by TD-er » 22 Jul 2020, 22:36

For the transmitter side it shouldn't matter indeed what frequency you try to send.
For receivers there is a built in filter, which may still receive signals from neighboring carrier frequencies, but it may be a bit less sensitive for other frequencies.

For IR codes we use an external library: https://github.com/letscontrolit/ESPEas ... oteESP8266

I'm not really familiar with the code of this library and plugin as JimmyS does maintain that part.

I do know this library is rather extensive, so I can imagine some parts are just disabled at compile time.
My first guess would be to have a look at the library and the plugin code to see if you find some specific defines referring to the device you try to control.

martinus
Normal user
Posts: 83
Joined: 15 Feb 2020, 16:57

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#3 Post by martinus » 23 Jul 2020, 14:27

The IR Receivers used for this library decode the incoming signal to a mark/space pulse signal and the 3x kHz carrier signal is removed. The library never sees the carrier signal.

The used IR LED does not modulate by itself so the library uses a software PWM signal carrier to generate mark/space signals.

The library is preconfigured for all known IR signals like this:

Code: Select all

IRsend.cpp:void IRsend::enableIROut(uint32_t freq, uint8_t duty) {
IRsend.cpp:  enableIROut(hz);
IRsend.cpp:  enableIROut(frequency, dutycycle);
IRsend.cpp:  enableIROut(frequency, dutycycle);
IRsend.cpp:  enableIROut(hz);
ir_Coolix.cpp:  enableIROut(38);
ir_Daikin.cpp:    enableIROut(kDaikin128Freq);
ir_Dish.cpp:  enableIROut(57600);  // Set modulation freq. to 57.6kHz.
ir_GlobalCache.cpp:  enableIROut(hz);
ir_Goodweather.cpp:  enableIROut(38);
ir_Gree.cpp:  enableIROut(38);
ir_Haier.cpp:    enableIROut(38000);
ir_Hitachi.cpp:  enableIROut(kHitachiAcFreq);
ir_JVC.cpp:  enableIROut(38, 33);
ir_Lasertag.cpp:  enableIROut(36, 25);
ir_Lutron.cpp:  enableIROut(40000, 40);  // 40Khz & 40% dutycycle.
ir_Midea.cpp:  enableIROut(38);
ir_MWM.cpp:  enableIROut(38, 25);
ir_Neoclima.cpp:  enableIROut(38);
ir_Pronto.cpp:  enableIROut(hz);
ir_RC5_RC6.cpp:  enableIROut(36, 25);
ir_RC5_RC6.cpp:  enableIROut(36, 33);
ir_RCMM.cpp:  enableIROut(36, 33);
ir_Samsung.cpp:  enableIROut(38);
ir_Trotec.cpp:  enableIROut(36);
ir_Whynter.cpp:  enableIROut(38);
So the library can handle 36,38,40,56 kHz on demand by setting enableIROut()
The IR LED can handle all of these frequencies.

reza
Normal user
Posts: 59
Joined: 13 Jun 2017, 21:14

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#4 Post by reza » 24 Jul 2020, 14:48

TD-er wrote:
22 Jul 2020, 22:36
For the transmitter side it shouldn't matter indeed what frequency you try to send.
For receivers there is a built in filter, which may still receive signals from neighboring carrier frequencies, but it may be a bit less sensitive for other frequencies.

For IR codes we use an external library: https://github.com/letscontrolit/ESPEas ... oteESP8266

I'm not really familiar with the code of this library and plugin as JimmyS does maintain that part.

I do know this library is rather extensive, so I can imagine some parts are just disabled at compile time.
My first guess would be to have a look at the library and the plugin code to see if you find some specific defines referring to the device you try to control.
hi thank you for help. i am beginner my friend.i seen plugin but i can not found a code for change frequency :(

reza
Normal user
Posts: 59
Joined: 13 Jun 2017, 21:14

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#5 Post by reza » 24 Jul 2020, 15:00

martinus wrote:
23 Jul 2020, 14:27
The IR Receivers used for this library decode the incoming signal to a mark/space pulse signal and the 3x kHz carrier signal is removed. The library never sees the carrier signal.

The used IR LED does not modulate by itself so the library uses a software PWM signal carrier to generate mark/space signals.

The library is preconfigured for all known IR signals like this:

Code: Select all

IRsend.cpp:void IRsend::enableIROut(uint32_t freq, uint8_t duty) {
IRsend.cpp:  enableIROut(hz);
IRsend.cpp:  enableIROut(frequency, dutycycle);
IRsend.cpp:  enableIROut(frequency, dutycycle);
IRsend.cpp:  enableIROut(hz);
ir_Coolix.cpp:  enableIROut(38);
ir_Daikin.cpp:    enableIROut(kDaikin128Freq);
ir_Dish.cpp:  enableIROut(57600);  // Set modulation freq. to 57.6kHz.
ir_GlobalCache.cpp:  enableIROut(hz);
ir_Goodweather.cpp:  enableIROut(38);
ir_Gree.cpp:  enableIROut(38);
ir_Haier.cpp:    enableIROut(38000);
ir_Hitachi.cpp:  enableIROut(kHitachiAcFreq);
ir_JVC.cpp:  enableIROut(38, 33);
ir_Lasertag.cpp:  enableIROut(36, 25);
ir_Lutron.cpp:  enableIROut(40000, 40);  // 40Khz & 40% dutycycle.
ir_Midea.cpp:  enableIROut(38);
ir_MWM.cpp:  enableIROut(38, 25);
ir_Neoclima.cpp:  enableIROut(38);
ir_Pronto.cpp:  enableIROut(hz);
ir_RC5_RC6.cpp:  enableIROut(36, 25);
ir_RC5_RC6.cpp:  enableIROut(36, 33);
ir_RCMM.cpp:  enableIROut(36, 33);
ir_Samsung.cpp:  enableIROut(38);
ir_Trotec.cpp:  enableIROut(36);
ir_Whynter.cpp:  enableIROut(38);
So the library can handle 36,38,40,56 kHz on demand by setting enableIROut()
The IR LED can handle all of these frequencies.
hi friend thank you for help , i want control my A/C . this has an other frequency and i want test every frequency until found and control this. now i have a ir remote with 38 frequency and control my TV . but this is not work for A/C . even i test in 1meter distance but dont work...
so where this setting ? i am using firmware 2.00 of espeasy with D1mini.
i am beginner please help

martinus
Normal user
Posts: 83
Joined: 15 Feb 2020, 16:57

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#6 Post by martinus » 26 Jul 2020, 10:27

I guess your issue is more related to the used protocol instead of the frequency. You can't change the frequency in the ESPEasy webgui.
If you want to learn things, maybe check this link:

https://esp8266-shop.com/blog/esp8266-i ... ditioners/

You could try the IR receiver and see if signals from the IR remote are detected by the IRRemote library.

DeirdreGraham
Normal user
Posts: 2
Joined: 27 Jul 2020, 15:37

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#7 Post by DeirdreGraham » 27 Jul 2020, 16:20

I cannot see the issue here... :geek:

reza
Normal user
Posts: 59
Joined: 13 Jun 2017, 21:14

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#8 Post by reza » 27 Jul 2020, 19:42

martinus wrote:
26 Jul 2020, 10:27
I guess your issue is more related to the used protocol instead of the frequency. You can't change the frequency in the ESPEasy webgui.
If you want to learn things, maybe check this link:

https://esp8266-shop.com/blog/esp8266-i ... ditioners/

You could try the IR receiver and see if signals from the IR remote are detected by the IRRemote library.
no I do not want change the frequency in the ESPEasy webgui (there is not any setting for this in GUI). i want change this from source code and library.but i dont know how do this?! i know setting of 38 Khz is in source code , now how i can change this for 40KHz or other frequency ?

i have a ir receiver with arduino for read every codes and every remote control (TV - A/C and etc...) . so when i am test with TV remote i see which(NEC or SONY OR etc...) and i see code and how many bits (32)
so i test for send this with my ir remote with espeasy and this is work and ok . but when i want test this for a A/C remote , again i see code and bits ... in serial manitor in arduino but when i want send this for A/C even 1m distance or 0.5m , dont work. so this is related to frequency! is this true ?

TD-er
Core team member
Posts: 2886
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#9 Post by TD-er » 27 Jul 2020, 22:15

I can imagine there may be some vendor specific define in the source code which does set it to the needed carrier frequency.
So perhaps if you take a look at the code of the IR lib we use to see if you find any reference to the brand of your device?

ToniA
Normal user
Posts: 64
Joined: 26 Aug 2016, 20:37

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#10 Post by ToniA » 28 Jul 2020, 08:52

Air conditioner IR protocols are very different from TV etc. protocols. The signals are very long, and typically include all the settings at once.

Take a look at the IRext images (https://github.com/letscontrolit/ESPEasy/releases, the IRext images are also included into the builds). There are two plugins to control various A/C models, the other is HeatpumpIR and the other is IR Transmit:
https://espeasy.readthedocs.io/en/lates ... #p088-page
https://espeasy.readthedocs.io/en/lates ... #p035-page -> see the source file https://github.com/letscontrolit/ESPEas ... 5_IRTX.ino

reza
Normal user
Posts: 59
Joined: 13 Jun 2017, 21:14

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#11 Post by reza » 29 Jul 2020, 18:01

TD-er wrote:
27 Jul 2020, 22:15
I can imagine there may be some vendor specific define in the source code which does set it to the needed carrier frequency.
So perhaps if you take a look at the code of the IR lib we use to see if you find any reference to the brand of your device?
hi
the A/C that i use this is LG brand . when i read ir codes for example (for on/off) i see this code in serial manitor:

Code: Select all

Timestamp : 000071.392
Encoding  : LG
Code      : 880094D (28 bits)
Library   : v2.5.3

Raw Timing[59]:
   +  8396, -  4162,    +   632, -  1610,    +   604, -   490,    +   630, -   488, 
   +   604, -   516,    +   604, -  1610,    +   606, -   516,    +   602, -   490, 
   +   630, -   492,    +   602, -   520,    +   600, -   488,    +   632, -   492, 
   +   602, -   520,    +   602, -   488,    +   630, -   488,    +   604, -   516, 
   +   604, -   492,    +   628, -  1612,    +   602, -   492,    +   630, -   488, 
   +   604, -  1610,    +   628, -   492,    +   598, -  1614,    +   630, -   492, 
   +   600, -   516,    +   604, -  1612,    +   602, -  1610,    +   630, -   524, 
   +   568, -  1604,    +   628

uint16_t rawData[59] = {8396, 4162,  632, 1610,  604, 490,  630, 488,  604, 516,  604, 1610,  606, 516,  602, 490,  630, 492,  602, 520,  600, 488,  632, 492,  602, 520,  602, 488,  630, 488,  604, 516,  604, 492,  628, 1612,  602, 492,  630, 488,  604, 1610,  628, 492,  598, 1614,  630, 492,  600, 516,  604, 1612,  602, 1610,  630, 524,  568, 1604,  628};  // LG 880094D
uint32_t address = 0x88;
uint32_t command = 0x94;
uint64_t data = 0x880094D;


Timestamp : 000073.150
Encoding  : LG
Code      : 88C0051 (28 bits)
Library   : v2.5.3

Raw Timing[59]:
   +  8422, -  4162,    +   606, -  1610,    +   630, -   490,    +   602, -   518, 
   +   602, -   492,    +   626, -  1610,    +   604, -   490,    +   630, -   492, 
   +   602, -   514,    +   606, -  1608,    +   606, -  1608,    +   632, -   488, 
   +   604, -   518,    +   604, -   490,    +   626, -   490,    +   606, -   514, 
   +   602, -   518,    +   664, -   432,    +   602, -   516,    +   602, -   524, 
   +   594, -   492,    +   602, -   550,    +   568, -  1612,    +   604, -   516, 
   +   600, -  1612,    +   604, -   552,    +   568, -   492,    +   630, -   490, 
   +   602, -  1610,    +   630

uint16_t rawData[59] = {8422, 4162,  606, 1610,  630, 490,  602, 518,  602, 492,  626, 1610,  604, 490,  630, 492,  602, 514,  606, 1608,  606, 1608,  632, 488,  604, 518,  604, 490,  626, 490,  606, 514,  602, 518,  664, 432,  602, 516,  602, 524,  594, 492,  602, 550,  568, 1612,  604, 516,  600, 1612,  604, 552,  568, 492,  630, 490,  602, 1610,  630};  // LG 88C0051
uint32_t address = 0x88;
uint32_t command = 0xC005;
uint64_t data = 0x88C0051;
but when i want send this code with this command and my esp tramsmitter:

Code: Select all

http://192.168.1.131/control?cmd=IRSEND,LG,88C0051,28
so dont work . what am i do ? :(

ToniA
Normal user
Posts: 64
Joined: 26 Aug 2016, 20:37

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#12 Post by ToniA » 30 Jul 2020, 09:22

Use a plugin which is intended for A/C control. See my post above.

reza
Normal user
Posts: 59
Joined: 13 Jun 2017, 21:14

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#13 Post by reza » 01 Aug 2020, 01:04

ToniA wrote:
30 Jul 2020, 09:22
Use a plugin which is intended for A/C control. See my post above.
my friend, i am beginner . which plugin i can use for this problem ? how use plugin? this plugin, can support my A/C brand (LG) ?

jimmys01
Normal user
Posts: 19
Joined: 07 Jan 2019, 22:37

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#14 Post by jimmys01 » 01 Aug 2020, 10:12

The command should work as you have wrote it. But also check this: https://github.com/letscontrolit/ESPEasy/issues/2724
Perhaps you have a hardware issue.
Check this: https://github.com/crankyoldgit/IRremot ... ting-Guide

reza
Normal user
Posts: 59
Joined: 13 Jun 2017, 21:14

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#15 Post by reza » 08 Aug 2020, 10:27

jimmys01 wrote:
01 Aug 2020, 10:12
The command should work as you have wrote it. But also check this: https://github.com/letscontrolit/ESPEasy/issues/2724
Perhaps you have a hardware issue.
Check this: https://github.com/crankyoldgit/IRremot ... ting-Guide
friends , i am beginner
3 years ago for TV control with espeasy , i used

Code: Select all

ESPEasy_v2.0.0-dev10_normal_4096.bin
with a D1mini . (used shardan circuit for ir transmit).
with a arduino and a IR receiver i seen 3 parameter for send.
1.brand (for example samsung)
2.code (for example 12345678)
3.bits (for example 32bits)
so with this command i can conrol my TV.

Code: Select all

http://192.168.1.131/control?cmd=IRSEND,SAMSUNG,12345678,32
now for A/C i think , i am must use this :

Code: Select all

ESP_Easy_mega_20200801_minimal_IRext_ESP8266_1M.bin
for a D1mini . is this true? this code support other brand for example LG ?
and for seen codes of A/C remote use this with a arduino and IR receiver :
https://github.com/ToniA/Raw-IR-decoder-for-Arduino
is this true ?
but this code can not compile on arduino and have these errors:

Code: Select all

C:\Users\GITEX\AppData\Local\Temp\ccpo5w0o.ltrans0.ltrans.o: In function `decodeProtocols':
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:373: undefined reference to `decodeMitsubishiElectric(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:374: undefined reference to `decodeFujitsu(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:375: undefined reference to `decodeMitsubishiHeavy(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:376: undefined reference to `decodeSharp(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:377: undefined reference to `decodeDaikin(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:378: undefined reference to `decodeCarrier(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:379: undefined reference to `decodeCarrier(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:380: undefined reference to `decodePanasonicCKP(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:381: undefined reference to `decodePanasonicCS(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:382: undefined reference to `decodeHyundai(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:383: undefined reference to `decodeGree(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:384: undefined reference to `decodeGree_YAC(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:385: undefined reference to `decodeFuego(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:386: undefined reference to `decodeToshiba(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:387: undefined reference to `decodeNibe(unsigned char*, char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:388: undefined reference to `decodeAirwell(char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:389: undefined reference to `decodeHitachi(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:390: undefined reference to `decodeSamsung(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:391: undefined reference to `decodeBallu(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:392: undefined reference to `decodeAUX(unsigned char*, int)'
C:\Users\GITEX\Desktop\dl new\Raw-IR-decoder-for-Arduino-master\rawirdecode/rawirdecode.ino:393: undefined reference to `decodeZHLT01remote(unsigned char*, int)'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Nano.
please guidence me . thanks

ToniA
Normal user
Posts: 64
Joined: 26 Aug 2016, 20:37

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#16 Post by ToniA » 08 Aug 2020, 10:56

Are you sure you have the whole project, and not just the rawirdecode.ino? In Arduino IDE, you should have a lot of tabs, first one for the ino file, and then one for each cpp file.

I just tried to compile it for board 'Arduino Nano', and it compiles. I just don't have any way to verify if it actually works on the board, as all I have is Duemilanove and Mega.

reza
Normal user
Posts: 59
Joined: 13 Jun 2017, 21:14

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#17 Post by reza » 08 Aug 2020, 11:03

ToniA wrote:
08 Aug 2020, 10:56
Are you sure you have the whole project, and not just the rawirdecode.ino? In Arduino IDE, you should have a lot of tabs, first one for the ino file, and then one for each cpp file.

I just tried to compile it for board 'Arduino Nano', and it compiles. I just don't have any way to verify if it actually works on the board, as all I have is Duemilanove and Mega.
i have just rawirdecode.ino :(
Untitlejjjd.jpg
Untitlejjjd.jpg (262.06 KiB) Viewed 192 times
where is my problem :(

Is my path correct to control A/C?
if this problem resolve , i can control my LG A/C ? :(

ToniA
Normal user
Posts: 64
Joined: 26 Aug 2016, 20:37

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#18 Post by ToniA » 08 Aug 2020, 11:45

That looks strange. The IDE should open all the code files in the folder, and include them into the build.

reza
Normal user
Posts: 59
Joined: 13 Jun 2017, 21:14

Re: how build 36 or 37 or 39 or 40 Khz frequency with espeasy (esp8266) ?

#19 Post by reza » 08 Aug 2020, 12:13

ToniA wrote:
08 Aug 2020, 11:45
That looks strange. The IDE should open all the code files in the folder, and include them into the build.
i found problem. all files must move to a folder with name "rawirdecode" until open. now all files open in IDE. but have error about big files and can not compile on arduino nano and work on arduino mega. i will test this with arduino mega. but just one quesion. i am weak in english and translate. so i understand your explain hardly. is that true my explain ? about control A/C ? can i control LG brand with this code ? thank you

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests