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

(rebase/build) Add M117 support (print progress with octoprint) #3147

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Monkopedia
Copy link

Forking #1497 and trying to get it to build.

@jvasileff
Copy link

I tried to test this. It appears that breaking the appendix on the Buddy Board is enough to bypass the firmware signature check, and while I had no trouble installing the firmware, nothing I tried would boot on the MK4.

For the build machine, I started with a fresh Ubuntu EC2 instance, and installed dependencies:

sudo apt update
sudo apt install python3 python-is-python3 python3-pip

I spent most of my effort with the base v4.6.1 code: (although this PR did compile fine)

git clone https://github.com/prusa3d/Prusa-Firmware-Buddy.git

AFAICT, the best build command is:

python utils/build.py --build-type release --generate-bbf --bootloader yes --preset mk4-xBuddy027c-400step-planetary -DDEVELOPMENT_ITEMS_ENABLED:BOOL=no

I tried several variations of that command, as well as the mk4-xBuddy034-400step-planetary preset. Nothing worked. All builds with --bootloader yes resulted in a boot loop, and all builds with --bootloader no froze during boot when the progress bar reached 50%.

@Monkopedia
Copy link
Author

I tried to test this. It appears that breaking the appendix on the Buddy Board is enough to bypass the firmware signature check, and while I had no trouble installing the firmware, nothing I tried would boot on the MK4.

For the build machine, I started with a fresh Ubuntu EC2 instance, and installed dependencies:

sudo apt update
sudo apt install python3 python-is-python3 python3-pip

I spent most of my effort with the base v4.6.1 code: (although this PR did compile fine)

git clone https://github.com/prusa3d/Prusa-Firmware-Buddy.git

AFAICT, the best build command is:

python utils/build.py --build-type release --generate-bbf --bootloader yes --preset mk4-xBuddy027c-400step-planetary -DDEVELOPMENT_ITEMS_ENABLED:BOOL=no

I tried several variations of that command, as well as the mk4-xBuddy034-400step-planetary preset. Nothing worked. All builds with --bootloader yes resulted in a boot loop, and all builds with --bootloader no froze during boot when the progress bar reached 50%.

I tried to test this. It appears that breaking the appendix on the Buddy Board is enough to bypass the firmware signature check, and while I had no trouble installing the firmware, nothing I tried would boot on the MK4.

For the build machine, I started with a fresh Ubuntu EC2 instance, and installed dependencies:

sudo apt update
sudo apt install python3 python-is-python3 python3-pip

I spent most of my effort with the base v4.6.1 code: (although this PR did compile fine)

git clone https://github.com/prusa3d/Prusa-Firmware-Buddy.git

AFAICT, the best build command is:

python utils/build.py --build-type release --generate-bbf --bootloader yes --preset mk4-xBuddy027c-400step-planetary -DDEVELOPMENT_ITEMS_ENABLED:BOOL=no

I tried several variations of that command, as well as the mk4-xBuddy034-400step-planetary preset. Nothing worked. All builds with --bootloader yes resulted in a boot loop, and all builds with --bootloader no froze during boot when the progress bar reached 50%.

@jvasileff I'm sorry to say I don't think I'll be much help remote debugging this. I have plenty of experience doing firmware stuff, but haven't actually worked with the buddy board or prusa devices at all yet, and need some hands on experience before I could even guess whats wrong. I'll update here if I get my hands on a device and can make some progress on fixing the boot issues (or determining if a different build config is key).

@jvasileff
Copy link

@Monkopedia no worries. I primarily wanted to document what I did to give others that want to try a head start, and to see if anyone had any quick ideas.

At this point, I suspect we are missing something from Prusa. The build is pretty easy and straightforward, but it just doesn't boot.

@jvasileff
Copy link

For good measure, I gave it another try with:

python utils/build.py --preset mk4-xBuddy027c-400step-planetary,mk4-xBuddy034-400step-planetary

which produced:

mk4-xbuddy027c-400step-planetary_release_boot.bbf
mk4-xbuddy027c-400step-planetary_release_noboot.bbf
mk4-xbuddy034-400step-planetary_release_boot.bbf
mk4-xbuddy034-400step-planetary_release_noboot.bbf

None of these booted.

@jvasileff
Copy link

I noticed the latest firmware is available in tags, and not the master branch. It looks like Prusa is no longer pushing individual commits. But the good news is that I was able to compile, install, and boot firmware tag v4.7.2 with

python utils/build.py --preset mk4 --build-type release --generate-bbf --bootloader yes

Unfortunately, after rebasing this patch onto v4.7.2 and testing with OctoPrint, the patch had no effect. The LCD doesn't show print status, and filament runout is not reported.

Note that in order to compile after the rebase, the following patch is required:

# git diff --cached
diff --git a/src/gui/screen_printing_serial.cpp b/src/gui/screen_printing_serial.cpp
index 4ee9251d..e9aea0ca 100644
--- a/src/gui/screen_printing_serial.cpp
+++ b/src/gui/screen_printing_serial.cpp
@@ -30,7 +30,7 @@ screen_printing_serial_data_t::screen_printing_serial_data_t()
 
     SetButtonIconAndLabel(BtnSocket::Right, BtnRes::Disconnect, LabelRes::Disconnect);
 
-    w_message.font = resource_font(IDR_FNT_SMALL);
+    w_message.set_font(resource_font(IDR_FNT_SMALL));
     w_message.SetAlignment(Align_t::CenterBottom());
     w_message.SetPadding({ 0, 2, 0, 2 });
 }
diff --git a/src/gui/window_lcd_message.cpp b/src/gui/window_lcd_message.cpp
index a63ffa4a..7c805181 100644
--- a/src/gui/window_lcd_message.cpp
+++ b/src/gui/window_lcd_message.cpp
@@ -34,7 +34,7 @@ WindowLCDMessage::WindowLCDMessage(window_t *parent, Rect16 rect)
     last_lcd_message_text[LCD_MESSAGE_MAX_LEN] = 0;
     lcd_message_text[0] = 0;
     lcd_message_text[LCD_MESSAGE_MAX_LEN] = 0;
-    font = resource_font(IDR_FNT_SMALL);
+    set_font(resource_font(IDR_FNT_SMALL));
     SetAlignment(Align_t::Center());
 }

@@ -31,6 +31,11 @@ bool GcodeSuite::process_parsed_command_custom(bool no_ok) {
case 50:
PrusaGcodeSuite::M50(); // selftest
break;
case 117:
PrusaGcodeSuite::M117();
if (!no_ok)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just break here. The ok_to_send stuff is handled below.

@bkerler
Copy link
Contributor

bkerler commented Dec 21, 2023

What's the current status of this PR, does it work ? Or does it need work on it and if, what work is needed ?

@timur-tabi
Copy link

timur-tabi commented Apr 14, 2024

See also #3846.

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

Successfully merging this pull request may close these issues.

7 participants