Comments (5)
I'm not sure if I have the same issue as you but I'm also using irsend.sendRaw and I'm not getting the results. I tested this first with an Arduino code which did work but it doesn't work with my ESP-12E module.
Here's my code:
#include <IRremoteESP8266.h>
//#include <IRremoteInt.h>
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include "fauxmoESP.h"
//#include "credentials.h" can use this
//to set WiFi SSID and password
#define WIFI_SSID "iotech-2.4GHz"
#define WIFI_PASS "Athena&George"
#define SERIAL_BAUDRATE 115200
#define LED 16 // LED on Board
#define RELAY_PIN 4 //
#define OPen2Pin 12 // Open Blinds pin
#define Close2Pin 14 // Close Blinds pin
#define khz 40 // 40kHz carrier frequency for the Hunter Douglas
IRsend irsend(0); //
unsigned int OPen2Signal[] = {2800, 2800, 1050, 2800, 1050, 1050, 1050, 1050, 1050,
2800, 2800, 2800, 1050, 2800, 1050, 1050, 1050, 1050, 1050,
2800, 2800, 2800, 1050, 2800, 1050, 1050, 1050, 1050, 1050,
2800, 2800, 2800, 1050, 2800, 1050, 1050, 1050, 1050, 1050,
2800, 2800, 2800, 1050, 2800, 1050, 1050, 1050, 1050, 1050,
2800, 2800, 2800, 1050, 2800, 1050, 1050, 1050, 1050, 1050,
2800, 2800, 2800, 1050, 2800, 1050, 1050, 1050, 1050, 1050,
2800, 2800, 2800, 1050, 2800, 1050, 1050, 1050, 1050, 1050, 1975
}; //Open2
unsigned int Close2Signal[] = {2800, 2800, 1050, 2800, 1050, 1050, 1050, 2800, 1050,
1050, 2800, 2800, 1050, 2800, 1050, 1050, 1050, 2800, 1050,
1050, 2800, 2800, 1050, 2800, 1050, 1050, 1050, 2800, 1050,
1050, 2800, 2800, 1050, 2800, 1050, 1050, 1050, 2800, 1050,
1050, 2800, 2800, 1050, 2800, 1050, 1050, 1050, 2800, 1050,
1050, 2800, 2800, 1050, 2800, 1050, 1050, 1050, 2800, 1050,
1050, 2800, 2800, 1050, 2800, 1050, 1050, 1050, 2800, 1050,
1050, 2800, 2800, 1050, 2800, 1050, 1050, 1050, 2800, 1050, 1975
}; //Close the lower blinds
// variables will change:
int butOpen2State = 0; // variable for reading the pushbutton status
int butClose2State = 0; // variable for reading the pushbutton status
fauxmoESP fauxmo;
...
void loop() {
// Since fauxmoESP 2.0 the library uses the "compatibility" mode by
// default, this means that it uses WiFiUdp class instead of AsyncUDP.
// The later requires the Arduino Core for ESP8266 staging version
// whilst the former works fine with current stable 2.3.0 version.
// But, since it's not "async" anymore we have to manually poll for UDP
// packets
fauxmo.handle();
// read the state of the pushbutton value:
butOpen2State = digitalRead(OPen2Pin);
butClose2State = digitalRead(Close2Pin);
//Serial.println(butOpen2State);
if (butOpen2State == HIGH) {
// send IR code:
irsend.sendRaw(OPen2Signal, sizeof(OPen2Signal) / sizeof(OPen2Signal[0]), khz);
Serial.println("Open2 Button Pushed");
digitalWrite(RELAY_PIN, HIGH);
}
if (butClose2State == HIGH) {
// send IR code:
irsend.sendRaw(Close2Signal, sizeof(Close2Signal) / sizeof(Close2Signal[0]), khz);
Serial.println("Close2 Button Pushed");
digitalWrite(RELAY_PIN, LOW);
}
}
For testing I inserted a standard LED and the LED is always ON. I haven't hooked up the scope to check the signals but this is different than what worked on the Arduino setup.
Maybe I'll try hard coding the array size and length and see if that works like it did with you but that doesn't explain why GPIO0 is always high (3.3V).
from irremoteesp8266.
Try using a different gpio rather than 0. Gpio 0 is use by the ESP8266 and requires special handling...
http://www.forward.com.au/pfod/ESP8266/GPIOpins/index.html
from irremoteesp8266.
Yes, I've tried 0 and also 4 and I confirmed on the scope that nothing is going out on those pins. I added the code to toggle another pin when the button is pushed and that works so I know that I'm entering that portion of the code.
I can't seem to figure out what's wrong, full code at http://pastebin.com/Gexv8t3a
from irremoteesp8266.
I got the code to work but I added pinMode(4, OUTPUT)
which makes sense but none of the examples configured the pin so I assumed that was done in the IR code
from irremoteesp8266.
It is done in the code/library, but you need to call the begin() method. From yourexample above:
IRsend irsend(0);
You should have had a irsend.begin(); in your setup() routine.
That was initialising the IR sender on Pin 0. If you wanted pin 4, then use:
IRsend irsend(4);
setup() {
irsend.begin();
}
loop() {
...
}
from irremoteesp8266.
Related Issues (20)
- Panasonic AC 128bit HOT 1
- `sendNEC()` function has no NEC redundant bits implemented HOT 1
- I might help improving KELVINATOR protocol (Timer function) HOT 1
- IRremoteESP8266 library sending wrong when send signal of 32 bits HOT 4
- help with irsend AC commands convert String to unsigned char array HOT 1
- Library's Non-declared variables & too many arguments to function issues. HOT 1
- Adding night mode for Mistubishi Electric air con HOT 2
- Compile Error in ESP32 IDF when including IRemoteESP8266 as a component HOT 2
- DECODE_HASH should get its own protocol type HOT 9
- IRremoteESP8266 library compile error bk7231t HOT 2
- USB CDC must be enabled on ESP32S3 in order to receive infrared signals correctly. HOT 1
- Fails to detect Hitachi AC Remote. Sending raw data also does not work HOT 9
- Need help for Panasonic Remote Control N2QAYB000354
- The IT Receiver sensor (SM0038) is receiving signals and reporting values even when not pressing any button in the remote.
- Carrier AC 84bit HOT 2
- Does this library support for OnePlus TV , realme TV and Mi TV remote. HOT 1
- Problem with Zanussi A/C HOT 7
- IRHaierAC160 light toggle only working every 2nd time
- Unable to include C libraries HOT 3
- How to get or find CarrierAc 32 bit protocol? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from irremoteesp8266.