-
Notifications
You must be signed in to change notification settings - Fork 27
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
rctclient.exceptions.InvalidCommand: 43 is not a valid Command #16
Comments
The multiplexing capabilities of the inverter firmware seems very limited indeed. It seems every client is receiving the responses to every other connected client. While writing https://github.com/weltenwort/home-assistant-rct-power-integration based on this awesome library I had to work around that as well. |
Yea, make sure to have the latest firmware. Older ones (especially around 2020) were really broken and could send you one client's request in a response to your (unrelated) query even for differing IDs. Depending on the settings, the inverters also send unsolicited frames that can trigger bugs. I guess I have to fix up the timeseries-script, but not sure when I'll get to around to touch that (I really don't want to). PRs welcome as always. |
Similar issue with timeseries2csv.py here. Firmware 2.3.5673.
mostly (80%) ends up with different exceptions:
|
I am having the same issue as @matzeruegge with Firmware 2.3.5673. |
Not using timeseries2csv.py but rctclient and it works as before with 2.3.5673 here. |
same issue here.....This error occurs every 4-5 calls.......since update to 2.3.5673
|
I made changes to the exception handling in frame.py without accounting for potential side effects. Specifically, I replaced the original line 427, "raise InvalidCommand(str(exc), cmd, i) from exc," with the line "pass." Consequently, CSV files are now being created. |
I see these messages only if the Android or iOS app is also running. The FW is not good at multiple accesses. |
2.3.5673 really seems to be a regression here. rctmon is running fine for me, but subjectively, the RCT app has gotten a lot slower showing recent values on startup. |
The issue here is that the inverter seems to be by default in the "READ PEROIDICALLY" mode. I am not sure if this is new since 2.3.573. It sends every 30s a set of frames for predefined oids, even if you do not send any command at all to the inverter. If you send the command Probably it is better to reset the READ PEROIDICALLY as documented by setting There are some more strange findings. The set of oids is not equal in each chunk. Every other chunk contains a `net.slave_data'. And there seems to be an end-of-series marker 0x1B 0x1B 0x1B. The list of oids sent periodically is:
I fear there is no easy fix with the existing parser. I started working on a new reader/parser tolerating frames not being requested and filtering out only those requested. If someone has taken the risk to reset the series by setting |
Since the protocol is based on TCP there must be some client in the network which reads these values constantly. |
I did not do any tests so far, but I assume that as soon as any client connects to port 8899 the server will send the frames. I fear that the READ_PERIODICAL command is a global setting per device and not a setting per connection as one would expect. You could try to open two connections in parallel to verify this. I have no idea whats the purpose of this and if there is an intended consumer. It would also be interesting if this was introduced by the latest firmware. |
I cannot confirm this for my RCT 10.0, same SW version 2.3.5673. Environment: strictly one client via LAN only; Wifi off; service portal off; RCT portal off. And: 'pas.period' set to zero (0) and then back to default=30, i.e. no periodic reads should be active. Test 1: When I open a TCP conn to the inverter and do nothing (no read nor write, some regular TCP keep alives only) -> no unsolicited frame is sent from the inverter. But yes, the 'invalid command' and numerous timeouts (no response for read cmds and timeseries) are also present in my regular setup. For the time being, I hide this with read retries. |
I have 2.3.5674 on the 10.0 inverter and see pas.period == 30. I only see errors when I access the inverter at same time via App. |
@SaxonWood Interesting! My app is not active and the portal not open (means no browser has a connection, the inverter still has access to the internet). So may be this is some special state on my side only. Not sure what could have caused this then. May be I should try to set to pas.period to 0. @42Bastian Yes I also catch timeouts and do a retry as a workaround. This seems to work but is not very nice. if the app sets pas.period on each start it would be safe to turn this off. Needs more testing. |
Maybe not related, but since I set the router port the inverter is connected to to 100MB, I see fewer errors. |
As we all know, the inverter had changed its behaviour with firmware version 2.3.5673. The "invalid command" comes from the fact that from time to time the inverter either:
......2d2bxx......002b..... -> the first "2b" not a valid frame start because 2d must not preceed 2b to be a START_TOKEN. If decoded with the current rctclient 'consume' fct, this give "invalid command xx" (xx likely in its decimal notation) ......2b2b........002b.... -> the first "2b" is not a valid frame start either. If decoded with the rctclient 'consume' fct, this give "invalid command 43", because 2b (hex) = 43 (dec). To overcome this, I'm testing a modified version of the consume function with a new optional "strict" option, where the START_TOKEN must be preceeded with "00". Note that the preceeding "00" is not generally there, but normally in responses from the inverter. Decoding of requests to the inverter etc. should not expect the "00" before the "2b". Other suggestions welcome! |
@SaxonWood I have encountered similar issues. I have written a new package parser and a reader sample application based on the code of this repo here. It does not address all the issues but I can read data over a couple of weeks now. This code is work-in-progress and under development. Feel free to take a look at this. The code is here. Example usage of the parser is here. See readme for improvements. If this is stabilized we could make PR if there is interest. |
Hi,
I exported some data from my RCT power using timeseries2csv.py and encountered the following error sporadically:
I noticed that I received
Got unexpected frame oid ...
much more often when on I open the RCT app so it might be that handling of multiple connections is limited on the RCT power generator side.In parallel, also an instance of https://github.com/lauff/ioBroker.rct is running, so the invalid command might also be some kind of interaction.
The RCT power has the newest firmware installed.
Best regards,
Stephan
The text was updated successfully, but these errors were encountered: