Skip to content

Commit b24e726

Browse files
committed
Add initial support for Kobra 3 V2
1 parent e822004 commit b24e726

File tree

12 files changed

+100
-10
lines changed

12 files changed

+100
-10
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Here are the suported printers and firmwares with latest Rinkhals release:
2121
| Kobra 2 Pro | `3.1.2.3` | Only with mainboard [Trigorilla Spe **B** v1.0.x](https://1coderookie.github.io/Kobra2ProInsights/hardware/mainboard/#trigorilla_spe_b_v10x-stock-new-revision). `3.1.4` is buggy |
2222
| Kobra S1 (+ combo) | `2.5.2.3` `2.5.3.1` |
2323
| Kobra 3 Max (+ combo) | `2.4.6` `2.4.6.5` |
24+
| Kobra 3 V2 (+ combo) | `1.0.5.8` |
2425

2526
In case you're wondering this project is named after rinkhals, a sub-species of Cobras ... Kobra ... Rinkhals 👏
2627

build/tools.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ compress_swu() {
2121
rm -f $SWU_PATH
2222
cd $SWU_DIR
2323

24-
if [ "$KOBRA_MODEL_CODE" = "K2P" ] || [ "$KOBRA_MODEL_CODE" = "K3" ]; then
24+
if [ "$KOBRA_MODEL_CODE" = "K2P" ] || [ "$KOBRA_MODEL_CODE" = "K3" ] || [ "$KOBRA_MODEL_CODE" = "K3V2" ]; then
2525
zip -0 -P U2FsdGVkX19deTfqpXHZnB5GeyQ/dtlbHjkUnwgCi+w= -r $SWU_NAME update_swu
2626
elif [ "$KOBRA_MODEL_CODE" = "KS1" ]; then
2727
zip -0 -P U2FsdGVkX1+lG6cHmshPLI/LaQr9cZCjA8HZt6Y8qmbB7riY -r $SWU_NAME update_swu

docs/docs/Rinkhals/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Rinkhals bundles Dropbear, a lightweight SSH server alternative to OpenSSH.
5454

5555
During Rinkhals startup, Dropbear is started and listens on port 22. Default root credentials are used for password authentication exclusively.
5656

57-
On the K2P, K3 and KS1, the root password is `rockchip`
57+
On the K2P, K3, K3V2 and KS1, the root password is `rockchip`
5858
On the K3M, the root password is not yet known.
5959

6060

docs/docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ In this documentation, the following printers will be refered to with their mode
2323

2424
- K2P: Anycubic Kobra 2 Pro
2525
- K3: Anycubic Kobra 3 (+ combo)
26+
- K3V2: Anycubic Kobra 3 V2 (+ combo)
2627
- K3M: Anycubic Kobra 3 Max (+ combo)
2728
- KS1: Anycubic Kobra S1 (+ combo)
2829

docs/docs/printers/kobra-3-v2.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: Anycubic Kobra 3 V2
3+
---
4+
5+
6+
## General
7+
8+
- SWU password: `U2FsdGVkX19deTfqpXHZnB5GeyQ/dtlbHjkUnwgCi+w=`
9+
- Ex/Im password: `2YLVrATRvUEnMeXk6Vtc7qxfzYM4TJzrLnEBma8zpUKeGtseGWqp4LXs7e8KeU2u`
10+
- SSH root password: `rockchip`
11+
12+
13+
## Firmware history
14+
15+
??? quote "1.0.5.8"
16+
```
17+
{
18+
"id": 135,
19+
"model_id": 20027,
20+
"machine_version": "1.1.0",
21+
"firmware_name": "update.swu",
22+
"peripheral_version": "",
23+
"firmware_version": "1.0.5.8",
24+
"firmware_url": "https://cdn.cloud-universe.anycubic.com/attachment/1926959055878316033_aruz4b58.swu",
25+
"firmware_size": 167656195,
26+
"firmware_md5": "e603207b38a033b03b551b37ed204979",
27+
"parent_id": 0,
28+
"force_update": false,
29+
"time_cost": 20,
30+
"update_desc": "1.Purge volume config. in ACS Next\n2.Zone Leveling\n3.More stable file transfers\n*ACSNext >= 1.3.5\n",
31+
"create_date": 1748258053
32+
}
33+
```
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/sh
2+
3+
# This script was automatically generated, don't modify it directly
4+
# Before MD5: 1d990eda4e4c4240efbaa0852fba2b2f
5+
# After MD5: 80f4af5e816f70202bdf0e566212e4ec
6+
7+
TARGET=$1
8+
9+
MD5=$(md5sum $TARGET | awk '{print $1}')
10+
if [ "$MD5" = "80f4af5e816f70202bdf0e566212e4ec" ]; then
11+
echo $TARGET is already patched, skipping...
12+
exit 0
13+
fi
14+
if [ "$MD5" != "1d990eda4e4c4240efbaa0852fba2b2f" ]; then
15+
echo $TARGET hash does not match, skipping patch...
16+
exit 1
17+
fi
18+
19+
PATCH_FILE=/tmp/patch-$RANDOM.bin
20+
echo 'AKDjDvCg4R8EAOoO8KDhL3VzZXJlbWFpbi9yaW5raGFscy8uY3VycmVudC9vcHQvcmlua2hhbHMvdWkvcmlua2hhbHMtdWkuc2ggJiBlY2hvICQhID4gL3RtcC9yaW5raGFscy9yaW5raGFscy11aS5waWR0aW1lb3V0IC10IDIgc3RyYWNlLXFxcSAtZSB0cmFjZT1ub25lIC1wICQoY2F0IC90bXAvcmlua2hhbHMvcmlua2hhbHMtdWkucGlkKSAyPiAvZGV2L251bGwAcm0gLWYgL3RtcC9yaW5raGFscy9yaW5raGFscy11aS5waWQAAACf5QAAAOoo/w8AHpv862QAoOOmrfzrAACfAAAA6o7/DwAYm/zrDwBQ4/f//woAAJ/lAADq6v8PABKb/OsIABvlAJDlBCCg4wEQoOPC9v7rCAAb5QCQBBCg43r4/uvQ+//qUmlua2hhbHMAUmlua2hhbA==' | base64 -d > $PATCH_FILE
21+
22+
dd if=$PATCH_FILE skip=0 ibs=1 of=$TARGET seek=119757 obs=1 count=7 conv=notrunc # 0x1d3cd / 0x2d3cd > 0x00a0e30ef0a0e1
23+
dd if=$PATCH_FILE skip=7 ibs=1 of=$TARGET seek=978828 obs=1 count=4 conv=notrunc # 0xeef8c / 0xfef8c > 0x1f0400ea
24+
dd if=$PATCH_FILE skip=11 ibs=1 of=$TARGET seek=982820 obs=1 count=105 conv=notrunc # 0xeff24 / 0xfff24 > 0x0ef0a0e12f75736572656d61696e2f72696e6b68616c732f2e63757272656e742f6f70742f72696e6b68616c732f75692f72696e6b68616c732d75692e73682026206563686f202421203e202f746d702f72696e6b68616c732f72696e6b68616c732d75692e706964
25+
dd if=$PATCH_FILE skip=116 ibs=1 of=$TARGET seek=982926 obs=1 count=19 conv=notrunc # 0xeff8e / 0xfff8e > 0x74696d656f7574202d74203220737472616365
26+
dd if=$PATCH_FILE skip=135 ibs=1 of=$TARGET seek=982946 obs=1 count=108 conv=notrunc # 0xeffa2 / 0xfffa2 > 0x2d717171202d652074726163653d6e6f6e65202d70202428636174202f746d702f72696e6b68616c732f72696e6b68616c732d75692e7069642920323e202f6465762f6e756c6c00726d202d66202f746d702f72696e6b68616c732f72696e6b68616c732d75692e70696400
27+
dd if=$PATCH_FILE skip=243 ibs=1 of=$TARGET seek=983056 obs=1 count=27 conv=notrunc # 0xf0010 / 0x100010 > 0x00009fe5000000ea28ff0f001e9bfceb6400a0e3a6adfceb00009f
28+
dd if=$PATCH_FILE skip=270 ibs=1 of=$TARGET seek=983084 obs=1 count=25 conv=notrunc # 0xf002c / 0x10002c > 0x000000ea8eff0f00189bfceb0f0050e3f7ffff0a00009fe500
29+
dd if=$PATCH_FILE skip=295 ibs=1 of=$TARGET seek=983110 obs=1 count=15 conv=notrunc # 0xf0046 / 0x100046 > 0x00eaeaff0f00129bfceb08001be500
30+
dd if=$PATCH_FILE skip=310 ibs=1 of=$TARGET seek=983126 obs=1 count=19 conv=notrunc # 0xf0056 / 0x100056 > 0x90e50420a0e30110a0e3c2f6feeb08001be500
31+
dd if=$PATCH_FILE skip=329 ibs=1 of=$TARGET seek=983146 obs=1 count=1 conv=notrunc # 0xf006a / 0x10006a > 0x90
32+
dd if=$PATCH_FILE skip=330 ibs=1 of=$TARGET seek=983148 obs=1 count=12 conv=notrunc # 0xf006c / 0x10006c > 0x0410a0e37af8feebd0fbffea
33+
dd if=$PATCH_FILE skip=342 ibs=1 of=$TARGET seek=2786176 obs=1 count=16 conv=notrunc # 0x2a8380 / 0x2b8380 > 0x52696e6b68616c730052696e6b68616c
34+
35+
rm $PATCH_FILE

files/3-rinkhals/opt/rinkhals/patches/create-patches.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def patch_K3SysUi(binaryPath, modelCode, version):
111111
buttonCallback = k3sysui.symbols['_ZZN10MainWindow19AcSettingPageUiInitEvENKUlvE_clEv']
112112
patchJumpAddress = 0xfd278
113113
patchReturnAddress = 0xfd2a8
114-
elif (modelCode == 'K3' and version == '2.4.0.4') or (modelCode == 'K3M' and version == '2.4.6.5'):
114+
elif (modelCode == 'K3' and version == '2.4.0.4') or (modelCode == 'K3M' and version == '2.4.6.5') or (modelCode == 'K3V2' and version == '1.0.5.8'):
115115
buttonCallback = k3sysui.symbols['_ZZN10MainWindow19AcSettingPageUiInitEvENKUlvE_clEv']
116116
patchJumpAddress = 0xfef8c
117117
patchReturnAddress = 0xfefbc
@@ -191,7 +191,7 @@ def patch_K3SysUi(binaryPath, modelCode, version):
191191
osSleep = k3sysui.symbols['_ZN8GobalVar7OsSleepEi']
192192
acDisplayWaitHandler = k3sysui.symbols['_ZN10MainWindow20AcDisplayWaitHandlerEhh']
193193

194-
if modelCode == 'K3' or modelCode == 'K3M':
194+
if modelCode == 'K3' or modelCode == 'K3M' or modelCode == 'K3V2':
195195
acDisplayWaitHide = k3sysui.symbols['_ZN10MainWindow17AcDisplayWaitHideEv']
196196
elif modelCode == 'KS1':
197197
acDisplayWaitHide = k3sysui.symbols['_ZN10MainWindow17AcDisplayWaitHideEh']

files/3-rinkhals/opt/rinkhals/scripts/check-updates.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,22 @@ def get_latest_update(self, model_code=None, current_version=None):
111111
self.firmware_version = '3.1.4'
112112
elif model_code == 'K3':
113113
self.model_id = '20024'
114-
self.firmware_version = '2.3.8.9'
114+
self.firmware_version = '2.4.0.4'
115115
elif model_code == 'KS1':
116116
self.model_id = '20025'
117-
self.firmware_version = '2.5.1.6'
117+
self.firmware_version = '2.5.3.1'
118118
elif model_code == 'K3M':
119119
self.model_id = '20026'
120+
self.firmware_version = '2.4.6.5'
121+
elif model_code == 'K3V2':
122+
self.model_id = '20027'
123+
self.firmware_version = '1.0.5.8'
124+
elif model_code.isdigit():
125+
self.model_id = model_code
120126
self.firmware_version = '1.2.3.4'
121127
else:
122128
return None
129+
123130
if current_version:
124131
self.firmware_version = current_version
125132

files/3-rinkhals/opt/rinkhals/ui/common.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ def get():
144144
elif model_id == '20026':
145145
printer_info.model = 'Anycubic Kobra 3 Max'
146146
printer_info.model_code = 'K3M'
147+
elif model_id == '20027':
148+
printer_info.model = 'Anycubic Kobra 3 V2'
149+
printer_info.model_code = 'K3V2'
147150
except:
148151
return None
149152

@@ -512,6 +515,8 @@ def collect():
512515
if firmware_version == '2.4.5.3': supposed_hash = None
513516
if firmware_version == '2.4.6': supposed_hash = 'ff5c2d8ae79b8d90d0ff7c697d85502d'
514517
if firmware_version == '2.4.6.5': supposed_hash = 'b79497202880f92b6e4a578a32e8f3a3'
518+
elif printer_info.model_code == 'K3V2':
519+
if firmware_version == '1.0.5.8': supposed_hash = None
515520

516521
if supposed_hash is None:
517522
printer_cfg_mtime = os.path.getmtime(printer_cfg_path)

files/3-rinkhals/opt/rinkhals/ui/rinkhals-install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1488,7 +1488,7 @@ def install_version():
14881488
self.show_modal(self.modal_ota_firmware)
14891489

14901490
def extract_swu(self):
1491-
if self.printer_info.model_code == 'K2P' or self.printer_info.model_code == 'K3':
1491+
if self.printer_info.model_code == 'K2P' or self.printer_info.model_code == 'K3' or self.printer_info.model_code == 'K3V2':
14921492
password = 'U2FsdGVkX19deTfqpXHZnB5GeyQ/dtlbHjkUnwgCi+w='
14931493
elif self.printer_info.model_code == 'KS1':
14941494
password = 'U2FsdGVkX1+lG6cHmshPLI/LaQr9cZCjA8HZt6Y8qmbB7riY'

0 commit comments

Comments
 (0)