@mjeshurun I’ve updated my tutorial to include using python-broadlink to capture codes. Go back to my first post, to the Teach remote codes header, then click on Click to teach via python-broadlink. Let me know how it goes.
I really don’t know how to thank you for all your good efforts and help.
You have my deepest gratitude!
I tried the python-broadlink solution you added, but I’m still getting error messages when I try to capture remote codes.
Here is a copy of the messages output when I followed your steps:
pi@raspberrypi:~ $ python3
Python 3.7.3 (default, Dec 20 2019, 18:57:59)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import broadlink
>>> devices = broadlink.discover(timeout=5)
>>> print(devices)
[<broadlink.rm4 object at 0xb66aadf0>]
>>> devices[0].auth()
True
>>> devices[0].enter_learning()
>>> packet = devices[0].check_data()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 631, in check_data
check_error(response[0x22:0x24])
File "/usr/local/lib/python3.7/dist-packages/broadlink/exceptions.py", line 97, in check_error
raise exception(error_code)
broadlink.exceptions.StorageError: The device storage is full
>>> print(packet.hex())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'packet' is not defined
>>> devices[0].send_data(packet)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'packet' is not defined
>>>
I don’t know if this is related to the problem, but my RM4 Pro LED turns to color RED after I enter learning mode (It’s not WHITE as in your description). Also, the LED does not turn off after I press the remote button I want to learn.
I’m pretty sure the remote is close enough to the RM4 Pro to capture the code. The distance between the remote and RM4 Pro was 10 cm.
Yes, 10cm should certainly be close enough, unless the batteries in your remote have died!
Hmmm, I’m not sure what’s happening. I’ve never seen a red LED!
It might be worth completely re-setting the Broadlink device, and re-connecting it back to the wifi - just to start from new. Then try the new learning method?
I’ll have a think, but because I can’t replicate the error it’s a little tricky to debug. It’s obviously an issue, as evidenced by the GitHub link above, but not one I currently have!
EDIT: OK, so according to this comment, you will need to remove line 74 in the exceptions.py file within your python-broadlink folder.
You will then need to reinstall python-broadlink:
sudo python3 setup.py install
Then retry all the teaching stuff.
Still doesn’t explain the red LED though, I don’t think…
When you’ve got time, could you run the following command when inside your python-broadlink folder, and paste the output here?
git log -1
Additionally, check out this post, especially when it gets to learning codes: could you try that method and let me know if it works? You’ve done almost all of it before, except it uses a slightly different learning method. I expect this to fail too, but just want to check!
Also, just to double check: how are you connecting the device to your WiFi? App or python-broadlink? If it’s the app I wonder whether it is somehow still connecting to the cloud, therefore disabling local control?
I connected my device to Wifi using the Broadlink app, but once the device was added to the Wifi network (and AP mode slow LED flashing stopped) I did not continue to add the device to the app.
I tried using the python-broadlink method to connect the device to the Wifi network, but the command did not do anything and the device stayed in AP mode with blue LED flashing slowly.
This is the command I used (with my network’s name and passcode):
Reading around online, it looks like your device only has a blue LED and a red/orange LED, and when it is in learning mode the red/orange LED is on. So it might actually be working as intended! If you have the user guide, it might be worth checking. Don’t forget that my guide is based on the RM4C Mini, which is not the same as yours!
When learning a remote code my white LED (your red/orange LED) remains on for at least 10 seconds after I started pressing the remote button. Make sure to keep pressing the button until the LED turns off! I don’t know whether this affects the broadlink.exceptions.StorageError: The device storage is full issue though.
If I was you, I would contribute to the open issue on the python-broadlink GitHub, explain the steps you’ve taken, and the results you’re getting, and see if anyone else can help!
can I use this command for block internet (cloud) access to the RM? I’ve a simple router and I can not block a single IP, only configure an IP reservation.
But that’s OK, I think. If you get the device connected too your local WiFi as described in either method (app or python-broadlink), it won’t try to phone home afterwards.
The message is really a warning for those using the app to connect the device to the local WiFi - if you go to far with the app (further than instructed), the device will contact the Broadlink servers!
I cant get my rmpro to connect via the python-broadlink (not using the app).
How can this be done?
I put the rmpro in AP mode (4 blinks, pause). so it does not register an IP on my wifi network yet. How can the broadlink discovery find it?
The RM4C Mini is now a wifi access point. Connect your computer to the access point (it will probably have Broadlink in the name). It may take a little bit of time for the access point to appear in your wifi list.
I am connecting my laptop to the broadlink RMPRO. where do I type python3? do I ssh into my openhab ubuntu ?My OH resides in a ubuntu VM in my esxi server