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
I can get attributes value and timeseries value,but when I test rpc method, gateway report error.
I use swagger api /rpc/twoway/{deviceId} to test rpc method.
Here is my params:
{ "method": "AddRole", "params": { "InputArguments":"wrath" }, "persistent": false, "timeout": 5000 }
error:
""2023-05-12 10:52:55" - |ERROR| - [opcua_connector.py] - opcua_connector - server_side_rpc_handler - 300 - 'dict'"
Traceback (most recent call last):
File "/home/wrath/workdir/chentangguan/thingsboard_gateway/connectors/opcua/opcua_connector.py", line 288, in server_side_rpc_handler
result = method["node"].call_method(method[rpc_method], arguments)
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/common/node.py", line 685, in call_method
return opcua.common.methods.call_method(self, methodid, *args)
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/common/methods.py", line 17, in call_method
result = call_method_full(parent, methodid, *args)
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/common/methods.py", line 40, in call_method_full
result = _call_method(parent.server, parent.nodeid, methodid, to_variant(*args))
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/common/methods.py", line 51, in _call_method
results = server.call(methodstocall)
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/client/ua_client.py", line 602, in call
data = self._uasocket.send_request(request)
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/client/ua_client.py", line 81, in send_request
future = self._send_request(request, callback, timeout, message_type)
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/client/ua_client.py", line 55, in _send_request
binreq = struct_to_binary(request)
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/ua/ua_binary.py", line 261, in struct_to_binary
packet.append(to_binary(uatype, val))
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/ua/ua_binary.py", line 284, in to_binary
return struct_to_binary(val)
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/ua/ua_binary.py", line 256, in struct_to_binary
packet.append(list_to_binary(uatype[6:], val))
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/ua/ua_binary.py", line 296, in list_to_binary
pack = [to_binary(uatype, el) for el in val]
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/ua/ua_binary.py", line 296, in <listcomp>
pack = [to_binary(uatype, el) for el in val]
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/ua/ua_binary.py", line 284, in to_binary
return struct_to_binary(val)
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/ua/ua_binary.py", line 256, in struct_to_binary
packet.append(list_to_binary(uatype[6:], val))
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/ua/ua_binary.py", line 296, in list_to_binary
pack = [to_binary(uatype, el) for el in val]
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/ua/ua_binary.py", line 296, in <listcomp>
pack = [to_binary(uatype, el) for el in val]
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/ua/ua_binary.py", line 274, in to_binary
return pack_uatype(vtype, val)
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/ua/ua_binary.py", line 192, in pack_uatype
return variant_to_binary(value)
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/ua/ua_binary.py", line 378, in variant_to_binary
b.append(pack_uatype(var.VariantType, var.Value))
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/ua/ua_binary.py", line 188, in pack_uatype
return extensionobject_to_binary(value)
File "/home/wrath/workdir/chentangguan/venv/lib/python3.8/site-packages/opcua/ua/ua_binary.py", line 458, in extensionobject_to_binary
TypeId = ua.extension_object_ids[obj.__class__.__name__]
KeyError: 'dict'
I use "Prosys OPC UA Simulation Server" to simulation my opcua data;
here is part of my opcua.json.
I can get attributes value and timeseries value,but when I test rpc method, gateway report error.
I use swagger api
/rpc/twoway/{deviceId}
to test rpc method. Here is my params:{ "method": "AddRole", "params": { "InputArguments":"wrath" }, "persistent": false, "timeout": 5000 }
error:
where should I set dict key?