Git Product home page Git Product logo

odrive-gui's People

Contributors

denniswittich avatar dreusel avatar falkoschindler avatar rodja avatar zauberzeug-dev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

odrive-gui's Issues

Web app unresponsive

There seems to be some issues with the web app in your Docker image/main.py. A couple things:

  • According to NiceGUI's doc, default port is 8080, and ui.run() doesn't set a port here, so the Docker CLI command should probably use -p 80:8080
  • Trying to access the app at http://localhost is still unsuccessful. No server response code (unreachable).

docker run --rm --privileged -p 80:8080 --name odrive -it zauberzeug/odrive-gui:latest prints the following:

/usr/local/lib/python3.9/site-packages/justpy
Module directory: /usr/local/lib/python3.9/site-packages/justpy, Application directory: /app

Any idea? @zauberzeug-dev

Sometimes the "Searching for ODrive..." remains visible on startup (and controls dont show up)

This issue is already present in the current main, so not introduced by my work in #10 ;)
It's a bit inconsistent. Sometimes it works fine, sometimes not.
With #10 , if it starts up in this 'broken' state, devices connected after startup will show up, but the "Searching for ODrive..." message remains visible.
I wonder if it's a bug in nicegui where it sometimes drops updates during startup or anything like that.

Cannot run from windows?

Hello,

On windows 11 with python version 3.11.4 installed
Odrivetool v0.5.6 is installed
pip install -r requirements.txt to meet the requirement.

When tried to run in windows with python .\src\main.py command,
I get below error and blank webpage.

python .\src\main.py
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\#####\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\spawn.py", line 120, in spawn_main
    exitcode = _main(fd, parent_sentinel)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\#####\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\spawn.py", line 129, in _main
    prepare(preparation_data)
  File "C:\Users\#####\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\spawn.py", line 240, in prepare
    _fixup_main_from_path(data['init_main_from_path'])
  File "C:\Users\#####\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\spawn.py", line 291, in _fixup_main_from_path
    main_content = runpy.run_path(main_path,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen runpy>", line 291, in run_path
  File "<frozen runpy>", line 98, in _run_module_code
  File "<frozen runpy>", line 88, in _run_code
  File "C:\workspaces\odrive\sw\odrive-gui\src\main.py", line 6, in <module>
    from nicegui import ui
  File "C:\Users\####\AppData\Local\Programs\Python\Python311\Lib\site-packages\nicegui\__init__.py", line 2, in <module>
    from nicegui.nicegui import app, ui
  File "C:\Users\####\AppData\Local\Programs\Python\Python311\Lib\site-packages\nicegui\nicegui.py", line 8, in <module>
    from .ui import Ui  # NOTE: before justpy
    ^^^^^^^^^^^^^^^^^^
  File "C:\Users\####\AppData\Local\Programs\Python\Python311\Lib\site-packages\nicegui\ui.py", line 5, in <module>
    class Ui:
  File "C:\Users\####\AppData\Local\Programs\Python\Python311\Lib\site-packages\nicegui\ui.py", line 6, in Ui
    from .config import config  # NOTE: before run
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\####\AppData\Local\Programs\Python\Python311\Lib\site-packages\nicegui\config.py", line 47, in <module>
    with open(filepath) as f:
         ^^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument: '<frozen runpy>'

Note '#####' is a username assigned to the OS

Breaks and never recovers when the odrive is disconnected

When the odrive is disconnected (ie power removed which in my case is sometimes needed because it goes in an error state after saving the config) the terminal output shows an error and then goes into an endless repetitive cycle from which it never recovers, also (specifically) not when reconnecting the ordive:

11:03:32.312403110 [LEGACY_OBJ] protocol failed with 3 - propagating error to application
ERROR base_events: Task exception was never retrieved
future: <Task finished name='Task-3' coro=<loop() done, defined at /usr/local/lib/python3.9/site-packages/nicegui/binding.py:17> exception=ObjectLostError('the object disappeared')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/nicegui/binding.py", line 24, in loop
    value = transform(getattr(source_obj, source_name))
  File "/usr/local/lib/python3.9/site-packages/odrive/pyfibre/fibre/libfibre.py", line 638, in __get__
    return self._get_obj(instance).read()
  File "/usr/local/lib/python3.9/site-packages/odrive/pyfibre/fibre/libfibre.py", line 581, in __call__
    return run_coroutine_threadsafe(self._libfibre.loop, lambda: self.__call__(*args))
  File "/usr/local/lib/python3.9/site-packages/odrive/pyfibre/fibre/libfibre.py", line 296, in run_coroutine_threadsafe
    return future.result()
  File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 446, in result
    return self.__get_result()
  File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.9/site-packages/odrive/pyfibre/fibre/libfibre.py", line 291, in func_async
    result = await result
  File "/usr/local/lib/python3.9/site-packages/odrive/pyfibre/fibre/libfibre.py", line 548, in async_call
    tx_buf, rx_chunk, is_closed = await agen.asend((tx_buf, self._rx_size - len(rx_buf), True))
  File "/usr/local/lib/python3.9/site-packages/odrive/pyfibre/fibre/libfibre.py", line 470, in asend
    return await self.__anext__()
  File "/usr/local/lib/python3.9/site-packages/odrive/pyfibre/fibre/libfibre.py", line 499, in __anext__
    raise _get_exception(status)
fibre.libfibre.ObjectLostError: the object disappeared
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/nicegui/timer.py", line 41, in do_callback
    return callback()
  File "/app/controls.py", line 49, in <lambda>
    f'{axis.motor.current_control.Iq_measured * axis.motor.current_control.v_current_control_integral_q:.1f} W'))
AttributeError: 'EmptyInterface' object has no attribute 'motor'
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/nicegui/timer.py", line 41, in do_callback
    return callback()
  File "/app/controls.py", line 49, in <lambda>
    f'{axis.motor.current_control.Iq_measured * axis.motor.current_control.v_current_control_integral_q:.1f} W'))
AttributeError: 'EmptyInterface' object has no attribute 'motor'
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/nicegui/timer.py", line 39, in do_callback
    return await callback()
  File "/app/controls.py", line 144, in vel_push
    vel_plot.push([datetime.now()], [[axis.controller.input_vel], [axis.encoder.vel_estimate]])

It would be great if the application could resume when the odrive reconnects.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.