-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3fde94
commit cc66a03
Showing
60 changed files
with
833 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
drafts/test.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
// Place your crycode.de-website-public workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and | ||
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope | ||
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is | ||
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | ||
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. | ||
// Placeholders with the same ids are connected. | ||
// Example: | ||
// "Print to console": { | ||
// "scope": "javascript,typescript", | ||
// "prefix": "log", | ||
// "body": [ | ||
// "console.log('$1');", | ||
// "$2" | ||
// ], | ||
// "description": "Log output to console" | ||
// } | ||
|
||
"Abbr Tag": { | ||
"scope": "markdown", | ||
"prefix": "abbr", | ||
"body": "{% abbr $TM_SELECTED_TEXT %}", | ||
"description": "Add abbr Nunjunks Tag to the selected text" | ||
}, | ||
|
||
"IMG Tag": { | ||
"scope": "markdown", | ||
"prefix": "img", | ||
"body": "{% img $TM_SELECTED_TEXT thumb: $1 %}", | ||
"description": "Add img Nunjunks Tag" | ||
}, | ||
|
||
"Grid Tag": { | ||
"scope": "markdown", | ||
"prefix": "grid", | ||
"body": [ | ||
"{% grid $1 %}", | ||
"$2", | ||
"{% endgrid %}" | ||
], | ||
"description": "Add grid Nunjunks Tags" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file added
BIN
+8.09 KB
posts/grundlagen-und-installation-von-iobroker/influxdb2-setup-1-thumb.webp
Binary file not shown.
Binary file added
BIN
+23.2 KB
posts/grundlagen-und-installation-von-iobroker/influxdb2-setup-1.webp
Binary file not shown.
Binary file added
BIN
+13.8 KB
posts/grundlagen-und-installation-von-iobroker/influxdb2-setup-2-thumb.webp
Binary file not shown.
Binary file added
BIN
+55.5 KB
posts/grundlagen-und-installation-von-iobroker/influxdb2-setup-2.webp
Binary file not shown.
Binary file added
BIN
+14.3 KB
.../grundlagen-und-installation-von-iobroker/iobroker-adapter-influxdb-aktivieren-thumb.webp
Binary file not shown.
Binary file added
BIN
+49.6 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-influxdb-aktivieren.webp
Binary file not shown.
Binary file added
BIN
+12.4 KB
...grundlagen-und-installation-von-iobroker/iobroker-adapter-influxdb-aktivieren2-thumb.webp
Binary file not shown.
Binary file added
BIN
+45.2 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-influxdb-aktivieren2.webp
Binary file not shown.
Binary file added
BIN
+19.2 KB
...undlagen-und-installation-von-iobroker/iobroker-adapter-influxdb-einstellungen-thumb.webp
Binary file not shown.
Binary file added
BIN
+57.6 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-influxdb-einstellungen.webp
Binary file not shown.
Binary file added
BIN
+20.6 KB
...rundlagen-und-installation-von-iobroker/iobroker-adapter-influxdb-installation-thumb.webp
Binary file not shown.
Binary file added
BIN
+117 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-influxdb-installation.webp
Binary file not shown.
Binary file added
BIN
+12.1 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-influxdb-laeuft-thumb.webp
Binary file not shown.
Binary file added
BIN
+35.6 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-influxdb-laeuft.webp
Binary file not shown.
Binary file added
BIN
+10.2 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-influxdb-suche-thumb.webp
Binary file not shown.
Binary file added
BIN
+34.8 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-influxdb-suche.webp
Binary file not shown.
Binary file added
BIN
+13.1 KB
...undlagen-und-installation-von-iobroker/iobroker-adapter-influxdb-verlaufsdaten-thumb.webp
Binary file not shown.
Binary file added
BIN
+37.2 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-influxdb-verlaufsdaten.webp
Binary file not shown.
Binary file added
BIN
+18 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-sql-einstellungen-thumb.webp
Binary file not shown.
Binary file added
BIN
+51.8 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-sql-einstellungen.webp
Binary file not shown.
Binary file added
BIN
+19.3 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-sql-installation-thumb.webp
Binary file not shown.
Binary file added
BIN
+109 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-sql-installation.webp
Binary file not shown.
Binary file added
BIN
+9.9 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-sql-laeuft-thumb.webp
Binary file not shown.
Binary file added
BIN
+28.1 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-sql-laeuft.webp
Binary file not shown.
Binary file added
BIN
+9.8 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-sql-suche-thumb.webp
Binary file not shown.
Binary file added
BIN
+33.1 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-sql-suche.webp
Binary file not shown.
Binary file added
BIN
+31.7 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-adapter-thumb.webp
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+10.1 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-admin-ui-thumb.webp
Binary file not shown.
Binary file added
BIN
+28.6 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-admin-ui.webp
Binary file not shown.
Binary file added
BIN
+18.9 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-objekte-thumb.webp
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+14.9 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-vis2-einstellungen-thumb.webp
Binary file not shown.
Binary file added
BIN
+42.5 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-vis2-einstellungen.webp
Binary file not shown.
Binary file added
BIN
+14.4 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-vis2-installation-thumb.webp
Binary file not shown.
Binary file added
BIN
+128 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-vis2-installation.webp
Binary file not shown.
Binary file added
BIN
+18.9 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-vis2-lizenz-thumb.webp
Binary file not shown.
Binary file added
BIN
+178 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-vis2-lizenz.webp
Binary file not shown.
Binary file added
BIN
+12.8 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-vis2-suche-thumb.webp
Binary file not shown.
Binary file added
BIN
+65.9 KB
posts/grundlagen-und-installation-von-iobroker/iobroker-vis2-suche.webp
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
title: Projekt HomePi - ioBroker I²C-Porterweiterung PCF8574 | ||
author: | ||
name: Peter Müller | ||
link: https://crycode.de | ||
banner: banner.webp | ||
date: 2019-09-21 12:00:00 | ||
updated: 2024-04-19 13:27:10 | ||
categories: | ||
- [HomePi] | ||
- [ioBroker] | ||
tags: | ||
- I2C-Bus | ||
- HomePi | ||
- ioBroker | ||
- PCF8574 | ||
- Raspberry Pi | ||
abbr: | ||
GPIO: General Purpose Input Output | ||
I²C: Inter Integrated Circuit | ||
IC: Integrated Circuit / Integrierter Schaltkreis | ||
--- | ||
|
||
Über den Adapter *i2c* ist es möglich diverse Geräte über den {% abbr I²C %}-Bus in ioBroker einzubinden. | ||
|
||
In meinem Projekt [HomePi](/kategorie/homepi) verwende ich einige ICs vom Typ [PCF8574](http://www.ti.com/lit/ds/symlink/pcf8574.pdf) zur Bereitstellung von zusätzlichen {% abbr GPIO %}s. Dieser Beitrag soll die Einbindung der *PCF8574* {% abbr IC %}s in ioBroker beschreiben. | ||
|
||
<!-- more --> | ||
|
||
Es wird davon ausgegangen, dass der {% abbr I²C %}-Bus bereits am Raspberry Pi eingerichtet ist und die angeschlossenen {% abbr IC %}s erreichbar sind. | ||
|
||
## Installation des Adapters i2c | ||
|
||
Die Installation des Adapters [i2c](https://github.com/UncleSamSwiss/ioBroker.i2c) ist ganz normal über das Stable-Repository von ioBroker möglich. | ||
|
||
Sobald die Installation Abgeschlossen ist, öffnet sich automatisch die Adapterkonfiguration, welche wir vorerst auch direkt wieder *schließen* können. | ||
|
||
In der Übersicht der Instanzen starten wir nun die Instanz `i2c.0` durch einen Klick auf den Start-Button. | ||
|
||
Sobald die Instanz läuft, öffnen wir wieder die Adapterkonfiguration durch einen Klick auf den Schraubenschlüssel-Button und klicken dort dann auf Geräte suchen. Die erkannten {% abbr I²C %}-Geräte werden daraufhin als einzelne Tabs angezeigt und können über diese konfiguriert werden. | ||
|
||
{% grid 2 %} | ||
{% img adapter-i2c-allgemein.webp thumb: Allgemeine Einstellungen des i2c-Adapters %} | ||
{% img adapter-i2c-pcf8574-ausgang.webp thumb: PCF8574 Einstellungen des i2c-Adapters %} | ||
{% endgrid %} | ||
|
||
## Verwendung der Interrupts | ||
|
||
Für die Verwendung der Interrupts ist der [RPI-Monitor (rpi2) Adapter](https://github.com/iobroker-community-adapters/ioBroker.rpi2) erforderlich. Die Installation von diesem habe ich bereits im Beitrag [ioBroker GPIOs](/homepi-iobroker-gpios) beschrieben. | ||
Alternativ können auch andere beliebige ioBroker States als Auslöser verwendet werden, sofern dies Sinn macht. | ||
|
||
Standardmäßig werden Veränderungen an Eingangspins über aktives Polling abgefragt. Das Intervall, in dem die Abfragen stattfinden wird über die Option *Abfrage-Intervall* festgelegt. | ||
|
||
Über die Auswahl eines *Interrupt-Objektes* kann ein {% abbr GPIO %} des Raspberry Pi ausgewählt werden, an dem die Interrupt-Leitung des *PCF8574* {% abbr IC %}s angeschlossen ist. Sobald sich dann der State von diesem Interrupt-Objekt ändert, werden die Eingänge des {% abbr IC %}s neu gelesen. Das *Abfrage-Intervall* kann dann auf `0` gesetzt und damit deaktiviert werden. | ||
|
||
{% img adapter-i2c-pcf8574-eingang.webp thumb: PCF8574 mit Interrupt Einstellungen des i2c-Adapters %} | ||
|
||
## Objekte | ||
|
||
Gemäß den gewählten Einstellungen für die einzelnen {% abbr IC %}s werden die Objekte für die Ein- und Ausgänge automatisch durch den Adapter angelegt und jeweils auch als *Input* oder *Output* gekennzeichnet. | ||
|
||
{% img adapter-i2c-objekte.webp thumb: PCF8574 Objekte des i2c-Adapters %} | ||
|
||
> [!NOTE] | ||
> Es ist zwar möglich die Objekte per Hand umzubenennen, jedoch wird dies bei jedem Neustart des Adapter wieder überschrieben. | ||
> Möchte man eigene Infos hinzufügen, so kann die Beschreibung (`desc`) des Objekte verwendet werden. Diese wird nicht automatisch überschrieben. |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+15.1 KB
posts/homepi-iobroker-i2c-pcf8574/adapter-i2c-pcf8574-ausgang-thumb.webp
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+17.9 KB
posts/homepi-iobroker-i2c-pcf8574/adapter-i2c-pcf8574-eingang-thumb.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,219 @@ | ||
--- | ||
title: Projekt HomePi - MQTT Broker Mosca | ||
author: | ||
name: Peter Müller | ||
link: https://crycode.de | ||
banner: banner.webp | ||
date: 2019-09-22 12:00:00 | ||
categories: | ||
- [HomePi] | ||
- [Netzwerk] | ||
tags: | ||
- Mosca | ||
- MQTT | ||
- Redis | ||
- SystemD | ||
abbr: | ||
JSON: JavaScript Object Notation | ||
--- | ||
|
||
Für den Einsatz des *Message Queuing Telemetry Transport* (kurz MQTT) wird immer ein Server, der sogenannte *Broker*, benötigt. Dieser kümmert sich um die Kommunikation mit allen Clients und die entsprechende Verteilung der einzelnen Datenpakete. | ||
|
||
Ich verwende als MQTT Broker [Mosca](https://github.com/mcollina/mosca). Dies ist ein recht einfacher Broker auf Basis von Node.js. | ||
|
||
<!-- more --> | ||
|
||
<!-- toc Inhalt --> | ||
|
||
## Installation von Mosca | ||
|
||
Da [Mosca](https://github.com/mcollina/mosca) auf Node.js basiert, muss dies natürlich vorher auf dem System installiert sein. Infos hierzu sind in meinem Beitrag [Installation von Node.js](/installation-von-node-js) zu finden. | ||
|
||
Die Installation von *Mosca* als Standalone ist recht einfach: | ||
|
||
```sh Installation von Mosca | ||
npm install -g mosca bunyan | ||
``` | ||
|
||
[Bunyan](https://github.com/trentm/node-bunyan) ist eine {% abbr JSON %} Logging Library, welche zur lesbaren Ausgabe der *Mosca* Logs verwendet wird. | ||
|
||
Nach der Installation kann *Mosca* probeweise gestartet werden: | ||
|
||
```sh Manueller Start von Mosca | ||
mosca -v | bunyan | ||
``` | ||
|
||
Zum Beenden einfach wie gewohnt `STRG`+`C` drücken. | ||
|
||
## Anlegen von Benutzern | ||
|
||
Standardmäßig verwendet *Mosca* keine Benutzerauthentifizierung und erlaubt jedem Client alles. Da dies relativ unsicher ist, legen wir Benutzer an, die für die Verbindung zu *Mosca* zugelassen sind. | ||
|
||
Die Benutzer werden in der Datei `~/mosca/credentials.json` gespeichert. Das entsprechende Verzeichnis legen wir zuerst an, sofern es nicht bereits vorhanden ist. | ||
|
||
```sh Mosca Nutzer anlegen | ||
mkdir -p ~/mosca | ||
mosca adduser <user> <password> --credentials ~/mosca/credentials.json | ||
``` | ||
|
||
Hierbei müssen natürlich `<user>` durch den Benutzernamen und `<password>` durch das Passwort für den Benutzer ersetzt werden. | ||
|
||
Damit angelegten Benutzern werden Rechte für *Publish* und *Subscribe* auf alle Topics gegeben. Möchte man die Rechte auf bestimmte Topics oder Topic-Bereiche einschränken, so ist dies wie folgt möglich: | ||
|
||
```sh Mosca Nutzer mit eingeschränkten Rechten anlegen | ||
mosca adduser myuser mypass --credentials ~/mosca/credentials.json \ | ||
--authorize-publish 'hello/**' --authorize-subscribe 'hello/**' | ||
``` | ||
|
||
Zur Sicherheit setzen wir nun noch die Dateirechte der Benutzerdatei so, dass nur der Eigentümer die Datei lesen darf: | ||
|
||
```sh Dateirechte anpassen | ||
chmod 0600 ~/mosca/credentials.json | ||
``` | ||
|
||
Damit von *Mosca* die Benutzer beim Start geladen werden muss die entsprechende Datei als Parameter mit angegeben werden: | ||
|
||
```sh Mosca Start mit Authentifizierung | ||
mosca -v --credentials ~/mosca/credentials.json | bunyan | ||
``` | ||
|
||
## Entfernen von Benutzern | ||
|
||
Angelegte Benutzer können wie folgt wieder entfernt/gelöscht werden: | ||
|
||
```sh Mosca Benutzer löschen | ||
mosca rmuser myuser --credentials ~/mosca/credentials.json | ||
``` | ||
|
||
## Konfiguration | ||
|
||
Die Konfiguration kann über eine js-Datei erfolgen, die wir unter `~/mosca/config.js` speichern. | ||
Der Inhalt der Datei könnte wie folgt aussehen. Eine [vollständige Beschreibung](https://github.com/mcollina/mosca/wiki/Mosca-as-a-standalone-service.#configuration) ist im offiziellen GitHub Repository von *Mosca* zu finden. | ||
|
||
```js Mosca Konfigurationsdatei | ||
var mosca = require('mosca'); | ||
|
||
module.exports = { | ||
port: 1883, | ||
id: 'homepi-broker', | ||
stats: true, | ||
logger: { | ||
level: 'info' | ||
}, | ||
backend: { | ||
type: 'redis', | ||
port: 6379, | ||
host: 'localhost', | ||
return_buffers: true | ||
}, | ||
persistence: { | ||
factory: mosca.persistence.Redis, | ||
port: 6379, | ||
host: 'localhost' | ||
} | ||
}; | ||
``` | ||
|
||
Diese Konfiguration verwendet [Redis](https://redis.io/) als Cache. Sofern ihr keine lokale Redis Installation betreibt oder diese Funktion nicht benötigt, können die Bereiche `backend` und `persistence` auch einfach weggelassen werden. | ||
|
||
Damit die Config-Datei auch verwendet wird, muss sie beim Start mit angegeben werden: | ||
|
||
```sh Start von *Mosca* mit Authentifizierung und Konfiguration | ||
mosca -v --credentials ~/mosca/credentials.json --config ~/mosca/config.js | bunyan | ||
``` | ||
|
||
## Startscript | ||
|
||
Damit der Start von *Mosca* einfacher wird erstellen wir ein kleines Startscript in `~/mosca/mosca.sh`. Dieses Script wird auch für den weiter unten beschriebenen *SystemD*-Service benötigt. | ||
|
||
```sh Mosca Startscript | ||
#!/bin/bash | ||
export PATH=$PATH:~/.npm-global/bin | ||
export NODE_PATH=~/.npm-global/lib/node_modules | ||
|
||
mosca -v --credentials ~/mosca/credentials.json --config ~/mosca/config.js | bunyan | ||
|
||
exit $? | ||
``` | ||
|
||
Die Pfade bei `PATH` und `NODE_PATH` müssen gegebenenfalls an das eigene System angepasst werden. Dies hängt unter anderem von der Art der Node.js Installation ab. | ||
|
||
Abschließend müssen wir das Script noch ausführbar machen und können dann *Mosca* darüber starten: | ||
|
||
```sh Startscript ausführbar machen und ausführen | ||
chmod +x ~/mosca/mosca.sh | ||
~/mosca/mosca.sh | ||
``` | ||
|
||
## SystemD-Service | ||
|
||
Damit der *Mosca* Broker in das System integriert wird, sollte ein *SystemD*-Service für diesen angelegt werden. Mit diesem kann *Mosca* dann beispielsweise automatisch beim Systemstart als Daemon gestartet werden. | ||
|
||
Die *SystemD*-Service-Datei speichern wir mit folgendem Inhalt unter `/etc/systemd/system/mosca.service`. | ||
|
||
```ini | ||
[Unit] | ||
Description=Mosca MQTT Broker | ||
After=network.target | ||
|
||
[Service] | ||
ExecStart=/home/pi/mosca/mosca.sh | ||
KillMode=control-group | ||
Restart=always | ||
RestartSec=3s | ||
User=pi | ||
Group=pi | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
``` | ||
|
||
Gegebenenfalls müssen der Pfad in `ExecStart`, sowie `User` und `Group` noch an das jeweilige System angepasst werden. | ||
|
||
Der neue *SystemD*-Service kann anschließend wie folgt gestartet werden: | ||
|
||
```sh SystemD-Service starten | ||
sudo systemctl start mosca.service | ||
``` | ||
|
||
Die Logmeldungen können wie gewohnt über `journalctl` eingesehen werden: | ||
|
||
```sh SystemD-Service starten | ||
sudo journalctl -u mosca.service | ||
``` | ||
|
||
Die Ausgabe sollte dann in etwa so aussehen: | ||
|
||
```plain | ||
Sep 12 10:06:40 homepi systemd[1]: Started Mosca MQTT Broker. | ||
Sep 12 10:06:40 homepi mosca.sh[6790]: +++.+++: ,+++ +++; '+++ +++. | ||
Sep 12 10:06:40 homepi mosca.sh[6790]: ++.+++.++ ++.++ ++,'+ `+',++ ++,++ | ||
Sep 12 10:06:40 homepi mosca.sh[6790]: +` +, +: .+ .+ +; +; '+ '+ +` +` | ||
Sep 12 10:06:40 homepi mosca.sh[6790]: +` +. +: ,+ `+ ++ +; '+ ;+ + +. | ||
Sep 12 10:06:40 homepi mosca.sh[6790]: +` +. +: ,+ `+ +' '+ + +. | ||
Sep 12 10:06:40 homepi mosca.sh[6790]: +` +. +: ,+ `+ :+. '+ +++++. | ||
Sep 12 10:06:40 homepi mosca.sh[6790]: +` +. +: ,+ `+ ++ '+ +++++. | ||
Sep 12 10:06:40 homepi mosca.sh[6790]: +` +. +: ,+ `+ ++ '+ + +. | ||
Sep 12 10:06:40 homepi mosca.sh[6790]: +` +. +: ,+ `+ +: +: '+ ;+ + +. | ||
Sep 12 10:06:40 homepi mosca.sh[6790]: +` +. +: .+ .+ +; +; '+ '+ + +. | ||
Sep 12 10:06:40 homepi mosca.sh[6790]: +` +. +: ++;++ ++'++ ++'+' + +. | ||
Sep 12 10:06:40 homepi mosca.sh[6790]: +` +. +: +++ +++. ,++' + +. | ||
Sep 12 10:06:41 homepi mosca.sh[6790]: [1568275601915] INFO: mosca/6792 on homepi: server started (mqtt=1883) | ||
``` | ||
|
||
Wenn alles läuft kann der *SystemD*-Service noch aktiviert werden, sodass er automatisch bei jedem Systemstart geladen wird: | ||
|
||
```sh SystemD-Service aktivieren | ||
sudo systemctl enable mosca.service | ||
``` | ||
|
||
## Möglicher Fehler beim Start des SystemD-Services | ||
|
||
Wenn beim Start des *SystemD*-Services die Fehlermeldung `Error: Cannot find module 'mosca'` erscheint, dann hilft es das global installierte Modul `mosca` in das Verzeichnis der Datei `config.js` zu verlinken. Die machen wir wie folgt: | ||
|
||
```sh Global installiertes Modul verlinken | ||
cd ~/mosca | ||
npm link mosca | ||
``` | ||
|
||
Anschließend sollte der *SystemD*-Service ohne Fehlermeldung gestartet werden können. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters