-
Notifications
You must be signed in to change notification settings - Fork 141
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
Add optional reset-before-request-data #95
base: master
Are you sure you want to change the base?
Conversation
085d981
to
6a9956a
Compare
fixed both issues |
Sorry, but i don't think mbus_init_slave and mbus_init_slaves_str are a true benefit to the library. Why not using mbus_send_ping_frame() directly? It's an issue in mbus-serial-request-data-multi-reply.c so it should be fixed there. Here is my suggestion add additional mbus_send_ping_frame with address = MBUS_ADDRESS_BROADCAST_NOREPLY add the end of mbus_init_slaves. I don't like new parameters for "special" devices. It's good if the tools work generally. Does it fix the issue with Sontex Supercal? |
I removed mbus_init_slave* completely, you are right they have too little functionality of their own. Certain devices need to be reset, I don't like to side-effects of sending a broadcast reset to all devices. Other implementations also offer to send reset before request (e.g. Terminal-Systems MGW986). |
But we don't send a SND_NKE in case of a secondary address. (Yes, i know that a SND_NKE deselect the slave but nobody prevent us from resending a select again). As a user i would expect the same reset behavior. Doesn't #90 appear in case of secondary address? |
I don't see how this, in its current form, solves anything. You'd have Quoting "The M-Bus: A Documentation, Rev. 4.8" (page 28-29):
The default really, really should send resets, and then start with the Currently, the only correctly working scenario is multi-reply with If you want / need a way to skip the reset, you'll also need to specify I don't see any reason to always send a reset to secondary address. Page 64:
Only way I can see that would allow continuing requests to a secondary I would suggest that, instead of adding an option and all that, fixing cc @Spindel |
I don't have much to add there, @delreich. More options won't really fix the somewhat broken state it's in right now, and I've always been disappointed in seeing an "--unbreak-something" option for any software. |
Looks like Quick examples:
Might be more, but 8pm on a Friday isn't really the time to be looking for them. |
The rationale for the `init_slaves` call seems undocumented (it was added when the `mbus-{tcp,serial}-request-data-multi-reply.c` files were added to `libmbus`). If the slaves do not respond to the ping operation, then it needlessly wastes double whatever the time-out value is set to. The ping immediately before communicating with a slave by primary address seems to be a work-around to a specific model of M-Bus meter: the Sontex Supercal531. rscada/libmbus#95 This adds a boolean flag that permits enabling or disabling this work-around as needed.
This feature is needed to read Sontex Supercal 531 reliably