3D Printer Monitor Wemos D1 Mini ESP8266

24,814

219

112

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.

7 People Made This Project!

Recommendations

  • Arduino Contest 2019

    Arduino Contest 2019
  • Trash to Treasure

    Trash to Treasure
  • Tape Contest

    Tape Contest

112 Discussions

0
None
qwiktune

4 weeks 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 4 weeks 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 4 weeks 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 4 weeks 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 4 weeks 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 4 weeks 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 4 weeks 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 4 weeks 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 4 weeks 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 8 weeks 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 5 weeks ago

2.5.0 -- also works.

0
None
WilliamM481Carl334

Reply 7 weeks ago

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

0
None
CarlL72WilliamM481

Reply 7 weeks ago

Actually version 2.4.2 works even better!

0
None
lustreking

5 weeks 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
1 reply
0
None
Qromelustreking

Reply 5 weeks ago

Not sure if you saw this in the documentation:

```*NOTE: You must edit the Settings.h file and remove the // on the "//#define DISPLAY_SH1106" to use the 1.3 SSH1106 display in the code. It defaults to support the SSD1306 display.```

If you have already done this and the display still looks that way, then perhaps you have a damaged OLED.

0
None
AnubisKnight

5 months ago

Great Project.

I'm having trouble getting the display to work. I have the OLED and teh board you have listed in and all the wiring is hooked up correctly, but I still cannot get it to display anything. I can access the web interface online too.

4 replies
0
None
malvernasAnubisKnight

Reply 3 months ago

I had the same issue. I rolled back my library to an earlier version (3.2.6) and it worked just fine

0
None
Qromemalvernas

Reply 2 months ago

Jeff, make sure you are using the latest version of the code as well as the latest version of the ESP8266 core. It sure looks like you have an old version of a library.

Also, if the web interface is working you should be able to load the compiled binary file through the web interface. Give that a try.

0
None
jeffaveryQrome

Reply 2 months ago

Hi Qrome,

Thank you very much for the reply! I'm still beating my head against the wall. I checked and the ESP8266 board version was 2.4.2 so I upgraded to 2.5. I'm new to this so I'm not 100% sure what each library is doing, or if there can be version conflicts. Below is what I show installed on my board manager and Library manager. I recompiled and uploaded this morning after upgrading the OLED module to v 4.0.0 and the board manager to 2.5.0. I also verified that I have just over 4 volts to the pins vcc and ground on the OLED. I get no backlit or anything though on either of the OLEDs (tried two different ones) I tried. Not sure if that's normal. Thanks again so much for any thoughts. This is the first project of this type that I have hit such a wall on. I'm sure it's something simple I'm missing.


Board Manager:
ESP8266 By ESP8266 Community version 2.5.0

Sketch Library: (Many more than this but they all say "built in")
Adafruit GFX graphics core library v 1.3.4
simple JSON streaming parser for use in Arduino by Bartosz v 0.1.2
Arduino JSON by Benoit v 5.13.4
the SSD1306 and SH1106 based 128x64 pixel OLED display by Daniel Eichhorn v 4.0.0
JSON streaming parser by Daniel Eichhorn v 1.0.5
WhareHauoraWiFiManager by Tzapu v 0.15.0
WiFiManager by Tzapu by Tzapu v 0.14.0

0
None
jeffaveryjeffavery

Reply 2 months ago

Hi Qrome,

Got it working, I thought I'd post the fix here in case it helps someone else. Thanks again for pointing me in the right direction. I watched Chris' video on here, and he was using the 2.4.1 board manager. I also noticed that his was WemOS D1 R2 Mini. Also, in re-reading your instructions, you said to
  • Select Board: "WeMos D1 R2 & mini"
Mine just said WemOS D1 R1 nothing else. Strange, it worked enough like this for the board to program, but not to fire up the OLED. I removed all versions of the ESP8266 board management software and just installed 2.4.1. Once I did that, WemOS R1 D2 & Mini were a choice under board manager. I selected that, reflashed it and it's working great!

Thanks again.

Jeff
PrintMonitor.jpg