gbeevans.com

3D Printing With A Raspberry Pi.

At the start of the year I made the decision to buy a DiamondMind 3D Printer. It was a kit set that that took me a few weeks(Mostly Because I Had Other Things On) to get fully working.

In the early days I decided that leaving my main computer sitting next to it for the many many hours that it took to print was not really something that I wanted to do.

Stand Up Repetier Server

I started to have a look around and see what was available.

Repetier Server was one of the first that I found. So I pulled out a 256MB Raspberry Pi flashed a 16GB SD Card with Raspbian Pi and started the task of installing Repetier Server on it.

It was not the most difficult thing I have done but there where a few steps missing to get it fully up and running.

I soon figured out that it was an issue with the permissions that where set up on the files that needed to be moved in to there pre required spaces. I have since done another install of Repetier Server onto another 512MB Raspberry Pi and can confirm that building Repetier Server your self removes these issues.

I liked Repetier Server a lot. It was simple enough to get up and running and had an nice easy to use layout.

The only real downsides where;

  • There is no Camera Capture Software baked in
  • It to me has the Y Axis arrows around the wrong way and from time to time I would hit the wrong button and crash my lil purple cart into a wall.

Fixing these issues

Well that was an interesting proposition. The Y-Axis problem was not really a major issue even if it may look like i'm throwing my toys out of the cot over it.

The Camera issue was something that I felt could be addressed inside Repetier but would be a pain as not everyone is going to be using Repetier server on a Raspberry Pi and as such calling raspstil would not work.

So as such I decided to make a simple web page that would show you the most recent picture from the camera.

I figured to get this working it was a case of writing up a shell script, along with some javascript and HTML. The Shell Script would take care of the photo capture and create a simlink that could be followed by apache to serve the image out. The javascript was needed to reload the image being shown.

This took a few hours to get going fully.

Version 1

Version 1 was simple at best but it worked like a champ. However it had some major caveats.

  • X Y Z Axises and temperature sill had to be found by going into Repetier Server meaning that you needed to have more than one window open at a time to view both at the same time.
  • Photo's taken where massive. They where fine over on the local network. Even on Wi-Fi it worked well. Over the internet was a different story.
  • Photos where stored on the Raspberry Pi which meant you had to delete them from time to time.

Version 1.1

Knowing some of the draw backs with version 1 I set out to fix the one that was causing the most amount of issues(for me). The XYZ Axis and Temp Viewing on the same page issue.

This took a bit of work and some heavy amount of reverse engineering Repetier Server.

After some digging around the Repetier Server front end I managed to find the hooks that it was using to display these values.

Once I found these hooks it was relatively easy to get it working on my computer. But broke as soon as apache tried to serve the html script.

Slightly annoyed and perplex as to why it stopped working as soon as it hit apache I did some more searching.

Soon I found out what was causing the issues. I was dealing with cross site scripting. Because the files that where being called resided on port 8080 and I was running on port 80 on the same server it blocked the ajax calls.

Some more digging and tinkering with reverse proxy on apache it worked.

<Location /printserver> ProxyPass http://localhost:8080/ ProxyPassReverse http://localhost:8080/ </Location>

Where To Now

I bet you would like to know.

In a few weeks I will be posting another article much like this one going over where I am going to go with this.

If you want to subscribe to get these as soon as they come out click here

Tags: 3D Printer, Development, HTML, Javascript, Shell, Raspberry Pi
Back

About.

Welcome.

gbeevans.com is run by Geoff Evans.

Geoff also runs Geo Com Ltd who build and run web sites web apps etc.

In my off time I build/tinker with Arduino, Raspberry Pi, Beaglebone etc. I have made and minted may custom PCB's.

Over the years I have been involved with many stage productions both on stage, back stage, and sometimes on the very rear occasion front of house. In 2008 I won the AMI Showdown Award for sound design in ACG Senior College's Production of "The Player Project"

Depending on when I find time I will post here most likely about the above subjects. You can get me most of the times by the links below. I monitor Twitter but frequent posting will be rare.

Where To Find Me
Twitter: GeoCom
Facebook: gbeevans
YouTube: gbeevans
GitHub: geocom
GeekZone: geocom
Work: Geo Com Ltd