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

Combined #86

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Combined #86

wants to merge 6 commits into from

Conversation

Accept the QPI, QID, QVFW, QVFW2, QFLAG, QBOOT, and QOPM commands.
The HS_MS_MSX protocol specification in the repository says for the

QPIRI command value R is “Parallel max num”.

On my system R returns 9, while the source code expected "-" in scanf().

This change alters the input of scanf() to accept any character in
the position for R.

Closes ned-kelly#71
When many inverter_poller at the same time send commands, the result is undefined.

This locks exclusively the configuration file, while the process is running,
so that simultaneous instances have to wait until the file is released.

For some reason locking the device /dev/hidraw0 does not work for me,
I get sometimes the output from previous runs.  I suspect that when
cInverter::query() does exceed the 2s timeout, it quits, and leaves the
response of its commands on the wire.  For fd = /dev/hidraw0
    tcflush(fd, TCOFLUSH);
has no effect.

As a matter of fact, on my system I have increased the timeout in
cInverter::query() to 15s and now it does always work correctly.

Also the program, when called with -1, could exit, while the thread
is receiving data, this leaves the next invocation with some
ready-data, which it is not expecting.
On Raspberry Pi 3B executing the original code, with Influx disabled, takes:
real    0m57,753s
user    0m54,679s
sys     0m2,214s

With the modification the time is:
real    0m10,733s
user    0m8,338s
sys     0m0,759s

For the record, I run the code outside of containers.
Here more jq-calls are replaced with sed.  The time on Raspberry Pi is now

real    0m4,965s
user    0m2,595s
sys     0m0,726s

I do not use Influx.  This allows updating the data in OpenHab (I read
the MQTT stream from OpenHAB) every five seconds, once all jq calls are
removed.
@dilyanpalauzov
Copy link
Contributor Author

Some of the changes are also on https://github.com/manio/skymax-demo/ .

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

Successfully merging this pull request may close these issues.

1 participant