EN
  • Čeština
  • Español
  • Italiano
  • Deutsch
  • Polski
  • Français
Login

Installing MINI404 simulator

Relevant for:
Last updated 4 months ago
This article is also available in following languages: 
CSDEESFRITPL
Prusa Research does not develop or provide support for this system! We can only address direct errors in this guide and improve clarity based on comments. Our technical/customer support can not provide help in regards to technical/installation difficulties, troubleshooting, and feature requests. For this, we recommend checking out the documentation of the project on Github.

MK/MINI404 are simulators of the RAMBO/Einsy Rambo/Buddy platforms. It is developed on and runs natively under Linux. It is possible to build it under Windows using Cygwin, but here we will go the Linux way.

We at Prusa Research use his tool for testing firmware in development and beautiful crisp screenshots for Github changelogs and our Knowledgebase. There is a range of options for automation through scripts, and is a great way to test your own custom builds of the firmware or how community translations format, act and read on our various printer's displays. Or perhaps you simply want to see the printer in action and explore the menu layout and solution we have come up with, should you be considering an Original Prusa printer.

This is a project that is still work-in-progress. Some of the bugs or less streamlined procedures mentioned here may have been fixed by this time and new functionality may have been added. This guide has a goal to be a layman's approach to install and get started playing with this wonderful tool, as well as a shoutout to the creator and excellent volunteer community contributor known as VintagePC.

Prerequisites:

A distribution of Linux must be installed. Can be installed on a VM, but we will not cover the installation and setup of that here. Note that big graphics issues have been experienced under VirtualBox on Windows 10.

Here, we are running it on Linux Mint (lightweight Xfce version), simply because the writer prefers it. It is actually developed under OpenSUSE. Dependencies and commands outlined here are based and tested on Linux Mint, but this guide should cover most Debian/Ubuntu-based distros. Any distro will probably do, but necessary dependencies may differ between distros. If you are unfamiliar with Linux we recommend getting a Debian-based distro as Debian is well documented and is what this guide will cover dependencies for.

One negative of this distro is the rather large install size, so be sure the VM has:

  • At least 15-20GB of HDD.
  • Access to at least 2 CPU cores
  • Enabled Graphics acceleration
  • Shared clipboard
  • Has a shared folder with the host machine (optional)

We will install one simulator after the other, and cover basic use in a linked article. You should start with MK404, as this is a little easier and can generate some files used in MINI404, which MINI404 can not generate on its own (or at least not as easily).

Any distro will probably do, but if you are unfamiliar with Linux I recommend getting a Debian-based distro as Debian is well documented and is what this guide will cover.

Updating and installing dependencies

Be ready to become a super hacker as we enter... The TERMINAL! We will assume you have a fresh install of Linux here, but the procedure shouldn’t matter if you run Linux already. You may just have some of the needed packages already.

Pro-tip: Paste using Shift + Insert, not ctrl + V. Pressing the up and down key will give you the previously entered command. The Tab key is autofill.

Open Konsole or whatever terminal you find (hotkey: ctrl + alt + T) and start updating the system by running:

sudo apt-get update -y

sudo apt-get upgrade -y

This may take some time. Let the lines scroll until you get the command line again. There are probably more surgical ways of doing this, but for the sake of simplicity, this is how we roll.

We will install:

  • Git
  • Cmake
  • Python
  • Dependencies (deps).

The command below should install everything you need to run the simulator.

sudo apt-get install git libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev cmake libsasl2-dev libsdl1.2-dev libseccomp-dev libsnappy-dev libssh2-1-dev libelf-dev gcc-avr libglew-dev freeglut3-dev libsdl-sound1.2-dev libpng-dev libsdl2-dev libgtk-3-dev libstdc++6 g++-7 python2-dev python3-dev libjpeg-dev libwebp-dev libtiff5-dev libsdl2-image-dev libsdl2-image-2.0-0 libusb-1.0-0-dev ninja-build -y

Compile the compiler (or something like that):

sudo apt-get install build-essential -y

Reboot the machine.

sudo reboot

These dependencies and the procedure thus far are the same for MINI404 and MK404!

Installing MINI404

For installing the MK404 simulator, please see Installing MK404 simulator
Back into the terminal we go! Just make yourself comfortable. This is mostly where we will stay from now on. We won’t go into what each command does that much, but it is mostly self-evident. 
 
You should be in the home/bottom directory of the user. If in doubt you can always use cd to go to the bottom of the directory tree. cd ../ will bring you one folder back. cd ../../ two folders back, etc.. You can see folders and files in a location with ls. You are now a {linux} wizard, Harry..
 
Clone the Git repository. You should be in the root directory. Run the command cd to make sure before starting.
git clone https://github.com/vintagepc/MINI404.git
Enter the folder
cd MINI404

Loading dependencies-ish things (submodules)

git submodule init

git submodule update

Configure the build (there may be errors if you missed a previous step)

./configure --target-list=buddy-softmmu --enable-opengl

Then compile. I gave the VM two cores (half of this laptop's total), so I use two cores with -j2. This will take some time.

make -j2

Initial setup and start

The output (build) will be found in the sub-folder build/ and is called qemu-system-buddy. Enter this directory. This is where we will launch the simulator and it will hold all firmware files, bootloader, screenshots, and image files.

cd

cd MINI404/build/

Download and unzip bootloader and firmware, Using “wget [url]” and “unzip [filename]”. I have encountered issues where the filename had periods other than before the extension.

wget https://prusa-buddy-firmware-dependencies.s3.eu-central-1.amazonaws.com/bootloader-mini-1.0.0.zip

unzip bootloader-mini-1.0.0.zip

Download the latest firmware file from https://prusa3d.com/drivers. This procedure is the same for any Zip-file. Right-click the download button and "Copy link address". Paste this the link after wget to download.

wget https://cdn.prusa3d.com/downloads/firmware/prusa3d_fw_4_3_3_MINI.zip

unzip prusa3d_fw_4_3_3_MINI.zip

If you get a URL with more info, like what is in bold, you can delete everything after the filename. This is google tracking/metadata I think. https://cdn.prusa3d.com/downloads/firmware/prusa3d_fw_4_3_3_MINI.zip#_ga=2.176807781.1573756582.1632118194-1308288749.1629274326

You can now start the application with the following command while being within the same directory (MINI404/build/buddy-softmmu/). It can be used in this state, but will not have persistent memory, like saving Steel sheet profiles or other settings. We will set that up later.

./qemu-system-buddy -machine prusa-mini -kernel prusa3d_fw_4_3_3_MINI.bbf -chardev vc,id=p404-scriptcon,cols=80,rows=24

If you are in the root folder you can avoid entering the directory first, and rather do both navigation and launching the sim in one command:

cd MINI404/build/ ; ./qemu-system-buddy -machine prusa-mini -kernel prusa3d_4.3.3_MINI.bbf -chardev vc,id=p404-scriptcon,cols=80,rows=24

 Persistent flash memory for live z, language selection, and other settings

https://github.com/vintagepc/MINI404/wiki/Flash-Storage-Persistence

 Create files to use as SPIflash(8M) and two st25dv64k blocks (64K).

truncate -s 8M SPIflash.bin

truncate -s 64K st25block1.bin

truncate -s 64K st25block2.bin

To open MINI404 using these files use:

./qemu-system-buddy -machine prusa-mini -kernel prusa3d_fw_4_3_3_MINI.bbf -chardev vc,id=p404-scriptcon,cols=80,rows=24 -mtdblock SPIflash.bin -pflash st25block1.bin -pflash st25block2.bin

Using an image as a USB stick

First, you must have an image file to use as a drive. MK404 can do easily, but with MINI404 it is a bit more complicated. Put shortly, you need an image file with the ending .img, and a FAT32 filesystem, which you can use mtools to put G-codes on. 

Download the pre-made 1 GB image file with the sheep G-code already loaded. It is zipped and is only 4Mb.

wget https://cdn.help.prusa3d.com/wp-content/uploads/2021/11/MINIUSB.zip

Unzip the file you just downloaded.

unzip MINIUSB.zip

If you want to download a G-code and put it on the "USB stick", use wget [link] from a link in Prusaprinters. Commands below will download and copy the file already present!

wget https://media.prusaprinters.org/media/prints/13787/gcodes/339252_4279d4ab-37ae-49d3-bd5e-ee70893b0eec/sheep_pmoews_200um_mini_pla_2h17m.gcode

Put the G-code file in the image file (sd card) image using mtools.

mcopy -vsi FAT32.img sheep_pmoews_200um_mini_pla_2h17m.gcode ::

To start MINI404

./qemu-system-buddy -machine prusa-mini -kernel prusa3d_fw_4_3_3_MINI.bbf -chardev vc,id=p404-scriptcon,cols=80,rows=24 -mtdblock SPIflash.bin -pflash st25block1.bin -pflash st25block2.bin -drive if=none,id=usbstick,format=raw,file=MINIUSB.img -device usb-storage,drive=usbstick

Ethernet (PrusaLink!)

Yes, you can connect to the machine remotely as well! You basically route the internet of the VM to the printer. This will give you the option to test NTP servers and remote control of the MINI404 printer.

./qemu-system-buddy -machine prusa-mini -kernel prusa3d_fw_4_3_3_MINI.bbf -chardev vc,id=p404-scriptcon,cols=80,rows=24 -mtdblock SPIflash.bin -pflash st25block1.bin -pflash st25block2.bin -drive if=none,id=usbstick,format=raw,file=MINIUSB.img -device usb-storage,drive=usbstick -netdev user,id=mini-eth,hostfwd=tcp::3333-:80

You can now find the IP under LAN setting, on the printer's menu.

Fancy graphics

To get the full experience, you can add -append gfx-full to get a dynamic 3d model of the printer. The graphics options are many, so please see the link below for a complete set of arguments.

https://github.com/vintagepc/MINI404/wiki/Advanced-Visuals

./qemu-system-buddy -machine prusa-mini -kernel prusa3d_fw_4_3_3_MINI.bbf -chardev vc,id=p404-scriptcon,cols=80,rows=24 -mtdblock SPIflash.bin -pflash st25block1.bin -pflash st25block2.bin -drive if=none,id=usbstick,format=raw,file=MINIUSB.img -device usb-storage,drive=usbstick -netdev user,id=mini-eth,hostfwd=tcp::3333-:80 -append gfx-full

Creating a script file to start it

As you can see, the line for launching is becoming pretty long. There is an online tool to generate the whole line depending on what you use, but you can also create a bash script to launch one set configuration.

Create and start editing a small text file using Nano editor. 

sudo nano startMINI404.sh

Paste the line below (or whatever you have)

./qemu-system-buddy -machine prusa-mini -kernel prusa3d_fw_4_3_3_MINI.bbf -chardev vc,id=p404-scriptcon,cols=80,rows=24 -mtdblock SPIflash.bin -pflash st25block1.bin -pflash st25block2.bin -drive if=none,id=usbstick,format=raw,file=MINIUSB.img -device usb-storage,drive=usbstick -netdev user,id=mini-eth,hostfwd=tcp::3333-:80 -append gfx-full

Close and save

Ctrl+x -> Yes to save -> enter to confirm the file-name.

Make the script executable

sudo chmod +x startMINI404.sh

From now on you can start the script from within the folder with:

./startMINI404.sh

Using MINI404

To control the simulator, like taking screenshots, manipulating the simulated hardware (shorting or disconnecting fans and heaters, etc.), you must use scripting commands (scriptcon).

https://github.com/vintagepc/MINI404/wiki/Scripting-Mini

The console for this is found in one of the tabs called p404-scriptcon (green square). Select it and detach it so it is separate (purple arrow). Each command is outlined in the link above. Copy/Paste does not work, but the Tab key will do autofill.

Now you can have a view with the display on one side (blue square), the script console on another (green square), and the terminal output confirming the generation of files (purple square). To the right in the screenshot below you see the command for making a screenshot of the display and saving it as a PNG.

For installing the MK404 simulator, please see Installing MK404 simulator

Final notes

There is a lot more you can do with this simulator. We only installed the MINI+, but you can also connect PrusaLink or Octoprint, and much more. You are now up and running so check out the Github Wiki for more options, features, and fun.

About the creator

VintagePC is a volunteer community contributor with great insight into hardware and firmware architecture. If you want to help, perhaps port this to other systems (Win binaries exist but require Cygwin to run and mac has worked once someone claimed, but is not the creator's daily driver), or are very up to date on QEMU internals and the "correct" way of doing things, or contribute to this project in any other way, contact the man through his Github https://github.com/vintagepc/.

Prusa Research does not develop or provide support for this system! We can only address direct errors in this guide and improve clarity based on comments. Our technical/customer support can not provide help in regards to technical/installation difficulties, troubleshooting, and feature requests. For this, we recommend checking out the documentation of the project on Github.
Was this article helpful?

Comments

Please sign in before adding a comment.
0
Still have questions?

Still have questions?

If you have a question about something that isn't covered here, check out our additional resources.
And if that doesn't do the trick, you can send an inquiry to info@prusa3d.com or through the button below.