Skip to content

Commit 06bf08c

Browse files
authored
Merge pull request #192 from json-scada/master
Version 0.44-alpha
2 parents a3cbb3a + 7392590 commit 06bf08c

18 files changed

+177
-54
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ To provide an easy to use, fully-featured, scalable, and portable SCADA/IIoT-I4.
4848
- MongoDB as the real-time core database, persistence layer, config store, SOE historian.
4949
- Event-based realtime async data processing with MongoDB Change Streams.
5050
- Portability and modular interoperability over Linux, Windows, Mac OSX, x86/64, ARM.
51-
- Windows installer available in the [releases section](https://github.com/riclolsen/json-scada/releases/tag/V0.43-alpha).
51+
- Windows installer available in the [releases section](https://github.com/riclolsen/json-scada/releases/tag/V0.44-alpha).
5252
- Unlimited tags, servers, and users.
5353
- Horizontal scalability, from a single computer to big clusters (MongoDB-sharding), Docker containers, VMs, Kubernetes, cloud, or hybrid deployments.
5454
- Modular distributed architecture. Lightweight redundant data acquisition nodes can connect securely over TLS to the database server. E.g. a Raspberry PI can be a data acquisition node.
@@ -90,7 +90,7 @@ To provide an easy to use, fully-featured, scalable, and portable SCADA/IIoT-I4.
9090
## Documentation
9191

9292
- [Generic Install Guide](https://github.com/riclolsen/json-scada/blob/master/docs/install.md)
93-
- [Windows Installer](https://github.com/riclolsen/json-scada/releases/tag/V0.43-alpha)
93+
- [Windows Installer](https://github.com/riclolsen/json-scada/releases/tag/V0.44-alpha)
9494
- [RedHat/Rocky Linux Installer](https://github.com/riclolsen/json-scada/blob/master/docs/install.md#rhel94-and-compatible-systems-automated-installation)
9595
- [Docker Demo](https://github.com/riclolsen/json-scada/blob/master/demo-docker/README.md)
9696
- [Schema Documentation](https://github.com/riclolsen/json-scada/blob/master/docs/schema.md)

index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ To provide an easy to use, fully-featured, scalable, and portable SCADA/IIoT-I4.
4848
- MongoDB as the real-time core database, persistence layer, config store, SOE historian.
4949
- Event-based realtime async data processing with MongoDB Change Streams.
5050
- Portability and modular interoperability over Linux, Windows, Mac OSX, x86/64, ARM.
51-
- Windows installer available in the [releases section](https://github.com/riclolsen/json-scada/releases/tag/V0.43-alpha).
51+
- Windows installer available in the [releases section](https://github.com/riclolsen/json-scada/releases/tag/V0.44-alpha).
5252
- Unlimited tags, servers, and users.
5353
- Horizontal scalability, from a single computer to big clusters (MongoDB-sharding), Docker containers, VMs, Kubernetes, cloud, or hybrid deployments.
5454
- Modular distributed architecture. Lightweight redundant data acquisition nodes can connect securely over TLS to the database server. E.g. a Raspberry PI can be a data acquisition node.
@@ -90,7 +90,7 @@ To provide an easy to use, fully-featured, scalable, and portable SCADA/IIoT-I4.
9090
## Documentation
9191

9292
- [Generic Install Guide](docs/install.md)
93-
- [Windows Installer](https://github.com/riclolsen/json-scada/releases/tag/V0.43-alpha)
93+
- [Windows Installer](https://github.com/riclolsen/json-scada/releases/tag/V0.44-alpha)
9494
- [RedHat/Rocky Linux Installer](docs/install.md#rhel94-and-compatible-systems-automated-installation)
9595
- [Install Guide](docs/install.md)
9696
- [Docker Demo](demo-docker/README.md)

platform-windows/create_services.bat

+6-6
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ nssm set JSON_SCADA_mqttsparkplugclient AppRotateOnline 1
134134
nssm set JSON_SCADA_mqttsparkplugclient AppRotateBytes 10000000
135135
nssm set JSON_SCADA_mqttsparkplugclient Start SERVICE_DELAYED_AUTO_START
136136

137-
nssm install JSON_SCADA_iec104client "C:\json-scada\bin\iec104client.exe" 1 2
137+
nssm install JSON_SCADA_iec104client "C:\json-scada\bin\iec104client.exe" 1 1
138138
nssm set JSON_SCADA_iec104client AppStdout C:\json-scada\log\iec104client.log
139139
nssm set JSON_SCADA_iec104client AppRotateOnline 1
140140
nssm set JSON_SCADA_iec104client AppRotateBytes 10000000
@@ -170,25 +170,25 @@ rem nssm set JSON_SCADA_iccpserver AppRotateOnline 1
170170
rem nssm set JSON_SCADA_iccpserver AppRotateBytes 10000000
171171
rem nssm set JSON_SCADA_iccpserver Start SERVICE_DEMAND_START
172172

173-
nssm install JSON_SCADA_dnp3client "C:\json-scada\bin\Dnp3Client.exe" 1 2
173+
nssm install JSON_SCADA_dnp3client "C:\json-scada\bin\Dnp3Client.exe" 1 1
174174
nssm set JSON_SCADA_dnp3client AppStdout C:\json-scada\log\dnp3client.log
175175
nssm set JSON_SCADA_dnp3client AppRotateOnline 1
176176
nssm set JSON_SCADA_dnp3client AppRotateBytes 10000000
177177
nssm set JSON_SCADA_dnp3client Start SERVICE_DEMAND_START
178178

179-
nssm install JSON_SCADA_opcuaclient "C:\json-scada\bin\OPC-UA-Client.exe" 1 2
179+
nssm install JSON_SCADA_opcuaclient "C:\json-scada\bin\OPC-UA-Client.exe" 1 1
180180
nssm set JSON_SCADA_opcuaclient AppStdout C:\json-scada\log\opcuaclient.log
181181
nssm set JSON_SCADA_opcuaclient AppRotateOnline 1
182182
nssm set JSON_SCADA_opcuaclient AppRotateBytes 10000000
183-
nssm set JSON_SCADA_opcuaclient Start SERVICE_DEMAND_START
183+
nssm set JSON_SCADA_opcuaclient Start SERVICE_DELAYED_AUTO_START
184184

185-
nssm install JSON_SCADA_opcdaclient "C:\json-scada\bin\OPC-DA-Client.exe" 1 2
185+
nssm install JSON_SCADA_opcdaclient "C:\json-scada\bin\OPC-DA-Client.exe" 1 1
186186
nssm set JSON_SCADA_opcdaclient AppStdout C:\json-scada\log\opcdaclient.log
187187
nssm set JSON_SCADA_opcdaclient AppRotateOnline 1
188188
nssm set JSON_SCADA_opcdaclient AppRotateBytes 10000000
189189
nssm set JSON_SCADA_opcdaclient Start SERVICE_DEMAND_START
190190

191-
nssm install JSON_SCADA_iec61850client "C:\json-scada\bin\iec61850_client.exe" 1 2
191+
nssm install JSON_SCADA_iec61850client "C:\json-scada\bin\iec61850_client.exe" 1 1
192192
nssm set JSON_SCADA_iec61850client AppStdout C:\json-scada\log\iec61850client.log
193193
nssm set JSON_SCADA_iec61850client AppRotateOnline 1
194194
nssm set JSON_SCADA_iec61850client AppRotateBytes 10000000

platform-windows/initial_setup.bat

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ call create_services.bat
2020
ping -n 10 127.0.0.1
2121
call mongodb-start.bat
2222
ping -n 12 127.0.0.1
23-
mongodb-runtime\bin\mongo json_scada < ..\mongo_seed_demo\a_rs-init.js
24-
mongodb-runtime\bin\mongo json_scada < ..\mongo_seed_demo\b_create-db.js
23+
mongodb-runtime\bin\mongo json_scada < ..\mongo_seed\a_rs-init.js
24+
ping -n 2 127.0.0.1
25+
mongodb-runtime\bin\mongo json_scada < ..\mongo_seed\b_create-db.js
2526
mongodb-runtime\bin\mongoimport --db json_scada --collection protocolDriverInstances --type json --file ..\mongo_seed_demo\demo_instances.json
2627
mongodb-runtime\bin\mongoimport --db json_scada --collection protocolConnections --type json --file ..\mongo_seed_demo\demo_connections.json
2728
mongodb-runtime\bin\mongoimport --db json_scada --collection realtimeData --type json --file ..\mongo_seed_demo\demo_data.json

platform-windows/json-scada.nsi

+9-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55
; NSIS (Nullsoft Scriptable Install System) - http://nsis.sourceforge.net/Main_Page
66

7-
SetCompressor LZMA
7+
SetCompress Auto
8+
SetCompressor lzma
9+
SetCompressorDictSize 32
10+
SetDatablockOptimize Off
811

912
Unicode True
1013
; RequestExecutionLevel user
@@ -17,13 +20,13 @@ RequestExecutionLevel admin
1720

1821
;--------------------------------
1922

20-
!define VERSION "v.0.43"
21-
!define VERSION_ "0.43.0.0"
23+
!define VERSION "v.0.44"
24+
!define VERSION_ "0.44.0.0"
2225

2326
Function .onInit
24-
System::Call 'keexrnel32::CreateMutexA(i 0, i 0, t "MutexJsonScadaInstall") i .r1 ?e'
25-
Pop $R0
26-
StrCmp $R0 0 +3
27+
System::Call 'keexrnel32::CreateMutexA(p0, i1, t "MutexJsonScadaInstall")?e'
28+
Pop $0
29+
IntCmpU $0 183 0 +3 +3
2730
MessageBox MB_OK|MB_ICONEXCLAMATION "Installer already executing!"
2831
Abort
2932
FunctionEnd

platform-windows/release_notes.txt

+19
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,25 @@ Inkscape+SAGE:
135135

136136
-------------------------------------------------------------------
137137

138+
Notes for version 0.44:
139+
140+
* Default login credentials: username=admin password=jsonscada.
141+
* Metabase credentials: [email protected] password=jsonscada123.
142+
* Fixed MongoDB indexes creation by the Windows installer.
143+
* Fixed memory leak and performance problems in the OPC-UA Client driver.
144+
145+
Requirements and recommendations:
146+
147+
* Windows 10/11 64 bits or Server >=2019, Windows PowerShell. At least 20GB of free space in the "C:" drive.
148+
* Administrative rights. Corporate Windows policies may cause problems with the creation of services and the opening of TCP ports.
149+
* Free TCP ports 6688, 6689, 27017, 5432, 80, 8080, 3000, 3001, 9000. Other ports may be required for optional services and protocols.
150+
* If the server already has MongoDB, PostgreSQL, Grafana, Metabase, Nginx or another webserver, please uninstall, disable or watch out for possible conflicts.
151+
* Do not update previously installed JSON-SCADA. Please uninstall previous JSON-SCADA versions before installing a new version.
152+
* If using VirtualBox configure "paravirtualization interface"=KVM, otherwise Nodejs errors may occur.
153+
* MongoDB requires AVX instructions on x86 CPU.
154+
155+
-------------------------------------------------------------------
156+
138157
Notes for version 0.43:
139158

140159
* ATTENTION: The default SVG folder has been moved to "c:\json-scada\svg\".

src/AdminUI/public/i18n/messages_i18n-en_us.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
var Msg =
55
{
66
NomeProduto: '{json:scada}',
7-
VersaoProduto: '0.43',
7+
VersaoProduto: '0.44',
88

99
NomeVisorTelas: 'Display Viewer',
1010
NomeVisorEventos: 'Events Viewer',

src/AdminUI/public/i18n/messages_i18n-pt_br.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
var Msg =
55
{
66
NomeProduto: '{json:scada}',
7-
VersaoProduto: '0.43',
7+
VersaoProduto: '0.44',
88

99
NomeVisorTelas: 'Visor de Telas',
1010
NomeVisorEventos: 'Visor de Eventos',

src/AdminUI/public/i18n/messages_i18n-uk_ua.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
var Msg =
55
{
66
NomeProduto: '{json:scada}',
7-
VersaoProduto: '0.43',
7+
VersaoProduto: '0.44',
88

99
NomeVisorTelas: 'Перегляд ',
1010
NomeVisorEventos: 'Події',

src/AdminUI/public/i18n/messages_i18n.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
var Msg =
55
{
66
NomeProduto: '{json:scada}',
7-
VersaoProduto: '0.43',
7+
VersaoProduto: '0.44',
88

99
NomeVisorTelas: 'Display Viewer',
1010
NomeVisorEventos: 'Events Viewer',

src/AdminUI/public/release_notes.txt

+19
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,25 @@ Inkscape+SAGE:
135135

136136
-------------------------------------------------------------------
137137

138+
Notes for version 0.44:
139+
140+
* Default login credentials: username=admin password=jsonscada.
141+
* Metabase credentials: [email protected] password=jsonscada123.
142+
* Fixed MongoDB indexes creation by the Windows installer.
143+
* Fixed memory leak and performance problems in the OPC-UA Client driver.
144+
145+
Requirements and recommendations:
146+
147+
* Windows 10/11 64 bits or Server >=2019, Windows PowerShell. At least 20GB of free space in the "C:" drive.
148+
* Administrative rights. Corporate Windows policies may cause problems with the creation of services and the opening of TCP ports.
149+
* Free TCP ports 6688, 6689, 27017, 5432, 80, 8080, 3000, 3001, 9000. Other ports may be required for optional services and protocols.
150+
* If the server already has MongoDB, PostgreSQL, Grafana, Metabase, Nginx or another webserver, please uninstall, disable or watch out for possible conflicts.
151+
* Do not update previously installed JSON-SCADA. Please uninstall previous JSON-SCADA versions before installing a new version.
152+
* If using VirtualBox configure "paravirtualization interface"=KVM, otherwise Nodejs errors may occur.
153+
* MongoDB requires AVX instructions on x86 CPU.
154+
155+
-------------------------------------------------------------------
156+
138157
Notes for version 0.43:
139158

140159
* ATTENTION: The default SVG folder has been moved to "c:\json-scada\svg\".

src/AdminUI/src/App.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
import { useRouter } from 'vue-router'
120120
import { STORAGE_KEY } from './i18n'
121121
122-
const version = ref('v0.43-alpha')
122+
const version = ref('v0.44-alpha')
123123
const router = useRouter()
124124
const theme = ref('dark')
125125
const vuetifyTheme = useTheme()

src/OPC-UA-Client/AsduReceiveHandler.cs

+67-7
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,11 @@ private async Task ConsoleClient()
207207
return;
208208
}
209209

210-
Log(conn_name + " - " + "Browsing the OPC UA server namespace.");
211-
exitCode = ExitCode.ErrorBrowseNamespace;
212-
213210
if (OPCUA_conn.autoCreateTags)
214211
{
212+
Log(conn_name + " - " + "Browsing the OPC UA server namespace.");
213+
exitCode = ExitCode.ErrorBrowseNamespace;
214+
215215
await FindObjects(session, ObjectIds.ObjectsFolder);
216216

217217
await Task.Delay(50);
@@ -223,7 +223,7 @@ private async Task ConsoleClient()
223223
ListMon.ForEach(i => i.QueueSize = System.Convert.ToUInt32(System.Convert.ToDouble(OPCUA_conn.autoCreateTagQueueSize)));
224224
Log(conn_name + " - " + ListMon.Count + " Objects found");
225225

226-
Log(conn_name + " - " + "Create a subscription with publishing interval of " + System.Convert.ToDouble(OPCUA_conn.autoCreateTagPublishingInterval) + "seconds");
226+
Log(conn_name + " - " + "Create a subscription with publishing interval of " + System.Convert.ToDouble(OPCUA_conn.autoCreateTagPublishingInterval) + " seconds");
227227
exitCode = ExitCode.ErrorCreateSubscription;
228228
var subscription =
229229
new Subscription(session.DefaultSubscription)
@@ -242,10 +242,70 @@ private async Task ConsoleClient()
242242
Log(conn_name + " - " + "Add the subscription to the session.");
243243
Log(conn_name + " - " + subscription.MonitoredItemCount + " Monitored items");
244244
exitCode = ExitCode.ErrorAddSubscription;
245-
session.AddSubscription(subscription);
246-
subscription.Create();
245+
try
246+
{
247+
session.AddSubscription(subscription);
248+
subscription.Create();
249+
subscription.ApplyChanges();
250+
}
251+
catch (Exception e)
252+
{
253+
Log(conn_name + " - Error creating subscription: " + e.Message);
254+
}
255+
}
256+
else
257+
{
258+
Log(conn_name + " - " + "Create subscription for inserted tags.");
259+
exitCode = ExitCode.ErrorBrowseNamespace;
247260

248-
subscription.ApplyChanges();
261+
foreach (var sub in OPCUA_conn.OpcSubscriptions)
262+
{
263+
List<MonitoredItem> lm = new List<MonitoredItem>();
264+
foreach (var tm in sub.Value)
265+
{
266+
lm.Add(new MonitoredItem()
267+
{
268+
DisplayName = tm.ungroupedDescription,
269+
StartNodeId = tm.protocolSourceObjectAddress,
270+
SamplingInterval = (int)(tm.protocolSourceSamplingInterval * 1000),
271+
QueueSize = (uint)OPCUA_conn.autoCreateTagQueueSize,
272+
MonitoringMode = MonitoringMode.Reporting,
273+
DiscardOldest = true,
274+
AttributeId = Attributes.Value,
275+
});
276+
}
277+
lm.ForEach(i => i.Notification += OnNotification);
278+
279+
Log(conn_name + " - " + "Create a subscription with publishing interval of " + sub.Key + " seconds");
280+
exitCode = ExitCode.ErrorCreateSubscription;
281+
var subscription =
282+
new Subscription(session.DefaultSubscription)
283+
{
284+
PublishingInterval = (int)(sub.Key * 1000),
285+
PublishingEnabled = true,
286+
TimestampsToReturn = TimestampsToReturn.Both,
287+
// MaxNotificationsPerPublish = 1,
288+
SequentialPublishing = false,
289+
};
290+
291+
await Task.Delay(50);
292+
subscription.AddItems(lm);
293+
294+
await Task.Delay(50);
295+
Log(conn_name + " - " + "Add the subscription to the session.");
296+
Log(conn_name + " - " + subscription.MonitoredItemCount + " Monitored items");
297+
exitCode = ExitCode.ErrorAddSubscription;
298+
try
299+
{
300+
session.AddSubscription(subscription);
301+
subscription.Create();
302+
subscription.ApplyChanges();
303+
}
304+
catch (Exception e)
305+
{
306+
Log(conn_name + " - Error creating subscription: " + e.Message);
307+
}
308+
}
249309
}
250310

251311
Log(conn_name + " - " + "Running...");

src/OPC-UA-Client/Common_srv_cli.cs

+9
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ public class
109109
public SortedSet<string> InsertedTags = new SortedSet<string>();
110110
public OPCUAClient connection;
111111
public Thread thrOPCStack;
112+
public Dictionary<double, List<rtMonitTag>> OpcSubscriptions = new Dictionary<double, List<rtMonitTag>>();
112113
}
113114
[BsonIgnoreExtraElements]
114115
public class protocolDriverInstancesClass
@@ -142,6 +143,14 @@ public class OPC_Value
142143
public string common_address;
143144
public string display_name;
144145
}
146+
public class rtMonitTag
147+
{
148+
public string protocolSourceObjectAddress;
149+
public string tag;
150+
public string ungroupedDescription;
151+
public double protocolSourceSamplingInterval;
152+
public double protocolSourceQueueSize;
153+
}
145154
public class rtFilt
146155
{
147156
public int protocolSourceConnectionNumber;

src/OPC-UA-Client/MongoCommands.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ partial class MainClass
2828
{
2929
// This process watches (via change stream) for commands inserted to a commands collection
3030
// When the command is considered valid it is forwarded to the RTU
31-
static async void ProcessMongoCmd(JSONSCADAConfig jsConfig)
31+
static async void ProcessMongoCmd()
3232
{
3333
do
3434
{
3535
try
3636
{
37-
var Client = ConnectMongoClient(jsConfig);
38-
var DB = Client.GetDatabase(jsConfig.mongoDatabaseName);
37+
var Client = ConnectMongoClient(JSConfig);
38+
var DB = Client.GetDatabase(JSConfig.mongoDatabaseName);
3939
var collection =
4040
DB
4141
.GetCollection
@@ -46,7 +46,7 @@ static async void ProcessMongoCmd(JSONSCADAConfig jsConfig)
4646
.RunCommandAsync((Command<BsonDocument>)"{ping:1}")
4747
.Wait(1000);
4848
if (!isMongoLive)
49-
throw new Exception("Error on connection " + jsConfig.mongoConnectionString);
49+
throw new Exception("Error on connection " + JSConfig.mongoConnectionString);
5050

5151
Log("MongoDB CMD CS - Start listening for commands via changestream...");
5252
var filter = "{ operationType: 'insert' }";

src/OPC-UA-Client/MongoUpdate.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ partial class MainClass
3434
static public int AutoKeyMultiplier = 1000000; // maximum number of points on each connection self-published (auto numbered points)
3535

3636
// This process updates acquired values in the mongodb collection for realtime data
37-
static public async void ProcessMongo(JSONSCADAConfig jsConfig)
37+
static public async void ProcessMongo()
3838
{
3939
do
4040
{
4141
try
4242
{
4343
var serializer = new BsonValueSerializer();
44-
var Client = ConnectMongoClient(jsConfig);
45-
var DB = Client.GetDatabase(jsConfig.mongoDatabaseName);
44+
var Client = ConnectMongoClient(JSConfig);
45+
var DB = Client.GetDatabase(JSConfig.mongoDatabaseName);
4646
var collection =
4747
DB.GetCollection<rtData>(RealtimeDataCollectionName);
4848
var collectionId =
@@ -150,7 +150,7 @@ static public async void ProcessMongo(JSONSCADAConfig jsConfig)
150150
// will imediatelly be followed by an update below (to the same tag)
151151
}
152152
}
153-
153+
154154
// update one existing document with received tag value (realtimeData)
155155
var update =
156156
new BsonDocument {

0 commit comments

Comments
 (0)