Run Command:
pip install -r requirements.txt
python manage.py runserver
- To START OPCUA-Client
API: $ curl --data "" http://127.0.0.1:8000/api/startopc
- To STOP OPCUA-Client
API: $ curl --data "" http://127.0.0.1:8000/api/stopopc
- To change the EdgeGateway Properties
API: http://localhost:8000/api/changeDataCenterProperties
BODY:
{
"Name": "Edge Device",
"Mode1": "UNO-2271 Linux",
"Password": "123456",
"Identity": "S3-0001",
"IP Address": "192.168.1.15",
"Time Zone": "+05:30",
"Description": "Siqsess Edge gateway Integrate with Bosch Nexeed Platform "
}
- To Change DataService-OPCUA-Properties
API: http://localhost:8000/api/changeDataService
BODY:
{
"mode": "update",
"Type": "OPCUAProperties",
"data": {
"Enable": "True",
"ClientName": "OPC_SIMULATION_CLIENT",
"url": "opc.tcp://DESKTOP-Q78JC4A.mshome.net:53530/OPCUA/SimulationServer",
"UpdateTime": "5",
"Param": "Parameters",
"RetryCount": "3",
"RecoveryTime": "10"
}
}
- To Change DataService-OPCUA-Parameter-MeasurementTags
API: http://localhost:8000/api/changeDataService
BODY:
{
"mode": "update",
"Type": "OPCUAParameterMeasurementTags",
"data":{
"MeasurementTag": [
{
"NameSpace": "3",
"Identifier": "1001",
"DisplayName": "Temperature",
"InitialValue": "0"
},
{
"NameSpace": "3",
"Identifier": "1002",
"DisplayName": "Pressure",
"InitialValue": "0"
},
{
"NameSpace": "3",
"Identifier": "1003",
"DisplayName": "Flow",
"InitialValue": "0"
}
]
}
}
- To Create DataService-OPCUA-Parameter-MeasurementTags
API: http://localhost:8000/api/changeDataService
BODY:
{
"mode": "create",
"Type": "OPCUAParameterMeasurementTags",
"data":{
"MeasurementTag": [
{
"NameSpace": "3",
"Identifier": "1001",
"DisplayName": "Temperature",
"InitialValue": "0"
},
{
"NameSpace": "3",
"Identifier": "1002",
"DisplayName": "Pressure",
"InitialValue": "0"
},
{
"NameSpace": "3",
"Identifier": "1003",
"DisplayName": "Flow",
"InitialValue": "0"
}
]
}
}
- To Delete DataService-OPCUA-Parameter-MeasurementTags
API: http://localhost:8000/api/changeDataService
BODY:
{
"mode": "delete",
"Type": "OPCUAParameterMeasurementTags",
"data":{
"MeasurementTag": [
{
"NameSpace": "3",
"Identifier": "1001",
"DisplayName": "Temperature",
"InitialValue": "0"
},
{
"NameSpace": "3",
"Identifier": "1002",
"DisplayName": "Pressure",
"InitialValue": "0"
},
{
"NameSpace": "3",
"Identifier": "1003",
"DisplayName": "Flow",
"InitialValue": "0"
}
]
}
}
- To change DataService-MQTT-Properties
API: http://localhost:8000/api/changeDataService
BODY:
{
"mode": "update",
"Type": "OPCUAProperties",
"data": {
"Enable": "true",
"subscriptionTopic": "IOTC3WSX0001/Event",
"serverIpAddress": "54.160.238.163",
"serverPort": "1883"
}
}
- To Change Services - Redis
API: http://localhost:8000/api/changeDataService
BODY:
{
"mode": "update",
"Type": "Redis",
"data": {
"IpAddress": "127.0.0.1",
"Port": "6379"
}
}
- To Change Services - MongoDB:
API: http://localhost:8000/api/changeDataService
BODY:
{
"mode": "update",
"Type": "MongoDB",
"data": {
"connectionString": "127.0.0.1:27017",
"DataBase": "CNC"
}
}
- To Start WebSocket
API: $ curl --data "" http://127.0.0.1:8000/api/startWebSocket
- To Stop WebSocket
API: $ curl --data "" http://127.0.0.1:8000/api/stopWebSocket
- To Read Json Data
API: $ curl -X GET http://localhost:8000/api/ReadDeviceSettings
- To Read MongoDb Datetime Range Documents
API: $ curl -X GET http://localhost:8000/api/ReadDbData
BODY:
{
"from_date":"2021-10-13T00:00:00.000Z",
"to_date":"2021-10-13T00:00:00.000Z"
}
docker run -p 6379:6379 -d redis:5
docker run -p 27016:27017 -d mongo:latest
{
"ip" : "192.168.1.40",
"port" : "502",
"deviceName" : "TCPdevice01"
}
1. linux/arm64 --> siqsessedge/cnc-api:v2
2. linux/amd64 --> siqsessedge/cnc-api:linux-arm
Eg: docker pull siqsessedge/cnc-api:v2
docker run -t -p 8000:8000 siqsessedge/cnc-api:v2
Format:
docker exec -it (CONTAINER ID) /bin/bash
Example:
docker exec -it c2c727b2624e /bin/bash
docker run --name cncapi --net projectnetwork --ip 172.18.0.5 -p 8000:8000 siqsessedge/cnc-api:v2
docker run --net projectnetwork --ip 172.18.0.3 mongo:latest
docker run --net projectnetwork --ip 172.18.0.4 redis:5
docker network inspect bosch-mcm-overall_static-network
docker network create --subnet=172.18.0.0/16 mynet123
docker run --net mynet123 --ip 172.18.0.22 -it ubuntu bash
docker network ls
docker build -t siqsessedge/cnc-api:linux-arm --push --platform linux/arm64 .
version: '3'
services:
backend:
image: "siqsessedge/cnc-api:v2"
ports:
- "8000:8000"
depends_on:
- redis
- mongo
networks:
cnc-network:
ipv4_address: 174.22.0.3
restart: always
redis:
image: "redis:5"
ports:
- "6379:6379"
networks:
cnc-network:
ipv4_address: 174.22.0.4
restart: always
mongo:
image: "mongo:latest"
ports:
- "27016:27017"
networks:
cnc-network:
ipv4_address: 174.22.0.2
restart: always
networks:
cnc-network:
ipam:
config:
- subnet: 174.22.0.0/16