OctoPrint control panel in Python curses

I recently got an old computer screen out of my garage. It is now just perfect to monitor the extruder temperature and print progress from OctoPrint.

The screen is linked to the Raspberry Pi using an HDMI to DVI cable. To save some resources on this small board, I decided to use ncurses, which avoids the use of an X server. Communication with OctoPrint is done through the REST API. It allowed me to retrieve both temperature and print progress which are the most important values to me while printing.

The code is written in Python which includes native bindings to ncurses. To make extruder temperature visible from far distance, I decided to use some ASCII art to draw the numbers over several terminal lines. A progress bar is also present at the bottom of the screen.

Coding this took very few time, but the result is yet pretty convincing. However, I noticed that while the big numbers were very useful for far sight, numerical displays should be duplicated in normal letters for close sight, when I’m just right in front of the screen, manipulating the printer.

I provide my code here: octomonitor_mk1.py. To use it, replace BASE_URL and fill API_KEY. It does not require any dependency except python itself.

2 Replies to “OctoPrint control panel in Python curses”

  1. I can’t seem to get this python script to pull info from octoprint. i supplied the script with the servers IP address and API key but nadda. I can see the characters on the screen but they display as if they have not received any info. Any advice would be appreciate.

    Thank you =)

  2. Hi, thanks for trying my script. As you can see, the post is very old. There might have been a change in the API. Do you get any HTTP request error ? Can you please tell me which version of Octoprint you are using ?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.