Engineering-Research-and-Development / iotagent-opcua

IoT Agent for OPC UA protocol
https://iotagent-opcua.rtfd.io/
GNU Affero General Public License v3.0
41 stars 21 forks source link

Write commands/methods error #85

Closed alberto072710 closed 1 year ago

alberto072710 commented 1 year ago

I'm trying to execute methods on the opc server but I can't. I have the following method in my opc server.

Captura de pantalla 2022-11-22 125938

My 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: {
        Habitacion : {
              active : [ {
                name : "temperature",
                type : "Float"
              }, {
                name : "pressure",
                type : "Integer"
              } ],
              lazy : [ ],
              commands : [{
                  name : "temperatureCommand",
                  type : "command"
              }]
        }
    },
    contexts: [
    {
        id: "Habitacion:001",
        type: "Habitacion",
        polling: "false",
        mappings: [
            {
                ocb_id: "pressure",
                opcua_id: "ns=4;i=4",
                object_id: null,
                inputArguments: []
            },
            {
                ocb_id: "temperature",
                opcua_id: "ns=4;i=3",
                object_id: null,
                inputArguments: []
            }
        ]
    }
    ],
    contextSubscriptions: [{
        id: "Habitacion:001",
        type: "Habitacion",
        mappings: [
            {
                ocb_id: "temperatureCommand",
                opcua_id: "ns=4;i=9",
                object_id: "ns=4;i=9",
                inputArguments: []
    }]
    }],
    service: 'opcua_car',
    subservice: '/demo',
    providerUrl: 'http://localhost:4041',
    deviceRegistrationDuration: 'P20Y',
    defaultType: 'Device',
    defaultResource: '/iot/opcua',
    explicitAttrs: false
};

config.opcua = {
    endpoint: 'opc.tcp://192.168.2.1:4840/PLC',
    securityMode: 'None',
    securityPolicy: 'None',
    username: null,
    password: null,
    uniqueSubscription: false,
    polling: false,
    agentId: 'age01_',
    namespaceIgnore: '0,7',
    entityId: 'age01_Car',
    entityType: 'Device'
};
config.jexlTransformations = {};
config.configRetrieval = false;
config.defaultKey = 'iot';
config.defaultTransport = 'OPCUA';
//config.multiCore = false;
config.autoprovision = true;
module.exports = config;

When I execute the command to activate the method it gives an error Captura de pantalla 2022-11-24 104915

But the iot-agent receives the update command

Captura de pantalla 2022-11-24 105051

iot agent devices

Captura de pantalla 2022-11-24 104942

ocb entities

Captura de pantalla 2022-11-24 105548

walterwootz commented 1 year ago

Hi, could you show the registrations on Orion by running the following request?

curl --location --request GET 'http://localhost:1026/v2/registrations' \
--header 'Accept: application/json' \
--header 'Fiware-Service: opcua_car' \
--header 'Fiware-ServicePath: /demo'
alberto072710 commented 1 year ago

Captura de pantalla 2022-11-24 113157

walterwootz commented 1 year ago

Hello @alberto072710, the problem has been fixed with the new version of the agent 2.0.2, so please use image iotagent4fiware/iotagent-opcua:2.0.2 on your docker compose and use the latest version of the config.js you can find here (there are some small differences in the opcua/mappingTool section).

alberto072710 commented 1 year ago

Thank you very much. Amazing work!!!!

Now if I manage to send a command and I see how that command updates the corresponding variable, but the "info" entity does not get any value and the "status" entity of the command remains "pending", could you explain to me how these entities work? From an opc browser if I get success.

Captura de pantalla 2022-11-30 092856

Captura de pantalla 2022-11-30 093501

On the other hand, I have tried to declare a command "suma" with input parameters, but when executing them I get an error in the iot-agent, I attach the configuration in case there is something wrong declared

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: {
        Habitacion: {
            active: [
                {
                    name: 'temperature',
                    type: 'Float'
                },
                {
                    name: 'pressure',
                    type: 'Integer'
                }
            ],
            lazy: [],
            commands: [
                {
                    name: 'temperatureCommand',
                    type: 'command'
                },
                {
                    name: 'suma',
                    type: 'command'
                }
            ]
        }
    },
    contexts: [
        {
            id: 'Habitacion:001',
            type: 'Habitacion',
            mappings: [
                {
                    ocb_id: 'pressure',
                    opcua_id: 'ns=4;i=4',
                    object_id: 'ns=4;i=4',
                    inputArguments: []
                },
                {
                    ocb_id: 'temperature',
                    opcua_id: 'ns=4;i=3',
                    object_id: 'ns=4;i=3',
                    inputArguments: []
                }
            ]
        }
    ],
    contextSubscriptions: [
        {
            id: 'Habitacion:001',
            type: 'Habitacion',
            mappings: [
                {
                    ocb_id: 'temperatureCommand',
                    opcua_id: 'ns=4;i=8',
                    object_id: 'ns=4;i=1',
                    inputArguments: []
                },
                {
                    ocb_id: 'suma',
                    opcua_id: 'ns=4;i=9',
                    object_id: 'ns=4;i=1',
                    inputArguments: [
                        {
                            dataType: 4,
                            type: 'DATO1'
                        },
                        {
                            dataType: 4,
                            type: 'DATO2'
                        }
                    ]   
                }
            ]
        }
    ],
    service: 'opcua_car',
    subservice: '/demo',
    providerUrl: 'http://localhost:4041',
    deviceRegistrationDuration: 'P20Y',
    defaultType: 'Device',
    defaultResource: '/iot/opcua',
    explicitAttrs: false
};

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

config.mappingTool = {
    polling: false,
    /**
     * agentId prefix to be assigned to the newly generated entity from MappingTool execution
     */
    agentId: 'age01_',
    /**
     * Namespaces to ignore when crawling nodes from OPC UA Server
     */
    namespaceIgnore: '0,7',
    /**
     * entityId to be assigned to the newly generated entity from MappingTool execution
     */
    entityId: 'age01_Car',
    /**
     * entityType to be assigned to the newly generated entity from MappingTool execution
     */
    entityType: 'Device'
};
config.jexlTransformations = {};
config.configRetrieval = false;
config.defaultKey = 'iot';
config.defaultTransport = 'OPCUA';
//config.multiCore = false;
config.autoprovision = true;
module.exports = config;

command

Captura de pantalla 2022-11-30 094620

iot-agent

2022-11-30 09:46:53 time=2022-11-30T08:46:53.063Z | lvl=DEBUG | corr=89a7f2aa-708b-11ed-806f-0242ac160003; cbfwd=1 | trans=203823ff-5b8e-42a0-8f31-7eb867a715bf | op=IoTAgentNGSI.GenericMiddlewares | from=n/a | srv=opcua_car | subsrv=/demo | msg=Request for path [//op/update] from [iotagent-opcua:4041] | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.063Z | lvl=DEBUG | corr=89a7f2aa-708b-11ed-806f-0242ac160003; cbfwd=1 | trans=203823ff-5b8e-42a0-8f31-7eb867a715bf | op=IoTAgentNGSI.GenericMiddlewares | from=n/a | srv=opcua_car | subsrv=/demo | msg=Body:
2022-11-30 09:46:53 
2022-11-30 09:46:53 {
2022-11-30 09:46:53     "entities": [
2022-11-30 09:46:53         {
2022-11-30 09:46:53             "id": "Habitacion:001",
2022-11-30 09:46:53             "type": "Habitacion",
2022-11-30 09:46:53             "suma": {
2022-11-30 09:46:53                 "type": "command",
2022-11-30 09:46:53                 "value": [
2022-11-30 09:46:53                     2,
2022-11-30 09:46:53                     2
2022-11-30 09:46:53                 ],
2022-11-30 09:46:53                 "metadata": {}
2022-11-30 09:46:53             }
2022-11-30 09:46:53         }
2022-11-30 09:46:53     ],
2022-11-30 09:46:53     "actionType": "update"
2022-11-30 09:46:53 }
2022-11-30 09:46:53 
2022-11-30 09:46:53  | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.063Z | lvl=DEBUG | corr=89a7f2aa-708b-11ed-806f-0242ac160003; cbfwd=1 | trans=203823ff-5b8e-42a0-8f31-7eb867a715bf | op=IoTAgentNGSI.ContextServer-v2 | from=n/a | srv=opcua_car | subsrv=/demo | msg=Handling v2 update from [iotagent-opcua:4041] | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.063Z | lvl=DEBUG | corr=89a7f2aa-708b-11ed-806f-0242ac160003; cbfwd=1 | trans=203823ff-5b8e-42a0-8f31-7eb867a715bf | op=IoTAgentNGSI.ContextServer-v2 | from=n/a | srv=opcua_car | subsrv=/demo | msg={
2022-11-30 09:46:53     "entities": [
2022-11-30 09:46:53         {
2022-11-30 09:46:53             "id": "Habitacion:001",
2022-11-30 09:46:53             "type": "Habitacion",
2022-11-30 09:46:53             "suma": {
2022-11-30 09:46:53                 "type": "command",
2022-11-30 09:46:53                 "value": [
2022-11-30 09:46:53                     2,
2022-11-30 09:46:53                     2
2022-11-30 09:46:53                 ],
2022-11-30 09:46:53                 "metadata": {}
2022-11-30 09:46:53             }
2022-11-30 09:46:53         }
2022-11-30 09:46:53     ],
2022-11-30 09:46:53     "actionType": "update"
2022-11-30 09:46:53 } | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.063Z | lvl=DEBUG | corr=89a7f2aa-708b-11ed-806f-0242ac160003; cbfwd=1 | trans=203823ff-5b8e-42a0-8f31-7eb867a715bf | op=IoTAgentNGSI.MongoDBDeviceRegister | from=n/a | srv=opcua_car | subsrv=/demo | msg=Looking for device with [{"name":"Habitacion:001","service":"opcua_car","subservice":"/demo","type":"Habitacion"}]. | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.064Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=n/a | subsrv=n/a | msg=Looking for group params ["service","subservice","type","apikey"] with queryObj {"service":"opcua_car","subservice":"/demo","type":"Habitacion","apikey":"iot"} | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.065Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=n/a | subsrv=n/a | msg=Device group for fields [["service","subservice","type","apikey"]] not found: [{"service":"opcua_car","subservice":"/demo","type":"Habitacion","apikey":"iot"}] | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.065Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=n/a | subsrv=n/a | msg=Looking for group params ["service","subservice","apikey"] with queryObj {"service":"opcua_car","subservice":"/demo","apikey":"iot"} | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.066Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=opcua_car | subsrv=/demo | msg=Device group data found: {"_id":"63871217db1baab3db7b614d","resource":"/iot/opcua","apikey":"iot","type":"Device","service":"opcua_car","subservice":"/demo"} | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.067Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.DeviceService | from=n/a | srv=n/a | subsrv=n/a | msg=deviceData before merge with conf: {"_id":"63871217db1baa30467b6156","lazy":[],"active":[{"name":"temperature","type":"Float","object_id":"temperature"},{"name":"pressure","type":"Integer","object_id":"pressure"}],"commands":[{"name":"temperatureCommand","type":"command","object_id":"temperatureCommand"},{"name":"suma","type":"command","object_id":"suma"}],"staticAttributes":[],"subscriptions":[],"creationDate":"2022-11-30T08:19:35.519Z","id":"Habitacion:001","type":"Habitacion","name":"Habitacion:001","service":"opcua_car","subservice":"/demo","registrationId":"638712179c31f6349d5c58eb","internalId":null,"apikey":"iot","endpoint":"opc.tcp://192.168.2.1:4840","explicitAttrs":false} | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.067Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.DeviceService | from=n/a | srv=n/a | subsrv=n/a | msg=deviceData after merge with conf: {"_id":"63871217db1baa30467b6156","lazy":[],"active":[{"name":"temperature","type":"Float","object_id":"temperature"},{"name":"pressure","type":"Integer","object_id":"pressure"}],"commands":[{"name":"temperatureCommand","type":"command","object_id":"temperatureCommand"},{"name":"suma","type":"command","object_id":"suma"}],"staticAttributes":[],"subscriptions":[],"creationDate":"2022-11-30T08:19:35.519Z","id":"Habitacion:001","type":"Habitacion","name":"Habitacion:001","service":"opcua_car","subservice":"/demo","registrationId":"638712179c31f6349d5c58eb","internalId":null,"apikey":"iot","endpoint":"opc.tcp://192.168.2.1:4840","explicitAttrs":false,"internalAttributes":null} | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.067Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentOPCUA.Agent | from=n/a | srv=n/a | subsrv=n/a | msg=updateHandler | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.067Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentOPCUA.CommandHandler | from=n/a | srv=n/a | subsrv=n/a | msg=Handling command [{"type":"command","value":[2,2],"metadata":{},"name":"suma"}] for device [Habitacion:001] in service [opcua_car - /demo] | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.067Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.MongoDBDeviceRegister | from=n/a | srv=opcua_car | subsrv=/demo | msg=Looking for device with [{"name":"Habitacion:001","service":"opcua_car","subservice":"/demo","type":"Habitacion"}]. | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.068Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentOPCUA.IOTAUtils | from=n/a | srv=n/a | subsrv=n/a | msg=Getting effective API Key | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.068Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentOPCUA.IOTAUtils | from=n/a | srv=n/a | subsrv=n/a | msg=Using device apikey: iot | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.068Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentOPCUA.CommandHandler | from=n/a | srv=n/a | subsrv=n/a | msg=Sending command execution to device [Habitacion:001] with apikey [iot] and payload [{"suma":[2,2]}]  | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.068Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=n/a | subsrv=n/a | msg=Creating execution for function [executeCommand] and protocol [OPCUA] | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.068Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=n/a | subsrv=n/a | msg=Binding found for function [executeCommand] and protocol [OPCUA] | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.068Z | lvl=INFO | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentOPCUA.OPCUABinding | from=n/a | srv=n/a | subsrv=n/a | msg=Method to call =[{"objectId":"ns=4;i=1","methodId":"ns=4;i=9","inputArguments":[{"dataType":4,"type":"DATO1","value":[2,2],"arrayType":1},{"dataType":4,"type":"DATO2","arrayType":0}]}] | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.068Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.NGSIService | from=n/a | srv=opcua_car | subsrv=/demo | msg=executeWithDeviceInfo entityName Habitacion:001 type Habitacion apikey iot attributes [{"name":"suma_status","type":"commandStatus","value":"PENDING"}] deviceInformation {"_id":"63871217db1baa30467b6156","lazy":[],"active":[{"name":"temperature","type":"Float","object_id":"temperature"},{"name":"pressure","type":"Integer","object_id":"pressure"}],"commands":[{"name":"temperatureCommand","type":"command","object_id":"temperatureCommand"},{"name":"suma","type":"command","object_id":"suma"}],"staticAttributes":[],"subscriptions":[],"creationDate":"2022-11-30T08:19:35.519Z","id":"Habitacion:001","type":"Habitacion","name":"Habitacion:001","service":"opcua_car","subservice":"/demo","registrationId":"638712179c31f6349d5c58eb","internalId":null,"apikey":"iot","endpoint":"opc.tcp://192.168.2.1:4840","explicitAttrs":false,"internalAttributes":null} | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.069Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=n/a | subsrv=n/a | msg=Looking for group params ["type"] with queryObj {"type":"Habitacion"} | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.069Z | lvl=FATAL | corr=n/a | trans=n/a | op=IoTAgentNGSI.Global | from=n/a | srv=n/a | subsrv=n/a | msg=An unexpected exception has been raised. Ignoring: Error: expecting a number NaN
2022-11-30 09:46:53     at coerceVariantType (/opt/iotagent-opcua/node_modules/node-opcua-variant/dist/variant.js:630:23)
2022-11-30 09:46:53     at constructHook (/opt/iotagent-opcua/node_modules/node-opcua-variant/dist/variant.js:375:25)
2022-11-30 09:46:53     at new Variant (/opt/iotagent-opcua/node_modules/node-opcua-variant/dist/variant.js:59:26)
2022-11-30 09:46:53     at BasicTypeSchema._coerceVariant [as coerce] (/opt/iotagent-opcua/node_modules/node-opcua-variant/dist/variant.js:46:66)
2022-11-30 09:46:53     at initialize_field (/opt/iotagent-opcua/node_modules/node-opcua-factory/dist/schema_helpers.js:65:20)
2022-11-30 09:46:53     at initialize_field_array (/opt/iotagent-opcua/node_modules/node-opcua-factory/dist/schema_helpers.js:94:17)
2022-11-30 09:46:53     at new CallMethodRequest (/opt/iotagent-opcua/node_modules/node-opcua-types/dist/_generated_opcua_types.js:4170:79)
2022-11-30 09:46:53     at /opt/iotagent-opcua/node_modules/node-opcua-types/dist/_generated_opcua_types.js:4318:67
2022-11-30 09:46:53     at Array.map (<anonymous>)
2022-11-30 09:46:53     at new CallRequest (/opt/iotagent-opcua/node_modules/node-opcua-types/dist/_generated_opcua_types.js:4318:56)
2022-11-30 09:46:53     at ClientSessionImpl.call (/opt/iotagent-opcua/node_modules/node-opcua-client/dist/private/client_session_impl.js:920:25)
2022-11-30 09:46:53     at /opt/iotagent-opcua/node_modules/thenify/index.js:72:10
2022-11-30 09:46:53     at new Promise (<anonymous>)
2022-11-30 09:46:53     at ClientSessionImpl.call (/opt/iotagent-opcua/node_modules/thenify/index.js:70:12)
2022-11-30 09:46:53     at AsyncFunction.executeCommand (/opt/iotagent-opcua/lib/bindings/OPCUABinding.js:274:17)
2022-11-30 09:46:53     at /opt/iotagent-opcua/node_modules/async/dist/async.js:196:27 | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.070Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=n/a | subsrv=n/a | msg=Device group for fields [["type"]] not found: [{"type":"Habitacion"}] | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.070Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.NGSIService | from=n/a | srv=opcua_car | subsrv=/demo | msg=error {"name":"DEVICE_GROUP_NOT_FOUND","message":"Couldn\t find device group for fields: [\"type\"] and values: {\"type\":\"Habitacion\"}","code":404} in get group device | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.070Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.NGSIUtils | from=n/a | srv=opcua_car | subsrv=/demo | msg=typeInformation {"_id":"63871217db1baa30467b6156","lazy":[],"active":[{"name":"temperature","type":"Float","object_id":"temperature"},{"name":"pressure","type":"Integer","object_id":"pressure"}],"commands":[{"name":"temperatureCommand","type":"command","object_id":"temperatureCommand"},{"name":"suma","type":"command","object_id":"suma"}],"staticAttributes":[],"subscriptions":[],"creationDate":"2022-11-30T08:19:35.519Z","id":"Habitacion:001","type":"Habitacion","name":"Habitacion:001","service":"opcua_car","subservice":"/demo","registrationId":"638712179c31f6349d5c58eb","internalId":null,"apikey":"iot","endpoint":"opc.tcp://192.168.2.1:4840","explicitAttrs":false,"internalAttributes":null} | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.070Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.expressionPlugin | from=n/a | srv=opcua_car | subsrv=/demo | msg=expressionPlugin entity {"suma_status":{"type":"commandStatus","value":"PENDING"},"id":"Habitacion:001","type":"Habitacion"} | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.070Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.MultiEntityPlugin | from=n/a | srv=opcua_car | subsrv=/demo | msg=multiEntityPlugin entity {"suma_status":{"type":"commandStatus","value":"PENDING"},"id":"Habitacion:001","type":"Habitacion"} | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.070Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.Entities-v2 | from=n/a | srv=opcua_car | subsrv=/demo | msg=typeInformation: {"_id":"63871217db1baa30467b6156","lazy":[],"active":[{"name":"temperature","type":"Float","object_id":"temperature"},{"name":"pressure","type":"Integer","object_id":"pressure"}],"commands":[{"name":"temperatureCommand","type":"command","object_id":"temperatureCommand"},{"name":"suma","type":"command","object_id":"suma"}],"staticAttributes":[],"subscriptions":[],"creationDate":"2022-11-30T08:19:35.519Z","id":"Habitacion:001","type":"Habitacion","name":"Habitacion:001","service":"opcua_car","subservice":"/demo","registrationId":"638712179c31f6349d5c58eb","internalId":null,"apikey":"iot","endpoint":"opc.tcp://192.168.2.1:4840","explicitAttrs":false,"internalAttributes":null} | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.070Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.Entities-v2 | from=n/a | srv=opcua_car | subsrv=/demo | msg=Updating device value in the Context Broker at [http://orion:1026/v2/entities/Habitacion:001/attrs?type=Habitacion] | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.070Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.Entities-v2 | from=n/a | srv=opcua_car | subsrv=/demo | msg=Using the following NGSI v2 request:
2022-11-30 09:46:53 
2022-11-30 09:46:53 {
2022-11-30 09:46:53     "url": "http://orion:1026/v2/entities/Habitacion:001/attrs?type=Habitacion",
2022-11-30 09:46:53     "method": "PATCH",
2022-11-30 09:46:53     "headers": {
2022-11-30 09:46:53         "fiware-service": "opcua_car",
2022-11-30 09:46:53         "fiware-servicepath": "/demo"
2022-11-30 09:46:53     },
2022-11-30 09:46:53     "json": {
2022-11-30 09:46:53         "suma_status": {
2022-11-30 09:46:53             "type": "commandStatus",
2022-11-30 09:46:53             "value": "PENDING",
2022-11-30 09:46:53             "metadata": {
2022-11-30 09:46:53                 "TimeInstant": {
2022-11-30 09:46:53                     "type": "DateTime",
2022-11-30 09:46:53                     "value": "2022-11-30T08:46:53.070Z"
2022-11-30 09:46:53                 }
2022-11-30 09:46:53             }
2022-11-30 09:46:53         },
2022-11-30 09:46:53         "TimeInstant": {
2022-11-30 09:46:53             "type": "DateTime",
2022-11-30 09:46:53             "value": "2022-11-30T08:46:53.070Z"
2022-11-30 09:46:53         }
2022-11-30 09:46:53     }
2022-11-30 09:46:53 }
2022-11-30 09:46:53 
2022-11-30 09:46:53  | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.070Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.Request | from=n/a | srv=opcua_car | subsrv=/demo | msg=Options: {
2022-11-30 09:46:53     "url": "http://orion:1026/v2/entities/Habitacion:001/attrs?type=Habitacion",
2022-11-30 09:46:53     "method": "PATCH",
2022-11-30 09:46:53     "headers": {
2022-11-30 09:46:53         "fiware-service": "opcua_car",
2022-11-30 09:46:53         "fiware-servicepath": "/demo"
2022-11-30 09:46:53     },
2022-11-30 09:46:53     "json": {
2022-11-30 09:46:53         "suma_status": {
2022-11-30 09:46:53             "type": "commandStatus",
2022-11-30 09:46:53             "value": "PENDING",
2022-11-30 09:46:53             "metadata": {
2022-11-30 09:46:53                 "TimeInstant": {
2022-11-30 09:46:53                     "type": "DateTime",
2022-11-30 09:46:53                     "value": "2022-11-30T08:46:53.070Z"
2022-11-30 09:46:53                 }
2022-11-30 09:46:53             }
2022-11-30 09:46:53         },
2022-11-30 09:46:53         "TimeInstant": {
2022-11-30 09:46:53             "type": "DateTime",
2022-11-30 09:46:53             "value": "2022-11-30T08:46:53.070Z"
2022-11-30 09:46:53         }
2022-11-30 09:46:53     }
2022-11-30 09:46:53 } | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.074Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.Request | from=n/a | srv=opcua_car | subsrv=/demo | msg=Response "" | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.074Z | lvl=INFO | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.Entities-v2 | from=n/a | srv=opcua_car | subsrv=/demo | msg=Received the following response from the CB: Value updated successfully
2022-11-30 09:46:53  | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.074Z | lvl=DEBUG | corr=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | trans=db0310f6-3ed8-4cd6-b130-2f95f929f2f7 | op=IoTAgentNGSI.ContextServer-v2 | from=n/a | srv=opcua_car | subsrv=/demo | msg=Update action from [iotagent-opcua:4041] handled successfully. | comp=IoTAgent
2022-11-30 09:46:53 time=2022-11-30T08:46:53.074Z | lvl=DEBUG | corr=89a7f2aa-708b-11ed-806f-0242ac160003; cbfwd=1 | trans=203823ff-5b8e-42a0-8f31-7eb867a715bf | op=IoTAgentNGSI.DomainControl | from=n/a | srv=opcua_car | subsrv=/demo | msg=response-time: 12 | comp=IoTAgent
2022-11-30 09:46:54 time=2022-11-30T08:46:54.348Z | lvl=DEBUG | corr=4013beea-9c1a-4969-8ffb-b7974f807b49 | trans=4013beea-9c1a-4969-8ffb-b7974f807b49 | op=IoTAgentNGSI.GenericMiddlewares | from=n/a | srv=n/a | subsrv=n/a | msg=Request for path [/iot/about] from [localhost:4041] | comp=IoTAgent
2022-11-30 09:46:54 time=2022-11-30T08:46:54.348Z | lvl=DEBUG | corr=4013beea-9c1a-4969-8ffb-b7974f807b49 | trans=4013beea-9c1a-4969-8ffb-b7974f807b49 | op=IoTAgentNGSI.DomainControl | from=n/a | srv=n/a | subsrv=n/a | msg=response-time: 0 | comp=IoTAgent
walterwootz commented 1 year ago

Hello @alberto072710, the problem has been fixed with the new version of the agent 2.0.3, so please use image iotagent4fiware/iotagent-opcua:2.0.3 on your docker compose.

If you encounter new problems, please open a new issue.