arduino / arduino/ArduinoCore-mbed

Ubuntu bricking Arduino port.

Open
#1,030 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
411
Forks
225
PR merge metrics
No merged PRs in 30d

Description

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
```

Contributor guide

No contributing guide indexed for this repository

Research direction

No project file or test is identified; begin by reproducing the USB serial failure across Ubuntu and Windows with the Portenta, Nicla Vision, or ESP32S3 devices. Review the supplied resetports.sh script and the interactions with ModemManager and USB serial devices, then document a reproducible cause and safe recovery steps.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, ubuntu
Domain
embedded-iot, operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
18/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.