0

I am new to MQTT messaging system, but yet i managed to implement the paho Android service in snapdragon board running AOSP kk-4.4.2 . My service will start at the boot up and it will connect to the public broker of HiveMQ with port 1883 .

The problem is after connecting my Android device running my custom AOSP to the server and if i try to connect another client from the android application which is running on a phone. The client in the snapdragon board automatically disconnects from the server. when i try to reconnect it is connecting to the server again.

I use different client Id and user names while connecting to the server

  • 2
    I would say this is a client id clash, but you say not. Post broker logs and the code you use to connect so we can have a look – hardillb Mar 23 '16 at 17:20
  • Hey hardillb, you were right . I kinda hard coded the client ID I just now figured it out . I gave unique ID and it is working now .. Thanks – Hariprasath Gopal Mar 25 '16 at 02:28
  • have u documented your implementation and could give me a tutorial about it, how to run mqtt in android aosp? – icouldin Nov 24 '20 at 08:36

1 Answers1

7

This is most likely because you are using the same client id for both (all) clients.

Client ids need to be unique and most brokers will disconnect the first connection when a second connects with the same id.

hardillb
  • 54,545
  • 11
  • 67
  • 105