How I Added Wi-Fi to My Creality Ender 3
by MrDIYLab in Workshop > 3D Printing
20933 Views, 50 Favorites, 0 Comments
How I Added Wi-Fi to My Creality Ender 3
I am very excited about this project. Let me show you how I added Wi-Fi to my Ender3 Printer.
Watch the Video
The video walks through the idea behind the project as well as how I added the wireless dashboard to my printer. Feel free to add your questions in the comment section of the YouTube video if you need any further assistance.
Introduction
I always wanted to have a quick way to keep an eye on my 3D printers, see the progress and have some basic controls. From what I found, the only way to do that remotely is by using something like a raspberry pi running octoprint. While this is an amazing and powerful project, I was looking for something that is simple, with instant functions and is affordable. This is what I came up with. It runs on a ESP8266 module, connects directly to the printer and boots up instantly.
The Dashboard
You are looking at the printer's dashboard. It has multiple tabs that show different things.
The main tab here, shows the overall status of the printer. I can see the nozzle temperature, the bed temperature, the print time, the print progress along with the name of the file being printed. It has action buttons to print, pause or stop a print job along with current z height, feed and flow rates. Additionally, at the bottom I added some graphs to plot the temperatures as they come in and the location of the nozzle.
The second tab shows the list of files on the sd card. On the right hand side, it displays the file size and the ability to print.
The third tab is the terminal. It can be used to send Gcode commands to the printer directly or to monitor the raw data coming in from it.
The rest of the tabs are there for configuration and setup. I will skip that now, however, I can visit them later if needed.
So this is the dashboard, I tried to make it simple, free of clutter and straight to the point. And I think it is looking very good and it is very practical too: I can view it on my laptop, ipad or my phone.
How It Works
So let's talk about how it works. The concept behind it is relatively simple. There is an ESP8266 microcontroller that sits between the dashboard and the serial port on the 3d printer. By using a websocket, I am able to connect those two.
In one direction, it takes the commands coming from the dashboard and sends them to the printer console over serial.In the other direction, it monitors the printer console and sends all the incoming messages to the dashboard.
Example
When the dashboard receives a message from the printer console, it parses it, and extracts data from it. It uses this data to update the interface in realtime.
For example, when it receives this line, using regular expression, it knows that this is a temperature reading. It extracts the bed temperature from it. Then, it uses this new bed temperature value to update the web interface using JavaScript. This process repeats over and over... for each message received. It is currently programmed to parse dozens of data points and more can easily be added in the future.
Missing Data Issue
One challenge I faced was that not all that data I need to have a useful dashboard was provided by the printer at runtime. For example, the printer doesn't automatically send updates about the print time or percentage while it is printing. So in this scenario, I added a small script that periodically requests the print time or percentage using the M31 and the M27 gcode commands. That means every 30 seconds, the printer receives M31 and M27 gcode commands and responds with the print time or percentage.
These messages are treated like all incoming messages, they get parsed, extracted and the dashboard is updated.
I have also used this technique for other on-demand requests. For example, when I click on the files tab, it sends the M20L gcode command asking for the list of files on the SD card. Then the printer replies with the file list and that get parsed and displayed.
Installation
Well, I tried three different ways and all three give almost the same results.
For the first, I used an ESP01 module. For the second, I used a Wemos d1 mini. And for the third, I built a custom board to address all the challenges I faced with the first two. For all three, there are four connects: Tx, Rx, Gnd and Power.
I had to do a bit of research to figure out where these pins were on my printer. Also the power pin varies depends on which installation I used. For example, ESP01 needs 3.3v while the wemos d1 mini needs either 3.3v or 5v. Gnd is easy, it goes to any ground on the printer. Finding Rx and Tx can be easy or tricky depending on the printer. Some printers have them exposed and some are really hidden.
For the hidden ones, I found a good trick which is tapping into the USB to serial chip. Most budget printers have the CH430 chip. With a quick search, I found the schematic. The Tx and RX are at the top and that is what I used for my Ender3 V2.
This required fine soldering, so I understand it might not be for everyone, but I was comfortable going in there and soldering it by hand.
And that is how I installed it. I was done and ready to be used.
PCBs
A shoutout to PCBWay for providing these PCBs for my project. I have been using their service for over 3 years and had nothing but great experience and quality. If you are a hobbyist and in the market for PCBs, I highly encourage you to give them a visit. Get 10 PCBs for $5 USD at https://www.pcbway.com
Challenges
However there were small challenges:
One - was the Wi-Fi signal issues. My 3D printer has a metal frame. The enclosure for its motherboard was all metal too. Initially, I left the ESP8266 boards inside and I faced a lot of loading, timeout and speed issues. When I realized that, I used long wires and moved my device outside the enclosure and everything worked perfectly fine after that.
Two - finding power source for my device wasn't easy - especially after adding the auto bed level, I had no ports left to tap into.That is why I built this companion board. I used an ESP07S module which is based on the ESP8266 microcontroller but it has an external antenna. So everything can be left inside the metal enclosure but the antenna can stick out.
This companion board also takes care of the power. I noticed the LCD cable has 5 volts and Gnd rails. So I made the board sit between the motherboard and the LCD cable to take advantage of that. Now I don't have to worry about the power and only left with just 2 pins to solder.
Online
To start using it, I visit the dashboard's URL and provide the IP address of the board which I called the 3D Printer Wireless Gateway ... and my printer is ONLINE!
Conclusion
I will leave you with the bin files for the ESP01 and Wemos d2 mini if you want to try this project at home. And if you looking for my companion board, it will make it available in my store.
If you found this useful, maybe consider visiting my YouTube channel and say hello. I will be posting future updates about this project.