3D Printer Monitor Wemos D1 Mini ESP8266

45,861

295

141

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

14 People Made This Project!

Recommendations

  • Plywood Challenge

    Plywood Challenge
  • Plastic Contest

    Plastic Contest
  • Battery Powered Contest

    Battery Powered Contest

141 Discussions

0
Mass1mo
Mass1mo

Question 11 months ago

When I verify the code, it says Settings.h: No such file or directory
It seems that the settings library is not downloaded but I don't see where I can.
Please help
Thank you!

0
Mass1mo
Mass1mo

Answer 11 months ago

Nevermind, I found the problem. I forgot to extract the file, so when I opened the code, it didn't come with the other files

0
stephen.grattage
stephen.grattage

Reply 3 months ago

I have got this problem. How did you sort it out? Cheers

0
bepstein
bepstein

4 months ago

Fantastic project. Have had one in my office one floor above my printer for about a week now, and I think I'm going to make one or two more for the bedroom and workshop!!

0
prickly81
prickly81

5 months ago

Help me please! Time (hours) are not displayed

1592257495737.jpg1592257502245.jpg1592257593428.jpg1592257608764.jpg
0
DaveM352
DaveM352

Question 11 months ago on Step 4

Awsome project.
Wonder if anyone could help me, as I would love to get this working, as I am so near....( I seem to be getting the same results as other......)
I have sucessfully programmed it as per the video and setup my wifi,
But when I connect to it via a web browser to do the final stages all I
get is ether a blank browser or html text which the page is constructed
with.
Have tried firefox, chrome, opera & microsofts edge which show the same.
Reprogrammed it 4 times, still the same.
What have I missed...... Anyone got any nearer to any ideas on how to rectify this....??

1
Qrome
Qrome

Answer 11 months ago

I have a feeling that the newer version of the ESP8266 core is the problem. The project was developed and tested with ESP8266 core 2.5.2 -- give that a try.

0
Funky Diver
Funky Diver

Reply 5 months ago

Exactly this, once I'd downgraded to 2.5.2 everything sprung to live.

0
tommakesmusic
tommakesmusic

7 months ago

When I was making the project with the latest esp8266 boards definition I could not get the oled screen to show anything. I tried everything. This would mean that getting the ip address of the monitor to continue the set up would be difficult. What I did find, however, was that the project compiled first time (assuming all libraries are installed). Connect to the access point and add your wifi credentials and continue with the setup.
With nothing on the screen, i was mystified as to how to continue the next bit of the PrinterMonitor setup.
After several attempted recompiles and re-flashes I discovered that on the mac the latest version of the arduino ide actually shows the ip address of the PrinterMonitor in the "Ports" section of the board options, once it joins the network. (See picture.)
Once you have the ip address of the PrinterMonitor you can connect via a browser, configure it as per the instructable and to get the screen to work, just upload the compiled binary firmware that Qrome includes in the zip file. One reboot later and the screen is working perfectly!

Arduino IDE.jpg
0
norbs
norbs

Question 8 months ago

When i try and compile, I get a wall of text like this....

In file included from sketch\libs/ArduinoJson/src/ArduinoJson/Deserialization/../JsonVariant.hpp:14:0,
from sketch\libs/ArduinoJson/src/ArduinoJson/Deserialization/../JsonBuffer.hpp:12,
from sketch\libs/ArduinoJson/src/ArduinoJson/Deserialization/JsonParser.hpp:7,
from sketch\libs/ArduinoJson/src/ArduinoJson/JsonBufferBase.hpp:7,
from sketch\libs/ArduinoJson/src/ArduinoJson/DynamicJsonBuffer.hpp:7,
from sketch\libs/ArduinoJson/src/ArduinoJson.hpp:7,
from sketch\libs/ArduinoJson/src/ArduinoJson.h:9,
from sketch\libs/ArduinoJson/ArduinoJson.h:5,
from sketch\OctoPrintClient.h:29,
from sketch\Settings.h:49,
from D:\MyDocs\Arduino\printer-monitor-master\printermonitor\printermonitor.ino:31:
sketch\libs/ArduinoJson/src/ArduinoJson/Deserialization/../RawJson.hpp:43:11: error: RawJson is a function from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
inline Internals::RawJsonString<T> RawJson(T str) {
^

0
Qrome
Qrome

Answer 8 months ago

Make sure you are using the esp8266 Core platform version 2.5.2 and all the versions of the library files mentioned in the Readm.md file.

1
iPriddy
iPriddy

Question 10 months ago

I have been able to succesfully write the software onto the Wemo. I currently have the screen to connect to the AP, however I do not see the network appearing on my Mac. It comes up on my iPhone but says "unable to connect" Have tried to connect manually on Mac but still no luck.

3
Mass1mo
Mass1mo

Question 10 months ago

When I verify the code, there is an error compiling for board WeMos d1 r1. It seems that a file is missing in the wemos board uploader.
Anyone might know what the problem is?

0
GImoe
GImoe

Question 11 months ago

Hi Dave,

Im stuck with this error when i try to upload the commands

printermonitor:1255:5: error: 'display' was not declared in this scope

display.displayOn();

^

printermonitor:1258:5: error: 'display' was not declared in this scope

display.displayOff();

^

exit status 1
expected constructor, destructor, or type conversion before '(' token
0
hanskrckstock
hanskrckstock

12 months ago

Hey,

thank you for this nice project.
But I have a problem to get to the webserver.
I installed everything and it works fine. I set up my WiFi and it also connect to it but if i try to connect to the webserver by IP i will get an empty page.
On the serial monitor seems everything fine. When I try to connect it only says: "Signal Strength (RSSI): 90%".
It's the same for other browers like chrome.
Sometimes it showed this:

b2
HTTP/1.1 200 OK
Content-Type: text/html
Cache-Control: no-cache, no-store
Pragma: no-cache
Expires: -1
Accept-Ranges: none
Transfer-Encoding: chunked
Connection: close
0
<!DOCTYPE HTML><html><head><title>Printer Monitor</title><link rel='icon' href='data:;base64,='><meta charset='UTF-8'><meta name='viewport' content='width=device-width, initial-scale=1'><meta http-equiv="refresh" content="30"><link rel='stylesheet' href='https://www.w3schools.com/w3css/4/w3.css'><link rel='stylesheet' href='https://www.w3schools.com/lib/w3-theme-light-green.css'><link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css'></head><body><nav class='w3-sidebar w3-bar-block w3-card' style='margin-top:88px' id='mySidebar'><div class='w3-container w3-theme-d2'><span onclick='closeSidebar()' class='w3-button w3-display-topright w3-large'><i class='fa fa-times'></i></span><div class='w3-cell w3-left w3-xxxlarge' style='width:60px'><i class='fa fa-cube'></i></div><div class='w3-padding'>Menu</div></div><a class='w3-bar-item w3-button' href='/'><i class='fa fa-home'></i> Home</a><a class='w3-bar-item w3-button' href='/configure'><i class='fa fa-cog'></i> Configure</a><a class='w3-bar-item w3-button' href='/configureweather'><i class='fa fa-cloud'></i> Weather</a><a class='w3-bar-item w3-button' href='/systemreset' onclick='return confirm("Do you want to reset to default settings?")'><i class='fa fa-undo'></i> Reset Settings</a><a class='w3-bar-item w3-button' href='/forgetwifi' onclick='return confirm("Do you want to forget to WiFi connection?")'><i class='fa fa-wifi'></i> Forget WiFi</a><a class='w3-bar-item w3-button' href='/update'><i class='fa fa-wrench'></i> Firmware Update</a><a class='w3-bar-item w3-button' href='https://github.com/Qrome' target='_blank'><i class='fa fa-question-circle'></i> About</a></nav><header class='w3-top w3-bar w3-theme'><button class='w3-bar-item w3-button w3-xxxlarge w3-hover-theme' onclick='openSidebar()'><i class='fa fa-bars'></i></button><h2 class='w3-bar-item'>Printer Monitor</h2></header><script>function openSidebar(){document.getElementById('mySidebar').style.display='block'}function closeSidebar(){document.getElementById('mySidebar').style.display='none'}closeSidebar();</script><br><div class='w3-container w3-large' style='margin-top:88px'><div class='w3-cell-row' style='width:100%'><h2>Time: 19:06:04</h2></div><div class='w3-cell-row'><div class='w3-cell w3-container' style='width:100%'><p>Host Name: octopi<br>Status: Offline<br>Reason: Server address is required; ApiKey is required; <br><hr></p></div></div><p>Please <a href='/configureweather'>Configure Weather</a> API</p><br><br><br></div><footer class='w3-container w3-bottom w3-theme w3-margin-top'><i class='fa fa-paper-plane-o'></i> Version: 2.5<br><i class='fa fa-rss'></i> Signal Strength: 90%</footer></body></html>

Can someone help me?

0
hanskrckstock
hanskrckstock

Reply 11 months ago

I found the solution. The esp board manager has to have the version 2.4.1 and json 5.13.3.

0
MarioM264
MarioM264

Question 1 year ago

How can I add button to switch on/off the screen? Or is there possible to turn on the screen for let say 10 secs and then it would go off again?

0
matti04_electronics
matti04_electronics

Answer 1 year ago

Hi, I didn't make the project, but the simplest solution would probably be to make a switch in the power cable. I don't know if there will be some errors with the data lines, but you could try it out!

2
Carl334
Carl334

Tip 1 year ago

I also had trouble with the screen. More than two days of banging my head, with way to many tries at a fix. Someone (Jeff) here posted that he downgraded to version 2.4.1 of ESP8266 Boards and chose the board; one with the ----- mini at the end. Worked for me. So I'm here to thanks Jeff; but cannot find his posting again to thank him.

0
NimaJ3
NimaJ3

Reply 1 year ago

Thanks so so so much.to Jeff and You.really rescud me.