The Hackspace recently took delivery of a Raspberry Pi NoIR Camera Module from Farnell – full details are on their website. It is an add-on camera module for the Raspberry Pi which has no infrared filter, making it perfect for taking infrared photographs or photographing objects in low light (twilight) conditions. The camera plugs directly into the Pi by way of a 15 pin Ribbon Cable, to the dedicated 15 pin MIPI Camera Serial Interface (CSI). The standard ribbon cable supplied is going to be too short for our 3D printer needs, but longer ribbon cables can be purchased. The cable can easily be replaced by uncoupling at the camera end.
- General Specification
- Omnivision 5647 sensor in a fixed-focus module without IR filter
- 5 megapixel
- 2592×1944 stills
- 1080p at 30 frames per second
- 720p at 60 frames per second
- 640x480p at 60/90 frames per second
- CSi interface with 150mm ribbon cable
- Weighs 2.4g (3.4g with ribbon cable)
In this post I’ll cover what we did to get the camera module working and ready for use. There will be a follow up post which will show how we are actually using it and how the camera and Pi is fitted to the printer.
A Bit of Background
A completely customized version of AntiX Linux that boots to a live Linux desktop off a thumb drive or CD, and installs to a hard drive in less than 20 minutes for a fully functioning Linux OS with the latest OctoPrint already setup and running. The official MakerOS OctoPrint plugin will allow you to interface with your MakerOS projects from within OctoPrint. Once installed you will be able to query your projects and download both.gcode and.STL files from your projects to your OctoPrint instance. On the initial call to the MakerOS API a MakerOS folder will be created in your files.
Installing Octoprint. If you do not have Octoprint installed and don’t fancy installing the OctoPi distribution, then maybe you would prefer to add Octoprint onto your existing Pi OS? For this I would only be repeating (and not very well) what has already been written over on the OctoPrint Github Repository, so check it out.
The Hackspace already has a Raspberry Pi running as a 3D print server allowing the controlling of our Prusa Mendel through the two options of either Octoprint or Repetier Server. The Pi distribution was provided by myself and is Raspbian with Octoprint and Repetier Server loaded afterwards. What we need to do is add support for the RaspiCam and web video streaming. Initially to take time-lapse videos of 3D printing then moving onto other projects afterwards.
Repetier Server or Octoprint?
The short answer for the Hackspace is both, and we use whatever our own personal preference is. Repetier Server is not to be confused with Repetier Host, which is by the same developer. Repetier Host is a full work flow solution for 3D printing to create, visualise and edit printer paths, as well as full printer control. All of this software is completely free.
Octoprint has built in camera support for time-lapse video or stills while printing, or even live streaming via it’s web interface. It also allows graphical visualisation of the printer extrusion paths live as they are being printed. Repetier Server does not have support for either of these although live streaming can still be accessed on port 8080 via the mjpg-streamer web interface, which gets installed as part of the set-up for the video side of things (more on that later). Repetier server has an annoying bug where after you have ran a print job, the manual extrude feature either does not work, or wants to extrude forever, resulting in a switch off and switch on solution. However, Repetier server does seem faster when uploading gcode, or when choosing to print a previously uploaded file.
For the purposes of this article we will be focusing on using OctoPrint, because as mentioned earlier, it has built in camera support.
The Beginning
To create a 3D print server on a Pi from scratch, the easiest route to follow is to download the OctoPi distribution and follow their instructions, which have everything included to get the Pi working with OctoPrint and the RaspiCam. You can then add on Repetier Server to this afterwards should you wish. Installing OctoPi would make this article end now and everything would be so straight forward.
Updating the Raspberry Pi
It’s been some time since the Pi was updated so we thought it was best to go through this first.
We updated the Raspbian install on our Raspberry Pi by running :
You may need to be root, in which case :
This took some hours.
Enabling the camera
Open the raspi-config
tool from the Terminal:
Select camera
, then select Enable
, and when prompted to reboot select Yes
.
Enabling the camera using raspi-config
did two things. It told your Pi that there is a camera attached and it added three command line utilities.
With the camera module connected and enabled, enter the following command in the Terminal to take a picture:
For more on command line usage, see : http://www.raspberrypi.org/documentation/usage/camera/raspicam/README.md
Installing Octoprint
If you do not have Octoprint installed and don’t fancy installing the OctoPi distribution, then maybe you would prefer to add Octoprint onto your existing Pi OS? For this I would only be repeating (and not very well) what has already been written over on the OctoPrint Github Repository, so check it out.
Adding RaspPiCam Support to Octoprint
The repository we need to download, unpack and compile is mjpg-streamer-experimentalby Liam Jackson. This has the RaspiCam plugin
For the compile side, we need to ensure the command cmake
and a dev version of libjpeg
is pre-installed:
When prompted select Y
to install.
You can run directly from the mjpg-streamer-experimental folder with:
You can also specify options, like in raspivid
above
If you have followed the install guide for OctoPrint correctly, then you will need to make the following changes to your startup script to now look at this new mjpg-streamer-experimental folder:
Edit the /home/pi/bin/octoprint
start up script with the following:
Hopefully that’s it, after a reboot, you should find that OctoPrint is running on the http://<your Raspi's IP>:<port number>
you have assigned and the webcam feed from the RaspiCam is visible in the Control
tab
You can see in the following photo that the infrared from a remote control can be picked up, due to this model of RaspiCam having no infrared filter.
NOTE : You can still access the webcam stream without OctoPrint installed, in case you want to use Repetier Server instead. Just type http://<your Raspi's IP>:8080
in your favourite browser.
Next Steps
We now need to design an enclosure for the Pi and PiFace, buy a longer camera ribbon connection, then find a suitable mounting position on the Prusa Mendel for it’s final resting place.
- 3Installing Scribus
- 5Alternative Installation Methods
Introduction
There are many ways to install Scribus on your Mac but the simplest methods are to download either the Scribus Disk Image (DMG) or the Scribus Package Installer (PKG).
The instructions below will show you how to install Scribus using either of these methods.
Installing GhostScript
Before you think about installing Scribus you need to think about whether you should install GhostScript first.
GhostScript is software that provides services to other applications. Specifically, for Scribus, it allows you to import PostScript (PS) images, Extended PostScript (EPS) images, and PDF files (as images). It also allows you to export your document as PS or EPS (rather than the normal PDF export). It is also needed if you want to use the 'Print Plate' Preview functions.
If you don't think that you will need these functions - and not everyone does - then you don't need to install GhostScript but you will get a message each time you start Scribus mentioning that GhostScript isn't installed. You can always follow the instructions below if you change your mind later.
If, on the other hand, you want to make sure that Scribus is ready for whatever you need to do with it then you should install GhostScript. It's entirely your choice.
If you're not installing GhostScript then skip the rest of this section and go to next section.
You can download the latest version of GhostScript from here.
Locate the 'GhostScript xx.xx' link with the highest 'xx.xx' version number - it's usually near the top of the page - and click on it. This will start the download of the GhostScript PKG (Package Installer). How the download actually happens is dependant on your browser and system set-up, and thus outside the scope of this article.
Installing Octoprint For Os Xenoverse
Once the PKG has downloaded, open the folder it was downloaded to (this is usually 'Downloads' within your own Home folder).
Double click the PKG icon and follow the on-screen instructions. Accept the defaults if you don't know what to change.
Once the process has finished, GhostScript should be installed and ready for action.
Installing Scribus
Once you've got GhostScript installed - really, do that first - you can get down to installing Scribus itself.
As mentioned earlier, there are two easy options for doing this:
- DMG - Disk Image
- PKG - Package Installer
Neither option is particularly difficult but they are quite different, so each is described below.
Disk Image (DMG) Installation
If you're installing Scribus using the Package Installer skip to the next section.
To install from the Disk Image, go to the Scribus Download page.
Click on the link for 'Mac OS X DMG (Intel only, Leopard (10.5) or higher)' and follow the instructions to download the file.
Once the download is complete, open the folder it was downloaded to (this is usually 'Downloads' within your own Home folder), then double-click on the Scribus DMG file to open it. A window will open showing the Scribus application icon.
Drag the Scribus application icon over to the Applications folder shortcut within the same window.
Once the Scribus application has been copied to your Applications folder you can drag the Scribus DMG icon - it looks like a little disk drive - from your desktop to the Trash. (This doesn't delete the DMG, it just 'ejects' it so it's no longer open.)
You can now double-click the Scribus application icon in your Applications folder to start Scribus.
Package Installer (PKG) Installation
To install using the Package Installer, go to the Scribus Download page.
Click on the link for 'Mac OS X package installer (Intel only, Leopard (10.5) or higher)' and follow the instructions to download the file.
Once the download is complete, open the folder it was downloaded to (this is usually 'Downloads' within your own Home folder), then double-click on the Scribus PKG file to run it.
Follow the simple on-screen instructions. Accept the defaults unless you know what to change.
Once Scribus has been installed, open your Applications folder and double-click the Scribus icon to start Scribus.
Installing GhostScript after Scribus
It is possible that you have installed Scribus before installing GhostScript and therefore are getting messages that GhostScript isn't installed.
Don't worry, you can probably fix that quite easily.
First, close Scribus if you already have it open.
Then install GhostScript using the procedure as stated near the top of this article.
Once GhostScript has been installed you need to tell Scribus where GhostScript is.
Open Scribus and choose menu 'Scribus -> Preferences'.Scroll down the list of icons on the left of the Preferences dialog box until you see 'External Tools', then click on 'External Tools'.
At the top of the dialog box you'll see a section named 'Postscript Interpreter', this is where you tell Scribus where GhostScript is installed.Copy this text
/usr/local/bin/gs
and paste it into the field for 'Name of Executable'.OK the dialog box.Close Scribus, then open it again.
Scribus should now be running using GhostScript and you shouldn't be getting the message you were getting before.
However, if the above didn't work, open the Preferences dialog box again, copy this text
/opt/local/bin/gs
and paste it into the field for 'Name of Executable'.OK the dialog box.Close Scribus, then open it again.
You should now be able to use Scribus normally.
However, if that also didn't work you'll need to get more technical.
If neither of the options above fixed your problem then GhostScript was probably installed somewhere that is non-standard, for whatever reason. Hopefully the procedure below will show you where it is, and then how to tell Scribus where it is.
Open your Applications folder and scroll down until you see the 'Utilities' folder.
Double-click the Utilities folder and scroll down until you see the 'Terminal' utility.Double-click the Terminal utility to run it.Copy this text
find / -type l -name gs -print
and paste it after the Terminal prompt, the prompt will probably look like a $ (dollar sign).Press ENTER.
Your system will now start searching for the GhostScript GS file. This is a non-destructive search; no files will be tampered with in any way.
After a while you should see something in the output that looks like
/usr/local/bin/gs
This means that your system has found a GhostScript installation at that location.
Once you've spotted a location you can use CTRL+Z to stop the search. If you don't stop the search it will continue to plough through all of your connected drives doing more searching. It's nothing to worry about but you could be waiting a very long time if you don't stop it.
Once you've stopped the search, scroll up if necessary and copy the location to the 'Name of Executable' field in 'External Tools' - as shown above - then OK the dialog, close Scribus, then re-open it.
You should now have Scribus working with GhostScript.
To clean up after yourself, go to your Terminal utility, type 'EXIT' (without the quotes), press ENTER, then close the Terminal utility.
If you're still having trouble then the problem is something that is outside the scope of this article. Try using the Scribus Forum, or the Scribus Mailing List, or the Scribus Google+ page to get more help.
Alternative Installation Methods
Homebrew
Homebrew purports to be the missing package manager for OS X.
Find out more about installing through Homebrew here.
Subversion (SVN)
Subversion (often abbreviated SVN, after the command name svn) is a software versioning and revision control system. Developers use Subversion to maintain current and historical versions of files such as source code, web pages, and documentation.
Installing Octoprint
Find out more about installing through SVN here.
Fink
The Fink project wants to bring the full world of Unix Open Source software to Darwin and Mac OS X. They modify Unix software so that it compiles and runs on Mac OS X ('port' it) and make it available for download as a coherent distribution.
Find out more about installing through Fink here.
MacPorts
The MacPorts Project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the OS X operating system.
Installing Octoprint For Os Xml
Find out more about installing through MacPorts here.
Installing Development Version
Instead of installing the current stable version of Scribus you can install the latest development version instead.
First you should install GhostScript as shown above.
Once you've installed GhostScript, you need to download the latest development version Disk Image from here.
Click on the link for 'Scribus.dmg' and follow the instructions to download the file.
Once the download is complete, open the folder it was downloaded to (this is usually 'Downloads' within your own Home folder), then double-click on the Scribus DMG file to open it. A window will open showing the Scribus application icon.
Using Finder, open your personal Applications folder in your own Home folder. This is the folder usually called Users/<your name>/Applications and not your normal Applications folder.
Drag the Scribus application icon over to the personal Applications folder you've just opened.
Once the Scribus application has been copied to the Applications folder you can drag the Scribus DMG icon - it looks like a little disk drive - from your desktop to the Trash. (This doesn't delete the DMG, it just 'ejects' it so it's no longer open.)
You can now double-click the Scribus application icon in the Applications folder to start Scribus.