Code Monkey home page Code Monkey logo

Comments (5)

shamblett avatar shamblett commented on July 26, 2024

Not sure what you are trying to do here, you don't explain what 'successfully connected' means nor what 'the tools available' means.

MQTT is a broker based protocol, i.e. you need an MQTT broker running somewhere, your apps use the MQTT client to connect to the broker and exchange messages between themselves via the broker.

You cannot connect applications together using MQTT clients alone. Please read the MQTT spec or look at some of the examples in the examples directory in the repository.

from mqtt_client.

WeiFangChou avatar WeiFangChou commented on July 26, 2024

I am currently working on two Flutter chat apps that are intended to function as chat applications using MQTT for communication. However, I am facing an issue where the two apps are unable to communicate with each other using MQTT. Strangely, each app can successfully communicate with the MQTTX tool individually.

from mqtt_client.

shamblett avatar shamblett commented on July 26, 2024

What is the MQTTX tool? Which MQTT broker are you using?

from mqtt_client.

WeiFangChou avatar WeiFangChou commented on July 26, 2024

Title: Unable to establish communication between two Flutter apps using MQTT

Description:
I have developed two Flutter apps that can communicate via MQTT. However, I'm encountering an issue where each app can only communicate with the MQTTX testing tool, but not with each other.

Steps to reproduce:

Set up two Flutter apps with MQTT communication capabilities.
Configure the MQTT broker details (hostname, port, authentication) in both apps.
Establish MQTT connections in both apps using unique client IDs.
Subscribe to and publish messages using MQTT topics in each app.
Attempt to send messages between the two apps.
Expected behavior:
The two Flutter apps should be able to establish MQTT communication and exchange messages with each other.

Actual behavior:
Despite the correct MQTT broker configuration and unique client IDs, the two Flutter apps fail to communicate directly. They can only communicate with the MQTTX testing tool individually.

Additional information:

I have verified that the MQTT broker settings are identical in both apps.
I have checked the topic subscriptions and message publishing configurations in each app.
There are no firewall or network restrictions affecting the MQTT communication.
The MQTTX testing tool works fine with both apps, indicating that the apps' MQTT functionality is functional.
Please provide guidance or suggestions on how to resolve this issue and enable communication between the two Flutter apps. Thank you.

from mqtt_client.

WeiFangChou avatar WeiFangChou commented on July 26, 2024

Solution
I found MqttConnectMessage() use same clientID

from mqtt_client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.