zschub / VeluxIR

IR protocol for old Velux remotes
GNU General Public License v3.0
10 stars 2 forks source link

No issue, just wanted to say... #1

Open deggle opened 6 years ago

deggle commented 6 years ago

...thank you for this!

Having tried to use some of the standard libraries (IRremoteESP8266) to 'learn' the Velux codes with no luck, I was searching around for info on the protocol to try and replicate it myself but struggled to find any information.

Then I came across your code, and not only did it include the protocol/packet info, but you've already coded it, and for for the ESP! It literally worked first time when flashed to a Remotsy board, so I'm pretty happy with that!

Thanks again,

Tim

eclisia commented 2 years ago

Dear @deggle and dear @zschub ! First @zschub : congratulation for such job.

@ all : have you feedback concerning the use of your code ? I faced the same probleme than @deggle : simple clone with ESP8266 remote library is not working. I was thinking about a lack of power in my IR LED emitter ? But, since I saw your code, I guess it is just a problem of timing. I don't understand very well how it works and how I can adapt it for my Velux model (a window + a blinding). Thank by advance for your answer. May be we can exchange by e-mail ? best regards

nannerbm commented 2 years ago

@ all : have you feedback concerning the use of your code ? I faced the same probleme than @deggle : simple clone with ESP8266 remote library is not working. I was thinking about a lack of power in my IR LED emitter ? But, since I saw your code, I guess it is just a problem of timing. I don't understand very well how it works and how I can adapt it for my Velux model (a window + a blinding). Thank by advance for your answer. May be we can exchange by e-mail ? best regards

Hi there, I would be happy to help if I can. Some things you could try - looking at the signals sent to your IR LED with a scope?

I used a bright IR LED (something like https://www.adafruit.com/product/387 from memory) and used the Arduino to control current flowing to the LED from a 5V rail using a simple transistor circuit (no chance to drive the IR LED with current from the Arduino IO pin - from memory it was quite limited).

csambrook commented 2 years ago

I'm not sure what you are trying to achieve exactly but the Velux IR system has some funky checksum and security built in. If you are just using zschub's code as it is then you should be OK but if you are altering the code to use different security addresses or to drive a blind as well as the window up/down motor then you'll need to take account of the security. I can send you some code which is based on zschub's work but adds full addressing and motor + blind + shutter control if that might help.

eclisia commented 2 years ago

Dear,

Thanks for your feed back.

I try to replace the older Velux remote by an ESP solution.

Various elements :

First screenshot

First scrrenshot is the waveform measured at the IR LED pin, after the call of the UP command from @zschub source code.

Second screenshot

Second screenshot is the waveforme measured at the IR Receiver pin with a homemade code. This IR signal is from the original Velux remote. This homemade code is based on the libraries :

RAW data

Finally, please find hereafter the RAW IR received from the original Velux remote and captured with a homemade code. remote : Unknown encoding: 21171BDA (24 bits) Raw (48): {404, 1226404, 12281222, 414400, 1230402, 12281220, 414400, 1228404, 1228404, 1228404, 12281220, 414402, 1228404, 1228404, 1228404, 1228404, 1228404, 1228404, 1228404, 1228404, 12281220, 414400, 1230402, 1228404}; 21171BDA

eclisia commented 2 years ago

@csambrook Thanks to for your proposal. Yes, I would like help concerning my issue. My Velux remote control unit is a WLC 100 51 04. And I've got a Up/Down/Stop command for the Windows opening system + a Up/Down/stop command for the Blinding element.

csambrook commented 2 years ago

Your scope trace from the original Velux remote doesn't show a 38kHz carrier signal which makes me wonder if you are perhaps not using a regular IR photo diode but rather one which decodes and removes the carrier signal? If so that is exactly what you'd expect for command = 'autoUP', motor = 1, address = 0 (all windows). Each bit lasts maybe 1.6ms and the whole 24 bit sequence takes just under 40ms. Your scope trace from the output pin of your esp looks like you have zoomed in too far and are seeing the 38kHz carrier signal, If that's the case you are looking at just the first 3 bits of a transmission. As explained by zschub, each bit is either a short burst of carrier followed by a long break or a long burst of carrier followed by a short break. 0ms to 1.7ms is a zero, 1.7ms to 3.5ms is a zero, and 3.5ms to 5.2ms (off the end of your trace) is a one. You might find out more if you set your timebase to show 100ms across the screen and try again. Also zoom in a little more and check that the 38kHz carrier really is 38kHz.

For what it's worth, my guess is that your processor is not running at the speed the code is expecting and as a consequence the 38kHz timing as well as the overall timing is incorrect. The code has a flag, ARDUINO_ARCH_ESP8266, which needs to be set correctly by telling your IDE the correct processor type, check you have done that.

eclisia commented 2 years ago

Dear,

Thanks for your feedback. Yes, I use an IR module bought an Amazon. Let me find the reference : here . So yes, you should have right : the module might decode something. I'll try to buy a simple IR diode and I'll come back to you (I need some week...)