-
Notifications
You must be signed in to change notification settings - Fork 49
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
sml_server: add a switch to exit after one packet #46
Comments
I would have appreciated openhab proposing changes here. |
smartmeter-obis got such switch just recently. i would recommend everyone developing on libsml should have a look at that lib - just to have something to compare with |
Thank you for the new issue and that you are willing to include the needs of the openHAB people into libsml. I just checked. In my case the unmodified sml_server produces the following output, which also loops:
The modified sml_server produces the following output and then exists:
So it it not just about a switch to terminate sml_server after a single run. What I do not know exactly as my knowledge about Java (which is used for openHAB and also the linked rule) is basic: Does the unmodified sml_server output work? I would say no as it looks into all lines and makes something. Sorry that I cannot be more clear on that as I am really not a programmer... |
No, it will not work as it is. The rule just takes line 0 and 2, which won't work on all meters today. It needs to parse the lines it reads for 1.8.0 and 16.7.0. This should be quite simple. |
I made a branch which includes the -s. Please check, if this works. sml_server_switch |
@msebald Did you have time to test my code?
But be aware. I am not familiar in writing Xtend code and have not tested it with openHAB. |
No. But I will. I'm on vacation. Next week I'm back home again. |
No answer from @msebald. But as I created a pull request, I'll close this. |
Off topic I discussed in #29 with @msebald that sml_server is used by the @openhab project rule sml. At the moment sml_server.c is copied there and modified slightly. The main reason for the change is, that the program needs to stop after processing one packet. My idea is to add a switch to do that. Do I get support for this and how should the switch be called? E.g. "-s" for single?
The text was updated successfully, but these errors were encountered: