3D Printer Monitor Wemos D1 Mini ESP8266

26,762

221

119

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 (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

8 People Made This Project!

Recommendations

  • DIY Summer Camp Contest

    DIY Summer Camp Contest
  • Planter Challenge

    Planter Challenge
  • Backyard Contest

    Backyard Contest

119 Discussions

0
None
davidewen

Question 26 days ago on Step 4

I changed the password on the Printer Monitor and now I can't remember it.

How do I reset it?

Thanks,
David

0
None
norton.who

4 weeks ago

Hi,
I followed the instructions, everything looks cool, LED screen is saying to connect to Oct-Mon-ad5dc3, however when I connect to the Printer Monitor wi-fi with the PC, Google Chrome open and I seen an error "This site can’t be reached". I have tried many times, rebooting everything, pinging everything with responses, verifying everything, however maybe I missed something. Can someone please provide some advice on why I can't connect to the web interface.
Many thanks

2 replies
0
None
Qromenorton.who

Reply 4 weeks ago

It sounds like the step you are on is to connect to the Access Point generated by the Printer Monitor. This means you need to connect via your Wifi. This is also easy to do with your phone. Look under the available Access Points under your wifi settings and you should see one called Oct-Mon-ad5dc3 -- connect to that access point -- THEN open the browser to the configuration page.

0
None
norton.whoQrome

Reply 27 days ago

Thanks for your reply. I tried again and discovered the problem was that I was trying to connect to 192.168.4.42 instead of 192.168.4.41. Got it all working now. Thank You.

0
None
HansD18

2 months ago

I struggled a bit getting this to work, as my ESP wants to be addressed by the GPIO PIN numbers (D2=4 & D5=14). Maybe helpful for other people too ;)

I have 1 question : is it possible to change the text colours ?

But it works, and it's GREAT ! Many thanks !

2 replies
0
None
QromeHansD18

Reply 2 months ago

Glad it is working for you. If you use the Wemos D1 Mini board selected from the ESP8266 2.5.0 core -- the D2 and D5 variables should map and work perfectly.
The simple I2C (4 pin) OLED do not support multi-color. The Blue and Yellow have dedicated colors on the screen area.
Thanks for the comments.

0
None
HansD18Qrome

Reply 2 months ago

No problem it is white, I was just wondering as I saw some other displays in color, so probably they are the 7 pin version ;)

I'm very happy with it, it's a great little monitoring tool :)

I chose Wemos D1, later I saw there is Wemos D1 Mini as well, haven't tried the latter ;)
Maybe it is a bit different if you choose Wemos D1 (iso D1 Mini), but it works :)

0
None
qwiktune

3 months ago

I've followed the instructions, but I cant seem to get anything to work. It uploads 100% says its done, but nothing on my monitor, no wifi network. After I find all the libraries and install them do I have to do anything else to add them to the code? I'm new to This IDE interface so maybe I'm not understanding, but I've tried 4 times with 2 different chips and 2 different screens just to be sure it wasn't the hardware. At this point i'm willing to throw someone a few bucks, both chips and both monitors just to get one in return working so I can set it up. Any takers?

8 replies
0
None
qwiktuneqwiktune

Reply 3 months ago

Actually i might have gotten it to work using v2.4.1, but with the smaller screen. When I try using the bigger one, most of the screen is noise. If this install the same for both sized screens? If so maybe this screen is damaged some how?

0
None
Qromeqwiktune

Reply 3 months ago

The smaller screen is the default in the Settings.h file. If you look at the Readme.md file as well as in the Settings.h -- if you use the larger 1.3 display you have to uncomment out the line for the different driver.

```
  • (optional) 1.3" I2C OLED Display: https://amzn.to/2IP0gRU (must uncomment #define DISPLAY_SH1106 in the Settings.h to use the 1.3" SSH1106 display)
```
0
None
qwiktuneQrome

Reply 3 months ago

Yeah, thank you just saw after I posted that. Working. Only question I have now is the Weather. On one I'm using an API key and on the other I'm using the CityID but neither seems to show any sort of weather or any kind of weather Null value on the screen? Is that something that was being developed but not finished?

0
None
Qromeqwiktune

Reply 3 months ago

It is fully functional. You probably have an invalid City ID or invalid API key. If you log into the web interface, does it display the error message there on the home page?

If not there, plug it in to your computer and open the Serial Monitor from Arduino with baud set to 115200 -- when it boots up and tries to go get the weather data it should log out the error or problem there.

When using the City ID -- it is the number that is displayed as part of the URL. Example: Los Angeles comes up with the following OpenWeatherMap URL -- https://openweathermap.org/city/5368361 -- those last numbers on the URL is the City ID (5368361).

0
None
qwiktuneQrome

Reply 3 months ago

Yes I used the valid API key from openweathermap.org which I know is valid because I used the same API key when building my Raspberry Pi Magic Mirror and it works there, but not here. Also my CityID appears correct which also not working (and this is on 2 different Wemos D1 mini's). I am however using version 2.4.1 because the newer versions did not work for me (as you can see from my eariler comments). I notice in Chris's tutorial he also uses 2.4.1, but also has no weather configuration options in the interface to set. Would I need to have 2.4.2+ version for making the weather work, or should 2.4.1 still make the weather work? I'm new to Arduino so it'll take me a bit to figure out your troubleshoot suggestion to pull the error, if there is one.

0
None
Qromeqwiktune

Reply 3 months ago

If it compiles it isn't an issue with the ESP8266 core (so 2.4.1 if it compiles should be fine). Are you able to run this with the Serial Monitor from Arduino to see the Errors?

Test your API key and CityID with this:

api.openweathermap.org/data/2.5/group?id=[CITY_ID]&units=imperial&cnt=1&APPID=[API_KEY]

Change out the [CITY_ID] with yours etc. and put the http in front of it (they strip the links here)


The easiest way to see what is going on is view the Serial Monitor -- the error will show there.

0
None
qwiktuneQrome

Reply 3 months ago

Looks like maybe that URL cut off? I tried "http://api.openweathermap.org/data/2.5/group?id=5206379" but the browser returned {"cod":401, "message": "Invalid API key. Please see http://openweathermap.org/faq#error401 for more info."}. Not sure where I'd put that API key in that URL to test it. I will try and check the monitor out tonight and report back what I'm seeing. All i have to do is connect it to the USB port and open the monitor in Arduino to see it? I've never used the Serial Monitor before.

0
None
Qromeqwiktune

Reply 3 months ago

Yeah, the site shortened it. Provide the FULL URL and replace items in the URL for your needs. You should get a valid json response.

api.openweathermap.org/data/2.5/group?id=[CITY_ID]&units=imperial&cnt=1&APPID=[API_KEY]

1
None
Carl334

Tip 4 months 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.

3 replies
0
None
QromeCarl334

Reply 4 months ago

2.5.0 -- also works.

0
None
WilliamM481Carl334

Reply 4 months ago

Many thanks for bringing this back up! Instant fix lol.

0
None
CarlL72WilliamM481

Reply 4 months ago

Actually version 2.4.2 works even better!