Skip to content

Ubuntu bricking Arduino port. #1030

Open
@hpssjellis

Description

@hpssjellis

Ubuntu bricking Arduino port.

Curious if anyone else has these issues. This is the second ubuntu machine I have had that seems to brick a Portenta, Nicla Vision and now esp32s3 com port.
Works on ubuntu vscode or arduino IDE then does not work on windows either vscode or arduino IDE. Sometimes it then doesn't work on the ubuntu machine.

I think the ubuntu machine is reconfiguring the port which then bricks it on windows. Anyone any suggestions?

@facchinm I really go to stop bricking my Arduinos. I thought this was just a PortentaH7 issue but now I have bricked two Nicla Visions. My latest the esp32S3, does still work on ubuntu both vscode and the arduino IDE but does not work on windows, and I have tested the code on a different esp3s3 and the code and ports work fine.
P.S. This latest one is a seeedstudion XIAO esp32S3 so not an Arduino issues, but the solution might be useful.

I tried a chatGPT solution but it did nothing useful.

resetports.sh bash file for ubuntu


#!/bin/bash

echo "Identifying USB serial devices..."
USB_DEVICES=$(ls /dev/ttyUSB* /dev/ttyACM* 2>/dev/null)

if [ -z "$USB_DEVICES" ]; then
    echo "No USB serial devices found."
else
    for myPort in $USB_DEVICES; do
        echo "Releasing $myPort..."
        sudo fuser -k $myPort 2>/dev/null
    done
fi

echo "Stopping ModemManager (if installed)..."
sudo systemctl stop ModemManager 2>/dev/null
sudo systemctl disable ModemManager 2>/dev/null

echo "Resetting USB hubs..."
for myUSB in $(ls /sys/bus/usb/drivers/usb/*/unbind); do
    echo "Unbinding: $myUSB"
    echo "${myUSB##*/}" | sudo tee /sys/bus/usb/drivers/usb/unbind
    sleep 1
    echo "Rebinding: $myUSB"
    echo "${myUSB##*/}" | sudo tee /sys/bus/usb/drivers/usb/bind
done

echo "Power cycling USB ports (turning off and back on)..."
echo '1' | sudo tee /sys/bus/usb/devices/usb1/remove
sleep 3
echo '1' | sudo tee /sys/bus/usb/devices/usb1/add

echo "USB reset complete. Safe to reboot into Windows."


anyone got any other suggestions. By the way the above code kills your mouse so make sure your shutdown the ubuntu with

sudo shutdown -r now

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions