Skip to content

Commit db5d3a9

Browse files
committed
update env and readme for creality-discovery
1 parent e6a73ae commit db5d3a9

4 files changed

Lines changed: 8 additions & 2 deletions

File tree

creality-discovery/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
# Auto Discovery Creality Device And Forward TCP
22

33
### Config Envs
4-
- `CR_SN`: printer sn, eg: `1234567890ABCD`
4+
- `CR_ID`: printer id, eg: `1234567890ABCD`
55
- `CR_IFACE`: which network interface to scan
66
- `CR_PORTS`: tcp ports to forward, eg: `4408,8000`
77
- `CR_INTERVAL`: how often to scan, eg: `10`
8+
9+
### Get `CR_ID`
10+
> Servel ways, eg: mobile app info, ssh or `Creality Print` desktip client
11+
12+
![](creality-ssh.png)
13+
![](creality-print.png)
144 KB
Loading
65.4 KB
Loading

creality-discovery/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func info(format string, v ...interface{}) {
3636
func init() {
3737
log.SetOutput(io.Discard) // 彻底禁言标准库
3838
cfg = Config{
39-
TargetService: fmt.Sprintf("_Creality-%s._udp", getEnv("CR_SN", "1234567890ABCD")),
39+
TargetService: fmt.Sprintf("_Creality-%s._udp", getEnv("CR_ID", "1234567890ABCD")),
4040
BindIface: getEnv("CR_IFACE", "host0"),
4141
ProxyPorts: strings.Split(getEnv("CR_PORTS", "4408,8000"), ","),
4242
ScanInterval: time.Duration(getEnvInt("CR_INTERVAL", 10)) * time.Second,

0 commit comments

Comments
 (0)