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.74k stars 844 forks source link

[HELP] How to add a new protocol in the Type drop-down box?? #1530

Open DuXiaoChuang opened 1 month ago

DuXiaoChuang commented 1 month ago

How to add a new protocol in the Type drop-down box?? image

yhliyr commented 1 month ago

perhaps you could try adding a new connector type at gateway-widget.model.ts-ConnectorType and gateway-widget.model.ts-GatewayConnectorDefaultTypesTranslatesMap in the thingsboard platform project

DuXiaoChuang commented 1 month ago

perhaps you could try adding a new connector type at gateway-widget.model.ts-ConnectorType and gateway-widget.model.ts-GatewayConnectorDefaultTypesTranslatesMap in the thingsboard platform project

How to add a new protocol in the Type drop-down box?? image

yhliyr commented 1 month ago

@DuXiaoChuang You can't do this on the web page, you have to modify the Thingsboard project code as i mentioned above, and compile the ui-ngx project and redeploy the whole project. 在页面上是不能手动添加的,只能改代码重新编译项目打包,改动的位置就是上面我提的两个地方,加两行就行了

or maybe you can try using the CUSTOM type, 或许可以试试 CUSTOM 类型,这个可以指定自定义连接器class的,不过我没试过,我也正在搞自定义connector

DuXiaoChuang commented 1 month ago

@DuXiaoChuang You can't do this on the web page, you have to modify the Thingsboard project code as i mentioned above, and compile the ui-ngx project and redeploy the whole project. 在页面上是不能手动添加的,只能改代码重新编译项目打包,改动的位置就是上面我提的两个地方,加两行就行了

or maybe you can try using the CUSTOM type, 或许可以试试 CUSTOM 类型,这个可以指定自定义连接器class的,不过我没试过,我也正在搞自定义connector

我按照你说的加了,没效果啊,下拉框里还是没有新增的协议。很奇怪,是其他哪里还要修改吗?而且目前代码和你的代码有版本上的差异。

DuXiaoChuang commented 1 month ago

@DuXiaoChuang You can't do this on the web page, you have to modify the Thingsboard project code as i mentioned above, and compile the ui-ngx project and redeploy the whole project. 在页面上是不能手动添加的,只能改代码重新编译项目打包,改动的位置就是上面我提的两个地方,加两行就行了

or maybe you can try using the CUSTOM type, 或许可以试试 CUSTOM 类型,这个可以指定自定义连接器class的,不过我没试过,我也正在搞自定义connector

I added the connector and named it with custom, but this TAB still has no data, which is strange.

image image

yhliyr commented 1 month ago

@DuXiaoChuang You can't do this on the web page, you have to modify the Thingsboard project code as i mentioned above, and compile the ui-ngx project and redeploy the whole project. 在页面上是不能手动添加的,只能改代码重新编译项目打包,改动的位置就是上面我提的两个地方,加两行就行了 or maybe you can try using the CUSTOM type, 或许可以试试 CUSTOM 类型,这个可以指定自定义连接器class的,不过我没试过,我也正在搞自定义connector

I added the connector and named it with custom, but this TAB still has no data, which is strange.

image image

it show "focas", the class name is "focas" right? You can add a new ConnectorType here by 'Edit Component' 这里应该就把类名 focas 当作一种类型了,这里编辑部件可以手动添加连接器类型的

DuXiaoChuang commented 1 month ago

@DuXiaoChuang You can't do this on the web page, you have to modify the Thingsboard project code as i mentioned above, and compile the ui-ngx project and redeploy the whole project. 在页面上是不能手动添加的,只能改代码重新编译项目打包,改动的位置就是上面我提的两个地方,加两行就行了 or maybe you can try using the CUSTOM type, 或许可以试试 CUSTOM 类型,这个可以指定自定义连接器class的,不过我没试过,我也正在搞自定义connector

I added the connector and named it with custom, but this TAB still has no data, which is strange. image image

it show "focas", the class name is "focas" right? You can add a new ConnectorType here by 'Edit Component' 这里应该就把类名 focas 当作一种类型了,这里编辑部件可以手动添加连接器类型的

ok, thanks