-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwb-mqtt-mbgate.schema.json
374 lines (374 loc) · 14.6 KB
/
wb-mqtt-mbgate.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"title": "MQTT to Modbus TCP and RTU slave gateway configuration",
"description": "mbgate_schema_description",
"configFile": {
"path": "/etc/wb-mqtt-mbgate.conf",
"service": "wb-mqtt-mbgate",
"editor": "mbgate"
},
"definitions": {
"reg_common": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"title": "Enabled",
"propertyOrder": 1
},
"topic": {
"type": "string",
"title": "MQTT Device (from topic name)",
"readOnly": true,
"propertyOrder": 10
},
"unitId": {
"type": "integer",
"title": "Modbus unit ID",
"minimum": 1,
"maximum": 255,
"propertyOrder": 20
},
"address": {
"type": "integer",
"title": "Start address",
"minimum": 0,
"maximum": 65535,
"propertyOrder": 30
}
},
"required": ["unitId", "address", "topic"]
},
"reg_format": {
"properties": {
"enabled": {
"type": "boolean",
"title": "Enabled",
"propertyOrder": 1
},
"topic": {
"type": "string",
"title": "MQTT Device (from topic name)",
"propertyOrder": 10,
"readOnly": true
},
"unitId": {
"type": "integer",
"title": "Modbus unit ID",
"minimum": 1,
"maximum": 255,
"propertyOrder": 20
},
"address": {
"type": "integer",
"title": "Start address",
"minimum": 0,
"maximum": 65535,
"propertyOrder": 30
},
"format": {
"type": "string",
"enum": ["signed", "unsigned", "bcd", "float", "varchar"],
"title": "Register format",
"options": {
"enum_titles": [
"Signed integer",
"Unsigned integer",
"BCD",
"IEEE754 float",
"Varchar (fixed size string)"
]
},
"propertyOrder": 40
},
"size": {
"type": "integer",
"title": "Size in bytes (in registers for text)",
"minimum": 0,
"propertyOrder": 50
},
"scale": {
"type": "number",
"title": "Value scale",
"propertyOrder": 70
},
"byteswap": {
"type": "boolean",
"title": "Little-endian for bytes in words",
"default": false,
"propertyOrder": 80
},
"wordswap": {
"type": "boolean",
"title": "Little-endian for words",
"default": false,
"propertyOrder": 90
}
},
"required": ["format", "size"]
},
"tcp": {
"title": "TCP",
"type": "object",
"properties": {
"host": {
"type": "string",
"title": "Bind address",
"description": "IP address or hostname to bind gateway to",
"default": "*",
"propertyOrder": 20,
"options": {
"grid_columns": 10
}
},
"port": {
"type": "integer",
"title": "Server TCP port",
"description": "TCP port number to bing gateway to",
"default": 502,
"minimum": 1,
"maximum": 65535,
"propertyOrder": 30,
"options": {
"grid_columns": 2
}
}
},
"required": ["host", "port"]
},
"rtu": {
"title": "RTU",
"type": "object",
"properties": {
"path": {
"type": "string",
"title": "Path to device",
"minLength": 1,
"propertyOrder": 1
},
"baud_rate": {
"type": "integer",
"title": "Baud rate",
"enum": [110, 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200],
"default": 9600,
"propertyOrder": 3,
"options": {
"grid_columns": 3
}
},
"parity": {
"type": "string",
"title": "Parity",
"enum": ["N", "E", "O"],
"default": "N",
"propertyOrder": 4,
"options": {
"grid_columns": 3
}
},
"data_bits": {
"type": "integer",
"title": "Data bits",
"enum": [5, 6, 7, 8],
"default": 8,
"propertyOrder": 5,
"options": {
"grid_columns": 3
}
},
"stop_bits": {
"type": "integer",
"title": "Stop bits",
"enum": [1, 2],
"default": 1,
"propertyOrder": 5,
"options": {
"grid_columns": 3
}
}
},
"required": ["path"]
}
},
"properties": {
"debug": {
"type": "boolean",
"title": "Enable debug logging",
"default": false,
"propertyOrder": 36
},
"modbus": {
"title": "Modbus binding",
"oneOf": [
{
"$ref": "#/definitions/tcp"
},
{
"$ref": "#/definitions/rtu"
}
],
"propertyOrder": 20
},
"mqtt": {
"type": "object",
"title": "MQTT connection",
"properties": {
"host": {
"type": "string",
"title": "Address",
"description": "Broker address",
"default": "localhost",
"propertyOrder": 10,
"options": {
"grid_columns": 10
}
},
"port": {
"type": "integer",
"title": "Port",
"description": "Broker port",
"default": 1883,
"minimum": 0,
"maximum": 65535,
"propertyOrder": 20,
"options": {
"grid_columns": 2
}
},
"keepalive": {
"type": "integer",
"title": "Keep-alive interval",
"description": "keepalive_description",
"default": 60,
"propertyOrder": 25,
"options": {
"grid_columns": 12
}
},
"auth": {
"type": "boolean",
"title": "Enable username+password authentication",
"default": false,
"propertyOrder": 30,
"options": {
"grid_columns": 12
}
},
"username": {
"type": "string",
"title": "Login",
"propertyOrder": 40,
"options": {
"grid_columns": 6
}
},
"password": {
"type": "string",
"title": "Password",
"propertyOrder": 50,
"options": {
"grid_columns": 6
}
}
},
"required": ["host", "port"],
"propertyOrder": 35
},
"registers": {
"type": "object",
"title": "Register bindings",
"propertyOrder": 40,
"properties": {
"discretes": {
"type": "array",
"title": "Discrete inputs (read-only one-bit values)",
"propertyOrder": 10,
"items": {
"$ref": "#/definitions/reg_common"
}
},
"coils": {
"type": "array",
"title": "Coils (read/write one-bit values)",
"propertyOrder": 20,
"items": {
"$ref": "#/definitions/reg_common"
}
},
"inputs": {
"type": "array",
"title": "Input registers (read-only registers)",
"propertyOrder": 30,
"items": {
"$ref": "#/definitions/reg_format"
}
},
"holdings": {
"type": "array",
"title": "Holding registers (read/write registers)",
"propertyOrder": 40,
"items": {
"$ref": "#/definitions/reg_format"
}
}
}
}
},
"required": ["debug", "modbus", "mqtt", "registers"],
"translations": {
"en": {
"keepalive_description": "Request to broker repeats if data was not received within specified interval"
},
"ru": {
"MQTT to Modbus TCP and RTU slave gateway configuration": "Шлюз MQTT - Modbus RTU/TCP slave",
"Enabled": "Включить",
"MQTT Device (from topic name)": "Канал MQTT",
"Modbus unit ID": "ID данных Modbus",
"Start address": "Начальный адрес",
"Register format": "Тип данных",
"Size": "Размер данных",
"Maximum value": "Максимальное значение",
"Value scale": "Множитель",
"Byte swap": "Изменить порядок байт",
"Word swap": "Изменить порядок слов",
"Bind address": "IP-адрес",
"IP address or hostname to bind gateway to": "IP-адрес или имя хоста для сервера Modbus TCP",
"Server TCP port": "Порт",
"TCP port number to bing gateway to": "Номер порта для сервера Modbus TCP",
"Port type": "Тип порта",
"Path to device": "Путь к устройству",
"Baud rate": "Скорость обмена",
"Parity": "Контроль чётности",
"Data bits": "Число бит данных",
"Stop bits": "Стоп биты",
"Enable debug logging": "Включить отладочные сообщения",
"Modbus binding": "Режим работы шлюза",
"MQTT connection": "Настройки подключения к брокеру MQTT",
"Address": "Адрес",
"Broker address": "Адрес брокера MQTT",
"Port": "Порт",
"Broker port": "Порт брокера MQTT",
"Keep-alive interval": "Интервал ожидания ответа",
"keepalive_description": "Запрос к брокеру повторяется, если данные не были получены в течение заданного интервала",
"Enable username+password authentication": "Включить аутентификацию по логину и паролю",
"Login": "Логин",
"Password": "Пароль",
"Register bindings": "Соответствия каналов и регистров",
"Discrete inputs (read-only one-bit values)": "Дискретные входы (однобитовые значения, только для чтения)",
"Coils (read/write one-bit values)": "Дискретные выходы (однобитовые значения, чтение/запись)",
"Input registers (read-only registers)": "Регистры Input (только для чтения)",
"Holding registers (read/write registers)": "Регистры Holding (чтение/запись)",
"little-endian for bytes in words": "Обратный порядок байт в словах",
"little-endian for words": "Обратный порядок слов",
"Signed integer": "Знаковое целое",
"Unsigned integer": "Беззнаковое целое",
"BCD": "Двоично-десятичное (BCD) целое",
"IEEE754 float": "Число с плавающей точкой (IEEE754)",
"Varchar (fixed size string)": "Текстовое поле фиксированного размера",
"Size in bytes (in registers for text)": "Размер в байтах (в регистрах для текста)",
"Little-endian for bytes in words": "Обратный порядок байт в словах",
"Little-endian for words": "Обратный порядок слов"
}
}
}