svalouch / python-rctclient

Python client for RCTs Serial Communication Protocol
https://rctclient.readthedocs.io
GNU General Public License v3.0
46 stars 27 forks source link

rctclient.exceptions.InvalidCommand: 13 is not a valid Command #13

Closed leonardo0014 closed 2 years ago

leonardo0014 commented 3 years ago

After being helped so well last time, I have to report something again. With the new version 0.0.3 and timeseries2csv.py I got this error again and again when I called it up: timeseries2csv.py --host=192.168.1.2 --resolution=minutes --count=1 --output=datei.csv 1;

...
Requesting egrid_feed
timestamp: 2021-06-17 23:59:59
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/rctclient/frame.py", line 425, in consume
self._command = Command(cmd)
File "/usr/lib/python3.9/enum.py", line 360, in __call__
return cls.__new__(cls, value)
File "/usr/lib/python3.9/enum.py", line 677, in __new__
raise ve_exc
ValueError: 13 is not a valid Command

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/data/allUsers/Projekte/projekt_rctpower/timeseries2csv.py", line 333, in <module>
timeseries2csv()
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "/data/allUsers/Projekte/projekt_rctpower/timeseries2csv.py", line 226, in timeseries2csv
rframe.consume(buf)
File "/usr/local/lib/python3.9/dist-packages/rctclient/frame.py", line 427, in consume
raise InvalidCommand(str(exc), cmd, i) from exc
rctclient.exceptions.InvalidCommand: 13 is not a valid Command

Unfortunately, I can't find a cause. I am using the current Debian Testing and have all packages on the required version via PIP.

Any suggestions what else it could be?

Update: Correction: I get an error code back (1) if the error occurs.

leonardo0014 commented 2 years ago

it seems to be the same cause as issue #16 Since it no longer accumulates so much for me, or I have found a workaround, I am closing the report here.