-
Notifications
You must be signed in to change notification settings - Fork 7.8k
shell: mqtt: use topic levels #92677
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
base: main
Are you sure you want to change the base?
shell: mqtt: use topic levels #92677
Conversation
e6a8228
to
248510b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind the change but this will be breaking users so needs to be mentioned in the migration guide.
Bonus points if:
- you consider adding some documentation for the MQTT backend in https://docs.zephyrproject.org/latest/services/shell/index.html#backends (of course this would be a different PR, not asking you to do it here)
- you consider making the topics being used something that can be configured via Kconfig, since things are pretty inflexible at the moment, as your PR basically highlights. I would argue this could/should be done in this very PR since it would effectively make this change non-breaking for folks if you keep the same default value as before.
Thanks!
Since 4.2 hard freeze is tomorrow and there no 4.3 release files I created #92961 |
Thank you for your review and insightful feedback @kartben .
I think it is difficult to make something that is backward compatible and still follow MQTT best practice. I would like to have The backward compatible solution would be to make only two Kconfig which would have shared MQTT levels:
Which is a bit redundant. Semi-related: I think there is a need for a common MQTT topic device identifier in Kconfig somewhere, so everything that uses MQTT has the same identifier. |
248510b
to
b7c4db2
Compare
b7c4db2
to
a7d2f80
Compare
a7d2f80
to
fcb4bc0
Compare
fcb4bc0
to
baca20e
Compare
@kartben does my comment make any sense? |
a24ec28
to
8799cf7
Compare
I went with this. It is a bit redundant but it allows backward compatibility and also allows adding another level e.g. |
8799cf7
to
b1f55f4
Compare
Change topic from <device_id>_rx (and tx) to <device_id>/sh/rx. This allows use of wildcards. E.g. subscribe to all devices "+/sh/tx". Level "sh" is added to the topic to make it less generic and prevent potential clashes with other topics. The topic part after <device_id> is configurable via Kconfig. Signed-off-by: Jeppe Odgaard <[email protected]>
Replace `select NET_MGMT` and `select NET_MGMT_EVENT` with `select NET_CONNECTION_MANAGER` to get L4 events. Signed-off-by: Jeppe Odgaard <[email protected]>
b1f55f4
to
cf68580
Compare
@kartben can you please revisit? |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Sorry for the delay in coming back to this and thank you for your patience
kartben's request has been resolved so this PR is ready to revisit @jakub-uC :) |
Change topic from <device_id>_rx (and tx) to <device_id>/sh/rx.
This allows use of wildcards. E.g. subscribe to all devices "+/sh/tx".
Level "sh" is added to the topic to make it less generic and prevent potential clashes with other topics.