Skip to content

Commit

Permalink
Merge 58a8819 into 77e87cc
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiaMarzano-Eng committed Oct 5, 2021
2 parents 77e87cc + 58a8819 commit 688291c
Show file tree
Hide file tree
Showing 5 changed files with 358 additions and 489 deletions.
4 changes: 2 additions & 2 deletions conf/config.json.TEST_WITH_PLACEHOLDER
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"baseRoot": "/"
},
"deviceRegistry": {
"type": "memory"
"type": "mongodb"
},
"mongodb": {
"host": "TEST_MACHINE_IP",
"port": "27017",
"db": "iotagent",
"db": "iotagent_opcua",
"retries": 5,
"retryTime": 5
},
Expand Down
68 changes: 38 additions & 30 deletions conf/config.properties.WITH_PLACEHOLDER
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
## SOUTHBOUND CONFIGURATION (OPC UA)
namespace-ignore=2,7
endpoint=opc.tcp://TEST_MACHINE_IP:5001/UA/CarServer

namespaceIndex=3
namespaceNumericIdentifier=1000

## NORTHBOUND CONFIGURATION (ORION CONTEXT BROKER)
context-broker-host=TEST_MACHINE_IP
context-broker-port=1026
server-base-root=/
server-port=4001
device-registry-type=memory
mongodb-host=TEST_MACHINE_IP
mongodb-port=27017
mongodb-db=iotagent
mongodb-retries=5
mongodb-retry-time=5
fiware-service=opcua_car
fiware-service-path=/demo

## AGENT CONFIGURATION
server-base-root=
server-port=4001
provider-url=http://TEST_MACHINE_IP:4001

device-registration-duration=P1M
#endpoint=opc.tcp://TEST_MACHINE_IP:4334/UA/EnergyMESServer
endpoint=opc.tcp://TEST_MACHINE_IP:5001/UA/CarServer
device-registry-type=mongodb

log-level=INFO
#DATATYPE MAPPING OPCUA --> NGSI

namespaceIndex=3
namespaceNumericIdentifier=1000

# MONGO-DB CONFIGURATION (required if device-registry-type=mongodb)
mongodb-host=TEST_MACHINE_IP
mongodb-port=27017
mongodb-db=iotagent_opcua
mongodb-retries=5
mongodb-retry-time=5

## DATATYPE MAPPING OPCUA --> NGSI
OPC-datatype-Number=Number
OPC-datatype-Decimal128=Number
OPC-datatype-Double=Number
Expand All @@ -31,7 +39,7 @@ OPC-datatype-String=Text
OPC-datatype-ByteString=Text
#END DATATYPE MAPPING OPCUA --> NGSI

#SESSION PARAMETERS
## SESSION PARAMETERS
requestedPublishingInterval=10
requestedLifetimeCount=1000
requestedMaxKeepAliveCount=10
Expand All @@ -40,43 +48,43 @@ publishingEnabled=true
priority=10

#SubscriptionsStrategy
uniqueSubscription=false
uniqueSubscription=true

#MONITORING PARAMETERS
## MONITORING PARAMETERS
samplingInterval=1
queueSize=10000
discardOldest=false

#SERVER CERT E AUTH
## SERVER CERT E AUTH
securityMode=None
securityPolicy=None
userName=
password=

#securityMode=SIGNANDENCRYPT
#securityPolicy=Basic256
#securityPolicy=1Basic256
#password=password1
#userName=user1

#api-ip=192.168.13.153

#Administration Services
## ADMINISTRATION SERVICES
api-port=8080
#End Administration Services

#POLL COMMANDS SETTINGS
polling=true
## POLL COMMANDS SETTINGS
polling=false
polling-commands-timer=1000
pollingDaemonFrequency=20000
pollingExpiration=200000
#END POLL COMMANDS SETTINGS

#AGENT ID
## AGENT ID
agent-id=age01_

entity-id=age01_Car
test-machine-ip=TEST_MACHINE_IP
#CONFIGURATION
configuration=api
#CHECK TIMER POLLING DEVICES

## CONFIGURATION
configuration=#api

## CHECK TIMER POLLING DEVICES
checkTimer=2000
4 changes: 1 addition & 3 deletions replace_local_ip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
MACHINE_IP=$(hostname -I | cut -d ' ' -f 1)

sed -i "s/TEST_MACHINE_IP/$MACHINE_IP/g" conf/config.properties
sed -i "s/TEST_MACHINE_IP/$MACHINE_IP/g" conf/config.json
sed -i "s/TEST_MACHINE_IP/$MACHINE_IP/g" conf/config.properties.WITH_PLACEHOLDER
sed -i "s/TEST_MACHINE_IP/$MACHINE_IP/g" conf/config.json.TEST_WITH_PLACEHOLDER
sed -i "s/TEST_MACHINE_IP/$MACHINE_IP/g" conf/config.json
65 changes: 14 additions & 51 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,38 @@
version: "3"
#secrets:
# age_idm_auth:
# file: age_idm_auth.txt
version: "3.2"

services:
iotcarsrv:
hostname: iotcarsrv
image: iotagent4fiware/opcuacarsrv:latest
environment:
- http_proxy=$http_proxy
- https_proxy=$https_proxy
- no_proxy=$no_proxy
networks:
- hostnet
ports:
- "5001:5001"

iotmongo:
hostname: iotmongo
mongo-db:
image: mongo:4.2
environment:
- http_proxy=$http_proxy
- https_proxy=$https_proxy
- no_proxy=$no_proxy
networks:
- iotnet
hostname: mongo-db
ports:
- "27017:27017"
networks:
- hostnet
volumes:
- iot_mongo_data:/data/db
- iot_mongo_conf:/data/configdb

################ OCB ################
- mongo-db:/data

orion:
hostname: orion
image: fiware/orion:latest
environment:
- http_proxy=$http_proxy
- https_proxy=$https_proxy
- no_proxy=$no_proxy
hostname: orion
container_name: fiware-orion
depends_on:
- mongo-db
networks:
- hostnet
- ocbnet
ports:
- "1026:1026"
depends_on:
- orion_mongo
command: -statCounters -dbhost orion_mongo -logLevel INFO

orion_mongo:
hostname: orion_mongo
image: mongo:4.2
environment:
- http_proxy=$http_proxy
- https_proxy=$https_proxy
- no_proxy=$no_proxy
networks:
- ocbnet
volumes:
- orion_mongo_data:/data/db
- orion_mongo_conf:/data/configdb
command: --nojournal

volumes:
iot_mongo_data:
iot_mongo_conf:
orion_mongo_data:
orion_mongo_conf:
command: -dbhost mongo-db -logLevel DEBUG

networks:
hostnet:
iotnet:
ocbnet:

volumes:
mongo-db:

0 comments on commit 688291c

Please sign in to comment.