I was wondering if it was possible to Wifi my 3D printer. At the moment I need to either use an SD card or plug it into the front of my printer with a USB cord.
These are two mechanical connections that will soon fail due to the constant operation. You could, of course just attach a dedicated unit like a raspberry Pi. This requires additional power requirements and a USB plug screaming to be snapped off. This along with the general shortage of raspberry pi in general puts me off this idea.
There are lots of low-cost ESP wifi modules that could surely pass the serial data from wifi to the printer so I set out to see if this was indeed possible.
In general, I would print directly from Octoprint from an old laptop that has a new lease on life with this important function. Before I can start I have to work out how to hack into the control board serial communication.
Once these libraries were installed I could flash the ESP-32
Once you have successfully flashed the ESP shortly afterward a new AP will appear in your list of APs called ESP3D. Connect to this AP the password will be 12345678. This will open a captured portal page in a browser, there will be an error on the page.
Click on Choose files and navigate to esp3d/data select all the files and upload them.
After the upload, the files should appear in the ESP3D UI.
Reboot the ESP-32
You should now be presented with the first-time configuration.
Choose Marlin, no other settings need to change here (E3V2) click Continue
On the next screen, you can configure your WiFi
If you would like to connect to your local WiFI enter your AP and credentials otherwise leave the settings as they are to connect to the ESP-32 directly.
You will now be presented with the ESP3D full UI.
Click on ESP3D at the top of the UI.
From the top of the window click Printer.
Select Marlin from the dropdown and click Set
An extra tab should now appear at top of the UI.
This is as far as we can go with ESP3D for now.
Connecting to the serial port
As I mentioned earlier, 3D printers have serial but the data is communicated via a converter chip to computer-friendly USB. Most small controllers can not act as USB host so we need to hijack the serial before it gets to the converter chip. Looking at the schematic for the board the printer CPU connects directly to the serial-USB converter chip.
There is no convenient header to connect to the serial so we will have to solder directly to the converter chip.
Below you can see my serial wires soldered to the chip.
Conventionally there is a header near buy that can supply our ESP32 with 3.3v and ground.
Once you have soldered the serial connection and connected headers to the power route the wires with the control panel ribbon cable.
Remove the back cover of the aluminum extrusion and slide the holder (see STL) as far forward as it will go behind the ender control panel, insert the ESP32
Connect your new serial wires to GP01 and GP03 RX to TX and TX to RX connect the power wires to 3.3v and a GND.
If you have been successful you should see an IP address on the Ender screen.
Return to your browser and check your printer tab. and click the refresh button.
You should see GCODE defaults you can change. If you only see Label Value Help the printer is not talking to the ESP32.
Virtual serial port
We now need to trick your slicer or Octoprint that your computer has a COM port. To do this we use virtual serial port software. There are many different apps that will do this. I found this one easy to use and appears free: https://tibbo.com/soi/software.html
The tool requires the IP of the ESP32 and a port number. The port number can be found in the ESP3D UI. This probably won’t change unless you change it.
Simply add the IP address in Tibbo or your virtual serial port software of choice and the port number.
Here Tibbo has allocated COM5, remember your COM port.
All things being equal when you try to connect from your slicer or Octoprint there should be a COM port and when you connect to that COM port you should have control of your printer as if the USB cable is attached.
Check the video at the top of the guide with my findings on how well the prints come out.
Initially, I tried an ESP-01s the first print that came out was not good. It seems that the printer paused several times during the job. I am not sure if the network was slow or if the 8266 was just struggling to keep up. Looking at the network performance of the Ocotprint server it was not running out of capacity at all so I figured the 8266 was the bottleneck. Time for an upgrade.
I tried an ESP32 with the same firmware and fired off another Benchy.
This print came out significantly better. It was not perfect as there were one or two places where it looks like the print head may have stopped but nothing like the dozens of times it must have stalled with the 8266.
With a bit of tweaking, I think it would be possible to run a 3D printer with a low-cost ESP module. I have the ideal situation here as I have no other wifi signals to interfere and network latency could be an issue in a suburban area. Using Wifi would mitigate the issue of damaged USB plugs or SD card readers but it does introduce the issue of someone inadvertently rebooting the router.
The general convenience of being able to print from anywhere without the requirement for extra power connections or add-ons might make it worthwhile.
I will add a double pole switch so I can swap between Wifi and USB as both can not be used at the same time. Keep an eye out on my cults3d account as I will have a mounting bracket for the Ender 3 V2 and ESP32. Even if you did not want to print directly you can still use all the tools in ESP3D.