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.76k stars 846 forks source link

custom rpc execution #1552

Closed khalilKian closed 1 month ago

khalilKian commented 1 month ago

Hello,

I’d like to contribute to the custom RPC importing functionality for the gateway.

For a long time, I've wanted to enhance the gateway by adding more RPC methods that can be used for local network hardware communication or third-party integration, without exposing the rpcRemoteShell feature. This will provide a secure and controlled way to manage the gateway remotely.

Additionally, I’ve included some minor fixes related to the generation of the .deb package.

CLAassistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.

khalilKian commented 1 month ago

guide: you need to create a file inside /etc/thingsboard-gateway/rpc/{filename}.py ( optional )

filename.py def __rpc_hello(self,*args): log.debug("hello RPC request received with arguments %s", args) return {"code": 200, "resp": "world", "action": self.version , "args" : arg[0]}