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

Problem with sending a command #15

Open
deadeye-flint opened this issue Dec 15, 2017 · 7 comments
Open

Problem with sending a command #15

deadeye-flint opened this issue Dec 15, 2017 · 7 comments

Comments

@deadeye-flint
Copy link

deadeye-flint commented Dec 15, 2017

Hi,

first, thanks for your effort. Cool stuff.

Looks like, sending my command isn't working.
I'm doing the following:
RM2Device rm2 = new RM2Device(rmip, new Mac(b));
rm2.auth();
rm2.enterLearning(); // this gives me a success and led is on
Thread.sleep(10000); // during that time, I press the button on my remote and led goes off
byte[] command = rm2.checkData();
rm2.sendCmdPkt(new SendDataCmdPayload(command));

I'd expect that my command is sent again. Or am I doing something wrong? I have a RM pro, I think. It's this one:
https://www.amazon.de/Urant-Universal-Intelligent-Controller-Automation-RF-Fernbedienung-Funktioniert-Smart-Remote-Control/dp/B06XKPFBMP/ref=sr_1_4?ie=UTF8&qid=1513372563&sr=8-4&keywords=rm+pro

The same command works when I use the Broadlink app.

Thanks for your help.

@mob41
Copy link
Owner

mob41 commented Dec 16, 2017

Are you trying to learn a RF remote code? This won’t work currently because this library does not implement sweep frequency for RF, so as Python’s one.

mjg59/python-broadlink#87

Can you try with IR one? It should work

@deadeye-flint
Copy link
Author

Hi mob41,

I'm trying with IR. So, the code, I posted should work correctly? Any idea what I could do to find the problem?

Also, is there a way to check, if a new command was learned? Because, I'd assume Thread.sleep for 10 seconds isn't the best way to learn new commands.

Thanks

@deadeye-flint
Copy link
Author

I did some other tests. I wanted to try the python version. But I had troubles to let it run. Then, I installed Home Assistant which also has Broadlink support. With this, I can learn and send commands properly.
It's interesting. When sending commands with the java api, the led not even turns on. So, it looks like, it's not sending at all.
Any ideas?
Not sure, if this is important, I'm running the api with java 9 on macOS.

Can you give me the hex code of a proper IR command? I just want to check, if the led turns on when I use a command that works for you.

such a command looks like that:
0000000000000000000000008619052708AD8E80E9210642BAFB6A9FE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4CE27657B1A0FAE00253709E9A7D3A3F4C

Can you approve that this should work?
byte[] command = rm2.checkData();
rm2.sendCmdPkt(new SendDataCmdPayload(command));

Also, is it usual, that checkData() always returns data? Or should it only return data, when something was learned? Because in my case checkData() always returns something.

Thanks for your help.

@mob41
Copy link
Owner

mob41 commented Dec 22, 2017

Hi,
I still don't have enough time to test out the results. I will reply you asap!

checkData() will return null if no data is received or error occurred in RM Pro.
In my knowledge, once enterLearning() is called, the data in RM Pro is cleared.

@deadeye-flint
Copy link
Author

Hi,

no problem. I don't expect a quick reply for a project, you most likely work in your spare time. I actually was surprised that I got a reply so quickly.

Also, I'm now considering using an Harmony Hub instead, because then I also can control my PS3. Unfortunately, then I can't use it for my fan.

Cheers,
Hannes

@bwssytems
Copy link
Contributor

This has been resolved with the 1.0.1-SNAPSHOT version that was just merged.

@mob41
Copy link
Owner

mob41 commented Aug 12, 2019

Have this got resolved? I am gonna to close this and mark it as completed.

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

3 participants