mlfunston / node-red-contrib-broadlink-control

Set of node-red nodes to manage the Broadlink home automation device suite
MIT License
44 stars 24 forks source link

send Base64 code not working #87

Open javferper opened 2 years ago

javferper commented 2 years ago

I have a RM4 pro type 649b. No problem learning the red node code, no problem sending the base64 from Home Assistant, but I can't send it through the red node. Node debug no show error, but device red LED never lights up when clicking injection node. any solution? Thanks

andjones132 commented 2 years ago

I have the exact same issue with the RM4 Pro. I have a remote to control device. I used HA to learn the Base64 codes. Out of 6 buttons on the remote, 4 of them work.

This Base64 code works:

"scAGAeyeBgALJikMDicOKCcMKA0NKA0nDicoDScOJw0NKCcODScNKA0nDSgNJw4nKA0oDScNDQABjQ4nDicoDQ0nDicoDScNDicNJw4nKA0oDScNDSgoDQ0oDCgNKA0nDicNJygNKA0oDA4AAY0NKA0nKA0OJg4nKA0oDQ0nDicNKCcNKA0oDQ0nKA0NKA0nDicNKA0nDicoDScNKA0NAAGNDicNKCgMDicNKCgMKA0NKA0nDicoDScOJw0NKCcODScNKA0nDicNKA0nKA0oDScNDQABpA4nDSgoDA4nDSgoDCgNDSgNJw4nKA0nDicNDSgnDgwoDSgNJw4nDSgNJygNKA0nDQ0ABdw="

This Base64 code does not work:

"scBEAvaeBgAEDgUNBAABJQfRBQ0FDAQAAf0EDwUMBAABJwREBI8EDgULBAAB/QQNBlsEAAGtBwwGDAQAASQERQSPBBAEDAQAASUE1gQQBAwEAAEoBNMGCwYMBAABJwTTBgwGCgQAAScE0wQNBAQEWQTXBNMFHgQAASUE1AYMBgwEAAEmBNQGCwYMBAAB/AQRBAABegSPBBAEDAQAAScE0ggKBwsEAAEkBdMGDAYLBAAB/AcOBAwEAAH9BBEEAAE0BNUGCwYMBAABygQxBQ4FCwQAAfwHCwYMBAABJQZUDicoDA4nDicoDCgNDSgNJw4nKA0nDSgNDSgnDQ0oDSgNJw0oDScoDSgNDScOJg4AAY0NJw4nKA0NJw4nKA0oDA4nDSgNJygNKA0nDQ0oJw4NJw0oDScOJw0oJw0oDQ0oDScNAAGNDSgNJygNDiYOJygNKA0NJw0oDScoDSgNKA0NJygNDScNKA0oDScNKCgNJw0NKA0nDQABjQ4nDScpDA4nDScoDSgNDScOJw0oKAwoDSgNDScoDQ0oDScOJw0nDicoDScODScNJw4AAY0NJw4nKAwOJw4nKA0nDQ4nDScOJygNKA0nDQ0oJw4NJw0oDScOJw0nKA0oDQ0nDicNAAGNDicNJygNDScOJygNKA0NJw4nDScoDSgNKA0NJygNDScOJw0oDScOJygNJw0NKA0nDgABjA4nDicoDA4nDSgoDCgNDSgNJw4nKA0nDSgNDSgnDQ0oDScOJw0oDScoDSgNDScOJw0ABdw="

mondedos commented 2 years ago

Hello,

I definitely confirm that it is a bug of this development. The problem is that it does not send long lR codes, neither in base 64 nor in array format.

I have performed the following test. I have two broadlink at home, the mini 3 and the mini 4 and I have tried the following scenarios.

Case 1 Code => [38,0,88,0,0,1,33,148,19,18,18,56,17,20,18,19,17,19,18,19,18,19,18,19, 19,55,19,18,18,56,17,56,19,55,19,55,18,19,18,55,19,55,19,55,18,19,18,19,18, 55,19,18,18,56,18,19,19,18,19,18,18,56,17,56,19,18,18,56,19,18,19,55,17,0, 5,62,0,1,38,74,19,0,12,82,0,1,39,73,18,0,13,5,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0]

I put the mini 3 in learning mode and send from the mini 4 a short frame, then the mini 3 receives the code correctly.

I put the mini 4 in learning mode and send from the mini 3 a short frame, then the mini 4 receives the code correctly.

case 2 Code =>

[38,0,6,1,103,54,13,14,13,14,13,40,14,14,13,40,14,13,14,14,13,14,14,40, 13,40,14,13,14,14,13,14,13,40,14,40,14,14,13,14,13,17,14,14,13,14,13,14,13, 14,14,13,14,14,13,14,13,14,14,13,14,14,13,40,14,13,14,14,13,14,14,13,14,13, 14,14,13,14,13,40,14,14,13,14,13,14,13,15,13,41,13,40,14,40,14,40,13,40,14, 40,13,41,13,40,14,14,13,14,13,41,13,14,13,14,13,14,13,15,13,14,13,14,13,14, 13,14,14,40,13,40,14,14,13,14,13,41,13,14,13,14,13,14,14,13,14,14,13,14,13, 41,13,40,14,13,14,14,13,14,13,14,13,14,14,13,14,14,13,14,13,14,14,40,13,14, 13,14,14,13,14,14,13,14,14,13,14,13,14,14,13,14,13,14,13,14,14,13,14,14,13, 14,13,14,14,13,14,14,13,14,13,14,13,14,14,14,13,14,13,14,13,14,14,14,13,14, 15,12,13,14,14,14,13,14,13,14,13,14,14,13,14,14,13,40,14,13,14,14,13,14,13, 41,13,14,13,40,14,14,13,40,15,12,14,14,13,0,13,5,13,5]

I put the mini 3 in learning mode and send from the mini 4 a long frame, then the mini 3 does not receive the code.

I put the mini 4 in learning mode and send from the mini 3 a long frame, then the mini 4 does not receive the code.

Therefore, I interpret that it is not a problem with the mini 3 or the mini 4 because from the broadlink application I can turn on the devices that have a long code. In this case it is clear that it is a bug of this development.

Please could you find out the problem and correct it?

Thank you

mondedos commented 2 years ago

After reviewing the code, I think the problem may be focused on the following function of the Device.js class

sendPacket(command, payload) { this.count = (this.count + 1) & 0xffff; var packet = Buffer.alloc(0x38, 0); //Is it possible to increase the buffer? packet[0x00] = 0x5a;

I don't know if it is possible or not to increase the buffer.

var packet = Buffer.alloc(0x38, 0); //Is it possible to increase the buffer?

I don't know how I could test this modification because I don't know how to program in this language, nor do I know how to set up a test project to verify what I say. But I understand that the length of the buffer could be calculated based on the IR code that is being sent to it.

Please, we need it corrected.

Thanks in advance.

mondedos commented 2 years ago

It seems that the project is abandoned, nobody answers and the last update is from 2021.