mirror of
https://github.com/tcivie/meshtastic-metrics-exporter.git
synced 2025-02-02 07:41:11 -08:00
Merge pull request #18 from tcivie/Update-to-support-meshtastic-version-2.3.13
Update to support meshtastic version 2.3.13
This commit is contained in:
commit
d2afef76d5
|
@ -4,7 +4,10 @@
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="jdk" jdkName="Python 3.12 (meshtastic-metrics-exporter)" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="PackageRequirementsSettings">
|
||||||
|
<option name="versionSpecifier" value="Greater or equal (>=x.y.z)" />
|
||||||
|
</component>
|
||||||
</module>
|
</module>
|
|
@ -1,5 +1,9 @@
|
||||||
|
try:
|
||||||
from meshtastic.config_pb2 import Config
|
from meshtastic.config_pb2 import Config
|
||||||
from meshtastic.mesh_pb2 import HardwareModel
|
from meshtastic.mesh_pb2 import HardwareModel
|
||||||
|
except ImportError:
|
||||||
|
from meshtastic.protobuf.config_pb2 import Config
|
||||||
|
from meshtastic.protobuf.mesh_pb2 import HardwareModel
|
||||||
|
|
||||||
|
|
||||||
class ClientDetails:
|
class ClientDetails:
|
||||||
|
|
|
@ -3,8 +3,14 @@ import os
|
||||||
|
|
||||||
from cryptography.hazmat.backends import default_backend
|
from cryptography.hazmat.backends import default_backend
|
||||||
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
|
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
|
||||||
|
|
||||||
|
try:
|
||||||
from meshtastic.mesh_pb2 import MeshPacket, Data, HardwareModel
|
from meshtastic.mesh_pb2 import MeshPacket, Data, HardwareModel
|
||||||
from meshtastic.portnums_pb2 import PortNum
|
from meshtastic.portnums_pb2 import PortNum
|
||||||
|
except ImportError:
|
||||||
|
from meshtastic.protobuf.mesh_pb2 import MeshPacket, Data, HardwareModel
|
||||||
|
from meshtastic.protobuf.portnums_pb2 import PortNum
|
||||||
|
|
||||||
from prometheus_client import CollectorRegistry, Counter, Histogram, Gauge
|
from prometheus_client import CollectorRegistry, Counter, Histogram, Gauge
|
||||||
from psycopg_pool import ConnectionPool
|
from psycopg_pool import ConnectionPool
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@ from venv import logger
|
||||||
|
|
||||||
import psycopg
|
import psycopg
|
||||||
import unishox2
|
import unishox2
|
||||||
|
|
||||||
|
try:
|
||||||
from meshtastic.admin_pb2 import AdminMessage
|
from meshtastic.admin_pb2 import AdminMessage
|
||||||
from meshtastic.mesh_pb2 import Position, User, HardwareModel, Routing, Waypoint, RouteDiscovery, NeighborInfo
|
from meshtastic.mesh_pb2 import Position, User, HardwareModel, Routing, Waypoint, RouteDiscovery, NeighborInfo
|
||||||
from meshtastic.mqtt_pb2 import MapReport
|
from meshtastic.mqtt_pb2 import MapReport
|
||||||
|
@ -12,6 +14,18 @@ from meshtastic.portnums_pb2 import PortNum
|
||||||
from meshtastic.remote_hardware_pb2 import HardwareMessage
|
from meshtastic.remote_hardware_pb2 import HardwareMessage
|
||||||
from meshtastic.storeforward_pb2 import StoreAndForward
|
from meshtastic.storeforward_pb2 import StoreAndForward
|
||||||
from meshtastic.telemetry_pb2 import Telemetry, DeviceMetrics, EnvironmentMetrics, AirQualityMetrics, PowerMetrics
|
from meshtastic.telemetry_pb2 import Telemetry, DeviceMetrics, EnvironmentMetrics, AirQualityMetrics, PowerMetrics
|
||||||
|
except ImportError:
|
||||||
|
from meshtastic.protobuf.admin_pb2 import AdminMessage
|
||||||
|
from meshtastic.protobuf.mesh_pb2 import Position, User, HardwareModel, Routing, Waypoint, RouteDiscovery, \
|
||||||
|
NeighborInfo
|
||||||
|
from meshtastic.protobuf.mqtt_pb2 import MapReport
|
||||||
|
from meshtastic.protobuf.paxcount_pb2 import Paxcount
|
||||||
|
from meshtastic.protobuf.portnums_pb2 import PortNum
|
||||||
|
from meshtastic.protobuf.remote_hardware_pb2 import HardwareMessage
|
||||||
|
from meshtastic.protobuf.storeforward_pb2 import StoreAndForward
|
||||||
|
from meshtastic.protobuf.telemetry_pb2 import Telemetry, DeviceMetrics, EnvironmentMetrics, AirQualityMetrics, \
|
||||||
|
PowerMetrics
|
||||||
|
|
||||||
from prometheus_client import CollectorRegistry
|
from prometheus_client import CollectorRegistry
|
||||||
from psycopg_pool import ConnectionPool
|
from psycopg_pool import ConnectionPool
|
||||||
|
|
||||||
|
|
6
main.py
6
main.py
|
@ -4,8 +4,14 @@ from datetime import datetime
|
||||||
|
|
||||||
import paho.mqtt.client as mqtt
|
import paho.mqtt.client as mqtt
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
try:
|
||||||
from meshtastic.mesh_pb2 import MeshPacket
|
from meshtastic.mesh_pb2 import MeshPacket
|
||||||
from meshtastic.mqtt_pb2 import ServiceEnvelope
|
from meshtastic.mqtt_pb2 import ServiceEnvelope
|
||||||
|
except ImportError:
|
||||||
|
from meshtastic.protobuf.mesh_pb2 import MeshPacket
|
||||||
|
from meshtastic.protobuf.mqtt_pb2 import ServiceEnvelope
|
||||||
|
|
||||||
from paho.mqtt.enums import CallbackAPIVersion
|
from paho.mqtt.enums import CallbackAPIVersion
|
||||||
from prometheus_client import CollectorRegistry, start_http_server
|
from prometheus_client import CollectorRegistry, start_http_server
|
||||||
from psycopg_pool import ConnectionPool
|
from psycopg_pool import ConnectionPool
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
paho-mqtt~=2.1.0
|
paho-mqtt~=2.1.0
|
||||||
python-dotenv~=1.0.1
|
python-dotenv~=1.0.1
|
||||||
meshtastic~=2.3.11
|
|
||||||
prometheus_client~=0.20.0
|
prometheus_client~=0.20.0
|
||||||
unishox2-py3~=1.0.0
|
unishox2-py3~=1.0.0
|
||||||
cryptography~=42.0.8
|
cryptography~=42.0.8
|
||||||
psycopg~=3.1.19
|
psycopg~=3.1.19
|
||||||
psycopg_pool~=3.2.2
|
psycopg_pool~=3.2.2
|
||||||
|
meshtastic~=2.3.13
|
Loading…
Reference in a new issue