-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apple TV Remote NEC repeat signal #364
Comments
All you need to do is specify the number of repeats when calling From your example, if you wanted to transmit that sequence of a NEC 77E1A097 message and three (3) NEC repeat messages, you'd make the following call: |
Friendly ping. How did it work for you? |
Hey crankyoldgit at first thanks for your help, I really appreciate that! Unfortunately I don't have much time to work on my project at the moment, but I tested it right now and it doesn't work. When I use the remote, to turn the AppleTV off, LED light is off as long as I push the button. But if I use my board to transmit the code, the light goes off and immediately on. Like it would only send one signal. |
I'm curious, how does the delay not work like it should?! (Feel free to post your .ino here, Just use the "Insert code" selection when you do so to keep it formatted.) I used to have an old Gen 1 Apple TV, I know the "hold" button thing. That used to be held down for seconds or so at a time. If that's what you are trying to reproduce, just be aware that the each message (i.e. the initial and each "repeat" command) is only about roughly 100 milliseconds. So, if say you wanted to emulate holding the button down for 5 seconds, you'd need 5000/100 = 50 or so repeats. e.g. The command itself does all of it's delay's internally. i.e. that command will take about 5 seconds to complete, hopefully. If however, what you are saying is your ESP isn't behaving correctly when doing |
I will give you a quick overview over the project. I want to control my living room with amazon echo, so far so good. I can switch my TV on/off and also my music system, just with saying "Alexa, turn my TV/music system on/off" (On works with the AppleTV, but I only tried six repeat codes to turn it off. 'cause my universal remote used six). For that I dont really need the delay() function. But I also want to make a advanced command, like YouTube. When I say "Alexa, turn YouTube on." my TV, music system and AppleTV should start, after a short delay my TV/music system should switch to the right inputs and the AppleTV should go two apps to the right and confirm so YouTube get started.
`Serial.println("Start"); Start = millis(); do ino: ` #include <IRremoteESP8266.h> //by Ken Shirriff (C) NEU #define WIFI_SSID "Mr. NiceGuy (.Y.)" fauxmoESP alexawifi; IRsend IRLED(4); // IRLED angeschlossen am D2 Pin (GPIO4) - NEU unsigned long Start; void wifiSetup() { // -----------------------------------------------------------------------------
} void pause(int ms) void anfrage(uint8_t device_id, const char * device_name, bool state) if (state) //Geräte anschalten - devices turn on
} else //Geräte Ausschalten
} void geraete(){
} void setup() {
} void loop() // if (millis() - previousMillis > interval) |
FYI, you can use the https://github.com/markszabo/IRremoteESP8266/blob/master/examples/IRMQTTServer/IRMQTTServer.ino example code and something like https://home-assistant.io/ to do automation and combined with Amazon Alexa. I do it and something similar, for example here: https://github.com/crankyoldgit/Home-AssistantConfig/blob/master/scripts.yaml Now, to your script. Unless you have a reason, don't use Next, I notice you've got some I'm not sure what is going in you main Hope that helps. |
I'm a bit busy at the moment with my study, so I don't have the time to make something complete new. But I will definitely give it a go when I get the time! This is my first project and I have big goals for my apartment :D `else if (device_id == 3) //YouTube for(int i = 0; i < 2; i++) IRLED.sendNEC(0x77E1A080, 32); //Apple TV Bestätigen - ok |
I tried a delay(10) in my loop and the board doesn't like it (reboot). |
Okay, what you describe sounds very weird and bad. I think you need to go back to basics, try loading the standard blink.ino example code. i.e. turns an led on and off every 1-2 seconds to so. Without your exact code to download from somewhere (i.e. github/pastebin/etc) I can't help you further. Assuming it (blink) does work, then work your way forward adding in libraries and your code bit by bit to find out what is broken. A long shot, but get rid of or rename your In order for this (IR) library to function correctly, you are going to need a working |
When I get the time, I will start from zero and work my way up. It's very frustrating and I can't leave that alone, so I think I will probably try to start with it tonight :D |
Thanks crankyoldgi for your help, I really appreciate that you took some time to help me! I finally found my problem and a way around it. It was a function called onMessage in the Library above. I just copy the information I need out of it and continue without it. `#include <IRremoteESP8266.h> #include "fauxmoESP.h" fauxmoESP fauxmo; bool device_value; #define WIFI_SSID "Mr. NiceGuy (.Y.)" void setup() wifiSetup(); void loop() if (doSomething == 1) } void MusicTest() void request(unsigned char device_code, bool device_value) void wifiSetup() // ----------
} void devices() fauxmo.onMessage(copy); void copy(uint8_t device_id, const char * device_name, bool state) |
@MarleyRobert Um, you may now want to change your WIFI password. ;-) e.g. #define WIFI_PASS "MbdWPn!420*" But I'm sure you deliberately randomised it before posting to trick others. Nudge Nudge, ;-) ;-) It seems everything is sorted now, so I'm going to close this issue. If you don't believe so, please update it and we can re-open. (plus closing it will make that password less obvious.) |
What's up @crankyoldgit (peace) |
@MarleyRobert The former. IRsend doesn't need any time between sending signals. It doesn't care. |
Oh and to be clear, most protocols this library supports sending include the 'inter-message' gap per protocol at the end of the active part of sending. You don't need to code for that. |
hi there (peace),
I want to control my AppleTV but I have a problem. There is a Button which, when I press it once, sends the code 77E1C097 (32 bits) twice. When I press the button twice, i receive the same code four times. But there is another funtion of the button I want to use. For this one I need to hold the button for about 1-2 sec. So again, I get the same code twice and after that I get the NEC(repeat) code
does anybody of you know how I can send the NEC repeat signal or does anyone know a way around this problem?
best regards,
michel
The text was updated successfully, but these errors were encountered: