Skip to content

Commit

Permalink
Update build scripts, instructions and configs for DNP3 server.
Browse files Browse the repository at this point in the history
  • Loading branch information
riclolsen committed Feb 3, 2025
1 parent 0e4a39f commit d0e38e8
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 32 deletions.
2 changes: 1 addition & 1 deletion demo-docker/mongo_seed/files/demo_connections.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
{"_id":{"$oid":"6675d176e2f7917450d7585b"},"protocolDriver":"PLC4X","protocolDriverInstanceNumber":1,"protocolConnectionNumber":2003,"name":"PLC1","description":"PLC #1 MODBUS","enabled":true,"commandsEnabled":true,"topics":["MBPLC1_HR1|holding-register:1:UINT","MBPLC1_10HRS|holding-register:2:INT[10]"],"autoCreateTags": true,"endpointURLs":["modbus-tcp://localhost:5001?unit-identifier=2"],"giInterval": 1.5,"stats":null}
{"_id":{"$oid":"669ea9ce96e9a9fe7abe6ef8"},"protocolDriver":"OPC-DA","protocolDriverInstanceNumber":1,"protocolConnectionNumber":5001,"name":"OPCDAClient1","description":"Download from demo server from https://github.com/technosoftware-gmbh/opcdaaehda-client-solution-net/tree/master/x86/DemoServer","enabled":true,"commandsEnabled":true,"stats":null,"endpointURLs":["opcda://localhost/SampleCompany.DaSample.30"],"autoCreateTags":true,"useSecurity":false,"autoCreateTagPublishingInterval":5,"autoCreateTagQueueSize":5,"autoCreateTagSamplingInterval":0,"giInterval":300,"localCertFilePath":"","peerCertFilePath":"","timeoutMs":20000,"topics":[],"deadBand":5,"hoursShift":0,"password":"","username":""}
{"_id":{"$oid":"66e6c7d1311eee86fc6b4f07"},"protocolDriver":"DNP3","protocolDriverInstanceNumber":1,"protocolConnectionNumber":33,"name":"DNP3DEMO","description":"DNP3 DEMO","enabled": true,"commandsEnabled":true,"stats":null,"ipAddresses":["127.0.0.1:20000"],"passphrase":"","pfxFilePath":"","useSecurity":false,"timeoutMs":10000,"localLinkAddress":2,"remoteLinkAddress":1,"giInterval":300,"hoursShift":0,"timeSyncInterval":0,"localCertFilePath":"","peerCertFilePath":"","peerCertFilesPaths":[],"rootCertFilePath":"","chainValidation":false,"allowOnlySpecificCertificates":false,"privateKeyFilePath":"","allowTLSv10":false,"allowTLSv11":false,"allowTLSv12":true,"allowTLSv13":true,"cipherList":"","connectionMode":"TCP Active","asyncOpenDelay":0,"timeSyncMode":0,"class0ScanInterval":0,"class1ScanInterval":0,"class2ScanInterval":0,"class3ScanInterval":0,"enableUnsolicited":true,"rangeScans":[],"baudRate":9600,"parity":"Even","stopBits":"One","handshake":"None","timeoutForACK":1000,"timeoutRepeat":1000}
{ "_id": { "$oid": "679a83338b90fe1713ef7fef" }, "protocolDriver": "DNP3_SERVER", "protocolDriverInstanceNumber": 1, "protocolConnectionNumber": 34, "name": "DNP3SRV", "description": "DNP3 SERVER DEMO", "enabled": true, "commandsEnabled": true, "stats": null, "ipAddresses": [ "127.0.0.1:20000" ], "passphrase": "", "pfxFilePath": "", "useSecurity": false, "timeoutMs": 10000, "localLinkAddress": 2, "remoteLinkAddress": 1, "giInterval": 300, "hoursShift": 0, "timeSyncInterval": 0, "localCertFilePath": "", "peerCertFilePath": "", "peerCertFilesPaths": [], "rootCertFilePath": "", "chainValidation": false, "allowOnlySpecificCertificates": false, "privateKeyFilePath": "", "allowTLSv10": false, "allowTLSv11": false, "allowTLSv12": true, "allowTLSv13": true, "cipherList": "", "connectionMode": "TCP Passive", "asyncOpenDelay": 0, "timeSyncMode": 0, "class0ScanInterval": 0, "class1ScanInterval": 0, "class2ScanInterval": 0, "class3ScanInterval": 0, "enableUnsolicited": true, "rangeScans": [], "portName": "COM1", "baudRate": 9600, "parity": "Even", "stopBits": "One", "handshake": "None", "timeoutForACK": 1000, "timeoutRepeat": 1000, "ipAddressLocalBind": "0.0.0.0:20000", "autoCreateTags": true, "topics": [ "KAW2" ], "serverQueueSize": 2000 }
{ "_id": { "$oid": "679a83338b90fe1713ef7fef" }, "protocolDriver": "DNP3_SERVER", "protocolDriverInstanceNumber": 1, "protocolConnectionNumber": 34, "name": "DNP3SRV", "description": "DNP3 SERVER DEMO", "enabled": true, "commandsEnabled": true, "stats": null, "ipAddresses": [], "passphrase": "", "pfxFilePath": "", "useSecurity": false, "timeoutMs": 10000, "localLinkAddress": 2, "remoteLinkAddress": 1, "giInterval": 300, "hoursShift": 0, "timeSyncInterval": 0, "localCertFilePath": "", "peerCertFilePath": "", "peerCertFilesPaths": [], "rootCertFilePath": "", "chainValidation": false, "allowOnlySpecificCertificates": false, "privateKeyFilePath": "", "allowTLSv10": false, "allowTLSv11": false, "allowTLSv12": true, "allowTLSv13": true, "cipherList": "", "connectionMode": "TCP Passive", "asyncOpenDelay": 0, "timeSyncMode": 0, "class0ScanInterval": 0, "class1ScanInterval": 0, "class2ScanInterval": 0, "class3ScanInterval": 0, "enableUnsolicited": true, "rangeScans": [], "portName": "COM1", "baudRate": 9600, "parity": "Even", "stopBits": "One", "handshake": "None", "timeoutForACK": 1000, "timeoutRepeat": 1000, "ipAddressLocalBind": "0.0.0.0:20000", "autoCreateTags": true, "topics": [ "KAW2" ], "serverQueueSize": 2000 }
2 changes: 1 addition & 1 deletion demo-docker/mongo_seed/files/demo_connections_linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
{"_id":{"$oid":"6675d176e2f7917450d7585b"},"protocolDriver":"PLC4X","protocolDriverInstanceNumber":1,"protocolConnectionNumber":2003,"name":"PLC1","description":"PLC #1 MODBUS","enabled":true,"commandsEnabled":true,"topics":["MBPLC1_HR1|holding-register:1:UINT","MBPLC1_10HRS|holding-register:2:INT[10]"],"autoCreateTags": true,"endpointURLs":["modbus-tcp://localhost:5001?unit-identifier=2"],"giInterval": 1.5,"stats":null}
{"_id":{"$oid":"669ea9ce96e9a9fe7abe6ef8"},"protocolDriver":"OPC-DA","protocolDriverInstanceNumber":1,"protocolConnectionNumber":5001,"name":"OPCDAClient1","description":"Download from demo server from https://github.com/technosoftware-gmbh/opcdaaehda-client-solution-net/tree/master/x86/DemoServer","enabled":true,"commandsEnabled":true,"stats":null,"endpointURLs":["opcda://localhost/SampleCompany.DaSample.30"],"autoCreateTags":true,"useSecurity":false,"autoCreateTagPublishingInterval":5,"autoCreateTagQueueSize":5,"autoCreateTagSamplingInterval":0,"giInterval":300,"localCertFilePath":"","peerCertFilePath":"","timeoutMs":20000,"topics":[],"deadBand":5,"hoursShift":0,"password":"","username":""}
{"_id":{"$oid":"66e6c7d1311eee86fc6b4f07"},"protocolDriver":"DNP3","protocolDriverInstanceNumber":1,"protocolConnectionNumber":33,"name":"DNP3DEMO","description":"DNP3 DEMO","enabled": true,"commandsEnabled":true,"stats":null,"ipAddresses":["127.0.0.1:20000"],"passphrase":"","pfxFilePath":"","useSecurity":false,"timeoutMs":10000,"localLinkAddress":2,"remoteLinkAddress":1,"giInterval":300,"hoursShift":0,"timeSyncInterval":0,"localCertFilePath":"","peerCertFilePath":"","peerCertFilesPaths":[],"rootCertFilePath":"","chainValidation":false,"allowOnlySpecificCertificates":false,"privateKeyFilePath":"","allowTLSv10":false,"allowTLSv11":false,"allowTLSv12":true,"allowTLSv13":true,"cipherList":"","connectionMode":"TCP Active","asyncOpenDelay":0,"timeSyncMode":0,"class0ScanInterval":0,"class1ScanInterval":0,"class2ScanInterval":0,"class3ScanInterval":0,"enableUnsolicited":true,"rangeScans":[],"baudRate":9600,"parity":"Even","stopBits":"One","handshake":"None","timeoutForACK":1000,"timeoutRepeat":1000}
{ "_id": { "$oid": "679a83338b90fe1713ef7fef" }, "protocolDriver": "DNP3_SERVER", "protocolDriverInstanceNumber": 1, "protocolConnectionNumber": 34, "name": "DNP3SRV", "description": "DNP3 SERVER DEMO", "enabled": true, "commandsEnabled": true, "stats": null, "ipAddresses": [ "127.0.0.1:20000" ], "passphrase": "", "pfxFilePath": "", "useSecurity": false, "timeoutMs": 10000, "localLinkAddress": 2, "remoteLinkAddress": 1, "giInterval": 300, "hoursShift": 0, "timeSyncInterval": 0, "localCertFilePath": "", "peerCertFilePath": "", "peerCertFilesPaths": [], "rootCertFilePath": "", "chainValidation": false, "allowOnlySpecificCertificates": false, "privateKeyFilePath": "", "allowTLSv10": false, "allowTLSv11": false, "allowTLSv12": true, "allowTLSv13": true, "cipherList": "", "connectionMode": "TCP Passive", "asyncOpenDelay": 0, "timeSyncMode": 0, "class0ScanInterval": 0, "class1ScanInterval": 0, "class2ScanInterval": 0, "class3ScanInterval": 0, "enableUnsolicited": true, "rangeScans": [], "portName": "COM1", "baudRate": 9600, "parity": "Even", "stopBits": "One", "handshake": "None", "timeoutForACK": 1000, "timeoutRepeat": 1000, "ipAddressLocalBind": "0.0.0.0:20000", "autoCreateTags": true, "topics": [ "KAW2" ], "serverQueueSize": 2000 }
{ "_id": { "$oid": "679a83338b90fe1713ef7fef" }, "protocolDriver": "DNP3_SERVER", "protocolDriverInstanceNumber": 1, "protocolConnectionNumber": 34, "name": "DNP3SRV", "description": "DNP3 SERVER DEMO", "enabled": true, "commandsEnabled": true, "stats": null, "ipAddresses": [], "passphrase": "", "pfxFilePath": "", "useSecurity": false, "timeoutMs": 10000, "localLinkAddress": 2, "remoteLinkAddress": 1, "giInterval": 300, "hoursShift": 0, "timeSyncInterval": 0, "localCertFilePath": "", "peerCertFilePath": "", "peerCertFilesPaths": [], "rootCertFilePath": "", "chainValidation": false, "allowOnlySpecificCertificates": false, "privateKeyFilePath": "", "allowTLSv10": false, "allowTLSv11": false, "allowTLSv12": true, "allowTLSv13": true, "cipherList": "", "connectionMode": "TCP Passive", "asyncOpenDelay": 0, "timeSyncMode": 0, "class0ScanInterval": 0, "class1ScanInterval": 0, "class2ScanInterval": 0, "class3ScanInterval": 0, "enableUnsolicited": true, "rangeScans": [], "portName": "COM1", "baudRate": 9600, "parity": "Even", "stopBits": "One", "handshake": "None", "timeoutForACK": 1000, "timeoutRepeat": 1000, "ipAddressLocalBind": "0.0.0.0:20000", "autoCreateTags": true, "topics": [ "KAW2" ], "serverQueueSize": 2000 }
6 changes: 3 additions & 3 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Execute commands below for scripted installation:

sudo dnf -y install git
cd /home/jsonscada
git clone https://github.com/riclolsen/json-scada --config core.autocrlf=input
git clone --recurse-submodules https://github.com/riclolsen/json-scada --config core.autocrlf=input
cd json-scada/platform-rhel9

# on x86-64 platform run
Expand Down Expand Up @@ -119,7 +119,7 @@ Execute commands below for scripted installation:

sudo dnf -y install git
cd /home/jsonscada
git clone https://github.com/riclolsen/json-scada --config core.autocrlf=input
git clone --recurse-submodules https://github.com/riclolsen/json-scada --config core.autocrlf=input
cd json-scada/platform-ubuntu-2404

# on x86-64 or ARM64 platform run
Expand Down Expand Up @@ -212,7 +212,7 @@ Download the code from the online repo

Or do a git clone

git clone https://github.com/riclolsen/json-scada --config core.autocrlf=input
git clone --recurse-submodules https://github.com/riclolsen/json-scada --config core.autocrlf=input

Build the code using the adequate script for the host platform:

Expand Down
5 changes: 3 additions & 2 deletions platform-linux/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,19 @@ cmake .. -DCMAKE_INSTALL_PREFIX="../../../mongo-cxx-driver-lib" -DCMAKE_CXX_STAN
cmake --build . --config Release
cmake --build . --target install --config Release

cd ../dnp3/opendnp3
cd ../../../dnp3/opendnp3
mkdir build
cd build
cmake -DDNP3_EXAMPLES=ON -DDNP3_TLS=ON ..
make
cp cpp/lib/libopendnp3.so ../../../../bin/

cd ../../Dnp3Server
mkdir build
cd build
cmake ..
make

cp Dnp3Server ../../../../bin/
cd ..

export GOBIN=~/json-scada/bin
Expand Down
20 changes: 20 additions & 0 deletions platform-mac/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,26 @@ cd ../OPC-DA-Client
dotnet restore
dotnet publish --no-self-contained --runtime win-x64 -p:PublishReadyToRun=true -f net8.0-windows -c Release -o ../../bin-wine/ OPC-DA-Client.csproj

cd ../mongo-cxx-driver/mongo-cxx-driver/build
cmake .. -DCMAKE_INSTALL_PREFIX="../../../mongo-cxx-driver-lib" -DCMAKE_CXX_STANDARD=17 -DBUILD_VERSION=4.0.0 -DBUILD_SHARED_LIBS=OFF -DBUILD_SHARED_AND_STATIC_LIBS=OFF
cmake --build . --config Release
cmake --build . --target install --config Release

cd ../../../dnp3/opendnp3
mkdir build
cd build
cmake -DDNP3_EXAMPLES=ON -DDNP3_TLS=ON ..
make
cp cpp/lib/libopendnp3.so ../../../../bin/

cd ../../Dnp3Server
mkdir build
cd build
cmake ..
make
cp Dnp3Server ../../../../bin/
cd ..

export GOBIN=~/json-scada/bin
go env -w GO111MODULE=auto

Expand Down
23 changes: 23 additions & 0 deletions platform-nix-idx/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

ARG1=${1:-linux-x64}

# extract submodules for mongodb C++ driver and opendnp3
# git submodule update --init --recursive

cd ..
mkdir bin
mkdir bin-wine
Expand Down Expand Up @@ -45,6 +48,26 @@ dotnet publish --no-self-contained --runtime $ARG1 -p:PublishReadyToRun=true -c
#dotnet restore
#dotnet publish --no-self-contained --runtime win-x64 -p:PublishReadyToRun=true -f net8.0-windows -c Release -o ../../bin-wine/ OPC-DA-Client.csproj

#cd ../mongo-cxx-driver/mongo-cxx-driver/build
#cmake .. -DCMAKE_INSTALL_PREFIX="../../../mongo-cxx-driver-lib" -DCMAKE_CXX_STANDARD=17 -DBUILD_VERSION=4.0.0 -DBUILD_SHARED_LIBS=OFF -DBUILD_SHARED_AND_STATIC_LIBS=OFF
#cmake --build . --config Release
#cmake --build . --target install --config Release
#
#cd ../../../dnp3/opendnp3
#mkdir build
#cd build
#cmake -DDNP3_EXAMPLES=ON -DDNP3_TLS=ON ..
#make
#cp cpp/lib/libopendnp3.so ../../../../bin/
#
#cd ../../Dnp3Server
#mkdir build
#cd build
#cmake ..
#make
#cp Dnp3Server ../../../../bin/
#cd ..

export GOBIN=~/json-scada/bin
go env -w GO111MODULE=auto

Expand Down
16 changes: 16 additions & 0 deletions platform-nix-idx/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,22 @@ stdout_logfile_maxbytes=10MB ; max # logfile bytes b4 rotation (default 50MB)
stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10)
stdout_capture_maxbytes=10MB ; number of bytes in 'capturemode' (default 0)

;[program:dnp3server]
;command=/home/user/json-scada/bin/Dnp3Server 1 1
;autostart=false
;numprocs=1 ; number of processes copies to start (def 1)
;environment=LD_LIBRARY_PATH="/home/jsonscada/json-scada/bin"
;directory=/home/user/json-scada/bin/ ; directory to cwd to before exec (def no cwd)
;user=user ; setuid to this UNIX account to run the program
;stdout_logfile=/home/user/json-scada/log/dnp3server.log ; stdout log path, NONE for none;
;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
;stdout_logfile_backups=0 ; # of stdout logfile backups (0 means none, default 10)
;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0)
;stderr_logfile=/home/user/json-scada/log/dnp3server.err ; stderr log path, NONE for none;
;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
;stderr_logfile_backups=0 ; # of stderr logfile backups (0 means none, default 10)
;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0)

;[program:mongowr]
;; args: instance# loglevel
;command=/usr/bin/node /home/user/json-scada/src/mongowr/index.js
Expand Down
Loading

0 comments on commit d0e38e8

Please sign in to comment.