From 6acdc6c7f8b164f1897151cb5c0e2abb080d949b Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Sat, 12 Sep 2026 02:01:02 -0400 Subject: [PATCH] [Issue #7] - Added config.go setting to allow setting the hostname --- config.go.example | 1 + network.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config.go.example b/config.go.example index d1ad6cf..93190f3 100644 --- a/config.go.example +++ b/config.go.example @@ -9,6 +9,7 @@ const ( WifiPass = "SecretWifiPassword" // Networking settings + Hostname = "pico2w-bme280" EnableICMP = true MQTTHost = "192.168.1.50" // Must be an IP address; DNS resolution is not supported currently diff --git a/network.go b/network.go index 44aac91..7d0b031 100644 --- a/network.go +++ b/network.go @@ -115,7 +115,7 @@ func InitNetwork(ssid, pass string) (*NetworkStack, error) { stack := &xnet.StackAsync{} err = stack.Reset(xnet.StackConfig{ - Hostname: "pico2w-bme280", + Hostname: Hostname, RandSeed: time.Now().UnixNano(), MaxActiveTCPPorts: 2, MTU: uint16(framelen - ethernet.MaxOverheadSize),