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
StorageError: The device storage is full while learning and workaround #404
Comments
I'm having the same issue here. I tried commenting out the line you reference and the script still crashes. |
Which script are you using? First find your device and enter learning mode import broadlink
device = broadlink.discover()
devices.auth()
device.enter_learning() Now the LED indicator should be white, press the button now. After that, run: packet = devices.check_data()
print(packet.hex()) This should show the IR packet in hex format. |
Can you confirm whether to try these commands in the Python console after commenting out line 74 in exceptions.py, or doesn't it require commenting out that line at all? |
Here I mean after commenting out line 74. But actually, in my test, the first portion works even without commenting out the line. The |
So just to check: are you commenting out only line 74, or also the whole check_error() function? |
Hello friends, By the way, I don't know if it's a problem, but my RM4 Pro is showing a red LED when its in learning mode (not white LED). Here is another thread which I tried using to troubleshoot the issue (with the kind help of @hafniumzinc), but, so far, with no success: Have you found any new leads to solve the problem? |
+1 on facing this issue. Interestingly I noticed that when you learn the command from Home Assistant - works fine. When using the broadlink_cli here, it returns the full storage error. |
This is not a bug, this is the expected behavior. The applications that import this library should handle this exception using a try except clause. Check the Broadlink integration in Home Assistant for more implementation details. |
Yes, I understand it is reasonable in the API. But the |
Is the the error "The device storage is full" supposed to be fixed now? I have the pulled the latest which includes the fix to broadlink_cli to handle the StorageError exception, but I still encounter the error when I try to do anything with my RM3 mini. |
Please make sure your code is correct. This is our implementation in Home Assistant. You can use it as a template. |
I see the difference now. In the current broadlink_cli python, the call to dev.check_data() is wrapped in an 'try', but I'm getting the exception from dev.enter_learning(), which is not wrapped in exception handling:
However, wrapping dev.enter_learning() in a 'try' block doesn't help. It must fail to enter learning mode since it just times out later reading data:
I also can't send an IR code I've already learned, so there's a fundamental problem executing any useful operation due to the storage error. |
You are probably using the wrong class. Try |
Thanks for the pointer. You are right. Changing from using the "rm" class to using the "rm4" class works! Glad to finally get this working! |
One more note just to complete my view of things. My "old" RM3 mini still requires the old "rm" class (old firmware being "v57"). The new RM3 minis I have purchased recently do not work with the "rm" class, they require the use of the "rm4" class (new firmware being "v44057"). Thanks for the help sorting this out. |
Yes. RM mini 3 0x5f36 requires special payload headers. It communicates like RM4 series devices. |
Hi friends, |
@mjeshurun what device class are you using? Try a different one, like |
Thank you for your reply @KTibow , When I ran the following command python-broadlink discovered my device as an rm4:
|
What command are you using to learn the code? |
I'm following this set of commands:
After the last "enter_learning" command I get the error message, so I cant continue to the next commands that are supposed to be:
|
When you call |
Thank you for the suggestion, @felipediel . |
The If statement (asking for permission)if code_received:
device.check_data()
else:
print("No code received") Try except (asking for forgiveness)try:
device.check_data()
except ReadError:
print("No code received") This code snippet is exactly what you are looking for. |
Thank you 🙏 Or do I need to add the commands you wrote somewhere into the broadlink_cli file? |
If you just want to learn a code, you can use the CLI:
If you want to create a Python script, you can refer to the CLI to understand how the library works and how its functions should be implemented. |
@felipediel And not use the earlier learn command I mentioned before? ( Because doing this didn't work. I got a |
@mjeshurun they mean to run it from the command line, possibly with |
Thanks @KTibow . |
As for the first one, what do you mean? Did it give any errors? You need to replace the |
This is the command I entered in terminal and the error message I got.
Thanks for double checking. Yes, my device info (type, ip, mac) are mentioned in the command |
or
Do not use |
Thank you. I tried both commands, but I got the same error message.
|
I think the IP address is wrong. |
Wonderful! You were right!!! My next step was to record my appliances wireless remotes' codes. However, the RM4 Pro didn't recognize any RF codes, and, as such, it returned a "No data received..." message.
On the other hand, when I tried to record IR codes the RM4 Pro properly recorded them:
Am I missing a necessary step before recording RF codes? |
You can use |
YAYAYAYAYAY!!! This command did the trick!!! :))))) |
Closing, since it is not a problem to be solved in our code base. |
Sorry I reopened this thread. The problem still happens, but I think I can help to replicate. And I believe it is a code problem. Hope this help to solve. I spent my afternoon trying to make it work and getting this error. I notice when we started to learn any code, and don't press any button on remote, the error popups in screen (about 5 seconds after the command) while the RM4 Mini still with the white led on. But, if you press the remote control button just after entered the learning mode, it works beautifully. So to replicate the problem, just enter the learn mode and just wait 5 seconds. I'm a developer but zero skills with python. So, I suppose, the problemas has something about the delay between entering the learning mode and "grab" the code from the device while it still not ready yet. And the error about full storage is just a "bad catch" somewhere, or the "bad code" returned crashes the write method. Hope it drives for the solution, and btw REALLY THANKS for all the effort spent. |
Hi. We are catching the StorageError here. The problem does not exist in our code base. It is an implementation problem in client applications, which should use the CLI as a starting point to implement our functions correctly. Edit: I just realized we need to improve our documentation to inform about this behavior. |
You're right! My mistake, I'm sorry! I was able to detect the problem using the library directly on python console, but the treatment is indeed in the other project. *By problem I meant ask to check_data() before pressing the button. |
I recently got a new Broadlink RM mini 3 from Amazon US, the device type is
0x5F36
. Withpython-broadlink
, I am able to "learn" a few IR code, it is working fine. After a few codes learned, the device starts to complain "The device storage is full
" error. This problem cannot be resolved by resetting the device, and I am pretty desperate at this point.On deciding whether I will need to return the device, I realize that: after using
enter_learning()
function, the device has white indicator on, which means it indeed reads the IR code, but the error only comes when I try to usecheck_data()
function. Further tests indicate that as long as I commented out thecheck_error()
statement, thecheck_data
function can actually correctly reporting IR code.So I assume the "learning" functionality is actually writing IR codes into the device's memory, which, from what I see, is very much limited. Since there is no "erase" option given, I assume a lot of users are going to encounter the same problem. And, since most users of
python-broadlink
only need to read out the IR code instead of really using the learning function, I think it would be great if an option for temporarily disabling the error check for full device storage could be given.The text was updated successfully, but these errors were encountered: