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

[BUG] No such file or directory: '/home/username/.cache/python-miio/python-mirobo.seq' when trying to update firmware #972

Closed
henrikrox opened this issue Mar 13, 2021 · 7 comments · Fixed by #976
Labels

Comments

@henrikrox
Copy link

eveyrthing worked fine except when i try to update the firmewae, using python3 venv

(venv) henrikr@hroksvaag:~$ mirobo --token XXXX --ip 10.0.0.5 update-firmware /home/henrikr/Downloads/vacuum/Valetudo/output/vacuum_2020_valetudo_2021_02_0.pkg
Traceback (most recent call last):
  File "/home/henrikr/flasher/venv/bin/mirobo", line 8, in <module>
    sys.exit(cli())
  File "/home/henrikr/flasher/venv/lib/python3.8/site-packages/miio/click_common.py", line 59, in __call__
    return self.main(*args, **kwargs)
  File "/home/henrikr/flasher/venv/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/henrikr/flasher/venv/lib/python3.8/site-packages/click/core.py", line 1256, in invoke
    Command.invoke(self, ctx)
  File "/home/henrikr/flasher/venv/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/henrikr/flasher/venv/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/henrikr/flasher/venv/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/henrikr/flasher/venv/lib/python3.8/site-packages/miio/vacuum_cli.py", line 61, in cli
    with open(id_file, "r") as f, contextlib.suppress(
FileNotFoundError: [Errno 2] No such file or directory: '/home/henrikr/.cache/python-miio/python-mirobo.seq'
@boesing
Copy link

boesing commented Mar 14, 2021

I get this error when executing a vaccum command.
I think this is not related to specific commands.

@rytilahti
Copy link
Owner

Ah, that bug was introduced during some cleanups and is only broken in the most recent release, sorry for that...

For a temporary fix, create that file with 0 as it's contents and the commands will start working again.

@rytilahti rytilahti added the bug label Mar 14, 2021
@gunnaraas
Copy link

gunnaraas commented Mar 15, 2021

Ah, that bug was introduced during some cleanups and is only broken in the most recent release, sorry for that...

For a temporary fix, create that file with 0 as it's contents and the commands will start working again.

Tried this, new different issue.

(venv) gunnaraas@pop-os:~/flasher$ mirobo --token XXXXX --ip 192.168.8.1 update-firmware v11_002034.pkg
Traceback (most recent call last):
  File "/home/gunnaraas/flasher/venv/bin/mirobo", line 8, in <module>
    sys.exit(cli())
  File "/home/gunnaraas/flasher/venv/lib/python3.8/site-packages/miio/click_common.py", line 59, in __call__
    return self.main(*args, **kwargs)
  File "/home/gunnaraas/flasher/venv/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/gunnaraas/flasher/venv/lib/python3.8/site-packages/click/core.py", line 1256, in invoke
    Command.invoke(self, ctx)
  File "/home/gunnaraas/flasher/venv/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/gunnaraas/flasher/venv/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/gunnaraas/flasher/venv/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/gunnaraas/flasher/venv/lib/python3.8/site-packages/miio/vacuum_cli.py", line 62, in cli
    start_id = x.get("seq", 0)
AttributeError: 'int' object has no attribute 'get'

@oodg
Copy link

oodg commented Mar 15, 2021

Ah, that bug was introduced during some cleanups and is only broken in the most recent release, sorry for that...
For a temporary fix, create that file with 0 as it's contents and the commands will start working again.

Tried this, new different issue.

(venv) gunnaraas@pop-os:~/flasher$ mirobo --token XXXXX --ip 192.168.8.1 update-firmware v11_002034.pkg
Traceback (most recent call last):
  File "/home/gunnaraas/flasher/venv/bin/mirobo", line 8, in <module>
    sys.exit(cli())
  File "/home/gunnaraas/flasher/venv/lib/python3.8/site-packages/miio/click_common.py", line 59, in __call__
    return self.main(*args, **kwargs)
  File "/home/gunnaraas/flasher/venv/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/gunnaraas/flasher/venv/lib/python3.8/site-packages/click/core.py", line 1256, in invoke
    Command.invoke(self, ctx)
  File "/home/gunnaraas/flasher/venv/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/gunnaraas/flasher/venv/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/gunnaraas/flasher/venv/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/gunnaraas/flasher/venv/lib/python3.8/site-packages/miio/vacuum_cli.py", line 62, in cli
    start_id = x.get("seq", 0)
AttributeError: 'int' object has no attribute 'get'

Using {} instead of 0 seems to work

@gunnaraas
Copy link

@oodg thanks much, that did it

@rytilahti
Copy link
Owner

Ah, sorry about that! I misrecalled how the data was stored in that cache file. The linked PR should fix the issue for good.

@rytilahti
Copy link
Owner

0.5.5.1 fixing only this regression is now available at pypi.

xvlady pushed a commit to xvlady/python-miio that referenced this issue May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants