eschava / broadlink-mqtt

MQTT client to control BroadLink devices
MIT License
222 stars 61 forks source link

RecordRF not working #44

Closed seanbaker74 closed 4 years ago

seanbaker74 commented 5 years ago

I have a Broadlink RM Pro+ that I'm trying to get working. I send "recordrf" to the MQTT channel and broadlink enters recording mode but never manages to capture the command. I am able to record RF with other applications (broadlink-mqtt-bridge and e-control), so I know broadlink and the RF device work. Is this feature working? Thanks.


[2019-08-08 06:29:11,414] DEBUG Recording RF command to file /opt/broadlink-mqtt/commands/rollershutter/2/up
[2019-08-08 06:29:11,414] DEBUG Learning RF Frequency, press and hold the button to learn...
[2019-08-08 06:29:32,773] WARNING RF Frequency not found```
eschava commented 5 years ago

Hi, this is an experimental feature and I have no appropriate device to check if it is working If you do not mind you can be my tester for it :) I can add some code and ask you to recheck, OK?

seanbaker74 commented 5 years ago

Sure, happy to test it...

eschava commented 5 years ago

Rechecked the code - it looks OK Do you follow the instructions? You need to press and hold the button during the first message (Learning RF Frequency...) and single press when second (To complete learning...) message is print

seanbaker74 commented 5 years ago

Yes, I did the same thing I do with broadlink-mqtt-bridge, which seems to work. It doesn't find the frequency with a press and hold. broadlink-mqtt-bridge waits for 30 seconds, and sometimes it might take 10 seconds or so.

eschava commented 5 years ago

Can you please try to record a signal using broadlink_cli utility from python-broadlink project?

seanbaker74 commented 5 years ago

Same thing with broadlink_cli. It enters learning mode, but can't find the frequency.

I'm assuming after it finds the frequency it should tell me to do the short press to learn the code?

Learning RF Frequency, press and hold the button to learn...
RF Frequency not found
eschava commented 5 years ago

I checked instructions from https://github.com/mjg59/python-broadlink/issues/87 and found that tests were done using: python3 pycrypto python package

seanbaker74 commented 5 years ago

python3 and pycrypto are already installed...

eschava commented 5 years ago

And do you run mqtt.py or broadlink_cli using python3?

seanbaker74 commented 5 years ago

Good point! :)

I just ran broadlink_cli with python3 and got a bit further. 1/4 attempts crashed, 3/4 attempts found the freqency but couldn't find the RF code.

Attempt 1:

Learning RF Frequency, press and hold the button to learn...
Found RF Frequency - 1 of 2!
You can now let go of the button
Press enter to continue...
To complete learning, single press the button you want to learn
No data received...

Attempt 2:

Learning RF Frequency, press and hold the button to learn...
Traceback (most recent call last):
  File "./broadlink_cli", line 195, in <module>
    while (not dev.check_frequency()) and (timeout > 0):
  File "/usr/local/lib/python3.6/dist-packages/broadlink/__init__.py", line 565, in check_frequency
    response = self.send_packet(0x6a, packet)
  File "/usr/local/lib/python3.6/dist-packages/broadlink/__init__.py", line 298, in send_packet
    response = self.cs.recvfrom(2048)
socket.timeout: timed out

Attempt 3:

Learning RF Frequency, press and hold the button to learn...
Found RF Frequency - 1 of 2!
You can now let go of the button
Press enter to continue...
To complete learning, single press the button you want to learn
No data received...

Attempt 4:

Learning RF Frequency, press and hold the button to learn...
Found RF Frequency - 1 of 2!
You can now let go of the button
Press enter to continue...
To complete learning, single press the button you want to learn
No data received...
Kepnu4 commented 5 years ago

guys how do you run mqtt.py with python3? I got:

File "mqtt.py", line 67
    except Exception, e:
                    ^
SyntaxError: invalid syntax
eschava commented 5 years ago

guys how do you run mqtt.py with python3? I got:

Committed the fix to support python3