eschava / broadlink-mqtt

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

The device storage is full when trying to learn new codes #80

Closed Insaned79 closed 3 years ago

Insaned79 commented 4 years ago

I learned some codes with my rm4_mini new device and used it for about a month. Now when I try to do it again, the learning doesn't happen and I get in the log: [2020-07-28 17:25:51,873] ERROR Error Traceback (most recent call last): File "mqtt.py", line 199, in on_message record(device, file) File "mqtt.py", line 255, in record ir_packet = device.check_data() File "/usr/local/lib/python3.6/dist-packages/broadlink/__init__.py", line 600, in check_data check_error(response[0x22:0x24]) File "/usr/local/lib/python3.6/dist-packages/broadlink/exceptions.py", line 97, in check_error raise exception(error_code) broadlink.exceptions.StorageError: The device storage is full I've noticed that guys from another project have recently faced a similar problem: https://github.com/home-assistant/core/issues/35875#

zhapwey commented 4 years ago

Same problem here, if someone has a solution

thanks

eschava commented 4 years ago

Please check with the latest release of python-broadlink library

mjeshurun commented 4 years ago

Please check with the latest release of python-broadlink library

Hi @eschava , Based on the recent posts in thread #404 in the python-broadlink github page, am I correct to assume that the "device storage is full" issue has been fixed? I own an RM4 Pro and tried to learn RF codes, but I'm still getting the "storage full" error message. I could use your help in solving this issue, since I'm quite a noob in these coding matters 🙏

eschava commented 4 years ago

It was mentioned there that your rm4 device should be identified correctly What kind of connection do you use? lookup or specified type?

mjeshurun commented 4 years ago

It was mentioned there that your rm4 device should be identified correctly What kind of connection do you use? lookup or specified type?

I'm sorry, I'm not sure I understand what you mean by "lookup or specified type".

I follow this guide to record RF signals using the RM4 Pro. The guide lists both your solutions: python-broadlink and broadlink-mqtt, but I can't get them to work properly and I'm stuck with the "device storage is full" message.

If I was more knowledgeable in coding, maybe I would have figured out my misunderstanding of your question, but, unfortunately, I'm a noob in these matters.

eschava commented 4 years ago

What is the value of the device_type parameter in the mqtt.conf or custom.conf files?

mjeshurun commented 4 years ago

I think I'm starting to understand my mistake. In both solutions mentioned in the guide, I did not fill my device_type parameters in any file. for example, this is my device type output I got by using the python-broadlink method, but I didn't notice I needed to save the device_type data into a special file located in the broadlink_cli folder.

pi@raspberrypi:~/python-broadlink/cli $ ./broadlink_discovery --timeout 10 --dst-ip 192.168.1.6
Discovering...
###########################################
RM4
# broadlink_cli --type 0x61a2 --host 192.168.1.6 --mac 24dfa7b9c689
Device file data (to be used with --device @filename in broadlink_cli) : 
0x61a2 192.168.1.6 24dfa7b9c689
temperature = 0.0

I did the same mistake with the broadlink-mqtt solution. which means I didn't fill my device info into the custom.conf file.

It looks like the python-broadlink solution might be easier for noobs like me. Could you please explain how I should save my device_type info into the broadlink_cli folder? Sorry in advance for such a noob question 🙏🙏

eschava commented 4 years ago

You shouldn't provide information about your device if device_type='lookup' In this case, it should be obtained automatically

mjeshurun commented 4 years ago

You shouldn't provide information about your device if device_type='lookup' In this case, it should be obtained automatically

I think I follow your meaning relating to device_type='lookup'. I can confirm my custom.conf file is set to the default device_type='lookup'. What aboutdevice_hostanddevice_mac`? Do I need to fill them with my device's ip and mac addresses, or do I live these lines untouched?

I;m a bit confused as to what is causing the problem, since python-broadlink discovered my device as an RM4 along with the host and mac addresses when I ran the command: ./broadlink_discovery --timeout 10 --dst-ip 192.168.1.6

what could be the reason I'm still getting the "device storage is full" message? Am I mixing procedures between the two different solutions?

eschava commented 4 years ago

device_host and device_mac are ignored for lookup device type But on the other hand for the experiment, you can use the direct connection and specify all parameters device_type='rm4' device_host='ip.ad.dr.ess' device_mac='ma:ca:dd:re:ss'

mjeshurun commented 4 years ago

device_host and device_mac are ignored for lookup device type But on the other hand for the experiment, you can use the direct connection and specify all parameters device_type='rm4' device_host='ip.ad.dr.ess' device_mac='ma:ca:dd:re:ss'

I tried to manually enter the device type, host and mac, but I still get the error message.

eschava commented 4 years ago

That's sad. It was my last hope :)

rodrigogml commented 3 years ago

Hi, 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.

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.

rodrigogml commented 3 years ago

I believe I posted it in the wrong project. It affects this project, but seems to be a 'python-broadlink' problem. Will replicate the post there too.

eschava commented 3 years ago

I've checked the discussion there and tried to fix the issue in a similar way. Please check now

rodrigogml commented 3 years ago

Like I said I'm not a python developer, and don't know exactly the python's behavior. But by similarity with other languages, like try/catch block of java, the line code: ir_packet = device.check_data() seems to expect an exception from the check_data() method. I think the check_data() just returns some invalid data. Like some forgotten cache. Not null neither an exception.

I'm don't know how to debug the code and get better data to analyze, but I can write some "print()" in code to see what is happening.

I'll do more tests when I get home and be back with more data later. And maybe learn some python and english to be more collaborative in future ;)

eschava commented 3 years ago

have you tried the latest update?

rodrigogml commented 3 years ago

Well, I have no experience with GIT either, but still thinking I'm a developer (lol)

I got the code yesterday using the command: git clone https://github.com/eschava/broadlink-mqtt.git and installed the dependencies folowing the instructions on readme.

Not sure if the fix was there, can check that later too.

If I need to clone other branch, please, tell me the right git clone command.

eschava commented 3 years ago

you need to update your folder with git pull command inside it

rodrigogml commented 3 years ago

Sorry, couldn't test yesterday like I promised, but I came with god news: Worked like a charm :)

I made some other tests and like to give some data. The application tried 6 times, with a delay of 5 seconds between. Wich took 30 seconds to gave me the message "WARNING No Command Received". My RM4C mini awaits 40 seconds in the learning mode. If I press the button between the 30 and the 40 seconds, the command is not saved (obviosly). I don't know if 40 seconds is the default behavior for all devices (don't have any other). Thinking just about my device I'd suggest add more two attempts to fullfil the 40 seconds.

Despites this "time" subject, I'd recomend close this thread issue. I tried to make it crashs again but unsucessfull (lol). Great job!

eschava commented 3 years ago

Thanks a lot! Increased number of attempts to 8