Skip to content
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4701289
Add AMS options
EmberLightVFX Jun 16, 2025
e9ec935
Add better external LED functions
EmberLightVFX Jun 16, 2025
be94eb5
Update package_import_url
EmberLightVFX Jun 16, 2025
e220a9a
Reset the encoder number to 0 on each boot.
EmberLightVFX Jun 16, 2025
575d157
Change from select component to number component (select contains a b…
EmberLightVFX Jun 16, 2025
e2dd3ab
Fix selected_slot and led selection
EmberLightVFX Jun 16, 2025
d1ee9ad
Update the ams and slot calculation for rotary encoder
EmberLightVFX Jun 16, 2025
7223e3f
Update esphome to 2025.06.0
EmberLightVFX Jun 18, 2025
ac25681
Renamed update_leds to select_led to reflect better what it's doing
EmberLightVFX Jun 18, 2025
c01f27d
Move rotary encoder code to its own file
EmberLightVFX Jun 18, 2025
3ef2aeb
Fix conditions when manually selecting units, ams and slots in web UI
EmberLightVFX Jun 18, 2025
d5c4fb0
reorder substitutions for better clarity
EmberLightVFX Jun 18, 2025
7411828
remove the import of button.yaml as it's not used.
EmberLightVFX Jun 18, 2025
f230ea8
Clean up comments
EmberLightVFX Jun 18, 2025
ac5220c
Add correct flash size and psram info for esp32 S3 super mini
EmberLightVFX Jun 18, 2025
54570a9
Correct LED pins and name
EmberLightVFX Jun 18, 2025
72c3180
Place encoder info in diagnostic category
EmberLightVFX Jun 18, 2025
22dc30d
Correct external led name in web ui
EmberLightVFX Jun 18, 2025
edb0375
Increase rmt_symbols for external led to reduce flickering
EmberLightVFX Jun 18, 2025
70b304f
Change ams icons for better match
EmberLightVFX Jun 18, 2025
49730e0
Set cpu frequency lower to reduce power consumption
EmberLightVFX Jun 18, 2025
2d40c85
Add LED Brightness slider to be able to set the LED brightness and co…
EmberLightVFX Jun 18, 2025
0919402
Merge branch 'spuder:main' into AMS-with-rotary-selection
EmberLightVFX Jun 19, 2025
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
6 changes: 5 additions & 1 deletion firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ clean:
esphome clean lolin_s2_mini.yaml
esphome clean lolin_s3_mini.yaml
esphome clean esp32-s3-devkitc-1.yaml
esphome clean esp32_s3_super_mini.yaml
rm -rf .esphome/idedata/*
rm -rf ~/.platformio/penv
# build-esp32s2-mini:
Expand Down Expand Up @@ -71,4 +72,7 @@ lolin_s3_mini:
run lolin_s3_mini.yaml --device $(USB_ADDRESS)
devkit:
esphome \
run esp32-s3-devkitc-1.yaml --device $(USB_ADDRESS)
run esp32-s3-devkitc-1.yaml --device $(USB_ADDRESS)
s3_super_mini_manual_ams:
esphome \
run esp32-s3-super-mini-manual-ams.yaml --device $(USB_ADDRESS)
87 changes: 87 additions & 0 deletions firmware/common-manual-ams.yaml
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The common-manual-ams.yaml appears to be nearly identical to the common.yaml

Could we consolidate these changes into the common.yaml?
If a setting needs to be changed we could split it out into a new file (probably openspool-ams.yaml)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutley! I didn't want to break anything thus I made a copy of it.

My idea would be to split as much as possible so inside your esp-device-yaml you would add the packages you want for your setup (ams, no ams, rotary encoder, external led etc) and that's that. I'll make a new PR for the splitting to see what you think about it.

Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
preferences:
flash_write_interval: 3sec

substitutions:
name: openspool

esphome:
name: ${name}
name_add_mac_suffix: true
project:
name: spuder.openspool
version: ${version}
min_version: 2025.6.0
platformio_options:
build_unflags: -std=gnu++11
build_flags:
- -std=gnu++14
- -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"
on_boot:
then:
#TODO: breahting blue studders a little bit
- light.turn_on:
id: neopixel_light
effect: Breathing Blue
- wait_until:
condition:
wifi.connected:
- delay: 100ms
- light.turn_on:
id: neopixel_light
effect: none
- delay: 100ms
- light.turn_on:
id: neopixel_light
effect: Rainbow
- delay: 1s
- light.turn_off:
id: neopixel_light
- delay: 500ms
- script.execute: select_led
- if:
condition:
lambda: |-
return !id(bambu_lan_access_code).state.empty() &&
!id(bambu_ip_address).state.empty() &&
!id(bambu_serial_number).state.empty();
then:
- logger.log:
level: info
format: "Connecting to Bambu printer"
- mqtt.enable:
id: bambu_mqtt
else:
- logger.log:
level: info
format: "Missing Bambu Credentials, skipping mqtt connect"
- mqtt.disable:
id: bambu_mqtt
on_shutdown:
then:
- light.turn_off:
id: neopixel_light

esp32:
framework:
type: esp-idf
sdkconfig_options:
CONFIG_MBEDTLS_HKDF_C: y # Needed for bambu KDF
CONFIG_MBEDTLS_MD_C: y # Needed for bambu KDF

packages:
version: !include conf.d/version.yaml
uptime: !include conf.d/uptime.yaml
wifi: !include conf.d/wifi.yaml
web_server: !include conf.d/web_server.yaml
debug: !include conf.d/debug.yaml
# time: !include conf.d/time.yaml
mqtt_bambu_lan: !include conf.d/mqtt_bambu_lan.yaml
filament: !include conf.d/filament.yaml
bambu_printer: !include conf.d/bambu_printer.yaml
automation: !include conf.d/automation.yaml
led-external: !include conf.d/led-external.yaml
ota: !include conf.d/ota.yaml
#update: !include conf.d/update.yaml
api: !include conf.d/api.yaml
logger: !include conf.d/logger.yaml
105 changes: 105 additions & 0 deletions firmware/conf.d/bambu_ams.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
globals:
- id: selected_slot
type: int
restore_value: true
initial_value: "0"

script:
- id: update_selected_slot
then:
- lambda: |-
if (id(ams_number).state == 0) {
id(selected_slot) = 0;
} else {
id(selected_slot) = (id(ams_number).state - 1) * 4 + id(slot_number).state;
}
- script.execute: select_led

number:
- platform: template
name: "Number of AMS units"
id: ams_units
optimistic: false
restore_value: true
icon: mdi:train-car-container
min_value: 0
max_value: 4
step: 1
initial_value: 1
set_action:
then:
- lambda: |-
if (id(bambu_model).state == "A1Mini" || id(bambu_model).state == "A1") {
ESP_LOGD("AMS Units", "A1Mini or A1 detected, setting AMS to 1");
id(ams_units).publish_state(1);
} else {
ESP_LOGD("AMS Units", "AMS units: %d", (int)id(ams_units).state);
id(ams_units).publish_state(x);
}
ESP_LOGD("AMS", "Number of AMS units set: %d", (int)x);

if (x < id(ams_number).state) {
ESP_LOGD("AMS Units", "AMS is higher than current units size, forcing AMS to %d", (int)x);
id(ams_number).publish_state(x);
}
if (x == 0) {
ESP_LOGD("AMS Units", "AMS units is 0, forcing slot to 1");
id(slot_number).publish_state(1);
}
- script.execute: update_selected_slot
web_server:
sorting_group_id: sorting_group_printer_settings
sorting_weight: 100

- platform: template
name: "AMS Number"
id: ams_number
optimistic: false
restore_value: true
icon: mdi:train-car-container
min_value: 0
max_value: 4
step: 1
initial_value: 1
set_action:
then:
- lambda: |-
if (x > id(ams_units).state) {
ESP_LOGD("ams_number", "AMS number too high, setting to %d", (int)id(ams_units).state);
id(ams_number).publish_state(id(ams_units).state);
} else {
id(ams_number).publish_state(x);
}
ESP_LOGD("AMS", "AMS selected: %d", (int)x);

if (x == 0 && id(slot_number).state != 1) {
ESP_LOGD("AMS", "AMS is 0, forcing slot to 1");
id(slot_number).publish_state(1);
}
- script.execute: update_selected_slot
web_server:
sorting_group_id: sorting_group_ams

- platform: template
name: "Slot Number"
id: slot_number
optimistic: false
restore_value: true
icon: mdi:record-circle-outline
min_value: 1
max_value: 4
step: 1
initial_value: 1
set_action:
then:
- lambda: |-
if (id(ams_number).state == 0) {
ESP_LOGD("slot_number", "AMS is 0, forcing slot to 1");
id(slot_number).publish_state(1);
} else {
id(slot_number).publish_state(x);
}
ESP_LOGD("AMS", "Slot selected: %d", (int)x);
- script.execute: update_selected_slot
web_server:
sorting_group_id: sorting_group_ams
Loading