tinymovr / Tinymovr

Compact brushless motor controller with FOC, integrated absolute encoder and CAN Bus.
https://tinymovr.com
GNU General Public License v3.0
233 stars 38 forks source link

Studio does not start #276

Closed beesjot closed 12 months ago

beesjot commented 1 year ago

Hello

I've successfuly installed tinymovr[GUI] (by use command pip3 install "Tinymover[GUI]") but when I try to start Tinymovr, I can see next messages:

C:\Users\beesj>tinymovr Traceback (most recent call last): File "C:\Users\beesj\AppData\Local\Programs\Python\Python311\Lib\site-packages\tinymovr\config\config.py", line 55, in get_bus_config return configs[0]


IndexError: list index out of range

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

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\beesj\AppData\Local\Programs\Python\Python311\Scripts\tinymovr.exe\__main__.py", line 7, in <module>
  File "C:\Users\beesj\AppData\Local\Programs\Python\Python311\Lib\site-packages\tinymovr\gui\gui.py", line 48, in spawn
    w = MainWindow(app, arguments)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\beesj\AppData\Local\Programs\Python\Python311\Lib\site-packages\tinymovr\gui\window.py", line 139, in __init__
    params = get_bus_config(buses)
             ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\beesj\AppData\Local\Programs\Python\Python311\Lib\site-packages\tinymovr\config\config.py", line 57, in get_bus_config
    raise can.CanInitializationError("No active interface found") from exc
can.exceptions.CanInitializationError: No active interface found

Can You help me in this problem? 

System is Win10, Python v3.11.4. Tinymovr rev5.2 is conneceted two ways to PC: via Serial port, and via USB-CAN-A (Waveshare). Each interface is operating, but it is to little to change configuration of Tinymovr. My target is in control device via Serial port, and use internal motor Hall sensors.

Regards
beesjot
yconst commented 12 months ago

Hi @beesjot !

This error means that Tinymovr Studio is unable to detect a CAN bus interface. Upon startup, Studio tries to auto-detect a limited number of interface types, namely slcan and canine. For any other type, it needs to be specified as a command line argument (the bustype parameter), using the python-can compatible interface name.

For instance:

tinymovr --bus=socketcan

So you will need to find the python-can compatible interface name for your adapter first. Once you do that, you can pass it as an argument. If it is still not detected, it means that the python-can driver does not support channel auto-detection, and you will need to supply that as well, for instance:

tinymovr --bus=slcan --chan=/dev/ttyACM0

your chan parameter depends both on the OS as well as the device itself. For instance, in Windows, it is common to have a COM port as a channel:

tinymovr --bus=slcan --chan=COMXX

I hope this helps. I am converting this to a discussion as it is not an issue of studio. Please feel free to continue the discussion here.