RPI 4B USB communication issue

I try to use usb connect odrive, but odrive always disappear after sometime.
and python just tell me [ ‘RemoteObject’ object has no attribute ‘axis0’]
like what happend in (Usb communication issue / AttributeError: 'RemoteObject' object has no attribute 'axis0')
I think my usb line is short enough(20cm).
and some times I found my raspberrypi can’t start up with red power light on, when connected 3 odrive by usb. after I unplug two usb, it start up normally.(or power RPI first)
I changed a raspberry pi the issue seems gone.

I don’t know how to make the connection heathy?
this is the dmesg report:
[ 3.966417] cdc_acm 1-1.1:1.0: ttyACM0: USB ACM device
[ 3.972963] cdc_acm 1-1.2:1.0: ttyACM1: USB ACM device
[ 3.978430] cdc_acm 1-1.3:1.0: ttyACM2: USB ACM device
[ 3.980218] usbcore: registered new interface driver cdc_acm
[ 3.980229] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 3.988401] cfg80211: Loaded X.509 cert ‘sforshee: 00b28ddf47aef9cea7’
[ 4.100858] brcmfmac: F1 signature read @0x18000000=0x15264345
[ 4.112830] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 4.113722] usbcore: registered new interface driver brcmfmac
[ 4.365427] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 4.404732] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Mar 2 2020 23:30:41 version 7.45.202 (r724630 CY) FWID 01-72f6ece2
[ 6.368877] uart-pl011 fe201000.serial: no DMA platform data
[ 6.379934] 8021q: 802.1Q VLAN Support v1.8
[ 6.394758] random: crng init done
[ 6.394773] random: 7 urandom warning(s) missed due to ratelimiting
[ 6.662866] Adding 102396k swap on /var/swap. Priority:-2 extents:1 across:102396k SSFS
[ 6.808403] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 6.808417] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled
[ 7.113352] bcmgenet: Skipping UMAC reset
[ 7.208006] bcmgenet fd580000.genet: configuring instance for external RGMII (no delay)
[ 7.208177] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 8.247968] bcmgenet fd580000.genet eth0: Link is Down
[ 10.040350] fuse init (API version 7.27)
[ 12.768730] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 13.092637] Bluetooth: Core ver 2.22
[ 13.092711] NET: Registered protocol family 31
[ 13.092719] Bluetooth: HCI device and connection manager initialized
[ 13.092738] Bluetooth: HCI socket layer initialized
[ 13.092750] Bluetooth: L2CAP socket layer initialized
[ 13.092786] Bluetooth: SCO socket layer initialized
[ 13.106454] Bluetooth: HCI UART driver ver 2.3
[ 13.106465] Bluetooth: HCI UART protocol H4 registered
[ 13.106532] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 13.106728] Bluetooth: HCI UART protocol Broadcom registered
[ 13.384616] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 13.384641] Bluetooth: BNEP filters: protocol multicast
[ 13.384671] Bluetooth: BNEP socket layer initialized
[ 13.447421] Bluetooth: RFCOMM TTY layer initialized
[ 13.447442] Bluetooth: RFCOMM socket layer initialized
[ 13.447460] Bluetooth: RFCOMM ver 1.11
[ 14.796834] ICMPv6: process `dhcpcd’ is using deprecated sysctl (syscall) net.ipv6.neigh.wlan0.retrans_time - use net.ipv6.neigh.wlan0.retrans_time_ms instead
[ 181.647178] usb 1-1.2: reset full-speed USB device number 4 using xhci_hcd
[ 181.784930] cdc_acm 1-1.2:1.0: ttyACM1: USB ACM device
[ 181.877107] usb 1-1.3: reset full-speed USB device number 5 using xhci_hcd
[ 182.017055] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 182.107985] usb 1-1.1: reset full-speed USB device number 3 using xhci_hcd
[ 182.244690] cdc_acm 1-1.1:1.0: ttyACM2: USB ACM device
[ 268.283097] usb 1-1.3: reset full-speed USB device number 5 using xhci_hcd
[ 268.422521] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 268.523178] usb 1-1.2: reset full-speed USB device number 4 using xhci_hcd
[ 268.662555] cdc_acm 1-1.2:1.0: ttyACM1: USB ACM device
[ 268.753920] usb 1-1.1: reset full-speed USB device number 3 using xhci_hcd
[ 268.891046] cdc_acm 1-1.1:1.0: ttyACM2: USB ACM device
[ 406.779104] usb 1-1.3: reset full-speed USB device number 5 using xhci_hcd
[ 406.928597] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 407.019189] usb 1-1.1: reset full-speed USB device number 3 using xhci_hcd
[ 407.156487] cdc_acm 1-1.1:1.0: ttyACM2: USB ACM device
[ 518.701779] usb 1-1.3: reset full-speed USB device number 5 using xhci_hcd
[ 518.840313] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 519.002813] usb 1-1.1: reset full-speed USB device number 3 using xhci_hcd
[ 519.149158] cdc_acm 1-1.1:1.0: ttyACM2: USB ACM device
[ 876.300922] usb 1-1.2: USB disconnect, device number 4
[ 894.519464] usb 1-1.2: new full-speed USB device number 6 using xhci_hcd
[ 894.659093] usb 1-1.2: New USB device found, idVendor=1209, idProduct=0d32, bcdDevice= 3.00
[ 894.659146] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 894.659172] usb 1-1.2: Product: ODrive 3.6 CDC Interface
[ 894.659199] usb 1-1.2: Manufacturer: ODrive Robotics
[ 894.659209] usb 1-1.2: SerialNumber: 208E368A5550
[ 894.674071] cdc_acm 1-1.2:1.0: ttyACM1: USB ACM device
[ 936.587322] usb 1-1.3: reset full-speed USB device number 5 using xhci_hcd
[ 936.726445] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 936.817186] usb 1-1.1: reset full-speed USB device number 3 using xhci_hcd
[ 936.954468] cdc_acm 1-1.1:1.0: ttyACM1: USB ACM device
[ 937.047044] usb 1-1.2: reset full-speed USB device number 6 using xhci_hcd
[ 937.186503] cdc_acm 1-1.2:1.0: ttyACM2: USB ACM device
[ 1201.508458] usb 1-1.3: reset full-speed USB device number 5 using xhci_hcd
[ 1201.648163] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1214.039101] usb 1-1.2: reset full-speed USB device number 6 using xhci_hcd
[ 1214.175663] cdc_acm 1-1.2:1.0: ttyACM2: USB ACM device
[ 1228.367934] usb 1-1.1: reset full-speed USB device number 3 using xhci_hcd
[ 1228.507417] cdc_acm 1-1.1:1.0: ttyACM1: USB ACM device
[ 1535.805468] usb 1-1.3: reset full-speed USB device number 5 using xhci_hcd
[ 1535.943369] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1536.045771] usb 1-1.1: reset full-speed USB device number 3 using xhci_hcd
[ 1536.183932] cdc_acm 1-1.1:1.0: ttyACM1: USB ACM device
[ 1536.275349] usb 1-1.2: reset full-speed USB device number 6 using xhci_hcd
[ 1536.411842] cdc_acm 1-1.2:1.0: ttyACM2: USB ACM device
[ 1724.782406] usb 1-1.1: reset full-speed USB device number 3 using xhci_hcd
[ 1724.929861] cdc_acm 1-1.1:1.0: ttyACM0: USB ACM device
[ 1725.022497] usb 1-1.3: reset full-speed USB device number 5 using xhci_hcd
[ 1725.161520] cdc_acm 1-1.3:1.0: ttyACM1: USB ACM device
[ 1762.642210] usb 1-1.3: reset full-speed USB device number 5 using xhci_hcd
[ 1762.791306] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1762.882710] usb 1-1.1: reset full-speed USB device number 3 using xhci_hcd
[ 1763.019125] cdc_acm 1-1.1:1.0: ttyACM1: USB ACM device
[ 1942.909561] usb 1-1.3: reset full-speed USB device number 5 using xhci_hcd
[ 1943.056963] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1943.058333] usb 1-1.3: usbfs: process 1703 (Client.py) did not claim interface 2 before use
[ 1943.209566] usb 1-1.3: reset full-speed USB device number 5 using xhci_hcd
[ 1943.348860] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1943.449484] usb 1-1.3: reset full-speed USB device number 5 using xhci_hcd
[ 1943.589163] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1955.899300] usb 1-1.2: reset full-speed USB device number 6 using xhci_hcd
[ 1955.999122] usb 1-1.2: device descriptor read/64, error -32
[ 1956.219126] usb 1-1.2: device descriptor read/64, error -32
[ 1956.439164] usb 1-1.2: reset full-speed USB device number 6 using xhci_hcd
[ 1956.539155] usb 1-1.2: device descriptor read/64, error -32
[ 1956.759818] usb 1-1.2: device descriptor read/64, error -32
[ 1956.979155] usb 1-1.2: reset full-speed USB device number 6 using xhci_hcd
[ 1956.979377] usb 1-1.2: Device not responding to setup address.
[ 1957.199868] usb 1-1.2: Device not responding to setup address.
[ 1957.418934] usb 1-1.2: device not accepting address 6, error -71
[ 1957.518942] usb 1-1.2: reset full-speed USB device number 6 using xhci_hcd
[ 1957.519144] usb 1-1.2: Device not responding to setup address.
[ 1957.739297] usb 1-1.2: Device not responding to setup address.
[ 1957.958937] usb 1-1.2: device not accepting address 6, error -71
[ 1957.963522] usb 1-1.2: USB disconnect, device number 6
[ 1958.059395] usb 1-1.1: reset full-speed USB device number 3 using xhci_hcd
[ 1958.199128] cdc_acm 1-1.1:1.0: ttyACM1: USB ACM device
[ 1958.202402] usb 1-1.1: usbfs: process 1703 (Client.py) did not claim interface 2 before use
[ 1958.289198] usb 1-1.2: new full-speed USB device number 7 using xhci_hcd
[ 1958.399089] usb 1-1.2: device descriptor read/64, error -32
[ 1958.619071] usb 1-1.2: device descriptor read/64, error -32
[ 1958.839560] usb 1-1.1: reset full-speed USB device number 3 using xhci_hcd
[ 1958.978701] cdc_acm 1-1.1:1.0: ttyACM1: USB ACM device
[ 1959.069003] usb 1-1.2: new full-speed USB device number 8 using xhci_hcd
[ 1959.169507] usb 1-1.2: device descriptor read/64, error -32
[ 1959.389119] usb 1-1.2: device descriptor read/64, error -32
[ 1959.509125] usb 1-1-port2: attempt power cycle
[ 1959.609464] usb 1-1.1: reset full-speed USB device number 3 using xhci_hcd
[ 1959.746993] cdc_acm 1-1.1:1.0: ttyACM1: USB ACM device
[ 1960.168959] usb 1-1.2: new full-speed USB device number 9 using xhci_hcd
[ 1960.169158] usb 1-1.2: Device not responding to setup address.
[ 1960.389036] usb 1-1.2: Device not responding to setup address.
[ 1960.608896] usb 1-1.2: device not accepting address 9, error -71
[ 1960.708912] usb 1-1.2: new full-speed USB device number 10 using xhci_hcd
[ 1960.709118] usb 1-1.2: Device not responding to setup address.
[ 1960.929103] usb 1-1.2: Device not responding to setup address.
[ 1961.149030] usb 1-1.2: device not accepting address 10, error -71
[ 1961.149508] usb 1-1-port2: unable to enumerate USB device
[ 3123.246761] usb 1-1.1: reset full-speed USB device number 3 using xhci_hcd
[ 3123.384036] cdc_acm 1-1.1:1.0: ttyACM0: USB ACM device
[ 3123.476846] usb 1-1.3: reset full-speed USB device number 5 using xhci_hcd
[ 3123.614217] cdc_acm 1-1.3:1.0: ttyACM1: USB ACM device
[ 3135.149080] usb 1-1.3: reset full-speed USB device number 5 using xhci_hcd
[ 3135.286219] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 3135.386769] usb 1-1.1: reset full-speed USB device number 3 using xhci_hcd
[ 3140.576935] usb 1-1.1: device descriptor read/all, error -110
[ 3140.677089] usb 1-1.1: reset full-speed USB device number 3 using xhci_hcd
[ 3140.814438] cdc_acm 1-1.1:1.0: ttyACM1: USB ACM device
[ 3217.286863] usb 1-1.1: reset full-speed USB device number 3 using xhci_hcd
[ 3217.426514] cdc_acm 1-1.1:1.0: ttyACM0: USB ACM device
[ 3217.517890] usb 1-1.3: reset full-speed USB device number 5 using xhci_hcd
[ 3217.664246] cdc_acm 1-1.3:1.0: ttyACM1: USB ACM device

i find another issue that i can’t change the motor’s calibration current, I’m not sure that there are relationship with usb
In [3]: odrv1.axis1.motor.current_control.Iq_measured
Out[3]: 0.5566006898880005

In [4]: odrv1.axis1.motor.current_control.Iq_measured
Out[4]: 0.5566006898880005

In [5]: odrv1.axis1.motor.config.calibration_current
Out[5]: 8.0

In [6]: odrv1.axis1.motor.config
Out[6]: 
pre_calibrated = False (bool)
pole_pairs = 4 (int)
calibration_current = 8.0 (float)
resistance_calib_max_voltage = 2.0 (float)
phase_inductance = 0.0002368521090829745 (float)
phase_resistance = 0.09797680377960205 (float)
direction = -1 (int)
motor_type = 0 (int)
current_lim = 17.0 (float)
current_lim_tolerance = 1.25 (float)
inverter_temp_limit_lower = 100.0 (float)
inverter_temp_limit_upper = 120.0 (float)
requested_current_range = 10.0 (float)
current_control_bandwidth = 1000.0 (float)

In [7]: odrv1.axis1.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE

In [8]: odrv1.axis1.motor.current_control.Iq_measured
Out[8]: 0.5566006898880005

In [9]: odrv1.axis1.motor.current_control.Iq_measured
Out[9]: 0.5566006898880005

In [10]: odrv1.axis1.motor.current_control.Iq_measured
Out[10]: 0.5566006898880005

In [11]: odrv1.axis1.motor.current_control.Iq_measured
Out[11]: 0.5566006898880005

In [12]: odrv1.axis1.motor.current_control.Iq_measured
Out[12]: 0.5566006898880005

In [13]: odrv1.axis1.motor.current_control.Iq_measured
Out[13]: -4.5852837562561035

In [14]: odrv1.axis1.motor.current_control.Iq_measured
Out[14]: -9.957959175109863

In [15]: odrv1.axis1.motor.current_control.Iq_measured
Out[15]: -9.957959175109863

In [16]: odrv1.axis1.motor.current_control.Iq_measured
Out[16]: -9.957959175109863

In [17]: odrv1.axis1.motor.current_control.Iq_measured
Out[17]: -9.957959175109863

In [18]: odrv1.axis1.motor.current_control.Iq_measured
Out[18]: -9.957959175109863

Is that an 8-axis system you’ve got going there?

It may be that there’s too much noise in that box for the USB to work properly. Could be a ground loop between RPI and ODrive.

If I were you, I’d get a CAN interface for the RPI, and use CAN for your control (keep the USB connected for diagnostics, but don’t rely on it for control)

Make sure you’re using sudo also

sudo is not going to help here… That’s a low-level USB error caused by noise, usually a bad USB cable or a ground loop.

Thanks for your reply. It’s a 5-axis system. I used to try canbus in 500Hz, but it doesn’t work after a few time. someone said that linux are not worked well with can. Did you meet the same problem? Or what I can do to reduce the noise.

That’s rubbish. Windows are not worked well with CAN. :joy:
Things like the PiCan 3 (just a MCP2551 chip) work perfectly on the Raspberry Pi.
I’ve never had a failure on CAN even with dodgy wiring.

1 Like

My raspberrypi can’t boot when linked with more than odrive(use usb)
the power led keeps light and act led not light. the voltage between gpio 5V and GND was 5.012V, but just 100+mV between 3.3V and GND
Once I pull the usb, the RPI boot normaly from only red light and act led began to flash.
Then the gpio 3.3V was back to normal, and then I plug back the usb odrive device, it worked well.

I use a 48V 1500W power and a DC-DC transformer to power the raspberrypi and motor controller. My mac shows one odrive device need 100mA on usb.

I don’t know what’s wrong with it and how can I deal with it, because it’s hard for me to power RPI first.

I’m tired on the unreliable usb and wanna try uart on my project, and I found a doc about ascii protocol.


is there any example for me to learn?

Probably too much instantaneous current on the USB power rail. Power the +5V of the ODrive from something else (whatever is powering the Raspberry Pi)

I had used usb hub to link odrive. my raspberrypi boot successfully, but just one or two odrive was found in dmesg.
My usb link worked well after I bought a usb isolator.
my raspberrypi now can boot normally and none of odrives are lost connection.
the isolator can connect extra power, but I did not do this. It also works well.
maybe there are some wrong on usb when the odrive just in idle state.