Skip to content

Commit 0dbd0bb

Browse files
author
bigtreetech
committed
Add dialog before klipper/host/servce control, auto goto main gif menu when idle, add gesture for extrude roller menu, html for ios(unable to popup alert/confirm)
1 parent 666ea26 commit 0dbd0bb

25 files changed

+447
-283
lines changed

platformio.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ default_envs = knomiv2
1919
# Default values apply to all 'env:' prefixed environments
2020
#
2121
[env]
22-
upload_port = COM37
22+
; upload_port = COM37
2323
; upload_protocol = custom
2424
; extra_scripts = platformio_upload_ota.py
2525
; upload_url = http://192.168.1.117/update
@@ -40,7 +40,7 @@ lib_deps =
4040
; https://github.com/me-no-dev/ESPAsyncWebServer.git
4141
; https://github.com/ayushsharma82/AsyncElegantOTA.git
4242
ottowinter/ESPAsyncWebServer-esphome @ ^3.0.0
43-
https://github.com/looxonline/AsyncElegantOTA.git
43+
https://github.com/bigtreetech/AsyncElegantOTA.git
4444

4545
[env:knomiv2]
4646
platform = espressif32

src/config.h

Lines changed: 1 addition & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#ifndef CONFIG_H
22
#define CONFIG_H
33

4-
#include "pinout.h"
5-
6-
#define FW_VERSION "V1.0.1"
4+
#define FW_VERSION "V1.0.2"
75

86
// default 80 for http
97
#define SERVER_PORT 80
@@ -17,136 +15,13 @@
1715
#define AP_GATEWAY IPAddress(192, 168, 20, 1) // gateway IP
1816
#define AP_SUBNET IPAddress(255, 255, 255, 0) // subnet mask
1917

20-
// #define STA_TEST_SSID "biqu-m"
21-
// #define STA_TEST_PWD "biqu2020"
22-
23-
typedef void (*p_function_t)(void);
24-
25-
#include <WiFi.h>
26-
#include "lvgl.h"
27-
typedef struct {
28-
char sta_ssid[33];
29-
char sta_pwd[65];
30-
wifi_auth_mode_t sta_auth;
31-
char ap_ssid[33];
32-
char ap_pwd[65];
33-
char hostname[16];
34-
char moonraker_ip[65]; // "192.168.255.255" or "<hostname>.local"
35-
char moonraker_port[6]; // "65536", max_len=6
36-
char moonraker_tool[7];
37-
char mode[6]; // "ap":WIFI_MODE_AP, "sta":WIFI_MODE_STA, "apsta":WIFI_MODE_APSTA
38-
lv_color_t theme_color;
39-
} knomi_config_t;
40-
41-
typedef struct {
42-
int32_t rssi[SCAN_SSIDS_NUM]; // RSSI returned RSSI values
43-
char ssid[SCAN_SSIDS_NUM][65]; // SSIDs returned by the wifi scan.
44-
wifi_auth_mode_t authmode[SCAN_SSIDS_NUM]; // encryptionType
45-
uint8_t connected[SCAN_SSIDS_NUM];
46-
uint8_t count; // Number of WiFi Scanned
47-
} knomi_wifi_scan_t;
48-
49-
extern knomi_config_t knomi_config;
50-
extern knomi_wifi_scan_t wifi_scan;
51-
52-
53-
#define WEB_POST_NULL (0)
54-
#define WEB_POST_LOCAL_HOSTNAME BIT(0)
55-
#define WEB_POST_WIFI_CONFIG_MODE BIT(1)
56-
#define WEB_POST_WIFI_CONFIG_AP BIT(2)
57-
#define WEB_POST_WIFI_CONFIG_STA BIT(3)
58-
#define WEB_POST_MOONRAKER BIT(4)
59-
#define WEB_POST_WIFI_REFRESH BIT(5)
60-
#define WEB_POST_RESTART BIT(6)
61-
62-
#define LOCAL_POST_LV_THEME_COLOR BIT(7)
63-
#define EEPROM_PARA_CHANGED (WEB_POST_WIFI_CONFIG_AP | \
64-
WEB_POST_WIFI_CONFIG_STA | \
65-
WEB_POST_WIFI_CONFIG_MODE | \
66-
WEB_POST_LOCAL_HOSTNAME | \
67-
WEB_POST_MOONRAKER | \
68-
LOCAL_POST_LV_THEME_COLOR)
69-
70-
71-
void knomi_config_require_change(uint16_t require);
72-
void wifi_scan_refresh_set_callback(p_function_t cb);
73-
wifi_auth_mode_t wifi_get_ahth_mode_from_scanned_list(void);
74-
75-
void knomi_factory_reset(void);
76-
77-
typedef enum {
78-
WIFI_STATUS_ERROR, // no station ssid or connect failed
79-
WIFI_STATUS_CONNECTING,
80-
WIFI_STATUS_CONNECTED,
81-
WIFI_STATUS_DISCONNECT,
82-
WIFI_STATUS_INIT,
83-
}wifi_status_t;
84-
85-
wifi_status_t wifi_get_connect_status(void);
86-
8718
#define WIFI_STA_TIMEOUT 15000 // 15s
8819

89-
extern int32_t lis2dw12_acc[3];
90-
9120
// BTT red color for UI (RGB888)
9221
#define LV_32BIT_BTT_RED 0xC02F30
9322
#define LV_32BIT_BTT_BLUE 0x209ADE
9423
#define LV_32BIT_BTT_PURPLE 0xA91DDA
9524
#define LV_32BIT_BTT_GREEN 0x5DA910
9625
#define LV_DEFAULT_COLOR LV_32BIT_BTT_RED
9726

98-
// Macros for array numbers
99-
#define ACOUNT(n) (sizeof(n) / sizeof(n[0]))
100-
// Macros to make a string from a macro
101-
#define STRINGIFY_(M) #M
102-
#define STRINGIFY(M) STRINGIFY_(M)
103-
104-
// Preheat
105-
#define PREHEAT_0_NOZZLE 0
106-
#define PREHEAT_0_BED 0
107-
#define PREHEAT_0_LABEL "CoolDown"
108-
#define PREHEAT_1_NOZZLE 200
109-
#define PREHEAT_1_BED 60
110-
#define PREHEAT_1_LABEL "PLA:" STRINGIFY(PREHEAT_1_NOZZLE) "/" STRINGIFY(PREHEAT_1_BED) "℃"
111-
#define PREHEAT_2_NOZZLE 240
112-
#define PREHEAT_2_BED 70
113-
#define PREHEAT_2_LABEL "PETG:" STRINGIFY(PREHEAT_2_NOZZLE) "/" STRINGIFY(PREHEAT_2_BED) "℃"
114-
#define PREHEAT_3_NOZZLE 230
115-
#define PREHEAT_3_BED 90
116-
#define PREHEAT_3_LABEL "ABS:" STRINGIFY(PREHEAT_3_NOZZLE) "/" STRINGIFY(PREHEAT_3_BED) "℃"
117-
#define PREHEAT_4_NOZZLE 170
118-
#define PREHEAT_4_BED 50
119-
#define PREHEAT_4_LABEL "WOOD:" STRINGIFY(PREHEAT_4_NOZZLE) "/" STRINGIFY(PREHEAT_4_BED) "℃"
120-
#define PREHEAT_5_NOZZLE 220
121-
#define PREHEAT_5_BED 50
122-
#define PREHEAT_5_LABEL "TPU:" STRINGIFY(PREHEAT_5_NOZZLE) "/" STRINGIFY(PREHEAT_5_BED) "℃"
123-
#define PREHEAT_6_NOZZLE 250
124-
#define PREHEAT_6_BED 90
125-
#define PREHEAT_6_LABEL "NYLON:" STRINGIFY(PREHEAT_6_NOZZLE) "/" STRINGIFY(PREHEAT_6_BED) "℃"
126-
127-
// Extrude length, mm
128-
#define EXTRUDE_MM_0 1
129-
#define EXTRUDE_MM_0_LABEL STRINGIFY(EXTRUDE_MM_0)"mm"
130-
#define EXTRUDE_MM_1 5
131-
#define EXTRUDE_MM_1_LABEL STRINGIFY(EXTRUDE_MM_1)"mm"
132-
#define EXTRUDE_MM_2 10
133-
#define EXTRUDE_MM_2_LABEL STRINGIFY(EXTRUDE_MM_2)"mm"
134-
#define EXTRUDE_MM_3 50
135-
#define EXTRUDE_MM_3_LABEL STRINGIFY(EXTRUDE_MM_3)"mm"
136-
#define EXTRUDE_MM_4 100
137-
#define EXTRUDE_MM_4_LABEL STRINGIFY(EXTRUDE_MM_4)"mm"
138-
// mm/s to mm/min
139-
#define MMS_TO_MMM(n) ((n) * 60)
140-
// Extrude speed, mm/s
141-
#define EXTRUDE_MM_S_0 1
142-
#define EXTRUDE_MM_S_0_LABEL STRINGIFY(EXTRUDE_MM_S_0)"mm/s"
143-
#define EXTRUDE_MM_S_1 5
144-
#define EXTRUDE_MM_S_1_LABEL STRINGIFY(EXTRUDE_MM_S_1)"mm/s"
145-
#define EXTRUDE_MM_S_2 10
146-
#define EXTRUDE_MM_S_2_LABEL STRINGIFY(EXTRUDE_MM_S_2)"mm/s"
147-
#define EXTRUDE_MM_S_3 50
148-
#define EXTRUDE_MM_S_3_LABEL STRINGIFY(EXTRUDE_MM_S_3)"mm/s"
149-
#define EXTRUDE_MM_S_4 100
150-
#define EXTRUDE_MM_S_4_LABEL STRINGIFY(EXTRUDE_MM_S_4)"mm/s"
151-
15227
#endif

0 commit comments

Comments
 (0)