Skip to content

Latest commit

 

History

History
76 lines (59 loc) · 1.88 KB

MqttBroker.md

File metadata and controls

76 lines (59 loc) · 1.88 KB

MQTT Broker, Mosquitto

user@server:~$ sudo apt-get update
user@server:~$ sudo apt-get install mosquitto
user@server:~$ sudo update-rc.d mosquitto defaults
user@server:~$ sudo /etc/init.d/mosquitto start
root@server:~# service mosquitto status 
mosquitto start/running, process 682
root@server:~# service mosquitto stop
mosquitto stop/waiting
root@server:~# service mosquitto status 
mosquitto stop/waiting
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
root@workstation:~# service mosquitto start
mosquitto start/running, process 3386
root@workstation:~# service mosquitto status
mosquitto start/running, process 3386
root@workstation:~# 
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   

MQTT Broker, VerneMQ

Please refer to VerneMQ Installing on Debian and Ubuntu

Testing

user@server:~$ sudo apt-get install mosquitto-clients

As subscribers

user@server:~$ mosquitto_sub -h serverip -p 1883 -t This/#

As publishers

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