sipeed/picoclaw · error

mqtt connect timed out after 10s (broker: %s)

Error message

mqtt connect timed out after 10s (broker: %s)

What it means

Error "mqtt connect timed out after 10s (broker: %s)" thrown in sipeed/picoclaw.

Source

Thrown at pkg/channels/mqtt/mqtt.go:107

	firstSubscribe := make(chan error, 1)
	var once sync.Once

	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,
	})

View on GitHub (pinned to 49183d7e8d)

When it happens

Trigger: Thrown at pkg/channels/mqtt/mqtt.go:107 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/5d3694b36e4beb16. Report an issue: GitHub.