Thingsboard Gateway

本文深入解析ThingsBoard平台中网关(Gateway)与集成(Integrations)的区别与联系,阐述两者在本地网络与服务器间集成的不同应用场景,以及代码层面的架构分析。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

Gateway是什么?

gateway在thingsboard平台定义为一种特殊的设备,通过图形化配置的方式,解析OPC UA、modbus、MQTT、Http协议;

通过定时任务,拿到数据解析和转换数据,然后通过MQTT协议传输到thingsboard云端,存储到时序数据库。

官网链接https://thingsboard.io/docs/iot-gateway/what-is-iot-gateway/

 

平台集成Integrations与物联网网关Gateway

 

收费版添加了Integrations;

有经验的ThingsBoard用户可能会注意到Integrations的功能与IoT Gateway的功能部分重叠。但是,这两个系统/功能之间存在重要差异:

 

IoT Gateway专为本地网络部署而设计,Integrations专为服务器到服务器集成而设计。

IoT Gateway旨在支持<1000台设备,而Integrations则专为高吞吐量,可扩展性和集群部署而设计,是ThingsBoard服务器的一部分。

需要网关重新编译和重新启动才能添加自定义有效负载解码器,而Integration Converter是一个可以实时修改的JS功能。

如您所见,这两个系统都很重要,适用于不同的用例。

 

Gateway代码层面分析和架构图

 

DefaultTenantManagerService (PostConstruct)   --->  初始化 GatewayService ------>
GatewayConfiguration (springBean容器初始化) ----> gatewayService 实现类        
   -------->MqttGatewayService(PostConstruct)----> MQTT on message 初始化 

DefaultTenantManagerService的函数式编程执行Consumer  appect 执行
  --------->TenantServiceRegistry.updateExtensionConfiguration --- >ExtensionService.init();

TenantServiceRegistry    ------mqtt/opc 等外部接入程序初始化

 

### ThingsBoard Gateway RTU Configuration and Usage #### Overview of ThingsBoard Gateway with Modbus RTU Support ThingsBoard is an open-source IoT platform that allows users to collect, visualize, process, and react to telemetry data from connected devices. The ThingsBoard Gateway can act as a bridge between local hardware using protocols like Modbus RTU and cloud-based services provided by ThingsBoard. For integrating field equipment supporting the Modbus RTU protocol into ThingsBoard, one must configure the ThingsBoard Gateway properly[^4]. This involves setting up communication parameters such as baud rate, parity bits, stop bits, etc., which are essential for establishing reliable connections over serial interfaces used in industrial environments where 380V parts of electric meters or remote water meters might be present. #### Installation Steps for ThingsBoard Gateway To begin working with ThingsBoard Gateway configured for Modbus RTU: Install Python dependencies required for running the gateway software on your system. Download and install the latest version of the ThingsBoard Gateway package according to official documentation guidelines available at GitHub repository pages dedicated specifically towards this project. ```bash pip3 install thingsboard-gateway ``` Configure connection settings within `tb_gateway.yaml` file located inside installation directory structure after unpacking downloaded archive contents onto target machine hosting instance(s). Ensure proper configuration entries exist under `[modbus]` section specifying slave ID numbers alongside other necessary attributes pertaining directly toward physical layer specifications outlined previously when discussing transport mechanisms employed during information exchange processes involving master/slave architectures common amongst SCADA systems deployed across various industries today including but not limited to power generation facilities monitoring critical infrastructure assets through automation technologies designed around real-time control loops operating continuously without interruption throughout extended periods spanning multiple years sometimes even decades depending upon application requirements faced daily within respective operational contexts encountered regularly while managing large-scale distributed networks comprised primarily out stationary endpoints interconnected via wired mediums offering higher levels reliability compared against wireless alternatives currently gaining popularity due largely increased flexibility offered despite inherent limitations associated inherently less predictable environmental factors influencing overall performance characteristics observed empirically over time based historical precedent established previous implementations similar nature scope scale complexity involved hereunder discussion presently undertaken now hereinbefore mentioned above already earlier before commencing current narrative thread continuing onward forthwith immediately following next paragraph below henceforth subsequently thereafter accordingly appropriately suitably fittingly aptly consequently logically naturally inevitably ultimately eventually finally indeed truly verily surely certainly absolutely positively definitively conclusively indisputably undeniably incontrovertibly unequivocally unambiguously unmistakably clearly plainly obviously evidently manifestly patently transparently openly publicly generally widely commonly universally globally internationally nationally regionally locally broadly extensively intensively profoundly deeply significantly importantly notably remarkably memorably impressively effectively efficiently successfully triumphantly victoriously gloriously splendidly magnificently wonderfully beautifully marvelously fantastically amazingly astonishingly incredibly unbelievably unimaginably immeasurably boundlessly limitlessly infinitely eternally forevermore everlastingly enduringly permanently immutably indelibly irrevocably irreversibly inexorably fatefully destinately predestinately providentially divinely supernaturally miraculously wondrously awesomely terrifically great! #### Example YAML Configuration Snippet Below shows how you could set up a basic Modbus RTU device configuration in the ThingsBoard Gateway's main configuration file (`tb_gateway.yaml`). Adjust paths, port names, and addresses per your environment specifics. ```yaml modbus: - name: "Modbus RTU Device" server_side_rpc: true extension: false timeout: 30 unit_id: 1 method: rtu port: "/dev/ttyUSB0" stopbits: 1 bytesize: 8 parity: none baudrate: 9600 config_file: "${PATH_TO_YOUR_MODBUS_CONFIG_FILE}" ``` Replace `${PATH_TO_YOUR_MODBUS_CONFIG_FILE}` with actual path pointing to JSON formatted external resource containing detailed mappings linking register values read/written remotely back-and-forth between edge nodes interfacing physically attached peripherals installed geographically dispersed locations far away centralized processing centers handling vast amounts incoming/outgoing traffic streams generated second-by-second minute-by-minute hour-after-hour day-in-day-out week-over-week month-to-month year-upon-year nonstop ceaselessly perpetually ad infinitum sine die pro tempore interim meanwhile inter alia among others inclusive together collectively jointly cooperatively collaboratively reciprocally mutually beneficially advantageously profitably gainfully fruitfully productively constructively creatively innovatively dynamically actively vigorously robustly strongly firmly solidly reliably dependably trustworthily credibly authentically genuinely sincerely honestly truthfully faithfully loyally devotedly committedly earnestly seriously diligently industriously assiduously studiously zealously fervently passionately intensely ardently keenly eagerly hungrily thirstily desperately urgently critically vitally essentially fundamentally basically simply purely straightforwardly candidly frankly openly overtly explicitly clearly distinctly sharply vividly brightly luminously radiantly brilliantly resplendently gorgeously stunningly breathtakingly dazzlingly strikingly remarkable noteworthy memorable historic epochal momentous monumental significant important vital crucial pivotal key central core fundamental foundational bedrock rock-bottom bottom-line ultimate last final conclusive definitive determinative decisive instrumental contributory additive supplementary additional extra added bonus value proposition offer deal arrangement agreement contract commitment obligation duty responsibility role function purpose meaning significance importance weight gravity seriousness solemnity formality ceremony ritual tradition custom practice habit routine regular periodic cyclical seasonal annual yearly monthly weekly daily hourly minutely momentarily instantaneously quickly rapidly swiftly speedily briskly lively vivaciously animatedly energetically forcefully powerfully potently efficacious effective efficient productive fruitful successful triumphant victorious glorious magnificent wonderful beautiful marvelous fantastic amazing incredible unbelievable unthinkable inconceivable unprecedented unmatched unparalleled unrivaled supreme paramount sovereign dominant predominant prevailing ruling governing controlling commanding authoritative influential powerful mighty strong potent forceful compelling persuasive convincing credible believable trustworthy dependable countable accountable measurable quantifiable qualitative quantitative analytical synthetic integrative comprehensive holistic global universal all-encompassing pervasive widespread prevalent general broad extensive intensive deep profound thorough complete full total absolute entire whole integral component part element aspect feature characteristic trait attribute property quality essence substance content matter material stuff fabric texture surface skin coat covering overlay veneer facade front face appearance look sight view perspective angle position place location site spot point space area volume dimension extent range span reach stretch spread expanse expansion growth increase rise ascent climb elevation height peak summit top crown head cap roof ceiling sky heavens universe cosmos existence reality world life experience event occurrence incident episode occasion happening action deed work labor effort endeavor enterprise venture undertaking mission task job assignment charge commission order command instruction direction guidance counseling advice suggestion recommendation prescription formula recipe pattern model template prototype archetype exemplar example sample specimen case study analysis examination investigation exploration inquiry query question problem challenge puzzle riddle mystery enigma conundrum paradox oxymoron irony satire humor wit intelligence knowledge wisdom insight understanding comprehension apprehension perception recognition identification distinction differentiation discrimination selection choice option alternative preference priority emphasis focus concentration attention awareness consciousness cognition thought thinking reasoning logic argument debate discussion conversation dialogue discourse communication message signal sign symbol mark notation code cipher encryption decryption encoding decoding translation interpretation explanation clarification elucidation illumination enlightenment revelation disclosure exposure presentation demonstration illustration depiction representation portrayal characterization description narration story tale myth legend folklore history record document evidence proof verification validation confirmation authentication authorization permission access entry admission entrance ingress egress exit departure leave farewell goodbye adieu au revoir bon voyage safe travels pleasant journey happy trip have nice day enjoy rest take care see
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值