modrzew / hass-flashforge-adventurer-3

Home Assistant integration providing support for the FlashForge Adventurer 3 3D printer.
20 stars 10 forks source link

No progress recognition (Guider IIs) #11

Open Boeng01 opened 1 year ago

Boeng01 commented 1 year ago

First of all thanks a lot for this integration. I'm using it with a FlashForge Guider 2S and can confirm that it works nearly flawlessly with this Model.

Only thing i mentioned is that the progress state isn't recognized - so it's always 0% Every other state - status of the printer, temperature, camera etc. is recognized perfectly. Is there anything i can do to get the progress recognition working? Would be happy to share any helpful things since i'm not able to code myself.

Thanks

darek-margas commented 1 year ago

I've added PR fixing this. New firmware added layers, now it is possible to add sensors to return progress in layer number too. I didn't look at it but may get to it later.

Boeng01 commented 1 year ago

Thanks for the response. Anything i can do to support?Am 01.04.2023 01:09 schrieb Darek Margas @.***>: I've added PR fixing this. New firmware added layers, now it is possible to add sensors to return progress in layer number too. I didn't look at it but may get to it later.

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

darek-margas commented 1 year ago

Thanks for the response. Anything i can do to support?

Not really, just wait until is merged into or use my fork till then.

modrzew commented 1 year ago

Hey @Boeng01, unfortunately Adventurer 3 is the only printer I have on hand so it's really hard to debug it. If it's related to what @darek-margas wrote about (the printer returning info about layers) then the potential fix looks relatively straightforward; otherwise it'll be much harder.

modrzew commented 1 year ago

I just pushed a new version of the integration 1.0.3, which adds some debug messages to logs. Can you update and also enable logging by setting this in your configuration.yaml:

logger:
  default: warn
  logs:
    custom_components.flashforge_adventurer_3: debug

and then paste the relevant logs here? For progress specifically we're interested in the ~M27 command.

darek-margas commented 1 year ago

Hey @Boeng01, unfortunately Adventurer 3 is the only printer I have on hand so it's really hard to debug it. If it's related to what @darek-margas wrote about (the printer returning info about layers) then the potential fix looks relatively straightforward; otherwise it'll be much harder.

It certainly works on my v4. I have no idea if this is v4 specific or just newer firmware added it. Regex fixed problem.

Boeng01 commented 1 year ago

I just pushed a new version of the integration 1.0.3, which adds some debug messages to logs. Can you update and also enable logging by setting this in your configuration.yaml:

logger:
  default: warn
  logs:
    custom_components.flashforge_adventurer_3: debug

and then paste the relevant logs here? For progress specifically we're interested in the ~M27 command.

Sorry for the delayed answer. I will test this as soon as i got time for it. Could be after the weekend. Thanks for looking into this :)

darek-margas commented 1 year ago

Guys, I did it by traffic capture hence my PR which works on my v4 image

modrzew commented 1 year ago

Hey @Boeng01 @darek-margas, I just pushed the version 1.0.4 — can you try updating and telling me if the progress is reported now?

Boeng01 commented 1 year ago

Will start a print job this morning and see what happens. Will give an answer soon.

Boeng01 commented 1 year ago

Started a print and observed what happens. Unfortunately i get no progress indication on the entity. Looking at the debug-log there seems to happen something on Command M27 - here is a snip of the log:

2023-04-13 10:10:55.384 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Response from the printer: b'CMD M27 Received.\r\nSD printing byte 14/1000\r\nok\r\n' 2023-04-13 10:11:55.373 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Sent "~M27" to the printer 2023-04-13 10:11:55.379 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Response from the printer: b'CMD M27 Received.\r\nSD printing byte 15/1000\r\nok\r\n' 2023-04-13 10:12:55.375 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Sent "~M27" to the printer

It seems that the Progress is reported there, since M27 started at 0 and went up since start.

I updated the integration via HACS - do i have to reconfigure or re-add it on the devices tab? - edit: tried that, but the result is the same.

darek-margas commented 1 year ago

Started a print and observed what happens. Unfortunately i get no progress indication on the entity. Looking at the debug-log there seems to happen something on Command M27 - here is a snip of the log:

2023-04-13 10:10:55.384 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Response from the printer: b'CMD M27 Received.\r\nSD printing byte 14/1000\r\nok\r\n' 2023-04-13 10:11:55.373 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Sent "~M27" to the printer 2023-04-13 10:11:55.379 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Response from the printer: b'CMD M27 Received.\r\nSD printing byte 15/1000\r\nok\r\n' 2023-04-13 10:12:55.375 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Sent "~M27" to the printer

It seems that the Progress is reported there, since M27 started at 0 and went up since start.

I updated the integration via HACS - do i have to reconfigure or re-add it on the devices tab? - edit: tried that, but the result is the same.

Did you upgrade printer firmware to latest? Is it normal v4 or lite or something?

Boeng01 commented 1 year ago

It's the latest Firmware i get, since the printer isn't able to update automatically any more after a defect motherboard change. The latest firmware on the website is older than the one on my printer, so i think it's the latest available for this model. Like i mentioned before it's an Guider 2S, not an Adventurer.

darek-margas commented 1 year ago

Like i mentioned before it's an Guider 2S, not an Adventurer.

OK, this makes sense. So it seems my Adventurer 4 sends progress in percents followed by layers, while yours sends progress in promiles and no layers. It seems it has to be back to printer choice and conditional regex or maybe multiple regex matching and selecting non-empty return.

Boeng01 commented 1 year ago

Like i mentioned before it's an Guider 2S, not an Adventurer.

OK, this makes sense. So it seems my Adventurer 4 sends progress in percents followed by layers, while yours sends progress in promiles and no layers. It seems it has to be back to printer choice and conditional regex or maybe multiple regex matching and selecting non-empty return.

Not exactly sure if i know what you're talking about, but i'm sure you're right ;) anyway, can i do anything further to help getting this information for my printer usable in HA?

modrzew commented 1 year ago

Hey @Boeng01, sorry for the delay. Quick question, when the message containing SD printing byte 15/1000 showed in the logs, do you remember if the print job progress as reported by the printer was 15% or 1.5%? Curious if those are really promiles or just a typo in the message 🤔

Boeng01 commented 1 year ago

Hey @Boeng01, sorry for the delay. Quick question, when the message containing SD printing byte 15/1000 showed in the logs, do you remember if the print job progress as reported by the printer was 15% or 1.5%? Curious if those are really promiles or just a typo in the message 🤔

No worries, finally it's not that i can't use the printer in this state. Thanks for looking into it further. I'm not sure, tbh, and have to check again with the next print. Right now i would say it was 15%, but to be sure i will check.

Thanks

Boeng01 commented 1 year ago

I was wrong, it's promille:

2023-04-26 07:37:36.524 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Sent "~M601 S1" to the printer 2023-04-26 07:37:36.532 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Response from the printer: b'CMD M601 Received.\r\nControl Success V2.1.\r\nok\r\n' 2023-04-26 07:37:36.533 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Sent "~M27" to the printer 2023-04-26 07:37:36.540 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Response from the printer: b'CMD M27 Received.\r\nSD printing byte 741/1000\r\nok\r\n' 2023-04-26 07:37:36.540 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Sent "~M105" to the printer 2023-04-26 07:37:36.547 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Response from the printer: b'CMD M105 Received.\r\nT0:210 /210 B:50/50\r\nok\r\n' 2023-04-26 07:37:36.548 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.sensor] Finished fetching My sensor data in 0.047 seconds (success: True) 2023-04-26 07:38:36.508 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Sent "~M601 S1" to the printer 2023-04-26 07:38:36.521 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Response from the printer: b'CMD M601 Received.\r\nControl Success V2.1.\r\nok\r\n' 2023-04-26 07:38:36.521 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Sent "~M27" to the printer 2023-04-26 07:38:36.537 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Response from the printer: b'CMD M27 Received.\r\nSD printing byte 742/1000\r\nok\r\n' 2023-04-26 07:38:36.537 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Sent "~M105" to the printer 2023-04-26 07:38:36.546 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.protocol] Response from the printer: b'CMD M105 Received.\r\nT0:210 /210 B:50/50\r\nok\r\n' 2023-04-26 07:38:36.547 DEBUG (MainThread) [custom_components.flashforge_adventurer_3.sensor] Finished fetching My sensor data in 0.059 seconds (success: True)

darek-margas commented 1 year ago

I was wrong, it's promille:

That was my guess in my previous comment.

modrzew commented 1 year ago

I see, thanks @Boeng01! I just pushed a small update (commit 1c6e36066abebd22599d8bc698141c11fa91fb8e), can you try installing the master version (as opposed to 1.0.4) and tell me whether the progress is there? Cheers 🙂

Boeng01 commented 1 year ago

image

Looks good to me :) Thank you very much!

Maybe you should rename the integration at one point, since it's working on mor than 'adventurer 3' machines now?

modrzew commented 1 year ago

Maybe you should rename the integration at one point, since it's working on mor than 'adventurer 3' machines now?

Thanks! I thought about it at one point and decided to make this integration specific to Adventurer 3 only, as that's the printer I have so I can ensure it's always supported. If I made it target all Flashforge printers then maintaining it would require much bigger effort from me 🙂

Boeng01 commented 1 year ago

Oh, i understand. Thanks for replying. That makes sense. So it stays with this name and just works for my printer - i'm absoluteley fine with that :) Great work, thanks a lot.