Skip to content
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

The device storage is full when trying to learn new codes on broadlink.remote component #35875

Closed
mikepruett3 opened this issue May 20, 2020 · 114 comments · Fixed by #35986
Closed

Comments

@mikepruett3
Copy link

The problem

I was able to use the remote.learn_command service yesterday, before upgrading to 0.110.0 this morning. Now when I try to learn a code, I get an error about The device storage is full. I have plenty of disk space available for my HASS install... and I have tried this on multiple Broadlink RM Mini 3's and have the same issue.

service: remote.learn_command
entity_id: remote.living_room
device: television
command: test

Environment

  • Home Assistant Core release with the issue: 0.110.0
  • Last working Home Assistant Core release (if known):
  • Operating environment (Home Assistant/Supervised/Docker/venv): Docker
  • Integration causing this issue: Broadlink
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/broadlink/

Problem-relevant configuration.yaml

platform: broadlink
name: "Living Room"
host: 10.10.10.xx
mac: 'XX:XX:XX:XX:XX:XX'
type: rm_mini

Traceback/Error logs

Log Details (ERROR)
Logger: homeassistant.components.broadlink.remote
Source: components/broadlink/remote.py:305
Integration: broadlink (documentation, issues)
First occurred: 2:04:46 PM (1 occurrences)
Last logged: 2:04:46 PM

Failed to learn 'test/television': The device storage is full

Additional information

@probot-home-assistant
Copy link

Hey there @Danielhiversen, @felipediel, mind taking a look at this issue as its been labeled with a integration (broadlink) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@felipediel
Copy link
Contributor

Hi @mikepruett3. Thanks for reporting this error.
I'll fix it, but since I don't have the device, I'll need help to test the solution.

@felipediel
Copy link
Contributor

felipediel commented May 20, 2020

Testing the solution

1. Set up SSH add-on

1.1. Follow this tutorial.
1.1. Disable Protected Mode.
1.2. Set up a user name and password in the config file.

2. Open a terminal and connect to your device via SSH

ssh USERNAME@HOST

3. Change user to homeassistant.

docker exec -it homeassistant /bin/bash

4. Let's update some files

cd /usr/src/homeassistant/homeassistant/components/broadlink

wget -O __init__.py https://raw.githubusercontent.com/felipediel/home-assistant/fix-learning/homeassistant/components/broadlink/__init__.py

wget -O remote.py https://raw.githubusercontent.com/felipediel/home-assistant/fix-learning/homeassistant/components/broadlink/remote.py

7. Restart Home Assistant

Please let me know if it worked so I can create a pull request.

@chrisfonte
Copy link

@felipediel I had the same issue and just tried your potential fix, same behavior.

@chrisfonte
Copy link

I removed the "type" from my configuration.yaml and it fixed the issue.

Broadlink

switch:

  • platform: broadlink
    host: "192.168.101.214"
    mac: '24:DF:A7:36:D0:74'

    type: rm_mini3_newblackbean

    switches:
    ac:
    friendly_name: "Chris Office AC"
    command_on: 'JgCSAAABIpIXNRUSFjYWNRY2FjUWEhYRFjYWEhU2FhIWERYSFhEWEhYRFhIWERYSFhEWNhY1FhIWERYSFjYVNhY2FhEWNhYRFhIWNRYSFgACjhYRFhIWEhUSFhIVEhYSFRIWEhUSFjYVEhYSFhEWNhUSFhIWERYSFhEWEhYRFhIWERYSFhEWEhYSFRIWERY2FjYVAA0FAAAAAAAA'
    command_off: 'JgCSAAABIZMVNxUSFTcVExQ3FRMUNxUSFRMVNhU3FRMVExQTFRIVExUSFRMVExQTFRMUExUTFBMVEhUTFTYVNxU2FRMVNxUSFRMVNxQTFQACjxUSFRMVExQTFRIVExUSFRMVEhUTFRMUExUSFRMVNhUTFRIVExUTFBQUExQUFBMUFBQTFBQUExUTFDcVEhU3FRIVAA0FAAAAAAAA'
    string:
    friendly_name: "LED String Lights"
    command_on: 'JgBwAAABJZISExIUEhQSFBIUEhQSFBIUEjcTNhM2FDYSNxM2EzYTNxI3ExMSNxMTExMTExM2FBITExU1EhQSNxI3FTQTExM3FQAFCQABKUkTAAxHAAEoSRQADEgAASdJFAAMRwABJ0oSAAxJAAEnSRQADQUAAAAAAAAAAA=='
    command_off: 'JgBwAAABI5MUExMTEhQTExMTEhQTExMTEzYUNRQ2EzYTNhM3EzYTNhQ1FDQVNhQSFBIUEhM3ExMTExMTEhQSNxM2FDYTExI3EwAFDQABKEkUAAxHAAEpSRMADEkAASdJFAAMSAABJ0oTAAxIAAEnShQADQUAAAAAAAAAAA=='

@felipediel
Copy link
Contributor

@chrisfonte Your problem was in the config file, it is different.

@mikepruett3
Copy link
Author

So I already had SSH access to the ubuntu server running my hassio_supervisor and homeassistant containers. I did docker exec into the homeassistant container, and pull the init.py file down and restart. Still having the same issue.

@felipediel
Copy link
Contributor

@mikepruett3 Please run this file using python3 debug.py and send me debug.txt.

@felipediel
Copy link
Contributor

If the LED blinks during debugging, try to capture a code.

@mikepruett3
Copy link
Author

Here is the debug.txt file. I did look at the closest device when I ran the debug, and no LED activity at all.

debug.txt

@felipediel
Copy link
Contributor

Your firewall is blocking discovery. You can run debug.py using your computer if you want, just make sure you are on the same network.

@mikepruett3
Copy link
Author

So this worked before updating to 0.110.0 this morning. I have not made any other network changes, or any changes on my firewall (Ubiquity EdgeRouterX). Having said that, I did do a few tests using the broadlink python3 library (my python sucks, but I did find some discovery steps on
the python-broadlink github page.

From my workstation on the same network

python3
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import broadlink
>>> devices = broadlink.discover(timeout=30)
>>> print(devices)
[<broadlink.rm object at 0x0000021898400820>, <broadlink.rm object at 0x00000218984007C0>]

yet when I try from the homeassistant container...

docker exec -it homeassistant /bin/bash
bash-5.0# python3
Python 3.7.7 (default, Apr 28 2020, 13:57:57)
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import broadlink
>>> devices = broadlink.discover(timeout=30)
>>> print(devices)
[]

Could this have something to do with hassio ingress or apparmor?

@mikepruett3
Copy link
Author

On a whim, I tried the same test from the bash console of the ubuntu server hosting the homeassistant container, and discovery works there as well...

$ python3
Python 3.6.9 (default, Apr 18 2020, 01:56:04)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import broadlink
>>> devices = broadlink.discover(timeout=30)
>>> print(devices)
[<broadlink.rm object at 0x7f52dc838438>, <broadlink.rm object at 0x7f52dc8385f8>]
>>>

@felipediel
Copy link
Contributor

You need to run debug.py on your workstation.

@mikepruett3
Copy link
Author

Ok, so I ran the debug.py from the ubuntu server running the homeassistant container (not from inside the container), and this is the debug.txt file that was created...

debug-outside-container.txt

Note, when I run the debug.py from inside the homeassitant container, I get this debug.txt output

debug-inside-container.txt

@mikepruett3
Copy link
Author

Here is the debug.txt from my workstation...

debug-from-workstation.txt

@felipediel
Copy link
Contributor

Ok, the debug is working. Now try to learn a code when the LED blinks and send me debug.txt. Don't do it inside the container.

@mikepruett3
Copy link
Author

Here is the debug.txt, I ran it from the ubuntu server console.

code-learn-debug.txt

@felipediel
Copy link
Contributor

Strange, there are no error codes in the response. Tomorrow I will create a custom debug script to understand what is going on. I'll keep you informed.

@francescoanoe
Copy link

Hi Guys,
landing here after searching.. same problem here with 0.110 on hassOS via Hyper-V and a RM4 mini.
Launching services broadlink.learn and remote.learn_command report same error:

image

If i send a command previously learned from itself all works, i see the white led blink.

Available for testing or debug....

@com-xuonghuynh
Copy link

I have a same problem

@ciec68
Copy link

ciec68 commented May 21, 2020

I have a same problem too - 0.110.0 and a RM3 mini

@anamika784
Copy link

I have a same problem too. ( Home Assistant Core release with the issue: 0.110.0 and a RM4 mini)
ERROR (MainThread) [homeassistant.components.broadlink] Failed to learn: The device storage is full

@r0b3rt74
Copy link

Same error here And no notifications when learning. Hassio 0.110.0.

@francescoanoe
Copy link

Thank you @felipediel
Unfortunately i cant learn any command because the RM4 dont receive any ir code. After call the services the error appearing immediately and with any iteraction with the broadlink.
The white led doesnt appear.. it works only if i manually send an ir but i dont have finished the capture work... 😄
I will put my self in queue for the fixing! 🤞
See you

@sebastian-steinmann
Copy link

@felipediel Does that mean the codes are sent, and the error is kinda irrelevant?

@felipediel
Copy link
Contributor

felipediel commented May 22, 2020

I deleted my previous comment because I was wrong and I don't want to create confusion. I just implemented a possible solution based on a deeper analysis of the debug files. Could anyone help me test it?

@sebastian-steinmann I was wrong. The error needs to be handled.

@marco76mk
Copy link

this update not work:

2020-05-25 22:55:51 ERROR (MainThread) [homeassistant.components.remote] Error while setting up broadlink platform for remote
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/broadlink/remote.py", line 134, in async_setup_platform
d = next(filter(lambda d: d.host[0] == host, devices))
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
RuntimeError: coroutine raised StopIteration

@felipediel
Copy link
Contributor

I updated the file to handle this exception. Please try again.

@marco76mk
Copy link

mmmm error:

2020-05-25 23:19:57 ERROR (MainThread) [homeassistant.components.broadlink.remote] The selected class for 10.0.0.82 is <class 'broadlink.rm'>

2020-05-25 23:21:41 ERROR (MainThread) [homeassistant.components.broadlink.remote] Learning: host=10.0.0.82, class=<class 'broadlink.rm'>, request_header=b''
2020-05-25 23:21:49 ERROR (MainThread) [homeassistant.components.broadlink.remote] Learning: host=10.0.0.82, class=<class 'broadlink.rm'>, request_header=b''

@felipediel
Copy link
Contributor

No other error? It seems to be working fine. Check the .storage folder.

@marco76mk
Copy link

2020-05-25 23:22:19 ERROR (MainThread) [homeassistant.components.broadlink.remote] Failed to learn 'Turn on': No code received

in the ".storage" folder I had removed the broadlink files, but now no file that starts with "broadlink_..." _appears

@felipediel
Copy link
Contributor

felipediel commented May 25, 2020

python3 --version

@Rookeh
Copy link

Rookeh commented May 25, 2020

Not sure if this helps, but I just had the exact same issue. Updated to 0.110.2 and got "The device storage is full" errors when trying to learn remote codes.

In my case, adding the type field to the configuration (in my case, rm4_mini) actually fixed the problem.

@marco76mk
Copy link

marco76mk commented May 25, 2020

now it works !!
I copied the "broadlink_remote_24dfa727d9ee_flags" file again and tried to run the "remote.learn_configuration" command again
now the files broadlink_remote_24dfa727d9ee_codes has been created

the latest update fixes

@felipediel
Copy link
Contributor

The last update contains only error messages. I have no idea what was going wrong. But I am happy to know that your problem is solved.

@anamika784
Copy link

I typed the "type"( rm4c_mini) again, restarted. Everything is working fine now.
Thank you for your help.

@maorbenamer
Copy link

maorbenamer commented May 29, 2020

Update to 0.110.3 and add typed the "type"( rm4_pro),
Now it worked and can learned only IR.
Cant learn RF
Error:
Failed to learn: No signal received

@felipediel
Copy link
Contributor

@maorbenamer RF is not yet supported. I will add this feature after the refactor I'm doing.

@maorbenamer
Copy link

@maorbenamer RF is not yet supported. I will add this feature after the refactor I'm doing.

Thanks for the fast reply. 😀

And I thought I was wrong in one of the settings 🤦🏻‍♂️

@felipediel
Copy link
Contributor

felipediel commented Jun 18, 2020

@sebastian-steinmann Could you help me improve support for your SP1 device? You just need to run a few debug scripts...

@sebastian-steinmann
Copy link

@sebastian-steinmann Could you help me improve support for your SP1 device? You just need to run a few debug scripts...

Yeah, hit me. Unsure of the classifications tho, thought I had an rm device.

@nombreregular
Copy link

Hey guys, I'm really new to H.A. I think I'm having the exact same issue with rm4c. It can use remote.send_command to send the only code I managed to make it learn, but learn_command and broadlink services also gives the storage full error. I did run the solution suggested by @felipediel but so far nothing has change. I ran the debug too.
debug.txt

@felipediel
Copy link
Contributor

@sebastian-steinmann Ah, sorry, I thought you had an SP1.

@jose4191 You need to specify the correct type in the config. Use type: rm4c_mini.

@nombreregular
Copy link

nombreregular commented Jun 19, 2020

@sebastian-steinmann Ah, sorry, I thought you had an SP1.

@jose4191 You need to specify the correct type in the config. Use type: rm4c_mini.

Hi! You're right. I did change it, but broadlink switch still gives the storage full error. I did manage to get a template switch working using scripts and remote.send_command. Edit: just in case, broadlink services dissapeared after adding type.

@felipediel
Copy link
Contributor

@jose4191 You need to specify the device type for switches as well.

@maorbenamer
Copy link

maorbenamer commented Jul 6, 2020

@felipediel

@maorbenamer RF is not yet supported. I will add this feature after the refactor I'm doing.

RF is supported already?
Thanks

@felipediel
Copy link
Contributor

@maorbenamer Nope. You can use this workaround for now.

@jyavenard
Copy link
Contributor

I had this issue until I set in configuration.yaml the device type.
in my case:
type: rm4_mini

@maorbenamer
Copy link

@felipediel

@maorbenamer RF is not yet supported. I will add this feature after the refactor I'm doing.

RF is supported already?
Thanks

@felipediel
Any update?
Thanks

@felipediel
Copy link
Contributor

It will take some time, we have two updates in the queue.

@maorbenamer
Copy link

It will take some time, we have two updates in the queue.

Thanks for the response, were can I update about the release day?

@felipediel
Copy link
Contributor

@Leeharg
Copy link

Leeharg commented Aug 26, 2020

https://www.home-assistant.io/blog

Thanks for your hard work.

i can't seem to find anything about the update on the blog? i have one rm3_mini working perfectly but the new one doesn't work and says "Failed to learn 'Turn on': The device storage is full"

@felipediel
Copy link
Contributor

@Leeharg You need to specify the correct device type. It is probably rm_mini3_newblackbean. If it doesn't work you can try rm_mini. This will no longer be necessary after this update, which is already merged into the dev branch. I think that in a week or two it will be available. You can track the master branch for real time updates.

@Rocologo
Copy link

Rocologo commented Sep 5, 2020

FYI. It tried rm_mini3_redbean and rm_mini3_newblackbean but it was not working until I tried rm_mini.

I dont know how to to see which model im using but rm_mini works for me. I have had this problem for quite a while and now it is finally solved for me. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.