Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .github/FUNDING.yml
100644 → 100755
Empty file.
14 changes: 13 additions & 1 deletion OpenOrangeStorm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ advanced_more() {
echo -e "6) Base ZNP-K1 Compiled Image Config (NOT for OpenOrangeStorm)"
echo ""
echo -e "7) Change Machine Model / Board Version / Motor Current"
echo ""
echo -e "8) Probe Timeout Fix (Only for Orange Storm Giga)"
echo -e "----------------------------------------------------------${NC}"
echo ""
echo -e "(${Y} B ${NC}) Back to Main Menu"
Expand All @@ -259,6 +261,7 @@ advanced_more() {
5) toggle_branch;;
6) base_image_config;;
7) $HOME/OpenOrangeStorm/img-config/set-printer-model.sh; exit 0;;
8) probe_timeout_fix;;
b) return;; # Return to the main menu
*) echo -e "${R}Invalid choice, please try again.${NC}";;
esac
Expand Down Expand Up @@ -663,6 +666,13 @@ install_configs() {
fi
}

probe_timeout_fix() {
sed -i "s|TRSYNC_TIMEOUT = 0.025|TRSYNC_TIMEOUT = 0.050|g" ~/klipper/klippy/mcu.py

echo "Successfully fixed the timeout issue!"
sleep 2
}

wifi_config() {
sudo nmtui
}
Expand Down Expand Up @@ -733,6 +743,7 @@ Commands:
crowsnest_fix Install webcam FPS fix.
base_image_config Apply base configuration for ZNP-K1 Compiled Image (Not for release images).
armbian_resize Resize the active Armbian partition (for eMMC > 8GB).
probe_timeout_fix Fixes the probe timeout error (Only for the Orange Storm Giga)

EOF
}
Expand Down Expand Up @@ -785,7 +796,7 @@ done

# Main Script Logic
if [ -z "$1" ]; then
run_fixes
run_fixes
set_current_branch
update_repo

Expand Down Expand Up @@ -821,6 +832,7 @@ else
crowsnest_fix) crowsnest_fix ;;
base_image_config) base_image_config ;;
armbian_resize) armbian_resize ;;
probe_timeout_fix) probe_timeout_fix ;;
*) echo -e "${G}Invalid command. Please try again.${NC}" ;;
esac
fi
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified dtb/giga/giga-v3.0-dts-newer.txt
100644 → 100755
Empty file.
Empty file modified dtb/giga/giga-v3.0-dts.txt
100644 → 100755
Empty file.
Empty file modified dtb/giga/rk3328-roc-cc-newer.dtb
100644 → 100755
Empty file.
Empty file modified dtb/giga/rk3328-roc-cc.dtb
100644 → 100755
Empty file.
Empty file modified img-config/printer-data/KAMP_Settings.cfg
100644 → 100755
Empty file.
Empty file modified img-config/printer-data/data.mdb
100644 → 100755
Empty file.
Empty file modified img-config/printer-data/klipper_debug.cfg
100644 → 100755
Empty file.
Empty file modified img-config/printer-data/mainsail.cfg
100644 → 100755
Empty file.
Empty file modified img-config/printer-data/moonraker.conf
100644 → 100755
Empty file.
207 changes: 154 additions & 53 deletions img-config/rpi-mcu-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ if [[ -z $1 ]]; then
echo ""
echo "Choose the MCU(s) to update:"
echo ""
select mcu_choice in "STM32" "Virtual RPi" "Pico-based USB Accelerometer" "All" "Cancel"; do
select mcu_choice in "STM32" "RP2040" "Virtual RPi" "Pico-based USB Accelerometer" "All" "Cancel"; do
case $mcu_choice in
STM32 ) echo "Updating STM32 MCU..."; break;;
Virtual\ RPi ) echo "Updating Virtual RPi MCU..."; break;;
RP2040) echo "Updating RP2040 (printhead) MCU..."; break;;
Virtual\ RPi ) echo "Updating Virtual RPi MCU..."; break;;
Pico-based\ USB\ Accelerometer ) echo "Updating Pico-based USB Accelerometer..."; break;;
All ) echo "Starting update process for STM32, Virtual RPi MCU and Pico USB Accelerometer"; break;;
All ) echo "Starting update process for STM32, RP2040, Virtual RPi MCU and Pico USB Accelerometer"; break;;
Cancel ) echo "Update canceled."; exit;;
esac
done
Expand All @@ -22,70 +23,170 @@ else
mcu_choice=$1
fi

# Installing Katapult
cd ~/
git clone https://github.com/Arksine/katapult

# Update Klipper repository
cd ~/klipper/ && git pull origin master

# Install python serial tools
sudo apt install python3-serial

# Update procedure for STM32 MCU
if [[ "$mcu_choice" == "STM32" ]] || [[ "$mcu_choice" == "All" ]]; then
clear
echo "Proceeding with STM32 MCU Update..."
make clean
cp ~/OpenOrangeStorm/mcu-firmware/mcu.config ~/klipper/.config
make


auto_updater() {
echo "Trying to put the STM32 into bootloader mode..."

#Trying to get the MCU unbound
echo M112 > ~/printer_data/comms/klippy.serial
sleep 1
echo FIRMWARE_RESTART > ~/printer_data/comms/klippy.serial
sleep 1
systemctl stop klipper

echo "Checking if succeeded..."
output=$(cd ~/katapult/scripts && python3 flash_can.py -i can0 -q)

# Display the output to the user
echo "$output"

# Prompt the user to input a UUID
read -p "Please enter the UUID that is the STM32 (usually the first one): " uuid

# Confirm the selected UUID
echo "You selected the UUID: $uuid"

python3 ~/katapult/scripts/flash_can.py -i can0 -u $uuid -f ~/klipper/out/klipper.bin

return
}


# Check if the MCU boots using the alternative method
if grep -q "/usr/local/bin/gpio_set.sh" "/etc/rc.local"; then
echo "Detected MCU running the Alternative method! Running headless flash..."
if [ -f "$MCU_SWFLASH_ALT" ]; then
"$MCU_SWFLASH_ALT"
else
echo "Error: Alternate MCU flash script not found."
fi
else
# Regular update through microSD card
# Create the 'Firmware' directory if it doesn't exist
mkdir -p ~/printer_data/config/Firmware
manual_update() {

# Regular update through microSD card
# Create the 'Firmware' directory if it doesn't exist
mkdir -p ~/printer_data/config/Firmware

# Remove old files in previous parent directory
rm ~/printer_data/config/X_4.bin > /dev/null 2>&1
rm ~/printer_data/config/elegoo_k1.bin > /dev/null 2>&1
rm ~/printer_data/config/ZNP_GIGA.bin > /dev/null 2>&1

cp ~/klipper/out/klipper.bin ~/printer_data/config/Firmware/ZNP_GIGA.bin

clear
# Display instructions for downloading the firmware
ip_address=$(hostname -I | awk '{print $1}')
echo ""
echo -e "\nTo download firmware files:"
echo "1. Visit: http://$ip_address/#/configure"
echo "2. Click the Firmware folder in the left Config list"
echo "3. Right-click and Download 'ZNP_GIGA.bin'"
echo " Then copy to a FAT32 formatted microSD card."
echo ""
echo -e "\nTo complete the update:"
echo "1. After this script completes, power off the printer"
echo " Then insert the microSD card."
echo "2. Power on, and check the MCU version in Fluidd's system tab."
echo "3. The '.bin' file on the microSD will be renamed to..."
echo " '.CUR' if the update was successful."
echo ""
echo -e "\nFor printers without external microSD slots:"
echo -e "Visit the OpenOrangeStorm wiki for info (if not already done)\n"
echo -e "https://github.com/OpenNeptune3D/OpenOrangeStorm/wiki"
echo ""
echo -e "\nHave you downloaded the bin files and are ready to continue? (y)"
read continue_choice
if [[ "$continue_choice" =~ ^[Yy]$ ]]; then
echo ""
if [[ "$mcu_choice" == "STM32" ]]; then
echo "Power-off the machine and insert the microSD card."
sleep 4
# Exit only if the selected choice was specifically STM32, not "All"
exit
fi
fi
}

# Remove old files in previous parent directory
rm ~/printer_data/config/X_4.bin > /dev/null 2>&1
rm ~/printer_data/config/elegoo_k1.bin > /dev/null 2>&1
rm ~/printer_data/config/ZNP_GIGA.bin > /dev/null 2>&1
if auto_updater; then
echo "Auto update for the STM32 was a success!!"
echo ""
echo "continuing..."
echo ""
echo "If you plan on updateing the printhead MCU as well after this, restart the board!"
sleep 4
else
echo "Auto update didn't work..."
echo ""
echo "Trying the SD-card method..."
sleep 2
manual_update
fi
fi

cp ~/klipper/out/klipper.bin ~/printer_data/config/Firmware/ZNP_GIGA.bin
if [[ "$mcu_choice" == "RP2040" ]] || [[ "$mcu_choice" == "All" ]]; then
clear
echo "Proceeding with RP2040 (printhead) MCU Update..."
make clean
cp ~/OpenOrangeStorm/mcu-firmware/printhead.config ~/klipper/.config
make


auto_updater() {
echo "Trying to put the RP2040 into bootloader mode..."

echo M112 > ~/printer_data/comms/klippy.serial
sleep 1
echo FIRMWARE_RESTART > ~/printer_data/comms/klippy.serial
sleep 1
sudo systemctl stop klipper

echo "Checking if succeeded..."
output=$(cd ~/katapult/scripts && python3 flash_can.py -i can0 -q)

# Display the output to the user
echo "$output"

# Prompt the user to input a UUID
read -p "Please enter the UUID that is the RP2040 (usually the second one): " uuid

# Confirm the selected UUID
echo "You selected the UUID: $uuid"

python3 ~/katapult/scripts/flash_can.py -i can0 -u $uuid -f ~/klipper/out/klipper.bin

return
}


clear
# Display instructions for downloading the firmware
ip_address=$(hostname -I | awk '{print $1}')
echo ""
echo -e "\nTo download firmware files:"
echo "1. Visit: http://$ip_address/#/configure"
echo "2. Click the Firmware folder in the left Config list"
echo "3. Right-click and Download 'ZNP_GIGA.bin'"
echo " Then copy to a FAT32 formatted microSD card."
echo ""
echo -e "\nTo complete the update:"
echo "1. After this script completes, power off the printer"
echo " Then insert the microSD card."
echo "2. Power on, and check the MCU version in Fluidd's system tab."
echo "3. The '.bin' file on the microSD will be renamed to..."
echo " '.CUR' if the update was successful."
echo ""
echo -e "\nFor printers without external microSD slots:"
echo -e "Visit the OpenOrangeStorm wiki for info (if not already done)\n"
echo -e "https://github.com/OpenNeptune3D/OpenOrangeStorm/wiki"
echo ""
echo -e "\nHave you downloaded the bin files and are ready to continue? (y)"
read continue_choice
if [[ "$continue_choice" =~ ^[Yy]$ ]]; then
echo ""
if [[ "$mcu_choice" == "STM32" ]]; then
echo "Power-off the machine and insert the microSD card."
sleep 4
# Exit only if the selected choice was specifically STM32, not "All"
exit
fi
fi
fi
if auto_updater; then
echo "Auto update for the RP2040 was a success!!"
echo ""
sleep 2
else
cp ~/klipper/out/klipper.bin ~/printer_data/config/Firmware/RP2040.bin
echo "Something didn't go as planned..."
echo "Either retry, or put the firmware on manually"
echo "Read the documentation how to do that!"
echo "We've copied the firmware into ~/printer_data/config/Firmware/RP2040.bin"

seconds=20

while [ $seconds -ge 0 ]; do
echo -ne "$seconds... "
sleep 1
seconds=$((seconds - 1))
done
fi
fi

# Update procedure for Pico-based Accelerometer
Expand Down
Empty file modified mcu-firmware/ElegooSD-restore.bin
100644 → 100755
Empty file.
Empty file modified mcu-firmware/firmware_backup_new.bin
100644 → 100755
Empty file.
57 changes: 42 additions & 15 deletions mcu-firmware/mcu.config
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG_LOW_LEVEL_OPTIONS=y
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_RPXXXX is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
Expand Down Expand Up @@ -49,7 +49,7 @@ CONFIG_MACH_STM32F4x5=y
CONFIG_HAVE_STM32_USBOTG=y
CONFIG_HAVE_STM32_CANBUS=y
CONFIG_HAVE_STM32_USBCANBUS=y
CONFIG_STM32_DFU_ROM_ADDRESS=0
CONFIG_STM32_DFU_ROM_ADDRESS=0x1fff0000
CONFIG_STM32_FLASH_START_8000=y
# CONFIG_STM32_FLASH_START_20200 is not set
# CONFIG_STM32_FLASH_START_C000 is not set
Expand All @@ -74,30 +74,59 @@ CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
CONFIG_STM32_MMENU_CANBUS_PB8_PB9=y
# CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set
# CONFIG_STM32_MMENU_CANBUS_PI9_PH13 is not set
# CONFIG_STM32_MMENU_CANBUS_PB5_PB6 is not set
# CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set
# CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set
# CONFIG_STM32_USBCANBUS_PA11_PA12 is not set
CONFIG_STM32_CANBUS_PB8_PB9=y
CONFIG_STM32_USBCANBUS_PA11_PA12=y
# CONFIG_STM32_CMENU_CANBUS_PB8_PB9 is not set
# CONFIG_STM32_CMENU_CANBUS_PI9_PH13 is not set
# CONFIG_STM32_CMENU_CANBUS_PB5_PB6 is not set
CONFIG_STM32_CMENU_CANBUS_PB12_PB13=y
# CONFIG_STM32_CMENU_CANBUS_PD0_PD1 is not set
CONFIG_STM32_CANBUS_PB12_PB13=y
CONFIG_USBCANBUS=y
CONFIG_USB=y
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER_CHIPID=y
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y

#
# USB ids
#
# end of USB ids

CONFIG_WANT_ADC=y
CONFIG_WANT_SPI=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_WANT_I2C=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_HARD_PWM=y
CONFIG_WANT_BUTTONS=y
CONFIG_WANT_TMCUART=y
CONFIG_WANT_NEOPIXEL=y
CONFIG_WANT_PULSE_COUNTER=y
CONFIG_WANT_ST7920=y
CONFIG_WANT_HD44780=y
CONFIG_WANT_ADXL345=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_LDC1612=y
CONFIG_WANT_MPU9250=y
CONFIG_WANT_ICM20948=y
CONFIG_WANT_THERMOCOUPLE=y
CONFIG_WANT_HX71X=y
CONFIG_WANT_ADS1220=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_WANT_LDC1612=y
CONFIG_WANT_SENSOR_ANGLE=y
CONFIG_NEED_SENSOR_BULK=y
CONFIG_CANSERIAL=y
CONFIG_WANT_LOAD_CELL_PROBE=y
CONFIG_NEED_SOS_FILTER=y
CONFIG_CANBUS=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_CANBUS_FILTER=y
CONFIG_INLINE_STEPPER_HACK=y
CONFIG_HAVE_STEPPER_OPTIMIZED_BOTH_EDGE=y
# CONFIG_WANT_STEPPER_OPTIMIZED_BOTH_EDGE is not set
CONFIG_INITIAL_PINS=""
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
Expand All @@ -107,6 +136,4 @@ CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
Empty file modified mcu-firmware/pico_usb.config
100644 → 100755
Empty file.
Loading