Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream read less than specified amount, expected 4, found 3 #4

Open
kolisko opened this issue Jul 26, 2020 · 0 comments
Open

stream read less than specified amount, expected 4, found 3 #4

kolisko opened this issue Jul 26, 2020 · 0 comments

Comments

@kolisko
Copy link

kolisko commented Jul 26, 2020

connecting to bafang M500

1 Michal:bafang-python kolisko$ /usr/local/bin/python3 --version
Python 3.7.7

0 Michal:bafang-python kolisko$ ./bafang-test.py 
port: /dev/cu.usbserial-1410
req: b'\x11Q\x04\xb0\x05'
resp: b'\x11Q\x04\xb0\x05'
Traceback (most recent call last):
  File "./bafang-test.py", line 55, in <module>
    info_message)
  File "./bafang-test.py", line 50, in read_config
    t = answ_format.parse(answ)
  File "/usr/local/lib/python3.7/site-packages/construct/core.py", line 288, in parse
    return self.parse_stream(io.BytesIO(data), **contextkw)
  File "/usr/local/lib/python3.7/site-packages/construct/core.py", line 300, in parse_stream
    return self._parsereport(stream, context, "(parsing)")
  File "/usr/local/lib/python3.7/site-packages/construct/core.py", line 312, in _parsereport
    obj = self._parse(stream, context, path)
  File "/usr/local/lib/python3.7/site-packages/construct/core.py", line 1981, in _parse
    subobj = sc._parsereport(stream, context, path)
  File "/usr/local/lib/python3.7/site-packages/construct/core.py", line 312, in _parsereport
    obj = self._parse(stream, context, path)
  File "/usr/local/lib/python3.7/site-packages/construct/core.py", line 2439, in _parse
    return self.subcon._parsereport(stream, context, path)
  File "/usr/local/lib/python3.7/site-packages/construct/core.py", line 312, in _parsereport
    obj = self._parse(stream, context, path)
  File "/usr/local/lib/python3.7/site-packages/construct/core.py", line 841, in _parse
    return stream_read(stream, length, path)
  File "/usr/local/lib/python3.7/site-packages/construct/core.py", line 92, in stream_read
    raise StreamError("stream read less than specified amount, expected %d, found %d" % (length, len(data)), path=path)
construct.core.StreamError: Error in path (parsing) -> manufacturer
stream read less than specified amount, expected 4, found 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant