User Tools

Site Tools


raspberry-pi

Link to this comparison view

raspberry-pi [2013/01/16 17:14]
jit
raspberry-pi [2013/10/20 17:41] (current)
jit
Line 3: Line 3:
 {{wiki:​jitsbuild:​with-raspberry-pi.png?​800}} {{wiki:​jitsbuild:​with-raspberry-pi.png?​800}}
  
-The following should be considered experimental,​ until it is demonstrated that this actually works. 
  
-This is for the adventurous.+==== Why? ====
  
----------------------+Most 3D printers work a lot like regular printers, in the sense that you install some software on a computer and then plug the printer into the computer using a USB cable. ​ But 3D printers have a special requirement: ​ depending on the size and complexity of the object to be printed, it might take hours to do one print, and if the print job is interrupted for some reason, the print will likely be ruined and you will have to start over from scratch.
  
-==== Why? ====+If you use your regular desktop or laptop computer to drive your 3D printer, and then use that computer to do other things at the same time, you run the risk of accidentally interrupting the printing software during the job.  So it's best not to multitask with that computer while printing; ​ just use a dedicated computer for that task and that task alone. ​ With the costs of computers gradually approaching zero, it's not expensive to do this.
  
-The Raspberry Pi is very small (about the same size as the Azteegand could be embedded into the printer itself, making the Bukobot completely free-standing (except for monitor, keyboard, and mouse). ​ It can also connect to a network, perhaps allowing the user to run the printer from a web browser on another computer.+The Raspberry Pi is very small computer.  ​(It'​s ​about the same size as the Azteeg ​controller; ​ in the photo above it's hiding in the background, between the printer ​and the monitor.) It's so small that it could be embedded into the printer itself, making the Bukobot completely free-standing (except for monitor, keyboard, and mouse). ​ It can also connect to a network, perhaps allowing the user to run the printer from a web browser on another computer;  in this case, the printer becomes a standalone appliance, and you wouldn'​t need to keep a monitor, keyboard, or mouse attached to it.
  
 The cost to do all this is very small. ​ Current US prices: The cost to do all this is very small. ​ Current US prices:
  
-  * Raspberry Pi, $35 (order backlog for these is currently about a month, in the U.S. at least)+  * Raspberry Pi, $35
  
   * Power supply, $6 (adafruit has a nice one)   * Power supply, $6 (adafruit has a nice one)
Line 23: Line 22:
   * cables, case, keyboard, mouse, hub, maybe $50 total   * cables, case, keyboard, mouse, hub, maybe $50 total
  
-  * monitor, maybe $150+  * monitor, maybe $150 (but see below)
  
-Of course you may already have some of the above.+Of course you may already have some of the above, or may not need some of the above.
  
 ==== Parts Required ==== ==== Parts Required ====
Line 33: Line 32:
   * High quality power supply for same, 5V, at least 1A, plus micro USB cable to connect it to the Pi   * High quality power supply for same, 5V, at least 1A, plus micro USB cable to connect it to the Pi
  
-  * SD card, at least 8GB, preferably class 10 or better+  * SD card, at least 8GB, preferably class 10 or better ​(but many people say class 4 works fine)
  
   * Powered USB hub   * Powered USB hub
Line 41: Line 40:
   * Mouse, USB (wired, at least at first)   * Mouse, USB (wired, at least at first)
  
-  * Monitor, HDMI, with HDMI cable+  * Monitor, HDMI, with HDMI cable  (or see below)
  
   * Ethernet cable, with Internet on the other end (do not try to use wireless, at least at first)   * Ethernet cable, with Internet on the other end (do not try to use wireless, at least at first)
Line 47: Line 46:
   * Mini USB cable to connect Pi to printer (should be included with printer)   * Mini USB cable to connect Pi to printer (should be included with printer)
  
-  * Bukobot+  * Printer (the Bukobot ​is highly recommended)
  
-One of the primary reasons for having problems with a Raspberry Pi is the power supply. ​ There are many different power supplies on the market (most smartphones and similar small devices use this type) and a lot of these power supplies are of poor quality. ​ The Pi needs a high-quality power supply, rated at one amp or more.  The adafruit unit (their #501) is recommended by Lady Ada, so it's a good one (and the price is good too).+=== Power Supply ===
  
-If you intend to connect the Azteeg, a keyboard, and a mouse to the Pi then you'll need a USB hub for sure (the Pi only has two USB ports). ​ Might as well make that a powered hub and be sure you won't overwhelm the Pi's power supply. ​ For not much more, you can get a powered hub that also has card slots (the Pi does have an SD card slot, but you boot from that and can't remove the card while the Pi is running).+One of the primary reasons for having problems with a Raspberry Pi is the power supply. ​ There are many different allegedly compatible power supplies on the market (most smartphones and similar small devices that recharge through a micro USB port use this type) and a lot of these power supplies are of poor quality. ​ The Pi needs a high-quality power supply, and it must be rated at one amp or more.  The adafruit unit (their [[https://​www.adafruit.com/​products/​501|#​501]]) is recommended by Lady Ada, so it's a good one (and the price is good too). 
 + 
 +=== Powered USB Hub === 
 + 
 +If you intend to connect the Azteeg, a keyboard, and a mouse to the Pi then you'll need a USB hub for sure (the Pi only has two USB ports). ​ Might as well make that a powered hub and be sure you won't overwhelm the Pi's power supply.  ​(For not much more, you could instead ​get a powered hub that also has card slots, if you think you might want to connect memory cards to the Pi for some reason. ​ The Pi does have a built-in ​SD card slot, but you boot from that and can't remove the card while the Pi is running).
  
 === Video Options === === Video Options ===
  
-For best picture quality, use a monitor (or television) with an HDMI connection.+For best picture quality, use a monitor (or high-def ​television) with an HDMI connection.  The Pi can do 1080p resolution.
  
-If you have a monitor ​sitting around that has VGA but not HDMI, you can use a [[http://​www.farnell.com/​datasheets/​1669934.pdf|Pi-View]] adapter.  (The system shown above is using one of these.)  ​You can get these from any Farnell/​element14 affiliate ​(Newark in the U.S. currently has these for about $33).+A DVI monitor can also deliver equivalent picture quality.  (Requires DVI-D or DVI-I; ​ DVI-A won't work.)  ​For this you need an HDMI-DVI adapter cable, or a regular DVI monitor cable plus an HDMI-DVI adapter ​(this adapter needs to have a male HDMI connector on one end, and female DVI on the other, as shown below).  These adapters are passive, and quite inexpensive.
  
-Of course the Pi also has a standard-definition output ​on RCA jack, that can be connected to an old-fashioned television. ​ It's low resolution, but perhaps sufficient to get the Pi set up and running headless. ​ (Anyone try this?)+{{wiki:​jitsbuild:​hdmi-to-dvi.jpg}} 
 + 
 +If you have a monitor sitting around that has VGA input but not HDMI or DVI, you can use a [[http://​www.farnell.com/​datasheets/​1669934.pdf|Pi-View]] adapter. ​ (The system shown above is using one of these.) ​ You can get these from any Farnell/​element14 affiliate (Newark in the U.S. currently has these for about $33).  Also now available from Adafruit: ​ [[https://​www.adafruit.com/​products/​1151|HDMI to VGA Video + Audio Adapter]], which also has audio output, and costs even less.  Also:  [[http://​www.amazon.com/​SANOXY®-Adapter-Power-free-Raspberry-Support/​dp/​B0088K7QUQ|this one]]. ​ (But be warned, it can be a little tricky to get the VGA configured properly, and mis-configured VGA can result in no video output at all; see [[http://​www.raspberrypi.org/​phpBB3/​viewtopic.php?​p=437952|here]] for more information.) 
 + 
 +Of course the Pi also has a standard-definition ​TV output ​("​composite"​) through its RCA jack, that can be connected to an old-fashioned television. ​ It's low resolution, but perhaps sufficient to get the Pi set up and running headless. ​ (Anyone try this?) 
 + 
 +You will need a monitor to get the Pi set up, and perhaps to administer and maintain it later. ​ (Unless you know how to use SSH and want to do everything from the command line.) ​ But if you set up the Pi to run headless (using a web interface, for example), you wouldn'​t need to keep a monitor connected all the time, so you could temporarily borrow a monitor from somewhere else and not have to buy one just for your Bukobot. 
 + 
 +Also, many monitors and TVs have multiple inputs, and can be connected to more than one computer at a time.  Just press the input button on the display to switch between computers. 
 + 
 +Finally, if you already have a [[https://​en.wikipedia.org/​wiki/​KVM_switch|KVM switch]] that can support DVI monitors, you can connect your Pi to the KVM switch through the HDMI-DVI adapter mentioned above, and then use the keyboard, video monitor and mouse that are already attached to your KVM switch to talk to your Pi.  And since many such KVM switches use a single USB connector for the keyboard and mouse connections,​ effectively putting a USB hub inside the KVM switch, you might not need a separate USB hub for the Pi;  plug the KVM switch into one of the Pi's USB ports, and the Azteeg into the other (don't connect the Azteeg through the KVM switch!). ​ In this case your total cost to add the Pi to your printer might be not much more than $50.
  
-You will need a monitor to get the Pi set up, and perhaps to administer and maintain it later. ​ But if you set up the Pi to run headless (using a web interface, for example), you wouldn'​t need to keep a monitor connected all the time, so you could temporarily borrow a monitor from somewhere else and not have to buy one just for your Bukobot. 
  
 ==== Getting Started ==== ==== Getting Started ====
  
-Download the latest version of [[http://​www.raspberrypi.org/​downloads|Raspbian Wheezy]] (not the soft-float version). ​ Follow the directions on that page to put the image on the SD card.  Note the default user name and password.+(In all of the following, it is assumed that you are using the default username, pi.  If you use a different user name, you may have to change some of the things below, replacing pi with your username. ​ You can wait to set up a different user name until you have gotten the Pi running and tested it for a while.) 
 + 
 +First go [[http://​www.raspberrypi.org/​quick-start-guide|here]] and click the diagram to download the pdf file.  Read it. 
 + 
 +Download the latest version of [[http://​www.raspberrypi.org/​downloads|Raspbian Wheezy]] (but not the soft-float version). ​ Follow the directions on that page to put the image on the SD card.  Note the default user name and password
 + 
 +Follow the directions on that page to sync the filesystem so that the card can be safely removed from the computer. ​ Insert the card into the Pi.
  
-Follow ​the directions to sync the filesystem so that the card can be safely removed from the computer.  ​Insert the card into the Pi.+**Alternatively**,​ you can download the new NOOBS installer shown on that page, and follow ​the directions ​there to put that on your 8GB card.  Or, for $40 you can buy the new package ​that contains one Raspberry Pi and one NOOBS card (but be warned, ​the card that comes with that package only holds 4GB and the directions below would have to be modified so that the card doesn'​t get too full, and nobody has documented that yet).  ​If you use NOOBS, select Raspbian Wheezy when it asks you.
  
-Connect the powered USB hub to one of the two USB ports on one end of the Pi.  Connect an Ethernet cable to the Pi's Ethernet jack next to the USB ports. ​ Connect the other end of the Ethernet cable to a working Internet connection.+Connect the powered USB hub to one of the two USB ports on one end of the Pi.  Connect an Ethernet cable to the Pi's Ethernet jack (next to the USB ports).  Connect the other end of the Ethernet cable to a working Internet connection.
  
 Connect the wired keyboard and the wired mouse to the powered USB hub.  Apply power to the hub.  Don't connect the Azteeg controller to the hub yet. Connect the wired keyboard and the wired mouse to the powered USB hub.  Apply power to the hub.  Don't connect the Azteeg controller to the hub yet.
Line 75: Line 93:
 Connect the monitor to the Pi's HDMI jack with the HDMI cable. ​ Turn the monitor on. Connect the monitor to the Pi's HDMI jack with the HDMI cable. ​ Turn the monitor on.
  
-Connect the Pi to its power supply using the micro USB cable, and plug the power supply in.+Connect the Pi to its power supply using the micro USB cable, and plug the power supply in.  (This is the closest thing you have to an on/off switch on the Pi;  always remember to power down the Pi through its menu before removing power.)
  
-Watch the monitor.+Watch the monitor.  Watch the text scroll by as the Pi boots up.
  
-See the text fly by as the Pi boots up.+Eventually, a menu resembling ​the one shown below should appear. ​ If it doesn'​t,​ troubleshoot. ​ (You can ask for help in the [[http://​forum.bukobot.com/​index.php?​board=4.0|Linux Specific Software section of the forum]]. ​ Don't be intimidated by this software; ​ millions of people have successfully gotten Pis running, including a lot of nine-year-old kids.)
  
-Eventually, a menu should appear. ​ If it doesn'​t,​ troubleshoot.+{{wiki:​jitsbuild:​raspi-config-2013-10.jpg}}
  
-{{wiki:​jitsbuild:​raspi-config.png}}+This menu is navigated with the up and down arrows, <​Tab>,​ and <​Enter>​. ​ In a few places you have to put check marks in boxes, indicated by square brackets like these [ ];  highlight the box, and hit the space bar to toggle the checkbox.
  
-This menu is navigated with the up and down arrows, <​Tab>,​ and <​Enter>​.+First, go into Advanced Options and try to update this menu program. ​ If an update ​is available, ​the computer will be rebooted before you continue.
  
-Firsttry to update this menu program (update).+Also on the Advanced Options menuset the graphics memory ​to 32MB.
  
-Use the menu to set the graphics memory to 32MB  ​(memory_split).+Tell the Pi to boot into the graphical user interface ​('​Desktop'​on next boot:
  
-Use the menu to tell the Pi to boot into the graphical user interface on next boot (boot_behaviour).+{{wiki:​jitsbuild:​rasp-config-bootopt-2013-10.jpg}}
  
-Use the menu to tell the Pi to expand its file system to maximum size on next boot (expand_rootfs).+Tell the Pi to expand its file system to maximum size on next boot.  ​(It will tell you if you don't need to do this.)
  
-Select your keyboard, locale, and time zone (configure_keyboard,​ change_locale,​ and change_timezone).  (Remember that the Raspberry Pi comes from England, and the defaults ​assume UK and GB and the like, and you should change those values if you live somewhere else in the world.)+If you intend to SSH into your Pi, enable that on the Advanced Options menu.  If you don't know what this means, don'​t. 
 + 
 +Select your keyboard, locale, and time zone.  (Remember that the Raspberry Pi comes from England, and the defaults ​are set for that place, and you should change those values if you live somewhere else in the world.) ​ The locale is specified like this:  language-COUNTRY.encoding,​ where '​language'​ is a two-or-three letter lowercase code, '​COUNTRY'​ is a two character uppercase country code, and encoding is (for most areas) UTF-8. ​ (Warning: ​ If you tell it to install ALL locales, it will take a long time for the menu to return, as locales are time-consuming to set up.)  (Note that the west coast of the U.S. is specified as '​Pacific Ocean'​.) 
 + 
 +Finally, change the user password. ​ Make note of the new one.
  
 Use the menu to reboot (tab over to <​Finish>​). Use the menu to reboot (tab over to <​Finish>​).
  
-Watch it boot again. ​ It should boot into the LXDE desktop environment. ​ If it doesn'​t,​ troubleshoot.+Watch it boot again. ​ It should boot into the [[http://​lxde.org/​|LXDE desktop environment]].  If it doesn'​t,​ troubleshoot.
  
-Start the Midori web browser and verify that the Pi can see the Internet.+Find the icon for the [[http://​www.midori-browser.org|Midori web browser]] on the Desktop, launch it, and verify that the Pi can see the Internet.
  
 Browse to this page.  Follow the rest of these directions. Browse to this page.  Follow the rest of these directions.
Line 145: Line 167:
 </​code>​ </​code>​
  
-That command will install a variety of utilities that are handy for maintaining and managing this machine, and a collection of common applications.+That command ​(which may run for a good long while) ​will install a variety of utilities that are handy for maintaining and managing this machine, and also a collection of common applications
 + 
 +This includes the complete LibreOffice suite, and a web browser called IceWeasel (a version of Firefox). ​ But, be warned: ​ Both of these are heavy users of memory, which is in short supply on the Pi.  They will probably run, but may run slowly. ​ They may run very slowly on a 256MB Pi. 
 + 
 +=== Next... === 
 + 
 +At this point, your Raspberry Pi is set up as a modern general-purpose desktop computer. ​ Test it for a while; ​ become accustomed to its quirks. ​ It's roughly equivalent in power to a high-end desktop system from the 1990'​s,​ so don't expect it to be fast.  Startup times may annoy you, but you won't be starting programs very often; ​ you will be starting your host software and letting it run for minutes or hours as it tells your printer how to make things. 
 + 
 +There are currently more than 37,000 free software packages available for this system; ​ any of them can be installed with a few clicks. ​ Many of them are installed now.  Click the LXDE icon at the left side of the bottom panel to see some of them.  Use the Synaptic package manager (under Other) to see what is installed, or visit the Pi Store. ​ You can also use Synaptic to install updates. ​ But remember, the Pi is rather slow and low on memory, and it's probably best if you don't try to run any other programs while the Pi is driving your printer. 
 + 
 +You should definitely change the default system password. ​ You may also want to create a new user (other than '​pi'​) and disable the pi account; ​ these are all standard security measures to protect your system from evil.  See [[http://​www.raspberrypi.org/​phpBB3/​viewtopic.php?​f=91&​t=57395&​p=432824|here]] for how. 
 + 
 +At this point, you can connect the Azteeg controller. ​ Plug it into your powered USB hub.
  
-This includes the complete LibreOffice suite, and a web browser called IceWeasel (a version of Firefox). ​ But, be warned: ​ Both of these are heavy users of memory, which is in short supply on the Pi.  They will probably run, but may run slowly. ​ Don't even think of running these on a 256MB Pi. 
  
 === Install software to run the Bukobot === === Install software to run the Bukobot ===
  
-Nowinstall pronterface (Printrun directory) into home directory:+The only software you really need to run on the Pi is your host software. ​ This is the software that talks to the Azteeg controller and transfers the contents of your G-code file to itand may also monitor the printer'​s operations.
  
-<​code>​ +Many people also run other kinds of software on their host machine, such as slicing software ​It'​s best not to do this on the Pi, as it may not have enough memory and may slow down tremendously.
-git clone git://​github.com/​kliment/​Printrun.git +
-</​code>​+
  
-If you have another computer to do slicing on, you can make a G-code file on that computer and transfer it to the Pi, and then you don't need skeinforge or Slic3r on the Pi.  The Pi is network connected, and can also talk to USB drives, so there are lots of ways of getting files across. ​ If you have the Azteeg X3, you can also put files on a microSD card and plug the card into the X3+If you have another computer to do slicing on (highly recommended), you can make a G-code file on that computer and transfer it to the Pi, and then you don't need slicing software like skeinforge or Slic3r on the Pi.  The Pi is network connected, and can also talk to USB drives, so there are lots of ways of getting files across. ​ If you have the Azteeg X3, you can also put files on a microSD card and plug the card into the X3, or use your host software ​to copy gcode files onto the microSD card through the USB cable (but be warnedthis is very slow).
-  +
-If you want to run skeinforge on the Piget the latest version from [[http://​fabmetheus.crsndoo.com/​|here]]. ​ Make a subdirectory called ~/​Printrun/​skeinforge/​ and unzip the contents of the downloaded file into there.+
  
-If you want to try Slic3rinstall it into another subdirectory of Printrun:+== pronterface == 
 + 
 +Pronterface is a host control program. ​ It's a good idea to install pronterface,​ even if you intend to use a different host control program; ​ it's light on resource requirements,​ and gives you something to switch to if you suspect that your other host control program might be causing problems. ​ (If you switch ​to a different host program and the problem doesn'​t go awaythen the problem is probably being caused by something other than the host program.) 
 + 
 +Install pronterface (Printrun ​directory) into your home directory:
  
 <​code>​ <​code>​
-cd ~/Printrun +cd ~ 
-git clone https://​github.com/​alexrj/Slic3r.git +git clone git://​github.com/​kliment/Printrun.git
-cd Slic3r  +
-sudo cpanm Boost::​Geometry::​Utils Math::​Clipper \ +
-    Math::​ConvexHull Math::​ConvexHull::​MonotoneChain Math::​Geometry::​Voronoi Math::​PlanePath Moo Wx +
-./​slic3r.pl ​+
 </​code>​ </​code>​
  
-Slic3r will be installed and started, and will launch the Slic3r Configuration Assistant. ​ You can use that tool, or instead you can cancel out of it and import some canned profiles already set up for the Bukobot; ​ just download the zip file from {{:​bukobot_profiles.zip|here}},​ unzip it, and use Slic3r'​s menu (File >> Load Config...) to load the profiles you need.  See [[host-slicing-settings|here]] for more information. 
  
 You can put an icon on the Desktop for launching Pronterface. ​ On the Desktop, create a new file (right-click in an empty area of the Desktop, select Create new... ​ Blank file), name it pronterface.desktop,​ right-click on the file and select LeafPad, then paste the following text into it: You can put an icon on the Desktop for launching Pronterface. ​ On the Desktop, create a new file (right-click in an empty area of the Desktop, select Create new... ​ Blank file), name it pronterface.desktop,​ right-click on the file and select LeafPad, then paste the following text into it:
Line 188: Line 216:
 </​code>​ </​code>​
  
-and save the file.+and save the file.  (If you are using a different username than pi, change that in two places above.) 
 + 
 +== slicers == 
 + 
 +Slic3r and skeinforge are programs for slicing (turning shapes into G-code files so they can be printed). ​ It's best to do this on a machine other than the Pi, but if you want to try them on the Pi [[raspberry-pi-slice|here'​s how to install them]]. 
  
 ==== How to run the programs ==== ==== How to run the programs ====
 +
 +=== Getting files onto the Pi ===
 +
 +Many people use the Pi only for controlling the printer, using a host program like Pronterface,​ and do all their slicing on a different machine that has a lot more memory and speed. ​ G-code files (.gcode extension) are generated on the other machine and transferred to the Pi through the network or by other means (USB thumb drive, etc.). ​ It's trivial to access shared network folders from the Pi:  start the File Manager, and do Go >> Network Drives.
  
 === Arduino === === Arduino ===
Line 196: Line 233:
 To run Arduino (for example, if you want to put a different firmware on the Azteeg controller),​ find Arduino in the main menu (click the start icon at lower left): ​ Start >> Programming ​ >> Arduino. To run Arduino (for example, if you want to put a different firmware on the Azteeg controller),​ find Arduino in the main menu (click the start icon at lower left): ​ Start >> Programming ​ >> Arduino.
  
-(Connect Pi to Azteeg first, ​of course.  Use the powered hub.) +(Connect Pi to Azteeg first, ​if you haven'​t already.  Use the powered hub.)
- +
-If you don't have motors connected to Azteeg, don't run the Azteeg from the 12V power supply. ​ Power it from USB instead. ​ Move the Input Select jumper on the Azteeg (on the X3 it's under the daughterboard). ​ See [[bukobot-assembly-documentation|Azteeg docs]].+
  
 You have to select the board type (Arduino Mega 2560), the COM port (probably only one listed there), and the baud rate (250000). ​ For more details see [[http://​reprap.org/​wiki/​Azteeg_X3|here]]. ​ (You don't have to install any drivers.) You have to select the board type (Arduino Mega 2560), the COM port (probably only one listed there), and the baud rate (250000). ​ For more details see [[http://​reprap.org/​wiki/​Azteeg_X3|here]]. ​ (You don't have to install any drivers.)
Line 204: Line 239:
 === pronterface === === pronterface ===
  
-To run pronterface,​ go to ~/Printrun and run pronterface.py:​+Create a desktop icon as described above and use that to launch ​pronterface, ​or go to ~/Printrun and run pronterface.py:​
  
 <​code>​ <​code>​
Line 211: Line 246:
 </​code>​ </​code>​
  
-The first time you run it, you have to tell it the board type and COM port.  If you want to try Slic3r (this may run impractically slow) instead of skeinforge, you have to go to pronterface preferences and tell pronterface where the Slic3r executable is:  Settings ​ >> ​ Options ​ >> ​ slicecommand.  ​There is also a command-line interface (pronsole.py) and a web browser interface. ​ See [[https://​github.com/​kliment/​Printrun|here]] for more information.+The first time you run it, you have to tell it the board type and COM port. 
 + 
 +There is also a command-line interface (pronsole.py) and a web browser interface ​for pronterface.  See [[https://​github.com/​kliment/​Printrun|here]] for more information. 
 + 
 +There are also other host softwares available for running your printer. ​ Those ought to be described by someone who has actually used them on a Pi. 
  
 ==== 256MB Raspberry Pi ==== ==== 256MB Raspberry Pi ====
raspberry-pi.1358378068.txt.gz · Last modified: 2013/01/16 17:14 by jit