Tuesday, July 31, 2012

Reprap printing from Raspberry Pi

Raspberry Pi controlling my RepRap

I just received my Raspberry Pi a few days ago and after seeing fellow RepRap-er RichRap's success, I wanted to start printing from it.  Since the RPi runs Linux (Specifically a specialty distro of Debian called Raspbian) I wanted to lay out the steps it took for me to get running.

Items needed:

4GB SD card or larger. (Raspberrypi.org suggests atleast 2GB, but trust me you'll need more with the extra dependencies needed to run the needed Reprap programs)
Raspberry Pi
Micro USB powersupply (Its crucial to have at least 1A capacity, anything less and you'll have issues)
Powered USB Hub (make sure it provides plenty of power, mine is capable of 2A)
Keyboard
Mouse
RepRap.  (I'm running RAMPS 1.4 w/Marlin Firmware, but anything that'll connect to Pronterface should be fine.)

Initial RPi set up:


First and foremost, upon initial starting up your RPi, expand the partition to the full SD capacity.  It'll save you a lot of hassle later on.

Optional:  Overclock the RPi.  This isn't 100% neccessary but it will make future steps quicker.  There are multiple tutorials on this but it's pretty easy. 

From your root terminal enter:

sudo nano /boot/config.txt

This brings up the config file and allows you to overclock easily. 
Scroll down to the bottom of the screen and type:

arm_freq=800
sdram_freq=500


Then press Cntrl O to write the file.
Then press Enter.

This will bring you back to the first menu, so now you can exit by pressing Cntrl X.
You should be back at the normal terminal screen now so it's time to reboot:
Type reboot and press enter.

Once you reboot you should be running an overclocked Pi.  You can adjust the arm_freq higher (up to ~900.)  I have mine currently running at 850.  It worked at 900, but I started to have some booting issues. 

Installing Dependencies:

You'll need a few dependencies to run Pronterface.
Once again go back to root terminal and type: 

sudo apt-get install python-serial

Note:  After all terminal commands you need to press enter.  This should be obvious so I won't list that in the directions from this point on


This will install PySerial.  Once this is done type:

sudo apt-get install python-wxgtk2.8

This will install wxPython.
Both of these will take a bit to download and install so be patient.  You'll know your done when you get back to the main terminal prompt.

Now is a good time to reboot.  Once again this can be done from terminal by simply typing "reboot" or "sudo reboot" if your not in sudo.

Downloading Pronterface:


Open up the web browser and navigate over to PrintRun on github.  Click downloads and save. (I'm sure there is a way to do this from terminal, I just didn't know how.)

Now open up the file manager and open up /home/pi  and find kliment's folder. 


Scroll all the way down until you see pronterface.py and double click.  Then click execute and wait a few seconds. 

Pronterface should now be up and running.  

Connecting to printer.


On another computer change the baud rate on your firmware to 115200 if it isn't already.  250000 won't work.

Some of these steps may not be needed but they don't take too much time so just go ahead and follow along.

Close Pronterface if you have it open. 

Reboot (I like to make sure everything is fresh and clean before trying to connect.  I had some issues before.)

Plug in your printer.  Then open Pronterface.  You should see the appropriate port in the port box.

Assuming you haven't run any other serial com ports yet, it should end in 0.   

Now click connect.

This is where I've had some difficulties.  I'm not sure if they stem from power issues or if its a bug in the system some where.

It may take a bit to connnect.  Or it may not connect.  Sometimes I need to close pronterface and restart a couple times before it finally connects.  But eventually it will connect. 

From this point on, it's the same as it would be on any other computer.  Set your temps, load your G codes and print yourself a yoda. 

I have attempted to install Slic3r but no luck so far.  I'm sure Skeinforge would be easier to install since it's python, but thats slow on my regular computer so I figure it'll put it off for now. 

Next we'll download the Android IDE.


This is pretty easy, since some very smart cats putting together the Raspbian distro included it in the available packages.  All you have to do is go to the terminal again and type

sudo apt-get install arduino

This should install Arduino.   Then once again everything is just like any other computer. 

One thing to note, the compiler used in this Arduino IDE is slow, so be patient.  It'll get there. 

Now its time to buy one of these 7" screens and integrate it all into my new MendelMax build.  With a wireless adapter, soon i'll be remotely logging in and starting a print before I leave work. 

Follow along with all of the RPi RepRap development here.


Tuesday, July 17, 2012