You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python 3.8.10 (default, Nov 26 2021, 20:14:08)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
import elitech
device = elitech.Device("/dev/ttyUSB0")
device
<elitech.Device object at 0x7faea38b9a30>
devinfo = device.get_devinfo()
devinfo
<elitech.msg.DevInfoResponse object at 0x7faea378e400>
print(devinfo.info)
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'DevInfoResponse' object has no attribute 'info'
print(devinfo.model_no)
50
print(devinfo.station_no)
1
print(devinfo.rec_count)
0
print(devinfo.start_time)
None
device.debug=True
body=device.get_data()
body
[]
print(devinfo.info)
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'DevInfoResponse' object has no attribute 'info'
print(device.encode)
utf8
print(device.get_devinfo)
<bound method Device.get_devinfo of <elitech.Device object at 0x7fe1ed9aca30>>
device.get_devinfo()
ba length=5
CC 00 06 00 D2
<elitech.msg.DevInfoResponse object at 0x7fe1ed8a0ca0>
$ elitech-datareader --command simple-set --interval=10 /dev/ttyUSB0
$ elitech-datareader --command get /dev/ttyUSB0
$ elitech-datareader --command latest /dev/ttyUSB0
$ elitech-datareader --command devinfo --encode=utf8 /dev/ttyUSB0
alarm=AlarmSetting.NONE
current=2022-02-16 16:35:12
delay=0.0
dev_num=E187109805
humi_calibration=0.0
humi_lower_limit=0.0
humi_upper_limit=0.0
last_online=2022-02-16 16:33:34
lower_limit=-30.0
model_no=50
rec_count=0
rec_interval=00:00:10
start_time=None
station_no=1
stop_button=StopButton.DISABLE
temp_calibration=0.0
temp_unit=TemperatureUnit.C
tone_set=ToneSet.NONE
upper_limit=60.0
user_info=RC-5 Data Logger
work_sts=WorkStatus.NOT_START
$ elitech-datareader --command get --page_size=500 /dev/ttyUSB0
Traceback (most recent call last):
File "/home/sclaes/.local/bin/elitech-datareader", line 8, in
sys.exit(main())
File "/home/sclaes/.local/lib/python3.8/site-packages/scripts/elitech_device.py", line 23, in main
command_get(args)
File "/home/sclaes/.local/lib/python3.8/site-packages/scripts/elitech_device.py", line 66, in command_get
device.get_data(callback=output, page_size=args.page_size)
File "/home/sclaes/.local/lib/python3.8/site-packages/elitech/init.py", line 136, in get_data
page = int(math.ceil(header.rec_count * data_size / float(page_size)))
UnboundLocalError: local variable 'data_size' referenced before assignment
Why is the attribute devinfo.info not defined? BTW: is there a tutorial? I got all the above from the source code...
BTW: How do I start recording? I set devinfo.start_time to 'now' but that doesn't make a difference. Neither does pressing the start button on the device (devinfo.rec_count stays 0). The device displays (a.o.) the temperature, so I assume it is working.
The text was updated successfully, but these errors were encountered:
I found out I had to press and hold to start logging. I should have read the fine manual... :-/
The other problems/error are still not resolved but at least I can now use the device to log the temperature. I thought it also could log the humidity but it can't. I need a different logger for that.
Python 3.8.10 (default, Nov 26 2021, 20:14:08)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
ba length=5
CC 00 06 00 D2
<elitech.msg.DevInfoResponse object at 0x7fe1ed8a0ca0>
$ elitech-datareader --command simple-set --interval=10 /dev/ttyUSB0
$ elitech-datareader --command get /dev/ttyUSB0
$ elitech-datareader --command latest /dev/ttyUSB0
$ elitech-datareader --command devinfo --encode=utf8 /dev/ttyUSB0
alarm=AlarmSetting.NONE
current=2022-02-16 16:35:12
delay=0.0
dev_num=E187109805
humi_calibration=0.0
humi_lower_limit=0.0
humi_upper_limit=0.0
last_online=2022-02-16 16:33:34
lower_limit=-30.0
model_no=50
rec_count=0
rec_interval=00:00:10
start_time=None
station_no=1
stop_button=StopButton.DISABLE
temp_calibration=0.0
temp_unit=TemperatureUnit.C
tone_set=ToneSet.NONE
upper_limit=60.0
user_info=RC-5 Data Logger
work_sts=WorkStatus.NOT_START
$ elitech-datareader --command get --page_size=500 /dev/ttyUSB0
Traceback (most recent call last):
File "/home/sclaes/.local/bin/elitech-datareader", line 8, in
sys.exit(main())
File "/home/sclaes/.local/lib/python3.8/site-packages/scripts/elitech_device.py", line 23, in main
command_get(args)
File "/home/sclaes/.local/lib/python3.8/site-packages/scripts/elitech_device.py", line 66, in command_get
device.get_data(callback=output, page_size=args.page_size)
File "/home/sclaes/.local/lib/python3.8/site-packages/elitech/init.py", line 136, in get_data
page = int(math.ceil(header.rec_count * data_size / float(page_size)))
UnboundLocalError: local variable 'data_size' referenced before assignment
Why is the attribute devinfo.info not defined? BTW: is there a tutorial? I got all the above from the source code...
BTW: How do I start recording? I set devinfo.start_time to 'now' but that doesn't make a difference. Neither does pressing the start button on the device (devinfo.rec_count stays 0). The device displays (a.o.) the temperature, so I assume it is working.
The text was updated successfully, but these errors were encountered: