简体   繁体   中英

OPC-uA Iotagent & Fiware Communication

With OPC-uA we want to transfer the data PLC to Fiware using the OPC-uA IotAgent. We are doing all the steps in this Link but we can't connect to IotAgent. We made the server file with python and read data from the uA-Expert software. You can see our files below. Firstly, we change the "docker-compose-external.yml" like the info about the iotagent website. Also when we delete the "config.json" file in AGECONF. The website says if the delete the config.json, MappingTool will be create new one, but its not. We edit the both "config.properties" file in AGECONF and CONF file. But we got a problem about the iotagent, other containers like mongodb have not a problem. We ask for your help in this matter. Thank you.

Opc-ua server's python file:

127.0.0.1 ip address is the localhost.

from opcua import Server
from random import randint
import time

server = Server()

url = "opc.tcp://127.0.0.1:4840"

server.set_endpoint(url)

name = "age01_Car"
addspace = server.register_namespace(name)

node = server.get_objects_node()

Param = node.add_object(addspace, "Parameters")

Speed = Param.add_variable(addspace," Speed ",0)


Speed.set_writable()


server.start()
print("Server has started at {}".format(url))

while True:
    Speed_i = randint(20,100)    
    print("Speed:",Speed_i)

    Speed.set_value(Speed_i)
    

    time.sleep(2)

docker-compose-external.yml file:



services:
  iotage:
    hostname: iotage
    image: iotagent4fiware/iotagent-opcua:latest
    networks:
      - hostnet
      - iotnet
    ports:
      - "0.0.0.0:4001:4001"
      - "0.0.0.0:4081:8080"
    extra_hosts:
      - "iotcarsrv:127.0.0.1"
      - "age01_Car:127.0.0.1"
    depends_on:
      - iotmongo
      - orion
    volumes:
      - ./AGECONF:/opt/iotagent-opcua/conf
      - ./certificates:/opt/iotagent-opcua/certificates
    environment:
      - IOTA_REGISTRY_TYPE=memory #Whether to hold IoT device info in memory or in a database
      - IOTA_LOG_LEVEL=DEBUG # The log level of the IoT Agent
      - IOTA_MONGO_HOST=iot_mongo # The host name of MongoDB
      - IOTA_MONGO_DB=iotagent_opcua # The name of the database used in mongoDB
      #################################################################################################################
      # please comment out if you want to use NGSI-ld, the OPCUA Agent is provided with NGSIv2 as default configuration
      #- IOTA_CB_NGSI_VERSION=ld
      #- IOTA_JSON_LD_CONTEXT=https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld
      #################################################################################################################
      - IOTA_FALLBACK_TENANT=opcua_car
      - IOTA_RELAX_TEMPLATE_VALIDATION=true

  iotmongo:
    hostname: iotmongo
    image: mongo:4.4
    networks:
      - iotnet
    volumes:
      - iot_mongo_data:/data/db
      - iot_mongo_conf:/data/configdb

  ################ OCB ################

  orion:
    hostname: orion
    #replace fiware/orion:latest with fiware/orion-ld:0.7.0 if you mind using NGSI-ld
    image: fiware/orion:latest
    #image: fiware/orion-ld:0.7.0
    networks:
      - hostnet
      - ocbnet
    ports:
      - "0.0.0.0:1026:1026"
    depends_on:
      - orion_mongo
    # please replace "command" if you want to use NGSI-ld, the OPCUA Agent is provided with NGSIv2 as default configuration
    #command: -statCounters -dbhost orion_mongo -logLevel INFO -forwarding
    command: -statCounters -dbhost orion_mongo -logLevel INFO

  orion_mongo:
    hostname: orion_mongo
    image: mongo:4.4
    networks:
      - ocbnet
    ports:
      - "0.0.0.0:27017:27017"
    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:

networks:
  hostnet:
  iotnet:
  ocbnet:

Config.properties File:

# Southbound configuration
# The OPC UA Objects available within the specified namespaces will not be mapped by the OPC UA IotAgent.
namespace-ignore=2,7
# OPC UA Server address
endpoint=opc.tcp://127.0.0.1:4840

# Northbound configuration
# These are important for identifying the Device location and will be useful
# when contacting the Orion Context Broker requesting values or methods execution.
context-broker-host=orion
context-broker-port=1026
fiware-service=opcua_car
fiware-service-path=/demo

# Agent Server Configuration
device-registry-type=memory
agent-id=age01_Car

# The identifiers of the namespace the nodes belong to
[22:41, 18.11.2022] Serdar Sallantı: namespaceIndex=3
namespaceNumericIdentifier=1000


# Session and monitoring parameters
# These parameters are the homonymous counterparts of OPC UA official ones.
# See OPC UA Documentation for further information

configuration=api


This is the server from the uAExpert: uAExpert

The logs when the run the "sudo docker-compose -f docker-compose-external-server.yml up -d" command:

serdar@ubuntu:~/Desktop/iot_agent_car/iotagent-opcua$ sudo docker-compose -f docker-compose-external-server.yml up 
Starting iotagentopcua_iotmongo_1 ... 
Starting iotagentopcua_iotmongo_1
Starting iotagentopcua_orion_mongo_1 ... 
Starting iotagentopcua_orion_mongo_1 ... done
Starting iotagentopcua_orion_1 ... 
Starting iotagentopcua_orion_1 ... done
Starting iotagentopcua_iotage_1 ... 
Starting iotagentopcua_iotage_1 ... done
Attaching to iotagentopcua_iotmongo_1, iotagentopcua_orion_mongo_1, iotagentopcua_orion_1, iotagentopcua_iotage_1
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:10.873+00:00"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:09.284+00:00"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:09.289+00:00"},"s":"I",  "c":"NETWORK",  "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:10.943+00:00"},"s":"I",  "c":"NETWORK",  "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:10.954+00:00"},"s":"I",  "c":"STORAGE",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":1,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"orion_mongo"}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:10.954+00:00"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4.17","gitVersion":"85de0cc83f4dc64dbbac7fe028a4866228c1b5d1","openSSLVersion":"OpenSSL 1.1.1f  31 Mar 2020","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2004","distarch":"x86_64","target_arch":"x86_64"}}}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:10.954+00:00"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"20.04"}}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:10.954+00:00"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"*"},"storage":{"journal":{"enabled":false}}}}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:09.290+00:00"},"s":"I",  "c":"STORAGE",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":1,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"iotmongo"}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:09.290+00:00"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4.17","gitVersion":"85de0cc83f4dc64dbbac7fe028a4866228c1b5d1","openSSLVersion":"OpenSSL 1.1.1f  31 Mar 2020","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2004","distarch":"x86_64","target_arch":"x86_64"}}}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:09.290+00:00"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"20.04"}}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:09.290+00:00"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"*"}}}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:10.973+00:00"},"s":"I",  "c":"STORAGE",  "id":22270,   "ctx":"initandlisten","msg":"Storage engine to use detected by data files","attr":{"dbpath":"/data/db","storageEngine":"wiredTiger"}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:10.973+00:00"},"s":"I",  "c":"STORAGE",  "id":22297,   "ctx":"initandlisten","msg":"Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem","tags":["startupWarnings"]}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:10.973+00:00"},"s":"I",  "c":"STORAGE",  "id":22315,   "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=2443M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress,compact_progress],,log=(enabled=false),"}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:09.291+00:00"},"s":"I",  "c":"STORAGE",  "id":22270,   "ctx":"initandlisten","msg":"Storage engine to use detected by data files","attr":{"dbpath":"/data/db","storageEngine":"wiredTiger"}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:09.291+00:00"},"s":"I",  "c":"STORAGE",  "id":22297,   "ctx":"initandlisten","msg":"Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem","tags":["startupWarnings"]}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:09.291+00:00"},"s":"I",  "c":"STORAGE",  "id":22315,   "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=2443M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress,compact_progress],"}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.361+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1668801313:361205][1:0x7f348af6ccc0], txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Set global recovery timestamp: (0, 0)"}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.361+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1668801313:361292][1:0x7f348af6ccc0], txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Set global oldest timestamp: (0, 0)"}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:09.877+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1668801309:877944][1:0x7f8908b32cc0], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 1 through 2"}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.365+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1668801313:365353][1:0x7f348af6ccc0], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 1, snapshot max: 1 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 70"}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.385+00:00"},"s":"I",  "c":"STORAGE",  "id":4795906, "ctx":"initandlisten","msg":"WiredTiger opened","attr":{"durationMillis":2412}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.385+00:00"},"s":"I",  "c":"RECOVERY", "id":23987,   "ctx":"initandlisten","msg":"WiredTiger recoveryTimestamp","attr":{"recoveryTimestamp":{"$timestamp":{"t":0,"i":0}}}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.393+00:00"},"s":"I",  "c":"STORAGE",  "id":22262,   "ctx":"initandlisten","msg":"Timestamp monitor starting"}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:10.246+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1668801310:246744][1:0x7f8908b32cc0], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 2 through 2"}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:13.231+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1668801313:230643][1:0x7f8908b32cc0], txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Main recovery loop: starting at 1/31872 to 2/256"}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:13.399+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1668801313:399492][1:0x7f8908b32cc0], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 1 through 2"}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:13.501+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1668801313:501625][1:0x7f8908b32cc0], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 2 through 2"}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:13.549+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1668801313:549120][1:0x7f8908b32cc0], txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Set global recovery timestamp: (0, 0)"}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:13.549+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1668801313:549302][1:0x7f8908b32cc0], txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Set global oldest timestamp: (0, 0)"}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:13.557+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1668801313:557681][1:0x7f8908b32cc0], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 1, snapshot max: 1 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 37"}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:13.564+00:00"},"s":"I",  "c":"STORAGE",  "id":4795906, "ctx":"initandlisten","msg":"WiredTiger opened","attr":{"durationMillis":4273}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:13.564+00:00"},"s":"I",  "c":"RECOVERY", "id":23987,   "ctx":"initandlisten","msg":"WiredTiger recoveryTimestamp","attr":{"recoveryTimestamp":{"$timestamp":{"t":0,"i":0}}}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:13.569+00:00"},"s":"I",  "c":"STORAGE",  "id":22262,   "ctx":"initandlisten","msg":"Timestamp monitor starting"}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:13.571+00:00"},"s":"W",  "c":"CONTROL",  "id":22120,   "ctx":"initandlisten","msg":"Access control is not enabled for the database. Read and write access to data and configuration is unrestricted","tags":["startupWarnings"]}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:13.575+00:00"},"s":"I",  "c":"STORAGE",  "id":20536,   "ctx":"initandlisten","msg":"Flow Control is enabled on this deployment"}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:13.579+00:00"},"s":"I",  "c":"FTDC",     "id":20625,   "ctx":"initandlisten","msg":"Initializing full-time diagnostic data capture","attr":{"dataDirectory":"/data/db/diagnostic.data"}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:13.580+00:00"},"s":"I",  "c":"REPL",     "id":6015317, "ctx":"initandlisten","msg":"Setting new configuration state","attr":{"newState":"ConfigReplicationDisabled","oldState":"ConfigPreStart"}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:13.582+00:00"},"s":"I",  "c":"NETWORK",  "id":23015,   "ctx":"listener","msg":"Listening on","attr":{"address":"/tmp/mongodb-27017.sock"}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:13.582+00:00"},"s":"I",  "c":"NETWORK",  "id":23015,   "ctx":"listener","msg":"Listening on","attr":{"address":"0.0.0.0"}}
iotmongo_1     | {"t":{"$date":"2022-11-18T19:55:13.582+00:00"},"s":"I",  "c":"NETWORK",  "id":23016,   "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.397+00:00"},"s":"W",  "c":"CONTROL",  "id":22120,   "ctx":"initandlisten","msg":"Access control is not enabled for the database. Read and write access to data and configuration is unrestricted","tags":["startupWarnings"]}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.421+00:00"},"s":"I",  "c":"STORAGE",  "id":20536,   "ctx":"initandlisten","msg":"Flow Control is enabled on this deployment"}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.452+00:00"},"s":"I",  "c":"FTDC",     "id":20625,   "ctx":"initandlisten","msg":"Initializing full-time diagnostic data capture","attr":{"dataDirectory":"/data/db/diagnostic.data"}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.461+00:00"},"s":"I",  "c":"REPL",     "id":6015317, "ctx":"initandlisten","msg":"Setting new configuration state","attr":{"newState":"ConfigReplicationDisabled","oldState":"ConfigPreStart"}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.492+00:00"},"s":"I",  "c":"NETWORK",  "id":23015,   "ctx":"listener","msg":"Listening on","attr":{"address":"/tmp/mongodb-27017.sock"}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.492+00:00"},"s":"I",  "c":"NETWORK",  "id":23015,   "ctx":"listener","msg":"Listening on","attr":{"address":"0.0.0.0"}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.492+00:00"},"s":"I",  "c":"NETWORK",  "id":23016,   "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.762+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.0.3:59462","connectionId":1,"connectionCount":1}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.763+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn1","msg":"client metadata","attr":{"remote":"172.22.0.3:59462","client":"conn1","doc":{"driver":{"name":"mongoc","version":"1.17.4"},"os":{"type":"Linux","name":"Debian GNU/Linux","version":"11","architecture":"x86_64"},"platform":"cfg=0x02a156a0e9 posix=200809 stdc=201710 CC=GCC 10.2.1 20210110 CFLAGS=\"\" LDFLAGS=\"\""}}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.765+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.0.3:59466","connectionId":2,"connectionCount":2}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.766+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn2","msg":"client metadata","attr":{"remote":"172.22.0.3:59466","client":"conn2","doc":{"driver":{"name":"mongoc","version":"1.17.4"},"os":{"type":"Linux","name":"Debian GNU/Linux","version":"11","architecture":"x86_64"},"platform":"cfg=0x02a156a0e9 posix=200809 stdc=201710 CC=GCC 10.2.1 20210110 CFLAGS=\"\" LDFLAGS=\"\""}}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.769+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.0.3:59474","connectionId":3,"connectionCount":3}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.770+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn3","msg":"client metadata","attr":{"remote":"172.22.0.3:59474","client":"conn3","doc":{"driver":{"name":"mongoc","version":"1.17.4"},"os":{"type":"Linux","name":"Debian GNU/Linux","version":"11","architecture":"x86_64"},"platform":"cfg=0x02a156a0e9 posix=200809 stdc=201710 CC=GCC 10.2.1 20210110 CFLAGS=\"\" LDFLAGS=\"\""}}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.772+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.0.3:59482","connectionId":4,"connectionCount":4}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.772+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn4","msg":"client metadata","attr":{"remote":"172.22.0.3:59482","client":"conn4","doc":{"driver":{"name":"mongoc","version":"1.17.4"},"os":{"type":"Linux","name":"Debian GNU/Linux","version":"11","architecture":"x86_64"},"platform":"cfg=0x02a156a0e9 posix=200809 stdc=201710 CC=GCC 10.2.1 20210110 CFLAGS=\"\" LDFLAGS=\"\""}}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.775+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.0.3:59496","connectionId":5,"connectionCount":5}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.776+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn5","msg":"client metadata","attr":{"remote":"172.22.0.3:59496","client":"conn5","doc":{"driver":{"name":"mongoc","version":"1.17.4"},"os":{"type":"Linux","name":"Debian GNU/Linux","version":"11","architecture":"x86_64"},"platform":"cfg=0x02a156a0e9 posix=200809 stdc=201710 CC=GCC 10.2.1 20210110 CFLAGS=\"\" LDFLAGS=\"\""}}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.778+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.0.3:59502","connectionId":6,"connectionCount":6}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.779+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn6","msg":"client metadata","attr":{"remote":"172.22.0.3:59502","client":"conn6","doc":{"driver":{"name":"mongoc","version":"1.17.4"},"os":{"type":"Linux","name":"Debian GNU/Linux","version":"11","architecture":"x86_64"},"platform":"cfg=0x02a156a0e9 posix=200809 stdc=201710 CC=GCC 10.2.1 20210110 CFLAGS=\"\" LDFLAGS=\"\""}}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.781+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.0.3:59518","connectionId":7,"connectionCount":7}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.782+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn7","msg":"client metadata","attr":{"remote":"172.22.0.3:59518","client":"conn7","doc":{"driver":{"name":"mongoc","version":"1.17.4"},"os":{"type":"Linux","name":"Debian GNU/Linux","version":"11","architecture":"x86_64"},"platform":"cfg=0x02a156a0e9 posix=200809 stdc=201710 CC=GCC 10.2.1 20210110 CFLAGS=\"\" LDFLAGS=\"\""}}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.783+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.0.3:59532","connectionId":8,"connectionCount":8}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.784+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn8","msg":"client metadata","attr":{"remote":"172.22.0.3:59532","client":"conn8","doc":{"driver":{"name":"mongoc","version":"1.17.4"},"os":{"type":"Linux","name":"Debian GNU/Linux","version":"11","architecture":"x86_64"},"platform":"cfg=0x02a156a0e9 posix=200809 stdc=201710 CC=GCC 10.2.1 20210110 CFLAGS=\"\" LDFLAGS=\"\""}}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.786+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.0.3:59542","connectionId":9,"connectionCount":9}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.786+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn9","msg":"client metadata","attr":{"remote":"172.22.0.3:59542","client":"conn9","doc":{"driver":{"name":"mongoc","version":"1.17.4"},"os":{"type":"Linux","name":"Debian GNU/Linux","version":"11","architecture":"x86_64"},"platform":"cfg=0x02a156a0e9 posix=200809 stdc=201710 CC=GCC 10.2.1 20210110 CFLAGS=\"\" LDFLAGS=\"\""}}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.789+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.0.3:59548","connectionId":10,"connectionCount":10}}
orion_mongo_1  | {"t":{"$date":"2022-11-18T19:55:13.789+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn10","msg":"client metadata","attr":{"remote":"172.22.0.3:59548","client":"conn10","doc":{"driver":{"name":"mongoc","version":"1.17.4"},"os":{"type":"Linux","name":"Debian GNU/Linux","version":"11","architecture":"x86_64"},"platform":"cfg=0x02a156a0e9 posix=200809 stdc=201710 CC=GCC 10.2.1 20210110 CFLAGS=\"\" LDFLAGS=\"\""}}}
orion_1        | time=2022-11-18T19:55:13.752Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=contextBroker.cpp[1092]:main | msg=start command line </usr/bin/contextBroker -fg -multiservice -ngsiv1Autocast -disableFileLog -statCounters -dbhost orion_mongo -logLevel INFO>
orion_1        | time=2022-11-18T19:55:13.752Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=contextBroker.cpp[1166]:main | msg=Orion Context Broker is running
orion_1        | time=2022-11-18T19:55:13.794Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongoConnectionPool.cpp[506]:mongoConnectionPoolInit | msg=Connected to mongodb://orion_mongo/?connectTimeoutMS=10000 (dbName: orion, poolsize: 10)
orion_1        | time=2022-11-18T19:55:13.799Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=contextBroker.cpp[1304]:main | msg=Startup completed
iotage_1       | *****************
iotage_1       | WARNING: It is recommended to enable authentication for secure connection
iotage_1       | *****************
iotage_1       | INFO: IoT Agent running standalone
iotage_1       | WARNING!!!
iotage_1       | CHECK YOUR config.properties FILE,  THE FOLLOWING PARAMETERS ARE NULL:
iotage_1       | server_base_root
iotage_1       | server_port
iotage_1       | mongodb_host
iotage_1       | mongodb_port
iotage_1       | mongodb_db
iotage_1       | mongodb_retries
iotage_1       | mongodb_retry_time
iotage_1       | device_registration_duration
iotage_1       | log_level
iotage_1       | requestedPublishingInterval
iotage_1       | requestedLifetimeCount
iotage_1       | requestedMaxKeepAliveCount
iotage_1       | maxNotificationsPerPublish
iotage_1       | publishingEnabled
iotage_1       | priority
iotage_1       | api_port
iotage_1       | polling_commands_timer
iotage_1       | pollingDaemonFrequency
iotage_1       | pollingExpiration
iotage_1       | samplingInterval
iotage_1       | queueSize
iotage_1       | discardOldest
iotage_1       | polling
iotagentopcua_iotage_1 exited with code 1

We are waiting for a solution about transferring data from PLC to fiware via opc-ua.

Please update your agent to the lastest version from here and then use the following configuration

config.js

var config = {};

config.iota = {
logLevel: 'DEBUG',
timestamp: true,
contextBroker: {
    host: 'localhost',
    port: '1026',
    ngsiVersion: 'v2',
    jsonLdContext: 'https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld',
    service: 'opcua_car',
    subservice: '/demo'
},
server: {
    port: 4041
},
deviceRegistry: {
    type: 'mongodb'
},
mongodb: {
    host: 'localhost',
    port: '27017',
    db: 'iotagent_opcua'
},
types: {
    Device: {
        active: [
            {
                name: 'ParametersSpeed',
                type: 'Number'
            }
        ]
    }
},
contexts: [
    {
        id: 'age01_Car',
        type: 'Device',
        mappings: [
            {
                ocb_id: 'ParametersSpeed',
                opcua_id: 'ns=2;i=2',
                object_id: 'ns=2;i=2',
                inputArguments: []
            }
        ]
    }
],
contextSubscriptions: [],
service: 'opcua_car',
subservice: '/demo',
providerUrl: 'http://localhost:4041',
deviceRegistrationDuration: 'P20Y',
defaultType: 'Device',
defaultResource: '/iot/opcua',
explicitAttrs: false
};

config.opcua = {
endpoint: 'opc.tcp://localhost:4840',
securityMode: 'None',
securityPolicy: 'None',
username: null,
password: null,
uniqueSubscription: false
};

config.mappingTool = {
polling: false,
agentId: 'age01_',
namespaceIgnore: '0,7',
entityId: 'age01_Car',
entityType: 'Device'
};

config.jexlTransformations = {};
config.configRetrieval = false;
config.defaultKey = 'iot';
config.defaultTransport = 'OPCUA';
config.autoprovision = true;

module.exports = config;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM