Error flashing with ODrivetool DFU [SOLVED]

I downloaded the RazorsEdge Branch, by @Wetmelon, compiled it, but when I try to flash my board using odrivetool dfu I get an error when I try to confirm the flash:
“NameError: name ‘y’ is not defined”

I am running UBUNTU LTS 16.04

(I am noticing now the error code that python 2.7 is being referenced… wonder if that is the issue?)

here is full output:

thomas@localhost:~/ODrive/Firmware$ odrivetool dfu /home/thomas/ODrive/Firmware/build/ODriveFirmware.hex
ODrive control utility v0.4.9
/usr/local/lib/python2.7/dist-packages/requests/init.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
warnings.warn(warning, RequestsDependencyWarning)
Waiting for ODrive…
Found ODrive 206A3396304B (v3.6-24V) with firmware [unknown version]

You are about to flash firmware [unknown version] which is the same version as the firmware on the device ([unknown version]).
Do you want to flash this firmware anyway? [y/N] y
Traceback (most recent call last):
File “/usr/local/bin/odrivetool”, line 142, in
odrive.dfu.launch_dfu(args, logger, app_shutdown_token)
File “/usr/local/lib/python2.7/dist-packages/odrive/dfu.py”, line 454, in launch_dfu
update_device(device, firmware, logger, cancellation_token)
File “/usr/local/lib/python2.7/dist-packages/odrive/dfu.py”, line 326, in update_device
if not odrive.utils.yes_no_prompt(“Do you want to flash this firmware anyway?”, False):
File “/usr/local/lib/python2.7/dist-packages/odrive/utils.py”, line 206, in yes_no_prompt
choice = input().lower()
File “”, line 1, in
NameError: name ‘y’ is not defined

I had previously flashed this board a few months ago with the endstops branch, but I was having issues getting it working so I am attempting to start anew.

alos when I try to just update the firmware with the Official Master I get different errors, even after compiling and specifiying the hex file:

thomas@localhost:~/ODrive-master/tools$ ./odrivetool dfu /home/thomas/ODrive-master/Firmware/build/ODriveFirmware.hex
fatal: Not a git repository (or any of the parent directories): .git
Command ‘[‘git’, ‘describe’, ‘–always’, ‘–tags’, ‘–dirty=*’]’ returned non-zero exit status 128
ODrive control utility v0.0.0.dev
Waiting for ODrive…
Traceback (most recent call last):
File “./odrivetool”, line 142, in
odrive.dfu.launch_dfu(args, logger, app_shutdown_token)
File “/home/thomas/ODrive-master/tools/odrive/dfu.py”, line 454, in launch_dfu
update_device(device, firmware, logger, cancellation_token)
File “/home/thomas/ODrive-master/tools/odrive/dfu.py”, line 258, in update_device
serial_number = device.serial_number
File “/usr/lib/python3/dist-packages/usb/core.py”, line 765, in serial_number
self._serial_number = util.get_string(self, self.iSerialNumber)
File “/usr/lib/python3/dist-packages/usb/util.py”, line 261, in get_string
0
File “/usr/lib/python3/dist-packages/usb/control.py”, line 173, in get_descriptor
data_or_wLength = desc_size)
File “/usr/lib/python3/dist-packages/usb/core.py”, line 955, in ctrl_transfer
self._ctx.managed_open()
File “/usr/lib/python3/dist-packages/usb/core.py”, line 105, in managed_open
self.handle = self.backend.open_device(self.dev)
File “/usr/lib/python3/dist-packages/usb/backend/libusb1.py”, line 722, in open_device
return _DeviceHandle(dev)
File “/usr/lib/python3/dist-packages/usb/backend/libusb1.py”, line 600, in init
_check(_lib.libusb_open(self.devid, byref(self.handle)))
File “/usr/lib/python3/dist-packages/usb/backend/libusb1.py”, line 552, in _check
raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 13] Access denied (insufficient permissions)
usage: odrivetool [-h] [-p PATH] [-s SERIAL_NUMBER] [-v] [–version]
{shell,dfu,backup-config,restore-config,generate-code,liveplotter,drv-status,rate-test,udev-setup}

odrivetool: error: too few arguments

I GOT IT TO FLASH!
I think it may had to do with not having python3 installed?
Here is what I did:

Install Developer Tools:

sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt-get update
sudo apt-get install gcc-arm-embedded
sudo apt-get install openocd
sudo add-apt-repository ppa:jonathonf/tup && sudo apt-get update && sudo apt-get install tup



sudo apt-get install libfuse-dev
sudo apt-add-repository 'deb http://ppa.launchpad.net/anatol/tup/ubuntu precise main'
sudo apt-get update
sudo apt-get install tup

Install python 3.72:

sudo apt update
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget

After installing the above packages, go and download the latest release’s source code from the Python download page using the following wget command…

cd /tmp
wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz

After downloading the package, run the commands below extract the file and install…

tar -xf Python-3.7.2.tar.xz
cd Python-3.7.2
./configure --enable-optimizations

Next start the building process using the make command… Replace the #1 with the number of CPU cores on your system for faster build time… My machine has 4 CPU core, so I use the make command with -j 4 option…

make -j 4

sudo make altinstall

Do not use the standard make install as it will overwrite the default system python3 binary…

After that, Python should be installed and ready to use…

To test if Python is installed and ready to use, run the commands below

python3.7 --version

then I ran the odrivetool dfu with sudo. the board flashes but it doesn’t reconnect, but when I open ODrrivetool the board is there yay :slight_smile:

Yeah, I think odrivetool only works correctly with Python 3