Elitech rc4 data access tool and library.
Project description
Description
This software is a data collecting tool, written in python for Temperature data logger RC-4/RC-5.
Elitech RC-4 / RC-5 is a reasonable data logger.
Enables to use RC-4/RC-5 on Mac, Linux, Windows.
Requirements
Python2.7 or Python3.4
Serial Port Driver
(for RC-4) Silicon Labs CP210x USB-UART bridge VCP driver. http://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx
(for RC-5) CH340 Serial Driver MacOSX
pySerial (data access library for serial port)
Setup
Install Serial Port Driver.
for RC-4: CP210x USB-UART bridge VCP driver. Download and install CP210x driver for your platform. http://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx
for RC-5: CH340 Serial Driver MacOSX
install dependencies.
$ python setup.py install
OR pip
$ pip install elitech-datareader
Example(Script)
Initialize device.
initialize. rec interval 10sec. set clock now.
$ elitech-datareader --command simple-set --interval=10 /dev/tty.SLAB_USBtoUART # RC-4 on macosx # /dev/tty.wchusbserialfd1430 # RC-5 on macosx
Get data
Press stop button for stop recording.
output to stdout.
$ elitech-datareader --command get /dev/tty.SLAB_USBtoUART 6 1 2015-06-07 13:53:36 25.0 2 2015-06-07 13:53:46 25.1 3 2015-06-07 13:53:56 25.1 4 2015-06-07 13:54:06 25.1 5 2015-06-07 13:54:16 25.1 6 2015-06-07 13:54:26 25.1
Elitech device gets the data in units called “Page size”. Page size is determined by the device model. RC4 is 100 and RC5 is 500.
You can directly specify the page size, with an optional argument –page_size. (for debug)
$ elitech-datareader --command get --page_size=500 /dev/tty.SLAB_USBtoUART 6 1 2015-06-07 13:53:36 25.0 2 2015-06-07 13:53:46 25.1 3 2015-06-07 13:53:56 25.1 4 2015-06-07 13:54:06 25.1 5 2015-06-07 13:54:16 25.1 6 2015-06-07 13:54:26 25.1
Get latest data
$ elitech-datareader --command latest /dev/tty.SLAB_USBtoUART 6 2015-06-07 13:54:26 25.1 $ elitech-datareader --command latest --only-value /dev/tty.SLAB_USBtoUART 25.2
Get device information
get device information.
$ elitech-datareader --command devinfo /dev/tty.SLAB_USBtoUART station_no=3 last_online=2015-06-09 01:13:13 temp_unit=TemperatureUnit.C alarm=AlarmSetting.NONE work_sts=WorkStatus.STOP lower_limit=-30.0 tone_set=ToneSet.NONE rec_count=272 upper_limit=60.0 delay=0.0 stop_button=StopButton.ENABLE current=2015-06-09 07:42:00 start_time=2015-06-07 13:53:36 rec_interval=00:00:10 temp_calibration=-1.5 user_info=RC-4 Data Logger dev_num=9900112233
Parameter set
set device parameter.
$ elitech-datareader --command set --interval=10 --upper_limit=60.0 --lower_limit=-30.0 \ --station_no=1 --stop_button=y --delay=0.0 --tone_set=y --alarm=x --temp_unit=C \ --temp_calibration=-1.5 --dev_num=1234567890 --user_info="RC4 Data Logger" /dev/tty.SLAB_USBtoUART
Debug raw communication
Send raw request data. receive response data.
$ elitech-datareader --command raw --req="CC 00 06 00 D2" -res_len=4 /dev/tty.SLAB_USBtoUART response length=4 55 01 01 32
Example(Python module)
Get device infomation.
import elitech
device = elitech.Device("/dev/tty.SLAB_USBtoUART")
devinfo = device.get_devinfo()
print(devinfo.info)
Get record data
import elitech
device = elitech.Device("/dev/tty.SLAB_USBtoUART")
body = device.get_data()
for elm in body:
print elm
Update param
device = elitech.Device("/dev/tty.SLAB_USBtoUART")
devinfo = device.get_devinfo() # get current parameters.
param_put = devinfo.to_param_put() #convart devinfo to parameter
param_put.rec_interval = datetime.time(0, 0, 10) # update parameter
param_put.stop_button = elitech.StopButton.ENABLE # update parameter
param_put_res = device.update(param_put) # update device
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file elitech-datareader-0.9.3.tar.gz
.
File metadata
- Download URL: elitech-datareader-0.9.3.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1360844d7974a53d5d3133f9a13e189811c0d5a361d3493a02dda26050037734 |
|
MD5 | 3445a3744d6f20cce24ffe58a1f86c36 |
|
BLAKE2b-256 | cb6f955aebbb132a8cf97d8728eb673a93efef88992690ba4d57dd9cd9102f36 |