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

Failed to Dispense: Unknown Error (Although it did dispense correctly) #67

Open
snirsh opened this issue Jun 21, 2021 · 3 comments
Open

Comments

@snirsh
Copy link

snirsh commented Jun 21, 2021

Hi guys,
First, This project is amazing! I've been going over it testing and running on a raspberry for almost two weeks now and I'm super excited that I got my feeder to work :)

Anyway, I'm trying to debug this myself but I'm not sure what the problem is.
Logs show:

petnet-feeder-service    | 2021-06-21 11:00:25,176   ERROR    feeder.util.mqtt.client: Failed to decode message: bytearray(b'{"_|deviceHid":"89dfa32aa126ff9964811ffffdf7e1c69c43b82a","s|msg_type":"trace","i|tl":32,"s|ts":"Start - D\xdf, Portion: 0 tbsp(309448g), Turns: 23, Bowl: 0g, Hopp"}')
petnet-feeder-service    | Traceback (most recent call last):
petnet-feeder-service    |   File "/tmp/feeder/util/mqtt/client.py", line 102, in handle_message
petnet-feeder-service    |     payload = json.loads(packet.payload.data)
petnet-feeder-service    |   File "/usr/local/lib/python3.8/json/__init__.py", line 343, in loads
petnet-feeder-service    |     s = s.decode(detect_encoding(s), 'surrogatepass')
petnet-feeder-service    | UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdf in position 106: invalid continuation byte

As far as I've managed to debug the problem I think it comes with small amounts of dispensed food.

Things I've noticed:
1/ It does work correctly on 1/4 cup of food.
2/ It doesn't work on 1/8 and less.
3/ The GUI shows the error included in the message.

Things I thought might help but didn't: (FYI, I'm running on a Raspberry Pi Zero W )
1/ Changed the device locale and added en_US.UTF-8 and en_US.ISO-8859-15.
2/ Tried to reset both the service and the feeder.
3/ Checked if it's not working for schedule only (It doesn't work for scheduled/snack/measuring).

Any help would be appreciated!

@siyuxing
Copy link

I got the same Exception, my problem is related to a issue with mosquitto (MQTT) service. Restarting the service by running sudo systemctl restart mosquitto.service fixed the problem for me.

@snirsh
Copy link
Author

snirsh commented Jan 3, 2022

@siyuxing Hi, thanks for the comment! did you run this command on your machine? or the docker container? if the latter, how did you run it on the container? I can't seem to be able to do so

@siyuxing
Copy link

siyuxing commented Jan 8, 2022

The issue I got is related to MQTT service crashes. Even after restarting the service manually. The feeder container process lose track of the MQTT client and cannot send out the requests.

I fixed the issue by running the command sudo systemctl stop mosquitto.service on my feeder host and then restarting the container process.

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