<p>I have had issues with printing on my i3 MK3, especially when it came to the first layer. In March 2020, I have installed the Prusa Mesh Leveling plugin for Octoprint. With that plugin and a Nylock nut modification, I was able to reduce the bed variance from 0.6 mm down to 0.014 mm and prints were great. That took about 25 rounds of calibration and I didn't have any issues with the graphics not updating.</p>
<p><a href="https://i.stack.imgur.com/Fo7Ag.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fo7Ag.png" alt="Mesh bed levelling on March 2020" /></a></p>
<p>Shortly after that, my filament sensor stopped working and I ordered a replacement, which I installed yesterday. But today, my prints are bad again, especially the first layer. So I thought I would simply run through the calibration and mesh bed leveling again.</p>
<p>First, I turned the screws in the wrong direction, so the result became worse and I needed several attempts until the results went into the correct direction. I'm currently at ~1.0 mm bed variance, which is very bad and I need to continue leveling the bed.</p>
<p><a href="https://i.stack.imgur.com/lR588.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lR588.png" alt="Bed variance currently" /></a></p>
<p>Now, the graphics does not update any longer. It always shows the same picture.</p>
<p>I also noticed some different behavior of the mesh bed levelling procedure. Usually, after running the mesh bed levelling, the printer needs some time (~5 secs) before it will react to other commands like a move on the Z axis. I used the following technique to find out when to reload the graphics:</p>
<ul>
<li>run mesh bed levelling</li>
<li>tell the printer to move up 10 mm on the Z axis</li>
<li>as soon as the print head moves up, it was possible to reload the graphics</li>
</ul>
<p>Now, the print head moves up immediately after the mesh bed levelling, without the ~5 secs delay and the graphics does not update.</p>
<p>I have already tried:</p>
<ul>
<li>click the &quot;reload heat map&quot; button</li>
<li>run mesh bed leveling again</li>
<li>restarting Octoprint</li>
<li>resetting the printer using the X button</li>
<li>looking for disk space via SSH</li>
</ul>
<p>.</p>
<pre><code>pi@octopi:~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       7.3G  1.9G  5.1G  27% /
devtmpfs        182M     0  182M   0% /dev
tmpfs           186M     0  186M   0% /dev/shm
tmpfs           186M  2.7M  183M   2% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           186M     0  186M   0% /sys/fs/cgroup
/dev/mmcblk0p1   42M   21M   21M  51% /boot
tmpfs            38M     0   38M   0% /run/user/1000
</code></pre>
<p>In the log file (<code>octoprint.log</code>) with output level set to <code>DEBUG</code>, I could see an entry:</p>
<pre><code>2020-06-06 12:19:52,261 - octoprint.plugins.PrusaMeshMap - INFO - Generating heatmap
2020-06-06 12:19:52,288 - py.warnings - WARNING - 
    /home/pi/oprint/local/lib/python2.7/site-packages/matplotlib/pyplot.py:522:
    RuntimeWarning: More than 20 figures have been opened. 
    Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are
    retained until explicitly closed and may consume too much memory. 
    (To control this warning, see the rcParam `figure.max_open_warning`).
    max_open_warning, RuntimeWarning)
</code></pre>
<p>As you can see, this was at 12:19. The last graphics I saw is from 12:37.</p>
<p>The logs also contain a message on 12:40:</p>
<pre><code>2020-06-06 12:40:39,262 - octoprint.util.comm - ERROR - Error while processing hook PrusaMeshMap:
Traceback (most recent call last):

  File &quot;/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/comm.py&quot;, line 2849, in _readline
    ret = hook(self, ret)
  File &quot;/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_PrusaMeshMap/__init__.py&quot;, line 90, in mesh_level_check
    self.mesh_level_generate()
  File &quot;/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_PrusaMeshMap/__init__.py&quot;, line 236, in mesh_level_generate
    fig.savefig(self.get_asset_folder() + '/img/heatmap.png', bbox_inches=&quot;tight&quot;)
[...]
  File &quot;/home/pi/oprint/local/lib/python2.7/site-packages/matplotlib/image.py&quot;, line 512, in _make_image
    output = self.to_rgba(output, bytes=True, norm=False)
  File &quot;/home/pi/oprint/local/lib/python2.7/site-packages/matplotlib/cm.py&quot;, line 259, in to_rgba
    xx = (xx * 255).astype(np.uint8)
MemoryError
</code></pre>
<p>On 12:46 I rebooted the system</p>
<pre><code>2020-06-06 12:46:08,761 - octoprint.server.api.system - INFO - Performing command for core:reboot: sudo shutdown -r now
</code></pre>
<p>but of course that graphics is still missing and the last available graphics is the one from 12:37. So, after the reboot one needs to run the mesh bed leveling again.</p>
<p>Still, no luck...</p>
<p>OctoPrint version is 1.4.0, OctoPi version 0.15.0PE, Prusameshmap Plugin: 0.3.0. As far as I can tell, that's the latest version available.</p>
<p>What can I do to make mesh bed leveling work again?</p>

[{'answer_id': 14567, 'author': '0scar', 'author_id': 5740, 'author_profile': 'https://3dprinting.stackexchange.com/users/5740', 'pm_score': 0, 'selected': False, 'text': '<p>You have found a bug in the OctoPrint plugin. As you noticed, not more than 20 graphs can be created/open at a time. This implies that the developer has not implemented pyplot correctly, this is a common mistake that I have ran into myself once or twice. You should notify the developer.</p>\n<p>The problem is that the old graph is not destroyed or not properly updated (I think it is intended to update the graph). The code passes the create plot multiple times and after 20 graphs it will drop the error message.</p>\n<p>If you reset the Pi or reload the Octoprint server you are probably good to go for another 20 graphs.</p>\n'}, {'answer_id': 14569, 'author': 'Thomas Weller', 'author_id': 1570, 'author_profile': 'https://3dprinting.stackexchange.com/users/1570', 'pm_score': 2, 'selected': True, 'text': '<p>I have formatted the SD card and installed Octoprint from scratch. That\'s nasty, because I lost all the models I uploaded.</p>\n<p>It seems to be a bug in <a href="https://github.com/PrusaOwners/OctoPrint-PrusaMeshMap/blob/master/octoprint_PrusaMeshMap/__init__.py" rel="nofollow noreferrer">__init__.py</a> of OctoPrint-PrusaMeshMap (archived Github repository).</p>\n<p>That code saves the heatmap in this line:</p>\n<pre><code>fig.savefig(self.get_asset_folder() + \'/img/heatmap.png\', bbox_inches=&quot;tight&quot;)\n</code></pre>\n<p>It uses Pyplot</p>\n<pre><code>import matplotlib.pyplot as plt\n</code></pre>\n<p>and thus the code should probably use (untested!)</p>\n<pre><code>plt.close(fig) \ndel fig\n</code></pre>\n<p>to free the resources.\nUnfortunately it\'s not possible to file this as an issue because the Github repository is in archived mode and thus readonly.</p>\n'}]
['https://3dprinting.stackexchange.com/questions/13821', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/1570/']