-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Linux post install script #1
base: master
Are you sure you want to change the base?
Added Linux post install script #1
Conversation
The suggested udev rules are not recommended. Do not use |
arduino_esp32_rules () { | ||
echo "" | ||
echo "# Arduino ESP32 bootloader mode udev rules" | ||
echo "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a particularly weird mixture of echo and "here" documents. Simply use one "here" document.
# reload udev rules | ||
echo "Reload rules..." | ||
udevadm trigger | ||
udevadm control --reload-rules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing EOL on last line. Using a proper text editor avoids this. Unix text files should have a line terminator on every line, including the last line.
I have successfully implemented the suggested changes (uaccess, EOL, single here doc) and confirmed the script's functionality. As this is my first Arduino project, troubleshooting this issue was particularly challenging due to the increased complexity for beginners. I believe integrating the script would significantly enhance the Arduino setup experience and improve usability for all users. #!/usr/bin/env bash
# This script creates a udev rule for the Arduino ESP32 bootloader mode
# allowing access without root privileges.
arduino_esp32_rules() {
echo "# Arduino ESP32 bootloader mode udev rules"
cat <<EOF # Use a here document for clean formatting
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0070", TAG+="uaccess"
EOF
}
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit
fi
arduino_esp32_rules > /etc/udev/rules.d/60-arduino-esp32.rules
# Reload udev rules
echo "Reload rules..."
udevadm trigger
udevadm control --reload-rules |
There is so much cargo-cult in these scripts, and I don't know where it is started (arduino mbed?). This is simpler and better IMNSHO:
|
Well, I just modified the original script to reflect the comments. |
Hi, thanks to this script I was able to successfully configure my Nano ESP32 on Linux. Unfortunately I'm not an expert in I think it would be beneficial for other users if this PR got merged. |
Added a simple Linux post install script.
This script is useful to set the right UDEV rules in order to deploy/upload the code to Arduino Nano ESP32 from a standard Linux user