Tuesday, May 27, 2014

I sat today to get OctoPrint to run a MR3020 router successfully. This is a long post, so stay with me. There are successful sub-steps documented elsewhere on the web, so I would link to them instead of putting them down here.

Devices Required
1) TP- Link MR3020 Wireless Router
2) A 4GB USB drive.
3)A 3d printer board

*****Steps beyond this have the capacity to void the router's warranty***

Installing OpenWRT on the router

1) Access the router
2) Navigate to the firmware update page
3) Upload the Openwrt Image and wait for the router to restart


See instructions here. For a router that has the barebones firmware from TP-link, use the webgui method which is recommended.

Setting a wireless AP and extending the flash capacity of the router
I followed a combination of guides given here and here

Unless the root file system has been successfully moved to the USB drive, do not continue steps further.

Setting up dependencies for OctoPrint

opkg update
opkg install python python-openssl kmod-usb-serial-pl2303 kmod-usb-serial-ftdi kmod-usb-acm distribute


Installing Octoprint
Download from the git repo for octoprint was done on my laptop, which had wamp running. I copied the zip file to my 'www' directory, started the wamp server, and executed the wget command with my laptop acting as the source of the files.


Once inside the unzipped Octoprint folder on your router, navigate to the folder Octoprint/Octoprint-master that has setup.py, and execute the following command

python setup.py build install

This step is successful will install Octoprint on the router.

With root credentials, you could test some initial stuff like connection and ports for octprint.

execute
octoprint --iknowwhatimdoing

at the prompt.. This is using root credentials, hence its advisable to run as a non-root user. I tried this, but haven't got success owing to the limited memory on the router.

Create a non-root user and execute the commands with the python shell

octoprint

The prompt will give you if the exeuction was successful and a URL with which the Octoprint server can be accessed.

navigate to the URL listed in the console, and you should be able to see the Octoprint startup page.

1 comment:

  1. Hi. I followed up your guide to install octoprint in my mr3020, but I ended up with this error:
    UPDATING build/lib/octoprint/_version.py
    Traceback (most recent call last):
    File "setup.py", line 110, in
    setup(**params())
    File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
    File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
    File "/usr/lib/python2.7/site-packages/setuptools/command/install.py", line 73, in run
    self.do_egg_install()
    File "/usr/lib/python2.7/site-packages/setuptools/command/install.py", line 93, in do_egg_install
    self.run_command('bdist_egg')
    File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
    File "/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.py", line 179, in run
    cmd = self.call_command('install_lib', warn_dir=0)
    File "/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.py", line 166, in call_command
    self.run_command(cmdname)
    File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
    File "/usr/lib/python2.7/site-packages/setuptools/command/install_lib.py", line 20, in run
    self.build()
    File "/usr/lib/python2.7/distutils/command/install_lib.py", line 109, in build
    self.run_command('build_py')
    File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
    File "/root/OctoPrint-master/versioneer.py", line 951, in run
    f.write(SHORT_VERSION_PY % versions)
    KeyError: 'branch'

    Do you know how can I solve this? Thanks a lot!

    ReplyDelete