I’ve been using the heck out of my Makerfarm i3v 10″ ever since it arrived back in November. It’s a solid kit and Colin at Makerfarm quickly responds to emails (that’s worth a lot to me even though I only had to bug him once.) Out of the box it comes with two ways to drive it: 1) a computer connected via USB and 2) the provided SD card and LCD interface. I use my laptop for modeling in addition to non-3D printing stuff, so having it tethered to the printer got old fast. Enter OctoPrint. OctoPrint is a Python project that communicates with the printer via USB, but also provides a web interface for controlling the printer, viewing its status, and uploading files. A lot of people run it on a Raspberry Pi. It’s a perfect use-case for such a device. Why not go with that? It’s well-supported and cheap enough, right? That’s just not how I roll.
The way I roll: Hey, all of OctoPrint is in Python and I know I can get the orphan Netgear running Python and the router has a USB port… New project!!
The following is what’s involved in general and is not a step-by-step guide.
Device: WNDR3700v1 (originally found wet, cold, and bricked in a dumpster)
Hardware: 4GB USB stick + USB hub (passive is just fine)
OS: OpenWrt Chaos Calmer (from here https://forum.openwrt.org/viewtopic.php?id=50914) (default password: changeme)
Software: OctoPrint + dependencies (Download from here)
First, figure out how to get OpenWrt on your router. There’s a tutorial on the web somewhere. (side note: I tried DD-Wrt, but had trouble getting the USB drivers installed, so I switched to OpenWrt.)
You’ll have to start with a connection to one of the LAN interfaces on the router, but we of course want to make things wireless and it makes it a lot easier to download packages and change settings when the router is configured as a client of our home WiFi network. Go ahead and configure that in LuCI before continuing. NOTE: The wwan interface must be on the same subnet as your WiFi network, but you’ll want to change the LAN interface to be on a different subnet! It took me a while to realize why I couldn’t hit the wwan IP from my WiFi network. In the end I set the LAN interface to a static 192.168.2.1 and the wwan to a static 192.168.1.200 (my WiFi network is on the 192.168.1.1/24 subnet).
Next, since the router doesn’t have enough internal storage for our needs, we need to get USB storage working. Most routers will only have one USB port and we need two (one for the flash drive we’ll connect and one for the printer), but through the modern wonder that is USB, a hub gives us more ports. The USB drive needs to be formatted. It’s probably a good idea to give it at least two partitions (one big one for storage and the other for SWAP), but I went with just one for storage. I used ext4 (ext2 should work too, but don’t use ext3 because it will wear out your drive). Plug the hub into the USB port on the router and the flash drive into one of the hub’s ports. Next, add it as a mount point through the OpenWrt luci web interface by going to System > Mount Points and click the “Add” button under the Mount Points section. Check “Enable this mount” and choose the device, then select the Filesystem. When you select the Filesystem, a “
Now that we’ve extended the device’s storage with the flash drive, we have room for the necessary software. Let’s SSH into the router (root@yourroutersip) and get package management (opkg) set up. There might be extra steps or it might work out of the box. Try running opkg update and see what you get. Resolving opkg issues is beyond the scope of this post. We need three packages from opkg – python, python-setuptools and kmod-usb-acm. kmod-usb-acm is the driver for the printer (aka Arduino Mega 2560).
opkg install python python-setuptools
kmod-usb-acm failed for me with the normal install command (something about a kernel version mismatch even though the kernel version matched). I used the force-depends argument and everything worked fine. I suggest trying it without first, though.
opkg install kmod-usb-acm --force-depends
Connect the end of the printer’s USB cable to the USB hub and reboot the device either through the web interface or by typing reboot in the terminal. Once the device is back up, SSH back in and run ls /dev . If the ACM USB driver is working, you should see ttyACM0. If you don’t see it, do the usual dmesg | tail to troubleshoot.
The next step is to install OctoPrint on the router. I could not get python-setuptools to connect to HTTPS sites (I’m sure it’s something simple, but it was distracting from proving the concept of getting OctoPrint running on a router.) Instead, I downloaded the packages to my laptop and scp’d them to the router and found the order of operations by trial and error. Don’t worry, you won’t have to because I documented the process and have provided a file containing everything you need 🙂
octoprint --iknowwhatimdoing &
That argument is there since you normally don’t want something to run as root, but sometimes (like when that’s the only account there is) you have to. The command will start OctoPrint on port 5000 (add a –port=PORT_NUMBER argument if you want it on a different port) when the router boots.
Reboot the router and try accessing http://yourrouterswwanip:5000. You should see the OctoPrint page. Configure your connection. The /dev/ttyACM0 device should be in the dropdown.
Enjoy your (now wireless) 3D printing!