Elegoo SLA Printer USB Network Storage
Sick of the USB thumb drive... make your printer smarter with network mass storage using a Raspberry Pi Zero!
Last updated
Sick of the USB thumb drive... make your printer smarter with network mass storage using a Raspberry Pi Zero!
Last updated
Raspberry Pi Zero W
Class 10 Micro SD Card (>= 32Gb)
Case
(Qty 2) USB to Micro USB
Barrel Whip (5.5mm x 2.5mm - Male Plug)
Barrel Whip (5.5mm x 2.5mm - Female Plug)
This instructional revolves more around setting up a device that can be used as a network mass storage device. I will focus on more of the hardware sides of things and when it comes to setting up the Pi refer you to instructionals I used to make this project possible.
Instructional: Make a Pi Zero W Smart USB flash drive
Instructional: Headless Pi Zero W Wifi Setup
There are many instructionals online to walk you through setting up your raspberry pi. I use the "Raspberry Pi Imager" with the Raspberry Pi OS Lite image.
Once the SD card has the OS written you will need to enable ssh and configure wifi. Use the resource files below ("ssh" and "wpa_supplicant.conf") the "Headless Pi Zero W Wifi Setup" article to configure these files for your network.
(1) Update apt
(2) Install Python3 / PIP (It should already be installed)
Follow the steps in "Make a Pi Zero W Smart USB flash drive" but there are some tweaks and changes that will be noted here with the steps they pertain to.
Follow the instructions as they are originally written. ("Make a Pi Zero W Smart USB flash drive")
Now we are going to create a file and directory that will eventually be visible on the Elegoo printer. The Raspberry Pi Zero W should be plugged into the printer from the designated USB port on the pi and you should have a power supply hooked up to the pi as well. The stock USB port on the Elegoo does not supply enough power to power the pi.
Now comes the moment of truth. Let’s see whether the 3D printer is going to be friends with the Pi Zero W. The command below will enable USB mass storage device mode, and the Elegoo printer should pop up a dialogue box. If it doesn’t, you may need to back out of the menu to the main menu page and get back into the storage.
The printer should provide the file and directory we previously created on the printer screen.
Once you’re satisfied that all is well, try a dismount:
Follow the instructions as they are originally written. ("Make a Pi Zero W Smart USB flash drive")
In order for the printer to detect any changes we’ve made over the network (for example, file or folder creations and deletions), it needs to be tricked into thinking that the USB device has been removed and reinserted.
We can use a Python library called watchdog (magpi.cc/2sLL1fi), which is designed for monitoring file system events and responding to them. Install this with the command below:
We then need some code to start a timer whenever something changes in the shared folder. The timer is reset to zero every time a new change occurs, and the USB reconnect is only triggered if we see 30 seconds of inactivity after a change. This avoids spamming the printer while we’re copying over multiple files.
The article refers to a program written to do this. To download it, type:
You will need to go into the usb_share.py program and modify line 7 to read like the following...
CMD_MOUNT = "modprobe g_mass_storage file=/piusb.bin stall=0 ro=0 removable=1"
To modify the program, type:
Press CTRL+O followed by Enter to save, and then CTRL+X to quit.
Follow the instructions as they are originally written. ("Make a Pi Zero W Smart USB flash drive")
Now that you are done you should have a SLA printer that is a little smarter and more convenient to use when it comes to providing your slices to your printer.