zauberzeug / odrive-gui Goto Github PK
View Code? Open in Web Editor NEWGUI to configure the ODrive Motor Controller
License: MIT License
GUI to configure the ODrive Motor Controller
License: MIT License
0.5.1 v3.6 can use this gui?
There seems to be some issues with the web app in your Docker image/main.py
. A couple things:
ui.run()
doesn't set a port here, so the Docker CLI command should probably use -p 80:8080
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
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.
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.