与lufft opus20设备的接口

opus20的Python项目详细描述


这是一个opus20,一个用于查询温度的python软件/ lufft公司生产的湿度/气压测井仪opus20。

源代码是managed on Github: pklaus/opus20。python包 也是registered on PyPI的 安装简单。

要求和安装

对裸opus20包的唯一严格要求是python 版本3.3+。然后,可以通过pip直接从 PYPI:

pip install --upgrade opus20

该软件包还附带了一个(可选)plot web服务器。这取决于 还有一些python包。要同时安装这些需求,请运行 此命令:

pip install --upgrade opus20[webserver]

这将安装更多的软件包,如jinja2、bottle、matplotlib, 熊猫,还有努比。(安装matplotlib可能还需要 安装python 3的python开发包。)

用法

python包安装了一个命令行工具来查询设备 当前值。它叫做opus20_cli

下面是如何从设备获取所有可用channels频道的列表:

philipp@lion:~> opus20_cli 192.168.1.55 list
Channel   100 (0x0064): CUR temperature         unit: °C    offset: ±10.0  logging: no
Channel   120 (0x0078): MIN temperature         unit: °C    offset: ±10.0  logging: no
Channel   140 (0x008C): MAX temperature         unit: °C    offset: ±10.0  logging: no
Channel   160 (0x00A0): AVG temperature         unit: °C    offset: ±10.0  logging: yes
Channel   105 (0x0069): CUR temperature         unit: °F    offset: 0.0    logging: no
Channel   125 (0x007D): MIN temperature         unit: °F    offset: 0.0    logging: no
Channel   145 (0x0091): MAX temperature         unit: °F    offset: 0.0    logging: no
Channel   165 (0x00A5): AVG temperature         unit: °F    offset: 0.0    logging: no
Channel   200 (0x00C8): CUR relative humidity   unit: %     offset: ±30.0  logging: no
Channel   220 (0x00DC): MIN relative humidity   unit: %     offset: ±30.0  logging: no
Channel   240 (0x00F0): MAX relative humidity   unit: %     offset: ±30.0  logging: no
Channel   260 (0x0104): AVG relative humidity   unit: %     offset: ±30.0  logging: yes
Channel   205 (0x00CD): CUR absolute humidity   unit: g/m³  offset: 0.0    logging: no
Channel   225 (0x00E1): MIN absolute humidity   unit: g/m³  offset: 0.0    logging: no
Channel   245 (0x00F5): MAX absolute humidity   unit: g/m³  offset: 0.0    logging: no
Channel   265 (0x0109): AVG absolute humidity   unit: g/m³  offset: 0.0    logging: yes
Channel   110 (0x006E): CUR dewpoint            unit: °C    offset: 0.0    logging: no
Channel   130 (0x0082): MIN dewpoint            unit: °C    offset: 0.0    logging: no
Channel   150 (0x0096): MAX dewpoint            unit: °C    offset: 0.0    logging: no
Channel   170 (0x00AA): AVG dewpoint            unit: °C    offset: 0.0    logging: yes
Channel   115 (0x0073): CUR dewpoint            unit: °F    offset: 0.0    logging: no
Channel   135 (0x0087): MIN dewpoint            unit: °F    offset: 0.0    logging: no
Channel   155 (0x009B): MAX dewpoint            unit: °F    offset: 0.0    logging: no
Channel   175 (0x00AF): AVG dewpoint            unit: °F    offset: 0.0    logging: no
Channel 10020 (0x2724): CUR battery voltage     unit: V     offset: 0.0    logging: no
Channel 10040 (0x2738): MIN battery voltage     unit: V     offset: 0.0    logging: no
Channel 10060 (0x274C): MAX battery voltage     unit: V     offset: 0.0    logging: no
Channel 10080 (0x2760): AVG battery voltage     unit: V     offset: 0.0    logging: yes

询问频道值的工作方式如下:

philipp@lion:~> opus20_cli 192.168.1.55 get 0x0064
24.712

您还可以下载存储在设备上的值并将其存储在 文件:

philipp@lion:~> opus20_cli --loglevel INFO 192.168.1.55 download log_data.pickle
INFO:opus20.opus20:Connected to device with ID: EC9C0A06B183
INFO:opus_cli:script running time (net): 1.208517 seconds.
philipp@lion:~>

以下是所有可能的cli命令的概述:

# List all possible channels:
opus20_cli 192.168.1.55 list

# Get the values for the specified channels (CUR, MIN, MAX temperature in °C):
opus20_cli 192.168.1.55 get 0x0064 0x0078 0x008C

# Download the latest log data and merge it into a persistant data file:
opus20_cli 192.168.1.55 download opus20.PickleStore.p

# Check if logging in general is enabled on the device:
opus20_cli 192.168.1.55 logging status
opus20_cli 192.168.1.55 logging start
opus20_cli 192.168.1.55 logging stop
# Or clear the log:
opus20_cli 192.168.1.55 logging clear

# Enable or disable logging for individual channels:
opus20_cli 192.168.1.55 enable  0x0064 0x0078 0x008C
opus20_cli 192.168.1.55 disable 0x00CD 0x00E1 0x00F5

作者

许可证

gplv3

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java与Groovy正则表达式匹配混淆   java控制台未定义为JSNI   主目录中的java指针异常   java如何获取hashmap中的arrayList的大小   ApachePOI用于文本,Java代码中的word doc(.docx)中没有进行追加   Ruby对象到Java对象   JavaSpringJPA哈希集只返回一个值   Java在执行由配置了精确类路径参数的mavenjarpluin生成的可执行jar时无法找到依赖项   java我试图在画布上写一个文本,但什么也没发生   java HTTP 404源服务器找不到目标资源的当前表示形式,或者不愿意透露存在该表示形式。不起作用   java提取小数点后的最后一个数字   oop Java:无法访问对象的元素   PHP URL中RecyclerView中的java句柄空异常   不调用OnCreateViewHolder的java Update RecyclerView适配器项