|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Setup script for Ubuntu development environment |
| 4 | + |
| 5 | +set -e |
| 6 | + |
| 7 | +echo "Setting up development environment..." |
| 8 | + |
| 9 | +# Update package lists |
| 10 | +sudo apt-get update |
| 11 | + |
| 12 | +# Install essential development tools |
| 13 | +sudo apt-get install -y \ |
| 14 | + build-essential \ |
| 15 | + git \ |
| 16 | + curl \ |
| 17 | + wget \ |
| 18 | + unzip \ |
| 19 | + software-properties-common \ |
| 20 | + udev \ |
| 21 | + python3-pip \ |
| 22 | + python3-venv \ |
| 23 | + pkg-config \ |
| 24 | + libusb-1.0-0-dev \ |
| 25 | + libudev-dev |
| 26 | + |
| 27 | +# Install PlatformIO |
| 28 | +echo "Installing PlatformIO..." |
| 29 | +python3 -m pip install --upgrade pip |
| 30 | +python3 -m pip install --upgrade platformio |
| 31 | + |
| 32 | +# Add PlatformIO to PATH |
| 33 | +echo 'export PATH=$PATH:~/.local/bin' >> ~/.bashrc |
| 34 | + |
| 35 | +# Install PlatformIO udev rules for device access |
| 36 | +echo "Setting up udev rules for device access..." |
| 37 | +curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/system/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules |
| 38 | +sudo service udev restart |
| 39 | +sudo usermod -a -G dialout $USER |
| 40 | +sudo usermod -a -G plugdev $USER |
| 41 | + |
| 42 | +# Create a symlink for common Arduino libraries location |
| 43 | +mkdir -p ~/Arduino/libraries |
| 44 | + |
| 45 | +# Install additional Python packages that might be useful |
| 46 | +python3 -m pip install --upgrade \ |
| 47 | + esptool \ |
| 48 | + adafruit-ampy \ |
| 49 | + pyserial |
| 50 | + |
| 51 | +# Install Gemini CLI |
| 52 | +echo "Installing Gemini CLI..." |
| 53 | +curl -sS https://storage.googleapis.com/gemini-cli/install.sh | bash |
| 54 | + |
| 55 | +# Set up Git configuration (if not already configured) |
| 56 | +if [ -z "$(git config --global user.name)" ]; then |
| 57 | + echo "Git user name not configured. You may want to run:" |
| 58 | + echo "git config --global user.name 'Your Name'" |
| 59 | + echo "git config --global user.email 'your.email@example.com'" |
| 60 | +fi |
| 61 | + |
| 62 | +echo "✅ Development environment setup complete!" |
| 63 | +echo "" |
| 64 | +echo "🚀 You can now:" |
| 65 | +echo " - Use 'pio' commands for PlatformIO operations" |
| 66 | +echo " - Use 'node' and 'npm' for JavaScript/TypeScript development" |
| 67 | +echo " - Develop Arduino/ESP32 projects with IntelliSense" |
| 68 | +echo "" |
| 69 | +echo "📋 Next steps:" |
| 70 | +echo " 1. Run 'pio run' to build the project" |
| 71 | +echo " 2. Run 'pio device list' to see connected devices" |
| 72 | +echo " 3. Use 'pio run --target upload' to flash firmware" |
| 73 | +echo "" |
| 74 | +echo "🔧 Hardware debugging:" |
| 75 | +echo " - USB devices are mounted with --privileged access" |
| 76 | +echo " - Serial ports should be accessible in /dev/" |
0 commit comments