|
|
Zeile 1: |
Zeile 1: |
| == Meshtastic Python CLI ==
| |
| Die [https://meshtastic.org/docs/software/python/cli/ Meshtastic Python CLI] ist das Kommandozeilen-Interface (Command Line Interface, CLI) für Meshtastic, das auf der Python-Bibliothek ''meshtastic'' basiert.
| |
| [[Datei:Phyton CLI.png|mini|Meshtastic Python CLI]]
| |
| Es ermöglicht die Steuerung und Konfiguration von Meshtastic-Geräten über die Kommandozeile.
| |
|
| |
|
| Die Installation des Meshtastic Python CLI ist unter https://meshtastic.org/docs/software/python/cli/installation/ beschrieben und kann dieser Beschreibung folgend Schritt für Schritt vorgenommen werden.
| |
|
| |
| Hier ist die Meshtastic Python CLI auf einem Windows-PC im Verzeichnis D://meshtastic installiert und einige erste Aufrufe zeigt die folgende Abbildung.
| |
|
| |
| Hilfe zu den Meshtastic-Kommandos zeigt Ihnen der Aufruf ''meshtastic --help'' oder die Meshtastic-Dokumentation unter https://meshtastic.org/docs/software/python/cli/usage/.
| |
|
| |
| In der Abbildung wird mit ''meshtastic --version'' die Softwareversion abgefragt und mit ''meshtastic --support'' ein Hinweis ausgegeben, der bei Anfragen an den Support berücksichtigt werden sollte.
| |
|
| |
| Die folgenden beiden Kommandos senden einen Textstring an das Meshtastic Device H01, das über USB mit COM4 des PCs verbunden ist.
| |
|
| |
| * ''meshtastic –port COM4 –sendtext „Hello Mesh!“''
| |
|
| |
| * ''meshtastic –port COM4 –sendtext „Finish working now.“''
| |
|
| |
| Weitere Erläuterungen zu diesen Kommandos finden Sie unter </ins>https://meshtastic.org/docs/software/python/cli/#--sendtext-sendtext<ins>.
| |
|
| |
| Wollen Sie ein Backup der Konfiguration eines Meshtastic-Clients erstellen, dann kann das mit dem folgenden Kommando über das CLI erfolgen.
| |
|
| |
| * ''meshtastic --port COM4 --export-config > config_backup.yaml''
| |
|
| |
| Die Konfiguration des über COM4 an den PC angeschlossene Meshtastic-Devices wird in der Datei ''config_backup.yaml'' abgespeichert.
| |
|
| |
| Ein Restore, wie es beispielsweise nach einem Firmware-Update von 2.5.x auf 2.6.x erforderlich ist, erreichen Sie mit
| |
|
| |
| * ''meshtastic --port COM4 --configure config_backup.yaml''
| |
|
| |
| [[Datei:Yaml.png|mini|Erstellen eines Backups]]
| |
| Die nebenstehende Abbildung zeigt Ihnen das Kommando für ein Backup. Die Datei ''config_backup.yaml'' umfasst 1609 Bytes und ist im Listing dargestellt.
| |
| # start of Meshtastic configure yaml
| |
| channel_url: <nowiki>https://meshtastic.org/e/#CgkSAQEoATABOgASDQgBOANIAVAbaAHIBgE</nowiki>
| |
| config:
| |
| bluetooth:
| |
| enabled: true
| |
| fixedPin: 123456
| |
| device:
| |
| nodeInfoBroadcastSecs: 3600
| |
| display:
| |
| autoScreenCarouselSecs: 5
| |
| compassNorthTop: true
| |
| screenOnSecs: 600
| |
| lora:
| |
| region: EU_868
| |
| sx126xRxBoostedGain: true
| |
| txEnabled: true
| |
| txPower: 27
| |
| usePreset: true
| |
| network:
| |
| ipv4Config: {}
| |
| ntpServer: meshtastic.pool.ntp.org
| |
| wifiEnabled: true
| |
| wifiPsk: u2u7fgzv31Ds
| |
| wifiSsid: Sunrise_2.4GHz_19B4C2
| |
| position:
| |
| broadcastSmartMinimumDistance: 100
| |
| broadcastSmartMinimumIntervalSecs: 30
| |
| gpsMode: NOT_PRESENT
| |
| gpsUpdateInterval: 120
| |
| positionBroadcastSecs: 900
| |
| positionFlags: 811
| |
| power:
| |
| lsSecs: 300
| |
| minWakeSecs: 10
| |
| sdsSecs: 4294967295
| |
| waitBluetoothSecs: 60
| |
| location:
| |
| alt: 422
| |
| lat: 47.1922021
| |
| lon: 8.8150053
| |
| module_config:
| |
| ambientLighting:
| |
| blue: 124
| |
| current: 10
| |
| green: 54
| |
| red: 102
| |
| detectionSensor:
| |
| detectionTriggeredHigh: true
| |
| minimumBroadcastSecs: 45
| |
| mqtt:
| |
| address: ade64e41caa64820a8546270f1a7fdbc.s1.eu.hivemq.cloud
| |
| enabled: true
| |
| jsonEnabled: true
| |
| mapReportSettings: {}
| |
| password: Cksz0801
| |
| root: msh
| |
| tlsEnabled: true
| |
| username: ckMesh
| |
| neighborInfo:
| |
| enabled: true
| |
| updateInterval: 14400
| |
| rangeTest:
| |
| enabled: true
| |
| sender: 1800
| |
| telemetry:
| |
| deviceUpdateInterval: 1800
| |
| environmentUpdateInterval: 1800
| |
| owner: Heltec LoRa32 V3
| |
| owner_short: H03
| |