User Tools

Site Tools


domoticz:mosquitto

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
domoticz:mosquitto [2023/10/20 06:45] – [Testing] oscardomoticz:mosquitto [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-====== Mosquitto ====== 
- 
----- 
-==== Installing ==== 
-Install the packages: 
-<code> 
-# apt-get install mosquitto 
-# apt-get install mosquitto-clients 
-</code> 
- 
-Update the config file: 
-<code> 
-# nano /etc/mosquitto/mosquitto.conf 
------------------------------------- 
-pid_file /run/mosquitto/mosquitto.pid 
- 
-persistence true 
-persistence_location /var/lib/mosquitto/ 
- 
-include_dir /etc/mosquitto/conf.d 
- 
-allow_anonymous true 
-listener 1883 0.0.0.0 
- 
-log_dest file /var/log/mosquitto.log 
-log_type error 
-log_type warning 
-#log_type notice 
-#log_type information 
- 
-connection_messages true 
-log_timestamp true 
-</code> 
-Check status: 
-<code> 
-# systemctl status mosquitto.service 
------------------------------------- 
-● mosquitto.service - Mosquitto MQTT Broker 
-     Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; preset: enabled) 
-     Active: active (running) since Fri 2023-10-20 08:29:19 CEST; 1s ago 
-       Docs: man:mosquitto.conf(5) 
-             man:mosquitto(8) 
-    Process: 1120 ExecStartPre=/bin/mkdir -m 740 -p /var/log/mosquitto (code=exited, status=0/SUCCESS) 
-    Process: 1122 ExecStartPre=/bin/chown mosquitto /var/log/mosquitto (code=exited, status=0/SUCCESS) 
-    Process: 1123 ExecStartPre=/bin/mkdir -m 740 -p /run/mosquitto (code=exited, status=0/SUCCESS) 
-    Process: 1124 ExecStartPre=/bin/chown mosquitto /run/mosquitto (code=exited, status=0/SUCCESS) 
-   Main PID: 1125 (mosquitto) 
-      Tasks: 1 (limit: 1571) 
-        CPU: 110ms 
-     CGroup: /system.slice/mosquitto.service 
-             └─1125 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf 
- 
-okt 20 08:29:19 raspberrypi systemd[1]: Starting mosquitto.service - Mosquitto MQTT Broker... 
-okt 20 08:29:19 raspberrypi mosquitto[1125]: 1697783359: Error: Unable to open log file /var/log/mosquitto.log for writing. 
-okt 20 08:29:19 raspberrypi systemd[1]: Started mosquitto.service - Mosquitto MQTT Broker. 
-</code> 
- 
-==== Testing ==== 
-In your existing terminal, subscribe to the “testtopic” topic 
- 
-  # mosquitto_sub -h localhost -t "testtopic" -v 
- 
-Then open another terminal and send a message on that topic 
- 
-  # mosquitto_pub -h localhost -t "testtopic" -m "Testing" 
  
domoticz/mosquitto.1697784340.txt.gz · Last modified: by oscar