diff --git a/docs/Changelog.md b/docs/Changelog.md
index 1f00491..d80abf5 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -1,6 +1,13 @@
# Changelog
+## [Vnext]
+### Changed
+- Neuste Minor Beckhoff ADS Library 7.0.172 wird verwendet (mit der Hoffnung bessere Kompatibilität unter Linux ohne TwinCAT Installation zu erreichen)
+ - [Beckhoff:](https://infosys.beckhoff.com/content/1033/tc3_ads.net/21454100235.html) Added support for unix domain sockets for local communication (TwinCAT 4026 and above)
+ - [Beckhoff:](https://infosys.beckhoff.com/content/1033/tc3_ads.net/21454100235.html) Integrated support for implementing customized AdsServers (AdsServer and AdsSymbolicServer)
+- AdsRouter in log4TC integriert um die Kommunikation mit TwinCAT Systemen auch ohne direkte TwinCAT Installation zu ermöglichen (z.B. unter Linux oder in Docker Containern). Siehe Beispiel `influx_on_beckhoff-rt-linux`
+
## [26.04.26]
### Added
- Verbesserter Linux Support durch Bereitstellung Debian **.deb** Paket. Siehe Anleitung [Linux Installation](https://mbc-engineering.github.io/log4TC/reference/installation.html#linux-installation)
diff --git a/docs/gettingstarted/intro.md b/docs/gettingstarted/intro.md
index 84d60c4..40157a5 100644
--- a/docs/gettingstarted/intro.md
+++ b/docs/gettingstarted/intro.md
@@ -13,7 +13,7 @@ Folgende Voraussetzungen haben die beiden Komponenten:
**log4TC TwinCat 3 Bibliothek**
* [TwinCat 3 (min. 4024.00)](https://www.beckhoff.com/de-de/support/downloadfinder/suchergebnis/?download_group=725136885)
-* Verwende die korrekte Bibliohtek-Version passend zu deiner TwinCAT Version (4024 oder 4026).
+* Verwende die korrekte [Bibliothek](https://github.com/mbc-engineering/log4TC/releases/latest)-Version passend zu deiner TwinCAT Version (4024 oder 4026).
**log4TC Service**
diff --git a/docs/index.md b/docs/index.md
index 511fc9f..91392b1 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -18,7 +18,6 @@ Log4TC besteht aus zwei Teilen, einer SPS-Bibliothek und einen Windows-Service.
* Unterstützung von Context-Eigenschaften auf verschiedenen Ebenen
* Performant und Modular
* Kostenlose Testversion verfügbar
- * Lizenzierung über Beckhoff-Mechanismus in Dongle, Klemme oder PC
* Unbegrenzte Ausgabemöglichkeiten (Textdatei, Datenbank, Cloud, usw.)
## Ausgaben
diff --git a/docs/internal/licensing.md b/docs/internal/licensing.md
deleted file mode 100644
index f2a5d93..0000000
--- a/docs/internal/licensing.md
+++ /dev/null
@@ -1,24 +0,0 @@
-# Lizenzierung
-
-Draft
-
-## Test-Lizenz / Entwickler-Lizenz
-
-* alle Features
-* Einschränkung auf max. 10000 Meldungen (Mike: eher nicht beschränken)
-* Einschränkung auf max. 12h
-
-## Runtime-Lizenz
-
-* Lizenzierung über Beckhoff (weiter Abklärung notwendig)
-* Abhängig von Leistungsklasse (Performance-Level)
-* P90: 250Fr. inkl. 1 Jahr Updates
-* P40: 100Fr. inkl. 1 Jahr Update
-* Update Verlängerung: 50Fr/Jahr (eher nicht, wegen verpflichtung; Update-Preis)
-* Staffelpreise?
-* Support-Packages?
-
-
-
-
-
diff --git a/readme.md b/readme.md
index 58a8f8e..6326a04 100644
--- a/readme.md
+++ b/readme.md
@@ -22,7 +22,6 @@ The log4TC service is typically installed on the same computer as the PLC, but f
* Support for context properties at various levels
* Efficient and modular
* Free trial version available
-* Licensing through Beckhoff mechanism in dongle, terminal, or PC
* Unlimited output possibilities (text file, database, cloud, etc.)
## Outputs
@@ -43,13 +42,14 @@ We can also create custom outputs upon request.
## Next Steps
* [Download](https://github.com/mbc-engineering/log4TC/releases/latest)
-* [Getting Started](docs/gettingstarted/intro.md)
-* [Reference](docs/reference/index.md)
+* [Getting Started](https://mbc-engineering.github.io/log4TC/gettingstarted/intro.html)
+* [Reference Nlog (Logfile) output](https://mbc-engineering.github.io/log4TC/reference/nlog_output.html)
+* [Reference InfluxDB output](https://mbc-engineering.github.io/log4TC/reference/influx_output.html)
## build
-see: setup: https://wixtoolset.org/docs/releasenotes/#v4
+see: setup: https://wixtoolset.org/docs/releasenotes/#wix-v7
dotnet msbuild -p:Configuration=Release -p:Platform=x64 -Restore
diff --git a/source/AdsRouterConsoleApp/.dockerignore b/source/AdsRouterConsoleApp/.dockerignore
deleted file mode 100644
index dd94fe4..0000000
--- a/source/AdsRouterConsoleApp/.dockerignore
+++ /dev/null
@@ -1,29 +0,0 @@
-[b|B]in
-[O|o]bj
-**/.classpath
-**/.dockerignore
-**/.env
-**/.git
-**/.gitignore
-**/.project
-**/.settings
-**/.toolstarget
-**/.vs
-**/.vscode
-**/*.*proj.user
-**/*.dbmdl
-**/*.jfm
-**/azds.yaml
-**/bin
-**/charts
-**/docker-compose*
-**/Dockerfile*
-**/node_modules
-**/npm-debug.log
-**/obj
-**/secrets.dev.yaml
-**/values.dev.yaml
-**/testresults
-LICENSE
-README.md
-**/**/testresults
diff --git a/source/AdsRouterConsoleApp/.gitignore b/source/AdsRouterConsoleApp/.gitignore
deleted file mode 100644
index 9491a2f..0000000
--- a/source/AdsRouterConsoleApp/.gitignore
+++ /dev/null
@@ -1,363 +0,0 @@
-## Ignore Visual Studio temporary files, build results, and
-## files generated by popular Visual Studio add-ons.
-##
-## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
-
-# User-specific files
-*.rsuser
-*.suo
-*.user
-*.userosscache
-*.sln.docstates
-
-# User-specific files (MonoDevelop/Xamarin Studio)
-*.userprefs
-
-# Mono auto generated files
-mono_crash.*
-
-# Build results
-[Dd]ebug/
-[Dd]ebugPublic/
-[Rr]elease/
-[Rr]eleases/
-x64/
-x86/
-[Ww][Ii][Nn]32/
-[Aa][Rr][Mm]/
-[Aa][Rr][Mm]64/
-bld/
-[Bb]in/
-[Oo]bj/
-[Oo]ut/
-[Ll]og/
-[Ll]ogs/
-
-# Visual Studio 2015/2017 cache/options directory
-.vs/
-# Uncomment if you have tasks that create the project's static files in wwwroot
-#wwwroot/
-
-# Visual Studio 2017 auto generated files
-Generated\ Files/
-
-# MSTest test Results
-[Tt]est[Rr]esult*/
-[Bb]uild[Ll]og.*
-
-# NUnit
-*.VisualState.xml
-TestResult.xml
-nunit-*.xml
-
-# Build Results of an ATL Project
-[Dd]ebugPS/
-[Rr]eleasePS/
-dlldata.c
-
-# Benchmark Results
-BenchmarkDotNet.Artifacts/
-
-# .NET Core
-project.lock.json
-project.fragment.lock.json
-artifacts/
-
-# ASP.NET Scaffolding
-ScaffoldingReadMe.txt
-
-# StyleCop
-StyleCopReport.xml
-
-# Files built by Visual Studio
-*_i.c
-*_p.c
-*_h.h
-*.ilk
-*.meta
-*.obj
-*.iobj
-*.pch
-*.pdb
-*.ipdb
-*.pgc
-*.pgd
-*.rsp
-*.sbr
-*.tlb
-*.tli
-*.tlh
-*.tmp
-*.tmp_proj
-*_wpftmp.csproj
-*.log
-*.vspscc
-*.vssscc
-.builds
-*.pidb
-*.svclog
-*.scc
-
-# Chutzpah Test files
-_Chutzpah*
-
-# Visual C++ cache files
-ipch/
-*.aps
-*.ncb
-*.opendb
-*.opensdf
-*.sdf
-*.cachefile
-*.VC.db
-*.VC.VC.opendb
-
-# Visual Studio profiler
-*.psess
-*.vsp
-*.vspx
-*.sap
-
-# Visual Studio Trace Files
-*.e2e
-
-# TFS 2012 Local Workspace
-$tf/
-
-# Guidance Automation Toolkit
-*.gpState
-
-# ReSharper is a .NET coding add-in
-_ReSharper*/
-*.[Rr]e[Ss]harper
-*.DotSettings.user
-
-# TeamCity is a build add-in
-_TeamCity*
-
-# DotCover is a Code Coverage Tool
-*.dotCover
-
-# AxoCover is a Code Coverage Tool
-.axoCover/*
-!.axoCover/settings.json
-
-# Coverlet is a free, cross platform Code Coverage Tool
-coverage*.json
-coverage*.xml
-coverage*.info
-
-# Visual Studio code coverage results
-*.coverage
-*.coveragexml
-
-# NCrunch
-_NCrunch_*
-.*crunch*.local.xml
-nCrunchTemp_*
-
-# MightyMoose
-*.mm.*
-AutoTest.Net/
-
-# Web workbench (sass)
-.sass-cache/
-
-# Installshield output folder
-[Ee]xpress/
-
-# DocProject is a documentation generator add-in
-DocProject/buildhelp/
-DocProject/Help/*.HxT
-DocProject/Help/*.HxC
-DocProject/Help/*.hhc
-DocProject/Help/*.hhk
-DocProject/Help/*.hhp
-DocProject/Help/Html2
-DocProject/Help/html
-
-# Click-Once directory
-publish/
-
-# Publish Web Output
-*.[Pp]ublish.xml
-*.azurePubxml
-# Note: Comment the next line if you want to checkin your web deploy settings,
-# but database connection strings (with potential passwords) will be unencrypted
-*.pubxml
-*.publishproj
-
-# Microsoft Azure Web App publish settings. Comment the next line if you want to
-# checkin your Azure Web App publish settings, but sensitive information contained
-# in these scripts will be unencrypted
-PublishScripts/
-
-# NuGet Packages
-*.nupkg
-# NuGet Symbol Packages
-*.snupkg
-# The packages folder can be ignored because of Package Restore
-**/[Pp]ackages/*
-# except build/, which is used as an MSBuild target.
-!**/[Pp]ackages/build/
-# Uncomment if necessary however generally it will be regenerated when needed
-#!**/[Pp]ackages/repositories.config
-# NuGet v3's project.json files produces more ignorable files
-*.nuget.props
-*.nuget.targets
-
-# Microsoft Azure Build Output
-csx/
-*.build.csdef
-
-# Microsoft Azure Emulator
-ecf/
-rcf/
-
-# Windows Store app package directories and files
-AppPackages/
-BundleArtifacts/
-Package.StoreAssociation.xml
-_pkginfo.txt
-*.appx
-*.appxbundle
-*.appxupload
-
-# Visual Studio cache files
-# files ending in .cache can be ignored
-*.[Cc]ache
-# but keep track of directories ending in .cache
-!?*.[Cc]ache/
-
-# Others
-ClientBin/
-~$*
-*~
-*.dbmdl
-*.dbproj.schemaview
-*.jfm
-*.pfx
-*.publishsettings
-orleans.codegen.cs
-
-# Including strong name files can present a security risk
-# (https://github.com/github/gitignore/pull/2483#issue-259490424)
-#*.snk
-
-# Since there are multiple workflows, uncomment next line to ignore bower_components
-# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
-#bower_components/
-
-# RIA/Silverlight projects
-Generated_Code/
-
-# Backup & report files from converting an old project file
-# to a newer Visual Studio version. Backup files are not needed,
-# because we have git ;-)
-_UpgradeReport_Files/
-Backup*/
-UpgradeLog*.XML
-UpgradeLog*.htm
-ServiceFabricBackup/
-*.rptproj.bak
-
-# SQL Server files
-*.mdf
-*.ldf
-*.ndf
-
-# Business Intelligence projects
-*.rdl.data
-*.bim.layout
-*.bim_*.settings
-*.rptproj.rsuser
-*- [Bb]ackup.rdl
-*- [Bb]ackup ([0-9]).rdl
-*- [Bb]ackup ([0-9][0-9]).rdl
-
-# Microsoft Fakes
-FakesAssemblies/
-
-# GhostDoc plugin setting file
-*.GhostDoc.xml
-
-# Node.js Tools for Visual Studio
-.ntvs_analysis.dat
-node_modules/
-
-# Visual Studio 6 build log
-*.plg
-
-# Visual Studio 6 workspace options file
-*.opt
-
-# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
-*.vbw
-
-# Visual Studio LightSwitch build output
-**/*.HTMLClient/GeneratedArtifacts
-**/*.DesktopClient/GeneratedArtifacts
-**/*.DesktopClient/ModelManifest.xml
-**/*.Server/GeneratedArtifacts
-**/*.Server/ModelManifest.xml
-_Pvt_Extensions
-
-# Paket dependency manager
-.paket/paket.exe
-paket-files/
-
-# FAKE - F# Make
-.fake/
-
-# CodeRush personal settings
-.cr/personal
-
-# Python Tools for Visual Studio (PTVS)
-__pycache__/
-*.pyc
-
-# Cake - Uncomment if you are using it
-# tools/**
-# !tools/packages.config
-
-# Tabs Studio
-*.tss
-
-# Telerik's JustMock configuration file
-*.jmconfig
-
-# BizTalk build output
-*.btp.cs
-*.btm.cs
-*.odx.cs
-*.xsd.cs
-
-# OpenCover UI analysis results
-OpenCover/
-
-# Azure Stream Analytics local run output
-ASALocalRun/
-
-# MSBuild Binary and Structured Log
-*.binlog
-
-# NVidia Nsight GPU debugger configuration file
-*.nvuser
-
-# MFractors (Xamarin productivity tool) working folder
-.mfractor/
-
-# Local History for Visual Studio
-.localhistory/
-
-# BeatPulse healthcheck temp database
-healthchecksdb
-
-# Backup folder for Package Reference Convert tool in Visual Studio 2017
-MigrationBackup/
-
-# Ionide (cross platform F# VS Code tools) working folder
-.ionide/
-
-# Fody - auto-generated XML schema
-FodyWeavers.xsd
\ No newline at end of file
diff --git a/source/AdsRouterConsoleApp/.vscode/launch.json b/source/AdsRouterConsoleApp/.vscode/launch.json
deleted file mode 100644
index 452d333..0000000
--- a/source/AdsRouterConsoleApp/.vscode/launch.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- // Use IntelliSense to find out which attributes exist for C# debugging
- // Use hover for the description of the existing attributes
- // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
- "version": "0.2.0",
- "configurations": [
- {
- "name": "Docker .NET Core Launch",
- "type": "docker",
- "request": "launch",
- "preLaunchTask": "docker-run: debug",
- "netCore": {
- "appProject": "${workspaceFolder}/src/AdsRouterConsoleApp.csproj"
- }
- }
-]
-}
\ No newline at end of file
diff --git a/source/AdsRouterConsoleApp/.vscode/tasks.json b/source/AdsRouterConsoleApp/.vscode/tasks.json
deleted file mode 100644
index 7a84357..0000000
--- a/source/AdsRouterConsoleApp/.vscode/tasks.json
+++ /dev/null
@@ -1,101 +0,0 @@
-{
- "version": "2.0.0",
- "tasks": [
- {
- "label": "build",
- "command": "dotnet",
- "type": "process",
- "args": [
- "build",
- "${workspaceFolder}/src/AdsRouterConsoleApp.csproj",
- "-c", "Debug",
- "-o", "src/bin/Debug",
- "--framework", "net5.0",
- "/property:GenerateFullPaths=true",
- "/consoleloggerparameters:NoSummary"
- ],
- "problemMatcher": "$msCompile"
- },
- {
- "label": "publish",
- "command": "dotnet",
- "type": "process",
- "args": [
- "publish",
- "${workspaceFolder}/TwinCAT.Ads.AdsRouterConsole.csproj",
- "/property:GenerateFullPaths=true",
- "/consoleloggerparameters:NoSummary"
- ],
- "problemMatcher": "$msCompile"
- },
- {
- "label": "watch",
- "command": "dotnet",
- "type": "process",
- "args": [
- "watch",
- "run",
- "${workspaceFolder}/TwinCAT.Ads.AdsRouterConsole.csproj",
- "/property:GenerateFullPaths=true",
- "/consoleloggerparameters:NoSummary"
- ],
- "problemMatcher": "$msCompile"
- },
- {
- "type": "docker-build",
- "label": "docker-build: debug",
- "dependsOn": [
- "build"
- ],
- "dockerBuild": {
- "tag": "adsrouterconsoleapp:dev",
- "target": "base",
- "dockerfile": "${workspaceFolder}/Dockerfile",
- "context": "${workspaceFolder}",
- "pull": true
- },
- "netCore": {
- "appProject": "${workspaceFolder}/src/AdsRouterConsoleApp.csproj"
- }
- },
- {
- "type": "docker-build",
- "label": "docker-build: release",
- "dependsOn": [
- "build"
- ],
- "dockerBuild": {
- "tag": "adsrouterconsoleapp:latest",
- "dockerfile": "${workspaceFolder}/src/Dockerfile",
- "context": "${workspaceFolder}",
- "pull": true
- },
- "netCore": {
- "appProject": "${workspaceFolder}/src/AdsRouterConsoleApp.csproj"
- }
- },
- {
- "type": "docker-run",
- "label": "docker-run: debug",
- "dependsOn": [
- "docker-build: debug"
- ],
- "dockerRun": {},
- "netCore": {
- "appProject": "${workspaceFolder}/src/AdsRouterConsoleApp.csproj",
- "enableDebugging": true
- }
- },
- {
- "type": "docker-run",
- "label": "docker-run: release",
- "dependsOn": [
- "docker-build: release"
- ],
- "dockerRun": {},
- "netCore": {
- "appProject": "${workspaceFolder}/src/AdsRouterConsoleApp.csproj"
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/source/AdsRouterConsoleApp/AdsRouterConsoleApp.sln b/source/AdsRouterConsoleApp/AdsRouterConsoleApp.sln
deleted file mode 100644
index 9d40b71..0000000
--- a/source/AdsRouterConsoleApp/AdsRouterConsoleApp.sln
+++ /dev/null
@@ -1,28 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.7.34031.279
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdsRouterConsoleApp", "src\AdsRouterConsoleApp.csproj", "{8BBD5E02-0027-4638-8431-BE93BFB01C4D}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- TeamRelease|Any CPU = TeamRelease|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {8BBD5E02-0027-4638-8431-BE93BFB01C4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {8BBD5E02-0027-4638-8431-BE93BFB01C4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8BBD5E02-0027-4638-8431-BE93BFB01C4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {8BBD5E02-0027-4638-8431-BE93BFB01C4D}.Release|Any CPU.Build.0 = Release|Any CPU
- {8BBD5E02-0027-4638-8431-BE93BFB01C4D}.TeamRelease|Any CPU.ActiveCfg = TeamRelease|Any CPU
- {8BBD5E02-0027-4638-8431-BE93BFB01C4D}.TeamRelease|Any CPU.Build.0 = TeamRelease|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {3DB6E660-311D-4B68-AE5F-D5750318800E}
- EndGlobalSection
-EndGlobal
diff --git a/source/AdsRouterConsoleApp/Directory.Build.props b/source/AdsRouterConsoleApp/Directory.Build.props
deleted file mode 100644
index 21d4cc9..0000000
--- a/source/AdsRouterConsoleApp/Directory.Build.props
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
- Log4Tc-AdsRouter
- mbc Log4Tc-adsRouter
-
- Simple TCP/IP ADS Router Console Application for use on systems without TwinCAT installation / setup.
- Console ADS Router with AdsServer that is required to connect from log4TC Service
-
- bqstony
- mbc-engineering
- Copyright © mbc-engineering
-
- 24.11.08
-
-
-
-
diff --git a/source/AdsRouterConsoleApp/Dockerfile b/source/AdsRouterConsoleApp/Dockerfile
deleted file mode 100644
index 9e72eda..0000000
--- a/source/AdsRouterConsoleApp/Dockerfile
+++ /dev/null
@@ -1,45 +0,0 @@
-# Build Context to this file is ./
-#
-# Build the image with the following command:
-# log4TCAdsRouterversion=$(sed -n 's|.*\([^<]*\).*|\1|p' Directory.Build.props) && \
-# podman build \
-# --build-arg BUILD_VERSION="$log4TCAdsRouterversion" \
-# --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
-# --build-arg SOURCECOMMITID="$(git rev-parse HEAD)" \
-# -t log4tc-adsrouter:$log4TCAdsRouterversion-beta .
-
-# Base Image stage
-########################
-FROM mcr.microsoft.com/dotnet/runtime:8.0-bookworm-slim AS base
-ARG BUILD_VERSION
-ARG BUILD_DATE
-ARG SOURCECOMMITID
-WORKDIR /app
-# The ADSRouter used TcpPort (48898 or 0xBF02 by default)
-EXPOSE 48898
-
-# The OCI Spec Labels https://github.com/opencontainers/image-spec/blob/main/annotations.md
-LABEL org.opencontainers.image.version=$BUILD_VERSION
-LABEL org.opencontainers.image.created=$BUILD_DATE
-LABEL org.opencontainers.image.title=log4tc-adsRouter
-LABEL org.opencontainers.image.authors=bqstony
-LABEL org.opencontainers.image.source=https://github.com/mbc-engineering/log4TC
-LABEL org.opencontainers.image.revision=$SOURCECOMMITID
-LABEL org.opencontainers.image.base.name=mcr.microsoft.com/dotnet/runtime:8.0-bookworm-slim
-LABEL org.opencontainers.image.vendor="mbc-engineering"
-
-# Stages for building the app
-########################
-FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS publish
-WORKDIR /src
-COPY src/. .
-RUN dotnet publish --framework net10.0 --configuration Release --self-contained false --runtime linux-x64 --output /app/publish
-
-# Stage for pack the binary to deployment container
-########################
-FROM base AS final
-WORKDIR /app
-COPY --from=publish /app/publish .
-COPY src/appsettingsSample.json ./appsettings.json
-
-ENTRYPOINT ["dotnet", "AdsRouterConsoleApp.dll"]
diff --git a/source/AdsRouterConsoleApp/README.md b/source/AdsRouterConsoleApp/README.md
deleted file mode 100644
index 32d2a9b..0000000
--- a/source/AdsRouterConsoleApp/README.md
+++ /dev/null
@@ -1,226 +0,0 @@
-# AdsRouterConsoleApp
-
-> UPDATE: Es gibt ein Beispiel von Beckhoff mit Dockerfile vom 11.03.2025: https://github.com/Beckhoff/TF6000_ADS_DOTNET_V5_Samples/blob/main/Sources/RouterSamples/AdsRouterConsoleApp/Dockerfile
-
-Dies ist eine Kopie vom 08.11.2024 von Beckhoff github Repo: https://github.com/Beckhoff/TF6000_ADS_DOTNET_V5_Samples/tree/main/Sources/RouterSamples/AdsRouterConsoleApp
-
-## Description of the **AdsRouterConsoleApp** Sample application
-The project contains a lean TCP ADS Router as binary. It is a simple console application
-'ready-to-run' (with included simple AdsServers Port 1 and Port 10000).
-
-It can be used in scenarios where no standard TwinCAT router is established or available and is running in UserMode only (no realtime characteristics) and contains no further functionality than distributing the ADS Frames (e.g. no Port 10000, no ADS Secure). It is just used to route ADS frames locally between AdsServers and give some basic support of Route management and browsing Remote Systems.
-and to/from remote ADS devices.
-
-## Requirements
-- No other System allocating the same port (e.g. a regular TwinCAT installation)
-
-This sample works across all platforms that are supported by the .net core runtime (windows, linux, macOS). This is called a "portable" or "framework dependant" deployment.
-If an *.exe really is needed, please consider self-contained deployments.
-
-Along with the deployment of the application where the TcpRouter is implemented, a valid Router / ADS configuration must be placed to specify
-the Local Net ID, the name and the default port of the Router system.
-
-The preferred way to configure the system is with standard Configuration providers, which are part of the
-.NET Core / ASP .NET Core infrastructure.
-
-See further information:
-https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-3.1
-
-This enables common options for application configuration that can be used 'out-of-the-box':
-
-- Via the file appsettings.json
-- With the StaticRoutesConfigurationProvider (StaticRoutes.xml)
-- Using Environment Variables.
-- Command line arguments
-- etc.
-
-The configuration has to be loaded during application startup and is placed into the **'Beckhoff.TwinCAT.Ads.AdsRouterConsole'** application via dependency injection and
-must contain the following information:
-- The name of the local System (usually the Computer or Hostname)
-- The Local AmsNetId of the local system as Unique Address in the network
-- Optionally the used TcpPort (48898 or 0xBF02 by default)
-- The static routes in the 'RemoteConnections' list.
-- Logging configuration.
-
-Actually the configuration is not reloaded during the runtime of the **'Beckhoff.TwinCAT.Ads.AdsRouterConsole'** application.
-Please be aware that the "Backroute" from the Remote system linking to the local system (via AmsNetId) is necessary also to get functional routes.
-
-### Json
-Example for a valid 'appSettings.json' file (please change the Addresses for your network/systems.)
-
-```json
-{
- "AmsRouter": {
- "Name": "MyLocalSystem",
- "NetId": "192.168.1.20.1.1",
- "TcpPort": 48898,
- "RemoteConnections": [
- {
- "Name": "RemoteSystem1",
- "Address": "RemoteSystem1",
- "NetId": "192.168.1.21.1.1",
- "Type": "TCP_IP"
- },
- {
- "Name": "RemoteSystem2",
- "Address": "192.168.1.22",
- "NetId": "192.168.1.22.1.1",
- "Type": "TCP_IP"
- },
- ]
- },
- "Logging": {
- "LogLevel": {
- "Default": "Warning"
- }
- }
-}
-```
-### StaticRoutes.xml
-Alternatively a "StaticRoutes.Xml" Xml File can configure the system in the same manner.
-
-An example of the local "StaticRoutes.xml" is given here:
-
-```xml
-
-
-
- MyLocalSystem
- 192.168.1.22.1.1
-
-
-
- MyRemoteSystem
- RemoteSytem
-
- 192.168.1.21.1.1
- TCP_IP
-
-
-
-```
-
-This file must be edited to configure the ADS Router. It is not reloaded during the runtime of the **'Beckhoff.TwinCAT.Ads.AdsRouterConsole'** application.
-
-### Configuration by Environment Variables
-Alternatively, the configuration can also be set via Environment variables.
-
-```Powershell
-PS> $env:AmsRouter:Name = 'MyLocalSystem'
-PS> $env:AmsRouter:NetId = '192.168.1.20.1.1'
-PS> $env:AmsRouter:TcpPort = 48898
-PS> $env:AmsRouter:RemoteConnections:0:Name = 'RemoteSystem1'
-PS> $env:AmsRouter:RemoteConnections:0:Address = 'RemoteSystem1'
-PS> $env:AmsRouter:RemoteConnections:0:NetId = '192.168.1.21.1.1'
-PS> $env:AmsRouter:RemoteConnections:1:Name = 'RemoteSystem2'
-PS> $env:AmsRouter:RemoteConnections:1:Address = '192.168.1.22'
-PS> $env:AmsRouter:RemoteConnections:1:NetId = '192.168.1.22.1.1'
-PS> $env:AmsRouter:Logging:LogLevel:Default = 'Warning'
-```
-
-```Powershell
-PS> dir env: | where Name -like AmsRouter* | format-table -AutoSize
-
-Name Value
----- -----
-AmsRouter:Name MyLocalSystem
-AmsRouter:NetId 192.168.1.20.1.1
-AmsRouter:TcpPort 48898
-AmsRouter:RemoteConnections:0:Name RemoteSystem1
-AmsRouter:RemoteConnections:0:Address RemoteSystem1
-AmsRouter:RemoteConnections:0:NetId 192.168.1.21.1.1
-AmsRouter:RemoteConnections:1:Name RemoteSystem2
-AmsRouter:RemoteConnections:1:Address 192.168.1.22
-AmsRouter:RemoteConnections:1:NetId 192.168.1.22.1.1
-AmsRouter:Logging:LogLevel:Default Warning
-```
-
-## First Steps
-
-### Running as .NET Core or .NET Standard application
-```Shell
-dotnet run .\TwinCAT.Ads.AdsRouterConsole.dll
-```
-
-### Running as Full Framework Application
-```Shell
-TwinCAT.Ads.AdsRouterConsole.exe
-```
-
-### Testing
-The Sample Application instantiates AdsServers beneath the Routers:
-1. Router AdsServer (Port 1)
-2. SystemService AdsServer (Port 10000)
-
-Therefore, this application can be tested very easy with the 'TcXaeMgmt' Powershell Module. Just install this module into the local Powershell
-
-[Installation](https://www.powershellgallery.com/packages/TcXaeMgmt)
-
-[Documentation](https://infosys.beckhoff.com/english.php?content=../content/1033/tc3_ads_ps_tcxaemgmt/3972231819.html&id=8731138690123386389)
-
-Installing the TcXaeMgmt Module
-```pwsh
-PS> install-module TcXaeMgmt
-PS> import-module TcXaeMgmt
-```
-
-Determine the local AmsNetId
-```pwsh
-PS> Get-AdsRoute -local
-
-Name NetId Protocol TLS Address FingerPrint
----- ----- -------- --- ------- -----------
-MYSYSTEM 1.1.1.1.1.1 TcpIP 192.168.0.1
-```
-
-Testing the Local AdsServers (Router and SystemService)
-```pwsh
-
-PS> Test-AdsRoute -port 1
-Name Address Port Latency Result
- (ms)
----- ------- ---- ------- ------
-MYSYSTEM 1.1.1.1.1.1 1 4 Ok
-
-PS> Test-AdsRoute -port 10000
-
-Name Address Port Latency Result
- (ms)
----- ------- ---- ------- ------
-MYSYSTEM 1.1.1.1.1.1 10000 0.9 Ok
-```
-
-Getting remote routes of the local system
-```pwsh
-PS> Get-AdsRoute
-
-Name NetId Protocol TLS Address FingerPrint
----- ----- -------- --- ------- -----------
-CodedRemote 3.3.3.3.1.1 TcpIP
-```
-
-Broadcast Search
-```pwsh
-PS> Get-AdsRoute -all
-
-Name NetId Protocol TLS Address FingerPrint TcVersion RTSystem
----- ----- -------- --- ------- ----------- --------- --------
-MYSYSTEM 1.1.1.1.1.1 TcpIP 192.168.0.1 [UNKNOWN] [UNKNOWN]
-CX_11111 1.1.1.1.1.2 TcpIP X 192.168.0.2 478c762e... 3.1.4025 TcBSD 13.2
-CX_11112 1.1.1.1.1.3 TcpIP X 192.168.0.3 3.1.4022 CE7.0
-CX_11113 1.1.1.1.1.4 TcpIP X 192.168.0.4 ab35ff7f... 3.1.4024 Win10 (21H2)
-CX_11114 1.1.1.1.1.5 TcpIP X 192.168.0.5 4528dc85... 3.1.4024 Win10 (22H2)
-```
-
-Adding and Removing Routes (help)
-
-```pwsh
-PS> get-help Add-AdsRoute -examples
-PS> get-help Remove-AdsRoute -examples
-```
-
-
-
-## Further documentation
-The actual version of the documentation is available in the Beckhoff Infosys.
-[Beckhoff Information System](https://infosys.beckhoff.com/index.php?content=../content/1033/tc3_ads.net/index.html&id=207622008965200265)
diff --git a/source/AdsRouterConsoleApp/docs/run-as-docker-container.md b/source/AdsRouterConsoleApp/docs/run-as-docker-container.md
deleted file mode 100644
index 9ed8133..0000000
--- a/source/AdsRouterConsoleApp/docs/run-as-docker-container.md
+++ /dev/null
@@ -1,129 +0,0 @@
-# Package and deploy the AdsRouterConsoleApp as a Container Image
-
-## Build the image
-
-Change directory to the project root folder (where the *.sln files are located).
-
-From within the project root run the `docker build` process with appropriated arguments.
-
-For instance, the following command builds an `ads-router-console` image based on the provided `Dockerfile`.
-
-```sh
-docker build -t ads-router-console --target=final --file Dockerfile .
-```
-
-**Don't miss the `.` at the end of the `docker build` command.**
-The `.` sets the current directoy (which should be the root of the repository) as the build context which serves as root for relative paths during the build process.
-
-Afterwards `docker image ls` should list the build `ads-router-console` image.
-
-## Run the image as a container on the container-host network
-
-The `AdsRouterConsoleApp` expects AMS route configurations to be passed as envrionment variables.
-
-Only environment variables starting with `ENV_` will be read by the application.
-In the following you find a minimal example set of sutiable variables.
-
-```sh
-# Basic ADS-Router config which has to match StaticRoutes on TwinCAT-Host systems
-ENV_AmsRouter__Name=AdsRouterConsole
-ENV_AmsRouter__NetId=55.123.98.42.1.1
-
-# Indexed List of remote connections to TwinCAT Hosts
-# First TwinCAT-Host
-ENV_AmsRouter__RemoteConnections__0__Name=TwinCAT-Host
-ENV_AmsRouter__RemoteConnections__0__Address=192.168.178.72
-ENV_AmsRouter__RemoteConnections__0__NetId=5.29.122.232.1.1
-
-# Another sample TwinCAT-Host
-ENV_AmsRouter__RemoteConnections__1__Name=Another-TwinCAT-Host
-ENV_AmsRouter__RemoteConnections__1__Address=192.168.178.74
-ENV_AmsRouter__RemoteConnections__1__NetId=19.58.12.202.1.1
-
-# Verbose log output
-ENV_Logging__LogLevel__Default=Debug
-```
-
-To pass environment variables to a container instance you can use the [-e, --env or --env-file option](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file)
-
-In the following example, the set of environment variables is passed via `--env-file` as argument of the `docker run` command.
-
-```sh
-docker run \
--it \
---rm \
---name adsrouter \
---env-file="src/settings-host-network.env" \
---network host \
-ads-router-console
-```
-
-## Run the image as a container inside a bridged container network
-
-If you leave out the `--network host` option in the `docker run` command, docker assigns the container to the default bridge network (even though the [default bridge network is is considered as a legacy detail of Docker](https://docs.docker.com/network/bridge/#use-the-default-bridge-network)).
-As a result, Docker configures a bridge device and assigns a private IP address to that bridge which is usually referred to as `docker0`.
-
-```sh
-$ ip addr show dev docker0
-3: docker0: mtu 1500 qdisc noqueue state DOWN group default
- link/ether 02:42:11:29:6a:bc brd ff:ff:ff:ff:ff:ff
- inet 172.18.0.1/16 brd 172.18.255.255 scope global docker0
- valid_lft forever preferred_lft forever
- inet6 fe80::42:11ff:fe29:6abc/64 scope link
- valid_lft forever preferred_lft forever
-```
-
-In bridge mode, each started container owns a (virtual) network stack which gets configured by docker during the container start.
-During the configuration docker assigns each container a IP address in the subnet of the `docker0` bridge.
-Likewise, the previously assigned IP address of the `docker0` bridge is set as default route within each container.
-Finally, docker utilizes the `iptables` on the container-host to apply network address translation as well as port forwarding between the container network, the `docker0` bridge and the container host network.
-
-Running the `AdsRouterConsole` inside a container within a bridged network requires the assignmend of a `LoopbackIP` and a `LoopbackPort`.
-Furthermore, the `AdsRouterConsole` needs information about IP addresses of ADS-Client applications, deployed as seperated containers in the private subnet of the bridged network.
-All required settings should be passed as envrionment variables.
-Again, only environment variables starting with `ENV_` will be read by the application.
-In the following you find a minimal example set of sutiable variables for a bridged network setup:
-
-```sh
-# Basic ADS-Router config which has to match StaticRoutes on TwinCAT-Host systems
-ENV_AmsRouter__Name=AdsRouterConsole
-ENV_AmsRouter__NetId=55.123.98.42.1.1
-
-# IP and TCP socket on which the ADS-Router should listen on for incoming client connections
-ENV_AmsRouter__LoopbackIP=172.17.0.2
-ENV_AmsRouter__LoopbackPort=48900
-
-# Setting to accept incoming ADS-Client connections from the private container subnetwork
-ENV_AmsRouter__LoopbackExternalSubnet=172.17.0.0/16
-
-# Indexed List of remote connections to TwinCAT Hosts
-# First TwinCAT-Host
-ENV_AmsRouter__RemoteConnections__0__Name=TwinCAT-Host
-ENV_AmsRouter__RemoteConnections__0__Address=192.168.178.72
-ENV_AmsRouter__RemoteConnections__0__NetId=5.29.122.232.1.1
-
-# Another sample TwinCAT-Host
-ENV_AmsRouter__RemoteConnections__1__Name=Another-TwinCAT-Host
-ENV_AmsRouter__RemoteConnections__1__Address=192.168.178.74
-ENV_AmsRouter__RemoteConnections__1__NetId=19.58.12.202.1.1
-
-# Verbose log output
-ENV_Logging__LogLevel__Default=Debug
-```
-
-To pass environment variables to a container instance you can use the [-e, --env or --env-file option](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file)
-
-In the following example, a set of environment variables is passed via `--env-file` as argument of the `docker run` command.
-In addition, we can pass the `--ip` option to match the `ENV_AmsRouter__LoopbackIP=172.17.0.2` setting.
-Likewise the `-p` option is used to map the `ENV_AmsRouter__LoopbackPort=48900` port of the container to the host port `48898`.
-
-```sh
-docker run \
--it \
---rm \
---name adsrouter \
---env-file="src/settings-bridged-network.env" \
---ip 172.17.0.2 \
--p 48898:48900 \
-ads-router-console
-```
diff --git a/source/AdsRouterConsoleApp/docs/run-beneath-TwinCATRouter.md b/source/AdsRouterConsoleApp/docs/run-beneath-TwinCATRouter.md
deleted file mode 100644
index 2e05e1b..0000000
--- a/source/AdsRouterConsoleApp/docs/run-beneath-TwinCATRouter.md
+++ /dev/null
@@ -1,72 +0,0 @@
-# Run the AdsRouterConsoleApp together with the standard installed TwinCAT Router
-One sophisticated scenario is to run the AdsRouterConsoleApp beneath the standard TwinCAT Router.
-The result will be two different (virtual) independent ADS networks.
-
-Because the standard Router 'blocks' the IPLoopback for its own loopback communication,
-the AdsRouterConsoleApp must be configured to different Addresses and ports.
-
-# Example for a configuration
-
-Local IPAddress:
-192.168.2.1
-
-TwinCAT Router AmsNetId: 1.1.1.1.1.1 (internal channel 127.0.0.1:48998, external 192.168.2.1: 48998)
-AdsRouterConsole AmsNetId: 2.2.2.2.1.1 (internal channel 192.168.2.1: 48900, external 192.168.2.1: 48901)
-
-AdsClients and AdsServers that can communicate via the TwinCAT Router must run on this machine (IPAddress 127.0.0.1)
-AdsClients and AdsServers that can communicate via the AdsRouterConsole are in the Network 192.168.2.0/24
-
-The LoopbackExternalSubnet / LoopbackExternals setting can be used alternatively on AdsRouterConsole application.
-
-## TwinCAT Router
-| Name | Value | Description | Configurable |
-| ---- | --- | --- | --- |
-| AmsNetId | 1.1.1.1.1.1 | AmsNetId of the TwinCAT Router | true |
-| LoopbackIP | 127.0.0.1 | LoopbackIP of the TwinCAT Router | false |
-| LoopbackPort | 48998 (0xBF02) | Used TCP/IP port for the 'internal' communication channel | false |
-| ExternalPort | 48998 (0xBF02) | Used TCP/IP Port for external ADS communication | false |
-| LoopbackExternalSubnet | 127.0.0.1/32 | Loopback access is only allowed for Source IP 127.0.0.1 | false |
-| LoopbackExternals | 127.0.0.1 | Loopback access is only allowed for Source IP 127.0.0.1 | false |
-
-## TcpIpRouter Component / AdsRouterConsole application
-
-| Name | Value | Description | Configurable |
-| ---- | --- | --- | --- |
-| AmsNetId | 2.2.2.2.1.1 | AmsNetId of the AdsRouterConsole/TcpIpRouter | true |
-| LoopbackIP | 192.168.2.1 | (external) IPAddress that is allowed to use the 'internal' ADS communication port | true |
-| LoopbackPort | 48900 | Used TCP/IP port for the 'internal' communication channel | true |
-true |
-| ExternalPort | 48901 | Used TCP/IP Port for ADS communication | false |
-| LoopbackExternalSubnet | 192.168.2.0/24 | internal access only allowed for the subnet 192.168.2.0/24 |
-| LoopbackExternals | 192.168.2.3, 192.168.2.4 | or alternativly internal access is only allowed for this list of IPAddresses | true |
-
-### Config.Json for the AdsRouterConsole
-
-```json
-{
- "AmsRouter": {
- "Name": "AdsRouterConsole",
- "NetId": "2.2.2.2.1.1",
- "TcpPort": 48900,
- "LoopbackIP": "192.168.2.1",
- "LoopbackPort": 48901,
-
- "LoopbackExternalSubnet": "192.168.2.0/24",
- // Or alternatively
- // "LoopbackExternals": [
- // { "IP": "192.168.2.3" },
- // { "IP": "192.168.2.4" },
- // ]
- }
-}
-```
-
-### Instantiation with parameters of the AmsTcpIpRouter class
-```csharp
-AmsNetId localNetId = new AmsNetId("2.2.2.2.1.1");
-IPAddress loopbackIP = IPAddress.Parse("192.168.2.1");
-int loopbackPort = 48900;
-int externalPort = 48901;
-IPNetwork loopbackExternalSubnet = new IPNetwork(“192.168.2.0/24”);
-AmsTcpIpRouter _router = new AmsTcpIpRouter(localNetId, loopbackPort, loopbackIP, externalPort, loopbackExternalSubnet, _logger);
-```
\ No newline at end of file
diff --git a/source/AdsRouterConsoleApp/src/AdsRouterConsoleApp.csproj b/source/AdsRouterConsoleApp/src/AdsRouterConsoleApp.csproj
deleted file mode 100644
index 2eb3b5c..0000000
--- a/source/AdsRouterConsoleApp/src/AdsRouterConsoleApp.csproj
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
- Exe
- net10.0
- Simple TCP/IP ADS Router Console Application for use on systems without TwinCAT installation / setup.
- TCP/IP ADS Router Console Application
- true
- TwinCAT.Ads.AdsRouterService.Program
- true
- portable
- latest
- PackageReference
- enable
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PreserveNewest
- Always
- true
-
-
-
diff --git a/source/AdsRouterConsoleApp/src/Program.cs b/source/AdsRouterConsoleApp/src/Program.cs
deleted file mode 100644
index d24b77c..0000000
--- a/source/AdsRouterConsoleApp/src/Program.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Hosting;
-using Microsoft.Extensions.Logging;
-using System;
-using System.Threading;
-using TwinCAT.Ads.TcpRouter;
-
-namespace TwinCAT.Ads.AdsRouterService
-{
- #region CODE_SAMPLE_ROUTERCONSOLE
-
- class Program
- {
- ///
- /// Defines the entry point of the application.
- ///
- /// The arguments.
- public static void Main(string[] args)
- {
- try
- {
- CreateHostBuilder(args).Build().Run();
- }
- catch (OperationCanceledException /*cex*/)
- {
- Console.WriteLine("Router cancelled!");
- }
- catch (Exception ex)
- {
- Console.WriteLine($"Router failed with '{ex.Message}'");
- }
- }
-
- ///
- /// Creates the host builder.
- ///
- /// The arguments.
- /// IHostBuilder.
- public static IHostBuilder CreateHostBuilder(string[] args)
- {
- var ret = Host.CreateDefaultBuilder(args);
-
- ret.ConfigureServices((hostContext, services) =>
- {
- services.AddHostedService();
- })
- .ConfigureAppConfiguration((hostingContext, config) =>
- {
- // Add further AppConfigurationProvider here.
- //config.Sources.Clear(); // Clear all default config sources
- config.AddEnvironmentVariables("ENV_"); // Use Environment variables
- //config.AddCommandLine(args); // Use Command Line
- //config.AddJsonFile("appSettings.json"); // Use Appsettings
- //config.AddStaticRoutesXmlConfiguration(); // Overriding settings with StaticRoutes.Xml
- })
- .ConfigureLogging(logging =>
- {
- logging.ClearProviders();
- // Adding console logging here.
- logging.AddConsole();
- });
- return ret;
- }
- }
- #endregion
-}
diff --git a/source/AdsRouterConsoleApp/src/Worker.cs b/source/AdsRouterConsoleApp/src/Worker.cs
deleted file mode 100644
index 44568fc..0000000
--- a/source/AdsRouterConsoleApp/src/Worker.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.Hosting;
-using Microsoft.Extensions.Logging;
-using TwinCAT.Ads.TcpRouter;
-using System.Net;
-using System.Text;
-using TwinCAT.Ads.SystemService;
-using TwinCAT.Router;
-using TwinCAT;
-//using TwinCAT.Router;
-
-namespace TwinCAT.Ads.AdsRouterService
-{
-
- #region CODE_SAMPLE_ROUTERCONSOLE
-
- ///
- /// The RouterService instance represents a long running (hosted) service that implements an .
- /// Implements the
- ///
- ///
- /// Long running Background task that runs a .
- /// The service is stopped via the given to the method.
- ///
- ///
- public class RouterService : BackgroundService
- {
- private readonly ILoggerFactory _logerFactory;
-
- ///
- /// Logger
- ///
- private readonly ILogger _logger;
- ///
- /// Configuration
- ///
- private readonly IConfiguration _configuration;
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The logger.
- /// The configuration.
- public RouterService(ILoggerFactory loggerFactory, IConfiguration configuration)
- {
- _logerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory));
- _logger = loggerFactory.CreateLogger();
- _configuration = configuration;
- //string? value = _configuration.GetValue("ASPNETCORE_ENVIRONMENT", "Production");
- }
-
- ///
- /// Execute the Router asynchronously as .
- ///
- /// The cancellation token.
- protected override async Task ExecuteAsync(CancellationToken cancel)
- {
- AmsTcpIpRouter router;
-
- using (_logger.BeginScope("Starting"))
- {
- StringBuilder appCommon = new StringBuilder();
-
- appCommon.AppendLine($"ApplicationPath: {Environment.GetCommandLineArgs()[0]}");
- appCommon.AppendLine($"BaseDirectory: {AppContext.BaseDirectory}");
- appCommon.AppendLine($"CurrentDirectory: {Directory.GetCurrentDirectory()}");
- //_logger.LogInformation(sB.ToString());
-
- StringBuilder config = new StringBuilder();
- string? value = _configuration.GetValue("ASPNETCORE_ENVIRONMENT", "Production");
- config.AppendLine($"ASPNETCORE_ENVIRONMENT: {value}");
-
- Console.WriteLine("Application Directories");
- Console.WriteLine("=======================");
- Console.WriteLine(appCommon);
- Console.WriteLine("");
- Console.WriteLine("Configuration");
- Console.WriteLine("=============");
- Console.WriteLine(config);
- Console.WriteLine("");
-
- Console.WriteLine("Press Ctrl + C to shutdown!");
-
- router = new AmsTcpIpRouter(_configuration, _logerFactory);
- router.RouterStatusChanged += Router_RouterStatusChanged;
-
- // Use this overload to instantiate a Router without support of IHost/IConfigurationProvider support and parametrize by code
- // AmsTcpIpRouter router = new AmsTcpIpRouter(new AmsNetId("1.2.3.4.5.6"), AmsTcpIpRouter.DEFAULT_TCP_PORT,IPAddress.Loopback,AmsTcpIpRouter.DEFAULT_TCP_PORT,_logger);
- // router.AddRoute(...);
-
- _logger.LogInformation(appCommon.ToString());
- _logger.LogInformation(config.ToString());
- }
-
- Task routerTask = router.StartAsync(cancel); // Start the router
-
- // Starting included AdsServers
- // In this case we add the simple TwinCAT Router (AmsPort 1) to support adding and removing routes
- AdsRouterServer adsRouterService = new AdsRouterServer(router, _logerFactory);
-
- // And a simple TwinCAT System Service (AmsPort 10000) for supporting browsing routes (including BroadcastSearch)
- SystemServiceServer systemService = new SystemServiceServer(router, _logerFactory);
-
- Task systemServiceTask = systemService.ConnectServerAndWaitAsync(cancel);
- Task routerServerTask = adsRouterService.ConnectServerAndWaitAsync(cancel);
-
- // Wait until Router, AdsRouter Server and SystemService Server have finished.
- await Task.WhenAll(routerTask, systemServiceTask, routerServerTask);
- // Succeeded
- Console.WriteLine("Finished");
- }
-
- ///
- /// Handles the RouterStatusChanged event of the
- ///
- /// The source of the event.
- /// The instance containing the event data.
- private void Router_RouterStatusChanged(object? sender, RouterStatusChangedEventArgs e)
- {
- if (e.RouterStatus == RouterStatus.Started)
- {
- // From here on, the Router is available to receive Data.
- }
- }
- }
- #endregion
-}
diff --git a/source/AdsRouterConsoleApp/src/appSettings.json b/source/AdsRouterConsoleApp/src/appSettings.json
deleted file mode 100644
index b373ca7..0000000
--- a/source/AdsRouterConsoleApp/src/appSettings.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "AmsRouter": {
- "Name": "LocalSystem",
- "NetId": "1.1.1.1.1.1",
- "TcpPort": 48898,
- "RemoteConnections": [
- {
- "Name": "RemoteSystem",
- "Address": "192.168.0.2",
- "NetId": "2.2.2.2.1.1",
- "Type": "TCP_IP"
- }
- ]
- },
- "Logging": {
- "LogLevel": {
- "Default": "Information",
- "System": "Information",
- "Microsoft": "Information"
- },
- "Console": {
- "IncludeScopes": true
- }
- }
-}
\ No newline at end of file
diff --git a/source/AdsRouterConsoleApp/src/appsettingsSample.json b/source/AdsRouterConsoleApp/src/appsettingsSample.json
deleted file mode 100644
index 8b4a968..0000000
--- a/source/AdsRouterConsoleApp/src/appsettingsSample.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "AmsRouter": {
- "Name": "LocalSystem",
- "NetId": "172.19.13.9.1.1",
- "TcpPort": 48898,
- "RemoteConnections": [
- {
- "Name": "RemoteSystem",
- "Address": "10.10.1.122",
- "NetId": "172.21.208.1.1.1",
- "Type": "TCP_IP"
- }
- ]
- },
- "Logging": {
- "LogLevel": {
- "Default": "Information",
- "System": "Information",
- "Microsoft": "Information"
- },
- "Console": {
- "IncludeScopes": true
- }
- }
-}
diff --git a/source/AdsRouterConsoleApp/src/settings-bridged-network.env b/source/AdsRouterConsoleApp/src/settings-bridged-network.env
deleted file mode 100644
index 0b24f47..0000000
--- a/source/AdsRouterConsoleApp/src/settings-bridged-network.env
+++ /dev/null
@@ -1,27 +0,0 @@
-# Alternative settings via Environment Variables
-# using config.AddEnvironmentVariables("ENV_") in ConfigureAppConfiguration
-
-# Basic ADS-Router config which has to match StaticRoutes on TwinCAT-Host systems
-ENV_AmsRouter__Name=AdsRouterConsole
-ENV_AmsRouter__NetId=55.123.98.42.1.1
-
-# IP and TCP socket on which the ADS-Router should listen on for incoming client connections
-ENV_AmsRouter__LoopbackIP=172.17.0.2
-ENV_AmsRouter__LoopbackPort=48900
-
-# Setting to accept incoming ADS-Client connections from the private container subnetwork
-ENV_AmsRouter__LoopbackExternalSubnet=172.17.0.0/16
-
-# Indexed List of remote connections to TwinCAT Hosts
-# First TwinCAT-Host
-ENV_AmsRouter__RemoteConnections__0__Name=TwinCAT-Host
-ENV_AmsRouter__RemoteConnections__0__Address=192.168.178.72
-ENV_AmsRouter__RemoteConnections__0__NetId=5.29.122.232.1.1
-
-# Another sample TwinCAT-Host
-ENV_AmsRouter__RemoteConnections__1__Name=Another-TwinCAT-Host
-ENV_AmsRouter__RemoteConnections__1__Address=192.168.178.74
-ENV_AmsRouter__RemoteConnections__1__NetId=19.58.12.202.1.1
-
-# Verbose log output
-ENV_Logging__LogLevel__Default=Debug
\ No newline at end of file
diff --git a/source/AdsRouterConsoleApp/src/settings-host-network.env b/source/AdsRouterConsoleApp/src/settings-host-network.env
deleted file mode 100644
index 7009632..0000000
--- a/source/AdsRouterConsoleApp/src/settings-host-network.env
+++ /dev/null
@@ -1,21 +0,0 @@
-# Alternative settings via Environment Variables
-# using config.AddEnvironmentVariables("ENV_") in ConfigureAppConfiguration
-
-# Basic ADS-Router config which has to match StaticRoutes on TwinCAT-Host systems
-ENV_AmsRouter__Name=AdsRouterConsoleApp
-ENV_AmsRouter__NetId=55.123.98.42.1.1
-
-# Indexed List of remote connections to TwinCAT Hosts
-# First TwinCAT-Host
-ENV_AmsRouter__RemoteConnections__0__Name=TwinCAT-Host
-ENV_AmsRouter__RemoteConnections__0__Address=192.168.178.72
-ENV_AmsRouter__RemoteConnections__0__NetId=5.29.122.232.1.1
-
-# Another sample TwinCAT-Host
-ENV_AmsRouter__RemoteConnections__1__Name=Another-TwinCAT-Host
-ENV_AmsRouter__RemoteConnections__1__Address=192.168.178.74
-ENV_AmsRouter__RemoteConnections__1__NetId=19.58.12.202.1.1
-
-# Verbose log output
-#ENV_Logging__LogLevel__Default=Debug
-ENV_Logging__LogLevel__Default=Information
\ No newline at end of file
diff --git a/source/Log4Tc/.gitignore b/source/Log4Tc/.gitignore
index 50e6602..805626c 100644
--- a/source/Log4Tc/.gitignore
+++ b/source/Log4Tc/.gitignore
@@ -263,4 +263,6 @@ __pycache__/
# Cake Build tools folder and cake version pinned file
/tools/
-!/tools/packages.config
\ No newline at end of file
+!/tools/packages.config
+
+log4TC-linux-x64/
\ No newline at end of file
diff --git a/source/Log4Tc/Directory.Build.props b/source/Log4Tc/Directory.Build.props
index dbcee33..328b306 100644
--- a/source/Log4Tc/Directory.Build.props
+++ b/source/Log4Tc/Directory.Build.props
@@ -13,8 +13,10 @@
Copyright © mbc-engineering
Apache-2.0
- 26.04.26
+ 26.06.06
+
+ true
net10.0
-
+
diff --git a/source/Log4Tc/Mbc.Log4Tc.Service/Mbc.Log4Tc.Service.csproj b/source/Log4Tc/Mbc.Log4Tc.Service/Mbc.Log4Tc.Service.csproj
index c45f312..7289842 100644
--- a/source/Log4Tc/Mbc.Log4Tc.Service/Mbc.Log4Tc.Service.csproj
+++ b/source/Log4Tc/Mbc.Log4Tc.Service/Mbc.Log4Tc.Service.csproj
@@ -31,7 +31,9 @@
-
+
+
+
@@ -39,12 +41,11 @@
-
-
+
@@ -74,7 +75,6 @@
all
-
/etc/log4tc/config/appsettings.json
@@ -86,19 +86,4 @@
/etc/systemd/system/Mbc.Log4Tc.Service.service
-
-
diff --git a/source/Log4Tc/Mbc.Log4Tc.Service/Program.cs b/source/Log4Tc/Mbc.Log4Tc.Service/Program.cs
index 8c92dea..f94bf5f 100644
--- a/source/Log4Tc/Mbc.Log4Tc.Service/Program.cs
+++ b/source/Log4Tc/Mbc.Log4Tc.Service/Program.cs
@@ -1,4 +1,5 @@
-using Mbc.Log4Tc.Dispatcher;
+using Mbc.Log4Tc.AdsRouter;
+using Mbc.Log4Tc.Dispatcher;
using Mbc.Log4Tc.Model;
using Mbc.Log4Tc.Output.Graylog;
using Mbc.Log4Tc.Output.InfluxDb;
@@ -21,14 +22,14 @@ namespace Mbc.Log4Tc.Service
{
public static class Program
{
- private static string[] CmdArgs;
+ private static string[] _cmdArgs;
public static async Task Main(string[] args)
{
var logPath = Path.Combine(OsPaths.GetInternalLogBasePath(), "service-.log");
var logger = new LoggerConfiguration()
.Enrich.FromLogContext()
- .WriteTo.Console()
+ .WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] <{SourceContext}> {Message:lj}{NewLine}{Exception}")
.WriteTo.File(logPath, outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}) {Message}{NewLine}{Exception}", fileSizeLimitBytes: 1024 * 1024 * 10, retainedFileCountLimit: 5, rollingInterval: RollingInterval.Month)
.CreateLogger();
@@ -49,7 +50,7 @@ await CreateHostBuilder(args, logger)
public static IHostBuilder CreateHostBuilder(string[] args, Logger logger)
{
- CmdArgs = args;
+ _cmdArgs = args;
var hostBuilder = Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration(configure =>
{
@@ -86,6 +87,7 @@ public static IHostBuilder CreateHostBuilder(string[] args, Logger logger)
// .AddOutputs(hostContext.Configuration);
services
+ .AddLog4TcAdsRouter()
.AddLog4TcAdsLogReceiver()
.AddLog4TcDispatcher();
});
@@ -99,12 +101,6 @@ public static IHostBuilder CreateHostBuilder(string[] args, Logger logger)
else
{
throw new PlatformNotSupportedException("Service only in windows system supported.");
- /* For systemd install first package Microsoft.Extensions.Hosting.Systemd and switch to >= netcoreapp3.0
- * https://devblogs.microsoft.com/dotnet/net-core-and-systemd/
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux){
- hostBuilder.UseSystemd();
- }
- */
}
}
@@ -132,7 +128,7 @@ private static string GetPluginPath()
private static bool IsLocalConfig()
{
- return CmdArgs.Contains("--localconfig", StringComparer.InvariantCultureIgnoreCase);
+ return _cmdArgs.Contains("--localconfig", StringComparer.InvariantCultureIgnoreCase);
}
}
}
diff --git a/source/Log4Tc/Mbc.Log4Tc.Service/appsettings.json b/source/Log4Tc/Mbc.Log4Tc.Service/appsettings.json
index af59e0d..0666205 100644
--- a/source/Log4Tc/Mbc.Log4Tc.Service/appsettings.json
+++ b/source/Log4Tc/Mbc.Log4Tc.Service/appsettings.json
@@ -1,4 +1,40 @@
{
+ "AmsRouter": {
+ // Activate AmsTcpIpRouter (Loopback without TC Installation), set to false when ChannelProtocol is set to "AdsOverMqtt" and you want to use MQTT as primary protocol
+ "Active": false,
+ "Name": "Log4TcComputer",
+ "NetId": "1.1.1.1.1.1",
+ // Non Secure Port 48898
+ "TcpPort": 48898,
+ // Allowed values: "Loopback", "UnixSocket"
+ "ChannelPortType": "Loopback",
+ // Allowed values: "Ads" (use Loopback), "AdsOverMqtt" (Forces use of MQTT), "All" (First Loopback, then MQTT)
+ "ChannelProtocol": "AdsOverMqtt",
+ "RemoteConnections": [
+ //{
+ // "Name": "RemoteSystem",
+ // "Address": "10.10.1.111",
+ // "NetId": "10.35.12.19.1.1",
+ // "Type": "TCP_IP"
+ //}
+ ],
+ "Mqtt": [
+ {
+ "NoRetain": false,
+ "Unidirectional": false,
+ "Port": 1883,
+ "Address": "127.0.0.1",
+ "Topic": "AdsOverMqtt"
+ },
+ {
+ "NoRetain": false,
+ "Unidirectional": false,
+ "Port": 1883,
+ "Address": "10.10.1.111",
+ "Topic": "AdsOverMqtt"
+ }
+ ]
+ },
"Logging": {
"LogLevel": {
"Default": "Information",
diff --git a/source/Log4Tc/Mbc.Log4Tc.SmokeTest/Log4TcService.cs b/source/Log4Tc/Mbc.Log4Tc.SmokeTest/Log4TcService.cs
index 217b105..4b1d762 100644
--- a/source/Log4Tc/Mbc.Log4Tc.SmokeTest/Log4TcService.cs
+++ b/source/Log4Tc/Mbc.Log4Tc.SmokeTest/Log4TcService.cs
@@ -1,8 +1,7 @@
-using FakeItEasy;
-using Mbc.Log4Tc.Dispatcher;
+using Mbc.Log4Tc.Dispatcher;
using Mbc.Log4Tc.Model;
using Mbc.Log4Tc.Receiver;
-using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging.Abstractions;
using System;
using System.Collections.Generic;
@@ -20,7 +19,8 @@ public Log4TcService()
{
var adsLogReceiverlogger = new NullLoggerFactory();
var adsHostnameService = new AdsHostnameService(new NullLogger());
- _adsLogReceiver = new AdsLogReceiver(adsLogReceiverlogger, adsHostnameService);
+ var configuration = new ConfigurationBuilder().Build();
+ _adsLogReceiver = new AdsLogReceiver(configuration, adsLogReceiverlogger, adsHostnameService);
_output = new TestRecordingOutput();
}
diff --git a/source/Log4Tc/dockerfile b/source/Log4Tc/dockerfile
index 8547465..e32d660 100644
--- a/source/Log4Tc/dockerfile
+++ b/source/Log4Tc/dockerfile
@@ -7,48 +7,39 @@
# --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
# --build-arg SOURCECOMMITID="$(git rev-parse HEAD)" \
# -t log4tc:$log4TCversion-beta .
+#
+# Run the image with the following command:
+# podman run -d --name log4tc -p 16150:16150 log4tc:$log4TCversion-beta
-# Base Image stage
-########################
-FROM mcr.microsoft.com/dotnet/runtime:8.0-bookworm-slim AS base
+# runtime-deps -> Ubuntu based native linux libs present
+FROM mcr.microsoft.com/dotnet/runtime-deps:10.0
ARG BUILD_VERSION
ARG BUILD_DATE
ARG SOURCECOMMITID
WORKDIR /app
-# The ADS server port for this server. For custom Servers, the port range should
+# The Log4TC custom ADS server port for this server.
EXPOSE 16150
+# The Default ADS Port
+EXPOSE 48898
# The OCI Spec Labels https://github.com/opencontainers/image-spec/blob/main/annotations.md
LABEL org.opencontainers.image.version=$BUILD_VERSION
LABEL org.opencontainers.image.created=$BUILD_DATE
-LABEL org.opencontainers.image.title=log4TC
-LABEL org.opencontainers.image.authors=stegm;bqstony
-LABEL org.opencontainers.image.source=https://github.com/mbc-engineering/log4TC
+LABEL org.opencontainers.image.title="log4TC"
+LABEL org.opencontainers.image.description="log4TC is a logging and telemetry collection service for TwinCAT systems, providing a unified interface for collecting, processing, and forwarding log data from TwinCAT environments to various logging backends."
+LABEL org.opencontainers.image.authors="stegm;bqstony"
+LABEL org.opencontainers.image.source="https://github.com/mbc-engineering/log4TC"
LABEL org.opencontainers.image.revision=$SOURCECOMMITID
-LABEL org.opencontainers.image.base.name=mcr.microsoft.com/dotnet/runtime:8.0-bookworm-slim
+LABEL org.opencontainers.image.base.name="mcr.microsoft.com/dotnet/runtime:10.0"
LABEL org.opencontainers.image.vendor="mbc-engineering"
+LABEL org.opencontainers.image.source="https://github.com/mbc-engineering/log4TC"
# Default configuration for the log4TC service
RUN mkdir -p /var/log/log4tc /etc/log4tc/config
-COPY Mbc.Log4Tc.Service/appsettingsSample.json /etc/log4tc/config/appsettings.json
+COPY Mbc.Log4Tc.Service/appsettings.json /etc/log4tc/config/appsettings.json
COPY Mbc.Log4Tc.Output.NLog/NLogLinux.config /etc/log4tc/config/NLog.config
-# Stages for building and test the app
-########################
-FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS test-stage
-WORKDIR /src
-COPY . .
-RUN dotnet test --framework net10.0 --configuration Release --logger trx --results-directory /app/testresults
-
-FROM test-stage AS publish-stage
-WORKDIR /src/Mbc.Log4Tc.Service
-RUN dotnet publish --framework net10.0 --configuration Release --self-contained false --runtime linux-x64 --output /app/publish
-
-# Stage for pack the binary to deployment container
-########################
-FROM base AS final
-WORKDIR /app
-COPY --from=publish-stage /app/testresults ./testresults
-COPY --from=publish-stage /app/publish .
-ENTRYPOINT ["dotnet", "Mbc.Log4Tc.Service.dll"]
+# the self-contained build artefact
+COPY log4TC-linux-x64/ .
+ENTRYPOINT ["./Mbc.Log4Tc.Service"]
diff --git a/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/.gitignore b/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/.gitignore
index 1269488..00f31cc 100644
--- a/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/.gitignore
+++ b/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/.gitignore
@@ -1 +1,3 @@
-data
+data/log4TC-chronograf-storage
+data/log4TC-influxdb-storage
+data/log4TC-mosquitto-storage/data
diff --git a/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/data/log4TC-mosquitto-storage/config/simple-mosquitto.conf b/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/data/log4TC-mosquitto-storage/config/simple-mosquitto.conf
new file mode 100644
index 0000000..6326a18
--- /dev/null
+++ b/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/data/log4TC-mosquitto-storage/config/simple-mosquitto.conf
@@ -0,0 +1,4 @@
+listener 1883
+persistence true
+persistence_location /mosquitto/data
+allow_anonymous true
\ No newline at end of file
diff --git a/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/docker-compose.mqtt.yml b/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/docker-compose.mqtt.yml
new file mode 100644
index 0000000..7d4d5ba
--- /dev/null
+++ b/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/docker-compose.mqtt.yml
@@ -0,0 +1,146 @@
+services:
+ influxdb:
+ image: influxdb:1.8-alpine
+ volumes:
+ - ./data/log4tc-influxdb-storage:/var/lib/influxdb
+ - ./initdb.iql:/docker-entrypoint-initdb.d/initdb.iql
+ ports:
+ - 8086:8086
+ networks:
+ - twincatads
+
+ chronograf:
+ image: chronograf:1.8-alpine
+ depends_on:
+ - influxdb
+ environment:
+ INFLUXDB_URL: http://influxdb:8086
+ ports:
+ - 8888:8888
+ volumes:
+ - ./data/log4TC-chronograf-storage:/var/lib/chronograf
+ networks:
+ - twincatads
+
+ mosquitto:
+ image: eclipse-mosquitto:latest
+ container_name: mosquitto
+ hostname: mosquitto
+ ports:
+ - "1883:1883"
+ restart: unless-stopped
+ volumes:
+ - ./data/log4TC-mosquitto-storage/config/simple-mosquitto.conf:/mosquitto/config/mosquitto.conf:ro
+ networks:
+ - twincatads
+
+ log4tc:
+ #image: log4tc:26.06.06-beta
+ image: ghcr.io/bqstony/log4tc:26.06.06-beta
+ container_name: log4tc
+ depends_on:
+ - mosquitto
+ - influxdb
+ volumes:
+ - ./appsettings.json:/etc/log4tc/config/appsettings.json
+ environment:
+ - DOTNET_AmsRouter__Active=true
+ - DOTNET_AmsRouter__Name=Log4TcContainer
+ - DOTNET_AmsRouter__NetId=1.1.1.100.1.1
+ # Non Secure Port 48898
+ - DOTNET_AmsRouter__TcpPort=48898
+ # Allowed values: "Loopback", "UnixSocket"
+ - DOTNET_AmsRouter__ChannelPortType=Loopback
+ # Allowed values: "Ads" (use Loopback), "AdsOverMqtt" (Forces use of MQTT), "All" (First Loopback, then MQTT)
+ - DOTNET_AmsRouter__ChannelProtocol=AdsOverMqtt
+ # IP and TCP socket on which the ADS-Router should listen on for incoming (internal) client connections
+ # Changed IP/Port here to use a dedicated Ip Port for internal Router communication
+ - DOTNET_AmsRouter__LoopbackIP=192.168.20.100
+ - DOTNET_AmsRouter__LoopbackPort=48900
+ # Setting to accept incoming ADS-Client connections from the private container subnetwork
+ - DOTNET_AmsRouter__LoopbackExternalSubnet=192.168.20.0/24
+ - DOTNET_AmsRouter__Mqtt__0__NoRetain=false
+ - DOTNET_AmsRouter__Mqtt__0__Unidirectional=false
+ - DOTNET_AmsRouter__Mqtt__0__Port=1883
+ - DOTNET_AmsRouter__Mqtt__0__Address=127.0.0.1
+ - DOTNET_AmsRouter__Mqtt__0__Topic=AdsOverMqtt
+ - DOTNET_AmsRouter__Mqtt__1__NoRetain=false
+ - DOTNET_AmsRouter__Mqtt__1__Unidirectional=false
+ - DOTNET_AmsRouter__Mqtt__1__Port=1883
+ - DOTNET_AmsRouter__Mqtt__1__Address=10.10.1.111
+ - DOTNET_AmsRouter__Mqtt__1__Topic=AdsOverMqtt
+ # Example for a remote connection to a TwinCAT system with log4TC library integrated.
+ #- DOTNET_AmsRouter__RemoteConnections__0__Name=TwinCAT-Host
+ #- DOTNET_AmsRouter__RemoteConnections__0__Address=10.10.1.149
+ #- DOTNET_AmsRouter__RemoteConnections__0__NetId=5.23.232.30.1.1
+ # The rest comes from the default appsettings.json, which can be overridden by mounting a custom one via volumes or with environment variables
+ ports:
+ # The Log4TC custom ADS server port for this server.
+ - 16150:16150
+ # The Default ADS Port
+ - 48898:48898
+ restart: unless-stopped
+ networks:
+ twincatads:
+ # The router address is defined fixed in the Environment Variables (config-routerconsole.env)
+ ipv4_address: 192.168.20.100
+
+ tc31-xar-base-opc:
+ image: ghcr.io/bqstony/tc31-xar-base-opc:2026.05.27
+ container_name: tc31-xar-base-opc
+ hostname: tc31-xar-base-opc
+ restart: unless-stopped
+ depends_on:
+ - mosquitto
+ privileged: true
+ ulimits:
+ memlock: -1
+ rtprio: 99
+ #devices:
+ #- /dev/mem:/dev/mem
+ #- /dev/bbapi:/dev/bbapi
+ volumes:
+ # IN WSL %UserProfile%\.wslconfig Enable:
+ # The empty sample and soft-RT dev workloads run without any hugepages reserved. Only real PLC projects with a non-zero LockedMemSize (EtherCAT master, large router memory) need hugetlbfs-backed memory in the WSL kernel — in that case make the allocation persistent across Docker Desktop / host restarts by adding the kernel boot parameters to
+ #[wsl2]
+ #memory=10GB
+ #guiApplications=true
+ #kernelCommandLine=default_hugepagesz=2M hugepagesz=2M hugepages=1024
+ #
+ # HugePages provide physically contiguous memory regions for DMA mapping.
+ # Verify : cat /proc/meminfo | grep HugePages_Tota
+ # HugePages_Total: 1024
+ - /dev/hugepages:/dev/hugepages:rw
+ networks:
+ - twincatads
+
+ # Use PCI_DEVICES as environment variables to specify the Ethernet
+ # controllers which can be used by the TwinCAT runtime for real-time
+ # ethernet communication.
+ # If PCI_DEVICES is not provided at all, TwinCAT will probe all
+ # available Ethernet controllers of the host for real-time ethernet communication.
+ # If PCI_DEVICES is set to NONE, the TwinCAT runtime won't use probe
+ # any PCI Ethernet controller for real-time ethernet communicaion.
+ # Set PCI_DEVICES to a space seperated list of PCI slot address
+ # to explicitly set Ethernet controllers for real-time ethernet communication.
+ # Run `sudo TcRteInstall -l` on the host to get a list of available
+ # Ethernet controllers and their PCI slot address
+ # Examples:
+ # #- PCI_DEVICES=NONE
+ # - PCI_DEVICES=NONE
+ # - PCI_DEVICES=0000:02:00.0
+ # - PCI_DEVICES=0000:04:00.0 0000:03:00.0
+ environment:
+ - PCI_DEVICES=NONE
+ - AMS_NETID=15.15.15.15.1.1
+ # Mode -> FAST_AS_POSSIBLE is regular proces / REALTIME is uses realtime capabilities of the host / Test is for testing purposes
+ - TC_RUN_MODE=FAST_AS_POSSIBLE
+
+networks:
+ twincatads:
+ name: twincatads
+ ipam:
+ driver: default
+ config:
+ - subnet: 192.168.20.0/24
+ gateway: 192.168.20.1
diff --git a/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/docker-compose.yml b/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/docker-compose.yml
new file mode 100644
index 0000000..8f3eb78
--- /dev/null
+++ b/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/docker-compose.yml
@@ -0,0 +1,71 @@
+services:
+ influxdb:
+ image: influxdb:1.8-alpine
+ volumes:
+ - ./data/log4tc-influxdb-storage:/var/lib/influxdb
+ - ./initdb.iql:/docker-entrypoint-initdb.d/initdb.iql
+ ports:
+ - 8086:8086
+ networks:
+ - twincatads
+
+ chronograf:
+ image: chronograf:1.8-alpine
+ depends_on:
+ - influxdb
+ environment:
+ INFLUXDB_URL: http://influxdb:8086
+ ports:
+ - 8888:8888
+ volumes:
+ - ./data/log4TC-chronograf-storage:/var/lib/chronograf
+ networks:
+ - twincatads
+
+ log4tc:
+ #image: log4tc:26.06.06-beta
+ image: ghcr.io/bqstony/log4tc:26.06.06-beta
+ container_name: log4tc
+ depends_on:
+ - influxdb
+ volumes:
+ - ./appsettings.json:/etc/log4tc/config/appsettings.json
+ environment:
+ - DOTNET_AmsRouter__Active=true
+ - DOTNET_AmsRouter__Name=Log4TcContainer
+ - DOTNET_AmsRouter__NetId=1.1.1.100.1.1
+ # Non Secure Port 48898
+ - DOTNET_AmsRouter__TcpPort=48898
+ # Allowed values: "Loopback", "UnixSocket"
+ - DOTNET_AmsRouter__ChannelPortType=Loopback
+ # Allowed values: "Ads" (use Loopback), "AdsOverMqtt" (Forces use of MQTT), "All" (First Loopback, then MQTT)
+ - DOTNET_AmsRouter__ChannelProtocol=All
+ # IP and TCP socket on which the ADS-Router should listen on for incoming (internal) client connections
+ # Changed IP/Port here to use a dedicated Ip Port for internal Router communication
+ - DOTNET_AmsRouter__LoopbackIP=192.168.20.100
+ - DOTNET_AmsRouter__LoopbackPort=48900
+ # Setting to accept incoming ADS-Client connections from the private container subnetwork
+ - DOTNET_AmsRouter__LoopbackExternalSubnet=192.168.20.0/24
+ # Example for a remote connection to a TwinCAT system with log4TC library integrated.
+ - DOTNET_AmsRouter__RemoteConnections__0__Name=TwinCAT-Host
+ - DOTNET_AmsRouter__RemoteConnections__0__Address=10.10.1.149
+ - DOTNET_AmsRouter__RemoteConnections__0__NetId=10.10.1.149.1.1
+ # The rest comes from the default appsettings.json, which can be overridden by mounting a custom one via volumes or with environment variables
+ ports:
+ # The Log4TC custom ADS server port for this server.
+ - 16150:16150
+ # The Default ADS Port
+ - 48898:48898
+ networks:
+ twincatads:
+ # The router address is defined fixed in the Environment Variables (config-routerconsole.env)
+ ipv4_address: 192.168.20.100
+
+networks:
+ twincatads:
+ name: twincatads
+ ipam:
+ driver: default
+ config:
+ - subnet: 192.168.20.0/24
+ gateway: 192.168.20.1
diff --git a/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/log4TC_pod.yaml b/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/log4TC_pod.yaml
deleted file mode 100644
index e4534bf..0000000
--- a/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/log4TC_pod.yaml
+++ /dev/null
@@ -1,62 +0,0 @@
-apiVersion: v1
-kind: Pod
-metadata:
- name: log4tc
-spec:
- #hostNetwork: true
- containers:
- - name: influxdb
- image: docker.io/influxdb:1.8-alpine
- volumeMounts:
- - name: log4tc-influxdb-storage
- mountPath: /var/lib/influxdb
- - name: log4tc-influxdb-initdb
- # All files in /docker-entrypoint-initdb.d werden beim neuen Containerstart ausgeführt
- mountPath: /docker-entrypoint-initdb.d/initdb.iql
- ports:
- - containerPort: 8086
- hostPort: 8086
- - name: chronograf
- image: docker.io/chronograf:1.8-alpine
- env:
- - name: INFLUXDB_URL
- value: http://localhost:8086
- ports:
- - containerPort: 8888
- hostPort: 8888
- volumeMounts:
- - name: log4tc-chronograf-storage
- mountPath: /var/lib/chronograf
- - name: log4tc-adsrouter
- image: log4tc-adsrouter:24.11.08-beta
- ports:
- - containerPort: 48898
- hostPort: 48898
- - name: log4tc-service
- image: log4tc:24.11.08-beta
- # activate influxdb logging
- volumeMounts:
- - name: log4tc-appsetings
- mountPath: /etc/log4tc/config/appsettings.json
- ports:
- - containerPort: 16150
- hostPort: 16150
- volumes:
- - name: log4tc-influxdb-storage
- # Mounte ein lokales Verzeichnis bei lokalen kubernetes-Umgebungen
- hostPath:
- path: ./data/log4tc-influxdb-storage
- type: DirectoryOrCreate
- - name: log4tc-influxdb-initdb
- hostPath:
- path: ./initdb.iql
- type: File
- - name: log4tc-chronograf-storage
- hostPath:
- path: ./data/log4tc-chronograf-storage
- type: DirectoryOrCreate
- - name: log4tc-appsetings
- # Mount appsettings.json to store messages into InfluxDB
- hostPath:
- path: ./appsettings.json
- type: File
diff --git a/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/readme.md b/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/readme.md
index da10538..98c56aa 100644
--- a/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/readme.md
+++ b/source/TwinCat_Examples/influx_on_beckhoff-rt-linux/readme.md
@@ -31,57 +31,19 @@ Podman ist ein Container-Manager, der ohne Daemon-Prozess arbeitet. Er ermöglic
```bash
# Starte pod
-podman kube play log4TC_pod.yaml
+podman compose up -d
podman pod ps
```
Chronograf ist nun erreichbar über die IP-Adresse auf port 8888 `http://[HOST-IP]:8888`
-> ADServerConsole
+> ADS Router
> - Der AdsServer ist erreichbar unter dem Port: 48898, wie in der [Doku](https://infosys.beckhoff.com/english.php?content=../content/1033/tcadscommon/12440276875.html&id=4771231825177913410) beschrieben.
## Cleanup
```bash
# entferne den pod
-podman kube down log4TC_pod.yaml
+podman compose down
rmdir ./data
```
-
-## FAQ
-
-### Verbindung zum AdsServer nicht möglich
-
-Es sollte folgende Meldung im Log4TC-Log erscheinen (Ausgabe über `podman logs -f log4tc-log4tc-service`):
-
-```log
-21:02:33 INF] Starting log4TC service.
-[21:02:34 INF] Starting ADS log receiver.
-[21:02:34 INF] Log receiver connected.
-[21:02:34 INF] Log4Tc AdsServer with name=Log4Tc (16150); Address=172.19.13.9.1.1:16150:16150; Version=0.0 is connected!
-[21:02:34 INF] Starting log dispatcher.
-[21:02:34 INF] Loading output configuration.
-[21:02:34 INF] Loaded output 'nlog' with filter 'Filter(*)' and exclude 'Filter(none)'.
-[21:02:34 INF] Log dispatcher started.
-[21:02:34 INF] Application started. Press Ctrl+C to shut down.
-[21:02:34 INF] Hosting environment: Development
-[21:02:34 INF] Content root path: /mnt/c/Source/github/mbc-engineering/log4TC/source/Log4Tc/Mbc.Log4Tc.Service
-```
-Sollte folgende Ausgabe erscheinen, ersicthlich auf Zeile 4:
-
-```log
-[20:05:15 INF] Starting log4TC service.
-[20:05:15 INF] Starting ADS log receiver.
-[20:05:15 INF] Log receiver connected.
-[20:05:15 ERR] AmsServer connection failed with error: Connection refused [::ffff:127.0.0.1]:48898. Port 'Log4Tc' (16150)!
-[20:05:15 INF] Log receiver shutdown.
-[20:05:15 INF] Starting log dispatcher.
-[20:05:15 INF] Loading output configuration.
-[20:05:15 INF] Loaded output 'nlog' with filter 'Filter(*)' and exclude 'Filter(none)'.
-[20:05:15 INF] Log dispatcher started.
-[20:05:15 INF] Application started. Press Ctrl+C to shut down.
-[20:05:15 INF] Hosting environment: Production
-[20:05:15 INF] Content root path: /app
-```
-
-... ist kein ADS Router lokal vorhanden. Entweder einen installieren oder die AdsRouterConsoleApp verwenden!