Trouble connecting with new install on raspberry pi

I have an odrive which I can connect to using odrivetool on my laptop, but I cannot connect to it with a totally freshly configured raspberry pi 4.

I’ve taken the latest raspbian lite image and flashed it on to an sd card. I enabled ssh and setup wifi using a known good wpa_supplicant.conf. I changed the hostname. I powered it on and ssh’d in. I did a sudo apt update and sudo apt upgrade and rebooted. Then I did sudo apt install python3-pip and sudo pip3 install odrive. Then I rebooted. That is all I have done with this pi image.

Then I log back in, run sudo odrivetool -v, and get the following:

ODrive control utility v0.4.11
Waiting for ODrive...
USB discover loop
ConfigurationValue 1
	InterfaceNumber 0,0
		EndpointAddress 130
	InterfaceNumber 1,0
		EndpointAddress 1
		EndpointAddress 129
	InterfaceNumber 2,0
		EndpointAddress 3
		EndpointAddress 131

Kernel Driver was not attached
EndpointAddress for writing 3
EndpointAddress for reading 131
Connecting to device on USB device bus 1 device 4
/usr/local/lib/python3.7/dist-packages/fibre/shell.py:104: RuntimeWarning: coroutine 'InteractiveShell.run_code' was never awaited
  console.runcode('import sys')
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/usr/local/lib/python3.7/dist-packages/fibre/shell.py:105: RuntimeWarning: coroutine 'InteractiveShell.run_code' was never awaited
  console.runcode('superexcepthook = sys.excepthook')
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/usr/local/lib/python3.7/dist-packages/fibre/shell.py:106: RuntimeWarning: coroutine 'InteractiveShell.run_code' was never awaited
  console.runcode('def newexcepthook(ex_class,ex,trace):\n'
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/usr/local/lib/python3.7/dist-packages/fibre/shell.py:109: RuntimeWarning: coroutine 'InteractiveShell.run_code' was never awaited
  console.runcode('sys.excepthook=newexcepthook')
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Please connect your ODrive.
You can also type help() or quit().

Now I’ve seen those warnings on other systems that still work, so I’m less concerned there. I have waited several minutes because I know sometimes connecting is slow. But it never connects. I have power cycled and tried multiple times. However my laptop connects with success (see below).

I should say that reflashing the Pi4 came after a day of bad luck yesterday trying to get this odrive I have to connect. Neither my desktop (new install of the pip3 package) nor my raspberry pi (also a new install of the pip3 package) would connect to the odrive, and I thought it was dead until I realized my laptop will connect to it just fine. I have another system of odrives and a raspberry pi that previously worked, and yesterday I had trouble with it too.

So I’m going a little nuts. I can’t work on my robot until I can get a pi to connect again. Is the current pip package actually working?

I do get a weird thing with my laptop, which is this JSON error others on this board have seen. Here is what a successful connection looks like on my laptop right now:

ODrive control utility v0.4.11.dev

Developer Preview
  If you find issues, please report them
  on https://github.com/madcowswe/ODrive/issues
  or better yet, submit a pull request to fix it.

Waiting for ODrive...
USB discover loop
ConfigurationValue 1
	InterfaceNumber 0,0
		EndpointAddress 130
	InterfaceNumber 1,0
		EndpointAddress 1
		EndpointAddress 129
	InterfaceNumber 2,0
		EndpointAddress 3
		EndpointAddress 131

Kernel Driver was not attached
EndpointAddress for writing 3
EndpointAddress for reading 131
Connecting to device on USB device bus 1 device 29
Please connect your ODrive.
You can also type help() or quit().

JSON: [
{"name":"","id":0,"type":"json","access":"r"},
{"name":"vbus_voltage","id":1,"type":"float","access":"r"},
{"name":"serial_number","id":2,"type":"uint64","access":"r"},
{"name":"hw_version_major","id":3,"type":"uint8","access":"r"},
{"name":"hw_version_minor","id":4,"type":"uint8","access":"r"},
{"name":"hw_version_variant","id":5,"type":"uint8","access":"r"},
{"name":"fw_version_major","id":6,"type":"uint8","access":"r"},
{"name":"fw_version_minor","id":7,"type":"uint8","access":"r"},
{"name":"fw_version_revision","id":8,"type":"uint8","access":"r"},
{"name":"fw_version_unreleased","id":9,"type":"uint8","access":"r"},
{"name":"user_config_loaded","id":10,"type":"bool","access":"r"},
{"name":"brake_resistor_armed","id":11,"type":"bool","access":"r"},
{"name":"system_stats","type":"object","members":[
{"name":"uptime","id":12,"type":"uint32","access":"r"},
{"name":"min_heap_space","id":13,"type":"uint32","access":"r"},
{"name":"min_stack_space_axis0","id":14,"type":"uint32","access":"r"},
{"name":"min_stack_space_axis1","id":15,"type":"uint32","access":"r"},
{"name":"min_stack_space_comms","id":16,"type":"uint32","access":"r"},
{"name":"min_stack_space_usb","id":17,"type":"uint32","access":"r"},
{"name":"min_stack_space_uart","id":18,"type":"uint32","access":"r"},
{"name":"min_stack_space_usb_irq","id":19,"type":"uint32","access":"r"},
{"name":"min_stack_space_startup","id":20,"type":"uint32","access":"r"},
{"name":"usb","type":"object","members":[
{"name":"rx_cnt","id":21,"type":"uint32","access":"r"},
{"name":"tx_cnt","id":22,"type":"uint32","access":"r"},
{"name":"tx_overrun_cnt","id":23,"type":"uint32","access":"r"}]},
{"name":"i2c","type":"object","members":[
{"name":"addr","id":24,"type":"uint8","access":"r"},
{"name":"addr_match_cnt","id":25,"type":"uint32","access":"r"},
{"name":"rx_cnt","id":26,"type":"uint32","access":"r"},
{"name":"error_cnt","id":27,"type":"uint32","access":"r"}]}]},
{"name":"config","type":"object","members":[
{"name":"brake_resistance","id":28,"type":"float","access":"rw"},
{"name":"enable_uart","id":29,"type":"bool","access":"rw"},
{"name":"enable_i2c_instead_of_can","id":30,"type":"bool","access":"rw"},
{"name":"enable_ascii_protocol_on_usb","id":31,"type":"bool","access":"rw"},
{"name":"dc_bus_undervoltage_trip_level","id":32,"type":"float","access":"rw"},
{"name":"dc_bus_overvoltage_trip_level","id":33,"type":"float","access":"rw"},
{"name":"gpio1_pwm_mapping","type":"object","members":[
{"name":"endpoint","id":34,"type":"endpoint_ref","access":"rw"},
{"name":"min","id":35,"type":"float","access":"rw"},
{"name":"max","id":36,"type":"float","access":"rw"}]},
{"name":"gpio2_pwm_mapping","type":"object","members":[
{"name":"endpoint","id":37,"type":"endpoint_ref","access":"rw"},
{"name":"min","id":38,"type":"float","access":"rw"},
{"name":"max","id":39,"type":"float","access":"rw"}]},
{"name":"gpio3_pwm_mapping","type":"object","members":[
{"name":"endpoint","id":40,"type":"endpoint_ref","access":"rw"},
{"name":"min","id":41,"type":"float","access":"rw"},
{"name":"max","id":42,"type":"float","access":"rw"}]},
{"name":"gpio4_pwm_mapping","type":"object","members":[
{"name":"endpoint","id":43,"type":"endpoint_ref","access":"rw"},
{"name":"min","id":44,"type":"float","access":"rw"},
{"name":"max","id":45,"type":"float","access":"rw"}]},
{"name":"gpio3_analog_mapping","type":"object","members":[
{"name":"endpoint","id":46,"type":"endpoint_ref","access":"rw"},
{"name":"min","id":47,"type":"float","access":"rw"},
{"name":"max","id":48,"type":"float","access":"rw"}]},
{"name":"gpio4_analog_mapping","type":"object","members":[
{"name":"endpoint","id":49,"type":"endpoint_ref","access":"rw"},
{"name":"min","id":50,"type":"float","access":"rw"},
{"name":"max","id":51,"type":"float","access":"rw"}]}]},
{"name":"axis0","type":"object","members":[
{"name":"error","id":52,"type":"uint16","access":"rw"},
{"name":"step_dir_active","id":53,"type":"bool","access":"r"},
{"name":"current_state","id":54,"type":"uint8","access":"r"},
{"name":"requested_state","id":55,"type":"uint8","access":"rw"},
{"name":"loop_counter","id":56,"type":"uint32","access":"r"},
{"name":"lockin_state","id":57,"type":"uint8","access":"r"},
{"name":"config","type":"object","members":[
{"name":"startup_motor_calibration","id":58,"type":"bool","access":"rw"},
{"name":"startup_encoder_index_search","id":59,"type":"bool","access":"rw"},
{"name":"startup_encoder_offset_calibration","id":60,"type":"bool","access":"rw"},
{"name":"startup_closed_loop_control","id":61,"type":"bool","access":"rw"},
{"name":"startup_sensorless_control","id":62,"type":"bool","access":"rw"},
{"name":"enable_step_dir","id":63,"type":"bool","access":"rw"},
{"name":"counts_per_step","id":64,"type":"float","access":"rw"},
{"name":"watchdog_timeout","id":65,"type":"float","access":"rw"},
{"name":"step_gpio_pin","id":66,"type":"uint16","access":"rw"},
{"name":"dir_gpio_pin","id":67,"type":"uint16","access":"rw"},
{"name":"lockin","type":"object","members":[
{"name":"current","id":68,"type":"float","access":"rw"},
{"name":"ramp_time","id":69,"type":"float","access":"rw"},
{"name":"ramp_distance","id":70,"type":"float","access":"rw"},
{"name":"accel","id":71,"type":"float","access":"rw"},
{"name":"vel","id":72,"type":"float","access":"rw"},
{"name":"finish_distance","id":73,"type":"float","access":"rw"},
{"name":"finish_on_vel","id":74,"type":"bool","access":"rw"},
{"name":"finish_on_distance","id":75,"type":"bool","access":"rw"},
{"name":"finish_on_enc_idx","id":76,"type":"bool","access":"rw"}]}]},
{"name":"motor","type":"object","members":[
{"name":"error","id":77,"type":"uint16","access":"rw"},
{"name":"armed_state","id":78,"type":"uint8","access":"r"},
{"name":"is_calibrated","id":79,"type":"bool","access":"r"},
{"name":"current_meas_phB","id":80,"type":"float","access":"r"},
{"name":"current_meas_phC","id":81,"type":"float","access":"r"},
{"name":"DC_calib_phB","id":82,"type":"float","access":"rw"},
{"name":"DC_calib_phC","id":83,"type":"float","access":"rw"},
{"name":"phase_current_rev_gain","id":84,"type":"float","access":"rw"},
{"name":"thermal_current_lim","id":85,"type":"float","access":"r"},
{"name":"get_inverter_temp","id":86,"type":"function","inputs":[],"outputs":[
{"name":"result","id":87,"type":"float","access":"rw"}]},
{"name":"current_control","type":"object","members":[
{"name":"p_gain","id":88,"type":"float","access":"rw"},
{"name":"i_gain","id":89,"type":"float","access":"rw"},
{"name":"v_current_control_integral_d","id":90,"type":"float","access":"rw"},
{"name":"v_current_control_integral_q","id":91,"type":"float","access":"rw"},
{"name":"Ibus","id":92,"type":"float","access":"rw"},
{"name":"final_v_alpha","id":93,"type":"float","access":"rw"},
{"name":"final_v_beta","id":94,"type":"float","access":"rw"},
{"name":"Iq_setpoint","id":95,"type":"float","access":"rw"},
{"name":"Iq_measured","id":96,"type":"float","access":"rw"},
{"name":"Id_measured","id":97,"type":"float","access":"rw"},
{"name":"I_measured_report_filter_k","id":98,"type":"float","access":"rw"},
{"name":"max_allowed_current","id":99,"type":"float","access":"r"},
{"name":"overcurrent_trip_level","id":100,"type":"float","access":"r"}]},
{"name":"gate_driver","type":"object","members":[
{"name":"drv_fault","id":101,"type":"uint16","access":"r"}]},
{"name":"timing_log","type":"object","members":[
{"name":"TIMING_LOG_GENERAL","id":102,"type":"uint16","access":"r"},
{"name":"TIMING_LOG_ADC_CB_I","id":103,"type":"uint16","access":"r"},
{"name":"TIMING_LOG_ADC_CB_DC","id":104,"type":"uint16","access":"r"},
{"name":"TIMING_LOG_MEAS_R","id":105,"type":"uint16","access":"r"},
{"name":"TIMING_LOG_MEAS_L","id":106,"type":"uint16","access":"r"},
{"name":"TIMING_LOG_ENC_CALIB","id":107,"type":"uint16","access":"r"},
{"name":"TIMING_LOG_IDX_SEARCH","id":108,"type":"uint16","access":"r"},
{"name":"TIMING_LOG_FOC_VOLTAGE","id":109,"type":"uint16","access":"r"},
{"name":"TIMING_LOG_FOC_CURRENT","id":110,"type":"uint16","access":"r"}]},
{"name":"config","type":"object","members":[
{"name":"pre_calibrated","id":111,"type":"bool","access":"rw"},
{"name":"pole_pairs","id":112,"type":"int32","access":"rw"},
{"name":"calibration_current","id":113,"type":"float","access":"rw"},
{"name":"resistance_calib_max_voltage","id":114,"type":"float","access":"rw"},
{"name":"phase_inductance","id":115,"type":"float","access":"rw"},
{"name":"phase_resistance","id":116,"type":"float","access":"rw"},
{"name":"direction","id":117,"type":"int32","access":"rw"},
{"name":"motor_type","id":118,"type":"uint8","access":"rw"},
{"name":"current_lim","id":119,"type":"float","access":"rw"},
{"name":"inverter_temp_limit_lower","id":120,"type":"float","access":"rw"},
{"name":"inverter_temp_limit_upper","id":121,"type":"float","access":"rw"},
{"name":"requested_current_range","id":122,"type":"float","access":"rw"},
{"name":"current_control_bandwidth","id":123,"type":"float","access":"rw"}]}]},
{"name":"controller","type":"object","members":[
{"name":"error","id":124,"type":"uint8","access":"rw"},
{"name":"pos_setpoint","id":125,"type":"float","access":"rw"},
{"name":"vel_setpoint","id":126,"type":"float","access":"rw"},
{"name":"vel_integrator_current","id":127,"type":"float","access":"rw"},
{"name":"current_setpoint","id":128,"type":"float","access":"rw"},
{"name":"vel_ramp_target","id":129,"type":"float","access":"rw"},
{"name":"vel_ramp_enable","id":130,"type":"bool","access":"rw"},
{"name":"config","type":"object","members":[
{"name":"control_mode","id":131,"type":"uint8","access":"rw"},
{"name":"pos_gain","id":132,"type":"float","access":"rw"},
{"name":"vel_gain","id":133,"type":"float","access":"rw"},
{"name":"vel_integrator_gain","id":134,"type":"float","access":"rw"},
{"name":"vel_limit","id":135,"type":"float","access":"rw"},
{"name":"vel_limit_tolerance","id":136,"type":"float","access":"rw"},
{"name":"vel_ramp_rate","id":137,"type":"float","access":"rw"},
{"name":"setpoints_in_cpr","id":138,"type":"bool","access":"rw"}]},
{"name":"set_pos_setpoint","id":139,"type":"function","inputs":[
{"name":"pos_setpoint","id":140,"type":"float","access":"rw"},
{"name":"vel_feed_forward","id":141,"type":"float","access":"rw"},
{"name":"current_feed_forward","id":142,"type":"float","access":"rw"}],"outputs":[]},
{"name":"set_vel_setpoint","id":143,"type":"function","inputs":[
{"name":"vel_setpoint","id":144,"type":"float","access":"rw"},
{"name":"current_feed_forward","id":145,"type":"float","access":"rw"}],"outputs":[]},
{"name":"set_current_setpoint","id":146,"type":"function","inputs":[
{"name":"current_setpoint","id":147,"type":"float","access":"rw"}],"outputs":[]},
{"name":"move_to_pos","id":148,"type":"function","inputs":[
{"name":"pos_setpoint","id":149,"type":"float","access":"rw"}],"outputs":[]},
{"name":"move_incremental","id":150,"type":"function","inputs":[
{"name":"displacement","id":151,"type":"float","access":"rw"},
{"name":"from_goal_point","id":152,"type":"bool","access":"rw"}],"outputs":[]},
{"name":"start_anticogging_calibration","id":153,"type":"function","inputs":[],"outputs":[]}]},
{"name":"encoder","type":"object","members":[
{"name":"error","id":154,"type":"uint8","access":"rw"},
{"name":"is_ready","id":155,"type":"bool","access":"rw"},
{"name":"index_found","id":156,"type":"bool","access":"rw"},
{"name":"shadow_count","id":157,"type":"int32","access":"rw"},
{"name":"count_in_cpr","id":158,"type":"int32","access":"rw"},
{"name":"interpolation","id":159,"type":"float","access":"rw"},
{"name":"phase","id":160,"type":"float","access":"r"},
{"name":"pos_estimate","id":161,"type":"float","access":"rw"},
{"name":"pos_cpr","id":162,"type":"float","access":"rw"},
{"name":"hall_state","id":163,"type":"uint8","access":"r"},
{"name":"vel_estimate","id":164,"type":"float","access":"rw"},
{"name":"calib_scan_response","id":165,"type":"float","access":"r"},
{"name":"config","type":"object","members":[
{"name":"mode","id":166,"type":"uint8","access":"rw"},
{"name":"use_index","id":167,"type":"bool","access":"rw"},
{"name":"find_idx_on_lockin_only","id":168,"type":"bool","access":"rw"},
{"name":"pre_calibrated","id":169,"type":"bool","access":"rw"},
{"name":"zero_count_on_find_idx","id":170,"type":"bool","access":"rw"},
{"name":"cpr","id":171,"type":"int32","access":"rw"},
{"name":"offset","id":172,"type":"int32","access":"rw"},
{"name":"offset_float","id":173,"type":"float","access":"rw"},
{"name":"enable_phase_interpolation","id":174,"type":"bool","access":"rw"},
{"name":"bandwidth","id":175,"type":"float","access":"rw"},
{"name":"calib_range","id":176,"type":"float","access":"rw"},
{"name":"calib_scan_distance","id":177,"type":"float","access":"rw"},
{"name":"calib_scan_omega","id":178,"type":"float","access":"rw"},
{"name":"idx_search_unidirectional","id":179,"type":"bool","access":"rw"},
{"name":"ignore_illegal_hall_state","id":180,"type":"bool","access":"rw"}]},
{"name":"set_linear_count","id":181,"type":"function","inputs":[
{"name":"count","id":182,"type":"int32","access":"rw"}],"outputs":[]}]},
{"name":"sensorless_estimator","type":"object","members":[
{"name":"error","id":183,"type":"uint8","access":"rw"},
{"name":"phase","id":184,"type":"float","access":"rw"},
{"name":"pll_pos","id":185,"type":"float","access":"rw"},
{"name":"vel_estimate","id":186,"type":"float","access":"rw"},
{"name":"config","type":"object","members":[
{"name":"observer_gain","id":187,"type":"float","access":"rw"},
{"name":"pll_bandwidth","id":188,"type":"float","access":"rw"},
{"name":"pm_flux_linkage","id":189,"type":"float","access":"rw"}]}]},
{"name":"trap_traj","type":"object","members":[
{"name":"config","type":"object","members":[
{"name":"vel_limit","id":190,"type":"float","access":"rw"},
{"name":"accel_limit","id":191,"type":"float","access":"rw"},
{"name":"decel_limit","id":192,"type":"float","access":"rw"},
{"name":"A_per_css","id":193,"type":"float","access":"rw"}]}]},
{"name":"watchdog_feed","id":194,"type":"function","inputs":[],"outputs":[]}]},
{"name":"axis1","type":"object","members":[
{"name":"error","id":195,"type":"uint16","access":"rw"},
{"name":"step_dir_active","id":196,"type":"bool","access":"r"},
{"name":"current_state","id":197,"type":"uint8","access":"r"},
{"name":"requested_state","id":198,"type":"uint8","access":"rw"},
{"name":"loop_counter","id":199,"type":"uint32","access":"r"},
{"name":"lockin_state","id":200,"type":"uint8","access":"r"},
{"name":"config","type":"object","members":[
{"name":"startup_motor_calibration","id":201,"type":"bool","access":"rw"},
{"name":"startup_encoder_index_search","id":202,"type":"bool","access":"rw"},
{"name":"startup_encoder_offset_calibration","id":203,"type":"bool","access":"rw"},
{"name":"startup_closed_loop_control","id":204,"type":"bool","access":"rw"},
{"name":"startup_sensorless_control","id":205,"type":"bool","access":"rw"},
{"name":"enable_step_dir","id":206,"type":"bool","access":"rw"},
{"name":"counts_per_step","id":207,"type":"float","access":"rw"},
{"name":"watchdog_timeout","id":208,"type":"float","access":"rw"},
{"name":"step_gpio_pin","id":209,"type":"uint16","access":"rw"},
{"name":"dir_gpio_pin","id":210,"type":"uint16","access":"rw"},
{"name":"lockin","type":"object","members":[
{"name":"current","id":211,"type":"float","access":"rw"},
{"name":"ramp_time","id":212,"type":"float","access":"rw"},
{"name":"ramp_distance","id":213,"type":"float","access":"rw"},
{"name":"accel","id":214,"type":"float","access":"rw"},
{"name":"vel","id":215,"type":"float","access":"rw"},
{"name":"finish_distance","id":216,"type":"float","access":"rw"},
{"name":"finish_on_vel","id":217,"type":"bool","access":"rw"},
{"name":"finish_on_distance","id":218,"type":"bool","access":"rw"},
{"name":"finish_on_enc_idx","id":219,"type":"bool","access":"rw"}]}]},
{"name":"motor","type":"object","members":[
{"name":"error","id":220,"type":"uint16","access":"rw"},
{"name":"armed_state","id":221,"type":"uint8","access":"r"},
{"name":"is_calibrated","id":222,"type":"bool","access":"r"},
{"name":"current_meas_phB","id":223,"type":"float","access":"r"},
{"name":"current_meas_phC","id":224,"type":"float","access":"r"},
{"name":"DC_calib_phB","id":225,"type":"float","access":"rw"},
{"name":"DC_calib_phC","id":226,"type":"float","access":"rw"},
{"name":"phase_current_rev_gain","id":227,"type":"float","access":"rw"},
{"name":"thermal_current_lim","id":228,"type":"float","access":"r"},
{"name":"get_inverter_temp","id":229,"type":"function","inputs":[],"outputs":[
{"name":"result","id":230,"type":"float","access":"rw"}]},
{"name":"current_control","type":"object","members":[
{"name":"p_gain","id":231,"type":"float","access":"rw"},
{"name":"i_gain","id":232,"type":"float","access":"rw"},
{"name":"v_current_control_integral_d","id":233,"type":"float","access":"rw"},
{"name":"v_current_control_integral_q","id":234,"type":"float","access":"rw"},
{"name":"Ibus","id":235,"type":"float","access":"rw"},
{"name":"final_v_alpha","id":236,"type":"float","access":"rw"},
{"name":"final_v_beta","id":237,"type":"float","access":"rw"},
{"name":"Iq_setpoint","id":238,"type":"float","access":"rw"},
{"name":"Iq_measured","id":239,"type":"float","access":"rw"},
{"name":"Id_measured","id":240,"type":"float","access":"rw"},
{"name":"I_measured_report_filter_k","id":241,"type":"float","access":"rw"},
{"name":"max_allowed_current","id":242,"type":"float","access":"r"},
{"name":"overcurrent_trip_level","id":243,"type":"float","access":"r"}]},
{"name":"gate_driver","type":"object","members":[
{"name":"drv_fault","id":244,"type":"uint16","access":"r"}]},
{"name":"timing_log","type":"object","members":[
{"name":"TIMING_LOG_GENERAL","id":245,"type":"uint16","access":"r"},
{"name":"TIMING_LOG_ADC_CB_I","id":246,"type":"uint16","access":"r"},
{"name":"TIMING_LOG_ADC_CB_DC","id":247,"type":"uint16","access":"r"},
{"name":"TIMING_LOG_MEAS_R","id":248,"type":"uint16","access":"r"},
{"name":"TIMING_LOG_MEAS_L","id":249,"type":"uint16","access":"r"},
{"name":"TIMING_LOG_ENC_CALIB","id":250,"type":"uint16","access":"r"},
{"name":"TIMING_LOG_IDX_SEARCH","id":251,"type":"uint16","access":"r"},
{"name":"TIMING_LOG_FOC_VOLTAGE","id":252,"type":"uint16","access":"r"},
{"name":"TIMING_LOG_FOC_CURRENT","id":253,"type":"uint16","access":"r"}]},
{"name":"config","type":"object","members":[
{"name":"pre_calibrated","id":254,"type":"bool","access":"rw"},
{"name":"pole_pairs","id":255,"type":"int32","access":"rw"},
{"name":"calibration_current","id":256,"type":"float","access":"rw"},
{"name":"resistance_calib_max_voltage","id":257,"type":"float","access":"rw"},
{"name":"phase_inductance","id":258,"type":"float","access":"rw"},
{"name":"phase_resistance","id":259,"type":"float","access":"rw"},
{"name":"direction","id":260,"type":"int32","access":"rw"},
{"name":"motor_type","id":261,"type":"uint8","access":"rw"},
{"name":"current_lim","id":262,"type":"float","access":"rw"},
{"name":"inverter_temp_limit_lower","id":263,"type":"float","access":"rw"},
{"name":"inverter_temp_limit_upper","id":264,"type":"float","access":"rw"},
{"name":"requested_current_range","id":265,"type":"float","access":"rw"},
{"name":"current_control_bandwidth","id":266,"type":"float","access":"rw"}]}]},
{"name":"controller","type":"object","members":[
{"name":"error","id":267,"type":"uint8","access":"rw"},
{"name":"pos_setpoint","id":268,"type":"float","access":"rw"},
{"name":"vel_setpoint","id":269,"type":"float","access":"rw"},
{"name":"vel_integrator_current","id":270,"type":"float","access":"rw"},
{"name":"current_setpoint","id":271,"type":"float","access":"rw"},
{"name":"vel_ramp_target","id":272,"type":"float","access":"rw"},
{"name":"vel_ramp_enable","id":273,"type":"bool","access":"rw"},
{"name":"config","type":"object","members":[
{"name":"control_mode","id":274,"type":"uint8","access":"rw"},
{"name":"pos_gain","id":275,"type":"float","access":"rw"},
{"name":"vel_gain","id":276,"type":"float","access":"rw"},
{"name":"vel_integrator_gain","id":277,"type":"float","access":"rw"},
{"name":"vel_limit","id":278,"type":"float","access":"rw"},
{"name":"vel_limit_tolerance","id":279,"type":"float","access":"rw"},
{"name":"vel_ramp_rate","id":280,"type":"float","access":"rw"},
{"name":"setpoints_in_cpr","id":281,"type":"bool","access":"rw"}]},
{"name":"set_pos_setpoint","id":282,"type":"function","inputs":[
{"name":"pos_setpoint","id":283,"type":"float","access":"rw"},
{"name":"vel_feed_forward","id":284,"type":"float","access":"rw"},
{"name":"current_feed_forward","id":285,"type":"float","access":"rw"}],"outputs":[]},
{"name":"set_vel_setpoint","id":286,"type":"function","inputs":[
{"name":"vel_setpoint","id":287,"type":"float","access":"rw"},
{"name":"current_feed_forward","id":288,"type":"float","access":"rw"}],"outputs":[]},
{"name":"set_current_setpoint","id":289,"type":"function","inputs":[
{"name":"current_setpoint","id":290,"type":"float","access":"rw"}],"outputs":[]},
{"name":"move_to_pos","id":291,"type":"function","inputs":[
{"name":"pos_setpoint","id":292,"type":"float","access":"rw"}],"outputs":[]},
{"name":"move_incremental","id":293,"type":"function","inputs":[
{"name":"displacement","id":294,"type":"float","access":"rw"},
{"name":"from_goal_point","id":295,"type":"bool","access":"rw"}],"outputs":[]},
{"name":"start_anticogging_calibration","id":296,"type":"function","inputs":[],"outputs":[]}]},
{"name":"encoder","type":"object","members":[
{"name":"error","id":297,"type":"uint8","access":"rw"},
{"name":"is_ready","id":298,"type":"bool","access":"rw"},
{"name":"index_found","id":299,"type":"bool","access":"rw"},
{"name":"shadow_count","id":300,"type":"int32","access":"rw"},
{"name":"count_in_cpr","id":301,"type":"int32","access":"rw"},
{"name":"interpolation","id":302,"type":"float","access":"rw"},
{"name":"phase","id":303,"type":"float","access":"r"},
{"name":"pos_estimate","id":304,"type":"float","access":"rw"},
{"name":"pos_cpr","id":305,"type":"float","access":"rw"},
{"name":"hall_state","id":306,"type":"uint8","access":"r"},
{"name":"vel_estimate","id":307,"type":"float","access":"rw"},
{"name":"calib_scan_response","id":308,"type":"float","access":"r"},
{"name":"config","type":"object","members":[
{"name":"mode","id":309,"type":"uint8","access":"rw"},
{"name":"use_index","id":310,"type":"bool","access":"rw"},
{"name":"find_idx_on_lockin_only","id":311,"type":"bool","access":"rw"},
{"name":"pre_calibrated","id":312,"type":"bool","access":"rw"},
{"name":"zero_count_on_find_idx","id":313,"type":"bool","access":"rw"},
{"name":"cpr","id":314,"type":"int32","access":"rw"},
{"name":"offset","id":315,"type":"int32","access":"rw"},
{"name":"offset_float","id":316,"type":"float","access":"rw"},
{"name":"enable_phase_interpolation","id":317,"type":"bool","access":"rw"},
{"name":"bandwidth","id":318,"type":"float","access":"rw"},
{"name":"calib_range","id":319,"type":"float","access":"rw"},
{"name":"calib_scan_distance","id":320,"type":"float","access":"rw"},
{"name":"calib_scan_omega","id":321,"type":"float","access":"rw"},
{"name":"idx_search_unidirectional","id":322,"type":"bool","access":"rw"},
{"name":"ignore_illegal_hall_state","id":323,"type":"bool","access":"rw"}]},
{"name":"set_linear_count","id":324,"type":"function","inputs":[
{"name":"count","id":325,"type":"int32","access":"rw"}],"outputs":[]}]},
{"name":"sensorless_estimator","type":"object","members":[
{"name":"error","id":326,"type":"uint8","access":"rw"},
{"name":"phase","id":327,"type":"float","access":"rw"},
{"name":"pll_pos","id":328,"type":"float","access":"rw"},
{"name":"vel_estimate","id":329,"type":"float","access":"rw"},
{"name":"vel_limit","id":333,"type":"float","access":"rw"},
{"name":"decel_limit","id":335,"type":"float","access":"rw"},
{"name":"A_per_css","id":336,"type":"float","access":"rw"}]}]},
{"name":"watchdog_feed","id":337,"type":"function","inputs":[],"outputs":[]}]},
{"name":"can","type":"object","members":[
{"name":"node_id","id":338,"type":"uint8","access":"r"},
{"name":"TxMailboxCompleteCallbackCnt","id":339,"type":"uint32","access":"r"},
{"name":"TxMailboxAbortCallbackCnt","id":340,"type":"uint32","access":"r"},
{"name":"received_msg_cnt","id":341,"type":"uint32","access":"r"},
{"name":"received_ack","id":342,"type":"uint32","access":"r"},
{"name":"unexpected_errors","id":343,"type":"uint32","access":"r"},
{"name":"unhandled_messages","id":344,"type":"uint32","access":"r"}]},
{"name":"test_property","id":345,"type":"uint32","access":"rw"},
{"name":"test_function","id":346,"type":"function","inputs":[
{"name":"delta","id":347,"type":"int32","access":"rw"}],"outputs":[
{"name":"result","id":348,"type":"int32","access":"rw"}]},
{"name":"get_oscilloscope_val","id":349,"type":"function","inputs":[
{"name":"index","id":350,"type":"uint32","access":"rw"}],"outputs":[
{"name":"result","id":351,"type":"float","access":"rw"}]},
{"name":"get_adc_voltage","id":352,"type":"function","inputs":[
{"name":"gpio","id":353,"type":"uint32","access":"rw"}],"outputs":[
{"name":"result","id":354,"type":"float","access":"rw"}]},
{"name":"save_configuration","id":355,"type":"function","inputs":[],"outputs":[]},
{"name":"erase_configuration","id":356,"type":"function","inputs":[],"outputs":[]},
{"name":"reboot","id":357,"type":"function","inputs":[],"outputs":[]},
JSON checksum: 0x59 0x33
malformed member : unsupported codec json
Connected to ODrive 336B31643536 as odrv0

One last aside… If I download the odrive github repo, navigate to the /tools directory, and run “sudo python3 setup.py build” I get the error
error: package directory 'fibre' does not exist
It looks like there is some stuff in setup.py to try to add that directory (from a nearby folder) to the path, but I guess that is failing. If I just copy the fibre directory to the tools directory, I get a different error:
package init file 'fibre/__init__.py' not found (or not a regular file)

So I’m really not sure how to even install this package from source if I want to make changes, since that seems broken.

All in all I’m having a whale of a time. I’ve got 6 Odrives and I just ordered two more. Halp. (:

EDITS: Two things. I just double checked that flashing the latest firmware does not help. It doesn’t. As far as that JSON message when my laptop connects, I just realized that is only shown when I use the -v flag on odrivetool, so maybe that’s perfectly normal.

Same problem here. I also reflashed raspbian on my Pi3, reinstalled ODrive and now I get the exact same errors. I tried to reinstall different Python version, but nothing helps. The ODrive is detected if I run lsusb and I also configured the USB permissions, but odrivetool doesn’t want to connect to it.

Hello.

I still cannot get this to work, and while others took a look on the discord, they weren’t able to identify a problem.

How can I debug this?

Well I did some debugging work today, and I found a way to make it connect. It is a hack though, and I am hoping someone from Odrive can use this information to help root out the bug.

Here’s the details:
I added a bunch of print statements and saw that USB traffic hums along for several seconds running through channel.remote_endpoint_read_buffer(0) in did_discover_channel() in Firmware/fibre/python/fibre/discovery.py, then it throws a ChannelBrokenException. That exception is caught, but discovery fails at that point.

I noticed that the ChannelBrokenException got thrown at the same time as some warning messages about something happening in Firmware/fibre/python/fibre/shell.py.

In the end, I found that if interact() is called (at the end of Firmware/fibre/python/fibre/shell.py) before the USB discovery is complete, then USB discovery will immediately fail.

So the hack, which obviously is not a real solution, is to add a 25 second sleep just before the call to interact().

If I do that, it connects to my odrive every time. If I remove it, it throws an exception when trying to connect and never succeeds.

So my question is, why does the call to interact() mess up USB communications? It’s not clear to me what interact() does. Any help odrive team?

Interesting. I will dig into this. May also be of interest to @Samuel and @madcowswe. Are you using ipython (which has fancy colouring and other features) or “regular” command line?

So I can see that find_all() spawns a thread to search for devices. Perhaps when interact() is called it interrupts or blocks that thread some how?

Instead of a simple time.sleep(25), try

while(len(discovered_devices) < 1):
    pass

or instead of pass, time.sleep(0.1) or similar.

Also, please check what happens if you reboot the ODrive and it tries to reconnect. Hopefully it connects instead of crashing but there’s a chance it fails

Thanks! I see colors, so I suppose that is ipython. pip3 --list also indicates that ipython is installed.

Swapping the sleep for your while loop still works. It seems to take longer with “pass” versus “time.sleep(0.1)”. It does not reconnect after a reboot, unless I exit odrivetool and run it again.

Thanks again for taking a look. Let me know what else I can do to debug.

1 Like