sipeed/picoclaw · error
mqtt connect failed: %w
Error message
mqtt connect failed: %w
What it means
Error "mqtt connect failed: %w" thrown in sipeed/picoclaw.
Source
Thrown at pkg/channels/mqtt/mqtt.go:111
opts.SetOnConnectHandler(func(client pahomqtt.Client) {
logger.InfoC("mqtt", "MQTT connected, subscribing to inbound topic")
err := c.subscribe(client)
once.Do(func() { firstSubscribe <- err })
})
opts.SetConnectionLostHandler(func(_ pahomqtt.Client, err error) {
logger.WarnCF("mqtt", "MQTT connection lost", map[string]any{"error": err.Error()})
})
client := pahomqtt.NewClient(opts)
token := client.Connect()
if !token.WaitTimeout(10 * time.Second) {
client.Disconnect(250)
return fmt.Errorf("mqtt connect timed out after 10s (broker: %s)", c.cfg.Broker)
}
if err := token.Error(); err != nil {
client.Disconnect(250)
return fmt.Errorf("mqtt connect failed: %w", err)
}
if err := <-firstSubscribe; err != nil {
client.Disconnect(250)
return fmt.Errorf("mqtt subscribe failed: %w", err)
}
c.client = client
c.SetRunning(true)
logger.InfoCF("mqtt", "MQTT channel started", map[string]any{
"broker": c.cfg.Broker,
"agent_id": c.cfg.AgentID,
})
return nil
}
// topicPrefix returns the configured topic prefix, normalizing slashes.View on GitHub (pinned to 49183d7e8d)
When it happens
Trigger: Thrown at pkg/channels/mqtt/mqtt.go:111 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15).
Data as JSON: /api/errors/cae65b405850aa4d.
Report an issue: GitHub.