Mosquitto entfernen auf PI

Einrichtung der openHAB Umgebung und allgemeine Konfigurationsthemen.

Moderatoren: seppy, udo1toni

MikeMo
Beiträge: 21
Registriert: 9. Apr 2017 06:34
Answers: 0

Mosquitto entfernen auf PI

Beitrag von MikeMo »

Nach diversen Problemen mit dem Mosquitto Service auf dem PI würde ich diesen gern komplett deinstallieren und neu Anfangen.
Was muss ich genau im Putty eingeben um openhabian komplett von Mosquitto zu entfernen?

Benutzeravatar
udo1toni
Beiträge: 15265
Registriert: 11. Apr 2018 18:05
Answers: 245
Wohnort: Darmstadt

Re: Mosquitto entfernen auf PI

Beitrag von udo1toni »

Du kannst mosquitto direkt über openhabian-config entfernen. Wenn Du dem Tool nicht traust: mosquitto wird ganz normal aus den Paketquellen geholt, das heißt, die Installation läuft über apt. Das gleiche gilt für das Entfernen:

Code: Alles auswählen

sudo apt remove mosquitto
deinstalliert die Software, behält aber die Konfiguration.

Code: Alles auswählen

sudo apt purge mosquitto
entfernt zusätzlich auch noch die Konfigurationsdateien.

Code: Alles auswählen

sudo apt install mosquitto
installiert mosquitto aus den Paketquellen. default hört mosquitto nur auf localhost, das heißt, die Datei /etc/mosquitto/mosquitto.conf muss anschließend angepasst werden.
openHAB4.3.5 stable in einem Debian-Container (bookworm) (Proxmox 8.4.1, LXC), mit openHABian eingerichtet

MikeMo
Beiträge: 21
Registriert: 9. Apr 2017 06:34
Answers: 0

Re: Mosquitto entfernen auf PI

Beitrag von MikeMo »

Danke, es scheint sich einiges deinstalliert zu haben.
nach neu insterlation scheinen aber immer noch Probleme da zu sein.
Da ich auch noch ein Samba Problem habe frage ich mich wie ich an die mosquitto.conf komme?
openhabian@openhabian:~ $ mosquitto
1639919078: mosquitto version 2.0.11 starting
1639919078: Using default config.
1639919078: Starting in local only mode. Connections will only be possible from clients running on this machine.
1639919078: Create a configuration file which defines a listener to allow remote access.
1639919078: For more details see https://mosquitto.org/documentation/aut ... n-methods/
1639919078: Opening ipv4 listen socket on port 1883.
1639919078: Error: Address already in use
1639919078: Opening ipv6 listen socket on port 1883.
1639919078: Error: Address already in use

Benutzeravatar
udo1toni
Beiträge: 15265
Registriert: 11. Apr 2018 18:05
Answers: 245
Wohnort: Darmstadt

Re: Mosquitto entfernen auf PI

Beitrag von udo1toni »

Da steht, dass Port 1883 schon belegt ist.

Welche Version von openHAB nutzt Du?
openHAB4.3.5 stable in einem Debian-Container (bookworm) (Proxmox 8.4.1, LXC), mit openHABian eingerichtet

MikeMo
Beiträge: 21
Registriert: 9. Apr 2017 06:34
Answers: 0

Re: Mosquitto entfernen auf PI

Beitrag von MikeMo »

openHAB 3.1.1
openhabian ##################################################
###############################################################################
## Ip = 192.168.178.140
## Release = Debian GNU/Linux 11 (bullseye)
## Kernel = Linux 5.10.63-v8+
## Platform = Raspberry Pi 4 Model B Rev 1.2
## Uptime = 2 day(s). 1:21:23
## CPU Usage = 1.01% avg over 4 cpu(s) (4 core(s) x 1 socket(s))
## CPU Load = 1m: 0.05, 5m: 0.06, 15m: 0.07
## Memory = Free: 1.75GB (47%), Used: 1.99GB (53%), Total: 3.75GB
## Swap = Free: 2.43GB (100%), Used: 0.00GB (0%), Total: 2.43GB
## Root = Free: 22.76GB (81%), Used: 5.01GB (19%), Total: 28.99GB
## Updates = 0 apt updates available.
## Sessions = 1 session(s)
## Processes = 129 running processes of 4194304 maximum processes
###############################################################################

_ _ _ ____ _
___ ___ ___ ___ | | | | / \ | __ ) (_) ____ ___
/ _ \ / _ \ / _ \ / _ \ | |_| | / _ \ | _ \ | | / _ \ / _ \
| (_) | (_) | __/| | | || _ | / ___ \ | |_) )| || (_) || | | |
\___/| __/ \___/|_| |_||_| |_|/_/ \_\|____/ |_| \__|_||_| | |
|_| 3.1.1 - Release Build

Benutzeravatar
udo1toni
Beiträge: 15265
Registriert: 11. Apr 2018 18:05
Answers: 245
Wohnort: Darmstadt

Re: Mosquitto entfernen auf PI

Beitrag von udo1toni »

Ach so... Mosquitto läuft natürlich als Dienst... Was gibt

Code: Alles auswählen

systemctl status mosquitto
aus?
openHAB4.3.5 stable in einem Debian-Container (bookworm) (Proxmox 8.4.1, LXC), mit openHABian eingerichtet

MikeMo
Beiträge: 21
Registriert: 9. Apr 2017 06:34
Answers: 0

Re: Mosquitto entfernen auf PI

Beitrag von MikeMo »

systemctl status mosquitto
● mosquitto.service - Mosquitto MQTT Broker
Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor pre>
Active: failed (Result: exit-code) since Sun 2021-12-19 14:02:55 CET; 2 da>
Docs: man:mosquitto.conf(5)
man:mosquitto(8)
Process: 64365 ExecStartPre=/bin/mkdir -m 740 -p /var/log/mosquitto (code=e>
Process: 64366 ExecStartPre=/bin/chown mosquitto /var/log/mosquitto (code=e>
Process: 64367 ExecStartPre=/bin/mkdir -m 740 -p /run/mosquitto (code=exite>
Process: 64368 ExecStartPre=/bin/chown mosquitto /run/mosquitto (code=exite>
Process: 64370 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.co>
Main PID: 64370 (code=exited, status=1/FAILURE)
CPU: 44ms

Dec 19 14:02:55 openhabian systemd[1]: mosquitto.service: Scheduled restart job>
Dec 19 14:02:55 openhabian systemd[1]: Stopped Mosquitto MQTT Broker.
Dec 19 14:02:55 openhabian systemd[1]: mosquitto.service: Start request repeate>
Dec 19 14:02:55 openhabian systemd[1]: mosquitto.service: Failed with result 'e>
Dec 19 14:02:55 openhabian systemd[1]: Failed to start Mosquitto MQTT Broker.
lines 1-18/18 (END)
● mosquitto.service - Mosquitto MQTT Broker
Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2021-12-19 14:02:55 CET; 2 days ago
Docs: man:mosquitto.conf(5)
man:mosquitto(8)
Process: 64365 ExecStartPre=/bin/mkdir -m 740 -p /var/log/mosquitto (code=exited, status=0/SUCCESS)
Process: 64366 ExecStartPre=/bin/chown mosquitto /var/log/mosquitto (code=exited, status=0/SUCCESS)
Process: 64367 ExecStartPre=/bin/mkdir -m 740 -p /run/mosquitto (code=exited, status=0/SUCCESS)
Process: 64368 ExecStartPre=/bin/chown mosquitto /run/mosquitto (code=exited, status=0/SUCCESS)
Process: 64370 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=exited, status=1/>
Main PID: 64370 (code=exited, status=1/FAILURE)
CPU: 44ms

Dec 19 14:02:55 openhabian systemd[1]: mosquitto.service: Scheduled restart job, restart counter is at 5.
Dec 19 14:02:55 openhabian systemd[1]: Stopped Mosquitto MQTT Broker.
Dec 19 14:02:55 openhabian systemd[1]: mosquitto.service: Start request repeated too quickly.
Dec 19 14:02:55 openhabian systemd[1]: mosquitto.service: Failed with result 'exit-code'.
Dec 19 14:02:55 openhabian systemd[1]: Failed to start Mosquitto MQTT Broker.
~
~
~
~
~
lines 1-18/18 (END)
● mosquitto.service - Mosquitto MQTT Broker
Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2021-12-19 14:02:55 CET; 2 days ago
Docs: man:mosquitto.conf(5)
man:mosquitto(8)
Process: 64365 ExecStartPre=/bin/mkdir -m 740 -p /var/log/mosquitto (code=exited, status=0/SUCCESS)
Process: 64366 ExecStartPre=/bin/chown mosquitto /var/log/mosquitto (code=exited, status=0/SUCCESS)
Process: 64367 ExecStartPre=/bin/mkdir -m 740 -p /run/mosquitto (code=exited, status=0/SUCCESS)
Process: 64368 ExecStartPre=/bin/chown mosquitto /run/mosquitto (code=exited, status=0/SUCCESS)
Process: 64370 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=exited, status=1/FAILURE)
Main PID: 64370 (code=exited, status=1/FAILURE)
CPU: 44ms

Dec 19 14:02:55 openhabian systemd[1]: mosquitto.service: Scheduled restart job, restart counter is at 5.
Dec 19 14:02:55 openhabian systemd[1]: Stopped Mosquitto MQTT Broker.
Dec 19 14:02:55 openhabian systemd[1]: mosquitto.service: Start request repeated too quickly.
Dec 19 14:02:55 openhabian systemd[1]: mosquitto.service: Failed with result 'exit-code'.
Dec 19 14:02:55 openhabian systemd[1]: Failed to start Mosquitto MQTT Broker.
~
~
~
~
~
lines 1-18/18 (END)

Benutzeravatar
udo1toni
Beiträge: 15265
Registriert: 11. Apr 2018 18:05
Answers: 245
Wohnort: Darmstadt

Re: Mosquitto entfernen auf PI

Beitrag von udo1toni »

Dann muss irgendein anderer Dienst parallel laufen, der den Port 1883 blockiert... Das ist nicht gut.
Was mich etwas irritiert, ist die Anzahl der laufenden Prozesse.

Wie hast Du denn den Rechner exakt aufgesetzt? Was läuft da noch, außer openHAB?
openHAB4.3.5 stable in einem Debian-Container (bookworm) (Proxmox 8.4.1, LXC), mit openHABian eingerichtet

MikeMo
Beiträge: 21
Registriert: 9. Apr 2017 06:34
Answers: 0

Re: Mosquitto entfernen auf PI

Beitrag von MikeMo »

Aufgesetzt mit Etcher und dem Image von Openhab Webseite.
Neben Mosquitto habe ich noch versucht Samba zu instellieren.
Im Openhab habe ich allerdings schon diverse Things und Pages am laufen.

Benutzeravatar
udo1toni
Beiträge: 15265
Registriert: 11. Apr 2018 18:05
Answers: 245
Wohnort: Darmstadt

Re: Mosquitto entfernen auf PI

Beitrag von udo1toni »

Das Image auf der openHAB Website wäre openHABian. Das richtet automatisch Samba ein und stellt mit dem Befehl sudo openhabian-config ein Menü zur Verfügung, über das z.B. auch mosquitto eingerichtet werden kann.

Meine Empfehlung an dieser Stelle: Mach ein Backup aller bisher erstellten Dinge in openHAB und setze das System komplett neu auf - mit Etcher das Image auf die SD-Karte, Boot, warten (ca. 20 Minuten), Zusatzmodule einrichten (über openhabian-config) und Backup zurückspielen. Sowohl Backup als auch Restore funktionieren problemlos mit dem Tool openhab-cli.
openHAB4.3.5 stable in einem Debian-Container (bookworm) (Proxmox 8.4.1, LXC), mit openHABian eingerichtet

Antworten