thingsboard / thingsboard-gateway

Open-source IoT Gateway - integrates devices connected to legacy and third-party systems with ThingsBoard IoT Platform using Modbus, CAN bus, BACnet, BLE, OPC-UA, MQTT, ODBC and REST protocols
https://thingsboard.io/docs/iot-gateway/what-is-iot-gateway/
Apache License 2.0
1.72k stars 828 forks source link

The gateway connects opuca server to fail:UnrecognizedPropertyException: Unrecognized field "fileName" #65

Closed BIT-masterpy closed 6 years ago

BIT-masterpy commented 6 years ago

Hello! I have gateway and thingsboard on version 1.4.0, both installed on same computer. I tried to use the gateway to connect to OpenOpcUa server with the following error.

`14:23:33.806 [pool-3-thread-1] INFO o.t.g.service.TenantServiceRegistry - [Tenant] Updating extension configuration

14:23:33.885 [pool-3-thread-1] INFO o.t.g.service.TenantServiceRegistry - Initializing extension: [opc][OPC UA]

14:23:33.891 [pool-3-thread-1] INFO o.t.g.e.opc.DefaultOpcUaService - Initializing OPC-UA service! 14:23:33.975 [pool-3-thread-1] ERROR o.t.gateway.util.ConfigurationTools - Failed to load class org.thingsboard.gateway.extensions.opc.conf.OpcUaConfiguration configuration from {"servers":[{"applicationName":"Thingsboard OPC-UA client","applicationUri":"","host":"localhost","port":23562,"scanPeriodInSeconds":10,"timeoutInMillis":5000,"security":"Basic128Rsa15","identity":{"type":"anonymous"},"keystore":{"type":"PKCS12","location":"example.pfx","password":"secret","alias":"gateway","keyPassword":"secret","fileName":"example.pfx", "file":"MIIKIgIBAzCCCdwGCSqGSIb3DQEHAaCCCc0EggnJMIIJxTCCBWoGCSqGSIb3DQEHAaCCBVsEggVXMIIFUzCCBU8GCyqGSIb3DQEMCgECoIIE+jCCBPYwKAYKKoZIhvcNAQwBAzAaBBTBjlJoN3UVdEU9BnUHdWaUob11AwICBAAEggTIZ3WuZbOvZDX8zjfZuTw0fReCq6UNbKwXI6MNfJiI44eer4kK8Rz6Uqre0sN0eIE51J1SJL2+VzrfJkYBLc2uQMYYOJvUycZeXLltX2G2mKlw0jqGO/o3fVOyE9YD0BQ5kWLUEf+/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kycYMhY7ckkoZ92NUPELV190LAlz3IOoTx9C4yeyHYbC/Y0nzZs5FQvkajuzAU4EsI+Te3iFh1kohC0Ulk4SQKCPq+Ob/dvModO9l61R8yCHDxsZeFACaCCsH7RQJRxeV1LUVHoiX1aJVuE01bj3jEBQN+ZI1A8qNdbCI+/q1o/GMVKQxtz5PY02A8VIa1cMGUwY5ljJJlTdRzPqiy3qP5ClbHKsbWucUECKfhAkqTuS0Uqm+h3Y6IN6yYxYqjbKEIuqgwbGiOJZzu82nVG51QpBtvMf1eDyOSOkQ2JZey+vXlOghavQl8aFluv5FHigw9Zk9yVZf8Z8Jk1ruVvFzlB1NXnn2YqKtKhYb+J/dqVhKiToDMQccYY7Hw8HSBXRzl345EVLxyjCngyAU6VjztqjCW6HYNjNggyUVYmDQ49XOsq6U/7QhzBEbhYo48f7qvPVetRxShSjXt5Jnc+5mJG7UXHAhBSUayFv5T5CUmKlhbcuKyzX0Euib6WgajPdKcgib4bUpAD7L1Y2cEYorWE/yASnY06ZNabRAcyRSQnkZecZ0X95GTUmX08oOblskmQlBzQunjQSRvdpLBCu1356NwYZ8CJ/bqMp1g25FBKXCStKoDuluD1PT9Trd7Dv+f65EPvKTt6S90h/EscPV3D1sx+foPf6kdPl3LfX7/o4H2b01yErbTDCYcew0qkoRLpqHJr8GAyTjW6478sgqxCDbW1R0dpGiJkCHyqEQd8g/b9zu+4Pab4Y1O5lIKhhnnVWfajdWmY1NJk7hvpJwpkydRTuic/JhMnmUafuoGW5ZLxfjyejZnH4z8SIxVXJeljHuOgp0wMxGiXbq+dcj2t5o9F3AMJ5lwfS5mzhvNIieGdOjGiyORx/HuAXwLOxg/6IhhP1usbZ1NXYyrPEMiN3icg0i8juDnvsiMD0wITAJBgUrDgMCGgUABBTQs2HzR+FLxtn2YexYPyg+nzXREAQUj8/6NHfuC4w2C2cblAttX3rFlzcCAgQA"},

"mapping":[{"deviceNodePattern":"Channel1\.Device\d+$","deviceNamePattern":"Device ${_System._DeviceId}","attributes":[{"key":"Tag1","type":"string","value":"${Tag1}"}],"timeseries":[{"key":"Tag2","type":"long","value":"${Tag2}"}]}]}]}

14:23:33.980 [pool-3-thread-1] ERROR o.t.g.e.opc.DefaultOpcUaService - OPC-UA service configuration failed! com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "fileName" (class org.thingsboard.gateway.util.KeystoreConfiguration), not marked as ignorable (6 known properties: "alias", "location", "type", "password", "fileContent", "keyPassword"]) at [Source: N/A; line: -1, column: -1] (through reference chain: org.thingsboard.gateway.extensions.opc.conf.OpcUaConfiguration["servers"]->java.util.ArrayList[0]->org.thingsboard.gateway.extensions.opc.conf.OpcUaServerConfiguration["keystore"]->org.thingsboard.gateway.util.KeystoreConfiguration["fileName"]) at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:62) at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:834) at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1093) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1477) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1455) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:282) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:140) at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:499) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:101) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:276) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:140) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:287) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:259) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26) at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:499) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:101) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:276) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:140) at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3770) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2099) at com.fasterxml.jackson.databind.ObjectMapper.treeToValue(ObjectMapper.java:2596) at org.thingsboard.gateway.util.ConfigurationTools.readConfiguration(ConfigurationTools.java:39) at org.thingsboard.gateway.extensions.opc.DefaultOpcUaService.init(DefaultOpcUaService.java:54) at org.thingsboard.gateway.service.TenantServiceRegistry.updateExtensionConfiguration(TenantServiceRegistry.java:81) at org.thingsboard.gateway.service.DefaultTenantManagerService.lambda$init$0(DefaultTenantManagerService.java:64) at org.thingsboard.gateway.service.gateway.MqttHandlerImpl.updateConfiguration(MqttHandlerImpl.java:164) at org.thingsboard.gateway.service.gateway.MqttHandlerImpl.onGatewayAttributesGet(MqttHandlerImpl.java:145) at org.thingsboard.gateway.service.gateway.MqttHandlerImpl.lambda$onMessage$0(MqttHandlerImpl.java:88) at java.util.concurrent.Executors$RunnableAdapter.call$$$capture(Executors.java:511) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java) at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) 14:23:33.985 [pool-3-thread-1] INFO o.t.g.service.TenantServiceRegistry - Failed to read configuration attribute com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "fileName" (class org.thingsboard.gateway.util.KeystoreConfiguration), not marked as ignorable (6 known properties: "alias", "location", "type", "password", "fileContent", "keyPassword"]) at [Source: N/A; line: -1, column: -1] (through reference chain: org.thingsboard.gateway.extensions.opc.conf.OpcUaConfiguration["servers"]->java.util.ArrayList[0]->org.thingsboard.gateway.extensions.opc.conf.OpcUaServerConfiguration["keystore"]->org.thingsboard.gateway.util.KeystoreConfiguration["fileName"]) at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:62) at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:834) at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1093) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1477) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1455) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:282) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:140) at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:499) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:101) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:276) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:140) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:287) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:259) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26) at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:499) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:101) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:276) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:140) at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3770) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2099) at com.fasterxml.jackson.databind.ObjectMapper.treeToValue(ObjectMapper.java:2596) at org.thingsboard.gateway.util.ConfigurationTools.readConfiguration(ConfigurationTools.java:39) at org.thingsboard.gateway.extensions.opc.DefaultOpcUaService.init(DefaultOpcUaService.java:54) at org.thingsboard.gateway.service.TenantServiceRegistry.updateExtensionConfiguration(TenantServiceRegistry.java:81) at org.thingsboard.gateway.service.DefaultTenantManagerService.lambda$init$0(DefaultTenantManagerService.java:64) at org.thingsboard.gateway.service.gateway.MqttHandlerImpl.updateConfiguration(MqttHandlerImpl.java:164) at org.thingsboard.gateway.service.gateway.MqttHandlerImpl.onGatewayAttributesGet(MqttHandlerImpl.java:145) at org.thingsboard.gateway.service.gateway.MqttHandlerImpl.lambda$onMessage$0(MqttHandlerImpl.java:88) at java.util.concurrent.Executors$RunnableAdapter.call$$$capture(Executors.java:511) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java) at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) 14:23:33.989 [pool-3-thread-1] WARN o.t.g.s.gateway.MqttHandlerImpl - Failed to update extension configurations [[]] java.lang.RuntimeException: Failed to update configuration at org.thingsboard.gateway.service.TenantServiceRegistry.updateExtensionConfiguration(TenantServiceRegistry.java:97) at org.thingsboard.gateway.service.DefaultTenantManagerService.lambda$init$0(DefaultTenantManagerService.java:64) at org.thingsboard.gateway.service.gateway.MqttHandlerImpl.updateConfiguration(MqttHandlerImpl.java:164) at org.thingsboard.gateway.service.gateway.MqttHandlerImpl.onGatewayAttributesGet(MqttHandlerImpl.java:145) at org.thingsboard.gateway.service.gateway.MqttHandlerImpl.lambda$onMessage$0(MqttHandlerImpl.java:88) at java.util.concurrent.Executors$RunnableAdapter.call$$$capture(Executors.java:511) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java) at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "fileName" (class org.thingsboard.gateway.util.KeystoreConfiguration), not marked as ignorable (6 known properties: "alias", "location", "type", "password", "fileContent", "keyPassword"]) at [Source: N/A; line: -1, column: -1] (through reference chain: org.thingsboard.gateway.extensions.opc.conf.OpcUaConfiguration["servers"]->java.util.ArrayList[0]->org.thingsboard.gateway.extensions.opc.conf.OpcUaServerConfiguration["keystore"]->org.thingsboard.gateway.util.KeystoreConfiguration["fileName"]) at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:62) at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:834) at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1093) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1477) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1455) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:282) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:140) at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:499) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:101) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:276) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:140) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:287) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:259) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26) at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:499) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:101) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:276) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:140) at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3770) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2099) at com.fasterxml.jackson.databind.ObjectMapper.treeToValue(ObjectMapper.java:2596) at org.thingsboard.gateway.util.ConfigurationTools.readConfiguration(ConfigurationTools.java:39) at org.thingsboard.gateway.extensions.opc.DefaultOpcUaService.init(DefaultOpcUaService.java:54) at org.thingsboard.gateway.service.TenantServiceRegistry.updateExtensionConfiguration(TenantServiceRegistry.java:81) ... 11 common frames omitted`

BIT-masterpy commented 6 years ago

tb-gateway.yml

2018-04-17_145601

opc-config.json 2018-04-17_145629

mp-loki commented 6 years ago

You are using remoteConfiguration: true which means that opc-config.json is ignored and the configuration that is provided in GUI (On the Devices -> Gateway -> Extensions tab) will be used instead. The problem is that ThingsBoard v1.4.0 Has a software issue in OPC-UA Extension configuration GUI, which was fixed in master branch and will be available in v1.4.1. So as a workaround I recommend you to either stick to remoteConfiguration: false or build ThingsBoard 1.4.1-SNAPSHOT from source

BIT-masterpy commented 6 years ago

@mp-loki Thank you.I reconfigured the file, but it was still wrong, and I couldn't connect the third-party opc-ua server.Is IOT-gateway only developed for KEPServerEX?Not compatible with other opc-ua servers?

`22:56:34.805 [nioEventLoopGroup-2-1] WARN i.n.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception. java.lang.NullPointerException: null at nl.jk5.mqtt.MqttPingHandler.channelRead(MqttPingHandler.java:34) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:297) at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:350) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1414) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:945) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:146) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:748) 22:56:34.941 [main] INFO o.t.g.e.opc.OpcUaServerMonitor - Initializing OPC-UA server connection to [D-ZHANGCHENG:12686]! 22:56:35.566 [main] ERROR o.t.gateway.util.ConfigurationTools - Keystore configuration: [KeystoreConfiguration(type=PKCS12, location=example.pfx, fileContent=, password=secret, alias=gateway, keyPassword=password)] is invalid! java.security.UnrecoverableKeyException: Get Key failed: Given final block not properly padded

Caused by: javax.crypto.BadPaddingException: Given final block not properly padded`

mp-loki commented 6 years ago

Change keyPassword to secret

BIT-masterpy commented 6 years ago

@mp-loki opc-config.json: opc

tb-gateway.yml: tbyml opc-ua server log: milo Address space: client pan1 pan2

Opc-ua server milo has been successfully connected with gateway, But there's no telemetry on the Thingsboard!

mp-loki commented 6 years ago

That's because you still have the mapping from KepServer example. Assuming that "Dynamic" is the device that you are looking for, set deviceNodePattern to match your path:

deviceNodePattern: "Objects\\.HelloWorld\\.Dynamic"

and then change attributes or telemetry to retrieve the tags that you want, e.g.

telemetry: [
  {
     "key": "Double Val",
     "type":"double",
     "value":"${Double}" 
  }
]

Note that "value":"${Double}" must correspond to a tag name on the server

BIT-masterpy commented 6 years ago

661 There is no error reporting. But there's no telemetry on the Thingsboard

BIT-masterpy commented 6 years ago

@mp-loki What's wrong with my configuration?The panel has no telemetry data. opc-config.json

99

client

BIT-masterpy commented 6 years ago

Thingsboard log: 100

BIT-masterpy commented 6 years ago

@mp-loki What might be the problem?

xkdguolei commented 5 years ago

@ mp-loki I tried to use the gateway to connect to OpenOpcUa server with the following error tb-gateway v2.1.1 thingsboard-windows-2.1.3

server:

Server bind address

address: "0.0.0.0"

Server bind port

port: "9090"

Check new version updates parameters

updates:

Enable/disable updates checking.

enabled: "${UPDATES_ENABLED:true}"

gateways: tenants:

  label: "Tenant"
  reporting:
    interval: 60000
  persistence:
    type: file
    path: storage
    bufferSize: 1000
  connection:
    host: "${GATEWAY_HOST:192.168.1.150}"
    port: 1883
    retryInterval: 3000
    maxInFlight: 1000
    security:
      accessToken: "${GATEWAY_ACCESS_TOKEN:dHRdHsT58CBDJy9OXBip}"
  remoteConfiguration: true
  extensions:
    -
      id: "opc-ua"
      type: "OPC UA"
      extensionConfiguration: opc-config.json

[{"id":"opc","type":"OPC UA","configuration":{"servers":[{"applicationName":"Thingsboard OPC-UA client","applicationUri":"","host":"localhost","port":49320,"scanPeriodInSeconds":10,"timeoutInMillis":5000,"security":"Basic128Rsa15","identity":{"type":"anonymous"},"keystore":{"type":"PKCS12","location":"example.pfx","password":"secret","alias":"gateway","keyPassword":"secret"},"mapping":[{"deviceNodePattern":"Channel1\.Device\d+$","deviceNamePattern":"Device ${_System._DeviceId}","attributes":[{"key":"Tag1","type":"string","value":"${Tag1}"}],"timeseries":[{"key":"Tag2","type":"long","value":"${Tag2}"}]}]}]}}]

OPC SERVER image

image

image image

mp-loki commented 5 years ago

@xkdguolei What was the error though? Try changing remoteConfiguration to 'false'

xkdguolei commented 5 years ago

@ mp-loki image image image image image

There is no error reporting. But there's no telemetry on the Thingsboard

mp-loki commented 5 years ago

Ok, please disregard my previous comment. Please provide your tb-gateway.log file. I also suggest you to create a new issue for this

mp-loki commented 5 years ago

can you please set log level to DEBUG and show your log again?

xkdguolei commented 5 years ago

@ mp-loki 2018-11-21 11:08:33,978 [main] INFO o.t.g.s.DefaultTenantManagerService - [Tenant] Initializing gateway 2018-11-21 11:08:35,464 [pool-1-thread-1] INFO o.t.g.s.gateway.MqttGatewayService - Configuration arrived! {"shared":{"configuration":"[{\"id\":\"opc\",\"type\":\"OPC UA\",\"configuration\":{\"servers\":[{\"applicationName\":\"Thingsboard OPC-UA client\",\"applicationUri\":\"opc.tcp://192.168.1.98:49320\",\"host\":\"192.168.1.98\",\"port\":49320,\"scanPeriodInSeconds\":10,\"timeoutInMillis\":5000,\"security\":\"None\",\"identity\":{\"type\":\"anonymous\"},\"keystore\":{\"type\":\"PKCS12\",\"location\":\"example.pfx\",\"password\":\"secret\",\"alias\":\"gateway\",\"keyPassword\":\"secret\"},\"mapping\":[{\"deviceNodePattern\":\"Channel1\\.Device\\d+$\",\"deviceNamePattern\":\"Device ${_System._DeviceId}\",\"attributes\":[{\"key\":\"Tag1\",\"type\":\"string\",\"value\":\"${Tag1}\"}],\"timeseries\":[{\"key\":\"Tag2\",\"type\":\"long\",\"value\":\"${Tag2}\"}]}]}]}}]"}} 2018-11-21 11:08:35,537 [pool-1-thread-1] INFO o.t.g.service.TenantServiceRegistry - [Tenant] Updating extension configuration 2018-11-21 11:08:35,655 [pool-1-thread-1] INFO o.t.g.service.TenantServiceRegistry - Initializing extension: [opc][OPC UA] 2018-11-21 11:08:35,733 [pool-1-thread-1] INFO o.t.g.e.opc.DefaultOpcUaService - Initializing OPC-UA service! 2018-11-21 11:08:35,874 [pool-1-thread-1] INFO o.t.g.e.opc.OpcUaServerMonitor - Initializing OPC-UA server connection to [192.168.1.98:49320]! 2018-11-21 11:08:36,577 [pool-3-thread-1] INFO o.t.g.s.gateway.MqttGatewayService - Gateway statistics {"ts":1542769715376,"values":{"devicesOnline":0,"attributesUploaded":0,"telemetryUploaded":0}} reported! 2018-11-21 11:08:36,628 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@28864e92: startup date [Wed Nov 21 11:08:28 CST 2018]; root of context hierarchy 2018-11-21 11:08:36,928 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/sigfox/{deviceTypeId}],methods=[POST]}" onto public void org.thingsboard.gateway.extensions.http.HttpController.handleSigfoxRequest(java.lang.String,java.lang.String,java.lang.String) throws java.lang.Exception 2018-11-21 11:08:36,936 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/uplink/{converterId}],methods=[POST]}" onto public void org.thingsboard.gateway.extensions.http.HttpController.handleRequest(java.lang.String,java.lang.String) throws java.lang.Exception 2018-11-21 11:08:36,959 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest) 2018-11-21 11:08:36,960 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) 2018-11-21 11:08:37,082 [main] INFO o.s.w.s.h.SimpleUrlHandlerMapping - Mapped URL path [/webjars/] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2018-11-21 11:08:37,082 [main] INFO o.s.w.s.h.SimpleUrlHandlerMapping - Mapped URL path [/] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2018-11-21 11:08:37,211 [main] INFO o.s.w.s.h.SimpleUrlHandlerMapping - Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2018-11-21 11:08:37,900 [main] INFO o.s.s.c.ThreadPoolTaskScheduler - Initializing ExecutorService 'taskScheduler' 2018-11-21 11:08:38,571 [main] INFO o.s.j.e.a.AnnotationMBeanExporter - Registering beans for JMX exposure on startup 2018-11-21 11:08:38,600 [main] INFO o.s.j.e.a.AnnotationMBeanExporter - Bean with name 'integrationMbeanExporter' has been autodetected for JMX exposure 2018-11-21 11:08:38,610 [main] INFO o.s.j.e.a.AnnotationMBeanExporter - Located managed bean 'integrationMbeanExporter': registering with JMX server as MBean [org.springframework.integration.monitor:name=integrationMbeanExporter,type=IntegrationMBeanExporter] 2018-11-21 11:08:38,816 [main] INFO o.s.i.m.IntegrationMBeanExporter - Registering beans for JMX exposure on startup 2018-11-21 11:08:38,819 [main] INFO o.s.i.m.IntegrationMBeanExporter - Registering MessageChannel nullChannel 2018-11-21 11:08:38,826 [main] INFO o.s.i.m.IntegrationMBeanExporter - Located managed bean 'org.springframework.integration:type=MessageChannel,name=nullChannel': registering with JMX server as MBean [org.springframework.integration:type=MessageChannel,name=nullChannel] 2018-11-21 11:08:39,187 [main] INFO o.s.i.m.IntegrationMBeanExporter - Registering MessageChannel errorChannel 2018-11-21 11:08:39,188 [main] INFO o.s.i.m.IntegrationMBeanExporter - Located managed bean 'org.springframework.integration:type=MessageChannel,name=errorChannel': registering with JMX server as MBean [org.springframework.integration:type=MessageChannel,name=errorChannel] 2018-11-21 11:08:39,301 [main] INFO o.s.i.m.IntegrationMBeanExporter - Registering MessageHandler errorLogger 2018-11-21 11:08:39,302 [main] INFO o.s.i.m.IntegrationMBeanExporter - Located managed bean 'org.springframework.integration:type=MessageHandler,name=errorLogger,bean=internal': registering with JMX server as MBean [org.springframework.integration:type=MessageHandler,name=errorLogger,bean=internal] 2018-11-21 11:08:39,366 [main] INFO o.s.c.s.DefaultLifecycleProcessor - Starting beans in phase 0 2018-11-21 11:08:39,366 [main] INFO o.s.i.endpoint.EventDrivenConsumer - Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel 2018-11-21 11:08:39,367 [main] INFO o.s.i.c.PublishSubscribeChannel - Channel 'tb-gateway:9090.errorChannel' has 1 subscriber(s). 2018-11-21 11:08:39,367 [main] INFO o.s.i.endpoint.EventDrivenConsumer - started _org.springframework.integration.errorLogger 2018-11-21 11:08:39,415 [main] INFO o.a.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-0.0.0.0-9090"] 2018-11-21 11:08:39,472 [main] INFO o.a.coyote.http11.Http11NioProtocol - Starting ProtocolHandler [http-nio-0.0.0.0-9090] 2018-11-21 11:08:39,473 [main] INFO o.a.tomcat.util.net.NioSelectorPool - Using a shared selector for servlet write/read 2018-11-21 11:08:39,585 [main] INFO o.s.b.c.e.t.TomcatEmbeddedServletContainer - Tomcat started on port(s): 9090 (http) 2018-11-21 11:08:39,598 [main] INFO o.t.gateway.GatewayApplication - Started GatewayApplication in 13.252 seconds (JVM running for 14.967) 2018-11-21 11:08:40,933 [pool-1-thread-1] INFO o.t.g.e.opc.OpcUaServerMonitor - Device scan cycle completed in 1034 ms 2018-11-21 11:08:40,942 [pool-1-thread-1] INFO o.t.g.e.opc.OpcUaServerMonitor - Scheduling next scan in 10 seconds! 2018-11-21 11:08:41,405 [pool-3-thread-1] INFO o.t.g.s.gateway.MqttGatewayService - Reported status [Initialized] of extension [opc] 2018-11-21 11:08:51,497 [pool-6-thread-1] INFO o.t.g.e.opc.OpcUaServerMonitor - Device scan cycle completed in 553 ms 2018-11-21 11:08:51,497 [pool-6-thread-1] INFO o.t.g.e.opc.OpcUaServerMonitor - Scheduling next scan in 10 seconds! 2018-11-21 11:09:01,918 [pool-6-thread-1] INFO o.t.g.e.opc.OpcUaServerMonitor - Device scan cycle completed in 419 ms 2018-11-21 11:09:01,918 [pool-6-thread-1] INFO o.t.g.e.opc.OpcUaServerMonitor - Scheduling next scan in 10 seconds! 2018-11-21 11:09:12,340 [pool-6-thread-1] INFO o.t.g.e.opc.OpcUaServerMonitor - Device scan cycle completed in 421 ms 2018-11-21 11:09:12,341 [pool-6-thread-1] INFO o.t.g.e.opc.OpcUaServerMonitor - Scheduling next scan in 10 seconds! 2018-11-21 11:09:22,802 [pool-6-thread-1] INFO o.t.g.e.opc.OpcUaServerMonitor - Device scan cycle completed in 459 ms 2018-11-21 11:09:22,802 [pool-6-thread-1] INFO o.t.g.e.opc.OpcUaServerMonitor - Scheduling next scan in 10 seconds! 2018-11-21 11:09:33,268 [pool-6-thread-1] INFO o.t.g.e.opc.OpcUaServerMonitor - Device scan cycle completed in 465 ms 2018-11-21 11:09:33,268 [pool-6-thread-1] INFO o.t.g.e.opc.OpcUaServerMonitor - Scheduling next scan in 10 seconds! 2018-11-21 11:09:35,417 [pool-3-thread-1] INFO o.t.g.s.gateway.MqttGatewayService - Gateway statistics {"ts":1542769775377,"values":{"devicesOnline":0,"attributesUploaded":0,"telemetryUploaded":0}} reported! 2