Skip to content
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

Broadlink RM4Pro typeid 5213 #114

Open
ChMaBu opened this issue Jul 24, 2024 · 5 comments
Open

Broadlink RM4Pro typeid 5213 #114

ChMaBu opened this issue Jul 24, 2024 · 5 comments

Comments

@ChMaBu
Copy link

ChMaBu commented Jul 24, 2024

Hi,

I can discover, but I can not turn on the learning mode.
Also no log file / debug info.

Pls. help

@bruno1007
Copy link

I also have the same problem with the RM4 Pro, typeid = 520b.

@bitlocus-art
Copy link

bitlocus-art commented Nov 2, 2024

I had the same issue with 520b, and spent a few hrs investigating the issue, comparing packets generated with the broadlink_cli.

Here are the two main issues:

  1. 520b requires the MAC address IN REVERSE, e.g. A0B1C2D3E4F5 needs to be entered as F5E4D3C2B1A0
  2. the encrypted payload needs to be PADDED to the next 16 bytes.

interim fix, until a new version is released that addresses the issue:

here is a template code that you can use in NODERED, right before an RM node (you dont need to configure the RM node, just set it to Device: "none" and Action: from payload

Add a function node ("on message" code) before the RM node, to populate the payload:


// BUGFIX for RM Pro 4, type 520b

var CODEHEX = "b1c03803ba...........1c1c0005dc";  // YOUR RF REMOTE BYTECODE AS HEX
// Convert HEX string to a Buffer
var data = Buffer.from(CODEHEX, 'hex');

// Calculate padding to make data length a multiple of 16
// (note that the plugin will add another header of 6 bytes)
const padding = (16 - ((data.length+6) % 16)) % 16;

// Add padding (all 0 bytes) to the data buffer
data = Buffer.concat([data, Buffer.alloc(padding)]);

var mac = "a0b1c2d3e4f5";  // your RMPRO4 mac  (not in reverse)
var host = "192.168.1.7";      // your RMPRO4 ip
msg.payload={
    "mac": Buffer.from(mac, 'hex').reverse().toString("hex"),  // need to reverse (bugfix)
    "host": host, 
    "devType" : "520b",
    "action":"send",
    "data":data
};

return msg;

@UpgradedMR
Copy link

I had the same issue with 520b, and spent a few hrs investigating the issue, comparing packets generated with the broadlink_cli.

Here are the two main issues:

  1. 520b requires the MAC address IN REVERSE, e.g. A0B1C2D3E4F5 needs to be entered as F5E4D3C2B1A0
  2. the encrypted payload needs to be PADDED to the next 16 bytes.

interim fix, until a new version is released that addresses the issue:

here is a template code that you can use in NODERED, right before an RM node (you dont need to configure the RM node, just set it to Device: "none" and Action: from payload

Add a function node ("on message" code) before the RM node, to populate the payload:


// BUGFIX for RM Pro 4, type 520b

var CODEHEX = "b1c03803ba...........1c1c0005dc";  // YOUR RF REMOTE BYTECODE AS HEX
// Convert HEX string to a Buffer
var data = Buffer.from(CODEHEX, 'hex');

// Calculate padding to make data length a multiple of 16
// (note that the plugin will add another header of 6 bytes)
const padding = (16 - ((data.length+6) % 16)) % 16;

// Add padding (all 0 bytes) to the data buffer
data = Buffer.concat([data, Buffer.alloc(padding)]);

var mac = "a0b1c2d3e4f5";  // your RMPRO4 mac  (not in reverse)
var host = "192.168.1.7";      // your RMPRO4 ip
msg.payload={
    "mac": Buffer.from(mac, 'hex').reverse().toString("hex"),  // need to reverse (bugfix)
    "host": host, 
    "devType" : "520b",
    "action":"send",
    "data":data
};

return msg;

What is "YOUR RF REMOTE BYTECODE AS HEX"?

@bitlocus-art
Copy link

What is "YOUR RF REMOTE BYTECODE AS HEX"?

This is the actual 433 MHZ RF message you want the RM4Pro to send to the receiving device. E.g. if you record an RF buttom press from an RF remote, that's what you would have recorded, and now want to replay.

You can record the RF signal for example with the python broadlink CLI:
https://github.com/mjg59/python-broadlink/tree/master/cli

The CLI can record and output the received signal in 3 different formats:

  • as Base64 encoded string
  • as HEX Bytecode, and
  • in Pulse format

You need to use the HEX bytecode (or if you captured the signal in a different way and have it as base64 you can just use a base64 to hex converter)

@UpgradedMR
Copy link

What is "YOUR RF REMOTE BYTECODE AS HEX"?

This is the actual 433 MHZ RF message you want the RM4Pro to send to the receiving device. E.g. if you record an RF buttom press from an RF remote, that's what you would have recorded, and now want to replay.

You can record the RF signal for example with the python broadlink CLI: https://github.com/mjg59/python-broadlink/tree/master/cli

The CLI can record and output the received signal in 3 different formats:

  • as Base64 encoded string
  • as HEX Bytecode, and
  • in Pulse format

You need to use the HEX bytecode (or if you captured the signal in a different way and have it as base64 you can just use a base64 to hex converter)

Thanks for your guidance with that. Everything seems to be ok with the CLI until i get to actually retrieving the code. It definitely looks like its being captured properly based on the LED but the command isnt pulling anything back.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants