3D Printer Monitor Wemos D1 Mini ESP8266

56,090

326

165

Introduction: 3D Printer Monitor Wemos D1 Mini ESP8266

About: I enjoy flying RC and 3D Printing

Monitor your 3D printer over a wifi connection. This is a Wemos D1 Mini and a 128x64 OLED combined together to display the status from your OctoPrint Server.

Requires the following:

Features:

  • Displays the print status from OctoPrint Server
  • Estimated time remaining
  • Time Printing
  • Percentage complete
  • Progress bar
  • Bed and Tool Temperature
  • Screen turns off when printer is turned off or disconnected
  • Screen turns on when printer is Operational or connected
  • Option to display clock instead of sleep mode
  • Sample rate is every 60 seconds when not printing
  • Sample rate is every 10 seconds when printing
  • Fully configurable from the web interface (not required to update Settings.h)
  • Supports OTA (loading firmware over WiFi connection on same LAN)
  • Basic Athentication to protect your settings
  • Video: https://youtu.be/niRv9SCgAPk
  • Detailed build video by Chris Riley: https://youtu.be/Rm-l1FSuJpI

Step 1: Solder Up the Wemos D1 Mini With the 128x64 I2C OLED Display

This step only requires connecting 4 wires between the Wemos D1 Mini and the OLED display.

  • SDA -> D2
  • SCL -> D5
  • VCC -> 5V+
  • GND -> GND-

Step 2: 3D Print a Case for Your 3D Printer Monitor

Since you are monitoring a 3D printer, you probably have the means to print the case for this project or create your own. My design is posted on Thingiverse.com here:

https://www.thingiverse.com/thing:2884823

Fit your Wemos and OLED in the case. You may need to apply some glue to the outer corners of the OLED display to get it to stick into the case. The Wemos will be held into the case by the back panel.

Step 3: Download and Compile Source Code

It is recommended to use Arduino IDE. You will need to configure Arduino IDE to work with the Wemos board and USB port and installed the required USB drivers etc.

  • USB CH340G drivers: https://wiki.wemos.cc/downloads
  • Open the Arduino IDE and enter the following URL http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas. This will add support for the Wemos D1 Mini to Arduino IDE.
  • In the Arduino IDE, open Boards Manager from Tools > Board menu and install esp8266 platform version 2.5.2 (and don't forget to select your ESP8266 board from Tools > Board menu after installation).
  • Select Board: "WeMos D1 R2 & mini"

Download the Source Code for 3D Printer Monitor:

https://github.com/Qrome/printer-monitor

Packages:

The following packages and libraries are used (download and install to your Arduino IDE):

Initial Configuration
You can update the project Settings.h file with your OctoPrint API Key or do it from the web interface. Get your OctoPrint API Key from your OctoPrint -> User Settings -> Current API Key.

NOTE: The settings in the Settings.h are the default settings for the first loading. After loading you will manage changes to the settings via the Web Interface. If you want to change settings again in the settings.h, you will need to erase the file system on the Wemos or use the “Reset Settings” option in the Web Interface.

Step 4: Web Interface

The Printer Monitor uses the WiFiManager so when it can't find the last network it was connected to it will become a AP Hotspot -- connect to it with your phone and you can then enter your WiFi connection information.

After connected to your WiFi network it will display the IP addressed assigned to it and that can be used to open a browser to the Web Interface. Everything can be configured there in the web interface.

Microcontroller Contest

Participated in the
Microcontroller Contest

15 People Made This Project!

Recommendations

  • Laser Challenge

    Laser Challenge
  • Paint Challenge

    Paint Challenge
  • Unusual Uses Contest

    Unusual Uses Contest

165 Comments

0
ranman60
ranman60

8 months ago

Hi Qrome,
Thanks for a great project. I have two D1 minis and two SSD1106's with the same problem. I have uncommented out the SSD1106 display line in settings.h but it has not changed anything. Any suggestions would be appreciated. BTW, I can access via the web GUI.

printermon (2).jpglibraries.pngdisplay settings.png
0
sedivy2006
sedivy2006

Reply 5 weeks ago

it is in settings.h here photo what you want

printermonitor - Settings.h _ Arduino 1.8.15 Hourly Build 2021_05_31 10_33 11_10_2021 21_48_03_LI.jpg
0
Qrome
Qrome

Reply 5 weeks ago



Remove the two slashes on that line.

0
Qrome
Qrome

Reply 8 months ago

That does look like it is not loading the SH1106 display library. You compiled and loaded it now for the 1.3 display?

0
ranman60
ranman60

Reply 8 months ago

I noticed that when I compiled and uploaded the code, it was getting a "No Response" error code. I changed the port to the appropriate Com Port and it uploaded but now I am getting a blank screen.

0
Qrome
Qrome

Reply 8 months ago

Make sure that you still have "1M SPIFF" selected under the Arduino Tools -> Flash Size.
This sometimes gets removed between selecting different boards.

0
ranman60
ranman60

Reply 8 months ago

Thanks Qrome. I have changed the flash settings to 1M but there was nothing about SPIFF. See attached jpg. Still nothing in the display.

flash settings.jpg
0
Qrome
Qrome

Reply 8 months ago

What ESP8266 core platform version are you running? The Readme instructs you to use Core platform version 2.5.2

0
ranman60
ranman60

Reply 8 months ago

I was running 2.7.4 so I changed it to 2.5.2. recompiled and uploaded with no change. I also power reset afterwards as well.

board manager.jpg
0
Qrome
Qrome

Reply 8 months ago

Run the serial port monitor durring the boot up on baud 115200 -- what do you see happening?

0
ranman60
ranman60

Reply 8 months ago

when I booted up with serial port monitor on, I saw nothing. When I uploaded the sketch, I saw the following.

2021-03-09_16-24-08.jpg2021-03-09_16-24-44.jpg
0
Qrome
Qrome

Reply 8 months ago

So, it looks like it is running only the display issue. What pins do you have it soldered to and what pins are selected in the Settings.h file?

0
ranman60
ranman60

Reply 8 months ago

SDA - D2
SCL - D5
VCC - 5v
GND - GND

display pins.jpg
0
justjakenotjacob
justjakenotjacob

Reply 7 months ago

I have this exact same issue. Any chance its been resolved?
I have tried all the suggestion in this thread. I have tried a new D1. I have tried this with 3 displays. Two of them are the same product and the 3rd is different. I did get this to work with the .96 screen. It really just seems like the display part is not working but I can figure out why. Really cool project. Crypto currency tracker would be a cool one. Each screen is the current price, chart and price change.

0
Qrome
Qrome

Reply 7 months ago

Make sure you use the ESP8266 Core 2.5.2 and set 1M SPIFFs as the readme.md file instructs.

0
justjakenotjacob
justjakenotjacob

Reply 7 months ago

Thanks for the reply! Both of those were set based off of this thread alone . I did figure out that esp8266-oled-ssd1306 library noted in the readme should be set to the 4.1 version. I was on 4.2 and that was not working (not sure if I overlooked that somewhere else). Thanks again!

0
chriskleov
chriskleov

3 months ago

i received these error at compile. any help please?

Arduino: 1.8.13 (Windows 10), Board: "LOLIN(WEMOS) D1 R2 & mini, 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600"
In file included from c:\users\chriskleov\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed\xtensa-lx106-elf\include\assert.h:10,
from c:\users\chriskleov\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed\xtensa-lx106-elf\include\sys\reent.h:503,

from c:\users\chriskleov\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed\xtensa-lx106-elf\include\stdlib.h:18,

from c:\users\chriskleov\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed\xtensa-lx106-elf\include\c++\10.3.0\cstdlib:75,

from c:\users\chriskleov\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed\xtensa-lx106-elf\include\c++\10.3.0\stdlib.h:36,

from C:\Users\chriskleov\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/Arduino.h:27,

from sketch\printermonitor.ino.cpp:1:

C:\Users\chriskleov\Documents\Arduino\libraries\WhareHauoraWiFiManager/WiFiManager.h:25:24: error: 'const char HTTP_HEAD []' redeclared as different kind of entity
25 | const char HTTP_HEAD[] PROGMEM = "<!DOCTYPE html>{v}";
| ^~~~~~~

In file included from sketch\Settings.h:42,
from C:\Users\chriskleov\Desktop\printer-monitor-master\printermonitor\printermonitor.ino:31:

C:\Users\chriskleov\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:39: note: previous declaration 'HTTPMethod HTTP_HEAD'
47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
| ^~~~~~~~~

exit status 1
Error compiling for board LOLIN(WEMOS) D1 R2 & mini.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

0
Qrome
Qrome

Reply 3 months ago

Make sure you are using the ESP8266 core version that is mentioned in the Readme.md file. As well as the listed versions of the required library packages.

0
budavaril
budavaril

Question 6 months ago

Hi Qrome,
Some of guys mentioned in the "Pull request" section a 3.0 branch exist somewhere with night mode etc..
Where I can find that?
Thanks your efforts in this project.

0
lustreking
lustreking

2 years ago

It looks like I'm missing a lot of lines in my display. Does this look like a bad config, or a bad display? I'm using the 1.3" version.

IMG_20190313_094121413_2.jpg