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

Proper M5C support #12

Open
iHatim1 opened this issue Oct 19, 2024 · 6 comments
Open

Proper M5C support #12

iHatim1 opened this issue Oct 19, 2024 · 6 comments

Comments

@iHatim1
Copy link

iHatim1 commented Oct 19, 2024

I installed the add-on and integration. Installation went well and the add-on web ui is working and showing all the info. However, when i use the integration and add my M5C printer the value are all unknown or not showing the correct state (printing and temps) the only sensors that are properly working are the gcode image and the progress percentage

@sondregronas
Copy link
Owner

Is the gcode image not the default placeholder, and the percentage not 0? And do they show up correctly on the ankerctl dashboard?

The sensors only populate once an MQTT connection has been established (and turned green on the ankerctl dashboard). The AddOn or Home Assistant logs should reflect this (or so I thought).

image

I don't own an M5C myself but as far as I know is that if ankerctl works as expected, then the component should too. From what I could tell it should be working, at least judging from this Ankermgmt/ankermake-m5-protocol#130 (comment)

@iHatim1
Copy link
Author

iHatim1 commented Oct 19, 2024

Here are images for the UI and home assistant
IMG_9789
IMG_9790

I tried to reload as well but still no value changes

@sondregronas
Copy link
Owner

sondregronas commented Oct 19, 2024

Thats weird. Are you using my addon, or the ankermgmt one? My version includes changes from this PR (Ankermgmt/ankermake-m5-protocol#160)

I'm afraid I'm not sure how to proceed in troubleshooting this, as all the communication is handled by ankerctl. The home assistant component only listens for the messages sent by ankerctl. Is there anything in the home assistant logs?

These are the relevant lines for the home assistant component, all it does is read the websocket of ankerctl. There's nothing I can do with the home assistant component, it would have to be resolved upstream.

https://github.com/sondregronas/ankermake-hass-component/blob/dev/custom_components/ankermake/__init__.py#L94

https://github.com/sondregronas/ankermake-hass-component/blob/dev/custom_components/ankermake/ankermake_mqtt_adapter.py#L268-L274

I'm not so familiar with the ankerctl codebase, nor do I have access to an M5C, but afaik the command types should be shared between M5 and M5C. This issue might be relevant Ankermgmt/ankermake-m5-protocol#137, and the command types and values in the comments of the issue are identical to the ones being read from this component.

@iHatim1
Copy link
Author

iHatim1 commented Oct 19, 2024

Yes I’m using your version of the add-on.
I dont really know much on how to investigate the issue I just try to follow any provided instructions 😅.
I just noted also that the MQTT keeps connecting and disconnecting almost every 5 seconds as you see in the image here
IMG_9791

but the connection appear stable in the Ui

@sondregronas
Copy link
Owner

sondregronas commented Oct 19, 2024

Thats very strange. The state of MQTT is not determined by Home Assistant, but by ankerctl / anker. I'm afraid I'm not sure why it's happening to you, but it is beyond my control. (https://github.com/sondregronas/ankermake-m5-protocol/blob/de707c2ca85452af2fadb34e37fc3b6ffa7debf6/web/__init__.py#L449-L456)

Try restarting the AddOn and the printer, mine auto restarts every 2hrs to circumvent a strange issue where ankerctl loses stability. If that doesn't work I cannot do more than guess what the issue could be; network instability?

That specific home assistant sensor works by visiting the ankerctl instance at the following url: http://<ip-address>:4470/api/ankerctl/status. Try to refresh it and see if you notice something odd.

There should be a field for state in mqttqueue. Note: mine is "running" even though my printer is off - it's communicating with an external server:

{
    "eu": "make-mqtt-eu.ankermake.com",
    "us": "make-mqtt.ankermake.com",
}

@iHatim1
Copy link
Author

iHatim1 commented Oct 22, 2024

I still have the issue, still couldn’t figure out why it’s happening. Also just noted that the sensors values does work when the print finishes 🤷🏽‍♂️ ( it shows the temps and that the state is finished ), really strange. I hope someone more tech savvy than me can solve it someday.

Thank you for your work 🙏🏽.

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