简体   繁体   English

Thingsboard 规则链:如何解压遥测?

[英]Thingsboard rule chain: How to decompress telemetry?

I am trying to use thingsboard to allow users to request log files from devices.我正在尝试使用 thingsboard 来允许用户从设备请求日志文件。 When requested, the devices send the log files to my TB server as telemetry.当请求时,设备将日志文件作为遥测发送到我的 TB 服务器。 First, the logs are compressed with gzip and then base64 encoded.首先,使用 gzip 压缩日志,然后进行 base64 编码。 I want to have the rule chain decompress these logs and email to the requestor.我想让规则链解压缩这些日志并通过电子邮件发送给请求者。 I've found code to convert the base64 string to a byte array, but I haven't found a way to decompress the resulting byte array.我找到了将 base64 字符串转换为字节数组的代码,但我还没有找到解压缩结果字节数组的方法。 I tried to invoke zlib using:我尝试使用以下方法调用 zlib:

var zlib = require('zlib');

but it results in an message that 'require' is not defined.但它会导致未定义“要求”的消息。

Any hints?有什么提示吗? What language exactly is the TB rule node environment? TB规则节点环境究竟是什么语言?

We send it to S3 and then have a link to it available on the TB gui - the user can request a log file(s) on the UX and then a few minutes later can click on the logfile and it downloads to their computer/device as a zip file.我们将其发送到 S3,然后在 TB gui 上提供指向它的链接 - 用户可以在 UX 上请求日志文件,然后几分钟后可以单击日志文件并将其下载到他们的计算机/设备作为 zip 文件。 Device is linux based.设备是基于linux的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM