ubruhin / python-dlogg-driver Goto Github PK
View Code? Open in Web Editor NEWUnofficial python package to read data from a USB D-LOGG device
License: GNU General Public License v3.0
Unofficial python package to read data from a USB D-LOGG device
License: GNU General Public License v3.0
I realized UVR61-3 answers to the command [0x21] with [0x80].
What could this command do and answer mean?
I am particularly searching for a way to "read" the data from sensors directly from the DL line. My UVR has 3 sensors attached using the "addresses 12, 13, 16 (don't know if hex or dec values).
...or maybe this could be done using another subcodes for command [0x20]?
[DEBUG] Transceive: ['0x21'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x80'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x0'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x0', '0x21'] --> ['0x80', '0x80']
[DEBUG] Transceive: ['0x21', '0x0', '0x22'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x0', '0xff'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x0', '0x82'] --> ['0x80', '0x1d']
[DEBUG] Transceive: ['0x21', '0x0', '0x21', '0x0', '0x21'] --> ['0x80', '0x80', '0x80']
[DEBUG] Transceive: ['0x21', '0x0', '0x21', '0x0', '0x82'] --> ['0x80', '0x80', '0x1d']
[DEBUG] Transceive: ['0x21', '0x0', '0x21', '0x0', '0xaa'] --> ['0x80', '0x80', '0xf']
[DEBUG] Transceive: ['0x21', '0x1'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x2'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x3'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x10'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x10', '0x18'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x82'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x82', '0x2', '0x1d'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x82', '0x21', '0x1d'] --> ['0x80', '0x80']
[DEBUG] Transceive: ['0x21', '0x82'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x21'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x0'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x80'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x90'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0xaa'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0xab'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x8a'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x8b'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x8c'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x8d'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x8e'] --> ['0x80']
[DEBUG] Transceive: ['0x21', '0x8f'] --> ['0x80']
Hello,
thanks for releasing the dlogg-driver!
I am struggling still to understand how to interpret data[:]. Could you please provide more documentation to explain how the data is structured?
Regards,
Hendrik
Hello,
I am accessing my BL-Net via IP. Are you planning to support this in future?
Regards,
Hendrik
Hello
The dlogg-linux from h. r not work anymore always get not logger tryed change many things in code etc but not work. you also not know why ?
With your python it reads the logger.
And is there a way to read out with your Python and like at Dlogg-Linux export to WinSol File Format Old version or if work new version have both :)
But the dlogg-db not work anymore cannot install it always hangs at pandas install :(
And at this dlogg driver why no WMZ , SOLAR, energy data, power data , or kwh or mWh is read out anymore ? Its comment out but when decomment i get only error what need todo ?
`class Uvr1611Data(object):
def init(self, raw_data, offset):
self.raw = bytearray(raw_data)
data = raw_data[offset:]
self.inputs = list()
for i in range(0, 16):
self.inputs.append(InputData(data[i2:i2+2]))
self.outputs = list()
for i in range(0, 13):
self.outputs.append(True if unpack("<H", data[32:34])[0] & 1 << i else False)
self.pump_speeds = list()
for i in range(0, 4):
self.pump_speeds.append(PumpSpeed(data[34+i]))
# self.wmz_active = raw_data[38]
# self.solar_1_power = unpack(">I", raw_data[39:43])
# self.solar_1_kwh = unpack(">H", raw_data[43:45])
# self.solar_1_mwh = unpack(">H", raw_data[45:47])
# self.solar_2_power = unpack(">I", raw_data[47:51])
# self.solar_2_kwh = unpack(">H", raw_data[51:53])
# self.solar_2_mwh = unpack(">H", raw_data[53:55])
checksum = raw_data[-1]
checksum_calc = sum(raw_data[0:-1]) & 0xFF
if checksum != checksum_calc:
raise IOError("Checksum mismatch in header")
def __unicode__(self):
text = u"{\n"
text += u" inputs: {}\n".format(u", ".join([unicode(x) for x in self.inputs]))
text += u" outputs: {}\n".format(u", ".join([unicode(x) for x in self.outputs]))
text += u" pump_speeds: {}\n".format(u", ".join([unicode(x) for x in self.pump_speeds]))
# text += u" wmz_active: {}\n".format(self.wmz_active)
# text += u" solar_1_power: {}\n".format(self.solar_1_power)
# text += u" solar_1_kwh: {}\n".format(self.solar_1_kwh)
# text += u" solar_1_mwh: {}\n".format(self.solar_1_mwh)
# text += u" solar_2_power: {}\n".format(self.solar_2_power)
# text += u" solar_2_kwh: {}\n".format(self.solar_2_kwh)
# text += u" solar_2_mwh: {}\n".format(self.solar_2_mwh)
return text`
Its needed how can i read that out with your py ?
Hope you can help me thanks.
Regards
Hi,
when i am trying to readout my logger with my raspberry pi, i get:
Type: Type.BL232_DLOGG_1DL
Firmware: 2.9
Mode: Mode.ONE_DL
Logging criterion: <dlogg_driver.definitions.LoggingCriterion object at 0x769db7b0>
Number of available samples: 32
Traceback (most recent call last):
File "ou1.py", line 10, in
data = device.fetch_data_range(header.start, 1)
File "/home/pi/.local/lib/python2.7/site-packages/dlogg_driver/device.py", line 94, in fetch_data_range
data.append(self.fetch_data(addr))
File "/home/pi/.local/lib/python2.7/site-packages/dlogg_driver/device.py", line 88, in fetch_data
return Uvr1611MemoryData(self._transceive(tx_data, 65, checksum=True))
File "/home/pi/.local/lib/python2.7/site-packages/dlogg_driver/device.py", line 125, in _transceive
raise IOError("Received {} bytes instead of {}".format(len(rx_data), rx_len))
IOError: Received 63 bytes instead of 65
Any ideas?
Thanxs
Hi - well done! Anyway, I was not yet sucessfull on retreiving data from my D-LOGG device using my Raspberry Pi 3 (Stretch).
Any Idea what could fix this?
This is the output when running in python interactively:
with DLoggDevice("/dev/ttyUSB0") as device:
... print u"Type: {}".format(device.get_type())
... print u"Firmware: {}".format(device.get_firmware_version())
... print u"Mode: {}".format(device.get_mode())
... print u"Logging criterion: {}".format(unicode(device.get_logging_criterion()))
... header = device.get_header()
... print u"Number of available samples: {}".format(header.get_sample_count())
... data = device.fetch_data_range(header.start, 1)
...
Type: Type.BL232_DLOGG_1DL
Firmware: 2.9
Mode: Mode.ONE_DL
Logging criterion: 3.0K
Number of available samples: 21
Traceback (most recent call last):
File "", line 8, in
File "/usr/local/lib/python2.7/dist-packages/dlogg_driver/device.py", line 94, in fetch_data_range
data.append(self.fetch_data(addr))
File "/usr/local/lib/python2.7/dist-packages/dlogg_driver/device.py", line 88, in fetch_data
return Uvr1611MemoryData(self._transceive(tx_data, 65, checksum=True))
File "/usr/local/lib/python2.7/dist-packages/dlogg_driver/device.py", line 125, in _transceive
raise IOError("Received {} bytes instead of {}".format(len(rx_data), rx_len))
IOError: Received 63 bytes instead of 65
Besides: I am wondering, why the device keeps telling "21" samples available all morning (last few hours). I installed the D-LOGG device on my UVR63-1 yesterday evening and it started with 1 sample, increasing all few minutes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.