petnet-feeder-service
petnet-feeder-service copied to clipboard
MQTT client in Feeder has too broad of a filter
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
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.
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.
Reopening since we needed to revert this. This time we should use dots... not dashes. 🥲