Skip to main content

temperature_sensor_reader

This is a temperature sensor package designed for modbus. Implemented in pymodbus only. PyPI website: https://pypi.org/project/modbus-configuretools-xzf8971/

Install

from pypi:

pip install modbus-configuretools-xzf8971  

from github:

pip install git+https://github.com/xzf89718/temperature_sensor_reader

Jiandarenke modbus RS485 as example

Before run scripts

Check the COM and chmod

chmod 666 \dev\ttyUSBx

Import modules

from modbus_configuretools import temperature_sensor.RS485_Jiandarenke as RS485_JDRK  
from modbus_configuretools import temperature_sensor.JDRKAddressConfig as Config

Configure parameters for Jiandarenke RS485 sensor

It's OK to set None for unkown value

# Modify these config values 
# Please configure these value in temperature_sensor before read or write values  
# SLAVEID must be specified. If SLAVEID is none, set to 1  
# ADDRESS_HUMIDITY = 0x0000  
# ADDRESS_TEMPERATURE_DEW_POINT = 0x0001  
# ADDRESS_TEMPERATURE = 0x0002  
# ADDRESS_TEMPERATURE_CALI = 0x0050  
# ADDRESS_HUMUDITY_CALI = 0x0051  
# ADDRESS_SLAVEID = 0x07D0  
# ADDRESS_BAUDRATE = 0x07D1  
# TEMPERATURE_CALI = 164  
# HUMIDITY_CALI = 7  
# SLAVEID = 1
# BAUDRATE = 1
myconfig = Config(ADDRESS_HUMIDITY, ADDRESS_TEMPERATURE_DEW_POINT, ADDRESS_TEMPERATURE, ADDRESS_SLAVEID, ADDRESS_BAUDRATE, ADDRESS_TEMPERATURE_CALI, ADDRESS_HUMUDITY_CALI, TEMPERATURE_CALI, HUMIDITY_CALI, SLAVEID, BAUDRATE)

Calibration of sensor. Not necessary calibration every time

sensor.CalibrationJiandarenke(myconfig)  

Set slaveID and baudrate

Please make sure only 1 sensor connect to the modbus bus

sensor.WriteSlaveIDAndBaudrate(myconfig)

Init and read measured values from sensor

# Create a wrapper for JDRK sensor  
sensor = RS485_JDRK(port="/dev/ttyUSB0")  
# Init and connect client
sensor.InitClient()  
# Read slaveID and baudrate  
slaveID, baudrate = sensor.ReadSalveIDAndBaudrate(myconfig)  
# Read temperature, dew point, humidity in one request  
# Only correct for specified sensor
temperature, dew_point_temperature, humidity = sensor.ReadTemperatureAndHumidity(myconfig)  
# Read temperature only  
temperature = sensor.ReadTemperature(myconfig)  
# Read dew point temperature  
dew_point_temperature = sensor.ReadTemperatureDewPoint(myconfig)  
# Read humidity only  
humidity = sensor.ReadTemperature(myconfig)  

Close the sensor

sensor.close()

Metadata

Release files for modbus-configuretools-xzf8971 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for modbus-configuretools-xzf8971 1.6.0
File Size Uploaded Provenance Actions
modbus_configuretools_xzf8971-1.6.0.tar.gz 10.8 kB Without provenance Details for modbus_configuretools_xzf8971-1.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for modbus-configuretools-xzf8971 1.6.0
File Interpreter ABI Platform Actions
modbus_configuretools_xzf8971-1.6.0-py3-none-any.whl Python 3 none any Details for modbus_configuretools_xzf8971-1.6.0-py3-none-any.whl

Total release size: 21.9 kB

Release files / modbus_configuretools_xzf8971-1.6.0.tar.gz

Download URL modbus_configuretools_xzf8971-1.6.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8ae2af17f413505083d4701df44187a560838aed5335f49c59ba6fb9bea64202
BLAKE2b-256 checksum
How to use checksums
abd892ec706d55a8b0d55bc2a3b07cbbb6f66ea977a7bdf2f3ce5a51dbd8c2d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.3

Release files / modbus_configuretools_xzf8971-1.6.0-py3-none-any.whl

Download URL modbus_configuretools_xzf8971-1.6.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc6d3b4f492be47d89bd48653777cf5dcc17d1c177f576caf54b0aa7714e6765
BLAKE2b-256 checksum
How to use checksums
24aec6c97984b11513927e6fd46682a11b9666fc3c1239c5e0f3b7415c007674
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.3

Security for modbus-configuretools-xzf8971 1.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page