Broker

Mosquitto

Mosquitto is an open source (BSD licensed) message broker that implements the MQ Telemetry Transport protocol versions 3.1 and 3.1.1. MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model

amikoo@uppboard:~$ sudo apt-get update
amikoo@uppboard:~$ sudo apt-get install mosquitto

root@workstation:~# nano /etc/mosquitto/mosquitto.conf
# Port to use for the default listener.
port 1883
# Boolean value that determines whether clients that connect
# without providing a username are allowed to connect. If set to
# false then a password file should be created (see the
# password_file option) to control authenticated client access.
# Defaults to true.
allow_anonymous true
amikoo@uppboard:~# service mosquitto start
    mosquitto start/running, process 3386
amikoo@uppboard:~# service mosquitto status
    mosquitto start/running, process 3386
Conexiones activas de Internet (servidores y establecidos)
Proto  Recib Enviad Dirección 
local         Dirección remota       Estado      
tcp        0      0 pymelab-ThinkPad:domain *:*                        
tcp        0      0 localhost:ipp           *:*                     ESCUCHAR   
tcp        0      0 *:1883                  *:*                     ESCUCHAR   
tcp        0      0 *:8123                  *:*                     ESCUCHAR

Testing

amikoo@uppboard:~$ sudo apt-get install mosquitto-clients

As subscribers

amikoo@uppboard:~$ mosquitto_sub -h serverip -p 1883 -t This/
#

As publishers

amikoo@uppboard:~$ mosquitto_pub -h serverip -p 1883 -t This/Topic -m 
"Hello All!"

Last updated