Git Product home page Git Product logo

Comments (18)

Pepolyno avatar Pepolyno commented on July 16, 2024

No meu Broadlink ocorre o mesmo problema. Mas ele sempre trabalhou bem, de uns tempo para cรก resolveu parar de funcionar.

from broadlink-http-rest.

radinsky avatar radinsky commented on July 16, 2024

@adepablom can you please provide the commands you're using, and maybe some debug output?

from broadlink-http-rest.

thunder2k avatar thunder2k commented on July 16, 2024

I'm having the same issue here. How was this solved?

from broadlink-http-rest.

radinsky avatar radinsky commented on July 16, 2024

It never was debugged. If you interested, please provide the commands you're using, maybe some debug prints, validate if your broadlink working correctly with its app and etc...

from broadlink-http-rest.

thunder2k avatar thunder2k commented on July 16, 2024

It works correctly with IR commands. The RF commands are working correctly through the app. What I'm trying to achieve is to switch on a TC-2 1 Gang light switch. What I tried is send the learnCommand and then press the ON button on the app. It times out with No Command learned and the RMPro becomes unresponsive for a few seconds. Please let me know what else should I provide you and how to get it.
Thanks!

from broadlink-http-rest.

thunder2k avatar thunder2k commented on July 16, 2024

Hi @radinsky any news on this?

from broadlink-http-rest.

radinsky avatar radinsky commented on July 16, 2024

@thunder2k sorry, somehow I missed your last message.
For me it was working the same, rm2 looks not capable to handle 2 tasks (send and learn/rx and tx) simultaneously, sometimes it works, but usually as you described it stucks for some time.
I can recommend 2 options:

  1. use external rf remote (there's a lot of cheap like 1$) and learn your tc2 to recognize it, and use broadlink-http-rest to learn the code of the rf remote
  2. use fake rf code (should be valid, you can generate using https://dimagoltsman.github.io/Random-Broadlink-RM-Code-Generator/ ), put the tc2 in learning mode and send the preconfigured command using broadlink-http-rest.

from broadlink-http-rest.

thunder2k avatar thunder2k commented on July 16, 2024

I'm interested in option 2 so I don't need to get new hardware..it's not clear to me how can I put my TC-2 into learning mode. Have you tried that? Do you have any tutorial? Also, you mentioned that sometimes it works, did you manage to do it? Mabe it's something related to timing..

from broadlink-http-rest.

radinsky avatar radinsky commented on July 16, 2024

Try looking here: mjg59/python-broadlink#21

from broadlink-http-rest.

thunder2k avatar thunder2k commented on July 16, 2024

I've checked your the link and got the codes to turn on and off the TC-2 switch. They're working flawlessly with the sendCode.py test script from your link.
Then I copied the working values in the settings.ini like below:
[Commands]
livingOn = <CODE_TO_TURN_ON>
livingOff = <CODE_TO_TURN_OFF>

The command is sent correctly as shown in your api output:
Reading device configuration for BroadlinkRM2
BroadlinkRM2: Read RM2 on <BROADLINK_IP> (<MAC_ADDRESS>)

Starting broadlink-rest server on 0.0.0.0: ...
127.0.0.1 - - [28/May/2019 20:52:55] "GET /sendCommand/livingOn HTTP/1.1" 200 -
Probably timed out..
Sent: livingOn
127.0.0.1 - - [28/May/2019 20:53:11] "GET /sendCommand/livingOn HTTP/1.1" 200 -
Sent: livingOn

Any Ideas? Do I need to encode/decode the obtained codes somehow?

EDIT
I manage to hack it changing your code as follows:
if commandName == "livingOn" or commandName == "livingOff":
device.send_data(commandFromSettings.decode('hex'))
else:
device.send_data(finalCommand)
Needless to say, it's ugly and hardcoded on those 2 commands but at least it works :)

Please let me know how to properly code this to avoid that hack

Thanks!

from broadlink-http-rest.

radinsky avatar radinsky commented on July 16, 2024

it should be /sendCommand/livingon
all the commands are case sensitive and on/off should be lower case
See examples here:
https://github.com/radinsky/broadlink-http-rest/blob/master/README.md

from broadlink-http-rest.

thunder2k avatar thunder2k commented on July 16, 2024

Changing the command to all lower case letters in settings.ini didn't help:
http://localhost:8082/sendCommand/livingon

and this is what I got:
127.0.0.1 - - [28/May/2019 23:01:21] "GET /sendCommand/livingon HTTP/1.1" 200 -
('n', 'living')
Sent: livingon
but the lights won't switch on

I think the way getBroadlinkSharedData.py retrieves the codes is different from how you do it in your learnCommand

from broadlink-http-rest.

radinsky avatar radinsky commented on July 16, 2024

How does it look in your settings.ini?
Have you tried learnCommand with lower case before sending command?

from broadlink-http-rest.

thunder2k avatar thunder2k commented on July 16, 2024

I've tried to learn the same command name again and it says:
Command livingon alreadyExists and changes are protected!
Failed: No command learned
I've tried to learn another command (teston) but it didn't work (It times out with No Command learned and the RMPro becomes unresponsive for a few seconds)
in my settings.ini, the command I've got from getBroadlinkSharedData.py it's a sequence of 1184 numbers and letters (only e,d,f letters appear in the code).

from broadlink-http-rest.

radinsky avatar radinsky commented on July 16, 2024

I suggest you sharing your settings.ini, I think you might missing something or messing with the lowercases.

from broadlink-http-rest.

thunder2k avatar thunder2k commented on July 16, 2024

Here it is (changing actual data for privacy):

[BroadlinkRM2]
IPAddress = <RM2_IP_ADDRESS>
MACAddress = <RM2_MAC_ADDRESS>
Device = <RM2_DEVICE_ID>
Timeout = 10
Type = RM2

[Commands]
1 = <192_ALPHANUMERICAL_CODE_IR>
2 = <192_ALPHANUMERICAL_CODE_IR>
3 = <192_ALPHANUMERICAL_CODE_IR>
4 = <192_ALPHANUMERICAL_CODE_IR>
5 = <192_ALPHANUMERICAL_CODE_IR>
6 = <192_ALPHANUMERICAL_CODE_IR>
7 = <192_ALPHANUMERICAL_CODE_IR>
8 = <192_ALPHANUMERICAL_CODE_IR>
9 = <192_ALPHANUMERICAL_CODE_IR>
0 = <192_ALPHANUMERICAL_CODE_IR>
livingon = <1184_ALPHANUMERICAL_CODE_RF>
livingoff = <1184_ALPHANUMERICAL_CODE_RF>

[Status]
living = 1

from broadlink-http-rest.

radinsky avatar radinsky commented on July 16, 2024

looks ok for me.
when you run http://localhost:8082/sendCommand/livingon can you tell if you see the yellow led on rm2 pro blinks? is livingoff also not working?
Can you confirm other commands you're sending (1, 2 ...0) are working correctly?

from broadlink-http-rest.

thunder2k avatar thunder2k commented on July 16, 2024

I need to confirm the blinking led as I'm not home at the moment. I see that it times out as you can see from my previous log (I've also removed your hardcoded text "Probably timed out.."and printed the actual error text and it was indeed timedout).
livingoff is not working as well.
The other commands (1,2,..0) are IR commands and are working perfectly but they were learned via learnCommand.

EDIT:
When running http://localhost:8082/sendCommand/livingon the led DOES NOT blink.

from broadlink-http-rest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.