Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c5d08253a7 | ||
|
|
5224e34f8c | ||
|
|
fb65bc8068 | ||
|
|
c0651a50a7 | ||
|
|
e04e3204eb | ||
|
|
ecc9e5ea99 | ||
|
|
ed024077ee | ||
|
|
91db5036c0 |
46
.github/workflows/compile.yaml
vendored
@@ -1,5 +1,9 @@
|
||||
name: PlatformIO CI
|
||||
|
||||
permissions:
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
@@ -24,22 +28,44 @@ jobs:
|
||||
|
||||
- name: Build PlatformIO Project
|
||||
run: |
|
||||
cd CYD-Klipper-Display
|
||||
cd CYD-Klipper
|
||||
pio run
|
||||
|
||||
- name: Make output dir
|
||||
run: mkdir -p output
|
||||
run: |
|
||||
mkdir -p output
|
||||
|
||||
- name: Build Binary
|
||||
run: |
|
||||
cp ./CYD-Klipper-Display/.pio/build/esp32dev/bootloader.bin output
|
||||
cp ./CYD-Klipper-Display/.pio/build/esp32dev/partitions.bin output
|
||||
cp ./CYD-Klipper-Display/.pio/build/esp32dev/firmware.bin output
|
||||
cp ~/platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin output
|
||||
esptool --chip esp32 merge_bin -o ./output/merged-firmware.bin --flash_mode dio --flash_freq 40m --flash_size 4MB 0x1000 ./output/bootloader.bin 0x8000 ./output/partitions.bin 0xe000 ./output/boot_app0.bin 0x10000 ./output/firmware.bin
|
||||
|
||||
- name: Upload artefact
|
||||
cp ./CYD-Klipper/.pio/build/esp32dev/bootloader.bin output
|
||||
cp ./CYD-Klipper/.pio/build/esp32dev/partitions.bin output
|
||||
cp ./CYD-Klipper/.pio/build/esp32dev/firmware.bin output
|
||||
cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin output
|
||||
python3 -m esptool --chip esp32 merge_bin -o ./output/merged-firmware.bin --flash_mode dio --flash_freq 40m --flash_size 4MB 0x1000 ./output/bootloader.bin 0x8000 ./output/partitions.bin 0xe000 ./output/boot_app0.bin 0x10000 ./output/firmware.bin
|
||||
cp -r ./output ./_site
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: firmware
|
||||
path: ./output
|
||||
path: ./output
|
||||
|
||||
- name: Upload GitHub Page Artifact
|
||||
uses: actions/upload-pages-artifact@v2
|
||||
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||
steps:
|
||||
- name: Print GitHub event name
|
||||
run: |
|
||||
echo "${{ github.event_name }}"
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v2
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.16.0)
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(CYD-Klipper-Display)
|
||||
project(CYD-Klipper)
|
||||
@@ -97,15 +97,15 @@ void fetch_printer_data()
|
||||
|
||||
if (status.containsKey("toolhead"))
|
||||
{
|
||||
printer.position[0] = status["toolhead"]["position"][0];
|
||||
printer.position[1] = status["toolhead"]["position"][1];
|
||||
printer.position[2] = status["toolhead"]["position"][2];
|
||||
const char *homed_axis = status["toolhead"]["homed_axes"];
|
||||
printer.homed_axis = strcmp(homed_axis, "xyz") == 0;
|
||||
}
|
||||
|
||||
if (status.containsKey("gcode_move"))
|
||||
{
|
||||
printer.position[0] = status["gcode_move"]["gcode_position"][0];
|
||||
printer.position[1] = status["gcode_move"]["gcode_position"][1];
|
||||
printer.position[2] = status["gcode_move"]["gcode_position"][2];
|
||||
bool absolute_coords = status["gcode_move"]["absolute_coordinates"];
|
||||
printer.absolute_coords = absolute_coords == true;
|
||||
}
|
||||
@@ -25,6 +25,17 @@ bool verify_ip(){
|
||||
}
|
||||
}
|
||||
|
||||
bool retry_ip_verify(){
|
||||
for (int i = 0; i < 3; i++){
|
||||
if (verify_ip()){
|
||||
return true;
|
||||
}
|
||||
delay(500);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void ta_event_cb(lv_event_t * e) {
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
lv_obj_t * ta = lv_event_get_target(e);
|
||||
@@ -87,7 +98,7 @@ void ip_setup_inner(){
|
||||
void ip_setup(){
|
||||
connect_ok = false;
|
||||
|
||||
if (global_config.ipConfigured && verify_ip()){
|
||||
if (global_config.ipConfigured && retry_ip_verify()){
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -108,8 +108,6 @@ void wifi_init_inner(){
|
||||
lv_task_handler();
|
||||
lv_refr_now(NULL);
|
||||
|
||||
int n = WiFi.scanNetworks();
|
||||
|
||||
lv_obj_clean(lv_scr_act());
|
||||
|
||||
lv_obj_t * refreshBtn = lv_btn_create(lv_scr_act());
|
||||
@@ -128,15 +126,22 @@ void wifi_init_inner(){
|
||||
lv_obj_align(list, LV_ALIGN_TOP_LEFT, 10, 40);
|
||||
lv_obj_set_size(list, TFT_HEIGHT - 20, TFT_WIDTH - 40 - 5);
|
||||
|
||||
int n = WiFi.scanNetworks();
|
||||
|
||||
for (int i = 0; i < n; ++i) {
|
||||
const char* ssid = WiFi.SSID(i).c_str();
|
||||
int len = strlen(ssid);
|
||||
String ssid = WiFi.SSID(i);
|
||||
char* ssid_copy = (char*)malloc(ssid.length() + 1);
|
||||
int j = 0;
|
||||
|
||||
if (len == 0)
|
||||
continue;
|
||||
for (; j < ssid.length(); ++j){
|
||||
if (ssid[j] == '\0')
|
||||
continue;
|
||||
|
||||
ssid_copy[j] = ssid[j];
|
||||
}
|
||||
|
||||
ssid_copy[j] = '\0';
|
||||
|
||||
const char* ssid_copy = (const char*)malloc(len + 1);
|
||||
strcpy((char*)ssid_copy, ssid);
|
||||
lv_obj_t * btn = lv_list_add_btn(list, LV_SYMBOL_WIFI, ssid_copy);
|
||||
lv_obj_add_event_cb(btn, wifi_btn_event_handler, LV_EVENT_ALL, (void*)ssid_copy);
|
||||
}
|
||||
44
README.md
@@ -1,3 +1,43 @@
|
||||
# CYD-Klipper-Display
|
||||

|
||||
[](https://ko-fi.com/suchmememanyskill)
|
||||
|
||||
WIP!
|
||||
# CYD-Klipper
|
||||
An implementation of a Klipper status display on an ESP32 + screen. Uses Moonraker to fetch data.
|
||||
|
||||
A simple and cheap solution to use a dedicated screen with Klipper, a 3d printing Firmware.
|
||||
|
||||

|
||||
|
||||
### Required hardware
|
||||
|
||||
A ESP32-2432S028R is required to run this project. You can find out where to buy these on the ["ESP32 Cheap Yellow Display"](https://github.com/witnessmenow/ESP32-Cheap-Yellow-Display#where-to-buy) repository.
|
||||
|
||||
### Features
|
||||
- View printer status
|
||||
- View print progress
|
||||
- Start a print
|
||||
- Move the printer
|
||||
- Manage temperature
|
||||
- Extrude/Retract filament
|
||||
|
||||
### Install
|
||||
|
||||
[There is a web-based installer available. This is only supported on Chrome, Edge or Opera, and only on Desktop.](https://suchmememanyskill.github.io/CYD-Klipper/)
|
||||
|
||||
On initial install, all data should be wiped. On updates, data should be able to be kept without issues.
|
||||
|
||||
There are no 'over the air' updates. Each update has to be applied manually.
|
||||
|
||||
### Screenshots
|
||||
(Quite literally shots of the screen. I'm sorry)
|
||||
|
||||
-|-
|
||||
:-:|:-:
|
||||
|
|
||||
|
|
||||
|
|
||||
|
||||
|
||||
### Credits
|
||||
- [xtouch](https://github.com/xperiments-in/xtouch)
|
||||
- [ESP32-Cheap-Yellow-Display](https://github.com/witnessmenow/ESP32-Cheap-Yellow-Display)
|
||||
32
_site/index.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<head>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');
|
||||
|
||||
* {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
}
|
||||
|
||||
.main {
|
||||
width: fit-content;
|
||||
margin: auto;
|
||||
}
|
||||
</style>
|
||||
<script type="module" src="https://unpkg.com/esp-web-tools@9/dist/web/install-button.js?module"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<section class="main">
|
||||
<h2>CYD-Klipper</h2>
|
||||
<p>An implementation of a Klipper status display on an ESP32 + screen.<br>Uses Moonraker to fetch data.</p>
|
||||
<img alt="GitHub release (with filter)" src="https://img.shields.io/github/v/release/suchmememanyskill/CYD-Klipper">
|
||||
<a href="https://github.com/suchmememanyskill/CYD-Klipper"><img alt="GitHub repo" src="https://img.shields.io/badge/Source-Github-blue.svg"></a>
|
||||
<section class="install">
|
||||
<h3>Install</h3>
|
||||
<p>Note: You may need to hold the 'BOOT' button on the device while pressing install</p>
|
||||
<esp-web-install-button
|
||||
manifest="https://suchmememanyskill.github.io/CYD-Klipper/manifest.json"></esp-web-install-button>
|
||||
</section>
|
||||
</section>
|
||||
</body>
|
||||
27
_site/manifest.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "CYD-Klipper",
|
||||
"new_install_prompt_erase": true,
|
||||
"builds": [
|
||||
{
|
||||
"chipFamily": "ESP32",
|
||||
"parts": [
|
||||
{
|
||||
"path": "output/bootloader.bin",
|
||||
"offset": 4096
|
||||
},
|
||||
{
|
||||
"path": "output/partitions.bin",
|
||||
"offset": 32768
|
||||
},
|
||||
{
|
||||
"path": "output/boot_app0.bin",
|
||||
"offset": 57344
|
||||
},
|
||||
{
|
||||
"path": "output/firmware.bin",
|
||||
"offset": 65536
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
10
_site/manifest_wipe.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "CYD-Klipper",
|
||||
"new_install_prompt_erase": false,
|
||||
"builds": [
|
||||
{
|
||||
"path": "output/merged-firmware.bin",
|
||||
"offset": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
readme/PXL_20231113_142717308.jpg
Normal file
|
After Width: | Height: | Size: 335 KiB |
BIN
readme/PXL_20231113_171629383.jpg
Normal file
|
After Width: | Height: | Size: 533 KiB |
BIN
readme/PXL_20231113_171701876.jpg
Normal file
|
After Width: | Height: | Size: 890 KiB |
BIN
readme/PXL_20231113_171715809.jpg
Normal file
|
After Width: | Height: | Size: 552 KiB |
BIN
readme/PXL_20231113_171724404.jpg
Normal file
|
After Width: | Height: | Size: 911 KiB |
BIN
readme/PXL_20231113_171751745.jpg
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
readme/PXL_20231113_171809315.jpg
Normal file
|
After Width: | Height: | Size: 1.0 MiB |