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

MQTT client in Feeder has too broad of a filter #48

Open
kruton opened this issue Feb 5, 2021 · 3 comments
Open

MQTT client in Feeder has too broad of a filter #48

kruton opened this issue Feb 5, 2021 · 3 comments

Comments

@kruton
Copy link
Collaborator

kruton commented Feb 5, 2021

When sending a message to the feeder, it seems like the client is getting its own messages back. This is probably due to an overly broad subscription.

2021-02-05 03:32:23,409   INFO     uvicorn.access: 10.42.1.1:20837 - "POST /api/v1/feeder/874efd08bad4cfd26a0e349d9af44d9f475e691e/feed HTTP/1.1" 200
2021-02-05 03:32:23,412   INFO     feeder.util.mqtt.client: Unknown message: krs/cmd/stg/84d982191f1b42c6f9ff482e51248f55dc784561 => bytearray(b'{"hid": "ijixzgphkbpgnumbxskxymsbticmivev", "name": "SendCommand", "encrypted": false, "parameters": {"deviceHid": "874efd08bad4cfd26a0e349d9af44d9f475e691e", "command": "feed", "payload": "{\\"portion\\": 0.125}"}}')
2021-02-05 03:32:25,975   INFO     uvicorn.access: 10.42.1.1:20837 - "GET /api/v1/feeder/history?size=10&page=1 HTTP/1.1" 200
@mbillow
Copy link
Member

mbillow commented Feb 6, 2021

Yah, we likely only need to subscribe the client to krs/api/# and krs/tel/#. Keep in mind though, that we will still get some of our own messages back because we also publish on these topics.

@kruton
Copy link
Collaborator Author

kruton commented Feb 6, 2021

The device only sends response messages back on krs.tel.gts.# and krs.api.gts.# which this service shouldn't be sending. I think the gts is gateway-to-server and stg is server-to-gateway to remove the ambiguity.

@mbillow mbillow closed this as completed in ba2e018 Feb 7, 2021
mbillow added a commit that referenced this issue Feb 7, 2021
Only subscribe to gts topics (fixes #48)
kruton added a commit that referenced this issue Feb 16, 2021
This reverts commit ba2e018.

It appears that this may cause issue #61.
@mbillow
Copy link
Member

mbillow commented Feb 21, 2021

Reopening since we needed to revert this. This time we should use dots... not dashes. 🥲

@mbillow mbillow reopened this Feb 21, 2021
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

No branches or pull requests

2 participants