-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide service to manage the extended IO (mainly PLC1200 signal modules). Including: - Config the modules, or retrieve the configuration - Sync system time to extended IO controller - Update the firmware of the controller and some modules - currently only controller firmware updating is supported. - Read extended IO events The extended IO controller is an ASIC, whose job is to forward the configuration to signal modules and collect events from modules. The firmware of the controller provides the IO read/write functionalities through a FUSE filesystem /eio. The iot2050-eiod.service is managing this FUSE file system. This manager is exposing service to localhost via gRPC, the iot2050-eiosd.service is managing this gRPC server. To sync the system time to eio controller, the iot2050-eio-time-syncing.service is doing the job. iot2050-eio-fwu-monitor.service is used to monitor the current firmware version of the eio controller, and raise alarm to console when the firmware does not match. This is useful when the host application is upgraded but the eio controller firmware is not updated accordingly, for example, when trying another example image via a SDCard/USB stick. To consume the service provided by this manager, an iot2050-eio cli is provided to config/retrieve/update-firmware from the console. This cli is purely a gRPC client to call the RPC procedure provided by the iot2050-eiosd.service. It's also possible to consume the service from WEB applications, we will provide a demo web application for configing/retrieving the signal modules. The module configuration is written in YAML, which will be validated via JSON schemas internally. For this YAML file, please check the config-template/sm-config-example.yaml for details. Please note the `description` for each slot, currently when retrieving the configuration, the description should be a multiline text, however, it's not so easy to generate multile line text for yaml. This part is still WIP. The YAML configuration is internally converted to the binary format which the extended IO controller accepts. We may use some binary schema tools such as Kaitai Struct to rewrite this part of logic in the future. Co-developed-by: Li Hua Qian <[email protected]> Signed-off-by: Li Hua Qian <[email protected]> Signed-off-by: Baocheng Su <[email protected]>
- Loading branch information
1 parent
aae9157
commit 9ae0f67
Showing
37 changed files
with
4,640 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# IOT2050 Extended IO Subsystem | ||
|
||
The IOT2050 Extended IO (EIO) subsystem is for managing the extended | ||
IOs, currently the PLC1200 signal modules. | ||
|
||
This subsystem is only valid on IOT2050-SM variant at the moment. | ||
|
||
The core is a RPC service implemented with the help of gPRC. | ||
|
||
In addition: | ||
- A FUSE service for loading the ext-io file system. | ||
- A time syncing service for sync the system time to extended IO | ||
controller. | ||
- A cli tool for communicating with the gRPC server: | ||
- Deploy/Retrieve extended IO configurations | ||
- Update firmware for the extended IO controller or modules. | ||
- A firmware updating monitoring service for notify updating while | ||
firmware does not match. | ||
|
||
## Regenerate the gRPC python modules if proto file changes: | ||
|
||
```shell | ||
python3 -m grpc_tools.protoc -I. --python_out=. --pyi_out=. --grpc_python_out=. gRPC/EIOManager/iot2050-eio.proto | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"version": "L00.00.00.12-0-ged53b19", | ||
"sha1sum":"93dc2baadd6e74ffc5e74332625881ae6974879c" | ||
} |
Binary file not shown.
Binary file not shown.
20 changes: 20 additions & 0 deletions
20
recipes-app/iot2050-eio-manager/files/config-schema/schema-na.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright (c) Siemens AG, 2023 | ||
# | ||
# Authors: | ||
# Su Bao Cheng <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
$schema: 'https://json-schema.org/draft/2020-12/schema' | ||
$id: 'https://iot2050-sm/sm-na' | ||
|
||
type: object | ||
properties: | ||
description: | ||
type: string | ||
mlfb: | ||
const: "NA" | ||
|
||
required: | ||
- mlfb | ||
|
||
unevaluatedProperties: false |
93 changes: 93 additions & 0 deletions
93
recipes-app/iot2050-eio-manager/files/config-schema/schema-sm-config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Copyright (c) Siemens AG, 2023 | ||
# | ||
# Authors: | ||
# Su Bao Cheng <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
$schema: 'https://json-schema.org/draft/2020-12/schema' | ||
$id: 'https://iot2050-sm/sm-config' | ||
|
||
type: object | ||
properties: | ||
slot1: | ||
$ref: "#/$defs/slot" | ||
slot2: | ||
$ref: "#/$defs/slot" | ||
slot3: | ||
$ref: "#/$defs/slot" | ||
slot4: | ||
$ref: "#/$defs/slot" | ||
slot5: | ||
$ref: "#/$defs/slot" | ||
slot6: | ||
$ref: "#/$defs/slot" | ||
|
||
required: | ||
- slot1 | ||
- slot2 | ||
- slot3 | ||
- slot4 | ||
- slot5 | ||
- slot6 | ||
|
||
$defs: | ||
slot: | ||
type: object | ||
properties: | ||
mlfb: | ||
enum: | ||
- 6ES7647-0CM00-1AA2 | ||
- 6ES7223-1QH32-0XB0 | ||
- 6ES7231-4HF32-0XB0 | ||
- 6ES7231-5PD32-0XB0 | ||
- 6ES7231-5PF32-0XB0 | ||
- 6ES7238-5XA32-0XB0 | ||
- NA | ||
|
||
allOf: | ||
|
||
- if: | ||
properties: | ||
mlfb: | ||
const: 6ES7647-0CM00-1AA2 | ||
then: | ||
$ref: https://iot2050-sm/sm-sens-di | ||
|
||
- if: | ||
properties: | ||
mlfb: | ||
const: 6ES7223-1QH32-0XB0 | ||
then: | ||
$ref: https://iot2050-sm/sm1223-ac-rly | ||
|
||
- if: | ||
properties: | ||
mlfb: | ||
const: 6ES7231-4HF32-0XB0 | ||
then: | ||
$ref: https://iot2050-sm/sm1231-ai | ||
|
||
- if: | ||
properties: | ||
mlfb: | ||
enum: | ||
- 6ES7231-5PD32-0XB0 | ||
- 6ES7231-5PF32-0XB0 | ||
then: | ||
$ref: https://iot2050-sm/sm1231-rtd | ||
|
||
- if: | ||
properties: | ||
mlfb: | ||
const: 6ES7238-5XA32-0XB0 | ||
then: | ||
$ref: https://iot2050-sm/sm1238-em-480vac | ||
|
||
- if: | ||
properties: | ||
mlfb: | ||
const: NA | ||
then: | ||
$ref: https://iot2050-sm/sm-na | ||
|
||
unevaluatedProperties: false |
20 changes: 20 additions & 0 deletions
20
recipes-app/iot2050-eio-manager/files/config-schema/schema-sm-sens-di.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright (c) Siemens AG, 2023 | ||
# | ||
# Authors: | ||
# Su Bao Cheng <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
$schema: 'https://json-schema.org/draft/2020-12/schema' | ||
$id: 'https://iot2050-sm/sm-sens-di' | ||
|
||
type: object | ||
properties: | ||
description: | ||
type: string | ||
mlfb: | ||
const: "6ES7647-0CM00-1AA2" | ||
|
||
required: | ||
- mlfb | ||
|
||
unevaluatedProperties: false |
74 changes: 74 additions & 0 deletions
74
recipes-app/iot2050-eio-manager/files/config-schema/schema-sm1223-ac-rly.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Copyright (c) Siemens AG, 2023 | ||
# | ||
# Authors: | ||
# Su Bao Cheng <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
$schema: 'https://json-schema.org/draft/2020-12/schema' | ||
$id: 'https://iot2050-sm/sm1223-ac-rly' | ||
|
||
type: object | ||
properties: | ||
description: | ||
type: string | ||
mlfb: | ||
const: "6ES7223-1QH32-0XB0" | ||
di: | ||
type: object | ||
properties: | ||
ch0_3_delay_time: | ||
enum: [2, 3, 4, 5, 6, 7, 9] | ||
ch4_7_delay_time: | ||
enum: [2, 3, 4, 5, 6, 7, 9] | ||
required: | ||
- ch0_3_delay_time | ||
- ch4_7_delay_time | ||
unevaluatedProperties: false | ||
dq: | ||
type: object | ||
properties: | ||
behavior_with_OD: | ||
enum: [2, 3] | ||
ch0: | ||
$ref: "#/$defs/channel" | ||
ch1: | ||
$ref: "#/$defs/channel" | ||
ch2: | ||
$ref: "#/$defs/channel" | ||
ch3: | ||
$ref: "#/$defs/channel" | ||
ch4: | ||
$ref: "#/$defs/channel" | ||
ch5: | ||
$ref: "#/$defs/channel" | ||
ch6: | ||
$ref: "#/$defs/channel" | ||
ch7: | ||
$ref: "#/$defs/channel" | ||
|
||
if: | ||
properties: | ||
behavior_with_OD: | ||
const: 3 | ||
then: | ||
required: [ch0, ch1, ch2, ch3, ch4, ch5, ch6, ch7] | ||
|
||
required: | ||
- behavior_with_OD | ||
unevaluatedProperties: false | ||
|
||
required: | ||
- mlfb | ||
- di | ||
- dq | ||
|
||
$defs: | ||
channel: | ||
type: object | ||
properties: | ||
substitute: | ||
enum: [0, 1] | ||
required: | ||
- substitute | ||
|
||
unevaluatedProperties: false |
76 changes: 76 additions & 0 deletions
76
recipes-app/iot2050-eio-manager/files/config-schema/schema-sm1231-ai.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Copyright (c) Siemens AG, 2023 | ||
# | ||
# Authors: | ||
# Su Bao Cheng <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
$schema: 'https://json-schema.org/draft/2020-12/schema' | ||
$id: 'https://iot2050-sm/sm1231-ai' | ||
|
||
type: object | ||
properties: | ||
description: | ||
type: string | ||
mlfb: | ||
const: "6ES7231-4HF32-0XB0" | ||
power_alarm: | ||
type: boolean | ||
integ_time: | ||
enum: [0, 1, 2, 3] | ||
ch0: | ||
$ref: "#/$defs/channel" | ||
ch1: | ||
$ref: "#/$defs/channel" | ||
ch2: | ||
$ref: "#/$defs/channel" | ||
ch3: | ||
$ref: "#/$defs/channel" | ||
ch4: | ||
$ref: "#/$defs/channel" | ||
ch5: | ||
$ref: "#/$defs/channel" | ||
ch6: | ||
$ref: "#/$defs/channel" | ||
ch7: | ||
$ref: "#/$defs/channel" | ||
|
||
required: [mlfb, power_alarm, integ_time, ch0, ch1, ch2, ch3, ch4, ch5, ch6, ch7] | ||
|
||
$defs: | ||
channel: | ||
type: object | ||
properties: | ||
type: | ||
enum: [1, 3] | ||
smooth: | ||
enum: [0, 1, 2, 3] | ||
open_wire_alarm: | ||
type: boolean | ||
overflow_alarm: | ||
type: boolean | ||
underflow_alarm: | ||
type: boolean | ||
|
||
if: | ||
properties: | ||
type: | ||
const: 1 | ||
then: | ||
properties: | ||
range: | ||
enum: [7, 8, 9] | ||
else: | ||
properties: | ||
range: | ||
enum: [2, 3] | ||
|
||
required: | ||
- type | ||
- range | ||
- smooth | ||
- open_wire_alarm | ||
- overflow_alarm | ||
- underflow_alarm | ||
unevaluatedProperties: false | ||
|
||
unevaluatedProperties: false |
Oops, something went wrong.