Skip to main content

Elitech rc4 data access tool and library.

Project description

Elitech RC4 / RC5 DataReader

Description

This software is a data collecting tool, written in python for Temperature data logger RC-4/RC-5 and Temperature and Humidity data logger RC-4HC.

Elitech RC-4 / RC-4HC / RC-5 is a reasonable data logger.

RC-5+(Note the plus "+" sign). is not supperted.

Enables to use RC-4/RC-5 on Mac, Linux, Windows.

This is an unofficial tool. This tool was made by monitoring and guessing serial communication data. That is why this software is not perfect.

Requirements

Setup

  1. Install Serial Port Driver.

  2. install dependencies.

$ python setup.py install

OR pip

$ pip install elitech-datareader
  1. Linux: Add yourself to the dialout group. Restart required.
sudo usermod -a -G dialout $USER

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 --value_only /dev/tty.SLAB_USBtoUART
25.2

Get device information

get device information.

$ elitech-datareader --command devinfo --encode=utf8 /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

user_info is multibytes text. Use --encode option. (default UTF8)

On Elitech Software (Logger Data Management Software V2.0, Rc Logger), user info is encoded various charsets. (GBK, MS932).

$ elitech-datareader --command devinfo --encode=gbk /dev/tty.SLAB_USBtoUART  # for mac os Rc Logger software

see. https://github.com/civic/elitech-datareader/issues/17

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 --encode=utf8 --user_info="UserInfoユーザー情報" /dev/tty.SLAB_USBtoUART

user_info is multibytes text. Use --encode option. (default UTF8)

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

Note (serial port)

If comunication unstable, then try --ser_baudrate and --ser_timeout option.

$ elitech-datareader --command devinfo --ser_baudrate 115200 --ser_timeout=10 /dev/tty.SLAB_USBtoUART

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elitech-datareader-1.0.5.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

elitech_datareader-1.0.5-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file elitech-datareader-1.0.5.tar.gz.

File metadata

  • Download URL: elitech-datareader-1.0.5.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

File hashes

Hashes for elitech-datareader-1.0.5.tar.gz
Algorithm Hash digest
SHA256 bf0b6e601014609509e288cb4c8215489edf8c9a6c202bbbd75a8f3ffb6f9ec8
MD5 7f4c3472fd5239bdcbd671cab4a7b146
BLAKE2b-256 57a01a1986a3996c47d2a93158a422c1c34252ce83888bba17a1728e9d0af222

See more details on using hashes here.

File details

Details for the file elitech_datareader-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: elitech_datareader-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

File hashes

Hashes for elitech_datareader-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 815eac49c7d92165bdf4c6354d19da6dd6b0349b49656d22fdc9f74cbb744820
MD5 aba78f3edbec65a572c5248b69a1e3d9
BLAKE2b-256 0f955183555d2f7a71b9e48120afa19857887189c5b0683328d8bcfcda677617

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page