Mosquitto MQTT Broker

install mosquitto iconMosquitto is a lightweight open source message broker that Implements MQTT versions 3.1.0, 3.1.1 and version 5.0

It is written in C by Roger Light, and is available as a free download for Windows and Linux and is an Eclipse project.

The main website is here.

MQTT Version 5.0 Support Notes:

As of release 1.6 the mosquitto broker supports MQTT v5 in addition to MQTT v3.11.

You can continue to use the older version 3.11 clients with the latest broker.

Mosquitto v2 introduced some important changes that affect first time users in particular.

By default it requires authentication and doesn’t listen on a network address.

The following simple configuration file will make mosquitto start like previous versions:

listener 1883
allow_anonymous true

Installing The Broker

To use it you will first need to install it.

Special Note dec 12-2020: The latest version 2.x departs considerably from previous 1.6 versions in the install security and so for beginners I would recommend you stay with the older 1. x versions for the time being.

Starting and Stopping The Broker

Depending on the install it will probably be started automatically on system startup.

Although this is very desirable in production environments it is less so in test environments.

My preferred approach is to stop the mosquitto service and start it manually from the command prompt.

This gives you access to the console which is invaluable for testing.

On Windows you can stop the service if it is running by using the control panel>admin>services.

You can also the net command:

net stop mosquitto

On Linux use:

sudo service mosquitto stop
sudo systemctl stop mosquitto.service

Starting from command line is the best option when testing and to do that use:

Windows and LInux

mosquitto -v   #start in verbose mode

To see other start options use:

mosquitto -h

By default the broker will start listening on port 1883.

You can change that by editing the configuration file-mosquitto.conf. See Quick Guide to The Mosquitto.conf File With Examples

Alternatively you can use a command line switch to specify the port e.g.

mosquitto -p 1884

You can run Multiple brokers on the same machine by starting them on different ports See this video- on running multiple brokers.

Mosquitto Client Programs

The mosquitto install includes the client testing programs.

There is a simple subscriber client

mosquitto_sub

and a publisher client

mosquitto_pub

They are useful for some quick tests.

See Using The Mosquitto_pub and Mosquitto_sub Client Tools- Examples

Common Questions and Answers

Q- Are messages stored on the broker?

A- Yes but only temporarily. Once they have been sent to all subscribers they are then discarded.

Q -Is there a limit to the message size allowed by a broker?

A- MQTT imposes a maximum message size limit of 268,435,456 bytes. You can restrict the maximum message size the broker will accept using:
message_size_limit limit
e.g
message_size_limit 1000

in the mosquitto configuration file. Messages received greater than the limit are dropped by the broker.

Q- Does the broker need a configuration file to start?

A- No

Q- What is the persistence setting in the mosquitto conf file?

A- When enabled the broker stores temporary data like persistent connections,retained messages,last will messages to a file. If the server is restarted then the values are restored.

Resources

Other Tutorials

Please rate? And use Comments to let me know more
[Total: 15   Average: 4.5/5]

92 comments

  1. Hi Steve
    I am using mosquito version mosquitto-1.6.13-install-windows-x64 (https://mosquitto.org/files/binary/win64/mosquitto-1.6.13-install-windows-x64.exe. For this I am able to publish and subscribe messages in mosquito broker using self-signed Certificate.

    But when I am using higher version of (2 series) mosquito i.e. mosquitto-2.0.7-install-windows-x64 getting following errors while subscribing and publishing
    1) While Subscribing
    mosquitto>mosquitto_sub -h -t test -p 8883 –cafile “C:\Program Files\mosquitto\certs\ca.crt” –tls-version tlsv1.2
    Connection error: Connection Refused: not authorised.

    2) While Publishing
    mosquitto>mosquitto_pub -h -t test -m “message” -p 8883 –cafile “C:\Program Files\mosquitto\certs\ca.crt”
    Connection error: Connection Refused: not authorised.
    Error: The connection was refused.

    3) In Mosquitto broker
    mosquitto>mosquitto -c mosquitto.conf -v
    1612757601: The ‘port’ option is now deprecated and will be removed in a future version. Please use ‘listener’ instead.
    1612757601: mosquitto version 2.0.7 starting
    1612757601: Config loaded from mosquitto.conf.
    1612757601: Opening ipv6 listen socket on port 1883.
    1612757601: Opening ipv4 listen socket on port 1883.
    1612757601: mosquitto version 2.0.7 running
    1612757610: New connection from fe80::a808:ae55:d7a3:53dd:57512 on port 1883.
    1612757610: Sending CONNACK to fe80::a808:ae55:d7a3:53dd (0, 5)
    1612757610: Client disconnected, not authorised.
    1612757614: New connection from fe80::a808:ae55:d7a3:53dd:57515 on port 1883.
    1612757614: Sending CONNACK to fe80::a808:ae55:d7a3:53dd (0, 5)
    1612757614: Client disconnected, not authorised.

    4) a) If I am trying with 127.0.0.1
    mosquitto>mosquitto_sub -h 127.0.0.1 -t test -p 8883 –cafile “C:\Program Files\mosquitto\certs\ca.crt” –tls-version tlsv1.2
    Error: A TLS error occurred.
    b) In Broker
    New connection from 127.0.0.1:57527 on port 8883.
    1612757656: OpenSSL Error[0]: error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error
    1612757656: Client disconnected: Unknown error.

    I have used for all versions of 2.0 and higher same error I am receiving Connection error: Connection Refused: not authorised.

    We want to use latest 2.0.7 version can you please tell me why this version is not working.

    Thanks

      1. Thanks Steve, I want to ask one more thing I was trying to subscribe in my .net API I am getting error in mosquitto
        OpenSSL Error[0]: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca

        1. Not sure of the question anonymous access was previously allowed by default and now it isn’t and so you have to explicitly allow it.

          1. Thanks Steve for the info.

            I am now getting this error locally SUB and PUB is working with thus certificate through one simulator it is giving this error

            New connection from ::1:52610 on port 8883.
            1613127049: OpenSSL Error[0]: error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate
            1613127049: Client closed its connection.

          2. Hi Steve,
            I am using one localhost(IIS Express) certificate that is working fine while subscribing, now I have created one child certificate Common Name mentioning as IP address of my machine.
            I am getting below error while subscribing through this certificate.

            New connection from 10.61.49.71:53431 on port 1884.
            OpenSSL Error[0]: error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate
            Client closed its connection.

            Thanks,
            Yogendra

  2. Hi Steve,

    My field machine remains offline most of the time but should subscribe to Mosquitto broker once online and able to receive all messages published so far from other field devices..
    Also once my machine is able to receive those messages, those messages need to be cleared from broker.
    Please help me with “How To” for the same.

    Regards
    Dipankar

    1. You need to publish messages with qos of 1 or 2. You machine should use a non clean session and subscribe with qos of 1 or 2. The messages will be deleted once the subscriber has received them.

      1. Thanks a lot Steve for your prompt help. I also need to store the message securely and encrypted. Is there any message store associated with Mosquitto that helps in persisting the messages securely till my field machine subscribes to the topic and received all of them.

        1. Yes they are stored in persistent store on the broker. Limit is usually around 100 messages but you will need to check
          rgds
          steve

          1. Hi Steve,
            Thanks for the tips on how broker can persist the messages received from the filed devices. However, would like to know how the payload can be encrypted during data persistence phase.

            To summarize, I can use MQTTS with valid certificate for TLS v1.2 communication between client and broker and thereby the message payload published by MQTT client will be encrypted during transit.

            However, once it is received by Mosquitto broker and till the time the messages are subscribed, Mosquitto broker need to store the payload encrypted.

            So, please help me with mechanism to encrypt, store, decrypt the payload

          2. Hi Steve,

            I need another help. For persisting the messages, is there any better and optimized alternative than storing in database. There may be huge overhead of storing telemetric data in database. Do we have any other type of message storing mechanism that is more efficient?

      2. what is the primary item by which the broker tracks the connection?
        If broker and client from different vendors,how password is encrypted in unique way

        1. The connection id of the client is used to track the connection. Passwords and usernames are not encrypted by mqtt

          1. Thanks for the reply.
            can we use same procedure for authentication if broker and client are from different vendors?
            should we provide username and password for every publish and subscribe?
            Is there any function for adding the users in password file other than manually adding through the mosquitto_passwd utility

            Thank you.

          2. The protocol is vendor neutral. Whether you use a username/passsword on each pub/sub depends on the application. There is no automatic way of generating the password file as far as I know.

  3. Hi, getting there.
    Thanks for the videos and texts, also the downloads that are pretty good.
    A few days in and I have a test MQTT pi set up, I upset my home one so I backed out and set the new one up so I could keep the lights on!

    Slow progress but “FUN”.

    A Question, of course.
    I am using a hyperlink in a web page that opens a new page, so far so good. When the new page opens can I get it to publish an MQTT (over websockets) as part of the new pages code?
    Then I can make other stuff happen at the same time as the web page opens.

    Looking for an; “It’s possible answer” and then I will carry on trying to make that happen. If not pos’ I need to decide how to progress my project.
    Of course any pointers would be appreciated.
    Thanks

    1. If I understand it correctly you want it to run a script when the page opens. If so the anser is yes by using the onload in the body tag as shown in the code below

      This is taken from a working script and calls the connect but you can call any function you want.
      Rgds
      Steve

  4. Hi,
    I am running Mosquitto on a virtual machine and it is working fine. There are around five devices sending constantly via the broker without problems. Yet, I have a problem with one single device. Somehow it doesn’t connect to Mosquitto although the IP and port settings are like the other devices. I tried it with a public server and it is sending there. Do you know what the problem could be there?
    Best,
    Mike

    1. Hi
      Do you have restrictions on the broker i.e username/password/ ACl connection limits etc.
      Can you ping the broker from the client machine?
      Rgds
      Steve

      1. Hi,
        I just left the Mosquitto settings as they were when I installed it. So I guess there are no restrictions on that, or are there ACI connection limits by default? The username and password are also not used by the other devices.
        Is it possible that somehow Mosquitto blocks certain devices for some reason?
        The device itself has a limited user interface, so it’s not possible to ping the broker.
        Best,
        Max

        1. On a default broker install there are no restrictions. Do you have access to the broker console so that you can see the connection attempt. Are you using MQTT on the client or mqtt over websockets.If you are using websockets then mosquitto will need to be configured.
          Rgds
          Steve

  5. Hi,

    Have a broker running on 127.0.0.1, now trying to publish via a nodemcu to local broker. It does not connect to local broker. If i use test.mosquitto.org i am able to punlish and subscribe. What would my local broker be called or the address ???
    New and confused

    1. Ho 127.0.0.1 is the machine you are sitting at. To find the IP address of the machine go to the machine and open a command prompt and type
      ipconfig (windows)
      ifconfig (linux)

      If you know the name of the machine you could always try and use the name.
      Rgds
      Steve

      1. Thanks again for your swift reply.

        When i first installed mosquitto i was able to use the ip of the machine to succesfully publish and subscribe. The second time it did not work with the machine ip until i found that mosquitto broker was running at 127.0.0.1. Then i was able to publish and subscribe succesfully.
        im now trying to get a nodemcu to act as a client but it will not recognise 127.0.0.1 and is unable to connect to mqtt server. I then decided to connect it test.mosquitto.org and all is well. I wish to use my local broker so if internet connection is lost my network and broker will all still work.

        Any furthur help would be great.

        1. Hi
          127.0.0.1 is the default IP for you local machine but it has a proper IP address like 192.168.1.21. That is the IP address you need However you can configure the broker to only respond to requests to a certain IP address but by default you don’t. check the config file and make sure that the address 127.0.0.1 isn’t mentioned it it is remove it.

  6. How many esp32 clients can be connected simultaneously to a raspberry pi 3 acting as a local mqtt server(running mosquitto)

  7. Hi Steve
    I am learning Linux and mqtt,i have tried mosquitto publish and subscribe on my localhost and it’s worked.
    But ,when i rent a IDC linux(centos 8) machine and install mosquitto,
    then,i publish a topic to this linux ip 192.168.168.100 ,it’s always show TimeoutError: [WinError 10060]
    i still can’t find any solution,could you help me?
    1.i try to publish a topic from my localhost to mosquitto test server : test.mosquitto.org and subscribe
    from linux ,it’s worked….so,i don’t know what’s wrong…
    2.use python paho to publish from my localhost to test.mosquitto.org and subscribe from linux is worked.

  8. Hi
    It seems like Mosquitto will not read the Mosquitto database used for persisting when starting up. I have configured the following for Mosquitto:

    persistence true
    persistence_file mosquitto.db
    persistence_location /tmp/

    I publish a few topics with QoS 2 and retained. When terminating Mosquitto the output is as expected:

    1598259315: mosquitto version 1.6.11 terminating
    1598259315: Saving in-memory database to /tmp/mosquitto.db.

    If i cat /tmp/mosquitto.db, I can see it contains my retained messages.

    When starting Mosquitto again, I expected to see that it read the database and that the retained messages I had published before terminating Mosquitto, would still be available (without having to re-publish them):

    mosquitto -c /mosquitto/config/mosquitto.conf
    1598259446: mosquitto version 1.6.11 starting
    1598259446: Config loaded from /mosquitto/config/mosquitto.conf.
    1598259446: Opening ipv4 listen socket on port 1883.
    1598259446: Opening ipv4 listen socket on port 8883.
    1598259446: Opening ipv6 listen socket on port 8883.
    1598259446: mosquitto version 1.6.11 running

    But as shown above, there is no indication that the database have been read (should it say something about that?) and my retained messages are gone.

    Do I need something else in my configuration, or have I misunderstood the persistence feature?

    Thanks
    Tue

    1. Hi
      I just tested it and it works. You might be reading the wrong .db file change the path in the conf file to a full file path.
      Rgds
      Steve

      1. Hi Steve
        Thanks a lot for your quick reply. I have tried several combinations of setting the filename and the path, also some that should not be valid according to the documentation, but nothing works. Should Mosquitto write something to stdout/stderr when starting that it is reading the database (like it does when writing the database)? Which persistence settings did you use?
        Can it be my publish that needs something before it is persisted. I have tried with the following publish:

        mosquitto_pub -h 127.0.0.1 -p 1883 -u xxx -P xxx -t test123 -m “test message” -q 2 -r

        Best regards

        Tue

        1. No it doesn’t tell you it is reading the database you do get an error that it is can’t write. Have you checked the timestamp on the file to check it is being updated?
          Also try without username/password as I didn’t check it with security.
          Other than that the settings are the same as you config file.
          I also just noticed that you are using a slightly newer version than I am. Are you on windows or Linux?
          Also I’m not sure that I use the persistence location I can’t check it at the moment try commenting that out
          Rgds
          Steve

          1. Hi
            Just checked my file and I used
            persistence true
            persistence_location /home/pi/mos
            rgds
            steve

          2. Hi Steve
            I have found the issue now. The problem is that mosquitto.db is written by the mosquitto user, but it seems like it reads it before it drops priveledges to the mosquitto user at startup. For this reason, the file can not be read unless I change the permissions before restarting mosquitto.
            -rw——- 1 mosquitt mosquitt 3095 Aug 26 06:57 /home/mos/mosquitto.db
            Thanks for your support!
            Tue

  9. Steve,
    I have been working with a setup using Node-red on a Pi3 with mosquitto as the broker. The client is a ESP32. This is a weather station I am trying to setup and used the N-R-Dashboard for the output. This all works fine and I have a nice display of the information that I can access on my Iphone(Safari), Pi3/4 (Chromium), IPad(Safari)(Chrome). All of these work well initially but after a day or so it starts giving me “lost connection” messages and is very intermittent then eventually it just stops providing any info. I am watching the Mosquitto log and I see message being received and sent, but nothing on the dashboard. Not sure were I should go from here. Been looking through your website but haven’t found the key to this problem.
    Thanks,
    Ken

    1. I’m assuming you are keeping the dashboard open all of the time. If you are then I would suspect a websockets timeout issue. If you close the browser and reconnect is it ok.
      Rgds
      Steve

      1. Steve,
        I just ran the experiment. Closed the Chromium browser on my Pi4. Re-Opened and then entered the address of the dashboard host etc. Continued to get a “Connection Lost” notification in the top bar of the Dashboard. The only time I get reliable Dashboard info is after reboot the Pi3 NR computer. Then it will report timely complete info for about a day and this on any of my other computers.
        thanks,
        Ken

        1. Hi
          Did you check that basic networking was working on the pi by doing a ping.If you start node-red manually from the command prompt you may also see something on the console that may help.
          Rgds
          Steve

          1. When I run a 10 ping sequence I get about 170 ms avg. response. but the dashboard never completely loads all the content but I can see all the message go thru mosquitto.

          2. Not sure of your question, “What dashboard are you using”. Dashboard from Node-red v1.1.2.
            This Node-red is running on a Pi3 and I view thru various browsers on Ipad, iphone, a pi4 using chromium etc.
            Thanks,
            Ken

          3. Hi
            Can you send me the flow you can post it in the comments or if it is one you downloaded from me tell me which one
            rgds
            Steve

  10. Hi
    I run Mosquitto on Pi with a connection from ESP32.
    I read data with ESP32 from Xiaomi temperature. Everything is fine, but after a while I lose contact with MQTT and I can’t publish anything. I checked and it doesn’t go into the “if (client.connected())” anymore, just in ” else { ”

    void publish(const char* addr, char* valueName, char* value) {
    char topic[50];
    sprintf(topic, “%s/%s/%s”, MQTT_PREFIX, addr, valueName);
    if (client.connected()) {
    Serial.print(“connected —— “);
    // client.publish(topic, value);
    client.loop();
    // Serial.print(“dupa loop – “);
    }
    else {
    Serial.println(“don’t connected—– “);
    // reconnect();
    // Serial.println(“Dupa reconectare – “);
    }

    Best regards
    Mihai

  11. Hi Steve, and thanks for your contributions to our understanding of MQTT!

    I’m trying to use mosquitto as a message-passing server. I want one part of the topic space (a/b/c/#) to be fully public (anybody can read/write.) And I want access to #SYS/ to be limited to the host the mosquitto server is running on. I’ll run a website there that subscribes to $SYS/broker to display current stats.

    I can’t figure out how to do this, either with a listener on a different port or with a user/password combo. In some cases mosquitto’s reporting errors on config file lines that don’t exist so I’m not sure what’s going on.)

    I’d expect this to be a common configuration but googling isn’t turning up anything helpful. Any suggestions? Or is there a better way to accomplish what I want?

    Thanks!

  12. Hi Steve,

    Thanks for your sharing the information.I have a question when using mosquitto and need your help.

    I have mosquitto broker running on the Ubuntu, use 6 embedded devices as the client for publishing information, and another client running on the Ubuntu subscribes to the information.However, some embedded devices will be disconnected after running for 1 week or 2 weeks, and the log infomation,
    1589849321: New connection from 192.168.1.114 on port 1883.
    1589849322: Socket error on client , disconnecting.

    The mosquitto.conf is as follows,
    message_size_limit 0
    port 1883
    max_connections -1
    require_certificate false
    persistence false

    I read a few posts you wrote and found that I did not use a CA certificate. Is this the problem? Can I use mosquitto normally without using this method?

    Regards,

    Andrew

    1. Can you just clarify what is happening.
      An embedded client disconnects and when it tries to reconnect it is rejected? is this what is happening.

      Is the client using a clean session? how long does the client remain disconnected?

      1. Hi Steven,
        Thanks for your response.
        After an embedded client works for a few days, there is a sudden disconnection and the broker cannot be connected again.It seems that mosquitto broker did not send CONNACK.
        The embedded client uses a clean session. Normally, after disconnecting, the client cannot connect to the server again. In this case, the device can only be powered off and restarted.

        Regards,

        Andrew

          1. Hi Steve,
            I am using paho.mqtt.embedded-c packet.I designed a state machine to handle connection, ping request and subscription information. And used a task of FreeRTOS to run this state machine.

            Thanks and regards,
            Andrew

  13. Hi Steve,

    Thanks for the quick guide.

    I have Mosquito broker and client installed on my raspberry pi, which I intend to create home automation solution.

    How many device maximum is best to be connected to the broker for efficiency, that is without having it to crash?

    Regards

    1. I have tested it to 1000 connections as on Linux users are limited to approx 1000 open ports.
      rgds
      Steve

  14. Hello Steve,

    In my system target, I want to use the mosquitto – client. Is this possible? Currently, I am not planning to use the mosquito broker. I downloaded the mosquito library with the broker and client and I can see a client in it.

    Thanks and regards – Dilip Jayavant

  15. I got the broker running on Ubuntu 18.04. Can use Pub and Sub and see messages. However, can’t make an MQTT connection on Windows machine on same local LAN subnet using MQTT Lens or MQTT Box. No WS or TLS so far.. Just basic connections. On that same Win machine connect using PuTTY to tcp port 1883. Any thoughts?

      1. Yes, I can connect to mqtt.eclipse.org using MQTT Box or Lens on a Windows machine. That is how I have been doing my testing.

        I’m able to connect to my internal broker ONLY through the Pub and Sub on the SAME linux box as the broker. I can, however, make a TCP connection to the broker linux box, port 1883 from the Windows machine. So I don’t believe it is a network routing issue.

        Thanks for your help.
        Tom

        1. In that case I would check the configuration of the broker. Is it configured for websockets and TLS
          rgds
          Steve

    1. Hi Steve,
      I am using Mosquitto running on Windows 7 machine. I can pub and sub using two different cmds on the same machine.
      I am trying to connect MKR1000 with this Mosquitto broker using its IP address but my pubsubClient.connect() fails with error state -2.

      Following your Post, I have configured mosqquitto with mosquitto-2.conf with:
      listener 1883
      allow_anonymous true
      max_packet_size 1280

      Any hint?

      Ehsan

  16. Hi Steve,
    I have requirement with mosqitto where one set of client would like to connect to mosquito with using TLS (certificate) but use passwords using port (1883)

    The other set of clients would like to connect with TLS and certificates. but using a different port (8883)

    Is this configuration possible ?

    If this is not possible can I run two copies of Mosquitto (with two different configuration file) listening on two ports ? as a service ?

  17. Hi Steve,
    Thanks to your guide, I was able to successfully log messages coming to the broker into a text file and then using python script load the data/messages from the text file into the database.
    But I want to make this process real time, so is there a session id or something based on which I can create separate text files for the messages from broker? using which i can schedule my python script as well to run once the session expires? Or is there a better way to have the messages coming to broker be updated into the database as soon as it reaches the broker?

      1. Hi Steve,
        Thanks for the guidance, but I am not storing the messages directly, i am trying to parse the single message hex data recevied into mutilple decimal values. Since the incoming rate of messages is high, some of the data gets lost during parsing. So is there a way I can parse the data realtime and publish on webpages and store in db as well?

        1. Rose
          Did you try the script as the logging takes place in a separate thread. Do you have any idea of the messages/sec and I can try it.
          Rgds
          Steve

          1. Yes I am doing the parsing in a separate thread, and calling the data from the queue. Still the data seems to be lost.

            Around 6 messages 128 bytes long are being received in a second, each message is hex data and i’m parsing it into 7 decimal values and storing these 7 decimal values in db and sending over websocket.
            Will using node.js be a better option instead of python?

  18. Hi Steve,
    So I’ve been doing the python tutorials with an external broker, and am currently trying to connect to a local mosquitto broker instance but am having a bit of trouble understanding the connect() command arguments. Any ideas?

    thanks

  19. Hi Steve,
    We have subscribed to a basic package of freeboard and we are facing difficulties in linking our test mosquitto MQTT server to freeboard.
    We have successfully completed the data transfet between the TEST MOSQUITTO SERVER and OUR PLC.
    The below are the configuration settings in our PLC ( Programmable Logic Controller )

    1. TYPE : MQTT
    2. NAME : ( Any name )
    3. TOPIC : qwerty ( Advice )
    4. SERVER : 37.187.106.16 ( Advice )
    5. PORT : 1883
    6. USE ENCRYPTION : NO
    7. CLIENT ID : mqttdemo ( Advice )
    8. API KEY / USERNAME : steve
    9. PASSWORD : john
    10. JSON MASSAGES : no

    With these settings we tried these out, But the connection could not be accomplished. Please advice.

    Regards,

    Satheesh Kumaran

    1. Can you point me to the instructions you are following.You might also want to use the ask steve page as I don’t have a freeboard account and you might need to let me access using yours.
      rgds
      steve

  20. Hi Steve.
    Thanks for your publications. I recently had a question for you and your answer was very helpful. I have another one. I installed Mosquitto broker in Raspberry Pi. After a lot of problems I finally managed to have it running. I have one application (IoTView by an industrial software manufacturer) who is accessing the broker, suscribing and publishing. At the same time I have another application (Web Studio) from the same manufacturer running on a PC, acting as a server who records the information on a database. On the tests, only one of them (IoTView) could run with no problems, while the other one stop working. I have been doing modifications for several months thinking the problem was on the application. Yesterday the manufacturer let me know the problem was on the Broker running on Raspberry Pi. It could not attend two connections at the same time…. Since you know this subject more than anyone I know, I would like your opinion. Is that so? It makes no sense for me that the broker on Raspberry Pi can attend only one connection at the same time. Is there not a parameter whom I can modify to alter this? The manufacturer reccomendation was to switch and install a broker on the Server. The PC running windows.

    1. Hi
      I run Mosquitto on Pi with multiple connections. Are you using different client names for the clients? The client ID needs to be unique.
      Also start the broker with the -v option so you can see the connections and responses.
      rgds
      steve

Leave a Reply

Your email address will not be published. Required fields are marked *