Getting frustrated, Windows 10

Hello, oDrive community! I have an oDrive board on loan from a friend who was looking for some new behaviors in his oDrive so I thought I’d jump in and have a go at modification of the firmware and hopefully with some success be able to bring those changes to the project.

However…

Just getting this board running and connected to my Windows 10 machine has been a… challenge… that I haven’t conquered yet, despite spending a week of evenings overcoming some stubborn obstacles already.

The first obstacle is that the instructions to install pywin32 seem to be wrong. The readme says “Install dependencies by typing pip install pywin32==222”. When I did this, I got a lot of errors when trying to run odrivetool. I banged my head against Google for a long time before I decided to eliminate the ==222, which worked.

I got the motor and encoder wired properly and when I power the board, the motor beeps for a moment, turns for a ways, and then stops so I assume there’s firmware loaded on it. My board is v3.2. The problem is that odrivetool doesn’t “see” my board. I have followed the instructions for zadig and chosen libusb-win32 - although here again, there are labeling discrepancies between the instructions and reality. I see in Device Manager “libusb-wins32 devices” with “ODrive version 3.2” listed within. But odrivetool never recognizes it. I’ve plugged, unplugged, tried different sequences - all to no avail.

So, I figure, maybe I do have to (re)flash the firmware onto the board - so I follow the multiple-levels of dependent utilities and drivers, seem to have everything ready to go, copy and paste the openocd command to flash the firmware and “Unexpected command line argument: halt”… Sigh. Removing the argument just makes it complain about the next argument in the list (write_image/) and I have no idea where to go next with it.

In Summary:

  1. Despite this first post being a real bummer, I’d like to get involved in this project.

  2. Someone really should go through a Windows (and maybe the other OSs) set-up from scratch following the instructions while not making any assumptions based on what they already know. I guess I’ve kinda already done this and posted my findings in this post but I’m not yet familiar with the tools, environment, and dependencies to make recommendations.

  3. The information about how to set-up the board and tools as well as user guides, etc seem to be scattered all over the place. Sometimes I spend a lot of time just trying to find “that oDrive page I just had open last night”.

  4. Can someone help me get my board up and running? I seem so close and yet so far. Should I just spin up a Linux VM? Can I use my Raspi for all of this?

–Will Kalman

2 Likes

Hi Will,

I have a Windows 10 machine for the odrivetool and a VM with 8.1 for development.

For the odrivetool, I followed that description with anaconda.

Windows

Install Python 3. We recommend the Anaconda distribution because it packs a lot of useful scientific tools, however you can also install the standalone python.
    Anaconda: Download the installer from here. Execute the downloaded file and follow the instructions.
    Standalone Python: Download the installer from here. Execute the downloaded file and follow the instructions.
    If you have Python 2 installed alongside Python 3, replace pip by C:\Users\YOUR_USERNAME\AppData\Local\Programs\Python\Python36-32\Scripts\pip. If you have trouble with this step then refer to this walkthrough.
Launch the command prompt.
    Anaconda: In the start menu, type Anaconda Prompt Enter
    Standalone Python: In the start menu, type cmd Enter
Install dependencies by typing pip install pywin32==222 Enter
Install the ODrive tools by typing pip install odrive Enter
Plug in a USB cable into the microUSB connector on ODrive, and connect it to your PC.
Use the Zadig utility to set ODrive driver to libusb-win32.

Check ‘List All Devices’ from the options menu, and select ‘ODrive 3.x Native Interface (Interface 2)’. With that selected in the device list choose ‘libusb-win32’ from the target driver list and then press the large ‘install driver’ button.

After that I got an dependency error.
Fixed with this:

Hi all,
in the documentation for installing phyton on a windows machine, a line should be added between point 3 (pip install pywin32) and 4 (pip install odrive). Otherwise the installation of ODrive tool will fail.

pip install pyserial

Greetings Zennix

Unfortunately, that wasn’t the issue on my machine:

C:\WINDOWS\system32>pip install pyserial
Requirement already satisfied: pyserial in c:\users\wkalman\appdata\local\programs\python\python37-32\lib\site-packages (3.4)

C:\WINDOWS\system32>odrivetool
ODrive control utility v0.4.1
Please connect your ODrive.
You can also type help() or quit().

In [1]:

It just sits there and never recognizes the oDrive which is plugged in to USB and recognized in Device Manager as indicated in my post.

Does anyone else have a clue as to what I should do next? Does odrivetool log anything?

And how about the error when I try to flash the firmware?

Do you have a green light on the board?

No green light that I can see. When I power up the board, there’s a beep and the motor makes just over one rotation so there’s some life in there.

Is there a reference to the board and it’s components like LEDs, etc?

If you have a 3.2, the hardware files are here:

i only have a 3.5 and 24 hours of experience, my 3.5 has a LED when there is power but i see the 3.2 doesnt have one so that was a poor question indeed!

Running odrivetool with --verbose…

C:\WINDOWS\system32>odrivetool --verbose
ODrive control utility v0.4.1
Waiting for ODrive…
USB discover loop
ConfigurationValue 1
_ InterfaceNumber 0,0_
_ EndpointAddress 130_
_ InterfaceNumber 1,0_
_ EndpointAddress 1_
_ EndpointAddress 129_

EndpointAddress for writing 1
EndpointAddress for reading 129
Connecting to device on USB device bus 0 device 1
Please connect your ODrive.
You can also type help() or quit().

no response - probably incompatible
USB discover loop
USB discover loop
USB discover loop
USB discover loop
In [1]: exit

Any thoughts? Unfortunately, I don’t know what it’s supposed to say…

The other thing is - does this have firmware? I assumed it does since it does it’s little startup dance. Do I, or should I, re-flash the firmware? If so - does anyone have any insight on the problem I was having following the instructions as stated above with the Halt argument causing problems?

It likely has old firmware.

When you tried to flash, I assume you have all the STLinkV2 stuff, and installed the Eclipse GNU ARM version of openocd?

Yes, I followed the guide to flash the firmware (installing openocd and the ST drivers) but I’m getting the "Unexpected command line argument: halt” error as stated in my post…

I tried to get this running via my raspi but the openocd installation was a big show-stopper - there wasn’t an apt package and other options amounted to quickly going down the rabbit-hole of adding more and more dependencies and potential problems so I built a Debian Linux VM hosted on my Windows laptop and was able to install openocd, then flash and connect to my oDrive. I think I wore out Google!

Now that it’s flashed and I know it will connect, I’ll try it from Windows and see if the flash was the key.

It also seems that odrivetool will not detect hot-plugging the oDrive. I have to restart odrivetool to get it to “see” the oDrive. Is that the expected behavior?

Now I’m going to make a motor move! WHEW!

Connecting now via Raspi and Windows. Looks like it was a firmware issue. I also noticed that one time, odrivetool did a hot-plug reconnect (and called it a re-connect in the message) without being restarted so I guess it does officially support it, though it seems to be a slow and/or intermittent. Connecting overall seems a bit slow - and variable - so maybe it’s all part of the same behavior.

Anyhow, thanks to those who replied. I’m sure I’ll have more questions later ;^)

Don’t tell me
Smoothing filters :rofl::rofl:

1 Like