# Copyright 2022-2023 Bruce Merry # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . [package] name = "sunsniff" version = "0.3.2" edition = "2021" authors = ["Bruce Merry"] license = "GPL-3.0-or-later" description = "Intercept and store telemetry from a Sunsynk inverter" repository = "https://github.com/bmerry/sunsniff" [profile.release] strip = true lto = true [package.metadata.cross.build] pre-build = [ 'set -e', 'apt-get update && apt-get install -y flex bison dpkg-dev', 'cd /tmp', 'curl https://www.tcpdump.org/release/libpcap-1.10.4.tar.gz | tar -zx', 'cd libpcap-1.10.4', 'arch="$(dpkg-architecture -A $CROSS_DEB_ARCH -q DEB_TARGET_GNU_TYPE)"', 'if ! which ${arch}-gcc; then arch="$(./config.sub $arch)"; fi', './configure --host "$arch" --disable-shared LDFLAGS="-static"', 'make', 'make install' ] [features] default = ["influxdb2", "mqtt", "modbus", "pcap"] mqtt = ["dep:mqtt-async-client", "dep:serde_json"] modbus = ["dep:modbus-robust", "dep:serde_with", "dep:tokio-modbus", "dep:tokio-serial", "chrono/clock", "tokio/time"] pcap = ["dep:chrono-tz", "dep:etherparse", "dep:pcap"] [build-dependencies] csv = "1.2.1" serde = { version = "1.0.159", features = ["derive"] } [dependencies] async-std = "1.12.0" async-trait = "0.1.57" chrono = { version = "0.4.22", default-features = false, features = ["std"] } chrono-tz = { version = "0.8.2", features = ["serde"], optional = true } clap = { version = "4.0.10", features = ["derive"] } env_logger = "0.10.0" etherparse = { version = "0.13.0", optional = true } futures = "0.3.28" influxdb2 = { version = "0.4.0", default_features = false, features = ["rustls"], optional = true } log = "0.4.17" modbus-robust = { version = "0.1.0", optional = true } mqtt-async-client = { version = "0.3.1", optional = true } pcap = { version = "1.0.0", features = ["capture-stream"], optional = true } serde = { version = "1.0.159", features = ["derive"] } serde_json = { version = "1.0.95", optional = true } serde_with = { version = "3.2.0", optional = true } tokio = { version = "1.21.2", features = ["macros", "rt"] } tokio-modbus = { version = "0.9.0", default-features = false, features = ["rtu", "tcp"], optional = true } tokio-serial = { version = "5.4.4", optional = true } toml = "0.7.3" [dev-dependencies] assert_approx_eq = "1.1.0"