diff --git a/csharp/InnovEnergy.sln b/csharp/InnovEnergy.sln index 9247b7144..69f33a105 100644 --- a/csharp/InnovEnergy.sln +++ b/csharp/InnovEnergy.sln @@ -24,8 +24,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "S3", "lib/S3/S3.csproj", "{ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "deprecated", "deprecated", "{46DE03C4-52D1-47AA-8E60-8BB15361D723}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsController", "app/CsController/CsController.csproj", "{72DBBE42-A09F-43C0-9613-331039857056}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SaliMax", "app/SaliMax/SaliMax.csproj", "{25073794-D859-4824-9984-194C7E928496}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StatusApi", "lib/StatusApi/StatusApi.csproj", "{9D17E78C-8A70-43DB-A619-DC12D20D023D}" @@ -112,10 +110,6 @@ Global {C3639841-13F4-4F24-99C6-7D965593BF89}.Debug|Any CPU.Build.0 = Debug|Any CPU {C3639841-13F4-4F24-99C6-7D965593BF89}.Release|Any CPU.ActiveCfg = Release|Any CPU {C3639841-13F4-4F24-99C6-7D965593BF89}.Release|Any CPU.Build.0 = Release|Any CPU - {72DBBE42-A09F-43C0-9613-331039857056}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {72DBBE42-A09F-43C0-9613-331039857056}.Debug|Any CPU.Build.0 = Debug|Any CPU - {72DBBE42-A09F-43C0-9613-331039857056}.Release|Any CPU.ActiveCfg = Release|Any CPU - {72DBBE42-A09F-43C0-9613-331039857056}.Release|Any CPU.Build.0 = Release|Any CPU {25073794-D859-4824-9984-194C7E928496}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {25073794-D859-4824-9984-194C7E928496}.Debug|Any CPU.Build.0 = Debug|Any CPU {25073794-D859-4824-9984-194C7E928496}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -195,7 +189,6 @@ Global {E3A5F3A3-72A5-47CC-85C6-2D8E962A0EC1} = {145597B4-3E30-45E6-9F72-4DD43194539A} {46DE03C4-52D1-47AA-8E60-8BB15361D723} = {AD5B98A8-AB7F-4DA2-B66D-5B4E63E7D854} {4A67D79F-F0C9-4BBC-9601-D5948E6C05D3} = {46DE03C4-52D1-47AA-8E60-8BB15361D723} - {72DBBE42-A09F-43C0-9613-331039857056} = {145597B4-3E30-45E6-9F72-4DD43194539A} {25073794-D859-4824-9984-194C7E928496} = {145597B4-3E30-45E6-9F72-4DD43194539A} {9D17E78C-8A70-43DB-A619-DC12D20D023D} = {AD5B98A8-AB7F-4DA2-B66D-5B4E63E7D854} {C3639841-13F4-4F24-99C6-7D965593BF89} = {46DE03C4-52D1-47AA-8E60-8BB15361D723} diff --git a/csharp/app/CsController/CsController.csproj b/csharp/app/CsController/CsController.csproj deleted file mode 100644 index aab629be3..000000000 --- a/csharp/app/CsController/CsController.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - enable - InnovEnergy.CsController - true - - - - - - - - diff --git a/csharp/app/CsController/Program.cs b/csharp/app/CsController/Program.cs deleted file mode 100644 index 4d625c96c..000000000 --- a/csharp/app/CsController/Program.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.Reactive.Linq; -using InnovEnergy.Lib.Protocols.DBus; -using InnovEnergy.Lib.Protocols.DBus.Protocol.DataTypes; -using InnovEnergy.Lib.Victron.VeDBus; - - -// dotnet publish EmuMeter.csproj -c Release -r linux-arm -p:PublishSingleFile=true --self-contained true && \ -// rsync -av bin/Release/net6.0/linux-arm/publish/ root@10.2.1.6:/home/root/emu && clear && \ -// ssh root@10.2.1.6 /home/root/emu/EmuMeter - - -Console.WriteLine("Starting CsController "); - -//Enable out InnovEnergy GUI Page through DBusService.DBUS_SERVICE_UNSUPPORTED -// var service = new DBusService("com.victronenergy.unsupported"); -var veProperties = new VeProperties(); -veProperties.Set("/CustomName", "InnovEnergy"); -veProperties.Set("/ProductName", "InnovEnergySW"); - - -var dbus = new DBusConnection(Bus.System); -// var ep = new UnixDomainSocketEndPoint("/home/kim/graber_dbus.sock"); -// var auth = AuthenticationMethod.ExternalAsRoot(); -// var dbusAddress = new Bus(ep, auth); -// var dbus = new DBusConnection(dbusAddress); - - -await veProperties.PublishOnDBus(Bus.System, "com.victronenergy.unsupported"); - -var battery = "com.victronenergy.battery.ttyUSB0"; -var soc = 21.0; - -//TODO change ttyUSB0 for generic Battery on dbus -var names = await dbus.ListNames(); -foreach (var name in names) -{ - if(name.Contains("com.victronenergy.battery.")) - { - battery = name; - break; - } -} - -var mustCharge = dbus - .ObserveSignalMessages(sender: battery, objectPath: "/Soc") - .Select(m => m.Payload)! - .OfType>() - .Where(d => d.ContainsKey("Value")) - .Select(d => d["Value"].Value) - .OfType() - .Do(s => Console.WriteLine($"soc = {s}")) - .Select(d => d < 67) - .DistinctUntilChanged(); - - -mustCharge.Subscribe(b => -{ - dbus.SetValue("com.victronenergy.settings", "/Settings/CGwacs/BatteryLife/State", b ? 9 : 10); // 9 = charge battery, 10 = optimized (no batterylife) -}); - - -// Console.ReadLine(); \ No newline at end of file diff --git a/csharp/app/CsController/debug.sh b/csharp/app/CsController/debug.sh deleted file mode 100644 index 3f25d1795..000000000 --- a/csharp/app/CsController/debug.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -csproj="CsController.csproj" -exe="CsController" -remote="10.2.1.6" -#remote="10.2.2.152" - -netVersion="net6.0" -platform="linux-arm" -config="Release" -host="root@$remote" -dir="/data/innovenergy/$exe" - -set -e - -dotnet publish "$csproj" -c $config -r $platform -p:SuppressTrimmAnalysisWarnings=true -p:PublishSingleFile=true -p:PublishTrimmed=true -p:DebugType=None -p:DebugSymbols=false --self-contained true -rsync -av "bin/$config/$netVersion/$platform/publish/" "$host:$dir" - -clear -ssh "$host" "$dir/$exe" - \ No newline at end of file diff --git a/csharp/app/CsController/service/log/run b/csharp/app/CsController/service/log/run deleted file mode 100755 index d42c9d38b..000000000 --- a/csharp/app/CsController/service/log/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -exec 2>&1 -exec multilog t s25000 n4 /var/log/CsController diff --git a/csharp/app/CsController/service/run b/csharp/app/CsController/service/run deleted file mode 100755 index a509d6c68..000000000 --- a/csharp/app/CsController/service/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -exec 2>&1 -exec softlimit -d 100000000 -s 1000000 -a 100000000 /opt/innovenergy/CsController/CsController