marcolivierarsenault / moonraker-home-assistant

Home Assistant integration for Moonraker, Klipper and Mainsail
https://moonraker-home-assistant.readthedocs.io
MIT License
210 stars 25 forks source link

Thumbnail not showing on multi-instance setup #355

Open srbjessen opened 4 weeks ago

srbjessen commented 4 weeks ago

Version of the moonraker integration

1.2.1

Describe your setup

Macbook Pro 2014 Linux Mint image Mainsail 2 printers connected (Biqu BX and JGMaker Artist-D Pro) separate folders and instances

Describe the bug

Thumbnail doesn't show, just says "inactive" constantly. Orcaslicer, prusaslicer, superslicer gives same problem. 300x300, 32x32 PNG thumbnails in slicers.

Moonraker Logs

home-assistant_moonraker_2024-06-08T00-01-55.555Z.log Not sure where to find config. Nothing in my yaml's

marcolivierarsenault commented 4 weeks ago

what is your printer model.

Also you specify multi-instance. Does it work in single instance

Subcode commented 3 weeks ago

Im having the same issue, looks like its not looking on the right port. Single instance,

2024-06-09 04:58:22.663 DEBUG (MainThread) [custom_components.moonraker.camera] Trying to get thumbnail 2024-06-09 04:58:22.663 DEBUG (MainThread) [custom_components.moonraker.camera] Thumbnail new_path: .thumbs/CE3E3V2_ESP32_Devkit_v4_Snap_Fit_Case_Top-720x720.png 2024-06-09 04:58:22.664 DEBUG (MainThread) [custom_components.moonraker.camera] Fetching new thumbnail: http://192.168.1.182/server/files/gcodes/.thumbs/CE3E3V2_ESP32_Devkit_v4_Snap_Fit_Case_Top-720x720.png 2024-06-09 04:58:22.699 DEBUG (MainThread) [custom_components.moonraker.camera] Trying to get thumbnail

It is trying to look at: http://192.168.1.182/server/files/gcodes/.thumbs/CE3E3V2_ESP32_Devkit_v4_Snap_Fit_Case_Top-720x720.png But the correct url would be: http://192.168.1.182:7125/server/files/gcodes/.thumbs/CE3E3V2_ESP32_Devkit_v4_Snap_Fit_Case_Top-720x720.png

srbjessen commented 3 weeks ago

what is your printer model.

Also you specify multi-instance. Does it work in single instance

1x Biqu BX 1x JGMaker Artist-D Pro

Both show thumbnails from slicer in Mainsail interface, but nothing is passed on to HA.

Only have this setup with multi-instance, only specified in case it matters :-)

srbjessen commented 3 weeks ago

Im having the same issue, looks like its not looking on the right port. Single instance,

2024-06-09 04:58:22.663 DEBUG (MainThread) [custom_components.moonraker.camera] Trying to get thumbnail 2024-06-09 04:58:22.663 DEBUG (MainThread) [custom_components.moonraker.camera] Thumbnail new_path: .thumbs/CE3E3V2_ESP32_Devkit_v4_Snap_Fit_Case_Top-720x720.png 2024-06-09 04:58:22.664 DEBUG (MainThread) [custom_components.moonraker.camera] Fetching new thumbnail: http://192.168.1.182/server/files/gcodes/.thumbs/CE3E3V2_ESP32_Devkit_v4_Snap_Fit_Case_Top-720x720.png 2024-06-09 04:58:22.699 DEBUG (MainThread) [custom_components.moonraker.camera] Trying to get thumbnail

It is trying to look at: http://192.168.1.182/server/files/gcodes/.thumbs/CE3E3V2_ESP32_Devkit_v4_Snap_Fit_Case_Top-720x720.png But the correct url would be: http://192.168.1.182:7125/server/files/gcodes/.thumbs/CE3E3V2_ESP32_Devkit_v4_Snap_Fit_Case_Top-720x720.png

That seems like a reasonable conclusion. Would also have been my guess that it had to do with the ports. Unfortunately I'm not skilled enough to change and test alternative setups/codes.

marcolivierarsenault commented 3 weeks ago

can you ssh in the printer and check what is the exact path of that thumbnail from /

Subcode commented 3 weeks ago

For the record, i changed camera.py line 167:

    response = await self._session.get(
        f"http://{self.url}/server/files/gcodes/{new_path}"
    )

to:

    response = await self._session.get(
        f"http://{self.url}:7125/server/files/gcodes/{new_path}"
    )

And now it just works fine.

srbjessen commented 3 weeks ago

Thats awesome, then we just need it to function with multi-instance. In my case port 7126 & 7127Sendt fra min Galaxy -------- Oprindelig besked --------Fra: Subcode @.> Dato: 09.06.2024 18.59 (GMT+01:00) Til: marcolivierarsenault/moonraker-home-assistant @.> Cc: srbjessen @.>, Author @.> Emne: Re: [marcolivierarsenault/moonraker-home-assistant] Thumbnail not showing on multi-instance setup (Issue #355) For the record, i changed camera.py line 167: response = await self._session.get( f"http://{self.url}/server/files/gcodes/{new_path}" )

to: response = await self._session.get( f"http://{self.url}:7125/server/files/gcodes/{new_path}" )

And now it just works fine.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

srbjessen commented 3 weeks ago

for one instance the path is: /home/klip/BIQUBX_data/gcodes/.thumbs for the other: /home/klip/ARTISTD_data/gcodes/.thumbs

I'm guessing that makes it harder, since all names will depend on user setup of multiinstance...