<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.phidgets.com/docs21/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Patrick</id>
	<title>Phidgets Legacy Support - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.phidgets.com/docs21/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Patrick"/>
	<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/Special:Contributions/Patrick"/>
	<updated>2026-04-08T06:18:55Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Template:Phidget21Box&amp;diff=24133</id>
		<title>Template:Phidget21Box</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Template:Phidget21Box&amp;diff=24133"/>
		<updated>2024-02-23T17:43:37Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;background-color: #ffcccc;&amp;quot;&lt;br /&gt;
|[[Image:alert.png|40px|link=]] &lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |&lt;br /&gt;
&#039;&#039;&#039;Notice:&#039;&#039;&#039; This page contains information for the legacy Phidget21 Library.&lt;br /&gt;
&lt;br /&gt;
Phidget21 is out of support. Bugfixes may be considered on a case by case basis. &lt;br /&gt;
&lt;br /&gt;
Phidget21 does not support VINT Phidgets, or new USB Phidgets released after 2020. We maintain a selection of legacy devices for sale that are supported in Phidget21. &lt;br /&gt;
&lt;br /&gt;
We recommend that new projects be developed against the Phidget22 Library.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&#039;&#039;&#039;Click on the [[Image:2phidget22.jpg|link=|100px]] button in the menu bar to go to the Phidget22 version of this page.&#039;&#039;&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
|[[Image:alert.png|40px|link=]] &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=MediaWiki:Common.js&amp;diff=24132</id>
		<title>MediaWiki:Common.js</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=MediaWiki:Common.js&amp;diff=24132"/>
		<updated>2022-06-15T23:51:14Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/**&lt;br /&gt;
 * Redirect User:Name/skin.js and skin.css to the current skin&#039;s pages&lt;br /&gt;
 * (unless the &#039;skin&#039; page really exists).&lt;br /&gt;
 *&lt;br /&gt;
 * Dependencies: mediawiki.util&lt;br /&gt;
 *&lt;br /&gt;
 * @source https://www.mediawiki.org/wiki/Snippets/Redirect_skin.js&lt;br /&gt;
 * @revision 2016-04-13&lt;br /&gt;
 */&lt;br /&gt;
if ( mw.config.get( &#039;wgArticleId&#039; ) === 0 &amp;amp;&amp;amp; mw.config.get( &#039;wgNamespaceNumber&#039; ) === 2 ) {&lt;br /&gt;
	mw.loader.using( &#039;mediawiki.util&#039;, function () {&lt;br /&gt;
		var titleParts = mw.config.get( &#039;wgPageName&#039; ).split( &#039;/&#039; );&lt;br /&gt;
		// Make sure there was a part before and after the slash&lt;br /&gt;
		// And that the latter is &#039;skin.js&#039; or &#039;skin.css&#039;&lt;br /&gt;
		if ( titleParts.length === 2 ) {&lt;br /&gt;
			var userSkinPage = titleParts[0] + &#039;/&#039; + mw.config.get( &#039;skin&#039; );&lt;br /&gt;
			if ( titleParts[1] === &#039;skin.js&#039; ) {&lt;br /&gt;
				window.location.href = mw.util.getUrl( userSkinPage + &#039;.js&#039; );&lt;br /&gt;
			} else if ( titleParts[1] === &#039;skin.css&#039; ) {&lt;br /&gt;
				window.location.href = mw.util.getUrl( userSkinPage + &#039;.css&#039; );&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	} );&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// Book specific&lt;br /&gt;
var wgBookName = ( mw.config.get( &#039;wgPageName&#039; ).split( &#039;/&#039;, 1)[0] || &#039;&#039; ).split( &#039;:&#039;, 2 ).join( &#039;:&#039; );&lt;br /&gt;
mw.loader.load( &#039;/docs/index.php?title=MediaWiki:Common.css/&#039;+wgBookName+&#039;&amp;amp;action=raw&amp;amp;ctype=text/css&#039;, &#039;text/css&#039; );&lt;br /&gt;
 &lt;br /&gt;
// Imported scripts&lt;br /&gt;
mw.loader.load( &#039;/docs/index.php?title=MediaWiki:Common.js/CollapseElements.js&amp;amp;action=raw&amp;amp;ctype=text/javascript&#039;);&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=24129</id>
		<title>Driver Changelog</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=24129"/>
		<updated>2019-10-08T19:59:46Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Administrative]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20191008===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fix Java library&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20191007===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fix kernel driver for macos 10.9 and 10.10&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20191001===&lt;br /&gt;
*macOS / Windows release&lt;br /&gt;
**Support for macos 10.15 Catalina&lt;br /&gt;
**Update firmware files&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20190409===&lt;br /&gt;
*Fix GPS Date after April 6 2019 week rollover event&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20190208===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where devices plugged in before boot were inaccessible until unplugged/re-plugged on 2018 Mac Mini.&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20180622===&lt;br /&gt;
*Python fix&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20180215===&lt;br /&gt;
*Move to .NET 4.0&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20171215===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where opening two of the same device with -1 serial could cause missed attach/detach events and other errors.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160921===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where devices plugged in before boot were inaccessible until unplugged/re-plugged, under OS X 10.11. &lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160202===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Labview 7.1 support&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160107===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Don&#039;t throw an exception on EncoderPositionChangeEventArgs.Time in the .Net library when time it unknown - just return 0x7fffffff&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160104===&lt;br /&gt;
*Mac/Windows release&lt;br /&gt;
**New firmware for 1042 and 1044, fixing digital gyro&lt;br /&gt;
===2.1.8.20151217===&lt;br /&gt;
*Fixed 1045 bug where it will display an unknown ambient temperature sometimes&lt;br /&gt;
*Fixed a crash in the windows control panel&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151020===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Fixed an issue where the examples would error when trying to run them from the control panel.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151009===&lt;br /&gt;
*OS X and Windows release&lt;br /&gt;
**Upgraded firmware for 1024, 1032, 1041, 1042, 1043, 1044 and 1067 to address issues with these Phidgets on OS X El Capitan&lt;br /&gt;
*SBC release&lt;br /&gt;
**Support for multiple webcams &lt;br /&gt;
===2.1.8.20150821===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Support OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150805===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Preliminary support for OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150410===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed Makefile phidget21.h target issues&lt;br /&gt;
===2.1.8.20150326===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed issue with webservice buttons not being visible in the control panel&lt;br /&gt;
===2.1.8.20150323===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Updated icons with new company logo&lt;br /&gt;
===2.1.8.20150227===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Added copyright/licence headers to source code files&lt;br /&gt;
**Updated cvtutf files to a newer version&lt;br /&gt;
===2.1.8.20150109===&lt;br /&gt;
*Windows-only&lt;br /&gt;
**Fixed examples for Labview 8.5&lt;br /&gt;
===2.1.8.20141209===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Added support for armv7s and arm64 to the iOS library. Dropped support for armv6. Requires iOS 5.1.1 or later.&lt;br /&gt;
===2.1.8.20141202===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Labview release to support older versions&lt;br /&gt;
===2.1.8.20141119===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed an issue with the 2.1.8.20141117 release where nothing was actually installed.&lt;br /&gt;
===2.1.8.20141117===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed a code-signing issue that make the installer appear unsigned on OS X 10.10&lt;br /&gt;
**Dropped support for OS X 10.4&lt;br /&gt;
===2.1.8.20140905===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added an IA32 folder to the windows libraries download - this supports Windows on the Intel Galileo platform&lt;br /&gt;
===2.1.8.20140428===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to C# Stepper GUI Example&lt;br /&gt;
===2.1.8.20140319===&lt;br /&gt;
*CPhidget_getDeviceClass can now be called on handle before it is attached.&lt;br /&gt;
*Added support for 64-bit Max/MSP (Version 6.1+) on both OS X and Windows.&lt;br /&gt;
===2.1.8.20140227===&lt;br /&gt;
*Deals with 1046 bug in v100 and v101 firmware.&lt;br /&gt;
**No longer reports bad values that appear right after a channel is enabled.&lt;br /&gt;
**Fixes issue where changing the gain while channel 0 is disabled would sometimes cause bad readings.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20131105===&lt;br /&gt;
* Fixed a defect in the Flash examples for the 1012 (Outputs 11-16 were not addressed properly).&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20130926===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support setting label on 1067 from Windows&lt;br /&gt;
===2.1.8.20130820===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added logging option to control panel / C# full examples&lt;br /&gt;
===2.1.8.20130802===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fix for Windows 8 issue where only &#039;Uninitialized Phidget Handle&#039; would show up in the Manager, and Phidgets could not be opened.&lt;br /&gt;
===2.1.8.20130723===&lt;br /&gt;
*Improvement to java: we don&#039;t attach/detach our native threads for each event, just one attach, then detach before the thread exits.&lt;br /&gt;
**This increases performance, esp. when debugging on Android.&lt;br /&gt;
*Improvement to Android: We reuse the UsbRequest object rather then creating a new one for each transfer. This reduces logcat messages tremendously, and increases performance.&lt;br /&gt;
===2.1.8.20130710===&lt;br /&gt;
*Android-only release&lt;br /&gt;
**Added extra android target architectures: x86, MIPS, armeabi-v7a&lt;br /&gt;
===2.1.8.20130618===&lt;br /&gt;
*Changed setCompassCorrectionParameters() API call so that compass calibration parameters are written out to non-volatile storage on 1042/1044, so that they persist across power cycles. Previously, calibration data would need to be re-programmed at each attach.&lt;br /&gt;
*Changes to C# Spatial example:&lt;br /&gt;
**Compass calibration parameter set dialog removed from for 1042/1044 because parameters are set by the calibration software - and thus do not need setting in the example.&lt;br /&gt;
**Stores/restores parameters for 1056 based on serial number, so multiple different calibrations can be maintained.&lt;br /&gt;
===2.1.8.20130607===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to compass calibration software for 1042/1044&lt;br /&gt;
===2.1.8.20130419===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed setCompassCorrectionParameters in the COM library&lt;br /&gt;
===2.1.8.20130327===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Changed Windows installer to stop virus-scanner false positives&lt;br /&gt;
**Dropped support for Windows 2000&lt;br /&gt;
===2.1.8.20130320===&lt;br /&gt;
*Added EPHIDGET_NOTFOUND exception to Dictionary.getKey() for when the key is not found.&lt;br /&gt;
*Added exceptions back into the Java library - they have been missing since 2.1.8.20121015 release.&lt;br /&gt;
===2.1.8.20130313===&lt;br /&gt;
*Updates to Matlab support&lt;br /&gt;
**Works properly on Matlab 7+, on Windows, Mac, Linux without needing changes to .m files.&lt;br /&gt;
===2.1.8.20130221===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Encoder Index event added to C and .NET libraries&lt;br /&gt;
===2.1.8.20121218===&lt;br /&gt;
*Webservice version: 1.0.10&lt;br /&gt;
**Support for 1024, 1032&lt;br /&gt;
*Support for 1024, 1032&lt;br /&gt;
*fixed bug where if one half of a composite device is open, and PHIDGET_USB_ERROR_FLAG gets set, the device may never re-attach.&lt;br /&gt;
===2.1.8.20121015===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support for new pressure/light sensors in example.&lt;br /&gt;
===2.1.8.20120914===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Improved firmware upgrading in control panel - it was giving some false-errors on some machines.&lt;br /&gt;
===2.1.8.20120912===&lt;br /&gt;
*Fixed bug where 1065 could fail to attach when opened over webservice&lt;br /&gt;
*Fixed bug where close() could deadlock on Phidgets opened over the webservice&lt;br /&gt;
*Changed LED64 LED Brightness from int to double&lt;br /&gt;
**this may cause issues when controlling the LED64 over the webservice and library/webservice are not the same version&lt;br /&gt;
**the old setDiscreteLED call will remain, deprecated, with an int argument for compatibility.&lt;br /&gt;
===2.1.8.20120716===&lt;br /&gt;
*Linux-Only Release&lt;br /&gt;
**Fixed a bug where opening a device in two program at once would cause an attach-detach cycle as they fight each other for control.&lt;br /&gt;
===2.1.8.20120713===&lt;br /&gt;
*Mac-Only Release&lt;br /&gt;
**Added signing of the Mac installer, so Mountain Lion (OS X 10.8) doesn&#039;t refuse to run it.&lt;br /&gt;
===2.1.8.20120615===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that caused java to crash on events introduced in 2.1.8.20120612&lt;br /&gt;
===2.1.8.20120612===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed another bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120606===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120525===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed PhidgetIR sendRawData bug in .NET on 64-bit machines.&lt;br /&gt;
===2.1.8.20120514===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed a bug that causes a segfault with libusb-1.0 under 64-bit Linux.&lt;br /&gt;
===2.1.8.20120507===&lt;br /&gt;
*Mac/Linux-only release&lt;br /&gt;
**Fixes a setLabel bug introduced in 2.1.8.20120503&lt;br /&gt;
===2.1.8.20120503===&lt;br /&gt;
*Fixed some spelling mistakes&lt;br /&gt;
*Moved to libusb-1.0&lt;br /&gt;
**This resolves a bug where having a webcam plugged in caused a memory leak in the webservice.&lt;br /&gt;
*Fixed bug with advanced servo where setting acceleration to accelerationMax would cause an exception for some servo types&lt;br /&gt;
===2.1.8.20120216===&lt;br /&gt;
*Fixed bug with RFID Reader on OS X and Linux, as well as .NET over the webservice&lt;br /&gt;
*Fixed bug that could cause the Java Phidget Manager to crash during garbage collection.&lt;br /&gt;
===2.1.8.20120131===&lt;br /&gt;
*Fixed RFID Reader bug that caused tag event to not get thrown in .NET Applications&lt;br /&gt;
*Changed compass bearing calculations in spatial C# example&lt;br /&gt;
===2.1.8.20120123===&lt;br /&gt;
*Added support for 1061 v300+&lt;br /&gt;
*Fixed a bug where the firmware version could be mis-reported over Bonjour&lt;br /&gt;
===2.1.8.20111220===&lt;br /&gt;
*Fixed a bug in AppleScript where closing a Phidget opened via label would give a &#039;Connection Invalid&#039; error.&lt;br /&gt;
*Fixed a bug where the webservice may fail to start on Linux systems that don&#039;t support IPv6 (ie. SBC2).&lt;br /&gt;
*Fixed issue where ratiometric state on newest interfacekit wouldn&#039;t be read back properly if it was false during attach.&lt;br /&gt;
*Fixed webservice issue where ratiometric state would not be reported properly for newest interfacekits&lt;br /&gt;
*Increased the number of overrun errors ignored during initial attach for InterfaceKit.&lt;br /&gt;
*Fixed an issue with the iPhone library and header&lt;br /&gt;
===2.1.8.20111219===&lt;br /&gt;
*fixed various other webservice stability/performance/memory leak bugs&lt;br /&gt;
*Faster connection to SBC-connected Phidgets from Mac OS&lt;br /&gt;
*Don&#039;t report packetlost or overrun errors that happen during early initialization - these are just noise.&lt;br /&gt;
*Fixed a bug in the webservice tree removal function that could cause memory leaks.&lt;br /&gt;
*Fixed bug where Webservice would crash on Linux if the chosen serverID was already under use on the network&lt;br /&gt;
*Stopped sending hardware Error Events before the Attach event - they are now queued up and sent after Attach&lt;br /&gt;
*Fixed a crash in the [[Phidget Control Panel]]&lt;br /&gt;
*Added ability to remove dictionary keys from a key change listener&lt;br /&gt;
*Reduced the number of false &#039;pending command not finished&#039; error events on Close()&lt;br /&gt;
*Fixed a webservice bug where exceptions/false attach events could occur when close() is called soon after open&lt;br /&gt;
*Fixed bug where closing a PhidgetRFID soon after attach could cause a crash&lt;br /&gt;
*Fixed webservice but on MacOS where client could exit with SIG_PIPE error&lt;br /&gt;
*Fixed webservice bug where the server would sometimes exit(1) after many connect/disconnect cycles&lt;br /&gt;
*Fixed webservice bug where client could deadlock during close()&lt;br /&gt;
*Fixed webservice bug where opening a single remote phidget multiple times from the same application would fail&lt;br /&gt;
*Fixed a webservice bug where sockets weren&#039;t being closed properly sometimes&lt;br /&gt;
*Fixed a webservice bug where pre-attach error events wouldn&#039;t get through&lt;br /&gt;
*Fixed a bug where the webservice running on Linux would stop responding to clients after ~300 connect/disconnect cycles&lt;br /&gt;
*Fixed bug where a Phidget would become inaccessible until the app is restarted if a thread creation failed&lt;br /&gt;
*Fixed webservice bug where connect is slow on Windows when multiple clients are running simultaneously&lt;br /&gt;
*Fixed webservice bug where authentication would fail on a valid password&lt;br /&gt;
*Fixed webservice bug where attach may never happen, and would require a close()/open()&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20111121===&lt;br /&gt;
*Added support for new servo types to all libraries&lt;br /&gt;
*Fixed min/max position/velocity causing invalid arg exception on servo/advservo&lt;br /&gt;
*IPv6 support on MacOS&lt;br /&gt;
*Fixed some memory leaks&lt;br /&gt;
*Fixed hostname lookup issue on Mac OS with Back To My Mac enabled.&lt;br /&gt;
===2.1.8.20111028===&lt;br /&gt;
*Fixed Applescript bugs and released examples&lt;br /&gt;
*Added openLabel to .NET, Java, COM&lt;br /&gt;
*Setting change trigger to 0 on interfacekit will not set event mode.&lt;br /&gt;
**Previously setting change trigger to 0 after setting data rate would supersede the data rate setting, which is probably unexpected.&lt;br /&gt;
===2.1.8.20110630 - MacOS Only===&lt;br /&gt;
*handle USB bug introduced in MacOS 10.6.8&lt;br /&gt;
===2.1.8.20110615===&lt;br /&gt;
*Added error event when trying to open Phidgets with an unsupported version&lt;br /&gt;
===2.1.8.20110614 - Windows Only===&lt;br /&gt;
*Fixed bug in C# Spatial example&lt;br /&gt;
*Added support for negative gains in 1056&lt;br /&gt;
===2.1.8.20110601 - MacOS Only===&lt;br /&gt;
*Fixed AppleScript issues&lt;br /&gt;
===2.1.8.20110527===&lt;br /&gt;
*Fixed AS3.0 library (Flash/Flex) - wouldn&#039;t connect to webservice as of last release&lt;br /&gt;
*Fixed bug where webservice doesn&#039;t release a closed Phidget&lt;br /&gt;
*Fixed bug where devices that don&#039;t support label didn&#039;t show up on MacOS&lt;br /&gt;
*Fixed iPhone library issues&lt;br /&gt;
===2.1.8.20110524===&lt;br /&gt;
*AppleScript support added&lt;br /&gt;
*fixed problem with Spatial in .NET on 64-bit Windows&lt;br /&gt;
*Added remote setLabel to mac preference pane.&lt;br /&gt;
*fixed a bug where label characters 7,8,9 would be read back corrupted on certain devices.&lt;br /&gt;
**labels &amp;gt;7 characters that exhibit this bug will now be truncated to 7 characters when being read back&lt;br /&gt;
**call setLabel again using this library or newer to support 10 character labels.&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to &amp;lt;=7 characters on these devices.&lt;br /&gt;
*fixed bug on MacOS where serial number and/or label strings could be read wrong.&lt;br /&gt;
*better support for recovering misbehaving devices in Linux&lt;br /&gt;
*fixed a deadlock on linux when Avahi is installed but not running&lt;br /&gt;
*clear list of attached devices when closing remote manager&lt;br /&gt;
*Added support for Unicode labels&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to ASCII.&lt;br /&gt;
*Added open by label&lt;br /&gt;
*Webservice protocol version up to 1.0.9 (for open by label)&lt;br /&gt;
*Made opening multiple device is one application faster.&lt;br /&gt;
*TextLCD changes:&lt;br /&gt;
**cursor is disabled while writing to the display or setting a custom character to prevent display artifacts&lt;br /&gt;
**cursor is disabled when a full line is written so it doesn&#039;t go to the start of another line&lt;br /&gt;
**1204 should be stable&lt;br /&gt;
**setDisplayCharacter supports 0x00-0xff&lt;br /&gt;
*stopped property reflected more accurately in the C# stepper example&lt;br /&gt;
*Added error events to mac examples&lt;br /&gt;
===2.1.8.20110329 - Windows only===&lt;br /&gt;
*Fixed problem with control panel encoder example where enable wouldn&#039;t work&lt;br /&gt;
*Fixed issue with SpatialData, GPSPositionChange, PHChange and WeightChange events in Labview 64-bit&lt;br /&gt;
===2.1.8.20110322===&lt;br /&gt;
*Fixed [[Phidget Control Panel]] memory leak when Bonjour in installed but not running&lt;br /&gt;
*Fixed current sense formula on 1061_0 v200&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetAdvancedServo&lt;br /&gt;
*Fixed bug in old PhidgetTemperatureSensor&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20110310===&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetServo&lt;br /&gt;
*Fixed some Labview bugs&lt;br /&gt;
*Added some Java and VB.NET examples&lt;br /&gt;
===2.1.8.20110301===&lt;br /&gt;
*Full Support for 1002, 1011, 1040, 1046, 1054, 1065, 1204&lt;br /&gt;
*New webservice version - 1.0.8&lt;br /&gt;
**Support for new devices&lt;br /&gt;
**Support for error events&lt;br /&gt;
===2.1.7.20110203===&lt;br /&gt;
*fixed crash on close of remote Phidget on MacOS&lt;br /&gt;
*C# ifkit example bugfix - crashed on 1015/1016&lt;br /&gt;
*webservice improvements&lt;br /&gt;
*Switch to IP address for SBC config in browser&lt;br /&gt;
*Faster IP lookup for SBCs in control panel&lt;br /&gt;
===2.1.7.20101222 / 2.1.7.20101223===&lt;br /&gt;
*fixed getServerID on Linux&lt;br /&gt;
*removed report ack&lt;br /&gt;
**this was causing some bad side effects&lt;br /&gt;
*manual .local lookups on Windows&lt;br /&gt;
**much faster then letting Windows do it itself&lt;br /&gt;
*Support for new Labview library&lt;br /&gt;
*Fixed PhidgetIR bug where library would crash if repeat code is longer then IR_MAX_REPEAT_LENGTH&lt;br /&gt;
===2.1.7.20101103===&lt;br /&gt;
*Decreased Phidget Webservice event latency on Windows&lt;br /&gt;
*Preliminary support for 1002, 1011, 1040, 1045, 1046, 1054, 1065, 1204 (C, .NET)&lt;br /&gt;
*Webservice version updated to 1.0.7&lt;br /&gt;
**support for 1045, 1011, 1204&lt;br /&gt;
*Fixed a bug where webservice connections could be unexpectedly lost&lt;br /&gt;
*Bugfix: couldn&#039;t set interfacekit data rate over webservice.&lt;br /&gt;
*Fixed some memory leaks in the Mac library&lt;br /&gt;
*Fixed bug where blocking for &amp;gt;2 seconds in an events handler when opening remotely could cause a crash.&lt;br /&gt;
===2.1.7.20100803===&lt;br /&gt;
*Windows only release&lt;br /&gt;
*fixed setLabel in WindowsCE&lt;br /&gt;
*fixed getHashCode in .NET library - needed for working with Phidgets in Labview via .NET&lt;br /&gt;
===2.1.7.20100621===&lt;br /&gt;
*Linux only release - autotools updates&lt;br /&gt;
**call ldconfig automatically&lt;br /&gt;
**remove old phidget21 library (pre-autotools) when installing new one.&lt;br /&gt;
===2.1.7.20100620===&lt;br /&gt;
*Linux only release - added version.sh for autoreconf&lt;br /&gt;
===2.1.7.20100618===&lt;br /&gt;
*Linux only release - added udev/hotplug files&lt;br /&gt;
===2.1.7.20100617===&lt;br /&gt;
*Linux only release&lt;br /&gt;
*Transitioned to autotools in linux for phidget21 / webservice&lt;br /&gt;
*phidget21 library and webservice are now separate downloads&lt;br /&gt;
===2.1.7.20100525===&lt;br /&gt;
*full support for PhidgetSpatial and PhidgetIR in all libraries&lt;br /&gt;
*fixed 1031 not attaching in AS3.0&lt;br /&gt;
*Better error messages in JNI&lt;br /&gt;
*Updated error codes, device ID/Class lists in Java, Flash, COM, etc.&lt;br /&gt;
*Fixed TemperatureSensor version 200,201,202 bug - ambient sensor would not report negative temperatures.&lt;br /&gt;
*Revised temperaturesensor API to report tempMin/tempMax and errors more accurately.&lt;br /&gt;
*Added initial events for encoder digital inputs&lt;br /&gt;
*full support for 1047&lt;br /&gt;
*Added new device support to WindowsCE&lt;br /&gt;
*Updated mac examples for 1047, 1048&lt;br /&gt;
===2.1.6.20100504===&lt;br /&gt;
*Windows only Release&lt;br /&gt;
**Added 1131 and 1132 to InterfaceKit example in MSI&lt;br /&gt;
===2.1.6.20100428===&lt;br /&gt;
*limit data rate maximum to 16ms over the webservice for devices that expose dataRate (InterfaceKit, Spatial)&lt;br /&gt;
*fixed bug where TextLCD 8/8/8 would stay in Bonjour list after webservice is shutdown&lt;br /&gt;
*set/get Brightness for 1203_2&lt;br /&gt;
*Support 1048 in C# example&lt;br /&gt;
*webservice version incremented to 1.0.6&lt;br /&gt;
**TextLCD set/get brightness&lt;br /&gt;
**PhidgetIR support&lt;br /&gt;
**PhidgetSpatial support&lt;br /&gt;
**1047 support (enable, index)&lt;br /&gt;
===2.1.6.20100406===&lt;br /&gt;
*Support for 1018_2 (dataRate)&lt;br /&gt;
*Webservice version incremented to 1.0.5&lt;br /&gt;
===2.1.6.20100401===&lt;br /&gt;
*Updated InterfaceKit example with new sensors&lt;br /&gt;
*make Windows connect cancelable&lt;br /&gt;
*make pending zeroconf lookups cancelable during close&lt;br /&gt;
===2.1.6.20100318===&lt;br /&gt;
*Mac only release&lt;br /&gt;
**Added WillSleep and Wakeup events to give user control of Phidgets immediately before and after a system sleep (MacOS Only).&lt;br /&gt;
===2.1.6.20100317===&lt;br /&gt;
*Windows only release&lt;br /&gt;
**Some of the examples were being built using an out of date .NET library&lt;br /&gt;
===2.1.6.20100310===&lt;br /&gt;
*MaxMSP fix - 2.1.6.20100126 introduced a bug for some Phidgets where openremote/open by serial didn&#039;t work and MaxMSP would sometimes crash.&lt;br /&gt;
**No code changes to any of the other libraries.&lt;br /&gt;
===2.1.6.20100304===&lt;br /&gt;
*stopped property changes trigger events over webservice so they are noticed.&lt;br /&gt;
**more compatible with how local open works&lt;br /&gt;
*added 5 new servos&lt;br /&gt;
*fixed bug where remote close would not set detached so a subsequent open would not always connect.&lt;br /&gt;
*handle UninitializeZeroconf better - shut down thread before closing handles, fixes hang on SBC&lt;br /&gt;
*fixed bug on Mac where detaching 2 or more Phidgets at the same time caused a crash&lt;br /&gt;
*fixed close blocking because of a pending connect (mac, linux)&lt;br /&gt;
*Final support for 1031 in all libraries.&lt;br /&gt;
===2.1.6.20100129===&lt;br /&gt;
*Implemented initial events in Flash&lt;br /&gt;
**Flash behaviour should now be identical to C library local and remote.&lt;br /&gt;
*Fix RFID issue where close could cause crash&lt;br /&gt;
*increment webservice version to 1.0.4&lt;br /&gt;
*fixed RFID remote open&lt;br /&gt;
**Flash would never get an attach event if the reader had been previously opened&lt;br /&gt;
**Initial tag event would not be fired when a tag was present and the antenna was enabled prior to open&lt;br /&gt;
*fixed openRemote failing on Mac&lt;br /&gt;
*fixed deadlock in webservice which could be hit by opening/closing a device over and over again.&lt;br /&gt;
*fixed bug in stepper, which caused seg fault on SBC on position change events.&lt;br /&gt;
===2.1.6.20100126===&lt;br /&gt;
*added network open support in Max/MSP&lt;br /&gt;
===2.1.6.20100115===&lt;br /&gt;
*Increased network performance for Linux/MacOS&lt;br /&gt;
*Added five servo types&lt;br /&gt;
===2.1.6.20091215===&lt;br /&gt;
*Fixed busy loop in Linux openRemote&lt;br /&gt;
*JNI Library relocated to /Library/Java/Extensions on MacOS&lt;br /&gt;
===2.1.6.20091211===&lt;br /&gt;
*Heartbeat now works on Linux as well (had to make sockets non-blocking)&lt;br /&gt;
===2.1.6.20091130===&lt;br /&gt;
*Added heartbeat to webservice (client side)&lt;br /&gt;
**Better detects network failures by using active polling timeouts&lt;br /&gt;
*Fixed 0/8/8 over webservice&lt;br /&gt;
===2.1.6.20091020===&lt;br /&gt;
*Fixed 1052 counting issue on 1070 (-1 reported as 255)&lt;br /&gt;
*Fixed issue where Phidget21 would try to reinstall from a limited user account or when the Control Panel was disabled.&lt;br /&gt;
*64-bit kernel support in Snow Leopard&lt;br /&gt;
===2.1.6.20090928===&lt;br /&gt;
*Support for PhidgetSBC (1070)&lt;br /&gt;
*zeroconf can handle starting up before the mdns daemon, and will keep trying to connect.&lt;br /&gt;
*fixed 1066 not showing up on Mac&lt;br /&gt;
*added advanced servo example to mac pref pane&lt;br /&gt;
*implemented proper error handling in COM&lt;br /&gt;
**default behavious remains the same, enable proper error handling with &#039;EnableVerboseErrors&#039;&lt;br /&gt;
*implemented error events in Java&lt;br /&gt;
===2.1.6.20090917===&lt;br /&gt;
*Updated webservice protocol version to 1.0.3&lt;br /&gt;
*Fixed stepper under AS3.0&lt;br /&gt;
*added setServoType, getServoType, setServoParameters to PhidgetServo and PhidgetAdvancedServo&lt;br /&gt;
*possible race condition fixed in webservice (pdictclient.c:907)&lt;br /&gt;
===2.1.6.20090902 (mac only release)===&lt;br /&gt;
*Support MacOSX 10.6, drop support for 10.3.9, require 10.4 or newer&lt;br /&gt;
**Fully 64-bit compliant, library supports ppc, i386, x86_64&lt;br /&gt;
===2.1.6.20090806===&lt;br /&gt;
*Added 1049 support&lt;br /&gt;
*Fixed RFID tag events over webservice&lt;br /&gt;
===2.1.6.20090804===&lt;br /&gt;
*Added 1051_2 support&lt;br /&gt;
*Fixed various small initialization issues - stepper, adv servo, rfid&lt;br /&gt;
*Added 32-bit library install to 64-bit installer&lt;br /&gt;
**VB6.0, etc. need the 32-bit COM library on 64-bit windows&lt;br /&gt;
===2.1.6.20090717===&lt;br /&gt;
*?&lt;br /&gt;
===2.1.6.20090708===&lt;br /&gt;
*Added DeviceID to zeroconf&lt;br /&gt;
*fixed RFID.LastTag in .NET&lt;br /&gt;
*Changed the error codes returned by error events; error events now have their own set of error codes rather then sharing the function return codes.&lt;br /&gt;
*Added support for 1047, 1048&lt;br /&gt;
*Added error event codes rather then trying to reuse the EPHIDGET return codes.&lt;br /&gt;
*fixed TextLCD issue where display could get corrupted during a detach/attach&lt;br /&gt;
*made mac more reliable on attach&lt;br /&gt;
*more error logging on mac&lt;br /&gt;
===2.1.6.20090525===&lt;br /&gt;
*fixed RFID not attaching via webservice if a tag is present.&lt;br /&gt;
*bugfix related to double free on detach event.&lt;br /&gt;
*Implemented getKey&lt;br /&gt;
*Added MIPS II support to Windows CE&lt;br /&gt;
===2.1.6.20090430===&lt;br /&gt;
*Added ActiveX interface to COM library&lt;br /&gt;
*Added stepper and advancedServo to Flex .swc library&lt;br /&gt;
===2.1.6.20090417===&lt;br /&gt;
*added PhidgetIR prototype support to C library&lt;br /&gt;
*properly handles sleeping on OSX&lt;br /&gt;
*fixed some webservice field initializations in Flash and C&lt;br /&gt;
*fixed security exceptions in [[Phidget Control Panel]] under Vista&lt;br /&gt;
*added [[Phidget Control Panel]] to start menu&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090318 (Examples/AS3.0 only release)===&lt;br /&gt;
*Fixed AdvancedServo in Flash - wouldn&#039;t attach&lt;br /&gt;
===2.1.6.20090317===&lt;br /&gt;
*[[Phidget Control Panel]] properly supports Vista UAC and Limited user accounts in XP, etc.&lt;br /&gt;
*Added 64-bit release of Phidget21.msi for Windows&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090312===&lt;br /&gt;
*added 1064, 1059 to WindowsCE&lt;br /&gt;
*fixed opening 1051 over webservice&lt;br /&gt;
*fixed opening 1015/1016 over webservice broken in last release&lt;br /&gt;
===2.1.6.20090302===&lt;br /&gt;
*Advanced servo bugfix: stopped would stop being true if min/max was set to exclude current position.&lt;br /&gt;
*linux USB improvements when many Phidgets are attached and opened at once.&lt;br /&gt;
*1031 support in phidget21, webservice, .NET - hidden until product release&lt;br /&gt;
**CPhidgetLED_setVoltage&lt;br /&gt;
**CPhidgetLED_getVoltage&lt;br /&gt;
**CPhidgetLED_setCurrentLimit&lt;br /&gt;
**CPhidgetLED_getCurrentLimit&lt;br /&gt;
*unknown timechange == PUNK_INT in encoder position change event&lt;br /&gt;
**1st position change event&lt;br /&gt;
**&amp;gt; 30 seconds time change&lt;br /&gt;
*AS3 updates&lt;br /&gt;
**updated to 1.0.2 webservice&lt;br /&gt;
**encoder position change events report relative change rather then absolute position&lt;br /&gt;
**encoder adds getTimeChange function for timing encoder changes&lt;br /&gt;
*webservice updated to 1.0.2&lt;br /&gt;
**Authorization is asynchronous&lt;br /&gt;
**Doesn&#039;t match the old version checking, so errors will not be nice when trying to connect to an old webservice&lt;br /&gt;
**Sends out all initial data, so it&#039;s just like opening locally&lt;br /&gt;
**supports interfacekit Raw sensor value&lt;br /&gt;
**supports labels on remoteIP managers&lt;br /&gt;
*avahi bugfix&lt;br /&gt;
*webservice more stable against forcefully closed clients&lt;br /&gt;
*closing a network Phidget won&#039;t block - ever.&lt;br /&gt;
**no longer using quit, just closing the socket&lt;br /&gt;
*added libavahi-client.so.3 reference to linux library.&lt;br /&gt;
*Fixed bug with opening one phidget with serial and no serial at the same time over the webservice&lt;br /&gt;
===2.1.5.20090105===&lt;br /&gt;
*[[Phidget Control Panel]] stability improvements&lt;br /&gt;
*added CPhidgetSBC_getHostname&lt;br /&gt;
*advanced servo 1 motor current sense equation - support should now be complete&lt;br /&gt;
*webservice and network code bugfixes - crash / deadlock during close, problems with concurrent connections, etc.&lt;br /&gt;
*fixed close on remote and remoteIP managers&lt;br /&gt;
*name of RFID changed from &amp;quot;Phidget RFID 4-output&amp;quot; to &amp;quot;Phidget RFID 2-output&amp;quot; - updated anything referencing old name.&lt;br /&gt;
&lt;br /&gt;
===2.1.5.20081023===&lt;br /&gt;
*added advanced servo and stepper examples to VB6.0, VB.NET and C&lt;br /&gt;
*added deviceClass and deviceID&lt;br /&gt;
*updated Mac examples&lt;br /&gt;
*webservice protocol version enforcement&lt;br /&gt;
*internal fix/rework of device id&#039;s etc.&lt;br /&gt;
*Fixed memory leaks in webservice and phidget21 network code.&lt;br /&gt;
*Dictionary and network stability improvements.&lt;br /&gt;
*duplicate calls to open or close are now silently ignored.&lt;br /&gt;
===2.1.4.20080924===&lt;br /&gt;
*Old TextLCD 0/8/8&#039;s can now have both halves open at the same time on Windows&lt;br /&gt;
*fixed bug with composite devices on linux&lt;br /&gt;
*fixed manager on linux to better deal with unique devices&lt;br /&gt;
===2.1.4.20080922===&lt;br /&gt;
*Updated Delphi files&lt;br /&gt;
*TextLCD can display 0x80-0xFF characters from Java&lt;br /&gt;
*getAttachedDevices works for mdns managers&lt;br /&gt;
*fixed a deadlock in the webservice&lt;br /&gt;
*better network error handling / password support for windows C# examples&lt;br /&gt;
*waitForAttachment will return EPHIDGET_CLOSED if the handle is closed while it is waiting.&lt;br /&gt;
*added EPHIDGET_CLOSED&lt;br /&gt;
*joining central threads checks whether they are trying to be joined by themselves first (avoid deadlocks).&lt;br /&gt;
*changed context of error event to be free from locks (can call close, open, etc. from them).&lt;br /&gt;
===2.1.4.20080821===&lt;br /&gt;
*zeroconf threads exit cleanly on last _close (apple zeroconf)&lt;br /&gt;
*Added advanced servo and stepper to Max&lt;br /&gt;
===2.1.4.20080811 (mac only release)===&lt;br /&gt;
*Fixed manager on Mac (wasn&#039;t working at all since 2.1.4.20080808)&lt;br /&gt;
===2.1.4.20080808===&lt;br /&gt;
*added CPhidgetSBC and CPhidgetSBCManager to the c library - these interfaces are hidden from users and meant to be used internally (for now).&lt;br /&gt;
*CPhidgetManager_open no longer blocks to send out initial attach events. These initial events are sent from the CentralThread context like all other attach events.&lt;br /&gt;
*fixed CThread_wait_on_event on Linux&lt;br /&gt;
*added CPhidgetGeneric interface for prototyping to C, .NET libraries. product ID is 0x99. These are only visible in debug releases, only to be used internally.&lt;br /&gt;
===2.1.4.20080715===&lt;br /&gt;
*udev rules fixed for product IDs with alpha-hex values&lt;br /&gt;
*blocking in an attach event does not block calls to open anymore&lt;br /&gt;
*RFID tag event handlers can now handle blocking - tag lost is timed after the tag handler exits.&lt;br /&gt;
===2.1.4.20080623===&lt;br /&gt;
*Flex .swc library was out of sync&lt;br /&gt;
*fixed CPhidgetManager_getAttachedDevices for network managers&lt;br /&gt;
*Added CPhidgetManager_freeAttachedDevicesArray&lt;br /&gt;
===2.1.4.20080613===&lt;br /&gt;
*Max/MSP RFID fixed&lt;br /&gt;
*0/0/8 and advanced servo added to CE&lt;br /&gt;
*fixed flash policy file server in webservice&lt;br /&gt;
*webservice with password and asynchronous together work now&lt;br /&gt;
===2.1.4.20080602===&lt;br /&gt;
*phidget21.h -&amp;gt; phidget21int.h so as not to be confused with generated phidget21.h&lt;br /&gt;
*some changes to Makefile fro crosscompiling&lt;br /&gt;
*no more vbscript in msi&lt;br /&gt;
===2.1.4.20080513===&lt;br /&gt;
*removed long long from COM - not supported by VB6.0&lt;br /&gt;
*added LastTag to RFID in .NET&lt;br /&gt;
===2.1.4.20080428===&lt;br /&gt;
*support Mac OS X 10.3.9 again&lt;br /&gt;
*Rev up to 2.1.4&lt;br /&gt;
*finalize Phidget Stepper API - Phidget Stepper requires 2.1.4 as a minimum&lt;br /&gt;
*fixed serverConnect and serverDisconnect handlers for manager and dictionary in COM&lt;br /&gt;
*Changed:&lt;br /&gt;
**PhidgetStepper and PhidgetAdvancedServo&lt;br /&gt;
***MotorPosition -&amp;gt; Position&lt;br /&gt;
***MotorOn -&amp;gt; Engaged&lt;br /&gt;
***MotorStopped -&amp;gt; Stopped&lt;br /&gt;
*Added:&lt;br /&gt;
**CPhidgetStepper_getCurrentLimit&lt;br /&gt;
**CPhidgetEncoder_getPosition&lt;br /&gt;
**CPhidgetEncoder_setPosition&lt;br /&gt;
**CPhidgetMotorControl_getVelocity&lt;br /&gt;
**CPhidgetMotorControl_setVelocity&lt;br /&gt;
**CPhidgetMotorControl_set_OnVelocityChange_Handler&lt;br /&gt;
**CPhidgetServo_setEngaged&lt;br /&gt;
**CPhidgetServo_getEngaged&lt;br /&gt;
**CPhidgetServo_getPosition&lt;br /&gt;
**CPhidgetServo_setPosition&lt;br /&gt;
**CPhidgetServo_set_OnPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getPositionMax&lt;br /&gt;
**CPhidgetServo_getPositionMin&lt;br /&gt;
**Count functions&lt;br /&gt;
*Deprecated:&lt;br /&gt;
**CPhidgetEncoder_getEncoderPosition&lt;br /&gt;
**CPhidgetEncoder_setEncoderPosition&lt;br /&gt;
**CPhidgetMotorControl_getMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_setMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_set_OnMotorChange_Handler&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorPosition&lt;br /&gt;
**CPhidgetServo_setMotorPosition&lt;br /&gt;
**CPhidgetServo_set_OnMotorPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**Num functions&lt;br /&gt;
*Added ability to deprecate funcitons in the C library - compiler will issue a warning when they are used.&lt;br /&gt;
*added names to some arguments in phidget21.h&lt;br /&gt;
*fixes to the webservice for initial state stuff - now it behaves almost like non-webservice, with guaranteed initial events, but we don&#039;t guarantee initial state in the attach event yet. Min/Max, Num motors, inputs, etc. are all guaranteed in the attach handler.&lt;br /&gt;
*Finalized support for Phidget Stepper&lt;br /&gt;
===2.1.3.20080402===&lt;br /&gt;
*Fixed windows BUG - Device Type was showing up wrong&lt;br /&gt;
*CPhidgetStepper_getPosition -&amp;gt; CPhidgetStepper_getCurrentPosition&lt;br /&gt;
===2.1.3.20080327===&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorStopped&lt;br /&gt;
*changes to API&lt;br /&gt;
**CPhidgetStepper_setMotorPosition -&amp;gt; CPhidgetStepper_setTargetMotorPosition&lt;br /&gt;
**added CPhidgetStepper_getTargetMotorPosition&lt;br /&gt;
**Stepper MotorSpeed -&amp;gt; Velocity&lt;br /&gt;
**Stepper and AdvancedServo MaxVelocity -&amp;gt; VelocityLimit&lt;br /&gt;
*add waitForAttachment to COM&lt;br /&gt;
*COM getbool (not indexed) will now return FALSE on false (rather then always returning true)&lt;br /&gt;
*fixed write thread timeouts - was setting attached after starting write thread so write thread would see a detached device and exit immediately&lt;br /&gt;
===2.1.3.20080206===&lt;br /&gt;
*changed long long to __int64, to be happy in borland C++&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetStepper_getMaxMotorSpeed&lt;br /&gt;
**CPhidgetStepper_setMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorStopped&lt;br /&gt;
**CPhidgetStepper_setCurrentMotorPosition&lt;br /&gt;
*removed CPhidgetStepper_setVelocity&lt;br /&gt;
*added CPhidgetStepper_setMaxVelocity, CPhidgetStepper_getMaxVelocity&lt;br /&gt;
===2.1.3.20080114===&lt;br /&gt;
*Added new functions to Flash API&lt;br /&gt;
*Added new functions to Webservice Protocol&lt;br /&gt;
*Added new functions to COM Library&lt;br /&gt;
*Added new functions to Java Library&lt;br /&gt;
*All device fiels in C library cleaned up and made consistent&lt;br /&gt;
*Open in windows is exclusive - this needs to be tested for stability&lt;br /&gt;
*No data will be returned / accepted if it lies outside of max/min range&lt;br /&gt;
*if a data value is unknown, user variable is set to PUNK_INT, PUNK_DBL, or PUNK_BOOL, and return value is EPHIDGET_UNKNOWNVAL&lt;br /&gt;
*Proper Device initializations on Attach:&lt;br /&gt;
**triggers are set to defaults on attach&lt;br /&gt;
**device state is read in and preserved on attach&lt;br /&gt;
**during attach event, all sensor data, etc. is provided if available&lt;br /&gt;
**no data events until after the attach event returns&lt;br /&gt;
**everything initialized by the time waitForAttachment returns&lt;br /&gt;
**after attach event returns, a full set of initial state data events are thrown&lt;br /&gt;
*.NET collections are readonly, and never NULL (but empty when phidget detached)&lt;br /&gt;
*.NET callbacks no longer catch and hide all exceptions&lt;br /&gt;
**make sure to use try/catch blocks especially in Attach when accessing properties that may not be initialized.&lt;br /&gt;
*added min/max functions:&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMax&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMax&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMax&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMax&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMin&lt;br /&gt;
**CPhidgetPHSensor_getPHMax&lt;br /&gt;
**CPhidgetPHSensor_getPHMin&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMax&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMin&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetStepper_getAccelerationMax&lt;br /&gt;
**CPhidgetStepper_getAccelerationMin&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMax&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMin&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMax&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMin&lt;br /&gt;
*Added functions:&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperature&lt;br /&gt;
**CPhidgetTemperatureSensor_getThermocoupleType&lt;br /&gt;
**CPhidgetTemperatureSensor_setThermocoupleType&lt;br /&gt;
**CPhidget_set_OnServerConnectHandler&lt;br /&gt;
**CPhidget_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_getServerID&lt;br /&gt;
**CPhidgetDictionary_getServerAddress&lt;br /&gt;
**CPhidgetDictionary_getServerStatus&lt;br /&gt;
**CPhidgetManager_getServerID&lt;br /&gt;
**CPhidgetManager_getServerAddress&lt;br /&gt;
**CPhidgetManager_getServerStatus&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
*Removed functions:&lt;br /&gt;
**CPhidgetServo_setMotorOff&lt;br /&gt;
*TemperatureSensor:&lt;br /&gt;
**Ambient sensor is accessed with it&#039;s own function&lt;br /&gt;
**first thermocouple is Index 0 everywhere&lt;br /&gt;
**no ambient sensor events&lt;br /&gt;
*getServerID is implemented&lt;br /&gt;
*changed the internal network structure (added CPhidgetRemote)&lt;br /&gt;
*reworked the USB code (mostly on Windows)&lt;br /&gt;
**Better handles closing, ESD events, timeouts&lt;br /&gt;
**fixed issues with Encoder, RFID stopping reading after a certain time.&lt;br /&gt;
**added USB error flag&lt;br /&gt;
*openRemote functions have been implemented&lt;br /&gt;
**these require bonjour (mac / windows) or avahi (linux) to be installed on both the client and server&lt;br /&gt;
**if they are not, you get EPHIDGET_UNSUPPORTED when you call them&lt;br /&gt;
*openRemoteIP functions are asynchronous and persistent&lt;br /&gt;
*include cphidgetconstants.h in phidget21.h for users&lt;br /&gt;
===2.1.2.20071108===&lt;br /&gt;
*start of chagelog&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=24128</id>
		<title>Driver Changelog</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=24128"/>
		<updated>2019-10-07T18:09:44Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Administrative]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20191007===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fix kernel driver for macos 10.9 and 10.10&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20191001===&lt;br /&gt;
*macOS / Windows release&lt;br /&gt;
**Support for macos 10.15 Catalina&lt;br /&gt;
**Update firmware files&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20190409===&lt;br /&gt;
*Fix GPS Date after April 6 2019 week rollover event&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20190208===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where devices plugged in before boot were inaccessible until unplugged/re-plugged on 2018 Mac Mini.&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20180622===&lt;br /&gt;
*Python fix&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20180215===&lt;br /&gt;
*Move to .NET 4.0&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20171215===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where opening two of the same device with -1 serial could cause missed attach/detach events and other errors.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160921===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where devices plugged in before boot were inaccessible until unplugged/re-plugged, under OS X 10.11. &lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160202===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Labview 7.1 support&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160107===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Don&#039;t throw an exception on EncoderPositionChangeEventArgs.Time in the .Net library when time it unknown - just return 0x7fffffff&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160104===&lt;br /&gt;
*Mac/Windows release&lt;br /&gt;
**New firmware for 1042 and 1044, fixing digital gyro&lt;br /&gt;
===2.1.8.20151217===&lt;br /&gt;
*Fixed 1045 bug where it will display an unknown ambient temperature sometimes&lt;br /&gt;
*Fixed a crash in the windows control panel&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151020===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Fixed an issue where the examples would error when trying to run them from the control panel.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151009===&lt;br /&gt;
*OS X and Windows release&lt;br /&gt;
**Upgraded firmware for 1024, 1032, 1041, 1042, 1043, 1044 and 1067 to address issues with these Phidgets on OS X El Capitan&lt;br /&gt;
*SBC release&lt;br /&gt;
**Support for multiple webcams &lt;br /&gt;
===2.1.8.20150821===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Support OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150805===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Preliminary support for OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150410===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed Makefile phidget21.h target issues&lt;br /&gt;
===2.1.8.20150326===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed issue with webservice buttons not being visible in the control panel&lt;br /&gt;
===2.1.8.20150323===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Updated icons with new company logo&lt;br /&gt;
===2.1.8.20150227===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Added copyright/licence headers to source code files&lt;br /&gt;
**Updated cvtutf files to a newer version&lt;br /&gt;
===2.1.8.20150109===&lt;br /&gt;
*Windows-only&lt;br /&gt;
**Fixed examples for Labview 8.5&lt;br /&gt;
===2.1.8.20141209===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Added support for armv7s and arm64 to the iOS library. Dropped support for armv6. Requires iOS 5.1.1 or later.&lt;br /&gt;
===2.1.8.20141202===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Labview release to support older versions&lt;br /&gt;
===2.1.8.20141119===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed an issue with the 2.1.8.20141117 release where nothing was actually installed.&lt;br /&gt;
===2.1.8.20141117===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed a code-signing issue that make the installer appear unsigned on OS X 10.10&lt;br /&gt;
**Dropped support for OS X 10.4&lt;br /&gt;
===2.1.8.20140905===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added an IA32 folder to the windows libraries download - this supports Windows on the Intel Galileo platform&lt;br /&gt;
===2.1.8.20140428===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to C# Stepper GUI Example&lt;br /&gt;
===2.1.8.20140319===&lt;br /&gt;
*CPhidget_getDeviceClass can now be called on handle before it is attached.&lt;br /&gt;
*Added support for 64-bit Max/MSP (Version 6.1+) on both OS X and Windows.&lt;br /&gt;
===2.1.8.20140227===&lt;br /&gt;
*Deals with 1046 bug in v100 and v101 firmware.&lt;br /&gt;
**No longer reports bad values that appear right after a channel is enabled.&lt;br /&gt;
**Fixes issue where changing the gain while channel 0 is disabled would sometimes cause bad readings.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20131105===&lt;br /&gt;
* Fixed a defect in the Flash examples for the 1012 (Outputs 11-16 were not addressed properly).&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20130926===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support setting label on 1067 from Windows&lt;br /&gt;
===2.1.8.20130820===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added logging option to control panel / C# full examples&lt;br /&gt;
===2.1.8.20130802===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fix for Windows 8 issue where only &#039;Uninitialized Phidget Handle&#039; would show up in the Manager, and Phidgets could not be opened.&lt;br /&gt;
===2.1.8.20130723===&lt;br /&gt;
*Improvement to java: we don&#039;t attach/detach our native threads for each event, just one attach, then detach before the thread exits.&lt;br /&gt;
**This increases performance, esp. when debugging on Android.&lt;br /&gt;
*Improvement to Android: We reuse the UsbRequest object rather then creating a new one for each transfer. This reduces logcat messages tremendously, and increases performance.&lt;br /&gt;
===2.1.8.20130710===&lt;br /&gt;
*Android-only release&lt;br /&gt;
**Added extra android target architectures: x86, MIPS, armeabi-v7a&lt;br /&gt;
===2.1.8.20130618===&lt;br /&gt;
*Changed setCompassCorrectionParameters() API call so that compass calibration parameters are written out to non-volatile storage on 1042/1044, so that they persist across power cycles. Previously, calibration data would need to be re-programmed at each attach.&lt;br /&gt;
*Changes to C# Spatial example:&lt;br /&gt;
**Compass calibration parameter set dialog removed from for 1042/1044 because parameters are set by the calibration software - and thus do not need setting in the example.&lt;br /&gt;
**Stores/restores parameters for 1056 based on serial number, so multiple different calibrations can be maintained.&lt;br /&gt;
===2.1.8.20130607===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to compass calibration software for 1042/1044&lt;br /&gt;
===2.1.8.20130419===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed setCompassCorrectionParameters in the COM library&lt;br /&gt;
===2.1.8.20130327===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Changed Windows installer to stop virus-scanner false positives&lt;br /&gt;
**Dropped support for Windows 2000&lt;br /&gt;
===2.1.8.20130320===&lt;br /&gt;
*Added EPHIDGET_NOTFOUND exception to Dictionary.getKey() for when the key is not found.&lt;br /&gt;
*Added exceptions back into the Java library - they have been missing since 2.1.8.20121015 release.&lt;br /&gt;
===2.1.8.20130313===&lt;br /&gt;
*Updates to Matlab support&lt;br /&gt;
**Works properly on Matlab 7+, on Windows, Mac, Linux without needing changes to .m files.&lt;br /&gt;
===2.1.8.20130221===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Encoder Index event added to C and .NET libraries&lt;br /&gt;
===2.1.8.20121218===&lt;br /&gt;
*Webservice version: 1.0.10&lt;br /&gt;
**Support for 1024, 1032&lt;br /&gt;
*Support for 1024, 1032&lt;br /&gt;
*fixed bug where if one half of a composite device is open, and PHIDGET_USB_ERROR_FLAG gets set, the device may never re-attach.&lt;br /&gt;
===2.1.8.20121015===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support for new pressure/light sensors in example.&lt;br /&gt;
===2.1.8.20120914===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Improved firmware upgrading in control panel - it was giving some false-errors on some machines.&lt;br /&gt;
===2.1.8.20120912===&lt;br /&gt;
*Fixed bug where 1065 could fail to attach when opened over webservice&lt;br /&gt;
*Fixed bug where close() could deadlock on Phidgets opened over the webservice&lt;br /&gt;
*Changed LED64 LED Brightness from int to double&lt;br /&gt;
**this may cause issues when controlling the LED64 over the webservice and library/webservice are not the same version&lt;br /&gt;
**the old setDiscreteLED call will remain, deprecated, with an int argument for compatibility.&lt;br /&gt;
===2.1.8.20120716===&lt;br /&gt;
*Linux-Only Release&lt;br /&gt;
**Fixed a bug where opening a device in two program at once would cause an attach-detach cycle as they fight each other for control.&lt;br /&gt;
===2.1.8.20120713===&lt;br /&gt;
*Mac-Only Release&lt;br /&gt;
**Added signing of the Mac installer, so Mountain Lion (OS X 10.8) doesn&#039;t refuse to run it.&lt;br /&gt;
===2.1.8.20120615===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that caused java to crash on events introduced in 2.1.8.20120612&lt;br /&gt;
===2.1.8.20120612===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed another bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120606===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120525===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed PhidgetIR sendRawData bug in .NET on 64-bit machines.&lt;br /&gt;
===2.1.8.20120514===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed a bug that causes a segfault with libusb-1.0 under 64-bit Linux.&lt;br /&gt;
===2.1.8.20120507===&lt;br /&gt;
*Mac/Linux-only release&lt;br /&gt;
**Fixes a setLabel bug introduced in 2.1.8.20120503&lt;br /&gt;
===2.1.8.20120503===&lt;br /&gt;
*Fixed some spelling mistakes&lt;br /&gt;
*Moved to libusb-1.0&lt;br /&gt;
**This resolves a bug where having a webcam plugged in caused a memory leak in the webservice.&lt;br /&gt;
*Fixed bug with advanced servo where setting acceleration to accelerationMax would cause an exception for some servo types&lt;br /&gt;
===2.1.8.20120216===&lt;br /&gt;
*Fixed bug with RFID Reader on OS X and Linux, as well as .NET over the webservice&lt;br /&gt;
*Fixed bug that could cause the Java Phidget Manager to crash during garbage collection.&lt;br /&gt;
===2.1.8.20120131===&lt;br /&gt;
*Fixed RFID Reader bug that caused tag event to not get thrown in .NET Applications&lt;br /&gt;
*Changed compass bearing calculations in spatial C# example&lt;br /&gt;
===2.1.8.20120123===&lt;br /&gt;
*Added support for 1061 v300+&lt;br /&gt;
*Fixed a bug where the firmware version could be mis-reported over Bonjour&lt;br /&gt;
===2.1.8.20111220===&lt;br /&gt;
*Fixed a bug in AppleScript where closing a Phidget opened via label would give a &#039;Connection Invalid&#039; error.&lt;br /&gt;
*Fixed a bug where the webservice may fail to start on Linux systems that don&#039;t support IPv6 (ie. SBC2).&lt;br /&gt;
*Fixed issue where ratiometric state on newest interfacekit wouldn&#039;t be read back properly if it was false during attach.&lt;br /&gt;
*Fixed webservice issue where ratiometric state would not be reported properly for newest interfacekits&lt;br /&gt;
*Increased the number of overrun errors ignored during initial attach for InterfaceKit.&lt;br /&gt;
*Fixed an issue with the iPhone library and header&lt;br /&gt;
===2.1.8.20111219===&lt;br /&gt;
*fixed various other webservice stability/performance/memory leak bugs&lt;br /&gt;
*Faster connection to SBC-connected Phidgets from Mac OS&lt;br /&gt;
*Don&#039;t report packetlost or overrun errors that happen during early initialization - these are just noise.&lt;br /&gt;
*Fixed a bug in the webservice tree removal function that could cause memory leaks.&lt;br /&gt;
*Fixed bug where Webservice would crash on Linux if the chosen serverID was already under use on the network&lt;br /&gt;
*Stopped sending hardware Error Events before the Attach event - they are now queued up and sent after Attach&lt;br /&gt;
*Fixed a crash in the [[Phidget Control Panel]]&lt;br /&gt;
*Added ability to remove dictionary keys from a key change listener&lt;br /&gt;
*Reduced the number of false &#039;pending command not finished&#039; error events on Close()&lt;br /&gt;
*Fixed a webservice bug where exceptions/false attach events could occur when close() is called soon after open&lt;br /&gt;
*Fixed bug where closing a PhidgetRFID soon after attach could cause a crash&lt;br /&gt;
*Fixed webservice but on MacOS where client could exit with SIG_PIPE error&lt;br /&gt;
*Fixed webservice bug where the server would sometimes exit(1) after many connect/disconnect cycles&lt;br /&gt;
*Fixed webservice bug where client could deadlock during close()&lt;br /&gt;
*Fixed webservice bug where opening a single remote phidget multiple times from the same application would fail&lt;br /&gt;
*Fixed a webservice bug where sockets weren&#039;t being closed properly sometimes&lt;br /&gt;
*Fixed a webservice bug where pre-attach error events wouldn&#039;t get through&lt;br /&gt;
*Fixed a bug where the webservice running on Linux would stop responding to clients after ~300 connect/disconnect cycles&lt;br /&gt;
*Fixed bug where a Phidget would become inaccessible until the app is restarted if a thread creation failed&lt;br /&gt;
*Fixed webservice bug where connect is slow on Windows when multiple clients are running simultaneously&lt;br /&gt;
*Fixed webservice bug where authentication would fail on a valid password&lt;br /&gt;
*Fixed webservice bug where attach may never happen, and would require a close()/open()&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20111121===&lt;br /&gt;
*Added support for new servo types to all libraries&lt;br /&gt;
*Fixed min/max position/velocity causing invalid arg exception on servo/advservo&lt;br /&gt;
*IPv6 support on MacOS&lt;br /&gt;
*Fixed some memory leaks&lt;br /&gt;
*Fixed hostname lookup issue on Mac OS with Back To My Mac enabled.&lt;br /&gt;
===2.1.8.20111028===&lt;br /&gt;
*Fixed Applescript bugs and released examples&lt;br /&gt;
*Added openLabel to .NET, Java, COM&lt;br /&gt;
*Setting change trigger to 0 on interfacekit will not set event mode.&lt;br /&gt;
**Previously setting change trigger to 0 after setting data rate would supersede the data rate setting, which is probably unexpected.&lt;br /&gt;
===2.1.8.20110630 - MacOS Only===&lt;br /&gt;
*handle USB bug introduced in MacOS 10.6.8&lt;br /&gt;
===2.1.8.20110615===&lt;br /&gt;
*Added error event when trying to open Phidgets with an unsupported version&lt;br /&gt;
===2.1.8.20110614 - Windows Only===&lt;br /&gt;
*Fixed bug in C# Spatial example&lt;br /&gt;
*Added support for negative gains in 1056&lt;br /&gt;
===2.1.8.20110601 - MacOS Only===&lt;br /&gt;
*Fixed AppleScript issues&lt;br /&gt;
===2.1.8.20110527===&lt;br /&gt;
*Fixed AS3.0 library (Flash/Flex) - wouldn&#039;t connect to webservice as of last release&lt;br /&gt;
*Fixed bug where webservice doesn&#039;t release a closed Phidget&lt;br /&gt;
*Fixed bug where devices that don&#039;t support label didn&#039;t show up on MacOS&lt;br /&gt;
*Fixed iPhone library issues&lt;br /&gt;
===2.1.8.20110524===&lt;br /&gt;
*AppleScript support added&lt;br /&gt;
*fixed problem with Spatial in .NET on 64-bit Windows&lt;br /&gt;
*Added remote setLabel to mac preference pane.&lt;br /&gt;
*fixed a bug where label characters 7,8,9 would be read back corrupted on certain devices.&lt;br /&gt;
**labels &amp;gt;7 characters that exhibit this bug will now be truncated to 7 characters when being read back&lt;br /&gt;
**call setLabel again using this library or newer to support 10 character labels.&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to &amp;lt;=7 characters on these devices.&lt;br /&gt;
*fixed bug on MacOS where serial number and/or label strings could be read wrong.&lt;br /&gt;
*better support for recovering misbehaving devices in Linux&lt;br /&gt;
*fixed a deadlock on linux when Avahi is installed but not running&lt;br /&gt;
*clear list of attached devices when closing remote manager&lt;br /&gt;
*Added support for Unicode labels&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to ASCII.&lt;br /&gt;
*Added open by label&lt;br /&gt;
*Webservice protocol version up to 1.0.9 (for open by label)&lt;br /&gt;
*Made opening multiple device is one application faster.&lt;br /&gt;
*TextLCD changes:&lt;br /&gt;
**cursor is disabled while writing to the display or setting a custom character to prevent display artifacts&lt;br /&gt;
**cursor is disabled when a full line is written so it doesn&#039;t go to the start of another line&lt;br /&gt;
**1204 should be stable&lt;br /&gt;
**setDisplayCharacter supports 0x00-0xff&lt;br /&gt;
*stopped property reflected more accurately in the C# stepper example&lt;br /&gt;
*Added error events to mac examples&lt;br /&gt;
===2.1.8.20110329 - Windows only===&lt;br /&gt;
*Fixed problem with control panel encoder example where enable wouldn&#039;t work&lt;br /&gt;
*Fixed issue with SpatialData, GPSPositionChange, PHChange and WeightChange events in Labview 64-bit&lt;br /&gt;
===2.1.8.20110322===&lt;br /&gt;
*Fixed [[Phidget Control Panel]] memory leak when Bonjour in installed but not running&lt;br /&gt;
*Fixed current sense formula on 1061_0 v200&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetAdvancedServo&lt;br /&gt;
*Fixed bug in old PhidgetTemperatureSensor&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20110310===&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetServo&lt;br /&gt;
*Fixed some Labview bugs&lt;br /&gt;
*Added some Java and VB.NET examples&lt;br /&gt;
===2.1.8.20110301===&lt;br /&gt;
*Full Support for 1002, 1011, 1040, 1046, 1054, 1065, 1204&lt;br /&gt;
*New webservice version - 1.0.8&lt;br /&gt;
**Support for new devices&lt;br /&gt;
**Support for error events&lt;br /&gt;
===2.1.7.20110203===&lt;br /&gt;
*fixed crash on close of remote Phidget on MacOS&lt;br /&gt;
*C# ifkit example bugfix - crashed on 1015/1016&lt;br /&gt;
*webservice improvements&lt;br /&gt;
*Switch to IP address for SBC config in browser&lt;br /&gt;
*Faster IP lookup for SBCs in control panel&lt;br /&gt;
===2.1.7.20101222 / 2.1.7.20101223===&lt;br /&gt;
*fixed getServerID on Linux&lt;br /&gt;
*removed report ack&lt;br /&gt;
**this was causing some bad side effects&lt;br /&gt;
*manual .local lookups on Windows&lt;br /&gt;
**much faster then letting Windows do it itself&lt;br /&gt;
*Support for new Labview library&lt;br /&gt;
*Fixed PhidgetIR bug where library would crash if repeat code is longer then IR_MAX_REPEAT_LENGTH&lt;br /&gt;
===2.1.7.20101103===&lt;br /&gt;
*Decreased Phidget Webservice event latency on Windows&lt;br /&gt;
*Preliminary support for 1002, 1011, 1040, 1045, 1046, 1054, 1065, 1204 (C, .NET)&lt;br /&gt;
*Webservice version updated to 1.0.7&lt;br /&gt;
**support for 1045, 1011, 1204&lt;br /&gt;
*Fixed a bug where webservice connections could be unexpectedly lost&lt;br /&gt;
*Bugfix: couldn&#039;t set interfacekit data rate over webservice.&lt;br /&gt;
*Fixed some memory leaks in the Mac library&lt;br /&gt;
*Fixed bug where blocking for &amp;gt;2 seconds in an events handler when opening remotely could cause a crash.&lt;br /&gt;
===2.1.7.20100803===&lt;br /&gt;
*Windows only release&lt;br /&gt;
*fixed setLabel in WindowsCE&lt;br /&gt;
*fixed getHashCode in .NET library - needed for working with Phidgets in Labview via .NET&lt;br /&gt;
===2.1.7.20100621===&lt;br /&gt;
*Linux only release - autotools updates&lt;br /&gt;
**call ldconfig automatically&lt;br /&gt;
**remove old phidget21 library (pre-autotools) when installing new one.&lt;br /&gt;
===2.1.7.20100620===&lt;br /&gt;
*Linux only release - added version.sh for autoreconf&lt;br /&gt;
===2.1.7.20100618===&lt;br /&gt;
*Linux only release - added udev/hotplug files&lt;br /&gt;
===2.1.7.20100617===&lt;br /&gt;
*Linux only release&lt;br /&gt;
*Transitioned to autotools in linux for phidget21 / webservice&lt;br /&gt;
*phidget21 library and webservice are now separate downloads&lt;br /&gt;
===2.1.7.20100525===&lt;br /&gt;
*full support for PhidgetSpatial and PhidgetIR in all libraries&lt;br /&gt;
*fixed 1031 not attaching in AS3.0&lt;br /&gt;
*Better error messages in JNI&lt;br /&gt;
*Updated error codes, device ID/Class lists in Java, Flash, COM, etc.&lt;br /&gt;
*Fixed TemperatureSensor version 200,201,202 bug - ambient sensor would not report negative temperatures.&lt;br /&gt;
*Revised temperaturesensor API to report tempMin/tempMax and errors more accurately.&lt;br /&gt;
*Added initial events for encoder digital inputs&lt;br /&gt;
*full support for 1047&lt;br /&gt;
*Added new device support to WindowsCE&lt;br /&gt;
*Updated mac examples for 1047, 1048&lt;br /&gt;
===2.1.6.20100504===&lt;br /&gt;
*Windows only Release&lt;br /&gt;
**Added 1131 and 1132 to InterfaceKit example in MSI&lt;br /&gt;
===2.1.6.20100428===&lt;br /&gt;
*limit data rate maximum to 16ms over the webservice for devices that expose dataRate (InterfaceKit, Spatial)&lt;br /&gt;
*fixed bug where TextLCD 8/8/8 would stay in Bonjour list after webservice is shutdown&lt;br /&gt;
*set/get Brightness for 1203_2&lt;br /&gt;
*Support 1048 in C# example&lt;br /&gt;
*webservice version incremented to 1.0.6&lt;br /&gt;
**TextLCD set/get brightness&lt;br /&gt;
**PhidgetIR support&lt;br /&gt;
**PhidgetSpatial support&lt;br /&gt;
**1047 support (enable, index)&lt;br /&gt;
===2.1.6.20100406===&lt;br /&gt;
*Support for 1018_2 (dataRate)&lt;br /&gt;
*Webservice version incremented to 1.0.5&lt;br /&gt;
===2.1.6.20100401===&lt;br /&gt;
*Updated InterfaceKit example with new sensors&lt;br /&gt;
*make Windows connect cancelable&lt;br /&gt;
*make pending zeroconf lookups cancelable during close&lt;br /&gt;
===2.1.6.20100318===&lt;br /&gt;
*Mac only release&lt;br /&gt;
**Added WillSleep and Wakeup events to give user control of Phidgets immediately before and after a system sleep (MacOS Only).&lt;br /&gt;
===2.1.6.20100317===&lt;br /&gt;
*Windows only release&lt;br /&gt;
**Some of the examples were being built using an out of date .NET library&lt;br /&gt;
===2.1.6.20100310===&lt;br /&gt;
*MaxMSP fix - 2.1.6.20100126 introduced a bug for some Phidgets where openremote/open by serial didn&#039;t work and MaxMSP would sometimes crash.&lt;br /&gt;
**No code changes to any of the other libraries.&lt;br /&gt;
===2.1.6.20100304===&lt;br /&gt;
*stopped property changes trigger events over webservice so they are noticed.&lt;br /&gt;
**more compatible with how local open works&lt;br /&gt;
*added 5 new servos&lt;br /&gt;
*fixed bug where remote close would not set detached so a subsequent open would not always connect.&lt;br /&gt;
*handle UninitializeZeroconf better - shut down thread before closing handles, fixes hang on SBC&lt;br /&gt;
*fixed bug on Mac where detaching 2 or more Phidgets at the same time caused a crash&lt;br /&gt;
*fixed close blocking because of a pending connect (mac, linux)&lt;br /&gt;
*Final support for 1031 in all libraries.&lt;br /&gt;
===2.1.6.20100129===&lt;br /&gt;
*Implemented initial events in Flash&lt;br /&gt;
**Flash behaviour should now be identical to C library local and remote.&lt;br /&gt;
*Fix RFID issue where close could cause crash&lt;br /&gt;
*increment webservice version to 1.0.4&lt;br /&gt;
*fixed RFID remote open&lt;br /&gt;
**Flash would never get an attach event if the reader had been previously opened&lt;br /&gt;
**Initial tag event would not be fired when a tag was present and the antenna was enabled prior to open&lt;br /&gt;
*fixed openRemote failing on Mac&lt;br /&gt;
*fixed deadlock in webservice which could be hit by opening/closing a device over and over again.&lt;br /&gt;
*fixed bug in stepper, which caused seg fault on SBC on position change events.&lt;br /&gt;
===2.1.6.20100126===&lt;br /&gt;
*added network open support in Max/MSP&lt;br /&gt;
===2.1.6.20100115===&lt;br /&gt;
*Increased network performance for Linux/MacOS&lt;br /&gt;
*Added five servo types&lt;br /&gt;
===2.1.6.20091215===&lt;br /&gt;
*Fixed busy loop in Linux openRemote&lt;br /&gt;
*JNI Library relocated to /Library/Java/Extensions on MacOS&lt;br /&gt;
===2.1.6.20091211===&lt;br /&gt;
*Heartbeat now works on Linux as well (had to make sockets non-blocking)&lt;br /&gt;
===2.1.6.20091130===&lt;br /&gt;
*Added heartbeat to webservice (client side)&lt;br /&gt;
**Better detects network failures by using active polling timeouts&lt;br /&gt;
*Fixed 0/8/8 over webservice&lt;br /&gt;
===2.1.6.20091020===&lt;br /&gt;
*Fixed 1052 counting issue on 1070 (-1 reported as 255)&lt;br /&gt;
*Fixed issue where Phidget21 would try to reinstall from a limited user account or when the Control Panel was disabled.&lt;br /&gt;
*64-bit kernel support in Snow Leopard&lt;br /&gt;
===2.1.6.20090928===&lt;br /&gt;
*Support for PhidgetSBC (1070)&lt;br /&gt;
*zeroconf can handle starting up before the mdns daemon, and will keep trying to connect.&lt;br /&gt;
*fixed 1066 not showing up on Mac&lt;br /&gt;
*added advanced servo example to mac pref pane&lt;br /&gt;
*implemented proper error handling in COM&lt;br /&gt;
**default behavious remains the same, enable proper error handling with &#039;EnableVerboseErrors&#039;&lt;br /&gt;
*implemented error events in Java&lt;br /&gt;
===2.1.6.20090917===&lt;br /&gt;
*Updated webservice protocol version to 1.0.3&lt;br /&gt;
*Fixed stepper under AS3.0&lt;br /&gt;
*added setServoType, getServoType, setServoParameters to PhidgetServo and PhidgetAdvancedServo&lt;br /&gt;
*possible race condition fixed in webservice (pdictclient.c:907)&lt;br /&gt;
===2.1.6.20090902 (mac only release)===&lt;br /&gt;
*Support MacOSX 10.6, drop support for 10.3.9, require 10.4 or newer&lt;br /&gt;
**Fully 64-bit compliant, library supports ppc, i386, x86_64&lt;br /&gt;
===2.1.6.20090806===&lt;br /&gt;
*Added 1049 support&lt;br /&gt;
*Fixed RFID tag events over webservice&lt;br /&gt;
===2.1.6.20090804===&lt;br /&gt;
*Added 1051_2 support&lt;br /&gt;
*Fixed various small initialization issues - stepper, adv servo, rfid&lt;br /&gt;
*Added 32-bit library install to 64-bit installer&lt;br /&gt;
**VB6.0, etc. need the 32-bit COM library on 64-bit windows&lt;br /&gt;
===2.1.6.20090717===&lt;br /&gt;
*?&lt;br /&gt;
===2.1.6.20090708===&lt;br /&gt;
*Added DeviceID to zeroconf&lt;br /&gt;
*fixed RFID.LastTag in .NET&lt;br /&gt;
*Changed the error codes returned by error events; error events now have their own set of error codes rather then sharing the function return codes.&lt;br /&gt;
*Added support for 1047, 1048&lt;br /&gt;
*Added error event codes rather then trying to reuse the EPHIDGET return codes.&lt;br /&gt;
*fixed TextLCD issue where display could get corrupted during a detach/attach&lt;br /&gt;
*made mac more reliable on attach&lt;br /&gt;
*more error logging on mac&lt;br /&gt;
===2.1.6.20090525===&lt;br /&gt;
*fixed RFID not attaching via webservice if a tag is present.&lt;br /&gt;
*bugfix related to double free on detach event.&lt;br /&gt;
*Implemented getKey&lt;br /&gt;
*Added MIPS II support to Windows CE&lt;br /&gt;
===2.1.6.20090430===&lt;br /&gt;
*Added ActiveX interface to COM library&lt;br /&gt;
*Added stepper and advancedServo to Flex .swc library&lt;br /&gt;
===2.1.6.20090417===&lt;br /&gt;
*added PhidgetIR prototype support to C library&lt;br /&gt;
*properly handles sleeping on OSX&lt;br /&gt;
*fixed some webservice field initializations in Flash and C&lt;br /&gt;
*fixed security exceptions in [[Phidget Control Panel]] under Vista&lt;br /&gt;
*added [[Phidget Control Panel]] to start menu&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090318 (Examples/AS3.0 only release)===&lt;br /&gt;
*Fixed AdvancedServo in Flash - wouldn&#039;t attach&lt;br /&gt;
===2.1.6.20090317===&lt;br /&gt;
*[[Phidget Control Panel]] properly supports Vista UAC and Limited user accounts in XP, etc.&lt;br /&gt;
*Added 64-bit release of Phidget21.msi for Windows&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090312===&lt;br /&gt;
*added 1064, 1059 to WindowsCE&lt;br /&gt;
*fixed opening 1051 over webservice&lt;br /&gt;
*fixed opening 1015/1016 over webservice broken in last release&lt;br /&gt;
===2.1.6.20090302===&lt;br /&gt;
*Advanced servo bugfix: stopped would stop being true if min/max was set to exclude current position.&lt;br /&gt;
*linux USB improvements when many Phidgets are attached and opened at once.&lt;br /&gt;
*1031 support in phidget21, webservice, .NET - hidden until product release&lt;br /&gt;
**CPhidgetLED_setVoltage&lt;br /&gt;
**CPhidgetLED_getVoltage&lt;br /&gt;
**CPhidgetLED_setCurrentLimit&lt;br /&gt;
**CPhidgetLED_getCurrentLimit&lt;br /&gt;
*unknown timechange == PUNK_INT in encoder position change event&lt;br /&gt;
**1st position change event&lt;br /&gt;
**&amp;gt; 30 seconds time change&lt;br /&gt;
*AS3 updates&lt;br /&gt;
**updated to 1.0.2 webservice&lt;br /&gt;
**encoder position change events report relative change rather then absolute position&lt;br /&gt;
**encoder adds getTimeChange function for timing encoder changes&lt;br /&gt;
*webservice updated to 1.0.2&lt;br /&gt;
**Authorization is asynchronous&lt;br /&gt;
**Doesn&#039;t match the old version checking, so errors will not be nice when trying to connect to an old webservice&lt;br /&gt;
**Sends out all initial data, so it&#039;s just like opening locally&lt;br /&gt;
**supports interfacekit Raw sensor value&lt;br /&gt;
**supports labels on remoteIP managers&lt;br /&gt;
*avahi bugfix&lt;br /&gt;
*webservice more stable against forcefully closed clients&lt;br /&gt;
*closing a network Phidget won&#039;t block - ever.&lt;br /&gt;
**no longer using quit, just closing the socket&lt;br /&gt;
*added libavahi-client.so.3 reference to linux library.&lt;br /&gt;
*Fixed bug with opening one phidget with serial and no serial at the same time over the webservice&lt;br /&gt;
===2.1.5.20090105===&lt;br /&gt;
*[[Phidget Control Panel]] stability improvements&lt;br /&gt;
*added CPhidgetSBC_getHostname&lt;br /&gt;
*advanced servo 1 motor current sense equation - support should now be complete&lt;br /&gt;
*webservice and network code bugfixes - crash / deadlock during close, problems with concurrent connections, etc.&lt;br /&gt;
*fixed close on remote and remoteIP managers&lt;br /&gt;
*name of RFID changed from &amp;quot;Phidget RFID 4-output&amp;quot; to &amp;quot;Phidget RFID 2-output&amp;quot; - updated anything referencing old name.&lt;br /&gt;
&lt;br /&gt;
===2.1.5.20081023===&lt;br /&gt;
*added advanced servo and stepper examples to VB6.0, VB.NET and C&lt;br /&gt;
*added deviceClass and deviceID&lt;br /&gt;
*updated Mac examples&lt;br /&gt;
*webservice protocol version enforcement&lt;br /&gt;
*internal fix/rework of device id&#039;s etc.&lt;br /&gt;
*Fixed memory leaks in webservice and phidget21 network code.&lt;br /&gt;
*Dictionary and network stability improvements.&lt;br /&gt;
*duplicate calls to open or close are now silently ignored.&lt;br /&gt;
===2.1.4.20080924===&lt;br /&gt;
*Old TextLCD 0/8/8&#039;s can now have both halves open at the same time on Windows&lt;br /&gt;
*fixed bug with composite devices on linux&lt;br /&gt;
*fixed manager on linux to better deal with unique devices&lt;br /&gt;
===2.1.4.20080922===&lt;br /&gt;
*Updated Delphi files&lt;br /&gt;
*TextLCD can display 0x80-0xFF characters from Java&lt;br /&gt;
*getAttachedDevices works for mdns managers&lt;br /&gt;
*fixed a deadlock in the webservice&lt;br /&gt;
*better network error handling / password support for windows C# examples&lt;br /&gt;
*waitForAttachment will return EPHIDGET_CLOSED if the handle is closed while it is waiting.&lt;br /&gt;
*added EPHIDGET_CLOSED&lt;br /&gt;
*joining central threads checks whether they are trying to be joined by themselves first (avoid deadlocks).&lt;br /&gt;
*changed context of error event to be free from locks (can call close, open, etc. from them).&lt;br /&gt;
===2.1.4.20080821===&lt;br /&gt;
*zeroconf threads exit cleanly on last _close (apple zeroconf)&lt;br /&gt;
*Added advanced servo and stepper to Max&lt;br /&gt;
===2.1.4.20080811 (mac only release)===&lt;br /&gt;
*Fixed manager on Mac (wasn&#039;t working at all since 2.1.4.20080808)&lt;br /&gt;
===2.1.4.20080808===&lt;br /&gt;
*added CPhidgetSBC and CPhidgetSBCManager to the c library - these interfaces are hidden from users and meant to be used internally (for now).&lt;br /&gt;
*CPhidgetManager_open no longer blocks to send out initial attach events. These initial events are sent from the CentralThread context like all other attach events.&lt;br /&gt;
*fixed CThread_wait_on_event on Linux&lt;br /&gt;
*added CPhidgetGeneric interface for prototyping to C, .NET libraries. product ID is 0x99. These are only visible in debug releases, only to be used internally.&lt;br /&gt;
===2.1.4.20080715===&lt;br /&gt;
*udev rules fixed for product IDs with alpha-hex values&lt;br /&gt;
*blocking in an attach event does not block calls to open anymore&lt;br /&gt;
*RFID tag event handlers can now handle blocking - tag lost is timed after the tag handler exits.&lt;br /&gt;
===2.1.4.20080623===&lt;br /&gt;
*Flex .swc library was out of sync&lt;br /&gt;
*fixed CPhidgetManager_getAttachedDevices for network managers&lt;br /&gt;
*Added CPhidgetManager_freeAttachedDevicesArray&lt;br /&gt;
===2.1.4.20080613===&lt;br /&gt;
*Max/MSP RFID fixed&lt;br /&gt;
*0/0/8 and advanced servo added to CE&lt;br /&gt;
*fixed flash policy file server in webservice&lt;br /&gt;
*webservice with password and asynchronous together work now&lt;br /&gt;
===2.1.4.20080602===&lt;br /&gt;
*phidget21.h -&amp;gt; phidget21int.h so as not to be confused with generated phidget21.h&lt;br /&gt;
*some changes to Makefile fro crosscompiling&lt;br /&gt;
*no more vbscript in msi&lt;br /&gt;
===2.1.4.20080513===&lt;br /&gt;
*removed long long from COM - not supported by VB6.0&lt;br /&gt;
*added LastTag to RFID in .NET&lt;br /&gt;
===2.1.4.20080428===&lt;br /&gt;
*support Mac OS X 10.3.9 again&lt;br /&gt;
*Rev up to 2.1.4&lt;br /&gt;
*finalize Phidget Stepper API - Phidget Stepper requires 2.1.4 as a minimum&lt;br /&gt;
*fixed serverConnect and serverDisconnect handlers for manager and dictionary in COM&lt;br /&gt;
*Changed:&lt;br /&gt;
**PhidgetStepper and PhidgetAdvancedServo&lt;br /&gt;
***MotorPosition -&amp;gt; Position&lt;br /&gt;
***MotorOn -&amp;gt; Engaged&lt;br /&gt;
***MotorStopped -&amp;gt; Stopped&lt;br /&gt;
*Added:&lt;br /&gt;
**CPhidgetStepper_getCurrentLimit&lt;br /&gt;
**CPhidgetEncoder_getPosition&lt;br /&gt;
**CPhidgetEncoder_setPosition&lt;br /&gt;
**CPhidgetMotorControl_getVelocity&lt;br /&gt;
**CPhidgetMotorControl_setVelocity&lt;br /&gt;
**CPhidgetMotorControl_set_OnVelocityChange_Handler&lt;br /&gt;
**CPhidgetServo_setEngaged&lt;br /&gt;
**CPhidgetServo_getEngaged&lt;br /&gt;
**CPhidgetServo_getPosition&lt;br /&gt;
**CPhidgetServo_setPosition&lt;br /&gt;
**CPhidgetServo_set_OnPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getPositionMax&lt;br /&gt;
**CPhidgetServo_getPositionMin&lt;br /&gt;
**Count functions&lt;br /&gt;
*Deprecated:&lt;br /&gt;
**CPhidgetEncoder_getEncoderPosition&lt;br /&gt;
**CPhidgetEncoder_setEncoderPosition&lt;br /&gt;
**CPhidgetMotorControl_getMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_setMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_set_OnMotorChange_Handler&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorPosition&lt;br /&gt;
**CPhidgetServo_setMotorPosition&lt;br /&gt;
**CPhidgetServo_set_OnMotorPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**Num functions&lt;br /&gt;
*Added ability to deprecate funcitons in the C library - compiler will issue a warning when they are used.&lt;br /&gt;
*added names to some arguments in phidget21.h&lt;br /&gt;
*fixes to the webservice for initial state stuff - now it behaves almost like non-webservice, with guaranteed initial events, but we don&#039;t guarantee initial state in the attach event yet. Min/Max, Num motors, inputs, etc. are all guaranteed in the attach handler.&lt;br /&gt;
*Finalized support for Phidget Stepper&lt;br /&gt;
===2.1.3.20080402===&lt;br /&gt;
*Fixed windows BUG - Device Type was showing up wrong&lt;br /&gt;
*CPhidgetStepper_getPosition -&amp;gt; CPhidgetStepper_getCurrentPosition&lt;br /&gt;
===2.1.3.20080327===&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorStopped&lt;br /&gt;
*changes to API&lt;br /&gt;
**CPhidgetStepper_setMotorPosition -&amp;gt; CPhidgetStepper_setTargetMotorPosition&lt;br /&gt;
**added CPhidgetStepper_getTargetMotorPosition&lt;br /&gt;
**Stepper MotorSpeed -&amp;gt; Velocity&lt;br /&gt;
**Stepper and AdvancedServo MaxVelocity -&amp;gt; VelocityLimit&lt;br /&gt;
*add waitForAttachment to COM&lt;br /&gt;
*COM getbool (not indexed) will now return FALSE on false (rather then always returning true)&lt;br /&gt;
*fixed write thread timeouts - was setting attached after starting write thread so write thread would see a detached device and exit immediately&lt;br /&gt;
===2.1.3.20080206===&lt;br /&gt;
*changed long long to __int64, to be happy in borland C++&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetStepper_getMaxMotorSpeed&lt;br /&gt;
**CPhidgetStepper_setMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorStopped&lt;br /&gt;
**CPhidgetStepper_setCurrentMotorPosition&lt;br /&gt;
*removed CPhidgetStepper_setVelocity&lt;br /&gt;
*added CPhidgetStepper_setMaxVelocity, CPhidgetStepper_getMaxVelocity&lt;br /&gt;
===2.1.3.20080114===&lt;br /&gt;
*Added new functions to Flash API&lt;br /&gt;
*Added new functions to Webservice Protocol&lt;br /&gt;
*Added new functions to COM Library&lt;br /&gt;
*Added new functions to Java Library&lt;br /&gt;
*All device fiels in C library cleaned up and made consistent&lt;br /&gt;
*Open in windows is exclusive - this needs to be tested for stability&lt;br /&gt;
*No data will be returned / accepted if it lies outside of max/min range&lt;br /&gt;
*if a data value is unknown, user variable is set to PUNK_INT, PUNK_DBL, or PUNK_BOOL, and return value is EPHIDGET_UNKNOWNVAL&lt;br /&gt;
*Proper Device initializations on Attach:&lt;br /&gt;
**triggers are set to defaults on attach&lt;br /&gt;
**device state is read in and preserved on attach&lt;br /&gt;
**during attach event, all sensor data, etc. is provided if available&lt;br /&gt;
**no data events until after the attach event returns&lt;br /&gt;
**everything initialized by the time waitForAttachment returns&lt;br /&gt;
**after attach event returns, a full set of initial state data events are thrown&lt;br /&gt;
*.NET collections are readonly, and never NULL (but empty when phidget detached)&lt;br /&gt;
*.NET callbacks no longer catch and hide all exceptions&lt;br /&gt;
**make sure to use try/catch blocks especially in Attach when accessing properties that may not be initialized.&lt;br /&gt;
*added min/max functions:&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMax&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMax&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMax&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMax&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMin&lt;br /&gt;
**CPhidgetPHSensor_getPHMax&lt;br /&gt;
**CPhidgetPHSensor_getPHMin&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMax&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMin&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetStepper_getAccelerationMax&lt;br /&gt;
**CPhidgetStepper_getAccelerationMin&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMax&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMin&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMax&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMin&lt;br /&gt;
*Added functions:&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperature&lt;br /&gt;
**CPhidgetTemperatureSensor_getThermocoupleType&lt;br /&gt;
**CPhidgetTemperatureSensor_setThermocoupleType&lt;br /&gt;
**CPhidget_set_OnServerConnectHandler&lt;br /&gt;
**CPhidget_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_getServerID&lt;br /&gt;
**CPhidgetDictionary_getServerAddress&lt;br /&gt;
**CPhidgetDictionary_getServerStatus&lt;br /&gt;
**CPhidgetManager_getServerID&lt;br /&gt;
**CPhidgetManager_getServerAddress&lt;br /&gt;
**CPhidgetManager_getServerStatus&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
*Removed functions:&lt;br /&gt;
**CPhidgetServo_setMotorOff&lt;br /&gt;
*TemperatureSensor:&lt;br /&gt;
**Ambient sensor is accessed with it&#039;s own function&lt;br /&gt;
**first thermocouple is Index 0 everywhere&lt;br /&gt;
**no ambient sensor events&lt;br /&gt;
*getServerID is implemented&lt;br /&gt;
*changed the internal network structure (added CPhidgetRemote)&lt;br /&gt;
*reworked the USB code (mostly on Windows)&lt;br /&gt;
**Better handles closing, ESD events, timeouts&lt;br /&gt;
**fixed issues with Encoder, RFID stopping reading after a certain time.&lt;br /&gt;
**added USB error flag&lt;br /&gt;
*openRemote functions have been implemented&lt;br /&gt;
**these require bonjour (mac / windows) or avahi (linux) to be installed on both the client and server&lt;br /&gt;
**if they are not, you get EPHIDGET_UNSUPPORTED when you call them&lt;br /&gt;
*openRemoteIP functions are asynchronous and persistent&lt;br /&gt;
*include cphidgetconstants.h in phidget21.h for users&lt;br /&gt;
===2.1.2.20071108===&lt;br /&gt;
*start of chagelog&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=OS_-_OS_X&amp;diff=24127</id>
		<title>OS - OS X</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=OS_-_OS_X&amp;diff=24127"/>
		<updated>2019-10-01T18:10:53Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
{{OSLang|[[File:Icon-Mac-OS.png‎|64x64px|link=]]|On OS X, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#WebService|WebService]].}}&lt;br /&gt;
__TOC__&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;OS X 10.5 Leopard or newer&#039;&#039;&#039;, and can run on PPC, 32-bit, and 64-bit systems.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide for your specific Phidget device, which may be found in its [[:Category:UserGuide|user guide]].  If you already have the Preference Pane Installed and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the workings behind the Preference Pane, the Phidget WebService, and more - all specific to OS X.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
*OS X 10.11+: [{{SERVER}}/downloads/phidget21/libraries/macos/Phidget.dmg Installer Download]&lt;br /&gt;
*Mac OS X 10.7 - OS X 10.10: [{{SERVER}}/downloads/phidget21/libraries/macos/Phidget_OS_X_10_7.dmg Installer Download]&lt;br /&gt;
*Mac OS X 10.5 - OS X 10.6: [{{SERVER}}/downloads/phidget21/libraries/macos/Phidget_OS_X_10_5.dmg Installer Download]&lt;br /&gt;
*[[Software License]]&lt;br /&gt;
&lt;br /&gt;
If you need old versions of the libraries, [{{SERVER}}/downloads/phidget21/libraries/macos/Phidget/ click here].&lt;br /&gt;
&lt;br /&gt;
==Getting Started with OS X==&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|o2P580PvjCg}}&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer will install the core Phidget files onto your system.&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download the Phidget installer for your system:&lt;br /&gt;
*[{{SERVER}}/downloads/phidget21/libraries/macos/Phidget.dmg OS X Installer]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and double click on {{Code|Phidgets.mpkg}} to install the libraries.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX Install 1.png|link=|alt=OS X Install]]&lt;br /&gt;
&lt;br /&gt;
3. Proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX Install 2.png|link=|alt=OS X Install]]&lt;br /&gt;
&lt;br /&gt;
4. Once the installation is complete, you are ready to program with Phidgets. To find out what files got installed, please see [[#Description of Installer files | Description of Installer files]] in the Appendix section.&lt;br /&gt;
&lt;br /&gt;
Proceed onto to the [[#Phidget Preference Pane | next]] section where the Phidget Preference Pane will be discussed.&lt;br /&gt;
&lt;br /&gt;
====Phidget Preference Pane====&lt;br /&gt;
&lt;br /&gt;
The Phidget Preference Pane is a tool to quickly determine whether your system is able to communicate with Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, open up the {{Code|System Preferences}} window.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX System Preferences.png|link=|alt=OS X System Preferences]]&lt;br /&gt;
&lt;br /&gt;
Click on the {{Code|Phidgets}} icon in the {{Code|Other}} section to bring up the Phidgets Preference Pane.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane General.png|link=|alt=OS X PreferencePane General]]&lt;br /&gt;
&lt;br /&gt;
The Phidget Preference Pane can:&lt;br /&gt;
* Access and test Phidgets connected to your computer&lt;br /&gt;
* Update device firmware&lt;br /&gt;
* Access other Phidgets over the webservice, and make your local Phidgets accessible over the webservice&lt;br /&gt;
* Make use of the [[Phidget Dictionary]]&lt;br /&gt;
* Manage the labels of connected Phidgets&lt;br /&gt;
* View all [[OS_-_Phidget_SBC|SBCs]] on the network and view their webpages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For more information, visit the [[Phidget Control Panel#OS X|Phidget Preference Pane]] page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software components of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software component is working by seeing if the Phidget device is listed in the General tab of the Phidget Preference Pane.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane General.png ‎|link=|alt=OS X Preference Pane General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If you see your Phidget in the list, you can continue to the [[#Programming Languages | programming languages]] section to learn more. If you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the OS X System Profiler. You can access the System Profiler by selecting {{Code|About This Mac}} under the Apple icon. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX About This Mac.png‎|link=|alt=OS X About This Mac]]&lt;br /&gt;
&lt;br /&gt;
The new window will open up.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX More Info.png|link=|alt=OS X More Info]]&lt;br /&gt;
&lt;br /&gt;
Select {{Code|More Info}}. The System Profiler will show up. In the USB section, you will be able to find all connected USB devices. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX USB Devices.png ‎|link=|alt=OS X Attached USB Devices]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, The PhidgetInterfaceKit and PhidgetRFID are connected to the USB ports. &lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the example programs &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using OS X 10.5 or newer. &lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Quick Downloads| quick downloads section]] to download them)&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Us|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
Phidgets’ philosophy is that you do not have to be an electrical engineer in order to do projects that use devices like sensors, motors, motor controllers, and interface boards. All you need to know is how to program.&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language. You can learn more about what is needed to program in a particular language by choosing the language of your preference below. If you need help choosing a language, please look at the [[Software Overview#Language Support |language comparison table]]. &lt;br /&gt;
&lt;br /&gt;
We recommend the following languages for OS X:&lt;br /&gt;
* [[Language - Applescript|AppleScript]]&lt;br /&gt;
* [[Language - C/C++|C/C++]]&lt;br /&gt;
* [[Language - C Sharp|C# (Using Mono)]]&lt;br /&gt;
* [[Language - Cocoa | Cocoa]]&lt;br /&gt;
* [[Language - Flash AS3 | Flash AS3]]&lt;br /&gt;
* [[Language - Flex AS3 | Flex AS3]]&lt;br /&gt;
* [[Language - LiveCode | LiveCode]]&lt;br /&gt;
* [[Language - Java | Java]]&lt;br /&gt;
* [[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
* [[Language - Python | Python]]&lt;br /&gt;
* [[Language - Ruby|Ruby]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
==WebService==&lt;br /&gt;
&lt;br /&gt;
The Phidget WebService allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget WebService on OS X are already included in the [[#Quick Downloads | Drivers]] above. If you see the Phidget Preference Pane in System Preferences, then you already have the WebService drivers installed.&lt;br /&gt;
&lt;br /&gt;
There are two ways that you can connect to a Phidget hosted on another computer. The first method is by using the IP address/host name and port of the host computer. The second method makes the use of [http://en.wikipedia.org/wiki/Multicast_DNS mDNS], which allows Phidgets to be found and opened on the network by a server id instead of an IP address/host name. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget WebService takes advantage of [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software, which is built-in to OS X. It is a tool developed by Apple to locate devices, such as Phidgets,  on a network.&lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the WebService on Windows, but we also have an overview of the [[Phidget WebService]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the WebService On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the WebService on and off. The first method is through the Phidget Preference Pane. In the {{Code|WebService}} tab, you can start or stop the WebService. You can also choose to have the WebService start up automatically upon system boot up by selecting the {{Code|Start Automatically}} checkbox. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Webservice Stopped.png|link=|alt=OS X PreferencePane WebService]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the WebService on and off is through command line. After using our installer, the WebService utility is automatically installed in {{Code|/usr/bin/phidget21webservice}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|phidgetwebservice21}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 phidgetwebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mapping out which command line options to which Phidget Preference Pane option is as follows:&lt;br /&gt;
&lt;br /&gt;
-p: {{Code|Port}} field&lt;br /&gt;
&lt;br /&gt;
-n: {{Code|ServerID}} field&lt;br /&gt;
&lt;br /&gt;
-P: {{Code|Password}} field&lt;br /&gt;
&lt;br /&gt;
-v: Not supported under the Phidget Preference Pane&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, use {{Code|hostname}} on the command line.&lt;br /&gt;
*For your IP address, use {{Code|ifconfig -a}} on the command line.&lt;br /&gt;
**A line in the return text, under your main internet connection (usually {{Code|eth0}}) will say something like {{Code|inet addr:192.168.3.178}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some usage examples:&lt;br /&gt;
&lt;br /&gt;
To start the WebService with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 phidgetwebservice21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the WebService with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 phidgetwebservice21-n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To stop the WebService, simply close the command line window or press {{Code|Control}} and {{Code|c}} at the same time in the command line window.&lt;br /&gt;
&lt;br /&gt;
===Using the WebService===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the WebService, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that if you only have a single computer, you can also connect to the Phidget over the WebService. The computer will simply act as both a host and client. This will allow you to bypass the [[General Phidget Programming # Details for Open() | one application per Phidget limitation]]. &lt;br /&gt;
&lt;br /&gt;
* Start the WebService on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on OS X is to set up the WebService and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Preference Pane and traverse to the {{Code|Web Service}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Webservice Stopped.png |link=|alt=OS X Preference Pane WebService]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way they are, and click on {{Code|Start WebService}} to run the WebService.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the WebService is running by looking at the status on the right side.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Webservice Running.png|link=|alt=OS X PreferencePane WebService Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Preference Pane, open up the {{Code|Bonjour}} tab. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Bonjour.png ‎‎ |link=|alt=OS X PreferencePane Bonjour.png ‎]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to communicate with the Phidget over the WebService.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Example.png ‎ |link=|alt=OS X PreferencePane Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the WebService was indeed behind this exchange by terminating the WebService process while still allowing the remote program to run. On the host&#039;s Phidget Preference Pane, traverse to the {{Code|WebService}} tab. Hit {{Code|Stop WebService}} to terminate the WebService. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Webservice Running.png|link=|alt=OS X PreferencePane WebService Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the WebService, there is nothing attached. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Example Stopped.png |link=|alt=OS X PreferencePane Example Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the WebService===&lt;br /&gt;
&lt;br /&gt;
You can get debugging information from the WebService itself.  This debugging can only be enabled from the command line approach to start the WebService. Debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 phidgetwebservice21 -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The debugging information will be shown as output in the command line console.&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
&lt;br /&gt;
===Description of Installer files===&lt;br /&gt;
&lt;br /&gt;
Here is the list of files and their description for each file the installer puts onto your system. &lt;br /&gt;
===Description of Library files===&lt;br /&gt;
&lt;br /&gt;
This section will explain the files that were placed onto your system as part of the installation process.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.framework}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is placed into {{Code|/Library/Frameworks}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget.kext}}&amp;lt;/b&amp;gt; is the kernel extension.  It is placed into {{Code|/System/Library/Extensions}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|libphidget21.jnilib}}&amp;lt;/b&amp;gt; is the JNI library for Java.  It is placed into {{Code|/Library/Java/Extensions}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidgets.prefpane}}&amp;lt;/b&amp;gt; is the Phidgets Preference Pane.  It is placed into {{Code|/Library/PreferencePanes}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidgetwebservice21}}&amp;lt;/b&amp;gt; is the Phidget WebService.  It is placed into {{Code|/usr/bin}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetsOSA.app}}&amp;lt;/b&amp;gt; is the the Phidgets agent for AppleScript.  It is placed into {{Code|/Library/ScriptingAdditions}}.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
None, yet.&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=24126</id>
		<title>Driver Changelog</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=24126"/>
		<updated>2019-10-01T18:08:16Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Administrative]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20191001===&lt;br /&gt;
*macOS / Windows release&lt;br /&gt;
**Support for macos 10.15 Catalina&lt;br /&gt;
**Update firmware files&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20190409===&lt;br /&gt;
*Fix GPS Date after April 6 2019 week rollover event&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20190208===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where devices plugged in before boot were inaccessible until unplugged/re-plugged on 2018 Mac Mini.&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20180622===&lt;br /&gt;
*Python fix&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20180215===&lt;br /&gt;
*Move to .NET 4.0&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20171215===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where opening two of the same device with -1 serial could cause missed attach/detach events and other errors.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160921===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where devices plugged in before boot were inaccessible until unplugged/re-plugged, under OS X 10.11. &lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160202===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Labview 7.1 support&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160107===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Don&#039;t throw an exception on EncoderPositionChangeEventArgs.Time in the .Net library when time it unknown - just return 0x7fffffff&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160104===&lt;br /&gt;
*Mac/Windows release&lt;br /&gt;
**New firmware for 1042 and 1044, fixing digital gyro&lt;br /&gt;
===2.1.8.20151217===&lt;br /&gt;
*Fixed 1045 bug where it will display an unknown ambient temperature sometimes&lt;br /&gt;
*Fixed a crash in the windows control panel&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151020===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Fixed an issue where the examples would error when trying to run them from the control panel.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151009===&lt;br /&gt;
*OS X and Windows release&lt;br /&gt;
**Upgraded firmware for 1024, 1032, 1041, 1042, 1043, 1044 and 1067 to address issues with these Phidgets on OS X El Capitan&lt;br /&gt;
*SBC release&lt;br /&gt;
**Support for multiple webcams &lt;br /&gt;
===2.1.8.20150821===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Support OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150805===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Preliminary support for OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150410===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed Makefile phidget21.h target issues&lt;br /&gt;
===2.1.8.20150326===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed issue with webservice buttons not being visible in the control panel&lt;br /&gt;
===2.1.8.20150323===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Updated icons with new company logo&lt;br /&gt;
===2.1.8.20150227===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Added copyright/licence headers to source code files&lt;br /&gt;
**Updated cvtutf files to a newer version&lt;br /&gt;
===2.1.8.20150109===&lt;br /&gt;
*Windows-only&lt;br /&gt;
**Fixed examples for Labview 8.5&lt;br /&gt;
===2.1.8.20141209===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Added support for armv7s and arm64 to the iOS library. Dropped support for armv6. Requires iOS 5.1.1 or later.&lt;br /&gt;
===2.1.8.20141202===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Labview release to support older versions&lt;br /&gt;
===2.1.8.20141119===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed an issue with the 2.1.8.20141117 release where nothing was actually installed.&lt;br /&gt;
===2.1.8.20141117===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed a code-signing issue that make the installer appear unsigned on OS X 10.10&lt;br /&gt;
**Dropped support for OS X 10.4&lt;br /&gt;
===2.1.8.20140905===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added an IA32 folder to the windows libraries download - this supports Windows on the Intel Galileo platform&lt;br /&gt;
===2.1.8.20140428===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to C# Stepper GUI Example&lt;br /&gt;
===2.1.8.20140319===&lt;br /&gt;
*CPhidget_getDeviceClass can now be called on handle before it is attached.&lt;br /&gt;
*Added support for 64-bit Max/MSP (Version 6.1+) on both OS X and Windows.&lt;br /&gt;
===2.1.8.20140227===&lt;br /&gt;
*Deals with 1046 bug in v100 and v101 firmware.&lt;br /&gt;
**No longer reports bad values that appear right after a channel is enabled.&lt;br /&gt;
**Fixes issue where changing the gain while channel 0 is disabled would sometimes cause bad readings.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20131105===&lt;br /&gt;
* Fixed a defect in the Flash examples for the 1012 (Outputs 11-16 were not addressed properly).&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20130926===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support setting label on 1067 from Windows&lt;br /&gt;
===2.1.8.20130820===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added logging option to control panel / C# full examples&lt;br /&gt;
===2.1.8.20130802===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fix for Windows 8 issue where only &#039;Uninitialized Phidget Handle&#039; would show up in the Manager, and Phidgets could not be opened.&lt;br /&gt;
===2.1.8.20130723===&lt;br /&gt;
*Improvement to java: we don&#039;t attach/detach our native threads for each event, just one attach, then detach before the thread exits.&lt;br /&gt;
**This increases performance, esp. when debugging on Android.&lt;br /&gt;
*Improvement to Android: We reuse the UsbRequest object rather then creating a new one for each transfer. This reduces logcat messages tremendously, and increases performance.&lt;br /&gt;
===2.1.8.20130710===&lt;br /&gt;
*Android-only release&lt;br /&gt;
**Added extra android target architectures: x86, MIPS, armeabi-v7a&lt;br /&gt;
===2.1.8.20130618===&lt;br /&gt;
*Changed setCompassCorrectionParameters() API call so that compass calibration parameters are written out to non-volatile storage on 1042/1044, so that they persist across power cycles. Previously, calibration data would need to be re-programmed at each attach.&lt;br /&gt;
*Changes to C# Spatial example:&lt;br /&gt;
**Compass calibration parameter set dialog removed from for 1042/1044 because parameters are set by the calibration software - and thus do not need setting in the example.&lt;br /&gt;
**Stores/restores parameters for 1056 based on serial number, so multiple different calibrations can be maintained.&lt;br /&gt;
===2.1.8.20130607===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to compass calibration software for 1042/1044&lt;br /&gt;
===2.1.8.20130419===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed setCompassCorrectionParameters in the COM library&lt;br /&gt;
===2.1.8.20130327===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Changed Windows installer to stop virus-scanner false positives&lt;br /&gt;
**Dropped support for Windows 2000&lt;br /&gt;
===2.1.8.20130320===&lt;br /&gt;
*Added EPHIDGET_NOTFOUND exception to Dictionary.getKey() for when the key is not found.&lt;br /&gt;
*Added exceptions back into the Java library - they have been missing since 2.1.8.20121015 release.&lt;br /&gt;
===2.1.8.20130313===&lt;br /&gt;
*Updates to Matlab support&lt;br /&gt;
**Works properly on Matlab 7+, on Windows, Mac, Linux without needing changes to .m files.&lt;br /&gt;
===2.1.8.20130221===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Encoder Index event added to C and .NET libraries&lt;br /&gt;
===2.1.8.20121218===&lt;br /&gt;
*Webservice version: 1.0.10&lt;br /&gt;
**Support for 1024, 1032&lt;br /&gt;
*Support for 1024, 1032&lt;br /&gt;
*fixed bug where if one half of a composite device is open, and PHIDGET_USB_ERROR_FLAG gets set, the device may never re-attach.&lt;br /&gt;
===2.1.8.20121015===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support for new pressure/light sensors in example.&lt;br /&gt;
===2.1.8.20120914===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Improved firmware upgrading in control panel - it was giving some false-errors on some machines.&lt;br /&gt;
===2.1.8.20120912===&lt;br /&gt;
*Fixed bug where 1065 could fail to attach when opened over webservice&lt;br /&gt;
*Fixed bug where close() could deadlock on Phidgets opened over the webservice&lt;br /&gt;
*Changed LED64 LED Brightness from int to double&lt;br /&gt;
**this may cause issues when controlling the LED64 over the webservice and library/webservice are not the same version&lt;br /&gt;
**the old setDiscreteLED call will remain, deprecated, with an int argument for compatibility.&lt;br /&gt;
===2.1.8.20120716===&lt;br /&gt;
*Linux-Only Release&lt;br /&gt;
**Fixed a bug where opening a device in two program at once would cause an attach-detach cycle as they fight each other for control.&lt;br /&gt;
===2.1.8.20120713===&lt;br /&gt;
*Mac-Only Release&lt;br /&gt;
**Added signing of the Mac installer, so Mountain Lion (OS X 10.8) doesn&#039;t refuse to run it.&lt;br /&gt;
===2.1.8.20120615===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that caused java to crash on events introduced in 2.1.8.20120612&lt;br /&gt;
===2.1.8.20120612===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed another bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120606===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120525===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed PhidgetIR sendRawData bug in .NET on 64-bit machines.&lt;br /&gt;
===2.1.8.20120514===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed a bug that causes a segfault with libusb-1.0 under 64-bit Linux.&lt;br /&gt;
===2.1.8.20120507===&lt;br /&gt;
*Mac/Linux-only release&lt;br /&gt;
**Fixes a setLabel bug introduced in 2.1.8.20120503&lt;br /&gt;
===2.1.8.20120503===&lt;br /&gt;
*Fixed some spelling mistakes&lt;br /&gt;
*Moved to libusb-1.0&lt;br /&gt;
**This resolves a bug where having a webcam plugged in caused a memory leak in the webservice.&lt;br /&gt;
*Fixed bug with advanced servo where setting acceleration to accelerationMax would cause an exception for some servo types&lt;br /&gt;
===2.1.8.20120216===&lt;br /&gt;
*Fixed bug with RFID Reader on OS X and Linux, as well as .NET over the webservice&lt;br /&gt;
*Fixed bug that could cause the Java Phidget Manager to crash during garbage collection.&lt;br /&gt;
===2.1.8.20120131===&lt;br /&gt;
*Fixed RFID Reader bug that caused tag event to not get thrown in .NET Applications&lt;br /&gt;
*Changed compass bearing calculations in spatial C# example&lt;br /&gt;
===2.1.8.20120123===&lt;br /&gt;
*Added support for 1061 v300+&lt;br /&gt;
*Fixed a bug where the firmware version could be mis-reported over Bonjour&lt;br /&gt;
===2.1.8.20111220===&lt;br /&gt;
*Fixed a bug in AppleScript where closing a Phidget opened via label would give a &#039;Connection Invalid&#039; error.&lt;br /&gt;
*Fixed a bug where the webservice may fail to start on Linux systems that don&#039;t support IPv6 (ie. SBC2).&lt;br /&gt;
*Fixed issue where ratiometric state on newest interfacekit wouldn&#039;t be read back properly if it was false during attach.&lt;br /&gt;
*Fixed webservice issue where ratiometric state would not be reported properly for newest interfacekits&lt;br /&gt;
*Increased the number of overrun errors ignored during initial attach for InterfaceKit.&lt;br /&gt;
*Fixed an issue with the iPhone library and header&lt;br /&gt;
===2.1.8.20111219===&lt;br /&gt;
*fixed various other webservice stability/performance/memory leak bugs&lt;br /&gt;
*Faster connection to SBC-connected Phidgets from Mac OS&lt;br /&gt;
*Don&#039;t report packetlost or overrun errors that happen during early initialization - these are just noise.&lt;br /&gt;
*Fixed a bug in the webservice tree removal function that could cause memory leaks.&lt;br /&gt;
*Fixed bug where Webservice would crash on Linux if the chosen serverID was already under use on the network&lt;br /&gt;
*Stopped sending hardware Error Events before the Attach event - they are now queued up and sent after Attach&lt;br /&gt;
*Fixed a crash in the [[Phidget Control Panel]]&lt;br /&gt;
*Added ability to remove dictionary keys from a key change listener&lt;br /&gt;
*Reduced the number of false &#039;pending command not finished&#039; error events on Close()&lt;br /&gt;
*Fixed a webservice bug where exceptions/false attach events could occur when close() is called soon after open&lt;br /&gt;
*Fixed bug where closing a PhidgetRFID soon after attach could cause a crash&lt;br /&gt;
*Fixed webservice but on MacOS where client could exit with SIG_PIPE error&lt;br /&gt;
*Fixed webservice bug where the server would sometimes exit(1) after many connect/disconnect cycles&lt;br /&gt;
*Fixed webservice bug where client could deadlock during close()&lt;br /&gt;
*Fixed webservice bug where opening a single remote phidget multiple times from the same application would fail&lt;br /&gt;
*Fixed a webservice bug where sockets weren&#039;t being closed properly sometimes&lt;br /&gt;
*Fixed a webservice bug where pre-attach error events wouldn&#039;t get through&lt;br /&gt;
*Fixed a bug where the webservice running on Linux would stop responding to clients after ~300 connect/disconnect cycles&lt;br /&gt;
*Fixed bug where a Phidget would become inaccessible until the app is restarted if a thread creation failed&lt;br /&gt;
*Fixed webservice bug where connect is slow on Windows when multiple clients are running simultaneously&lt;br /&gt;
*Fixed webservice bug where authentication would fail on a valid password&lt;br /&gt;
*Fixed webservice bug where attach may never happen, and would require a close()/open()&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20111121===&lt;br /&gt;
*Added support for new servo types to all libraries&lt;br /&gt;
*Fixed min/max position/velocity causing invalid arg exception on servo/advservo&lt;br /&gt;
*IPv6 support on MacOS&lt;br /&gt;
*Fixed some memory leaks&lt;br /&gt;
*Fixed hostname lookup issue on Mac OS with Back To My Mac enabled.&lt;br /&gt;
===2.1.8.20111028===&lt;br /&gt;
*Fixed Applescript bugs and released examples&lt;br /&gt;
*Added openLabel to .NET, Java, COM&lt;br /&gt;
*Setting change trigger to 0 on interfacekit will not set event mode.&lt;br /&gt;
**Previously setting change trigger to 0 after setting data rate would supersede the data rate setting, which is probably unexpected.&lt;br /&gt;
===2.1.8.20110630 - MacOS Only===&lt;br /&gt;
*handle USB bug introduced in MacOS 10.6.8&lt;br /&gt;
===2.1.8.20110615===&lt;br /&gt;
*Added error event when trying to open Phidgets with an unsupported version&lt;br /&gt;
===2.1.8.20110614 - Windows Only===&lt;br /&gt;
*Fixed bug in C# Spatial example&lt;br /&gt;
*Added support for negative gains in 1056&lt;br /&gt;
===2.1.8.20110601 - MacOS Only===&lt;br /&gt;
*Fixed AppleScript issues&lt;br /&gt;
===2.1.8.20110527===&lt;br /&gt;
*Fixed AS3.0 library (Flash/Flex) - wouldn&#039;t connect to webservice as of last release&lt;br /&gt;
*Fixed bug where webservice doesn&#039;t release a closed Phidget&lt;br /&gt;
*Fixed bug where devices that don&#039;t support label didn&#039;t show up on MacOS&lt;br /&gt;
*Fixed iPhone library issues&lt;br /&gt;
===2.1.8.20110524===&lt;br /&gt;
*AppleScript support added&lt;br /&gt;
*fixed problem with Spatial in .NET on 64-bit Windows&lt;br /&gt;
*Added remote setLabel to mac preference pane.&lt;br /&gt;
*fixed a bug where label characters 7,8,9 would be read back corrupted on certain devices.&lt;br /&gt;
**labels &amp;gt;7 characters that exhibit this bug will now be truncated to 7 characters when being read back&lt;br /&gt;
**call setLabel again using this library or newer to support 10 character labels.&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to &amp;lt;=7 characters on these devices.&lt;br /&gt;
*fixed bug on MacOS where serial number and/or label strings could be read wrong.&lt;br /&gt;
*better support for recovering misbehaving devices in Linux&lt;br /&gt;
*fixed a deadlock on linux when Avahi is installed but not running&lt;br /&gt;
*clear list of attached devices when closing remote manager&lt;br /&gt;
*Added support for Unicode labels&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to ASCII.&lt;br /&gt;
*Added open by label&lt;br /&gt;
*Webservice protocol version up to 1.0.9 (for open by label)&lt;br /&gt;
*Made opening multiple device is one application faster.&lt;br /&gt;
*TextLCD changes:&lt;br /&gt;
**cursor is disabled while writing to the display or setting a custom character to prevent display artifacts&lt;br /&gt;
**cursor is disabled when a full line is written so it doesn&#039;t go to the start of another line&lt;br /&gt;
**1204 should be stable&lt;br /&gt;
**setDisplayCharacter supports 0x00-0xff&lt;br /&gt;
*stopped property reflected more accurately in the C# stepper example&lt;br /&gt;
*Added error events to mac examples&lt;br /&gt;
===2.1.8.20110329 - Windows only===&lt;br /&gt;
*Fixed problem with control panel encoder example where enable wouldn&#039;t work&lt;br /&gt;
*Fixed issue with SpatialData, GPSPositionChange, PHChange and WeightChange events in Labview 64-bit&lt;br /&gt;
===2.1.8.20110322===&lt;br /&gt;
*Fixed [[Phidget Control Panel]] memory leak when Bonjour in installed but not running&lt;br /&gt;
*Fixed current sense formula on 1061_0 v200&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetAdvancedServo&lt;br /&gt;
*Fixed bug in old PhidgetTemperatureSensor&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20110310===&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetServo&lt;br /&gt;
*Fixed some Labview bugs&lt;br /&gt;
*Added some Java and VB.NET examples&lt;br /&gt;
===2.1.8.20110301===&lt;br /&gt;
*Full Support for 1002, 1011, 1040, 1046, 1054, 1065, 1204&lt;br /&gt;
*New webservice version - 1.0.8&lt;br /&gt;
**Support for new devices&lt;br /&gt;
**Support for error events&lt;br /&gt;
===2.1.7.20110203===&lt;br /&gt;
*fixed crash on close of remote Phidget on MacOS&lt;br /&gt;
*C# ifkit example bugfix - crashed on 1015/1016&lt;br /&gt;
*webservice improvements&lt;br /&gt;
*Switch to IP address for SBC config in browser&lt;br /&gt;
*Faster IP lookup for SBCs in control panel&lt;br /&gt;
===2.1.7.20101222 / 2.1.7.20101223===&lt;br /&gt;
*fixed getServerID on Linux&lt;br /&gt;
*removed report ack&lt;br /&gt;
**this was causing some bad side effects&lt;br /&gt;
*manual .local lookups on Windows&lt;br /&gt;
**much faster then letting Windows do it itself&lt;br /&gt;
*Support for new Labview library&lt;br /&gt;
*Fixed PhidgetIR bug where library would crash if repeat code is longer then IR_MAX_REPEAT_LENGTH&lt;br /&gt;
===2.1.7.20101103===&lt;br /&gt;
*Decreased Phidget Webservice event latency on Windows&lt;br /&gt;
*Preliminary support for 1002, 1011, 1040, 1045, 1046, 1054, 1065, 1204 (C, .NET)&lt;br /&gt;
*Webservice version updated to 1.0.7&lt;br /&gt;
**support for 1045, 1011, 1204&lt;br /&gt;
*Fixed a bug where webservice connections could be unexpectedly lost&lt;br /&gt;
*Bugfix: couldn&#039;t set interfacekit data rate over webservice.&lt;br /&gt;
*Fixed some memory leaks in the Mac library&lt;br /&gt;
*Fixed bug where blocking for &amp;gt;2 seconds in an events handler when opening remotely could cause a crash.&lt;br /&gt;
===2.1.7.20100803===&lt;br /&gt;
*Windows only release&lt;br /&gt;
*fixed setLabel in WindowsCE&lt;br /&gt;
*fixed getHashCode in .NET library - needed for working with Phidgets in Labview via .NET&lt;br /&gt;
===2.1.7.20100621===&lt;br /&gt;
*Linux only release - autotools updates&lt;br /&gt;
**call ldconfig automatically&lt;br /&gt;
**remove old phidget21 library (pre-autotools) when installing new one.&lt;br /&gt;
===2.1.7.20100620===&lt;br /&gt;
*Linux only release - added version.sh for autoreconf&lt;br /&gt;
===2.1.7.20100618===&lt;br /&gt;
*Linux only release - added udev/hotplug files&lt;br /&gt;
===2.1.7.20100617===&lt;br /&gt;
*Linux only release&lt;br /&gt;
*Transitioned to autotools in linux for phidget21 / webservice&lt;br /&gt;
*phidget21 library and webservice are now separate downloads&lt;br /&gt;
===2.1.7.20100525===&lt;br /&gt;
*full support for PhidgetSpatial and PhidgetIR in all libraries&lt;br /&gt;
*fixed 1031 not attaching in AS3.0&lt;br /&gt;
*Better error messages in JNI&lt;br /&gt;
*Updated error codes, device ID/Class lists in Java, Flash, COM, etc.&lt;br /&gt;
*Fixed TemperatureSensor version 200,201,202 bug - ambient sensor would not report negative temperatures.&lt;br /&gt;
*Revised temperaturesensor API to report tempMin/tempMax and errors more accurately.&lt;br /&gt;
*Added initial events for encoder digital inputs&lt;br /&gt;
*full support for 1047&lt;br /&gt;
*Added new device support to WindowsCE&lt;br /&gt;
*Updated mac examples for 1047, 1048&lt;br /&gt;
===2.1.6.20100504===&lt;br /&gt;
*Windows only Release&lt;br /&gt;
**Added 1131 and 1132 to InterfaceKit example in MSI&lt;br /&gt;
===2.1.6.20100428===&lt;br /&gt;
*limit data rate maximum to 16ms over the webservice for devices that expose dataRate (InterfaceKit, Spatial)&lt;br /&gt;
*fixed bug where TextLCD 8/8/8 would stay in Bonjour list after webservice is shutdown&lt;br /&gt;
*set/get Brightness for 1203_2&lt;br /&gt;
*Support 1048 in C# example&lt;br /&gt;
*webservice version incremented to 1.0.6&lt;br /&gt;
**TextLCD set/get brightness&lt;br /&gt;
**PhidgetIR support&lt;br /&gt;
**PhidgetSpatial support&lt;br /&gt;
**1047 support (enable, index)&lt;br /&gt;
===2.1.6.20100406===&lt;br /&gt;
*Support for 1018_2 (dataRate)&lt;br /&gt;
*Webservice version incremented to 1.0.5&lt;br /&gt;
===2.1.6.20100401===&lt;br /&gt;
*Updated InterfaceKit example with new sensors&lt;br /&gt;
*make Windows connect cancelable&lt;br /&gt;
*make pending zeroconf lookups cancelable during close&lt;br /&gt;
===2.1.6.20100318===&lt;br /&gt;
*Mac only release&lt;br /&gt;
**Added WillSleep and Wakeup events to give user control of Phidgets immediately before and after a system sleep (MacOS Only).&lt;br /&gt;
===2.1.6.20100317===&lt;br /&gt;
*Windows only release&lt;br /&gt;
**Some of the examples were being built using an out of date .NET library&lt;br /&gt;
===2.1.6.20100310===&lt;br /&gt;
*MaxMSP fix - 2.1.6.20100126 introduced a bug for some Phidgets where openremote/open by serial didn&#039;t work and MaxMSP would sometimes crash.&lt;br /&gt;
**No code changes to any of the other libraries.&lt;br /&gt;
===2.1.6.20100304===&lt;br /&gt;
*stopped property changes trigger events over webservice so they are noticed.&lt;br /&gt;
**more compatible with how local open works&lt;br /&gt;
*added 5 new servos&lt;br /&gt;
*fixed bug where remote close would not set detached so a subsequent open would not always connect.&lt;br /&gt;
*handle UninitializeZeroconf better - shut down thread before closing handles, fixes hang on SBC&lt;br /&gt;
*fixed bug on Mac where detaching 2 or more Phidgets at the same time caused a crash&lt;br /&gt;
*fixed close blocking because of a pending connect (mac, linux)&lt;br /&gt;
*Final support for 1031 in all libraries.&lt;br /&gt;
===2.1.6.20100129===&lt;br /&gt;
*Implemented initial events in Flash&lt;br /&gt;
**Flash behaviour should now be identical to C library local and remote.&lt;br /&gt;
*Fix RFID issue where close could cause crash&lt;br /&gt;
*increment webservice version to 1.0.4&lt;br /&gt;
*fixed RFID remote open&lt;br /&gt;
**Flash would never get an attach event if the reader had been previously opened&lt;br /&gt;
**Initial tag event would not be fired when a tag was present and the antenna was enabled prior to open&lt;br /&gt;
*fixed openRemote failing on Mac&lt;br /&gt;
*fixed deadlock in webservice which could be hit by opening/closing a device over and over again.&lt;br /&gt;
*fixed bug in stepper, which caused seg fault on SBC on position change events.&lt;br /&gt;
===2.1.6.20100126===&lt;br /&gt;
*added network open support in Max/MSP&lt;br /&gt;
===2.1.6.20100115===&lt;br /&gt;
*Increased network performance for Linux/MacOS&lt;br /&gt;
*Added five servo types&lt;br /&gt;
===2.1.6.20091215===&lt;br /&gt;
*Fixed busy loop in Linux openRemote&lt;br /&gt;
*JNI Library relocated to /Library/Java/Extensions on MacOS&lt;br /&gt;
===2.1.6.20091211===&lt;br /&gt;
*Heartbeat now works on Linux as well (had to make sockets non-blocking)&lt;br /&gt;
===2.1.6.20091130===&lt;br /&gt;
*Added heartbeat to webservice (client side)&lt;br /&gt;
**Better detects network failures by using active polling timeouts&lt;br /&gt;
*Fixed 0/8/8 over webservice&lt;br /&gt;
===2.1.6.20091020===&lt;br /&gt;
*Fixed 1052 counting issue on 1070 (-1 reported as 255)&lt;br /&gt;
*Fixed issue where Phidget21 would try to reinstall from a limited user account or when the Control Panel was disabled.&lt;br /&gt;
*64-bit kernel support in Snow Leopard&lt;br /&gt;
===2.1.6.20090928===&lt;br /&gt;
*Support for PhidgetSBC (1070)&lt;br /&gt;
*zeroconf can handle starting up before the mdns daemon, and will keep trying to connect.&lt;br /&gt;
*fixed 1066 not showing up on Mac&lt;br /&gt;
*added advanced servo example to mac pref pane&lt;br /&gt;
*implemented proper error handling in COM&lt;br /&gt;
**default behavious remains the same, enable proper error handling with &#039;EnableVerboseErrors&#039;&lt;br /&gt;
*implemented error events in Java&lt;br /&gt;
===2.1.6.20090917===&lt;br /&gt;
*Updated webservice protocol version to 1.0.3&lt;br /&gt;
*Fixed stepper under AS3.0&lt;br /&gt;
*added setServoType, getServoType, setServoParameters to PhidgetServo and PhidgetAdvancedServo&lt;br /&gt;
*possible race condition fixed in webservice (pdictclient.c:907)&lt;br /&gt;
===2.1.6.20090902 (mac only release)===&lt;br /&gt;
*Support MacOSX 10.6, drop support for 10.3.9, require 10.4 or newer&lt;br /&gt;
**Fully 64-bit compliant, library supports ppc, i386, x86_64&lt;br /&gt;
===2.1.6.20090806===&lt;br /&gt;
*Added 1049 support&lt;br /&gt;
*Fixed RFID tag events over webservice&lt;br /&gt;
===2.1.6.20090804===&lt;br /&gt;
*Added 1051_2 support&lt;br /&gt;
*Fixed various small initialization issues - stepper, adv servo, rfid&lt;br /&gt;
*Added 32-bit library install to 64-bit installer&lt;br /&gt;
**VB6.0, etc. need the 32-bit COM library on 64-bit windows&lt;br /&gt;
===2.1.6.20090717===&lt;br /&gt;
*?&lt;br /&gt;
===2.1.6.20090708===&lt;br /&gt;
*Added DeviceID to zeroconf&lt;br /&gt;
*fixed RFID.LastTag in .NET&lt;br /&gt;
*Changed the error codes returned by error events; error events now have their own set of error codes rather then sharing the function return codes.&lt;br /&gt;
*Added support for 1047, 1048&lt;br /&gt;
*Added error event codes rather then trying to reuse the EPHIDGET return codes.&lt;br /&gt;
*fixed TextLCD issue where display could get corrupted during a detach/attach&lt;br /&gt;
*made mac more reliable on attach&lt;br /&gt;
*more error logging on mac&lt;br /&gt;
===2.1.6.20090525===&lt;br /&gt;
*fixed RFID not attaching via webservice if a tag is present.&lt;br /&gt;
*bugfix related to double free on detach event.&lt;br /&gt;
*Implemented getKey&lt;br /&gt;
*Added MIPS II support to Windows CE&lt;br /&gt;
===2.1.6.20090430===&lt;br /&gt;
*Added ActiveX interface to COM library&lt;br /&gt;
*Added stepper and advancedServo to Flex .swc library&lt;br /&gt;
===2.1.6.20090417===&lt;br /&gt;
*added PhidgetIR prototype support to C library&lt;br /&gt;
*properly handles sleeping on OSX&lt;br /&gt;
*fixed some webservice field initializations in Flash and C&lt;br /&gt;
*fixed security exceptions in [[Phidget Control Panel]] under Vista&lt;br /&gt;
*added [[Phidget Control Panel]] to start menu&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090318 (Examples/AS3.0 only release)===&lt;br /&gt;
*Fixed AdvancedServo in Flash - wouldn&#039;t attach&lt;br /&gt;
===2.1.6.20090317===&lt;br /&gt;
*[[Phidget Control Panel]] properly supports Vista UAC and Limited user accounts in XP, etc.&lt;br /&gt;
*Added 64-bit release of Phidget21.msi for Windows&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090312===&lt;br /&gt;
*added 1064, 1059 to WindowsCE&lt;br /&gt;
*fixed opening 1051 over webservice&lt;br /&gt;
*fixed opening 1015/1016 over webservice broken in last release&lt;br /&gt;
===2.1.6.20090302===&lt;br /&gt;
*Advanced servo bugfix: stopped would stop being true if min/max was set to exclude current position.&lt;br /&gt;
*linux USB improvements when many Phidgets are attached and opened at once.&lt;br /&gt;
*1031 support in phidget21, webservice, .NET - hidden until product release&lt;br /&gt;
**CPhidgetLED_setVoltage&lt;br /&gt;
**CPhidgetLED_getVoltage&lt;br /&gt;
**CPhidgetLED_setCurrentLimit&lt;br /&gt;
**CPhidgetLED_getCurrentLimit&lt;br /&gt;
*unknown timechange == PUNK_INT in encoder position change event&lt;br /&gt;
**1st position change event&lt;br /&gt;
**&amp;gt; 30 seconds time change&lt;br /&gt;
*AS3 updates&lt;br /&gt;
**updated to 1.0.2 webservice&lt;br /&gt;
**encoder position change events report relative change rather then absolute position&lt;br /&gt;
**encoder adds getTimeChange function for timing encoder changes&lt;br /&gt;
*webservice updated to 1.0.2&lt;br /&gt;
**Authorization is asynchronous&lt;br /&gt;
**Doesn&#039;t match the old version checking, so errors will not be nice when trying to connect to an old webservice&lt;br /&gt;
**Sends out all initial data, so it&#039;s just like opening locally&lt;br /&gt;
**supports interfacekit Raw sensor value&lt;br /&gt;
**supports labels on remoteIP managers&lt;br /&gt;
*avahi bugfix&lt;br /&gt;
*webservice more stable against forcefully closed clients&lt;br /&gt;
*closing a network Phidget won&#039;t block - ever.&lt;br /&gt;
**no longer using quit, just closing the socket&lt;br /&gt;
*added libavahi-client.so.3 reference to linux library.&lt;br /&gt;
*Fixed bug with opening one phidget with serial and no serial at the same time over the webservice&lt;br /&gt;
===2.1.5.20090105===&lt;br /&gt;
*[[Phidget Control Panel]] stability improvements&lt;br /&gt;
*added CPhidgetSBC_getHostname&lt;br /&gt;
*advanced servo 1 motor current sense equation - support should now be complete&lt;br /&gt;
*webservice and network code bugfixes - crash / deadlock during close, problems with concurrent connections, etc.&lt;br /&gt;
*fixed close on remote and remoteIP managers&lt;br /&gt;
*name of RFID changed from &amp;quot;Phidget RFID 4-output&amp;quot; to &amp;quot;Phidget RFID 2-output&amp;quot; - updated anything referencing old name.&lt;br /&gt;
&lt;br /&gt;
===2.1.5.20081023===&lt;br /&gt;
*added advanced servo and stepper examples to VB6.0, VB.NET and C&lt;br /&gt;
*added deviceClass and deviceID&lt;br /&gt;
*updated Mac examples&lt;br /&gt;
*webservice protocol version enforcement&lt;br /&gt;
*internal fix/rework of device id&#039;s etc.&lt;br /&gt;
*Fixed memory leaks in webservice and phidget21 network code.&lt;br /&gt;
*Dictionary and network stability improvements.&lt;br /&gt;
*duplicate calls to open or close are now silently ignored.&lt;br /&gt;
===2.1.4.20080924===&lt;br /&gt;
*Old TextLCD 0/8/8&#039;s can now have both halves open at the same time on Windows&lt;br /&gt;
*fixed bug with composite devices on linux&lt;br /&gt;
*fixed manager on linux to better deal with unique devices&lt;br /&gt;
===2.1.4.20080922===&lt;br /&gt;
*Updated Delphi files&lt;br /&gt;
*TextLCD can display 0x80-0xFF characters from Java&lt;br /&gt;
*getAttachedDevices works for mdns managers&lt;br /&gt;
*fixed a deadlock in the webservice&lt;br /&gt;
*better network error handling / password support for windows C# examples&lt;br /&gt;
*waitForAttachment will return EPHIDGET_CLOSED if the handle is closed while it is waiting.&lt;br /&gt;
*added EPHIDGET_CLOSED&lt;br /&gt;
*joining central threads checks whether they are trying to be joined by themselves first (avoid deadlocks).&lt;br /&gt;
*changed context of error event to be free from locks (can call close, open, etc. from them).&lt;br /&gt;
===2.1.4.20080821===&lt;br /&gt;
*zeroconf threads exit cleanly on last _close (apple zeroconf)&lt;br /&gt;
*Added advanced servo and stepper to Max&lt;br /&gt;
===2.1.4.20080811 (mac only release)===&lt;br /&gt;
*Fixed manager on Mac (wasn&#039;t working at all since 2.1.4.20080808)&lt;br /&gt;
===2.1.4.20080808===&lt;br /&gt;
*added CPhidgetSBC and CPhidgetSBCManager to the c library - these interfaces are hidden from users and meant to be used internally (for now).&lt;br /&gt;
*CPhidgetManager_open no longer blocks to send out initial attach events. These initial events are sent from the CentralThread context like all other attach events.&lt;br /&gt;
*fixed CThread_wait_on_event on Linux&lt;br /&gt;
*added CPhidgetGeneric interface for prototyping to C, .NET libraries. product ID is 0x99. These are only visible in debug releases, only to be used internally.&lt;br /&gt;
===2.1.4.20080715===&lt;br /&gt;
*udev rules fixed for product IDs with alpha-hex values&lt;br /&gt;
*blocking in an attach event does not block calls to open anymore&lt;br /&gt;
*RFID tag event handlers can now handle blocking - tag lost is timed after the tag handler exits.&lt;br /&gt;
===2.1.4.20080623===&lt;br /&gt;
*Flex .swc library was out of sync&lt;br /&gt;
*fixed CPhidgetManager_getAttachedDevices for network managers&lt;br /&gt;
*Added CPhidgetManager_freeAttachedDevicesArray&lt;br /&gt;
===2.1.4.20080613===&lt;br /&gt;
*Max/MSP RFID fixed&lt;br /&gt;
*0/0/8 and advanced servo added to CE&lt;br /&gt;
*fixed flash policy file server in webservice&lt;br /&gt;
*webservice with password and asynchronous together work now&lt;br /&gt;
===2.1.4.20080602===&lt;br /&gt;
*phidget21.h -&amp;gt; phidget21int.h so as not to be confused with generated phidget21.h&lt;br /&gt;
*some changes to Makefile fro crosscompiling&lt;br /&gt;
*no more vbscript in msi&lt;br /&gt;
===2.1.4.20080513===&lt;br /&gt;
*removed long long from COM - not supported by VB6.0&lt;br /&gt;
*added LastTag to RFID in .NET&lt;br /&gt;
===2.1.4.20080428===&lt;br /&gt;
*support Mac OS X 10.3.9 again&lt;br /&gt;
*Rev up to 2.1.4&lt;br /&gt;
*finalize Phidget Stepper API - Phidget Stepper requires 2.1.4 as a minimum&lt;br /&gt;
*fixed serverConnect and serverDisconnect handlers for manager and dictionary in COM&lt;br /&gt;
*Changed:&lt;br /&gt;
**PhidgetStepper and PhidgetAdvancedServo&lt;br /&gt;
***MotorPosition -&amp;gt; Position&lt;br /&gt;
***MotorOn -&amp;gt; Engaged&lt;br /&gt;
***MotorStopped -&amp;gt; Stopped&lt;br /&gt;
*Added:&lt;br /&gt;
**CPhidgetStepper_getCurrentLimit&lt;br /&gt;
**CPhidgetEncoder_getPosition&lt;br /&gt;
**CPhidgetEncoder_setPosition&lt;br /&gt;
**CPhidgetMotorControl_getVelocity&lt;br /&gt;
**CPhidgetMotorControl_setVelocity&lt;br /&gt;
**CPhidgetMotorControl_set_OnVelocityChange_Handler&lt;br /&gt;
**CPhidgetServo_setEngaged&lt;br /&gt;
**CPhidgetServo_getEngaged&lt;br /&gt;
**CPhidgetServo_getPosition&lt;br /&gt;
**CPhidgetServo_setPosition&lt;br /&gt;
**CPhidgetServo_set_OnPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getPositionMax&lt;br /&gt;
**CPhidgetServo_getPositionMin&lt;br /&gt;
**Count functions&lt;br /&gt;
*Deprecated:&lt;br /&gt;
**CPhidgetEncoder_getEncoderPosition&lt;br /&gt;
**CPhidgetEncoder_setEncoderPosition&lt;br /&gt;
**CPhidgetMotorControl_getMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_setMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_set_OnMotorChange_Handler&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorPosition&lt;br /&gt;
**CPhidgetServo_setMotorPosition&lt;br /&gt;
**CPhidgetServo_set_OnMotorPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**Num functions&lt;br /&gt;
*Added ability to deprecate funcitons in the C library - compiler will issue a warning when they are used.&lt;br /&gt;
*added names to some arguments in phidget21.h&lt;br /&gt;
*fixes to the webservice for initial state stuff - now it behaves almost like non-webservice, with guaranteed initial events, but we don&#039;t guarantee initial state in the attach event yet. Min/Max, Num motors, inputs, etc. are all guaranteed in the attach handler.&lt;br /&gt;
*Finalized support for Phidget Stepper&lt;br /&gt;
===2.1.3.20080402===&lt;br /&gt;
*Fixed windows BUG - Device Type was showing up wrong&lt;br /&gt;
*CPhidgetStepper_getPosition -&amp;gt; CPhidgetStepper_getCurrentPosition&lt;br /&gt;
===2.1.3.20080327===&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorStopped&lt;br /&gt;
*changes to API&lt;br /&gt;
**CPhidgetStepper_setMotorPosition -&amp;gt; CPhidgetStepper_setTargetMotorPosition&lt;br /&gt;
**added CPhidgetStepper_getTargetMotorPosition&lt;br /&gt;
**Stepper MotorSpeed -&amp;gt; Velocity&lt;br /&gt;
**Stepper and AdvancedServo MaxVelocity -&amp;gt; VelocityLimit&lt;br /&gt;
*add waitForAttachment to COM&lt;br /&gt;
*COM getbool (not indexed) will now return FALSE on false (rather then always returning true)&lt;br /&gt;
*fixed write thread timeouts - was setting attached after starting write thread so write thread would see a detached device and exit immediately&lt;br /&gt;
===2.1.3.20080206===&lt;br /&gt;
*changed long long to __int64, to be happy in borland C++&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetStepper_getMaxMotorSpeed&lt;br /&gt;
**CPhidgetStepper_setMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorStopped&lt;br /&gt;
**CPhidgetStepper_setCurrentMotorPosition&lt;br /&gt;
*removed CPhidgetStepper_setVelocity&lt;br /&gt;
*added CPhidgetStepper_setMaxVelocity, CPhidgetStepper_getMaxVelocity&lt;br /&gt;
===2.1.3.20080114===&lt;br /&gt;
*Added new functions to Flash API&lt;br /&gt;
*Added new functions to Webservice Protocol&lt;br /&gt;
*Added new functions to COM Library&lt;br /&gt;
*Added new functions to Java Library&lt;br /&gt;
*All device fiels in C library cleaned up and made consistent&lt;br /&gt;
*Open in windows is exclusive - this needs to be tested for stability&lt;br /&gt;
*No data will be returned / accepted if it lies outside of max/min range&lt;br /&gt;
*if a data value is unknown, user variable is set to PUNK_INT, PUNK_DBL, or PUNK_BOOL, and return value is EPHIDGET_UNKNOWNVAL&lt;br /&gt;
*Proper Device initializations on Attach:&lt;br /&gt;
**triggers are set to defaults on attach&lt;br /&gt;
**device state is read in and preserved on attach&lt;br /&gt;
**during attach event, all sensor data, etc. is provided if available&lt;br /&gt;
**no data events until after the attach event returns&lt;br /&gt;
**everything initialized by the time waitForAttachment returns&lt;br /&gt;
**after attach event returns, a full set of initial state data events are thrown&lt;br /&gt;
*.NET collections are readonly, and never NULL (but empty when phidget detached)&lt;br /&gt;
*.NET callbacks no longer catch and hide all exceptions&lt;br /&gt;
**make sure to use try/catch blocks especially in Attach when accessing properties that may not be initialized.&lt;br /&gt;
*added min/max functions:&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMax&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMax&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMax&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMax&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMin&lt;br /&gt;
**CPhidgetPHSensor_getPHMax&lt;br /&gt;
**CPhidgetPHSensor_getPHMin&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMax&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMin&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetStepper_getAccelerationMax&lt;br /&gt;
**CPhidgetStepper_getAccelerationMin&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMax&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMin&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMax&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMin&lt;br /&gt;
*Added functions:&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperature&lt;br /&gt;
**CPhidgetTemperatureSensor_getThermocoupleType&lt;br /&gt;
**CPhidgetTemperatureSensor_setThermocoupleType&lt;br /&gt;
**CPhidget_set_OnServerConnectHandler&lt;br /&gt;
**CPhidget_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_getServerID&lt;br /&gt;
**CPhidgetDictionary_getServerAddress&lt;br /&gt;
**CPhidgetDictionary_getServerStatus&lt;br /&gt;
**CPhidgetManager_getServerID&lt;br /&gt;
**CPhidgetManager_getServerAddress&lt;br /&gt;
**CPhidgetManager_getServerStatus&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
*Removed functions:&lt;br /&gt;
**CPhidgetServo_setMotorOff&lt;br /&gt;
*TemperatureSensor:&lt;br /&gt;
**Ambient sensor is accessed with it&#039;s own function&lt;br /&gt;
**first thermocouple is Index 0 everywhere&lt;br /&gt;
**no ambient sensor events&lt;br /&gt;
*getServerID is implemented&lt;br /&gt;
*changed the internal network structure (added CPhidgetRemote)&lt;br /&gt;
*reworked the USB code (mostly on Windows)&lt;br /&gt;
**Better handles closing, ESD events, timeouts&lt;br /&gt;
**fixed issues with Encoder, RFID stopping reading after a certain time.&lt;br /&gt;
**added USB error flag&lt;br /&gt;
*openRemote functions have been implemented&lt;br /&gt;
**these require bonjour (mac / windows) or avahi (linux) to be installed on both the client and server&lt;br /&gt;
**if they are not, you get EPHIDGET_UNSUPPORTED when you call them&lt;br /&gt;
*openRemoteIP functions are asynchronous and persistent&lt;br /&gt;
*include cphidgetconstants.h in phidget21.h for users&lt;br /&gt;
===2.1.2.20071108===&lt;br /&gt;
*start of chagelog&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=24125</id>
		<title>OS - Phidget SBC</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=24125"/>
		<updated>2019-07-31T21:30:08Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
{{OSLang|[[File:icon-Linux.png|64x64px|link=OS - Linux]]|On the Single Board Computer (SBC), Phidgets can be either plugged directly into one of the USB ports or run over a network using the [[#WebService | WebService]].}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Unlike our other supported operating systems, the SBC &#039;&#039;&#039;does not require downloads&#039;&#039;&#039; unless you are doing something advanced like loading the firmware or developing your own kernel.  You will know if you need these downloads, otherwise, the SBC should work as described on the [[1073 User Guide#Getting Started|SBC3 Getting Started Guide]] right out of the box.&lt;br /&gt;
&lt;br /&gt;
*[[Software License]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC (1070):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1070/changelog.txt changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1070/phidgetsbc-minimal.bin Minimal Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1070/phidgetsbc-full.bin Full Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1070/buildroot-phidgetsbc.tar.gz Buildroot/Kernel Sources]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC2 (1072):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1072/changelog.txt changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1072/phidgetsbc2.bin SBC2 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1072/phidgetsbc2-kerneldev.tar.gz SBC2 Kernel Development Package] (How-to and patch file)&lt;br /&gt;
&#039;&#039;&#039;The PhidgetSBC3 has different firmware packages based on the kernel version. In order to determine the device version of your SBC3, see the [[1073_User_Guide#SBC_Web_Interface|web configuration page]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:sbcver.jpg|thumb|562px|link=|The system information table is found on the Status -&amp;gt; System tab of the &#039;&#039;&#039;[[1073_User_Guide#SBC_Web_Interface|web configuration page]]&#039;&#039;&#039; of the SBC.]]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.6.3:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/changelog.txt changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.6.3/phidgetsbc3.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.6.3/phidgetsbc3-kerneldev.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.6.3/phidgetsbc3-upgrade_3.6.3_3.14.27.tar.gz SBC3 Kernel upgrade package (3.6.3 -&amp;gt; 3.14.27)]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.14.27:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/changelog.txt changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.14.27/phidgetsbc3.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.14.27/phidgetsbc3-update_3.14.27.tar.gz SBC3 Kernel update package (3.14.27)]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.14.27/phidgetsbc3-kerneldev.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Note that, instead of using the firmware to update your SBC, updates should normally be done via the System -&amp;gt; Packages page on your SBC3 web interface. It is rarely necessary to completely re-flash your device..&lt;br /&gt;
&amp;lt;br clear = all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Getting Started with the Phidget SBC Debian Linux==&lt;br /&gt;
&lt;br /&gt;
The Single Board Computer (SBC) is a unique Phidget.  It is a computer with a Linux operating system.  It can compile code, save files, manage background jobs, host information over the web, and more.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If this is your first time&#039;&#039;&#039; using the Phidget SBC, you will want to start with the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  After that, here we will get you started on topics beyond those in the getting started guide, including how to write Phidget code to run on the SBC.  You &#039;&#039;&#039;do not need this page&#039;&#039;&#039; if you are simply using the SBC to broadcast data from Phidgets over the network - it does that automatically.  We describe how to verify and use this in the [[1073 User Guide#Getting Started | Getting Started Guide]].&lt;br /&gt;
&lt;br /&gt;
This page will show you how to:&lt;br /&gt;
* Install the ability to write and develop code on the SBC itself&lt;br /&gt;
* Use the command line for basic coding tasks&lt;br /&gt;
* Troubleshoot the SBC&#039;s network&lt;br /&gt;
It will also give additional specifications, which are useful for doing more advanced things with the SBC hardware and software.&lt;br /&gt;
&lt;br /&gt;
Before reading this page, you should have done the following via the Getting Started Guide:&lt;br /&gt;
* Set up networking on your SBC, via either Ethernet or wireless&lt;br /&gt;
* Set up an admin password&lt;br /&gt;
* Learned the IP address or link local address of the SBC&lt;br /&gt;
We will use this information in setting up the libraries and drivers to use the SBC for writing and running code.&lt;br /&gt;
&lt;br /&gt;
Conceivably, you could simply use the SBC like any Linux computer, and do all of your development and compiling of Phidget code on the SBC itself.  In practice this gets complicated as the SBC does not have a keyboard or screen.  So usually, you will want to develop your code an external computer and copy files and settings over to the SBC via a network.  This makes this Getting Started section unique, in that we show you how to set up both computers:&lt;br /&gt;
* Your [[#Getting Started - External Computer | External Development Computer]], usually your main desktop or laptop which will transfer files and settings to and from the SBC&lt;br /&gt;
* The [[#Getting Started - The SBC (Debian Linux) | SBC]] itself, which needs programming language libraries to use Phidgets.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - External Computer===&lt;br /&gt;
&lt;br /&gt;
You have two ways to connect to the SBC from an external computer: via the [[#SBC Web Interface|SBC Web Interface]] and over the more powerful but complex [[#SSH | Secure Shell (SSH)]].&lt;br /&gt;
&lt;br /&gt;
====SBC Web Interface====&lt;br /&gt;
&lt;br /&gt;
You have already worked extensively with the web interface in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  This was the tool within a web browser which was opened either via the [[Phidget Control Panel]] on Windows, or by simply entering the IP or link local address into an internet browser.  It allowed you to set the password, set up internet connectivity, and so on.  &lt;br /&gt;
&lt;br /&gt;
This section doesn&#039;t have more information on the interface; rather, it simply serves as a reminder that you have the web interface as an available tool.  Examples, including screenshots, are placed where appropriate in this document.  The web interface will probably stay your initial go-to way to connect to the SBC, especially for tasks that benefit from graphical interaction, like setting up wireless or using the webcam.&lt;br /&gt;
&lt;br /&gt;
====SSH====&lt;br /&gt;
&lt;br /&gt;
The most flexible way to transfer files and commands to and from the SBC is via a program called &#039;&#039;&#039;ssh&#039;&#039;&#039;.  The ssh program provides command line text access over a network into the SBC.  Using it, you can run programs and give the SBC commands.  The ssh program has a companion program called &#039;&#039;&#039;scp&#039;&#039;&#039; which can copy files back and forth.  If you are unfamiliar with ssh, you can think of it like the command line or a Mac terminal, but with a remote connection to a different computer.  It is a minimal yet effective way to interact with a remote computer.&lt;br /&gt;
&lt;br /&gt;
Before connecting over ssh, you will need:&lt;br /&gt;
* The &#039;&#039;&#039;IP address&#039;&#039;&#039; (such as 168.254.3.0) or &#039;&#039;&#039;link local address&#039;&#039;&#039; (such as phidgetsbc.local) of the SBC&lt;br /&gt;
* The &#039;&#039;&#039;admin password&#039;&#039;&#039; for the SBC&lt;br /&gt;
Both of these items can be found by following the steps in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].&lt;br /&gt;
&lt;br /&gt;
You will also need to enable SSH on the SBC side.  This can be done through the [[#SBC Web Interface| Web Interface]], under {{Code|Network &amp;amp;rarr; Settings}}, by changing the &#039;&#039;SSH Server&#039;&#039; radio button to &#039;&#039;Enabled&#039;&#039; and saving your changes:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_turn_on_ssh.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
=====SSH on Windows=====&lt;br /&gt;
&lt;br /&gt;
The ssh program is not installed on Windows by default.  But, there are a variety of SSH programs available for free. One simple and commonly used program is [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY], and it has the advantage that the executable doesn&#039;t need to install, it just runs.&lt;br /&gt;
&lt;br /&gt;
With PuTTY, when you first run the program it will ask you what to connect to.  Enter the IP address or link local address of the SBC, and then click the SSH radio button right below the address, which will change the port to 22.  Then click open, and you&#039;ll have an ssh connection to the SBC open in a terminal.  It will prompt you for a user name ({{Code|root}}) and password (the admin password).&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, there is an SCP component to PuTTY, called PSCP, which is available from the same [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY download page].  Use of PSCP will be similar with the address, username, and password, except that you will be transferring files instead of sending commands.&lt;br /&gt;
&lt;br /&gt;
=====SSH on Linux and Mac OS=====&lt;br /&gt;
&lt;br /&gt;
Linux and Mac OS already have ssh installed by default.  To run ssh simply open a terminal...&lt;br /&gt;
* {{Code|Ctrl-Alt-T}} on Linux &lt;br /&gt;
* {{Code|Applications &amp;amp;rarr; Utilities &amp;amp;rarr; Terminal}} on Mac OS &lt;br /&gt;
...and type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
ssh root@phidgetsbc.local&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have re-named your SBC, include that name instead of the {{Code|phidgetsbc.local}} link address.  Or, you can use the SBC&#039;s IP address, e.g. something like {{Code|ssh root@168.254.3.0}}&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, the command follows the form of: {{Code|scp from to}}&lt;br /&gt;
&lt;br /&gt;
So, to copy a file {{Code|/root/data.txt}} from the SBC to your local machine, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
scp root@phidgetsbc.local:/root/data.txt .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note the use of the dot &#039;&#039;&#039;.&#039;&#039;&#039; to indicate that scp should put the file in the current local directory.   If you&#039;re not sure what folder the terminal is operating in type {{Code|pwd}} to print the working directory.  Terminals usually start by default in your home folder.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - The SBC (Debian Linux)===&lt;br /&gt;
&lt;br /&gt;
The SBC runs Linux, which is a full operating system. It is stripped down compared to a full desktop release of Linux, but you can compile code on it, run programs, schedule tasks, create and manage files, run a web server, and much, much more.&lt;br /&gt;
&lt;br /&gt;
At this point you have connected to the SBC via the [[#SBC Web Interface|web interface]], and probably also through [[#SSH|SSH]].  This section will help you install libraries and drivers that you probably want - i.e. support for C, Java, and Python.  After this section, you&#039;ll be well into the depths of using the SBC as a computer, and so you&#039;ll probably want to keep the [[#Using SBC Linux|Using SBC Linux section]] open for reference while you work if you are not already familiar with Linux.&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the following Phidget functionality installed:&lt;br /&gt;
* The Phidget C libraries {{Code|libphidget21.so}}&lt;br /&gt;
* The Phidget [[#WebService | WebService]]&lt;br /&gt;
(If you are simply curious what these are and how they get installed, we describe the process on the [[OS - Linux | general Linux page]].)&lt;br /&gt;
&lt;br /&gt;
But to compile C programs, or run Java programs, or use Python, you will need to install these languages onto the SBC.  &lt;br /&gt;
&lt;br /&gt;
Before installing anything on the SBC, however, (even via a button on the web interface) make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
====Installing C/C++ and Java====&lt;br /&gt;
&lt;br /&gt;
The simplest way to install C/C++  and Java on the SBC is via the web interface.  There is a button under {{Code|System &amp;amp;rarr; Packages}} to install C support (including {{Code|gcc}}) and another button to install Java support:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_packages_web.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
You have to check that you are running the same version of Java on your development machine (where you plan on compiling the java programs) as the SBC is running. To do this type the following into the terminal on your computer and from ssh on the SBC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
Java -version&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need to update the version of Java on your SBC, use the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install openjdk-7-jre-headless&lt;br /&gt;
su&lt;br /&gt;
update-alternatives --config java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you&#039;re ready to begin programming.  We have programming pages for both [[Language - C/C++|C/C++]] and for [[Language - Java|Java]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].  &lt;br /&gt;
&lt;br /&gt;
If you want to avoid using the [[#SSH|SSH]] interface on the SBC entirely, and you want to write your program in Java and run it continuously from boot (which is the only option if you want to avoid [[#SSH|SSH]]), we have a [[#Program in Java with the Web Interface|very in-depth section]] on that topic.&lt;br /&gt;
&lt;br /&gt;
====Installing Python====&lt;br /&gt;
&lt;br /&gt;
Installing Python has two steps.  First, you&#039;ll need to install the basic ability to run python, and then you&#039;ll need to install the Phidget Python module.  Both steps (and both options) require that you issue the relevant commands through an [[#SSH|SSH terminal]].&lt;br /&gt;
&lt;br /&gt;
=====Basic Python=====&lt;br /&gt;
&lt;br /&gt;
The base Python functionality can be downloaded and installed in one step with [[#apt|apt]] (i.e. in a terminal, type):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will give you Python, and now you just have to install the Phidget Python module to gain Phidget functionality. If the installation fails because it can&#039;t find python, you need to enable the full repository as described in [[#Getting Started_-_The_SBC_(Debian_Linux)|this section]], and then perform an apt-get update.&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 1: Use a USB Key=====&lt;br /&gt;
&lt;br /&gt;
Copy the [{{SERVER}}/downloads/phidget21/libraries/any/PhidgetsPython.zip Python Libraries] onto a USB key.  Unpack the zip file into a folder on the USB key.  Insert the key into the SBC.&lt;br /&gt;
&lt;br /&gt;
You will have to figure out where the USB key (and the Phidget Python library folder) is now located.  We describe how in the general [[#Using USB Data Keys | Using USB Data Keys]] section.&lt;br /&gt;
&lt;br /&gt;
After you know the place where the USB key is mounted, in a terminal go to that directory (e.g. type {{Code|cd /media/usb0/}}), enter the unpacked Phidget Python Library folder, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have an whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 2: Use the Internet=====&lt;br /&gt;
&lt;br /&gt;
Rather than using a USB key to transfer the file, the SBC can download it directly from the internet.  You will need {{Code|wget}} and {{Code|unzip}} installed, both of which are small:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install wget&lt;br /&gt;
apt-get install unzip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the web link address for the [{{SERVER}}/downloads/phidget21/libraries/any/PhidgetsPython.zip Python Libraries].&lt;br /&gt;
&lt;br /&gt;
In an SSH terminal to the SBC, type: {{Code|&amp;lt;nowiki&amp;gt;wget http://www.python_library_link&amp;lt;/nowiki&amp;gt;}} where instead of &amp;lt;nowiki&amp;gt;http://www.python_library_link&amp;lt;/nowiki&amp;gt; you insert the link you just copied. Copying into a terminal can usually be done via the right-click menu.&lt;br /&gt;
&lt;br /&gt;
This will download the Phidget python libraries to the folder you ran the {{Code|wget}} command in.  Unzip the downloaded file using the command {{Code|unzip file}}, where file is the filename from {{Code|wget}}. Or try typing {{Code|ls}} to list the names of a file in the directory, which should include the unzipped folder.  Enter the unzipped folder (e.g. use {{Code|cd}} to change directory), and install the Phidget Python libraries:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have a whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
====Installing Other Languages====&lt;br /&gt;
&lt;br /&gt;
You may also be able to program on the SBC using [[Language - Ruby|Ruby]] and [[Language - C Sharp|C# under Mono]], though we do not offer in-depth support for these languages on the SBC.  The installation procedures should more or less follow that of [[#Installing Python|installing python]] on the SBC, except you will be installing Ruby or Mono.  Performing package searches using [[#apt|apt cache search]] can help you find the relevant software.&lt;br /&gt;
&lt;br /&gt;
For C#, as of 2012 the {{Code|mono-complete}} package is broken on the Debian Squeeze repository.  Rather, you have to install the Mono runtime and Mono compiler separately.&lt;br /&gt;
&lt;br /&gt;
To install the runtime package (and its dependencies), use [[#apt|apt]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-runtime&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to install the C# compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-gmcs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or the Visual Basic compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-vbnc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, the system and library packages do not link correctly for the version 2.0 of Mono.  If this is the case, your code will compile fine, but when you try to run it, you will get an error like:&lt;br /&gt;
&lt;br /&gt;
:{{Code|The assembly mscorlib.dll was not found or could not be loaded.}}&lt;br /&gt;
:{{Code|It should have been installed in the `/usr/lib/mono/1.0/mscorlib.dll&#039; directory.}}&lt;br /&gt;
&lt;br /&gt;
In this case, you need to install these two packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libmono-corlib1.0-cil&lt;br /&gt;
apt-get install libmono-system1.0-cil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we found these packages to work by working through the tree structure.  As a general rule, you can find these dependencies by using install (here, {{Code|apt-get install mono-complete}}) to get a sense of the package tree structure.  This will possibly tell you that the packages are broken, but at the same time this will list the dependencies of the packages.  Trying to install individual dependencies will show you that although a root-package fails, the sub-packages will sometimes succeed, and install what you need.&lt;br /&gt;
&lt;br /&gt;
If you want to use a specific dll or library that is not available in this reduced version of mono, you can install mono complete by switching from Emdebian+Debian to just Debian.  To do this:&lt;br /&gt;
&lt;br /&gt;
In {{Code|/etc/apt/preferences}} make the following changes:&lt;br /&gt;
:{{Code|Package: *}}&lt;br /&gt;
:{{Code|&amp;lt;nowiki&amp;gt;Pin: release a=stable&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
:{{Code|Pin-Priority: 1010}}&lt;br /&gt;
	&lt;br /&gt;
In {{Code|/etc/apt/sources.list/mutistrap-debian.list}} remove the emdebian line.&lt;br /&gt;
&lt;br /&gt;
Apply the changes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get dist-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many packages will be &#039;downgraded&#039; from the emdebian to debian versions.  Delete the {{Code|&amp;lt;nowiki&amp;gt;/etc/apt/preferences&amp;lt;/nowiki&amp;gt;}} file and install mono-complete:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install monodoc-http mono-complete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Choose monodoc-http explicitly, because otherwise the install fails on monodoc-browser.&lt;br /&gt;
&lt;br /&gt;
After this process, you can compile your C# Code.cs Phidget source file the same way as on a generic [[Language - C Sharp#Linux|Linux with Mono]] system.  Please refer to that page on how to obtain the *.dll Phidget resource file and compile your code.  On the SBC, however, because you are already running as root (the Super User), you do not need &#039;sudo&#039; and indeed the SBC will give you an error if you use it.  Instead, compiling and running will look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
gmcs Code.cs -r:Phidget21.NET.dll&lt;br /&gt;
mono Code.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using SBC Linux==&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve set up communication with the SBC, and installed whichever programming language support you need, you&#039;re probably ready for a short tour of useful tools on the SBC&#039;s version of Linux.&lt;br /&gt;
&lt;br /&gt;
First, you will by default be running on the SBC as &#039;&#039;&#039;root&#039;&#039;&#039;, which is the super-user.  For Linux users, this probably makes you nervous because you know you can overwrite important system files without the system asking for additional permission.  As a Windows or Mac OS user - although you may usually run your computer as an administrator - your familiar system usually prompts you to confirm before you do anything really dangerous, and this will &#039;&#039;&#039;not&#039;&#039;&#039; happen on the SBC as the root user.&lt;br /&gt;
&lt;br /&gt;
Next, there is no installed help on the SBC.  Help on Linux is usually called &#039;man pages&#039; which is short for &#039;the manual pages&#039;.  On a full Linux system, usually if you need help with any command you can type, for example, {{Code|man ls}} and it will give you help with the program [[#ls|ls]].  But these help pages take up significant space, and they are widely available online.  So, if you need more help with a certain command, you can always type {{Code|man command}} into your favourite search engine.&lt;br /&gt;
&lt;br /&gt;
Finally, the SBC has no windowing system.  For Linux users, this means no X-windows (Gnome, KDE, etc).  And as a Windows or Mac user, you can think of it as running all of your programs and commands through the terminal or DOS prompt command line.  The SBC provides all of the functionality of an operating system (e.g. process scheduling, file management, etc) but without any graphical interface.  The only exception is the [[#SBC Web Interface|web interface]], which gives graphical access to a limited part of what the SBC can do.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands===&lt;br /&gt;
&lt;br /&gt;
If you are doing more with the SBC than simply running pre-written programs [[#Writing a Phidget Program|in Java to run continuously from boot]], you will be interacting with the SBC&#039;s Linux operating system over the command line by using [[#SSH|SSH]].  This section discusses useful programs already installed on the SBC, and how to run them on the command line.&lt;br /&gt;
&lt;br /&gt;
====ls====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;ls&#039;&#039;&#039; program lists the contents of a directory.&lt;br /&gt;
&lt;br /&gt;
It will show both files and folders, but not files that start with a &amp;quot;.&amp;quot; (these are hidden files on Linux).&lt;br /&gt;
*If you also want to show hidden files, use {{Code|ls -a}}&lt;br /&gt;
*If you want more information, such as size and date modified, use {{Code|ls -l}}&lt;br /&gt;
*Commands can be combined, like {{Code|ls -al}}&lt;br /&gt;
&lt;br /&gt;
====cd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cd&#039;&#039;&#039; program changes to a new directory.&lt;br /&gt;
&lt;br /&gt;
For example, {{Code|cd /root}} changes into the directory at the base of the file tree called &#039;&#039;root&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* Linux uses forward slashes&lt;br /&gt;
* The base of all directories is &amp;quot;/&amp;quot; (not &amp;quot;C:\&amp;quot;)&lt;br /&gt;
* The tilde symbol (~) is short for your home directory (i.e. when you are root, this is short for &amp;quot;/root&amp;quot;)&lt;br /&gt;
* The double dot &amp;quot;..&amp;quot; means move one directory higher (for example from {{Code|/root/data/}} to {{Code|/root/}})&lt;br /&gt;
&lt;br /&gt;
====pwd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;pwd&#039;&#039;&#039; program prints the current directory you are working in.  (&#039;P&#039;rint &#039;W&#039;orking &#039;D&#039;irectory)&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
:{{Code|root@phidgetsbc:~# pwd}}&lt;br /&gt;
:{{Code|/root}}&lt;br /&gt;
&lt;br /&gt;
====cp, mv, and rm====&lt;br /&gt;
&lt;br /&gt;
These programs are copy (&#039;&#039;&#039;cp&#039;&#039;&#039;), move (&#039;&#039;&#039;mv&#039;&#039;&#039;), and remove (&#039;&#039;&#039;rm&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Copy copies a file from one location and pastes it to another.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|cp data.txt data_backup.txt}} will put a copy of the file {{Code|data.txt}} into {{Code|data_backup.txt}}&lt;br /&gt;
&lt;br /&gt;
Move moves a file (this is also useful for renaming files) to a new destination.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|mv data.txt data_backup.txt}} will put the contents of {{Code|data.txt}} into {{Code|data_backup.txt}}, and then will remove {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Remove deletes a file.&lt;br /&gt;
&lt;br /&gt;
For example, typing {{Code|rm data.txt}} will delete {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Note that &#039;&#039;&#039;rm&#039;&#039;&#039; is final.  Once you remove a file using {{Code|rm}}, it is gone forever.  There is no recycle bin, no temporary trash, nothing other than backups you may have personally created in the past!&lt;br /&gt;
&lt;br /&gt;
Directories can only be removed with {{Code|rmdir}}, and then only if they are empty.  If you want to remove a directory and all the files in it, use {{Code|rm -rf directory}} but be &#039;&#039;&#039;very, very careful&#039;&#039;&#039; with this command.  Trying to remove everything within a directory (e.g. {{Code|rm -rf *}}) is one of the most dangerous commands you can run on a Linux system, as running it from the wrong directory will result in Linux happily removing everything under that directory -- which could be your entire filesystem.&lt;br /&gt;
&lt;br /&gt;
====find====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;find&#039;&#039;&#039; program does what it says - it finds things.  &lt;br /&gt;
&lt;br /&gt;
Unfortunately for the casual user, the find program is very flexible and powerful, and thus not especially intuitive to use.  But, here are some examples:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|find folder -name file.txt}}&lt;br /&gt;
| Looks for all files in a folder (/ for root - or all - folders) with a certain name (* for wildcard)&lt;br /&gt;
| {{Code|find / -name *.jpg}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|find folder -mtime +X}}&lt;br /&gt;
| Looks for all files in a folder modified less than X days ago&lt;br /&gt;
| {{Code|find /root -mtime +30}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====grep====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;grep&#039;&#039;&#039; program takes text input and searches for a term. &lt;br /&gt;
&lt;br /&gt;
For example, if you type {{Code|mount}} to view what devices are mounted (e.g. loaded) on your SBC, you will see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may be a lot of information you don&#039;t need.  If you are only interested in a USB key attachment (as described in the [[#Using USB Data Keys|Using USB Data Keys]] section), you can use grep to filter that one response:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep sda1&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====nano====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;nano&#039;&#039;&#039; program is a small text editor that you can use within an SSH terminal. &lt;br /&gt;
&lt;br /&gt;
Nano can be surprisingly useful for writing short lengths of code right on the SBC, so there is no need to transfer files and keep track of different file versions on different computers.&lt;br /&gt;
&lt;br /&gt;
Nano has all keyboard commands which are listed at the bottom of the screen at all times as a reminder (Ctrl-O to save, Ctrl-X to exit, these expand with a larger terminal window).  And, nano provides what is called &#039;syntax highlighting&#039;, which colours reserved keywords, comments, strings, and so on as appropriate to the programming language you are using.  Nano detects the programming language via the extension of the file ({{Code|.java}} for Java, {{Code|.c}} for C/C++, and {{Code|.py}} for Python).&lt;br /&gt;
&lt;br /&gt;
Typing {{Code|nano test.py}} on an SSH command line and then entering a few lines of Python into the new empty file results in:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_nano_python.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
====apt====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;apt&#039;&#039;&#039; program allows you to install, uninstall, upgrade, and search software available for the SBC.&lt;br /&gt;
For a non-Linux user, the apt framework may be daunting at first, but it actually allows you to keep your system up to date and install and manage software quickly, easily, and for free.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Before installing anything on the SBC, make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-cache search term}}&lt;br /&gt;
| Looks for all programs (packages) that have {{Code|term}} in the title or description&lt;br /&gt;
| {{Code|apt-cache search opencv}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-cache show package}}&lt;br /&gt;
| Shows a lot of data about {{Code|package}} including size, version, etc&lt;br /&gt;
| {{Code|apt-cache show unzip}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-get update}}&lt;br /&gt;
| Gets the most recent listing of available software&lt;br /&gt;
| {{Code|apt-get update}}  (No options)&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-get install program}}&lt;br /&gt;
| Installs {{Code|program}} from the internet&lt;br /&gt;
| {{Code|apt-get install python}}&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====mount====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|mount}} shows you all of the mounted devices on your SBC.  &lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the non-Linux user, the concept of a device may be quite strange.  To give a short summary, everything on Linux that you can read or write is a file.  Webcams are files (i.e. you can &#039;read&#039; photos from them), USB keys are files, and each filesystem (tmp storage, the kernel portion, the main filesystem) are also themselves files.  These files specify what and how something can be written.  These are not necessarily linear, for example, you can see above that the USB key ({{Code|/media/usb0}} is mounted &#039;&#039;within&#039;&#039; the root file system {{Code|rootfs}} which is /.   &lt;br /&gt;
&lt;br /&gt;
So mount gives you an idea of what devices have been &#039;mounted&#039; for reading or writing, and how you can read and write to them.  More information on mount (and its various forms, like {{Code|umount}}) is available widely around the Internet.&lt;br /&gt;
&lt;br /&gt;
====which====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|which}} tells you if and where a program is installed.&lt;br /&gt;
&lt;br /&gt;
For example, on a default SBC, typing {{Code|which python}} will return no results.  But after successfully [[#Installing Python | installing python]], it will return {{Code|/usr/bin/python}} as the location of the python program/binary/executable.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands to Install===&lt;br /&gt;
&lt;br /&gt;
These are other programs you may find useful on the command line.  Although they are not on the SBC by default, these and other programs can usually be installed simply by using [[#apt|apt-get install]], with the exception of gcc.  For example, {{Code|apt-get install wget}} will download and install [[#wget|wget]].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This section and the section on [[#Some Useful Commands|pre-installed commands]] can hardly cover all of the complexities and power of the Linux operating system.  There are many excellent tutorials online, and between them and using [[#apt|apt]] to find and install programs you should be able to learn a lot and perform any number of complex useful tasks.&lt;br /&gt;
&lt;br /&gt;
====gcc====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;gcc&#039;&#039;&#039; program is the C compiler for Linux.&lt;br /&gt;
&lt;br /&gt;
If you are an experienced C/C++ user on Mac or Linux, or if you&#039;ve already read our [[Language - C/C++ | C Language page]], you might think you need to install gcc via {{Code|apt-get}} to compile C code.  However, gcc is not in the package repository for the SBC, so {{Code|apt-get install gcc}} will fail.  Rather, to install gcc, you can do it via the web interface, as described in the [[#Installing C/C++ and Java|Installing C/C++ and Java]] section.&lt;br /&gt;
&lt;br /&gt;
After installing it via the SBC web interface, you can use {{Code|gcc}} normally.&lt;br /&gt;
&lt;br /&gt;
====less====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;less&#039;&#039;&#039; program displays the contents of a text or source code file.  When displaying the file, {{Code|less}} allows you to scroll up and down to read it.&lt;br /&gt;
&lt;br /&gt;
This is useful if you are writing your sensor readings to a data file, and you want to read the data file while it is being written by your main code.  If your data file is called {{Code|data.txt}}, you can type {{Code|less data.txt}} and see the lines in the file, and what they are.&lt;br /&gt;
&lt;br /&gt;
The {{Code|less}} program output can also be piped into another program.  For example, you can use {{Code|less}} and the word search program {{Code|grep}} to find lines within a file with a search term.  For instance, if you have a C source code file {{Code|Program.c}} on the SBC, and you want to see all the lines in {{Code|Program.c}} that contain a variable name {{Code|var}}, you can type: &lt;br /&gt;
:&amp;lt;code&amp;gt;less Program.c | grep var&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====wget====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;wget&#039;&#039;&#039; program allows you to get an online file (over http) and download it to the SBC.&lt;br /&gt;
&lt;br /&gt;
For example, to get the source file (HTML) from the Phidgets home page, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
wget http://www.phidgets.com&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is most useful for downloading libraries, drivers, or anything (zip, tar, etc) you need from the web which is not available by [[#apt|using apt]].&lt;br /&gt;
&lt;br /&gt;
===Writing a Phidget Program===&lt;br /&gt;
&lt;br /&gt;
We provide two ways to write and upload a Phidget Program:&lt;br /&gt;
# The [[#SBC Web Interface|web interface]]:&lt;br /&gt;
#* This is useful for simple projects written in Java that you want to start only at boot&lt;br /&gt;
#* You can also use C projects, but they must be compiled off the SBC for an ARM processor&lt;br /&gt;
# Over [[#SSH|SSH]], which will allow you to write or transfer source code directly to and from the SBC&lt;br /&gt;
#* This is useful for all other projects, such as:&lt;br /&gt;
#** Projects that run at scheduled times (e.g. once per minute)&lt;br /&gt;
#** Projects that use languages other than Java or ARM-compiled C&lt;br /&gt;
Note that you can still run an [[#SSH|SSH]] project at boot, you just have to write and install a startup script.  This is a bit complex, but we do have an example that starts the program {{Code|phidgetwebservice21}} [[OS - Linux#As A Service|at boot using a script]].&lt;br /&gt;
&lt;br /&gt;
Once you know which method you&#039;d like to use, you can continue on to learn how to [[#Program in Java with the Web Interface|Program in Java with the Web Interface]], or how to [[#Program with SSH|Program with SSH]] using Java, C, or Python.  If you are actually typing in source code on the SBC, you&#039;ll find our [[#Developing Code on the SBC|developing code on the SBC section]] useful.&lt;br /&gt;
&lt;br /&gt;
====Program in Java with the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To show how to write, compile, and install Java programs on the SBC, we&#039;ll use the [[Language - Java|Java Hello World]] example code.  You can download the HelloWorld example by downloading the whole [{{SERVER}}/downloads/phidget21/examples/java/JavaJNI.zip Java example package].  Make sure you have the same version of [[#Installing C/C++ and Java|Java installed on the SBC]] as you have on your external development machine. Instruction for checking and updating are found on the [[#Installing C/C++ and Java|installation page]].&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how to get the HelloWorld code running on the SBC.  On your external computer:&lt;br /&gt;
&lt;br /&gt;
1. Download the SBC version of the Phidget Java libraries ({{Code|phidget21.jar}}).  You can download this from the [[#SBC Web Interface|web interface]], on the page under {{Code|Projects &amp;amp;rarr; Projects}}, under the &#039;&#039;&#039;Notes&#039;&#039;&#039; section.&lt;br /&gt;
&lt;br /&gt;
2. Place the SBC version of {{Code|phidget21.jar}} into a directory on your external computer.  This will be your working directory that you will use to compile the Java files.&lt;br /&gt;
&lt;br /&gt;
3. Also copy the {{Code|HelloWorld.java}} file into that working directory.&lt;br /&gt;
&lt;br /&gt;
4. Compile the {{Code|HelloWorld.java}} file from within that working directory.  From the command line prompt on Windows, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .;phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In a terminal on Linux or Mac OS, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. You should now have three compiled class files: {{Code|HelloWorld.class}}, {{Code|HelloWorld$1.class}}, and {{Code|HelloWorld$2.class}}.  You don&#039;t need to try and run them, and if you do you may encounter an error because the SBC {{Code|phidget21.jar}} may be slightly different than the Phidget support you have installed on your external computer.&lt;br /&gt;
&lt;br /&gt;
Now we move onto the SBC:&lt;br /&gt;
&lt;br /&gt;
6. Create a new project on the SBC, in the web interface under {{Code|Projects &amp;amp;rarr; Projects}}.  Call it HelloWorld:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_create_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
7. On the next screen, you will be prompted to upload your files.  We will upload the three Java class files, and then click the {{Code|Start}} button:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_web_run_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
8. You&#039;ll note that as it runs, there are two links below the {{Code|Stop}} button: One called {{Code|stdout}}, which is &#039;&#039;Standard Output&#039;&#039;, and one called {{Code|stderr}}, which is &#039;&#039;Standard Error&#039;&#039;.  Usually, when you run a program on the command line, you see both standard out and standard error at the same time - i.e. you get all program output right there in your terminal or command prompt.  But when running a program in the background, Linux splits the output up into normal output and error output as this is very useful for debugging (i.e. you can check if standard error is empty).  &lt;br /&gt;
&lt;br /&gt;
Here, however, if you&#039;re not sure whether the program will run correctly, you should first check {{Code|stderr}} to see if any errors were generated, and then check {{Code|stdout}} to see if the output looks as expected.&lt;br /&gt;
&lt;br /&gt;
To write your own Java program, follow the same process but use your own source code instead of the {{Code|HelloWorld.java}} example.&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, we offer additional help on [[#Via the Web Interface|running a program automatically using the web interface]].&lt;br /&gt;
&lt;br /&gt;
====Program with SSH====&lt;br /&gt;
&lt;br /&gt;
Similarly to starting a program via the [[#Program in Java with the Web Interface|web interface]], we use the Phidget Java {{Code|HelloWorld}} example here.&lt;br /&gt;
&lt;br /&gt;
Make sure you have [[#Installing C/C++ and Java|Java installed on the SBC]].  To compile and run the {{Code|HelloWorld}} example:&lt;br /&gt;
&lt;br /&gt;
1. Open an [[#SSH|SSH terminal]] to the SBC&lt;br /&gt;
&lt;br /&gt;
2. Download the [{{SERVER}}/downloads/phidget21/examples/java/JavaJNI.zip Phidget Java Examples] to the SBC, using [[#wget|wget]] (you may need to install {{Code|wget}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
3. Unpack the examples using [[#unzip|unzip]] (you may need to install {{Code|unzip}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
4. The location of {{Code|phidget21.jar}} on the SBC is {{Code|/usr/share/java/phidget21.jar}}.  Within the unzipped example directory, compile the {{Code|HelloWorld.java}} example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:/usr/share/java/phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. To run the {{Code|HelloWorld}} program, use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
java -classpath .:/usr/share/java/phidget21.jar HelloWorld&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, you&#039;ll probably want to learn to [[#Running a Program Automatically|run this Java program automatically]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; If you&#039;re used to using Linux with Phidgets already, you&#039;ll probably notice that you don&#039;t need to switch into root using {{Code|sudo}} on the SBC in order to run programs.  This is because you already are running as root, not because the [[OS - Linux#Setting udev Rules|udev rules are set up]].  So if you set up another user, or [[#Via Cron|run a cron job]] as anything other than root or system, you&#039;ll need to add permission for the Phidget program to run in your [[OS - Linux#Setting udev Rules|udev rules]].&lt;br /&gt;
&lt;br /&gt;
====Developing Code on the SBC====&lt;br /&gt;
&lt;br /&gt;
When you&#039;re not just using pre-written source code, and you&#039;re writing code actually on the SBC itself, you&#039;ll probably want to use [[#nano|nano]].  Other terminal editors on the SBC include {{Code|vi}} which is already installed, and {{Code|emacs}}, which you can install using [[#apt|apt]].  Both {{Code|vi}} and {{Code|emacs}} are much more efficient for the experienced user, but they contain modes and keyboard shortcuts that can seem strange or almost hindering to the casual user.&lt;br /&gt;
&lt;br /&gt;
Regardless of which editor you choose to use, some of your keyboard habits may not transfer well.  For example, in the Linux command line, the command {{Code|Ctrl-C}} means &#039;&#039;stop the currently running program&#039;&#039;, (i.e. your open editor) not copy.  Within most SSH terminals, you can copy and paste using the right-mouse button, and on some terminals (and all native Linux terminals) you can copy by simply highlighting text, and you can paste it using the middle (scroll) mouse button.  On the other hand, if you write a program that hangs on the command line, {{Code|Ctrl-C}} can actually be useful to terminate it.&lt;br /&gt;
&lt;br /&gt;
Also {{Code|Ctrl-Z}} does not mean &#039;&#039;undo&#039;&#039;, rather it means &#039;&#039;run the current program in the background&#039;&#039;.  This is useful because running a program in an SSH terminal simply hangs your SSH input until the program is done.  So typing {{Code|Ctrl-Z}} while the program is running frees up the command line for more input.  But if you accidentally hit {{Code|Ctrl-Z}} while running an editor like [[#nano|nano]], the editor will immediately exit to the command line.  Don&#039;t worry though, it will not stop or lose your work.  You can bring it back up by using the {{Code|fg}} (e.g. &#039;foreground&#039;) command, like {{Code|fg nano}}, and this will automatically bring your nano process back to the front.&lt;br /&gt;
&lt;br /&gt;
===Running a Program Automatically===&lt;br /&gt;
&lt;br /&gt;
For testing your program, you will certainly want to run it via [[#SSH|SSH]] or via the {{Code|Start}} button on the project page on the web interface until you are quite sure it runs well.  However, eventually you will probably want the program to run without your input, either [[#Via the Web Interface|continuously, and starting at boot]], or via a task scheduled to [[#Via Cron|run to completion at certain times]].&lt;br /&gt;
&lt;br /&gt;
Both have their advantages and disadvantages.  Usually, you would want to use the continuous, from-boot methods for event driven code that has to handle a wide variety of user input that could occur at any time.  You would want to use the scheduled method when the SBC needs to perform a repeated task (e.g. reading sensor data) again and again.  The main difference is:&lt;br /&gt;
* With the continuous (boot) method you can have any Phidgets (including sensors, LEDs, input switches, etc) attached and giving events to your code all the time, and&lt;br /&gt;
* With the scheduled (cron) method you have much less of a chance to run into long-term memory management and instability problems with any code you write, because your program runs for only a short time before exiting and getting cleaned up.&lt;br /&gt;
&lt;br /&gt;
====Via the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To use this method, you must have created the program you want to run as [[#Program in Java with the Web Interface | a Java or ARM-compiled C project in the web interface]].  If you would like to use another language, or another way of uploading your project, but you still want to start at boot and run continuously, you will need to use a [[#Via a Boot Script|boot script]].&lt;br /&gt;
&lt;br /&gt;
In the web interface, go to the {{Code|Projects}} tab, and click on the project you would like to run.  Near the bottom of the project page (the one with the {{Code|Start}} and {{Code|Stop}} buttons at the top), there will be a section called {{Code|Startup Settings}}.  You can see a screenshot of the whole project page, including these settings, in the [[#Program in Java with the Web Interface | web interface project section]].&lt;br /&gt;
&lt;br /&gt;
Select the {{Code|Enabled}} radio button.  The other defaults should be fine, unless you specifically know otherwise:&lt;br /&gt;
* For &#039;&#039;Boot Order&#039;&#039;, lower numbers boot first.  Booting later means more programs are available for use, booting earlier means other programs can use your program.  &lt;br /&gt;
* &#039;&#039;Run as a daemon&#039;&#039; starts the program as a daemon, which is a program that runs in the background.  Unless you have &#039;&#039;explicitly&#039;&#039; written your program as a daemon, leave this checked.  (If you don&#039;t know what a daemon is, don&#039;t worry, you haven&#039;t written one, so leave it checked.)  &#039;&#039;Un&#039;&#039;checking this when your program is a normal program will cause the SBC to hang while booting.&lt;br /&gt;
* The &#039;&#039;Executable or Class&#039;&#039; name should be automatically sensed to be your main Java class&lt;br /&gt;
* &#039;&#039;Arguments&#039;&#039; are any command line arguments you need, just as you would type them into the command line&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Your program must be very, very stable to run properly via the web interface.  Imagine your program running continuously for days, or months on end.  Any memory leaks, over time, will render your program (and the SBC) unusable until a reboot.  Counts or other variables that increase within your program and never reset may create a segmentation fault eventually.&lt;br /&gt;
&lt;br /&gt;
If, for stability purposes, you want your program to start, run for a little while, and then exit so that the SBC operating system can clean up the memory each time, you&#039;ll probably want to use [[#Via Cron|Cron]] to run your program instead.&lt;br /&gt;
&lt;br /&gt;
====Via Cron====&lt;br /&gt;
&lt;br /&gt;
Cron can automatically schedule programs - known as &#039;jobs&#039;, or &#039;cron jobs&#039; - at most once per minute.  Less often than that, it is very flexible, allowing you to run it on certain months, weekdays, hours, etc.  Cron simply reads a special file (your {{Code|crontab}}) and runs whatever programs are listed, with whatever timing they are listed with.  The cron program runs all the time in the background, making it what is known as a Linux &#039;&#039;daemon&#039;&#039;, but the programs it starts as jobs run only as long as they naturally would, and then they exit.&lt;br /&gt;
&lt;br /&gt;
If you need your program to run more often than once per minute, have the program schedule itself while still running.  For example, to run every five seconds, run a fast loop,  and sleep for five seconds. Do this twenty times and exit.  Then schedule this once per minute using cron, and your program will in essence run every five seconds.&lt;br /&gt;
&lt;br /&gt;
Setting up a cron job simply entails editing your {{Code|crontab}} file.&lt;br /&gt;
&lt;br /&gt;
First, you&#039;ll probably want to specify your default editor to be [[#nano|nano]]. Otherwise it will default to {{Code|vi}} and you&#039;ll have to figure out {{Code|vi}} in order to add lines to your crontab:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
export EDITOR=nano&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to edit your crontab file, simply type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
crontab -e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each line of the crontab file is one scheduled job.  Lines that start with a hash &amp;quot;#&amp;quot; are comments and are ignored.  There is an example line in the crontab, and a reminder line at the very end.  Essentially, each line should contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
minute hour dayOfMonth month dayOfWeek  command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*{{Code|command}} is the program you want to run (with absolute path, and arguments)&lt;br /&gt;
** For example, {{Code|./myprogram argument1}} won&#039;t work, but {{Code|/root/code/myprogram argument1}} will&lt;br /&gt;
* Each time argument is either a number, a list of numbers separated by commas, or an asterisk&lt;br /&gt;
** For example, * * * * * means every minute for all days and months, 0,30 * * * * means every thirty minutes (i.e. at the top of the hour and at 30 minutes in) for all days and months&lt;br /&gt;
&lt;br /&gt;
If you already have jobs scheduled, you&#039;ll see them in the file that comes up.  You can edit, add, or delete.  &lt;br /&gt;
&lt;br /&gt;
After you save, you&#039;ll see a little message back in the terminal that says the new crontab file was installed, and it is now scheduled!  Cron always starts every boot, and so if you have edited and installed your crontab as above, the scheduling of your program will start properly even after a reboot of the SBC.  However, if you are having strange scheduling problems, you may want to familiarize yourself with the [[#Software Details|software details]] of how the SBC as a whole determines the current date and time.&lt;br /&gt;
&lt;br /&gt;
=====My Cron Job Doesn&#039;t Work!=====&lt;br /&gt;
&lt;br /&gt;
It is actually very common for a script or program to work on the command line but then &#039;&#039;not&#039;&#039; work as a cron job.  The most common reason for this, by far, is that you specify &#039;&#039;relative&#039;&#039; paths in your program to access files rather than &#039;&#039;absolute&#039;&#039; paths.  For example:&lt;br /&gt;
* {{Code|code/project.c}} is a relative path (bad for cron)&lt;br /&gt;
* {{Code|/root/code/project.c}} is an absolute path (good for cron)&lt;br /&gt;
The cron jobs are &#039;&#039;not&#039;&#039; executed from your home directory, or your code directory, so they will not be using the same location you may be using to test your code.  So always use absolute paths.&lt;br /&gt;
&lt;br /&gt;
Another common reason is you may be using environment variables or other settings that are true in a terminal but are &#039;&#039;not&#039;&#039; true by default in the raw system.  You can end up taking many things for granted in a shell, for example the shortcut &amp;quot;~&amp;quot; means home directory in a shell, but not by default in the raw system.  The things that get loaded for a shell (but which are not present in the raw system) are:&lt;br /&gt;
* The settings loaded by {{Code|/etc/profile}}&lt;br /&gt;
* Any settings in {{Code|~/.bashrc}}, which is nothing by default on the SBC&lt;br /&gt;
&lt;br /&gt;
On a full Linux operating system, you would use the logs written to by cron to find the error output and debug it.  On the SBC, however, cron does not write logs (otherwise, these logs would eat up the SBC memory very quickly even for routine jobs).  For short-term debugging, you can write output from your program to a file, and read that file afterwards to figure out what your program is doing.&lt;br /&gt;
&lt;br /&gt;
====Via a Boot Script====&lt;br /&gt;
&lt;br /&gt;
If you want to run your program constantly and for it to start at boot like the [[#Via the Web Interface|web interface would do]], you can install your program into the boot order using a script.  This is a somewhat involved process, and you should be familiar with shell programming in Linux.  For this process, we only offer a [[OS - Linux#As A Service|similar example]] which installs and runs the program {{Code|phidgetwebservice21}} within the boot sequence.&lt;br /&gt;
&lt;br /&gt;
===Using USB Data Keys===&lt;br /&gt;
&lt;br /&gt;
After plugging the USB key in, it won&#039;t just appear on your desktop, so to speak, so you&#039;ll need to figure out where you can read and write to it within the SSH directory structure.&lt;br /&gt;
&lt;br /&gt;
The web interface program can help with this.  After you plug a USB key in, it will show up under {{Code|Status &amp;amp;rarr; System}}.  Or, the USB key and all other attached devices can be seen at {{Code|Status &amp;amp;rarr; USB}}:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_mounted_devices.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
In the screenshot above, you can see that the USB key is located in {{Code|/media/usb0}}.&lt;br /&gt;
&lt;br /&gt;
Alternately, you can use the SSH command {{Code|mount}}, and the searching program {{Code|grep}} which will filter the response of {{Code|mount}} and only return the lines with your search term ({{Code|usb}}):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep usb&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the USB key can be written to and read from using the {{Code|/media/usb0}} directory.  Copying a file to {{Code|/media/usb0}} will copy a file to the USB key.  The same goes for removing, renaming, opening files within your program, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Mount points like {{Code|/media/usb0}} should not be hard-coded into any of your programs.  (See the [[#Common Problems and Solutions | Common Problems and Solutions]] section for more information.)  If you need to obtain the mount point for a freshly mounted USB key within your code, have your code obtain the mount tables and search on the &#039;&#039;device&#039;&#039;  (e.g. {{Code|/dev/sda1}} or {{Code|/dev/sdb1}}) and obtain the corresponding mounted {{Code|/media/usbN}} location, where N is a number 0-9.&lt;br /&gt;
&lt;br /&gt;
===Saving and Retrieving Data===&lt;br /&gt;
&lt;br /&gt;
This section covers getting data on and off of the SBC.  There are two main methods of simply moving data on and off the SBC - via a [[#Via a USB Key|USB key]], and via [[#Over the Network (SCP)|copy over the network]] - and a third method for moving and installing data when it concerns [[#Backing Up Your Data|backing up lower level system data]].&lt;br /&gt;
&lt;br /&gt;
====Via a USB Key====&lt;br /&gt;
&lt;br /&gt;
After plugging in a USB data key, first you need to [[#Using USB Data Keys | find out the location]] where that data key was mounted.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the location of the USB key is {{Code|/media/usb0/}}, and we want to copy the file {{Code|data.txt}} to the USB key.  Your SSH session might look something like this, using [[#ls|ls]] and [[#mount|mount]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# ls&lt;br /&gt;
data.txt&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
root@phidgetsbc:~# cp data.txt /media/usb0/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cp&#039;&#039;&#039; program copies data from a source to a destination.  The syntax is {{Code|cp from to}}, where here we are copying from {{Code|data.txt}} to {{Code|/media/usb0/}}.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caution:&#039;&#039;&#039; Even if there is no USB key mounted at {{Code|/media/usb0/}}, this use of {{Code|cp}} will still work &#039;&#039;with no errors&#039;&#039;!  This is because there is still a file called {{Code|/media/usb0/}}, there is just no USB key file system &#039;&#039;mounted&#039;&#039; to that point.  So be sure to run [[#mount|mount]] or use some other method of determining that there is, in fact, a USB data key attached and where it is mounted to.&lt;br /&gt;
&lt;br /&gt;
====Over the Network (SCP)====&lt;br /&gt;
&lt;br /&gt;
SCP is a command line program already installed on Linux and Mac OS, and downloadable for free on Windows.  We discuss it and give examples in the [[#SSH|SSH]] section, but remember it here when you&#039;re trying to get data on and off of the SBC.  With SSH or a terminal already open, you&#039;ll probably find it to be much faster and easier than dealing with a USB key.&lt;br /&gt;
&lt;br /&gt;
====Backing Up Your Data====&lt;br /&gt;
&lt;br /&gt;
For the web interface, you can save and restore all web interface settings under the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} tab.&lt;br /&gt;
&lt;br /&gt;
To save the settings of what packages are installed for later re-installation, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg --get-selections &amp;gt; installedPrograms.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then save the file {{Code|installedPrograms.txt}} externally.  If you have to completely wipe the SBC, you can just reinstall the whole list by moving the {{Code|installedPrograms.txt}} file back onto the SBC, and then typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg –set-selections &amp;lt; installedPrograms.txt&lt;br /&gt;
apt-get dselect-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also remember to externally save:&lt;br /&gt;
* Your {{Code|~/.bashrc}} settings file if you&#039;ve changed it&lt;br /&gt;
* Your {{Code|crontab}} file if [[#Via Cron|you&#039;ve edited it]]&lt;br /&gt;
* Any data files or code you&#039;ve created&lt;br /&gt;
&lt;br /&gt;
It is important to save these settings often, and at points where you know the system is running well.  It may be tempting to create a backup right before you [[#Recovery System|wipe the SBC and start from scratch]], but often the reason you are having problems then is some setting or change, and backing these up and reinstalling them will only reinstall the problem.&lt;br /&gt;
&lt;br /&gt;
To truly back the files up, you must copy them to an external computer or location using either a [[#Via a USB Key|USB Key]] or [[#Over the Network (SCP) | over the network]].  Then they can be copied back if needed later.&lt;br /&gt;
&lt;br /&gt;
If you are looking to restore data on an SBC that will not boot properly, you&#039;ll want to be in the [[#Partial Recovery|partial recovery]] portion of our Troubleshooting section.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
The SBC can be quite tricky to debug, because it is a complex and flexible computer.  Common problems and solutions include:&lt;br /&gt;
* You can&#039;t find the SBC on the network at all - refer to the [[#Initial Internet Setup|Initial Internet Setup]] section&lt;br /&gt;
* You have changed some setting or file such that the SBC doesn&#039;t run anymore, or doesn&#039;t run as expected - refer to the [[#Recovery|Recovery]] section&lt;br /&gt;
&lt;br /&gt;
If you are having trouble using Phidgets on the SBC, you should go through the [[OS - Linux#Troubleshooting | Troubleshooting section on the general Linux page]].  Some of the problems on the Linux page (such as library problems) are easier to fix by simply working through the [[#Recovery|Recovery]] section when they occur on the SBC.&lt;br /&gt;
&lt;br /&gt;
Namely, it often helps to simply perform a [[#Factory Reset|factory reset]] on the SBC (save your files and installed program list first, as [[#Backing Up Your Data|described here]]).  Sometimes you change a file or setting within the operating system when you are trying to get something up and running, and this unintentionally affects other programs too.  Performing a factory reset starts you with a clean slate.&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, or the information within this guide, please [[Contact Us|ask us]]!&lt;br /&gt;
&lt;br /&gt;
===Initial Internet Setup===&lt;br /&gt;
&lt;br /&gt;
To set up the SBC, you almost always need a &#039;&#039;wired&#039;&#039; Ethernet connection with DHCP (Dynamic Host Configuration Protocol), and without a firewall.  This connection should be to a &#039;&#039;router&#039;&#039;, not directly plugged in to your computer.&lt;br /&gt;
&lt;br /&gt;
Even if you do not have this type of a connection at home, these types of connections are very common at both offices and universities.  On a Windows or Mac OS computer, you can bring up the [[Phidget Control Panel]] as described in the SBC&#039;s [[1072 User Guide#Getting Started|Getting Started Page]].  Failing this, or on a Linux computer, we discuss some alternate setup methods in this section.  Keep in mind that without a wired, open DHCP connection these setup methods can be difficult and fickle. &lt;br /&gt;
&lt;br /&gt;
====No Wired-Only Connection====&lt;br /&gt;
&lt;br /&gt;
Sometimes it can work to plug the SBC, using Ethernet, directly into an Ethernet port on your home wireless router.  Do not plug it directly into your computer!  (Although in some instances, a direct connection can be made to work on Linux, see the [[#No DHCP|No DHCP]] section below) &lt;br /&gt;
&lt;br /&gt;
This direct-router method is a very picky process, however, and can fail because:&lt;br /&gt;
* Some home and office routers place a firewall between wireless connections (clients) and wired connections (the local area network)&lt;br /&gt;
* Some home and office routers do not by default allow both Ethernet DHCP and wireless DHCP.&lt;br /&gt;
* Some routers and DHCP hubs only provide access to an internet connection, and do not provide local area network inter-connections (this is common on mobile device tethering hubs)&lt;br /&gt;
&lt;br /&gt;
Routers are quite complex, and even with admin privileges it can be a painstaking process to find all the right firewall settings to turn off in order to allow two computers on the network to talk to one another, rather than just connect to the internet.  This is why university or office networks are often ideal for the purpose of setting up the SBC, because these institutions depend on computers on a local network being able to talk together.  University libraries in particular can be a good source of wired DHCP connection ports.  &lt;br /&gt;
&lt;br /&gt;
Covering all of the different router configuration possibilities here, and how to change them to make the SBC work, is essentially impossible.  If you try using the SBC at home or at work, the SBC does not work on the first try when plugged directly into the router via Ethernet, and you want to make that connection work rather than seeking out an alternate for the initial setup, you should find documentation specific to your router (usually available online) and properly configure it.&lt;br /&gt;
&lt;br /&gt;
The good news is that if you can find an Ethernet DHCP connection &#039;&#039;just once&#039;&#039; for a short time, you can use that connection to configure the SBC to work on your home wireless network.  During that initial connection, you can enable wireless and set up as many wireless DHCP connections (with passwords) that you need.  Once wireless is enabled and set up, you can take the SBC home to your wireless router and the SBC will automatically seek out and connect to its remembered networks as they appear.  At that point, you can also use wireless like a normal internet, web interface, and SSH connection.&lt;br /&gt;
&lt;br /&gt;
====No Link Local Addressing====&lt;br /&gt;
&lt;br /&gt;
If you have a wired DHCP connection, no firewall, and no link local addressing (e.g. bonjour or avahi is not installed) then you will need access to the DHCP router logs.  From the router logs, you should see the connection (or attempted connection) by the SBC within the logs.  From that log entry, you should either be able to determine the IP address for the SBC, or see what happens when the router blocks access.  The IP address can be used in place of the link local address for both the web interface and for SSH.&lt;br /&gt;
&lt;br /&gt;
====No DHCP====&lt;br /&gt;
&lt;br /&gt;
The SBC will first try to use DHCP, but then it will revert to responding to a link local address under bonjour and avahi.  If you are depending on this, please wait &#039;&#039;&#039;at least three minutes&#039;&#039;&#039; after the SBC boots for the SBC to fail in obtaining a DHCP connection and properly revert to link local addressing.&lt;br /&gt;
&lt;br /&gt;
If you have a static IP setup, and want to use link local addressing rather than accessing the router logs, this should usually work by default on Windows and Mac OS (e.g. type the address such as {{Code|phidgetsbc.local}} into a web browser).  If it doesn&#039;t work automatically, there is not much you can do and you should seek out a wired DHCP connection elsewhere.&lt;br /&gt;
&lt;br /&gt;
On Linux, it also should work by default, but you have the additional option of explicitly adding routes that look within the default network settings for the SBC.  From a terminal (as root), type:&lt;br /&gt;
* {{Code|route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0 metric 99}}&lt;br /&gt;
* {{Code|route add default dev eth0 metric 99}}&lt;br /&gt;
You can also compile and use the {{Code|phidgetsbclist.c}} example (use the provided Makefile, don&#039;t use gcc) in the [{{SERVER}}/downloads/phidget21/libraries/linux/libphidget.tar.gz Phidget Linux Libraries] package, under the {{Code|examples}} folder.  This will allow you to see if the SBC is detected on the network at all.   Note that to use this option you must have the Phidget Libraries and the Phidget WebService installed on your Linux computer - in-depth instructions to do this are on the [[OS - Linux|main Linux page]].&lt;br /&gt;
&lt;br /&gt;
===Recovery System===&lt;br /&gt;
&lt;br /&gt;
You can either boot the SBC into recovery mode and attempt to recover files and settings, or you can completely wipe the SBC by performing a factory reset.  If the LEDs do not turn on normally (red on constantly, green on at first start, then off, then on when fully booted) then you&#039;ll want to read the [[#Hardware Issues|hardware issues]] section.&lt;br /&gt;
&lt;br /&gt;
====Partial Recovery====&lt;br /&gt;
&lt;br /&gt;
The recovery system can be entered in two ways:&lt;br /&gt;
# From the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} web interface page.&lt;br /&gt;
# By holding down the reset button for 20+ seconds - until the green light has switched from flashing slowly to flashing quickly.&lt;br /&gt;
&lt;br /&gt;
The recovery system runs an [[#SSH|SSH]] server where the username and password both are {{Code|root}}.&lt;br /&gt;
&lt;br /&gt;
If the main filesystem has been damaged/misconfigured in such a way that it won’t boot, you may be able to fix the issue or recover important files before running a full factory reset. From an SSH connection to the recovery system, you can mount the main root filesystem with the following commands (assuming it’s not damaged):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# For 1072 - PhidgetSBC2:&lt;br /&gt;
ubiattach /dev/ubi_ctrl -m 6&lt;br /&gt;
&lt;br /&gt;
# For 1073 - PhidgetSBC3:&lt;br /&gt;
ubiattach /dev/ubi_ctrl -m 7&lt;br /&gt;
&lt;br /&gt;
mount -t ubifs /dev/ubi0_0 /mnt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Factory Reset====&lt;br /&gt;
&lt;br /&gt;
This restores the kernel and root filesystem from backup, overwriting any changes that may have been made and &#039;&#039;completely wiping the system&#039;&#039; to the state that it got shipped in. (You can save your files and installed program list first, as [[#Backing Up Your Data|described here]].)  This can be enacted one of two ways.&lt;br /&gt;
# Use the reset button:&lt;br /&gt;
##Enter the recovery mode by holding down the reset button for 20+ seconds as above (until fast flashing)&lt;br /&gt;
##Wait for a full boot (i.e. you can see it on the [[Phidget Control Panel]], or can SSH with username and password as {{Code|root}})&lt;br /&gt;
##Hold down the reset button again, but this time for only 10 seconds (until slow flashing)&lt;br /&gt;
##Wait for the SBC to fully reset and reboot (at least three minutes) - the LED will turn off and on again when this occurs&lt;br /&gt;
##*Note that after a factory reboot the SSH server will be disabled&lt;br /&gt;
##*Also note that after a factory reboot the SBC creates new SSH keys, and reverts to the {{Code|phidgetsbc.local}} address&lt;br /&gt;
# Via the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, where you can follow the instructions&lt;br /&gt;
&lt;br /&gt;
====Hardware Issues====&lt;br /&gt;
&lt;br /&gt;
The LEDs are an indicator of the hardware working properly.  The normal boot process is:&lt;br /&gt;
* Red LED: Turns on from moment of power being applied.&lt;br /&gt;
* Green LED: Turns on momentarily when power applied, then turns off momentarily, then turns on and stays on when booted.&lt;br /&gt;
&lt;br /&gt;
If the green status LED never turns on (or fails to turn on the second time), the boot process is failing somewhere.  This could be due to:&lt;br /&gt;
* A damaged OS - Try performing a [[#Factory Reset|Factory Reset]]&lt;br /&gt;
* If this fails, it is likely hardware damage (very difficult to diagnose, please [[Contact Us|contact us]])&lt;br /&gt;
&lt;br /&gt;
If neither LED turns on, hardware damage is even more likely.  Unless the path to the red LED is the one thing that has been damaged, the device is likely not receiving and using power.&lt;br /&gt;
* Try performing a [[#Factory Reset|Factory Reset]], and if that does not work please [[Contact Us|contact us]]&lt;br /&gt;
&lt;br /&gt;
=====USB Issues=====&lt;br /&gt;
&lt;br /&gt;
On the Phidget SBC2, there is a hardware issue that is unrelated to the LEDs.  It is a USB problem, and manifests in many ways:&lt;br /&gt;
* Strange behaviour when some devices but not others are plugged in to the SBC&lt;br /&gt;
* Strange behaviour with combinations of devices&lt;br /&gt;
* Failure (or intermittent failure) to see Phidgets on the USB hub, or USB keys on the hub&lt;br /&gt;
&lt;br /&gt;
This problem is fixable, either on your own or by sending your SBC back to Phidgets.  For an in-depth solution, see the [[SBC2_USB_Hub_Fix | SBC2 Hub Fix Page]].&lt;br /&gt;
&lt;br /&gt;
===Updating Your SBC===&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve owned your SBC for a while and want to update your packages, you can run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...to &#039;&#039;update&#039;&#039; your software source list and then &#039;&#039;upgrade&#039;&#039; to the latest version of all installed software.  If you are used to Mac OS or Windows, note that this does not just update the non-kernel parts of the operating system, it updates every additional piece of software you have installed.&lt;br /&gt;
&lt;br /&gt;
To update the SBC software itself (e.g. the kernel), it is easiest to use the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, to enter a page that will give you the option to update.  You will need to have an update file on a USB key inserted into the SBC, of type:&lt;br /&gt;
* UBI Image (system_ubi.img), or &lt;br /&gt;
* Kernel image (uImage), or&lt;br /&gt;
* Phidget Upgrade package containing both UBI and Kernel images (phidgetsbc*.bin)&lt;br /&gt;
&lt;br /&gt;
These are either obtained from the Phidgets website, or are a custom kernel / filesystem that you can create yourself, if you are experienced.&lt;br /&gt;
&lt;br /&gt;
The reason why this information is in troubleshooting is that you should certainly [[#Backing Up Your Data|back up your system]] before trying this.  And, it is quite rare to need to upgrade the kernel or filesystem on the SBC, so something serious should be going on before you attempt it.  Try using the [[#Recovery System|recovery system]] first.&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
Now that you have the basic libraries installed, you can pick your language and begin programming!  &lt;br /&gt;
&lt;br /&gt;
If you are not using the [[#WebService | webservice]] to control a Phidget over a network, your next step will be to delve into the use of your specific language.  Each page has its own set of specific libraries, code examples, and setup instructions.  &lt;br /&gt;
&lt;br /&gt;
On SBC Linux, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Java | Java]]&lt;br /&gt;
*[[Language - Python | Python]]&lt;br /&gt;
&lt;br /&gt;
These languages may also run on the SBC, but we do not yet directly offer SBC support for them:&lt;br /&gt;
* [[Language - Ruby|Ruby]]&lt;br /&gt;
* [[Language - C Sharp|C#]] (using Mono)&lt;br /&gt;
&lt;br /&gt;
You can probably figure out how to install and use them by a combination of the language pages linked above, and the section on [[#Installing Other Languages|installing other languages on the SBC]].&lt;br /&gt;
&lt;br /&gt;
==WebService==&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the [[Phidget WebService]] installed, and the SBC automatically starts the WebService at boot.&lt;br /&gt;
&lt;br /&gt;
To practice using the WebService, and to learn more about it, we have hands-on examples on the [[OS - Linux|general Linux page]], starting in the [[OS - Linux#Using the WebService|using the WebService section]].&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Shutting off USB ports to save power===&lt;br /&gt;
The SBC3 has an on-board USB hub that can control power to the ports. To do this unbind and rebind the USB drivers.&lt;br /&gt;
&lt;br /&gt;
To turn off the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/unbind}}&lt;br /&gt;
&lt;br /&gt;
To turn on the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/bind}}&lt;br /&gt;
&lt;br /&gt;
These will also cause detach and attach events for the Phidget devices, respectively. While the drivers are unbound, you will not get any hot plug events for any devices on USB.&lt;br /&gt;
&lt;br /&gt;
===Using a Touchscreen===&lt;br /&gt;
Please note that this will ONLY work with an SBC3 since it has a USB 2.0 hub:&lt;br /&gt;
&lt;br /&gt;
Using a touchscreen with the SBC is a great way to get user input and visual feedback from an SBC otherwise devoid of visual output.  The SBC does not have any conventional display ports such as VGA, DVI, or HDMI but it does have a number of USB ports and USB displays do exist.  With the upgrade to a USB 2.0 hub on the SBC3 from the earlier models which had USB 1 hubs the SBC now has enough capability to operate a screen over USB.  We don&#039;t recommend running a standard desktop environment since the processor is too slow to really keep up with a typical desktop it does make for an excellent interface for a kiosk, instrumentation control panel or  other, similar use case.  This document is going to go through the process of enabling support for a typical USB display as well as installing a fairly compact desktop environment called xfce on the SBC.  &lt;br /&gt;
&lt;br /&gt;
The screen I will be using is from a company called [http://lilliputweb.net/ Lilliput].  Specifically a UM-70 model.  Before you begin, please make sure that you have the screen plugged into the SBC, it will also be useful to have a spare USB keyboard and mouse handy as you will need them once you are no longer using an SSH terminal to communicate with the SBC.&lt;br /&gt;
&lt;br /&gt;
[[File:lilliputoff.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Getting the display to function====&lt;br /&gt;
Begin by logging into the web configuration page for your SBC and upgrading all of the packages on the SBC.  Be sure to include the full Debian package repository.  For more information on how to do this refer to the  [[OS - Phidget SBC#Getting Started - External Computer|getting started]] section of the Phidget SBC documentation.  Once you are fully up to date open an SSH session with the SBC and navigate to the &amp;quot;/etc&amp;quot; folder.  Open inittab with a terminal-based text editor such as nano and add the following to the bottom of the file, just above the {{code|T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100}} line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
1:2345:respawn:/sbin/getty 38400 tty1 &lt;br /&gt;
2:23:respawn:/sbin/getty 38400 tty2 &lt;br /&gt;
3:23:respawn:/sbin/getty 38400 tty3 &lt;br /&gt;
4:23:respawn:/sbin/getty 38400 tty4 &lt;br /&gt;
5:23:respawn:/sbin/getty 38400 tty5 &lt;br /&gt;
6:23:respawn:/sbin/getty 38400 tty6 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reboot your system.  After a few minutes you should see the LCD screen come up with a standard Linux terminal interface and a login prompt.  This is all well and good but this isn&#039;t really appreciably better than simply using an SSH session to communicate with the SBC.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputlogin.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Setting up Xfce====&lt;br /&gt;
In order to get a traditional windowing environment we still need to install a desktop manager as well as a number of supporting packages.  Log in and make sure everything is still up to date with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install the following packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xserver-xorg lxde xfce4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the SBC asks you if you want to continue, just type &amp;quot;Y&amp;quot; and press enter.  &lt;br /&gt;
&lt;br /&gt;
This will install the xfce desktop environment and any other necessary programs on the SBC.  When it&#039;s done, restart the SBC.  When it boots back up it should boot directly to a login screen instead of the terminal interface.  Log in, and you are good to go.  It won&#039;t be particularly fast, but don&#039;t worry, the SBC does not have a dedicated video processor on it so it&#039;s perfectly normal for it to be slow.  What&#039;s important is that it works.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputdesktop.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Calibrating the touch screen====&lt;br /&gt;
Unfortunately, by default the screen is calibrated to believe the bottom of the screen is on the right hand side.  This has the effect of making the touch functionality more or less useless until it has been properly calibrated.  To do this, install the following package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xinput-calibrator&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now use xinput calibrator to measure the parameters of your screen.  Launch xinput calibrator (called Calibrate Touchscreen in the programs menu) and follow the instructions on the screen.  The screen should now be functioning at full potential.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Using a Different Wireless Adapter===&lt;br /&gt;
&lt;br /&gt;
The support for the wireless adaptor that Phidgets sells is written into the SBC kernel.  Hence, we do not support using other adaptors. &lt;br /&gt;
&lt;br /&gt;
However, Linux is very flexible, and it is possible (though not easy) to write a custom kernel for the SBC and add support for a new wireless adaptor.  We can&#039;t help you with this, but we do provide some basic guidelines for [[#Custom Kernel and Filesystem|building your own kernel]].  You can also have a look at our thoughts on our own experience with choosing a Wifi adapter: [[Alternative Wi-Fi Adapters on the SBC]].&lt;br /&gt;
&lt;br /&gt;
===Using a Different Webcam===&lt;br /&gt;
&lt;br /&gt;
In addition to the webcam that Phidgets sells, you have the option to use many different webcams with the SBC.  There is a [http://www.ideasonboard.org/uvc/#devices long list] of compatible webcams.&lt;br /&gt;
&lt;br /&gt;
The common thread for these webcams is that they use UVC - the USB Video Class - drivers for Linux.  You can then use [[#mount|mount]] to find out what video device your webcam is mounted under.&lt;br /&gt;
&lt;br /&gt;
===Taking Pictures With the Webcam===&lt;br /&gt;
&lt;br /&gt;
Probably the most straightforward way to use a webcam for pictures rather than video is to use the {{Code|opencv}} library.  You can get it by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libcv2.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there is no {{Code|libcv2.1}} package, you can perform {{Code|apt-cache search libcv}} to find the current version.&lt;br /&gt;
&lt;br /&gt;
The opencv libraries can also be used within Python, by installing the link between them:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python-opencv&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then taking pictures from within code becomes quite simple.  For example, in Python, taking and saving an image is four lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
#! /usr/bin/python&lt;br /&gt;
&lt;br /&gt;
import cv&lt;br /&gt;
&lt;br /&gt;
# The webcam is located at /dev/video0 &lt;br /&gt;
# OpenCV only needs the number after video&lt;br /&gt;
webcam = cv.CaptureFromCAM(0)&lt;br /&gt;
&lt;br /&gt;
frame = cv.QueryFrame(webcam)&lt;br /&gt;
&lt;br /&gt;
cv.SaveImage(&amp;quot;image.jpg&amp;quot;, frame)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the complete OpenCV documentation, see [http://docs.opencv.org/ The OpenCV Reference], and specifically the section on reading and writing images.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The SBC is probably not as powerful for image processing and transport when compared to your desktop computer.  Try running your image processing code on the SBC from an early point in development.  During those test runs, you can visit the first System page of the [[#SBC Web Interface|SBC Web Interface]] to check the processor and memory use.  For more information on processor power, check the specification for your SBC (on the product page on [{{SERVER}} our main website]) as well as our discussion of [[#Pushing Processor Limits|pushing processor limits]] below.&lt;br /&gt;
&lt;br /&gt;
===Checking System Logs===&lt;br /&gt;
&lt;br /&gt;
The SBC maintains two logs: a kernel log and a system log.  &lt;br /&gt;
&lt;br /&gt;
The kernel log is for low-level occurrences, such as devices attaching and leaving the USB hub, recording what drivers are being used, and so on.&lt;br /&gt;
&lt;br /&gt;
The system log (syslog) is for normal chatter from the operating system.  Any program with the right permissions can use it (though you need to know the method to write to it, information all around the Internet can help) and it contains everything from the Ethernet going up and down, to webserver requests, and so on.  If you don&#039;t run many programs or services on the SBC, the syslog will essentially be a mirror of the kernel log, because the kernel is the only thing talking.&lt;br /&gt;
&lt;br /&gt;
You can check these logs by using the web interface in the {{Code|System &amp;amp;rarr; Logs}} tab.&lt;br /&gt;
&lt;br /&gt;
Or you can perform more powerful filtering and displaying via an SSH terminal.  For example, {{Code|dmesg}} is the command to display the kernel log, and {{Code|tail}} prints the last ten lines of input.  So, if you are trying to see if you can get a device to be detected on USB, you can run &amp;lt;code&amp;gt;dmesg | tail&amp;lt;/code&amp;gt; to print the latest ten lines of kernel log data.&lt;br /&gt;
&lt;br /&gt;
The actual locations of the log files (for filtering and reading) are:&lt;br /&gt;
* {{Code|/var/log/syslog}} &lt;br /&gt;
* {{Code|/var/log/dmesg}}&lt;br /&gt;
But don&#039;t edit them directly!  Always follow the advice and procedures around the Internet on how to properly log items to syslog.&lt;br /&gt;
&lt;br /&gt;
===X Forwarding===&lt;br /&gt;
&lt;br /&gt;
Although most tasks can be done using the [[#SBC Web Interface|SBC Web Interface]] or [[#SSH|SSH]], you can also set up X11 forwarding on the SBC.  X11 is the window manager base, which provides a graphical windowing system on the SBC.  Although you probably won&#039;t connect directly to the X11 manager (i.e. by plugging a screen directly into the SBC), X11 also gives a user the ability to forward graphical windows over SSH.  You will need the following packages installed:&lt;br /&gt;
* {{Code|x11-common}}&lt;br /&gt;
* {{Code|xbase-clients}}&lt;br /&gt;
After installing, make sure that the line in {{Code|/etc/ssh/sshd_config}} has a line that says:&lt;br /&gt;
:{{Code|X11Forwarding yes}}&lt;br /&gt;
Then log out and log back into the SBC.  This second time you log in, use the {{Code|-X}} switch to turn on X forwarding for that connection:&lt;br /&gt;
:{{Code|ssh -X root@phidgetsbc.local}}&lt;br /&gt;
Then you should be able to run programs that launch a window, and it will launch remotely and appear on the computer you have the SSH connection from.&lt;br /&gt;
&lt;br /&gt;
===Pushing Processor Limits===&lt;br /&gt;
&lt;br /&gt;
The SBC, though more powerful than many embedded computers out there, is probably about as powerful as your smartphone.  If you hook up 1 ms Phidget sampling devices to all six of its USB ports, events and packets will probably get lost.  The exact data rates you can accomplish depend on:&lt;br /&gt;
* What else is running on the SBC&lt;br /&gt;
* How efficient your code is for external operations (like File I/O)&lt;br /&gt;
* Other minor details (e.g. the temperature of the SBC, etc)&lt;br /&gt;
&lt;br /&gt;
If you want to achieve data rates as fast as possible, try these tips:&lt;br /&gt;
* Program in C, not in an interpreted language (Python, Java, .NET)&lt;br /&gt;
* Perform file I/O as little as possible.  Locally cache data, manage your writing to a file in a separate thread, and use low-level write calls.&lt;br /&gt;
* Change the [[#Custom Kernel and Filesystem|filesystem]] to a faster, non-compressed file system.&lt;br /&gt;
** Alternatively, use a high-data-rate USB key.&lt;br /&gt;
* Keep other running processes to a minimum. &lt;br /&gt;
** If you are running code locally right on the SBC, turn off the Phidget WebService.&lt;br /&gt;
&lt;br /&gt;
===Custom Kernel and Filesystem===&lt;br /&gt;
&lt;br /&gt;
You can compile your own kernel and flash it to the board. It is left up to the user to configure an appropriate cross-compiler for kernel development. You may also be able to compile a new kernel on-board.  We have a kernel development kit, complete with patch file and README:&lt;br /&gt;
* [{{SERVER}}/downloads/phidgetsbc/1072/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Compiling a new, custom kernel is somewhat complex.  If the SBC is your first experience with Linux, writing a custom kernel will be difficult.  However, it will probably also be very rewarding because you can put whatever you like into it.  We might be able to offer additional suggestions, but ultimately you&#039;re on your own here. &lt;br /&gt;
&lt;br /&gt;
You may be able to write a custom kernel right on the SBC, but the easiest way is to develop the kernel on an external computer.  And the easiest way to develop on an external computer is for that computer to also be Linux, even just in a Virtual Machine.  The time spent loading a copy of Linux into a virtual machine (such as VirtualBox, which is free) onto your computer will probably be less time than setting up a standard compiler on Windows to cross-compile.&lt;br /&gt;
&lt;br /&gt;
On your external Linux system, you will need:&lt;br /&gt;
* A cross-compiling toolchain for the ARM processor, which we briefly describe on the [[OS - Linux#Cross-Compiling with a Custom Toolchain | main Linux page]], and &lt;br /&gt;
* The [{{SERVER}}/downloads/phidgetsbc/1072/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package] from the Phidgets website.  &lt;br /&gt;
The kernel development kit has a brief README file which describes how to obtain the proper kernel and patch, configure, customize, and build it.&lt;br /&gt;
&lt;br /&gt;
We have an application guide in progress, which walks through building a custom kernel to add Bluetooth support to the SBC.  Please contact us if you would like more information.  Even if you are trying to add support for hardware other than a bluetooth modem, or wondering if support even exists in the kernel for your modem (3G, alternate wireless, etc) you will probably find the application guide helpful.  Follow it up to the point where you run the program {{Code|menuconfig}} (you don&#039;t need an SBC to do this), which will give you a menu of all drivers you can enable in the SBC kernel.&lt;br /&gt;
&lt;br /&gt;
After making your new kernel, you should have a uImage and modules target for your Makefile.  At this point you can transfer your kernel files onto the SBC, make their targets, and transfer them into the nand memory.  This involves erasing the old kernel, flashing the new kernel, installing the new kernel modules, and rebooting.  From the SBC, in the kernel directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
make uImage; make modules&lt;br /&gt;
flash-eraseall /dev/mtd3&lt;br /&gt;
nandwrite -p /dev/mtd3 arch/arm/boot/uImage&lt;br /&gt;
make modules-install&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Custom kernels can also be flashed from the [[#Recovery System | Recovery System]].&lt;br /&gt;
&lt;br /&gt;
If you need to create a root filesystem image, the filesystem type is UBIFS, and the commands to create it are:&lt;br /&gt;
&lt;br /&gt;
====For SBC2:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====For SBC3:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You then flash ‘system_ubi.img’ (not ‘system_ubifs.img’) from the recovery system.&lt;br /&gt;
&lt;br /&gt;
Again, like the custom kernel creation, the need to create a custom root filesystem is essentially non-existent except for those advanced users who already know they need it... and furthermore, you are almost entirely on your own.&lt;br /&gt;
&lt;br /&gt;
===Saving a file system to flash to multiple SBC&#039;s===&lt;br /&gt;
You may want to create a complete backup of your SBC root filesystem, which can then be flashed to other SBCs. This is how it could be done:&lt;br /&gt;
&lt;br /&gt;
You will need a USB drive - we have had issues using cheap flash drives, so a real USB drive is recommended. Make sure it&#039;s empty, as it will be reformatted.&lt;br /&gt;
&lt;br /&gt;
All of these commands are executed on your SBC, while logged in over SSH.&lt;br /&gt;
&lt;br /&gt;
First, re-format the USB drive as ext3. Assuming the USB drive is sda and has a single partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
mkfs.ext3 /dev/sda1&lt;br /&gt;
mount -t ext3 /dev/sda1 /media/usb0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remount / as readonly, so it doesn&#039;t change as we&#039;re copying it. To do this, we need to kill all running processes except sshd:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
service udev stop&lt;br /&gt;
service ifplugd stop&lt;br /&gt;
service rsyslog stop&lt;br /&gt;
service avahi-daemon stop&lt;br /&gt;
service phidgetwebservice stop&lt;br /&gt;
service ntp stop&lt;br /&gt;
service busybox-httpd stop&lt;br /&gt;
service dbus stop&lt;br /&gt;
service cron stop&lt;br /&gt;
pkill dhclient&lt;br /&gt;
mount -o remount,ro /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the remount says that / is busy, do a &#039;ps auxww&#039; and &#039;pkill&#039; anything else that may be running until it remounts properly.&lt;br /&gt;
&lt;br /&gt;
Then, copy / to the flash drive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkdir /media/usb0/root&lt;br /&gt;
mount --bind / /mnt/&lt;br /&gt;
cp -a /mnt/* /media/usb0/root/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, clean up the copy - removing files specific to this board. We also remove the APT cache to save space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
find /media/usb0/root/var/log -type f -print0 | xargs -0 rm -f&lt;br /&gt;
rm -rf /media/usb0/root/var/lib/apt/lists/*&lt;br /&gt;
mkdir /media/usb0/root/var/lib/apt/lists/partial&lt;br /&gt;
rm -f /media/usb0/root/var/cache/apt/*.bin&lt;br /&gt;
rm /media/usb0/root/etc/udev/rules.d/70-persistent-net.rules&lt;br /&gt;
rm /media/usb0/root/etc/ssh/ssh_host_*&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
then, create the ubinize.cfg file:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi	&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs0&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi		&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
vol_flags=autoresize	&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: you may need to increase vol_size if your filesystem is larger.&lt;br /&gt;
&lt;br /&gt;
then, create the UBI image from the copy:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then, unmount the drive to ensure everything is written out properly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you can remove the /root/ folder and system_ubifs.img. system_ubi.img can be flashed to other SBCs using the recovery system.&lt;br /&gt;
&lt;br /&gt;
==Software Details==&lt;br /&gt;
&lt;br /&gt;
For even more advanced uses of the SBC, it may help to know the gritty details of the SBC software system.&lt;br /&gt;
&lt;br /&gt;
;Operating System&lt;br /&gt;
:Debian/GNU Linux&lt;br /&gt;
:Kernel 2.6.X or higher (generally kept up to date with latest releases, use {{Code|uname -r}} to check the kernel version)&lt;br /&gt;
&lt;br /&gt;
;Main Filesystem (rootfs)&lt;br /&gt;
:UBIFS (a raw flash type of file system)&lt;br /&gt;
:Mounted in a 460 MB Nand partition (in Read/Write mode)&lt;br /&gt;
&lt;br /&gt;
;Kernel&lt;br /&gt;
:uImage format&lt;br /&gt;
:Has its own 3MiB partition on bare Nand&lt;br /&gt;
&lt;br /&gt;
;Web Interface Scripts and Configuration Data&lt;br /&gt;
:Located in {{Code|/etc/webif}}&lt;br /&gt;
:Modifying these scripts can be done; however, it is very easy to enter invalid data that could cause the system to behave unexpectedly or not boot.&lt;br /&gt;
&lt;br /&gt;
;User Applications uploaded through Web Interface&lt;br /&gt;
:Located in {{Code|/usr/userapps}}&lt;br /&gt;
&lt;br /&gt;
;Webcam Device Location&lt;br /&gt;
:{{Code|/dev/video0}}&lt;br /&gt;
:Numbers increase with more webcams&lt;br /&gt;
&lt;br /&gt;
;Date and Time&lt;br /&gt;
:Set using ntp (network time protocol) at boot&lt;br /&gt;
:The ntp daemon continues to run in the background and will periodically update the clock &lt;br /&gt;
:The network keeps the SBC very close to real time&lt;br /&gt;
:Also there is a real-time clock with battery backup which will preserve date/time across reboots, power removal&lt;br /&gt;
:The real-time clock is synced to system time during reboot/shutdown&lt;br /&gt;
:If power is unplugged suddenly, and the network not restored, the real-time clock may not have the correct time&lt;br /&gt;
&lt;br /&gt;
;Wireless Networking System&lt;br /&gt;
:Wireless adapter support for the wireless adapter that Phidgets sells is written into the kernel&lt;br /&gt;
:It supports WEP and WPA&lt;br /&gt;
:It is best configured through the configuration interface.&lt;br /&gt;
&lt;br /&gt;
;Nand Layout&lt;br /&gt;
:The board contains 512MiB on Nand. This nand is split into 7 partitions as follows:&lt;br /&gt;
:0: u-boot		 size: 256K		 Read Only&lt;br /&gt;
:1: u-boot_env		 size: 128K		 Read Only&lt;br /&gt;
:2: recovery_kernel	 size: 2M		 Read Only&lt;br /&gt;
:3: kernel		 size: 3M		 Writable&lt;br /&gt;
:4: flashfs	 	 size: ~3.625M	 	 Read Only&lt;br /&gt;
:5: recovery_fs		 size: ~ 43M		 Read Only&lt;br /&gt;
:6: rootfs		 size: ~ 460M		 Writable&lt;br /&gt;
: The final size of flashfs/recovery_fs/rootfs depends on the image size at production, and on the number/location of bad blocks in the NAND.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: U-Boot and recovery kernel and filesystem cannot be written from Linux - this is a safety measure.&lt;br /&gt;
&lt;br /&gt;
;Boot Loader&lt;br /&gt;
:U-Boot is used for setting up the processor and booting Linux, and is only accessible via a serial connection. &lt;br /&gt;
:Normal users will not need to use or modify it.&lt;br /&gt;
:Be very careful when modifying the u-boot partition. If it is damaged or overwritten, it is difficult to fix.&lt;br /&gt;
:When using U-Boot, a prompt will appear via serial shortly after power on.  &lt;br /&gt;
:The environment variables will help you determine how to boot Linux on the SBC&lt;br /&gt;
:You can also refer to the [http://www.denx.de/wiki/DULG/Manual U-Boot documentation]&lt;br /&gt;
&lt;br /&gt;
;Boot Process&lt;br /&gt;
:From power on...&lt;br /&gt;
:1. Processor loads first 4 bytes from NAND into Steppingstone and runs it.&lt;br /&gt;
:2. Steppingstone sets up RAM, copies u-boot from NAND into RAM and runs U-Boot.&lt;br /&gt;
:3. U-Boot initializes the processor, sets GPIO state, etc., copies the linux kernel into RAM, sets up the kernel command line arguments, checks that the kernel image is valid, and boots it.&lt;br /&gt;
:4. Linux boots, bringing up USB, Networking, NAND, etc. and then mounts the rootfs NAND partition on /.&lt;br /&gt;
:5. init gets run as the parents of all processes, as uses the /etc/inittab script to bring up the system. This includes mounting other filesystems, settings the hostname, and running the scripts in /etc/init.d, among other things.&lt;br /&gt;
:6. inittab then turns the green LED on.&lt;br /&gt;
:7. inittab then sets up a getty on the first serial port, ready for interfacing using the debug board.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|PHP Curl|Curl doesn&#039;t install smoothly}}&lt;br /&gt;
&lt;br /&gt;
There is an issue with the embedded version of PHP5.3, try forcing it to install the specific version that you need.  This can be done with the following command:&lt;br /&gt;
&lt;br /&gt;
{{Code|apt-get install php5-common&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;5.3.3-7+squeeze14}}&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|FTDI Errors|FTDI adapters do not appear to work with the SBC}}&lt;br /&gt;
&lt;br /&gt;
The 3.1.6 version of the Linux kernel which is used on some versions of the SBC has a bug that causes issues with FTDI drivers and makes them malfunction.  To solve this problem you must upgrade the kernel to a newer version.  You can find the files [[#Quick Downloads| here]].&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|USB Memory Key mounting|Sometimes USB Memory Keys mount at more than one location}}&lt;br /&gt;
&lt;br /&gt;
When you insert a memory key, the SBC will load it as a device (e.g. {{Code|/dev/sda1}}) and it will also &#039;&#039;mount&#039;&#039; the key for reading and writing within the {{Code|/media/}} directory.  The {{Code|/media/}} directory version will be called something like {{Code|usb0}}.  &lt;br /&gt;
At times, an inserted memory key will get mounted in more than one location.  You can observe if this occurs by checking the currently mounted devices with the command {{Code|mount}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
/dev/sda1 on /media/usb1 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will note that the same device ({{Code|/dev/sda1}}) is now mounted at &#039;&#039;both&#039;&#039; {{Code|/media/usb0}} and {{Code|/media/usb1}}.  To fix this problem as it occurs, you can use {{Code|umount}} (notice there is no letter &#039;n&#039;) to unmount the second instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# umount /media/usb1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In practice, this should not be a problem, because writing to or reading from either {{Code|usb0}} or {{Code|usb1}} will have the same effect on the memory key.  However, if you hard-code a media location into your program (i.e. expecting {{Code|/media/usb0}} to be the first USB key you insert and {{Code|/media/usb1}} to be the second key) your program will sometimes work and sometimes fail.  &lt;br /&gt;
&lt;br /&gt;
To get around this within code, find the mount point for each device as it appears.  The devices, such as {{Code|/dev/sda1}} will always refer to the actual memory key.  But, they cannot be written to directly without being mounted, so you will have to parse the mount table (what is returned from {{Code|mount}}) within your code to find the device and its corresponding mount point.&lt;br /&gt;
&lt;br /&gt;
This is a problem with the standard embedded Debian automount program, and we have no known fix.&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|Perl Locale Errors on SSH|No Locales Installed}}&lt;br /&gt;
&lt;br /&gt;
By default, no locales are installed on the SBC.  If you use [[#apt|apt]] a lot to install and manage your software on the SBC, you will get messages like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
perl: warning: Setting locale failed.&lt;br /&gt;
perl: warning: Please check that your locale settings:&lt;br /&gt;
	LANGUAGE = (unset),&lt;br /&gt;
	LC_ALL = (unset),&lt;br /&gt;
	LANG = &amp;quot;en_CA.UTF-8&amp;quot;&lt;br /&gt;
    are supported and installed on your system.&lt;br /&gt;
perl: warning: Falling back to the standard locale (&amp;quot;C&amp;quot;).&lt;br /&gt;
locale: Cannot set LC_CTYPE to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_MESSAGES to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_ALL to default locale: No such file or directory&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To squelch these messages, you should install and reconfigure your locale like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install locales&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command will show you a long list from which you should pick your location, by language.  For example, en_CA is english_Canada.  Here in Calgary, we use en_CA.UTF-8 and so for the first question we would input locale &amp;quot;114&amp;quot; and for the second (system) question we would input {{Code|en_CA}} for the locale.&lt;br /&gt;
&lt;br /&gt;
This might give you a locale undefined error, in which case you can generate the locale (for us, again, it is en_CA):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
locale-gen en_CA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=24124</id>
		<title>OS - Phidget SBC</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=24124"/>
		<updated>2019-07-31T21:28:37Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
{{OSLang|[[File:icon-Linux.png|64x64px|link=OS - Linux]]|On the Single Board Computer (SBC), Phidgets can be either plugged directly into one of the USB ports or run over a network using the [[#WebService | WebService]].}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Unlike our other supported operating systems, the SBC &#039;&#039;&#039;does not require downloads&#039;&#039;&#039; unless you are doing something advanced like loading the firmware or developing your own kernel.  You will know if you need these downloads, otherwise, the SBC should work as described on the [[1073 User Guide#Getting Started|SBC3 Getting Started Guide]] right out of the box.&lt;br /&gt;
&lt;br /&gt;
*[[Software License]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC (1070):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1070/changelog.txt changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1070/phidgetsbc-minimal.bin Minimal Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1070/phidgetsbc-full.bin Full Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1070/buildroot-phidgetsbc.tar.gz Buildroot/Kernel Sources]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC2 (1072):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1072/changelog.txt changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1072/phidgetsbc2.bin SBC2 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1072/phidgetsbc2-kerneldev.tar.gz SBC2 Kernel Development Package] (How-to and patch file)&lt;br /&gt;
&#039;&#039;&#039;The PhidgetSBC3 has different firmware packages based on the kernel version. In order to determine the device version of your SBC3, see the [[1073_User_Guide#SBC_Web_Interface|web configuration page]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:sbcver.jpg|thumb|562px|link=|The system information table is found on the Status -&amp;gt; System tab of the &#039;&#039;&#039;[[1073_User_Guide#SBC_Web_Interface|web configuration page]]&#039;&#039;&#039; of the SBC.]]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.6.3:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/changelog.txt changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.6.3/phidgetsbc3.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.6.3/phidgetsbc3-kerneldev.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.6.3/phidgetsbc3-upgrade_3.6.3_3.14.27.tar.gz SBC3 Kernel upgrade package (3.6.3 -&amp;gt; 3.14.27)]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.14.27:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/changelog.txt changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.14.27/phidgetsbc3.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.14.27/phidgetsbc3-update_3.14.27.tar.gz SBC3 Kernel update package (3.14.27)]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.14.27/phidgetsbc3-kerneldev.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Note that, instead of using the firmware to update your SBC, updates should normally be done via the System -&amp;gt; Packages page on your SBC3 web interface. It is rarely necessary to completely re-flash your device..&lt;br /&gt;
&amp;lt;br clear = all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Getting Started with the Phidget SBC Debian Linux==&lt;br /&gt;
&lt;br /&gt;
The Single Board Computer (SBC) is a unique Phidget.  It is a computer with a Linux operating system.  It can compile code, save files, manage background jobs, host information over the web, and more.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If this is your first time&#039;&#039;&#039; using the Phidget SBC, you will want to start with the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  After that, here we will get you started on topics beyond those in the getting started guide, including how to write Phidget code to run on the SBC.  You &#039;&#039;&#039;do not need this page&#039;&#039;&#039; if you are simply using the SBC to broadcast data from Phidgets over the network - it does that automatically.  We describe how to verify and use this in the [[1073 User Guide#Getting Started | Getting Started Guide]].&lt;br /&gt;
&lt;br /&gt;
This page will show you how to:&lt;br /&gt;
* Install the ability to write and develop code on the SBC itself&lt;br /&gt;
* Use the command line for basic coding tasks&lt;br /&gt;
* Troubleshoot the SBC&#039;s network&lt;br /&gt;
It will also give additional specifications, which are useful for doing more advanced things with the SBC hardware and software.&lt;br /&gt;
&lt;br /&gt;
Before reading this page, you should have done the following via the Getting Started Guide:&lt;br /&gt;
* Set up networking on your SBC, via either Ethernet or wireless&lt;br /&gt;
* Set up an admin password&lt;br /&gt;
* Learned the IP address or link local address of the SBC&lt;br /&gt;
We will use this information in setting up the libraries and drivers to use the SBC for writing and running code.&lt;br /&gt;
&lt;br /&gt;
Conceivably, you could simply use the SBC like any Linux computer, and do all of your development and compiling of Phidget code on the SBC itself.  In practice this gets complicated as the SBC does not have a keyboard or screen.  So usually, you will want to develop your code an external computer and copy files and settings over to the SBC via a network.  This makes this Getting Started section unique, in that we show you how to set up both computers:&lt;br /&gt;
* Your [[#Getting Started - External Computer | External Development Computer]], usually your main desktop or laptop which will transfer files and settings to and from the SBC&lt;br /&gt;
* The [[#Getting Started - The SBC (Debian Linux) | SBC]] itself, which needs programming language libraries to use Phidgets.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - External Computer===&lt;br /&gt;
&lt;br /&gt;
You have two ways to connect to the SBC from an external computer: via the [[#SBC Web Interface|SBC Web Interface]] and over the more powerful but complex [[#SSH | Secure Shell (SSH)]].&lt;br /&gt;
&lt;br /&gt;
====SBC Web Interface====&lt;br /&gt;
&lt;br /&gt;
You have already worked extensively with the web interface in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  This was the tool within a web browser which was opened either via the [[Phidget Control Panel]] on Windows, or by simply entering the IP or link local address into an internet browser.  It allowed you to set the password, set up internet connectivity, and so on.  &lt;br /&gt;
&lt;br /&gt;
This section doesn&#039;t have more information on the interface; rather, it simply serves as a reminder that you have the web interface as an available tool.  Examples, including screenshots, are placed where appropriate in this document.  The web interface will probably stay your initial go-to way to connect to the SBC, especially for tasks that benefit from graphical interaction, like setting up wireless or using the webcam.&lt;br /&gt;
&lt;br /&gt;
====SSH====&lt;br /&gt;
&lt;br /&gt;
The most flexible way to transfer files and commands to and from the SBC is via a program called &#039;&#039;&#039;ssh&#039;&#039;&#039;.  The ssh program provides command line text access over a network into the SBC.  Using it, you can run programs and give the SBC commands.  The ssh program has a companion program called &#039;&#039;&#039;scp&#039;&#039;&#039; which can copy files back and forth.  If you are unfamiliar with ssh, you can think of it like the command line or a Mac terminal, but with a remote connection to a different computer.  It is a minimal yet effective way to interact with a remote computer.&lt;br /&gt;
&lt;br /&gt;
Before connecting over ssh, you will need:&lt;br /&gt;
* The &#039;&#039;&#039;IP address&#039;&#039;&#039; (such as 168.254.3.0) or &#039;&#039;&#039;link local address&#039;&#039;&#039; (such as phidgetsbc.local) of the SBC&lt;br /&gt;
* The &#039;&#039;&#039;admin password&#039;&#039;&#039; for the SBC&lt;br /&gt;
Both of these items can be found by following the steps in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].&lt;br /&gt;
&lt;br /&gt;
You will also need to enable SSH on the SBC side.  This can be done through the [[#SBC Web Interface| Web Interface]], under {{Code|Network &amp;amp;rarr; Settings}}, by changing the &#039;&#039;SSH Server&#039;&#039; radio button to &#039;&#039;Enabled&#039;&#039; and saving your changes:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_turn_on_ssh.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
=====SSH on Windows=====&lt;br /&gt;
&lt;br /&gt;
The ssh program is not installed on Windows by default.  But, there are a variety of SSH programs available for free. One simple and commonly used program is [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY], and it has the advantage that the executable doesn&#039;t need to install, it just runs.&lt;br /&gt;
&lt;br /&gt;
With PuTTY, when you first run the program it will ask you what to connect to.  Enter the IP address or link local address of the SBC, and then click the SSH radio button right below the address, which will change the port to 22.  Then click open, and you&#039;ll have an ssh connection to the SBC open in a terminal.  It will prompt you for a user name ({{Code|root}}) and password (the admin password).&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, there is an SCP component to PuTTY, called PSCP, which is available from the same [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY download page].  Use of PSCP will be similar with the address, username, and password, except that you will be transferring files instead of sending commands.&lt;br /&gt;
&lt;br /&gt;
=====SSH on Linux and Mac OS=====&lt;br /&gt;
&lt;br /&gt;
Linux and Mac OS already have ssh installed by default.  To run ssh simply open a terminal...&lt;br /&gt;
* {{Code|Ctrl-Alt-T}} on Linux &lt;br /&gt;
* {{Code|Applications &amp;amp;rarr; Utilities &amp;amp;rarr; Terminal}} on Mac OS &lt;br /&gt;
...and type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
ssh root@phidgetsbc.local&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have re-named your SBC, include that name instead of the {{Code|phidgetsbc.local}} link address.  Or, you can use the SBC&#039;s IP address, e.g. something like {{Code|ssh root@168.254.3.0}}&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, the command follows the form of: {{Code|scp from to}}&lt;br /&gt;
&lt;br /&gt;
So, to copy a file {{Code|/root/data.txt}} from the SBC to your local machine, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
scp root@phidgetsbc.local:/root/data.txt .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note the use of the dot &#039;&#039;&#039;.&#039;&#039;&#039; to indicate that scp should put the file in the current local directory.   If you&#039;re not sure what folder the terminal is operating in type {{Code|pwd}} to print the working directory.  Terminals usually start by default in your home folder.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - The SBC (Debian Linux)===&lt;br /&gt;
&lt;br /&gt;
The SBC runs Linux, which is a full operating system. It is stripped down compared to a full desktop release of Linux, but you can compile code on it, run programs, schedule tasks, create and manage files, run a web server, and much, much more.&lt;br /&gt;
&lt;br /&gt;
At this point you have connected to the SBC via the [[#SBC Web Interface|web interface]], and probably also through [[#SSH|SSH]].  This section will help you install libraries and drivers that you probably want - i.e. support for C, Java, and Python.  After this section, you&#039;ll be well into the depths of using the SBC as a computer, and so you&#039;ll probably want to keep the [[#Using SBC Linux|Using SBC Linux section]] open for reference while you work if you are not already familiar with Linux.&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the following Phidget functionality installed:&lt;br /&gt;
* The Phidget C libraries {{Code|libphidget21.so}}&lt;br /&gt;
* The Phidget [[#WebService | WebService]]&lt;br /&gt;
(If you are simply curious what these are and how they get installed, we describe the process on the [[OS - Linux | general Linux page]].)&lt;br /&gt;
&lt;br /&gt;
But to compile C programs, or run Java programs, or use Python, you will need to install these languages onto the SBC.  &lt;br /&gt;
&lt;br /&gt;
Before installing anything on the SBC, however, (even via a button on the web interface) make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
====Installing C/C++ and Java====&lt;br /&gt;
&lt;br /&gt;
The simplest way to install C/C++  and Java on the SBC is via the web interface.  There is a button under {{Code|System &amp;amp;rarr; Packages}} to install C support (including {{Code|gcc}}) and another button to install Java support:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_packages_web.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
You have to check that you are running the same version of Java on your development machine (where you plan on compiling the java programs) as the SBC is running. To do this type the following into the terminal on your computer and from ssh on the SBC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
Java -version&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need to update the version of Java on your SBC, use the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install openjdk-7-jre-headless&lt;br /&gt;
su&lt;br /&gt;
update-alternatives --config java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you&#039;re ready to begin programming.  We have programming pages for both [[Language - C/C++|C/C++]] and for [[Language - Java|Java]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].  &lt;br /&gt;
&lt;br /&gt;
If you want to avoid using the [[#SSH|SSH]] interface on the SBC entirely, and you want to write your program in Java and run it continuously from boot (which is the only option if you want to avoid [[#SSH|SSH]]), we have a [[#Program in Java with the Web Interface|very in-depth section]] on that topic.&lt;br /&gt;
&lt;br /&gt;
====Installing Python====&lt;br /&gt;
&lt;br /&gt;
Installing Python has two steps.  First, you&#039;ll need to install the basic ability to run python, and then you&#039;ll need to install the Phidget Python module.  Both steps (and both options) require that you issue the relevant commands through an [[#SSH|SSH terminal]].&lt;br /&gt;
&lt;br /&gt;
=====Basic Python=====&lt;br /&gt;
&lt;br /&gt;
The base Python functionality can be downloaded and installed in one step with [[#apt|apt]] (i.e. in a terminal, type):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will give you Python, and now you just have to install the Phidget Python module to gain Phidget functionality. If the installation fails because it can&#039;t find python, you need to enable the full repository as described in [[#Getting Started_-_The_SBC_(Debian_Linux)|this section]], and then perform an apt-get update.&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 1: Use a USB Key=====&lt;br /&gt;
&lt;br /&gt;
Copy the [{{SERVER}}/downloads/phidget21/libraries/any/PhidgetsPython.zip Python Libraries] onto a USB key.  Unpack the zip file into a folder on the USB key.  Insert the key into the SBC.&lt;br /&gt;
&lt;br /&gt;
You will have to figure out where the USB key (and the Phidget Python library folder) is now located.  We describe how in the general [[#Using USB Data Keys | Using USB Data Keys]] section.&lt;br /&gt;
&lt;br /&gt;
After you know the place where the USB key is mounted, in a terminal go to that directory (e.g. type {{Code|cd /media/usb0/}}), enter the unpacked Phidget Python Library folder, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have an whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 2: Use the Internet=====&lt;br /&gt;
&lt;br /&gt;
Rather than using a USB key to transfer the file, the SBC can download it directly from the internet.  You will need {{Code|wget}} and {{Code|unzip}} installed, both of which are small:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install wget&lt;br /&gt;
apt-get install unzip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the web link address for the [{{SERVER}}/downloads/phidget21/libraries/any/PhidgetsPython.zip Python Libraries].&lt;br /&gt;
&lt;br /&gt;
In an SSH terminal to the SBC, type: {{Code|&amp;lt;nowiki&amp;gt;wget http://www.python_library_link&amp;lt;/nowiki&amp;gt;}} where instead of &amp;lt;nowiki&amp;gt;http://www.python_library_link&amp;lt;/nowiki&amp;gt; you insert the link you just copied. Copying into a terminal can usually be done via the right-click menu.&lt;br /&gt;
&lt;br /&gt;
This will download the Phidget python libraries to the folder you ran the {{Code|wget}} command in.  Unzip the downloaded file using the command {{Code|unzip file}}, where file is the filename from {{Code|wget}}. Or try typing {{Code|ls}} to list the names of a file in the directory, which should include the unzipped folder.  Enter the unzipped folder (e.g. use {{Code|cd}} to change directory), and install the Phidget Python libraries:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have a whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
====Installing Other Languages====&lt;br /&gt;
&lt;br /&gt;
You may also be able to program on the SBC using [[Language - Ruby|Ruby]] and [[Language - C Sharp|C# under Mono]], though we do not offer in-depth support for these languages on the SBC.  The installation procedures should more or less follow that of [[#Installing Python|installing python]] on the SBC, except you will be installing Ruby or Mono.  Performing package searches using [[#apt|apt cache search]] can help you find the relevant software.&lt;br /&gt;
&lt;br /&gt;
For C#, as of 2012 the {{Code|mono-complete}} package is broken on the Debian Squeeze repository.  Rather, you have to install the Mono runtime and Mono compiler separately.&lt;br /&gt;
&lt;br /&gt;
To install the runtime package (and its dependencies), use [[#apt|apt]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-runtime&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to install the C# compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-gmcs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or the Visual Basic compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-vbnc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, the system and library packages do not link correctly for the version 2.0 of Mono.  If this is the case, your code will compile fine, but when you try to run it, you will get an error like:&lt;br /&gt;
&lt;br /&gt;
:{{Code|The assembly mscorlib.dll was not found or could not be loaded.}}&lt;br /&gt;
:{{Code|It should have been installed in the `/usr/lib/mono/1.0/mscorlib.dll&#039; directory.}}&lt;br /&gt;
&lt;br /&gt;
In this case, you need to install these two packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libmono-corlib1.0-cil&lt;br /&gt;
apt-get install libmono-system1.0-cil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we found these packages to work by working through the tree structure.  As a general rule, you can find these dependencies by using install (here, {{Code|apt-get install mono-complete}}) to get a sense of the package tree structure.  This will possibly tell you that the packages are broken, but at the same time this will list the dependencies of the packages.  Trying to install individual dependencies will show you that although a root-package fails, the sub-packages will sometimes succeed, and install what you need.&lt;br /&gt;
&lt;br /&gt;
If you want to use a specific dll or library that is not available in this reduced version of mono, you can install mono complete by switching from Emdebian+Debian to just Debian.  To do this:&lt;br /&gt;
&lt;br /&gt;
In {{Code|/etc/apt/preferences}} make the following changes:&lt;br /&gt;
:{{Code|Package: *}}&lt;br /&gt;
:{{Code|&amp;lt;nowiki&amp;gt;Pin: release a=stable&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
:{{Code|Pin-Priority: 1010}}&lt;br /&gt;
	&lt;br /&gt;
In {{Code|/etc/apt/sources.list/mutistrap-debian.list}} remove the emdebian line.&lt;br /&gt;
&lt;br /&gt;
Apply the changes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get dist-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many packages will be &#039;downgraded&#039; from the emdebian to debian versions.  Delete the {{Code|&amp;lt;nowiki&amp;gt;/etc/apt/preferences&amp;lt;/nowiki&amp;gt;}} file and install mono-complete:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install monodoc-http mono-complete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Choose monodoc-http explicitly, because otherwise the install fails on monodoc-browser.&lt;br /&gt;
&lt;br /&gt;
After this process, you can compile your C# Code.cs Phidget source file the same way as on a generic [[Language - C Sharp#Linux|Linux with Mono]] system.  Please refer to that page on how to obtain the *.dll Phidget resource file and compile your code.  On the SBC, however, because you are already running as root (the Super User), you do not need &#039;sudo&#039; and indeed the SBC will give you an error if you use it.  Instead, compiling and running will look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
gmcs Code.cs -r:Phidget21.NET.dll&lt;br /&gt;
mono Code.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using SBC Linux==&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve set up communication with the SBC, and installed whichever programming language support you need, you&#039;re probably ready for a short tour of useful tools on the SBC&#039;s version of Linux.&lt;br /&gt;
&lt;br /&gt;
First, you will by default be running on the SBC as &#039;&#039;&#039;root&#039;&#039;&#039;, which is the super-user.  For Linux users, this probably makes you nervous because you know you can overwrite important system files without the system asking for additional permission.  As a Windows or Mac OS user - although you may usually run your computer as an administrator - your familiar system usually prompts you to confirm before you do anything really dangerous, and this will &#039;&#039;&#039;not&#039;&#039;&#039; happen on the SBC as the root user.&lt;br /&gt;
&lt;br /&gt;
Next, there is no installed help on the SBC.  Help on Linux is usually called &#039;man pages&#039; which is short for &#039;the manual pages&#039;.  On a full Linux system, usually if you need help with any command you can type, for example, {{Code|man ls}} and it will give you help with the program [[#ls|ls]].  But these help pages take up significant space, and they are widely available online.  So, if you need more help with a certain command, you can always type {{Code|man command}} into your favourite search engine.&lt;br /&gt;
&lt;br /&gt;
Finally, the SBC has no windowing system.  For Linux users, this means no X-windows (Gnome, KDE, etc).  And as a Windows or Mac user, you can think of it as running all of your programs and commands through the terminal or DOS prompt command line.  The SBC provides all of the functionality of an operating system (e.g. process scheduling, file management, etc) but without any graphical interface.  The only exception is the [[#SBC Web Interface|web interface]], which gives graphical access to a limited part of what the SBC can do.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands===&lt;br /&gt;
&lt;br /&gt;
If you are doing more with the SBC than simply running pre-written programs [[#Writing a Phidget Program|in Java to run continuously from boot]], you will be interacting with the SBC&#039;s Linux operating system over the command line by using [[#SSH|SSH]].  This section discusses useful programs already installed on the SBC, and how to run them on the command line.&lt;br /&gt;
&lt;br /&gt;
====ls====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;ls&#039;&#039;&#039; program lists the contents of a directory.&lt;br /&gt;
&lt;br /&gt;
It will show both files and folders, but not files that start with a &amp;quot;.&amp;quot; (these are hidden files on Linux).&lt;br /&gt;
*If you also want to show hidden files, use {{Code|ls -a}}&lt;br /&gt;
*If you want more information, such as size and date modified, use {{Code|ls -l}}&lt;br /&gt;
*Commands can be combined, like {{Code|ls -al}}&lt;br /&gt;
&lt;br /&gt;
====cd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cd&#039;&#039;&#039; program changes to a new directory.&lt;br /&gt;
&lt;br /&gt;
For example, {{Code|cd /root}} changes into the directory at the base of the file tree called &#039;&#039;root&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* Linux uses forward slashes&lt;br /&gt;
* The base of all directories is &amp;quot;/&amp;quot; (not &amp;quot;C:\&amp;quot;)&lt;br /&gt;
* The tilde symbol (~) is short for your home directory (i.e. when you are root, this is short for &amp;quot;/root&amp;quot;)&lt;br /&gt;
* The double dot &amp;quot;..&amp;quot; means move one directory higher (for example from {{Code|/root/data/}} to {{Code|/root/}})&lt;br /&gt;
&lt;br /&gt;
====pwd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;pwd&#039;&#039;&#039; program prints the current directory you are working in.  (&#039;P&#039;rint &#039;W&#039;orking &#039;D&#039;irectory)&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
:{{Code|root@phidgetsbc:~# pwd}}&lt;br /&gt;
:{{Code|/root}}&lt;br /&gt;
&lt;br /&gt;
====cp, mv, and rm====&lt;br /&gt;
&lt;br /&gt;
These programs are copy (&#039;&#039;&#039;cp&#039;&#039;&#039;), move (&#039;&#039;&#039;mv&#039;&#039;&#039;), and remove (&#039;&#039;&#039;rm&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Copy copies a file from one location and pastes it to another.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|cp data.txt data_backup.txt}} will put a copy of the file {{Code|data.txt}} into {{Code|data_backup.txt}}&lt;br /&gt;
&lt;br /&gt;
Move moves a file (this is also useful for renaming files) to a new destination.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|mv data.txt data_backup.txt}} will put the contents of {{Code|data.txt}} into {{Code|data_backup.txt}}, and then will remove {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Remove deletes a file.&lt;br /&gt;
&lt;br /&gt;
For example, typing {{Code|rm data.txt}} will delete {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Note that &#039;&#039;&#039;rm&#039;&#039;&#039; is final.  Once you remove a file using {{Code|rm}}, it is gone forever.  There is no recycle bin, no temporary trash, nothing other than backups you may have personally created in the past!&lt;br /&gt;
&lt;br /&gt;
Directories can only be removed with {{Code|rmdir}}, and then only if they are empty.  If you want to remove a directory and all the files in it, use {{Code|rm -rf directory}} but be &#039;&#039;&#039;very, very careful&#039;&#039;&#039; with this command.  Trying to remove everything within a directory (e.g. {{Code|rm -rf *}}) is one of the most dangerous commands you can run on a Linux system, as running it from the wrong directory will result in Linux happily removing everything under that directory -- which could be your entire filesystem.&lt;br /&gt;
&lt;br /&gt;
====find====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;find&#039;&#039;&#039; program does what it says - it finds things.  &lt;br /&gt;
&lt;br /&gt;
Unfortunately for the casual user, the find program is very flexible and powerful, and thus not especially intuitive to use.  But, here are some examples:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|find folder -name file.txt}}&lt;br /&gt;
| Looks for all files in a folder (/ for root - or all - folders) with a certain name (* for wildcard)&lt;br /&gt;
| {{Code|find / -name *.jpg}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|find folder -mtime +X}}&lt;br /&gt;
| Looks for all files in a folder modified less than X days ago&lt;br /&gt;
| {{Code|find /root -mtime +30}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====grep====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;grep&#039;&#039;&#039; program takes text input and searches for a term. &lt;br /&gt;
&lt;br /&gt;
For example, if you type {{Code|mount}} to view what devices are mounted (e.g. loaded) on your SBC, you will see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may be a lot of information you don&#039;t need.  If you are only interested in a USB key attachment (as described in the [[#Using USB Data Keys|Using USB Data Keys]] section), you can use grep to filter that one response:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep sda1&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====nano====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;nano&#039;&#039;&#039; program is a small text editor that you can use within an SSH terminal. &lt;br /&gt;
&lt;br /&gt;
Nano can be surprisingly useful for writing short lengths of code right on the SBC, so there is no need to transfer files and keep track of different file versions on different computers.&lt;br /&gt;
&lt;br /&gt;
Nano has all keyboard commands which are listed at the bottom of the screen at all times as a reminder (Ctrl-O to save, Ctrl-X to exit, these expand with a larger terminal window).  And, nano provides what is called &#039;syntax highlighting&#039;, which colours reserved keywords, comments, strings, and so on as appropriate to the programming language you are using.  Nano detects the programming language via the extension of the file ({{Code|.java}} for Java, {{Code|.c}} for C/C++, and {{Code|.py}} for Python).&lt;br /&gt;
&lt;br /&gt;
Typing {{Code|nano test.py}} on an SSH command line and then entering a few lines of Python into the new empty file results in:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_nano_python.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
====apt====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;apt&#039;&#039;&#039; program allows you to install, uninstall, upgrade, and search software available for the SBC.&lt;br /&gt;
For a non-Linux user, the apt framework may be daunting at first, but it actually allows you to keep your system up to date and install and manage software quickly, easily, and for free.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Before installing anything on the SBC, make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-cache search term}}&lt;br /&gt;
| Looks for all programs (packages) that have {{Code|term}} in the title or description&lt;br /&gt;
| {{Code|apt-cache search opencv}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-cache show package}}&lt;br /&gt;
| Shows a lot of data about {{Code|package}} including size, version, etc&lt;br /&gt;
| {{Code|apt-cache show unzip}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-get update}}&lt;br /&gt;
| Gets the most recent listing of available software&lt;br /&gt;
| {{Code|apt-get update}}  (No options)&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-get install program}}&lt;br /&gt;
| Installs {{Code|program}} from the internet&lt;br /&gt;
| {{Code|apt-get install python}}&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====mount====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|mount}} shows you all of the mounted devices on your SBC.  &lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the non-Linux user, the concept of a device may be quite strange.  To give a short summary, everything on Linux that you can read or write is a file.  Webcams are files (i.e. you can &#039;read&#039; photos from them), USB keys are files, and each filesystem (tmp storage, the kernel portion, the main filesystem) are also themselves files.  These files specify what and how something can be written.  These are not necessarily linear, for example, you can see above that the USB key ({{Code|/media/usb0}} is mounted &#039;&#039;within&#039;&#039; the root file system {{Code|rootfs}} which is /.   &lt;br /&gt;
&lt;br /&gt;
So mount gives you an idea of what devices have been &#039;mounted&#039; for reading or writing, and how you can read and write to them.  More information on mount (and its various forms, like {{Code|umount}}) is available widely around the Internet.&lt;br /&gt;
&lt;br /&gt;
====which====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|which}} tells you if and where a program is installed.&lt;br /&gt;
&lt;br /&gt;
For example, on a default SBC, typing {{Code|which python}} will return no results.  But after successfully [[#Installing Python | installing python]], it will return {{Code|/usr/bin/python}} as the location of the python program/binary/executable.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands to Install===&lt;br /&gt;
&lt;br /&gt;
These are other programs you may find useful on the command line.  Although they are not on the SBC by default, these and other programs can usually be installed simply by using [[#apt|apt-get install]], with the exception of gcc.  For example, {{Code|apt-get install wget}} will download and install [[#wget|wget]].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This section and the section on [[#Some Useful Commands|pre-installed commands]] can hardly cover all of the complexities and power of the Linux operating system.  There are many excellent tutorials online, and between them and using [[#apt|apt]] to find and install programs you should be able to learn a lot and perform any number of complex useful tasks.&lt;br /&gt;
&lt;br /&gt;
====gcc====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;gcc&#039;&#039;&#039; program is the C compiler for Linux.&lt;br /&gt;
&lt;br /&gt;
If you are an experienced C/C++ user on Mac or Linux, or if you&#039;ve already read our [[Language - C/C++ | C Language page]], you might think you need to install gcc via {{Code|apt-get}} to compile C code.  However, gcc is not in the package repository for the SBC, so {{Code|apt-get install gcc}} will fail.  Rather, to install gcc, you can do it via the web interface, as described in the [[#Installing C/C++ and Java|Installing C/C++ and Java]] section.&lt;br /&gt;
&lt;br /&gt;
After installing it via the SBC web interface, you can use {{Code|gcc}} normally.&lt;br /&gt;
&lt;br /&gt;
====less====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;less&#039;&#039;&#039; program displays the contents of a text or source code file.  When displaying the file, {{Code|less}} allows you to scroll up and down to read it.&lt;br /&gt;
&lt;br /&gt;
This is useful if you are writing your sensor readings to a data file, and you want to read the data file while it is being written by your main code.  If your data file is called {{Code|data.txt}}, you can type {{Code|less data.txt}} and see the lines in the file, and what they are.&lt;br /&gt;
&lt;br /&gt;
The {{Code|less}} program output can also be piped into another program.  For example, you can use {{Code|less}} and the word search program {{Code|grep}} to find lines within a file with a search term.  For instance, if you have a C source code file {{Code|Program.c}} on the SBC, and you want to see all the lines in {{Code|Program.c}} that contain a variable name {{Code|var}}, you can type: &lt;br /&gt;
:&amp;lt;code&amp;gt;less Program.c | grep var&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====wget====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;wget&#039;&#039;&#039; program allows you to get an online file (over http) and download it to the SBC.&lt;br /&gt;
&lt;br /&gt;
For example, to get the source file (HTML) from the Phidgets home page, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
wget http://www.phidgets.com&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is most useful for downloading libraries, drivers, or anything (zip, tar, etc) you need from the web which is not available by [[#apt|using apt]].&lt;br /&gt;
&lt;br /&gt;
===Writing a Phidget Program===&lt;br /&gt;
&lt;br /&gt;
We provide two ways to write and upload a Phidget Program:&lt;br /&gt;
# The [[#SBC Web Interface|web interface]]:&lt;br /&gt;
#* This is useful for simple projects written in Java that you want to start only at boot&lt;br /&gt;
#* You can also use C projects, but they must be compiled off the SBC for an ARM processor&lt;br /&gt;
# Over [[#SSH|SSH]], which will allow you to write or transfer source code directly to and from the SBC&lt;br /&gt;
#* This is useful for all other projects, such as:&lt;br /&gt;
#** Projects that run at scheduled times (e.g. once per minute)&lt;br /&gt;
#** Projects that use languages other than Java or ARM-compiled C&lt;br /&gt;
Note that you can still run an [[#SSH|SSH]] project at boot, you just have to write and install a startup script.  This is a bit complex, but we do have an example that starts the program {{Code|phidgetwebservice21}} [[OS - Linux#As A Service|at boot using a script]].&lt;br /&gt;
&lt;br /&gt;
Once you know which method you&#039;d like to use, you can continue on to learn how to [[#Program in Java with the Web Interface|Program in Java with the Web Interface]], or how to [[#Program with SSH|Program with SSH]] using Java, C, or Python.  If you are actually typing in source code on the SBC, you&#039;ll find our [[#Developing Code on the SBC|developing code on the SBC section]] useful.&lt;br /&gt;
&lt;br /&gt;
====Program in Java with the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To show how to write, compile, and install Java programs on the SBC, we&#039;ll use the [[Language - Java|Java Hello World]] example code.  You can download the HelloWorld example by downloading the whole [{{SERVER}}/downloads/phidget21/examples/java/JavaJNI.zip Java example package].  Make sure you have the same version of [[#Installing C/C++ and Java|Java installed on the SBC]] as you have on your external development machine. Instruction for checking and updating are found on the [[#Installing C/C++ and Java|installation page]].&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how to get the HelloWorld code running on the SBC.  On your external computer:&lt;br /&gt;
&lt;br /&gt;
1. Download the SBC version of the Phidget Java libraries ({{Code|phidget21.jar}}).  You can download this from the [[#SBC Web Interface|web interface]], on the page under {{Code|Projects &amp;amp;rarr; Projects}}, under the &#039;&#039;&#039;Notes&#039;&#039;&#039; section.&lt;br /&gt;
&lt;br /&gt;
2. Place the SBC version of {{Code|phidget21.jar}} into a directory on your external computer.  This will be your working directory that you will use to compile the Java files.&lt;br /&gt;
&lt;br /&gt;
3. Also copy the {{Code|HelloWorld.java}} file into that working directory.&lt;br /&gt;
&lt;br /&gt;
4. Compile the {{Code|HelloWorld.java}} file from within that working directory.  From the command line prompt on Windows, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .;phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In a terminal on Linux or Mac OS, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. You should now have three compiled class files: {{Code|HelloWorld.class}}, {{Code|HelloWorld$1.class}}, and {{Code|HelloWorld$2.class}}.  You don&#039;t need to try and run them, and if you do you may encounter an error because the SBC {{Code|phidget21.jar}} may be slightly different than the Phidget support you have installed on your external computer.&lt;br /&gt;
&lt;br /&gt;
Now we move onto the SBC:&lt;br /&gt;
&lt;br /&gt;
6. Create a new project on the SBC, in the web interface under {{Code|Projects &amp;amp;rarr; Projects}}.  Call it HelloWorld:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_create_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
7. On the next screen, you will be prompted to upload your files.  We will upload the three Java class files, and then click the {{Code|Start}} button:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_web_run_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
8. You&#039;ll note that as it runs, there are two links below the {{Code|Stop}} button: One called {{Code|stdout}}, which is &#039;&#039;Standard Output&#039;&#039;, and one called {{Code|stderr}}, which is &#039;&#039;Standard Error&#039;&#039;.  Usually, when you run a program on the command line, you see both standard out and standard error at the same time - i.e. you get all program output right there in your terminal or command prompt.  But when running a program in the background, Linux splits the output up into normal output and error output as this is very useful for debugging (i.e. you can check if standard error is empty).  &lt;br /&gt;
&lt;br /&gt;
Here, however, if you&#039;re not sure whether the program will run correctly, you should first check {{Code|stderr}} to see if any errors were generated, and then check {{Code|stdout}} to see if the output looks as expected.&lt;br /&gt;
&lt;br /&gt;
To write your own Java program, follow the same process but use your own source code instead of the {{Code|HelloWorld.java}} example.&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, we offer additional help on [[#Via the Web Interface|running a program automatically using the web interface]].&lt;br /&gt;
&lt;br /&gt;
====Program with SSH====&lt;br /&gt;
&lt;br /&gt;
Similarly to starting a program via the [[#Program in Java with the Web Interface|web interface]], we use the Phidget Java {{Code|HelloWorld}} example here.&lt;br /&gt;
&lt;br /&gt;
Make sure you have [[#Installing C/C++ and Java|Java installed on the SBC]].  To compile and run the {{Code|HelloWorld}} example:&lt;br /&gt;
&lt;br /&gt;
1. Open an [[#SSH|SSH terminal]] to the SBC&lt;br /&gt;
&lt;br /&gt;
2. Download the [{{SERVER}}/downloads/phidget21/examples/java/JavaJNI.zip Phidget Java Examples] to the SBC, using [[#wget|wget]] (you may need to install {{Code|wget}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
3. Unpack the examples using [[#unzip|unzip]] (you may need to install {{Code|unzip}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
4. The location of {{Code|phidget21.jar}} on the SBC is {{Code|/usr/share/java/phidget21.jar}}.  Within the unzipped example directory, compile the {{Code|HelloWorld.java}} example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:/usr/share/java/phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. To run the {{Code|HelloWorld}} program, use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
java -classpath .:/usr/share/java/phidget21.jar HelloWorld&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, you&#039;ll probably want to learn to [[#Running a Program Automatically|run this Java program automatically]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; If you&#039;re used to using Linux with Phidgets already, you&#039;ll probably notice that you don&#039;t need to switch into root using {{Code|sudo}} on the SBC in order to run programs.  This is because you already are running as root, not because the [[OS - Linux#Setting udev Rules|udev rules are set up]].  So if you set up another user, or [[#Via Cron|run a cron job]] as anything other than root or system, you&#039;ll need to add permission for the Phidget program to run in your [[OS - Linux#Setting udev Rules|udev rules]].&lt;br /&gt;
&lt;br /&gt;
====Developing Code on the SBC====&lt;br /&gt;
&lt;br /&gt;
When you&#039;re not just using pre-written source code, and you&#039;re writing code actually on the SBC itself, you&#039;ll probably want to use [[#nano|nano]].  Other terminal editors on the SBC include {{Code|vi}} which is already installed, and {{Code|emacs}}, which you can install using [[#apt|apt]].  Both {{Code|vi}} and {{Code|emacs}} are much more efficient for the experienced user, but they contain modes and keyboard shortcuts that can seem strange or almost hindering to the casual user.&lt;br /&gt;
&lt;br /&gt;
Regardless of which editor you choose to use, some of your keyboard habits may not transfer well.  For example, in the Linux command line, the command {{Code|Ctrl-C}} means &#039;&#039;stop the currently running program&#039;&#039;, (i.e. your open editor) not copy.  Within most SSH terminals, you can copy and paste using the right-mouse button, and on some terminals (and all native Linux terminals) you can copy by simply highlighting text, and you can paste it using the middle (scroll) mouse button.  On the other hand, if you write a program that hangs on the command line, {{Code|Ctrl-C}} can actually be useful to terminate it.&lt;br /&gt;
&lt;br /&gt;
Also {{Code|Ctrl-Z}} does not mean &#039;&#039;undo&#039;&#039;, rather it means &#039;&#039;run the current program in the background&#039;&#039;.  This is useful because running a program in an SSH terminal simply hangs your SSH input until the program is done.  So typing {{Code|Ctrl-Z}} while the program is running frees up the command line for more input.  But if you accidentally hit {{Code|Ctrl-Z}} while running an editor like [[#nano|nano]], the editor will immediately exit to the command line.  Don&#039;t worry though, it will not stop or lose your work.  You can bring it back up by using the {{Code|fg}} (e.g. &#039;foreground&#039;) command, like {{Code|fg nano}}, and this will automatically bring your nano process back to the front.&lt;br /&gt;
&lt;br /&gt;
===Running a Program Automatically===&lt;br /&gt;
&lt;br /&gt;
For testing your program, you will certainly want to run it via [[#SSH|SSH]] or via the {{Code|Start}} button on the project page on the web interface until you are quite sure it runs well.  However, eventually you will probably want the program to run without your input, either [[#Via the Web Interface|continuously, and starting at boot]], or via a task scheduled to [[#Via Cron|run to completion at certain times]].&lt;br /&gt;
&lt;br /&gt;
Both have their advantages and disadvantages.  Usually, you would want to use the continuous, from-boot methods for event driven code that has to handle a wide variety of user input that could occur at any time.  You would want to use the scheduled method when the SBC needs to perform a repeated task (e.g. reading sensor data) again and again.  The main difference is:&lt;br /&gt;
* With the continuous (boot) method you can have any Phidgets (including sensors, LEDs, input switches, etc) attached and giving events to your code all the time, and&lt;br /&gt;
* With the scheduled (cron) method you have much less of a chance to run into long-term memory management and instability problems with any code you write, because your program runs for only a short time before exiting and getting cleaned up.&lt;br /&gt;
&lt;br /&gt;
====Via the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To use this method, you must have created the program you want to run as [[#Program in Java with the Web Interface | a Java or ARM-compiled C project in the web interface]].  If you would like to use another language, or another way of uploading your project, but you still want to start at boot and run continuously, you will need to use a [[#Via a Boot Script|boot script]].&lt;br /&gt;
&lt;br /&gt;
In the web interface, go to the {{Code|Projects}} tab, and click on the project you would like to run.  Near the bottom of the project page (the one with the {{Code|Start}} and {{Code|Stop}} buttons at the top), there will be a section called {{Code|Startup Settings}}.  You can see a screenshot of the whole project page, including these settings, in the [[#Program in Java with the Web Interface | web interface project section]].&lt;br /&gt;
&lt;br /&gt;
Select the {{Code|Enabled}} radio button.  The other defaults should be fine, unless you specifically know otherwise:&lt;br /&gt;
* For &#039;&#039;Boot Order&#039;&#039;, lower numbers boot first.  Booting later means more programs are available for use, booting earlier means other programs can use your program.  &lt;br /&gt;
* &#039;&#039;Run as a daemon&#039;&#039; starts the program as a daemon, which is a program that runs in the background.  Unless you have &#039;&#039;explicitly&#039;&#039; written your program as a daemon, leave this checked.  (If you don&#039;t know what a daemon is, don&#039;t worry, you haven&#039;t written one, so leave it checked.)  &#039;&#039;Un&#039;&#039;checking this when your program is a normal program will cause the SBC to hang while booting.&lt;br /&gt;
* The &#039;&#039;Executable or Class&#039;&#039; name should be automatically sensed to be your main Java class&lt;br /&gt;
* &#039;&#039;Arguments&#039;&#039; are any command line arguments you need, just as you would type them into the command line&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Your program must be very, very stable to run properly via the web interface.  Imagine your program running continuously for days, or months on end.  Any memory leaks, over time, will render your program (and the SBC) unusable until a reboot.  Counts or other variables that increase within your program and never reset may create a segmentation fault eventually.&lt;br /&gt;
&lt;br /&gt;
If, for stability purposes, you want your program to start, run for a little while, and then exit so that the SBC operating system can clean up the memory each time, you&#039;ll probably want to use [[#Via Cron|Cron]] to run your program instead.&lt;br /&gt;
&lt;br /&gt;
====Via Cron====&lt;br /&gt;
&lt;br /&gt;
Cron can automatically schedule programs - known as &#039;jobs&#039;, or &#039;cron jobs&#039; - at most once per minute.  Less often than that, it is very flexible, allowing you to run it on certain months, weekdays, hours, etc.  Cron simply reads a special file (your {{Code|crontab}}) and runs whatever programs are listed, with whatever timing they are listed with.  The cron program runs all the time in the background, making it what is known as a Linux &#039;&#039;daemon&#039;&#039;, but the programs it starts as jobs run only as long as they naturally would, and then they exit.&lt;br /&gt;
&lt;br /&gt;
If you need your program to run more often than once per minute, have the program schedule itself while still running.  For example, to run every five seconds, run a fast loop,  and sleep for five seconds. Do this twenty times and exit.  Then schedule this once per minute using cron, and your program will in essence run every five seconds.&lt;br /&gt;
&lt;br /&gt;
Setting up a cron job simply entails editing your {{Code|crontab}} file.&lt;br /&gt;
&lt;br /&gt;
First, you&#039;ll probably want to specify your default editor to be [[#nano|nano]]. Otherwise it will default to {{Code|vi}} and you&#039;ll have to figure out {{Code|vi}} in order to add lines to your crontab:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
export EDITOR=nano&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to edit your crontab file, simply type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
crontab -e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each line of the crontab file is one scheduled job.  Lines that start with a hash &amp;quot;#&amp;quot; are comments and are ignored.  There is an example line in the crontab, and a reminder line at the very end.  Essentially, each line should contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
minute hour dayOfMonth month dayOfWeek  command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*{{Code|command}} is the program you want to run (with absolute path, and arguments)&lt;br /&gt;
** For example, {{Code|./myprogram argument1}} won&#039;t work, but {{Code|/root/code/myprogram argument1}} will&lt;br /&gt;
* Each time argument is either a number, a list of numbers separated by commas, or an asterisk&lt;br /&gt;
** For example, * * * * * means every minute for all days and months, 0,30 * * * * means every thirty minutes (i.e. at the top of the hour and at 30 minutes in) for all days and months&lt;br /&gt;
&lt;br /&gt;
If you already have jobs scheduled, you&#039;ll see them in the file that comes up.  You can edit, add, or delete.  &lt;br /&gt;
&lt;br /&gt;
After you save, you&#039;ll see a little message back in the terminal that says the new crontab file was installed, and it is now scheduled!  Cron always starts every boot, and so if you have edited and installed your crontab as above, the scheduling of your program will start properly even after a reboot of the SBC.  However, if you are having strange scheduling problems, you may want to familiarize yourself with the [[#Software Details|software details]] of how the SBC as a whole determines the current date and time.&lt;br /&gt;
&lt;br /&gt;
=====My Cron Job Doesn&#039;t Work!=====&lt;br /&gt;
&lt;br /&gt;
It is actually very common for a script or program to work on the command line but then &#039;&#039;not&#039;&#039; work as a cron job.  The most common reason for this, by far, is that you specify &#039;&#039;relative&#039;&#039; paths in your program to access files rather than &#039;&#039;absolute&#039;&#039; paths.  For example:&lt;br /&gt;
* {{Code|code/project.c}} is a relative path (bad for cron)&lt;br /&gt;
* {{Code|/root/code/project.c}} is an absolute path (good for cron)&lt;br /&gt;
The cron jobs are &#039;&#039;not&#039;&#039; executed from your home directory, or your code directory, so they will not be using the same location you may be using to test your code.  So always use absolute paths.&lt;br /&gt;
&lt;br /&gt;
Another common reason is you may be using environment variables or other settings that are true in a terminal but are &#039;&#039;not&#039;&#039; true by default in the raw system.  You can end up taking many things for granted in a shell, for example the shortcut &amp;quot;~&amp;quot; means home directory in a shell, but not by default in the raw system.  The things that get loaded for a shell (but which are not present in the raw system) are:&lt;br /&gt;
* The settings loaded by {{Code|/etc/profile}}&lt;br /&gt;
* Any settings in {{Code|~/.bashrc}}, which is nothing by default on the SBC&lt;br /&gt;
&lt;br /&gt;
On a full Linux operating system, you would use the logs written to by cron to find the error output and debug it.  On the SBC, however, cron does not write logs (otherwise, these logs would eat up the SBC memory very quickly even for routine jobs).  For short-term debugging, you can write output from your program to a file, and read that file afterwards to figure out what your program is doing.&lt;br /&gt;
&lt;br /&gt;
====Via a Boot Script====&lt;br /&gt;
&lt;br /&gt;
If you want to run your program constantly and for it to start at boot like the [[#Via the Web Interface|web interface would do]], you can install your program into the boot order using a script.  This is a somewhat involved process, and you should be familiar with shell programming in Linux.  For this process, we only offer a [[OS - Linux#As A Service|similar example]] which installs and runs the program {{Code|phidgetwebservice21}} within the boot sequence.&lt;br /&gt;
&lt;br /&gt;
===Using USB Data Keys===&lt;br /&gt;
&lt;br /&gt;
After plugging the USB key in, it won&#039;t just appear on your desktop, so to speak, so you&#039;ll need to figure out where you can read and write to it within the SSH directory structure.&lt;br /&gt;
&lt;br /&gt;
The web interface program can help with this.  After you plug a USB key in, it will show up under {{Code|Status &amp;amp;rarr; System}}.  Or, the USB key and all other attached devices can be seen at {{Code|Status &amp;amp;rarr; USB}}:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_mounted_devices.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
In the screenshot above, you can see that the USB key is located in {{Code|/media/usb0}}.&lt;br /&gt;
&lt;br /&gt;
Alternately, you can use the SSH command {{Code|mount}}, and the searching program {{Code|grep}} which will filter the response of {{Code|mount}} and only return the lines with your search term ({{Code|usb}}):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep usb&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the USB key can be written to and read from using the {{Code|/media/usb0}} directory.  Copying a file to {{Code|/media/usb0}} will copy a file to the USB key.  The same goes for removing, renaming, opening files within your program, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Mount points like {{Code|/media/usb0}} should not be hard-coded into any of your programs.  (See the [[#Common Problems and Solutions | Common Problems and Solutions]] section for more information.)  If you need to obtain the mount point for a freshly mounted USB key within your code, have your code obtain the mount tables and search on the &#039;&#039;device&#039;&#039;  (e.g. {{Code|/dev/sda1}} or {{Code|/dev/sdb1}}) and obtain the corresponding mounted {{Code|/media/usbN}} location, where N is a number 0-9.&lt;br /&gt;
&lt;br /&gt;
===Saving and Retrieving Data===&lt;br /&gt;
&lt;br /&gt;
This section covers getting data on and off of the SBC.  There are two main methods of simply moving data on and off the SBC - via a [[#Via a USB Key|USB key]], and via [[#Over the Network (SCP)|copy over the network]] - and a third method for moving and installing data when it concerns [[#Backing Up Your Data|backing up lower level system data]].&lt;br /&gt;
&lt;br /&gt;
====Via a USB Key====&lt;br /&gt;
&lt;br /&gt;
After plugging in a USB data key, first you need to [[#Using USB Data Keys | find out the location]] where that data key was mounted.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the location of the USB key is {{Code|/media/usb0/}}, and we want to copy the file {{Code|data.txt}} to the USB key.  Your SSH session might look something like this, using [[#ls|ls]] and [[#mount|mount]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# ls&lt;br /&gt;
data.txt&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
root@phidgetsbc:~# cp data.txt /media/usb0/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cp&#039;&#039;&#039; program copies data from a source to a destination.  The syntax is {{Code|cp from to}}, where here we are copying from {{Code|data.txt}} to {{Code|/media/usb0/}}.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caution:&#039;&#039;&#039; Even if there is no USB key mounted at {{Code|/media/usb0/}}, this use of {{Code|cp}} will still work &#039;&#039;with no errors&#039;&#039;!  This is because there is still a file called {{Code|/media/usb0/}}, there is just no USB key file system &#039;&#039;mounted&#039;&#039; to that point.  So be sure to run [[#mount|mount]] or use some other method of determining that there is, in fact, a USB data key attached and where it is mounted to.&lt;br /&gt;
&lt;br /&gt;
====Over the Network (SCP)====&lt;br /&gt;
&lt;br /&gt;
SCP is a command line program already installed on Linux and Mac OS, and downloadable for free on Windows.  We discuss it and give examples in the [[#SSH|SSH]] section, but remember it here when you&#039;re trying to get data on and off of the SBC.  With SSH or a terminal already open, you&#039;ll probably find it to be much faster and easier than dealing with a USB key.&lt;br /&gt;
&lt;br /&gt;
====Backing Up Your Data====&lt;br /&gt;
&lt;br /&gt;
For the web interface, you can save and restore all web interface settings under the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} tab.&lt;br /&gt;
&lt;br /&gt;
To save the settings of what packages are installed for later re-installation, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg --get-selections &amp;gt; installedPrograms.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then save the file {{Code|installedPrograms.txt}} externally.  If you have to completely wipe the SBC, you can just reinstall the whole list by moving the {{Code|installedPrograms.txt}} file back onto the SBC, and then typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg –set-selections &amp;lt; installedPrograms.txt&lt;br /&gt;
apt-get dselect-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also remember to externally save:&lt;br /&gt;
* Your {{Code|~/.bashrc}} settings file if you&#039;ve changed it&lt;br /&gt;
* Your {{Code|crontab}} file if [[#Via Cron|you&#039;ve edited it]]&lt;br /&gt;
* Any data files or code you&#039;ve created&lt;br /&gt;
&lt;br /&gt;
It is important to save these settings often, and at points where you know the system is running well.  It may be tempting to create a backup right before you [[#Recovery System|wipe the SBC and start from scratch]], but often the reason you are having problems then is some setting or change, and backing these up and reinstalling them will only reinstall the problem.&lt;br /&gt;
&lt;br /&gt;
To truly back the files up, you must copy them to an external computer or location using either a [[#Via a USB Key|USB Key]] or [[#Over the Network (SCP) | over the network]].  Then they can be copied back if needed later.&lt;br /&gt;
&lt;br /&gt;
If you are looking to restore data on an SBC that will not boot properly, you&#039;ll want to be in the [[#Partial Recovery|partial recovery]] portion of our Troubleshooting section.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
The SBC can be quite tricky to debug, because it is a complex and flexible computer.  Common problems and solutions include:&lt;br /&gt;
* You can&#039;t find the SBC on the network at all - refer to the [[#Initial Internet Setup|Initial Internet Setup]] section&lt;br /&gt;
* You have changed some setting or file such that the SBC doesn&#039;t run anymore, or doesn&#039;t run as expected - refer to the [[#Recovery|Recovery]] section&lt;br /&gt;
&lt;br /&gt;
If you are having trouble using Phidgets on the SBC, you should go through the [[OS - Linux#Troubleshooting | Troubleshooting section on the general Linux page]].  Some of the problems on the Linux page (such as library problems) are easier to fix by simply working through the [[#Recovery|Recovery]] section when they occur on the SBC.&lt;br /&gt;
&lt;br /&gt;
Namely, it often helps to simply perform a [[#Factory Reset|factory reset]] on the SBC (save your files and installed program list first, as [[#Backing Up Your Data|described here]]).  Sometimes you change a file or setting within the operating system when you are trying to get something up and running, and this unintentionally affects other programs too.  Performing a factory reset starts you with a clean slate.&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, or the information within this guide, please [[Contact Us|ask us]]!&lt;br /&gt;
&lt;br /&gt;
===Initial Internet Setup===&lt;br /&gt;
&lt;br /&gt;
To set up the SBC, you almost always need a &#039;&#039;wired&#039;&#039; Ethernet connection with DHCP (Dynamic Host Configuration Protocol), and without a firewall.  This connection should be to a &#039;&#039;router&#039;&#039;, not directly plugged in to your computer.&lt;br /&gt;
&lt;br /&gt;
Even if you do not have this type of a connection at home, these types of connections are very common at both offices and universities.  On a Windows or Mac OS computer, you can bring up the [[Phidget Control Panel]] as described in the SBC&#039;s [[1072 User Guide#Getting Started|Getting Started Page]].  Failing this, or on a Linux computer, we discuss some alternate setup methods in this section.  Keep in mind that without a wired, open DHCP connection these setup methods can be difficult and fickle. &lt;br /&gt;
&lt;br /&gt;
====No Wired-Only Connection====&lt;br /&gt;
&lt;br /&gt;
Sometimes it can work to plug the SBC, using Ethernet, directly into an Ethernet port on your home wireless router.  Do not plug it directly into your computer!  (Although in some instances, a direct connection can be made to work on Linux, see the [[#No DHCP|No DHCP]] section below) &lt;br /&gt;
&lt;br /&gt;
This direct-router method is a very picky process, however, and can fail because:&lt;br /&gt;
* Some home and office routers place a firewall between wireless connections (clients) and wired connections (the local area network)&lt;br /&gt;
* Some home and office routers do not by default allow both Ethernet DHCP and wireless DHCP.&lt;br /&gt;
* Some routers and DHCP hubs only provide access to an internet connection, and do not provide local area network inter-connections (this is common on mobile device tethering hubs)&lt;br /&gt;
&lt;br /&gt;
Routers are quite complex, and even with admin privileges it can be a painstaking process to find all the right firewall settings to turn off in order to allow two computers on the network to talk to one another, rather than just connect to the internet.  This is why university or office networks are often ideal for the purpose of setting up the SBC, because these institutions depend on computers on a local network being able to talk together.  University libraries in particular can be a good source of wired DHCP connection ports.  &lt;br /&gt;
&lt;br /&gt;
Covering all of the different router configuration possibilities here, and how to change them to make the SBC work, is essentially impossible.  If you try using the SBC at home or at work, the SBC does not work on the first try when plugged directly into the router via Ethernet, and you want to make that connection work rather than seeking out an alternate for the initial setup, you should find documentation specific to your router (usually available online) and properly configure it.&lt;br /&gt;
&lt;br /&gt;
The good news is that if you can find an Ethernet DHCP connection &#039;&#039;just once&#039;&#039; for a short time, you can use that connection to configure the SBC to work on your home wireless network.  During that initial connection, you can enable wireless and set up as many wireless DHCP connections (with passwords) that you need.  Once wireless is enabled and set up, you can take the SBC home to your wireless router and the SBC will automatically seek out and connect to its remembered networks as they appear.  At that point, you can also use wireless like a normal internet, web interface, and SSH connection.&lt;br /&gt;
&lt;br /&gt;
====No Link Local Addressing====&lt;br /&gt;
&lt;br /&gt;
If you have a wired DHCP connection, no firewall, and no link local addressing (e.g. bonjour or avahi is not installed) then you will need access to the DHCP router logs.  From the router logs, you should see the connection (or attempted connection) by the SBC within the logs.  From that log entry, you should either be able to determine the IP address for the SBC, or see what happens when the router blocks access.  The IP address can be used in place of the link local address for both the web interface and for SSH.&lt;br /&gt;
&lt;br /&gt;
====No DHCP====&lt;br /&gt;
&lt;br /&gt;
The SBC will first try to use DHCP, but then it will revert to responding to a link local address under bonjour and avahi.  If you are depending on this, please wait &#039;&#039;&#039;at least three minutes&#039;&#039;&#039; after the SBC boots for the SBC to fail in obtaining a DHCP connection and properly revert to link local addressing.&lt;br /&gt;
&lt;br /&gt;
If you have a static IP setup, and want to use link local addressing rather than accessing the router logs, this should usually work by default on Windows and Mac OS (e.g. type the address such as {{Code|phidgetsbc.local}} into a web browser).  If it doesn&#039;t work automatically, there is not much you can do and you should seek out a wired DHCP connection elsewhere.&lt;br /&gt;
&lt;br /&gt;
On Linux, it also should work by default, but you have the additional option of explicitly adding routes that look within the default network settings for the SBC.  From a terminal (as root), type:&lt;br /&gt;
* {{Code|route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0 metric 99}}&lt;br /&gt;
* {{Code|route add default dev eth0 metric 99}}&lt;br /&gt;
You can also compile and use the {{Code|phidgetsbclist.c}} example (use the provided Makefile, don&#039;t use gcc) in the [{{SERVER}}/downloads/phidget21/libraries/linux/libphidget.tar.gz Phidget Linux Libraries] package, under the {{Code|examples}} folder.  This will allow you to see if the SBC is detected on the network at all.   Note that to use this option you must have the Phidget Libraries and the Phidget WebService installed on your Linux computer - in-depth instructions to do this are on the [[OS - Linux|main Linux page]].&lt;br /&gt;
&lt;br /&gt;
===Recovery System===&lt;br /&gt;
&lt;br /&gt;
You can either boot the SBC into recovery mode and attempt to recover files and settings, or you can completely wipe the SBC by performing a factory reset.  If the LEDs do not turn on normally (red on constantly, green on at first start, then off, then on when fully booted) then you&#039;ll want to read the [[#Hardware Issues|hardware issues]] section.&lt;br /&gt;
&lt;br /&gt;
====Partial Recovery====&lt;br /&gt;
&lt;br /&gt;
The recovery system can be entered in two ways:&lt;br /&gt;
# From the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} web interface page.&lt;br /&gt;
# By holding down the reset button for 20+ seconds - until the green light has switched from flashing slowly to flashing quickly.&lt;br /&gt;
&lt;br /&gt;
The recovery system runs an [[#SSH|SSH]] server where the username and password both are {{Code|root}}.&lt;br /&gt;
&lt;br /&gt;
If the main filesystem has been damaged/misconfigured in such a way that it won’t boot, you may be able to fix the issue or recover important files before running a full factory reset. From an SSH connection to the recovery system, you can mount the main root filesystem with the following commands (assuming it’s not damaged):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cat /proc/mtd&lt;br /&gt;
# Note which mtd# is &amp;quot;rootfs&amp;quot; (6 or 7) and pass into ubiattach:&lt;br /&gt;
ubiattach /dev/ubi_ctrl -m [rootfs mtd #]&lt;br /&gt;
mount -t ubifs /dev/ubi0_0 /mnt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Factory Reset====&lt;br /&gt;
&lt;br /&gt;
This restores the kernel and root filesystem from backup, overwriting any changes that may have been made and &#039;&#039;completely wiping the system&#039;&#039; to the state that it got shipped in. (You can save your files and installed program list first, as [[#Backing Up Your Data|described here]].)  This can be enacted one of two ways.&lt;br /&gt;
# Use the reset button:&lt;br /&gt;
##Enter the recovery mode by holding down the reset button for 20+ seconds as above (until fast flashing)&lt;br /&gt;
##Wait for a full boot (i.e. you can see it on the [[Phidget Control Panel]], or can SSH with username and password as {{Code|root}})&lt;br /&gt;
##Hold down the reset button again, but this time for only 10 seconds (until slow flashing)&lt;br /&gt;
##Wait for the SBC to fully reset and reboot (at least three minutes) - the LED will turn off and on again when this occurs&lt;br /&gt;
##*Note that after a factory reboot the SSH server will be disabled&lt;br /&gt;
##*Also note that after a factory reboot the SBC creates new SSH keys, and reverts to the {{Code|phidgetsbc.local}} address&lt;br /&gt;
# Via the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, where you can follow the instructions&lt;br /&gt;
&lt;br /&gt;
====Hardware Issues====&lt;br /&gt;
&lt;br /&gt;
The LEDs are an indicator of the hardware working properly.  The normal boot process is:&lt;br /&gt;
* Red LED: Turns on from moment of power being applied.&lt;br /&gt;
* Green LED: Turns on momentarily when power applied, then turns off momentarily, then turns on and stays on when booted.&lt;br /&gt;
&lt;br /&gt;
If the green status LED never turns on (or fails to turn on the second time), the boot process is failing somewhere.  This could be due to:&lt;br /&gt;
* A damaged OS - Try performing a [[#Factory Reset|Factory Reset]]&lt;br /&gt;
* If this fails, it is likely hardware damage (very difficult to diagnose, please [[Contact Us|contact us]])&lt;br /&gt;
&lt;br /&gt;
If neither LED turns on, hardware damage is even more likely.  Unless the path to the red LED is the one thing that has been damaged, the device is likely not receiving and using power.&lt;br /&gt;
* Try performing a [[#Factory Reset|Factory Reset]], and if that does not work please [[Contact Us|contact us]]&lt;br /&gt;
&lt;br /&gt;
=====USB Issues=====&lt;br /&gt;
&lt;br /&gt;
On the Phidget SBC2, there is a hardware issue that is unrelated to the LEDs.  It is a USB problem, and manifests in many ways:&lt;br /&gt;
* Strange behaviour when some devices but not others are plugged in to the SBC&lt;br /&gt;
* Strange behaviour with combinations of devices&lt;br /&gt;
* Failure (or intermittent failure) to see Phidgets on the USB hub, or USB keys on the hub&lt;br /&gt;
&lt;br /&gt;
This problem is fixable, either on your own or by sending your SBC back to Phidgets.  For an in-depth solution, see the [[SBC2_USB_Hub_Fix | SBC2 Hub Fix Page]].&lt;br /&gt;
&lt;br /&gt;
===Updating Your SBC===&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve owned your SBC for a while and want to update your packages, you can run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...to &#039;&#039;update&#039;&#039; your software source list and then &#039;&#039;upgrade&#039;&#039; to the latest version of all installed software.  If you are used to Mac OS or Windows, note that this does not just update the non-kernel parts of the operating system, it updates every additional piece of software you have installed.&lt;br /&gt;
&lt;br /&gt;
To update the SBC software itself (e.g. the kernel), it is easiest to use the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, to enter a page that will give you the option to update.  You will need to have an update file on a USB key inserted into the SBC, of type:&lt;br /&gt;
* UBI Image (system_ubi.img), or &lt;br /&gt;
* Kernel image (uImage), or&lt;br /&gt;
* Phidget Upgrade package containing both UBI and Kernel images (phidgetsbc*.bin)&lt;br /&gt;
&lt;br /&gt;
These are either obtained from the Phidgets website, or are a custom kernel / filesystem that you can create yourself, if you are experienced.&lt;br /&gt;
&lt;br /&gt;
The reason why this information is in troubleshooting is that you should certainly [[#Backing Up Your Data|back up your system]] before trying this.  And, it is quite rare to need to upgrade the kernel or filesystem on the SBC, so something serious should be going on before you attempt it.  Try using the [[#Recovery System|recovery system]] first.&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
Now that you have the basic libraries installed, you can pick your language and begin programming!  &lt;br /&gt;
&lt;br /&gt;
If you are not using the [[#WebService | webservice]] to control a Phidget over a network, your next step will be to delve into the use of your specific language.  Each page has its own set of specific libraries, code examples, and setup instructions.  &lt;br /&gt;
&lt;br /&gt;
On SBC Linux, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Java | Java]]&lt;br /&gt;
*[[Language - Python | Python]]&lt;br /&gt;
&lt;br /&gt;
These languages may also run on the SBC, but we do not yet directly offer SBC support for them:&lt;br /&gt;
* [[Language - Ruby|Ruby]]&lt;br /&gt;
* [[Language - C Sharp|C#]] (using Mono)&lt;br /&gt;
&lt;br /&gt;
You can probably figure out how to install and use them by a combination of the language pages linked above, and the section on [[#Installing Other Languages|installing other languages on the SBC]].&lt;br /&gt;
&lt;br /&gt;
==WebService==&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the [[Phidget WebService]] installed, and the SBC automatically starts the WebService at boot.&lt;br /&gt;
&lt;br /&gt;
To practice using the WebService, and to learn more about it, we have hands-on examples on the [[OS - Linux|general Linux page]], starting in the [[OS - Linux#Using the WebService|using the WebService section]].&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Shutting off USB ports to save power===&lt;br /&gt;
The SBC3 has an on-board USB hub that can control power to the ports. To do this unbind and rebind the USB drivers.&lt;br /&gt;
&lt;br /&gt;
To turn off the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/unbind}}&lt;br /&gt;
&lt;br /&gt;
To turn on the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/bind}}&lt;br /&gt;
&lt;br /&gt;
These will also cause detach and attach events for the Phidget devices, respectively. While the drivers are unbound, you will not get any hot plug events for any devices on USB.&lt;br /&gt;
&lt;br /&gt;
===Using a Touchscreen===&lt;br /&gt;
Please note that this will ONLY work with an SBC3 since it has a USB 2.0 hub:&lt;br /&gt;
&lt;br /&gt;
Using a touchscreen with the SBC is a great way to get user input and visual feedback from an SBC otherwise devoid of visual output.  The SBC does not have any conventional display ports such as VGA, DVI, or HDMI but it does have a number of USB ports and USB displays do exist.  With the upgrade to a USB 2.0 hub on the SBC3 from the earlier models which had USB 1 hubs the SBC now has enough capability to operate a screen over USB.  We don&#039;t recommend running a standard desktop environment since the processor is too slow to really keep up with a typical desktop it does make for an excellent interface for a kiosk, instrumentation control panel or  other, similar use case.  This document is going to go through the process of enabling support for a typical USB display as well as installing a fairly compact desktop environment called xfce on the SBC.  &lt;br /&gt;
&lt;br /&gt;
The screen I will be using is from a company called [http://lilliputweb.net/ Lilliput].  Specifically a UM-70 model.  Before you begin, please make sure that you have the screen plugged into the SBC, it will also be useful to have a spare USB keyboard and mouse handy as you will need them once you are no longer using an SSH terminal to communicate with the SBC.&lt;br /&gt;
&lt;br /&gt;
[[File:lilliputoff.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Getting the display to function====&lt;br /&gt;
Begin by logging into the web configuration page for your SBC and upgrading all of the packages on the SBC.  Be sure to include the full Debian package repository.  For more information on how to do this refer to the  [[OS - Phidget SBC#Getting Started - External Computer|getting started]] section of the Phidget SBC documentation.  Once you are fully up to date open an SSH session with the SBC and navigate to the &amp;quot;/etc&amp;quot; folder.  Open inittab with a terminal-based text editor such as nano and add the following to the bottom of the file, just above the {{code|T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100}} line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
1:2345:respawn:/sbin/getty 38400 tty1 &lt;br /&gt;
2:23:respawn:/sbin/getty 38400 tty2 &lt;br /&gt;
3:23:respawn:/sbin/getty 38400 tty3 &lt;br /&gt;
4:23:respawn:/sbin/getty 38400 tty4 &lt;br /&gt;
5:23:respawn:/sbin/getty 38400 tty5 &lt;br /&gt;
6:23:respawn:/sbin/getty 38400 tty6 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reboot your system.  After a few minutes you should see the LCD screen come up with a standard Linux terminal interface and a login prompt.  This is all well and good but this isn&#039;t really appreciably better than simply using an SSH session to communicate with the SBC.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputlogin.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Setting up Xfce====&lt;br /&gt;
In order to get a traditional windowing environment we still need to install a desktop manager as well as a number of supporting packages.  Log in and make sure everything is still up to date with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install the following packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xserver-xorg lxde xfce4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the SBC asks you if you want to continue, just type &amp;quot;Y&amp;quot; and press enter.  &lt;br /&gt;
&lt;br /&gt;
This will install the xfce desktop environment and any other necessary programs on the SBC.  When it&#039;s done, restart the SBC.  When it boots back up it should boot directly to a login screen instead of the terminal interface.  Log in, and you are good to go.  It won&#039;t be particularly fast, but don&#039;t worry, the SBC does not have a dedicated video processor on it so it&#039;s perfectly normal for it to be slow.  What&#039;s important is that it works.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputdesktop.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Calibrating the touch screen====&lt;br /&gt;
Unfortunately, by default the screen is calibrated to believe the bottom of the screen is on the right hand side.  This has the effect of making the touch functionality more or less useless until it has been properly calibrated.  To do this, install the following package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xinput-calibrator&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now use xinput calibrator to measure the parameters of your screen.  Launch xinput calibrator (called Calibrate Touchscreen in the programs menu) and follow the instructions on the screen.  The screen should now be functioning at full potential.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Using a Different Wireless Adapter===&lt;br /&gt;
&lt;br /&gt;
The support for the wireless adaptor that Phidgets sells is written into the SBC kernel.  Hence, we do not support using other adaptors. &lt;br /&gt;
&lt;br /&gt;
However, Linux is very flexible, and it is possible (though not easy) to write a custom kernel for the SBC and add support for a new wireless adaptor.  We can&#039;t help you with this, but we do provide some basic guidelines for [[#Custom Kernel and Filesystem|building your own kernel]].  You can also have a look at our thoughts on our own experience with choosing a Wifi adapter: [[Alternative Wi-Fi Adapters on the SBC]].&lt;br /&gt;
&lt;br /&gt;
===Using a Different Webcam===&lt;br /&gt;
&lt;br /&gt;
In addition to the webcam that Phidgets sells, you have the option to use many different webcams with the SBC.  There is a [http://www.ideasonboard.org/uvc/#devices long list] of compatible webcams.&lt;br /&gt;
&lt;br /&gt;
The common thread for these webcams is that they use UVC - the USB Video Class - drivers for Linux.  You can then use [[#mount|mount]] to find out what video device your webcam is mounted under.&lt;br /&gt;
&lt;br /&gt;
===Taking Pictures With the Webcam===&lt;br /&gt;
&lt;br /&gt;
Probably the most straightforward way to use a webcam for pictures rather than video is to use the {{Code|opencv}} library.  You can get it by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libcv2.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there is no {{Code|libcv2.1}} package, you can perform {{Code|apt-cache search libcv}} to find the current version.&lt;br /&gt;
&lt;br /&gt;
The opencv libraries can also be used within Python, by installing the link between them:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python-opencv&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then taking pictures from within code becomes quite simple.  For example, in Python, taking and saving an image is four lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
#! /usr/bin/python&lt;br /&gt;
&lt;br /&gt;
import cv&lt;br /&gt;
&lt;br /&gt;
# The webcam is located at /dev/video0 &lt;br /&gt;
# OpenCV only needs the number after video&lt;br /&gt;
webcam = cv.CaptureFromCAM(0)&lt;br /&gt;
&lt;br /&gt;
frame = cv.QueryFrame(webcam)&lt;br /&gt;
&lt;br /&gt;
cv.SaveImage(&amp;quot;image.jpg&amp;quot;, frame)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the complete OpenCV documentation, see [http://docs.opencv.org/ The OpenCV Reference], and specifically the section on reading and writing images.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The SBC is probably not as powerful for image processing and transport when compared to your desktop computer.  Try running your image processing code on the SBC from an early point in development.  During those test runs, you can visit the first System page of the [[#SBC Web Interface|SBC Web Interface]] to check the processor and memory use.  For more information on processor power, check the specification for your SBC (on the product page on [{{SERVER}} our main website]) as well as our discussion of [[#Pushing Processor Limits|pushing processor limits]] below.&lt;br /&gt;
&lt;br /&gt;
===Checking System Logs===&lt;br /&gt;
&lt;br /&gt;
The SBC maintains two logs: a kernel log and a system log.  &lt;br /&gt;
&lt;br /&gt;
The kernel log is for low-level occurrences, such as devices attaching and leaving the USB hub, recording what drivers are being used, and so on.&lt;br /&gt;
&lt;br /&gt;
The system log (syslog) is for normal chatter from the operating system.  Any program with the right permissions can use it (though you need to know the method to write to it, information all around the Internet can help) and it contains everything from the Ethernet going up and down, to webserver requests, and so on.  If you don&#039;t run many programs or services on the SBC, the syslog will essentially be a mirror of the kernel log, because the kernel is the only thing talking.&lt;br /&gt;
&lt;br /&gt;
You can check these logs by using the web interface in the {{Code|System &amp;amp;rarr; Logs}} tab.&lt;br /&gt;
&lt;br /&gt;
Or you can perform more powerful filtering and displaying via an SSH terminal.  For example, {{Code|dmesg}} is the command to display the kernel log, and {{Code|tail}} prints the last ten lines of input.  So, if you are trying to see if you can get a device to be detected on USB, you can run &amp;lt;code&amp;gt;dmesg | tail&amp;lt;/code&amp;gt; to print the latest ten lines of kernel log data.&lt;br /&gt;
&lt;br /&gt;
The actual locations of the log files (for filtering and reading) are:&lt;br /&gt;
* {{Code|/var/log/syslog}} &lt;br /&gt;
* {{Code|/var/log/dmesg}}&lt;br /&gt;
But don&#039;t edit them directly!  Always follow the advice and procedures around the Internet on how to properly log items to syslog.&lt;br /&gt;
&lt;br /&gt;
===X Forwarding===&lt;br /&gt;
&lt;br /&gt;
Although most tasks can be done using the [[#SBC Web Interface|SBC Web Interface]] or [[#SSH|SSH]], you can also set up X11 forwarding on the SBC.  X11 is the window manager base, which provides a graphical windowing system on the SBC.  Although you probably won&#039;t connect directly to the X11 manager (i.e. by plugging a screen directly into the SBC), X11 also gives a user the ability to forward graphical windows over SSH.  You will need the following packages installed:&lt;br /&gt;
* {{Code|x11-common}}&lt;br /&gt;
* {{Code|xbase-clients}}&lt;br /&gt;
After installing, make sure that the line in {{Code|/etc/ssh/sshd_config}} has a line that says:&lt;br /&gt;
:{{Code|X11Forwarding yes}}&lt;br /&gt;
Then log out and log back into the SBC.  This second time you log in, use the {{Code|-X}} switch to turn on X forwarding for that connection:&lt;br /&gt;
:{{Code|ssh -X root@phidgetsbc.local}}&lt;br /&gt;
Then you should be able to run programs that launch a window, and it will launch remotely and appear on the computer you have the SSH connection from.&lt;br /&gt;
&lt;br /&gt;
===Pushing Processor Limits===&lt;br /&gt;
&lt;br /&gt;
The SBC, though more powerful than many embedded computers out there, is probably about as powerful as your smartphone.  If you hook up 1 ms Phidget sampling devices to all six of its USB ports, events and packets will probably get lost.  The exact data rates you can accomplish depend on:&lt;br /&gt;
* What else is running on the SBC&lt;br /&gt;
* How efficient your code is for external operations (like File I/O)&lt;br /&gt;
* Other minor details (e.g. the temperature of the SBC, etc)&lt;br /&gt;
&lt;br /&gt;
If you want to achieve data rates as fast as possible, try these tips:&lt;br /&gt;
* Program in C, not in an interpreted language (Python, Java, .NET)&lt;br /&gt;
* Perform file I/O as little as possible.  Locally cache data, manage your writing to a file in a separate thread, and use low-level write calls.&lt;br /&gt;
* Change the [[#Custom Kernel and Filesystem|filesystem]] to a faster, non-compressed file system.&lt;br /&gt;
** Alternatively, use a high-data-rate USB key.&lt;br /&gt;
* Keep other running processes to a minimum. &lt;br /&gt;
** If you are running code locally right on the SBC, turn off the Phidget WebService.&lt;br /&gt;
&lt;br /&gt;
===Custom Kernel and Filesystem===&lt;br /&gt;
&lt;br /&gt;
You can compile your own kernel and flash it to the board. It is left up to the user to configure an appropriate cross-compiler for kernel development. You may also be able to compile a new kernel on-board.  We have a kernel development kit, complete with patch file and README:&lt;br /&gt;
* [{{SERVER}}/downloads/phidgetsbc/1072/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Compiling a new, custom kernel is somewhat complex.  If the SBC is your first experience with Linux, writing a custom kernel will be difficult.  However, it will probably also be very rewarding because you can put whatever you like into it.  We might be able to offer additional suggestions, but ultimately you&#039;re on your own here. &lt;br /&gt;
&lt;br /&gt;
You may be able to write a custom kernel right on the SBC, but the easiest way is to develop the kernel on an external computer.  And the easiest way to develop on an external computer is for that computer to also be Linux, even just in a Virtual Machine.  The time spent loading a copy of Linux into a virtual machine (such as VirtualBox, which is free) onto your computer will probably be less time than setting up a standard compiler on Windows to cross-compile.&lt;br /&gt;
&lt;br /&gt;
On your external Linux system, you will need:&lt;br /&gt;
* A cross-compiling toolchain for the ARM processor, which we briefly describe on the [[OS - Linux#Cross-Compiling with a Custom Toolchain | main Linux page]], and &lt;br /&gt;
* The [{{SERVER}}/downloads/phidgetsbc/1072/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package] from the Phidgets website.  &lt;br /&gt;
The kernel development kit has a brief README file which describes how to obtain the proper kernel and patch, configure, customize, and build it.&lt;br /&gt;
&lt;br /&gt;
We have an application guide in progress, which walks through building a custom kernel to add Bluetooth support to the SBC.  Please contact us if you would like more information.  Even if you are trying to add support for hardware other than a bluetooth modem, or wondering if support even exists in the kernel for your modem (3G, alternate wireless, etc) you will probably find the application guide helpful.  Follow it up to the point where you run the program {{Code|menuconfig}} (you don&#039;t need an SBC to do this), which will give you a menu of all drivers you can enable in the SBC kernel.&lt;br /&gt;
&lt;br /&gt;
After making your new kernel, you should have a uImage and modules target for your Makefile.  At this point you can transfer your kernel files onto the SBC, make their targets, and transfer them into the nand memory.  This involves erasing the old kernel, flashing the new kernel, installing the new kernel modules, and rebooting.  From the SBC, in the kernel directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
make uImage; make modules&lt;br /&gt;
flash-eraseall /dev/mtd3&lt;br /&gt;
nandwrite -p /dev/mtd3 arch/arm/boot/uImage&lt;br /&gt;
make modules-install&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Custom kernels can also be flashed from the [[#Recovery System | Recovery System]].&lt;br /&gt;
&lt;br /&gt;
If you need to create a root filesystem image, the filesystem type is UBIFS, and the commands to create it are:&lt;br /&gt;
&lt;br /&gt;
====For SBC2:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====For SBC3:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You then flash ‘system_ubi.img’ (not ‘system_ubifs.img’) from the recovery system.&lt;br /&gt;
&lt;br /&gt;
Again, like the custom kernel creation, the need to create a custom root filesystem is essentially non-existent except for those advanced users who already know they need it... and furthermore, you are almost entirely on your own.&lt;br /&gt;
&lt;br /&gt;
===Saving a file system to flash to multiple SBC&#039;s===&lt;br /&gt;
You may want to create a complete backup of your SBC root filesystem, which can then be flashed to other SBCs. This is how it could be done:&lt;br /&gt;
&lt;br /&gt;
You will need a USB drive - we have had issues using cheap flash drives, so a real USB drive is recommended. Make sure it&#039;s empty, as it will be reformatted.&lt;br /&gt;
&lt;br /&gt;
All of these commands are executed on your SBC, while logged in over SSH.&lt;br /&gt;
&lt;br /&gt;
First, re-format the USB drive as ext3. Assuming the USB drive is sda and has a single partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
mkfs.ext3 /dev/sda1&lt;br /&gt;
mount -t ext3 /dev/sda1 /media/usb0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remount / as readonly, so it doesn&#039;t change as we&#039;re copying it. To do this, we need to kill all running processes except sshd:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
service udev stop&lt;br /&gt;
service ifplugd stop&lt;br /&gt;
service rsyslog stop&lt;br /&gt;
service avahi-daemon stop&lt;br /&gt;
service phidgetwebservice stop&lt;br /&gt;
service ntp stop&lt;br /&gt;
service busybox-httpd stop&lt;br /&gt;
service dbus stop&lt;br /&gt;
service cron stop&lt;br /&gt;
pkill dhclient&lt;br /&gt;
mount -o remount,ro /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the remount says that / is busy, do a &#039;ps auxww&#039; and &#039;pkill&#039; anything else that may be running until it remounts properly.&lt;br /&gt;
&lt;br /&gt;
Then, copy / to the flash drive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkdir /media/usb0/root&lt;br /&gt;
mount --bind / /mnt/&lt;br /&gt;
cp -a /mnt/* /media/usb0/root/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, clean up the copy - removing files specific to this board. We also remove the APT cache to save space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
find /media/usb0/root/var/log -type f -print0 | xargs -0 rm -f&lt;br /&gt;
rm -rf /media/usb0/root/var/lib/apt/lists/*&lt;br /&gt;
mkdir /media/usb0/root/var/lib/apt/lists/partial&lt;br /&gt;
rm -f /media/usb0/root/var/cache/apt/*.bin&lt;br /&gt;
rm /media/usb0/root/etc/udev/rules.d/70-persistent-net.rules&lt;br /&gt;
rm /media/usb0/root/etc/ssh/ssh_host_*&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
then, create the ubinize.cfg file:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi	&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs0&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi		&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
vol_flags=autoresize	&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: you may need to increase vol_size if your filesystem is larger.&lt;br /&gt;
&lt;br /&gt;
then, create the UBI image from the copy:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then, unmount the drive to ensure everything is written out properly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you can remove the /root/ folder and system_ubifs.img. system_ubi.img can be flashed to other SBCs using the recovery system.&lt;br /&gt;
&lt;br /&gt;
==Software Details==&lt;br /&gt;
&lt;br /&gt;
For even more advanced uses of the SBC, it may help to know the gritty details of the SBC software system.&lt;br /&gt;
&lt;br /&gt;
;Operating System&lt;br /&gt;
:Debian/GNU Linux&lt;br /&gt;
:Kernel 2.6.X or higher (generally kept up to date with latest releases, use {{Code|uname -r}} to check the kernel version)&lt;br /&gt;
&lt;br /&gt;
;Main Filesystem (rootfs)&lt;br /&gt;
:UBIFS (a raw flash type of file system)&lt;br /&gt;
:Mounted in a 460 MB Nand partition (in Read/Write mode)&lt;br /&gt;
&lt;br /&gt;
;Kernel&lt;br /&gt;
:uImage format&lt;br /&gt;
:Has its own 3MiB partition on bare Nand&lt;br /&gt;
&lt;br /&gt;
;Web Interface Scripts and Configuration Data&lt;br /&gt;
:Located in {{Code|/etc/webif}}&lt;br /&gt;
:Modifying these scripts can be done; however, it is very easy to enter invalid data that could cause the system to behave unexpectedly or not boot.&lt;br /&gt;
&lt;br /&gt;
;User Applications uploaded through Web Interface&lt;br /&gt;
:Located in {{Code|/usr/userapps}}&lt;br /&gt;
&lt;br /&gt;
;Webcam Device Location&lt;br /&gt;
:{{Code|/dev/video0}}&lt;br /&gt;
:Numbers increase with more webcams&lt;br /&gt;
&lt;br /&gt;
;Date and Time&lt;br /&gt;
:Set using ntp (network time protocol) at boot&lt;br /&gt;
:The ntp daemon continues to run in the background and will periodically update the clock &lt;br /&gt;
:The network keeps the SBC very close to real time&lt;br /&gt;
:Also there is a real-time clock with battery backup which will preserve date/time across reboots, power removal&lt;br /&gt;
:The real-time clock is synced to system time during reboot/shutdown&lt;br /&gt;
:If power is unplugged suddenly, and the network not restored, the real-time clock may not have the correct time&lt;br /&gt;
&lt;br /&gt;
;Wireless Networking System&lt;br /&gt;
:Wireless adapter support for the wireless adapter that Phidgets sells is written into the kernel&lt;br /&gt;
:It supports WEP and WPA&lt;br /&gt;
:It is best configured through the configuration interface.&lt;br /&gt;
&lt;br /&gt;
;Nand Layout&lt;br /&gt;
:The board contains 512MiB on Nand. This nand is split into 7 partitions as follows:&lt;br /&gt;
:0: u-boot		 size: 256K		 Read Only&lt;br /&gt;
:1: u-boot_env		 size: 128K		 Read Only&lt;br /&gt;
:2: recovery_kernel	 size: 2M		 Read Only&lt;br /&gt;
:3: kernel		 size: 3M		 Writable&lt;br /&gt;
:4: flashfs	 	 size: ~3.625M	 	 Read Only&lt;br /&gt;
:5: recovery_fs		 size: ~ 43M		 Read Only&lt;br /&gt;
:6: rootfs		 size: ~ 460M		 Writable&lt;br /&gt;
: The final size of flashfs/recovery_fs/rootfs depends on the image size at production, and on the number/location of bad blocks in the NAND.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: U-Boot and recovery kernel and filesystem cannot be written from Linux - this is a safety measure.&lt;br /&gt;
&lt;br /&gt;
;Boot Loader&lt;br /&gt;
:U-Boot is used for setting up the processor and booting Linux, and is only accessible via a serial connection. &lt;br /&gt;
:Normal users will not need to use or modify it.&lt;br /&gt;
:Be very careful when modifying the u-boot partition. If it is damaged or overwritten, it is difficult to fix.&lt;br /&gt;
:When using U-Boot, a prompt will appear via serial shortly after power on.  &lt;br /&gt;
:The environment variables will help you determine how to boot Linux on the SBC&lt;br /&gt;
:You can also refer to the [http://www.denx.de/wiki/DULG/Manual U-Boot documentation]&lt;br /&gt;
&lt;br /&gt;
;Boot Process&lt;br /&gt;
:From power on...&lt;br /&gt;
:1. Processor loads first 4 bytes from NAND into Steppingstone and runs it.&lt;br /&gt;
:2. Steppingstone sets up RAM, copies u-boot from NAND into RAM and runs U-Boot.&lt;br /&gt;
:3. U-Boot initializes the processor, sets GPIO state, etc., copies the linux kernel into RAM, sets up the kernel command line arguments, checks that the kernel image is valid, and boots it.&lt;br /&gt;
:4. Linux boots, bringing up USB, Networking, NAND, etc. and then mounts the rootfs NAND partition on /.&lt;br /&gt;
:5. init gets run as the parents of all processes, as uses the /etc/inittab script to bring up the system. This includes mounting other filesystems, settings the hostname, and running the scripts in /etc/init.d, among other things.&lt;br /&gt;
:6. inittab then turns the green LED on.&lt;br /&gt;
:7. inittab then sets up a getty on the first serial port, ready for interfacing using the debug board.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|PHP Curl|Curl doesn&#039;t install smoothly}}&lt;br /&gt;
&lt;br /&gt;
There is an issue with the embedded version of PHP5.3, try forcing it to install the specific version that you need.  This can be done with the following command:&lt;br /&gt;
&lt;br /&gt;
{{Code|apt-get install php5-common&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;5.3.3-7+squeeze14}}&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|FTDI Errors|FTDI adapters do not appear to work with the SBC}}&lt;br /&gt;
&lt;br /&gt;
The 3.1.6 version of the Linux kernel which is used on some versions of the SBC has a bug that causes issues with FTDI drivers and makes them malfunction.  To solve this problem you must upgrade the kernel to a newer version.  You can find the files [[#Quick Downloads| here]].&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|USB Memory Key mounting|Sometimes USB Memory Keys mount at more than one location}}&lt;br /&gt;
&lt;br /&gt;
When you insert a memory key, the SBC will load it as a device (e.g. {{Code|/dev/sda1}}) and it will also &#039;&#039;mount&#039;&#039; the key for reading and writing within the {{Code|/media/}} directory.  The {{Code|/media/}} directory version will be called something like {{Code|usb0}}.  &lt;br /&gt;
At times, an inserted memory key will get mounted in more than one location.  You can observe if this occurs by checking the currently mounted devices with the command {{Code|mount}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
/dev/sda1 on /media/usb1 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will note that the same device ({{Code|/dev/sda1}}) is now mounted at &#039;&#039;both&#039;&#039; {{Code|/media/usb0}} and {{Code|/media/usb1}}.  To fix this problem as it occurs, you can use {{Code|umount}} (notice there is no letter &#039;n&#039;) to unmount the second instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# umount /media/usb1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In practice, this should not be a problem, because writing to or reading from either {{Code|usb0}} or {{Code|usb1}} will have the same effect on the memory key.  However, if you hard-code a media location into your program (i.e. expecting {{Code|/media/usb0}} to be the first USB key you insert and {{Code|/media/usb1}} to be the second key) your program will sometimes work and sometimes fail.  &lt;br /&gt;
&lt;br /&gt;
To get around this within code, find the mount point for each device as it appears.  The devices, such as {{Code|/dev/sda1}} will always refer to the actual memory key.  But, they cannot be written to directly without being mounted, so you will have to parse the mount table (what is returned from {{Code|mount}}) within your code to find the device and its corresponding mount point.&lt;br /&gt;
&lt;br /&gt;
This is a problem with the standard embedded Debian automount program, and we have no known fix.&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|Perl Locale Errors on SSH|No Locales Installed}}&lt;br /&gt;
&lt;br /&gt;
By default, no locales are installed on the SBC.  If you use [[#apt|apt]] a lot to install and manage your software on the SBC, you will get messages like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
perl: warning: Setting locale failed.&lt;br /&gt;
perl: warning: Please check that your locale settings:&lt;br /&gt;
	LANGUAGE = (unset),&lt;br /&gt;
	LC_ALL = (unset),&lt;br /&gt;
	LANG = &amp;quot;en_CA.UTF-8&amp;quot;&lt;br /&gt;
    are supported and installed on your system.&lt;br /&gt;
perl: warning: Falling back to the standard locale (&amp;quot;C&amp;quot;).&lt;br /&gt;
locale: Cannot set LC_CTYPE to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_MESSAGES to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_ALL to default locale: No such file or directory&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To squelch these messages, you should install and reconfigure your locale like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install locales&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command will show you a long list from which you should pick your location, by language.  For example, en_CA is english_Canada.  Here in Calgary, we use en_CA.UTF-8 and so for the first question we would input locale &amp;quot;114&amp;quot; and for the second (system) question we would input {{Code|en_CA}} for the locale.&lt;br /&gt;
&lt;br /&gt;
This might give you a locale undefined error, in which case you can generate the locale (for us, again, it is en_CA):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
locale-gen en_CA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=24123</id>
		<title>Driver Changelog</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=24123"/>
		<updated>2019-04-09T21:45:30Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Administrative]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20190409===&lt;br /&gt;
*Fix GPS Date after April 6 2019 week rollover event&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20190208===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where devices plugged in before boot were inaccessible until unplugged/re-plugged on 2018 Mac Mini.&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20180622===&lt;br /&gt;
*Python fix&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20180215===&lt;br /&gt;
*Move to .NET 4.0&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20171215===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where opening two of the same device with -1 serial could cause missed attach/detach events and other errors.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160921===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where devices plugged in before boot were inaccessible until unplugged/re-plugged, under OS X 10.11. &lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160202===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Labview 7.1 support&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160107===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Don&#039;t throw an exception on EncoderPositionChangeEventArgs.Time in the .Net library when time it unknown - just return 0x7fffffff&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160104===&lt;br /&gt;
*Mac/Windows release&lt;br /&gt;
**New firmware for 1042 and 1044, fixing digital gyro&lt;br /&gt;
===2.1.8.20151217===&lt;br /&gt;
*Fixed 1045 bug where it will display an unknown ambient temperature sometimes&lt;br /&gt;
*Fixed a crash in the windows control panel&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151020===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Fixed an issue where the examples would error when trying to run them from the control panel.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151009===&lt;br /&gt;
*OS X and Windows release&lt;br /&gt;
**Upgraded firmware for 1024, 1032, 1041, 1042, 1043, 1044 and 1067 to address issues with these Phidgets on OS X El Capitan&lt;br /&gt;
*SBC release&lt;br /&gt;
**Support for multiple webcams &lt;br /&gt;
===2.1.8.20150821===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Support OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150805===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Preliminary support for OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150410===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed Makefile phidget21.h target issues&lt;br /&gt;
===2.1.8.20150326===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed issue with webservice buttons not being visible in the control panel&lt;br /&gt;
===2.1.8.20150323===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Updated icons with new company logo&lt;br /&gt;
===2.1.8.20150227===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Added copyright/licence headers to source code files&lt;br /&gt;
**Updated cvtutf files to a newer version&lt;br /&gt;
===2.1.8.20150109===&lt;br /&gt;
*Windows-only&lt;br /&gt;
**Fixed examples for Labview 8.5&lt;br /&gt;
===2.1.8.20141209===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Added support for armv7s and arm64 to the iOS library. Dropped support for armv6. Requires iOS 5.1.1 or later.&lt;br /&gt;
===2.1.8.20141202===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Labview release to support older versions&lt;br /&gt;
===2.1.8.20141119===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed an issue with the 2.1.8.20141117 release where nothing was actually installed.&lt;br /&gt;
===2.1.8.20141117===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed a code-signing issue that make the installer appear unsigned on OS X 10.10&lt;br /&gt;
**Dropped support for OS X 10.4&lt;br /&gt;
===2.1.8.20140905===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added an IA32 folder to the windows libraries download - this supports Windows on the Intel Galileo platform&lt;br /&gt;
===2.1.8.20140428===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to C# Stepper GUI Example&lt;br /&gt;
===2.1.8.20140319===&lt;br /&gt;
*CPhidget_getDeviceClass can now be called on handle before it is attached.&lt;br /&gt;
*Added support for 64-bit Max/MSP (Version 6.1+) on both OS X and Windows.&lt;br /&gt;
===2.1.8.20140227===&lt;br /&gt;
*Deals with 1046 bug in v100 and v101 firmware.&lt;br /&gt;
**No longer reports bad values that appear right after a channel is enabled.&lt;br /&gt;
**Fixes issue where changing the gain while channel 0 is disabled would sometimes cause bad readings.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20131105===&lt;br /&gt;
* Fixed a defect in the Flash examples for the 1012 (Outputs 11-16 were not addressed properly).&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20130926===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support setting label on 1067 from Windows&lt;br /&gt;
===2.1.8.20130820===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added logging option to control panel / C# full examples&lt;br /&gt;
===2.1.8.20130802===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fix for Windows 8 issue where only &#039;Uninitialized Phidget Handle&#039; would show up in the Manager, and Phidgets could not be opened.&lt;br /&gt;
===2.1.8.20130723===&lt;br /&gt;
*Improvement to java: we don&#039;t attach/detach our native threads for each event, just one attach, then detach before the thread exits.&lt;br /&gt;
**This increases performance, esp. when debugging on Android.&lt;br /&gt;
*Improvement to Android: We reuse the UsbRequest object rather then creating a new one for each transfer. This reduces logcat messages tremendously, and increases performance.&lt;br /&gt;
===2.1.8.20130710===&lt;br /&gt;
*Android-only release&lt;br /&gt;
**Added extra android target architectures: x86, MIPS, armeabi-v7a&lt;br /&gt;
===2.1.8.20130618===&lt;br /&gt;
*Changed setCompassCorrectionParameters() API call so that compass calibration parameters are written out to non-volatile storage on 1042/1044, so that they persist across power cycles. Previously, calibration data would need to be re-programmed at each attach.&lt;br /&gt;
*Changes to C# Spatial example:&lt;br /&gt;
**Compass calibration parameter set dialog removed from for 1042/1044 because parameters are set by the calibration software - and thus do not need setting in the example.&lt;br /&gt;
**Stores/restores parameters for 1056 based on serial number, so multiple different calibrations can be maintained.&lt;br /&gt;
===2.1.8.20130607===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to compass calibration software for 1042/1044&lt;br /&gt;
===2.1.8.20130419===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed setCompassCorrectionParameters in the COM library&lt;br /&gt;
===2.1.8.20130327===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Changed Windows installer to stop virus-scanner false positives&lt;br /&gt;
**Dropped support for Windows 2000&lt;br /&gt;
===2.1.8.20130320===&lt;br /&gt;
*Added EPHIDGET_NOTFOUND exception to Dictionary.getKey() for when the key is not found.&lt;br /&gt;
*Added exceptions back into the Java library - they have been missing since 2.1.8.20121015 release.&lt;br /&gt;
===2.1.8.20130313===&lt;br /&gt;
*Updates to Matlab support&lt;br /&gt;
**Works properly on Matlab 7+, on Windows, Mac, Linux without needing changes to .m files.&lt;br /&gt;
===2.1.8.20130221===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Encoder Index event added to C and .NET libraries&lt;br /&gt;
===2.1.8.20121218===&lt;br /&gt;
*Webservice version: 1.0.10&lt;br /&gt;
**Support for 1024, 1032&lt;br /&gt;
*Support for 1024, 1032&lt;br /&gt;
*fixed bug where if one half of a composite device is open, and PHIDGET_USB_ERROR_FLAG gets set, the device may never re-attach.&lt;br /&gt;
===2.1.8.20121015===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support for new pressure/light sensors in example.&lt;br /&gt;
===2.1.8.20120914===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Improved firmware upgrading in control panel - it was giving some false-errors on some machines.&lt;br /&gt;
===2.1.8.20120912===&lt;br /&gt;
*Fixed bug where 1065 could fail to attach when opened over webservice&lt;br /&gt;
*Fixed bug where close() could deadlock on Phidgets opened over the webservice&lt;br /&gt;
*Changed LED64 LED Brightness from int to double&lt;br /&gt;
**this may cause issues when controlling the LED64 over the webservice and library/webservice are not the same version&lt;br /&gt;
**the old setDiscreteLED call will remain, deprecated, with an int argument for compatibility.&lt;br /&gt;
===2.1.8.20120716===&lt;br /&gt;
*Linux-Only Release&lt;br /&gt;
**Fixed a bug where opening a device in two program at once would cause an attach-detach cycle as they fight each other for control.&lt;br /&gt;
===2.1.8.20120713===&lt;br /&gt;
*Mac-Only Release&lt;br /&gt;
**Added signing of the Mac installer, so Mountain Lion (OS X 10.8) doesn&#039;t refuse to run it.&lt;br /&gt;
===2.1.8.20120615===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that caused java to crash on events introduced in 2.1.8.20120612&lt;br /&gt;
===2.1.8.20120612===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed another bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120606===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120525===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed PhidgetIR sendRawData bug in .NET on 64-bit machines.&lt;br /&gt;
===2.1.8.20120514===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed a bug that causes a segfault with libusb-1.0 under 64-bit Linux.&lt;br /&gt;
===2.1.8.20120507===&lt;br /&gt;
*Mac/Linux-only release&lt;br /&gt;
**Fixes a setLabel bug introduced in 2.1.8.20120503&lt;br /&gt;
===2.1.8.20120503===&lt;br /&gt;
*Fixed some spelling mistakes&lt;br /&gt;
*Moved to libusb-1.0&lt;br /&gt;
**This resolves a bug where having a webcam plugged in caused a memory leak in the webservice.&lt;br /&gt;
*Fixed bug with advanced servo where setting acceleration to accelerationMax would cause an exception for some servo types&lt;br /&gt;
===2.1.8.20120216===&lt;br /&gt;
*Fixed bug with RFID Reader on OS X and Linux, as well as .NET over the webservice&lt;br /&gt;
*Fixed bug that could cause the Java Phidget Manager to crash during garbage collection.&lt;br /&gt;
===2.1.8.20120131===&lt;br /&gt;
*Fixed RFID Reader bug that caused tag event to not get thrown in .NET Applications&lt;br /&gt;
*Changed compass bearing calculations in spatial C# example&lt;br /&gt;
===2.1.8.20120123===&lt;br /&gt;
*Added support for 1061 v300+&lt;br /&gt;
*Fixed a bug where the firmware version could be mis-reported over Bonjour&lt;br /&gt;
===2.1.8.20111220===&lt;br /&gt;
*Fixed a bug in AppleScript where closing a Phidget opened via label would give a &#039;Connection Invalid&#039; error.&lt;br /&gt;
*Fixed a bug where the webservice may fail to start on Linux systems that don&#039;t support IPv6 (ie. SBC2).&lt;br /&gt;
*Fixed issue where ratiometric state on newest interfacekit wouldn&#039;t be read back properly if it was false during attach.&lt;br /&gt;
*Fixed webservice issue where ratiometric state would not be reported properly for newest interfacekits&lt;br /&gt;
*Increased the number of overrun errors ignored during initial attach for InterfaceKit.&lt;br /&gt;
*Fixed an issue with the iPhone library and header&lt;br /&gt;
===2.1.8.20111219===&lt;br /&gt;
*fixed various other webservice stability/performance/memory leak bugs&lt;br /&gt;
*Faster connection to SBC-connected Phidgets from Mac OS&lt;br /&gt;
*Don&#039;t report packetlost or overrun errors that happen during early initialization - these are just noise.&lt;br /&gt;
*Fixed a bug in the webservice tree removal function that could cause memory leaks.&lt;br /&gt;
*Fixed bug where Webservice would crash on Linux if the chosen serverID was already under use on the network&lt;br /&gt;
*Stopped sending hardware Error Events before the Attach event - they are now queued up and sent after Attach&lt;br /&gt;
*Fixed a crash in the [[Phidget Control Panel]]&lt;br /&gt;
*Added ability to remove dictionary keys from a key change listener&lt;br /&gt;
*Reduced the number of false &#039;pending command not finished&#039; error events on Close()&lt;br /&gt;
*Fixed a webservice bug where exceptions/false attach events could occur when close() is called soon after open&lt;br /&gt;
*Fixed bug where closing a PhidgetRFID soon after attach could cause a crash&lt;br /&gt;
*Fixed webservice but on MacOS where client could exit with SIG_PIPE error&lt;br /&gt;
*Fixed webservice bug where the server would sometimes exit(1) after many connect/disconnect cycles&lt;br /&gt;
*Fixed webservice bug where client could deadlock during close()&lt;br /&gt;
*Fixed webservice bug where opening a single remote phidget multiple times from the same application would fail&lt;br /&gt;
*Fixed a webservice bug where sockets weren&#039;t being closed properly sometimes&lt;br /&gt;
*Fixed a webservice bug where pre-attach error events wouldn&#039;t get through&lt;br /&gt;
*Fixed a bug where the webservice running on Linux would stop responding to clients after ~300 connect/disconnect cycles&lt;br /&gt;
*Fixed bug where a Phidget would become inaccessible until the app is restarted if a thread creation failed&lt;br /&gt;
*Fixed webservice bug where connect is slow on Windows when multiple clients are running simultaneously&lt;br /&gt;
*Fixed webservice bug where authentication would fail on a valid password&lt;br /&gt;
*Fixed webservice bug where attach may never happen, and would require a close()/open()&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20111121===&lt;br /&gt;
*Added support for new servo types to all libraries&lt;br /&gt;
*Fixed min/max position/velocity causing invalid arg exception on servo/advservo&lt;br /&gt;
*IPv6 support on MacOS&lt;br /&gt;
*Fixed some memory leaks&lt;br /&gt;
*Fixed hostname lookup issue on Mac OS with Back To My Mac enabled.&lt;br /&gt;
===2.1.8.20111028===&lt;br /&gt;
*Fixed Applescript bugs and released examples&lt;br /&gt;
*Added openLabel to .NET, Java, COM&lt;br /&gt;
*Setting change trigger to 0 on interfacekit will not set event mode.&lt;br /&gt;
**Previously setting change trigger to 0 after setting data rate would supersede the data rate setting, which is probably unexpected.&lt;br /&gt;
===2.1.8.20110630 - MacOS Only===&lt;br /&gt;
*handle USB bug introduced in MacOS 10.6.8&lt;br /&gt;
===2.1.8.20110615===&lt;br /&gt;
*Added error event when trying to open Phidgets with an unsupported version&lt;br /&gt;
===2.1.8.20110614 - Windows Only===&lt;br /&gt;
*Fixed bug in C# Spatial example&lt;br /&gt;
*Added support for negative gains in 1056&lt;br /&gt;
===2.1.8.20110601 - MacOS Only===&lt;br /&gt;
*Fixed AppleScript issues&lt;br /&gt;
===2.1.8.20110527===&lt;br /&gt;
*Fixed AS3.0 library (Flash/Flex) - wouldn&#039;t connect to webservice as of last release&lt;br /&gt;
*Fixed bug where webservice doesn&#039;t release a closed Phidget&lt;br /&gt;
*Fixed bug where devices that don&#039;t support label didn&#039;t show up on MacOS&lt;br /&gt;
*Fixed iPhone library issues&lt;br /&gt;
===2.1.8.20110524===&lt;br /&gt;
*AppleScript support added&lt;br /&gt;
*fixed problem with Spatial in .NET on 64-bit Windows&lt;br /&gt;
*Added remote setLabel to mac preference pane.&lt;br /&gt;
*fixed a bug where label characters 7,8,9 would be read back corrupted on certain devices.&lt;br /&gt;
**labels &amp;gt;7 characters that exhibit this bug will now be truncated to 7 characters when being read back&lt;br /&gt;
**call setLabel again using this library or newer to support 10 character labels.&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to &amp;lt;=7 characters on these devices.&lt;br /&gt;
*fixed bug on MacOS where serial number and/or label strings could be read wrong.&lt;br /&gt;
*better support for recovering misbehaving devices in Linux&lt;br /&gt;
*fixed a deadlock on linux when Avahi is installed but not running&lt;br /&gt;
*clear list of attached devices when closing remote manager&lt;br /&gt;
*Added support for Unicode labels&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to ASCII.&lt;br /&gt;
*Added open by label&lt;br /&gt;
*Webservice protocol version up to 1.0.9 (for open by label)&lt;br /&gt;
*Made opening multiple device is one application faster.&lt;br /&gt;
*TextLCD changes:&lt;br /&gt;
**cursor is disabled while writing to the display or setting a custom character to prevent display artifacts&lt;br /&gt;
**cursor is disabled when a full line is written so it doesn&#039;t go to the start of another line&lt;br /&gt;
**1204 should be stable&lt;br /&gt;
**setDisplayCharacter supports 0x00-0xff&lt;br /&gt;
*stopped property reflected more accurately in the C# stepper example&lt;br /&gt;
*Added error events to mac examples&lt;br /&gt;
===2.1.8.20110329 - Windows only===&lt;br /&gt;
*Fixed problem with control panel encoder example where enable wouldn&#039;t work&lt;br /&gt;
*Fixed issue with SpatialData, GPSPositionChange, PHChange and WeightChange events in Labview 64-bit&lt;br /&gt;
===2.1.8.20110322===&lt;br /&gt;
*Fixed [[Phidget Control Panel]] memory leak when Bonjour in installed but not running&lt;br /&gt;
*Fixed current sense formula on 1061_0 v200&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetAdvancedServo&lt;br /&gt;
*Fixed bug in old PhidgetTemperatureSensor&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20110310===&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetServo&lt;br /&gt;
*Fixed some Labview bugs&lt;br /&gt;
*Added some Java and VB.NET examples&lt;br /&gt;
===2.1.8.20110301===&lt;br /&gt;
*Full Support for 1002, 1011, 1040, 1046, 1054, 1065, 1204&lt;br /&gt;
*New webservice version - 1.0.8&lt;br /&gt;
**Support for new devices&lt;br /&gt;
**Support for error events&lt;br /&gt;
===2.1.7.20110203===&lt;br /&gt;
*fixed crash on close of remote Phidget on MacOS&lt;br /&gt;
*C# ifkit example bugfix - crashed on 1015/1016&lt;br /&gt;
*webservice improvements&lt;br /&gt;
*Switch to IP address for SBC config in browser&lt;br /&gt;
*Faster IP lookup for SBCs in control panel&lt;br /&gt;
===2.1.7.20101222 / 2.1.7.20101223===&lt;br /&gt;
*fixed getServerID on Linux&lt;br /&gt;
*removed report ack&lt;br /&gt;
**this was causing some bad side effects&lt;br /&gt;
*manual .local lookups on Windows&lt;br /&gt;
**much faster then letting Windows do it itself&lt;br /&gt;
*Support for new Labview library&lt;br /&gt;
*Fixed PhidgetIR bug where library would crash if repeat code is longer then IR_MAX_REPEAT_LENGTH&lt;br /&gt;
===2.1.7.20101103===&lt;br /&gt;
*Decreased Phidget Webservice event latency on Windows&lt;br /&gt;
*Preliminary support for 1002, 1011, 1040, 1045, 1046, 1054, 1065, 1204 (C, .NET)&lt;br /&gt;
*Webservice version updated to 1.0.7&lt;br /&gt;
**support for 1045, 1011, 1204&lt;br /&gt;
*Fixed a bug where webservice connections could be unexpectedly lost&lt;br /&gt;
*Bugfix: couldn&#039;t set interfacekit data rate over webservice.&lt;br /&gt;
*Fixed some memory leaks in the Mac library&lt;br /&gt;
*Fixed bug where blocking for &amp;gt;2 seconds in an events handler when opening remotely could cause a crash.&lt;br /&gt;
===2.1.7.20100803===&lt;br /&gt;
*Windows only release&lt;br /&gt;
*fixed setLabel in WindowsCE&lt;br /&gt;
*fixed getHashCode in .NET library - needed for working with Phidgets in Labview via .NET&lt;br /&gt;
===2.1.7.20100621===&lt;br /&gt;
*Linux only release - autotools updates&lt;br /&gt;
**call ldconfig automatically&lt;br /&gt;
**remove old phidget21 library (pre-autotools) when installing new one.&lt;br /&gt;
===2.1.7.20100620===&lt;br /&gt;
*Linux only release - added version.sh for autoreconf&lt;br /&gt;
===2.1.7.20100618===&lt;br /&gt;
*Linux only release - added udev/hotplug files&lt;br /&gt;
===2.1.7.20100617===&lt;br /&gt;
*Linux only release&lt;br /&gt;
*Transitioned to autotools in linux for phidget21 / webservice&lt;br /&gt;
*phidget21 library and webservice are now separate downloads&lt;br /&gt;
===2.1.7.20100525===&lt;br /&gt;
*full support for PhidgetSpatial and PhidgetIR in all libraries&lt;br /&gt;
*fixed 1031 not attaching in AS3.0&lt;br /&gt;
*Better error messages in JNI&lt;br /&gt;
*Updated error codes, device ID/Class lists in Java, Flash, COM, etc.&lt;br /&gt;
*Fixed TemperatureSensor version 200,201,202 bug - ambient sensor would not report negative temperatures.&lt;br /&gt;
*Revised temperaturesensor API to report tempMin/tempMax and errors more accurately.&lt;br /&gt;
*Added initial events for encoder digital inputs&lt;br /&gt;
*full support for 1047&lt;br /&gt;
*Added new device support to WindowsCE&lt;br /&gt;
*Updated mac examples for 1047, 1048&lt;br /&gt;
===2.1.6.20100504===&lt;br /&gt;
*Windows only Release&lt;br /&gt;
**Added 1131 and 1132 to InterfaceKit example in MSI&lt;br /&gt;
===2.1.6.20100428===&lt;br /&gt;
*limit data rate maximum to 16ms over the webservice for devices that expose dataRate (InterfaceKit, Spatial)&lt;br /&gt;
*fixed bug where TextLCD 8/8/8 would stay in Bonjour list after webservice is shutdown&lt;br /&gt;
*set/get Brightness for 1203_2&lt;br /&gt;
*Support 1048 in C# example&lt;br /&gt;
*webservice version incremented to 1.0.6&lt;br /&gt;
**TextLCD set/get brightness&lt;br /&gt;
**PhidgetIR support&lt;br /&gt;
**PhidgetSpatial support&lt;br /&gt;
**1047 support (enable, index)&lt;br /&gt;
===2.1.6.20100406===&lt;br /&gt;
*Support for 1018_2 (dataRate)&lt;br /&gt;
*Webservice version incremented to 1.0.5&lt;br /&gt;
===2.1.6.20100401===&lt;br /&gt;
*Updated InterfaceKit example with new sensors&lt;br /&gt;
*make Windows connect cancelable&lt;br /&gt;
*make pending zeroconf lookups cancelable during close&lt;br /&gt;
===2.1.6.20100318===&lt;br /&gt;
*Mac only release&lt;br /&gt;
**Added WillSleep and Wakeup events to give user control of Phidgets immediately before and after a system sleep (MacOS Only).&lt;br /&gt;
===2.1.6.20100317===&lt;br /&gt;
*Windows only release&lt;br /&gt;
**Some of the examples were being built using an out of date .NET library&lt;br /&gt;
===2.1.6.20100310===&lt;br /&gt;
*MaxMSP fix - 2.1.6.20100126 introduced a bug for some Phidgets where openremote/open by serial didn&#039;t work and MaxMSP would sometimes crash.&lt;br /&gt;
**No code changes to any of the other libraries.&lt;br /&gt;
===2.1.6.20100304===&lt;br /&gt;
*stopped property changes trigger events over webservice so they are noticed.&lt;br /&gt;
**more compatible with how local open works&lt;br /&gt;
*added 5 new servos&lt;br /&gt;
*fixed bug where remote close would not set detached so a subsequent open would not always connect.&lt;br /&gt;
*handle UninitializeZeroconf better - shut down thread before closing handles, fixes hang on SBC&lt;br /&gt;
*fixed bug on Mac where detaching 2 or more Phidgets at the same time caused a crash&lt;br /&gt;
*fixed close blocking because of a pending connect (mac, linux)&lt;br /&gt;
*Final support for 1031 in all libraries.&lt;br /&gt;
===2.1.6.20100129===&lt;br /&gt;
*Implemented initial events in Flash&lt;br /&gt;
**Flash behaviour should now be identical to C library local and remote.&lt;br /&gt;
*Fix RFID issue where close could cause crash&lt;br /&gt;
*increment webservice version to 1.0.4&lt;br /&gt;
*fixed RFID remote open&lt;br /&gt;
**Flash would never get an attach event if the reader had been previously opened&lt;br /&gt;
**Initial tag event would not be fired when a tag was present and the antenna was enabled prior to open&lt;br /&gt;
*fixed openRemote failing on Mac&lt;br /&gt;
*fixed deadlock in webservice which could be hit by opening/closing a device over and over again.&lt;br /&gt;
*fixed bug in stepper, which caused seg fault on SBC on position change events.&lt;br /&gt;
===2.1.6.20100126===&lt;br /&gt;
*added network open support in Max/MSP&lt;br /&gt;
===2.1.6.20100115===&lt;br /&gt;
*Increased network performance for Linux/MacOS&lt;br /&gt;
*Added five servo types&lt;br /&gt;
===2.1.6.20091215===&lt;br /&gt;
*Fixed busy loop in Linux openRemote&lt;br /&gt;
*JNI Library relocated to /Library/Java/Extensions on MacOS&lt;br /&gt;
===2.1.6.20091211===&lt;br /&gt;
*Heartbeat now works on Linux as well (had to make sockets non-blocking)&lt;br /&gt;
===2.1.6.20091130===&lt;br /&gt;
*Added heartbeat to webservice (client side)&lt;br /&gt;
**Better detects network failures by using active polling timeouts&lt;br /&gt;
*Fixed 0/8/8 over webservice&lt;br /&gt;
===2.1.6.20091020===&lt;br /&gt;
*Fixed 1052 counting issue on 1070 (-1 reported as 255)&lt;br /&gt;
*Fixed issue where Phidget21 would try to reinstall from a limited user account or when the Control Panel was disabled.&lt;br /&gt;
*64-bit kernel support in Snow Leopard&lt;br /&gt;
===2.1.6.20090928===&lt;br /&gt;
*Support for PhidgetSBC (1070)&lt;br /&gt;
*zeroconf can handle starting up before the mdns daemon, and will keep trying to connect.&lt;br /&gt;
*fixed 1066 not showing up on Mac&lt;br /&gt;
*added advanced servo example to mac pref pane&lt;br /&gt;
*implemented proper error handling in COM&lt;br /&gt;
**default behavious remains the same, enable proper error handling with &#039;EnableVerboseErrors&#039;&lt;br /&gt;
*implemented error events in Java&lt;br /&gt;
===2.1.6.20090917===&lt;br /&gt;
*Updated webservice protocol version to 1.0.3&lt;br /&gt;
*Fixed stepper under AS3.0&lt;br /&gt;
*added setServoType, getServoType, setServoParameters to PhidgetServo and PhidgetAdvancedServo&lt;br /&gt;
*possible race condition fixed in webservice (pdictclient.c:907)&lt;br /&gt;
===2.1.6.20090902 (mac only release)===&lt;br /&gt;
*Support MacOSX 10.6, drop support for 10.3.9, require 10.4 or newer&lt;br /&gt;
**Fully 64-bit compliant, library supports ppc, i386, x86_64&lt;br /&gt;
===2.1.6.20090806===&lt;br /&gt;
*Added 1049 support&lt;br /&gt;
*Fixed RFID tag events over webservice&lt;br /&gt;
===2.1.6.20090804===&lt;br /&gt;
*Added 1051_2 support&lt;br /&gt;
*Fixed various small initialization issues - stepper, adv servo, rfid&lt;br /&gt;
*Added 32-bit library install to 64-bit installer&lt;br /&gt;
**VB6.0, etc. need the 32-bit COM library on 64-bit windows&lt;br /&gt;
===2.1.6.20090717===&lt;br /&gt;
*?&lt;br /&gt;
===2.1.6.20090708===&lt;br /&gt;
*Added DeviceID to zeroconf&lt;br /&gt;
*fixed RFID.LastTag in .NET&lt;br /&gt;
*Changed the error codes returned by error events; error events now have their own set of error codes rather then sharing the function return codes.&lt;br /&gt;
*Added support for 1047, 1048&lt;br /&gt;
*Added error event codes rather then trying to reuse the EPHIDGET return codes.&lt;br /&gt;
*fixed TextLCD issue where display could get corrupted during a detach/attach&lt;br /&gt;
*made mac more reliable on attach&lt;br /&gt;
*more error logging on mac&lt;br /&gt;
===2.1.6.20090525===&lt;br /&gt;
*fixed RFID not attaching via webservice if a tag is present.&lt;br /&gt;
*bugfix related to double free on detach event.&lt;br /&gt;
*Implemented getKey&lt;br /&gt;
*Added MIPS II support to Windows CE&lt;br /&gt;
===2.1.6.20090430===&lt;br /&gt;
*Added ActiveX interface to COM library&lt;br /&gt;
*Added stepper and advancedServo to Flex .swc library&lt;br /&gt;
===2.1.6.20090417===&lt;br /&gt;
*added PhidgetIR prototype support to C library&lt;br /&gt;
*properly handles sleeping on OSX&lt;br /&gt;
*fixed some webservice field initializations in Flash and C&lt;br /&gt;
*fixed security exceptions in [[Phidget Control Panel]] under Vista&lt;br /&gt;
*added [[Phidget Control Panel]] to start menu&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090318 (Examples/AS3.0 only release)===&lt;br /&gt;
*Fixed AdvancedServo in Flash - wouldn&#039;t attach&lt;br /&gt;
===2.1.6.20090317===&lt;br /&gt;
*[[Phidget Control Panel]] properly supports Vista UAC and Limited user accounts in XP, etc.&lt;br /&gt;
*Added 64-bit release of Phidget21.msi for Windows&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090312===&lt;br /&gt;
*added 1064, 1059 to WindowsCE&lt;br /&gt;
*fixed opening 1051 over webservice&lt;br /&gt;
*fixed opening 1015/1016 over webservice broken in last release&lt;br /&gt;
===2.1.6.20090302===&lt;br /&gt;
*Advanced servo bugfix: stopped would stop being true if min/max was set to exclude current position.&lt;br /&gt;
*linux USB improvements when many Phidgets are attached and opened at once.&lt;br /&gt;
*1031 support in phidget21, webservice, .NET - hidden until product release&lt;br /&gt;
**CPhidgetLED_setVoltage&lt;br /&gt;
**CPhidgetLED_getVoltage&lt;br /&gt;
**CPhidgetLED_setCurrentLimit&lt;br /&gt;
**CPhidgetLED_getCurrentLimit&lt;br /&gt;
*unknown timechange == PUNK_INT in encoder position change event&lt;br /&gt;
**1st position change event&lt;br /&gt;
**&amp;gt; 30 seconds time change&lt;br /&gt;
*AS3 updates&lt;br /&gt;
**updated to 1.0.2 webservice&lt;br /&gt;
**encoder position change events report relative change rather then absolute position&lt;br /&gt;
**encoder adds getTimeChange function for timing encoder changes&lt;br /&gt;
*webservice updated to 1.0.2&lt;br /&gt;
**Authorization is asynchronous&lt;br /&gt;
**Doesn&#039;t match the old version checking, so errors will not be nice when trying to connect to an old webservice&lt;br /&gt;
**Sends out all initial data, so it&#039;s just like opening locally&lt;br /&gt;
**supports interfacekit Raw sensor value&lt;br /&gt;
**supports labels on remoteIP managers&lt;br /&gt;
*avahi bugfix&lt;br /&gt;
*webservice more stable against forcefully closed clients&lt;br /&gt;
*closing a network Phidget won&#039;t block - ever.&lt;br /&gt;
**no longer using quit, just closing the socket&lt;br /&gt;
*added libavahi-client.so.3 reference to linux library.&lt;br /&gt;
*Fixed bug with opening one phidget with serial and no serial at the same time over the webservice&lt;br /&gt;
===2.1.5.20090105===&lt;br /&gt;
*[[Phidget Control Panel]] stability improvements&lt;br /&gt;
*added CPhidgetSBC_getHostname&lt;br /&gt;
*advanced servo 1 motor current sense equation - support should now be complete&lt;br /&gt;
*webservice and network code bugfixes - crash / deadlock during close, problems with concurrent connections, etc.&lt;br /&gt;
*fixed close on remote and remoteIP managers&lt;br /&gt;
*name of RFID changed from &amp;quot;Phidget RFID 4-output&amp;quot; to &amp;quot;Phidget RFID 2-output&amp;quot; - updated anything referencing old name.&lt;br /&gt;
&lt;br /&gt;
===2.1.5.20081023===&lt;br /&gt;
*added advanced servo and stepper examples to VB6.0, VB.NET and C&lt;br /&gt;
*added deviceClass and deviceID&lt;br /&gt;
*updated Mac examples&lt;br /&gt;
*webservice protocol version enforcement&lt;br /&gt;
*internal fix/rework of device id&#039;s etc.&lt;br /&gt;
*Fixed memory leaks in webservice and phidget21 network code.&lt;br /&gt;
*Dictionary and network stability improvements.&lt;br /&gt;
*duplicate calls to open or close are now silently ignored.&lt;br /&gt;
===2.1.4.20080924===&lt;br /&gt;
*Old TextLCD 0/8/8&#039;s can now have both halves open at the same time on Windows&lt;br /&gt;
*fixed bug with composite devices on linux&lt;br /&gt;
*fixed manager on linux to better deal with unique devices&lt;br /&gt;
===2.1.4.20080922===&lt;br /&gt;
*Updated Delphi files&lt;br /&gt;
*TextLCD can display 0x80-0xFF characters from Java&lt;br /&gt;
*getAttachedDevices works for mdns managers&lt;br /&gt;
*fixed a deadlock in the webservice&lt;br /&gt;
*better network error handling / password support for windows C# examples&lt;br /&gt;
*waitForAttachment will return EPHIDGET_CLOSED if the handle is closed while it is waiting.&lt;br /&gt;
*added EPHIDGET_CLOSED&lt;br /&gt;
*joining central threads checks whether they are trying to be joined by themselves first (avoid deadlocks).&lt;br /&gt;
*changed context of error event to be free from locks (can call close, open, etc. from them).&lt;br /&gt;
===2.1.4.20080821===&lt;br /&gt;
*zeroconf threads exit cleanly on last _close (apple zeroconf)&lt;br /&gt;
*Added advanced servo and stepper to Max&lt;br /&gt;
===2.1.4.20080811 (mac only release)===&lt;br /&gt;
*Fixed manager on Mac (wasn&#039;t working at all since 2.1.4.20080808)&lt;br /&gt;
===2.1.4.20080808===&lt;br /&gt;
*added CPhidgetSBC and CPhidgetSBCManager to the c library - these interfaces are hidden from users and meant to be used internally (for now).&lt;br /&gt;
*CPhidgetManager_open no longer blocks to send out initial attach events. These initial events are sent from the CentralThread context like all other attach events.&lt;br /&gt;
*fixed CThread_wait_on_event on Linux&lt;br /&gt;
*added CPhidgetGeneric interface for prototyping to C, .NET libraries. product ID is 0x99. These are only visible in debug releases, only to be used internally.&lt;br /&gt;
===2.1.4.20080715===&lt;br /&gt;
*udev rules fixed for product IDs with alpha-hex values&lt;br /&gt;
*blocking in an attach event does not block calls to open anymore&lt;br /&gt;
*RFID tag event handlers can now handle blocking - tag lost is timed after the tag handler exits.&lt;br /&gt;
===2.1.4.20080623===&lt;br /&gt;
*Flex .swc library was out of sync&lt;br /&gt;
*fixed CPhidgetManager_getAttachedDevices for network managers&lt;br /&gt;
*Added CPhidgetManager_freeAttachedDevicesArray&lt;br /&gt;
===2.1.4.20080613===&lt;br /&gt;
*Max/MSP RFID fixed&lt;br /&gt;
*0/0/8 and advanced servo added to CE&lt;br /&gt;
*fixed flash policy file server in webservice&lt;br /&gt;
*webservice with password and asynchronous together work now&lt;br /&gt;
===2.1.4.20080602===&lt;br /&gt;
*phidget21.h -&amp;gt; phidget21int.h so as not to be confused with generated phidget21.h&lt;br /&gt;
*some changes to Makefile fro crosscompiling&lt;br /&gt;
*no more vbscript in msi&lt;br /&gt;
===2.1.4.20080513===&lt;br /&gt;
*removed long long from COM - not supported by VB6.0&lt;br /&gt;
*added LastTag to RFID in .NET&lt;br /&gt;
===2.1.4.20080428===&lt;br /&gt;
*support Mac OS X 10.3.9 again&lt;br /&gt;
*Rev up to 2.1.4&lt;br /&gt;
*finalize Phidget Stepper API - Phidget Stepper requires 2.1.4 as a minimum&lt;br /&gt;
*fixed serverConnect and serverDisconnect handlers for manager and dictionary in COM&lt;br /&gt;
*Changed:&lt;br /&gt;
**PhidgetStepper and PhidgetAdvancedServo&lt;br /&gt;
***MotorPosition -&amp;gt; Position&lt;br /&gt;
***MotorOn -&amp;gt; Engaged&lt;br /&gt;
***MotorStopped -&amp;gt; Stopped&lt;br /&gt;
*Added:&lt;br /&gt;
**CPhidgetStepper_getCurrentLimit&lt;br /&gt;
**CPhidgetEncoder_getPosition&lt;br /&gt;
**CPhidgetEncoder_setPosition&lt;br /&gt;
**CPhidgetMotorControl_getVelocity&lt;br /&gt;
**CPhidgetMotorControl_setVelocity&lt;br /&gt;
**CPhidgetMotorControl_set_OnVelocityChange_Handler&lt;br /&gt;
**CPhidgetServo_setEngaged&lt;br /&gt;
**CPhidgetServo_getEngaged&lt;br /&gt;
**CPhidgetServo_getPosition&lt;br /&gt;
**CPhidgetServo_setPosition&lt;br /&gt;
**CPhidgetServo_set_OnPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getPositionMax&lt;br /&gt;
**CPhidgetServo_getPositionMin&lt;br /&gt;
**Count functions&lt;br /&gt;
*Deprecated:&lt;br /&gt;
**CPhidgetEncoder_getEncoderPosition&lt;br /&gt;
**CPhidgetEncoder_setEncoderPosition&lt;br /&gt;
**CPhidgetMotorControl_getMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_setMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_set_OnMotorChange_Handler&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorPosition&lt;br /&gt;
**CPhidgetServo_setMotorPosition&lt;br /&gt;
**CPhidgetServo_set_OnMotorPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**Num functions&lt;br /&gt;
*Added ability to deprecate funcitons in the C library - compiler will issue a warning when they are used.&lt;br /&gt;
*added names to some arguments in phidget21.h&lt;br /&gt;
*fixes to the webservice for initial state stuff - now it behaves almost like non-webservice, with guaranteed initial events, but we don&#039;t guarantee initial state in the attach event yet. Min/Max, Num motors, inputs, etc. are all guaranteed in the attach handler.&lt;br /&gt;
*Finalized support for Phidget Stepper&lt;br /&gt;
===2.1.3.20080402===&lt;br /&gt;
*Fixed windows BUG - Device Type was showing up wrong&lt;br /&gt;
*CPhidgetStepper_getPosition -&amp;gt; CPhidgetStepper_getCurrentPosition&lt;br /&gt;
===2.1.3.20080327===&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorStopped&lt;br /&gt;
*changes to API&lt;br /&gt;
**CPhidgetStepper_setMotorPosition -&amp;gt; CPhidgetStepper_setTargetMotorPosition&lt;br /&gt;
**added CPhidgetStepper_getTargetMotorPosition&lt;br /&gt;
**Stepper MotorSpeed -&amp;gt; Velocity&lt;br /&gt;
**Stepper and AdvancedServo MaxVelocity -&amp;gt; VelocityLimit&lt;br /&gt;
*add waitForAttachment to COM&lt;br /&gt;
*COM getbool (not indexed) will now return FALSE on false (rather then always returning true)&lt;br /&gt;
*fixed write thread timeouts - was setting attached after starting write thread so write thread would see a detached device and exit immediately&lt;br /&gt;
===2.1.3.20080206===&lt;br /&gt;
*changed long long to __int64, to be happy in borland C++&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetStepper_getMaxMotorSpeed&lt;br /&gt;
**CPhidgetStepper_setMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorStopped&lt;br /&gt;
**CPhidgetStepper_setCurrentMotorPosition&lt;br /&gt;
*removed CPhidgetStepper_setVelocity&lt;br /&gt;
*added CPhidgetStepper_setMaxVelocity, CPhidgetStepper_getMaxVelocity&lt;br /&gt;
===2.1.3.20080114===&lt;br /&gt;
*Added new functions to Flash API&lt;br /&gt;
*Added new functions to Webservice Protocol&lt;br /&gt;
*Added new functions to COM Library&lt;br /&gt;
*Added new functions to Java Library&lt;br /&gt;
*All device fiels in C library cleaned up and made consistent&lt;br /&gt;
*Open in windows is exclusive - this needs to be tested for stability&lt;br /&gt;
*No data will be returned / accepted if it lies outside of max/min range&lt;br /&gt;
*if a data value is unknown, user variable is set to PUNK_INT, PUNK_DBL, or PUNK_BOOL, and return value is EPHIDGET_UNKNOWNVAL&lt;br /&gt;
*Proper Device initializations on Attach:&lt;br /&gt;
**triggers are set to defaults on attach&lt;br /&gt;
**device state is read in and preserved on attach&lt;br /&gt;
**during attach event, all sensor data, etc. is provided if available&lt;br /&gt;
**no data events until after the attach event returns&lt;br /&gt;
**everything initialized by the time waitForAttachment returns&lt;br /&gt;
**after attach event returns, a full set of initial state data events are thrown&lt;br /&gt;
*.NET collections are readonly, and never NULL (but empty when phidget detached)&lt;br /&gt;
*.NET callbacks no longer catch and hide all exceptions&lt;br /&gt;
**make sure to use try/catch blocks especially in Attach when accessing properties that may not be initialized.&lt;br /&gt;
*added min/max functions:&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMax&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMax&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMax&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMax&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMin&lt;br /&gt;
**CPhidgetPHSensor_getPHMax&lt;br /&gt;
**CPhidgetPHSensor_getPHMin&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMax&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMin&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetStepper_getAccelerationMax&lt;br /&gt;
**CPhidgetStepper_getAccelerationMin&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMax&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMin&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMax&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMin&lt;br /&gt;
*Added functions:&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperature&lt;br /&gt;
**CPhidgetTemperatureSensor_getThermocoupleType&lt;br /&gt;
**CPhidgetTemperatureSensor_setThermocoupleType&lt;br /&gt;
**CPhidget_set_OnServerConnectHandler&lt;br /&gt;
**CPhidget_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_getServerID&lt;br /&gt;
**CPhidgetDictionary_getServerAddress&lt;br /&gt;
**CPhidgetDictionary_getServerStatus&lt;br /&gt;
**CPhidgetManager_getServerID&lt;br /&gt;
**CPhidgetManager_getServerAddress&lt;br /&gt;
**CPhidgetManager_getServerStatus&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
*Removed functions:&lt;br /&gt;
**CPhidgetServo_setMotorOff&lt;br /&gt;
*TemperatureSensor:&lt;br /&gt;
**Ambient sensor is accessed with it&#039;s own function&lt;br /&gt;
**first thermocouple is Index 0 everywhere&lt;br /&gt;
**no ambient sensor events&lt;br /&gt;
*getServerID is implemented&lt;br /&gt;
*changed the internal network structure (added CPhidgetRemote)&lt;br /&gt;
*reworked the USB code (mostly on Windows)&lt;br /&gt;
**Better handles closing, ESD events, timeouts&lt;br /&gt;
**fixed issues with Encoder, RFID stopping reading after a certain time.&lt;br /&gt;
**added USB error flag&lt;br /&gt;
*openRemote functions have been implemented&lt;br /&gt;
**these require bonjour (mac / windows) or avahi (linux) to be installed on both the client and server&lt;br /&gt;
**if they are not, you get EPHIDGET_UNSUPPORTED when you call them&lt;br /&gt;
*openRemoteIP functions are asynchronous and persistent&lt;br /&gt;
*include cphidgetconstants.h in phidget21.h for users&lt;br /&gt;
===2.1.2.20071108===&lt;br /&gt;
*start of chagelog&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=OS_-_OS_X&amp;diff=24122</id>
		<title>OS - OS X</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=OS_-_OS_X&amp;diff=24122"/>
		<updated>2019-02-11T17:22:37Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
{{OSLang|[[File:Icon-Mac-OS.png‎|64x64px|link=]]|On OS X, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#WebService|WebService]].}}&lt;br /&gt;
__TOC__&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;OS X 10.5 Leopard or newer&#039;&#039;&#039;, and can run on PPC, 32-bit, and 64-bit systems.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide for your specific Phidget device, which may be found in its [[:Category:UserGuide|user guide]].  If you already have the Preference Pane Installed and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the workings behind the Preference Pane, the Phidget WebService, and more - all specific to OS X.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
*OS X 10.7+: [{{SERVER}}/downloads/phidget21/libraries/macos/Phidget.dmg Installer Download]&lt;br /&gt;
*Mac OS X 10.5 - OS X 10.6: [{{SERVER}}/downloads/phidget21/libraries/macos/Phidget_OS_X_10_5.dmg Installer Download]&lt;br /&gt;
*[[Software License]]&lt;br /&gt;
&lt;br /&gt;
If you need old versions of the libraries, [{{SERVER}}/downloads/phidget21/libraries/macos/Phidget/ click here].&lt;br /&gt;
&lt;br /&gt;
==Getting Started with OS X==&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|o2P580PvjCg}}&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer will install the core Phidget files onto your system.&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download the Phidget installer for your system:&lt;br /&gt;
*[{{SERVER}}/downloads/phidget21/libraries/macos/Phidget.dmg OS X Installer]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and double click on {{Code|Phidgets.mpkg}} to install the libraries.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX Install 1.png|link=|alt=OS X Install]]&lt;br /&gt;
&lt;br /&gt;
3. Proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX Install 2.png|link=|alt=OS X Install]]&lt;br /&gt;
&lt;br /&gt;
4. Once the installation is complete, you are ready to program with Phidgets. To find out what files got installed, please see [[#Description of Installer files | Description of Installer files]] in the Appendix section.&lt;br /&gt;
&lt;br /&gt;
Proceed onto to the [[#Phidget Preference Pane | next]] section where the Phidget Preference Pane will be discussed.&lt;br /&gt;
&lt;br /&gt;
====Phidget Preference Pane====&lt;br /&gt;
&lt;br /&gt;
The Phidget Preference Pane is a tool to quickly determine whether your system is able to communicate with Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, open up the {{Code|System Preferences}} window.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX System Preferences.png|link=|alt=OS X System Preferences]]&lt;br /&gt;
&lt;br /&gt;
Click on the {{Code|Phidgets}} icon in the {{Code|Other}} section to bring up the Phidgets Preference Pane.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane General.png|link=|alt=OS X PreferencePane General]]&lt;br /&gt;
&lt;br /&gt;
The Phidget Preference Pane can:&lt;br /&gt;
* Access and test Phidgets connected to your computer&lt;br /&gt;
* Update device firmware&lt;br /&gt;
* Access other Phidgets over the webservice, and make your local Phidgets accessible over the webservice&lt;br /&gt;
* Make use of the [[Phidget Dictionary]]&lt;br /&gt;
* Manage the labels of connected Phidgets&lt;br /&gt;
* View all [[OS_-_Phidget_SBC|SBCs]] on the network and view their webpages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For more information, visit the [[Phidget Control Panel#OS X|Phidget Preference Pane]] page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software components of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software component is working by seeing if the Phidget device is listed in the General tab of the Phidget Preference Pane.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane General.png ‎|link=|alt=OS X Preference Pane General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If you see your Phidget in the list, you can continue to the [[#Programming Languages | programming languages]] section to learn more. If you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the OS X System Profiler. You can access the System Profiler by selecting {{Code|About This Mac}} under the Apple icon. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX About This Mac.png‎|link=|alt=OS X About This Mac]]&lt;br /&gt;
&lt;br /&gt;
The new window will open up.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX More Info.png|link=|alt=OS X More Info]]&lt;br /&gt;
&lt;br /&gt;
Select {{Code|More Info}}. The System Profiler will show up. In the USB section, you will be able to find all connected USB devices. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX USB Devices.png ‎|link=|alt=OS X Attached USB Devices]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, The PhidgetInterfaceKit and PhidgetRFID are connected to the USB ports. &lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the example programs &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using OS X 10.5 or newer. &lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Quick Downloads| quick downloads section]] to download them)&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Us|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
Phidgets’ philosophy is that you do not have to be an electrical engineer in order to do projects that use devices like sensors, motors, motor controllers, and interface boards. All you need to know is how to program.&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language. You can learn more about what is needed to program in a particular language by choosing the language of your preference below. If you need help choosing a language, please look at the [[Software Overview#Language Support |language comparison table]]. &lt;br /&gt;
&lt;br /&gt;
We recommend the following languages for OS X:&lt;br /&gt;
* [[Language - Applescript|AppleScript]]&lt;br /&gt;
* [[Language - C/C++|C/C++]]&lt;br /&gt;
* [[Language - C Sharp|C# (Using Mono)]]&lt;br /&gt;
* [[Language - Cocoa | Cocoa]]&lt;br /&gt;
* [[Language - Flash AS3 | Flash AS3]]&lt;br /&gt;
* [[Language - Flex AS3 | Flex AS3]]&lt;br /&gt;
* [[Language - LiveCode | LiveCode]]&lt;br /&gt;
* [[Language - Java | Java]]&lt;br /&gt;
* [[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
* [[Language - Python | Python]]&lt;br /&gt;
* [[Language - Ruby|Ruby]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
==WebService==&lt;br /&gt;
&lt;br /&gt;
The Phidget WebService allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget WebService on OS X are already included in the [[#Quick Downloads | Drivers]] above. If you see the Phidget Preference Pane in System Preferences, then you already have the WebService drivers installed.&lt;br /&gt;
&lt;br /&gt;
There are two ways that you can connect to a Phidget hosted on another computer. The first method is by using the IP address/host name and port of the host computer. The second method makes the use of [http://en.wikipedia.org/wiki/Multicast_DNS mDNS], which allows Phidgets to be found and opened on the network by a server id instead of an IP address/host name. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget WebService takes advantage of [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software, which is built-in to OS X. It is a tool developed by Apple to locate devices, such as Phidgets,  on a network.&lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the WebService on Windows, but we also have an overview of the [[Phidget WebService]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the WebService On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the WebService on and off. The first method is through the Phidget Preference Pane. In the {{Code|WebService}} tab, you can start or stop the WebService. You can also choose to have the WebService start up automatically upon system boot up by selecting the {{Code|Start Automatically}} checkbox. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Webservice Stopped.png|link=|alt=OS X PreferencePane WebService]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the WebService on and off is through command line. After using our installer, the WebService utility is automatically installed in {{Code|/usr/bin/phidget21webservice}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|phidgetwebservice21}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 phidgetwebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mapping out which command line options to which Phidget Preference Pane option is as follows:&lt;br /&gt;
&lt;br /&gt;
-p: {{Code|Port}} field&lt;br /&gt;
&lt;br /&gt;
-n: {{Code|ServerID}} field&lt;br /&gt;
&lt;br /&gt;
-P: {{Code|Password}} field&lt;br /&gt;
&lt;br /&gt;
-v: Not supported under the Phidget Preference Pane&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, use {{Code|hostname}} on the command line.&lt;br /&gt;
*For your IP address, use {{Code|ifconfig -a}} on the command line.&lt;br /&gt;
**A line in the return text, under your main internet connection (usually {{Code|eth0}}) will say something like {{Code|inet addr:192.168.3.178}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some usage examples:&lt;br /&gt;
&lt;br /&gt;
To start the WebService with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 phidgetwebservice21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the WebService with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 phidgetwebservice21-n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To stop the WebService, simply close the command line window or press {{Code|Control}} and {{Code|c}} at the same time in the command line window.&lt;br /&gt;
&lt;br /&gt;
===Using the WebService===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the WebService, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that if you only have a single computer, you can also connect to the Phidget over the WebService. The computer will simply act as both a host and client. This will allow you to bypass the [[General Phidget Programming # Details for Open() | one application per Phidget limitation]]. &lt;br /&gt;
&lt;br /&gt;
* Start the WebService on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on OS X is to set up the WebService and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Preference Pane and traverse to the {{Code|Web Service}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Webservice Stopped.png |link=|alt=OS X Preference Pane WebService]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way they are, and click on {{Code|Start WebService}} to run the WebService.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the WebService is running by looking at the status on the right side.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Webservice Running.png|link=|alt=OS X PreferencePane WebService Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Preference Pane, open up the {{Code|Bonjour}} tab. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Bonjour.png ‎‎ |link=|alt=OS X PreferencePane Bonjour.png ‎]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to communicate with the Phidget over the WebService.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Example.png ‎ |link=|alt=OS X PreferencePane Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the WebService was indeed behind this exchange by terminating the WebService process while still allowing the remote program to run. On the host&#039;s Phidget Preference Pane, traverse to the {{Code|WebService}} tab. Hit {{Code|Stop WebService}} to terminate the WebService. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Webservice Running.png|link=|alt=OS X PreferencePane WebService Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the WebService, there is nothing attached. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Example Stopped.png |link=|alt=OS X PreferencePane Example Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the WebService===&lt;br /&gt;
&lt;br /&gt;
You can get debugging information from the WebService itself.  This debugging can only be enabled from the command line approach to start the WebService. Debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 phidgetwebservice21 -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The debugging information will be shown as output in the command line console.&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
&lt;br /&gt;
===Description of Installer files===&lt;br /&gt;
&lt;br /&gt;
Here is the list of files and their description for each file the installer puts onto your system. &lt;br /&gt;
===Description of Library files===&lt;br /&gt;
&lt;br /&gt;
This section will explain the files that were placed onto your system as part of the installation process.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.framework}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is placed into {{Code|/Library/Frameworks}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget.kext}}&amp;lt;/b&amp;gt; is the kernel extension.  It is placed into {{Code|/System/Library/Extensions}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|libphidget21.jnilib}}&amp;lt;/b&amp;gt; is the JNI library for Java.  It is placed into {{Code|/Library/Java/Extensions}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidgets.prefpane}}&amp;lt;/b&amp;gt; is the Phidgets Preference Pane.  It is placed into {{Code|/Library/PreferencePanes}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidgetwebservice21}}&amp;lt;/b&amp;gt; is the Phidget WebService.  It is placed into {{Code|/usr/bin}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetsOSA.app}}&amp;lt;/b&amp;gt; is the the Phidgets agent for AppleScript.  It is placed into {{Code|/Library/ScriptingAdditions}}.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
None, yet.&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=OS_-_OS_X&amp;diff=24121</id>
		<title>OS - OS X</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=OS_-_OS_X&amp;diff=24121"/>
		<updated>2019-02-09T16:23:58Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
{{OSLang|[[File:Icon-Mac-OS.png‎|64x64px|link=]]|On OS X, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#WebService|WebService]].}}&lt;br /&gt;
__TOC__&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;OS X 10.5 Leopard or newer&#039;&#039;&#039;, and can run on PPC, 32-bit, and 64-bit systems.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide for your specific Phidget device, which may be found in its [[:Category:UserGuide|user guide]].  If you already have the Preference Pane Installed and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the workings behind the Preference Pane, the Phidget WebService, and more - all specific to OS X.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
*OS X 10.7+: [{{SERVER}}/downloads/phidget21/libraries/macos/Phidget.dmg Installer Download]&lt;br /&gt;
*Mac OS X 10.5 - OS X 10.6: [{{SERVER}}/downloads/phidget21/libraries/macos/Phidget_OS_X_10_5.dmg Legacy Installer Download]&lt;br /&gt;
*[[Software License]]&lt;br /&gt;
&lt;br /&gt;
If you need old versions of the libraries, [{{SERVER}}/downloads/phidget21/libraries/macos/Phidget/ click here].&lt;br /&gt;
&lt;br /&gt;
==Getting Started with OS X==&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|o2P580PvjCg}}&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer will install the core Phidget files onto your system.&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download the Phidget installer for your system:&lt;br /&gt;
*[{{SERVER}}/downloads/phidget21/libraries/macos/Phidget.dmg OS X Installer]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and double click on {{Code|Phidgets.mpkg}} to install the libraries.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX Install 1.png|link=|alt=OS X Install]]&lt;br /&gt;
&lt;br /&gt;
3. Proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX Install 2.png|link=|alt=OS X Install]]&lt;br /&gt;
&lt;br /&gt;
4. Once the installation is complete, you are ready to program with Phidgets. To find out what files got installed, please see [[#Description of Installer files | Description of Installer files]] in the Appendix section.&lt;br /&gt;
&lt;br /&gt;
Proceed onto to the [[#Phidget Preference Pane | next]] section where the Phidget Preference Pane will be discussed.&lt;br /&gt;
&lt;br /&gt;
====Phidget Preference Pane====&lt;br /&gt;
&lt;br /&gt;
The Phidget Preference Pane is a tool to quickly determine whether your system is able to communicate with Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, open up the {{Code|System Preferences}} window.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX System Preferences.png|link=|alt=OS X System Preferences]]&lt;br /&gt;
&lt;br /&gt;
Click on the {{Code|Phidgets}} icon in the {{Code|Other}} section to bring up the Phidgets Preference Pane.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane General.png|link=|alt=OS X PreferencePane General]]&lt;br /&gt;
&lt;br /&gt;
The Phidget Preference Pane can:&lt;br /&gt;
* Access and test Phidgets connected to your computer&lt;br /&gt;
* Update device firmware&lt;br /&gt;
* Access other Phidgets over the webservice, and make your local Phidgets accessible over the webservice&lt;br /&gt;
* Make use of the [[Phidget Dictionary]]&lt;br /&gt;
* Manage the labels of connected Phidgets&lt;br /&gt;
* View all [[OS_-_Phidget_SBC|SBCs]] on the network and view their webpages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For more information, visit the [[Phidget Control Panel#OS X|Phidget Preference Pane]] page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software components of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software component is working by seeing if the Phidget device is listed in the General tab of the Phidget Preference Pane.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane General.png ‎|link=|alt=OS X Preference Pane General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If you see your Phidget in the list, you can continue to the [[#Programming Languages | programming languages]] section to learn more. If you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the OS X System Profiler. You can access the System Profiler by selecting {{Code|About This Mac}} under the Apple icon. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX About This Mac.png‎|link=|alt=OS X About This Mac]]&lt;br /&gt;
&lt;br /&gt;
The new window will open up.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX More Info.png|link=|alt=OS X More Info]]&lt;br /&gt;
&lt;br /&gt;
Select {{Code|More Info}}. The System Profiler will show up. In the USB section, you will be able to find all connected USB devices. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX USB Devices.png ‎|link=|alt=OS X Attached USB Devices]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, The PhidgetInterfaceKit and PhidgetRFID are connected to the USB ports. &lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the example programs &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using OS X 10.5 or newer. &lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Quick Downloads| quick downloads section]] to download them)&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Us|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
Phidgets’ philosophy is that you do not have to be an electrical engineer in order to do projects that use devices like sensors, motors, motor controllers, and interface boards. All you need to know is how to program.&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language. You can learn more about what is needed to program in a particular language by choosing the language of your preference below. If you need help choosing a language, please look at the [[Software Overview#Language Support |language comparison table]]. &lt;br /&gt;
&lt;br /&gt;
We recommend the following languages for OS X:&lt;br /&gt;
* [[Language - Applescript|AppleScript]]&lt;br /&gt;
* [[Language - C/C++|C/C++]]&lt;br /&gt;
* [[Language - C Sharp|C# (Using Mono)]]&lt;br /&gt;
* [[Language - Cocoa | Cocoa]]&lt;br /&gt;
* [[Language - Flash AS3 | Flash AS3]]&lt;br /&gt;
* [[Language - Flex AS3 | Flex AS3]]&lt;br /&gt;
* [[Language - LiveCode | LiveCode]]&lt;br /&gt;
* [[Language - Java | Java]]&lt;br /&gt;
* [[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
* [[Language - Python | Python]]&lt;br /&gt;
* [[Language - Ruby|Ruby]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
==WebService==&lt;br /&gt;
&lt;br /&gt;
The Phidget WebService allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget WebService on OS X are already included in the [[#Quick Downloads | Drivers]] above. If you see the Phidget Preference Pane in System Preferences, then you already have the WebService drivers installed.&lt;br /&gt;
&lt;br /&gt;
There are two ways that you can connect to a Phidget hosted on another computer. The first method is by using the IP address/host name and port of the host computer. The second method makes the use of [http://en.wikipedia.org/wiki/Multicast_DNS mDNS], which allows Phidgets to be found and opened on the network by a server id instead of an IP address/host name. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget WebService takes advantage of [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software, which is built-in to OS X. It is a tool developed by Apple to locate devices, such as Phidgets,  on a network.&lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the WebService on Windows, but we also have an overview of the [[Phidget WebService]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the WebService On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the WebService on and off. The first method is through the Phidget Preference Pane. In the {{Code|WebService}} tab, you can start or stop the WebService. You can also choose to have the WebService start up automatically upon system boot up by selecting the {{Code|Start Automatically}} checkbox. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Webservice Stopped.png|link=|alt=OS X PreferencePane WebService]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the WebService on and off is through command line. After using our installer, the WebService utility is automatically installed in {{Code|/usr/bin/phidget21webservice}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|phidgetwebservice21}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 phidgetwebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mapping out which command line options to which Phidget Preference Pane option is as follows:&lt;br /&gt;
&lt;br /&gt;
-p: {{Code|Port}} field&lt;br /&gt;
&lt;br /&gt;
-n: {{Code|ServerID}} field&lt;br /&gt;
&lt;br /&gt;
-P: {{Code|Password}} field&lt;br /&gt;
&lt;br /&gt;
-v: Not supported under the Phidget Preference Pane&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, use {{Code|hostname}} on the command line.&lt;br /&gt;
*For your IP address, use {{Code|ifconfig -a}} on the command line.&lt;br /&gt;
**A line in the return text, under your main internet connection (usually {{Code|eth0}}) will say something like {{Code|inet addr:192.168.3.178}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some usage examples:&lt;br /&gt;
&lt;br /&gt;
To start the WebService with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 phidgetwebservice21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the WebService with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 phidgetwebservice21-n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To stop the WebService, simply close the command line window or press {{Code|Control}} and {{Code|c}} at the same time in the command line window.&lt;br /&gt;
&lt;br /&gt;
===Using the WebService===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the WebService, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that if you only have a single computer, you can also connect to the Phidget over the WebService. The computer will simply act as both a host and client. This will allow you to bypass the [[General Phidget Programming # Details for Open() | one application per Phidget limitation]]. &lt;br /&gt;
&lt;br /&gt;
* Start the WebService on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on OS X is to set up the WebService and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Preference Pane and traverse to the {{Code|Web Service}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Webservice Stopped.png |link=|alt=OS X Preference Pane WebService]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way they are, and click on {{Code|Start WebService}} to run the WebService.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the WebService is running by looking at the status on the right side.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Webservice Running.png|link=|alt=OS X PreferencePane WebService Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Preference Pane, open up the {{Code|Bonjour}} tab. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Bonjour.png ‎‎ |link=|alt=OS X PreferencePane Bonjour.png ‎]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to communicate with the Phidget over the WebService.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Example.png ‎ |link=|alt=OS X PreferencePane Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the WebService was indeed behind this exchange by terminating the WebService process while still allowing the remote program to run. On the host&#039;s Phidget Preference Pane, traverse to the {{Code|WebService}} tab. Hit {{Code|Stop WebService}} to terminate the WebService. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Webservice Running.png|link=|alt=OS X PreferencePane WebService Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the WebService, there is nothing attached. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Example Stopped.png |link=|alt=OS X PreferencePane Example Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the WebService===&lt;br /&gt;
&lt;br /&gt;
You can get debugging information from the WebService itself.  This debugging can only be enabled from the command line approach to start the WebService. Debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 phidgetwebservice21 -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The debugging information will be shown as output in the command line console.&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
&lt;br /&gt;
===Description of Installer files===&lt;br /&gt;
&lt;br /&gt;
Here is the list of files and their description for each file the installer puts onto your system. &lt;br /&gt;
===Description of Library files===&lt;br /&gt;
&lt;br /&gt;
This section will explain the files that were placed onto your system as part of the installation process.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.framework}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is placed into {{Code|/Library/Frameworks}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget.kext}}&amp;lt;/b&amp;gt; is the kernel extension.  It is placed into {{Code|/System/Library/Extensions}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|libphidget21.jnilib}}&amp;lt;/b&amp;gt; is the JNI library for Java.  It is placed into {{Code|/Library/Java/Extensions}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidgets.prefpane}}&amp;lt;/b&amp;gt; is the Phidgets Preference Pane.  It is placed into {{Code|/Library/PreferencePanes}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidgetwebservice21}}&amp;lt;/b&amp;gt; is the Phidget WebService.  It is placed into {{Code|/usr/bin}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetsOSA.app}}&amp;lt;/b&amp;gt; is the the Phidgets agent for AppleScript.  It is placed into {{Code|/Library/ScriptingAdditions}}.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
None, yet.&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=OS_-_OS_X&amp;diff=24120</id>
		<title>OS - OS X</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=OS_-_OS_X&amp;diff=24120"/>
		<updated>2019-02-09T16:21:41Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
{{OSLang|[[File:Icon-Mac-OS.png‎|64x64px|link=]]|On OS X, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#WebService|WebService]].}}&lt;br /&gt;
__TOC__&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;OS X 10.5 Leopard or newer&#039;&#039;&#039;, and can run on PPC, 32-bit, and 64-bit systems.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide for your specific Phidget device, which may be found in its [[:Category:UserGuide|user guide]].  If you already have the Preference Pane Installed and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the workings behind the Preference Pane, the Phidget WebService, and more - all specific to OS X.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
*OS X 10.7+: [{{SERVER}}/downloads/phidget21/libraries/macos/Phidget.dmg Installer Download]&lt;br /&gt;
*Mac OS X 10.5 - OS X 10.6: [{{SERVER}}/downloads/phidget21/libraries/macos/Phidget_OX_X_10_5.dmg Legacy Installer Download]&lt;br /&gt;
&lt;br /&gt;
*[{{SERVER}}/downloads/phidget21/libraries/macos/Phidget.dmg OS X Installer Download]&lt;br /&gt;
*[[Software License]]&lt;br /&gt;
&lt;br /&gt;
If you need old versions of the libraries, [{{SERVER}}/downloads/phidget21/libraries/macos/Phidget/ click here].&lt;br /&gt;
&lt;br /&gt;
==Getting Started with OS X==&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|o2P580PvjCg}}&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer will install the core Phidget files onto your system.&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download the Phidget installer for your system:&lt;br /&gt;
*[{{SERVER}}/downloads/phidget21/libraries/macos/Phidget.dmg OS X Installer]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and double click on {{Code|Phidgets.mpkg}} to install the libraries.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX Install 1.png|link=|alt=OS X Install]]&lt;br /&gt;
&lt;br /&gt;
3. Proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX Install 2.png|link=|alt=OS X Install]]&lt;br /&gt;
&lt;br /&gt;
4. Once the installation is complete, you are ready to program with Phidgets. To find out what files got installed, please see [[#Description of Installer files | Description of Installer files]] in the Appendix section.&lt;br /&gt;
&lt;br /&gt;
Proceed onto to the [[#Phidget Preference Pane | next]] section where the Phidget Preference Pane will be discussed.&lt;br /&gt;
&lt;br /&gt;
====Phidget Preference Pane====&lt;br /&gt;
&lt;br /&gt;
The Phidget Preference Pane is a tool to quickly determine whether your system is able to communicate with Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, open up the {{Code|System Preferences}} window.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX System Preferences.png|link=|alt=OS X System Preferences]]&lt;br /&gt;
&lt;br /&gt;
Click on the {{Code|Phidgets}} icon in the {{Code|Other}} section to bring up the Phidgets Preference Pane.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane General.png|link=|alt=OS X PreferencePane General]]&lt;br /&gt;
&lt;br /&gt;
The Phidget Preference Pane can:&lt;br /&gt;
* Access and test Phidgets connected to your computer&lt;br /&gt;
* Update device firmware&lt;br /&gt;
* Access other Phidgets over the webservice, and make your local Phidgets accessible over the webservice&lt;br /&gt;
* Make use of the [[Phidget Dictionary]]&lt;br /&gt;
* Manage the labels of connected Phidgets&lt;br /&gt;
* View all [[OS_-_Phidget_SBC|SBCs]] on the network and view their webpages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For more information, visit the [[Phidget Control Panel#OS X|Phidget Preference Pane]] page.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software components of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software component is working by seeing if the Phidget device is listed in the General tab of the Phidget Preference Pane.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane General.png ‎|link=|alt=OS X Preference Pane General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If you see your Phidget in the list, you can continue to the [[#Programming Languages | programming languages]] section to learn more. If you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the OS X System Profiler. You can access the System Profiler by selecting {{Code|About This Mac}} under the Apple icon. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX About This Mac.png‎|link=|alt=OS X About This Mac]]&lt;br /&gt;
&lt;br /&gt;
The new window will open up.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX More Info.png|link=|alt=OS X More Info]]&lt;br /&gt;
&lt;br /&gt;
Select {{Code|More Info}}. The System Profiler will show up. In the USB section, you will be able to find all connected USB devices. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX USB Devices.png ‎|link=|alt=OS X Attached USB Devices]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, The PhidgetInterfaceKit and PhidgetRFID are connected to the USB ports. &lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the example programs &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using OS X 10.5 or newer. &lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Quick Downloads| quick downloads section]] to download them)&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Us|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
Phidgets’ philosophy is that you do not have to be an electrical engineer in order to do projects that use devices like sensors, motors, motor controllers, and interface boards. All you need to know is how to program.&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language. You can learn more about what is needed to program in a particular language by choosing the language of your preference below. If you need help choosing a language, please look at the [[Software Overview#Language Support |language comparison table]]. &lt;br /&gt;
&lt;br /&gt;
We recommend the following languages for OS X:&lt;br /&gt;
* [[Language - Applescript|AppleScript]]&lt;br /&gt;
* [[Language - C/C++|C/C++]]&lt;br /&gt;
* [[Language - C Sharp|C# (Using Mono)]]&lt;br /&gt;
* [[Language - Cocoa | Cocoa]]&lt;br /&gt;
* [[Language - Flash AS3 | Flash AS3]]&lt;br /&gt;
* [[Language - Flex AS3 | Flex AS3]]&lt;br /&gt;
* [[Language - LiveCode | LiveCode]]&lt;br /&gt;
* [[Language - Java | Java]]&lt;br /&gt;
* [[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
* [[Language - Python | Python]]&lt;br /&gt;
* [[Language - Ruby|Ruby]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
==WebService==&lt;br /&gt;
&lt;br /&gt;
The Phidget WebService allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget WebService on OS X are already included in the [[#Quick Downloads | Drivers]] above. If you see the Phidget Preference Pane in System Preferences, then you already have the WebService drivers installed.&lt;br /&gt;
&lt;br /&gt;
There are two ways that you can connect to a Phidget hosted on another computer. The first method is by using the IP address/host name and port of the host computer. The second method makes the use of [http://en.wikipedia.org/wiki/Multicast_DNS mDNS], which allows Phidgets to be found and opened on the network by a server id instead of an IP address/host name. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget WebService takes advantage of [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software, which is built-in to OS X. It is a tool developed by Apple to locate devices, such as Phidgets,  on a network.&lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the WebService on Windows, but we also have an overview of the [[Phidget WebService]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the WebService On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the WebService on and off. The first method is through the Phidget Preference Pane. In the {{Code|WebService}} tab, you can start or stop the WebService. You can also choose to have the WebService start up automatically upon system boot up by selecting the {{Code|Start Automatically}} checkbox. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Webservice Stopped.png|link=|alt=OS X PreferencePane WebService]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the WebService on and off is through command line. After using our installer, the WebService utility is automatically installed in {{Code|/usr/bin/phidget21webservice}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|phidgetwebservice21}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 phidgetwebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mapping out which command line options to which Phidget Preference Pane option is as follows:&lt;br /&gt;
&lt;br /&gt;
-p: {{Code|Port}} field&lt;br /&gt;
&lt;br /&gt;
-n: {{Code|ServerID}} field&lt;br /&gt;
&lt;br /&gt;
-P: {{Code|Password}} field&lt;br /&gt;
&lt;br /&gt;
-v: Not supported under the Phidget Preference Pane&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, use {{Code|hostname}} on the command line.&lt;br /&gt;
*For your IP address, use {{Code|ifconfig -a}} on the command line.&lt;br /&gt;
**A line in the return text, under your main internet connection (usually {{Code|eth0}}) will say something like {{Code|inet addr:192.168.3.178}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some usage examples:&lt;br /&gt;
&lt;br /&gt;
To start the WebService with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 phidgetwebservice21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the WebService with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 phidgetwebservice21-n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To stop the WebService, simply close the command line window or press {{Code|Control}} and {{Code|c}} at the same time in the command line window.&lt;br /&gt;
&lt;br /&gt;
===Using the WebService===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the WebService, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that if you only have a single computer, you can also connect to the Phidget over the WebService. The computer will simply act as both a host and client. This will allow you to bypass the [[General Phidget Programming # Details for Open() | one application per Phidget limitation]]. &lt;br /&gt;
&lt;br /&gt;
* Start the WebService on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on OS X is to set up the WebService and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Preference Pane and traverse to the {{Code|Web Service}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Webservice Stopped.png |link=|alt=OS X Preference Pane WebService]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way they are, and click on {{Code|Start WebService}} to run the WebService.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the WebService is running by looking at the status on the right side.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Webservice Running.png|link=|alt=OS X PreferencePane WebService Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Preference Pane, open up the {{Code|Bonjour}} tab. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Bonjour.png ‎‎ |link=|alt=OS X PreferencePane Bonjour.png ‎]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to communicate with the Phidget over the WebService.&lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Example.png ‎ |link=|alt=OS X PreferencePane Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the WebService was indeed behind this exchange by terminating the WebService process while still allowing the remote program to run. On the host&#039;s Phidget Preference Pane, traverse to the {{Code|WebService}} tab. Hit {{Code|Stop WebService}} to terminate the WebService. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Webservice Running.png|link=|alt=OS X PreferencePane WebService Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the WebService, there is nothing attached. &lt;br /&gt;
&lt;br /&gt;
[[File:OSX PreferencePane Example Stopped.png |link=|alt=OS X PreferencePane Example Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the WebService===&lt;br /&gt;
&lt;br /&gt;
You can get debugging information from the WebService itself.  This debugging can only be enabled from the command line approach to start the WebService. Debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 phidgetwebservice21 -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The debugging information will be shown as output in the command line console.&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
&lt;br /&gt;
===Description of Installer files===&lt;br /&gt;
&lt;br /&gt;
Here is the list of files and their description for each file the installer puts onto your system. &lt;br /&gt;
===Description of Library files===&lt;br /&gt;
&lt;br /&gt;
This section will explain the files that were placed onto your system as part of the installation process.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.framework}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is placed into {{Code|/Library/Frameworks}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget.kext}}&amp;lt;/b&amp;gt; is the kernel extension.  It is placed into {{Code|/System/Library/Extensions}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|libphidget21.jnilib}}&amp;lt;/b&amp;gt; is the JNI library for Java.  It is placed into {{Code|/Library/Java/Extensions}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidgets.prefpane}}&amp;lt;/b&amp;gt; is the Phidgets Preference Pane.  It is placed into {{Code|/Library/PreferencePanes}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidgetwebservice21}}&amp;lt;/b&amp;gt; is the Phidget WebService.  It is placed into {{Code|/usr/bin}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetsOSA.app}}&amp;lt;/b&amp;gt; is the the Phidgets agent for AppleScript.  It is placed into {{Code|/Library/ScriptingAdditions}}.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
None, yet.&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=24119</id>
		<title>Driver Changelog</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=24119"/>
		<updated>2019-02-08T23:04:53Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Administrative]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20190208===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where devices plugged in before boot were inaccessible until unplugged/re-plugged on 2018 Mac Mini.&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20180622===&lt;br /&gt;
*Python fix&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20180215===&lt;br /&gt;
*Move to .NET 4.0&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20171215===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where opening two of the same device with -1 serial could cause missed attach/detach events and other errors.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160921===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where devices plugged in before boot were inaccessible until unplugged/re-plugged, under OS X 10.11. &lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160202===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Labview 7.1 support&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160107===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Don&#039;t throw an exception on EncoderPositionChangeEventArgs.Time in the .Net library when time it unknown - just return 0x7fffffff&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160104===&lt;br /&gt;
*Mac/Windows release&lt;br /&gt;
**New firmware for 1042 and 1044, fixing digital gyro&lt;br /&gt;
===2.1.8.20151217===&lt;br /&gt;
*Fixed 1045 bug where it will display an unknown ambient temperature sometimes&lt;br /&gt;
*Fixed a crash in the windows control panel&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151020===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Fixed an issue where the examples would error when trying to run them from the control panel.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151009===&lt;br /&gt;
*OS X and Windows release&lt;br /&gt;
**Upgraded firmware for 1024, 1032, 1041, 1042, 1043, 1044 and 1067 to address issues with these Phidgets on OS X El Capitan&lt;br /&gt;
*SBC release&lt;br /&gt;
**Support for multiple webcams &lt;br /&gt;
===2.1.8.20150821===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Support OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150805===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Preliminary support for OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150410===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed Makefile phidget21.h target issues&lt;br /&gt;
===2.1.8.20150326===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed issue with webservice buttons not being visible in the control panel&lt;br /&gt;
===2.1.8.20150323===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Updated icons with new company logo&lt;br /&gt;
===2.1.8.20150227===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Added copyright/licence headers to source code files&lt;br /&gt;
**Updated cvtutf files to a newer version&lt;br /&gt;
===2.1.8.20150109===&lt;br /&gt;
*Windows-only&lt;br /&gt;
**Fixed examples for Labview 8.5&lt;br /&gt;
===2.1.8.20141209===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Added support for armv7s and arm64 to the iOS library. Dropped support for armv6. Requires iOS 5.1.1 or later.&lt;br /&gt;
===2.1.8.20141202===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Labview release to support older versions&lt;br /&gt;
===2.1.8.20141119===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed an issue with the 2.1.8.20141117 release where nothing was actually installed.&lt;br /&gt;
===2.1.8.20141117===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed a code-signing issue that make the installer appear unsigned on OS X 10.10&lt;br /&gt;
**Dropped support for OS X 10.4&lt;br /&gt;
===2.1.8.20140905===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added an IA32 folder to the windows libraries download - this supports Windows on the Intel Galileo platform&lt;br /&gt;
===2.1.8.20140428===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to C# Stepper GUI Example&lt;br /&gt;
===2.1.8.20140319===&lt;br /&gt;
*CPhidget_getDeviceClass can now be called on handle before it is attached.&lt;br /&gt;
*Added support for 64-bit Max/MSP (Version 6.1+) on both OS X and Windows.&lt;br /&gt;
===2.1.8.20140227===&lt;br /&gt;
*Deals with 1046 bug in v100 and v101 firmware.&lt;br /&gt;
**No longer reports bad values that appear right after a channel is enabled.&lt;br /&gt;
**Fixes issue where changing the gain while channel 0 is disabled would sometimes cause bad readings.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20131105===&lt;br /&gt;
* Fixed a defect in the Flash examples for the 1012 (Outputs 11-16 were not addressed properly).&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20130926===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support setting label on 1067 from Windows&lt;br /&gt;
===2.1.8.20130820===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added logging option to control panel / C# full examples&lt;br /&gt;
===2.1.8.20130802===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fix for Windows 8 issue where only &#039;Uninitialized Phidget Handle&#039; would show up in the Manager, and Phidgets could not be opened.&lt;br /&gt;
===2.1.8.20130723===&lt;br /&gt;
*Improvement to java: we don&#039;t attach/detach our native threads for each event, just one attach, then detach before the thread exits.&lt;br /&gt;
**This increases performance, esp. when debugging on Android.&lt;br /&gt;
*Improvement to Android: We reuse the UsbRequest object rather then creating a new one for each transfer. This reduces logcat messages tremendously, and increases performance.&lt;br /&gt;
===2.1.8.20130710===&lt;br /&gt;
*Android-only release&lt;br /&gt;
**Added extra android target architectures: x86, MIPS, armeabi-v7a&lt;br /&gt;
===2.1.8.20130618===&lt;br /&gt;
*Changed setCompassCorrectionParameters() API call so that compass calibration parameters are written out to non-volatile storage on 1042/1044, so that they persist across power cycles. Previously, calibration data would need to be re-programmed at each attach.&lt;br /&gt;
*Changes to C# Spatial example:&lt;br /&gt;
**Compass calibration parameter set dialog removed from for 1042/1044 because parameters are set by the calibration software - and thus do not need setting in the example.&lt;br /&gt;
**Stores/restores parameters for 1056 based on serial number, so multiple different calibrations can be maintained.&lt;br /&gt;
===2.1.8.20130607===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to compass calibration software for 1042/1044&lt;br /&gt;
===2.1.8.20130419===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed setCompassCorrectionParameters in the COM library&lt;br /&gt;
===2.1.8.20130327===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Changed Windows installer to stop virus-scanner false positives&lt;br /&gt;
**Dropped support for Windows 2000&lt;br /&gt;
===2.1.8.20130320===&lt;br /&gt;
*Added EPHIDGET_NOTFOUND exception to Dictionary.getKey() for when the key is not found.&lt;br /&gt;
*Added exceptions back into the Java library - they have been missing since 2.1.8.20121015 release.&lt;br /&gt;
===2.1.8.20130313===&lt;br /&gt;
*Updates to Matlab support&lt;br /&gt;
**Works properly on Matlab 7+, on Windows, Mac, Linux without needing changes to .m files.&lt;br /&gt;
===2.1.8.20130221===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Encoder Index event added to C and .NET libraries&lt;br /&gt;
===2.1.8.20121218===&lt;br /&gt;
*Webservice version: 1.0.10&lt;br /&gt;
**Support for 1024, 1032&lt;br /&gt;
*Support for 1024, 1032&lt;br /&gt;
*fixed bug where if one half of a composite device is open, and PHIDGET_USB_ERROR_FLAG gets set, the device may never re-attach.&lt;br /&gt;
===2.1.8.20121015===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support for new pressure/light sensors in example.&lt;br /&gt;
===2.1.8.20120914===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Improved firmware upgrading in control panel - it was giving some false-errors on some machines.&lt;br /&gt;
===2.1.8.20120912===&lt;br /&gt;
*Fixed bug where 1065 could fail to attach when opened over webservice&lt;br /&gt;
*Fixed bug where close() could deadlock on Phidgets opened over the webservice&lt;br /&gt;
*Changed LED64 LED Brightness from int to double&lt;br /&gt;
**this may cause issues when controlling the LED64 over the webservice and library/webservice are not the same version&lt;br /&gt;
**the old setDiscreteLED call will remain, deprecated, with an int argument for compatibility.&lt;br /&gt;
===2.1.8.20120716===&lt;br /&gt;
*Linux-Only Release&lt;br /&gt;
**Fixed a bug where opening a device in two program at once would cause an attach-detach cycle as they fight each other for control.&lt;br /&gt;
===2.1.8.20120713===&lt;br /&gt;
*Mac-Only Release&lt;br /&gt;
**Added signing of the Mac installer, so Mountain Lion (OS X 10.8) doesn&#039;t refuse to run it.&lt;br /&gt;
===2.1.8.20120615===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that caused java to crash on events introduced in 2.1.8.20120612&lt;br /&gt;
===2.1.8.20120612===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed another bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120606===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120525===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed PhidgetIR sendRawData bug in .NET on 64-bit machines.&lt;br /&gt;
===2.1.8.20120514===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed a bug that causes a segfault with libusb-1.0 under 64-bit Linux.&lt;br /&gt;
===2.1.8.20120507===&lt;br /&gt;
*Mac/Linux-only release&lt;br /&gt;
**Fixes a setLabel bug introduced in 2.1.8.20120503&lt;br /&gt;
===2.1.8.20120503===&lt;br /&gt;
*Fixed some spelling mistakes&lt;br /&gt;
*Moved to libusb-1.0&lt;br /&gt;
**This resolves a bug where having a webcam plugged in caused a memory leak in the webservice.&lt;br /&gt;
*Fixed bug with advanced servo where setting acceleration to accelerationMax would cause an exception for some servo types&lt;br /&gt;
===2.1.8.20120216===&lt;br /&gt;
*Fixed bug with RFID Reader on OS X and Linux, as well as .NET over the webservice&lt;br /&gt;
*Fixed bug that could cause the Java Phidget Manager to crash during garbage collection.&lt;br /&gt;
===2.1.8.20120131===&lt;br /&gt;
*Fixed RFID Reader bug that caused tag event to not get thrown in .NET Applications&lt;br /&gt;
*Changed compass bearing calculations in spatial C# example&lt;br /&gt;
===2.1.8.20120123===&lt;br /&gt;
*Added support for 1061 v300+&lt;br /&gt;
*Fixed a bug where the firmware version could be mis-reported over Bonjour&lt;br /&gt;
===2.1.8.20111220===&lt;br /&gt;
*Fixed a bug in AppleScript where closing a Phidget opened via label would give a &#039;Connection Invalid&#039; error.&lt;br /&gt;
*Fixed a bug where the webservice may fail to start on Linux systems that don&#039;t support IPv6 (ie. SBC2).&lt;br /&gt;
*Fixed issue where ratiometric state on newest interfacekit wouldn&#039;t be read back properly if it was false during attach.&lt;br /&gt;
*Fixed webservice issue where ratiometric state would not be reported properly for newest interfacekits&lt;br /&gt;
*Increased the number of overrun errors ignored during initial attach for InterfaceKit.&lt;br /&gt;
*Fixed an issue with the iPhone library and header&lt;br /&gt;
===2.1.8.20111219===&lt;br /&gt;
*fixed various other webservice stability/performance/memory leak bugs&lt;br /&gt;
*Faster connection to SBC-connected Phidgets from Mac OS&lt;br /&gt;
*Don&#039;t report packetlost or overrun errors that happen during early initialization - these are just noise.&lt;br /&gt;
*Fixed a bug in the webservice tree removal function that could cause memory leaks.&lt;br /&gt;
*Fixed bug where Webservice would crash on Linux if the chosen serverID was already under use on the network&lt;br /&gt;
*Stopped sending hardware Error Events before the Attach event - they are now queued up and sent after Attach&lt;br /&gt;
*Fixed a crash in the [[Phidget Control Panel]]&lt;br /&gt;
*Added ability to remove dictionary keys from a key change listener&lt;br /&gt;
*Reduced the number of false &#039;pending command not finished&#039; error events on Close()&lt;br /&gt;
*Fixed a webservice bug where exceptions/false attach events could occur when close() is called soon after open&lt;br /&gt;
*Fixed bug where closing a PhidgetRFID soon after attach could cause a crash&lt;br /&gt;
*Fixed webservice but on MacOS where client could exit with SIG_PIPE error&lt;br /&gt;
*Fixed webservice bug where the server would sometimes exit(1) after many connect/disconnect cycles&lt;br /&gt;
*Fixed webservice bug where client could deadlock during close()&lt;br /&gt;
*Fixed webservice bug where opening a single remote phidget multiple times from the same application would fail&lt;br /&gt;
*Fixed a webservice bug where sockets weren&#039;t being closed properly sometimes&lt;br /&gt;
*Fixed a webservice bug where pre-attach error events wouldn&#039;t get through&lt;br /&gt;
*Fixed a bug where the webservice running on Linux would stop responding to clients after ~300 connect/disconnect cycles&lt;br /&gt;
*Fixed bug where a Phidget would become inaccessible until the app is restarted if a thread creation failed&lt;br /&gt;
*Fixed webservice bug where connect is slow on Windows when multiple clients are running simultaneously&lt;br /&gt;
*Fixed webservice bug where authentication would fail on a valid password&lt;br /&gt;
*Fixed webservice bug where attach may never happen, and would require a close()/open()&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20111121===&lt;br /&gt;
*Added support for new servo types to all libraries&lt;br /&gt;
*Fixed min/max position/velocity causing invalid arg exception on servo/advservo&lt;br /&gt;
*IPv6 support on MacOS&lt;br /&gt;
*Fixed some memory leaks&lt;br /&gt;
*Fixed hostname lookup issue on Mac OS with Back To My Mac enabled.&lt;br /&gt;
===2.1.8.20111028===&lt;br /&gt;
*Fixed Applescript bugs and released examples&lt;br /&gt;
*Added openLabel to .NET, Java, COM&lt;br /&gt;
*Setting change trigger to 0 on interfacekit will not set event mode.&lt;br /&gt;
**Previously setting change trigger to 0 after setting data rate would supersede the data rate setting, which is probably unexpected.&lt;br /&gt;
===2.1.8.20110630 - MacOS Only===&lt;br /&gt;
*handle USB bug introduced in MacOS 10.6.8&lt;br /&gt;
===2.1.8.20110615===&lt;br /&gt;
*Added error event when trying to open Phidgets with an unsupported version&lt;br /&gt;
===2.1.8.20110614 - Windows Only===&lt;br /&gt;
*Fixed bug in C# Spatial example&lt;br /&gt;
*Added support for negative gains in 1056&lt;br /&gt;
===2.1.8.20110601 - MacOS Only===&lt;br /&gt;
*Fixed AppleScript issues&lt;br /&gt;
===2.1.8.20110527===&lt;br /&gt;
*Fixed AS3.0 library (Flash/Flex) - wouldn&#039;t connect to webservice as of last release&lt;br /&gt;
*Fixed bug where webservice doesn&#039;t release a closed Phidget&lt;br /&gt;
*Fixed bug where devices that don&#039;t support label didn&#039;t show up on MacOS&lt;br /&gt;
*Fixed iPhone library issues&lt;br /&gt;
===2.1.8.20110524===&lt;br /&gt;
*AppleScript support added&lt;br /&gt;
*fixed problem with Spatial in .NET on 64-bit Windows&lt;br /&gt;
*Added remote setLabel to mac preference pane.&lt;br /&gt;
*fixed a bug where label characters 7,8,9 would be read back corrupted on certain devices.&lt;br /&gt;
**labels &amp;gt;7 characters that exhibit this bug will now be truncated to 7 characters when being read back&lt;br /&gt;
**call setLabel again using this library or newer to support 10 character labels.&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to &amp;lt;=7 characters on these devices.&lt;br /&gt;
*fixed bug on MacOS where serial number and/or label strings could be read wrong.&lt;br /&gt;
*better support for recovering misbehaving devices in Linux&lt;br /&gt;
*fixed a deadlock on linux when Avahi is installed but not running&lt;br /&gt;
*clear list of attached devices when closing remote manager&lt;br /&gt;
*Added support for Unicode labels&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to ASCII.&lt;br /&gt;
*Added open by label&lt;br /&gt;
*Webservice protocol version up to 1.0.9 (for open by label)&lt;br /&gt;
*Made opening multiple device is one application faster.&lt;br /&gt;
*TextLCD changes:&lt;br /&gt;
**cursor is disabled while writing to the display or setting a custom character to prevent display artifacts&lt;br /&gt;
**cursor is disabled when a full line is written so it doesn&#039;t go to the start of another line&lt;br /&gt;
**1204 should be stable&lt;br /&gt;
**setDisplayCharacter supports 0x00-0xff&lt;br /&gt;
*stopped property reflected more accurately in the C# stepper example&lt;br /&gt;
*Added error events to mac examples&lt;br /&gt;
===2.1.8.20110329 - Windows only===&lt;br /&gt;
*Fixed problem with control panel encoder example where enable wouldn&#039;t work&lt;br /&gt;
*Fixed issue with SpatialData, GPSPositionChange, PHChange and WeightChange events in Labview 64-bit&lt;br /&gt;
===2.1.8.20110322===&lt;br /&gt;
*Fixed [[Phidget Control Panel]] memory leak when Bonjour in installed but not running&lt;br /&gt;
*Fixed current sense formula on 1061_0 v200&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetAdvancedServo&lt;br /&gt;
*Fixed bug in old PhidgetTemperatureSensor&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20110310===&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetServo&lt;br /&gt;
*Fixed some Labview bugs&lt;br /&gt;
*Added some Java and VB.NET examples&lt;br /&gt;
===2.1.8.20110301===&lt;br /&gt;
*Full Support for 1002, 1011, 1040, 1046, 1054, 1065, 1204&lt;br /&gt;
*New webservice version - 1.0.8&lt;br /&gt;
**Support for new devices&lt;br /&gt;
**Support for error events&lt;br /&gt;
===2.1.7.20110203===&lt;br /&gt;
*fixed crash on close of remote Phidget on MacOS&lt;br /&gt;
*C# ifkit example bugfix - crashed on 1015/1016&lt;br /&gt;
*webservice improvements&lt;br /&gt;
*Switch to IP address for SBC config in browser&lt;br /&gt;
*Faster IP lookup for SBCs in control panel&lt;br /&gt;
===2.1.7.20101222 / 2.1.7.20101223===&lt;br /&gt;
*fixed getServerID on Linux&lt;br /&gt;
*removed report ack&lt;br /&gt;
**this was causing some bad side effects&lt;br /&gt;
*manual .local lookups on Windows&lt;br /&gt;
**much faster then letting Windows do it itself&lt;br /&gt;
*Support for new Labview library&lt;br /&gt;
*Fixed PhidgetIR bug where library would crash if repeat code is longer then IR_MAX_REPEAT_LENGTH&lt;br /&gt;
===2.1.7.20101103===&lt;br /&gt;
*Decreased Phidget Webservice event latency on Windows&lt;br /&gt;
*Preliminary support for 1002, 1011, 1040, 1045, 1046, 1054, 1065, 1204 (C, .NET)&lt;br /&gt;
*Webservice version updated to 1.0.7&lt;br /&gt;
**support for 1045, 1011, 1204&lt;br /&gt;
*Fixed a bug where webservice connections could be unexpectedly lost&lt;br /&gt;
*Bugfix: couldn&#039;t set interfacekit data rate over webservice.&lt;br /&gt;
*Fixed some memory leaks in the Mac library&lt;br /&gt;
*Fixed bug where blocking for &amp;gt;2 seconds in an events handler when opening remotely could cause a crash.&lt;br /&gt;
===2.1.7.20100803===&lt;br /&gt;
*Windows only release&lt;br /&gt;
*fixed setLabel in WindowsCE&lt;br /&gt;
*fixed getHashCode in .NET library - needed for working with Phidgets in Labview via .NET&lt;br /&gt;
===2.1.7.20100621===&lt;br /&gt;
*Linux only release - autotools updates&lt;br /&gt;
**call ldconfig automatically&lt;br /&gt;
**remove old phidget21 library (pre-autotools) when installing new one.&lt;br /&gt;
===2.1.7.20100620===&lt;br /&gt;
*Linux only release - added version.sh for autoreconf&lt;br /&gt;
===2.1.7.20100618===&lt;br /&gt;
*Linux only release - added udev/hotplug files&lt;br /&gt;
===2.1.7.20100617===&lt;br /&gt;
*Linux only release&lt;br /&gt;
*Transitioned to autotools in linux for phidget21 / webservice&lt;br /&gt;
*phidget21 library and webservice are now separate downloads&lt;br /&gt;
===2.1.7.20100525===&lt;br /&gt;
*full support for PhidgetSpatial and PhidgetIR in all libraries&lt;br /&gt;
*fixed 1031 not attaching in AS3.0&lt;br /&gt;
*Better error messages in JNI&lt;br /&gt;
*Updated error codes, device ID/Class lists in Java, Flash, COM, etc.&lt;br /&gt;
*Fixed TemperatureSensor version 200,201,202 bug - ambient sensor would not report negative temperatures.&lt;br /&gt;
*Revised temperaturesensor API to report tempMin/tempMax and errors more accurately.&lt;br /&gt;
*Added initial events for encoder digital inputs&lt;br /&gt;
*full support for 1047&lt;br /&gt;
*Added new device support to WindowsCE&lt;br /&gt;
*Updated mac examples for 1047, 1048&lt;br /&gt;
===2.1.6.20100504===&lt;br /&gt;
*Windows only Release&lt;br /&gt;
**Added 1131 and 1132 to InterfaceKit example in MSI&lt;br /&gt;
===2.1.6.20100428===&lt;br /&gt;
*limit data rate maximum to 16ms over the webservice for devices that expose dataRate (InterfaceKit, Spatial)&lt;br /&gt;
*fixed bug where TextLCD 8/8/8 would stay in Bonjour list after webservice is shutdown&lt;br /&gt;
*set/get Brightness for 1203_2&lt;br /&gt;
*Support 1048 in C# example&lt;br /&gt;
*webservice version incremented to 1.0.6&lt;br /&gt;
**TextLCD set/get brightness&lt;br /&gt;
**PhidgetIR support&lt;br /&gt;
**PhidgetSpatial support&lt;br /&gt;
**1047 support (enable, index)&lt;br /&gt;
===2.1.6.20100406===&lt;br /&gt;
*Support for 1018_2 (dataRate)&lt;br /&gt;
*Webservice version incremented to 1.0.5&lt;br /&gt;
===2.1.6.20100401===&lt;br /&gt;
*Updated InterfaceKit example with new sensors&lt;br /&gt;
*make Windows connect cancelable&lt;br /&gt;
*make pending zeroconf lookups cancelable during close&lt;br /&gt;
===2.1.6.20100318===&lt;br /&gt;
*Mac only release&lt;br /&gt;
**Added WillSleep and Wakeup events to give user control of Phidgets immediately before and after a system sleep (MacOS Only).&lt;br /&gt;
===2.1.6.20100317===&lt;br /&gt;
*Windows only release&lt;br /&gt;
**Some of the examples were being built using an out of date .NET library&lt;br /&gt;
===2.1.6.20100310===&lt;br /&gt;
*MaxMSP fix - 2.1.6.20100126 introduced a bug for some Phidgets where openremote/open by serial didn&#039;t work and MaxMSP would sometimes crash.&lt;br /&gt;
**No code changes to any of the other libraries.&lt;br /&gt;
===2.1.6.20100304===&lt;br /&gt;
*stopped property changes trigger events over webservice so they are noticed.&lt;br /&gt;
**more compatible with how local open works&lt;br /&gt;
*added 5 new servos&lt;br /&gt;
*fixed bug where remote close would not set detached so a subsequent open would not always connect.&lt;br /&gt;
*handle UninitializeZeroconf better - shut down thread before closing handles, fixes hang on SBC&lt;br /&gt;
*fixed bug on Mac where detaching 2 or more Phidgets at the same time caused a crash&lt;br /&gt;
*fixed close blocking because of a pending connect (mac, linux)&lt;br /&gt;
*Final support for 1031 in all libraries.&lt;br /&gt;
===2.1.6.20100129===&lt;br /&gt;
*Implemented initial events in Flash&lt;br /&gt;
**Flash behaviour should now be identical to C library local and remote.&lt;br /&gt;
*Fix RFID issue where close could cause crash&lt;br /&gt;
*increment webservice version to 1.0.4&lt;br /&gt;
*fixed RFID remote open&lt;br /&gt;
**Flash would never get an attach event if the reader had been previously opened&lt;br /&gt;
**Initial tag event would not be fired when a tag was present and the antenna was enabled prior to open&lt;br /&gt;
*fixed openRemote failing on Mac&lt;br /&gt;
*fixed deadlock in webservice which could be hit by opening/closing a device over and over again.&lt;br /&gt;
*fixed bug in stepper, which caused seg fault on SBC on position change events.&lt;br /&gt;
===2.1.6.20100126===&lt;br /&gt;
*added network open support in Max/MSP&lt;br /&gt;
===2.1.6.20100115===&lt;br /&gt;
*Increased network performance for Linux/MacOS&lt;br /&gt;
*Added five servo types&lt;br /&gt;
===2.1.6.20091215===&lt;br /&gt;
*Fixed busy loop in Linux openRemote&lt;br /&gt;
*JNI Library relocated to /Library/Java/Extensions on MacOS&lt;br /&gt;
===2.1.6.20091211===&lt;br /&gt;
*Heartbeat now works on Linux as well (had to make sockets non-blocking)&lt;br /&gt;
===2.1.6.20091130===&lt;br /&gt;
*Added heartbeat to webservice (client side)&lt;br /&gt;
**Better detects network failures by using active polling timeouts&lt;br /&gt;
*Fixed 0/8/8 over webservice&lt;br /&gt;
===2.1.6.20091020===&lt;br /&gt;
*Fixed 1052 counting issue on 1070 (-1 reported as 255)&lt;br /&gt;
*Fixed issue where Phidget21 would try to reinstall from a limited user account or when the Control Panel was disabled.&lt;br /&gt;
*64-bit kernel support in Snow Leopard&lt;br /&gt;
===2.1.6.20090928===&lt;br /&gt;
*Support for PhidgetSBC (1070)&lt;br /&gt;
*zeroconf can handle starting up before the mdns daemon, and will keep trying to connect.&lt;br /&gt;
*fixed 1066 not showing up on Mac&lt;br /&gt;
*added advanced servo example to mac pref pane&lt;br /&gt;
*implemented proper error handling in COM&lt;br /&gt;
**default behavious remains the same, enable proper error handling with &#039;EnableVerboseErrors&#039;&lt;br /&gt;
*implemented error events in Java&lt;br /&gt;
===2.1.6.20090917===&lt;br /&gt;
*Updated webservice protocol version to 1.0.3&lt;br /&gt;
*Fixed stepper under AS3.0&lt;br /&gt;
*added setServoType, getServoType, setServoParameters to PhidgetServo and PhidgetAdvancedServo&lt;br /&gt;
*possible race condition fixed in webservice (pdictclient.c:907)&lt;br /&gt;
===2.1.6.20090902 (mac only release)===&lt;br /&gt;
*Support MacOSX 10.6, drop support for 10.3.9, require 10.4 or newer&lt;br /&gt;
**Fully 64-bit compliant, library supports ppc, i386, x86_64&lt;br /&gt;
===2.1.6.20090806===&lt;br /&gt;
*Added 1049 support&lt;br /&gt;
*Fixed RFID tag events over webservice&lt;br /&gt;
===2.1.6.20090804===&lt;br /&gt;
*Added 1051_2 support&lt;br /&gt;
*Fixed various small initialization issues - stepper, adv servo, rfid&lt;br /&gt;
*Added 32-bit library install to 64-bit installer&lt;br /&gt;
**VB6.0, etc. need the 32-bit COM library on 64-bit windows&lt;br /&gt;
===2.1.6.20090717===&lt;br /&gt;
*?&lt;br /&gt;
===2.1.6.20090708===&lt;br /&gt;
*Added DeviceID to zeroconf&lt;br /&gt;
*fixed RFID.LastTag in .NET&lt;br /&gt;
*Changed the error codes returned by error events; error events now have their own set of error codes rather then sharing the function return codes.&lt;br /&gt;
*Added support for 1047, 1048&lt;br /&gt;
*Added error event codes rather then trying to reuse the EPHIDGET return codes.&lt;br /&gt;
*fixed TextLCD issue where display could get corrupted during a detach/attach&lt;br /&gt;
*made mac more reliable on attach&lt;br /&gt;
*more error logging on mac&lt;br /&gt;
===2.1.6.20090525===&lt;br /&gt;
*fixed RFID not attaching via webservice if a tag is present.&lt;br /&gt;
*bugfix related to double free on detach event.&lt;br /&gt;
*Implemented getKey&lt;br /&gt;
*Added MIPS II support to Windows CE&lt;br /&gt;
===2.1.6.20090430===&lt;br /&gt;
*Added ActiveX interface to COM library&lt;br /&gt;
*Added stepper and advancedServo to Flex .swc library&lt;br /&gt;
===2.1.6.20090417===&lt;br /&gt;
*added PhidgetIR prototype support to C library&lt;br /&gt;
*properly handles sleeping on OSX&lt;br /&gt;
*fixed some webservice field initializations in Flash and C&lt;br /&gt;
*fixed security exceptions in [[Phidget Control Panel]] under Vista&lt;br /&gt;
*added [[Phidget Control Panel]] to start menu&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090318 (Examples/AS3.0 only release)===&lt;br /&gt;
*Fixed AdvancedServo in Flash - wouldn&#039;t attach&lt;br /&gt;
===2.1.6.20090317===&lt;br /&gt;
*[[Phidget Control Panel]] properly supports Vista UAC and Limited user accounts in XP, etc.&lt;br /&gt;
*Added 64-bit release of Phidget21.msi for Windows&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090312===&lt;br /&gt;
*added 1064, 1059 to WindowsCE&lt;br /&gt;
*fixed opening 1051 over webservice&lt;br /&gt;
*fixed opening 1015/1016 over webservice broken in last release&lt;br /&gt;
===2.1.6.20090302===&lt;br /&gt;
*Advanced servo bugfix: stopped would stop being true if min/max was set to exclude current position.&lt;br /&gt;
*linux USB improvements when many Phidgets are attached and opened at once.&lt;br /&gt;
*1031 support in phidget21, webservice, .NET - hidden until product release&lt;br /&gt;
**CPhidgetLED_setVoltage&lt;br /&gt;
**CPhidgetLED_getVoltage&lt;br /&gt;
**CPhidgetLED_setCurrentLimit&lt;br /&gt;
**CPhidgetLED_getCurrentLimit&lt;br /&gt;
*unknown timechange == PUNK_INT in encoder position change event&lt;br /&gt;
**1st position change event&lt;br /&gt;
**&amp;gt; 30 seconds time change&lt;br /&gt;
*AS3 updates&lt;br /&gt;
**updated to 1.0.2 webservice&lt;br /&gt;
**encoder position change events report relative change rather then absolute position&lt;br /&gt;
**encoder adds getTimeChange function for timing encoder changes&lt;br /&gt;
*webservice updated to 1.0.2&lt;br /&gt;
**Authorization is asynchronous&lt;br /&gt;
**Doesn&#039;t match the old version checking, so errors will not be nice when trying to connect to an old webservice&lt;br /&gt;
**Sends out all initial data, so it&#039;s just like opening locally&lt;br /&gt;
**supports interfacekit Raw sensor value&lt;br /&gt;
**supports labels on remoteIP managers&lt;br /&gt;
*avahi bugfix&lt;br /&gt;
*webservice more stable against forcefully closed clients&lt;br /&gt;
*closing a network Phidget won&#039;t block - ever.&lt;br /&gt;
**no longer using quit, just closing the socket&lt;br /&gt;
*added libavahi-client.so.3 reference to linux library.&lt;br /&gt;
*Fixed bug with opening one phidget with serial and no serial at the same time over the webservice&lt;br /&gt;
===2.1.5.20090105===&lt;br /&gt;
*[[Phidget Control Panel]] stability improvements&lt;br /&gt;
*added CPhidgetSBC_getHostname&lt;br /&gt;
*advanced servo 1 motor current sense equation - support should now be complete&lt;br /&gt;
*webservice and network code bugfixes - crash / deadlock during close, problems with concurrent connections, etc.&lt;br /&gt;
*fixed close on remote and remoteIP managers&lt;br /&gt;
*name of RFID changed from &amp;quot;Phidget RFID 4-output&amp;quot; to &amp;quot;Phidget RFID 2-output&amp;quot; - updated anything referencing old name.&lt;br /&gt;
&lt;br /&gt;
===2.1.5.20081023===&lt;br /&gt;
*added advanced servo and stepper examples to VB6.0, VB.NET and C&lt;br /&gt;
*added deviceClass and deviceID&lt;br /&gt;
*updated Mac examples&lt;br /&gt;
*webservice protocol version enforcement&lt;br /&gt;
*internal fix/rework of device id&#039;s etc.&lt;br /&gt;
*Fixed memory leaks in webservice and phidget21 network code.&lt;br /&gt;
*Dictionary and network stability improvements.&lt;br /&gt;
*duplicate calls to open or close are now silently ignored.&lt;br /&gt;
===2.1.4.20080924===&lt;br /&gt;
*Old TextLCD 0/8/8&#039;s can now have both halves open at the same time on Windows&lt;br /&gt;
*fixed bug with composite devices on linux&lt;br /&gt;
*fixed manager on linux to better deal with unique devices&lt;br /&gt;
===2.1.4.20080922===&lt;br /&gt;
*Updated Delphi files&lt;br /&gt;
*TextLCD can display 0x80-0xFF characters from Java&lt;br /&gt;
*getAttachedDevices works for mdns managers&lt;br /&gt;
*fixed a deadlock in the webservice&lt;br /&gt;
*better network error handling / password support for windows C# examples&lt;br /&gt;
*waitForAttachment will return EPHIDGET_CLOSED if the handle is closed while it is waiting.&lt;br /&gt;
*added EPHIDGET_CLOSED&lt;br /&gt;
*joining central threads checks whether they are trying to be joined by themselves first (avoid deadlocks).&lt;br /&gt;
*changed context of error event to be free from locks (can call close, open, etc. from them).&lt;br /&gt;
===2.1.4.20080821===&lt;br /&gt;
*zeroconf threads exit cleanly on last _close (apple zeroconf)&lt;br /&gt;
*Added advanced servo and stepper to Max&lt;br /&gt;
===2.1.4.20080811 (mac only release)===&lt;br /&gt;
*Fixed manager on Mac (wasn&#039;t working at all since 2.1.4.20080808)&lt;br /&gt;
===2.1.4.20080808===&lt;br /&gt;
*added CPhidgetSBC and CPhidgetSBCManager to the c library - these interfaces are hidden from users and meant to be used internally (for now).&lt;br /&gt;
*CPhidgetManager_open no longer blocks to send out initial attach events. These initial events are sent from the CentralThread context like all other attach events.&lt;br /&gt;
*fixed CThread_wait_on_event on Linux&lt;br /&gt;
*added CPhidgetGeneric interface for prototyping to C, .NET libraries. product ID is 0x99. These are only visible in debug releases, only to be used internally.&lt;br /&gt;
===2.1.4.20080715===&lt;br /&gt;
*udev rules fixed for product IDs with alpha-hex values&lt;br /&gt;
*blocking in an attach event does not block calls to open anymore&lt;br /&gt;
*RFID tag event handlers can now handle blocking - tag lost is timed after the tag handler exits.&lt;br /&gt;
===2.1.4.20080623===&lt;br /&gt;
*Flex .swc library was out of sync&lt;br /&gt;
*fixed CPhidgetManager_getAttachedDevices for network managers&lt;br /&gt;
*Added CPhidgetManager_freeAttachedDevicesArray&lt;br /&gt;
===2.1.4.20080613===&lt;br /&gt;
*Max/MSP RFID fixed&lt;br /&gt;
*0/0/8 and advanced servo added to CE&lt;br /&gt;
*fixed flash policy file server in webservice&lt;br /&gt;
*webservice with password and asynchronous together work now&lt;br /&gt;
===2.1.4.20080602===&lt;br /&gt;
*phidget21.h -&amp;gt; phidget21int.h so as not to be confused with generated phidget21.h&lt;br /&gt;
*some changes to Makefile fro crosscompiling&lt;br /&gt;
*no more vbscript in msi&lt;br /&gt;
===2.1.4.20080513===&lt;br /&gt;
*removed long long from COM - not supported by VB6.0&lt;br /&gt;
*added LastTag to RFID in .NET&lt;br /&gt;
===2.1.4.20080428===&lt;br /&gt;
*support Mac OS X 10.3.9 again&lt;br /&gt;
*Rev up to 2.1.4&lt;br /&gt;
*finalize Phidget Stepper API - Phidget Stepper requires 2.1.4 as a minimum&lt;br /&gt;
*fixed serverConnect and serverDisconnect handlers for manager and dictionary in COM&lt;br /&gt;
*Changed:&lt;br /&gt;
**PhidgetStepper and PhidgetAdvancedServo&lt;br /&gt;
***MotorPosition -&amp;gt; Position&lt;br /&gt;
***MotorOn -&amp;gt; Engaged&lt;br /&gt;
***MotorStopped -&amp;gt; Stopped&lt;br /&gt;
*Added:&lt;br /&gt;
**CPhidgetStepper_getCurrentLimit&lt;br /&gt;
**CPhidgetEncoder_getPosition&lt;br /&gt;
**CPhidgetEncoder_setPosition&lt;br /&gt;
**CPhidgetMotorControl_getVelocity&lt;br /&gt;
**CPhidgetMotorControl_setVelocity&lt;br /&gt;
**CPhidgetMotorControl_set_OnVelocityChange_Handler&lt;br /&gt;
**CPhidgetServo_setEngaged&lt;br /&gt;
**CPhidgetServo_getEngaged&lt;br /&gt;
**CPhidgetServo_getPosition&lt;br /&gt;
**CPhidgetServo_setPosition&lt;br /&gt;
**CPhidgetServo_set_OnPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getPositionMax&lt;br /&gt;
**CPhidgetServo_getPositionMin&lt;br /&gt;
**Count functions&lt;br /&gt;
*Deprecated:&lt;br /&gt;
**CPhidgetEncoder_getEncoderPosition&lt;br /&gt;
**CPhidgetEncoder_setEncoderPosition&lt;br /&gt;
**CPhidgetMotorControl_getMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_setMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_set_OnMotorChange_Handler&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorPosition&lt;br /&gt;
**CPhidgetServo_setMotorPosition&lt;br /&gt;
**CPhidgetServo_set_OnMotorPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**Num functions&lt;br /&gt;
*Added ability to deprecate funcitons in the C library - compiler will issue a warning when they are used.&lt;br /&gt;
*added names to some arguments in phidget21.h&lt;br /&gt;
*fixes to the webservice for initial state stuff - now it behaves almost like non-webservice, with guaranteed initial events, but we don&#039;t guarantee initial state in the attach event yet. Min/Max, Num motors, inputs, etc. are all guaranteed in the attach handler.&lt;br /&gt;
*Finalized support for Phidget Stepper&lt;br /&gt;
===2.1.3.20080402===&lt;br /&gt;
*Fixed windows BUG - Device Type was showing up wrong&lt;br /&gt;
*CPhidgetStepper_getPosition -&amp;gt; CPhidgetStepper_getCurrentPosition&lt;br /&gt;
===2.1.3.20080327===&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorStopped&lt;br /&gt;
*changes to API&lt;br /&gt;
**CPhidgetStepper_setMotorPosition -&amp;gt; CPhidgetStepper_setTargetMotorPosition&lt;br /&gt;
**added CPhidgetStepper_getTargetMotorPosition&lt;br /&gt;
**Stepper MotorSpeed -&amp;gt; Velocity&lt;br /&gt;
**Stepper and AdvancedServo MaxVelocity -&amp;gt; VelocityLimit&lt;br /&gt;
*add waitForAttachment to COM&lt;br /&gt;
*COM getbool (not indexed) will now return FALSE on false (rather then always returning true)&lt;br /&gt;
*fixed write thread timeouts - was setting attached after starting write thread so write thread would see a detached device and exit immediately&lt;br /&gt;
===2.1.3.20080206===&lt;br /&gt;
*changed long long to __int64, to be happy in borland C++&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetStepper_getMaxMotorSpeed&lt;br /&gt;
**CPhidgetStepper_setMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorStopped&lt;br /&gt;
**CPhidgetStepper_setCurrentMotorPosition&lt;br /&gt;
*removed CPhidgetStepper_setVelocity&lt;br /&gt;
*added CPhidgetStepper_setMaxVelocity, CPhidgetStepper_getMaxVelocity&lt;br /&gt;
===2.1.3.20080114===&lt;br /&gt;
*Added new functions to Flash API&lt;br /&gt;
*Added new functions to Webservice Protocol&lt;br /&gt;
*Added new functions to COM Library&lt;br /&gt;
*Added new functions to Java Library&lt;br /&gt;
*All device fiels in C library cleaned up and made consistent&lt;br /&gt;
*Open in windows is exclusive - this needs to be tested for stability&lt;br /&gt;
*No data will be returned / accepted if it lies outside of max/min range&lt;br /&gt;
*if a data value is unknown, user variable is set to PUNK_INT, PUNK_DBL, or PUNK_BOOL, and return value is EPHIDGET_UNKNOWNVAL&lt;br /&gt;
*Proper Device initializations on Attach:&lt;br /&gt;
**triggers are set to defaults on attach&lt;br /&gt;
**device state is read in and preserved on attach&lt;br /&gt;
**during attach event, all sensor data, etc. is provided if available&lt;br /&gt;
**no data events until after the attach event returns&lt;br /&gt;
**everything initialized by the time waitForAttachment returns&lt;br /&gt;
**after attach event returns, a full set of initial state data events are thrown&lt;br /&gt;
*.NET collections are readonly, and never NULL (but empty when phidget detached)&lt;br /&gt;
*.NET callbacks no longer catch and hide all exceptions&lt;br /&gt;
**make sure to use try/catch blocks especially in Attach when accessing properties that may not be initialized.&lt;br /&gt;
*added min/max functions:&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMax&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMax&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMax&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMax&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMin&lt;br /&gt;
**CPhidgetPHSensor_getPHMax&lt;br /&gt;
**CPhidgetPHSensor_getPHMin&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMax&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMin&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetStepper_getAccelerationMax&lt;br /&gt;
**CPhidgetStepper_getAccelerationMin&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMax&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMin&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMax&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMin&lt;br /&gt;
*Added functions:&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperature&lt;br /&gt;
**CPhidgetTemperatureSensor_getThermocoupleType&lt;br /&gt;
**CPhidgetTemperatureSensor_setThermocoupleType&lt;br /&gt;
**CPhidget_set_OnServerConnectHandler&lt;br /&gt;
**CPhidget_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_getServerID&lt;br /&gt;
**CPhidgetDictionary_getServerAddress&lt;br /&gt;
**CPhidgetDictionary_getServerStatus&lt;br /&gt;
**CPhidgetManager_getServerID&lt;br /&gt;
**CPhidgetManager_getServerAddress&lt;br /&gt;
**CPhidgetManager_getServerStatus&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
*Removed functions:&lt;br /&gt;
**CPhidgetServo_setMotorOff&lt;br /&gt;
*TemperatureSensor:&lt;br /&gt;
**Ambient sensor is accessed with it&#039;s own function&lt;br /&gt;
**first thermocouple is Index 0 everywhere&lt;br /&gt;
**no ambient sensor events&lt;br /&gt;
*getServerID is implemented&lt;br /&gt;
*changed the internal network structure (added CPhidgetRemote)&lt;br /&gt;
*reworked the USB code (mostly on Windows)&lt;br /&gt;
**Better handles closing, ESD events, timeouts&lt;br /&gt;
**fixed issues with Encoder, RFID stopping reading after a certain time.&lt;br /&gt;
**added USB error flag&lt;br /&gt;
*openRemote functions have been implemented&lt;br /&gt;
**these require bonjour (mac / windows) or avahi (linux) to be installed on both the client and server&lt;br /&gt;
**if they are not, you get EPHIDGET_UNSUPPORTED when you call them&lt;br /&gt;
*openRemoteIP functions are asynchronous and persistent&lt;br /&gt;
*include cphidgetconstants.h in phidget21.h for users&lt;br /&gt;
===2.1.2.20071108===&lt;br /&gt;
*start of chagelog&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=24091</id>
		<title>Driver Changelog</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=24091"/>
		<updated>2018-06-22T17:41:32Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Administrative]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20180622===&lt;br /&gt;
*Python fix&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20180215===&lt;br /&gt;
*Move to .NET 4.0&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20171215===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where opening two of the same device with -1 serial could cause missed attach/detach events and other errors.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160921===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where devices plugged in before boot were inaccessible until unplugged/re-plugged, under OS X 10.11. &lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160202===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Labview 7.1 support&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160107===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Don&#039;t throw an exception on EncoderPositionChangeEventArgs.Time in the .Net library when time it unknown - just return 0x7fffffff&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160104===&lt;br /&gt;
*Mac/Windows release&lt;br /&gt;
**New firmware for 1042 and 1044, fixing digital gyro&lt;br /&gt;
===2.1.8.20151217===&lt;br /&gt;
*Fixed 1045 bug where it will display an unknown ambient temperature sometimes&lt;br /&gt;
*Fixed a crash in the windows control panel&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151020===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Fixed an issue where the examples would error when trying to run them from the control panel.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151009===&lt;br /&gt;
*OS X and Windows release&lt;br /&gt;
**Upgraded firmware for 1024, 1032, 1041, 1042, 1043, 1044 and 1067 to address issues with these Phidgets on OS X El Capitan&lt;br /&gt;
*SBC release&lt;br /&gt;
**Support for multiple webcams &lt;br /&gt;
===2.1.8.20150821===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Support OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150805===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Preliminary support for OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150410===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed Makefile phidget21.h target issues&lt;br /&gt;
===2.1.8.20150326===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed issue with webservice buttons not being visible in the control panel&lt;br /&gt;
===2.1.8.20150323===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Updated icons with new company logo&lt;br /&gt;
===2.1.8.20150227===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Added copyright/licence headers to source code files&lt;br /&gt;
**Updated cvtutf files to a newer version&lt;br /&gt;
===2.1.8.20150109===&lt;br /&gt;
*Windows-only&lt;br /&gt;
**Fixed examples for Labview 8.5&lt;br /&gt;
===2.1.8.20141209===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Added support for armv7s and arm64 to the iOS library. Dropped support for armv6. Requires iOS 5.1.1 or later.&lt;br /&gt;
===2.1.8.20141202===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Labview release to support older versions&lt;br /&gt;
===2.1.8.20141119===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed an issue with the 2.1.8.20141117 release where nothing was actually installed.&lt;br /&gt;
===2.1.8.20141117===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed a code-signing issue that make the installer appear unsigned on OS X 10.10&lt;br /&gt;
**Dropped support for OS X 10.4&lt;br /&gt;
===2.1.8.20140905===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added an IA32 folder to the windows libraries download - this supports Windows on the Intel Galileo platform&lt;br /&gt;
===2.1.8.20140428===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to C# Stepper GUI Example&lt;br /&gt;
===2.1.8.20140319===&lt;br /&gt;
*CPhidget_getDeviceClass can now be called on handle before it is attached.&lt;br /&gt;
*Added support for 64-bit Max/MSP (Version 6.1+) on both OS X and Windows.&lt;br /&gt;
===2.1.8.20140227===&lt;br /&gt;
*Deals with 1046 bug in v100 and v101 firmware.&lt;br /&gt;
**No longer reports bad values that appear right after a channel is enabled.&lt;br /&gt;
**Fixes issue where changing the gain while channel 0 is disabled would sometimes cause bad readings.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20131105===&lt;br /&gt;
* Fixed a defect in the Flash examples for the 1012 (Outputs 11-16 were not addressed properly).&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20130926===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support setting label on 1067 from Windows&lt;br /&gt;
===2.1.8.20130820===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added logging option to control panel / C# full examples&lt;br /&gt;
===2.1.8.20130802===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fix for Windows 8 issue where only &#039;Uninitialized Phidget Handle&#039; would show up in the Manager, and Phidgets could not be opened.&lt;br /&gt;
===2.1.8.20130723===&lt;br /&gt;
*Improvement to java: we don&#039;t attach/detach our native threads for each event, just one attach, then detach before the thread exits.&lt;br /&gt;
**This increases performance, esp. when debugging on Android.&lt;br /&gt;
*Improvement to Android: We reuse the UsbRequest object rather then creating a new one for each transfer. This reduces logcat messages tremendously, and increases performance.&lt;br /&gt;
===2.1.8.20130710===&lt;br /&gt;
*Android-only release&lt;br /&gt;
**Added extra android target architectures: x86, MIPS, armeabi-v7a&lt;br /&gt;
===2.1.8.20130618===&lt;br /&gt;
*Changed setCompassCorrectionParameters() API call so that compass calibration parameters are written out to non-volatile storage on 1042/1044, so that they persist across power cycles. Previously, calibration data would need to be re-programmed at each attach.&lt;br /&gt;
*Changes to C# Spatial example:&lt;br /&gt;
**Compass calibration parameter set dialog removed from for 1042/1044 because parameters are set by the calibration software - and thus do not need setting in the example.&lt;br /&gt;
**Stores/restores parameters for 1056 based on serial number, so multiple different calibrations can be maintained.&lt;br /&gt;
===2.1.8.20130607===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to compass calibration software for 1042/1044&lt;br /&gt;
===2.1.8.20130419===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed setCompassCorrectionParameters in the COM library&lt;br /&gt;
===2.1.8.20130327===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Changed Windows installer to stop virus-scanner false positives&lt;br /&gt;
**Dropped support for Windows 2000&lt;br /&gt;
===2.1.8.20130320===&lt;br /&gt;
*Added EPHIDGET_NOTFOUND exception to Dictionary.getKey() for when the key is not found.&lt;br /&gt;
*Added exceptions back into the Java library - they have been missing since 2.1.8.20121015 release.&lt;br /&gt;
===2.1.8.20130313===&lt;br /&gt;
*Updates to Matlab support&lt;br /&gt;
**Works properly on Matlab 7+, on Windows, Mac, Linux without needing changes to .m files.&lt;br /&gt;
===2.1.8.20130221===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Encoder Index event added to C and .NET libraries&lt;br /&gt;
===2.1.8.20121218===&lt;br /&gt;
*Webservice version: 1.0.10&lt;br /&gt;
**Support for 1024, 1032&lt;br /&gt;
*Support for 1024, 1032&lt;br /&gt;
*fixed bug where if one half of a composite device is open, and PHIDGET_USB_ERROR_FLAG gets set, the device may never re-attach.&lt;br /&gt;
===2.1.8.20121015===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support for new pressure/light sensors in example.&lt;br /&gt;
===2.1.8.20120914===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Improved firmware upgrading in control panel - it was giving some false-errors on some machines.&lt;br /&gt;
===2.1.8.20120912===&lt;br /&gt;
*Fixed bug where 1065 could fail to attach when opened over webservice&lt;br /&gt;
*Fixed bug where close() could deadlock on Phidgets opened over the webservice&lt;br /&gt;
*Changed LED64 LED Brightness from int to double&lt;br /&gt;
**this may cause issues when controlling the LED64 over the webservice and library/webservice are not the same version&lt;br /&gt;
**the old setDiscreteLED call will remain, deprecated, with an int argument for compatibility.&lt;br /&gt;
===2.1.8.20120716===&lt;br /&gt;
*Linux-Only Release&lt;br /&gt;
**Fixed a bug where opening a device in two program at once would cause an attach-detach cycle as they fight each other for control.&lt;br /&gt;
===2.1.8.20120713===&lt;br /&gt;
*Mac-Only Release&lt;br /&gt;
**Added signing of the Mac installer, so Mountain Lion (OS X 10.8) doesn&#039;t refuse to run it.&lt;br /&gt;
===2.1.8.20120615===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that caused java to crash on events introduced in 2.1.8.20120612&lt;br /&gt;
===2.1.8.20120612===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed another bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120606===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120525===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed PhidgetIR sendRawData bug in .NET on 64-bit machines.&lt;br /&gt;
===2.1.8.20120514===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed a bug that causes a segfault with libusb-1.0 under 64-bit Linux.&lt;br /&gt;
===2.1.8.20120507===&lt;br /&gt;
*Mac/Linux-only release&lt;br /&gt;
**Fixes a setLabel bug introduced in 2.1.8.20120503&lt;br /&gt;
===2.1.8.20120503===&lt;br /&gt;
*Fixed some spelling mistakes&lt;br /&gt;
*Moved to libusb-1.0&lt;br /&gt;
**This resolves a bug where having a webcam plugged in caused a memory leak in the webservice.&lt;br /&gt;
*Fixed bug with advanced servo where setting acceleration to accelerationMax would cause an exception for some servo types&lt;br /&gt;
===2.1.8.20120216===&lt;br /&gt;
*Fixed bug with RFID Reader on OS X and Linux, as well as .NET over the webservice&lt;br /&gt;
*Fixed bug that could cause the Java Phidget Manager to crash during garbage collection.&lt;br /&gt;
===2.1.8.20120131===&lt;br /&gt;
*Fixed RFID Reader bug that caused tag event to not get thrown in .NET Applications&lt;br /&gt;
*Changed compass bearing calculations in spatial C# example&lt;br /&gt;
===2.1.8.20120123===&lt;br /&gt;
*Added support for 1061 v300+&lt;br /&gt;
*Fixed a bug where the firmware version could be mis-reported over Bonjour&lt;br /&gt;
===2.1.8.20111220===&lt;br /&gt;
*Fixed a bug in AppleScript where closing a Phidget opened via label would give a &#039;Connection Invalid&#039; error.&lt;br /&gt;
*Fixed a bug where the webservice may fail to start on Linux systems that don&#039;t support IPv6 (ie. SBC2).&lt;br /&gt;
*Fixed issue where ratiometric state on newest interfacekit wouldn&#039;t be read back properly if it was false during attach.&lt;br /&gt;
*Fixed webservice issue where ratiometric state would not be reported properly for newest interfacekits&lt;br /&gt;
*Increased the number of overrun errors ignored during initial attach for InterfaceKit.&lt;br /&gt;
*Fixed an issue with the iPhone library and header&lt;br /&gt;
===2.1.8.20111219===&lt;br /&gt;
*fixed various other webservice stability/performance/memory leak bugs&lt;br /&gt;
*Faster connection to SBC-connected Phidgets from Mac OS&lt;br /&gt;
*Don&#039;t report packetlost or overrun errors that happen during early initialization - these are just noise.&lt;br /&gt;
*Fixed a bug in the webservice tree removal function that could cause memory leaks.&lt;br /&gt;
*Fixed bug where Webservice would crash on Linux if the chosen serverID was already under use on the network&lt;br /&gt;
*Stopped sending hardware Error Events before the Attach event - they are now queued up and sent after Attach&lt;br /&gt;
*Fixed a crash in the [[Phidget Control Panel]]&lt;br /&gt;
*Added ability to remove dictionary keys from a key change listener&lt;br /&gt;
*Reduced the number of false &#039;pending command not finished&#039; error events on Close()&lt;br /&gt;
*Fixed a webservice bug where exceptions/false attach events could occur when close() is called soon after open&lt;br /&gt;
*Fixed bug where closing a PhidgetRFID soon after attach could cause a crash&lt;br /&gt;
*Fixed webservice but on MacOS where client could exit with SIG_PIPE error&lt;br /&gt;
*Fixed webservice bug where the server would sometimes exit(1) after many connect/disconnect cycles&lt;br /&gt;
*Fixed webservice bug where client could deadlock during close()&lt;br /&gt;
*Fixed webservice bug where opening a single remote phidget multiple times from the same application would fail&lt;br /&gt;
*Fixed a webservice bug where sockets weren&#039;t being closed properly sometimes&lt;br /&gt;
*Fixed a webservice bug where pre-attach error events wouldn&#039;t get through&lt;br /&gt;
*Fixed a bug where the webservice running on Linux would stop responding to clients after ~300 connect/disconnect cycles&lt;br /&gt;
*Fixed bug where a Phidget would become inaccessible until the app is restarted if a thread creation failed&lt;br /&gt;
*Fixed webservice bug where connect is slow on Windows when multiple clients are running simultaneously&lt;br /&gt;
*Fixed webservice bug where authentication would fail on a valid password&lt;br /&gt;
*Fixed webservice bug where attach may never happen, and would require a close()/open()&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20111121===&lt;br /&gt;
*Added support for new servo types to all libraries&lt;br /&gt;
*Fixed min/max position/velocity causing invalid arg exception on servo/advservo&lt;br /&gt;
*IPv6 support on MacOS&lt;br /&gt;
*Fixed some memory leaks&lt;br /&gt;
*Fixed hostname lookup issue on Mac OS with Back To My Mac enabled.&lt;br /&gt;
===2.1.8.20111028===&lt;br /&gt;
*Fixed Applescript bugs and released examples&lt;br /&gt;
*Added openLabel to .NET, Java, COM&lt;br /&gt;
*Setting change trigger to 0 on interfacekit will not set event mode.&lt;br /&gt;
**Previously setting change trigger to 0 after setting data rate would supersede the data rate setting, which is probably unexpected.&lt;br /&gt;
===2.1.8.20110630 - MacOS Only===&lt;br /&gt;
*handle USB bug introduced in MacOS 10.6.8&lt;br /&gt;
===2.1.8.20110615===&lt;br /&gt;
*Added error event when trying to open Phidgets with an unsupported version&lt;br /&gt;
===2.1.8.20110614 - Windows Only===&lt;br /&gt;
*Fixed bug in C# Spatial example&lt;br /&gt;
*Added support for negative gains in 1056&lt;br /&gt;
===2.1.8.20110601 - MacOS Only===&lt;br /&gt;
*Fixed AppleScript issues&lt;br /&gt;
===2.1.8.20110527===&lt;br /&gt;
*Fixed AS3.0 library (Flash/Flex) - wouldn&#039;t connect to webservice as of last release&lt;br /&gt;
*Fixed bug where webservice doesn&#039;t release a closed Phidget&lt;br /&gt;
*Fixed bug where devices that don&#039;t support label didn&#039;t show up on MacOS&lt;br /&gt;
*Fixed iPhone library issues&lt;br /&gt;
===2.1.8.20110524===&lt;br /&gt;
*AppleScript support added&lt;br /&gt;
*fixed problem with Spatial in .NET on 64-bit Windows&lt;br /&gt;
*Added remote setLabel to mac preference pane.&lt;br /&gt;
*fixed a bug where label characters 7,8,9 would be read back corrupted on certain devices.&lt;br /&gt;
**labels &amp;gt;7 characters that exhibit this bug will now be truncated to 7 characters when being read back&lt;br /&gt;
**call setLabel again using this library or newer to support 10 character labels.&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to &amp;lt;=7 characters on these devices.&lt;br /&gt;
*fixed bug on MacOS where serial number and/or label strings could be read wrong.&lt;br /&gt;
*better support for recovering misbehaving devices in Linux&lt;br /&gt;
*fixed a deadlock on linux when Avahi is installed but not running&lt;br /&gt;
*clear list of attached devices when closing remote manager&lt;br /&gt;
*Added support for Unicode labels&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to ASCII.&lt;br /&gt;
*Added open by label&lt;br /&gt;
*Webservice protocol version up to 1.0.9 (for open by label)&lt;br /&gt;
*Made opening multiple device is one application faster.&lt;br /&gt;
*TextLCD changes:&lt;br /&gt;
**cursor is disabled while writing to the display or setting a custom character to prevent display artifacts&lt;br /&gt;
**cursor is disabled when a full line is written so it doesn&#039;t go to the start of another line&lt;br /&gt;
**1204 should be stable&lt;br /&gt;
**setDisplayCharacter supports 0x00-0xff&lt;br /&gt;
*stopped property reflected more accurately in the C# stepper example&lt;br /&gt;
*Added error events to mac examples&lt;br /&gt;
===2.1.8.20110329 - Windows only===&lt;br /&gt;
*Fixed problem with control panel encoder example where enable wouldn&#039;t work&lt;br /&gt;
*Fixed issue with SpatialData, GPSPositionChange, PHChange and WeightChange events in Labview 64-bit&lt;br /&gt;
===2.1.8.20110322===&lt;br /&gt;
*Fixed [[Phidget Control Panel]] memory leak when Bonjour in installed but not running&lt;br /&gt;
*Fixed current sense formula on 1061_0 v200&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetAdvancedServo&lt;br /&gt;
*Fixed bug in old PhidgetTemperatureSensor&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20110310===&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetServo&lt;br /&gt;
*Fixed some Labview bugs&lt;br /&gt;
*Added some Java and VB.NET examples&lt;br /&gt;
===2.1.8.20110301===&lt;br /&gt;
*Full Support for 1002, 1011, 1040, 1046, 1054, 1065, 1204&lt;br /&gt;
*New webservice version - 1.0.8&lt;br /&gt;
**Support for new devices&lt;br /&gt;
**Support for error events&lt;br /&gt;
===2.1.7.20110203===&lt;br /&gt;
*fixed crash on close of remote Phidget on MacOS&lt;br /&gt;
*C# ifkit example bugfix - crashed on 1015/1016&lt;br /&gt;
*webservice improvements&lt;br /&gt;
*Switch to IP address for SBC config in browser&lt;br /&gt;
*Faster IP lookup for SBCs in control panel&lt;br /&gt;
===2.1.7.20101222 / 2.1.7.20101223===&lt;br /&gt;
*fixed getServerID on Linux&lt;br /&gt;
*removed report ack&lt;br /&gt;
**this was causing some bad side effects&lt;br /&gt;
*manual .local lookups on Windows&lt;br /&gt;
**much faster then letting Windows do it itself&lt;br /&gt;
*Support for new Labview library&lt;br /&gt;
*Fixed PhidgetIR bug where library would crash if repeat code is longer then IR_MAX_REPEAT_LENGTH&lt;br /&gt;
===2.1.7.20101103===&lt;br /&gt;
*Decreased Phidget Webservice event latency on Windows&lt;br /&gt;
*Preliminary support for 1002, 1011, 1040, 1045, 1046, 1054, 1065, 1204 (C, .NET)&lt;br /&gt;
*Webservice version updated to 1.0.7&lt;br /&gt;
**support for 1045, 1011, 1204&lt;br /&gt;
*Fixed a bug where webservice connections could be unexpectedly lost&lt;br /&gt;
*Bugfix: couldn&#039;t set interfacekit data rate over webservice.&lt;br /&gt;
*Fixed some memory leaks in the Mac library&lt;br /&gt;
*Fixed bug where blocking for &amp;gt;2 seconds in an events handler when opening remotely could cause a crash.&lt;br /&gt;
===2.1.7.20100803===&lt;br /&gt;
*Windows only release&lt;br /&gt;
*fixed setLabel in WindowsCE&lt;br /&gt;
*fixed getHashCode in .NET library - needed for working with Phidgets in Labview via .NET&lt;br /&gt;
===2.1.7.20100621===&lt;br /&gt;
*Linux only release - autotools updates&lt;br /&gt;
**call ldconfig automatically&lt;br /&gt;
**remove old phidget21 library (pre-autotools) when installing new one.&lt;br /&gt;
===2.1.7.20100620===&lt;br /&gt;
*Linux only release - added version.sh for autoreconf&lt;br /&gt;
===2.1.7.20100618===&lt;br /&gt;
*Linux only release - added udev/hotplug files&lt;br /&gt;
===2.1.7.20100617===&lt;br /&gt;
*Linux only release&lt;br /&gt;
*Transitioned to autotools in linux for phidget21 / webservice&lt;br /&gt;
*phidget21 library and webservice are now separate downloads&lt;br /&gt;
===2.1.7.20100525===&lt;br /&gt;
*full support for PhidgetSpatial and PhidgetIR in all libraries&lt;br /&gt;
*fixed 1031 not attaching in AS3.0&lt;br /&gt;
*Better error messages in JNI&lt;br /&gt;
*Updated error codes, device ID/Class lists in Java, Flash, COM, etc.&lt;br /&gt;
*Fixed TemperatureSensor version 200,201,202 bug - ambient sensor would not report negative temperatures.&lt;br /&gt;
*Revised temperaturesensor API to report tempMin/tempMax and errors more accurately.&lt;br /&gt;
*Added initial events for encoder digital inputs&lt;br /&gt;
*full support for 1047&lt;br /&gt;
*Added new device support to WindowsCE&lt;br /&gt;
*Updated mac examples for 1047, 1048&lt;br /&gt;
===2.1.6.20100504===&lt;br /&gt;
*Windows only Release&lt;br /&gt;
**Added 1131 and 1132 to InterfaceKit example in MSI&lt;br /&gt;
===2.1.6.20100428===&lt;br /&gt;
*limit data rate maximum to 16ms over the webservice for devices that expose dataRate (InterfaceKit, Spatial)&lt;br /&gt;
*fixed bug where TextLCD 8/8/8 would stay in Bonjour list after webservice is shutdown&lt;br /&gt;
*set/get Brightness for 1203_2&lt;br /&gt;
*Support 1048 in C# example&lt;br /&gt;
*webservice version incremented to 1.0.6&lt;br /&gt;
**TextLCD set/get brightness&lt;br /&gt;
**PhidgetIR support&lt;br /&gt;
**PhidgetSpatial support&lt;br /&gt;
**1047 support (enable, index)&lt;br /&gt;
===2.1.6.20100406===&lt;br /&gt;
*Support for 1018_2 (dataRate)&lt;br /&gt;
*Webservice version incremented to 1.0.5&lt;br /&gt;
===2.1.6.20100401===&lt;br /&gt;
*Updated InterfaceKit example with new sensors&lt;br /&gt;
*make Windows connect cancelable&lt;br /&gt;
*make pending zeroconf lookups cancelable during close&lt;br /&gt;
===2.1.6.20100318===&lt;br /&gt;
*Mac only release&lt;br /&gt;
**Added WillSleep and Wakeup events to give user control of Phidgets immediately before and after a system sleep (MacOS Only).&lt;br /&gt;
===2.1.6.20100317===&lt;br /&gt;
*Windows only release&lt;br /&gt;
**Some of the examples were being built using an out of date .NET library&lt;br /&gt;
===2.1.6.20100310===&lt;br /&gt;
*MaxMSP fix - 2.1.6.20100126 introduced a bug for some Phidgets where openremote/open by serial didn&#039;t work and MaxMSP would sometimes crash.&lt;br /&gt;
**No code changes to any of the other libraries.&lt;br /&gt;
===2.1.6.20100304===&lt;br /&gt;
*stopped property changes trigger events over webservice so they are noticed.&lt;br /&gt;
**more compatible with how local open works&lt;br /&gt;
*added 5 new servos&lt;br /&gt;
*fixed bug where remote close would not set detached so a subsequent open would not always connect.&lt;br /&gt;
*handle UninitializeZeroconf better - shut down thread before closing handles, fixes hang on SBC&lt;br /&gt;
*fixed bug on Mac where detaching 2 or more Phidgets at the same time caused a crash&lt;br /&gt;
*fixed close blocking because of a pending connect (mac, linux)&lt;br /&gt;
*Final support for 1031 in all libraries.&lt;br /&gt;
===2.1.6.20100129===&lt;br /&gt;
*Implemented initial events in Flash&lt;br /&gt;
**Flash behaviour should now be identical to C library local and remote.&lt;br /&gt;
*Fix RFID issue where close could cause crash&lt;br /&gt;
*increment webservice version to 1.0.4&lt;br /&gt;
*fixed RFID remote open&lt;br /&gt;
**Flash would never get an attach event if the reader had been previously opened&lt;br /&gt;
**Initial tag event would not be fired when a tag was present and the antenna was enabled prior to open&lt;br /&gt;
*fixed openRemote failing on Mac&lt;br /&gt;
*fixed deadlock in webservice which could be hit by opening/closing a device over and over again.&lt;br /&gt;
*fixed bug in stepper, which caused seg fault on SBC on position change events.&lt;br /&gt;
===2.1.6.20100126===&lt;br /&gt;
*added network open support in Max/MSP&lt;br /&gt;
===2.1.6.20100115===&lt;br /&gt;
*Increased network performance for Linux/MacOS&lt;br /&gt;
*Added five servo types&lt;br /&gt;
===2.1.6.20091215===&lt;br /&gt;
*Fixed busy loop in Linux openRemote&lt;br /&gt;
*JNI Library relocated to /Library/Java/Extensions on MacOS&lt;br /&gt;
===2.1.6.20091211===&lt;br /&gt;
*Heartbeat now works on Linux as well (had to make sockets non-blocking)&lt;br /&gt;
===2.1.6.20091130===&lt;br /&gt;
*Added heartbeat to webservice (client side)&lt;br /&gt;
**Better detects network failures by using active polling timeouts&lt;br /&gt;
*Fixed 0/8/8 over webservice&lt;br /&gt;
===2.1.6.20091020===&lt;br /&gt;
*Fixed 1052 counting issue on 1070 (-1 reported as 255)&lt;br /&gt;
*Fixed issue where Phidget21 would try to reinstall from a limited user account or when the Control Panel was disabled.&lt;br /&gt;
*64-bit kernel support in Snow Leopard&lt;br /&gt;
===2.1.6.20090928===&lt;br /&gt;
*Support for PhidgetSBC (1070)&lt;br /&gt;
*zeroconf can handle starting up before the mdns daemon, and will keep trying to connect.&lt;br /&gt;
*fixed 1066 not showing up on Mac&lt;br /&gt;
*added advanced servo example to mac pref pane&lt;br /&gt;
*implemented proper error handling in COM&lt;br /&gt;
**default behavious remains the same, enable proper error handling with &#039;EnableVerboseErrors&#039;&lt;br /&gt;
*implemented error events in Java&lt;br /&gt;
===2.1.6.20090917===&lt;br /&gt;
*Updated webservice protocol version to 1.0.3&lt;br /&gt;
*Fixed stepper under AS3.0&lt;br /&gt;
*added setServoType, getServoType, setServoParameters to PhidgetServo and PhidgetAdvancedServo&lt;br /&gt;
*possible race condition fixed in webservice (pdictclient.c:907)&lt;br /&gt;
===2.1.6.20090902 (mac only release)===&lt;br /&gt;
*Support MacOSX 10.6, drop support for 10.3.9, require 10.4 or newer&lt;br /&gt;
**Fully 64-bit compliant, library supports ppc, i386, x86_64&lt;br /&gt;
===2.1.6.20090806===&lt;br /&gt;
*Added 1049 support&lt;br /&gt;
*Fixed RFID tag events over webservice&lt;br /&gt;
===2.1.6.20090804===&lt;br /&gt;
*Added 1051_2 support&lt;br /&gt;
*Fixed various small initialization issues - stepper, adv servo, rfid&lt;br /&gt;
*Added 32-bit library install to 64-bit installer&lt;br /&gt;
**VB6.0, etc. need the 32-bit COM library on 64-bit windows&lt;br /&gt;
===2.1.6.20090717===&lt;br /&gt;
*?&lt;br /&gt;
===2.1.6.20090708===&lt;br /&gt;
*Added DeviceID to zeroconf&lt;br /&gt;
*fixed RFID.LastTag in .NET&lt;br /&gt;
*Changed the error codes returned by error events; error events now have their own set of error codes rather then sharing the function return codes.&lt;br /&gt;
*Added support for 1047, 1048&lt;br /&gt;
*Added error event codes rather then trying to reuse the EPHIDGET return codes.&lt;br /&gt;
*fixed TextLCD issue where display could get corrupted during a detach/attach&lt;br /&gt;
*made mac more reliable on attach&lt;br /&gt;
*more error logging on mac&lt;br /&gt;
===2.1.6.20090525===&lt;br /&gt;
*fixed RFID not attaching via webservice if a tag is present.&lt;br /&gt;
*bugfix related to double free on detach event.&lt;br /&gt;
*Implemented getKey&lt;br /&gt;
*Added MIPS II support to Windows CE&lt;br /&gt;
===2.1.6.20090430===&lt;br /&gt;
*Added ActiveX interface to COM library&lt;br /&gt;
*Added stepper and advancedServo to Flex .swc library&lt;br /&gt;
===2.1.6.20090417===&lt;br /&gt;
*added PhidgetIR prototype support to C library&lt;br /&gt;
*properly handles sleeping on OSX&lt;br /&gt;
*fixed some webservice field initializations in Flash and C&lt;br /&gt;
*fixed security exceptions in [[Phidget Control Panel]] under Vista&lt;br /&gt;
*added [[Phidget Control Panel]] to start menu&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090318 (Examples/AS3.0 only release)===&lt;br /&gt;
*Fixed AdvancedServo in Flash - wouldn&#039;t attach&lt;br /&gt;
===2.1.6.20090317===&lt;br /&gt;
*[[Phidget Control Panel]] properly supports Vista UAC and Limited user accounts in XP, etc.&lt;br /&gt;
*Added 64-bit release of Phidget21.msi for Windows&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090312===&lt;br /&gt;
*added 1064, 1059 to WindowsCE&lt;br /&gt;
*fixed opening 1051 over webservice&lt;br /&gt;
*fixed opening 1015/1016 over webservice broken in last release&lt;br /&gt;
===2.1.6.20090302===&lt;br /&gt;
*Advanced servo bugfix: stopped would stop being true if min/max was set to exclude current position.&lt;br /&gt;
*linux USB improvements when many Phidgets are attached and opened at once.&lt;br /&gt;
*1031 support in phidget21, webservice, .NET - hidden until product release&lt;br /&gt;
**CPhidgetLED_setVoltage&lt;br /&gt;
**CPhidgetLED_getVoltage&lt;br /&gt;
**CPhidgetLED_setCurrentLimit&lt;br /&gt;
**CPhidgetLED_getCurrentLimit&lt;br /&gt;
*unknown timechange == PUNK_INT in encoder position change event&lt;br /&gt;
**1st position change event&lt;br /&gt;
**&amp;gt; 30 seconds time change&lt;br /&gt;
*AS3 updates&lt;br /&gt;
**updated to 1.0.2 webservice&lt;br /&gt;
**encoder position change events report relative change rather then absolute position&lt;br /&gt;
**encoder adds getTimeChange function for timing encoder changes&lt;br /&gt;
*webservice updated to 1.0.2&lt;br /&gt;
**Authorization is asynchronous&lt;br /&gt;
**Doesn&#039;t match the old version checking, so errors will not be nice when trying to connect to an old webservice&lt;br /&gt;
**Sends out all initial data, so it&#039;s just like opening locally&lt;br /&gt;
**supports interfacekit Raw sensor value&lt;br /&gt;
**supports labels on remoteIP managers&lt;br /&gt;
*avahi bugfix&lt;br /&gt;
*webservice more stable against forcefully closed clients&lt;br /&gt;
*closing a network Phidget won&#039;t block - ever.&lt;br /&gt;
**no longer using quit, just closing the socket&lt;br /&gt;
*added libavahi-client.so.3 reference to linux library.&lt;br /&gt;
*Fixed bug with opening one phidget with serial and no serial at the same time over the webservice&lt;br /&gt;
===2.1.5.20090105===&lt;br /&gt;
*[[Phidget Control Panel]] stability improvements&lt;br /&gt;
*added CPhidgetSBC_getHostname&lt;br /&gt;
*advanced servo 1 motor current sense equation - support should now be complete&lt;br /&gt;
*webservice and network code bugfixes - crash / deadlock during close, problems with concurrent connections, etc.&lt;br /&gt;
*fixed close on remote and remoteIP managers&lt;br /&gt;
*name of RFID changed from &amp;quot;Phidget RFID 4-output&amp;quot; to &amp;quot;Phidget RFID 2-output&amp;quot; - updated anything referencing old name.&lt;br /&gt;
&lt;br /&gt;
===2.1.5.20081023===&lt;br /&gt;
*added advanced servo and stepper examples to VB6.0, VB.NET and C&lt;br /&gt;
*added deviceClass and deviceID&lt;br /&gt;
*updated Mac examples&lt;br /&gt;
*webservice protocol version enforcement&lt;br /&gt;
*internal fix/rework of device id&#039;s etc.&lt;br /&gt;
*Fixed memory leaks in webservice and phidget21 network code.&lt;br /&gt;
*Dictionary and network stability improvements.&lt;br /&gt;
*duplicate calls to open or close are now silently ignored.&lt;br /&gt;
===2.1.4.20080924===&lt;br /&gt;
*Old TextLCD 0/8/8&#039;s can now have both halves open at the same time on Windows&lt;br /&gt;
*fixed bug with composite devices on linux&lt;br /&gt;
*fixed manager on linux to better deal with unique devices&lt;br /&gt;
===2.1.4.20080922===&lt;br /&gt;
*Updated Delphi files&lt;br /&gt;
*TextLCD can display 0x80-0xFF characters from Java&lt;br /&gt;
*getAttachedDevices works for mdns managers&lt;br /&gt;
*fixed a deadlock in the webservice&lt;br /&gt;
*better network error handling / password support for windows C# examples&lt;br /&gt;
*waitForAttachment will return EPHIDGET_CLOSED if the handle is closed while it is waiting.&lt;br /&gt;
*added EPHIDGET_CLOSED&lt;br /&gt;
*joining central threads checks whether they are trying to be joined by themselves first (avoid deadlocks).&lt;br /&gt;
*changed context of error event to be free from locks (can call close, open, etc. from them).&lt;br /&gt;
===2.1.4.20080821===&lt;br /&gt;
*zeroconf threads exit cleanly on last _close (apple zeroconf)&lt;br /&gt;
*Added advanced servo and stepper to Max&lt;br /&gt;
===2.1.4.20080811 (mac only release)===&lt;br /&gt;
*Fixed manager on Mac (wasn&#039;t working at all since 2.1.4.20080808)&lt;br /&gt;
===2.1.4.20080808===&lt;br /&gt;
*added CPhidgetSBC and CPhidgetSBCManager to the c library - these interfaces are hidden from users and meant to be used internally (for now).&lt;br /&gt;
*CPhidgetManager_open no longer blocks to send out initial attach events. These initial events are sent from the CentralThread context like all other attach events.&lt;br /&gt;
*fixed CThread_wait_on_event on Linux&lt;br /&gt;
*added CPhidgetGeneric interface for prototyping to C, .NET libraries. product ID is 0x99. These are only visible in debug releases, only to be used internally.&lt;br /&gt;
===2.1.4.20080715===&lt;br /&gt;
*udev rules fixed for product IDs with alpha-hex values&lt;br /&gt;
*blocking in an attach event does not block calls to open anymore&lt;br /&gt;
*RFID tag event handlers can now handle blocking - tag lost is timed after the tag handler exits.&lt;br /&gt;
===2.1.4.20080623===&lt;br /&gt;
*Flex .swc library was out of sync&lt;br /&gt;
*fixed CPhidgetManager_getAttachedDevices for network managers&lt;br /&gt;
*Added CPhidgetManager_freeAttachedDevicesArray&lt;br /&gt;
===2.1.4.20080613===&lt;br /&gt;
*Max/MSP RFID fixed&lt;br /&gt;
*0/0/8 and advanced servo added to CE&lt;br /&gt;
*fixed flash policy file server in webservice&lt;br /&gt;
*webservice with password and asynchronous together work now&lt;br /&gt;
===2.1.4.20080602===&lt;br /&gt;
*phidget21.h -&amp;gt; phidget21int.h so as not to be confused with generated phidget21.h&lt;br /&gt;
*some changes to Makefile fro crosscompiling&lt;br /&gt;
*no more vbscript in msi&lt;br /&gt;
===2.1.4.20080513===&lt;br /&gt;
*removed long long from COM - not supported by VB6.0&lt;br /&gt;
*added LastTag to RFID in .NET&lt;br /&gt;
===2.1.4.20080428===&lt;br /&gt;
*support Mac OS X 10.3.9 again&lt;br /&gt;
*Rev up to 2.1.4&lt;br /&gt;
*finalize Phidget Stepper API - Phidget Stepper requires 2.1.4 as a minimum&lt;br /&gt;
*fixed serverConnect and serverDisconnect handlers for manager and dictionary in COM&lt;br /&gt;
*Changed:&lt;br /&gt;
**PhidgetStepper and PhidgetAdvancedServo&lt;br /&gt;
***MotorPosition -&amp;gt; Position&lt;br /&gt;
***MotorOn -&amp;gt; Engaged&lt;br /&gt;
***MotorStopped -&amp;gt; Stopped&lt;br /&gt;
*Added:&lt;br /&gt;
**CPhidgetStepper_getCurrentLimit&lt;br /&gt;
**CPhidgetEncoder_getPosition&lt;br /&gt;
**CPhidgetEncoder_setPosition&lt;br /&gt;
**CPhidgetMotorControl_getVelocity&lt;br /&gt;
**CPhidgetMotorControl_setVelocity&lt;br /&gt;
**CPhidgetMotorControl_set_OnVelocityChange_Handler&lt;br /&gt;
**CPhidgetServo_setEngaged&lt;br /&gt;
**CPhidgetServo_getEngaged&lt;br /&gt;
**CPhidgetServo_getPosition&lt;br /&gt;
**CPhidgetServo_setPosition&lt;br /&gt;
**CPhidgetServo_set_OnPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getPositionMax&lt;br /&gt;
**CPhidgetServo_getPositionMin&lt;br /&gt;
**Count functions&lt;br /&gt;
*Deprecated:&lt;br /&gt;
**CPhidgetEncoder_getEncoderPosition&lt;br /&gt;
**CPhidgetEncoder_setEncoderPosition&lt;br /&gt;
**CPhidgetMotorControl_getMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_setMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_set_OnMotorChange_Handler&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorPosition&lt;br /&gt;
**CPhidgetServo_setMotorPosition&lt;br /&gt;
**CPhidgetServo_set_OnMotorPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**Num functions&lt;br /&gt;
*Added ability to deprecate funcitons in the C library - compiler will issue a warning when they are used.&lt;br /&gt;
*added names to some arguments in phidget21.h&lt;br /&gt;
*fixes to the webservice for initial state stuff - now it behaves almost like non-webservice, with guaranteed initial events, but we don&#039;t guarantee initial state in the attach event yet. Min/Max, Num motors, inputs, etc. are all guaranteed in the attach handler.&lt;br /&gt;
*Finalized support for Phidget Stepper&lt;br /&gt;
===2.1.3.20080402===&lt;br /&gt;
*Fixed windows BUG - Device Type was showing up wrong&lt;br /&gt;
*CPhidgetStepper_getPosition -&amp;gt; CPhidgetStepper_getCurrentPosition&lt;br /&gt;
===2.1.3.20080327===&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorStopped&lt;br /&gt;
*changes to API&lt;br /&gt;
**CPhidgetStepper_setMotorPosition -&amp;gt; CPhidgetStepper_setTargetMotorPosition&lt;br /&gt;
**added CPhidgetStepper_getTargetMotorPosition&lt;br /&gt;
**Stepper MotorSpeed -&amp;gt; Velocity&lt;br /&gt;
**Stepper and AdvancedServo MaxVelocity -&amp;gt; VelocityLimit&lt;br /&gt;
*add waitForAttachment to COM&lt;br /&gt;
*COM getbool (not indexed) will now return FALSE on false (rather then always returning true)&lt;br /&gt;
*fixed write thread timeouts - was setting attached after starting write thread so write thread would see a detached device and exit immediately&lt;br /&gt;
===2.1.3.20080206===&lt;br /&gt;
*changed long long to __int64, to be happy in borland C++&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetStepper_getMaxMotorSpeed&lt;br /&gt;
**CPhidgetStepper_setMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorStopped&lt;br /&gt;
**CPhidgetStepper_setCurrentMotorPosition&lt;br /&gt;
*removed CPhidgetStepper_setVelocity&lt;br /&gt;
*added CPhidgetStepper_setMaxVelocity, CPhidgetStepper_getMaxVelocity&lt;br /&gt;
===2.1.3.20080114===&lt;br /&gt;
*Added new functions to Flash API&lt;br /&gt;
*Added new functions to Webservice Protocol&lt;br /&gt;
*Added new functions to COM Library&lt;br /&gt;
*Added new functions to Java Library&lt;br /&gt;
*All device fiels in C library cleaned up and made consistent&lt;br /&gt;
*Open in windows is exclusive - this needs to be tested for stability&lt;br /&gt;
*No data will be returned / accepted if it lies outside of max/min range&lt;br /&gt;
*if a data value is unknown, user variable is set to PUNK_INT, PUNK_DBL, or PUNK_BOOL, and return value is EPHIDGET_UNKNOWNVAL&lt;br /&gt;
*Proper Device initializations on Attach:&lt;br /&gt;
**triggers are set to defaults on attach&lt;br /&gt;
**device state is read in and preserved on attach&lt;br /&gt;
**during attach event, all sensor data, etc. is provided if available&lt;br /&gt;
**no data events until after the attach event returns&lt;br /&gt;
**everything initialized by the time waitForAttachment returns&lt;br /&gt;
**after attach event returns, a full set of initial state data events are thrown&lt;br /&gt;
*.NET collections are readonly, and never NULL (but empty when phidget detached)&lt;br /&gt;
*.NET callbacks no longer catch and hide all exceptions&lt;br /&gt;
**make sure to use try/catch blocks especially in Attach when accessing properties that may not be initialized.&lt;br /&gt;
*added min/max functions:&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMax&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMax&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMax&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMax&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMin&lt;br /&gt;
**CPhidgetPHSensor_getPHMax&lt;br /&gt;
**CPhidgetPHSensor_getPHMin&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMax&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMin&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetStepper_getAccelerationMax&lt;br /&gt;
**CPhidgetStepper_getAccelerationMin&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMax&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMin&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMax&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMin&lt;br /&gt;
*Added functions:&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperature&lt;br /&gt;
**CPhidgetTemperatureSensor_getThermocoupleType&lt;br /&gt;
**CPhidgetTemperatureSensor_setThermocoupleType&lt;br /&gt;
**CPhidget_set_OnServerConnectHandler&lt;br /&gt;
**CPhidget_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_getServerID&lt;br /&gt;
**CPhidgetDictionary_getServerAddress&lt;br /&gt;
**CPhidgetDictionary_getServerStatus&lt;br /&gt;
**CPhidgetManager_getServerID&lt;br /&gt;
**CPhidgetManager_getServerAddress&lt;br /&gt;
**CPhidgetManager_getServerStatus&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
*Removed functions:&lt;br /&gt;
**CPhidgetServo_setMotorOff&lt;br /&gt;
*TemperatureSensor:&lt;br /&gt;
**Ambient sensor is accessed with it&#039;s own function&lt;br /&gt;
**first thermocouple is Index 0 everywhere&lt;br /&gt;
**no ambient sensor events&lt;br /&gt;
*getServerID is implemented&lt;br /&gt;
*changed the internal network structure (added CPhidgetRemote)&lt;br /&gt;
*reworked the USB code (mostly on Windows)&lt;br /&gt;
**Better handles closing, ESD events, timeouts&lt;br /&gt;
**fixed issues with Encoder, RFID stopping reading after a certain time.&lt;br /&gt;
**added USB error flag&lt;br /&gt;
*openRemote functions have been implemented&lt;br /&gt;
**these require bonjour (mac / windows) or avahi (linux) to be installed on both the client and server&lt;br /&gt;
**if they are not, you get EPHIDGET_UNSUPPORTED when you call them&lt;br /&gt;
*openRemoteIP functions are asynchronous and persistent&lt;br /&gt;
*include cphidgetconstants.h in phidget21.h for users&lt;br /&gt;
===2.1.2.20071108===&lt;br /&gt;
*start of chagelog&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Template:Phidget21Box&amp;diff=24090</id>
		<title>Template:Phidget21Box</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Template:Phidget21Box&amp;diff=24090"/>
		<updated>2018-05-11T18:45:28Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;background-color: #ffcccc;&amp;quot;&lt;br /&gt;
|[[Image:alert.png|40px|link=]] &lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |&lt;br /&gt;
&#039;&#039;&#039;Notice:&#039;&#039;&#039; This page contains information for the legacy Phidget21 Library. Phidget21 does not support VINT Phidgets, and will not support any new Phidgets. Phidget21 will be maintained until 2020. We recommend that new projects be developed against the Phidget22 Library.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=3&amp;gt;&#039;&#039;&#039;Click on the [[Image:2phidget22.jpg|link=|100px]] button in the menu bar to go to the Phidget22 version of this page.&#039;&#039;&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
|[[Image:alert.png|40px|link=]] &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Template:UserguideTOC&amp;diff=23997</id>
		<title>Template:UserguideTOC</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Template:UserguideTOC&amp;diff=23997"/>
		<updated>2018-05-04T22:39:13Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|- valign=middle&lt;br /&gt;
| align=center width=300px| __TOC__ &lt;br /&gt;
| [[Image:{{{1}}}|link={{SERVER}}/products.php?product_id={{{2}}}|500px]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|align=center|[{{SERVER}}/products.php?product_id={{{2}}} Go to this device&#039;s product page]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
__NOINDEX__&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=23980</id>
		<title>Driver Changelog</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=23980"/>
		<updated>2018-02-16T00:50:06Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Administrative]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
===2.1.9.20180215===&lt;br /&gt;
*Move to .NET 4.0&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20171215===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where opening two of the same device with -1 serial could cause missed attach/detach events and other errors.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160921===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where devices plugged in before boot were inaccessible until unplugged/re-plugged, under OS X 10.11. &lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160202===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Labview 7.1 support&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160107===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Don&#039;t throw an exception on EncoderPositionChangeEventArgs.Time in the .Net library when time it unknown - just return 0x7fffffff&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160104===&lt;br /&gt;
*Mac/Windows release&lt;br /&gt;
**New firmware for 1042 and 1044, fixing digital gyro&lt;br /&gt;
===2.1.8.20151217===&lt;br /&gt;
*Fixed 1045 bug where it will display an unknown ambient temperature sometimes&lt;br /&gt;
*Fixed a crash in the windows control panel&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151020===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Fixed an issue where the examples would error when trying to run them from the control panel.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151009===&lt;br /&gt;
*OS X and Windows release&lt;br /&gt;
**Upgraded firmware for 1024, 1032, 1041, 1042, 1043, 1044 and 1067 to address issues with these Phidgets on OS X El Capitan&lt;br /&gt;
*SBC release&lt;br /&gt;
**Support for multiple webcams &lt;br /&gt;
===2.1.8.20150821===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Support OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150805===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Preliminary support for OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150410===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed Makefile phidget21.h target issues&lt;br /&gt;
===2.1.8.20150326===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed issue with webservice buttons not being visible in the control panel&lt;br /&gt;
===2.1.8.20150323===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Updated icons with new company logo&lt;br /&gt;
===2.1.8.20150227===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Added copyright/licence headers to source code files&lt;br /&gt;
**Updated cvtutf files to a newer version&lt;br /&gt;
===2.1.8.20150109===&lt;br /&gt;
*Windows-only&lt;br /&gt;
**Fixed examples for Labview 8.5&lt;br /&gt;
===2.1.8.20141209===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Added support for armv7s and arm64 to the iOS library. Dropped support for armv6. Requires iOS 5.1.1 or later.&lt;br /&gt;
===2.1.8.20141202===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Labview release to support older versions&lt;br /&gt;
===2.1.8.20141119===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed an issue with the 2.1.8.20141117 release where nothing was actually installed.&lt;br /&gt;
===2.1.8.20141117===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed a code-signing issue that make the installer appear unsigned on OS X 10.10&lt;br /&gt;
**Dropped support for OS X 10.4&lt;br /&gt;
===2.1.8.20140905===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added an IA32 folder to the windows libraries download - this supports Windows on the Intel Galileo platform&lt;br /&gt;
===2.1.8.20140428===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to C# Stepper GUI Example&lt;br /&gt;
===2.1.8.20140319===&lt;br /&gt;
*CPhidget_getDeviceClass can now be called on handle before it is attached.&lt;br /&gt;
*Added support for 64-bit Max/MSP (Version 6.1+) on both OS X and Windows.&lt;br /&gt;
===2.1.8.20140227===&lt;br /&gt;
*Deals with 1046 bug in v100 and v101 firmware.&lt;br /&gt;
**No longer reports bad values that appear right after a channel is enabled.&lt;br /&gt;
**Fixes issue where changing the gain while channel 0 is disabled would sometimes cause bad readings.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20131105===&lt;br /&gt;
* Fixed a defect in the Flash examples for the 1012 (Outputs 11-16 were not addressed properly).&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20130926===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support setting label on 1067 from Windows&lt;br /&gt;
===2.1.8.20130820===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added logging option to control panel / C# full examples&lt;br /&gt;
===2.1.8.20130802===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fix for Windows 8 issue where only &#039;Uninitialized Phidget Handle&#039; would show up in the Manager, and Phidgets could not be opened.&lt;br /&gt;
===2.1.8.20130723===&lt;br /&gt;
*Improvement to java: we don&#039;t attach/detach our native threads for each event, just one attach, then detach before the thread exits.&lt;br /&gt;
**This increases performance, esp. when debugging on Android.&lt;br /&gt;
*Improvement to Android: We reuse the UsbRequest object rather then creating a new one for each transfer. This reduces logcat messages tremendously, and increases performance.&lt;br /&gt;
===2.1.8.20130710===&lt;br /&gt;
*Android-only release&lt;br /&gt;
**Added extra android target architectures: x86, MIPS, armeabi-v7a&lt;br /&gt;
===2.1.8.20130618===&lt;br /&gt;
*Changed setCompassCorrectionParameters() API call so that compass calibration parameters are written out to non-volatile storage on 1042/1044, so that they persist across power cycles. Previously, calibration data would need to be re-programmed at each attach.&lt;br /&gt;
*Changes to C# Spatial example:&lt;br /&gt;
**Compass calibration parameter set dialog removed from for 1042/1044 because parameters are set by the calibration software - and thus do not need setting in the example.&lt;br /&gt;
**Stores/restores parameters for 1056 based on serial number, so multiple different calibrations can be maintained.&lt;br /&gt;
===2.1.8.20130607===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to compass calibration software for 1042/1044&lt;br /&gt;
===2.1.8.20130419===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed setCompassCorrectionParameters in the COM library&lt;br /&gt;
===2.1.8.20130327===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Changed Windows installer to stop virus-scanner false positives&lt;br /&gt;
**Dropped support for Windows 2000&lt;br /&gt;
===2.1.8.20130320===&lt;br /&gt;
*Added EPHIDGET_NOTFOUND exception to Dictionary.getKey() for when the key is not found.&lt;br /&gt;
*Added exceptions back into the Java library - they have been missing since 2.1.8.20121015 release.&lt;br /&gt;
===2.1.8.20130313===&lt;br /&gt;
*Updates to Matlab support&lt;br /&gt;
**Works properly on Matlab 7+, on Windows, Mac, Linux without needing changes to .m files.&lt;br /&gt;
===2.1.8.20130221===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Encoder Index event added to C and .NET libraries&lt;br /&gt;
===2.1.8.20121218===&lt;br /&gt;
*Webservice version: 1.0.10&lt;br /&gt;
**Support for 1024, 1032&lt;br /&gt;
*Support for 1024, 1032&lt;br /&gt;
*fixed bug where if one half of a composite device is open, and PHIDGET_USB_ERROR_FLAG gets set, the device may never re-attach.&lt;br /&gt;
===2.1.8.20121015===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support for new pressure/light sensors in example.&lt;br /&gt;
===2.1.8.20120914===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Improved firmware upgrading in control panel - it was giving some false-errors on some machines.&lt;br /&gt;
===2.1.8.20120912===&lt;br /&gt;
*Fixed bug where 1065 could fail to attach when opened over webservice&lt;br /&gt;
*Fixed bug where close() could deadlock on Phidgets opened over the webservice&lt;br /&gt;
*Changed LED64 LED Brightness from int to double&lt;br /&gt;
**this may cause issues when controlling the LED64 over the webservice and library/webservice are not the same version&lt;br /&gt;
**the old setDiscreteLED call will remain, deprecated, with an int argument for compatibility.&lt;br /&gt;
===2.1.8.20120716===&lt;br /&gt;
*Linux-Only Release&lt;br /&gt;
**Fixed a bug where opening a device in two program at once would cause an attach-detach cycle as they fight each other for control.&lt;br /&gt;
===2.1.8.20120713===&lt;br /&gt;
*Mac-Only Release&lt;br /&gt;
**Added signing of the Mac installer, so Mountain Lion (OS X 10.8) doesn&#039;t refuse to run it.&lt;br /&gt;
===2.1.8.20120615===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that caused java to crash on events introduced in 2.1.8.20120612&lt;br /&gt;
===2.1.8.20120612===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed another bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120606===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120525===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed PhidgetIR sendRawData bug in .NET on 64-bit machines.&lt;br /&gt;
===2.1.8.20120514===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed a bug that causes a segfault with libusb-1.0 under 64-bit Linux.&lt;br /&gt;
===2.1.8.20120507===&lt;br /&gt;
*Mac/Linux-only release&lt;br /&gt;
**Fixes a setLabel bug introduced in 2.1.8.20120503&lt;br /&gt;
===2.1.8.20120503===&lt;br /&gt;
*Fixed some spelling mistakes&lt;br /&gt;
*Moved to libusb-1.0&lt;br /&gt;
**This resolves a bug where having a webcam plugged in caused a memory leak in the webservice.&lt;br /&gt;
*Fixed bug with advanced servo where setting acceleration to accelerationMax would cause an exception for some servo types&lt;br /&gt;
===2.1.8.20120216===&lt;br /&gt;
*Fixed bug with RFID Reader on OS X and Linux, as well as .NET over the webservice&lt;br /&gt;
*Fixed bug that could cause the Java Phidget Manager to crash during garbage collection.&lt;br /&gt;
===2.1.8.20120131===&lt;br /&gt;
*Fixed RFID Reader bug that caused tag event to not get thrown in .NET Applications&lt;br /&gt;
*Changed compass bearing calculations in spatial C# example&lt;br /&gt;
===2.1.8.20120123===&lt;br /&gt;
*Added support for 1061 v300+&lt;br /&gt;
*Fixed a bug where the firmware version could be mis-reported over Bonjour&lt;br /&gt;
===2.1.8.20111220===&lt;br /&gt;
*Fixed a bug in AppleScript where closing a Phidget opened via label would give a &#039;Connection Invalid&#039; error.&lt;br /&gt;
*Fixed a bug where the webservice may fail to start on Linux systems that don&#039;t support IPv6 (ie. SBC2).&lt;br /&gt;
*Fixed issue where ratiometric state on newest interfacekit wouldn&#039;t be read back properly if it was false during attach.&lt;br /&gt;
*Fixed webservice issue where ratiometric state would not be reported properly for newest interfacekits&lt;br /&gt;
*Increased the number of overrun errors ignored during initial attach for InterfaceKit.&lt;br /&gt;
*Fixed an issue with the iPhone library and header&lt;br /&gt;
===2.1.8.20111219===&lt;br /&gt;
*fixed various other webservice stability/performance/memory leak bugs&lt;br /&gt;
*Faster connection to SBC-connected Phidgets from Mac OS&lt;br /&gt;
*Don&#039;t report packetlost or overrun errors that happen during early initialization - these are just noise.&lt;br /&gt;
*Fixed a bug in the webservice tree removal function that could cause memory leaks.&lt;br /&gt;
*Fixed bug where Webservice would crash on Linux if the chosen serverID was already under use on the network&lt;br /&gt;
*Stopped sending hardware Error Events before the Attach event - they are now queued up and sent after Attach&lt;br /&gt;
*Fixed a crash in the [[Phidget Control Panel]]&lt;br /&gt;
*Added ability to remove dictionary keys from a key change listener&lt;br /&gt;
*Reduced the number of false &#039;pending command not finished&#039; error events on Close()&lt;br /&gt;
*Fixed a webservice bug where exceptions/false attach events could occur when close() is called soon after open&lt;br /&gt;
*Fixed bug where closing a PhidgetRFID soon after attach could cause a crash&lt;br /&gt;
*Fixed webservice but on MacOS where client could exit with SIG_PIPE error&lt;br /&gt;
*Fixed webservice bug where the server would sometimes exit(1) after many connect/disconnect cycles&lt;br /&gt;
*Fixed webservice bug where client could deadlock during close()&lt;br /&gt;
*Fixed webservice bug where opening a single remote phidget multiple times from the same application would fail&lt;br /&gt;
*Fixed a webservice bug where sockets weren&#039;t being closed properly sometimes&lt;br /&gt;
*Fixed a webservice bug where pre-attach error events wouldn&#039;t get through&lt;br /&gt;
*Fixed a bug where the webservice running on Linux would stop responding to clients after ~300 connect/disconnect cycles&lt;br /&gt;
*Fixed bug where a Phidget would become inaccessible until the app is restarted if a thread creation failed&lt;br /&gt;
*Fixed webservice bug where connect is slow on Windows when multiple clients are running simultaneously&lt;br /&gt;
*Fixed webservice bug where authentication would fail on a valid password&lt;br /&gt;
*Fixed webservice bug where attach may never happen, and would require a close()/open()&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20111121===&lt;br /&gt;
*Added support for new servo types to all libraries&lt;br /&gt;
*Fixed min/max position/velocity causing invalid arg exception on servo/advservo&lt;br /&gt;
*IPv6 support on MacOS&lt;br /&gt;
*Fixed some memory leaks&lt;br /&gt;
*Fixed hostname lookup issue on Mac OS with Back To My Mac enabled.&lt;br /&gt;
===2.1.8.20111028===&lt;br /&gt;
*Fixed Applescript bugs and released examples&lt;br /&gt;
*Added openLabel to .NET, Java, COM&lt;br /&gt;
*Setting change trigger to 0 on interfacekit will not set event mode.&lt;br /&gt;
**Previously setting change trigger to 0 after setting data rate would supersede the data rate setting, which is probably unexpected.&lt;br /&gt;
===2.1.8.20110630 - MacOS Only===&lt;br /&gt;
*handle USB bug introduced in MacOS 10.6.8&lt;br /&gt;
===2.1.8.20110615===&lt;br /&gt;
*Added error event when trying to open Phidgets with an unsupported version&lt;br /&gt;
===2.1.8.20110614 - Windows Only===&lt;br /&gt;
*Fixed bug in C# Spatial example&lt;br /&gt;
*Added support for negative gains in 1056&lt;br /&gt;
===2.1.8.20110601 - MacOS Only===&lt;br /&gt;
*Fixed AppleScript issues&lt;br /&gt;
===2.1.8.20110527===&lt;br /&gt;
*Fixed AS3.0 library (Flash/Flex) - wouldn&#039;t connect to webservice as of last release&lt;br /&gt;
*Fixed bug where webservice doesn&#039;t release a closed Phidget&lt;br /&gt;
*Fixed bug where devices that don&#039;t support label didn&#039;t show up on MacOS&lt;br /&gt;
*Fixed iPhone library issues&lt;br /&gt;
===2.1.8.20110524===&lt;br /&gt;
*AppleScript support added&lt;br /&gt;
*fixed problem with Spatial in .NET on 64-bit Windows&lt;br /&gt;
*Added remote setLabel to mac preference pane.&lt;br /&gt;
*fixed a bug where label characters 7,8,9 would be read back corrupted on certain devices.&lt;br /&gt;
**labels &amp;gt;7 characters that exhibit this bug will now be truncated to 7 characters when being read back&lt;br /&gt;
**call setLabel again using this library or newer to support 10 character labels.&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to &amp;lt;=7 characters on these devices.&lt;br /&gt;
*fixed bug on MacOS where serial number and/or label strings could be read wrong.&lt;br /&gt;
*better support for recovering misbehaving devices in Linux&lt;br /&gt;
*fixed a deadlock on linux when Avahi is installed but not running&lt;br /&gt;
*clear list of attached devices when closing remote manager&lt;br /&gt;
*Added support for Unicode labels&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to ASCII.&lt;br /&gt;
*Added open by label&lt;br /&gt;
*Webservice protocol version up to 1.0.9 (for open by label)&lt;br /&gt;
*Made opening multiple device is one application faster.&lt;br /&gt;
*TextLCD changes:&lt;br /&gt;
**cursor is disabled while writing to the display or setting a custom character to prevent display artifacts&lt;br /&gt;
**cursor is disabled when a full line is written so it doesn&#039;t go to the start of another line&lt;br /&gt;
**1204 should be stable&lt;br /&gt;
**setDisplayCharacter supports 0x00-0xff&lt;br /&gt;
*stopped property reflected more accurately in the C# stepper example&lt;br /&gt;
*Added error events to mac examples&lt;br /&gt;
===2.1.8.20110329 - Windows only===&lt;br /&gt;
*Fixed problem with control panel encoder example where enable wouldn&#039;t work&lt;br /&gt;
*Fixed issue with SpatialData, GPSPositionChange, PHChange and WeightChange events in Labview 64-bit&lt;br /&gt;
===2.1.8.20110322===&lt;br /&gt;
*Fixed [[Phidget Control Panel]] memory leak when Bonjour in installed but not running&lt;br /&gt;
*Fixed current sense formula on 1061_0 v200&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetAdvancedServo&lt;br /&gt;
*Fixed bug in old PhidgetTemperatureSensor&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20110310===&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetServo&lt;br /&gt;
*Fixed some Labview bugs&lt;br /&gt;
*Added some Java and VB.NET examples&lt;br /&gt;
===2.1.8.20110301===&lt;br /&gt;
*Full Support for 1002, 1011, 1040, 1046, 1054, 1065, 1204&lt;br /&gt;
*New webservice version - 1.0.8&lt;br /&gt;
**Support for new devices&lt;br /&gt;
**Support for error events&lt;br /&gt;
===2.1.7.20110203===&lt;br /&gt;
*fixed crash on close of remote Phidget on MacOS&lt;br /&gt;
*C# ifkit example bugfix - crashed on 1015/1016&lt;br /&gt;
*webservice improvements&lt;br /&gt;
*Switch to IP address for SBC config in browser&lt;br /&gt;
*Faster IP lookup for SBCs in control panel&lt;br /&gt;
===2.1.7.20101222 / 2.1.7.20101223===&lt;br /&gt;
*fixed getServerID on Linux&lt;br /&gt;
*removed report ack&lt;br /&gt;
**this was causing some bad side effects&lt;br /&gt;
*manual .local lookups on Windows&lt;br /&gt;
**much faster then letting Windows do it itself&lt;br /&gt;
*Support for new Labview library&lt;br /&gt;
*Fixed PhidgetIR bug where library would crash if repeat code is longer then IR_MAX_REPEAT_LENGTH&lt;br /&gt;
===2.1.7.20101103===&lt;br /&gt;
*Decreased Phidget Webservice event latency on Windows&lt;br /&gt;
*Preliminary support for 1002, 1011, 1040, 1045, 1046, 1054, 1065, 1204 (C, .NET)&lt;br /&gt;
*Webservice version updated to 1.0.7&lt;br /&gt;
**support for 1045, 1011, 1204&lt;br /&gt;
*Fixed a bug where webservice connections could be unexpectedly lost&lt;br /&gt;
*Bugfix: couldn&#039;t set interfacekit data rate over webservice.&lt;br /&gt;
*Fixed some memory leaks in the Mac library&lt;br /&gt;
*Fixed bug where blocking for &amp;gt;2 seconds in an events handler when opening remotely could cause a crash.&lt;br /&gt;
===2.1.7.20100803===&lt;br /&gt;
*Windows only release&lt;br /&gt;
*fixed setLabel in WindowsCE&lt;br /&gt;
*fixed getHashCode in .NET library - needed for working with Phidgets in Labview via .NET&lt;br /&gt;
===2.1.7.20100621===&lt;br /&gt;
*Linux only release - autotools updates&lt;br /&gt;
**call ldconfig automatically&lt;br /&gt;
**remove old phidget21 library (pre-autotools) when installing new one.&lt;br /&gt;
===2.1.7.20100620===&lt;br /&gt;
*Linux only release - added version.sh for autoreconf&lt;br /&gt;
===2.1.7.20100618===&lt;br /&gt;
*Linux only release - added udev/hotplug files&lt;br /&gt;
===2.1.7.20100617===&lt;br /&gt;
*Linux only release&lt;br /&gt;
*Transitioned to autotools in linux for phidget21 / webservice&lt;br /&gt;
*phidget21 library and webservice are now separate downloads&lt;br /&gt;
===2.1.7.20100525===&lt;br /&gt;
*full support for PhidgetSpatial and PhidgetIR in all libraries&lt;br /&gt;
*fixed 1031 not attaching in AS3.0&lt;br /&gt;
*Better error messages in JNI&lt;br /&gt;
*Updated error codes, device ID/Class lists in Java, Flash, COM, etc.&lt;br /&gt;
*Fixed TemperatureSensor version 200,201,202 bug - ambient sensor would not report negative temperatures.&lt;br /&gt;
*Revised temperaturesensor API to report tempMin/tempMax and errors more accurately.&lt;br /&gt;
*Added initial events for encoder digital inputs&lt;br /&gt;
*full support for 1047&lt;br /&gt;
*Added new device support to WindowsCE&lt;br /&gt;
*Updated mac examples for 1047, 1048&lt;br /&gt;
===2.1.6.20100504===&lt;br /&gt;
*Windows only Release&lt;br /&gt;
**Added 1131 and 1132 to InterfaceKit example in MSI&lt;br /&gt;
===2.1.6.20100428===&lt;br /&gt;
*limit data rate maximum to 16ms over the webservice for devices that expose dataRate (InterfaceKit, Spatial)&lt;br /&gt;
*fixed bug where TextLCD 8/8/8 would stay in Bonjour list after webservice is shutdown&lt;br /&gt;
*set/get Brightness for 1203_2&lt;br /&gt;
*Support 1048 in C# example&lt;br /&gt;
*webservice version incremented to 1.0.6&lt;br /&gt;
**TextLCD set/get brightness&lt;br /&gt;
**PhidgetIR support&lt;br /&gt;
**PhidgetSpatial support&lt;br /&gt;
**1047 support (enable, index)&lt;br /&gt;
===2.1.6.20100406===&lt;br /&gt;
*Support for 1018_2 (dataRate)&lt;br /&gt;
*Webservice version incremented to 1.0.5&lt;br /&gt;
===2.1.6.20100401===&lt;br /&gt;
*Updated InterfaceKit example with new sensors&lt;br /&gt;
*make Windows connect cancelable&lt;br /&gt;
*make pending zeroconf lookups cancelable during close&lt;br /&gt;
===2.1.6.20100318===&lt;br /&gt;
*Mac only release&lt;br /&gt;
**Added WillSleep and Wakeup events to give user control of Phidgets immediately before and after a system sleep (MacOS Only).&lt;br /&gt;
===2.1.6.20100317===&lt;br /&gt;
*Windows only release&lt;br /&gt;
**Some of the examples were being built using an out of date .NET library&lt;br /&gt;
===2.1.6.20100310===&lt;br /&gt;
*MaxMSP fix - 2.1.6.20100126 introduced a bug for some Phidgets where openremote/open by serial didn&#039;t work and MaxMSP would sometimes crash.&lt;br /&gt;
**No code changes to any of the other libraries.&lt;br /&gt;
===2.1.6.20100304===&lt;br /&gt;
*stopped property changes trigger events over webservice so they are noticed.&lt;br /&gt;
**more compatible with how local open works&lt;br /&gt;
*added 5 new servos&lt;br /&gt;
*fixed bug where remote close would not set detached so a subsequent open would not always connect.&lt;br /&gt;
*handle UninitializeZeroconf better - shut down thread before closing handles, fixes hang on SBC&lt;br /&gt;
*fixed bug on Mac where detaching 2 or more Phidgets at the same time caused a crash&lt;br /&gt;
*fixed close blocking because of a pending connect (mac, linux)&lt;br /&gt;
*Final support for 1031 in all libraries.&lt;br /&gt;
===2.1.6.20100129===&lt;br /&gt;
*Implemented initial events in Flash&lt;br /&gt;
**Flash behaviour should now be identical to C library local and remote.&lt;br /&gt;
*Fix RFID issue where close could cause crash&lt;br /&gt;
*increment webservice version to 1.0.4&lt;br /&gt;
*fixed RFID remote open&lt;br /&gt;
**Flash would never get an attach event if the reader had been previously opened&lt;br /&gt;
**Initial tag event would not be fired when a tag was present and the antenna was enabled prior to open&lt;br /&gt;
*fixed openRemote failing on Mac&lt;br /&gt;
*fixed deadlock in webservice which could be hit by opening/closing a device over and over again.&lt;br /&gt;
*fixed bug in stepper, which caused seg fault on SBC on position change events.&lt;br /&gt;
===2.1.6.20100126===&lt;br /&gt;
*added network open support in Max/MSP&lt;br /&gt;
===2.1.6.20100115===&lt;br /&gt;
*Increased network performance for Linux/MacOS&lt;br /&gt;
*Added five servo types&lt;br /&gt;
===2.1.6.20091215===&lt;br /&gt;
*Fixed busy loop in Linux openRemote&lt;br /&gt;
*JNI Library relocated to /Library/Java/Extensions on MacOS&lt;br /&gt;
===2.1.6.20091211===&lt;br /&gt;
*Heartbeat now works on Linux as well (had to make sockets non-blocking)&lt;br /&gt;
===2.1.6.20091130===&lt;br /&gt;
*Added heartbeat to webservice (client side)&lt;br /&gt;
**Better detects network failures by using active polling timeouts&lt;br /&gt;
*Fixed 0/8/8 over webservice&lt;br /&gt;
===2.1.6.20091020===&lt;br /&gt;
*Fixed 1052 counting issue on 1070 (-1 reported as 255)&lt;br /&gt;
*Fixed issue where Phidget21 would try to reinstall from a limited user account or when the Control Panel was disabled.&lt;br /&gt;
*64-bit kernel support in Snow Leopard&lt;br /&gt;
===2.1.6.20090928===&lt;br /&gt;
*Support for PhidgetSBC (1070)&lt;br /&gt;
*zeroconf can handle starting up before the mdns daemon, and will keep trying to connect.&lt;br /&gt;
*fixed 1066 not showing up on Mac&lt;br /&gt;
*added advanced servo example to mac pref pane&lt;br /&gt;
*implemented proper error handling in COM&lt;br /&gt;
**default behavious remains the same, enable proper error handling with &#039;EnableVerboseErrors&#039;&lt;br /&gt;
*implemented error events in Java&lt;br /&gt;
===2.1.6.20090917===&lt;br /&gt;
*Updated webservice protocol version to 1.0.3&lt;br /&gt;
*Fixed stepper under AS3.0&lt;br /&gt;
*added setServoType, getServoType, setServoParameters to PhidgetServo and PhidgetAdvancedServo&lt;br /&gt;
*possible race condition fixed in webservice (pdictclient.c:907)&lt;br /&gt;
===2.1.6.20090902 (mac only release)===&lt;br /&gt;
*Support MacOSX 10.6, drop support for 10.3.9, require 10.4 or newer&lt;br /&gt;
**Fully 64-bit compliant, library supports ppc, i386, x86_64&lt;br /&gt;
===2.1.6.20090806===&lt;br /&gt;
*Added 1049 support&lt;br /&gt;
*Fixed RFID tag events over webservice&lt;br /&gt;
===2.1.6.20090804===&lt;br /&gt;
*Added 1051_2 support&lt;br /&gt;
*Fixed various small initialization issues - stepper, adv servo, rfid&lt;br /&gt;
*Added 32-bit library install to 64-bit installer&lt;br /&gt;
**VB6.0, etc. need the 32-bit COM library on 64-bit windows&lt;br /&gt;
===2.1.6.20090717===&lt;br /&gt;
*?&lt;br /&gt;
===2.1.6.20090708===&lt;br /&gt;
*Added DeviceID to zeroconf&lt;br /&gt;
*fixed RFID.LastTag in .NET&lt;br /&gt;
*Changed the error codes returned by error events; error events now have their own set of error codes rather then sharing the function return codes.&lt;br /&gt;
*Added support for 1047, 1048&lt;br /&gt;
*Added error event codes rather then trying to reuse the EPHIDGET return codes.&lt;br /&gt;
*fixed TextLCD issue where display could get corrupted during a detach/attach&lt;br /&gt;
*made mac more reliable on attach&lt;br /&gt;
*more error logging on mac&lt;br /&gt;
===2.1.6.20090525===&lt;br /&gt;
*fixed RFID not attaching via webservice if a tag is present.&lt;br /&gt;
*bugfix related to double free on detach event.&lt;br /&gt;
*Implemented getKey&lt;br /&gt;
*Added MIPS II support to Windows CE&lt;br /&gt;
===2.1.6.20090430===&lt;br /&gt;
*Added ActiveX interface to COM library&lt;br /&gt;
*Added stepper and advancedServo to Flex .swc library&lt;br /&gt;
===2.1.6.20090417===&lt;br /&gt;
*added PhidgetIR prototype support to C library&lt;br /&gt;
*properly handles sleeping on OSX&lt;br /&gt;
*fixed some webservice field initializations in Flash and C&lt;br /&gt;
*fixed security exceptions in [[Phidget Control Panel]] under Vista&lt;br /&gt;
*added [[Phidget Control Panel]] to start menu&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090318 (Examples/AS3.0 only release)===&lt;br /&gt;
*Fixed AdvancedServo in Flash - wouldn&#039;t attach&lt;br /&gt;
===2.1.6.20090317===&lt;br /&gt;
*[[Phidget Control Panel]] properly supports Vista UAC and Limited user accounts in XP, etc.&lt;br /&gt;
*Added 64-bit release of Phidget21.msi for Windows&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090312===&lt;br /&gt;
*added 1064, 1059 to WindowsCE&lt;br /&gt;
*fixed opening 1051 over webservice&lt;br /&gt;
*fixed opening 1015/1016 over webservice broken in last release&lt;br /&gt;
===2.1.6.20090302===&lt;br /&gt;
*Advanced servo bugfix: stopped would stop being true if min/max was set to exclude current position.&lt;br /&gt;
*linux USB improvements when many Phidgets are attached and opened at once.&lt;br /&gt;
*1031 support in phidget21, webservice, .NET - hidden until product release&lt;br /&gt;
**CPhidgetLED_setVoltage&lt;br /&gt;
**CPhidgetLED_getVoltage&lt;br /&gt;
**CPhidgetLED_setCurrentLimit&lt;br /&gt;
**CPhidgetLED_getCurrentLimit&lt;br /&gt;
*unknown timechange == PUNK_INT in encoder position change event&lt;br /&gt;
**1st position change event&lt;br /&gt;
**&amp;gt; 30 seconds time change&lt;br /&gt;
*AS3 updates&lt;br /&gt;
**updated to 1.0.2 webservice&lt;br /&gt;
**encoder position change events report relative change rather then absolute position&lt;br /&gt;
**encoder adds getTimeChange function for timing encoder changes&lt;br /&gt;
*webservice updated to 1.0.2&lt;br /&gt;
**Authorization is asynchronous&lt;br /&gt;
**Doesn&#039;t match the old version checking, so errors will not be nice when trying to connect to an old webservice&lt;br /&gt;
**Sends out all initial data, so it&#039;s just like opening locally&lt;br /&gt;
**supports interfacekit Raw sensor value&lt;br /&gt;
**supports labels on remoteIP managers&lt;br /&gt;
*avahi bugfix&lt;br /&gt;
*webservice more stable against forcefully closed clients&lt;br /&gt;
*closing a network Phidget won&#039;t block - ever.&lt;br /&gt;
**no longer using quit, just closing the socket&lt;br /&gt;
*added libavahi-client.so.3 reference to linux library.&lt;br /&gt;
*Fixed bug with opening one phidget with serial and no serial at the same time over the webservice&lt;br /&gt;
===2.1.5.20090105===&lt;br /&gt;
*[[Phidget Control Panel]] stability improvements&lt;br /&gt;
*added CPhidgetSBC_getHostname&lt;br /&gt;
*advanced servo 1 motor current sense equation - support should now be complete&lt;br /&gt;
*webservice and network code bugfixes - crash / deadlock during close, problems with concurrent connections, etc.&lt;br /&gt;
*fixed close on remote and remoteIP managers&lt;br /&gt;
*name of RFID changed from &amp;quot;Phidget RFID 4-output&amp;quot; to &amp;quot;Phidget RFID 2-output&amp;quot; - updated anything referencing old name.&lt;br /&gt;
&lt;br /&gt;
===2.1.5.20081023===&lt;br /&gt;
*added advanced servo and stepper examples to VB6.0, VB.NET and C&lt;br /&gt;
*added deviceClass and deviceID&lt;br /&gt;
*updated Mac examples&lt;br /&gt;
*webservice protocol version enforcement&lt;br /&gt;
*internal fix/rework of device id&#039;s etc.&lt;br /&gt;
*Fixed memory leaks in webservice and phidget21 network code.&lt;br /&gt;
*Dictionary and network stability improvements.&lt;br /&gt;
*duplicate calls to open or close are now silently ignored.&lt;br /&gt;
===2.1.4.20080924===&lt;br /&gt;
*Old TextLCD 0/8/8&#039;s can now have both halves open at the same time on Windows&lt;br /&gt;
*fixed bug with composite devices on linux&lt;br /&gt;
*fixed manager on linux to better deal with unique devices&lt;br /&gt;
===2.1.4.20080922===&lt;br /&gt;
*Updated Delphi files&lt;br /&gt;
*TextLCD can display 0x80-0xFF characters from Java&lt;br /&gt;
*getAttachedDevices works for mdns managers&lt;br /&gt;
*fixed a deadlock in the webservice&lt;br /&gt;
*better network error handling / password support for windows C# examples&lt;br /&gt;
*waitForAttachment will return EPHIDGET_CLOSED if the handle is closed while it is waiting.&lt;br /&gt;
*added EPHIDGET_CLOSED&lt;br /&gt;
*joining central threads checks whether they are trying to be joined by themselves first (avoid deadlocks).&lt;br /&gt;
*changed context of error event to be free from locks (can call close, open, etc. from them).&lt;br /&gt;
===2.1.4.20080821===&lt;br /&gt;
*zeroconf threads exit cleanly on last _close (apple zeroconf)&lt;br /&gt;
*Added advanced servo and stepper to Max&lt;br /&gt;
===2.1.4.20080811 (mac only release)===&lt;br /&gt;
*Fixed manager on Mac (wasn&#039;t working at all since 2.1.4.20080808)&lt;br /&gt;
===2.1.4.20080808===&lt;br /&gt;
*added CPhidgetSBC and CPhidgetSBCManager to the c library - these interfaces are hidden from users and meant to be used internally (for now).&lt;br /&gt;
*CPhidgetManager_open no longer blocks to send out initial attach events. These initial events are sent from the CentralThread context like all other attach events.&lt;br /&gt;
*fixed CThread_wait_on_event on Linux&lt;br /&gt;
*added CPhidgetGeneric interface for prototyping to C, .NET libraries. product ID is 0x99. These are only visible in debug releases, only to be used internally.&lt;br /&gt;
===2.1.4.20080715===&lt;br /&gt;
*udev rules fixed for product IDs with alpha-hex values&lt;br /&gt;
*blocking in an attach event does not block calls to open anymore&lt;br /&gt;
*RFID tag event handlers can now handle blocking - tag lost is timed after the tag handler exits.&lt;br /&gt;
===2.1.4.20080623===&lt;br /&gt;
*Flex .swc library was out of sync&lt;br /&gt;
*fixed CPhidgetManager_getAttachedDevices for network managers&lt;br /&gt;
*Added CPhidgetManager_freeAttachedDevicesArray&lt;br /&gt;
===2.1.4.20080613===&lt;br /&gt;
*Max/MSP RFID fixed&lt;br /&gt;
*0/0/8 and advanced servo added to CE&lt;br /&gt;
*fixed flash policy file server in webservice&lt;br /&gt;
*webservice with password and asynchronous together work now&lt;br /&gt;
===2.1.4.20080602===&lt;br /&gt;
*phidget21.h -&amp;gt; phidget21int.h so as not to be confused with generated phidget21.h&lt;br /&gt;
*some changes to Makefile fro crosscompiling&lt;br /&gt;
*no more vbscript in msi&lt;br /&gt;
===2.1.4.20080513===&lt;br /&gt;
*removed long long from COM - not supported by VB6.0&lt;br /&gt;
*added LastTag to RFID in .NET&lt;br /&gt;
===2.1.4.20080428===&lt;br /&gt;
*support Mac OS X 10.3.9 again&lt;br /&gt;
*Rev up to 2.1.4&lt;br /&gt;
*finalize Phidget Stepper API - Phidget Stepper requires 2.1.4 as a minimum&lt;br /&gt;
*fixed serverConnect and serverDisconnect handlers for manager and dictionary in COM&lt;br /&gt;
*Changed:&lt;br /&gt;
**PhidgetStepper and PhidgetAdvancedServo&lt;br /&gt;
***MotorPosition -&amp;gt; Position&lt;br /&gt;
***MotorOn -&amp;gt; Engaged&lt;br /&gt;
***MotorStopped -&amp;gt; Stopped&lt;br /&gt;
*Added:&lt;br /&gt;
**CPhidgetStepper_getCurrentLimit&lt;br /&gt;
**CPhidgetEncoder_getPosition&lt;br /&gt;
**CPhidgetEncoder_setPosition&lt;br /&gt;
**CPhidgetMotorControl_getVelocity&lt;br /&gt;
**CPhidgetMotorControl_setVelocity&lt;br /&gt;
**CPhidgetMotorControl_set_OnVelocityChange_Handler&lt;br /&gt;
**CPhidgetServo_setEngaged&lt;br /&gt;
**CPhidgetServo_getEngaged&lt;br /&gt;
**CPhidgetServo_getPosition&lt;br /&gt;
**CPhidgetServo_setPosition&lt;br /&gt;
**CPhidgetServo_set_OnPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getPositionMax&lt;br /&gt;
**CPhidgetServo_getPositionMin&lt;br /&gt;
**Count functions&lt;br /&gt;
*Deprecated:&lt;br /&gt;
**CPhidgetEncoder_getEncoderPosition&lt;br /&gt;
**CPhidgetEncoder_setEncoderPosition&lt;br /&gt;
**CPhidgetMotorControl_getMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_setMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_set_OnMotorChange_Handler&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorPosition&lt;br /&gt;
**CPhidgetServo_setMotorPosition&lt;br /&gt;
**CPhidgetServo_set_OnMotorPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**Num functions&lt;br /&gt;
*Added ability to deprecate funcitons in the C library - compiler will issue a warning when they are used.&lt;br /&gt;
*added names to some arguments in phidget21.h&lt;br /&gt;
*fixes to the webservice for initial state stuff - now it behaves almost like non-webservice, with guaranteed initial events, but we don&#039;t guarantee initial state in the attach event yet. Min/Max, Num motors, inputs, etc. are all guaranteed in the attach handler.&lt;br /&gt;
*Finalized support for Phidget Stepper&lt;br /&gt;
===2.1.3.20080402===&lt;br /&gt;
*Fixed windows BUG - Device Type was showing up wrong&lt;br /&gt;
*CPhidgetStepper_getPosition -&amp;gt; CPhidgetStepper_getCurrentPosition&lt;br /&gt;
===2.1.3.20080327===&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorStopped&lt;br /&gt;
*changes to API&lt;br /&gt;
**CPhidgetStepper_setMotorPosition -&amp;gt; CPhidgetStepper_setTargetMotorPosition&lt;br /&gt;
**added CPhidgetStepper_getTargetMotorPosition&lt;br /&gt;
**Stepper MotorSpeed -&amp;gt; Velocity&lt;br /&gt;
**Stepper and AdvancedServo MaxVelocity -&amp;gt; VelocityLimit&lt;br /&gt;
*add waitForAttachment to COM&lt;br /&gt;
*COM getbool (not indexed) will now return FALSE on false (rather then always returning true)&lt;br /&gt;
*fixed write thread timeouts - was setting attached after starting write thread so write thread would see a detached device and exit immediately&lt;br /&gt;
===2.1.3.20080206===&lt;br /&gt;
*changed long long to __int64, to be happy in borland C++&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetStepper_getMaxMotorSpeed&lt;br /&gt;
**CPhidgetStepper_setMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorStopped&lt;br /&gt;
**CPhidgetStepper_setCurrentMotorPosition&lt;br /&gt;
*removed CPhidgetStepper_setVelocity&lt;br /&gt;
*added CPhidgetStepper_setMaxVelocity, CPhidgetStepper_getMaxVelocity&lt;br /&gt;
===2.1.3.20080114===&lt;br /&gt;
*Added new functions to Flash API&lt;br /&gt;
*Added new functions to Webservice Protocol&lt;br /&gt;
*Added new functions to COM Library&lt;br /&gt;
*Added new functions to Java Library&lt;br /&gt;
*All device fiels in C library cleaned up and made consistent&lt;br /&gt;
*Open in windows is exclusive - this needs to be tested for stability&lt;br /&gt;
*No data will be returned / accepted if it lies outside of max/min range&lt;br /&gt;
*if a data value is unknown, user variable is set to PUNK_INT, PUNK_DBL, or PUNK_BOOL, and return value is EPHIDGET_UNKNOWNVAL&lt;br /&gt;
*Proper Device initializations on Attach:&lt;br /&gt;
**triggers are set to defaults on attach&lt;br /&gt;
**device state is read in and preserved on attach&lt;br /&gt;
**during attach event, all sensor data, etc. is provided if available&lt;br /&gt;
**no data events until after the attach event returns&lt;br /&gt;
**everything initialized by the time waitForAttachment returns&lt;br /&gt;
**after attach event returns, a full set of initial state data events are thrown&lt;br /&gt;
*.NET collections are readonly, and never NULL (but empty when phidget detached)&lt;br /&gt;
*.NET callbacks no longer catch and hide all exceptions&lt;br /&gt;
**make sure to use try/catch blocks especially in Attach when accessing properties that may not be initialized.&lt;br /&gt;
*added min/max functions:&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMax&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMax&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMax&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMax&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMin&lt;br /&gt;
**CPhidgetPHSensor_getPHMax&lt;br /&gt;
**CPhidgetPHSensor_getPHMin&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMax&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMin&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetStepper_getAccelerationMax&lt;br /&gt;
**CPhidgetStepper_getAccelerationMin&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMax&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMin&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMax&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMin&lt;br /&gt;
*Added functions:&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperature&lt;br /&gt;
**CPhidgetTemperatureSensor_getThermocoupleType&lt;br /&gt;
**CPhidgetTemperatureSensor_setThermocoupleType&lt;br /&gt;
**CPhidget_set_OnServerConnectHandler&lt;br /&gt;
**CPhidget_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_getServerID&lt;br /&gt;
**CPhidgetDictionary_getServerAddress&lt;br /&gt;
**CPhidgetDictionary_getServerStatus&lt;br /&gt;
**CPhidgetManager_getServerID&lt;br /&gt;
**CPhidgetManager_getServerAddress&lt;br /&gt;
**CPhidgetManager_getServerStatus&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
*Removed functions:&lt;br /&gt;
**CPhidgetServo_setMotorOff&lt;br /&gt;
*TemperatureSensor:&lt;br /&gt;
**Ambient sensor is accessed with it&#039;s own function&lt;br /&gt;
**first thermocouple is Index 0 everywhere&lt;br /&gt;
**no ambient sensor events&lt;br /&gt;
*getServerID is implemented&lt;br /&gt;
*changed the internal network structure (added CPhidgetRemote)&lt;br /&gt;
*reworked the USB code (mostly on Windows)&lt;br /&gt;
**Better handles closing, ESD events, timeouts&lt;br /&gt;
**fixed issues with Encoder, RFID stopping reading after a certain time.&lt;br /&gt;
**added USB error flag&lt;br /&gt;
*openRemote functions have been implemented&lt;br /&gt;
**these require bonjour (mac / windows) or avahi (linux) to be installed on both the client and server&lt;br /&gt;
**if they are not, you get EPHIDGET_UNSUPPORTED when you call them&lt;br /&gt;
*openRemoteIP functions are asynchronous and persistent&lt;br /&gt;
*include cphidgetconstants.h in phidget21.h for users&lt;br /&gt;
===2.1.2.20071108===&lt;br /&gt;
*start of chagelog&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=23979</id>
		<title>Driver Changelog</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=23979"/>
		<updated>2017-12-15T22:09:47Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Administrative]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20171215===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where opening two of the same device with -1 serial could cause missed attach/detach events and other errors.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160921===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where devices plugged in before boot were inaccessible until unplugged/re-plugged, under OS X 10.11. &lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160202===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Labview 7.1 support&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160107===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Don&#039;t throw an exception on EncoderPositionChangeEventArgs.Time in the .Net library when time it unknown - just return 0x7fffffff&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160104===&lt;br /&gt;
*Mac/Windows release&lt;br /&gt;
**New firmware for 1042 and 1044, fixing digital gyro&lt;br /&gt;
===2.1.8.20151217===&lt;br /&gt;
*Fixed 1045 bug where it will display an unknown ambient temperature sometimes&lt;br /&gt;
*Fixed a crash in the windows control panel&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151020===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Fixed an issue where the examples would error when trying to run them from the control panel.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151009===&lt;br /&gt;
*OS X and Windows release&lt;br /&gt;
**Upgraded firmware for 1024, 1032, 1041, 1042, 1043, 1044 and 1067 to address issues with these Phidgets on OS X El Capitan&lt;br /&gt;
*SBC release&lt;br /&gt;
**Support for multiple webcams &lt;br /&gt;
===2.1.8.20150821===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Support OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150805===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Preliminary support for OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150410===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed Makefile phidget21.h target issues&lt;br /&gt;
===2.1.8.20150326===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed issue with webservice buttons not being visible in the control panel&lt;br /&gt;
===2.1.8.20150323===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Updated icons with new company logo&lt;br /&gt;
===2.1.8.20150227===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Added copyright/licence headers to source code files&lt;br /&gt;
**Updated cvtutf files to a newer version&lt;br /&gt;
===2.1.8.20150109===&lt;br /&gt;
*Windows-only&lt;br /&gt;
**Fixed examples for Labview 8.5&lt;br /&gt;
===2.1.8.20141209===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Added support for armv7s and arm64 to the iOS library. Dropped support for armv6. Requires iOS 5.1.1 or later.&lt;br /&gt;
===2.1.8.20141202===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Labview release to support older versions&lt;br /&gt;
===2.1.8.20141119===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed an issue with the 2.1.8.20141117 release where nothing was actually installed.&lt;br /&gt;
===2.1.8.20141117===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed a code-signing issue that make the installer appear unsigned on OS X 10.10&lt;br /&gt;
**Dropped support for OS X 10.4&lt;br /&gt;
===2.1.8.20140905===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added an IA32 folder to the windows libraries download - this supports Windows on the Intel Galileo platform&lt;br /&gt;
===2.1.8.20140428===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to C# Stepper GUI Example&lt;br /&gt;
===2.1.8.20140319===&lt;br /&gt;
*CPhidget_getDeviceClass can now be called on handle before it is attached.&lt;br /&gt;
*Added support for 64-bit Max/MSP (Version 6.1+) on both OS X and Windows.&lt;br /&gt;
===2.1.8.20140227===&lt;br /&gt;
*Deals with 1046 bug in v100 and v101 firmware.&lt;br /&gt;
**No longer reports bad values that appear right after a channel is enabled.&lt;br /&gt;
**Fixes issue where changing the gain while channel 0 is disabled would sometimes cause bad readings.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20131105===&lt;br /&gt;
* Fixed a defect in the Flash examples for the 1012 (Outputs 11-16 were not addressed properly).&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20130926===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support setting label on 1067 from Windows&lt;br /&gt;
===2.1.8.20130820===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added logging option to control panel / C# full examples&lt;br /&gt;
===2.1.8.20130802===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fix for Windows 8 issue where only &#039;Uninitialized Phidget Handle&#039; would show up in the Manager, and Phidgets could not be opened.&lt;br /&gt;
===2.1.8.20130723===&lt;br /&gt;
*Improvement to java: we don&#039;t attach/detach our native threads for each event, just one attach, then detach before the thread exits.&lt;br /&gt;
**This increases performance, esp. when debugging on Android.&lt;br /&gt;
*Improvement to Android: We reuse the UsbRequest object rather then creating a new one for each transfer. This reduces logcat messages tremendously, and increases performance.&lt;br /&gt;
===2.1.8.20130710===&lt;br /&gt;
*Android-only release&lt;br /&gt;
**Added extra android target architectures: x86, MIPS, armeabi-v7a&lt;br /&gt;
===2.1.8.20130618===&lt;br /&gt;
*Changed setCompassCorrectionParameters() API call so that compass calibration parameters are written out to non-volatile storage on 1042/1044, so that they persist across power cycles. Previously, calibration data would need to be re-programmed at each attach.&lt;br /&gt;
*Changes to C# Spatial example:&lt;br /&gt;
**Compass calibration parameter set dialog removed from for 1042/1044 because parameters are set by the calibration software - and thus do not need setting in the example.&lt;br /&gt;
**Stores/restores parameters for 1056 based on serial number, so multiple different calibrations can be maintained.&lt;br /&gt;
===2.1.8.20130607===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to compass calibration software for 1042/1044&lt;br /&gt;
===2.1.8.20130419===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed setCompassCorrectionParameters in the COM library&lt;br /&gt;
===2.1.8.20130327===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Changed Windows installer to stop virus-scanner false positives&lt;br /&gt;
**Dropped support for Windows 2000&lt;br /&gt;
===2.1.8.20130320===&lt;br /&gt;
*Added EPHIDGET_NOTFOUND exception to Dictionary.getKey() for when the key is not found.&lt;br /&gt;
*Added exceptions back into the Java library - they have been missing since 2.1.8.20121015 release.&lt;br /&gt;
===2.1.8.20130313===&lt;br /&gt;
*Updates to Matlab support&lt;br /&gt;
**Works properly on Matlab 7+, on Windows, Mac, Linux without needing changes to .m files.&lt;br /&gt;
===2.1.8.20130221===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Encoder Index event added to C and .NET libraries&lt;br /&gt;
===2.1.8.20121218===&lt;br /&gt;
*Webservice version: 1.0.10&lt;br /&gt;
**Support for 1024, 1032&lt;br /&gt;
*Support for 1024, 1032&lt;br /&gt;
*fixed bug where if one half of a composite device is open, and PHIDGET_USB_ERROR_FLAG gets set, the device may never re-attach.&lt;br /&gt;
===2.1.8.20121015===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support for new pressure/light sensors in example.&lt;br /&gt;
===2.1.8.20120914===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Improved firmware upgrading in control panel - it was giving some false-errors on some machines.&lt;br /&gt;
===2.1.8.20120912===&lt;br /&gt;
*Fixed bug where 1065 could fail to attach when opened over webservice&lt;br /&gt;
*Fixed bug where close() could deadlock on Phidgets opened over the webservice&lt;br /&gt;
*Changed LED64 LED Brightness from int to double&lt;br /&gt;
**this may cause issues when controlling the LED64 over the webservice and library/webservice are not the same version&lt;br /&gt;
**the old setDiscreteLED call will remain, deprecated, with an int argument for compatibility.&lt;br /&gt;
===2.1.8.20120716===&lt;br /&gt;
*Linux-Only Release&lt;br /&gt;
**Fixed a bug where opening a device in two program at once would cause an attach-detach cycle as they fight each other for control.&lt;br /&gt;
===2.1.8.20120713===&lt;br /&gt;
*Mac-Only Release&lt;br /&gt;
**Added signing of the Mac installer, so Mountain Lion (OS X 10.8) doesn&#039;t refuse to run it.&lt;br /&gt;
===2.1.8.20120615===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that caused java to crash on events introduced in 2.1.8.20120612&lt;br /&gt;
===2.1.8.20120612===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed another bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120606===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120525===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed PhidgetIR sendRawData bug in .NET on 64-bit machines.&lt;br /&gt;
===2.1.8.20120514===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed a bug that causes a segfault with libusb-1.0 under 64-bit Linux.&lt;br /&gt;
===2.1.8.20120507===&lt;br /&gt;
*Mac/Linux-only release&lt;br /&gt;
**Fixes a setLabel bug introduced in 2.1.8.20120503&lt;br /&gt;
===2.1.8.20120503===&lt;br /&gt;
*Fixed some spelling mistakes&lt;br /&gt;
*Moved to libusb-1.0&lt;br /&gt;
**This resolves a bug where having a webcam plugged in caused a memory leak in the webservice.&lt;br /&gt;
*Fixed bug with advanced servo where setting acceleration to accelerationMax would cause an exception for some servo types&lt;br /&gt;
===2.1.8.20120216===&lt;br /&gt;
*Fixed bug with RFID Reader on OS X and Linux, as well as .NET over the webservice&lt;br /&gt;
*Fixed bug that could cause the Java Phidget Manager to crash during garbage collection.&lt;br /&gt;
===2.1.8.20120131===&lt;br /&gt;
*Fixed RFID Reader bug that caused tag event to not get thrown in .NET Applications&lt;br /&gt;
*Changed compass bearing calculations in spatial C# example&lt;br /&gt;
===2.1.8.20120123===&lt;br /&gt;
*Added support for 1061 v300+&lt;br /&gt;
*Fixed a bug where the firmware version could be mis-reported over Bonjour&lt;br /&gt;
===2.1.8.20111220===&lt;br /&gt;
*Fixed a bug in AppleScript where closing a Phidget opened via label would give a &#039;Connection Invalid&#039; error.&lt;br /&gt;
*Fixed a bug where the webservice may fail to start on Linux systems that don&#039;t support IPv6 (ie. SBC2).&lt;br /&gt;
*Fixed issue where ratiometric state on newest interfacekit wouldn&#039;t be read back properly if it was false during attach.&lt;br /&gt;
*Fixed webservice issue where ratiometric state would not be reported properly for newest interfacekits&lt;br /&gt;
*Increased the number of overrun errors ignored during initial attach for InterfaceKit.&lt;br /&gt;
*Fixed an issue with the iPhone library and header&lt;br /&gt;
===2.1.8.20111219===&lt;br /&gt;
*fixed various other webservice stability/performance/memory leak bugs&lt;br /&gt;
*Faster connection to SBC-connected Phidgets from Mac OS&lt;br /&gt;
*Don&#039;t report packetlost or overrun errors that happen during early initialization - these are just noise.&lt;br /&gt;
*Fixed a bug in the webservice tree removal function that could cause memory leaks.&lt;br /&gt;
*Fixed bug where Webservice would crash on Linux if the chosen serverID was already under use on the network&lt;br /&gt;
*Stopped sending hardware Error Events before the Attach event - they are now queued up and sent after Attach&lt;br /&gt;
*Fixed a crash in the [[Phidget Control Panel]]&lt;br /&gt;
*Added ability to remove dictionary keys from a key change listener&lt;br /&gt;
*Reduced the number of false &#039;pending command not finished&#039; error events on Close()&lt;br /&gt;
*Fixed a webservice bug where exceptions/false attach events could occur when close() is called soon after open&lt;br /&gt;
*Fixed bug where closing a PhidgetRFID soon after attach could cause a crash&lt;br /&gt;
*Fixed webservice but on MacOS where client could exit with SIG_PIPE error&lt;br /&gt;
*Fixed webservice bug where the server would sometimes exit(1) after many connect/disconnect cycles&lt;br /&gt;
*Fixed webservice bug where client could deadlock during close()&lt;br /&gt;
*Fixed webservice bug where opening a single remote phidget multiple times from the same application would fail&lt;br /&gt;
*Fixed a webservice bug where sockets weren&#039;t being closed properly sometimes&lt;br /&gt;
*Fixed a webservice bug where pre-attach error events wouldn&#039;t get through&lt;br /&gt;
*Fixed a bug where the webservice running on Linux would stop responding to clients after ~300 connect/disconnect cycles&lt;br /&gt;
*Fixed bug where a Phidget would become inaccessible until the app is restarted if a thread creation failed&lt;br /&gt;
*Fixed webservice bug where connect is slow on Windows when multiple clients are running simultaneously&lt;br /&gt;
*Fixed webservice bug where authentication would fail on a valid password&lt;br /&gt;
*Fixed webservice bug where attach may never happen, and would require a close()/open()&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20111121===&lt;br /&gt;
*Added support for new servo types to all libraries&lt;br /&gt;
*Fixed min/max position/velocity causing invalid arg exception on servo/advservo&lt;br /&gt;
*IPv6 support on MacOS&lt;br /&gt;
*Fixed some memory leaks&lt;br /&gt;
*Fixed hostname lookup issue on Mac OS with Back To My Mac enabled.&lt;br /&gt;
===2.1.8.20111028===&lt;br /&gt;
*Fixed Applescript bugs and released examples&lt;br /&gt;
*Added openLabel to .NET, Java, COM&lt;br /&gt;
*Setting change trigger to 0 on interfacekit will not set event mode.&lt;br /&gt;
**Previously setting change trigger to 0 after setting data rate would supersede the data rate setting, which is probably unexpected.&lt;br /&gt;
===2.1.8.20110630 - MacOS Only===&lt;br /&gt;
*handle USB bug introduced in MacOS 10.6.8&lt;br /&gt;
===2.1.8.20110615===&lt;br /&gt;
*Added error event when trying to open Phidgets with an unsupported version&lt;br /&gt;
===2.1.8.20110614 - Windows Only===&lt;br /&gt;
*Fixed bug in C# Spatial example&lt;br /&gt;
*Added support for negative gains in 1056&lt;br /&gt;
===2.1.8.20110601 - MacOS Only===&lt;br /&gt;
*Fixed AppleScript issues&lt;br /&gt;
===2.1.8.20110527===&lt;br /&gt;
*Fixed AS3.0 library (Flash/Flex) - wouldn&#039;t connect to webservice as of last release&lt;br /&gt;
*Fixed bug where webservice doesn&#039;t release a closed Phidget&lt;br /&gt;
*Fixed bug where devices that don&#039;t support label didn&#039;t show up on MacOS&lt;br /&gt;
*Fixed iPhone library issues&lt;br /&gt;
===2.1.8.20110524===&lt;br /&gt;
*AppleScript support added&lt;br /&gt;
*fixed problem with Spatial in .NET on 64-bit Windows&lt;br /&gt;
*Added remote setLabel to mac preference pane.&lt;br /&gt;
*fixed a bug where label characters 7,8,9 would be read back corrupted on certain devices.&lt;br /&gt;
**labels &amp;gt;7 characters that exhibit this bug will now be truncated to 7 characters when being read back&lt;br /&gt;
**call setLabel again using this library or newer to support 10 character labels.&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to &amp;lt;=7 characters on these devices.&lt;br /&gt;
*fixed bug on MacOS where serial number and/or label strings could be read wrong.&lt;br /&gt;
*better support for recovering misbehaving devices in Linux&lt;br /&gt;
*fixed a deadlock on linux when Avahi is installed but not running&lt;br /&gt;
*clear list of attached devices when closing remote manager&lt;br /&gt;
*Added support for Unicode labels&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to ASCII.&lt;br /&gt;
*Added open by label&lt;br /&gt;
*Webservice protocol version up to 1.0.9 (for open by label)&lt;br /&gt;
*Made opening multiple device is one application faster.&lt;br /&gt;
*TextLCD changes:&lt;br /&gt;
**cursor is disabled while writing to the display or setting a custom character to prevent display artifacts&lt;br /&gt;
**cursor is disabled when a full line is written so it doesn&#039;t go to the start of another line&lt;br /&gt;
**1204 should be stable&lt;br /&gt;
**setDisplayCharacter supports 0x00-0xff&lt;br /&gt;
*stopped property reflected more accurately in the C# stepper example&lt;br /&gt;
*Added error events to mac examples&lt;br /&gt;
===2.1.8.20110329 - Windows only===&lt;br /&gt;
*Fixed problem with control panel encoder example where enable wouldn&#039;t work&lt;br /&gt;
*Fixed issue with SpatialData, GPSPositionChange, PHChange and WeightChange events in Labview 64-bit&lt;br /&gt;
===2.1.8.20110322===&lt;br /&gt;
*Fixed [[Phidget Control Panel]] memory leak when Bonjour in installed but not running&lt;br /&gt;
*Fixed current sense formula on 1061_0 v200&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetAdvancedServo&lt;br /&gt;
*Fixed bug in old PhidgetTemperatureSensor&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20110310===&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetServo&lt;br /&gt;
*Fixed some Labview bugs&lt;br /&gt;
*Added some Java and VB.NET examples&lt;br /&gt;
===2.1.8.20110301===&lt;br /&gt;
*Full Support for 1002, 1011, 1040, 1046, 1054, 1065, 1204&lt;br /&gt;
*New webservice version - 1.0.8&lt;br /&gt;
**Support for new devices&lt;br /&gt;
**Support for error events&lt;br /&gt;
===2.1.7.20110203===&lt;br /&gt;
*fixed crash on close of remote Phidget on MacOS&lt;br /&gt;
*C# ifkit example bugfix - crashed on 1015/1016&lt;br /&gt;
*webservice improvements&lt;br /&gt;
*Switch to IP address for SBC config in browser&lt;br /&gt;
*Faster IP lookup for SBCs in control panel&lt;br /&gt;
===2.1.7.20101222 / 2.1.7.20101223===&lt;br /&gt;
*fixed getServerID on Linux&lt;br /&gt;
*removed report ack&lt;br /&gt;
**this was causing some bad side effects&lt;br /&gt;
*manual .local lookups on Windows&lt;br /&gt;
**much faster then letting Windows do it itself&lt;br /&gt;
*Support for new Labview library&lt;br /&gt;
*Fixed PhidgetIR bug where library would crash if repeat code is longer then IR_MAX_REPEAT_LENGTH&lt;br /&gt;
===2.1.7.20101103===&lt;br /&gt;
*Decreased Phidget Webservice event latency on Windows&lt;br /&gt;
*Preliminary support for 1002, 1011, 1040, 1045, 1046, 1054, 1065, 1204 (C, .NET)&lt;br /&gt;
*Webservice version updated to 1.0.7&lt;br /&gt;
**support for 1045, 1011, 1204&lt;br /&gt;
*Fixed a bug where webservice connections could be unexpectedly lost&lt;br /&gt;
*Bugfix: couldn&#039;t set interfacekit data rate over webservice.&lt;br /&gt;
*Fixed some memory leaks in the Mac library&lt;br /&gt;
*Fixed bug where blocking for &amp;gt;2 seconds in an events handler when opening remotely could cause a crash.&lt;br /&gt;
===2.1.7.20100803===&lt;br /&gt;
*Windows only release&lt;br /&gt;
*fixed setLabel in WindowsCE&lt;br /&gt;
*fixed getHashCode in .NET library - needed for working with Phidgets in Labview via .NET&lt;br /&gt;
===2.1.7.20100621===&lt;br /&gt;
*Linux only release - autotools updates&lt;br /&gt;
**call ldconfig automatically&lt;br /&gt;
**remove old phidget21 library (pre-autotools) when installing new one.&lt;br /&gt;
===2.1.7.20100620===&lt;br /&gt;
*Linux only release - added version.sh for autoreconf&lt;br /&gt;
===2.1.7.20100618===&lt;br /&gt;
*Linux only release - added udev/hotplug files&lt;br /&gt;
===2.1.7.20100617===&lt;br /&gt;
*Linux only release&lt;br /&gt;
*Transitioned to autotools in linux for phidget21 / webservice&lt;br /&gt;
*phidget21 library and webservice are now separate downloads&lt;br /&gt;
===2.1.7.20100525===&lt;br /&gt;
*full support for PhidgetSpatial and PhidgetIR in all libraries&lt;br /&gt;
*fixed 1031 not attaching in AS3.0&lt;br /&gt;
*Better error messages in JNI&lt;br /&gt;
*Updated error codes, device ID/Class lists in Java, Flash, COM, etc.&lt;br /&gt;
*Fixed TemperatureSensor version 200,201,202 bug - ambient sensor would not report negative temperatures.&lt;br /&gt;
*Revised temperaturesensor API to report tempMin/tempMax and errors more accurately.&lt;br /&gt;
*Added initial events for encoder digital inputs&lt;br /&gt;
*full support for 1047&lt;br /&gt;
*Added new device support to WindowsCE&lt;br /&gt;
*Updated mac examples for 1047, 1048&lt;br /&gt;
===2.1.6.20100504===&lt;br /&gt;
*Windows only Release&lt;br /&gt;
**Added 1131 and 1132 to InterfaceKit example in MSI&lt;br /&gt;
===2.1.6.20100428===&lt;br /&gt;
*limit data rate maximum to 16ms over the webservice for devices that expose dataRate (InterfaceKit, Spatial)&lt;br /&gt;
*fixed bug where TextLCD 8/8/8 would stay in Bonjour list after webservice is shutdown&lt;br /&gt;
*set/get Brightness for 1203_2&lt;br /&gt;
*Support 1048 in C# example&lt;br /&gt;
*webservice version incremented to 1.0.6&lt;br /&gt;
**TextLCD set/get brightness&lt;br /&gt;
**PhidgetIR support&lt;br /&gt;
**PhidgetSpatial support&lt;br /&gt;
**1047 support (enable, index)&lt;br /&gt;
===2.1.6.20100406===&lt;br /&gt;
*Support for 1018_2 (dataRate)&lt;br /&gt;
*Webservice version incremented to 1.0.5&lt;br /&gt;
===2.1.6.20100401===&lt;br /&gt;
*Updated InterfaceKit example with new sensors&lt;br /&gt;
*make Windows connect cancelable&lt;br /&gt;
*make pending zeroconf lookups cancelable during close&lt;br /&gt;
===2.1.6.20100318===&lt;br /&gt;
*Mac only release&lt;br /&gt;
**Added WillSleep and Wakeup events to give user control of Phidgets immediately before and after a system sleep (MacOS Only).&lt;br /&gt;
===2.1.6.20100317===&lt;br /&gt;
*Windows only release&lt;br /&gt;
**Some of the examples were being built using an out of date .NET library&lt;br /&gt;
===2.1.6.20100310===&lt;br /&gt;
*MaxMSP fix - 2.1.6.20100126 introduced a bug for some Phidgets where openremote/open by serial didn&#039;t work and MaxMSP would sometimes crash.&lt;br /&gt;
**No code changes to any of the other libraries.&lt;br /&gt;
===2.1.6.20100304===&lt;br /&gt;
*stopped property changes trigger events over webservice so they are noticed.&lt;br /&gt;
**more compatible with how local open works&lt;br /&gt;
*added 5 new servos&lt;br /&gt;
*fixed bug where remote close would not set detached so a subsequent open would not always connect.&lt;br /&gt;
*handle UninitializeZeroconf better - shut down thread before closing handles, fixes hang on SBC&lt;br /&gt;
*fixed bug on Mac where detaching 2 or more Phidgets at the same time caused a crash&lt;br /&gt;
*fixed close blocking because of a pending connect (mac, linux)&lt;br /&gt;
*Final support for 1031 in all libraries.&lt;br /&gt;
===2.1.6.20100129===&lt;br /&gt;
*Implemented initial events in Flash&lt;br /&gt;
**Flash behaviour should now be identical to C library local and remote.&lt;br /&gt;
*Fix RFID issue where close could cause crash&lt;br /&gt;
*increment webservice version to 1.0.4&lt;br /&gt;
*fixed RFID remote open&lt;br /&gt;
**Flash would never get an attach event if the reader had been previously opened&lt;br /&gt;
**Initial tag event would not be fired when a tag was present and the antenna was enabled prior to open&lt;br /&gt;
*fixed openRemote failing on Mac&lt;br /&gt;
*fixed deadlock in webservice which could be hit by opening/closing a device over and over again.&lt;br /&gt;
*fixed bug in stepper, which caused seg fault on SBC on position change events.&lt;br /&gt;
===2.1.6.20100126===&lt;br /&gt;
*added network open support in Max/MSP&lt;br /&gt;
===2.1.6.20100115===&lt;br /&gt;
*Increased network performance for Linux/MacOS&lt;br /&gt;
*Added five servo types&lt;br /&gt;
===2.1.6.20091215===&lt;br /&gt;
*Fixed busy loop in Linux openRemote&lt;br /&gt;
*JNI Library relocated to /Library/Java/Extensions on MacOS&lt;br /&gt;
===2.1.6.20091211===&lt;br /&gt;
*Heartbeat now works on Linux as well (had to make sockets non-blocking)&lt;br /&gt;
===2.1.6.20091130===&lt;br /&gt;
*Added heartbeat to webservice (client side)&lt;br /&gt;
**Better detects network failures by using active polling timeouts&lt;br /&gt;
*Fixed 0/8/8 over webservice&lt;br /&gt;
===2.1.6.20091020===&lt;br /&gt;
*Fixed 1052 counting issue on 1070 (-1 reported as 255)&lt;br /&gt;
*Fixed issue where Phidget21 would try to reinstall from a limited user account or when the Control Panel was disabled.&lt;br /&gt;
*64-bit kernel support in Snow Leopard&lt;br /&gt;
===2.1.6.20090928===&lt;br /&gt;
*Support for PhidgetSBC (1070)&lt;br /&gt;
*zeroconf can handle starting up before the mdns daemon, and will keep trying to connect.&lt;br /&gt;
*fixed 1066 not showing up on Mac&lt;br /&gt;
*added advanced servo example to mac pref pane&lt;br /&gt;
*implemented proper error handling in COM&lt;br /&gt;
**default behavious remains the same, enable proper error handling with &#039;EnableVerboseErrors&#039;&lt;br /&gt;
*implemented error events in Java&lt;br /&gt;
===2.1.6.20090917===&lt;br /&gt;
*Updated webservice protocol version to 1.0.3&lt;br /&gt;
*Fixed stepper under AS3.0&lt;br /&gt;
*added setServoType, getServoType, setServoParameters to PhidgetServo and PhidgetAdvancedServo&lt;br /&gt;
*possible race condition fixed in webservice (pdictclient.c:907)&lt;br /&gt;
===2.1.6.20090902 (mac only release)===&lt;br /&gt;
*Support MacOSX 10.6, drop support for 10.3.9, require 10.4 or newer&lt;br /&gt;
**Fully 64-bit compliant, library supports ppc, i386, x86_64&lt;br /&gt;
===2.1.6.20090806===&lt;br /&gt;
*Added 1049 support&lt;br /&gt;
*Fixed RFID tag events over webservice&lt;br /&gt;
===2.1.6.20090804===&lt;br /&gt;
*Added 1051_2 support&lt;br /&gt;
*Fixed various small initialization issues - stepper, adv servo, rfid&lt;br /&gt;
*Added 32-bit library install to 64-bit installer&lt;br /&gt;
**VB6.0, etc. need the 32-bit COM library on 64-bit windows&lt;br /&gt;
===2.1.6.20090717===&lt;br /&gt;
*?&lt;br /&gt;
===2.1.6.20090708===&lt;br /&gt;
*Added DeviceID to zeroconf&lt;br /&gt;
*fixed RFID.LastTag in .NET&lt;br /&gt;
*Changed the error codes returned by error events; error events now have their own set of error codes rather then sharing the function return codes.&lt;br /&gt;
*Added support for 1047, 1048&lt;br /&gt;
*Added error event codes rather then trying to reuse the EPHIDGET return codes.&lt;br /&gt;
*fixed TextLCD issue where display could get corrupted during a detach/attach&lt;br /&gt;
*made mac more reliable on attach&lt;br /&gt;
*more error logging on mac&lt;br /&gt;
===2.1.6.20090525===&lt;br /&gt;
*fixed RFID not attaching via webservice if a tag is present.&lt;br /&gt;
*bugfix related to double free on detach event.&lt;br /&gt;
*Implemented getKey&lt;br /&gt;
*Added MIPS II support to Windows CE&lt;br /&gt;
===2.1.6.20090430===&lt;br /&gt;
*Added ActiveX interface to COM library&lt;br /&gt;
*Added stepper and advancedServo to Flex .swc library&lt;br /&gt;
===2.1.6.20090417===&lt;br /&gt;
*added PhidgetIR prototype support to C library&lt;br /&gt;
*properly handles sleeping on OSX&lt;br /&gt;
*fixed some webservice field initializations in Flash and C&lt;br /&gt;
*fixed security exceptions in [[Phidget Control Panel]] under Vista&lt;br /&gt;
*added [[Phidget Control Panel]] to start menu&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090318 (Examples/AS3.0 only release)===&lt;br /&gt;
*Fixed AdvancedServo in Flash - wouldn&#039;t attach&lt;br /&gt;
===2.1.6.20090317===&lt;br /&gt;
*[[Phidget Control Panel]] properly supports Vista UAC and Limited user accounts in XP, etc.&lt;br /&gt;
*Added 64-bit release of Phidget21.msi for Windows&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090312===&lt;br /&gt;
*added 1064, 1059 to WindowsCE&lt;br /&gt;
*fixed opening 1051 over webservice&lt;br /&gt;
*fixed opening 1015/1016 over webservice broken in last release&lt;br /&gt;
===2.1.6.20090302===&lt;br /&gt;
*Advanced servo bugfix: stopped would stop being true if min/max was set to exclude current position.&lt;br /&gt;
*linux USB improvements when many Phidgets are attached and opened at once.&lt;br /&gt;
*1031 support in phidget21, webservice, .NET - hidden until product release&lt;br /&gt;
**CPhidgetLED_setVoltage&lt;br /&gt;
**CPhidgetLED_getVoltage&lt;br /&gt;
**CPhidgetLED_setCurrentLimit&lt;br /&gt;
**CPhidgetLED_getCurrentLimit&lt;br /&gt;
*unknown timechange == PUNK_INT in encoder position change event&lt;br /&gt;
**1st position change event&lt;br /&gt;
**&amp;gt; 30 seconds time change&lt;br /&gt;
*AS3 updates&lt;br /&gt;
**updated to 1.0.2 webservice&lt;br /&gt;
**encoder position change events report relative change rather then absolute position&lt;br /&gt;
**encoder adds getTimeChange function for timing encoder changes&lt;br /&gt;
*webservice updated to 1.0.2&lt;br /&gt;
**Authorization is asynchronous&lt;br /&gt;
**Doesn&#039;t match the old version checking, so errors will not be nice when trying to connect to an old webservice&lt;br /&gt;
**Sends out all initial data, so it&#039;s just like opening locally&lt;br /&gt;
**supports interfacekit Raw sensor value&lt;br /&gt;
**supports labels on remoteIP managers&lt;br /&gt;
*avahi bugfix&lt;br /&gt;
*webservice more stable against forcefully closed clients&lt;br /&gt;
*closing a network Phidget won&#039;t block - ever.&lt;br /&gt;
**no longer using quit, just closing the socket&lt;br /&gt;
*added libavahi-client.so.3 reference to linux library.&lt;br /&gt;
*Fixed bug with opening one phidget with serial and no serial at the same time over the webservice&lt;br /&gt;
===2.1.5.20090105===&lt;br /&gt;
*[[Phidget Control Panel]] stability improvements&lt;br /&gt;
*added CPhidgetSBC_getHostname&lt;br /&gt;
*advanced servo 1 motor current sense equation - support should now be complete&lt;br /&gt;
*webservice and network code bugfixes - crash / deadlock during close, problems with concurrent connections, etc.&lt;br /&gt;
*fixed close on remote and remoteIP managers&lt;br /&gt;
*name of RFID changed from &amp;quot;Phidget RFID 4-output&amp;quot; to &amp;quot;Phidget RFID 2-output&amp;quot; - updated anything referencing old name.&lt;br /&gt;
&lt;br /&gt;
===2.1.5.20081023===&lt;br /&gt;
*added advanced servo and stepper examples to VB6.0, VB.NET and C&lt;br /&gt;
*added deviceClass and deviceID&lt;br /&gt;
*updated Mac examples&lt;br /&gt;
*webservice protocol version enforcement&lt;br /&gt;
*internal fix/rework of device id&#039;s etc.&lt;br /&gt;
*Fixed memory leaks in webservice and phidget21 network code.&lt;br /&gt;
*Dictionary and network stability improvements.&lt;br /&gt;
*duplicate calls to open or close are now silently ignored.&lt;br /&gt;
===2.1.4.20080924===&lt;br /&gt;
*Old TextLCD 0/8/8&#039;s can now have both halves open at the same time on Windows&lt;br /&gt;
*fixed bug with composite devices on linux&lt;br /&gt;
*fixed manager on linux to better deal with unique devices&lt;br /&gt;
===2.1.4.20080922===&lt;br /&gt;
*Updated Delphi files&lt;br /&gt;
*TextLCD can display 0x80-0xFF characters from Java&lt;br /&gt;
*getAttachedDevices works for mdns managers&lt;br /&gt;
*fixed a deadlock in the webservice&lt;br /&gt;
*better network error handling / password support for windows C# examples&lt;br /&gt;
*waitForAttachment will return EPHIDGET_CLOSED if the handle is closed while it is waiting.&lt;br /&gt;
*added EPHIDGET_CLOSED&lt;br /&gt;
*joining central threads checks whether they are trying to be joined by themselves first (avoid deadlocks).&lt;br /&gt;
*changed context of error event to be free from locks (can call close, open, etc. from them).&lt;br /&gt;
===2.1.4.20080821===&lt;br /&gt;
*zeroconf threads exit cleanly on last _close (apple zeroconf)&lt;br /&gt;
*Added advanced servo and stepper to Max&lt;br /&gt;
===2.1.4.20080811 (mac only release)===&lt;br /&gt;
*Fixed manager on Mac (wasn&#039;t working at all since 2.1.4.20080808)&lt;br /&gt;
===2.1.4.20080808===&lt;br /&gt;
*added CPhidgetSBC and CPhidgetSBCManager to the c library - these interfaces are hidden from users and meant to be used internally (for now).&lt;br /&gt;
*CPhidgetManager_open no longer blocks to send out initial attach events. These initial events are sent from the CentralThread context like all other attach events.&lt;br /&gt;
*fixed CThread_wait_on_event on Linux&lt;br /&gt;
*added CPhidgetGeneric interface for prototyping to C, .NET libraries. product ID is 0x99. These are only visible in debug releases, only to be used internally.&lt;br /&gt;
===2.1.4.20080715===&lt;br /&gt;
*udev rules fixed for product IDs with alpha-hex values&lt;br /&gt;
*blocking in an attach event does not block calls to open anymore&lt;br /&gt;
*RFID tag event handlers can now handle blocking - tag lost is timed after the tag handler exits.&lt;br /&gt;
===2.1.4.20080623===&lt;br /&gt;
*Flex .swc library was out of sync&lt;br /&gt;
*fixed CPhidgetManager_getAttachedDevices for network managers&lt;br /&gt;
*Added CPhidgetManager_freeAttachedDevicesArray&lt;br /&gt;
===2.1.4.20080613===&lt;br /&gt;
*Max/MSP RFID fixed&lt;br /&gt;
*0/0/8 and advanced servo added to CE&lt;br /&gt;
*fixed flash policy file server in webservice&lt;br /&gt;
*webservice with password and asynchronous together work now&lt;br /&gt;
===2.1.4.20080602===&lt;br /&gt;
*phidget21.h -&amp;gt; phidget21int.h so as not to be confused with generated phidget21.h&lt;br /&gt;
*some changes to Makefile fro crosscompiling&lt;br /&gt;
*no more vbscript in msi&lt;br /&gt;
===2.1.4.20080513===&lt;br /&gt;
*removed long long from COM - not supported by VB6.0&lt;br /&gt;
*added LastTag to RFID in .NET&lt;br /&gt;
===2.1.4.20080428===&lt;br /&gt;
*support Mac OS X 10.3.9 again&lt;br /&gt;
*Rev up to 2.1.4&lt;br /&gt;
*finalize Phidget Stepper API - Phidget Stepper requires 2.1.4 as a minimum&lt;br /&gt;
*fixed serverConnect and serverDisconnect handlers for manager and dictionary in COM&lt;br /&gt;
*Changed:&lt;br /&gt;
**PhidgetStepper and PhidgetAdvancedServo&lt;br /&gt;
***MotorPosition -&amp;gt; Position&lt;br /&gt;
***MotorOn -&amp;gt; Engaged&lt;br /&gt;
***MotorStopped -&amp;gt; Stopped&lt;br /&gt;
*Added:&lt;br /&gt;
**CPhidgetStepper_getCurrentLimit&lt;br /&gt;
**CPhidgetEncoder_getPosition&lt;br /&gt;
**CPhidgetEncoder_setPosition&lt;br /&gt;
**CPhidgetMotorControl_getVelocity&lt;br /&gt;
**CPhidgetMotorControl_setVelocity&lt;br /&gt;
**CPhidgetMotorControl_set_OnVelocityChange_Handler&lt;br /&gt;
**CPhidgetServo_setEngaged&lt;br /&gt;
**CPhidgetServo_getEngaged&lt;br /&gt;
**CPhidgetServo_getPosition&lt;br /&gt;
**CPhidgetServo_setPosition&lt;br /&gt;
**CPhidgetServo_set_OnPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getPositionMax&lt;br /&gt;
**CPhidgetServo_getPositionMin&lt;br /&gt;
**Count functions&lt;br /&gt;
*Deprecated:&lt;br /&gt;
**CPhidgetEncoder_getEncoderPosition&lt;br /&gt;
**CPhidgetEncoder_setEncoderPosition&lt;br /&gt;
**CPhidgetMotorControl_getMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_setMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_set_OnMotorChange_Handler&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorPosition&lt;br /&gt;
**CPhidgetServo_setMotorPosition&lt;br /&gt;
**CPhidgetServo_set_OnMotorPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**Num functions&lt;br /&gt;
*Added ability to deprecate funcitons in the C library - compiler will issue a warning when they are used.&lt;br /&gt;
*added names to some arguments in phidget21.h&lt;br /&gt;
*fixes to the webservice for initial state stuff - now it behaves almost like non-webservice, with guaranteed initial events, but we don&#039;t guarantee initial state in the attach event yet. Min/Max, Num motors, inputs, etc. are all guaranteed in the attach handler.&lt;br /&gt;
*Finalized support for Phidget Stepper&lt;br /&gt;
===2.1.3.20080402===&lt;br /&gt;
*Fixed windows BUG - Device Type was showing up wrong&lt;br /&gt;
*CPhidgetStepper_getPosition -&amp;gt; CPhidgetStepper_getCurrentPosition&lt;br /&gt;
===2.1.3.20080327===&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorStopped&lt;br /&gt;
*changes to API&lt;br /&gt;
**CPhidgetStepper_setMotorPosition -&amp;gt; CPhidgetStepper_setTargetMotorPosition&lt;br /&gt;
**added CPhidgetStepper_getTargetMotorPosition&lt;br /&gt;
**Stepper MotorSpeed -&amp;gt; Velocity&lt;br /&gt;
**Stepper and AdvancedServo MaxVelocity -&amp;gt; VelocityLimit&lt;br /&gt;
*add waitForAttachment to COM&lt;br /&gt;
*COM getbool (not indexed) will now return FALSE on false (rather then always returning true)&lt;br /&gt;
*fixed write thread timeouts - was setting attached after starting write thread so write thread would see a detached device and exit immediately&lt;br /&gt;
===2.1.3.20080206===&lt;br /&gt;
*changed long long to __int64, to be happy in borland C++&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetStepper_getMaxMotorSpeed&lt;br /&gt;
**CPhidgetStepper_setMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorStopped&lt;br /&gt;
**CPhidgetStepper_setCurrentMotorPosition&lt;br /&gt;
*removed CPhidgetStepper_setVelocity&lt;br /&gt;
*added CPhidgetStepper_setMaxVelocity, CPhidgetStepper_getMaxVelocity&lt;br /&gt;
===2.1.3.20080114===&lt;br /&gt;
*Added new functions to Flash API&lt;br /&gt;
*Added new functions to Webservice Protocol&lt;br /&gt;
*Added new functions to COM Library&lt;br /&gt;
*Added new functions to Java Library&lt;br /&gt;
*All device fiels in C library cleaned up and made consistent&lt;br /&gt;
*Open in windows is exclusive - this needs to be tested for stability&lt;br /&gt;
*No data will be returned / accepted if it lies outside of max/min range&lt;br /&gt;
*if a data value is unknown, user variable is set to PUNK_INT, PUNK_DBL, or PUNK_BOOL, and return value is EPHIDGET_UNKNOWNVAL&lt;br /&gt;
*Proper Device initializations on Attach:&lt;br /&gt;
**triggers are set to defaults on attach&lt;br /&gt;
**device state is read in and preserved on attach&lt;br /&gt;
**during attach event, all sensor data, etc. is provided if available&lt;br /&gt;
**no data events until after the attach event returns&lt;br /&gt;
**everything initialized by the time waitForAttachment returns&lt;br /&gt;
**after attach event returns, a full set of initial state data events are thrown&lt;br /&gt;
*.NET collections are readonly, and never NULL (but empty when phidget detached)&lt;br /&gt;
*.NET callbacks no longer catch and hide all exceptions&lt;br /&gt;
**make sure to use try/catch blocks especially in Attach when accessing properties that may not be initialized.&lt;br /&gt;
*added min/max functions:&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMax&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMax&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMax&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMax&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMin&lt;br /&gt;
**CPhidgetPHSensor_getPHMax&lt;br /&gt;
**CPhidgetPHSensor_getPHMin&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMax&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMin&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetStepper_getAccelerationMax&lt;br /&gt;
**CPhidgetStepper_getAccelerationMin&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMax&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMin&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMax&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMin&lt;br /&gt;
*Added functions:&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperature&lt;br /&gt;
**CPhidgetTemperatureSensor_getThermocoupleType&lt;br /&gt;
**CPhidgetTemperatureSensor_setThermocoupleType&lt;br /&gt;
**CPhidget_set_OnServerConnectHandler&lt;br /&gt;
**CPhidget_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_getServerID&lt;br /&gt;
**CPhidgetDictionary_getServerAddress&lt;br /&gt;
**CPhidgetDictionary_getServerStatus&lt;br /&gt;
**CPhidgetManager_getServerID&lt;br /&gt;
**CPhidgetManager_getServerAddress&lt;br /&gt;
**CPhidgetManager_getServerStatus&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
*Removed functions:&lt;br /&gt;
**CPhidgetServo_setMotorOff&lt;br /&gt;
*TemperatureSensor:&lt;br /&gt;
**Ambient sensor is accessed with it&#039;s own function&lt;br /&gt;
**first thermocouple is Index 0 everywhere&lt;br /&gt;
**no ambient sensor events&lt;br /&gt;
*getServerID is implemented&lt;br /&gt;
*changed the internal network structure (added CPhidgetRemote)&lt;br /&gt;
*reworked the USB code (mostly on Windows)&lt;br /&gt;
**Better handles closing, ESD events, timeouts&lt;br /&gt;
**fixed issues with Encoder, RFID stopping reading after a certain time.&lt;br /&gt;
**added USB error flag&lt;br /&gt;
*openRemote functions have been implemented&lt;br /&gt;
**these require bonjour (mac / windows) or avahi (linux) to be installed on both the client and server&lt;br /&gt;
**if they are not, you get EPHIDGET_UNSUPPORTED when you call them&lt;br /&gt;
*openRemoteIP functions are asynchronous and persistent&lt;br /&gt;
*include cphidgetconstants.h in phidget21.h for users&lt;br /&gt;
===2.1.2.20071108===&lt;br /&gt;
*start of chagelog&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Template:UGsbc2&amp;diff=23978</id>
		<title>Template:UGsbc2</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Template:UGsbc2&amp;diff=23978"/>
		<updated>2017-09-18T18:13:04Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==SBC Web Interface==&lt;br /&gt;
&lt;br /&gt;
Using the operating system sections of this guide, you should have been able to open a web browser with a connection to the SBC using either:&lt;br /&gt;
* The Phidget Control Panel (Windows), or&lt;br /&gt;
* The Phidget Preference Pane (Mac OS), or &lt;br /&gt;
* An mDNS connection (Linux).&lt;br /&gt;
Here we cover the basics on the tool that has been opened in the browser, known as the SBC Web Interface.&lt;br /&gt;
&lt;br /&gt;
===Set the Password===&lt;br /&gt;
&lt;br /&gt;
If this is your first time connecting to the SBC (or after a complete factory reset), you will see a screen asking you to set a password:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_gs_set_passwd.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
This password will be linked to the user {{Code|admin}} if you use the web interface in the future, and to the user {{Code|root}} if you choose to use SSH.  These are actually the same user, and the SSH connection is covered in-depth on the [[OS - Phidget SBC|SBC operating system page]].&lt;br /&gt;
&lt;br /&gt;
Remember this password, as you will need it to connect to the SBC in the future, and the only way to log in if you lose it is to perform a [[OS - Phidget SBC#Factory Reset|full factory reset]] on the SBC.&lt;br /&gt;
&lt;br /&gt;
The next time you connect to the SBC after you log out or reboot the SBC, you will be asked to log in with a user name and password:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_gs_login.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
===Navigating===&lt;br /&gt;
&lt;br /&gt;
The SBC Web Interface has a series of tabs and sub-tabs at the top, and by using these you can access the entire web interface.  Note that the web interface only allows you to configure a very small portion of the SBC, please refer to the full [[OS - Phidget SBC]] page for an in-depth introduction on the SBC Linux operating system.&lt;br /&gt;
&lt;br /&gt;
The header also has information about how long the SBC had been powered on without a reboot, what the link local address of the SBC is (here it is {{Code|phidgetsbc}}, so the full link local address is {{Code|phidgetsbc.local}}) and more:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_gs_web_header.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
The starting page of the web interface will also give you information about:&lt;br /&gt;
* The name of the SBC (you can rename it under {{Code|System &amp;amp;rarr; General}}, although note that this will &#039;&#039;&#039;also change the link local address of the SBC  to that name&#039;&#039;&#039;)&lt;br /&gt;
* The build, kernel, and board revision&lt;br /&gt;
* The MAC address (of the Ethernet connection...the wireless MAC address can be found on {{Code|Network &amp;amp;rarr; Status}} when the adapter is plugged in)&lt;br /&gt;
* The space left in your / filesystem (the amount of space you have for programs, and files not written to an external USB key)&lt;br /&gt;
* Any additionally mounted filesystems (such as a USB data key)&lt;br /&gt;
* The amount of memory your SBC is currently using.  This can be a bit misleading however.  To get a better idea of the total memory usage go to the &amp;quot;Processes&amp;quot; subtab and look at memory usage on a per-process basis.&lt;br /&gt;
&lt;br /&gt;
This can also be accessed later from {{Code|Status &amp;amp;rarr; System}}:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_gs_web_interface.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
===Set up Networking===&lt;br /&gt;
&lt;br /&gt;
After using the initial wired Ethernet connection (as described in detail in the [[#Hardware|hardware section]]) to access the web interface for the first time, you can use the {{Code|Network}} tab in the web interface to configure other network settings for use.&lt;br /&gt;
&lt;br /&gt;
The SBC can switch dynamically between Ethernet (what it tries first) and wireless via the [{{SERVER}}/products.php?product_id=3702 Wi-Fi USB Adapter w/SMA Antenna].  It is also able to dynamically handle both Ethernet and wireless being unplugged and then plugged back in.  This is especially useful if you are designing a project where the SBC will operate without a network - when testing you can plug in and remove the network adapters to check on how the SBC is doing.&lt;br /&gt;
&lt;br /&gt;
====Wireless====&lt;br /&gt;
&lt;br /&gt;
The SBC can only access wireless networks using the [{{SERVER}}/products.php?product_id=3702 Wi-Fi USB Adapter w/SMA Antenna].  If this WiFi adapter is plugged in to a USB port on the SBC, you will see something like this under {{Code|Network &amp;amp;rarr; Wireless}} in the web interface:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_gs_wireless.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
Here you can add and remember networks with passwords.  These do not necessarily have to be networks that are currently seen - you can add the SSID and password of your home network, for example, and the next time the SBC boots at home with wireless only it will connect to your home wireless network.  These SSID settings are only for DHCP networks.&lt;br /&gt;
&lt;br /&gt;
====Static IP====&lt;br /&gt;
&lt;br /&gt;
If you do not have DHCP on your main network, and do not want to use link local addressing, you can set the network connection to be static.  These settings can be found in the web interface under {{Code|Network &amp;amp;rarr; Settings}} for the Ethernet interface, and at the bottom of {{Code|Network &amp;amp;rarr; Wireless}} for wireless networking.  In the Ethernet settings, for example, you can specify network elements manually in the same way you would for a desktop computer:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_gs_static_ip.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
This setting is also useful to work entirely without mDNS and link local addressing.  After setting it, the SBC will start using that static IP immediately, so if this is done improperly this can make the SBC very hard to re-connect to depending on the routing within the rest of your network.  If you are not sure whether this will be a problem, it may help to read the in-depth [[OS - Phidget SBC#Initial Internet Setup|network troubleshooting section]] for the SBC.&lt;br /&gt;
&lt;br /&gt;
===View Attached Phidgets===&lt;br /&gt;
&lt;br /&gt;
You can view Phidgets that are directly attached to the SBC by going to {{Code|Phidgets &amp;amp;rarr; Status}} in the web interface:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_attached_phidgets.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
This will always show the attached Interface Kit that is part of the SBC board.  It will also show any Phidgets plugged into the SBC&#039;s USB ports.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of this screen (not shown in the screenshot) you will see the serial numbers of the attached Phidgets.  If you want to use these Phidgets within your code over a network using the webservice, you can use these serial numbers in your programming project.&lt;br /&gt;
&lt;br /&gt;
Note that any analog or digital sensors will not show up here, as they are a &#039;part&#039; of the Interface Kit and can be accessed through the ports in the Interface Kit API.  Taking a look at the [[1018 User Guide|User Guide]] for the [{{SERVER}}/products.php?product_id=1018 PhidgetInterfaceKit 8/8/8] will show you a good example of how this works.&lt;br /&gt;
&lt;br /&gt;
===Use the Webcam===&lt;br /&gt;
&lt;br /&gt;
Using the webcam (either the [{{SERVER}}/products.php?product_id=3402 Phidget USB Webcam] or another [https://en.wikipedia.org/wiki/List_of_USB_video_class_devices UVC-compatible webcam]) should be fairly straightforward.  Plug it in, then head to the web interface under {{Code|Webcam &amp;amp;rarr; Webcam}}:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_gs_webcam.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
This will allow you to stream video into the web interface.  This stream can also be viewed with any compatible M-JPG viewer, such as VLC.  To take pictures with the webcam within your code, see the [[OS - Phidget SBC#Taking Pictures with the Webcam|how-to]] on the main SBC operating system page.&lt;br /&gt;
&lt;br /&gt;
Webcams that support pan/tilt can be controlled via the web interface. Multiple frame rates and resolutions are supported. &lt;br /&gt;
&lt;br /&gt;
If the video stream is to be exported over the internet, it is recommended that the password be enabled. However, it must be noted that this is a simple HTTP authentication, which is sent unencrypted, and is thus not highly secure.&lt;br /&gt;
&lt;br /&gt;
If prompted for the webcam password, the username is ‘webcam’.&lt;br /&gt;
&lt;br /&gt;
If multiple webcams are attached, they will all start up using the same settings, except that each additional webcam will run on the next higher port number. Multiple webcams will generally only work when the resolution and framerate are set to low levels.&lt;br /&gt;
&lt;br /&gt;
At this point, we have covered most of the common uses of the web interface.  But the web interface offers many more configuration options.  This reference section covers all of the available options.  If you want to continue on to tasks such as writing and running code on the SBC, visit the [[OS - Phidget SBC]] page.&lt;br /&gt;
&lt;br /&gt;
====Can I use multiple webcams?====&lt;br /&gt;
Probably...  In theory you can connect multiple webcams to the SBC, however, the bandwidth of a USB1.1 hub will limit the amount of data you can stream meaning you might have to use reduces resolution/framerate to do it successfully.&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Template:UGsbc1&amp;diff=23977</id>
		<title>Template:UGsbc1</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Template:UGsbc1&amp;diff=23977"/>
		<updated>2017-09-18T18:11:45Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Basic Use===&lt;br /&gt;
&lt;br /&gt;
Basic use of the PhidgetSBC allows the opening of connected Phidgets over the network. Using another Phidget with the PhidgetSBC in this way is almost exactly like using Phidgets over USB, in respect to the API calls and behavior. However, some extra considerations need to be made when working with the PhidgetWebservice.&lt;br /&gt;
&lt;br /&gt;
===Phidget Webservice===&lt;br /&gt;
&lt;br /&gt;
Support for opening Phidgets over the network is made possible via the Phidget Webservice. This allows a user to write an application in a system and language of their choosing and then operate Phidgets connected to the PhidgetSBC.  It is a socket based server that runs on the PhidgetSBC, and allows any attached Phidgets to be seen and opened directly over the network.  To use this server go to the &amp;quot;Phidgets-&amp;gt;WebService&amp;quot; tab in the web configuration page and enable it.&lt;br /&gt;
&lt;br /&gt;
Opening and controlling a Phidget over the network is nearly the same as opening one locally. The main differences are:&lt;br /&gt;
&lt;br /&gt;
*Different open calls that include server information. New calls OpenRemote and openRemoteIP (naming depends on language).&lt;br /&gt;
*Access to Webservice based properties: Server hostname, port and ID.&lt;br /&gt;
*Access to server connect and disconnect events, and network error events.&lt;br /&gt;
*Phidgets can be opened by more then one separate application at the same time.&lt;br /&gt;
*Reliability is more of a issue because network connections are easily broken&lt;br /&gt;
&lt;br /&gt;
Opening a Phidget over the network is asynchronous and pervasive, just like opening locally. This means that if a connection to the remote server cannot be established right away, it will keep trying indefinitely, and even survive the server being stopped and started, etc.  Instances of the Phidget Webservice can be referred to either using hostname (IP Address) and port number, or by Server ID. The advantage of using a Server ID is that it stays consistent compared to IP addresses, and you don’t need to know the Port number.  A Webservice Server ID is assigned when the Webservice is run - which on the PhidgetSBC defaults to ‘phidgetsbc’. In order to use a Server ID, the Bonjour utility also needs to be installed.  Refer to the Programming Manual and the API manual for your language for more information about using the Phidget Webservice.&lt;br /&gt;
&lt;br /&gt;
====Reliability====&lt;br /&gt;
&lt;br /&gt;
Determining reliability needs can become important while opening Phidgets over the network, because the network connection can potentially be interrupted at any time. This can leave the network attached Phidget in an undesirable state. For example - if a motor controller is driving a motor and the connection is lost, there is no way to stop the motor until the connection is re-established. These issues are less important if you are just receiving sensor data from an Interface Kit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It’s generally a good idea to catch server connect and disconnect and Phidget attach and detach events in order to know the state of the connections. It’s also a good idea to catch error events - this is where network errors will be reported.  If reliability is important, you should consider writing a program to run locally on the PhidgetSBC, and communicate with it through the Dictionary interface. This way, if the connection is broken, the local application will notice and be able to take any appropriate actions. See the advanced chapter for more information.&lt;br /&gt;
&lt;br /&gt;
====Finding Phidgets on the Network====&lt;br /&gt;
&lt;br /&gt;
Any Phidgets attached to the PhidgetSBC can be identified using the Status &amp;gt;&amp;gt; Phidgets page in the configuration interface, and should be seen on the network through the Webservice.  The Phidget Control Panel has a Bonjour tab (under WebService &amp;gt;&amp;gt; Bonjour) that lists all detected network attached Phidgets. The Phidgets connected to the PhidgetSBC should be seen here and can be opened by double clicking its name in the menu.  Network attached Phidgets can also be located programmatically with the Phidget Manager. The Phidget Manager is used with either hostname and port, or server ID, just like with ‘Open’. The manager can also be used to find all Phidgets on any Webservice through Bonjour, by specifying a NULL Server ID. See your specific language’s guide for more information about coding with the Phidget Manager.&lt;br /&gt;
&lt;br /&gt;
===Testing Using Mac OS X===&lt;br /&gt;
The steps are very similar to the Windows process described above:&lt;br /&gt;
#Ensure you have OS X 10.3.9 or later running.&lt;br /&gt;
#Download and run the [{{SERVER}}/downloads/phidget21/libraries/macos/Phidget.dmg Installer] ([{{SERVER}}/docs/Software_License#OS_X software license])&lt;br /&gt;
#Click on System Preferences &amp;amp;rarr; Phidgets (under Other) to activate the Preference Pane&lt;br /&gt;
#Make sure that the Phidget SBC is properly attached to the network as described in the [[#Getting_Started|Getting Started section]]&lt;br /&gt;
#Double Click on the Phidget SBC in the Phidget Preference Pane to bring up the Web Interface in your default browser &lt;br /&gt;
#Or, click on the Bonjour tab to see attached Phidgets being run over the network and to bring up their examples&lt;br /&gt;
&lt;br /&gt;
The address in the browser that connects to the SBC is either an &#039;&#039;&#039;IP address&#039;&#039;&#039; (such as 192.168.2.181) or a &#039;&#039;&#039;link local address&#039;&#039;&#039;, (such as {{Code|phidgetsbc.local}}, which is the default). Note down the address in the browser, as you will need this information for later if you will be working [[OS - Phidget SBC|directly with the SBC]] to perform tasks such as writing or running code.  But for now, with the web interface open, we have a [[#SBC Web Interface|section to walk you through it]].&lt;br /&gt;
&lt;br /&gt;
===Using Linux===&lt;br /&gt;
&lt;br /&gt;
With Linux, you have many setup options, but all involve knowing the IP address or link local address of the SBC after you have plugged it in as described in [[#Getting_Started|Getting Started section]].  The IP address can be somewhat difficult to obtain, but the default link local address for all new Phidget SBCs is {{Code|phidgetsbc.local}} - which is an mDNS address.  Wait at least three minutes after booting the SBC to make sure link local addressing is started.  You&#039;ll also need some form of mDNS (either {{Code|avahi}} or {{Code|mDNSResponder}}) installed on your main computer.  The {{Code|avahi}} service is usually installed by default on most Linux machines, try {{Code|which avahi-resolve}} to make sure.  Then, try typing {{Code|phidgetsbc.local}} into a web browser.  The [[#SBC Web Interface|web interface]] should come up, starting with the [[#Set the Password|Set the Password]] screen.&lt;br /&gt;
&lt;br /&gt;
Note that some browsers (i.e. Google Chrome) combine search and addressing in the same address bar, so you may need to turn off web service and prediction service in {{Code|Preferences &amp;amp;rarr; Under The Bonnet}} for Chrome to treat {{Code|phidgetsbc.local}} like a web address rather than a search term.  If these steps do not bring you to the initial setup password screen as shown in the [[#SBC Web Interface|SBC Web Interface section]], you will probably need to read the [[OS - Phidget SBC#Initial Internet Setup|internet setup section on the SBC OS Page]].  That section contains more than just troubleshooting information - it includes in-depth information on how the SBC starts its network, your initial network configuration options, and how to connect to the SBC without mDNS using both DHCP and static IP.&lt;br /&gt;
&lt;br /&gt;
If you want to use the SBC to broadcast data from Phidgets over a network, the SBC is already automatically performing this function with its attached Interface Kit, and will also do so for any Phidgets plugged into its USB ports.  If this is your sole intended use of the SBC, you can skip ahead to our example on using the [[#Linux - Attached Interface Kit | attached Interface Kit]].&lt;br /&gt;
&lt;br /&gt;
However, the SBC is much, much more than simply a way to get data from Phidgets over a network.  You can use the SBC as an external Linux computer.  You&#039;ll need to [[#Set the Password|set a password]] using the SBC web interface, and write down a network address of the SBC ({{Code|phidgetsbc.local}}, or an IP address if you worked through the [[OS - Phidget SBC#Initial Internet Setup|internet setup section on the SBC OS Page]]).  But after that, if no other sections in the basic [[#SBC Web Interface|SBC web interface]] section apply to you (using the webcam, setting up wireless networking, or checking system parameters like memory), you can skip ahead to the [[OS - Phidget SBC]] page.  &lt;br /&gt;
&lt;br /&gt;
====Linux - Attached Interface Kit====&lt;br /&gt;
&lt;br /&gt;
As soon as the SBC boots and can connect to the network (either by DHCP or by mDNS/avahi), it begins broadcasting the state of its attached InterfaceKit over the network using the [[Phidget WebService]].  To test the InterfaceKit on your Linux computer over the network, you will need to install the Phidget libraries and the Phidget webservice if you haven&#039;t already.  (If you have used any Phidget via USB and over a network on your Linux computer, you have already done this.)  This process is described on the general [[OS - Linux|Linux OS]] page, so follow those installation instructions, with the following modifications to the [[OS - Linux#Using the WebService|Linux webservice introduction]]:&lt;br /&gt;
* Instead of using a localhost (127.0.0.1) address, use the the SBC&#039;s IP or link local ({{Code|phidgetsbc}}) address, &lt;br /&gt;
* Instead of using the function call {{Code|openRemoteIP}} in your code, use the function call {{Code|openRemote}}, and the Interface Kit serial number which is on the back of the SBC.&lt;br /&gt;
&lt;br /&gt;
Note that any attached analog sensors in the black ports will not show up over the webservice as individual Phidgets.  Rather, they will show up as part of the Interface Kit, through the port number that they are attached to on the SBC board.&lt;br /&gt;
&lt;br /&gt;
===Using Windows Mobile / CE 5.0 / CE 6.0===&lt;br /&gt;
&lt;br /&gt;
{{UGce}}&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Language_-_Cocoa&amp;diff=23976</id>
		<title>Language - Cocoa</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Language_-_Cocoa&amp;diff=23976"/>
		<updated>2017-09-18T18:04:57Z</updated>

		<summary type="html">&lt;p&gt;Patrick: Patrick moved page Language - Cocoa to Language - Objective C&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Language - Objective C]]&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Language_-_Objective_C&amp;diff=23975</id>
		<title>Language - Objective C</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Language_-_Objective_C&amp;diff=23975"/>
		<updated>2017-09-18T18:04:56Z</updated>

		<summary type="html">&lt;p&gt;Patrick: Patrick moved page Language - Cocoa to Language - Objective C&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
{{OSLang|[[File:icon-Cocoa.png|64x64px|alt=|link=]]|Cocoa is Apple&#039;s native object-oriented application programming interface (API) for the [http://www.apple.com/macosx Mac OS X] operating system.}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Cocoa|the complete Phidget API, including events|all Phidget devices.|XCode on OS X|}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
{{QuickDownloads|Cocoa|&lt;br /&gt;
{{APIQuickDownloads|{{SERVER}}/documentation/Phidget21_C_Doc.zip C/C++}}&lt;br /&gt;
{{ExtraAPIQuickDownloads|{{SERVER}}/documentation/web/cdoc/index.html|HTML Version of}}|&lt;br /&gt;
{{ExampleQuickDownloads|{{SERVER}}/downloads/phidget21/examples/objc/Cocoa.zip|}}|&lt;br /&gt;
{{MacQuickDownloads}}}}&lt;br /&gt;
&lt;br /&gt;
==Getting started with Cocoa==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
We offer support for developing Cocoa on [[#OS X |OS X]].&lt;br /&gt;
&lt;br /&gt;
==OS X==&lt;br /&gt;
&lt;br /&gt;
The Phidget examples were written in Objective-C and Xcode 3.2.4, and this tutorial assumes their use. Other versions of Xcode should work as well and would be set up in a similar manner. &lt;br /&gt;
&lt;br /&gt;
===Description of Files===&lt;br /&gt;
&lt;br /&gt;
Any files we think are worth knowing about specifically, or at the minimum a note that the OS X install puts things in their proper place.&lt;br /&gt;
&lt;br /&gt;
===XCode===&lt;br /&gt;
&lt;br /&gt;
====Use Our Examples====&lt;br /&gt;
If Xcode is not already installed on your system then you will need to get it.  You can download it from the Mac app store free of charge.&lt;br /&gt;
&lt;br /&gt;
Once that is done, you need to download our [{{SERVER}}/downloads/phidget21/examples/objc/Cocoa.zip examples].  If this is your first time working with Phidgets we recommend using the HelloWorld example as it will work with every Phidget device and it fairly easy to understand.  &lt;br /&gt;
&lt;br /&gt;
Open the HelloWorld example and before anything, run it.  You should see a window that looks like this:&lt;br /&gt;
&lt;br /&gt;
[[image:xcodehelloworld1.png|600px|link=]]&lt;br /&gt;
&lt;br /&gt;
The window will list every Phidgets device connected to the system.  In addition to this it will register when devices are connected or disconnected from the system.  Now go and find the example project for your specific device.  You can run this is the exact same way.  After that you can take a look at the code and see how things work.  While you are doing that you can refer to the [[#Follow The Examples|Follow the Examples]] section to guide you through all the parts of the example project.&lt;br /&gt;
&lt;br /&gt;
====Write Your Own Code====&lt;br /&gt;
&lt;br /&gt;
First, generate a new Cocoa project with a descriptive name such as PhidgetTest. &lt;br /&gt;
&lt;br /&gt;
Then, add the Phidget21 Framework (Groups &amp;amp; Files &amp;amp;rarr; Frameworks &amp;amp;rarr; Other Frameworks).&lt;br /&gt;
&lt;br /&gt;
Then, create a new Objective-C class with a descriptive name. For the purpose of this guide, the class name will be PhidgetInterfaceKit. &lt;br /&gt;
&lt;br /&gt;
At this point, a header file(.h) as well as an implementation file(.m) will automatically be created. Open the header file for editing, and add a reference to phidget21.h: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=objc&amp;gt;&lt;br /&gt;
  #import &amp;lt;Phidget21/phidget21.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say you want to use a text field to capture output. Add a text field outlet in the header file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=objc&amp;gt;&lt;br /&gt;
  @interface PhidgetInterfaceKit : NSObject{&lt;br /&gt;
    IBOutlet NSTextField *sensorValueTxt;&lt;br /&gt;
  }&lt;br /&gt;
  @end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, in Groups &amp;amp; Files &amp;amp;rarr; Resources, open up MainMenu.nib to bring up the Interface Builder. Drag a text field from the Library to the Window.  &lt;br /&gt;
&lt;br /&gt;
Now, an instance of the PhidgetInterfaceKit class will need to be created:&lt;br /&gt;
#In the Library, drag an object to the MainMenu.nib Window.  &lt;br /&gt;
#In the Identity tab of the Inspector for this object, add the PhidgetInterfaceKit class. &lt;br /&gt;
#Connect the PhidgetInterfaceKit class instance to the text field. &lt;br /&gt;
The project now has access to Phidgets and we are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Your main reference for writing Cocoa code will be our C/C++ API information, with syntax for all of our functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in AppleScript|[{{SERVER}}/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
===Code Snippets===&lt;br /&gt;
&lt;br /&gt;
Specific calls in Cocoa will differ in syntax from those on the [[General Phidget Programming]] page, but the concepts stay the same.  &lt;br /&gt;
&lt;br /&gt;
It may help to have the [[General Phidget Programming]] page and this section open at the same time, because they parallel each other and you can refer to the Cocoa syntax.  However, &#039;&#039;many&#039;&#039; additional concepts are covered on the General Phidget Programming page on a high level, such as using multiple Phidgets, handling errors, and different styles of programming.&lt;br /&gt;
&lt;br /&gt;
====Step One: Initialize and Open====&lt;br /&gt;
&lt;br /&gt;
First, make sure you have given your program access to Phidgets as described in the [[#Write Your Own Code | Write Your Own Code]] section. Then, you will need to declare your Phidget variable in your code.  For example, we can declare a Phidget Interface Kit in the .m implementation file with:&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=objc&amp;gt;&lt;br /&gt;
  CPhidgetInterfaceKitHandle ifkit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The object name for any type of Phidget - Temperature Sensor, Spatial, Motor Controller, etc - is listed in the API manual. Every type of Phidget also inherits functionality from the Phidget base class.&lt;br /&gt;
&lt;br /&gt;
Next, the Phidget object needs to be initialized and the program needs to try and connect to the Phidget through a call to open(). Open will tell the program to continuously try to connect to a Phidget, based on the parameters given, even trying to reconnect if it gets disconnected. For example, we can connect to a Phidget Interface Kit in the .m implementation file with:&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=objc&amp;gt;&lt;br /&gt;
  @implementation PhidgetInterfaceKit&lt;br /&gt;
  - (void)awakeFromNib&lt;br /&gt;
  {&lt;br /&gt;
    CPhidgetInterfaceKit_create(&amp;amp;ifkit);   &lt;br /&gt;
    CPhidget_open((CPhidgetHandle)ifkit, -1);&lt;br /&gt;
  }&lt;br /&gt;
  @end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The different types of open can be used with parameters to try and get the first device it can find, open based on its serial number, or even open across the network. The API manual lists all of the available modes that open provides. One important thing to remember is that when working with Phidgets, a local connection will reserve the device until closed. This prevents any other instances from retrieving data from the Phidget, including other programs. The one connection per device limit does not apply when exclusively using the [[Phidget WebService]].&lt;br /&gt;
&lt;br /&gt;
====Step Two: Wait for Attachment (plugging in) of the Phidget====&lt;br /&gt;
&lt;br /&gt;
Simply calling open does not guarantee you can use the Phidget immediately. To use the Phidget, it must be plugged in (attached).  We can handle this by using event driven programming and tracking the AttachEvents and DetachEvents, or by calling waitForAttachment. WaitForAttachment will block indefinitely until a connection is made to the Phidget, or an optional timeout is exceeded. &lt;br /&gt;
&lt;br /&gt;
To instead use events to handle attachment, first you declare the function that will be called when an Attach event is fired - in this case we call the function {{Code|gotAttach}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=objc&amp;gt;&lt;br /&gt;
int gotAttach(CPhidgetHandle phid, void *context) {&lt;br /&gt;
	[(id)context performSelectorOnMainThread:@selector(phidgetAdded:) withObject:nil waitUntilDone:NO];&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, after our {{Code|create}} call [[#Step One: Initialize and Open|in the Step One code snippet]], but before our {{Code|open}} call, we hook our {{Code|gotAttach}} event function into our Phidget software object with the {{Code|CPhidget_set_OnAttach_Handler}} function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=objc&amp;gt;&lt;br /&gt;
CPhidget_set_OnAttach_Handler((CPhidgetHandle)ifkit, gotAttach, self);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check our examples for putting these attachment calls into the context of your larger program.&lt;br /&gt;
&lt;br /&gt;
====Step Three: Do Things with the Phidget====&lt;br /&gt;
&lt;br /&gt;
We recommend the use of event driven programming when working with Phidgets. In a similar way to [[#Step Two: Wait for Attachment (plugging in) of the Phidget|handling an attach event]] as described above, we can hook an event handler at loading with the following code:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=objc&amp;gt;&lt;br /&gt;
  CPhidgetInterfaceKit_set_OnSensorChange_Handler(ifkit, gotSensorChange, self);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
A call like this connects a function and an event.  In this case, the {{Code|CPhidgetInterfaceKit_set_OnSensorChange_Handler}} hook connects the {{Code|gotSensorChange}} function to the event of a sensor (black analog input port) changing value on a Phidget Interface Kit.  Next, the callback method {{Code|gotSensorChange}} needs to be set up before it can be used. For example,&lt;br /&gt;
     &lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=objc&amp;gt;&lt;br /&gt;
int gotSensorChange(CPhidgetInterfaceKitHandle phid, void *context, int ind, int val)&lt;br /&gt;
  {&lt;br /&gt;
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];&lt;br /&gt;
    [(id)context performSelectorOnMainThread:@selector(SensorChange:)&lt;br /&gt;
    withObject:[NSArray arrayWithObjects:[NSNumber numberWithInt:ind], [NSNumber numberWithInt:val], nil] waitUntilDone:NO];&lt;br /&gt;
    [pool release];&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Above, the SensorChange method is invoked on the main thread. Event data is stored in a {{Code|NSArray}}, which in turn is sent as a single argument to the SensorChange method.  The {{Code|NSAutoreleasePool}} object is created to clean up released objects on the event thread, and is released at the end of the method. &lt;br /&gt;
&lt;br /&gt;
The method calls selector on the SensorChange method, which is defined as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=objc&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  - (void)SensorChange:(NSArray *)sensorChangeData&lt;br /&gt;
  {&lt;br /&gt;
    int sensorIndex, sensorValue;&lt;br /&gt;
    sensorIndex = [[sensorChangeData objectAtIndex:0] intValue];&lt;br /&gt;
    sensorValue = [[sensorChangeData objectAtIndex:1] intValue];&lt;br /&gt;
    [sensorValueTxt setStringValue:[NSString stringWithFormat:@&amp;quot;Sensor: %d, Value: &lt;br /&gt;
    %d&amp;quot;, sensorIndex, sensorValue]];&lt;br /&gt;
  } &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this series of declarations and functions, the code inside SensorChange will get executed every time the PhidgetInterfaceKit reports a change on one of its analog inputs. Some events such as Attach and Detach belong to the base Phidget object and thus are common to all types of Phidgets. &lt;br /&gt;
Please refer to the API manual and the Cocoa examples for a list of events and their usage. &lt;br /&gt;
&lt;br /&gt;
Some values can be read and sent directly to the Phidget, simply use the C API functions such as CPhidgetInterfaceKit_getSensorValue() for PhidgetInterfaceKits.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=objc&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  int sensorValue;&lt;br /&gt;
  CPhidgetInterfaceKit_getSensorValue(ifkit, 0, &amp;amp;sensorValue);&lt;br /&gt;
  [sensorValueTxt setintValue: sensorValue];&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
These functions can be used inside a polling loop as an alternative to event driven programming.&lt;br /&gt;
&lt;br /&gt;
====Step Four: Close and Delete====&lt;br /&gt;
&lt;br /&gt;
At the end of your program, don’t forget to call close to free any locks on the Phidget:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=objc&amp;gt;&lt;br /&gt;
  CPhidget_close((CPhidgetHandle)ifkit);&lt;br /&gt;
  CPhidget_delete((CPhidgetHandle)ifkit);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MoreHowTos}}&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
None at this time.&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=OS_-_Linux&amp;diff=23974</id>
		<title>OS - Linux</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=OS_-_Linux&amp;diff=23974"/>
		<updated>2017-09-18T17:17:53Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
{{OSLang|[[File:icon-Linux.png|64x64px|link=OS - Linux]]|On Linux, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#WebService | WebService]].}}&lt;br /&gt;
__TOC__&lt;br /&gt;
 &lt;br /&gt;
You need kernel &#039;&#039;&#039;version 2.6&#039;&#039;&#039; (released in 2003) or later.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Linux has complete support for all Phidgets and their software APIs; the only thing it lacks when compared to Windows and OS X is a graphical user interface.  We walk you through all steps for download,  installation, checking, and starting to write code below.  &lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the downloads:&lt;br /&gt;
*[{{SERVER}}/downloads/phidget21/libraries/linux/libphidget.tar.gz Phidget Libraries for Linux]&lt;br /&gt;
*[{{SERVER}}/downloads/phidget21/servers/linux/phidgetwebservice.tar.gz Phidget WebService for Linux]&lt;br /&gt;
*[[Software License]]&lt;br /&gt;
&lt;br /&gt;
If you need old versions of the libraries, [{{SERVER}}/downloads/phidget21/libraries/linux/libphidget/ click here].&lt;br /&gt;
&lt;br /&gt;
==Getting Started with Linux==&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|6pXWhGzX4Fg}}&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
#Install libusb-1.0 development libraries - {{Code|libusb-1.0-0-dev}}.  &lt;br /&gt;
#*Note that libusb-1.0 may be already on your system, but the development libraries probably aren&#039;t.&lt;br /&gt;
#*Search for {{Code|libusb-1.0-0-dev}} or similar in your distribution package directory.&lt;br /&gt;
#*Or install [http://libusb.info/ from source].&lt;br /&gt;
#Unpack and install the [{{SERVER}}/downloads/phidget21/libraries/linux/libphidget.tar.gz Phidget Libraries]&lt;br /&gt;
#*From the main unpacked libraries directory, run:&lt;br /&gt;
#*:{{Code|./configure}}&lt;br /&gt;
#*:{{Code|make}}&lt;br /&gt;
#*:{{Code|sudo make install}}&lt;br /&gt;
#*This will compile phidget21.h and place the library into your gcc path&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Although these libraries are written in C, the additional libraries for Python, Java, and most other Phidget-supported languages depend on them.&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface.  It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
To confirm that the libraries were installed correctly and can be used in code, you can use the [{{SERVER}}/downloads/phidget21/examples/c/phidget21-c-examples.tar.gz Phidget Generic C Examples].&lt;br /&gt;
&lt;br /&gt;
The easiest way to confirm correct installation will be to compile and run the {{Code|HelloWorld}} C example, included in the examples download.  This does not involve writing any C code, but it does involve compiling the example and running it, which is a quick process as we show below.  If you feel more comfortable running the {{Code|HelloWorld}} example for your specific language, you can skip below and pick your language, but keep in mind that any problems could be with the C library installation and not necessarily with your language.&lt;br /&gt;
&lt;br /&gt;
To compile and run the basic C example for checking your installation:&lt;br /&gt;
&lt;br /&gt;
1. Unpack the Phidget Generic C Examples&amp;lt;br&amp;gt;&lt;br /&gt;
2. Open a terminal (often Ctrl-Alt-T) and go to the directory where the examples are unpacked&amp;lt;br&amp;gt;&lt;br /&gt;
3. Compile the {{Code|HelloWorld.c}} example:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 gcc HelloWorld.c -o HelloWorld -lphidget21&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
4. Run the {{Code|HelloWorld}} example:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 sudo ./HelloWorld&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
(The sudo is needed for USB access for now, see the [[#Setting udev Rules|Setting udev Rules]] section for how to change this)&lt;br /&gt;
&lt;br /&gt;
The {{Code|-lphidget21}} will look in the standard library location for your Linux distribution (usually {{Code|/usr/lib/}}) for the Phidget 21 library file.  Generally, libraries to be linked on Linux through {{Code|gcc}} have a naming convention.  For example, {{Code|-lphidget21}} looks for the binary files &#039;&#039;&#039;{{Code|libphidget21.a}}&#039;&#039;&#039; and &#039;&#039;&#039;{{Code|libphidget21.so}}&#039;&#039;&#039; in the library location.  These files are automatically put in the library location during the {{Code|make install}} step of [[#Installing | installing the libraries]].&lt;br /&gt;
&lt;br /&gt;
The HelloWorld program will simply print out basic information for any device you plug in, and print a message upon unplugging the device.  For example, starting the program, plugging in an Interface Kit Phidget, unplugging the Interface Kit, and pressing Enter displays:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 $ sudo ./HelloWorld &lt;br /&gt;
   &lt;br /&gt;
 Opening...&lt;br /&gt;
 Press Enter to end&lt;br /&gt;
&lt;br /&gt;
 Hello to Device Phidget InterfaceKit 8/8/8, Serial Number: 37299&lt;br /&gt;
 Goodbye Device Phidget InterfaceKit 8/8/8, Serial Number: 37299&lt;br /&gt;
&lt;br /&gt;
 Closing...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
If the out-of-the-box examples do not work, make sure the Phidget is seen by your USB interface.  To check this, you can use the kernel log reader {{Code|dmesg}}.  Pipe the output of {{Code|dmesg}} into the utility {{Code|tail}} to read the last ten lines of the log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; dmesg | tail&lt;br /&gt;
 ....(9 lines)....&lt;br /&gt;
 [24344.013638] usb 2-1.2: new low speed USB device number 5 using ehci_hcd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The number between the [ ] is the system time in seconds since the last boot up, so you can tell whether the event was recent or not.  (This will also tell you the interrupt type of Phidget that is registered by the USB interface, see the [[#Common Problems and Solutions | common problems section below]] for more information on what this means.)&lt;br /&gt;
&lt;br /&gt;
The Phidget should both connect and disconnect properly, so unplugging it should result in an additional line at the tail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; dmesg | tail&lt;br /&gt;
 ....(8 lines)....&lt;br /&gt;
 [24344.013638] usb 2-1.2: new low speed USB device number 5 using ehci_hcd&lt;br /&gt;
 [25094.809328] usb 2-1.2: USB disconnect, device number 5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see similar lines to these at the tail of your kernel log, take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* You are running the example program as root (or your udev rules have been set properly)&lt;br /&gt;
* You are using libusb 1.0 (not the older 0.1 release)&lt;br /&gt;
* You have compiled versions of libphidget21.a and libphidget21.so in your system library location (usually {{Code|/usr/lib}})&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Quick Downloads| quick downloads section]] to download them)&lt;br /&gt;
* Your Linux kernel version is 2.6 or later (type {{Code|uname -r}} in a terminal to get your kernel version)&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Us|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
Now that you have the basic libraries installed, you can pick your language and begin programming!  &lt;br /&gt;
&lt;br /&gt;
If you are not using the [[#WebService | webservice]] (discussed below) to control a Phidget over a network, your next step will be to delve into the use of your specific language.  Each page has its own set of specific libraries, code examples, and setup instructions.  &lt;br /&gt;
&lt;br /&gt;
On Linux, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Java | Java]]&lt;br /&gt;
*[[Language - Python | Python]]&lt;br /&gt;
*[[Language - Ruby | Ruby]]&lt;br /&gt;
*[[Language - C Sharp | C#]] (Using [[Language - C Sharp#Mono|Mono]])&lt;br /&gt;
*[[Language - Flash AS3 | Flash AS3]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
==WebService==&lt;br /&gt;
&lt;br /&gt;
The Phidget WebService allows you to remotely control a Phidget over a network.&amp;lt;br&amp;gt;This section helps you install, check, and use the WebService on Linux, but we also have an overview of the [[Phidget WebService]] in general.&lt;br /&gt;
&lt;br /&gt;
===Installing the WebService===&lt;br /&gt;
&lt;br /&gt;
To install the webservice, you must first have the [[#Installing|Phidget libraries installed]].  Then, follow these steps:&lt;br /&gt;
&lt;br /&gt;
#Download &#039;&#039;&#039;avahi&#039;&#039;&#039; and its development libraries (mdnsresponder/bonjour is also an option, see the [[#WebService with mDNSResponder|webservice with mDNSResponder]] section)&lt;br /&gt;
#*Try {{Code|apt-cache search avahi}} in a terminal to find current packages&lt;br /&gt;
#*Often, this is installed in a default system, you may already have it&lt;br /&gt;
#Unpack and install the [{{SERVER}}/downloads/phidget21/servers/linux/phidgetwebservice.tar.gz Phidgets WebService] source code tarball for Linux&lt;br /&gt;
#*From the unpacked WebService source code directory, run:&lt;br /&gt;
#*:{{Code|./configure}}&lt;br /&gt;
#*:{{Code|make}}&lt;br /&gt;
#*:{{Code|sudo make install}}&lt;br /&gt;
#*This will compile the executable {{Code|phidgetwebservice21}} and place it into {{Code|/usr/bin/phidgetwebservice21}}&lt;br /&gt;
&lt;br /&gt;
====WebService with BSD====&lt;br /&gt;
&lt;br /&gt;
For &#039;&#039;&#039;BSD&#039;&#039;&#039;, the webservice has been found to work (BSD 8+) but requires a special configuration at the {{Code|./configure}} step:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 ./configure LIBS=/usr/lib/libphidget21.so CFLAGS=-pthread&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then {{Code|make}} and {{Code|sudo make install}} are the same.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The {{Code|LIBS}} argument may not be necessary, but sometimes BSD has trouble finding the library install location.  The {{Code|CFLAGS}} argument is needed because BSD needs explicit linking for using threads.&lt;br /&gt;
&lt;br /&gt;
====WebService with mDNSResponder====&lt;br /&gt;
&lt;br /&gt;
To use &#039;&#039;&#039;mdnsresponder&#039;&#039;&#039; instead of avahi, change the configure script to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 ./configure --enable-zeroconf=bonjour&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(To see all options, use {{Code|./configure --help}} like you would any configure script)&lt;br /&gt;
&lt;br /&gt;
===Setting Up the WebService===&lt;br /&gt;
&lt;br /&gt;
To set up and use the webservice, it helps to have [[#Setting udev Rules|set your udev rules]].  Otherwise, you must run the webservice as root.&lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|phidgetwebservice21}} by using the {{Code|-h}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
$ phidgetwebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see this help regardless of whether the webservice was correctly hooked in to avahi.  In fact, you will see it even if you explicitly disabled mDNS in the {{Code|./configure}} step at compile:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  ./configure --disable-zeroconf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(To see all options, use {{Code|./configure --help}} like you would any configure script)&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, use {{Code|hostname}} on the command line.&lt;br /&gt;
*For your IP address, use {{Code|ifconfig -a}} on the command line.&lt;br /&gt;
**A line in the return text, under your main internet connection (usually {{Code|eth0}}) will say something like {{Code|inet addr:192.168.3.178}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Using a server name to connect would not be an option without avahi or some other mDNS service; in this case you would only have the option to use an IP address.&lt;br /&gt;
&lt;br /&gt;
===Using the WebService===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the webservice, you&#039;ll want to:&lt;br /&gt;
* Obtain code you can use to open a Phidget remotely&lt;br /&gt;
* Start the webservice on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on Linux is simply to set up the webservice and run the Phidget program on the same computer, using the loopback interface.  Later, you can replace one of the two ends with a different computer and/or operating system.&lt;br /&gt;
&lt;br /&gt;
To quickly create code to run remotely, in our examples we include commented out lines with openRemote() function calls of different types.  In the C example for your device, find the line that says:&lt;br /&gt;
&lt;br /&gt;
{{Code|CPhidget_open((CPhidgetHandle) device, -1)}}&lt;br /&gt;
&lt;br /&gt;
and change it to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 int serial_number = 37299&lt;br /&gt;
 CPhidget_openRemoteIP ((CPhidgetHandle) device, serial_number, &amp;quot;127.0.0.1&amp;quot;, 5001, NULL)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Except that you should replace &#039;&#039;&#039;37299&#039;&#039;&#039; with the serial number of your Phidget, which you can obtain from either the Phidget board itself, or from when you [[#Checking|ran the HelloWorld example code]].  The IP address &amp;quot;127.0.0.1&amp;quot; simply loops back to the same computer, and 5001 is the default port as found from using {{Code|phidget21webservice -h}} in [[#Setting Up the WebService|the Setting Up the WebService]] section.  The NULL is used to not specify a password.&lt;br /&gt;
&lt;br /&gt;
Save the changed example under a different filename.  In the walkthrough here, we are using the {{Code|InterfaceKit.c}} example, and we rename it to be {{Code|InterfaceKitRemote.c}}&lt;br /&gt;
&lt;br /&gt;
Compile your new C file. In our {{Code|InterfaceKitRemote.c}} case, this would be by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 gcc InterfaceKitRemote.c -o InterfaceKitRemote -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Start two terminals to run this test, usually opened via Ctrl-Alt-T.  Your [[#Setting udev Rules|udev rules]] need to be set up or you should use sudo for every command.  First, start the webservice in Terminal #1:&lt;br /&gt;
&lt;br /&gt;
[[Image:Linux_ws_start.png|link=]]&lt;br /&gt;
&lt;br /&gt;
This will broadcast any Phidget events, and receive any Phidget requests, both over the network.&lt;br /&gt;
&lt;br /&gt;
2. Start the InterfaceKitRemote program that you just compiled which will open the remote Phidget.  In this case, it is {{Code|InterfaceKitRemote}}:&lt;br /&gt;
&lt;br /&gt;
[[Image:Linux_ws_step2.png|link=]]&lt;br /&gt;
&lt;br /&gt;
3. Now, plug in the Phidget!  The {{Code|phidget21webservice}} program captures the attach and other events and sends them out over the network (in the background in Terminal #1) and the Phidget software objected opened with openRemote in Terminal #2 receives them:&lt;br /&gt;
&lt;br /&gt;
[[Image:Linux_ws_step3.png|link=]]&lt;br /&gt;
&lt;br /&gt;
4. You can confirm that the webservice was indeed behind this exchange by killing the webservice process while still allowing the remote program to run:&lt;br /&gt;
&lt;br /&gt;
[[Image:Linux_ws_step4.png|link=]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the WebService===&lt;br /&gt;
&lt;br /&gt;
In addition to enabling [[General Phidget Programming#Logging|logging]] in your Phidget code, you can get additional debugging information from the WebService itself.  This additional debugging is enabled via a re-compile of the webservice.  From the webservice source code directory, do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 make clean&lt;br /&gt;
&lt;br /&gt;
 ./configure --enable-debug&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
 sudo make install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you suspect multicast DNS (mDNS) may be the problem, you can:&lt;br /&gt;
* Try compiling the webservice with mDNSResponder, as described in [[#Installing the WebService|Installing the WebService]], or &lt;br /&gt;
* Try compiling the webservice completely without mDNS, as described in [[#Setting Up the WebService|Setting Up the WebService]]&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Setting udev Rules===&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t want to be using {{Code|sudo}} to run Phidget programs (including the webservice) forever, you will want to create a {{Code|udev}} rule to allow yourself access to the Phidget when you are not root.&lt;br /&gt;
&lt;br /&gt;
Udev has an easy way to set the owner and permissions of the USB interface of the Phidget - it finds all devices that match a given set of rules, and applies new traits to them.  But you need to give udev something to match in order to apply the new settings.  Here, we will tell udev to match the vendor code for Phidgets, Inc.  &lt;br /&gt;
&lt;br /&gt;
We recommend that you use the rules file included in the library download you have already installed.  Check the README file included in that download for information on how exactly to install it.  &lt;br /&gt;
&lt;br /&gt;
The rules for udev are kept in files in {{Code|/etc/udev/rules.d/}} and are traditionally grouped into order of running (10 runs before 20, 30, etc) and device type (cd, network, etc).  There should be one or more files in there already - if this is your first time editing udev rules take a look at them to see the syntax to use:&lt;br /&gt;
* Commas separate each pair with == or =&lt;br /&gt;
* One rule on each line, no line breaks&lt;br /&gt;
* Quotes around the value to be matched or changed&lt;br /&gt;
* Comments can be added on lines starting with #&lt;br /&gt;
&lt;br /&gt;
Strictly speaking, the files run in lexical order (i.e. the order they&#039;re listed when you use {{Code|ls}}).  A device can match many rules, and all will apply (if possible).  If conflicting rules are found, the first rule found is followed.&lt;br /&gt;
&lt;br /&gt;
===Starting the WebService at Boot===&lt;br /&gt;
&lt;br /&gt;
If you are tired of starting the webservice on the command line all the time, you can have the webservice start when your system starts, every time.&lt;br /&gt;
&lt;br /&gt;
====User Space====&lt;br /&gt;
&lt;br /&gt;
If you are running a standard Linux machine with an X-server (Unity, KDE) the easiest way to do this is to have the Phidget WebService start when your x server starts.&lt;br /&gt;
&lt;br /&gt;
In this case, the webservice will be running in user space, so your [[#Setting udev Rules|udev rules need to be set up]] for the your user permissions to be able to access the USB ports using libusb.&lt;br /&gt;
&lt;br /&gt;
Within the X-windowing system, there is usually some sort of {{Code|System &amp;amp;rarr; Settings/Preferences &amp;amp;rarr; Startup}} that you can choose to add programs that start when a user session starts.  On Ubuntu you can use Unity to find programs listing &amp;quot;startup&amp;quot; in their names to accomplish the same thing.  This will eventually lead you to a graphical tool like this to simply add the {{Code|/usr/bin/phidgetwebservice21}} program:&lt;br /&gt;
&lt;br /&gt;
[[Image:linux_ws_boot.png|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====As A Service====&lt;br /&gt;
&lt;br /&gt;
You would want to set the boot start of {{Code|phidgetwebservice21}} to be a service if you are running a server, or a headless machine.  It is handy any time you need the webservice to be started as a booted, respawning service with a presence in different run levels and for all users.&lt;br /&gt;
&lt;br /&gt;
A service is essentially a program that hangs out in the background, waiting to be used by some incoming task.  When the service is needed, the service forks a program to handle that need.  Most services that run on your Linux computer already have the ability to fork themselves.  &lt;br /&gt;
&lt;br /&gt;
The webservice, however, is just a binary on Linux - {{Code|phidgetwebservice21}} - and so we need a program that handles the forking for us.  For this, we use the {{Code|start-stop-daemon}} program to spawn a standalone process for us, or kill it, based on our service-like start, stop, and restart commands.&lt;br /&gt;
&lt;br /&gt;
To do this, we need:&lt;br /&gt;
# A script that tells the boot process how to start and handle the webservice (i.e. by using {{Code|start-stop-daemon}})&lt;br /&gt;
# A link from that script to the boot list&lt;br /&gt;
# An initialization file for the script&lt;br /&gt;
&lt;br /&gt;
First, the script.  We will walk through Debian here, both because it is such a common distribution and because it is the distribution that our [{{SERVER}}/products.php?product_id=1073 Single Board Computer] runs.  But {{Code|init}} is surprisingly diverse on Linux, including everything from a different boot order, to different initialization programs and structure, and even different runlevels.  &lt;br /&gt;
&lt;br /&gt;
On Debian (including Ubuntu), the initialization script covers:&lt;br /&gt;
* Runlevels that the service should be present on&lt;br /&gt;
* Dependencies of the service&lt;br /&gt;
* Name of the service and other informative data&lt;br /&gt;
* The location of the PIDFILE, which stores the process ID (pid) for later dealing with a spawned instance&lt;br /&gt;
* Any configuration file locations&lt;br /&gt;
* What to do when the service is given instructions to &#039;&#039;&#039;start&#039;&#039;&#039;, &#039;&#039;&#039;stop&#039;&#039;&#039;, or &#039;&#039;&#039;reload&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The Debian script we use to start the webservice on the [{{SERVER}}/products.php?product_id=1073 Single Board Computer]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight line start=&amp;quot;1&amp;quot; lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          phidgetwebservice&lt;br /&gt;
# Required-Start:    $network $remote_fs&lt;br /&gt;
# Required-Stop:     $network $remote_fs&lt;br /&gt;
# Should-Start:      avahi&lt;br /&gt;
# Should-Stop:       avahi&lt;br /&gt;
# Default-Start:     2 3 4 5&lt;br /&gt;
# Default-Stop:      0 1 6&lt;br /&gt;
# Short-Description: Phidget WebService&lt;br /&gt;
# Description:       Phidget WebService for controlling Phidgets over the network.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&lt;br /&gt;
DESC=&amp;quot;Phidget WebService&amp;quot;&lt;br /&gt;
NAME=phidgetwebservice&lt;br /&gt;
BIN=phidgetwebservice21&lt;br /&gt;
DAEMON=/usr/bin/$BIN&lt;br /&gt;
PIDFILE=/var/run/$NAME.pid&lt;br /&gt;
CFG=/etc/default/$NAME&lt;br /&gt;
&lt;br /&gt;
# Gracefully exit if the package has been removed.&lt;br /&gt;
test -x $DAEMON || exit 0&lt;br /&gt;
&lt;br /&gt;
# load config&lt;br /&gt;
pws_port=&amp;quot;5001&amp;quot;&lt;br /&gt;
pws_serverid=&amp;quot;&amp;quot;&lt;br /&gt;
pws_password=&amp;quot;&amp;quot;&lt;br /&gt;
[ -f $CFG ] &amp;amp;&amp;amp; . $CFG&lt;br /&gt;
&lt;br /&gt;
start() {&lt;br /&gt;
	[ -z &amp;quot;$pws_port&amp;quot; ] || OPTIONS=&amp;quot;-p $pws_port &amp;quot;&lt;br /&gt;
	[ -z &amp;quot;$pws_password&amp;quot; ] || OPTIONS=&amp;quot;$OPTIONS-P $pws_password &amp;quot;&lt;br /&gt;
&lt;br /&gt;
	if [ -z &amp;quot;$pws_serverid&amp;quot; ]; then&lt;br /&gt;
		OPTIONS=&amp;quot;$OPTIONS -n $( hostname )&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		OPTIONS=&amp;quot;$OPTIONS -n $pws_serverid&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
	echo -n &amp;quot;Starting $DESC: &amp;quot;&lt;br /&gt;
	start-stop-daemon -S -b -q -p $PIDFILE -m -x $DAEMON -- $OPTIONS &amp;amp;&amp;amp; echo &amp;quot;OK&amp;quot; || echo &amp;quot;ALREADY RUNNING&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
stop() {&lt;br /&gt;
	echo -n &amp;quot;Stopping $DESC: &amp;quot;&lt;br /&gt;
	start-stop-daemon -K -q -p $PIDFILE -x $DAEMON &amp;amp;&amp;amp; echo &amp;quot;OK&amp;quot; || echo &amp;quot;NOT RUNNING&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
  start)&lt;br /&gt;
	start&lt;br /&gt;
	;;&lt;br /&gt;
  stop)&lt;br /&gt;
	stop&lt;br /&gt;
	;;&lt;br /&gt;
  restart|force-reload)&lt;br /&gt;
	stop&lt;br /&gt;
	sleep 1&lt;br /&gt;
	start&lt;br /&gt;
	;;&lt;br /&gt;
  *)&lt;br /&gt;
	echo &amp;quot;Usage: $0 {start|stop|restart}&amp;quot;&lt;br /&gt;
esac&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Save the script into a file called {{Code|phidgetwebservice}}, and use {{Code|chmod 755}} to make it executable.&lt;br /&gt;
&lt;br /&gt;
Also on Debian, startup service scripts should go in {{Code|/etc/init.d}}, and then put within the appropriate runlevel-numbered folder - by symbolic link.  There is a handy tool to do this for you, called {{Code|insserv}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 sudo insserv -d phidgetwebservice&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The {{Code|insserv}} program is the program that makes use of the {{Code|### BEGIN INIT INFO...### END INIT INFO}} that appears at the top of the {{Code|phidgetwebservice}} script.  Use {{Code|man insserv}} for more information.  The {{Code|insserv}} tool handles the mess of finding the right runlevel folders (i.e. the {{Code|rc.d}} numbered folders) and making the appropriate links. You can see what links would be updated by running {{Code|insserv}} with the {{Code|-n}} option, for a dry run.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When you run {{Code|insserv}}, all of the dependencies for the boot order are re-written.  This means that all of the initialization scripts in {{Code|/etc/init.d}} are re-examined.  So, you&#039;ll probably get a lot of output when you run the command.&lt;br /&gt;
&lt;br /&gt;
Then, you can check that {{Code|phidgetwebservice}} is on the service list with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 service --status-all&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And you can start it right now without rebooting like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:linux_system_service_start.png|link=]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|service}} command has many options to start and stop services like the phidgetwebservice, try {{Code|man service}} for more information.&lt;br /&gt;
&lt;br /&gt;
At this point, you can follow the client instructions on [[#Using the WebService|using the webservice]] to create a loopback test for the new webservice service that should now be running.&lt;br /&gt;
&lt;br /&gt;
The final piece, for future configuration changes, is that the {{Code|/etc/init.d}} script looks for the file {{Code|/etc/default/phidgetwebservice}} upon starting up.  The file is expected to contain the port, server ID, and password for the server side of the webservice.  These are also set in the {{Code|phidgetwebservice}} script in {{Code|init.d}}, as you can see from reading the code above, but if you want to change them a lot, you can edit the configuration file rather than changing the {{Code|phidgetwebservice}} script and re-installing by {{Code|insserv}} every time.  The configuration file in {{Code|/etc/default/}} should contain the same syntax as that used in the script source above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 pws_port=&amp;quot;5001&amp;quot;&lt;br /&gt;
 pws_serverid=&amp;quot;&amp;quot;&lt;br /&gt;
 pws_password=&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Cross-Compiling with a Custom Toolchain===&lt;br /&gt;
&lt;br /&gt;
This would allow you to have the Phidget libraries compiled to include in code for an embedded device.  When developing for an embedded device, you will often write code for it on your &#039;normal&#039; computer, and then build the code to binary with a different target than the processor in your computer.  Many microcontrollers do not have the ability to run a full operating system, and hence cannot compile code natively.  &lt;br /&gt;
&lt;br /&gt;
The collection of tools used to create binary code for a separate system is called a &#039;&#039;toolchain&#039;&#039;.  Compiling the Phidget libraries specifically for an embedded system, and placing them into the path for writing code on top of the libraries is like adding another link in this chain.&lt;br /&gt;
&lt;br /&gt;
You can use the typical {{Code|./configure}} setup for custom build targets:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
./configure --prefix=toolchain_location --build=this_system --host=target_system&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the Phidget libraries, the {{Code|./configure}} tool works this way as well. You&#039;d use this in the [[#Installing|install the libraries section]] setup. For example, let&#039;s say you&#039;re building the libraries to develop code for the [{{SERVER}}/products.php?product_id=1073 Single Board Computer] as a target.  Your system is a standard Linux system (i686-pc-linux-gnu) and the target system for the SBC is {{Code|arm-linux-gnueabi}}.  For this target, you&#039;ll need the base of the GNU embedded Debian chain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 sudo apt-get install gcc-arm-linux-gnueabi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, download the Phidget libraries [[#Quick Downloads|above]] and unpack them into a folder {{Code|phidget_libraries}}.  If {{Code|/usr/arm-linux-gnueabi}} is the location of your ARM toolchain (downloaded above in {{Code|gcc-arm-linux-gnueabi}}), type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 ~/phidget_libraries $&amp;gt; ./configure --prefix=/usr/arm-linux-gnueabi --build=i686-pc-linux-gnu --host=arm-linux-gnueabi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Linux on Non-Standard Systems===&lt;br /&gt;
&lt;br /&gt;
We occasionally get requests to use Phidgets on Linux systems other than a standard laptop or desktop.  One example is the Raspberry Pi system.  Often these systems include USB ports, so the combination makes sense.&lt;br /&gt;
&lt;br /&gt;
Our libraries are installed by building from source, and their main dependency is the {{Code|libusb-1.0-0-dev}} library, so if you can get gcc on your machine (or set up a cross compiler for it) and you can also install the libusb-1.0 development headers, you can probably get Phidgets to work.  Of course, we don&#039;t offer much support for these systems, so - depending on your system - expect to spend some raw time getting it up and going.  &lt;br /&gt;
&lt;br /&gt;
If you&#039;re new to the embedded computer thing, keep in mind that for these super basic systems, once you&#039;ve gotten a power supply, and storage, and put the kernel you want on it, and then spent a couple of days of time getting things working, and  more time getting your drivers going, costs add up pretty quickly.  If you want a compact system that works right out of the box (and which can use all of our analog sensors in addition to our USB Phidgets), check out our [{{SERVER}}/products.php?product_id=1073 Single Board Computer].   Our SBC3:&lt;br /&gt;
* Has many more USB ports than super-stripped devices, and also has digital and analog ports &lt;br /&gt;
* Includes a power supply and can run on batteries easily&lt;br /&gt;
* Has a nice amount of RAM, a decent embedded processor, and built-in onboard storage (we&#039;ve run R, GRASS, and X11 on it)&lt;br /&gt;
* Includes installed Debian, working Phidget drivers, and [[Phidget WebService|networked Phidget drivers]] from the moment it ships &lt;br /&gt;
* Has access to the full Debian repository including Python, Mono .NET, Ruby, and gcc&lt;br /&gt;
* Has a kernel development kit with patch file and instructions for adding new drivers (bluetooth, wireless, and so on)&lt;br /&gt;
* Comes with very in-depth documentation and technical support by phone and email &lt;br /&gt;
* Etc, etc.&lt;br /&gt;
The [[Phidget WebService|networked support]] in particular allows it to work with your cell phone and more.  &lt;br /&gt;
&lt;br /&gt;
But if you really do want a raw hobbyist system to tinker with, go for it!  We&#039;re all nerds here - we&#039;ve been there too and we certainly understand!&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|Low Speed Phidgets (Max of 8)|Linux will only schedule one low-speed interrupt transfer per millisecond.}}&lt;br /&gt;
&lt;br /&gt;
You can find out the type of your Phidget by attaching it and then running &amp;lt;code&amp;gt;&amp;lt;font size=3&amp;gt;dmesg | tail&amp;lt;/font&amp;gt;&amp;lt;/code&amp;gt;, which will display the type of Phidget from your kernel logs, as described above in the [[#Hardware|hardware section]]. The practical consequence of this is if your system has many low speed Phidgets attached, they will each be throttled down.  Low speed Phidgets require an interrupt transfer as often as every 8 milliseconds.  A Linux system could only have up to 8 of these Phidgets attached.&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|Sample Overrun Error|The data read from a program, or the first packet on the WebService, can give a sample overrun error (EEPHIDGET_OVERRUN).}}&lt;br /&gt;
&lt;br /&gt;
Linux only polls data from the analog inputs on Phidgets when you ask it to.  So there is some delay between when you open the device and when it actually attaches when data from those inputs are accumulating...and overrunning the buffer.  This is simply in the nature of how Linux polls USB - we recommend catching (but ignoring) this one-time initial error.&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|Raspberry Pi USB Current|Your device doesn&#039;t seem to run as expected on a Raspberry Pi.}}&lt;br /&gt;
&lt;br /&gt;
The USB ports on the standard Raspberry Pi are only capable of supplying around 100mA reliably.  Since USB specification dictates 500mA of current maximum, many USB devices require several hundred mA to run smoothly.  Since the Pi cannot supply this much current it is common to see buggy performance or complete failure to run at all.  The get around this you should use a USB hub connected to the Pi that has it&#039;s own external power supply.  This will allow the devices connected to have as much power as they require.&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Stepper_Motor_and_Controller_Primer&amp;diff=23973</id>
		<title>Stepper Motor and Controller Primer</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Stepper_Motor_and_Controller_Primer&amp;diff=23973"/>
		<updated>2017-09-18T17:17:04Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Primer]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|- valign=middle&lt;br /&gt;
| align=center width=300px| __TOC__ &lt;br /&gt;
| [[Image:3302.jpg|link=]]&lt;br /&gt;
| [[Image:1063.jpg|link=]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Stepper motors are broadly available motors commonly used for positioning.  The rotor of a stepper moves in a series of discrete steps.  By energizing the coils of the motor in sequence through many of these steps, the direction of rotation, number of rotations, and exact position of the motor shaft can be easily controlled.  By controlling the time between the steps, the speed and acceleration of the stepper is regulated.  In contrast, a DC motor will blindly spin at the highest speed possible when powered, unless it is controlled with an [[Encoder Primer|Encoder]] and a control system program. It is not necessary to use an encoder on a stepper motor unless you&#039;re concerned about the motor losing count of the steps over a long period of time or in high torque situations.&lt;br /&gt;
&lt;br /&gt;
Each stepper motor is designed to move by a certain angle with each discrete step.  The simplest stepper motors will rotate 90 degrees per step.  Standard industrial steppers will rotate 1.8 degrees per step. The stepping angle can be further reduced through use of a gearbox.&lt;br /&gt;
&lt;br /&gt;
In addition to the ease of precisely controlling position and speed, Steppers have other advantages:&lt;br /&gt;
&lt;br /&gt;
*Most motors have very little torque when they are operating at low speed or standstill. Since a stepper’s rotor is held in place by a magnetic field during each step,  steppers have full torque at low speed or standstill, making them very useful for low speed rotation and actuation. Additionally, a stepper motor can remain in a fixed position for long periods of time with the rated current in the windings, whereas with DC motors, stalling and remaining in a fixed position for long periods of time will cause motor burnout. &lt;br /&gt;
*DC Motors have brushes with a finite lifetime.  Steppers have no brushes, and are limited only by the life of the bearings.&lt;br /&gt;
&lt;br /&gt;
Compared to DC Motors, there are disadvantages to Steppers:&lt;br /&gt;
&lt;br /&gt;
*Each step will produce vibration in the motor.  If these vibrations are at the mechanical resonant frequency of the motor, they can cause the rotor to overshoot and bounce back and forth, resulting in a severe loss of torque. This phenomenon is called “ringing” and is often accompanied by a loud buzzing or grinding noise. To prevent the motor from operating in such a way, you should test the motor at various speeds in the physical application it is intended for, and try to avoid running the motor at a speed which exhibits ringing behaviour. &lt;br /&gt;
*If the motor encounters a brief overload, the fixed coils on the stator and  the free-spinning rotor can lose track of each other. If this happens at higher speeds, the motor will often stall.  Even at lower speeds, your system will have lost track of where exactly the motor is positioned – unless there is an independent system (e.g., an optical encoder) tracking the position.&lt;br /&gt;
*A Stepper motor cannot be loaded at its maximum torque, as it will almost certainly be overloaded during operation.  A DC Motor will naturally adjust its speed depending on how much power is provided, and the torque required to turn it’s shaft.&lt;br /&gt;
&lt;br /&gt;
For more information about the differences between stepper motors, DC motors, and servo motors, see the [[Motor Selection Guide]].&lt;br /&gt;
&lt;br /&gt;
==Types of Stepper Motors==&lt;br /&gt;
&lt;br /&gt;
We find it useful to classify motors according to how the coils are wound (Bipolar / Unipolar), the internal magnetic construction (Permanent Magnet / Hybrid), and how the current in the coils is regulated (Chopper Drive / Resistive Limited).&lt;br /&gt;
&lt;br /&gt;
===Coils===&lt;br /&gt;
=====Bipolar=====&lt;br /&gt;
These motors are manufactured with two coils of wire, resulting in one winding per phase.  By alternating the power between coils, as well as the direction of the current, the motor is rotated. This configuration produces magnetic fields within the coils in either direction, hence the term “Bipolar.”  The controller is more expensive because it has to be able to produce both positive and negative electrical currents, but the advantage is that the entire coil is being used, thus increasing torque capabilities at all speeds. We do not recommend using a bipolar controller to run a unipolar motor, even though it is theoretically possible.&lt;br /&gt;
&lt;br /&gt;
=====Unipolar=====&lt;br /&gt;
In a unipolar motor, the motor windings consist of two identical coils per phase, wound in opposite directions (each occupying half of the space a coil normally would in a bipolar stepper).   As a result, the controller only needs to select which of the two coils to pass current through in order to change the magnetic polarity, and only a positive current is required to be generated.  Due to this simplified control mechanism which uses only half of each coil, the torque of unipolar motors are usually much lower, but the overall cost of the system is much cheaper. The simplicity of the unipolar controller also means that you cannot use it to run a bipolar stepper motor.&lt;br /&gt;
&lt;br /&gt;
===Magnets===&lt;br /&gt;
=====Permanent Magnet=====&lt;br /&gt;
Permanent magnet motors are small, low torque, and inexpensive. They use a permanent magnet in the rotor that is attracted or repelled by magnetic field generated by the stator coils. Step angles are often 7.5 or 15 degrees, and the motors are usually unipolar.&lt;br /&gt;
&lt;br /&gt;
=====Variable Reluctance=====&lt;br /&gt;
The rotor of a variable reluctance stepper is made of iron, and it therefore aligns with the magnetic field generated by the stator coils. Since it doesn’t use a permanent magnet, it doesn’t matter which direction the current flows as long as each coil is wound in the opposite direction as the coil across from it. Therefore, variable reluctance steppers are unipolar and are typically designed to have larger step angles of 15 or more degrees.&lt;br /&gt;
&lt;br /&gt;
=====Hybrid=====&lt;br /&gt;
Hybrid Motors dominate the stepper motor world – they use a combination of characteristics from permanent magnet and variable reluctance steppers and have the best torque and speed, but are more expensive to produce. Step angles are typically 0.9 to 3.75 degrees, giving much better step resolution.&lt;br /&gt;
&lt;br /&gt;
===Drive===&lt;br /&gt;
=====Chopper Drive=====&lt;br /&gt;
Chopper Drive is an electronic control technique which allows specific motors to produce more power, torque, speed, and be more efficient.  Instead of relying on the resistance of the coil wiring, the inductance of the wiring is exploited by sophisticated control electronics as a short-term limitation of motor current.  Motor Manufacturers don’t do a good job of distinguishing motors suitable for use with Chopper Drive electronics.  The motors will often be large, square, with very low resistance.&lt;br /&gt;
=====Resistive Limited=====&lt;br /&gt;
Small, inexpensive steppers are designed to be built and controlled as cheaply as possible.  To simplify the control electronics, the length and thickness of the wire in the coils is selected for a particular control voltage.  This allows the coil itself to regulate the power available to the motor – provided the appropriate voltage is used, of course.  We call this type of motor Resistive Limited.&lt;br /&gt;
&lt;br /&gt;
==How it Works==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Stepper_back_web.jpg|left|link=|thumb|230px|Cross-Section of a Hybrid Bipolar Stepper&amp;lt;br /&amp;gt;[[Media:Stepper_back_web.jpg|Full-size Image]]]]&lt;br /&gt;
&lt;br /&gt;
===Hybrid Bipolar Steppers===&lt;br /&gt;
This section of the primer will cover the general principle of operation for stepper motors. While this information is by no means necessary to use a stepper motor, those who are curious about their inner workings may read on. &lt;br /&gt;
&lt;br /&gt;
The thumbnail to the left is a cross-sectional view of the inside of a hybrid bipolar stepper motor. As you can see, it has eight poles with six teeth each. This motor contains two coils- one wrapping the odd-numbered poles, and the other wrapping the even-numbered poles. The steel end-cap in the center of the image covers a cylindrical permanent magnet which surrounds the shaft. &lt;br /&gt;
&lt;br /&gt;
If positive current is sent to the odd-numbered coil, poles 1 and 5 are magnetized as south, and poles 3 and 7 are magnetized as north. Assuming the permanent magnet in the center of the motor has its north pole facing toward us, this will result in the rotor turning so that the teeth line up with stator poles 1 and 5, as they are in the image. At the same time, poles 3 and 7 will become aligned on the opposite end of the motor, where the gear on the rotor is permanently offset by the width of one tooth and the permanent magnet has magnetized the rotor as south. The rotation of the motor is continued by sending negative current through the even-numbered phase, then negative current through the odd-numbered phase, then positive current through the even-numbered phase, and so on. The stepper controller can reverse the direction of rotation simply by reversing this sequence.&lt;br /&gt;
&lt;br /&gt;
When a stepper motor becomes engaged in software, and current is applied to the coils, it may abruptly &amp;quot;snap&amp;quot; to the position that the rotor is being held at. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hybrid Unipolar Steppers===&lt;br /&gt;
The operation of a hybrid unipolar stepper is very similar to the bipolar stepper described above, except that each pole has two seperate coils wound in opposite directions. This results in four phases which only require positive current to operate. Rather than alternating the direction of current, the motor controller simply sends positive current to the appropriate half of the coil.&lt;br /&gt;
&lt;br /&gt;
==Controlling the Stepper Motor==&lt;br /&gt;
&lt;br /&gt;
The following information has been derived from using the 3308 stepper motor connected to a 1063 - PhidgetStepper Bipolar 1-Motor controller.&lt;br /&gt;
===Setting the Current Limit===&lt;br /&gt;
&lt;br /&gt;
[[Image:Graph12v.jpg|border|400px|link=|thumb|The current/speed characteristics for the 3308 at 12V.&amp;lt;br /&amp;gt;[[Media:Graph12v.jpg|Full-size Image]]]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Graph24v.jpg|border|400px|link=|thumb|The current/speed characteristics for the 3308 at 24V.&amp;lt;br /&amp;gt;[[Media:Graph24v.jpg|Full-size Image]]]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Graph30v.jpg|border|400px|link=|thumb|The current/speed characteristics for the 3308 at 30V.&amp;lt;br /&amp;gt;[[Media:Graph30v.jpg|Full-size Image]]]]&lt;br /&gt;
&lt;br /&gt;
The current limit is an important control property of stepper controllers. Since many stepper motors have a very low coil resistance, the current through the coils cannot “self-regulate” to a safe level on their own.  They require the sophisticated control techniques of a Chopper Drive, which is used in the [{{SERVER}}/products.php?product_id=1063 1063 PhidgetStepper] controller.  As a result, the maximum current allowed should be explicitly set.&lt;br /&gt;
&lt;br /&gt;
There are many factors that influence what the current limit should be set to. These include, but are not limited to,the acceleration and speed of the stepper, the supply voltage, applied torque, motor inductance, and coil resistance. The process of choosing the current limit can be simplified by following some general rules of thumb. The graphs in this section show a set of speed vs. current characteristics for the 3308 stepper with various power supplies. &lt;br /&gt;
&lt;br /&gt;
In the these graphs, the &#039;&#039;&#039;“actual speed”&#039;&#039;&#039; of the motor is the maximum speed attainable in a real world test done with no load on the motor, but at very high acceleration.  The &#039;&#039;&#039;“max speed”&#039;&#039;&#039; shows the limitation on speed imposed by the inductance of the motor coils at a given supply voltage.  Given that the 1063 controller is only able to run at a maximum speed of 2048 full steps per second, our graphs don’t show data at higher speeds. &lt;br /&gt;
&lt;br /&gt;
When the current limit is set low and the acceleration is high, the motor will not be able to provide enough power to accelerate itself and the load it’s driving.  The motor also has to overcome friction losses within the system, and do work on the load - for example, lifting a weight.  By increasing the current limit, more current and power is made available to accelerate and maintain maximum speeds.  This can be seen on any of the graphs in the initial steep ramp of the actual speed.  As the current limit increases, the motor is able to achieve higher speeds.&lt;br /&gt;
&lt;br /&gt;
In the case of this particular motor, the large inductance of the coils - great for producing lots of torque, quickly overwhelms a 12V power supply.  To get higher speeds and more performance out of this motor, higher supply voltages are necessary.  Compare the actual speed curve on the 12V graph to the 30V graph.  At 30V, the motor is able to achieve a much higher speed.  It’s important to remember that the actual speed was measured at very high accelerations - by lowering acceleration, higher velocities can be achieved.  Of course, if your motor is doing a lot of work, you’ll need to supply enough current to produce the necessary torque, therefore limiting the maximum speed. &lt;br /&gt;
&lt;br /&gt;
Setting Current Limit for your application is a balancing act.  By increasing the current limit, more torque is available, but far more power will be consumed when the motor is turning very slowly or stopped. When setting a high acceleration, more power (therefore current) is required to accelerate the motor and it’s load. Selecting the current limit is often done dynamically in the actual application - set the current limit very low, and run the system, increasing the Current Limit if it stalls.  After a set up has been determined that is reliable, increase the current limit by another 25% to give some margin.&lt;br /&gt;
&lt;br /&gt;
There is no point in setting the current limit to be greater than the motor’s rated current- the increased inductance will only further limit the motor speed. In this case, the 30V graph shows that it’s not feasible to operate this motor at maximum torque (1.7 Amps) at a speed greater than 1100 full steps per second. By reducing the current limit, greater speeds are possible, but less torque will be available.  Most motors designed for Chopper Drive control can operate at much higher voltages, but Phidgets Inc. does not carry a controller that can provide these voltages at this time.&lt;br /&gt;
&lt;br /&gt;
Note that just because you have set the current limit to some amount (for the sake of example let&#039;s say 2A) the motor will not draw 2A at all times.  The motor will only draw as much current as it needs.  This means that if there is only a small load on the motor and it is spinning at less than its top speed the motor might only draw a small fraction of the allotted 2A.  Even as low as 300 or 400mA.  As more load or higher speed is applied, the current usage will go up until the controller is giving the motor the full current limit. As a motor draws more current, it will also produce more heat. It is normal for a stepper motor to be hot to the touch after running for a while. If the motor is getting very hot, you may be trying to drive too large a load for that particular motor.&lt;br /&gt;
&lt;br /&gt;
===Choosing a Supply Voltage===&lt;br /&gt;
&lt;br /&gt;
When looking at a stepper motor&#039;s specifications, you may come across a &amp;quot;Rated Voltage&amp;quot; value. This value is usually equal to the rated current multiplied by the resistance of the coils of the motor, making it somewhat of a redundant specification. As mentioned earlier, you can increase your controller&#039;s supply voltage in order to allow the motor to reach higher speeds at a lower current (because high current causes high inductance which puts a hard limit on how much speed and torque a motor can produce). The motor will also produce more heat as you increase the supply voltage, so it&#039;s a good idea to choose a supply voltage based on the performance you need for the motor. Some motors will have a &amp;quot;Recommended Voltage&amp;quot; for a particular controller, which is the amount of voltage needed to reach the optimal speed and torque of the motor with minimal heating.&lt;br /&gt;
&lt;br /&gt;
===Setting the Velocity Limit===&lt;br /&gt;
&lt;br /&gt;
The velocity of a motor cannot be directly chosen with our stepper controllers. However, a velocity limit can be chosen to ensure that the motor does not go faster than a certain speed. This is useful because every stepper motor has a speed that causes itself to vibrate at the resonant frequency of its own moving parts. When the motor vibrates at this frequency, the motor will often overshoot its target position, causing it to lose most of its torque, sometimes even rotating in the wrong direction. This phenomenon is sometimes called &amp;quot;ringing&amp;quot;. If you experience these problems while running your stepper motor at a constant velocity, try setting the velocity limit to lower or higher than it was previously, in an attempt to minimize the amount of time spent operating at this particular velocity.&lt;br /&gt;
&lt;br /&gt;
===Setting the Acceleration===&lt;br /&gt;
The acceleration of a stepper motor is an important consideration when driving a load.  Setting the acceleration too high can result in the motor stalling, especially with a heavy load. Try to use low acceleration in high-torque applications.&lt;br /&gt;
&lt;br /&gt;
===Continuous Rotation and Forward/Reverse===&lt;br /&gt;
&lt;br /&gt;
A stepper motor can be caused to rotate continuously by simply setting the controller&#039;s target position property to an extremely large number of steps.&lt;br /&gt;
&lt;br /&gt;
Stepper motors can easily be run in forward or reverse by choosing a target position greater than or less than the current position, respectively. Reversing the polarity of either of the motor&#039;s wire pairs will invert this effect- causing a lesser target position to result in forward rotation, and a greater target position to result in reverse rotation. For this reason, you should pay attention to the way you wire a motor when developing and testing code, and ensure that you wire it with the same polarity in the future to avoid erroneous behaviour in applications where rotation direction matters.&lt;br /&gt;
&lt;br /&gt;
===Cooling===&lt;br /&gt;
The stepper controllers sold at Phidgets Inc. have a current rating that is limited by the heat dissipation capability of the board. You could add heatsinks, fans, or other cooling devices to increase the current limit, but do so with caution. Unless you have a way of monitoring the temperature of the driver chip during operation, you have no way of knowing how far beyond the rated specification you can go.&lt;br /&gt;
&lt;br /&gt;
===Wire Length===&lt;br /&gt;
&lt;br /&gt;
Since the stepper controller is sending a fairly simple signal to the motor, interference is not a big concern. You should be able to have quite long wires between your motor and controller. For more information, see the [[Effects_of_Long_Wires|effects of long wires]] page.&lt;br /&gt;
&lt;br /&gt;
===Saving Power===&lt;br /&gt;
&lt;br /&gt;
When the stepper motor has rotated the requested number of steps, and is stopped, the coils will remain energized to hold it in position.  This is necessary to allow the motor to support a load on its shaft without rotating to an unknown position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Holding torque&#039;&#039;&#039; is the amount of torque required to rotate the motor ‘against it’s will’ when the full rated current is flowing through  the coils.  If power consumption or overheating is a problem, and full holding torque is not required, the Current Limit can be decreased in software when the motor is not moving.  Holding torque will decrease linearly as you decrease the Current Limit, but will also allow you to save power and reduce the heat generated in your system.&lt;br /&gt;
&lt;br /&gt;
There is also a small resistance to movement within the motor even when there is no current, called &#039;&#039;&#039;Detent Torque&#039;&#039;&#039;. This may be sufficient to prevent rotation in your application, especially if the stepper has a gearbox on it.&lt;br /&gt;
&lt;br /&gt;
If the motor is not supporting a load or is not required to maintain a specific angle, it is recommended to set the Enable property to false.  This will allow the motor shaft to rotate freely, but the present angle may be lost if forces on the motor-shaft are greater than can be resisted by the detent torque of the unpowered motor. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Braking===&lt;br /&gt;
&lt;br /&gt;
There are several ways to stop a stepper motor, each with different characteristics: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Set Target Position&#039;&#039;&#039; - If you set the target position to the motor&#039;s current position, it will stop. This is typically the best way to stop quickly and hold position, since the motor coils will still be engaged. You could also set the motor velocity limit to zero for a similar effect.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Short the coils&#039;&#039;&#039; - If you have the stepper wires connected to some external circuitry, you could use a switch to short the A and B terminals together, and the C and D terminals together. Due to the [http://en.wikipedia.org/wiki/Lorentz_force Lorentz force] of the electrons in the coil, the motor will begin to brake and hold position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cut power&#039;&#039;&#039; - You could cut power to the controller, but since the motor coils would no longer be engaged, the momentum would cause it to continue rotating until it slows down from friction and detent.&lt;br /&gt;
&lt;br /&gt;
==Stepping Modes==&lt;br /&gt;
&lt;br /&gt;
===Full Stepping===&lt;br /&gt;
This is the default mode of stepping for bipolar motors, where both phases of the motor are controlled by two square waves of current. One wave lags behind the other by 90 degrees, and the motion of the motor is locked to these waves. A full step is completed when the square waves advance by 90 degrees. Since both phases are always fully energized, full stepping provides the best torque. &lt;br /&gt;
&lt;br /&gt;
===Half Stepping===&lt;br /&gt;
In this stepping mode, the controller alternates between having one phase energized and both phases energized. This results in the rotor pausing at half-steps in between the poles, effectively halving the step angle. However, since the current to each coil cannot be exactly balanced, the angle that the rotor comes to rest at between poles may not be exactly half the step angle. The downside to half stepping is that the motor will have less torque on the steps when only one phase is energized. &lt;br /&gt;
&lt;br /&gt;
===Mini/Micro-stepping===&lt;br /&gt;
By controlling the the relative current of both phases, the rotor position can come to rest at various equally spaced sub-steps between the two phases. This is achieved by following the same procedure for Full Stepping, except that the current supplied more closely resembles a sine wave rather than a square wave. Some bipolar controllers are designed to micro-step at low speeds to allow for smooth rotation.&lt;br /&gt;
&lt;br /&gt;
==Selecting a Gearbox==&lt;br /&gt;
&lt;br /&gt;
Using a stepper motor with a gearbox can be a good solution in applications that need very low rotation speeds and/or lots of torque.  Selecting a gearbox to attach to the stepper will result in increasing the output torque and decreasing the speed.  &lt;br /&gt;
Simply, the Gearbox Output Speed is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
 \text{Output Speed} =\frac{\text{Motor Speed}}{\text{Gearbox Ratio}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Although the reduction ratio plays a large part in determining the Gearbox Output Torque, there is also an inefficiency that is introduced through the use of a gearbox.  Some of the torque of the motor is internally converted into heat and lost. So to calculate the Gearbox Output Torque:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
 \text{Output Torque} = \text{Motor Output Torque  } \times \text{  Gearbox Ratio  } \times \text{  Gearbox Efficiency}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When choosing a stepper motor with a gearbox, keep in mind that the gearbox is rated to sustain a specific amount of torque, beyond which the gearbox could become damaged. This limit is often much lower than the amount of torque specified by the above equation.&lt;br /&gt;
&lt;br /&gt;
The Gearbox Step Angle can be determined by:                  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
 \text{Gearbox Step Angle} = \frac{\text{Motor Step Angle}}{\text{Gearbox Ratio}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Planetary Gearbox Reduction Ratios===&lt;br /&gt;
&lt;br /&gt;
[[File:Planetary_gearing.jpg|thumb|300px|link=|This diagram illustrates the parts of a 5.18:1 planetary gearbox.&amp;lt;br&amp;gt;[{{SERVER}}/docs21/images/1/1a/Planetary_gearing.jpg Click for Larger Image]]]&lt;br /&gt;
&lt;br /&gt;
In some applications, it is important to know the exact gear ratio of a gearbox (for example, when you need the output shaft to make a several complete rotations &lt;br /&gt;
and stop in the same position it started). Most motor datasheets will only list an approximate ratio, like &amp;quot;10:1&amp;quot; or &amp;quot;27:1&amp;quot;. However, there are ways to figure out &lt;br /&gt;
the exact ratio. &lt;br /&gt;
&lt;br /&gt;
In a planetary gearbox where the sun gear is used as an input and the rotation of the spider linking the planet gears is the output, the reduction ratio can be &lt;br /&gt;
expressed by the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\text{Gearbox Ratio} = \frac{T_R + T_S}{T_S}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;T_R&amp;lt;/math&amp;gt; is the number of teeth on the ring gear, and &amp;lt;math&amp;gt;T_S&amp;lt;/math&amp;gt; is the number of teeth on the sun gear. In this situation, the number of teeth on the planetary gears &lt;br /&gt;
don&#039;t affect the reduction ratio and serve only to connect the ring and sun gears. In order to increase the reduction ratio, you need to increase the number of &lt;br /&gt;
teeth on the ring gear. Since there is limited space inside a motor&#039;s gearbox, it eventually becomes impossible to increase the gear ratio. This limitation can be &lt;br /&gt;
bypassed by introducing multiple gear &#039;&#039;&#039;stages&#039;&#039;&#039;. In a multi-stage planetary gearbox, the axles of the planet gears of the first stage are connected to a piece &lt;br /&gt;
of metal called a &amp;quot;spider&amp;quot;, whose rotation is used to turn the sun of the next stage. It&#039;s very common for multi-stage planetary gearboxes to have a tall ring &lt;br /&gt;
gear that spans multiple stages. To determine the overall reduction ratio of a multi-stage planetary gearbox, simply multiply the two ratios together. For &lt;br /&gt;
example, two stages each with a 5:1 reduction ratio would result in a total ratio of 25:1. &lt;br /&gt;
The following table lists exact ratios for gearboxes commonly sold at Phidgets Inc. :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Gearbox_table.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The colored squares visualize the stages that compose each gearbox. For example, a two-stage gearbox with 1 blue and 1 green square indicates that one stage is &lt;br /&gt;
the same ratio as the 1-stage gearbox with the green square beside it, and the other stage is the same as the one with a blue square beside it.&lt;br /&gt;
If you have a third party gearbox and are unable to open it to count the gear teeth, you could also determine the approximate reduction ratio experimentally by &lt;br /&gt;
measuring the rotation angle after a known number of steps have occured. The more accurately you can measure the angle, the better your approximation will be.&lt;br /&gt;
&lt;br /&gt;
===Gearbox Terminology===&lt;br /&gt;
&lt;br /&gt;
Here is a short list of terms you might come across when deciding upon a gearbox:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backlash&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The amount of clearance between mated gear teeth.  Theoretically, the backlash should be “the smaller the better,” but in actual practice, some backlash must be allowed to prevent jamming.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gear Ratio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gearbox accepts the power (think of power as a torque that rotates) from the motor, reducing the speed (exactly) by a given ratio, while increasing the torque (roughly) by the same ratio – a ratio of the gear head with which the gear head reduces the motor speed.	For example, if a motor has a speed of 500RPM and the reduction ratio is 100:1, the speed of the gear head is 500/100 = 5RPM. This is the actual reduction ratio. The calculated speed from the gear head should be based on this ratio.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gearbox Step Angle&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A full step of the motor will result in the gearbox making a smaller step.  The angle of this step is the step angle of the motor divided by the gearbox reduction ratio. For example, a motor with a step angle of 1.8º and a gearbox with a reduction ratio of 20:1 will have a step angle of 1.8/20 = 0.09º at the output of the gearbox.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gearbox Output Torque&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gearbox takes the torque from the output shaft of the motor, reducing the speed and increasing the torque. The gearbox, depending on its efficiency, loses some of the torque as it is converted into heat. Therefore, the Gearbox Output Torque is the motor output torque multiplied by the reduction ratio multiplied by the efficiency of the gearbox. For example, a motor with a low-speed output torque of 500g*cm and a gearbox with a reduction ratio of 5:1 and 90% efficiency will have a Gearbox Output Torque of 500*5*0.9 = 2.25 kg*cm. Remember, however, that if the Gearbox Output Torque exceeds the allowable torque the gearbox is rated for, you can cause damage to the gearbox.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gear Trains&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Planetary gearboxes use multiple gear sets to achieve large gear reductions.  Each gear set makes the gearbox longer, and reduces the efficiency.&lt;br /&gt;
&lt;br /&gt;
==Product Comparison Tables==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|+&#039;&#039;&#039;Stepper Motor Product Specifications&#039;&#039;&#039;&lt;br /&gt;
! Phidgets Product #&lt;br /&gt;
! Motor Model Number&lt;br /&gt;
! Motor Type (Unipolar/Bipolar) &lt;br /&gt;
! Step Angle (deg)&lt;br /&gt;
! Holding Torque (g•cm)&lt;br /&gt;
! Low-Speed Torque (g•cm)&lt;br /&gt;
! Rated Current (A)&lt;br /&gt;
! Number of Leads&lt;br /&gt;
! Mounting Plate Size&lt;br /&gt;
! Shaft Diameter (mm)&lt;br /&gt;
! Total Weight (g)&lt;br /&gt;
! Motor Length (mm)&lt;br /&gt;
! Motor Size/Diameter (mm)&lt;br /&gt;
|-&lt;br /&gt;
| 3302|| 42BYGHM810  || Hybrid Bipolar || 0.9|| 4800|| 4280|| 2.4 || 4|| NEMA-17|| 5  || 362|| 48  || 42 x 42&lt;br /&gt;
|-&lt;br /&gt;
| 3303|| 42BYGHW811  || Hybrid Bipolar || 1.8|| 4800|| 4240|| 2.5 || 4|| NEMA-17|| 5  || 332|| 48  || 42 x 42&lt;br /&gt;
|-&lt;br /&gt;
| 3304|| 39BYGS202   || Hybrid Bipolar || 3.75|| 750|| 590 || 1   || 4|| NEMA-17|| 5  || 171|| 32  || 39 x 39&lt;br /&gt;
|-&lt;br /&gt;
| 3305|| 39BYG013    || Hybrid Bipolar || 1.8||  550|| 450 || 0.4 || 4|| NEMA-17|| 5  || 110|| 20  || 39 x 39&lt;br /&gt;
|-&lt;br /&gt;
| 3314|| PM42L-048-17|| Hybrid Unipolar|| 7.5|| 950 || 710 || 0.28|| 6|| N/A    || 3  || 138|| 14.4|| 42&lt;br /&gt;
|-&lt;br /&gt;
| 3315|| PM25S-048-15|| Hybrid Unipolar|| 7.5|| 140 || 50  || 0.1 || 6|| N/A    || 2  || 31 || 15  || 25&lt;br /&gt;
|-&lt;br /&gt;
| 3316|| PM20L-20-14 || Hybrid Unipolar|| 18 || 50  || 30  || 0.08|| 6|| N/A    || 1.5|| 24 || 16.5|| 20&lt;br /&gt;
|-&lt;br /&gt;
| 3320|| 28STH32     || Hybrid Bipolar || 1.8|| 600 || 520 || 0.67|| 4|| NEMA-11|| 5  || 111|| 32|| 28 x 28&lt;br /&gt;
|-&lt;br /&gt;
| 3323|| 35STH40     || Hybrid Bipolar || 1.8|| 1400|| 1200|| 1   || 4|| NEMA-14|| 5  || 200|| 40|| 35 x 35&lt;br /&gt;
|-&lt;br /&gt;
| 3324|| 42STH38     || Hybrid Bipolar || 1.8|| 3600|| 3300|| 1.7 || 4|| NEMA-17|| 5  || 289|| 40|| 42 x 42&lt;br /&gt;
|-&lt;br /&gt;
| 3330|| 57STH56     || Hybrid Bipolar || 0.9||12000||11200|| 2.8 || 4|| NEMA-23|| 6.4|| 695|| 56|| 56 x 56&lt;br /&gt;
|-&lt;br /&gt;
| 3331|| 57STH56     || Hybrid Bipolar || 1.8||12600||11000|| 2.8 || 4|| NEMA-23|| 6.4|| 686|| 56|| 56 x 56&lt;br /&gt;
|-&lt;br /&gt;
| 3335|| 86STH65     || Hybrid Bipolar || 1.8||34000||30000||2 or 4 || 4|| NEMA-34|| 12|| 1800|| 65|| 85 x 85&lt;br /&gt;
|-&lt;br /&gt;
| 3336|| 86STH156    || Hybrid Bipolar || 1.8||122000||106000||3 or 6 || 4|| NEMA-34|| 16|| 5200|| 156|| 85 x 85&lt;br /&gt;
|-&lt;br /&gt;
| 3340|| 42STH38     || Hybrid Bipolar || 0.9||3600||3300||1.7 || 4|| NEMA-17|| 5||288|| 40|| 42 x 42&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=1&lt;br /&gt;
|+&#039;&#039;&#039;Gearbox Stepper Motor Product Specifications&#039;&#039;&#039;&lt;br /&gt;
!Product #&lt;br /&gt;
!Motor Model #&lt;br /&gt;
!Motor Type&lt;br /&gt;
!Step Angle&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (deg)&lt;br /&gt;
!Holding Torque*,&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (g-cm)&lt;br /&gt;
!Low-speed Torque*,&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (g-cm)&lt;br /&gt;
!Rated Current (A)&lt;br /&gt;
!# of Leads&lt;br /&gt;
!Mounting Plate Size&lt;br /&gt;
!Shaft Diameter (mm)&lt;br /&gt;
!Total Weight (g)&lt;br /&gt;
!Motor Length (mm)&lt;br /&gt;
!Gearbox Length (mm)&lt;br /&gt;
!Motor Size/Diameter (mm)&lt;br /&gt;
!Gear Ratio&lt;br /&gt;
!Gearbox Max Torque (g-cm)&lt;br /&gt;
!Gearbox Efficiency&lt;br /&gt;
!Max Speed&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (RPM)&lt;br /&gt;
|-&lt;br /&gt;
| 3310||57BYG630-07AG20||Hybrid Bipolar||0.09||30000||30000||2.8||4||NEMA-23||8||1330||73||38||56x56||20:1||30000||||30&lt;br /&gt;
|-&lt;br /&gt;
| 3311||42BYGHW811-AG5.18||Hybrid Bipolar||0.35||24860||17790||2.5||4||NEMA-17||8||513||48||31||42x42||5.18:1||30000||0.9||115&lt;br /&gt;
|-&lt;br /&gt;
| 3312||42BYGHW811-AG26.8||Hybrid Bipolar||0.07||40000||40000||2.5||4||NEMA-17||8||526||48||39||42x42||26.8:1||40000||0.81||22&lt;br /&gt;
|-&lt;br /&gt;
| 3313||42BYGHW811-AG99.5||Hybrid Bipolar||0.02||50000||50000||2.5||4||NEMA-17||8||610||48||47||42x42||99.5:1||50000||0.73||6&lt;br /&gt;
|-&lt;br /&gt;
| 3317||42BYGH40(M)-160-4A||Hybrid Bipolar||0.35||16780||12000||1.6||4||NEMA-17||8||464||40||30||42x42||5.18:1||20000||0.9||115&lt;br /&gt;
|-&lt;br /&gt;
| 3318||42BYGH40(M)-160-4A||Hybrid Bipolar||0.07||30000||30000||1.6||4||NEMA-17||8||464||40||38||42x42||26.8:1||30000||0.8||22&lt;br /&gt;
|-&lt;br /&gt;
| 3319||42BYGH40(M)-160-4A||Hybrid Bipolar||0.02||40000||40000||1.6||4||NEMA-17||8||464||40||46||42x42||99.5:1||40000||0.7||6&lt;br /&gt;
|-&lt;br /&gt;
| 3321||28STH32-0674B/28JXS40K27||Hybrid Bipolar||0.067||16100||14000||0.67||4||NEMA-11||6||218||32||40||28x28||27:1||20000|| ||120&lt;br /&gt;
|-&lt;br /&gt;
| 3322||28STH32-0674B/28JXS40K100||Hybrid Bipolar||0.018||32000||32000||0.67||4||NEMA-11||6||243||32||49||28x28||100:1||32000|| ||35&lt;br /&gt;
|-&lt;br /&gt;
| 3325||42STH38-1684B/36JXS60K5.18||Hybrid Bipolar||0.35||18000||18000||1.7||4||NEMA-17||8||457||40||31||42x42||5.18:1||18000|| ||904&lt;br /&gt;
|-&lt;br /&gt;
| 3326||42STH38-1684B/36JXS60K14||Hybrid Bipolar||0.13||30000||30000||1.7||4||NEMA-17||8||502||40||39||42x42||14:1||30000|| ||295&lt;br /&gt;
|-&lt;br /&gt;
| 3327||42STH38-1684B/36JXS60K26||Hybrid Bipolar||0.067||30000||30000||1.7||4||NEMA-17||8||503||40||39||42x42||26.85:1||30000|| ||174&lt;br /&gt;
|-&lt;br /&gt;
| 3328||42STH38-1684B/36JXS60K51||Hybrid Bipolar||0.035||48000||48000||1.7||4||NEMA-17||8||564||40||48||42x42||51:1||48000|| ||63&lt;br /&gt;
|-&lt;br /&gt;
| 3329||42STH38-1684B/36JXS60K99.51||Hybrid Bipolar||0.018||48000||48000||1.7||4||NEMA-17||8||564||40||48||42x42||100:1||48000|| ||34&lt;br /&gt;
|-&lt;br /&gt;
| 3332||57STH56-2804B/56JXS300K4.25||Hybrid Bipolar||0.42||53000||46600||2.8||4||NEMA-23||12||1200||56||48||57x57||4.25:1||90000|| ||375&lt;br /&gt;
|-&lt;br /&gt;
| 3333||57STH56-2804B/56JXS300K15||Hybrid Bipolar||0.12||150000||150000||2.8||4||NEMA-23||12||1300||56||61||57x57||15:1||150000|| || 116&lt;br /&gt;
|-&lt;br /&gt;
| 3334||57STH56-2804B/56JXS300K77||Hybrid Bipolar||0.023||240000||240000||2.8||4||NEMA-23||12||1500||56||72||57x57||77:1||240000|| ||25&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt;Step angle, torque values, and max speed are all measured at the output of the gearbox. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;Holding torque and low speed torque for gearbox motors are limited by the max torque that the gearbox is rated to sustain.&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Glossary of Terms==&lt;br /&gt;
&lt;br /&gt;
===Motor Terms===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Coil Resistance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The electrical resistance (to direct current) of the wiring within the motor. This resistance causes some of the energy being applied to the motor to be converted into heat.  Some motors and motor controllers rely solely on the electrical resistance to regulate the current flowing through the motor. The Unipolar Motors we sell, and the 1062 PhidgetStepper Unipolar rely on this inexpensive, but inefficient technique. Other motors will have very low resistance, increasing their efficiency, but requiring very sophisticated control techniques because the resistance cannot regulate the current to a safe level on its own. Our Bipolar controllers and our Bipolar motors use this technique, otherwise known as Chopper Drive.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Holding Torque&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Holding Torque is the amount of torque needed to rotate the shaft of the stepper motor while the controller attempts to hold the position, using the maximum current allowed for the motor. Holding Torque is the sum of the magnetic force exerted by the electrical coils to hold the current position, and the detent torque, which is the natural resistance of the motor against rotation due to the permanent magnet inside the motor.  Once the motor begins to rotate, the torque it can exert (at least at low speeds) is Holding Torque minus twice the detent torque (because the motor is now working against the detent). As the motor speed increases, torque begins to decrease.  If the power supply voltage is low, or the inductance of the motor is high, the torque will fall more rapidly.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Motor Inductance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Stepper motors are built with a specific coil inductance. A high inductance motor will provide a greater amount of torque at low speeds, at the cost of having lower torque at high speeds. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Overhung Load (OHL) / Radial Load&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
An external load applied on the output shaft of the gearbox.  This load is often produced if pulleys are mounted directly on the shaft, pulling perpendicular to it. When the OHL exceeds a safe value, the bearings can fail, or the shaft can break from bending fatigue. While OHL and Thrust Load specifications are only available for our gearbox motors, both types of load should be avoided when using any of our motors.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rated Current&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The rated current is the maximum current that should be applied to each coil of the motor.  Current generates heat within the motor, and exceeding the regulated current will cause the motor to overheat.  If the motor is operated in a hot environment, or is enclosed, it can overheat at currents lower than the rated current.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step Angle&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in the shaft angle when the motor moves forward or backward by one full step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step Accuracy&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Depending on the motor and how it is loaded down, the step positions will vary slightly.  Fortunately, this variance doesn’t accumulate – so if you move the motor by one step or one million steps, the angle that the motor stops at will have the same margin of error.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Thrust load / Axial Load&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A load applied directly in line with the output shaft of the gearbox.  Avoid thrust as much as possible.  If thrust load is unavoidable, keep it to no more than the permissible value.&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Stepper_Motor_and_Controller_Primer&amp;diff=23972</id>
		<title>Stepper Motor and Controller Primer</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Stepper_Motor_and_Controller_Primer&amp;diff=23972"/>
		<updated>2017-09-18T17:16:40Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Primer]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|- valign=middle&lt;br /&gt;
| align=center width=300px| __TOC__ &lt;br /&gt;
| [[Image:3302.jpg|link=]]&lt;br /&gt;
| [[Image:1063.jpg|link=]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Stepper motors are broadly available motors commonly used for positioning.  The rotor of a stepper moves in a series of discrete steps.  By energizing the coils of the motor in sequence through many of these steps, the direction of rotation, number of rotations, and exact position of the motor shaft can be easily controlled.  By controlling the time between the steps, the speed and acceleration of the stepper is regulated.  In contrast, a DC motor will blindly spin at the highest speed possible when powered, unless it is controlled with an [[Encoder Primer|Encoder]] and a control system program. It is not necessary to use an encoder on a stepper motor unless you&#039;re concerned about the motor losing count of the steps over a long period of time or in high torque situations.&lt;br /&gt;
&lt;br /&gt;
Each stepper motor is designed to move by a certain angle with each discrete step.  The simplest stepper motors will rotate 90 degrees per step.  Standard industrial steppers will rotate 1.8 degrees per step. The stepping angle can be further reduced through use of a gearbox.&lt;br /&gt;
&lt;br /&gt;
In addition to the ease of precisely controlling position and speed, Steppers have other advantages:&lt;br /&gt;
&lt;br /&gt;
*Most motors have very little torque when they are operating at low speed or standstill. Since a stepper’s rotor is held in place by a magnetic field during each step,  steppers have full torque at low speed or standstill, making them very useful for low speed rotation and actuation. Additionally, a stepper motor can remain in a fixed position for long periods of time with the rated current in the windings, whereas with DC motors, stalling and remaining in a fixed position for long periods of time will cause motor burnout. &lt;br /&gt;
*DC Motors have brushes with a finite lifetime.  Steppers have no brushes, and are limited only by the life of the bearings.&lt;br /&gt;
&lt;br /&gt;
Compared to DC Motors, there are disadvantages to Steppers:&lt;br /&gt;
&lt;br /&gt;
*Each step will produce vibration in the motor.  If these vibrations are at the mechanical resonant frequency of the motor, they can cause the rotor to overshoot and bounce back and forth, resulting in a severe loss of torque. This phenomenon is called “ringing” and is often accompanied by a loud buzzing or grinding noise. To prevent the motor from operating in such a way, you should test the motor at various speeds in the physical application it is intended for, and try to avoid running the motor at a speed which exhibits ringing behaviour. &lt;br /&gt;
*If the motor encounters a brief overload, the fixed coils on the stator and  the free-spinning rotor can lose track of each other. If this happens at higher speeds, the motor will often stall.  Even at lower speeds, your system will have lost track of where exactly the motor is positioned – unless there is an independent system (e.g., an optical encoder) tracking the position.&lt;br /&gt;
*A Stepper motor cannot be loaded at its maximum torque, as it will almost certainly be overloaded during operation.  A DC Motor will naturally adjust its speed depending on how much power is provided, and the torque required to turn it’s shaft.&lt;br /&gt;
&lt;br /&gt;
For more information about the differences between stepper motors, DC motors, and servo motors, see the [[Motor Selection Guide]].&lt;br /&gt;
&lt;br /&gt;
==Types of Stepper Motors==&lt;br /&gt;
&lt;br /&gt;
We find it useful to classify motors according to how the coils are wound (Bipolar / Unipolar), the internal magnetic construction (Permanent Magnet / Hybrid), and how the current in the coils is regulated (Chopper Drive / Resistive Limited).&lt;br /&gt;
&lt;br /&gt;
===Coils===&lt;br /&gt;
=====Bipolar=====&lt;br /&gt;
These motors are manufactured with two coils of wire, resulting in one winding per phase.  By alternating the power between coils, as well as the direction of the current, the motor is rotated. This configuration produces magnetic fields within the coils in either direction, hence the term “Bipolar.”  The controller is more expensive because it has to be able to produce both positive and negative electrical currents, but the advantage is that the entire coil is being used, thus increasing torque capabilities at all speeds. We do not recommend using a bipolar controller to run a unipolar motor, even though it is theoretically possible.&lt;br /&gt;
&lt;br /&gt;
=====Unipolar=====&lt;br /&gt;
In a unipolar motor, the motor windings consist of two identical coils per phase, wound in opposite directions (each occupying half of the space a coil normally would in a bipolar stepper).   As a result, the controller only needs to select which of the two coils to pass current through in order to change the magnetic polarity, and only a positive current is required to be generated.  Due to this simplified control mechanism which uses only half of each coil, the torque of unipolar motors are usually much lower, but the overall cost of the system is much cheaper. The simplicity of the unipolar controller also means that you cannot use it to run a bipolar stepper motor.&lt;br /&gt;
&lt;br /&gt;
===Magnets===&lt;br /&gt;
=====Permanent Magnet=====&lt;br /&gt;
Permanent magnet motors are small, low torque, and inexpensive. They use a permanent magnet in the rotor that is attracted or repelled by magnetic field generated by the stator coils. Step angles are often 7.5 or 15 degrees, and the motors are usually unipolar.&lt;br /&gt;
&lt;br /&gt;
=====Variable Reluctance=====&lt;br /&gt;
The rotor of a variable reluctance stepper is made of iron, and it therefore aligns with the magnetic field generated by the stator coils. Since it doesn’t use a permanent magnet, it doesn’t matter which direction the current flows as long as each coil is wound in the opposite direction as the coil across from it. Therefore, variable reluctance steppers are unipolar and are typically designed to have larger step angles of 15 or more degrees.&lt;br /&gt;
&lt;br /&gt;
=====Hybrid=====&lt;br /&gt;
Hybrid Motors dominate the stepper motor world – they use a combination of characteristics from permanent magnet and variable reluctance steppers and have the best torque and speed, but are more expensive to produce. Step angles are typically 0.9 to 3.75 degrees, giving much better step resolution.&lt;br /&gt;
&lt;br /&gt;
===Drive===&lt;br /&gt;
=====Chopper Drive=====&lt;br /&gt;
Chopper Drive is an electronic control technique which allows specific motors to produce more power, torque, speed, and be more efficient.  Instead of relying on the resistance of the coil wiring, the inductance of the wiring is exploited by sophisticated control electronics as a short-term limitation of motor current.  Motor Manufacturers don’t do a good job of distinguishing motors suitable for use with Chopper Drive electronics.  The motors will often be large, square, with very low resistance.&lt;br /&gt;
=====Resistive Limited=====&lt;br /&gt;
Small, inexpensive steppers are designed to be built and controlled as cheaply as possible.  To simplify the control electronics, the length and thickness of the wire in the coils is selected for a particular control voltage.  This allows the coil itself to regulate the power available to the motor – provided the appropriate voltage is used, of course.  We call this type of motor Resistive Limited.&lt;br /&gt;
&lt;br /&gt;
==How it Works==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Stepper_back_web.jpg|left|link=|thumb|230px|Cross-Section of a Hybrid Bipolar Stepper&amp;lt;br /&amp;gt;[[Media:Stepper_back_web.jpg|Full-size Image]]]]&lt;br /&gt;
&lt;br /&gt;
===Hybrid Bipolar Steppers===&lt;br /&gt;
This section of the primer will cover the general principle of operation for stepper motors. While this information is by no means necessary to use a stepper motor, those who are curious about their inner workings may read on. &lt;br /&gt;
&lt;br /&gt;
The thumbnail to the left is a cross-sectional view of the inside of a hybrid bipolar stepper motor. As you can see, it has eight poles with six teeth each. This motor contains two coils- one wrapping the odd-numbered poles, and the other wrapping the even-numbered poles. The steel end-cap in the center of the image covers a cylindrical permanent magnet which surrounds the shaft. &lt;br /&gt;
&lt;br /&gt;
If positive current is sent to the odd-numbered coil, poles 1 and 5 are magnetized as south, and poles 3 and 7 are magnetized as north. Assuming the permanent magnet in the center of the motor has its north pole facing toward us, this will result in the rotor turning so that the teeth line up with stator poles 1 and 5, as they are in the image. At the same time, poles 3 and 7 will become aligned on the opposite end of the motor, where the gear on the rotor is permanently offset by the width of one tooth and the permanent magnet has magnetized the rotor as south. The rotation of the motor is continued by sending negative current through the even-numbered phase, then negative current through the odd-numbered phase, then positive current through the even-numbered phase, and so on. The stepper controller can reverse the direction of rotation simply by reversing this sequence.&lt;br /&gt;
&lt;br /&gt;
When a stepper motor becomes engaged in software, and current is applied to the coils, it may abruptly &amp;quot;snap&amp;quot; to the position that the rotor is being held at. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hybrid Unipolar Steppers===&lt;br /&gt;
The operation of a hybrid unipolar stepper is very similar to the bipolar stepper described above, except that each pole has two seperate coils wound in opposite directions. This results in four phases which only require positive current to operate. Rather than alternating the direction of current, the motor controller simply sends positive current to the appropriate half of the coil.&lt;br /&gt;
&lt;br /&gt;
==Controlling the Stepper Motor==&lt;br /&gt;
&lt;br /&gt;
The following information has been derived from using the 3308 stepper motor connected to a 1063 - PhidgetStepper Bipolar 1-Motor controller.&lt;br /&gt;
===Setting the Current Limit===&lt;br /&gt;
&lt;br /&gt;
[[Image:Graph12v.jpg|border|400px|link=|thumb|The current/speed characteristics for the 3308 at 12V.&amp;lt;br /&amp;gt;[[Media:Graph12v.jpg|Full-size Image]]]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Graph24v.jpg|border|400px|link=|thumb|The current/speed characteristics for the 3308 at 24V.&amp;lt;br /&amp;gt;[[Media:Graph24v.jpg|Full-size Image]]]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Graph30v.jpg|border|400px|link=|thumb|The current/speed characteristics for the 3308 at 30V.&amp;lt;br /&amp;gt;[[Media:Graph30v.jpg|Full-size Image]]]]&lt;br /&gt;
&lt;br /&gt;
The current limit is an important control property of stepper controllers. Since many stepper motors have a very low coil resistance, the current through the coils cannot “self-regulate” to a safe level on their own.  They require the sophisticated control techniques of a Chopper Drive, which is used in the [{{SERVER}}/products.php?product_id=1063 1063 PhidgetStepper] controller.  As a result, the maximum current allowed should be explicitly set.&lt;br /&gt;
&lt;br /&gt;
There are many factors that influence what the current limit should be set to. These include, but are not limited to,the acceleration and speed of the stepper, the supply voltage, applied torque, motor inductance, and coil resistance. The process of choosing the current limit can be simplified by following some general rules of thumb. The graphs in this section show a set of speed vs. current characteristics for the 3308 stepper with various power supplies. &lt;br /&gt;
&lt;br /&gt;
In the these graphs, the &#039;&#039;&#039;“actual speed”&#039;&#039;&#039; of the motor is the maximum speed attainable in a real world test done with no load on the motor, but at very high acceleration.  The &#039;&#039;&#039;“max speed”&#039;&#039;&#039; shows the limitation on speed imposed by the inductance of the motor coils at a given supply voltage.  Given that the 1063 controller is only able to run at a maximum speed of 2048 full steps per second, our graphs don’t show data at higher speeds. &lt;br /&gt;
&lt;br /&gt;
When the current limit is set low and the acceleration is high, the motor will not be able to provide enough power to accelerate itself and the load it’s driving.  The motor also has to overcome friction losses within the system, and do work on the load - for example, lifting a weight.  By increasing the current limit, more current and power is made available to accelerate and maintain maximum speeds.  This can be seen on any of the graphs in the initial steep ramp of the actual speed.  As the current limit increases, the motor is able to achieve higher speeds.&lt;br /&gt;
&lt;br /&gt;
In the case of this particular motor, the large inductance of the coils - great for producing lots of torque, quickly overwhelms a 12V power supply.  To get higher speeds and more performance out of this motor, higher supply voltages are necessary.  Compare the actual speed curve on the 12V graph to the 30V graph.  At 30V, the motor is able to achieve a much higher speed.  It’s important to remember that the actual speed was measured at very high accelerations - by lowering acceleration, higher velocities can be achieved.  Of course, if your motor is doing a lot of work, you’ll need to supply enough current to produce the necessary torque, therefore limiting the maximum speed. &lt;br /&gt;
&lt;br /&gt;
Setting Current Limit for your application is a balancing act.  By increasing the current limit, more torque is available, but far more power will be consumed when the motor is turning very slowly or stopped. When setting a high acceleration, more power (therefore current) is required to accelerate the motor and it’s load. Selecting the current limit is often done dynamically in the actual application - set the current limit very low, and run the system, increasing the Current Limit if it stalls.  After a set up has been determined that is reliable, increase the current limit by another 25% to give some margin.&lt;br /&gt;
&lt;br /&gt;
There is no point in setting the current limit to be greater than the motor’s rated current- the increased inductance will only further limit the motor speed. In this case, the 30V graph shows that it’s not feasible to operate this motor at maximum torque (1.7 Amps) at a speed greater than 1100 full steps per second. By reducing the current limit, greater speeds are possible, but less torque will be available.  Most motors designed for Chopper Drive control can operate at much higher voltages, but Phidgets Inc. does not carry a controller that can provide these voltages at this time.&lt;br /&gt;
&lt;br /&gt;
Note that just because you have set the current limit to some amount (for the sake of example let&#039;s say 2A) the motor will not draw 2A at all times.  The motor will only draw as much current as it needs.  This means that if there is only a small load on the motor and it is spinning at less than its top speed the motor might only draw a small fraction of the allotted 2A.  Even as low as 300 or 400mA.  As more load or higher speed is applied, the current usage will go up until the controller is giving the motor the full current limit. As a motor draws more current, it will also produce more heat. It is normal for a stepper motor to be hot to the touch after running for a while. If the motor is getting very hot, you may be trying to drive too large a load for that particular motor.&lt;br /&gt;
&lt;br /&gt;
===Choosing a Supply Voltage===&lt;br /&gt;
&lt;br /&gt;
When looking at a stepper motor&#039;s specifications, you may come across a &amp;quot;Rated Voltage&amp;quot; value. This value is usually equal to the rated current multiplied by the resistance of the coils of the motor, making it somewhat of a redundant specification. As mentioned earlier, you can increase your controller&#039;s supply voltage in order to allow the motor to reach higher speeds at a lower current (because high current causes high inductance which puts a hard limit on how much speed and torque a motor can produce). The motor will also produce more heat as you increase the supply voltage, so it&#039;s a good idea to choose a supply voltage based on the performance you need for the motor. Some motors will have a &amp;quot;Recommended Voltage&amp;quot; for a particular controller, which is the amount of voltage needed to reach the optimal speed and torque of the motor with minimal heating.&lt;br /&gt;
&lt;br /&gt;
===Setting the Velocity Limit===&lt;br /&gt;
&lt;br /&gt;
The velocity of a motor cannot be directly chosen with our stepper controllers. However, a velocity limit can be chosen to ensure that the motor does not go faster than a certain speed. This is useful because every stepper motor has a speed that causes itself to vibrate at the resonant frequency of its own moving parts. When the motor vibrates at this frequency, the motor will often overshoot its target position, causing it to lose most of its torque, sometimes even rotating in the wrong direction. This phenomenon is sometimes called &amp;quot;ringing&amp;quot;. If you experience these problems while running your stepper motor at a constant velocity, try setting the velocity limit to lower or higher than it was previously, in an attempt to minimize the amount of time spent operating at this particular velocity.&lt;br /&gt;
&lt;br /&gt;
===Setting the Acceleration===&lt;br /&gt;
The acceleration of a stepper motor is an important consideration when driving a load.  Setting the acceleration too high can result in the motor stalling, especially with a heavy load. Try to use low acceleration in high-torque applications.&lt;br /&gt;
&lt;br /&gt;
===Continuous Rotation and Forward/Reverse===&lt;br /&gt;
&lt;br /&gt;
A stepper motor can be caused to rotate continuously by simply setting the controller&#039;s target position property to an extremely large number of steps.&lt;br /&gt;
&lt;br /&gt;
Stepper motors can easily be run in forward or reverse by choosing a target position greater than or less than the current position, respectively. Reversing the polarity of either of the motor&#039;s wire pairs will invert this effect- causing a lesser target position to result in forward rotation, and a greater target position to result in reverse rotation. For this reason, you should pay attention to the way you wire a motor when developing and testing code, and ensure that you wire it with the same polarity in the future to avoid erroneous behaviour in applications where rotation direction matters.&lt;br /&gt;
&lt;br /&gt;
===Cooling===&lt;br /&gt;
The stepper controllers sold at Phidgets Inc. have a current rating that is limited by the heat dissipation capability of the board. You could add heatsinks, fans, or other cooling devices to increase the current limit, but do so with caution. Unless you have a way of monitoring the temperature of the driver chip during operation, you have no way of knowing how far beyond the rated specification you can go.&lt;br /&gt;
&lt;br /&gt;
===Wire Length===&lt;br /&gt;
&lt;br /&gt;
Since the stepper controller is sending a fairly simple signal to the motor, interference is not a big concern. You should be able to have quite long wires between your motor and controller. For more information, see the [[Effects_of_Long_Wires|effects of long wires]] page.&lt;br /&gt;
&lt;br /&gt;
===Saving Power===&lt;br /&gt;
&lt;br /&gt;
When the stepper motor has rotated the requested number of steps, and is stopped, the coils will remain energized to hold it in position.  This is necessary to allow the motor to support a load on its shaft without rotating to an unknown position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Holding torque&#039;&#039;&#039; is the amount of torque required to rotate the motor ‘against it’s will’ when the full rated current is flowing through  the coils.  If power consumption or overheating is a problem, and full holding torque is not required, the Current Limit can be decreased in software when the motor is not moving.  Holding torque will decrease linearly as you decrease the Current Limit, but will also allow you to save power and reduce the heat generated in your system.&lt;br /&gt;
&lt;br /&gt;
There is also a small resistance to movement within the motor even when there is no current, called &#039;&#039;&#039;Detent Torque&#039;&#039;&#039;. This may be sufficient to prevent rotation in your application, especially if the stepper has a gearbox on it.&lt;br /&gt;
&lt;br /&gt;
If the motor is not supporting a load or is not required to maintain a specific angle, it is recommended to set the Enable property to false.  This will allow the motor shaft to rotate freely, but the present angle may be lost if forces on the motor-shaft are greater than can be resisted by the detent torque of the unpowered motor. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Braking===&lt;br /&gt;
&lt;br /&gt;
There are several ways to stop a stepper motor, each with different characteristics: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Set Target Position&#039;&#039;&#039; - If you set the target position to the motor&#039;s current position, it will stop. This is typically the best way to stop quickly and hold position, since the motor coils will still be engaged. You could also set the motor velocity limit to zero for a similar effect.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Short the coils&#039;&#039;&#039; - If you have the stepper wires connected to some external circuitry, you could use a switch to short the A and B terminals together, and the C and D terminals together. Due to the [http://en.wikipedia.org/wiki/Lorentz_force Lorentz force] of the electrons in the coil, the motor will begin to brake and hold position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cut power&#039;&#039;&#039; - You could cut power to the controller, but since the motor coils would no longer be engaged, the momentum would cause it to continue rotating until it slows down from friction and detent.&lt;br /&gt;
&lt;br /&gt;
==Stepping Modes==&lt;br /&gt;
&lt;br /&gt;
===Full Stepping===&lt;br /&gt;
This is the default mode of stepping for bipolar motors, where both phases of the motor are controlled by two square waves of current. One wave lags behind the other by 90 degrees, and the motion of the motor is locked to these waves. A full step is completed when the square waves advance by 90 degrees. Since both phases are always fully energized, full stepping provides the best torque. &lt;br /&gt;
&lt;br /&gt;
===Half Stepping===&lt;br /&gt;
In this stepping mode, the controller alternates between having one phase energized and both phases energized. This results in the rotor pausing at half-steps in between the poles, effectively halving the step angle. However, since the current to each coil cannot be exactly balanced, the angle that the rotor comes to rest at between poles may not be exactly half the step angle. The downside to half stepping is that the motor will have less torque on the steps when only one phase is energized. &lt;br /&gt;
&lt;br /&gt;
===Mini/Micro-stepping===&lt;br /&gt;
By controlling the the relative current of both phases, the rotor position can come to rest at various equally spaced sub-steps between the two phases. This is achieved by following the same procedure for Full Stepping, except that the current supplied more closely resembles a sine wave rather than a square wave. Some bipolar controllers are designed to micro-step at low speeds to allow for smooth rotation.&lt;br /&gt;
&lt;br /&gt;
==Selecting a Gearbox==&lt;br /&gt;
&lt;br /&gt;
Using a stepper motor with a gearbox can be a good solution in applications that need very low rotation speeds and/or lots of torque.  Selecting a gearbox to attach to the stepper will result in increasing the output torque and decreasing the speed.  &lt;br /&gt;
Simply, the Gearbox Output Speed is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
 \text{Output Speed} =\frac{\text{Motor Speed}}{\text{Gearbox Ratio}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Although the reduction ratio plays a large part in determining the Gearbox Output Torque, there is also an inefficiency that is introduced through the use of a gearbox.  Some of the torque of the motor is internally converted into heat and lost. So to calculate the Gearbox Output Torque:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
 \text{Output Torque} = \text{Motor Output Torque  } \times \text{  Gearbox Ratio  } \times \text{  Gearbox Efficiency}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When choosing a stepper motor with a gearbox, keep in mind that the gearbox is rated to sustain a specific amount of torque, beyond which the gearbox could become damaged. This limit is often much lower than the amount of torque specified by the above equation.&lt;br /&gt;
&lt;br /&gt;
The Gearbox Step Angle can be determined by:                  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
 \text{Gearbox Step Angle} = \frac{\text{Motor Step Angle}}{\text{Gearbox Ratio}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Planetary Gearbox Reduction Ratios===&lt;br /&gt;
&lt;br /&gt;
[[File:Planetary_gearing.jpg|thumb|300px|link=|This diagram illustrates the parts of a 5.18:1 planetary gearbox.&amp;lt;br&amp;gt;[/docs21/images/1/1a/Planetary_gearing.jpg Click for Larger Image]]]&lt;br /&gt;
&lt;br /&gt;
In some applications, it is important to know the exact gear ratio of a gearbox (for example, when you need the output shaft to make a several complete rotations &lt;br /&gt;
and stop in the same position it started). Most motor datasheets will only list an approximate ratio, like &amp;quot;10:1&amp;quot; or &amp;quot;27:1&amp;quot;. However, there are ways to figure out &lt;br /&gt;
the exact ratio. &lt;br /&gt;
&lt;br /&gt;
In a planetary gearbox where the sun gear is used as an input and the rotation of the spider linking the planet gears is the output, the reduction ratio can be &lt;br /&gt;
expressed by the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\text{Gearbox Ratio} = \frac{T_R + T_S}{T_S}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;T_R&amp;lt;/math&amp;gt; is the number of teeth on the ring gear, and &amp;lt;math&amp;gt;T_S&amp;lt;/math&amp;gt; is the number of teeth on the sun gear. In this situation, the number of teeth on the planetary gears &lt;br /&gt;
don&#039;t affect the reduction ratio and serve only to connect the ring and sun gears. In order to increase the reduction ratio, you need to increase the number of &lt;br /&gt;
teeth on the ring gear. Since there is limited space inside a motor&#039;s gearbox, it eventually becomes impossible to increase the gear ratio. This limitation can be &lt;br /&gt;
bypassed by introducing multiple gear &#039;&#039;&#039;stages&#039;&#039;&#039;. In a multi-stage planetary gearbox, the axles of the planet gears of the first stage are connected to a piece &lt;br /&gt;
of metal called a &amp;quot;spider&amp;quot;, whose rotation is used to turn the sun of the next stage. It&#039;s very common for multi-stage planetary gearboxes to have a tall ring &lt;br /&gt;
gear that spans multiple stages. To determine the overall reduction ratio of a multi-stage planetary gearbox, simply multiply the two ratios together. For &lt;br /&gt;
example, two stages each with a 5:1 reduction ratio would result in a total ratio of 25:1. &lt;br /&gt;
The following table lists exact ratios for gearboxes commonly sold at Phidgets Inc. :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Gearbox_table.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The colored squares visualize the stages that compose each gearbox. For example, a two-stage gearbox with 1 blue and 1 green square indicates that one stage is &lt;br /&gt;
the same ratio as the 1-stage gearbox with the green square beside it, and the other stage is the same as the one with a blue square beside it.&lt;br /&gt;
If you have a third party gearbox and are unable to open it to count the gear teeth, you could also determine the approximate reduction ratio experimentally by &lt;br /&gt;
measuring the rotation angle after a known number of steps have occured. The more accurately you can measure the angle, the better your approximation will be.&lt;br /&gt;
&lt;br /&gt;
===Gearbox Terminology===&lt;br /&gt;
&lt;br /&gt;
Here is a short list of terms you might come across when deciding upon a gearbox:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backlash&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The amount of clearance between mated gear teeth.  Theoretically, the backlash should be “the smaller the better,” but in actual practice, some backlash must be allowed to prevent jamming.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gear Ratio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gearbox accepts the power (think of power as a torque that rotates) from the motor, reducing the speed (exactly) by a given ratio, while increasing the torque (roughly) by the same ratio – a ratio of the gear head with which the gear head reduces the motor speed.	For example, if a motor has a speed of 500RPM and the reduction ratio is 100:1, the speed of the gear head is 500/100 = 5RPM. This is the actual reduction ratio. The calculated speed from the gear head should be based on this ratio.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gearbox Step Angle&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A full step of the motor will result in the gearbox making a smaller step.  The angle of this step is the step angle of the motor divided by the gearbox reduction ratio. For example, a motor with a step angle of 1.8º and a gearbox with a reduction ratio of 20:1 will have a step angle of 1.8/20 = 0.09º at the output of the gearbox.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gearbox Output Torque&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gearbox takes the torque from the output shaft of the motor, reducing the speed and increasing the torque. The gearbox, depending on its efficiency, loses some of the torque as it is converted into heat. Therefore, the Gearbox Output Torque is the motor output torque multiplied by the reduction ratio multiplied by the efficiency of the gearbox. For example, a motor with a low-speed output torque of 500g*cm and a gearbox with a reduction ratio of 5:1 and 90% efficiency will have a Gearbox Output Torque of 500*5*0.9 = 2.25 kg*cm. Remember, however, that if the Gearbox Output Torque exceeds the allowable torque the gearbox is rated for, you can cause damage to the gearbox.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gear Trains&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Planetary gearboxes use multiple gear sets to achieve large gear reductions.  Each gear set makes the gearbox longer, and reduces the efficiency.&lt;br /&gt;
&lt;br /&gt;
==Product Comparison Tables==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|+&#039;&#039;&#039;Stepper Motor Product Specifications&#039;&#039;&#039;&lt;br /&gt;
! Phidgets Product #&lt;br /&gt;
! Motor Model Number&lt;br /&gt;
! Motor Type (Unipolar/Bipolar) &lt;br /&gt;
! Step Angle (deg)&lt;br /&gt;
! Holding Torque (g•cm)&lt;br /&gt;
! Low-Speed Torque (g•cm)&lt;br /&gt;
! Rated Current (A)&lt;br /&gt;
! Number of Leads&lt;br /&gt;
! Mounting Plate Size&lt;br /&gt;
! Shaft Diameter (mm)&lt;br /&gt;
! Total Weight (g)&lt;br /&gt;
! Motor Length (mm)&lt;br /&gt;
! Motor Size/Diameter (mm)&lt;br /&gt;
|-&lt;br /&gt;
| 3302|| 42BYGHM810  || Hybrid Bipolar || 0.9|| 4800|| 4280|| 2.4 || 4|| NEMA-17|| 5  || 362|| 48  || 42 x 42&lt;br /&gt;
|-&lt;br /&gt;
| 3303|| 42BYGHW811  || Hybrid Bipolar || 1.8|| 4800|| 4240|| 2.5 || 4|| NEMA-17|| 5  || 332|| 48  || 42 x 42&lt;br /&gt;
|-&lt;br /&gt;
| 3304|| 39BYGS202   || Hybrid Bipolar || 3.75|| 750|| 590 || 1   || 4|| NEMA-17|| 5  || 171|| 32  || 39 x 39&lt;br /&gt;
|-&lt;br /&gt;
| 3305|| 39BYG013    || Hybrid Bipolar || 1.8||  550|| 450 || 0.4 || 4|| NEMA-17|| 5  || 110|| 20  || 39 x 39&lt;br /&gt;
|-&lt;br /&gt;
| 3314|| PM42L-048-17|| Hybrid Unipolar|| 7.5|| 950 || 710 || 0.28|| 6|| N/A    || 3  || 138|| 14.4|| 42&lt;br /&gt;
|-&lt;br /&gt;
| 3315|| PM25S-048-15|| Hybrid Unipolar|| 7.5|| 140 || 50  || 0.1 || 6|| N/A    || 2  || 31 || 15  || 25&lt;br /&gt;
|-&lt;br /&gt;
| 3316|| PM20L-20-14 || Hybrid Unipolar|| 18 || 50  || 30  || 0.08|| 6|| N/A    || 1.5|| 24 || 16.5|| 20&lt;br /&gt;
|-&lt;br /&gt;
| 3320|| 28STH32     || Hybrid Bipolar || 1.8|| 600 || 520 || 0.67|| 4|| NEMA-11|| 5  || 111|| 32|| 28 x 28&lt;br /&gt;
|-&lt;br /&gt;
| 3323|| 35STH40     || Hybrid Bipolar || 1.8|| 1400|| 1200|| 1   || 4|| NEMA-14|| 5  || 200|| 40|| 35 x 35&lt;br /&gt;
|-&lt;br /&gt;
| 3324|| 42STH38     || Hybrid Bipolar || 1.8|| 3600|| 3300|| 1.7 || 4|| NEMA-17|| 5  || 289|| 40|| 42 x 42&lt;br /&gt;
|-&lt;br /&gt;
| 3330|| 57STH56     || Hybrid Bipolar || 0.9||12000||11200|| 2.8 || 4|| NEMA-23|| 6.4|| 695|| 56|| 56 x 56&lt;br /&gt;
|-&lt;br /&gt;
| 3331|| 57STH56     || Hybrid Bipolar || 1.8||12600||11000|| 2.8 || 4|| NEMA-23|| 6.4|| 686|| 56|| 56 x 56&lt;br /&gt;
|-&lt;br /&gt;
| 3335|| 86STH65     || Hybrid Bipolar || 1.8||34000||30000||2 or 4 || 4|| NEMA-34|| 12|| 1800|| 65|| 85 x 85&lt;br /&gt;
|-&lt;br /&gt;
| 3336|| 86STH156    || Hybrid Bipolar || 1.8||122000||106000||3 or 6 || 4|| NEMA-34|| 16|| 5200|| 156|| 85 x 85&lt;br /&gt;
|-&lt;br /&gt;
| 3340|| 42STH38     || Hybrid Bipolar || 0.9||3600||3300||1.7 || 4|| NEMA-17|| 5||288|| 40|| 42 x 42&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=1&lt;br /&gt;
|+&#039;&#039;&#039;Gearbox Stepper Motor Product Specifications&#039;&#039;&#039;&lt;br /&gt;
!Product #&lt;br /&gt;
!Motor Model #&lt;br /&gt;
!Motor Type&lt;br /&gt;
!Step Angle&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (deg)&lt;br /&gt;
!Holding Torque*,&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (g-cm)&lt;br /&gt;
!Low-speed Torque*,&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (g-cm)&lt;br /&gt;
!Rated Current (A)&lt;br /&gt;
!# of Leads&lt;br /&gt;
!Mounting Plate Size&lt;br /&gt;
!Shaft Diameter (mm)&lt;br /&gt;
!Total Weight (g)&lt;br /&gt;
!Motor Length (mm)&lt;br /&gt;
!Gearbox Length (mm)&lt;br /&gt;
!Motor Size/Diameter (mm)&lt;br /&gt;
!Gear Ratio&lt;br /&gt;
!Gearbox Max Torque (g-cm)&lt;br /&gt;
!Gearbox Efficiency&lt;br /&gt;
!Max Speed&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (RPM)&lt;br /&gt;
|-&lt;br /&gt;
| 3310||57BYG630-07AG20||Hybrid Bipolar||0.09||30000||30000||2.8||4||NEMA-23||8||1330||73||38||56x56||20:1||30000||||30&lt;br /&gt;
|-&lt;br /&gt;
| 3311||42BYGHW811-AG5.18||Hybrid Bipolar||0.35||24860||17790||2.5||4||NEMA-17||8||513||48||31||42x42||5.18:1||30000||0.9||115&lt;br /&gt;
|-&lt;br /&gt;
| 3312||42BYGHW811-AG26.8||Hybrid Bipolar||0.07||40000||40000||2.5||4||NEMA-17||8||526||48||39||42x42||26.8:1||40000||0.81||22&lt;br /&gt;
|-&lt;br /&gt;
| 3313||42BYGHW811-AG99.5||Hybrid Bipolar||0.02||50000||50000||2.5||4||NEMA-17||8||610||48||47||42x42||99.5:1||50000||0.73||6&lt;br /&gt;
|-&lt;br /&gt;
| 3317||42BYGH40(M)-160-4A||Hybrid Bipolar||0.35||16780||12000||1.6||4||NEMA-17||8||464||40||30||42x42||5.18:1||20000||0.9||115&lt;br /&gt;
|-&lt;br /&gt;
| 3318||42BYGH40(M)-160-4A||Hybrid Bipolar||0.07||30000||30000||1.6||4||NEMA-17||8||464||40||38||42x42||26.8:1||30000||0.8||22&lt;br /&gt;
|-&lt;br /&gt;
| 3319||42BYGH40(M)-160-4A||Hybrid Bipolar||0.02||40000||40000||1.6||4||NEMA-17||8||464||40||46||42x42||99.5:1||40000||0.7||6&lt;br /&gt;
|-&lt;br /&gt;
| 3321||28STH32-0674B/28JXS40K27||Hybrid Bipolar||0.067||16100||14000||0.67||4||NEMA-11||6||218||32||40||28x28||27:1||20000|| ||120&lt;br /&gt;
|-&lt;br /&gt;
| 3322||28STH32-0674B/28JXS40K100||Hybrid Bipolar||0.018||32000||32000||0.67||4||NEMA-11||6||243||32||49||28x28||100:1||32000|| ||35&lt;br /&gt;
|-&lt;br /&gt;
| 3325||42STH38-1684B/36JXS60K5.18||Hybrid Bipolar||0.35||18000||18000||1.7||4||NEMA-17||8||457||40||31||42x42||5.18:1||18000|| ||904&lt;br /&gt;
|-&lt;br /&gt;
| 3326||42STH38-1684B/36JXS60K14||Hybrid Bipolar||0.13||30000||30000||1.7||4||NEMA-17||8||502||40||39||42x42||14:1||30000|| ||295&lt;br /&gt;
|-&lt;br /&gt;
| 3327||42STH38-1684B/36JXS60K26||Hybrid Bipolar||0.067||30000||30000||1.7||4||NEMA-17||8||503||40||39||42x42||26.85:1||30000|| ||174&lt;br /&gt;
|-&lt;br /&gt;
| 3328||42STH38-1684B/36JXS60K51||Hybrid Bipolar||0.035||48000||48000||1.7||4||NEMA-17||8||564||40||48||42x42||51:1||48000|| ||63&lt;br /&gt;
|-&lt;br /&gt;
| 3329||42STH38-1684B/36JXS60K99.51||Hybrid Bipolar||0.018||48000||48000||1.7||4||NEMA-17||8||564||40||48||42x42||100:1||48000|| ||34&lt;br /&gt;
|-&lt;br /&gt;
| 3332||57STH56-2804B/56JXS300K4.25||Hybrid Bipolar||0.42||53000||46600||2.8||4||NEMA-23||12||1200||56||48||57x57||4.25:1||90000|| ||375&lt;br /&gt;
|-&lt;br /&gt;
| 3333||57STH56-2804B/56JXS300K15||Hybrid Bipolar||0.12||150000||150000||2.8||4||NEMA-23||12||1300||56||61||57x57||15:1||150000|| || 116&lt;br /&gt;
|-&lt;br /&gt;
| 3334||57STH56-2804B/56JXS300K77||Hybrid Bipolar||0.023||240000||240000||2.8||4||NEMA-23||12||1500||56||72||57x57||77:1||240000|| ||25&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt;Step angle, torque values, and max speed are all measured at the output of the gearbox. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;Holding torque and low speed torque for gearbox motors are limited by the max torque that the gearbox is rated to sustain.&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Glossary of Terms==&lt;br /&gt;
&lt;br /&gt;
===Motor Terms===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Coil Resistance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The electrical resistance (to direct current) of the wiring within the motor. This resistance causes some of the energy being applied to the motor to be converted into heat.  Some motors and motor controllers rely solely on the electrical resistance to regulate the current flowing through the motor. The Unipolar Motors we sell, and the 1062 PhidgetStepper Unipolar rely on this inexpensive, but inefficient technique. Other motors will have very low resistance, increasing their efficiency, but requiring very sophisticated control techniques because the resistance cannot regulate the current to a safe level on its own. Our Bipolar controllers and our Bipolar motors use this technique, otherwise known as Chopper Drive.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Holding Torque&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Holding Torque is the amount of torque needed to rotate the shaft of the stepper motor while the controller attempts to hold the position, using the maximum current allowed for the motor. Holding Torque is the sum of the magnetic force exerted by the electrical coils to hold the current position, and the detent torque, which is the natural resistance of the motor against rotation due to the permanent magnet inside the motor.  Once the motor begins to rotate, the torque it can exert (at least at low speeds) is Holding Torque minus twice the detent torque (because the motor is now working against the detent). As the motor speed increases, torque begins to decrease.  If the power supply voltage is low, or the inductance of the motor is high, the torque will fall more rapidly.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Motor Inductance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Stepper motors are built with a specific coil inductance. A high inductance motor will provide a greater amount of torque at low speeds, at the cost of having lower torque at high speeds. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Overhung Load (OHL) / Radial Load&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
An external load applied on the output shaft of the gearbox.  This load is often produced if pulleys are mounted directly on the shaft, pulling perpendicular to it. When the OHL exceeds a safe value, the bearings can fail, or the shaft can break from bending fatigue. While OHL and Thrust Load specifications are only available for our gearbox motors, both types of load should be avoided when using any of our motors.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rated Current&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The rated current is the maximum current that should be applied to each coil of the motor.  Current generates heat within the motor, and exceeding the regulated current will cause the motor to overheat.  If the motor is operated in a hot environment, or is enclosed, it can overheat at currents lower than the rated current.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step Angle&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in the shaft angle when the motor moves forward or backward by one full step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step Accuracy&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Depending on the motor and how it is loaded down, the step positions will vary slightly.  Fortunately, this variance doesn’t accumulate – so if you move the motor by one step or one million steps, the angle that the motor stops at will have the same margin of error.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Thrust load / Axial Load&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A load applied directly in line with the output shaft of the gearbox.  Avoid thrust as much as possible.  If thrust load is unavoidable, keep it to no more than the permissible value.&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Stepper_Motor_and_Controller_Primer&amp;diff=23971</id>
		<title>Stepper Motor and Controller Primer</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Stepper_Motor_and_Controller_Primer&amp;diff=23971"/>
		<updated>2017-09-18T17:16:10Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Primer]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|- valign=middle&lt;br /&gt;
| align=center width=300px| __TOC__ &lt;br /&gt;
| [[Image:3302.jpg|link=]]&lt;br /&gt;
| [[Image:1063.jpg|link=]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Stepper motors are broadly available motors commonly used for positioning.  The rotor of a stepper moves in a series of discrete steps.  By energizing the coils of the motor in sequence through many of these steps, the direction of rotation, number of rotations, and exact position of the motor shaft can be easily controlled.  By controlling the time between the steps, the speed and acceleration of the stepper is regulated.  In contrast, a DC motor will blindly spin at the highest speed possible when powered, unless it is controlled with an [[Encoder Primer|Encoder]] and a control system program. It is not necessary to use an encoder on a stepper motor unless you&#039;re concerned about the motor losing count of the steps over a long period of time or in high torque situations.&lt;br /&gt;
&lt;br /&gt;
Each stepper motor is designed to move by a certain angle with each discrete step.  The simplest stepper motors will rotate 90 degrees per step.  Standard industrial steppers will rotate 1.8 degrees per step. The stepping angle can be further reduced through use of a gearbox.&lt;br /&gt;
&lt;br /&gt;
In addition to the ease of precisely controlling position and speed, Steppers have other advantages:&lt;br /&gt;
&lt;br /&gt;
*Most motors have very little torque when they are operating at low speed or standstill. Since a stepper’s rotor is held in place by a magnetic field during each step,  steppers have full torque at low speed or standstill, making them very useful for low speed rotation and actuation. Additionally, a stepper motor can remain in a fixed position for long periods of time with the rated current in the windings, whereas with DC motors, stalling and remaining in a fixed position for long periods of time will cause motor burnout. &lt;br /&gt;
*DC Motors have brushes with a finite lifetime.  Steppers have no brushes, and are limited only by the life of the bearings.&lt;br /&gt;
&lt;br /&gt;
Compared to DC Motors, there are disadvantages to Steppers:&lt;br /&gt;
&lt;br /&gt;
*Each step will produce vibration in the motor.  If these vibrations are at the mechanical resonant frequency of the motor, they can cause the rotor to overshoot and bounce back and forth, resulting in a severe loss of torque. This phenomenon is called “ringing” and is often accompanied by a loud buzzing or grinding noise. To prevent the motor from operating in such a way, you should test the motor at various speeds in the physical application it is intended for, and try to avoid running the motor at a speed which exhibits ringing behaviour. &lt;br /&gt;
*If the motor encounters a brief overload, the fixed coils on the stator and  the free-spinning rotor can lose track of each other. If this happens at higher speeds, the motor will often stall.  Even at lower speeds, your system will have lost track of where exactly the motor is positioned – unless there is an independent system (e.g., an optical encoder) tracking the position.&lt;br /&gt;
*A Stepper motor cannot be loaded at its maximum torque, as it will almost certainly be overloaded during operation.  A DC Motor will naturally adjust its speed depending on how much power is provided, and the torque required to turn it’s shaft.&lt;br /&gt;
&lt;br /&gt;
For more information about the differences between stepper motors, DC motors, and servo motors, see the [[Motor Selection Guide]].&lt;br /&gt;
&lt;br /&gt;
==Types of Stepper Motors==&lt;br /&gt;
&lt;br /&gt;
We find it useful to classify motors according to how the coils are wound (Bipolar / Unipolar), the internal magnetic construction (Permanent Magnet / Hybrid), and how the current in the coils is regulated (Chopper Drive / Resistive Limited).&lt;br /&gt;
&lt;br /&gt;
===Coils===&lt;br /&gt;
=====Bipolar=====&lt;br /&gt;
These motors are manufactured with two coils of wire, resulting in one winding per phase.  By alternating the power between coils, as well as the direction of the current, the motor is rotated. This configuration produces magnetic fields within the coils in either direction, hence the term “Bipolar.”  The controller is more expensive because it has to be able to produce both positive and negative electrical currents, but the advantage is that the entire coil is being used, thus increasing torque capabilities at all speeds. We do not recommend using a bipolar controller to run a unipolar motor, even though it is theoretically possible.&lt;br /&gt;
&lt;br /&gt;
=====Unipolar=====&lt;br /&gt;
In a unipolar motor, the motor windings consist of two identical coils per phase, wound in opposite directions (each occupying half of the space a coil normally would in a bipolar stepper).   As a result, the controller only needs to select which of the two coils to pass current through in order to change the magnetic polarity, and only a positive current is required to be generated.  Due to this simplified control mechanism which uses only half of each coil, the torque of unipolar motors are usually much lower, but the overall cost of the system is much cheaper. The simplicity of the unipolar controller also means that you cannot use it to run a bipolar stepper motor.&lt;br /&gt;
&lt;br /&gt;
===Magnets===&lt;br /&gt;
=====Permanent Magnet=====&lt;br /&gt;
Permanent magnet motors are small, low torque, and inexpensive. They use a permanent magnet in the rotor that is attracted or repelled by magnetic field generated by the stator coils. Step angles are often 7.5 or 15 degrees, and the motors are usually unipolar.&lt;br /&gt;
&lt;br /&gt;
=====Variable Reluctance=====&lt;br /&gt;
The rotor of a variable reluctance stepper is made of iron, and it therefore aligns with the magnetic field generated by the stator coils. Since it doesn’t use a permanent magnet, it doesn’t matter which direction the current flows as long as each coil is wound in the opposite direction as the coil across from it. Therefore, variable reluctance steppers are unipolar and are typically designed to have larger step angles of 15 or more degrees.&lt;br /&gt;
&lt;br /&gt;
=====Hybrid=====&lt;br /&gt;
Hybrid Motors dominate the stepper motor world – they use a combination of characteristics from permanent magnet and variable reluctance steppers and have the best torque and speed, but are more expensive to produce. Step angles are typically 0.9 to 3.75 degrees, giving much better step resolution.&lt;br /&gt;
&lt;br /&gt;
===Drive===&lt;br /&gt;
=====Chopper Drive=====&lt;br /&gt;
Chopper Drive is an electronic control technique which allows specific motors to produce more power, torque, speed, and be more efficient.  Instead of relying on the resistance of the coil wiring, the inductance of the wiring is exploited by sophisticated control electronics as a short-term limitation of motor current.  Motor Manufacturers don’t do a good job of distinguishing motors suitable for use with Chopper Drive electronics.  The motors will often be large, square, with very low resistance.&lt;br /&gt;
=====Resistive Limited=====&lt;br /&gt;
Small, inexpensive steppers are designed to be built and controlled as cheaply as possible.  To simplify the control electronics, the length and thickness of the wire in the coils is selected for a particular control voltage.  This allows the coil itself to regulate the power available to the motor – provided the appropriate voltage is used, of course.  We call this type of motor Resistive Limited.&lt;br /&gt;
&lt;br /&gt;
==How it Works==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Stepper_back_web.jpg|left|link=|thumb|230px|Cross-Section of a Hybrid Bipolar Stepper&amp;lt;br /&amp;gt;[[Media:Stepper_back_web.jpg|Full-size Image]]]]&lt;br /&gt;
&lt;br /&gt;
===Hybrid Bipolar Steppers===&lt;br /&gt;
This section of the primer will cover the general principle of operation for stepper motors. While this information is by no means necessary to use a stepper motor, those who are curious about their inner workings may read on. &lt;br /&gt;
&lt;br /&gt;
The thumbnail to the left is a cross-sectional view of the inside of a hybrid bipolar stepper motor. As you can see, it has eight poles with six teeth each. This motor contains two coils- one wrapping the odd-numbered poles, and the other wrapping the even-numbered poles. The steel end-cap in the center of the image covers a cylindrical permanent magnet which surrounds the shaft. &lt;br /&gt;
&lt;br /&gt;
If positive current is sent to the odd-numbered coil, poles 1 and 5 are magnetized as south, and poles 3 and 7 are magnetized as north. Assuming the permanent magnet in the center of the motor has its north pole facing toward us, this will result in the rotor turning so that the teeth line up with stator poles 1 and 5, as they are in the image. At the same time, poles 3 and 7 will become aligned on the opposite end of the motor, where the gear on the rotor is permanently offset by the width of one tooth and the permanent magnet has magnetized the rotor as south. The rotation of the motor is continued by sending negative current through the even-numbered phase, then negative current through the odd-numbered phase, then positive current through the even-numbered phase, and so on. The stepper controller can reverse the direction of rotation simply by reversing this sequence.&lt;br /&gt;
&lt;br /&gt;
When a stepper motor becomes engaged in software, and current is applied to the coils, it may abruptly &amp;quot;snap&amp;quot; to the position that the rotor is being held at. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hybrid Unipolar Steppers===&lt;br /&gt;
The operation of a hybrid unipolar stepper is very similar to the bipolar stepper described above, except that each pole has two seperate coils wound in opposite directions. This results in four phases which only require positive current to operate. Rather than alternating the direction of current, the motor controller simply sends positive current to the appropriate half of the coil.&lt;br /&gt;
&lt;br /&gt;
==Controlling the Stepper Motor==&lt;br /&gt;
&lt;br /&gt;
The following information has been derived from using the 3308 stepper motor connected to a 1063 - PhidgetStepper Bipolar 1-Motor controller.&lt;br /&gt;
===Setting the Current Limit===&lt;br /&gt;
&lt;br /&gt;
[[Image:Graph12v.jpg|border|400px|link=|thumb|The current/speed characteristics for the 3308 at 12V.&amp;lt;br /&amp;gt;[[Media:Graph12v.jpg|Full-size Image]]]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Graph24v.jpg|border|400px|link=|thumb|The current/speed characteristics for the 3308 at 24V.&amp;lt;br /&amp;gt;[[Media:Graph24v.jpg|Full-size Image]]]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Graph30v.jpg|border|400px|link=|thumb|The current/speed characteristics for the 3308 at 30V.&amp;lt;br /&amp;gt;[[Media:Graph30v.jpg|Full-size Image]]]]&lt;br /&gt;
&lt;br /&gt;
The current limit is an important control property of stepper controllers. Since many stepper motors have a very low coil resistance, the current through the coils cannot “self-regulate” to a safe level on their own.  They require the sophisticated control techniques of a Chopper Drive, which is used in the [{{SERVER}}/products.php?product_id=1063 1063 PhidgetStepper] controller.  As a result, the maximum current allowed should be explicitly set.&lt;br /&gt;
&lt;br /&gt;
There are many factors that influence what the current limit should be set to. These include, but are not limited to,the acceleration and speed of the stepper, the supply voltage, applied torque, motor inductance, and coil resistance. The process of choosing the current limit can be simplified by following some general rules of thumb. The graphs in this section show a set of speed vs. current characteristics for the 3308 stepper with various power supplies. &lt;br /&gt;
&lt;br /&gt;
In the these graphs, the &#039;&#039;&#039;“actual speed”&#039;&#039;&#039; of the motor is the maximum speed attainable in a real world test done with no load on the motor, but at very high acceleration.  The &#039;&#039;&#039;“max speed”&#039;&#039;&#039; shows the limitation on speed imposed by the inductance of the motor coils at a given supply voltage.  Given that the 1063 controller is only able to run at a maximum speed of 2048 full steps per second, our graphs don’t show data at higher speeds. &lt;br /&gt;
&lt;br /&gt;
When the current limit is set low and the acceleration is high, the motor will not be able to provide enough power to accelerate itself and the load it’s driving.  The motor also has to overcome friction losses within the system, and do work on the load - for example, lifting a weight.  By increasing the current limit, more current and power is made available to accelerate and maintain maximum speeds.  This can be seen on any of the graphs in the initial steep ramp of the actual speed.  As the current limit increases, the motor is able to achieve higher speeds.&lt;br /&gt;
&lt;br /&gt;
In the case of this particular motor, the large inductance of the coils - great for producing lots of torque, quickly overwhelms a 12V power supply.  To get higher speeds and more performance out of this motor, higher supply voltages are necessary.  Compare the actual speed curve on the 12V graph to the 30V graph.  At 30V, the motor is able to achieve a much higher speed.  It’s important to remember that the actual speed was measured at very high accelerations - by lowering acceleration, higher velocities can be achieved.  Of course, if your motor is doing a lot of work, you’ll need to supply enough current to produce the necessary torque, therefore limiting the maximum speed. &lt;br /&gt;
&lt;br /&gt;
Setting Current Limit for your application is a balancing act.  By increasing the current limit, more torque is available, but far more power will be consumed when the motor is turning very slowly or stopped. When setting a high acceleration, more power (therefore current) is required to accelerate the motor and it’s load. Selecting the current limit is often done dynamically in the actual application - set the current limit very low, and run the system, increasing the Current Limit if it stalls.  After a set up has been determined that is reliable, increase the current limit by another 25% to give some margin.&lt;br /&gt;
&lt;br /&gt;
There is no point in setting the current limit to be greater than the motor’s rated current- the increased inductance will only further limit the motor speed. In this case, the 30V graph shows that it’s not feasible to operate this motor at maximum torque (1.7 Amps) at a speed greater than 1100 full steps per second. By reducing the current limit, greater speeds are possible, but less torque will be available.  Most motors designed for Chopper Drive control can operate at much higher voltages, but Phidgets Inc. does not carry a controller that can provide these voltages at this time.&lt;br /&gt;
&lt;br /&gt;
Note that just because you have set the current limit to some amount (for the sake of example let&#039;s say 2A) the motor will not draw 2A at all times.  The motor will only draw as much current as it needs.  This means that if there is only a small load on the motor and it is spinning at less than its top speed the motor might only draw a small fraction of the allotted 2A.  Even as low as 300 or 400mA.  As more load or higher speed is applied, the current usage will go up until the controller is giving the motor the full current limit. As a motor draws more current, it will also produce more heat. It is normal for a stepper motor to be hot to the touch after running for a while. If the motor is getting very hot, you may be trying to drive too large a load for that particular motor.&lt;br /&gt;
&lt;br /&gt;
===Choosing a Supply Voltage===&lt;br /&gt;
&lt;br /&gt;
When looking at a stepper motor&#039;s specifications, you may come across a &amp;quot;Rated Voltage&amp;quot; value. This value is usually equal to the rated current multiplied by the resistance of the coils of the motor, making it somewhat of a redundant specification. As mentioned earlier, you can increase your controller&#039;s supply voltage in order to allow the motor to reach higher speeds at a lower current (because high current causes high inductance which puts a hard limit on how much speed and torque a motor can produce). The motor will also produce more heat as you increase the supply voltage, so it&#039;s a good idea to choose a supply voltage based on the performance you need for the motor. Some motors will have a &amp;quot;Recommended Voltage&amp;quot; for a particular controller, which is the amount of voltage needed to reach the optimal speed and torque of the motor with minimal heating.&lt;br /&gt;
&lt;br /&gt;
===Setting the Velocity Limit===&lt;br /&gt;
&lt;br /&gt;
The velocity of a motor cannot be directly chosen with our stepper controllers. However, a velocity limit can be chosen to ensure that the motor does not go faster than a certain speed. This is useful because every stepper motor has a speed that causes itself to vibrate at the resonant frequency of its own moving parts. When the motor vibrates at this frequency, the motor will often overshoot its target position, causing it to lose most of its torque, sometimes even rotating in the wrong direction. This phenomenon is sometimes called &amp;quot;ringing&amp;quot;. If you experience these problems while running your stepper motor at a constant velocity, try setting the velocity limit to lower or higher than it was previously, in an attempt to minimize the amount of time spent operating at this particular velocity.&lt;br /&gt;
&lt;br /&gt;
===Setting the Acceleration===&lt;br /&gt;
The acceleration of a stepper motor is an important consideration when driving a load.  Setting the acceleration too high can result in the motor stalling, especially with a heavy load. Try to use low acceleration in high-torque applications.&lt;br /&gt;
&lt;br /&gt;
===Continuous Rotation and Forward/Reverse===&lt;br /&gt;
&lt;br /&gt;
A stepper motor can be caused to rotate continuously by simply setting the controller&#039;s target position property to an extremely large number of steps.&lt;br /&gt;
&lt;br /&gt;
Stepper motors can easily be run in forward or reverse by choosing a target position greater than or less than the current position, respectively. Reversing the polarity of either of the motor&#039;s wire pairs will invert this effect- causing a lesser target position to result in forward rotation, and a greater target position to result in reverse rotation. For this reason, you should pay attention to the way you wire a motor when developing and testing code, and ensure that you wire it with the same polarity in the future to avoid erroneous behaviour in applications where rotation direction matters.&lt;br /&gt;
&lt;br /&gt;
===Cooling===&lt;br /&gt;
The stepper controllers sold at Phidgets Inc. have a current rating that is limited by the heat dissipation capability of the board. You could add heatsinks, fans, or other cooling devices to increase the current limit, but do so with caution. Unless you have a way of monitoring the temperature of the driver chip during operation, you have no way of knowing how far beyond the rated specification you can go.&lt;br /&gt;
&lt;br /&gt;
===Wire Length===&lt;br /&gt;
&lt;br /&gt;
Since the stepper controller is sending a fairly simple signal to the motor, interference is not a big concern. You should be able to have quite long wires between your motor and controller. For more information, see the [[Effects_of_Long_Wires|effects of long wires]] page.&lt;br /&gt;
&lt;br /&gt;
===Saving Power===&lt;br /&gt;
&lt;br /&gt;
When the stepper motor has rotated the requested number of steps, and is stopped, the coils will remain energized to hold it in position.  This is necessary to allow the motor to support a load on its shaft without rotating to an unknown position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Holding torque&#039;&#039;&#039; is the amount of torque required to rotate the motor ‘against it’s will’ when the full rated current is flowing through  the coils.  If power consumption or overheating is a problem, and full holding torque is not required, the Current Limit can be decreased in software when the motor is not moving.  Holding torque will decrease linearly as you decrease the Current Limit, but will also allow you to save power and reduce the heat generated in your system.&lt;br /&gt;
&lt;br /&gt;
There is also a small resistance to movement within the motor even when there is no current, called &#039;&#039;&#039;Detent Torque&#039;&#039;&#039;. This may be sufficient to prevent rotation in your application, especially if the stepper has a gearbox on it.&lt;br /&gt;
&lt;br /&gt;
If the motor is not supporting a load or is not required to maintain a specific angle, it is recommended to set the Enable property to false.  This will allow the motor shaft to rotate freely, but the present angle may be lost if forces on the motor-shaft are greater than can be resisted by the detent torque of the unpowered motor. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Braking===&lt;br /&gt;
&lt;br /&gt;
There are several ways to stop a stepper motor, each with different characteristics: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Set Target Position&#039;&#039;&#039; - If you set the target position to the motor&#039;s current position, it will stop. This is typically the best way to stop quickly and hold position, since the motor coils will still be engaged. You could also set the motor velocity limit to zero for a similar effect.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Short the coils&#039;&#039;&#039; - If you have the stepper wires connected to some external circuitry, you could use a switch to short the A and B terminals together, and the C and D terminals together. Due to the [http://en.wikipedia.org/wiki/Lorentz_force Lorentz force] of the electrons in the coil, the motor will begin to brake and hold position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cut power&#039;&#039;&#039; - You could cut power to the controller, but since the motor coils would no longer be engaged, the momentum would cause it to continue rotating until it slows down from friction and detent.&lt;br /&gt;
&lt;br /&gt;
==Stepping Modes==&lt;br /&gt;
&lt;br /&gt;
===Full Stepping===&lt;br /&gt;
This is the default mode of stepping for bipolar motors, where both phases of the motor are controlled by two square waves of current. One wave lags behind the other by 90 degrees, and the motion of the motor is locked to these waves. A full step is completed when the square waves advance by 90 degrees. Since both phases are always fully energized, full stepping provides the best torque. &lt;br /&gt;
&lt;br /&gt;
===Half Stepping===&lt;br /&gt;
In this stepping mode, the controller alternates between having one phase energized and both phases energized. This results in the rotor pausing at half-steps in between the poles, effectively halving the step angle. However, since the current to each coil cannot be exactly balanced, the angle that the rotor comes to rest at between poles may not be exactly half the step angle. The downside to half stepping is that the motor will have less torque on the steps when only one phase is energized. &lt;br /&gt;
&lt;br /&gt;
===Mini/Micro-stepping===&lt;br /&gt;
By controlling the the relative current of both phases, the rotor position can come to rest at various equally spaced sub-steps between the two phases. This is achieved by following the same procedure for Full Stepping, except that the current supplied more closely resembles a sine wave rather than a square wave. Some bipolar controllers are designed to micro-step at low speeds to allow for smooth rotation.&lt;br /&gt;
&lt;br /&gt;
==Selecting a Gearbox==&lt;br /&gt;
&lt;br /&gt;
Using a stepper motor with a gearbox can be a good solution in applications that need very low rotation speeds and/or lots of torque.  Selecting a gearbox to attach to the stepper will result in increasing the output torque and decreasing the speed.  &lt;br /&gt;
Simply, the Gearbox Output Speed is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
 \text{Output Speed} =\frac{\text{Motor Speed}}{\text{Gearbox Ratio}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Although the reduction ratio plays a large part in determining the Gearbox Output Torque, there is also an inefficiency that is introduced through the use of a gearbox.  Some of the torque of the motor is internally converted into heat and lost. So to calculate the Gearbox Output Torque:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
 \text{Output Torque} = \text{Motor Output Torque  } \times \text{  Gearbox Ratio  } \times \text{  Gearbox Efficiency}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When choosing a stepper motor with a gearbox, keep in mind that the gearbox is rated to sustain a specific amount of torque, beyond which the gearbox could become damaged. This limit is often much lower than the amount of torque specified by the above equation.&lt;br /&gt;
&lt;br /&gt;
The Gearbox Step Angle can be determined by:                  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
 \text{Gearbox Step Angle} = \frac{\text{Motor Step Angle}}{\text{Gearbox Ratio}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Planetary Gearbox Reduction Ratios===&lt;br /&gt;
&lt;br /&gt;
[[File:Planetary_gearing.jpg|thumb|300px|link=|This diagram illustrates the parts of a 5.18:1 planetary gearbox.&amp;lt;br&amp;gt;[[[/docs21/images/1/1a/Planetary_gearing.jpg Click for Larger Image]]]&lt;br /&gt;
&lt;br /&gt;
In some applications, it is important to know the exact gear ratio of a gearbox (for example, when you need the output shaft to make a several complete rotations &lt;br /&gt;
and stop in the same position it started). Most motor datasheets will only list an approximate ratio, like &amp;quot;10:1&amp;quot; or &amp;quot;27:1&amp;quot;. However, there are ways to figure out &lt;br /&gt;
the exact ratio. &lt;br /&gt;
&lt;br /&gt;
In a planetary gearbox where the sun gear is used as an input and the rotation of the spider linking the planet gears is the output, the reduction ratio can be &lt;br /&gt;
expressed by the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\text{Gearbox Ratio} = \frac{T_R + T_S}{T_S}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;T_R&amp;lt;/math&amp;gt; is the number of teeth on the ring gear, and &amp;lt;math&amp;gt;T_S&amp;lt;/math&amp;gt; is the number of teeth on the sun gear. In this situation, the number of teeth on the planetary gears &lt;br /&gt;
don&#039;t affect the reduction ratio and serve only to connect the ring and sun gears. In order to increase the reduction ratio, you need to increase the number of &lt;br /&gt;
teeth on the ring gear. Since there is limited space inside a motor&#039;s gearbox, it eventually becomes impossible to increase the gear ratio. This limitation can be &lt;br /&gt;
bypassed by introducing multiple gear &#039;&#039;&#039;stages&#039;&#039;&#039;. In a multi-stage planetary gearbox, the axles of the planet gears of the first stage are connected to a piece &lt;br /&gt;
of metal called a &amp;quot;spider&amp;quot;, whose rotation is used to turn the sun of the next stage. It&#039;s very common for multi-stage planetary gearboxes to have a tall ring &lt;br /&gt;
gear that spans multiple stages. To determine the overall reduction ratio of a multi-stage planetary gearbox, simply multiply the two ratios together. For &lt;br /&gt;
example, two stages each with a 5:1 reduction ratio would result in a total ratio of 25:1. &lt;br /&gt;
The following table lists exact ratios for gearboxes commonly sold at Phidgets Inc. :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Gearbox_table.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The colored squares visualize the stages that compose each gearbox. For example, a two-stage gearbox with 1 blue and 1 green square indicates that one stage is &lt;br /&gt;
the same ratio as the 1-stage gearbox with the green square beside it, and the other stage is the same as the one with a blue square beside it.&lt;br /&gt;
If you have a third party gearbox and are unable to open it to count the gear teeth, you could also determine the approximate reduction ratio experimentally by &lt;br /&gt;
measuring the rotation angle after a known number of steps have occured. The more accurately you can measure the angle, the better your approximation will be.&lt;br /&gt;
&lt;br /&gt;
===Gearbox Terminology===&lt;br /&gt;
&lt;br /&gt;
Here is a short list of terms you might come across when deciding upon a gearbox:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backlash&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The amount of clearance between mated gear teeth.  Theoretically, the backlash should be “the smaller the better,” but in actual practice, some backlash must be allowed to prevent jamming.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gear Ratio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gearbox accepts the power (think of power as a torque that rotates) from the motor, reducing the speed (exactly) by a given ratio, while increasing the torque (roughly) by the same ratio – a ratio of the gear head with which the gear head reduces the motor speed.	For example, if a motor has a speed of 500RPM and the reduction ratio is 100:1, the speed of the gear head is 500/100 = 5RPM. This is the actual reduction ratio. The calculated speed from the gear head should be based on this ratio.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gearbox Step Angle&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A full step of the motor will result in the gearbox making a smaller step.  The angle of this step is the step angle of the motor divided by the gearbox reduction ratio. For example, a motor with a step angle of 1.8º and a gearbox with a reduction ratio of 20:1 will have a step angle of 1.8/20 = 0.09º at the output of the gearbox.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gearbox Output Torque&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gearbox takes the torque from the output shaft of the motor, reducing the speed and increasing the torque. The gearbox, depending on its efficiency, loses some of the torque as it is converted into heat. Therefore, the Gearbox Output Torque is the motor output torque multiplied by the reduction ratio multiplied by the efficiency of the gearbox. For example, a motor with a low-speed output torque of 500g*cm and a gearbox with a reduction ratio of 5:1 and 90% efficiency will have a Gearbox Output Torque of 500*5*0.9 = 2.25 kg*cm. Remember, however, that if the Gearbox Output Torque exceeds the allowable torque the gearbox is rated for, you can cause damage to the gearbox.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gear Trains&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Planetary gearboxes use multiple gear sets to achieve large gear reductions.  Each gear set makes the gearbox longer, and reduces the efficiency.&lt;br /&gt;
&lt;br /&gt;
==Product Comparison Tables==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|+&#039;&#039;&#039;Stepper Motor Product Specifications&#039;&#039;&#039;&lt;br /&gt;
! Phidgets Product #&lt;br /&gt;
! Motor Model Number&lt;br /&gt;
! Motor Type (Unipolar/Bipolar) &lt;br /&gt;
! Step Angle (deg)&lt;br /&gt;
! Holding Torque (g•cm)&lt;br /&gt;
! Low-Speed Torque (g•cm)&lt;br /&gt;
! Rated Current (A)&lt;br /&gt;
! Number of Leads&lt;br /&gt;
! Mounting Plate Size&lt;br /&gt;
! Shaft Diameter (mm)&lt;br /&gt;
! Total Weight (g)&lt;br /&gt;
! Motor Length (mm)&lt;br /&gt;
! Motor Size/Diameter (mm)&lt;br /&gt;
|-&lt;br /&gt;
| 3302|| 42BYGHM810  || Hybrid Bipolar || 0.9|| 4800|| 4280|| 2.4 || 4|| NEMA-17|| 5  || 362|| 48  || 42 x 42&lt;br /&gt;
|-&lt;br /&gt;
| 3303|| 42BYGHW811  || Hybrid Bipolar || 1.8|| 4800|| 4240|| 2.5 || 4|| NEMA-17|| 5  || 332|| 48  || 42 x 42&lt;br /&gt;
|-&lt;br /&gt;
| 3304|| 39BYGS202   || Hybrid Bipolar || 3.75|| 750|| 590 || 1   || 4|| NEMA-17|| 5  || 171|| 32  || 39 x 39&lt;br /&gt;
|-&lt;br /&gt;
| 3305|| 39BYG013    || Hybrid Bipolar || 1.8||  550|| 450 || 0.4 || 4|| NEMA-17|| 5  || 110|| 20  || 39 x 39&lt;br /&gt;
|-&lt;br /&gt;
| 3314|| PM42L-048-17|| Hybrid Unipolar|| 7.5|| 950 || 710 || 0.28|| 6|| N/A    || 3  || 138|| 14.4|| 42&lt;br /&gt;
|-&lt;br /&gt;
| 3315|| PM25S-048-15|| Hybrid Unipolar|| 7.5|| 140 || 50  || 0.1 || 6|| N/A    || 2  || 31 || 15  || 25&lt;br /&gt;
|-&lt;br /&gt;
| 3316|| PM20L-20-14 || Hybrid Unipolar|| 18 || 50  || 30  || 0.08|| 6|| N/A    || 1.5|| 24 || 16.5|| 20&lt;br /&gt;
|-&lt;br /&gt;
| 3320|| 28STH32     || Hybrid Bipolar || 1.8|| 600 || 520 || 0.67|| 4|| NEMA-11|| 5  || 111|| 32|| 28 x 28&lt;br /&gt;
|-&lt;br /&gt;
| 3323|| 35STH40     || Hybrid Bipolar || 1.8|| 1400|| 1200|| 1   || 4|| NEMA-14|| 5  || 200|| 40|| 35 x 35&lt;br /&gt;
|-&lt;br /&gt;
| 3324|| 42STH38     || Hybrid Bipolar || 1.8|| 3600|| 3300|| 1.7 || 4|| NEMA-17|| 5  || 289|| 40|| 42 x 42&lt;br /&gt;
|-&lt;br /&gt;
| 3330|| 57STH56     || Hybrid Bipolar || 0.9||12000||11200|| 2.8 || 4|| NEMA-23|| 6.4|| 695|| 56|| 56 x 56&lt;br /&gt;
|-&lt;br /&gt;
| 3331|| 57STH56     || Hybrid Bipolar || 1.8||12600||11000|| 2.8 || 4|| NEMA-23|| 6.4|| 686|| 56|| 56 x 56&lt;br /&gt;
|-&lt;br /&gt;
| 3335|| 86STH65     || Hybrid Bipolar || 1.8||34000||30000||2 or 4 || 4|| NEMA-34|| 12|| 1800|| 65|| 85 x 85&lt;br /&gt;
|-&lt;br /&gt;
| 3336|| 86STH156    || Hybrid Bipolar || 1.8||122000||106000||3 or 6 || 4|| NEMA-34|| 16|| 5200|| 156|| 85 x 85&lt;br /&gt;
|-&lt;br /&gt;
| 3340|| 42STH38     || Hybrid Bipolar || 0.9||3600||3300||1.7 || 4|| NEMA-17|| 5||288|| 40|| 42 x 42&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=1&lt;br /&gt;
|+&#039;&#039;&#039;Gearbox Stepper Motor Product Specifications&#039;&#039;&#039;&lt;br /&gt;
!Product #&lt;br /&gt;
!Motor Model #&lt;br /&gt;
!Motor Type&lt;br /&gt;
!Step Angle&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (deg)&lt;br /&gt;
!Holding Torque*,&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (g-cm)&lt;br /&gt;
!Low-speed Torque*,&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (g-cm)&lt;br /&gt;
!Rated Current (A)&lt;br /&gt;
!# of Leads&lt;br /&gt;
!Mounting Plate Size&lt;br /&gt;
!Shaft Diameter (mm)&lt;br /&gt;
!Total Weight (g)&lt;br /&gt;
!Motor Length (mm)&lt;br /&gt;
!Gearbox Length (mm)&lt;br /&gt;
!Motor Size/Diameter (mm)&lt;br /&gt;
!Gear Ratio&lt;br /&gt;
!Gearbox Max Torque (g-cm)&lt;br /&gt;
!Gearbox Efficiency&lt;br /&gt;
!Max Speed&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (RPM)&lt;br /&gt;
|-&lt;br /&gt;
| 3310||57BYG630-07AG20||Hybrid Bipolar||0.09||30000||30000||2.8||4||NEMA-23||8||1330||73||38||56x56||20:1||30000||||30&lt;br /&gt;
|-&lt;br /&gt;
| 3311||42BYGHW811-AG5.18||Hybrid Bipolar||0.35||24860||17790||2.5||4||NEMA-17||8||513||48||31||42x42||5.18:1||30000||0.9||115&lt;br /&gt;
|-&lt;br /&gt;
| 3312||42BYGHW811-AG26.8||Hybrid Bipolar||0.07||40000||40000||2.5||4||NEMA-17||8||526||48||39||42x42||26.8:1||40000||0.81||22&lt;br /&gt;
|-&lt;br /&gt;
| 3313||42BYGHW811-AG99.5||Hybrid Bipolar||0.02||50000||50000||2.5||4||NEMA-17||8||610||48||47||42x42||99.5:1||50000||0.73||6&lt;br /&gt;
|-&lt;br /&gt;
| 3317||42BYGH40(M)-160-4A||Hybrid Bipolar||0.35||16780||12000||1.6||4||NEMA-17||8||464||40||30||42x42||5.18:1||20000||0.9||115&lt;br /&gt;
|-&lt;br /&gt;
| 3318||42BYGH40(M)-160-4A||Hybrid Bipolar||0.07||30000||30000||1.6||4||NEMA-17||8||464||40||38||42x42||26.8:1||30000||0.8||22&lt;br /&gt;
|-&lt;br /&gt;
| 3319||42BYGH40(M)-160-4A||Hybrid Bipolar||0.02||40000||40000||1.6||4||NEMA-17||8||464||40||46||42x42||99.5:1||40000||0.7||6&lt;br /&gt;
|-&lt;br /&gt;
| 3321||28STH32-0674B/28JXS40K27||Hybrid Bipolar||0.067||16100||14000||0.67||4||NEMA-11||6||218||32||40||28x28||27:1||20000|| ||120&lt;br /&gt;
|-&lt;br /&gt;
| 3322||28STH32-0674B/28JXS40K100||Hybrid Bipolar||0.018||32000||32000||0.67||4||NEMA-11||6||243||32||49||28x28||100:1||32000|| ||35&lt;br /&gt;
|-&lt;br /&gt;
| 3325||42STH38-1684B/36JXS60K5.18||Hybrid Bipolar||0.35||18000||18000||1.7||4||NEMA-17||8||457||40||31||42x42||5.18:1||18000|| ||904&lt;br /&gt;
|-&lt;br /&gt;
| 3326||42STH38-1684B/36JXS60K14||Hybrid Bipolar||0.13||30000||30000||1.7||4||NEMA-17||8||502||40||39||42x42||14:1||30000|| ||295&lt;br /&gt;
|-&lt;br /&gt;
| 3327||42STH38-1684B/36JXS60K26||Hybrid Bipolar||0.067||30000||30000||1.7||4||NEMA-17||8||503||40||39||42x42||26.85:1||30000|| ||174&lt;br /&gt;
|-&lt;br /&gt;
| 3328||42STH38-1684B/36JXS60K51||Hybrid Bipolar||0.035||48000||48000||1.7||4||NEMA-17||8||564||40||48||42x42||51:1||48000|| ||63&lt;br /&gt;
|-&lt;br /&gt;
| 3329||42STH38-1684B/36JXS60K99.51||Hybrid Bipolar||0.018||48000||48000||1.7||4||NEMA-17||8||564||40||48||42x42||100:1||48000|| ||34&lt;br /&gt;
|-&lt;br /&gt;
| 3332||57STH56-2804B/56JXS300K4.25||Hybrid Bipolar||0.42||53000||46600||2.8||4||NEMA-23||12||1200||56||48||57x57||4.25:1||90000|| ||375&lt;br /&gt;
|-&lt;br /&gt;
| 3333||57STH56-2804B/56JXS300K15||Hybrid Bipolar||0.12||150000||150000||2.8||4||NEMA-23||12||1300||56||61||57x57||15:1||150000|| || 116&lt;br /&gt;
|-&lt;br /&gt;
| 3334||57STH56-2804B/56JXS300K77||Hybrid Bipolar||0.023||240000||240000||2.8||4||NEMA-23||12||1500||56||72||57x57||77:1||240000|| ||25&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt;Step angle, torque values, and max speed are all measured at the output of the gearbox. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;Holding torque and low speed torque for gearbox motors are limited by the max torque that the gearbox is rated to sustain.&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Glossary of Terms==&lt;br /&gt;
&lt;br /&gt;
===Motor Terms===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Coil Resistance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The electrical resistance (to direct current) of the wiring within the motor. This resistance causes some of the energy being applied to the motor to be converted into heat.  Some motors and motor controllers rely solely on the electrical resistance to regulate the current flowing through the motor. The Unipolar Motors we sell, and the 1062 PhidgetStepper Unipolar rely on this inexpensive, but inefficient technique. Other motors will have very low resistance, increasing their efficiency, but requiring very sophisticated control techniques because the resistance cannot regulate the current to a safe level on its own. Our Bipolar controllers and our Bipolar motors use this technique, otherwise known as Chopper Drive.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Holding Torque&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Holding Torque is the amount of torque needed to rotate the shaft of the stepper motor while the controller attempts to hold the position, using the maximum current allowed for the motor. Holding Torque is the sum of the magnetic force exerted by the electrical coils to hold the current position, and the detent torque, which is the natural resistance of the motor against rotation due to the permanent magnet inside the motor.  Once the motor begins to rotate, the torque it can exert (at least at low speeds) is Holding Torque minus twice the detent torque (because the motor is now working against the detent). As the motor speed increases, torque begins to decrease.  If the power supply voltage is low, or the inductance of the motor is high, the torque will fall more rapidly.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Motor Inductance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Stepper motors are built with a specific coil inductance. A high inductance motor will provide a greater amount of torque at low speeds, at the cost of having lower torque at high speeds. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Overhung Load (OHL) / Radial Load&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
An external load applied on the output shaft of the gearbox.  This load is often produced if pulleys are mounted directly on the shaft, pulling perpendicular to it. When the OHL exceeds a safe value, the bearings can fail, or the shaft can break from bending fatigue. While OHL and Thrust Load specifications are only available for our gearbox motors, both types of load should be avoided when using any of our motors.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rated Current&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The rated current is the maximum current that should be applied to each coil of the motor.  Current generates heat within the motor, and exceeding the regulated current will cause the motor to overheat.  If the motor is operated in a hot environment, or is enclosed, it can overheat at currents lower than the rated current.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step Angle&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in the shaft angle when the motor moves forward or backward by one full step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step Accuracy&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Depending on the motor and how it is loaded down, the step positions will vary slightly.  Fortunately, this variance doesn’t accumulate – so if you move the motor by one step or one million steps, the angle that the motor stops at will have the same margin of error.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Thrust load / Axial Load&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A load applied directly in line with the output shaft of the gearbox.  Avoid thrust as much as possible.  If thrust load is unavoidable, keep it to no more than the permissible value.&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Stepper_Motor_and_Controller_Primer&amp;diff=23970</id>
		<title>Stepper Motor and Controller Primer</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Stepper_Motor_and_Controller_Primer&amp;diff=23970"/>
		<updated>2017-09-18T17:15:46Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Primer]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|- valign=middle&lt;br /&gt;
| align=center width=300px| __TOC__ &lt;br /&gt;
| [[Image:3302.jpg|link=]]&lt;br /&gt;
| [[Image:1063.jpg|link=]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Stepper motors are broadly available motors commonly used for positioning.  The rotor of a stepper moves in a series of discrete steps.  By energizing the coils of the motor in sequence through many of these steps, the direction of rotation, number of rotations, and exact position of the motor shaft can be easily controlled.  By controlling the time between the steps, the speed and acceleration of the stepper is regulated.  In contrast, a DC motor will blindly spin at the highest speed possible when powered, unless it is controlled with an [[Encoder Primer|Encoder]] and a control system program. It is not necessary to use an encoder on a stepper motor unless you&#039;re concerned about the motor losing count of the steps over a long period of time or in high torque situations.&lt;br /&gt;
&lt;br /&gt;
Each stepper motor is designed to move by a certain angle with each discrete step.  The simplest stepper motors will rotate 90 degrees per step.  Standard industrial steppers will rotate 1.8 degrees per step. The stepping angle can be further reduced through use of a gearbox.&lt;br /&gt;
&lt;br /&gt;
In addition to the ease of precisely controlling position and speed, Steppers have other advantages:&lt;br /&gt;
&lt;br /&gt;
*Most motors have very little torque when they are operating at low speed or standstill. Since a stepper’s rotor is held in place by a magnetic field during each step,  steppers have full torque at low speed or standstill, making them very useful for low speed rotation and actuation. Additionally, a stepper motor can remain in a fixed position for long periods of time with the rated current in the windings, whereas with DC motors, stalling and remaining in a fixed position for long periods of time will cause motor burnout. &lt;br /&gt;
*DC Motors have brushes with a finite lifetime.  Steppers have no brushes, and are limited only by the life of the bearings.&lt;br /&gt;
&lt;br /&gt;
Compared to DC Motors, there are disadvantages to Steppers:&lt;br /&gt;
&lt;br /&gt;
*Each step will produce vibration in the motor.  If these vibrations are at the mechanical resonant frequency of the motor, they can cause the rotor to overshoot and bounce back and forth, resulting in a severe loss of torque. This phenomenon is called “ringing” and is often accompanied by a loud buzzing or grinding noise. To prevent the motor from operating in such a way, you should test the motor at various speeds in the physical application it is intended for, and try to avoid running the motor at a speed which exhibits ringing behaviour. &lt;br /&gt;
*If the motor encounters a brief overload, the fixed coils on the stator and  the free-spinning rotor can lose track of each other. If this happens at higher speeds, the motor will often stall.  Even at lower speeds, your system will have lost track of where exactly the motor is positioned – unless there is an independent system (e.g., an optical encoder) tracking the position.&lt;br /&gt;
*A Stepper motor cannot be loaded at its maximum torque, as it will almost certainly be overloaded during operation.  A DC Motor will naturally adjust its speed depending on how much power is provided, and the torque required to turn it’s shaft.&lt;br /&gt;
&lt;br /&gt;
For more information about the differences between stepper motors, DC motors, and servo motors, see the [[Motor Selection Guide]].&lt;br /&gt;
&lt;br /&gt;
==Types of Stepper Motors==&lt;br /&gt;
&lt;br /&gt;
We find it useful to classify motors according to how the coils are wound (Bipolar / Unipolar), the internal magnetic construction (Permanent Magnet / Hybrid), and how the current in the coils is regulated (Chopper Drive / Resistive Limited).&lt;br /&gt;
&lt;br /&gt;
===Coils===&lt;br /&gt;
=====Bipolar=====&lt;br /&gt;
These motors are manufactured with two coils of wire, resulting in one winding per phase.  By alternating the power between coils, as well as the direction of the current, the motor is rotated. This configuration produces magnetic fields within the coils in either direction, hence the term “Bipolar.”  The controller is more expensive because it has to be able to produce both positive and negative electrical currents, but the advantage is that the entire coil is being used, thus increasing torque capabilities at all speeds. We do not recommend using a bipolar controller to run a unipolar motor, even though it is theoretically possible.&lt;br /&gt;
&lt;br /&gt;
=====Unipolar=====&lt;br /&gt;
In a unipolar motor, the motor windings consist of two identical coils per phase, wound in opposite directions (each occupying half of the space a coil normally would in a bipolar stepper).   As a result, the controller only needs to select which of the two coils to pass current through in order to change the magnetic polarity, and only a positive current is required to be generated.  Due to this simplified control mechanism which uses only half of each coil, the torque of unipolar motors are usually much lower, but the overall cost of the system is much cheaper. The simplicity of the unipolar controller also means that you cannot use it to run a bipolar stepper motor.&lt;br /&gt;
&lt;br /&gt;
===Magnets===&lt;br /&gt;
=====Permanent Magnet=====&lt;br /&gt;
Permanent magnet motors are small, low torque, and inexpensive. They use a permanent magnet in the rotor that is attracted or repelled by magnetic field generated by the stator coils. Step angles are often 7.5 or 15 degrees, and the motors are usually unipolar.&lt;br /&gt;
&lt;br /&gt;
=====Variable Reluctance=====&lt;br /&gt;
The rotor of a variable reluctance stepper is made of iron, and it therefore aligns with the magnetic field generated by the stator coils. Since it doesn’t use a permanent magnet, it doesn’t matter which direction the current flows as long as each coil is wound in the opposite direction as the coil across from it. Therefore, variable reluctance steppers are unipolar and are typically designed to have larger step angles of 15 or more degrees.&lt;br /&gt;
&lt;br /&gt;
=====Hybrid=====&lt;br /&gt;
Hybrid Motors dominate the stepper motor world – they use a combination of characteristics from permanent magnet and variable reluctance steppers and have the best torque and speed, but are more expensive to produce. Step angles are typically 0.9 to 3.75 degrees, giving much better step resolution.&lt;br /&gt;
&lt;br /&gt;
===Drive===&lt;br /&gt;
=====Chopper Drive=====&lt;br /&gt;
Chopper Drive is an electronic control technique which allows specific motors to produce more power, torque, speed, and be more efficient.  Instead of relying on the resistance of the coil wiring, the inductance of the wiring is exploited by sophisticated control electronics as a short-term limitation of motor current.  Motor Manufacturers don’t do a good job of distinguishing motors suitable for use with Chopper Drive electronics.  The motors will often be large, square, with very low resistance.&lt;br /&gt;
=====Resistive Limited=====&lt;br /&gt;
Small, inexpensive steppers are designed to be built and controlled as cheaply as possible.  To simplify the control electronics, the length and thickness of the wire in the coils is selected for a particular control voltage.  This allows the coil itself to regulate the power available to the motor – provided the appropriate voltage is used, of course.  We call this type of motor Resistive Limited.&lt;br /&gt;
&lt;br /&gt;
==How it Works==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Stepper_back_web.jpg|left|link=|thumb|230px|Cross-Section of a Hybrid Bipolar Stepper&amp;lt;br /&amp;gt;[[Media:Stepper_back_web.jpg|Full-size Image]]]]&lt;br /&gt;
&lt;br /&gt;
===Hybrid Bipolar Steppers===&lt;br /&gt;
This section of the primer will cover the general principle of operation for stepper motors. While this information is by no means necessary to use a stepper motor, those who are curious about their inner workings may read on. &lt;br /&gt;
&lt;br /&gt;
The thumbnail to the left is a cross-sectional view of the inside of a hybrid bipolar stepper motor. As you can see, it has eight poles with six teeth each. This motor contains two coils- one wrapping the odd-numbered poles, and the other wrapping the even-numbered poles. The steel end-cap in the center of the image covers a cylindrical permanent magnet which surrounds the shaft. &lt;br /&gt;
&lt;br /&gt;
If positive current is sent to the odd-numbered coil, poles 1 and 5 are magnetized as south, and poles 3 and 7 are magnetized as north. Assuming the permanent magnet in the center of the motor has its north pole facing toward us, this will result in the rotor turning so that the teeth line up with stator poles 1 and 5, as they are in the image. At the same time, poles 3 and 7 will become aligned on the opposite end of the motor, where the gear on the rotor is permanently offset by the width of one tooth and the permanent magnet has magnetized the rotor as south. The rotation of the motor is continued by sending negative current through the even-numbered phase, then negative current through the odd-numbered phase, then positive current through the even-numbered phase, and so on. The stepper controller can reverse the direction of rotation simply by reversing this sequence.&lt;br /&gt;
&lt;br /&gt;
When a stepper motor becomes engaged in software, and current is applied to the coils, it may abruptly &amp;quot;snap&amp;quot; to the position that the rotor is being held at. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hybrid Unipolar Steppers===&lt;br /&gt;
The operation of a hybrid unipolar stepper is very similar to the bipolar stepper described above, except that each pole has two seperate coils wound in opposite directions. This results in four phases which only require positive current to operate. Rather than alternating the direction of current, the motor controller simply sends positive current to the appropriate half of the coil.&lt;br /&gt;
&lt;br /&gt;
==Controlling the Stepper Motor==&lt;br /&gt;
&lt;br /&gt;
The following information has been derived from using the 3308 stepper motor connected to a 1063 - PhidgetStepper Bipolar 1-Motor controller.&lt;br /&gt;
===Setting the Current Limit===&lt;br /&gt;
&lt;br /&gt;
[[Image:Graph12v.jpg|border|400px|link=|thumb|The current/speed characteristics for the 3308 at 12V.&amp;lt;br /&amp;gt;[[Media:Graph12v.jpg|Full-size Image]]]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Graph24v.jpg|border|400px|link=|thumb|The current/speed characteristics for the 3308 at 24V.&amp;lt;br /&amp;gt;[[Media:Graph24v.jpg|Full-size Image]]]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Graph30v.jpg|border|400px|link=|thumb|The current/speed characteristics for the 3308 at 30V.&amp;lt;br /&amp;gt;[[Media:Graph30v.jpg|Full-size Image]]]]&lt;br /&gt;
&lt;br /&gt;
The current limit is an important control property of stepper controllers. Since many stepper motors have a very low coil resistance, the current through the coils cannot “self-regulate” to a safe level on their own.  They require the sophisticated control techniques of a Chopper Drive, which is used in the [{{SERVER}}/products.php?product_id=1063 1063 PhidgetStepper] controller.  As a result, the maximum current allowed should be explicitly set.&lt;br /&gt;
&lt;br /&gt;
There are many factors that influence what the current limit should be set to. These include, but are not limited to,the acceleration and speed of the stepper, the supply voltage, applied torque, motor inductance, and coil resistance. The process of choosing the current limit can be simplified by following some general rules of thumb. The graphs in this section show a set of speed vs. current characteristics for the 3308 stepper with various power supplies. &lt;br /&gt;
&lt;br /&gt;
In the these graphs, the &#039;&#039;&#039;“actual speed”&#039;&#039;&#039; of the motor is the maximum speed attainable in a real world test done with no load on the motor, but at very high acceleration.  The &#039;&#039;&#039;“max speed”&#039;&#039;&#039; shows the limitation on speed imposed by the inductance of the motor coils at a given supply voltage.  Given that the 1063 controller is only able to run at a maximum speed of 2048 full steps per second, our graphs don’t show data at higher speeds. &lt;br /&gt;
&lt;br /&gt;
When the current limit is set low and the acceleration is high, the motor will not be able to provide enough power to accelerate itself and the load it’s driving.  The motor also has to overcome friction losses within the system, and do work on the load - for example, lifting a weight.  By increasing the current limit, more current and power is made available to accelerate and maintain maximum speeds.  This can be seen on any of the graphs in the initial steep ramp of the actual speed.  As the current limit increases, the motor is able to achieve higher speeds.&lt;br /&gt;
&lt;br /&gt;
In the case of this particular motor, the large inductance of the coils - great for producing lots of torque, quickly overwhelms a 12V power supply.  To get higher speeds and more performance out of this motor, higher supply voltages are necessary.  Compare the actual speed curve on the 12V graph to the 30V graph.  At 30V, the motor is able to achieve a much higher speed.  It’s important to remember that the actual speed was measured at very high accelerations - by lowering acceleration, higher velocities can be achieved.  Of course, if your motor is doing a lot of work, you’ll need to supply enough current to produce the necessary torque, therefore limiting the maximum speed. &lt;br /&gt;
&lt;br /&gt;
Setting Current Limit for your application is a balancing act.  By increasing the current limit, more torque is available, but far more power will be consumed when the motor is turning very slowly or stopped. When setting a high acceleration, more power (therefore current) is required to accelerate the motor and it’s load. Selecting the current limit is often done dynamically in the actual application - set the current limit very low, and run the system, increasing the Current Limit if it stalls.  After a set up has been determined that is reliable, increase the current limit by another 25% to give some margin.&lt;br /&gt;
&lt;br /&gt;
There is no point in setting the current limit to be greater than the motor’s rated current- the increased inductance will only further limit the motor speed. In this case, the 30V graph shows that it’s not feasible to operate this motor at maximum torque (1.7 Amps) at a speed greater than 1100 full steps per second. By reducing the current limit, greater speeds are possible, but less torque will be available.  Most motors designed for Chopper Drive control can operate at much higher voltages, but Phidgets Inc. does not carry a controller that can provide these voltages at this time.&lt;br /&gt;
&lt;br /&gt;
Note that just because you have set the current limit to some amount (for the sake of example let&#039;s say 2A) the motor will not draw 2A at all times.  The motor will only draw as much current as it needs.  This means that if there is only a small load on the motor and it is spinning at less than its top speed the motor might only draw a small fraction of the allotted 2A.  Even as low as 300 or 400mA.  As more load or higher speed is applied, the current usage will go up until the controller is giving the motor the full current limit. As a motor draws more current, it will also produce more heat. It is normal for a stepper motor to be hot to the touch after running for a while. If the motor is getting very hot, you may be trying to drive too large a load for that particular motor.&lt;br /&gt;
&lt;br /&gt;
===Choosing a Supply Voltage===&lt;br /&gt;
&lt;br /&gt;
When looking at a stepper motor&#039;s specifications, you may come across a &amp;quot;Rated Voltage&amp;quot; value. This value is usually equal to the rated current multiplied by the resistance of the coils of the motor, making it somewhat of a redundant specification. As mentioned earlier, you can increase your controller&#039;s supply voltage in order to allow the motor to reach higher speeds at a lower current (because high current causes high inductance which puts a hard limit on how much speed and torque a motor can produce). The motor will also produce more heat as you increase the supply voltage, so it&#039;s a good idea to choose a supply voltage based on the performance you need for the motor. Some motors will have a &amp;quot;Recommended Voltage&amp;quot; for a particular controller, which is the amount of voltage needed to reach the optimal speed and torque of the motor with minimal heating.&lt;br /&gt;
&lt;br /&gt;
===Setting the Velocity Limit===&lt;br /&gt;
&lt;br /&gt;
The velocity of a motor cannot be directly chosen with our stepper controllers. However, a velocity limit can be chosen to ensure that the motor does not go faster than a certain speed. This is useful because every stepper motor has a speed that causes itself to vibrate at the resonant frequency of its own moving parts. When the motor vibrates at this frequency, the motor will often overshoot its target position, causing it to lose most of its torque, sometimes even rotating in the wrong direction. This phenomenon is sometimes called &amp;quot;ringing&amp;quot;. If you experience these problems while running your stepper motor at a constant velocity, try setting the velocity limit to lower or higher than it was previously, in an attempt to minimize the amount of time spent operating at this particular velocity.&lt;br /&gt;
&lt;br /&gt;
===Setting the Acceleration===&lt;br /&gt;
The acceleration of a stepper motor is an important consideration when driving a load.  Setting the acceleration too high can result in the motor stalling, especially with a heavy load. Try to use low acceleration in high-torque applications.&lt;br /&gt;
&lt;br /&gt;
===Continuous Rotation and Forward/Reverse===&lt;br /&gt;
&lt;br /&gt;
A stepper motor can be caused to rotate continuously by simply setting the controller&#039;s target position property to an extremely large number of steps.&lt;br /&gt;
&lt;br /&gt;
Stepper motors can easily be run in forward or reverse by choosing a target position greater than or less than the current position, respectively. Reversing the polarity of either of the motor&#039;s wire pairs will invert this effect- causing a lesser target position to result in forward rotation, and a greater target position to result in reverse rotation. For this reason, you should pay attention to the way you wire a motor when developing and testing code, and ensure that you wire it with the same polarity in the future to avoid erroneous behaviour in applications where rotation direction matters.&lt;br /&gt;
&lt;br /&gt;
===Cooling===&lt;br /&gt;
The stepper controllers sold at Phidgets Inc. have a current rating that is limited by the heat dissipation capability of the board. You could add heatsinks, fans, or other cooling devices to increase the current limit, but do so with caution. Unless you have a way of monitoring the temperature of the driver chip during operation, you have no way of knowing how far beyond the rated specification you can go.&lt;br /&gt;
&lt;br /&gt;
===Wire Length===&lt;br /&gt;
&lt;br /&gt;
Since the stepper controller is sending a fairly simple signal to the motor, interference is not a big concern. You should be able to have quite long wires between your motor and controller. For more information, see the [[Effects_of_Long_Wires|effects of long wires]] page.&lt;br /&gt;
&lt;br /&gt;
===Saving Power===&lt;br /&gt;
&lt;br /&gt;
When the stepper motor has rotated the requested number of steps, and is stopped, the coils will remain energized to hold it in position.  This is necessary to allow the motor to support a load on its shaft without rotating to an unknown position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Holding torque&#039;&#039;&#039; is the amount of torque required to rotate the motor ‘against it’s will’ when the full rated current is flowing through  the coils.  If power consumption or overheating is a problem, and full holding torque is not required, the Current Limit can be decreased in software when the motor is not moving.  Holding torque will decrease linearly as you decrease the Current Limit, but will also allow you to save power and reduce the heat generated in your system.&lt;br /&gt;
&lt;br /&gt;
There is also a small resistance to movement within the motor even when there is no current, called &#039;&#039;&#039;Detent Torque&#039;&#039;&#039;. This may be sufficient to prevent rotation in your application, especially if the stepper has a gearbox on it.&lt;br /&gt;
&lt;br /&gt;
If the motor is not supporting a load or is not required to maintain a specific angle, it is recommended to set the Enable property to false.  This will allow the motor shaft to rotate freely, but the present angle may be lost if forces on the motor-shaft are greater than can be resisted by the detent torque of the unpowered motor. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Braking===&lt;br /&gt;
&lt;br /&gt;
There are several ways to stop a stepper motor, each with different characteristics: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Set Target Position&#039;&#039;&#039; - If you set the target position to the motor&#039;s current position, it will stop. This is typically the best way to stop quickly and hold position, since the motor coils will still be engaged. You could also set the motor velocity limit to zero for a similar effect.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Short the coils&#039;&#039;&#039; - If you have the stepper wires connected to some external circuitry, you could use a switch to short the A and B terminals together, and the C and D terminals together. Due to the [http://en.wikipedia.org/wiki/Lorentz_force Lorentz force] of the electrons in the coil, the motor will begin to brake and hold position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cut power&#039;&#039;&#039; - You could cut power to the controller, but since the motor coils would no longer be engaged, the momentum would cause it to continue rotating until it slows down from friction and detent.&lt;br /&gt;
&lt;br /&gt;
==Stepping Modes==&lt;br /&gt;
&lt;br /&gt;
===Full Stepping===&lt;br /&gt;
This is the default mode of stepping for bipolar motors, where both phases of the motor are controlled by two square waves of current. One wave lags behind the other by 90 degrees, and the motion of the motor is locked to these waves. A full step is completed when the square waves advance by 90 degrees. Since both phases are always fully energized, full stepping provides the best torque. &lt;br /&gt;
&lt;br /&gt;
===Half Stepping===&lt;br /&gt;
In this stepping mode, the controller alternates between having one phase energized and both phases energized. This results in the rotor pausing at half-steps in between the poles, effectively halving the step angle. However, since the current to each coil cannot be exactly balanced, the angle that the rotor comes to rest at between poles may not be exactly half the step angle. The downside to half stepping is that the motor will have less torque on the steps when only one phase is energized. &lt;br /&gt;
&lt;br /&gt;
===Mini/Micro-stepping===&lt;br /&gt;
By controlling the the relative current of both phases, the rotor position can come to rest at various equally spaced sub-steps between the two phases. This is achieved by following the same procedure for Full Stepping, except that the current supplied more closely resembles a sine wave rather than a square wave. Some bipolar controllers are designed to micro-step at low speeds to allow for smooth rotation.&lt;br /&gt;
&lt;br /&gt;
==Selecting a Gearbox==&lt;br /&gt;
&lt;br /&gt;
Using a stepper motor with a gearbox can be a good solution in applications that need very low rotation speeds and/or lots of torque.  Selecting a gearbox to attach to the stepper will result in increasing the output torque and decreasing the speed.  &lt;br /&gt;
Simply, the Gearbox Output Speed is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
 \text{Output Speed} =\frac{\text{Motor Speed}}{\text{Gearbox Ratio}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Although the reduction ratio plays a large part in determining the Gearbox Output Torque, there is also an inefficiency that is introduced through the use of a gearbox.  Some of the torque of the motor is internally converted into heat and lost. So to calculate the Gearbox Output Torque:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
 \text{Output Torque} = \text{Motor Output Torque  } \times \text{  Gearbox Ratio  } \times \text{  Gearbox Efficiency}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When choosing a stepper motor with a gearbox, keep in mind that the gearbox is rated to sustain a specific amount of torque, beyond which the gearbox could become damaged. This limit is often much lower than the amount of torque specified by the above equation.&lt;br /&gt;
&lt;br /&gt;
The Gearbox Step Angle can be determined by:                  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
 \text{Gearbox Step Angle} = \frac{\text{Motor Step Angle}}{\text{Gearbox Ratio}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Planetary Gearbox Reduction Ratios===&lt;br /&gt;
&lt;br /&gt;
[[File:Planetary_gearing.jpg|thumb|300px|link=|This diagram illustrates the parts of a 5.18:1 planetary gearbox.&amp;lt;br&amp;gt;[/docs21/images/1/1a/Planetary_gearing.jpg Click for Larger Image]]]&lt;br /&gt;
&lt;br /&gt;
In some applications, it is important to know the exact gear ratio of a gearbox (for example, when you need the output shaft to make a several complete rotations &lt;br /&gt;
and stop in the same position it started). Most motor datasheets will only list an approximate ratio, like &amp;quot;10:1&amp;quot; or &amp;quot;27:1&amp;quot;. However, there are ways to figure out &lt;br /&gt;
the exact ratio. &lt;br /&gt;
&lt;br /&gt;
In a planetary gearbox where the sun gear is used as an input and the rotation of the spider linking the planet gears is the output, the reduction ratio can be &lt;br /&gt;
expressed by the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\text{Gearbox Ratio} = \frac{T_R + T_S}{T_S}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;T_R&amp;lt;/math&amp;gt; is the number of teeth on the ring gear, and &amp;lt;math&amp;gt;T_S&amp;lt;/math&amp;gt; is the number of teeth on the sun gear. In this situation, the number of teeth on the planetary gears &lt;br /&gt;
don&#039;t affect the reduction ratio and serve only to connect the ring and sun gears. In order to increase the reduction ratio, you need to increase the number of &lt;br /&gt;
teeth on the ring gear. Since there is limited space inside a motor&#039;s gearbox, it eventually becomes impossible to increase the gear ratio. This limitation can be &lt;br /&gt;
bypassed by introducing multiple gear &#039;&#039;&#039;stages&#039;&#039;&#039;. In a multi-stage planetary gearbox, the axles of the planet gears of the first stage are connected to a piece &lt;br /&gt;
of metal called a &amp;quot;spider&amp;quot;, whose rotation is used to turn the sun of the next stage. It&#039;s very common for multi-stage planetary gearboxes to have a tall ring &lt;br /&gt;
gear that spans multiple stages. To determine the overall reduction ratio of a multi-stage planetary gearbox, simply multiply the two ratios together. For &lt;br /&gt;
example, two stages each with a 5:1 reduction ratio would result in a total ratio of 25:1. &lt;br /&gt;
The following table lists exact ratios for gearboxes commonly sold at Phidgets Inc. :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Gearbox_table.jpg|link=]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The colored squares visualize the stages that compose each gearbox. For example, a two-stage gearbox with 1 blue and 1 green square indicates that one stage is &lt;br /&gt;
the same ratio as the 1-stage gearbox with the green square beside it, and the other stage is the same as the one with a blue square beside it.&lt;br /&gt;
If you have a third party gearbox and are unable to open it to count the gear teeth, you could also determine the approximate reduction ratio experimentally by &lt;br /&gt;
measuring the rotation angle after a known number of steps have occured. The more accurately you can measure the angle, the better your approximation will be.&lt;br /&gt;
&lt;br /&gt;
===Gearbox Terminology===&lt;br /&gt;
&lt;br /&gt;
Here is a short list of terms you might come across when deciding upon a gearbox:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backlash&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The amount of clearance between mated gear teeth.  Theoretically, the backlash should be “the smaller the better,” but in actual practice, some backlash must be allowed to prevent jamming.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gear Ratio&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gearbox accepts the power (think of power as a torque that rotates) from the motor, reducing the speed (exactly) by a given ratio, while increasing the torque (roughly) by the same ratio – a ratio of the gear head with which the gear head reduces the motor speed.	For example, if a motor has a speed of 500RPM and the reduction ratio is 100:1, the speed of the gear head is 500/100 = 5RPM. This is the actual reduction ratio. The calculated speed from the gear head should be based on this ratio.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gearbox Step Angle&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A full step of the motor will result in the gearbox making a smaller step.  The angle of this step is the step angle of the motor divided by the gearbox reduction ratio. For example, a motor with a step angle of 1.8º and a gearbox with a reduction ratio of 20:1 will have a step angle of 1.8/20 = 0.09º at the output of the gearbox.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gearbox Output Torque&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The gearbox takes the torque from the output shaft of the motor, reducing the speed and increasing the torque. The gearbox, depending on its efficiency, loses some of the torque as it is converted into heat. Therefore, the Gearbox Output Torque is the motor output torque multiplied by the reduction ratio multiplied by the efficiency of the gearbox. For example, a motor with a low-speed output torque of 500g*cm and a gearbox with a reduction ratio of 5:1 and 90% efficiency will have a Gearbox Output Torque of 500*5*0.9 = 2.25 kg*cm. Remember, however, that if the Gearbox Output Torque exceeds the allowable torque the gearbox is rated for, you can cause damage to the gearbox.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gear Trains&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Planetary gearboxes use multiple gear sets to achieve large gear reductions.  Each gear set makes the gearbox longer, and reduces the efficiency.&lt;br /&gt;
&lt;br /&gt;
==Product Comparison Tables==&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|+&#039;&#039;&#039;Stepper Motor Product Specifications&#039;&#039;&#039;&lt;br /&gt;
! Phidgets Product #&lt;br /&gt;
! Motor Model Number&lt;br /&gt;
! Motor Type (Unipolar/Bipolar) &lt;br /&gt;
! Step Angle (deg)&lt;br /&gt;
! Holding Torque (g•cm)&lt;br /&gt;
! Low-Speed Torque (g•cm)&lt;br /&gt;
! Rated Current (A)&lt;br /&gt;
! Number of Leads&lt;br /&gt;
! Mounting Plate Size&lt;br /&gt;
! Shaft Diameter (mm)&lt;br /&gt;
! Total Weight (g)&lt;br /&gt;
! Motor Length (mm)&lt;br /&gt;
! Motor Size/Diameter (mm)&lt;br /&gt;
|-&lt;br /&gt;
| 3302|| 42BYGHM810  || Hybrid Bipolar || 0.9|| 4800|| 4280|| 2.4 || 4|| NEMA-17|| 5  || 362|| 48  || 42 x 42&lt;br /&gt;
|-&lt;br /&gt;
| 3303|| 42BYGHW811  || Hybrid Bipolar || 1.8|| 4800|| 4240|| 2.5 || 4|| NEMA-17|| 5  || 332|| 48  || 42 x 42&lt;br /&gt;
|-&lt;br /&gt;
| 3304|| 39BYGS202   || Hybrid Bipolar || 3.75|| 750|| 590 || 1   || 4|| NEMA-17|| 5  || 171|| 32  || 39 x 39&lt;br /&gt;
|-&lt;br /&gt;
| 3305|| 39BYG013    || Hybrid Bipolar || 1.8||  550|| 450 || 0.4 || 4|| NEMA-17|| 5  || 110|| 20  || 39 x 39&lt;br /&gt;
|-&lt;br /&gt;
| 3314|| PM42L-048-17|| Hybrid Unipolar|| 7.5|| 950 || 710 || 0.28|| 6|| N/A    || 3  || 138|| 14.4|| 42&lt;br /&gt;
|-&lt;br /&gt;
| 3315|| PM25S-048-15|| Hybrid Unipolar|| 7.5|| 140 || 50  || 0.1 || 6|| N/A    || 2  || 31 || 15  || 25&lt;br /&gt;
|-&lt;br /&gt;
| 3316|| PM20L-20-14 || Hybrid Unipolar|| 18 || 50  || 30  || 0.08|| 6|| N/A    || 1.5|| 24 || 16.5|| 20&lt;br /&gt;
|-&lt;br /&gt;
| 3320|| 28STH32     || Hybrid Bipolar || 1.8|| 600 || 520 || 0.67|| 4|| NEMA-11|| 5  || 111|| 32|| 28 x 28&lt;br /&gt;
|-&lt;br /&gt;
| 3323|| 35STH40     || Hybrid Bipolar || 1.8|| 1400|| 1200|| 1   || 4|| NEMA-14|| 5  || 200|| 40|| 35 x 35&lt;br /&gt;
|-&lt;br /&gt;
| 3324|| 42STH38     || Hybrid Bipolar || 1.8|| 3600|| 3300|| 1.7 || 4|| NEMA-17|| 5  || 289|| 40|| 42 x 42&lt;br /&gt;
|-&lt;br /&gt;
| 3330|| 57STH56     || Hybrid Bipolar || 0.9||12000||11200|| 2.8 || 4|| NEMA-23|| 6.4|| 695|| 56|| 56 x 56&lt;br /&gt;
|-&lt;br /&gt;
| 3331|| 57STH56     || Hybrid Bipolar || 1.8||12600||11000|| 2.8 || 4|| NEMA-23|| 6.4|| 686|| 56|| 56 x 56&lt;br /&gt;
|-&lt;br /&gt;
| 3335|| 86STH65     || Hybrid Bipolar || 1.8||34000||30000||2 or 4 || 4|| NEMA-34|| 12|| 1800|| 65|| 85 x 85&lt;br /&gt;
|-&lt;br /&gt;
| 3336|| 86STH156    || Hybrid Bipolar || 1.8||122000||106000||3 or 6 || 4|| NEMA-34|| 16|| 5200|| 156|| 85 x 85&lt;br /&gt;
|-&lt;br /&gt;
| 3340|| 42STH38     || Hybrid Bipolar || 0.9||3600||3300||1.7 || 4|| NEMA-17|| 5||288|| 40|| 42 x 42&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=1&lt;br /&gt;
|+&#039;&#039;&#039;Gearbox Stepper Motor Product Specifications&#039;&#039;&#039;&lt;br /&gt;
!Product #&lt;br /&gt;
!Motor Model #&lt;br /&gt;
!Motor Type&lt;br /&gt;
!Step Angle&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (deg)&lt;br /&gt;
!Holding Torque*,&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (g-cm)&lt;br /&gt;
!Low-speed Torque*,&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (g-cm)&lt;br /&gt;
!Rated Current (A)&lt;br /&gt;
!# of Leads&lt;br /&gt;
!Mounting Plate Size&lt;br /&gt;
!Shaft Diameter (mm)&lt;br /&gt;
!Total Weight (g)&lt;br /&gt;
!Motor Length (mm)&lt;br /&gt;
!Gearbox Length (mm)&lt;br /&gt;
!Motor Size/Diameter (mm)&lt;br /&gt;
!Gear Ratio&lt;br /&gt;
!Gearbox Max Torque (g-cm)&lt;br /&gt;
!Gearbox Efficiency&lt;br /&gt;
!Max Speed&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (RPM)&lt;br /&gt;
|-&lt;br /&gt;
| 3310||57BYG630-07AG20||Hybrid Bipolar||0.09||30000||30000||2.8||4||NEMA-23||8||1330||73||38||56x56||20:1||30000||||30&lt;br /&gt;
|-&lt;br /&gt;
| 3311||42BYGHW811-AG5.18||Hybrid Bipolar||0.35||24860||17790||2.5||4||NEMA-17||8||513||48||31||42x42||5.18:1||30000||0.9||115&lt;br /&gt;
|-&lt;br /&gt;
| 3312||42BYGHW811-AG26.8||Hybrid Bipolar||0.07||40000||40000||2.5||4||NEMA-17||8||526||48||39||42x42||26.8:1||40000||0.81||22&lt;br /&gt;
|-&lt;br /&gt;
| 3313||42BYGHW811-AG99.5||Hybrid Bipolar||0.02||50000||50000||2.5||4||NEMA-17||8||610||48||47||42x42||99.5:1||50000||0.73||6&lt;br /&gt;
|-&lt;br /&gt;
| 3317||42BYGH40(M)-160-4A||Hybrid Bipolar||0.35||16780||12000||1.6||4||NEMA-17||8||464||40||30||42x42||5.18:1||20000||0.9||115&lt;br /&gt;
|-&lt;br /&gt;
| 3318||42BYGH40(M)-160-4A||Hybrid Bipolar||0.07||30000||30000||1.6||4||NEMA-17||8||464||40||38||42x42||26.8:1||30000||0.8||22&lt;br /&gt;
|-&lt;br /&gt;
| 3319||42BYGH40(M)-160-4A||Hybrid Bipolar||0.02||40000||40000||1.6||4||NEMA-17||8||464||40||46||42x42||99.5:1||40000||0.7||6&lt;br /&gt;
|-&lt;br /&gt;
| 3321||28STH32-0674B/28JXS40K27||Hybrid Bipolar||0.067||16100||14000||0.67||4||NEMA-11||6||218||32||40||28x28||27:1||20000|| ||120&lt;br /&gt;
|-&lt;br /&gt;
| 3322||28STH32-0674B/28JXS40K100||Hybrid Bipolar||0.018||32000||32000||0.67||4||NEMA-11||6||243||32||49||28x28||100:1||32000|| ||35&lt;br /&gt;
|-&lt;br /&gt;
| 3325||42STH38-1684B/36JXS60K5.18||Hybrid Bipolar||0.35||18000||18000||1.7||4||NEMA-17||8||457||40||31||42x42||5.18:1||18000|| ||904&lt;br /&gt;
|-&lt;br /&gt;
| 3326||42STH38-1684B/36JXS60K14||Hybrid Bipolar||0.13||30000||30000||1.7||4||NEMA-17||8||502||40||39||42x42||14:1||30000|| ||295&lt;br /&gt;
|-&lt;br /&gt;
| 3327||42STH38-1684B/36JXS60K26||Hybrid Bipolar||0.067||30000||30000||1.7||4||NEMA-17||8||503||40||39||42x42||26.85:1||30000|| ||174&lt;br /&gt;
|-&lt;br /&gt;
| 3328||42STH38-1684B/36JXS60K51||Hybrid Bipolar||0.035||48000||48000||1.7||4||NEMA-17||8||564||40||48||42x42||51:1||48000|| ||63&lt;br /&gt;
|-&lt;br /&gt;
| 3329||42STH38-1684B/36JXS60K99.51||Hybrid Bipolar||0.018||48000||48000||1.7||4||NEMA-17||8||564||40||48||42x42||100:1||48000|| ||34&lt;br /&gt;
|-&lt;br /&gt;
| 3332||57STH56-2804B/56JXS300K4.25||Hybrid Bipolar||0.42||53000||46600||2.8||4||NEMA-23||12||1200||56||48||57x57||4.25:1||90000|| ||375&lt;br /&gt;
|-&lt;br /&gt;
| 3333||57STH56-2804B/56JXS300K15||Hybrid Bipolar||0.12||150000||150000||2.8||4||NEMA-23||12||1300||56||61||57x57||15:1||150000|| || 116&lt;br /&gt;
|-&lt;br /&gt;
| 3334||57STH56-2804B/56JXS300K77||Hybrid Bipolar||0.023||240000||240000||2.8||4||NEMA-23||12||1500||56||72||57x57||77:1||240000|| ||25&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt;Step angle, torque values, and max speed are all measured at the output of the gearbox. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;Holding torque and low speed torque for gearbox motors are limited by the max torque that the gearbox is rated to sustain.&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Glossary of Terms==&lt;br /&gt;
&lt;br /&gt;
===Motor Terms===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Coil Resistance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The electrical resistance (to direct current) of the wiring within the motor. This resistance causes some of the energy being applied to the motor to be converted into heat.  Some motors and motor controllers rely solely on the electrical resistance to regulate the current flowing through the motor. The Unipolar Motors we sell, and the 1062 PhidgetStepper Unipolar rely on this inexpensive, but inefficient technique. Other motors will have very low resistance, increasing their efficiency, but requiring very sophisticated control techniques because the resistance cannot regulate the current to a safe level on its own. Our Bipolar controllers and our Bipolar motors use this technique, otherwise known as Chopper Drive.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Holding Torque&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Holding Torque is the amount of torque needed to rotate the shaft of the stepper motor while the controller attempts to hold the position, using the maximum current allowed for the motor. Holding Torque is the sum of the magnetic force exerted by the electrical coils to hold the current position, and the detent torque, which is the natural resistance of the motor against rotation due to the permanent magnet inside the motor.  Once the motor begins to rotate, the torque it can exert (at least at low speeds) is Holding Torque minus twice the detent torque (because the motor is now working against the detent). As the motor speed increases, torque begins to decrease.  If the power supply voltage is low, or the inductance of the motor is high, the torque will fall more rapidly.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Motor Inductance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Stepper motors are built with a specific coil inductance. A high inductance motor will provide a greater amount of torque at low speeds, at the cost of having lower torque at high speeds. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Overhung Load (OHL) / Radial Load&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
An external load applied on the output shaft of the gearbox.  This load is often produced if pulleys are mounted directly on the shaft, pulling perpendicular to it. When the OHL exceeds a safe value, the bearings can fail, or the shaft can break from bending fatigue. While OHL and Thrust Load specifications are only available for our gearbox motors, both types of load should be avoided when using any of our motors.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rated Current&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The rated current is the maximum current that should be applied to each coil of the motor.  Current generates heat within the motor, and exceeding the regulated current will cause the motor to overheat.  If the motor is operated in a hot environment, or is enclosed, it can overheat at currents lower than the rated current.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step Angle&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The change in the shaft angle when the motor moves forward or backward by one full step. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step Accuracy&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Depending on the motor and how it is loaded down, the step positions will vary slightly.  Fortunately, this variance doesn’t accumulate – so if you move the motor by one step or one million steps, the angle that the motor stops at will have the same margin of error.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Thrust load / Axial Load&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A load applied directly in line with the output shaft of the gearbox.  Avoid thrust as much as possible.  If thrust load is unavoidable, keep it to no more than the permissible value.&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Template:UGsbc1&amp;diff=23969</id>
		<title>Template:UGsbc1</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Template:UGsbc1&amp;diff=23969"/>
		<updated>2017-09-18T15:47:00Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Basic Use===&lt;br /&gt;
&lt;br /&gt;
Basic use of the PhidgetSBC allows the opening of connected Phidgets over the network. Using another Phidget with the PhidgetSBC in this way is almost exactly like using Phidgets over USB, in respect to the API calls and behavior. However, some extra considerations need to be made when working with the PhidgetWebservice.&lt;br /&gt;
&lt;br /&gt;
===Phidget Webservice===&lt;br /&gt;
&lt;br /&gt;
Support for opening Phidgets over the network is made possible via the Phidget Webservice. This allows a user to write an application in a system and language of their choosing and then operate Phidgets connected to the PhidgetSBC.  It is a socket based server that runs on the PhidgetSBC, and allows any attached Phidgets to be seen and opened directly over the network.  To use this server go to the &amp;quot;Phidgets-&amp;gt;WebService&amp;quot; tab in the web configuration page and enable it.&lt;br /&gt;
&lt;br /&gt;
Opening and controlling a Phidget over the network is nearly the same as opening one locally. The main differences are:&lt;br /&gt;
&lt;br /&gt;
*Different open calls that include server information. New calls OpenRemote and openRemoteIP (naming depends on language).&lt;br /&gt;
*Access to Webservice based properties: Server hostname, port and ID.&lt;br /&gt;
*Access to server connect and disconnect events, and network error events.&lt;br /&gt;
*Phidgets can be opened by more then one separate application at the same time.&lt;br /&gt;
*Reliability is more of a issue because network connections are easily broken&lt;br /&gt;
&lt;br /&gt;
Opening a Phidget over the network is asynchronous and pervasive, just like opening locally. This means that if a connection to the remote server cannot be established right away, it will keep trying indefinitely, and even survive the server being stopped and started, etc.  Instances of the Phidget Webservice can be referred to either using hostname (IP Address) and port number, or by Server ID. The advantage of using a Server ID is that it stays consistent compared to IP addresses, and you don’t need to know the Port number.  A Webservice Server ID is assigned when the Webservice is run - which on the PhidgetSBC defaults to ‘phidgetsbc’. In order to use a Server ID, the Bonjour utility also needs to be installed.  Refer to the Programming Manual and the API manual for your language for more information about using the Phidget Webservice.&lt;br /&gt;
&lt;br /&gt;
====Reliability====&lt;br /&gt;
&lt;br /&gt;
Determining reliability needs can become important while opening Phidgets over the network, because the network connection can potentially be interrupted at any time. This can leave the network attached Phidget in an undesirable state. For example - if a motor controller is driving a motor and the connection is lost, there is no way to stop the motor until the connection is re-established. These issues are less important if you are just receiving sensor data from an Interface Kit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It’s generally a good idea to catch server connect and disconnect and Phidget attach and detach events in order to know the state of the connections. It’s also a good idea to catch error events - this is where network errors will be reported.  If reliability is important, you should consider writing a program to run locally on the PhidgetSBC, and communicate with it through the Dictionary interface. This way, if the connection is broken, the local application will notice and be able to take any appropriate actions. See the advanced chapter for more information.&lt;br /&gt;
&lt;br /&gt;
====Finding Phidgets on the Network====&lt;br /&gt;
&lt;br /&gt;
Any Phidgets attached to the PhidgetSBC can be identified using the Status &amp;gt;&amp;gt; Phidgets page in the configuration interface, and should be seen on the network through the Webservice.  The Phidget Control Panel has a Bonjour tab (under WebService &amp;gt;&amp;gt; Bonjour) that lists all detected network attached Phidgets. The Phidgets connected to the PhidgetSBC should be seen here and can be opened by double clicking its name in the menu.  Network attached Phidgets can also be located programmatically with the Phidget Manager. The Phidget Manager is used with either hostname and port, or server ID, just like with ‘Open’. The manager can also be used to find all Phidgets on any Webservice through Bonjour, by specifying a NULL Server ID. See your specific language’s guide for more information about coding with the Phidget Manager.&lt;br /&gt;
&lt;br /&gt;
===Testing Using Mac OS X===&lt;br /&gt;
The steps are very similar to the Windows process described above:&lt;br /&gt;
#Ensure you have OS X 10.3.9 or later running.&lt;br /&gt;
#Download and run the [{{SERVER}}/downloads/phidget21/libraries/macos/Phidget.dmg Installer] ([{{SERVER}}/Drivers_Info.html#Mac OS software license])&lt;br /&gt;
#Click on System Preferences &amp;amp;rarr; Phidgets (under Other) to activate the Preference Pane&lt;br /&gt;
#Make sure that the Phidget SBC is properly attached to the network as described in the [[#Getting_Started|Getting Started section]]&lt;br /&gt;
#Double Click on the Phidget SBC in the Phidget Preference Pane to bring up the Web Interface in your default browser &lt;br /&gt;
#Or, click on the Bonjour tab to see attached Phidgets being run over the network and to bring up their examples&lt;br /&gt;
&lt;br /&gt;
The address in the browser that connects to the SBC is either an &#039;&#039;&#039;IP address&#039;&#039;&#039; (such as 192.168.2.181) or a &#039;&#039;&#039;link local address&#039;&#039;&#039;, (such as {{Code|phidgetsbc.local}}, which is the default). Note down the address in the browser, as you will need this information for later if you will be working [[OS - Phidget SBC|directly with the SBC]] to perform tasks such as writing or running code.  But for now, with the web interface open, we have a [[#SBC Web Interface|section to walk you through it]].&lt;br /&gt;
&lt;br /&gt;
===Using Linux===&lt;br /&gt;
&lt;br /&gt;
With Linux, you have many setup options, but all involve knowing the IP address or link local address of the SBC after you have plugged it in as described in [[#Getting_Started|Getting Started section]].  The IP address can be somewhat difficult to obtain, but the default link local address for all new Phidget SBCs is {{Code|phidgetsbc.local}} - which is an mDNS address.  Wait at least three minutes after booting the SBC to make sure link local addressing is started.  You&#039;ll also need some form of mDNS (either {{Code|avahi}} or {{Code|mDNSResponder}}) installed on your main computer.  The {{Code|avahi}} service is usually installed by default on most Linux machines, try {{Code|which avahi-resolve}} to make sure.  Then, try typing {{Code|phidgetsbc.local}} into a web browser.  The [[#SBC Web Interface|web interface]] should come up, starting with the [[#Set the Password|Set the Password]] screen.&lt;br /&gt;
&lt;br /&gt;
Note that some browsers (i.e. Google Chrome) combine search and addressing in the same address bar, so you may need to turn off web service and prediction service in {{Code|Preferences &amp;amp;rarr; Under The Bonnet}} for Chrome to treat {{Code|phidgetsbc.local}} like a web address rather than a search term.  If these steps do not bring you to the initial setup password screen as shown in the [[#SBC Web Interface|SBC Web Interface section]], you will probably need to read the [[OS - Phidget SBC#Initial Internet Setup|internet setup section on the SBC OS Page]].  That section contains more than just troubleshooting information - it includes in-depth information on how the SBC starts its network, your initial network configuration options, and how to connect to the SBC without mDNS using both DHCP and static IP.&lt;br /&gt;
&lt;br /&gt;
If you want to use the SBC to broadcast data from Phidgets over a network, the SBC is already automatically performing this function with its attached Interface Kit, and will also do so for any Phidgets plugged into its USB ports.  If this is your sole intended use of the SBC, you can skip ahead to our example on using the [[#Linux - Attached Interface Kit | attached Interface Kit]].&lt;br /&gt;
&lt;br /&gt;
However, the SBC is much, much more than simply a way to get data from Phidgets over a network.  You can use the SBC as an external Linux computer.  You&#039;ll need to [[#Set the Password|set a password]] using the SBC web interface, and write down a network address of the SBC ({{Code|phidgetsbc.local}}, or an IP address if you worked through the [[OS - Phidget SBC#Initial Internet Setup|internet setup section on the SBC OS Page]]).  But after that, if no other sections in the basic [[#SBC Web Interface|SBC web interface]] section apply to you (using the webcam, setting up wireless networking, or checking system parameters like memory), you can skip ahead to the [[OS - Phidget SBC]] page.  &lt;br /&gt;
&lt;br /&gt;
====Linux - Attached Interface Kit====&lt;br /&gt;
&lt;br /&gt;
As soon as the SBC boots and can connect to the network (either by DHCP or by mDNS/avahi), it begins broadcasting the state of its attached InterfaceKit over the network using the [[Phidget WebService]].  To test the InterfaceKit on your Linux computer over the network, you will need to install the Phidget libraries and the Phidget webservice if you haven&#039;t already.  (If you have used any Phidget via USB and over a network on your Linux computer, you have already done this.)  This process is described on the general [[OS - Linux|Linux OS]] page, so follow those installation instructions, with the following modifications to the [[OS - Linux#Using the WebService|Linux webservice introduction]]:&lt;br /&gt;
* Instead of using a localhost (127.0.0.1) address, use the the SBC&#039;s IP or link local ({{Code|phidgetsbc}}) address, &lt;br /&gt;
* Instead of using the function call {{Code|openRemoteIP}} in your code, use the function call {{Code|openRemote}}, and the Interface Kit serial number which is on the back of the SBC.&lt;br /&gt;
&lt;br /&gt;
Note that any attached analog sensors in the black ports will not show up over the webservice as individual Phidgets.  Rather, they will show up as part of the Interface Kit, through the port number that they are attached to on the SBC board.&lt;br /&gt;
&lt;br /&gt;
===Using Windows Mobile / CE 5.0 / CE 6.0===&lt;br /&gt;
&lt;br /&gt;
{{UGce}}&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Software_License&amp;diff=23968</id>
		<title>Software License</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Software_License&amp;diff=23968"/>
		<updated>2017-09-18T15:41:54Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Windows==&lt;br /&gt;
&lt;br /&gt;
By downloading the Phidget21.MSI you agree to adhere to the terms of the [{{SERVER}}/documentation/Licenses/Software_Licenses.pdf Phidgets End User License Agreement]. The C API section of Phidget21 is covered by the [{{SERVER}}/documentation/Licenses/Software_Licenses.pdf GNU Lesser General Public License]. The source code of C API can be found [{{SERVER}}/downloads/phidget21/libraries/linux/libphidget.tar.gz here].&lt;br /&gt;
==OS X==&lt;br /&gt;
&lt;br /&gt;
By downloading the OS X Framework you agree to adhere to the terms of the [{{SERVER}}/documentation/Licenses/Software_Licenses.pdf Phidgets End User License Agreement].  The C API section of Phidget21 is covered by the [{{SERVER}}/documentation/Licenses/Software_Licenses.pdf GNU Lesser General Public License]. The source code of C API can be found [{{SERVER}}/downloads/phidget21/libraries/linux/libphidget.tar.gz here].&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
By downloading Linux Source you agree to adhere to the terms of the [{{SERVER}}/documentation/Licenses/Software_Licenses.pdf GNU Lesser General Public License].&lt;br /&gt;
&lt;br /&gt;
==Windows CE==&lt;br /&gt;
&lt;br /&gt;
By downloading the Phidget CE Framework you agree to adhere to the terms of the [{{SERVER}}/documentation/Licenses/Software_Licenses.pdf Phidgets End User License Agreement]. The C API section of Phidget21 is covered by the [{{SERVER}}/documentation/Licenses/Software_Licenses.pdf GNU Lesser General Public License]. The source code of C API can be found [{{SERVER}}/downloads/phidget21/libraries/linux/libphidget.tar.gz here]. The Windows CE Driver is covered by the [{{SERVER}}/documentation/Licenses/Software_Licenses.pdf Shared Source Limited Permissive License (SS-LPL)]. The source code can be found at [http://www.codeplex.com/PhidgetsWinCEDriver CodePlex].&lt;br /&gt;
&lt;br /&gt;
==iOS==&lt;br /&gt;
&lt;br /&gt;
By downloading the iOS library you agree to adhere to the terms of the [{{SERVER}}/documentation/Licenses/Software_Licenses.pdf Phidgets End User License Agreement]. The C API section of Phidget21 is covered by the [{{SERVER}}/documentation/Licenses/Software_Licenses.pdf GNU Lesser General Public License]. The source code of C API can be found [{{SERVER}}/downloads/phidget21/libraries/linux/libphidget.tar.gz here].&lt;br /&gt;
&lt;br /&gt;
==Android==&lt;br /&gt;
&lt;br /&gt;
By downloading the Android library you agree to adhere to the terms of the [{{SERVER}}/documentation/Licenses/Software_Licenses.pdf Phidgets End User License Agreement]. The C API section of Phidget21 is covered by the [{{SERVER}}/documentation/Licenses/Software_Licenses.pdf GNU Lesser General Public License]. The source code of C API can be found [{{SERVER}}/downloads/phidget21/libraries/linux/libphidget.tar.gz here].&lt;br /&gt;
&lt;br /&gt;
==SBC==&lt;br /&gt;
&lt;br /&gt;
By downloading the SBC Firmware or Buildroot/Kernal Sources, you agree to adhere to the terms of the [{{SERVER}}/documentation/Licenses/Software_Licenses.pdf GNU Lesser General Public License].&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Language_-_Simulink&amp;diff=23967</id>
		<title>Language - Simulink</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Language_-_Simulink&amp;diff=23967"/>
		<updated>2017-09-18T15:39:20Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
{{OSLang|[[File:icon-Simulink.png|64x64px]]|Simulink support is no longer maintained by Phidgets}}&lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;Legacy Documentation&#039;&#039;&#039;==&lt;br /&gt;
&amp;lt;font color=red&amp;gt;We no longer officially support Simulink, as newer versions have been found to be incompatible with Phidgets libraries.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below is the documentation for previously supported versions of Simulink.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Simulink|the non-[[General Phidget Programming#Event Driven Code|event driven]] part of the Phidget API|the Phidget Interface Kit.|Windows, Mac, and Linux; however, we provide a Windows walkthrough here|}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
{{QuickDownloads|Simulink|&lt;br /&gt;
{{APIQuickDownloads|{{SERVER}}/documentation/Phidget21_C_Doc.zip C}}|&lt;br /&gt;
{{ExampleQuickDownloads|{{SERVER}}/downloads/phidget21/examples/c/Simulink.zip Simulink|}}&lt;br /&gt;
{{ExampleQuickDownloads|{{SERVER}}/downloads/phidget21/examples/c/Matlab.zip MATLAB| (needed for the library)}}|&lt;br /&gt;
{{WindowsQuickDownloads}}&lt;br /&gt;
{{MacQuickDownloads}}&lt;br /&gt;
{{LinuxQuickDownloads}}}}&lt;br /&gt;
&lt;br /&gt;
==Getting Started with Simulink==&lt;br /&gt;
&lt;br /&gt;
We show how to use Simulink on Windows.  Simulink, like MATLAB, can run on Mac OS X and Linux systems.  Once you have MATLAB set up for your system - as described on our [[Language - MATLAB | MATLAB page]] - these instructions should apply no matter what your operating system behind MATLAB.&lt;br /&gt;
&lt;br /&gt;
This page assumes the reader is familiar with Simulink, Simulink user-defined functions, and interacting with Phidgets using MATLAB. In particular, if you&#039;ve not written working MATLAB code for Phidgets yet, please work through the [[Language - MATLAB|main MATLAB page]] before working through this one.  MATLAB and Simulink depend heavily on hooking MATLAB into the Phidget C library and writing user-defined blocks, and this may be a new aspect of MATLAB for you.&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets in Simulink, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
===Description of Files===&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;{{Code|phidget21Matlab.h}}&#039;&#039;&#039; file - found in the MATLAB (not Simulink) examples - is the library that makes both the MATLAB and the Simulink Phidget examples and other code work.  On both Linux and Mac OS X, this file should be modified as described on the [[Language - MATLAB|main MATLAB page]].&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [{{SERVER}}/downloads/phidget21/examples/c/Simulink.zip Simulink examples] and [{{SERVER}}/downloads/phidget21/examples/c/Matlab.zip MATLAB examples] and unpacking them into a folder.  The Phidget examples were written using Simulink 6.1/MATLAB 7 in Windows XP. Other recent versions of Simulink should work as well and would be set up in a similar manner. &lt;br /&gt;
&lt;br /&gt;
First, make sure that the &#039;&#039;&#039;{{Code|phidget21Matlab.h}}&#039;&#039;&#039; file from the MATLAB examples is in your MATLAB path.  This would be a good time to also add the path to the Simulink examples that you&#039;ve unpacked.  To add these folders to the Simulink path, choose &amp;quot;File &amp;amp;rarr; Set Path...&amp;quot; and add your folders:&lt;br /&gt;
&lt;br /&gt;
[[Image:Simulink setpath.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
You can add them one by one, or include all of the sub-folder of the folder you unpacked the example into:&lt;br /&gt;
&lt;br /&gt;
[[Image:Simulink choosepathfolder.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
Make sure to save and close afterwards.&lt;br /&gt;
&lt;br /&gt;
Now you are ready to run the Simulink Example.  At this time, we only have a Simulink example for the Phidget Interface Kit.  However, even if you don&#039;t have an Interface Kit, you can dig through the code behind the Simulink example and modify it to your own Phidget board (Spatial, Temperature Sensor, etc).&lt;br /&gt;
&lt;br /&gt;
With an Interface Kit, make sure it is plugged in.  Then, open the example by navigating to it from Simulink under &amp;quot;File &amp;amp;rarr; Open...&amp;quot;.  This will allow you to open the Interface Kit example:&lt;br /&gt;
&lt;br /&gt;
[[Image:Simulink openexamples.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
Opening the example will open the dashboard within Simulink to observe the Interface Kit.  You will have the main layout of the blocks, and then also two traces:&lt;br /&gt;
&lt;br /&gt;
[[Image:Simulink ifktopened.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
Once opened, the example should look like the screenshot above.  If the boxes for the Interface Kit are red, and running it results in a Phidgets object unknown error, you need to include the Simulink project and the MATLAB examples in your path.  &lt;br /&gt;
&lt;br /&gt;
When you run the example, by using &amp;quot;Simulation &amp;amp;rarr; Start&amp;quot;, the Interface Kit will turn on and off its digital outputs (to turn on and off any test LEDs you may have in them) and also print the output and sensor values to the screen and the traces:&lt;br /&gt;
&lt;br /&gt;
[[Image:Simulink runexamples.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
At this point, you probably want to set up your own project and [[#Write Your Own Code|write your own code]], or refer to our [[#Follow The Examples|teaching section]] to match code snippets and explanations to the example code.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
To begin your own project, you can make sure your MATLAB path is set as described in the [[#Use Our Examples|Use Our Examples]] section.  Then, you have to decide whether you will need to create new blocks first (refer to our example under the &amp;quot;M&amp;quot; directory for structure and example block code) or use the small set of Phidget blocks we already provide for the Interface Kit.  For help writing new blocks, we have some code snippets in the [[#Follow The Examples|Follow The Examples]] section.&lt;br /&gt;
&lt;br /&gt;
Once you have all the blocks you need (and they have been added to your path), you can create a new Model from the Simulink window:&lt;br /&gt;
&lt;br /&gt;
[[Image:Simulink newmodel.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
Then you can open up the Phidgets blocks right on the Simulink window and peruse the functionality of each block via its sub-menus.  Here are the two blocks available from the Simulink example:&lt;br /&gt;
&lt;br /&gt;
[[Image:Simulink addifkt.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
Once your blocks appear like this, it is easy to drag and drop them into your new model pane.  We have some [[#Follow The Examples|code snippets available]] for you to break down our example code into usable blocks, but as mentioned earlier you should already be familiar with writing user-defined blocks in Simulink as this is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This section has resources for you to learn from the example and write your own.&lt;br /&gt;
&lt;br /&gt;
Your main reference for writing Simulink code will be our C++ API information (because Simulink calls our C library directly) with syntax for all of our functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|although only traditional non-event driven code is available in Simulink.|[{{SERVER}}/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
===Code Snippets===&lt;br /&gt;
&lt;br /&gt;
This tutorial will use MATLAB code to demonstrate how user defined functions can be used to interact with Phidgets through the use of MATLAB Fcn, M Level 1 S Functions, and M Level 2 S Function blocks. &lt;br /&gt;
As writing C code is beyond the scope of this guide, C S Function blocks will not be discussed. However, C S Function blocks work similar to M S Function blocks. &lt;br /&gt;
&lt;br /&gt;
MATLAB Fcn blocks are the easiest blocks to use, but have limited features(i.e., only 1 input port). Level 1 S Functions blocks have more featues, but are more complicated to implement. Level 2 S Functions blocks are the most complex, but benefit in supporting the most features. &lt;br /&gt;
&lt;br /&gt;
Specific calls in Simulink user blocks will differ in syntax from those on the [[General Phidget Programming]] page, but the concepts stay the same.  &lt;br /&gt;
&lt;br /&gt;
It may help to have the [[General Phidget Programming]] page and this section open at the same time, because they parallel each other and you can refer to the MATLAB/Simulink syntax.  However, many additional concepts are covered on the General Phidget Programming page on a high level, such as using multiple Phidgets, handling errors, and different styles of programming.&lt;br /&gt;
&lt;br /&gt;
You may also find it useful to refer to the code snippets main [[Language - MATLAB#Code Snippets|MATLAB page]].&lt;br /&gt;
&lt;br /&gt;
====Step One: Initialize and Open====&lt;br /&gt;
&lt;br /&gt;
Before using the Phidget in your code, the Phidget object will need to be declared and initialized. &lt;br /&gt;
For example, we can declare and initialize an instance of a PhidgetInterfaceKit inside a M file of a Level 1 S Function block with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=matlab&amp;gt;&lt;br /&gt;
    global handle;&lt;br /&gt;
    loadlibrary(&#039;phidget21&#039;, &#039;phidget21Matlab.h&#039;);&lt;br /&gt;
    ptr = libpointer(&#039;int32Ptr&#039;,0);&lt;br /&gt;
    calllib(&#039;phidget21&#039;, &#039;CPhidgetInterfaceKit_create&#039;, ptr);&lt;br /&gt;
    handle = get(ptr, &#039;Value&#039;);&lt;br /&gt;
    calllib(&#039;phidget21&#039;, &#039;CPhidget_open&#039;, handle, -1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The handle variable is declared as a global, and can be easily accessed by other blocks. Since blocks repeatedly run until the simulation is completed, the above code will need to be restricted so that it runs only once during a simulation.  Hence, you should put such code inside the mdlInitializeSizes function. &lt;br /&gt;
&lt;br /&gt;
====Step Two: Wait for Attachment (plugging in) of the Phidget====&lt;br /&gt;
&lt;br /&gt;
To use the Phidget, it must be plugged in (attached).  We can handle this by calling waitForAttachment. This function works for any Phidget. WaitForAttachment will block indefinitely until a connection is made to the Phidget, or an optional timeout is exceeded:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=matlab&amp;gt;&lt;br /&gt;
    calllib(&#039;phidget21&#039;, &#039;CPhidget_waitForAttachment&#039;, handle, 2500)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line is also placed inside the mdlInitializeSizes function. &lt;br /&gt;
&lt;br /&gt;
Because Simulink and MATLAB cannot handle events, you cannot catch the attach events in the C library as you can with our other supported languages.&lt;br /&gt;
&lt;br /&gt;
====Step Three: Do Things with the Phidget====&lt;br /&gt;
&lt;br /&gt;
Although we usually recommend using events to interact with your Phidget, MATLAB and Simulink do not support event handling. Hence, you can only use the &amp;quot;get&amp;quot; and &amp;quot;set&amp;quot; functions from the C library to interact with your Phidget.&lt;br /&gt;
&lt;br /&gt;
For example, here we have a MATLAB Fcn block which can be used to set the output states of the digital output ports on a PhidgetInterfaceKit 8/8/8. The following code is placed inside a M file. &lt;br /&gt;
The block’s input variable is the desired output state to be set:&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
    function setOutputStates(outputState)&lt;br /&gt;
        global handle;&lt;br /&gt;
        for i = 0:7&lt;br /&gt;
            if (calllib(&#039;phidget21&#039;, &#039;CPhidgetInterfaceKit_setOutputState&#039;, handle, i, outputState) == 1)&lt;br /&gt;
                display(&#039;Set output state failed&#039;)&lt;br /&gt;
       &lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this handle is the same handle that was [[#Step One: Initialize and Open|created]] and [[#Step Two: Wait for Attachment (plugging in) of the Phidget|attached]] earlier.&lt;br /&gt;
&lt;br /&gt;
Next, a M Level 2 S Function will be used to retrieve sensor values of analog sensor ports and output it to a Simulink scope window. The block will contain no inputs and 1 output, with 8 dimensions (1 dimension for each analog sensor of a PhidgetInterfaceKit 8/8/8). For this, you can place the following code in the Output function in the M file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
    function Output(block)&lt;br /&gt;
        dataptr = libpointer(&#039;int32Ptr&#039;,0);&lt;br /&gt;
        global handle;&lt;br /&gt;
        for i = 0:7&lt;br /&gt;
            if (calllib(&#039;phidget21&#039;, &#039;CPhidgetInterfaceKit_getSensorValue&#039;, handle, i, dataptr) == 0)&lt;br /&gt;
                block.OutputPort(1).Data(i+1) = get(dataptr, &#039;Value&#039;);&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Step Four: Close and Delete====&lt;br /&gt;
&lt;br /&gt;
At the end of the simulation, the Phidget object will need to be closed and deleted. &lt;br /&gt;
To do this, the following lines can added to mdlTerminate. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=matlab&amp;gt;&lt;br /&gt;
    calllib(&#039;phidget21&#039;, &#039;CPhidget_close&#039;, handle);&lt;br /&gt;
    calllib(&#039;phidget21&#039;, &#039;CPhidget_delete&#039;, handle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Special Cases: Strings and Real-Time====&lt;br /&gt;
&lt;br /&gt;
=====Strings=====&lt;br /&gt;
&lt;br /&gt;
It is possible for a user to specify a string of characters in the block parameters dialog box of a user defined function such that it is passed into a user defined function. &lt;br /&gt;
Please see the PhidgetInterfaceKit_RemoteIP block library in the Simulink examples for details.  Simulink cannot display strings in the GUI, however it is possible to write a C S function that displays strings in the MATLAB console.  &lt;br /&gt;
&lt;br /&gt;
=====Working in Real Time=====&lt;br /&gt;
&lt;br /&gt;
Even though a model may finish simulating before a user has a chance to interact with Phidgets, there are workarounds that can be used to slow down simulation time to allow for user interaction. &lt;br /&gt;
&lt;br /&gt;
One method is to modify the Solver Options (under Simulation-&amp;gt;Configuration Parameters-&amp;gt;Solver). Changing the step size and stop time may slow down the simulation. Another method is to implement a user defined function that reduces the simulation speed until the system clock matches the Simulink clock. &lt;br /&gt;
&lt;br /&gt;
The Phidget Simulink example uses the “Real Time Block” to simulate the model in approximate real time. &lt;br /&gt;
&lt;br /&gt;
To use the “Real Time Block”, place the following files in your MATLAB working directory: slblocks.m, rtc.mdl, waitforreal.m. These files can be extracted from the root directory and the Real Time directory of the Phidget Simulink example.  Open up the Simulink Library Browser and select “Real Time Clock”. Place the Real Time Clock block onto your model. &lt;br /&gt;
&lt;br /&gt;
For applications where accurate real time simuation is needed, xPC Target can be used. Please note that the simulation speed of these methods may differ depending on the CPU speed, complexity of the model, the amount of text being displayed in the MATLAB console, etc....&lt;br /&gt;
&lt;br /&gt;
{{MoreHowTos}}&lt;br /&gt;
&lt;br /&gt;
Note, however, that although being familiar with both event and traditional programming can help you identify which functions are which within an API, Simulink only supports traditional logic programming.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
None at this time.&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=SBC2_USB_Hub_Fix&amp;diff=23966</id>
		<title>SBC2 USB Hub Fix</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=SBC2_USB_Hub_Fix&amp;diff=23966"/>
		<updated>2017-09-18T15:35:49Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Troubleshooting]]&lt;br /&gt;
There is a problem on [[1072 User Guide|SBC2&#039;s]] purchased before Jan. 10th 2012.  There was an issue with some of the routing to the USB hub which can cause issues with certain devices connected to the hub.  Symptoms of this problem include unusual behaviour with devices connected to the USB hub such as devices detaching and attaching as well as the occasional complete failure to attach.  Particularly bad offenders are servo controllers.  There are 2 solutions to this problem, you can either contact us and send the device in for modification.  Or you can make the modifications yourself provided you have the equipment and the ability to solder small components.  &lt;br /&gt;
&lt;br /&gt;
==What you will need==&lt;br /&gt;
If you intend to make the modifications yourself you will need a fine tip soldering iron, a microscope (or &#039;&#039;very&#039;&#039; sharp eyes), and a capacitor.  The capacitor that needs to be added is as follows:&lt;br /&gt;
&lt;br /&gt;
{| border = 1&lt;br /&gt;
|Style: ||Capcitance: ||Package:&lt;br /&gt;
|-&lt;br /&gt;
|Surface Mount||30pF||0603&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
They can be purchased from Digikey for $0.13 a piece.&lt;br /&gt;
&lt;br /&gt;
==What you need to do==&lt;br /&gt;
The capacitor needs to be added to the board in the location highlighted in red in the images that follow:&lt;br /&gt;
{|&lt;br /&gt;
|colspan = 2 align=&amp;quot;center&amp;quot;|[[image:1072 fix1.png|700px]]&lt;br /&gt;
|-&lt;br /&gt;
|[[image:1072 fix2.jpeg|700px]]||[[image:1072 fix2-2.jpeg|700px]]&lt;br /&gt;
|-&lt;br /&gt;
|[[image:1072 fix3.jpeg|700px]]||[[image:1072 fix3-2.jpeg|700px]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Language_-_C&amp;diff=23965</id>
		<title>Language - C</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Language_-_C&amp;diff=23965"/>
		<updated>2017-09-18T15:34:56Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
{{OSLang|[[File:icon-C++.png|link=|alt=C/C++|64x64px]]|C++ is a general purpose, cross-platform programming language with a vast user base.}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|C/C++|the complete Phidget API, including events|all Phidget devices.|Windows XP/Vista/7/8(environments include [[#Visual Studio | Visual Studio]], [[#Borland | Borland]], [[#Cygwin/MinGW | Cygwin, and MinGW]]), [[#Windows CE | Windows CE]], [[#OS X | OS X]], and [[#Linux | Linux]]|}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
{{QuickDownloads|C/C++|&lt;br /&gt;
{{APIQuickDownloads|{{SERVER}}/documentation/Phidget21_C_Doc.zip}}&lt;br /&gt;
{{ExtraAPIQuickDownloads|{{SERVER}}/documentation/web/cdoc/index.html|HTML Version of}}|&lt;br /&gt;
*[{{SERVER}}/downloads/phidget21/examples/c/VCpp.zip Visual Studio 2005/2008/2010 Projects]&lt;br /&gt;
*[{{SERVER}}/downloads/phidget21/examples/c/phidget21-c-examples.tar.gz All other compilers]|&lt;br /&gt;
{{ExtraLibraryQuickDownloads|{{SERVER}}/downloads/phidget21/libraries/windows/phidget21bcc.zip|Borland(Windows)|}}&lt;br /&gt;
{{WindowsQuickDownloads}}&lt;br /&gt;
{{MacQuickDownloads}}&lt;br /&gt;
{{LinuxQuickDownloads}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Getting started with C/C++==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#OS X |OS X]]&lt;br /&gt;
*[[#Linux | Linux]] (including PhidgetSBC)&lt;br /&gt;
&lt;br /&gt;
==Windows (XP/Vista/7/8)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
C/C++ programs on Windows depend on three files, which the installers in [[#Libraries and Drivers|Quick Downloads]] put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  By default, it is placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download all three [{{SERVER}}/downloads/phidget21/libraries/windows/Phidget-x86.zip files] and manually install them where you want; refer to our [[OS_-_Windows#Manual_File_Installation | Manual Installation Instructions]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for [[#Visual Studio 2005/2008/2010 | Visual Studio 2005/2008/2010]], [[#Visual Studio 2003 | Visual Studio 2003]], [[#Visual Studio C++ 6.0 | Visual Studio 6]], [[#Borland| Borland]], [[#Cygwin/MinGW | Cygwin/MinGW]], and [[#Dev C++ | Dev C++]].&lt;br /&gt;
&lt;br /&gt;
===Visual Studio===&lt;br /&gt;
&lt;br /&gt;
C++/CLI (which used to be called Managed C++) is very different from mainstream C/C++.  If you must use C++/CLI, consider calling the Phidget .NET library, instead of the C API normally used from C/C++.  We have no documentation for using C++/CLI.&lt;br /&gt;
&lt;br /&gt;
Microsoft makes free versions of Visual Studio available known as Express Editions.  The Express editions are suitable for most applications, but are limited in features for more complex applications. Please see [http://www.microsoft.com/visualstudio Microsoft Visual Studio] for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2005/2008/2010====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download the [{{SERVER}}/downloads/phidget21/examples/c/VCpp.zip examples] and unpack them into a folder.  To load all projects in Visual Studio, go to File &amp;amp;rarr; Open &amp;amp;rarr; Project &amp;amp;rarr; Solution, and open {{Code|Visual Studio Phidgets Examples.sln}} in the {{Code|VCpp}} folder of the examples.&lt;br /&gt;
&lt;br /&gt;
Since the examples were written in Visual Studio 2005, if you are opening the examples in Visual Studio 2008/2010, you will need to go through the Visual Studio Conversion Wizard to open and convert the 2005 project. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Conversion Wizard.PNG|link=|alt=Conversion Wizard]]&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C/C++. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example.&lt;br /&gt;
&lt;br /&gt;
Start by setting the {{Code|HelloWorld}} project as your start up project.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 StartUp Project.PNG|link=|alt=Start Up Project]]&lt;br /&gt;
&lt;br /&gt;
To run the example, click on Debug &amp;amp;rarr; Start Debugging. Please note that the projects, by default try to find the {{Code|phidget21.h}} and {{Code|phidget21.lib}} in the {{Code|$(SystemDrive)\Program Files\Phidgets}}. If you have these files installed in another location, please change the path to the file&#039;s location accordingly. Please see the [[#Write Your Own Code | Write Your Own Code]] section for details. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
If you have a 64-bit computer (and operating system) then you may also need to adjust the platform.  You can do this by selecting x64 from the following drop down menu:&lt;br /&gt;
&lt;br /&gt;
[[File:platform.png|link=]]&lt;br /&gt;
&lt;br /&gt;
If x64 is not a selectable option then go into the Configuration Manager and create it by selecting New... and copying the settings from Win32.  You should now be able to select x64 and run the code normally.&lt;br /&gt;
&lt;br /&gt;
[[File:newplatform.png|link=]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. {{FindYourDevice}}&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow the Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C/C++ library. To begin: &lt;br /&gt;
&lt;br /&gt;
1. Generate a new Visual C++: Win32 Console Application project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
2. Next, select Console Application.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 New Project 2.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Open the project properties window.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
&lt;br /&gt;
5. Add {{Code|&amp;quot;C:\Program Files\Phidgets&amp;quot;}} to the additional directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path  to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
6. Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
&lt;br /&gt;
7. Edit the additional dependencies and add {{Code|&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;}}. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path  to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
8. The project now has access to the Phidget function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget C/C++ library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow the Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2003====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Start by downloading the [{{SERVER}}/downloads/phidget21/examples/c/phidget21-c-examples.tar.gz examples]. You can import these examples into a Visual Studio 2003 C++ project. Afterwards, unpack them into a folder. Here, you can find example programs for all the devices. You will need this example source code to be copied into your C++ project later on. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example. &lt;br /&gt;
&lt;br /&gt;
2. A new project will need to be created. Generate a new Visual C++ empty project(.NET) with a descriptive name such as HelloWorld.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Create a new C++ file by adding a new item to the source files folder. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 New File.PNG|link=|alt=New File]]&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 New File 2.PNG|link=|alt=New File]]&lt;br /&gt;
&lt;br /&gt;
4. An empty C++ file will pop up. Please copy and paste the contents of the {{Code|HelloWorld.c}} program into here. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 Source.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
5. Next, the project setting needs to be set up. Open the project properties window.&lt;br /&gt;
&lt;br /&gt;
6. Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
&lt;br /&gt;
7. Add {{Code|&amp;quot;C:\Program Files\Phidgets&amp;quot;}} to the additional include directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
8. Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
&lt;br /&gt;
9. Add {{Code|&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;}} to the additional dependencies field. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
10. Now, you can run the example. Click on Debug &amp;amp;rarr; Start Without Debugging.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
11. This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. {{FindYourDevice}}&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow the Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your  development environment to properly link the Phidget C/C++ library. Please see the [[#Use Our Examples 2 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget C/C++ library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Visual Studio C++ 6.0====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Download the [{{SERVER}}/downloads/phidget21/examples/c/phidget21-c-examples.tar.gz examples] and unpack them into a folder. Here, you can find example programs for all the devices. You will need this example source code to be copied into your C++ project later on. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example.&lt;br /&gt;
&lt;br /&gt;
2. Next, a new project will need to be created. Generate a new Win32 Console Application project with a descriptive name such as HelloWorld.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Create an empty project.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 New Project 2.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
4. Next, the project settings needs to be set up. Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; C/C++ &amp;amp;rarr; Preprocessor.&lt;br /&gt;
&lt;br /&gt;
5. Add {{Code|C:\Program Files\Phidgets}} to the additional include directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
6. Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; Link &amp;amp;rarr; Input &amp;amp;rarr; Additional library Path.&lt;br /&gt;
&lt;br /&gt;
7. Add {{Code|phidget21.lib}} to the object/library modules field.&lt;br /&gt;
&lt;br /&gt;
8. Add {{Code|C:\Program  Files\Phidgets}} to the additional library path. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. &lt;br /&gt;
&lt;br /&gt;
[[File:VS6 Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
&lt;br /&gt;
9. Create a new C++ file by navigating to File &amp;amp;rarr; New &amp;amp;rarr; Files &amp;amp;rarr; C++ Source File and enter a descriptive name such as HelloWorld.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 New File.PNG|link=|alt=New File]]&lt;br /&gt;
&lt;br /&gt;
10. An empty C++ file will pop up. Please copy and paste the contents of the {{Code|HelloWorld.c}} program here.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 Source.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
11. Now, you can run the example. Click on Build &amp;amp;rarr; Execute.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
12. This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. {{FindYourDevice}}&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow the Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C/C++ library. Please see the [[#Use Our Examples 3 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 3 | Use Our Examples]] section. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Borland===&lt;br /&gt;
&lt;br /&gt;
====Use Our Examples====&lt;br /&gt;
&lt;br /&gt;
In addition to running one of the two [[#Libraries and Drivers:| Windows Installers]] above (which you probably already have if you worked through the &#039;&#039;Getting Started&#039;&#039; page for your device), you will need the [{{SERVER}}/downloads/phidget21/libraries/windows/phidget21bcc.zip Borland C++ Libraries]. {{Code|phidget21bcc.lib}} is typically placed in {{Code|C:\Program Files\Phidgets}}, but you are free to place it in any directory you wish.&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget C/C++ library, you&#039;re ready to download the [{{SERVER}}/downloads/phidget21/examples/c/phidget21-c-examples.tar.gz examples] and run the examples.&lt;br /&gt;
&lt;br /&gt;
Afterwards, unpack the examples. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example. Locate the {{Code|HelloWorld.c}} file and type the following to compile the file and link the Phidget C/C++ library:&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget C/C++ library and build a binary executable, enter the following in a command line prompt in the directory with {{Code|HelloWorld.c}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  bcc32 -eHelloWorld -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; phidget21bcc.lib HelloWorld.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is assumed that {{Code|phidget21bcc.lib}} and {{Code|phidget21.h}} are placed in {{Code|C:\Program Files\Phidgets}}. If the files are placed in another location, please adjust the paths to both of the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
In this case, {{Code|HelloWorld.c}} would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using {{Code|bcc32}}, you will have an executable named {{Code|HelloWorld}} that you can run.  &lt;br /&gt;
&lt;br /&gt;
This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:Borland HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. {{FindYourDevice}}&lt;br /&gt;
&lt;br /&gt;
====Write Your Own Code====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Borland. In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples [[#Use Our Examples 4 |above]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===GCC on Windows===&lt;br /&gt;
&lt;br /&gt;
====Cygwin/MinGW====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Download the [{{SERVER}}/downloads/phidget21/examples/c/phidget21-c-examples.tar.gz examples] and unpack them into a folder. Afterwards, unpack the examples. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example. Locate the {{Code|HelloWorld.c}} file and type the following to compile the file and link the Phidget C/C++ library in a command line prompt:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Cygwin&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o HelloWorld -I&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -L&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MinGW&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o HelloWorld -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After using gcc, you will have an executable named {{Code|HelloWorld}} that you can run.  &lt;br /&gt;
It is assumed that {{Code|phidget21.h}} and {{Code|phidget21.lib}} are placed in {{Code|C:\Program Files\Phidgets}}. If the files are placed in another location, please adjust the paths to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
After using {{Code|gcc}}, you will have an executable named {{Code|HelloWorld}} that you can run.  &lt;br /&gt;
&lt;br /&gt;
This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:C MinGW HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. {{FindYourDevice}}&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Cygwin/MinGW in your favourite text editor. In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 5| Use Our Examples]] section above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Dev C++===&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Download the [{{SERVER}}/downloads/phidget21/examples/c/phidget21-c-examples.tar.gz examples] and unpack them into a folder. Here, you can find example programs for all the devices. {{FindYourDevice}}  You will need this example source code to be copied into your Dev C++ project later on. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example.&lt;br /&gt;
&lt;br /&gt;
2. In order to control Phidgets with Dev C++, we will use the {{Code|reimp}} tool to convert the {{Code|phidget21.lib}} to a format that Dev C++ accepts. Download the [http://sourceforge.net/projects/mingw/ reimp tool].  Reimp is part of MinGW, a minimal UNIX emulator for Windows, and it is specifically within the mingw-utils package.  You can check MinGW&#039;s release notes to ensure Reimp is in the version you are using.&lt;br /&gt;
&lt;br /&gt;
3. Open up command line and traverse to the directory containing the reimp tool. Type the following command to create {{Code|libphidget21.a}}.&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  reimp.exe &amp;quot;C:\Program Files\Phidgets\phidget21.lib&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The command above assumes that the {{Code|phidget21.lib}} is in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. Please note that the 64 bit version of {{Code|phidget21.lib}} is not supported on Dev C/C++. Please use the 32 bit version of {{Code|phidget21.lib}}.&lt;br /&gt;
&lt;br /&gt;
4. Place {{Code|libphidget21.a}} in {{Code|&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib}}.&lt;br /&gt;
&lt;br /&gt;
5. Next, a new project will need to be created. Generate a new console application with a descriptive name such as PhidgetTest. Please select C as the project type.&lt;br /&gt;
&lt;br /&gt;
[[File:DevC New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
6. Next, the project settings needs to be set up. Navigate to Project Options &amp;amp;rarr; Directories &amp;amp;rarr; Include Directories.&lt;br /&gt;
&lt;br /&gt;
7. Add a new path to {{Code|C:\Program Files\Phidgets}}. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:DevC Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
8. Navigate to Project Options &amp;amp;rarr; Parameters &amp;amp;rarr; Linker.&lt;br /&gt;
&lt;br /&gt;
9. Add {{Code|-lphidget21}} to the field. This step will find the {{Code|libphidget21.a}} file in {{Code|&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib}}. &lt;br /&gt;
&lt;br /&gt;
[[File:DevC Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
10. To import the {{Code|HelloWorld}} program into your project, please open up {{Code|main.c}} in the editor.&lt;br /&gt;
&lt;br /&gt;
11. An empty C file will pop up. Please copy and paste the contents of the example program. &lt;br /&gt;
&lt;br /&gt;
[[File:DevC Source.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
12. Now, you can run the example. Click on Execute &amp;amp;rarr; Compile &amp;amp; Run.&lt;br /&gt;
&lt;br /&gt;
[[File:DevC Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
13. This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:DevC HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. {{FindYourDevice}}&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow the Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C/C++ library. Please see the [[#Use Our Examples 6 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the [[#Use Our Examples 6 | examples]] above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Code::Blocks===&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
The process for getting Phidgets working in Code::Blocks is much the same as [[#Dev C++|Dev-C++]].  You will need to download the reimp tool that is linked there and use it on the phidget21.lib file as instructed.  After the .a file has been created you can stick it in your /Phidgets folder with the rest of the Phidget library files.  &lt;br /&gt;
&lt;br /&gt;
Now that that has been done, open one of the example files that you would like to run, for example InterfaceKit-simple.c.  Under the Settings menu, choose &amp;quot;Compiler and debugger...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:compilersettings.png|link=|916px]]&lt;br /&gt;
&lt;br /&gt;
Go to the &amp;quot;Search directories&amp;quot; tab and add a new entry.  Choose your Phidgets installation directory.&lt;br /&gt;
&lt;br /&gt;
[[File:searchdirectories.png|link=|500px]]&lt;br /&gt;
&lt;br /&gt;
Under the &amp;quot;Linker settings&amp;quot; tab add a new entry and type in &amp;quot;phidget21&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:linkersettings.png|link=|500px]]&lt;br /&gt;
&lt;br /&gt;
You can now compile and run the example.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C/C++ library. Please see the [[#Use Our Examples 6 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the [[#Use Our Examples 6 | examples]] above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==OS X==&lt;br /&gt;
&lt;br /&gt;
C/C++ has excellent support on OS X through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Mac is to install the Phidget C/C++ library.  Compile and install them as explained on the Getting Started guide for your device, which you can find in its [[:Category:UserGuide|user guide]].  Then, the [[OS - OS X#Description of Library files|OS - OS X]] page also describes the different Phidget files, their installed locations, and their roles. &lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the main Phidget library for OS X as above, you&#039;re ready to download the [{{SERVER}}/downloads/phidget21/examples/c/phidget21-c-examples.tar.gz examples]. Afterwards, unzip the file. To run the example code, you&#039;ll need to find the source code &#039;&#039;for your specific device&#039;&#039;.  Then, compile the code under your platform and run it.&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget C/C++ library, and build an executable binary on OS X, do (for example, depending on the Headers location):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  gcc example.c -o example -F/Library/Frameworks -framework Phidget21 -I/Library/Frameworks/Phidget21.framework/Headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After using gcc, you will have an executable named {{Code|example}} that you can run.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 7|Use Our Example]] section above.&lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples.  Even more help and references are provided from there.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
C/C++ has support on Linux through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Linux is to install the Phidget libraries.  Compile and install them as explained on the main [[OS - Linux | Linux page]].  That Linux page also describes the different Phidget files, their installed locations, and their roles.&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Linux as above, you&#039;re ready to download and run the examples:&lt;br /&gt;
*[{{SERVER}}/downloads/phidget21/examples/c/phidget21-c-examples.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code for your device.  {{FindYourDevice}}  You can also use the HelloWorld program, which a basic program that can run with any Phidget.  Then, compile the code under your platform and run it.  When compiling, you need to link to the Phidget library.&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable on Linux, do the following in a terminal in the directory with {{Code|example.c}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, {{Code|example.c}} would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named {{Code|example}} that you can run.  &lt;br /&gt;
&lt;br /&gt;
On Linux, if you have not set up [[OS_-_Linux#Setting_udev_Rules | your udev rules for USB access]], you will need to run the program &#039;&#039;&#039;as root&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  sudo ./example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code on Linux, such as within a text editor like Emacs, Vi, Gedit, or Kate.  In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Windows CE==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
C/C++ programs on Windows CE depend on the following files, which the Windows CE installer puts onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is placed in {{Code|\Windows}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#WebService | PhidgetWebService]]. It can be placed anywhere on the system.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget.dll}}&amp;lt;/b&amp;gt; is the Phidgets kernel driver. It is placed in {{Code|\Windows}}.&lt;br /&gt;
&lt;br /&gt;
===Visual Studio 2005/2008/2010===&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Currently, we have no example code for C/C++ on Windows CE. However, set up is very much the same as what it would be with [[#Visual Studio 2005/2008/2010 |Visual Studio 2005/2008/2010]] in Windows. The {{Code|phidget21.h}} and {{Code|phidget21.lib}} can be downloaded [{{SERVER}}/downloads/phidget21/libraries/windows/Phidget21-windevel.zip here].&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C/C++ library. To begin: &lt;br /&gt;
&lt;br /&gt;
1. Generate a new Visual C++: Win32 Smart Device project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&lt;br /&gt;
[[File:WinCE VS C NewProject 1.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
2. Select {{Code|Next}}.&lt;br /&gt;
&lt;br /&gt;
[[File:WinCE VS C NewProject 2.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Select the SDK(s) that you want to code against and elect {{Code|Next}}.&lt;br /&gt;
&lt;br /&gt;
[[File:WinCE VS C NewProject 3.PNG|link=|alt=SDKs]]&lt;br /&gt;
&lt;br /&gt;
4. Create a console application and select {{Code|Next}}.&lt;br /&gt;
&lt;br /&gt;
[[File:WinCE VS C NewProject 4.PNG|link=|alt=Create Console Application]]&lt;br /&gt;
&lt;br /&gt;
3. Open the project properties window.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
&lt;br /&gt;
5. Add {{Code|&amp;quot;C:\Program Files\Phidgets&amp;quot;}} to the additional directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path  to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
6. Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
&lt;br /&gt;
7. Edit the additional dependencies and add {{Code|&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;}}. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path  to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
8. The project now has access to the Phidget function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget C/C++ library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow the Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Follow the Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  &lt;br /&gt;
&lt;br /&gt;
Your main reference for writing C code will be our C/C++ API information, with syntax for all of our functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in C/C++|[{{SERVER}}/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C/C++, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating an object with the {{Code|CPhidgetSpatialHandle}} type, and then initializing it using the {{Code|CPhidgetSpatial_create function}}.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Other C calls follow a similar syntax - {{Code|CPhidgetXXX_function}}, where XXX is the name of your device, and function is an action available from the API for your specific Phidget.|&lt;br /&gt;
[{{SERVER}}/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
===Code Snippets===&lt;br /&gt;
&lt;br /&gt;
When programming in C/C++, you&#039;re in luck.  All of our code snippet examples on our [[General Phidget Programming]] page are in both C++ and Java.  Therefore, we do not include any here, because that page is much more in-depth, and you won&#039;t have to have two pages open at once.  So head over there, and start writing code!&lt;br /&gt;
&lt;br /&gt;
===C++ Events===&lt;br /&gt;
If you want to use C++ style, object-oriented events you can do that as well.  The following examples show you how to do this:&lt;br /&gt;
&lt;br /&gt;
*[{{SERVER}}/docs21/images/0/05/Simple.cpp Main]&lt;br /&gt;
*[{{SERVER}}/docs21/images/1/11/Simple.h Header]&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
===Issue: I am using a non US-English version of Windows, and the Visual C/C++ examples run into a linker error===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The example projects, by default finds the {{Code|phidget21.h}} and {{Code|phidget21.lib}} in ${SystemDrive}\Program Files\Phidgets. If you are using a non US-English version of Windows, the Phidget drivers may be installed into a different location. To resolve, you will have to modify the paths to these two files. For instructions, please see your environment/compiler section.&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Language_-_C/C%2B%2B&amp;diff=23964</id>
		<title>Language - C/C++</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Language_-_C/C%2B%2B&amp;diff=23964"/>
		<updated>2017-09-18T15:33:48Z</updated>

		<summary type="html">&lt;p&gt;Patrick: Patrick moved page Language - C/C++ to Language - C&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Language - C]]&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Language_-_C&amp;diff=23963</id>
		<title>Language - C</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Language_-_C&amp;diff=23963"/>
		<updated>2017-09-18T15:33:46Z</updated>

		<summary type="html">&lt;p&gt;Patrick: Patrick moved page Language - C/C++ to Language - C&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
{{OSLang|[[File:icon-C++.png|link=|alt=C/C++|64x64px]]|C++ is a general purpose, cross-platform programming language with a vast user base.}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|C/C++|the complete Phidget API, including events|all Phidget devices.|Windows XP/Vista/7/8(environments include [[#Visual Studio | Visual Studio]], [[#Borland | Borland]], [[#Cygwin/MinGW | Cygwin, and MinGW]]), [[#Windows CE | Windows CE]], [[#OS X | OS X]], and [[#Linux | Linux]]|}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
{{QuickDownloads|C/C++|&lt;br /&gt;
{{APIQuickDownloads|{{SERVER}}/documentation/Phidget21_C_Doc.zip}}&lt;br /&gt;
{{ExtraAPIQuickDownloads|{{SERVER}}/documentation/web/cdoc/index.html|HTML Version of}}|&lt;br /&gt;
*[{{SERVER}}/downloads/phidget21/examples/c/VCpp.zip Visual Studio 2005/2008/2010 Projects]&lt;br /&gt;
*[{{SERVER}}/downloads/phidget21/examples/c/phidget21-c-examples.tar.gz All other compilers]|&lt;br /&gt;
{{ExtraLibraryQuickDownloads|{{SERVER}}/downloads/phidget21/libraries/windows/phidget21bcc.zip|Borland(Windows)|}}&lt;br /&gt;
{{WindowsQuickDownloads}}&lt;br /&gt;
{{MacQuickDownloads}}&lt;br /&gt;
{{LinuxQuickDownloads}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Getting started with C/C++==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#OS X |OS X]]&lt;br /&gt;
*[[#Linux | Linux]] (including PhidgetSBC)&lt;br /&gt;
&lt;br /&gt;
==Windows (XP/Vista/7/8)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
C/C++ programs on Windows depend on three files, which the installers in [[#Libraries and Drivers|Quick Downloads]] put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  By default, it is placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download all three [{{SERVER}}/downloads/phidget21/libraries/windows/Phidget-x86.zip files] and manually install them where you want; refer to our [[OS_-_Windows#Manual_File_Installation | Manual Installation Instructions]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for [[#Visual Studio 2005/2008/2010 | Visual Studio 2005/2008/2010]], [[#Visual Studio 2003 | Visual Studio 2003]], [[#Visual Studio C++ 6.0 | Visual Studio 6]], [[#Borland| Borland]], [[#Cygwin/MinGW | Cygwin/MinGW]], and [[#Dev C++ | Dev C++]].&lt;br /&gt;
&lt;br /&gt;
===Visual Studio===&lt;br /&gt;
&lt;br /&gt;
C++/CLI (which used to be called Managed C++) is very different from mainstream C/C++.  If you must use C++/CLI, consider calling the Phidget .NET library, instead of the C API normally used from C/C++.  We have no documentation for using C++/CLI.&lt;br /&gt;
&lt;br /&gt;
Microsoft makes free versions of Visual Studio available known as Express Editions.  The Express editions are suitable for most applications, but are limited in features for more complex applications. Please see [http://www.microsoft.com/visualstudio Microsoft Visual Studio] for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2005/2008/2010====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download the [{{SERVER}}/downloads/phidget21/examples/c/VCpp.zip examples] and unpack them into a folder.  To load all projects in Visual Studio, go to File &amp;amp;rarr; Open &amp;amp;rarr; Project &amp;amp;rarr; Solution, and open {{Code|Visual Studio Phidgets Examples.sln}} in the {{Code|VCpp}} folder of the examples.&lt;br /&gt;
&lt;br /&gt;
Since the examples were written in Visual Studio 2005, if you are opening the examples in Visual Studio 2008/2010, you will need to go through the Visual Studio Conversion Wizard to open and convert the 2005 project. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Conversion Wizard.PNG|link=|alt=Conversion Wizard]]&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C/C++. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example.&lt;br /&gt;
&lt;br /&gt;
Start by setting the {{Code|HelloWorld}} project as your start up project.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 StartUp Project.PNG|link=|alt=Start Up Project]]&lt;br /&gt;
&lt;br /&gt;
To run the example, click on Debug &amp;amp;rarr; Start Debugging. Please note that the projects, by default try to find the {{Code|phidget21.h}} and {{Code|phidget21.lib}} in the {{Code|$(SystemDrive)\Program Files\Phidgets}}. If you have these files installed in another location, please change the path to the file&#039;s location accordingly. Please see the [[#Write Your Own Code | Write Your Own Code]] section for details. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
If you have a 64-bit computer (and operating system) then you may also need to adjust the platform.  You can do this by selecting x64 from the following drop down menu:&lt;br /&gt;
&lt;br /&gt;
[[File:platform.png|link=]]&lt;br /&gt;
&lt;br /&gt;
If x64 is not a selectable option then go into the Configuration Manager and create it by selecting New... and copying the settings from Win32.  You should now be able to select x64 and run the code normally.&lt;br /&gt;
&lt;br /&gt;
[[File:newplatform.png|link=]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. {{FindYourDevice}}&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow the Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C/C++ library. To begin: &lt;br /&gt;
&lt;br /&gt;
1. Generate a new Visual C++: Win32 Console Application project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
2. Next, select Console Application.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 New Project 2.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Open the project properties window.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
&lt;br /&gt;
5. Add {{Code|&amp;quot;C:\Program Files\Phidgets&amp;quot;}} to the additional directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path  to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
6. Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
&lt;br /&gt;
7. Edit the additional dependencies and add {{Code|&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;}}. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path  to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
8. The project now has access to the Phidget function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget C/C++ library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow the Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2003====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Start by downloading the [{{SERVER}}/downloads/phidget21/examples/c/phidget21-c-examples.tar.gz examples]. You can import these examples into a Visual Studio 2003 C++ project. Afterwards, unpack them into a folder. Here, you can find example programs for all the devices. You will need this example source code to be copied into your C++ project later on. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example. &lt;br /&gt;
&lt;br /&gt;
2. A new project will need to be created. Generate a new Visual C++ empty project(.NET) with a descriptive name such as HelloWorld.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Create a new C++ file by adding a new item to the source files folder. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 New File.PNG|link=|alt=New File]]&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 New File 2.PNG|link=|alt=New File]]&lt;br /&gt;
&lt;br /&gt;
4. An empty C++ file will pop up. Please copy and paste the contents of the {{Code|HelloWorld.c}} program into here. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 Source.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
5. Next, the project setting needs to be set up. Open the project properties window.&lt;br /&gt;
&lt;br /&gt;
6. Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
&lt;br /&gt;
7. Add {{Code|&amp;quot;C:\Program Files\Phidgets&amp;quot;}} to the additional include directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
8. Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
&lt;br /&gt;
9. Add {{Code|&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;}} to the additional dependencies field. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
10. Now, you can run the example. Click on Debug &amp;amp;rarr; Start Without Debugging.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
11. This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. {{FindYourDevice}}&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow the Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your  development environment to properly link the Phidget C/C++ library. Please see the [[#Use Our Examples 2 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget C/C++ library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Visual Studio C++ 6.0====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Download the [{{SERVER}}/downloads/phidget21/examples/c/phidget21-c-examples.tar.gz examples] and unpack them into a folder. Here, you can find example programs for all the devices. You will need this example source code to be copied into your C++ project later on. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example.&lt;br /&gt;
&lt;br /&gt;
2. Next, a new project will need to be created. Generate a new Win32 Console Application project with a descriptive name such as HelloWorld.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Create an empty project.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 New Project 2.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
4. Next, the project settings needs to be set up. Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; C/C++ &amp;amp;rarr; Preprocessor.&lt;br /&gt;
&lt;br /&gt;
5. Add {{Code|C:\Program Files\Phidgets}} to the additional include directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
6. Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; Link &amp;amp;rarr; Input &amp;amp;rarr; Additional library Path.&lt;br /&gt;
&lt;br /&gt;
7. Add {{Code|phidget21.lib}} to the object/library modules field.&lt;br /&gt;
&lt;br /&gt;
8. Add {{Code|C:\Program  Files\Phidgets}} to the additional library path. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. &lt;br /&gt;
&lt;br /&gt;
[[File:VS6 Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
&lt;br /&gt;
9. Create a new C++ file by navigating to File &amp;amp;rarr; New &amp;amp;rarr; Files &amp;amp;rarr; C++ Source File and enter a descriptive name such as HelloWorld.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 New File.PNG|link=|alt=New File]]&lt;br /&gt;
&lt;br /&gt;
10. An empty C++ file will pop up. Please copy and paste the contents of the {{Code|HelloWorld.c}} program here.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 Source.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
11. Now, you can run the example. Click on Build &amp;amp;rarr; Execute.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
12. This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. {{FindYourDevice}}&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow the Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C/C++ library. Please see the [[#Use Our Examples 3 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 3 | Use Our Examples]] section. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Borland===&lt;br /&gt;
&lt;br /&gt;
====Use Our Examples====&lt;br /&gt;
&lt;br /&gt;
In addition to running one of the two [[#Libraries and Drivers:| Windows Installers]] above (which you probably already have if you worked through the &#039;&#039;Getting Started&#039;&#039; page for your device), you will need the [{{SERVER}}/downloads/phidget21/libraries/windows/phidget21bcc.zip Borland C++ Libraries]. {{Code|phidget21bcc.lib}} is typically placed in {{Code|C:\Program Files\Phidgets}}, but you are free to place it in any directory you wish.&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget C/C++ library, you&#039;re ready to download the [{{SERVER}}/downloads/phidget21/examples/c/phidget21-c-examples.tar.gz examples] and run the examples.&lt;br /&gt;
&lt;br /&gt;
Afterwards, unpack the examples. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example. Locate the {{Code|HelloWorld.c}} file and type the following to compile the file and link the Phidget C/C++ library:&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget C/C++ library and build a binary executable, enter the following in a command line prompt in the directory with {{Code|HelloWorld.c}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  bcc32 -eHelloWorld -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; phidget21bcc.lib HelloWorld.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is assumed that {{Code|phidget21bcc.lib}} and {{Code|phidget21.h}} are placed in {{Code|C:\Program Files\Phidgets}}. If the files are placed in another location, please adjust the paths to both of the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
In this case, {{Code|HelloWorld.c}} would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using {{Code|bcc32}}, you will have an executable named {{Code|HelloWorld}} that you can run.  &lt;br /&gt;
&lt;br /&gt;
This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:Borland HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. {{FindYourDevice}}&lt;br /&gt;
&lt;br /&gt;
====Write Your Own Code====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Borland. In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples [[#Use Our Examples 4 |above]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===GCC on Windows===&lt;br /&gt;
&lt;br /&gt;
====Cygwin/MinGW====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Download the [{{SERVER}}/downloads/phidget21/examples/c/phidget21-c-examples.tar.gz examples] and unpack them into a folder. Afterwards, unpack the examples. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example. Locate the {{Code|HelloWorld.c}} file and type the following to compile the file and link the Phidget C/C++ library in a command line prompt:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Cygwin&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o HelloWorld -I&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -L&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MinGW&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o HelloWorld -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After using gcc, you will have an executable named {{Code|HelloWorld}} that you can run.  &lt;br /&gt;
It is assumed that {{Code|phidget21.h}} and {{Code|phidget21.lib}} are placed in {{Code|C:\Program Files\Phidgets}}. If the files are placed in another location, please adjust the paths to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
After using {{Code|gcc}}, you will have an executable named {{Code|HelloWorld}} that you can run.  &lt;br /&gt;
&lt;br /&gt;
This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:C MinGW HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. {{FindYourDevice}}&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Cygwin/MinGW in your favourite text editor. In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 5| Use Our Examples]] section above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Dev C++===&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Download the [{{SERVER}}/downloads/phidget21/examples/c/phidget21-c-examples.tar.gz examples] and unpack them into a folder. Here, you can find example programs for all the devices. {{FindYourDevice}}  You will need this example source code to be copied into your Dev C++ project later on. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example.&lt;br /&gt;
&lt;br /&gt;
2. In order to control Phidgets with Dev C++, we will use the {{Code|reimp}} tool to convert the {{Code|phidget21.lib}} to a format that Dev C++ accepts. Download the [http://sourceforge.net/projects/mingw/ reimp tool].  Reimp is part of MinGW, a minimal UNIX emulator for Windows, and it is specifically within the mingw-utils package.  You can check MinGW&#039;s [http://sourceforge.net/project/shownotes.php?release_id=126568 release notes] to ensure Reimp is in the version you are using.&lt;br /&gt;
&lt;br /&gt;
3. Open up command line and traverse to the directory containing the reimp tool. Type the following command to create {{Code|libphidget21.a}}.&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  reimp.exe &amp;quot;C:\Program Files\Phidgets\phidget21.lib&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The command above assumes that the {{Code|phidget21.lib}} is in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. Please note that the 64 bit version of {{Code|phidget21.lib}} is not supported on Dev C/C++. Please use the 32 bit version of {{Code|phidget21.lib}}.&lt;br /&gt;
&lt;br /&gt;
4. Place {{Code|libphidget21.a}} in {{Code|&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib}}.&lt;br /&gt;
&lt;br /&gt;
5. Next, a new project will need to be created. Generate a new console application with a descriptive name such as PhidgetTest. Please select C as the project type.&lt;br /&gt;
&lt;br /&gt;
[[File:DevC New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
6. Next, the project settings needs to be set up. Navigate to Project Options &amp;amp;rarr; Directories &amp;amp;rarr; Include Directories.&lt;br /&gt;
&lt;br /&gt;
7. Add a new path to {{Code|C:\Program Files\Phidgets}}. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:DevC Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
8. Navigate to Project Options &amp;amp;rarr; Parameters &amp;amp;rarr; Linker.&lt;br /&gt;
&lt;br /&gt;
9. Add {{Code|-lphidget21}} to the field. This step will find the {{Code|libphidget21.a}} file in {{Code|&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib}}. &lt;br /&gt;
&lt;br /&gt;
[[File:DevC Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
10. To import the {{Code|HelloWorld}} program into your project, please open up {{Code|main.c}} in the editor.&lt;br /&gt;
&lt;br /&gt;
11. An empty C file will pop up. Please copy and paste the contents of the example program. &lt;br /&gt;
&lt;br /&gt;
[[File:DevC Source.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
12. Now, you can run the example. Click on Execute &amp;amp;rarr; Compile &amp;amp; Run.&lt;br /&gt;
&lt;br /&gt;
[[File:DevC Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
13. This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:DevC HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. {{FindYourDevice}}&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow the Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C/C++ library. Please see the [[#Use Our Examples 6 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the [[#Use Our Examples 6 | examples]] above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Code::Blocks===&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
The process for getting Phidgets working in Code::Blocks is much the same as [[#Dev C++|Dev-C++]].  You will need to download the reimp tool that is linked there and use it on the phidget21.lib file as instructed.  After the .a file has been created you can stick it in your /Phidgets folder with the rest of the Phidget library files.  &lt;br /&gt;
&lt;br /&gt;
Now that that has been done, open one of the example files that you would like to run, for example InterfaceKit-simple.c.  Under the Settings menu, choose &amp;quot;Compiler and debugger...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:compilersettings.png|link=|916px]]&lt;br /&gt;
&lt;br /&gt;
Go to the &amp;quot;Search directories&amp;quot; tab and add a new entry.  Choose your Phidgets installation directory.&lt;br /&gt;
&lt;br /&gt;
[[File:searchdirectories.png|link=|500px]]&lt;br /&gt;
&lt;br /&gt;
Under the &amp;quot;Linker settings&amp;quot; tab add a new entry and type in &amp;quot;phidget21&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:linkersettings.png|link=|500px]]&lt;br /&gt;
&lt;br /&gt;
You can now compile and run the example.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C/C++ library. Please see the [[#Use Our Examples 6 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the [[#Use Our Examples 6 | examples]] above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==OS X==&lt;br /&gt;
&lt;br /&gt;
C/C++ has excellent support on OS X through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Mac is to install the Phidget C/C++ library.  Compile and install them as explained on the Getting Started guide for your device, which you can find in its [[:Category:UserGuide|user guide]].  Then, the [[OS - OS X#Description of Library files|OS - OS X]] page also describes the different Phidget files, their installed locations, and their roles. &lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the main Phidget library for OS X as above, you&#039;re ready to download the [{{SERVER}}/downloads/phidget21/examples/c/phidget21-c-examples.tar.gz examples]. Afterwards, unzip the file. To run the example code, you&#039;ll need to find the source code &#039;&#039;for your specific device&#039;&#039;.  Then, compile the code under your platform and run it.&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget C/C++ library, and build an executable binary on OS X, do (for example, depending on the Headers location):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  gcc example.c -o example -F/Library/Frameworks -framework Phidget21 -I/Library/Frameworks/Phidget21.framework/Headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After using gcc, you will have an executable named {{Code|example}} that you can run.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 7|Use Our Example]] section above.&lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples.  Even more help and references are provided from there.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
C/C++ has support on Linux through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Linux is to install the Phidget libraries.  Compile and install them as explained on the main [[OS - Linux | Linux page]].  That Linux page also describes the different Phidget files, their installed locations, and their roles.&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Linux as above, you&#039;re ready to download and run the examples:&lt;br /&gt;
*[{{SERVER}}/downloads/phidget21/examples/c/phidget21-c-examples.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code for your device.  {{FindYourDevice}}  You can also use the HelloWorld program, which a basic program that can run with any Phidget.  Then, compile the code under your platform and run it.  When compiling, you need to link to the Phidget library.&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable on Linux, do the following in a terminal in the directory with {{Code|example.c}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, {{Code|example.c}} would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named {{Code|example}} that you can run.  &lt;br /&gt;
&lt;br /&gt;
On Linux, if you have not set up [[OS_-_Linux#Setting_udev_Rules | your udev rules for USB access]], you will need to run the program &#039;&#039;&#039;as root&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  sudo ./example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code on Linux, such as within a text editor like Emacs, Vi, Gedit, or Kate.  In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Windows CE==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
C/C++ programs on Windows CE depend on the following files, which the Windows CE installer puts onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is placed in {{Code|\Windows}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#WebService | PhidgetWebService]]. It can be placed anywhere on the system.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget.dll}}&amp;lt;/b&amp;gt; is the Phidgets kernel driver. It is placed in {{Code|\Windows}}.&lt;br /&gt;
&lt;br /&gt;
===Visual Studio 2005/2008/2010===&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Currently, we have no example code for C/C++ on Windows CE. However, set up is very much the same as what it would be with [[#Visual Studio 2005/2008/2010 |Visual Studio 2005/2008/2010]] in Windows. The {{Code|phidget21.h}} and {{Code|phidget21.lib}} can be downloaded [{{SERVER}}/downloads/phidget21/libraries/windows/Phidget21-windevel.zip here].&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C/C++ library. To begin: &lt;br /&gt;
&lt;br /&gt;
1. Generate a new Visual C++: Win32 Smart Device project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&lt;br /&gt;
[[File:WinCE VS C NewProject 1.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
2. Select {{Code|Next}}.&lt;br /&gt;
&lt;br /&gt;
[[File:WinCE VS C NewProject 2.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Select the SDK(s) that you want to code against and elect {{Code|Next}}.&lt;br /&gt;
&lt;br /&gt;
[[File:WinCE VS C NewProject 3.PNG|link=|alt=SDKs]]&lt;br /&gt;
&lt;br /&gt;
4. Create a console application and select {{Code|Next}}.&lt;br /&gt;
&lt;br /&gt;
[[File:WinCE VS C NewProject 4.PNG|link=|alt=Create Console Application]]&lt;br /&gt;
&lt;br /&gt;
3. Open the project properties window.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
&lt;br /&gt;
5. Add {{Code|&amp;quot;C:\Program Files\Phidgets&amp;quot;}} to the additional directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path  to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
6. Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
&lt;br /&gt;
7. Edit the additional dependencies and add {{Code|&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;}}. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path  to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
8. The project now has access to the Phidget function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget C/C++ library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow the Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Follow the Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  &lt;br /&gt;
&lt;br /&gt;
Your main reference for writing C code will be our C/C++ API information, with syntax for all of our functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in C/C++|[{{SERVER}}/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C/C++, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating an object with the {{Code|CPhidgetSpatialHandle}} type, and then initializing it using the {{Code|CPhidgetSpatial_create function}}.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Other C calls follow a similar syntax - {{Code|CPhidgetXXX_function}}, where XXX is the name of your device, and function is an action available from the API for your specific Phidget.|&lt;br /&gt;
[{{SERVER}}/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
===Code Snippets===&lt;br /&gt;
&lt;br /&gt;
When programming in C/C++, you&#039;re in luck.  All of our code snippet examples on our [[General Phidget Programming]] page are in both C++ and Java.  Therefore, we do not include any here, because that page is much more in-depth, and you won&#039;t have to have two pages open at once.  So head over there, and start writing code!&lt;br /&gt;
&lt;br /&gt;
===C++ Events===&lt;br /&gt;
If you want to use C++ style, object-oriented events you can do that as well.  The following examples show you how to do this:&lt;br /&gt;
&lt;br /&gt;
*[{{SERVER}}/docs21/images/0/05/Simple.cpp Main]&lt;br /&gt;
*[{{SERVER}}/docs21/images/1/11/Simple.h Header]&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
===Issue: I am using a non US-English version of Windows, and the Visual C/C++ examples run into a linker error===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The example projects, by default finds the {{Code|phidget21.h}} and {{Code|phidget21.lib}} in ${SystemDrive}\Program Files\Phidgets. If you are using a non US-English version of Windows, the Phidget drivers may be installed into a different location. To resolve, you will have to modify the paths to these two files. For instructions, please see your environment/compiler section.&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=USB_Webcam_Primer&amp;diff=23947</id>
		<title>USB Webcam Primer</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=USB_Webcam_Primer&amp;diff=23947"/>
		<updated>2017-06-07T20:58:23Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Primer]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|- valign=middle&lt;br /&gt;
| align=center width=300px| __TOC__ &lt;br /&gt;
| {{SERVER}}/images/3402_0_Web.jpg&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Webcams come in many forms, but the USB ones usually come as UVC (USB Video Class) devices.  This primer gives a very brief overview of what they are and how to use them.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
The advantage of UVC devices is their cross-platform compatibility, especially within the various flavours of Linux.  &lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/USB_video_device_class Wikpedia] gives a good overview of their levels of compatibility&lt;br /&gt;
* Many devices other than the Phidget webcam use the same protocol, please refer to [http://www.ideasonboard.org/uvc/#devices a compatibility list]&lt;br /&gt;
&lt;br /&gt;
==Use==&lt;br /&gt;
&lt;br /&gt;
A UVC device should be truly plug and play.  Even on the [{{SERVER}}/products.php?product_id=1072 Phidget Single Board Computer], the drivers are already installed.  You can almost immediately begin using video capture programs on your operating system to record video or pictures.&lt;br /&gt;
&lt;br /&gt;
Examples include:&lt;br /&gt;
&lt;br /&gt;
* Capture from Windows media players and creators&lt;br /&gt;
* Use iMovie on Mac OS X&lt;br /&gt;
* Use Cheese on Linux ({{Code|sudo apt-get install cheese}})&lt;br /&gt;
&lt;br /&gt;
However, these programs are usually graphical programs which don&#039;t help if you want to use the webcam in code.&lt;br /&gt;
&lt;br /&gt;
===Code===&lt;br /&gt;
&lt;br /&gt;
Regardless of your platform, a good place to start is [http://opencv.willowgarage.com/wiki/ OpenCV].  It is a library for C/C++ that focuses solely on processing images and video.  It also has bindings to other languages like Python.&lt;br /&gt;
&lt;br /&gt;
We also offer a programming example in C# to use the webcam:&lt;br /&gt;
&lt;br /&gt;
*[{{SERVER}}/downloads/misc/MJPEGDecoder.zip C# Program]&lt;br /&gt;
&lt;br /&gt;
Additional advice by operating system is below.&lt;br /&gt;
&lt;br /&gt;
====Phidget SBC====&lt;br /&gt;
&lt;br /&gt;
Any UVC webcam device should work interchangeably with any other UVC webcam device, So you don&#039;t have to use the Phidget one, you can find one that fits your needs. &lt;br /&gt;
&lt;br /&gt;
On our Single Board Computer (SBC) page, we give an example of how to use a UVC webcam to take pictures using the SBC and OpenCV in code:&lt;br /&gt;
*[[OS - Phidget SBC#Taking Pictures With the Webcam|Taking Pictures with the Webcam]]&lt;br /&gt;
&lt;br /&gt;
====Windows====&lt;br /&gt;
&lt;br /&gt;
On Windows, [http://opencv.willowgarage.com/wiki/ OpenCV] is your best bet.&lt;br /&gt;
&lt;br /&gt;
====Linux====&lt;br /&gt;
&lt;br /&gt;
On full Linux systems, you can possibly use OpenCV, though there have been some problems on standard Ubuntu distributions.&amp;lt;br&amp;gt;&lt;br /&gt;
Alternatively, you can use the program {{Code|streamer}} which can then be used in code:&lt;br /&gt;
:{{Code|sudo apt-get install streamer}}&lt;br /&gt;
:{{Code|streamer -c /dev/video0 -b 16 -o output.jpg}}&lt;br /&gt;
&lt;br /&gt;
==Did You Know==&lt;br /&gt;
&lt;br /&gt;
The UVC standard outlines more than just picture taking - it can control pan, tilt, resolution, etc depending on the functionality for your camera.  This is how the Phidget SBC controls what resolution is displayed on its [[1072_User_Guide#SBC Web Interface|Web Interface]].  &lt;br /&gt;
&lt;br /&gt;
If you want to play with these advanced features, and you own an SBC, you can look at the scripts in {{Code|/var/www/}} on the SBC.&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_gs_webcam.png|link=|alt=]]&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Language_-_Ruby&amp;diff=23946</id>
		<title>Language - Ruby</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Language_-_Ruby&amp;diff=23946"/>
		<updated>2017-06-07T20:56:21Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
{{OSLang|[[File:Icon-Ruby.png|64x64px|link=|alt=]]|Ruby is an interpreted and object oriented scripting language with simple syntax created by [http://en.wikipedia.org/wiki/Yukihiro_Matsumoto Yukihiro Matsumoto].}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Ruby|the complete Phidget API, including events|all Phidget devices.|Linux and OS X|}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
{{QuickDownloads|Ruby|&lt;br /&gt;
{{APIQuickDownloads|http://www.rubydoc.info/gems/phidgets-ffi/frames RubyDoc}}|&lt;br /&gt;
{{ExampleQuickDownloads|http://rubygems.org/gems/phidgets-ffi| (on RubyGems Server)}}|&lt;br /&gt;
{{ExtraLibraryQuickDownloads|http://rubygems.org/gems/phidgets-ffi|Ruby| (on RubyGems Server)}}&lt;br /&gt;
{{MacQuickDownloads}}&lt;br /&gt;
{{LinuxQuickDownloads}}}}&lt;br /&gt;
&lt;br /&gt;
===3rd Party Library===&lt;br /&gt;
The following library was submitted by a user and is an alternative means for using Phidgets in Ruby.  It is only suitable for the Spatial, GPS, Interface Kit, and Advanced Servo product lines but more may follow.&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/brighton36/phidgets_native Link]&lt;br /&gt;
&lt;br /&gt;
Please note that this is not Phidgets&#039; official library and we take no responsibility for issues stemming from its use nor are we able to support the library ourselves.  We are merely making this available for users who wish for an alternative to our own libraries.&lt;br /&gt;
&lt;br /&gt;
==Getting started with Ruby==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions for OS X and Linux are similar, so they are combined [[#OS X and Linux|into the same section]].&lt;br /&gt;
&#039;&#039;&#039;Although Ruby can run on Windows, we do not offer official support for the Phidgets libraries using Ruby on Windows.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==OS X and Linux==&lt;br /&gt;
&lt;br /&gt;
Here, we walk you through installing the libraries both on your operating system and within Ruby, and then we walk through examples and writing code from scratch.&lt;br /&gt;
&lt;br /&gt;
===Install the Phidget drivers and libraries===&lt;br /&gt;
&lt;br /&gt;
The first step in using Ruby on OS X or Linux is to install the Phidget libraries.  The best way to do this is to go through the &#039;&#039;Getting Started&#039;&#039; guide for your device. This guide can be found in the [[:Category:UserGuide|user guide]].&lt;br /&gt;
&lt;br /&gt;
This process of installing will put the Phidget libraries on your system.  Ruby programs on OS X and Linux depend on the following files from the Phidget libraries: &lt;br /&gt;
&lt;br /&gt;
If you are using OS X:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.framework}}&amp;lt;/b&amp;gt; contains the actual Phidgets library for OS X, which is used at run-time.  &lt;br /&gt;
&lt;br /&gt;
If you are using Linuxe:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|libphidget21.so}}&amp;lt;/b&amp;gt; contains the actual Phidgets library for Linux, which is used at run-time.&lt;br /&gt;
&lt;br /&gt;
===Install phidgets-ffi===&lt;br /&gt;
&lt;br /&gt;
For both OS X and Linux, you will need the ffi and phidgets-ffi Ruby gems to run Phidgets.  This requires that you have RubyGems set up so that you can download and install gems (i.e. third-party software) to plug into Ruby and use.  The phidgets-ffi gem contains the Ruby library for Phidgets, and Phidgets example code.&lt;br /&gt;
&lt;br /&gt;
For more information, please see phidgets-ffi at [http://rubygems.org/gems/phidgets-ffi RubyGems] and [https://github.com/kreynolds/phidgets-ffi GitHub].&lt;br /&gt;
&lt;br /&gt;
Both Ruby and RubyGems are part of the Debian Linux repository.  Both Ruby and RubyGems are a part of Mac OS X 10.5 and higher.&lt;br /&gt;
&lt;br /&gt;
RubyGems will give you the command line program {{Code|gem}}.  This is the program you can use to install the phidgets-ffi and ffi gems.  First use it to install the [http://rubygems.org/gems/ffi ffi gem]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gem install ffi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this should be run using &#039;&#039;&#039;{{Code|sudo}}&#039;&#039;&#039; on Linux.  A version of ffi 1.0.9 or greater is needed. Next, please install the phidgets-ffi gem by typing the following into the command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gem install phidgets-ffi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this should be run using &#039;&#039;&#039;{{Code|sudo}}&#039;&#039;&#039; on Linux.  For OS X systems, the gem will be installed into {{Code|/Library/Ruby/Gems/1.x/phidgets-ffi-x.x.x}}.  For typical Linux systems, the gem will be installed into {{Code|var/lib/gems/1.x/gems/phidgets-ffi-x.x.x}}.&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
Open a command line terminal and navigate to the phidgets-ffi gem directory. {{Code|cd}} into the {{Code|examples}} folder. Here, you will find all of the examples available for Ruby, including a Hello World example that will work with any Phidget.  You will also find source code examples specifically designed for each Phidget.  {{FindYourDevice}}&lt;br /&gt;
&lt;br /&gt;
The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} Ruby example.&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Type the following into command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  ruby HelloWorld.rb&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that, on Linux, unless you have your [[OS_-_Linux#Setting_udev_Rules|udev rules set]], you will need to run Phidgets programs using &#039;&#039;&#039;{{Code|sudo}}&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:Ruby Linux HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. {{FindYourDevice}}&lt;br /&gt;
&lt;br /&gt;
Once you have the Ruby examples running, we have a [[#Follow the Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your environment to properly link the Phidget Ruby libraries.&lt;br /&gt;
&lt;br /&gt;
Simply, add the following two lines to the beginning of any {{Code|.rb}} script to make use of the phidgets-ffi gem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=ruby&amp;gt;&lt;br /&gt;
  require &#039;rubygems&#039;&lt;br /&gt;
  require &#039;phidgets-ffi&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow the Examples|teaching ]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Follow the Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Your main reference for writing Ruby code will be our Ruby API information, with syntax for all of our functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in Ruby|[{{SERVER}}/documentation/rubydoc Ruby API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In Ruby, you catch these events thrown by Phidgets (on a sensor data change, for example) by using the &#039;&#039;&#039;do&#039;&#039;&#039; command.  There are many events for each Phidget, such as device.on_attach, where device is your Interface Kit, Temperature Sensor, etc, etc.  &amp;lt;br&amp;gt; &lt;br /&gt;
Some event functions will be common to all Phidgets (attach and detach), and some will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
|Creating a Phidget software object in Ruby is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating a {{Code|Spatial}} object.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The object provides device specific methods and properties which are available from the API for your specific Phidget.|&lt;br /&gt;
[{{SERVER}}/documentation/rubydoc Ruby API]}}&lt;br /&gt;
&lt;br /&gt;
===Code Snippets===&lt;br /&gt;
&lt;br /&gt;
Specific calls in Ruby will differ in syntax from those on the [[General Phidget Programming]] page, but the concepts stay the same.  &lt;br /&gt;
&lt;br /&gt;
It may help to have the [[General Phidget Programming]] page and this section open at the same time, because they parallel each other and you can refer to the Ruby syntax.  However, many additional concepts are covered on the General Phidget Programming page on a high level, such as using multiple Phidgets, handling errors, and different styles of programming.&lt;br /&gt;
&lt;br /&gt;
For example, if we were using a [{{SERVER}}/products.php?product_id=1018 Phidget Interface Kit] as our device, our code snippets would look something like those shown here.&lt;br /&gt;
&lt;br /&gt;
====Step One: Initialize and Open====&lt;br /&gt;
&lt;br /&gt;
The Phidget constructor method will need to be called to create the Phidget object. There are two methods or programming a Phidget in Ruby: with and without a block. &lt;br /&gt;
&lt;br /&gt;
=====Block Programming===== &lt;br /&gt;
&lt;br /&gt;
To initialize and open a Phidget with a block of code following, for example, use this structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=ruby&amp;gt;&lt;br /&gt;
  Phidgets::InterfaceKit.new do |device|&lt;br /&gt;
    ..&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that with block programming, the block between &#039;&#039;&#039;do....end&#039;&#039;&#039; is your entire program.  As described in detail in the [[#Step Two: Wait for Attachment (plugging in) of the Phidget|next code snippet]], a block of code will automatically wait for the Phidget to finish opening and attaching, and will automatically call close on the Phidget at the end of the block. &lt;br /&gt;
&lt;br /&gt;
=====Non Block Programming=====&lt;br /&gt;
&lt;br /&gt;
To simply create and open a Phidget of a certain type - in this case an Interface Kit - use this structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=ruby&amp;gt;&lt;br /&gt;
  device = Phidgets::InterfaceKit.new&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The object name for any type of Phidget is listed in the API manual. Here we use the Phidget Interface Kit (the Phidget with digital inputs, outputs, and analog sensor ports), but if you have a different Phidget like a Motor Controller, or a Temperature Sensor, or a Spatial, you would use the software object for your specific Phidget.  Every type of Phidget also inherits functionality from the Phidget base class. &lt;br /&gt;
&lt;br /&gt;
=====Options for Open=====&lt;br /&gt;
&lt;br /&gt;
Options can be added to the Open constructor to connect to the first Phidget (of a certain type) that it finds, based on its serial number, label, or even connect across the network. [http://rubydoc.info/gems/phidgets-ffi/0.1.1/frames Rubydocs API documentation] lists all of the available modes that the constructor provides. &lt;br /&gt;
&lt;br /&gt;
For example, the following will try to connect to the first Phidget it finds:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=ruby&amp;gt;&lt;br /&gt;
  device= Phidgets::InterfaceKit.new&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following will try to connect to a Phidget over the Phidget WebService with a serial number of {{Code|99999}}, and a server id of {{Code|myserver}}: &lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=ruby&amp;gt;&lt;br /&gt;
  options = {:serial_number =&amp;gt; 99999, :server_id =&amp;gt; ‘myserver’, :password =&amp;gt; nil}&lt;br /&gt;
  device= Phidgets::InterfaceKit.new(options)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One important thing to remember is that when working with Phidgets, a local connection will reserve the device until closed. This prevents any other instances from retrieving data from the Phidget, including other programs. The one connection per device limit does not apply when exclusively using the [[Phidget WebService]].&lt;br /&gt;
&lt;br /&gt;
{{Code|Phidgets::InterfaceKit.new}} will tell the program to continuously try to connect to a Phidget, based on the options given (if any), and will even try to reconnect if it gets disconnected. &lt;br /&gt;
&lt;br /&gt;
====Step Two: Wait for Attachment (plugging in) of the Phidget==== &lt;br /&gt;
&lt;br /&gt;
To use the Phidget, it must be plugged in (attached).  Like the create (&amp;quot;new&amp;quot;) call above, there are blocking and non-blocking methods of detecting and handling attachment.  Attachment in software must be handled for all Phidgets.  We can handle it by using event driven programming and tracking the {{Code|on_attach}} and {{Code|on_detach}} events, or by calling: {{Code|wait_for_attachment}}.&lt;br /&gt;
&lt;br /&gt;
=====Block Programming=====&lt;br /&gt;
&lt;br /&gt;
If you are programming inside a block, {{Code|wait_for_attachment}} is automatically called. By default, it will halt the program and try to connect to the Phidget for up to 1000 milliseconds.  Afterwards, the block will yield. Finally, close is not needed as it is automatically called once the block has finished.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=ruby&amp;gt;&lt;br /&gt;
  options = {:timeout =&amp;gt; 2000)&lt;br /&gt;
  Phidgets::InterfaceKit.new(options) do |device|&lt;br /&gt;
    ... &lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Non Block Programming=====&lt;br /&gt;
&lt;br /&gt;
For the non block programming method, simply calling the constructor does not guarantee you can use the Phidget immediately. The {{Code|wait_for_attachment}} call will block indefinitely until a connection is made to the Phidget, or an optional timeout is exceeded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=ruby&amp;gt;&lt;br /&gt;
  device= Phidgets::InterfaceKit.new&lt;br /&gt;
  device.wait_for_attachment 2000 #halt the program for up 2000 milliseconds or until the Phidget is connected&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please also remember to call close at the end or the program to free any locks on the Phidget&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=ruby&amp;gt;&lt;br /&gt;
  device.close&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Event Programming=====&lt;br /&gt;
&lt;br /&gt;
Sometimes, it makes more sense to handle the attachment via an event.  This would be in instances where the Phidget is being plugged and unplugged, and you want to handle these incidents.  Or, when you want to use event-driven programming because you have a GUI-driven program.  In these cases, you would use the non-blocking method of creating and opening the Phidget (&amp;quot;new&amp;quot;), and use an event driven function to handle the attach event when thrown.  An event-driven code snippet to handle the attachment might look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=ruby&amp;gt;&lt;br /&gt;
  device.on_attach  do |device, obj|&lt;br /&gt;
    puts &amp;quot;Id: #{device.id}&amp;quot;&lt;br /&gt;
    puts &amp;quot;Serial number: #{device.serial_number}&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Step Three: Do Things with the Phidget====&lt;br /&gt;
&lt;br /&gt;
You can read data and interact with your Phidget both by polling it for its current state (or to set a state), or by catching events that trigger when the data changes.&lt;br /&gt;
&lt;br /&gt;
For our [{{SERVER}}/products.php?product_id=1018 Phidget Interface Kit], the polling method of getting the current sensor state and setting an output state looks something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=ruby&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Get a data point from Analog Port 0&lt;br /&gt;
puts &amp;quot;Sensor value[0]: #{device.sensors[0].to_i}&amp;quot; &lt;br /&gt;
&lt;br /&gt;
# Set digital output port 0 to be on&lt;br /&gt;
device.outputs[0].state = true&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To catch data changes via events, you would use something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=ruby&amp;gt;&lt;br /&gt;
  device.on_sensor_change do |device, input, value, obj|&lt;br /&gt;
    puts &amp;quot;Sensor #{input.index}&#039;s value has changed to #{value}&amp;quot;&lt;br /&gt;
  end &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Step Four: Close====&lt;br /&gt;
 &lt;br /&gt;
If you are using the block programming method, you do not need to worry about closing the Phidget; it is already taken care of when the block ends. However, if you are using the non block programming method, then you will need ensure that the Phidget is closed. At the end of your program, call {{Code|close}} to free any locks on the Phidget that the Phidget constructor call put in place!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=ruby&amp;gt;&lt;br /&gt;
  device.close&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MoreHowTos}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;complete&#039;&#039; set of functions you have available for all Phidgets can be found in the [http://rubydoc.info/gems/phidgets-ffi/0.1.1/frames Ruby API]. You can also find more description on any device-specific function in the Device API page for your specific Phidget, which can be found in its [[:Category:UserGuide|user guide]].&lt;br /&gt;
&lt;br /&gt;
====Raw FFI====&lt;br /&gt;
&lt;br /&gt;
As an alternative to programming with the method as outlined in this document, you can also program making straight C calls through FFI. Please refer to the files in {{Code|Ruby Gems Directory/phidgets-ffi-x.x.x/lib/phidgets-ffi/ffi}} to see a list of available methods, and the [{{SERVER}}/documentation/Phidget21_C_Doc.zip C API] for usage. There are raw ffi examples in {{Code|Ruby Gems directory/phidgets-ffi-x.x.x/examples/raw-ffi}}.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
None at this time.&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=23891</id>
		<title>OS - Phidget SBC</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=23891"/>
		<updated>2017-05-24T19:10:21Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
{{OSLang|[[File:icon-Linux.png|64x64px|link=OS - Linux]]|On the Single Board Computer (SBC), Phidgets can be either plugged directly into one of the USB ports or run over a network using the [[#WebService | WebService]].}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Unlike our other supported operating systems, the SBC &#039;&#039;&#039;does not require downloads&#039;&#039;&#039; unless you are doing something advanced like loading the firmware or developing your own kernel.  You will know if you need these downloads, otherwise, the SBC should work as described on the [[1073 User Guide#Getting Started|SBC3 Getting Started Guide]] right out of the box.&lt;br /&gt;
&lt;br /&gt;
*[[Software License]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC (1070):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1070/changelog.txt changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1070/phidgetsbc-minimal.bin Minimal Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1070/phidgetsbc-full.bin Full Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1070/buildroot-phidgetsbc.tar.gz Buildroot/Kernel Sources]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC2 (1072):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1072/changelog.txt changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1072/phidgetsbc2.bin SBC2 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1072/phidgetsbc2-kerneldev.tar.gz SBC2 Kernel Development Package] (How-to and patch file)&lt;br /&gt;
&#039;&#039;&#039;The PhidgetSBC3 has different firmware packages based on the kernel version. In order to determine the device version of your SBC3, see the [[1073_User_Guide#SBC_Web_Interface|web configuration page]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:sbcver.jpg|thumb|562px|link=|The system information table is found on the Status -&amp;gt; System tab of the &#039;&#039;&#039;[[1073_User_Guide#SBC_Web_Interface|web configuration page]]&#039;&#039;&#039; of the SBC.]]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.6.3:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/changelog.txt changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.6.3/phidgetsbc3.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.6.3/phidgetsbc3-kerneldev.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.6.3/phidgetsbc3-upgrade_3.6.3_3.14.27.tar.gz SBC3 Kernel upgrade package (3.6.3 -&amp;gt; 3.14.27)]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.14.27:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/changelog.txt changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.14.27/phidgetsbc3.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.14.27/phidgetsbc3-update_3.14.27.tar.gz SBC3 Kernel update package (3.14.27)]&lt;br /&gt;
*[{{SERVER}}/downloads/phidgetsbc/1073/linux-3.14.27/phidgetsbc3-kerneldev.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Note that, instead of using the firmware to update your SBC, updates should normally be done via the System -&amp;gt; Packages page on your SBC3 web interface. It is rarely necessary to completely re-flash your device..&lt;br /&gt;
&amp;lt;br clear = all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Getting Started with the Phidget SBC Debian Linux==&lt;br /&gt;
&lt;br /&gt;
The Single Board Computer (SBC) is a unique Phidget.  It is a computer with a Linux operating system.  It can compile code, save files, manage background jobs, host information over the web, and more.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If this is your first time&#039;&#039;&#039; using the Phidget SBC, you will want to start with the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  After that, here we will get you started on topics beyond those in the getting started guide, including how to write Phidget code to run on the SBC.  You &#039;&#039;&#039;do not need this page&#039;&#039;&#039; if you are simply using the SBC to broadcast data from Phidgets over the network - it does that automatically.  We describe how to verify and use this in the [[1073 User Guide#Getting Started | Getting Started Guide]].&lt;br /&gt;
&lt;br /&gt;
This page will show you how to:&lt;br /&gt;
* Install the ability to write and develop code on the SBC itself&lt;br /&gt;
* Use the command line for basic coding tasks&lt;br /&gt;
* Troubleshoot the SBC&#039;s network&lt;br /&gt;
It will also give additional specifications, which are useful for doing more advanced things with the SBC hardware and software.&lt;br /&gt;
&lt;br /&gt;
Before reading this page, you should have done the following via the Getting Started Guide:&lt;br /&gt;
* Set up networking on your SBC, via either Ethernet or wireless&lt;br /&gt;
* Set up an admin password&lt;br /&gt;
* Learned the IP address or link local address of the SBC&lt;br /&gt;
We will use this information in setting up the libraries and drivers to use the SBC for writing and running code.&lt;br /&gt;
&lt;br /&gt;
Conceivably, you could simply use the SBC like any Linux computer, and do all of your development and compiling of Phidget code on the SBC itself.  In practice this gets complicated as the SBC does not have a keyboard or screen.  So usually, you will want to develop your code an external computer and copy files and settings over to the SBC via a network.  This makes this Getting Started section unique, in that we show you how to set up both computers:&lt;br /&gt;
* Your [[#Getting Started - External Computer | External Development Computer]], usually your main desktop or laptop which will transfer files and settings to and from the SBC&lt;br /&gt;
* The [[#Getting Started - The SBC (Debian Linux) | SBC]] itself, which needs programming language libraries to use Phidgets.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - External Computer===&lt;br /&gt;
&lt;br /&gt;
You have two ways to connect to the SBC from an external computer: via the [[#SBC Web Interface|SBC Web Interface]] and over the more powerful but complex [[#SSH | Secure Shell (SSH)]].&lt;br /&gt;
&lt;br /&gt;
====SBC Web Interface====&lt;br /&gt;
&lt;br /&gt;
You have already worked extensively with the web interface in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  This was the tool within a web browser which was opened either via the [[Phidget Control Panel]] on Windows, or by simply entering the IP or link local address into an internet browser.  It allowed you to set the password, set up internet connectivity, and so on.  &lt;br /&gt;
&lt;br /&gt;
This section doesn&#039;t have more information on the interface; rather, it simply serves as a reminder that you have the web interface as an available tool.  Examples, including screenshots, are placed where appropriate in this document.  The web interface will probably stay your initial go-to way to connect to the SBC, especially for tasks that benefit from graphical interaction, like setting up wireless or using the webcam.&lt;br /&gt;
&lt;br /&gt;
====SSH====&lt;br /&gt;
&lt;br /&gt;
The most flexible way to transfer files and commands to and from the SBC is via a program called &#039;&#039;&#039;ssh&#039;&#039;&#039;.  The ssh program provides command line text access over a network into the SBC.  Using it, you can run programs and give the SBC commands.  The ssh program has a companion program called &#039;&#039;&#039;scp&#039;&#039;&#039; which can copy files back and forth.  If you are unfamiliar with ssh, you can think of it like the command line or a Mac terminal, but with a remote connection to a different computer.  It is a minimal yet effective way to interact with a remote computer.&lt;br /&gt;
&lt;br /&gt;
Before connecting over ssh, you will need:&lt;br /&gt;
* The &#039;&#039;&#039;IP address&#039;&#039;&#039; (such as 168.254.3.0) or &#039;&#039;&#039;link local address&#039;&#039;&#039; (such as phidgetsbc.local) of the SBC&lt;br /&gt;
* The &#039;&#039;&#039;admin password&#039;&#039;&#039; for the SBC&lt;br /&gt;
Both of these items can be found by following the steps in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].&lt;br /&gt;
&lt;br /&gt;
You will also need to enable SSH on the SBC side.  This can be done through the [[#SBC Web Interface| Web Interface]], under {{Code|Network &amp;amp;rarr; Settings}}, by changing the &#039;&#039;SSH Server&#039;&#039; radio button to &#039;&#039;Enabled&#039;&#039; and saving your changes:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_turn_on_ssh.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
=====SSH on Windows=====&lt;br /&gt;
&lt;br /&gt;
The ssh program is not installed on Windows by default.  But, there are a variety of SSH programs available for free. One simple and commonly used program is [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY], and it has the advantage that the executable doesn&#039;t need to install, it just runs.&lt;br /&gt;
&lt;br /&gt;
With PuTTY, when you first run the program it will ask you what to connect to.  Enter the IP address or link local address of the SBC, and then click the SSH radio button right below the address, which will change the port to 22.  Then click open, and you&#039;ll have an ssh connection to the SBC open in a terminal.  It will prompt you for a user name ({{Code|root}}) and password (the admin password).&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, there is an SCP component to PuTTY, called PSCP, which is available from the same [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY download page].  Use of PSCP will be similar with the address, username, and password, except that you will be transferring files instead of sending commands.&lt;br /&gt;
&lt;br /&gt;
=====SSH on Linux and Mac OS=====&lt;br /&gt;
&lt;br /&gt;
Linux and Mac OS already have ssh installed by default.  To run ssh simply open a terminal...&lt;br /&gt;
* {{Code|Ctrl-Alt-T}} on Linux &lt;br /&gt;
* {{Code|Applications &amp;amp;rarr; Utilities &amp;amp;rarr; Terminal}} on Mac OS &lt;br /&gt;
...and type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
ssh root@phidgetsbc.local&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have re-named your SBC, include that name instead of the {{Code|phidgetsbc.local}} link address.  Or, you can use the SBC&#039;s IP address, e.g. something like {{Code|ssh root@168.254.3.0}}&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, the command follows the form of: {{Code|scp from to}}&lt;br /&gt;
&lt;br /&gt;
So, to copy a file {{Code|/root/data.txt}} from the SBC to your local machine, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
scp root@phidgetsbc.local:/root/data.txt .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note the use of the dot &#039;&#039;&#039;.&#039;&#039;&#039; to indicate that scp should put the file in the current local directory.   If you&#039;re not sure what folder the terminal is operating in type {{Code|pwd}} to print the working directory.  Terminals usually start by default in your home folder.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - The SBC (Debian Linux)===&lt;br /&gt;
&lt;br /&gt;
The SBC runs Linux, which is a full operating system. It is stripped down compared to a full desktop release of Linux, but you can compile code on it, run programs, schedule tasks, create and manage files, run a web server, and much, much more.&lt;br /&gt;
&lt;br /&gt;
At this point you have connected to the SBC via the [[#SBC Web Interface|web interface]], and probably also through [[#SSH|SSH]].  This section will help you install libraries and drivers that you probably want - i.e. support for C, Java, and Python.  After this section, you&#039;ll be well into the depths of using the SBC as a computer, and so you&#039;ll probably want to keep the [[#Using SBC Linux|Using SBC Linux section]] open for reference while you work if you are not already familiar with Linux.&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the following Phidget functionality installed:&lt;br /&gt;
* The Phidget C libraries {{Code|libphidget21.so}}&lt;br /&gt;
* The Phidget [[#WebService | WebService]]&lt;br /&gt;
(If you are simply curious what these are and how they get installed, we describe the process on the [[OS - Linux | general Linux page]].)&lt;br /&gt;
&lt;br /&gt;
But to compile C programs, or run Java programs, or use Python, you will need to install these languages onto the SBC.  &lt;br /&gt;
&lt;br /&gt;
Before installing anything on the SBC, however, (even via a button on the web interface) make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
====Installing C/C++ and Java====&lt;br /&gt;
&lt;br /&gt;
The simplest way to install C/C++  and Java on the SBC is via the web interface.  There is a button under {{Code|System &amp;amp;rarr; Packages}} to install C support (including {{Code|gcc}}) and another button to install Java support:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_packages_web.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
You have to check that you are running the same version of Java on your development machine (where you plan on compiling the java programs) as the SBC is running. To do this type the following into the terminal on your computer and from ssh on the SBC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
Java -version&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need to update the version of Java on your SBC, use the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install openjdk-7-jre-headless&lt;br /&gt;
su&lt;br /&gt;
update-alternatives --config java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you&#039;re ready to begin programming.  We have programming pages for both [[Language - C/C++|C/C++]] and for [[Language - Java|Java]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].  &lt;br /&gt;
&lt;br /&gt;
If you want to avoid using the [[#SSH|SSH]] interface on the SBC entirely, and you want to write your program in Java and run it continuously from boot (which is the only option if you want to avoid [[#SSH|SSH]]), we have a [[#Program in Java with the Web Interface|very in-depth section]] on that topic.&lt;br /&gt;
&lt;br /&gt;
====Installing Python====&lt;br /&gt;
&lt;br /&gt;
Installing Python has two steps.  First, you&#039;ll need to install the basic ability to run python, and then you&#039;ll need to install the Phidget Python module.  Both steps (and both options) require that you issue the relevant commands through an [[#SSH|SSH terminal]].&lt;br /&gt;
&lt;br /&gt;
=====Basic Python=====&lt;br /&gt;
&lt;br /&gt;
The base Python functionality can be downloaded and installed in one step with [[#apt|apt]] (i.e. in a terminal, type):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will give you Python, and now you just have to install the Phidget Python module to gain Phidget functionality. If the installation fails because it can&#039;t find python, you need to enable the full repository as described in [[#Getting Started_-_The_SBC_(Debian_Linux)|this section]], and then perform an apt-get update.&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 1: Use a USB Key=====&lt;br /&gt;
&lt;br /&gt;
Copy the [{{SERVER}}/downloads/libraries/PhidgetsPython.zip Python Libraries] onto a USB key.  Unpack the zip file into a folder on the USB key.  Insert the key into the SBC.&lt;br /&gt;
&lt;br /&gt;
You will have to figure out where the USB key (and the Phidget Python library folder) is now located.  We describe how in the general [[#Using USB Data Keys | Using USB Data Keys]] section.&lt;br /&gt;
&lt;br /&gt;
After you know the place where the USB key is mounted, in a terminal go to that directory (e.g. type {{Code|cd /media/usb0/}}), enter the unpacked Phidget Python Library folder, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have an whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 2: Use the Internet=====&lt;br /&gt;
&lt;br /&gt;
Rather than using a USB key to transfer the file, the SBC can download it directly from the internet.  You will need {{Code|wget}} and {{Code|unzip}} installed, both of which are small:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install wget&lt;br /&gt;
apt-get install unzip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the web link address for the [{{SERVER}}/downloads/libraries/PhidgetsPython.zip Python Libraries].&lt;br /&gt;
&lt;br /&gt;
In an SSH terminal to the SBC, type: {{Code|wget http://www.python_library_link}} where instead of http://www.python_library_link you insert the link you just copied. Copying into a terminal can usually be done via the right-click menu.&lt;br /&gt;
&lt;br /&gt;
This will download the Phidget python libraries to the folder you ran the {{Code|wget}} command in.  Unzip the downloaded file using the command {{Code|unzip file}}, where file is the filename from {{Code|wget}}. Or try typing {{Code|ls}} to list the names of a file in the directory, which should include the unzipped folder.  Enter the unzipped folder (e.g. use {{Code|cd}} to change directory), and install the Phidget Python libraries:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have a whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
====Installing Other Languages====&lt;br /&gt;
&lt;br /&gt;
You may also be able to program on the SBC using [[Language - Ruby|Ruby]] and [[Language - C Sharp|C# under Mono]], though we do not offer in-depth support for these languages on the SBC.  The installation procedures should more or less follow that of [[#Installing Python|installing python]] on the SBC, except you will be installing Ruby or Mono.  Performing package searches using [[#apt|apt cache search]] can help you find the relevant software.&lt;br /&gt;
&lt;br /&gt;
For C#, as of 2012 the {{Code|mono-complete}} package is broken on the Debian Squeeze repository.  Rather, you have to install the Mono runtime and Mono compiler separately.&lt;br /&gt;
&lt;br /&gt;
To install the runtime package (and its dependencies), use [[#apt|apt]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-runtime&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to install the C# compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-gmcs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or the Visual Basic compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-vbnc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, the system and library packages do not link correctly for the version 2.0 of Mono.  If this is the case, your code will compile fine, but when you try to run it, you will get an error like:&lt;br /&gt;
&lt;br /&gt;
:{{Code|The assembly mscorlib.dll was not found or could not be loaded.}}&lt;br /&gt;
:{{Code|It should have been installed in the `/usr/lib/mono/1.0/mscorlib.dll&#039; directory.}}&lt;br /&gt;
&lt;br /&gt;
In this case, you need to install these two packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libmono-corlib1.0-cil&lt;br /&gt;
apt-get install libmono-system1.0-cil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we found these packages to work by working through the tree structure.  As a general rule, you can find these dependencies by using install (here, {{Code|apt-get install mono-complete}}) to get a sense of the package tree structure.  This will possibly tell you that the packages are broken, but at the same time this will list the dependencies of the packages.  Trying to install individual dependencies will show you that although a root-package fails, the sub-packages will sometimes succeed, and install what you need.&lt;br /&gt;
&lt;br /&gt;
If you want to use a specific dll or library that is not available in this reduced version of mono, you can install mono complete by switching from Emdebian+Debian to just Debian.  To do this:&lt;br /&gt;
&lt;br /&gt;
In {{Code|/etc/apt/preferences}} make the following changes:&lt;br /&gt;
:{{Code|Package: *}}&lt;br /&gt;
:{{Code|&amp;lt;nowiki&amp;gt;Pin: release a=stable&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
:{{Code|Pin-Priority: 1010}}&lt;br /&gt;
	&lt;br /&gt;
In {{Code|/etc/apt/sources.list/mutistrap-debian.list}} remove the emdebian line.&lt;br /&gt;
&lt;br /&gt;
Apply the changes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get dist-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many packages will be &#039;downgraded&#039; from the emdebian to debian versions.  Delete the {{Code|&amp;lt;nowiki&amp;gt;/etc/apt/preferences&amp;lt;/nowiki&amp;gt;}} file and install mono-complete:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install monodoc-http mono-complete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Choose monodoc-http explicitly, because otherwise the install fails on monodoc-browser.&lt;br /&gt;
&lt;br /&gt;
After this process, you can compile your C# Code.cs Phidget source file the same way as on a generic [[Language - C Sharp#Linux|Linux with Mono]] system.  Please refer to that page on how to obtain the *.dll Phidget resource file and compile your code.  On the SBC, however, because you are already running as root (the Super User), you do not need &#039;sudo&#039; and indeed the SBC will give you an error if you use it.  Instead, compiling and running will look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
gmcs Code.cs -r:Phidget21.NET.dll&lt;br /&gt;
mono Code.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using SBC Linux==&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve set up communication with the SBC, and installed whichever programming language support you need, you&#039;re probably ready for a short tour of useful tools on the SBC&#039;s version of Linux.&lt;br /&gt;
&lt;br /&gt;
First, you will by default be running on the SBC as &#039;&#039;&#039;root&#039;&#039;&#039;, which is the super-user.  For Linux users, this probably makes you nervous because you know you can overwrite important system files without the system asking for additional permission.  As a Windows or Mac OS user - although you may usually run your computer as an administrator - your familiar system usually prompts you to confirm before you do anything really dangerous, and this will &#039;&#039;&#039;not&#039;&#039;&#039; happen on the SBC as the root user.&lt;br /&gt;
&lt;br /&gt;
Next, there is no installed help on the SBC.  Help on Linux is usually called &#039;man pages&#039; which is short for &#039;the manual pages&#039;.  On a full Linux system, usually if you need help with any command you can type, for example, {{Code|man ls}} and it will give you help with the program [[#ls|ls]].  But these help pages take up significant space, and they are widely available online.  So, if you need more help with a certain command, you can always type {{Code|man command}} into your favourite search engine.&lt;br /&gt;
&lt;br /&gt;
Finally, the SBC has no windowing system.  For Linux users, this means no X-windows (Gnome, KDE, etc).  And as a Windows or Mac user, you can think of it as running all of your programs and commands through the terminal or DOS prompt command line.  The SBC provides all of the functionality of an operating system (e.g. process scheduling, file management, etc) but without any graphical interface.  The only exception is the [[#SBC Web Interface|web interface]], which gives graphical access to a limited part of what the SBC can do.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands===&lt;br /&gt;
&lt;br /&gt;
If you are doing more with the SBC than simply running pre-written programs [[#Writing a Phidget Program|in Java to run continuously from boot]], you will be interacting with the SBC&#039;s Linux operating system over the command line by using [[#SSH|SSH]].  This section discusses useful programs already installed on the SBC, and how to run them on the command line.&lt;br /&gt;
&lt;br /&gt;
====ls====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;ls&#039;&#039;&#039; program lists the contents of a directory.&lt;br /&gt;
&lt;br /&gt;
It will show both files and folders, but not files that start with a &amp;quot;.&amp;quot; (these are hidden files on Linux).&lt;br /&gt;
*If you also want to show hidden files, use {{Code|ls -a}}&lt;br /&gt;
*If you want more information, such as size and date modified, use {{Code|ls -l}}&lt;br /&gt;
*Commands can be combined, like {{Code|ls -al}}&lt;br /&gt;
&lt;br /&gt;
====cd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cd&#039;&#039;&#039; program changes to a new directory.&lt;br /&gt;
&lt;br /&gt;
For example, {{Code|cd /root}} changes into the directory at the base of the file tree called &#039;&#039;root&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* Linux uses forward slashes&lt;br /&gt;
* The base of all directories is &amp;quot;/&amp;quot; (not &amp;quot;C:\&amp;quot;)&lt;br /&gt;
* The tilde symbol (~) is short for your home directory (i.e. when you are root, this is short for &amp;quot;/root&amp;quot;)&lt;br /&gt;
* The double dot &amp;quot;..&amp;quot; means move one directory higher (for example from {{Code|/root/data/}} to {{Code|/root/}})&lt;br /&gt;
&lt;br /&gt;
====pwd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;pwd&#039;&#039;&#039; program prints the current directory you are working in.  (&#039;P&#039;rint &#039;W&#039;orking &#039;D&#039;irectory)&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
:{{Code|root@phidgetsbc:~# pwd}}&lt;br /&gt;
:{{Code|/root}}&lt;br /&gt;
&lt;br /&gt;
====cp, mv, and rm====&lt;br /&gt;
&lt;br /&gt;
These programs are copy (&#039;&#039;&#039;cp&#039;&#039;&#039;), move (&#039;&#039;&#039;mv&#039;&#039;&#039;), and remove (&#039;&#039;&#039;rm&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Copy copies a file from one location and pastes it to another.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|cp data.txt data_backup.txt}} will put a copy of the file {{Code|data.txt}} into {{Code|data_backup.txt}}&lt;br /&gt;
&lt;br /&gt;
Move moves a file (this is also useful for renaming files) to a new destination.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|mv data.txt data_backup.txt}} will put the contents of {{Code|data.txt}} into {{Code|data_backup.txt}}, and then will remove {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Remove deletes a file.&lt;br /&gt;
&lt;br /&gt;
For example, typing {{Code|rm data.txt}} will delete {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Note that &#039;&#039;&#039;rm&#039;&#039;&#039; is final.  Once you remove a file using {{Code|rm}}, it is gone forever.  There is no recycle bin, no temporary trash, nothing other than backups you may have personally created in the past!&lt;br /&gt;
&lt;br /&gt;
Directories can only be removed with {{Code|rmdir}}, and then only if they are empty.  If you want to remove a directory and all the files in it, use {{Code|rm -rf directory}} but be &#039;&#039;&#039;very, very careful&#039;&#039;&#039; with this command.  Trying to remove everything within a directory (e.g. {{Code|rm -rf *}}) is one of the most dangerous commands you can run on a Linux system, as running it from the wrong directory will result in Linux happily removing everything under that directory -- which could be your entire filesystem.&lt;br /&gt;
&lt;br /&gt;
====find====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;find&#039;&#039;&#039; program does what it says - it finds things.  &lt;br /&gt;
&lt;br /&gt;
Unfortunately for the casual user, the find program is very flexible and powerful, and thus not especially intuitive to use.  But, here are some examples:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|find folder -name file.txt}}&lt;br /&gt;
| Looks for all files in a folder (/ for root - or all - folders) with a certain name (* for wildcard)&lt;br /&gt;
| {{Code|find / -name *.jpg}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|find folder -mtime +X}}&lt;br /&gt;
| Looks for all files in a folder modified less than X days ago&lt;br /&gt;
| {{Code|find /root -mtime +30}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====grep====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;grep&#039;&#039;&#039; program takes text input and searches for a term. &lt;br /&gt;
&lt;br /&gt;
For example, if you type {{Code|mount}} to view what devices are mounted (e.g. loaded) on your SBC, you will see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may be a lot of information you don&#039;t need.  If you are only interested in a USB key attachment (as described in the [[#Using USB Data Keys|Using USB Data Keys]] section), you can use grep to filter that one response:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep sda1&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====nano====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;nano&#039;&#039;&#039; program is a small text editor that you can use within an SSH terminal. &lt;br /&gt;
&lt;br /&gt;
Nano can be surprisingly useful for writing short lengths of code right on the SBC, so there is no need to transfer files and keep track of different file versions on different computers.&lt;br /&gt;
&lt;br /&gt;
Nano has all keyboard commands which are listed at the bottom of the screen at all times as a reminder (Ctrl-O to save, Ctrl-X to exit, these expand with a larger terminal window).  And, nano provides what is called &#039;syntax highlighting&#039;, which colours reserved keywords, comments, strings, and so on as appropriate to the programming language you are using.  Nano detects the programming language via the extension of the file ({{Code|.java}} for Java, {{Code|.c}} for C/C++, and {{Code|.py}} for Python).&lt;br /&gt;
&lt;br /&gt;
Typing {{Code|nano test.py}} on an SSH command line and then entering a few lines of Python into the new empty file results in:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_nano_python.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
====apt====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;apt&#039;&#039;&#039; program allows you to install, uninstall, upgrade, and search software available for the SBC.&lt;br /&gt;
For a non-Linux user, the apt framework may be daunting at first, but it actually allows you to keep your system up to date and install and manage software quickly, easily, and for free.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Before installing anything on the SBC, make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-cache search term}}&lt;br /&gt;
| Looks for all programs (packages) that have {{Code|term}} in the title or description&lt;br /&gt;
| {{Code|apt-cache search opencv}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-cache show package}}&lt;br /&gt;
| Shows a lot of data about {{Code|package}} including size, version, etc&lt;br /&gt;
| {{Code|apt-cache show unzip}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-get update}}&lt;br /&gt;
| Gets the most recent listing of available software&lt;br /&gt;
| {{Code|apt-get update}}  (No options)&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-get install program}}&lt;br /&gt;
| Installs {{Code|program}} from the internet&lt;br /&gt;
| {{Code|apt-get install python}}&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====mount====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|mount}} shows you all of the mounted devices on your SBC.  &lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the non-Linux user, the concept of a device may be quite strange.  To give a short summary, everything on Linux that you can read or write is a file.  Webcams are files (i.e. you can &#039;read&#039; photos from them), USB keys are files, and each filesystem (tmp storage, the kernel portion, the main filesystem) are also themselves files.  These files specify what and how something can be written.  These are not necessarily linear, for example, you can see above that the USB key ({{Code|/media/usb0}} is mounted &#039;&#039;within&#039;&#039; the root file system {{Code|rootfs}} which is /.   &lt;br /&gt;
&lt;br /&gt;
So mount gives you an idea of what devices have been &#039;mounted&#039; for reading or writing, and how you can read and write to them.  More information on mount (and its various forms, like {{Code|umount}}) is available widely around the Internet.&lt;br /&gt;
&lt;br /&gt;
====which====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|which}} tells you if and where a program is installed.&lt;br /&gt;
&lt;br /&gt;
For example, on a default SBC, typing {{Code|which python}} will return no results.  But after successfully [[#Installing Python | installing python]], it will return {{Code|/usr/bin/python}} as the location of the python program/binary/executable.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands to Install===&lt;br /&gt;
&lt;br /&gt;
These are other programs you may find useful on the command line.  Although they are not on the SBC by default, these and other programs can usually be installed simply by using [[#apt|apt-get install]], with the exception of gcc.  For example, {{Code|apt-get install wget}} will download and install [[#wget|wget]].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This section and the section on [[#Some Useful Commands|pre-installed commands]] can hardly cover all of the complexities and power of the Linux operating system.  There are many excellent tutorials online, and between them and using [[#apt|apt]] to find and install programs you should be able to learn a lot and perform any number of complex useful tasks.&lt;br /&gt;
&lt;br /&gt;
====gcc====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;gcc&#039;&#039;&#039; program is the C compiler for Linux.&lt;br /&gt;
&lt;br /&gt;
If you are an experienced C/C++ user on Mac or Linux, or if you&#039;ve already read our [[Language - C/C++ | C Language page]], you might think you need to install gcc via {{Code|apt-get}} to compile C code.  However, gcc is not in the package repository for the SBC, so {{Code|apt-get install gcc}} will fail.  Rather, to install gcc, you can do it via the web interface, as described in the [[#Installing C/C++ and Java|Installing C/C++ and Java]] section.&lt;br /&gt;
&lt;br /&gt;
After installing it via the SBC web interface, you can use {{Code|gcc}} normally.&lt;br /&gt;
&lt;br /&gt;
====less====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;less&#039;&#039;&#039; program displays the contents of a text or source code file.  When displaying the file, {{Code|less}} allows you to scroll up and down to read it.&lt;br /&gt;
&lt;br /&gt;
This is useful if you are writing your sensor readings to a data file, and you want to read the data file while it is being written by your main code.  If your data file is called {{Code|data.txt}}, you can type {{Code|less data.txt}} and see the lines in the file, and what they are.&lt;br /&gt;
&lt;br /&gt;
The {{Code|less}} program output can also be piped into another program.  For example, you can use {{Code|less}} and the word search program {{Code|grep}} to find lines within a file with a search term.  For instance, if you have a C source code file {{Code|Program.c}} on the SBC, and you want to see all the lines in {{Code|Program.c}} that contain a variable name {{Code|var}}, you can type: &lt;br /&gt;
:&amp;lt;code&amp;gt;less Program.c | grep var&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====wget====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;wget&#039;&#039;&#039; program allows you to get an online file (over http) and download it to the SBC.&lt;br /&gt;
&lt;br /&gt;
For example, to get the source file (HTML) from the Phidgets home page, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
wget http://www.phidgets.com&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is most useful for downloading libraries, drivers, or anything (zip, tar, etc) you need from the web which is not available by [[#apt|using apt]].&lt;br /&gt;
&lt;br /&gt;
===Writing a Phidget Program===&lt;br /&gt;
&lt;br /&gt;
We provide two ways to write and upload a Phidget Program:&lt;br /&gt;
# The [[#SBC Web Interface|web interface]]:&lt;br /&gt;
#* This is useful for simple projects written in Java that you want to start only at boot&lt;br /&gt;
#* You can also use C projects, but they must be compiled off the SBC for an ARM processor&lt;br /&gt;
# Over [[#SSH|SSH]], which will allow you to write or transfer source code directly to and from the SBC&lt;br /&gt;
#* This is useful for all other projects, such as:&lt;br /&gt;
#** Projects that run at scheduled times (e.g. once per minute)&lt;br /&gt;
#** Projects that use languages other than Java or ARM-compiled C&lt;br /&gt;
Note that you can still run an [[#SSH|SSH]] project at boot, you just have to write and install a startup script.  This is a bit complex, but we do have an example that starts the program {{Code|phidgetwebservice21}} [[OS - Linux#As A Service|at boot using a script]].&lt;br /&gt;
&lt;br /&gt;
Once you know which method you&#039;d like to use, you can continue on to learn how to [[#Program in Java with the Web Interface|Program in Java with the Web Interface]], or how to [[#Program with SSH|Program with SSH]] using Java, C, or Python.  If you are actually typing in source code on the SBC, you&#039;ll find our [[#Developing Code on the SBC|developing code on the SBC section]] useful.&lt;br /&gt;
&lt;br /&gt;
====Program in Java with the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To show how to write, compile, and install Java programs on the SBC, we&#039;ll use the [[Language - Java|Java Hello World]] example code.  You can download the HelloWorld example by downloading the whole [{{SERVER}}/downloads/examples/JavaJNI.zip Java example package].  Make sure you have the same version of [[#Installing C/C++ and Java|Java installed on the SBC]] as you have on your external development machine. Instruction for checking and updating are found on the [[#Installing C/C++ and Java|installation page]].&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how to get the HelloWorld code running on the SBC.  On your external computer:&lt;br /&gt;
&lt;br /&gt;
1. Download the SBC version of the Phidget Java libraries ({{Code|phidget21.jar}}).  You can download this from the [[#SBC Web Interface|web interface]], on the page under {{Code|Projects &amp;amp;rarr; Projects}}, under the &#039;&#039;&#039;Notes&#039;&#039;&#039; section.&lt;br /&gt;
&lt;br /&gt;
2. Place the SBC version of {{Code|phidget21.jar}} into a directory on your external computer.  This will be your working directory that you will use to compile the Java files.&lt;br /&gt;
&lt;br /&gt;
3. Also copy the {{Code|HelloWorld.java}} file into that working directory.&lt;br /&gt;
&lt;br /&gt;
4. Compile the {{Code|HelloWorld.java}} file from within that working directory.  From the command line prompt on Windows, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .;phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In a terminal on Linux or Mac OS, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. You should now have three compiled class files: {{Code|HelloWorld.class}}, {{Code|HelloWorld$1.class}}, and {{Code|HelloWorld$2.class}}.  You don&#039;t need to try and run them, and if you do you may encounter an error because the SBC {{Code|phidget21.jar}} may be slightly different than the Phidget support you have installed on your external computer.&lt;br /&gt;
&lt;br /&gt;
Now we move onto the SBC:&lt;br /&gt;
&lt;br /&gt;
6. Create a new project on the SBC, in the web interface under {{Code|Projects &amp;amp;rarr; Projects}}.  Call it HelloWorld:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_create_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
7. On the next screen, you will be prompted to upload your files.  We will upload the three Java class files, and then click the {{Code|Start}} button:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_web_run_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
8. You&#039;ll note that as it runs, there are two links below the {{Code|Stop}} button: One called {{Code|stdout}}, which is &#039;&#039;Standard Output&#039;&#039;, and one called {{Code|stderr}}, which is &#039;&#039;Standard Error&#039;&#039;.  Usually, when you run a program on the command line, you see both standard out and standard error at the same time - i.e. you get all program output right there in your terminal or command prompt.  But when running a program in the background, Linux splits the output up into normal output and error output as this is very useful for debugging (i.e. you can check if standard error is empty).  &lt;br /&gt;
&lt;br /&gt;
Here, however, if you&#039;re not sure whether the program will run correctly, you should first check {{Code|stderr}} to see if any errors were generated, and then check {{Code|stdout}} to see if the output looks as expected.&lt;br /&gt;
&lt;br /&gt;
To write your own Java program, follow the same process but use your own source code instead of the {{Code|HelloWorld.java}} example.&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, we offer additional help on [[#Via the Web Interface|running a program automatically using the web interface]].&lt;br /&gt;
&lt;br /&gt;
====Program with SSH====&lt;br /&gt;
&lt;br /&gt;
Similarly to starting a program via the [[#Program in Java with the Web Interface|web interface]], we use the Phidget Java {{Code|HelloWorld}} example here.&lt;br /&gt;
&lt;br /&gt;
Make sure you have [[#Installing C/C++ and Java|Java installed on the SBC]].  To compile and run the {{Code|HelloWorld}} example:&lt;br /&gt;
&lt;br /&gt;
1. Open an [[#SSH|SSH terminal]] to the SBC&lt;br /&gt;
&lt;br /&gt;
2. Download the [{{SERVER}}/downloads/examples/JavaJNI.zip Phidget Java Examples] to the SBC, using [[#wget|wget]] (you may need to install {{Code|wget}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
3. Unpack the examples using [[#unzip|unzip]] (you may need to install {{Code|unzip}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
4. The location of {{Code|phidget21.jar}} on the SBC is {{Code|/usr/share/java/phidget21.jar}}.  Within the unzipped example directory, compile the {{Code|HelloWorld.java}} example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:/usr/share/java/phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. To run the {{Code|HelloWorld}} program, use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
java -classpath .:/usr/share/java/phidget21.jar HelloWorld&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, you&#039;ll probably want to learn to [[#Running a Program Automatically|run this Java program automatically]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; If you&#039;re used to using Linux with Phidgets already, you&#039;ll probably notice that you don&#039;t need to switch into root using {{Code|sudo}} on the SBC in order to run programs.  This is because you already are running as root, not because the [[OS - Linux#Setting udev Rules|udev rules are set up]].  So if you set up another user, or [[#Via Cron|run a cron job]] as anything other than root or system, you&#039;ll need to add permission for the Phidget program to run in your [[OS - Linux#Setting udev Rules|udev rules]].&lt;br /&gt;
&lt;br /&gt;
====Developing Code on the SBC====&lt;br /&gt;
&lt;br /&gt;
When you&#039;re not just using pre-written source code, and you&#039;re writing code actually on the SBC itself, you&#039;ll probably want to use [[#nano|nano]].  Other terminal editors on the SBC include {{Code|vi}} which is already installed, and {{Code|emacs}}, which you can install using [[#apt|apt]].  Both {{Code|vi}} and {{Code|emacs}} are much more efficient for the experienced user, but they contain modes and keyboard shortcuts that can seem strange or almost hindering to the casual user.&lt;br /&gt;
&lt;br /&gt;
Regardless of which editor you choose to use, some of your keyboard habits may not transfer well.  For example, in the Linux command line, the command {{Code|Ctrl-C}} means &#039;&#039;stop the currently running program&#039;&#039;, (i.e. your open editor) not copy.  Within most SSH terminals, you can copy and paste using the right-mouse button, and on some terminals (and all native Linux terminals) you can copy by simply highlighting text, and you can paste it using the middle (scroll) mouse button.  On the other hand, if you write a program that hangs on the command line, {{Code|Ctrl-C}} can actually be useful to terminate it.&lt;br /&gt;
&lt;br /&gt;
Also {{Code|Ctrl-Z}} does not mean &#039;&#039;undo&#039;&#039;, rather it means &#039;&#039;run the current program in the background&#039;&#039;.  This is useful because running a program in an SSH terminal simply hangs your SSH input until the program is done.  So typing {{Code|Ctrl-Z}} while the program is running frees up the command line for more input.  But if you accidentally hit {{Code|Ctrl-Z}} while running an editor like [[#nano|nano]], the editor will immediately exit to the command line.  Don&#039;t worry though, it will not stop or lose your work.  You can bring it back up by using the {{Code|fg}} (e.g. &#039;foreground&#039;) command, like {{Code|fg nano}}, and this will automatically bring your nano process back to the front.&lt;br /&gt;
&lt;br /&gt;
===Running a Program Automatically===&lt;br /&gt;
&lt;br /&gt;
For testing your program, you will certainly want to run it via [[#SSH|SSH]] or via the {{Code|Start}} button on the project page on the web interface until you are quite sure it runs well.  However, eventually you will probably want the program to run without your input, either [[#Via the Web Interface|continuously, and starting at boot]], or via a task scheduled to [[#Via Cron|run to completion at certain times]].&lt;br /&gt;
&lt;br /&gt;
Both have their advantages and disadvantages.  Usually, you would want to use the continuous, from-boot methods for event driven code that has to handle a wide variety of user input that could occur at any time.  You would want to use the scheduled method when the SBC needs to perform a repeated task (e.g. reading sensor data) again and again.  The main difference is:&lt;br /&gt;
* With the continuous (boot) method you can have any Phidgets (including sensors, LEDs, input switches, etc) attached and giving events to your code all the time, and&lt;br /&gt;
* With the scheduled (cron) method you have much less of a chance to run into long-term memory management and instability problems with any code you write, because your program runs for only a short time before exiting and getting cleaned up.&lt;br /&gt;
&lt;br /&gt;
====Via the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To use this method, you must have created the program you want to run as [[#Program in Java with the Web Interface | a Java or ARM-compiled C project in the web interface]].  If you would like to use another language, or another way of uploading your project, but you still want to start at boot and run continuously, you will need to use a [[#Via a Boot Script|boot script]].&lt;br /&gt;
&lt;br /&gt;
In the web interface, go to the {{Code|Projects}} tab, and click on the project you would like to run.  Near the bottom of the project page (the one with the {{Code|Start}} and {{Code|Stop}} buttons at the top), there will be a section called {{Code|Startup Settings}}.  You can see a screenshot of the whole project page, including these settings, in the [[#Program in Java with the Web Interface | web interface project section]].&lt;br /&gt;
&lt;br /&gt;
Select the {{Code|Enabled}} radio button.  The other defaults should be fine, unless you specifically know otherwise:&lt;br /&gt;
* For &#039;&#039;Boot Order&#039;&#039;, lower numbers boot first.  Booting later means more programs are available for use, booting earlier means other programs can use your program.  &lt;br /&gt;
* &#039;&#039;Run as a daemon&#039;&#039; starts the program as a daemon, which is a program that runs in the background.  Unless you have &#039;&#039;explicitly&#039;&#039; written your program as a daemon, leave this checked.  (If you don&#039;t know what a daemon is, don&#039;t worry, you haven&#039;t written one, so leave it checked.)  &#039;&#039;Un&#039;&#039;checking this when your program is a normal program will cause the SBC to hang while booting.&lt;br /&gt;
* The &#039;&#039;Executable or Class&#039;&#039; name should be automatically sensed to be your main Java class&lt;br /&gt;
* &#039;&#039;Arguments&#039;&#039; are any command line arguments you need, just as you would type them into the command line&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Your program must be very, very stable to run properly via the web interface.  Imagine your program running continuously for days, or months on end.  Any memory leaks, over time, will render your program (and the SBC) unusable until a reboot.  Counts or other variables that increase within your program and never reset may create a segmentation fault eventually.&lt;br /&gt;
&lt;br /&gt;
If, for stability purposes, you want your program to start, run for a little while, and then exit so that the SBC operating system can clean up the memory each time, you&#039;ll probably want to use [[#Via Cron|Cron]] to run your program instead.&lt;br /&gt;
&lt;br /&gt;
====Via Cron====&lt;br /&gt;
&lt;br /&gt;
Cron can automatically schedule programs - known as &#039;jobs&#039;, or &#039;cron jobs&#039; - at most once per minute.  Less often than that, it is very flexible, allowing you to run it on certain months, weekdays, hours, etc.  Cron simply reads a special file (your {{Code|crontab}}) and runs whatever programs are listed, with whatever timing they are listed with.  The cron program runs all the time in the background, making it what is known as a Linux &#039;&#039;daemon&#039;&#039;, but the programs it starts as jobs run only as long as they naturally would, and then they exit.&lt;br /&gt;
&lt;br /&gt;
If you need your program to run more often than once per minute, have the program schedule itself while still running.  For example, to run every five seconds, run a fast loop,  and sleep for five seconds. Do this twenty times and exit.  Then schedule this once per minute using cron, and your program will in essence run every five seconds.&lt;br /&gt;
&lt;br /&gt;
Setting up a cron job simply entails editing your {{Code|crontab}} file.&lt;br /&gt;
&lt;br /&gt;
First, you&#039;ll probably want to specify your default editor to be [[#nano|nano]]. Otherwise it will default to {{Code|vi}} and you&#039;ll have to figure out {{Code|vi}} in order to add lines to your crontab:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
export EDITOR=nano&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to edit your crontab file, simply type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
crontab -e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each line of the crontab file is one scheduled job.  Lines that start with a hash &amp;quot;#&amp;quot; are comments and are ignored.  There is an example line in the crontab, and a reminder line at the very end.  Essentially, each line should contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
minute hour dayOfMonth month dayOfWeek  command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*{{Code|command}} is the program you want to run (with absolute path, and arguments)&lt;br /&gt;
** For example, {{Code|./myprogram argument1}} won&#039;t work, but {{Code|/root/code/myprogram argument1}} will&lt;br /&gt;
* Each time argument is either a number, a list of numbers separated by commas, or an asterisk&lt;br /&gt;
** For example, * * * * * means every minute for all days and months, 0,30 * * * * means every thirty minutes (i.e. at the top of the hour and at 30 minutes in) for all days and months&lt;br /&gt;
&lt;br /&gt;
If you already have jobs scheduled, you&#039;ll see them in the file that comes up.  You can edit, add, or delete.  &lt;br /&gt;
&lt;br /&gt;
After you save, you&#039;ll see a little message back in the terminal that says the new crontab file was installed, and it is now scheduled!  Cron always starts every boot, and so if you have edited and installed your crontab as above, the scheduling of your program will start properly even after a reboot of the SBC.  However, if you are having strange scheduling problems, you may want to familiarize yourself with the [[#Software Details|software details]] of how the SBC as a whole determines the current date and time.&lt;br /&gt;
&lt;br /&gt;
=====My Cron Job Doesn&#039;t Work!=====&lt;br /&gt;
&lt;br /&gt;
It is actually very common for a script or program to work on the command line but then &#039;&#039;not&#039;&#039; work as a cron job.  The most common reason for this, by far, is that you specify &#039;&#039;relative&#039;&#039; paths in your program to access files rather than &#039;&#039;absolute&#039;&#039; paths.  For example:&lt;br /&gt;
* {{Code|code/project.c}} is a relative path (bad for cron)&lt;br /&gt;
* {{Code|/root/code/project.c}} is an absolute path (good for cron)&lt;br /&gt;
The cron jobs are &#039;&#039;not&#039;&#039; executed from your home directory, or your code directory, so they will not be using the same location you may be using to test your code.  So always use absolute paths.&lt;br /&gt;
&lt;br /&gt;
Another common reason is you may be using environment variables or other settings that are true in a terminal but are &#039;&#039;not&#039;&#039; true by default in the raw system.  You can end up taking many things for granted in a shell, for example the shortcut &amp;quot;~&amp;quot; means home directory in a shell, but not by default in the raw system.  The things that get loaded for a shell (but which are not present in the raw system) are:&lt;br /&gt;
* The settings loaded by {{Code|/etc/profile}}&lt;br /&gt;
* Any settings in {{Code|~/.bashrc}}, which is nothing by default on the SBC&lt;br /&gt;
&lt;br /&gt;
On a full Linux operating system, you would use the logs written to by cron to find the error output and debug it.  On the SBC, however, cron does not write logs (otherwise, these logs would eat up the SBC memory very quickly even for routine jobs).  For short-term debugging, you can write output from your program to a file, and read that file afterwards to figure out what your program is doing.&lt;br /&gt;
&lt;br /&gt;
====Via a Boot Script====&lt;br /&gt;
&lt;br /&gt;
If you want to run your program constantly and for it to start at boot like the [[#Via the Web Interface|web interface would do]], you can install your program into the boot order using a script.  This is a somewhat involved process, and you should be familiar with shell programming in Linux.  For this process, we only offer a [[OS - Linux#As A Service|similar example]] which installs and runs the program {{Code|phidgetwebservice21}} within the boot sequence.&lt;br /&gt;
&lt;br /&gt;
===Using USB Data Keys===&lt;br /&gt;
&lt;br /&gt;
After plugging the USB key in, it won&#039;t just appear on your desktop, so to speak, so you&#039;ll need to figure out where you can read and write to it within the SSH directory structure.&lt;br /&gt;
&lt;br /&gt;
The web interface program can help with this.  After you plug a USB key in, it will show up under {{Code|Status &amp;amp;rarr; System}}.  Or, the USB key and all other attached devices can be seen at {{Code|Status &amp;amp;rarr; USB}}:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_mounted_devices.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
In the screenshot above, you can see that the USB key is located in {{Code|/media/usb0}}.&lt;br /&gt;
&lt;br /&gt;
Alternately, you can use the SSH command {{Code|mount}}, and the searching program {{Code|grep}} which will filter the response of {{Code|mount}} and only return the lines with your search term ({{Code|usb}}):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep usb&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the USB key can be written to and read from using the {{Code|/media/usb0}} directory.  Copying a file to {{Code|/media/usb0}} will copy a file to the USB key.  The same goes for removing, renaming, opening files within your program, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Mount points like {{Code|/media/usb0}} should not be hard-coded into any of your programs.  (See the [[#Common Problems and Solutions | Common Problems and Solutions]] section for more information.)  If you need to obtain the mount point for a freshly mounted USB key within your code, have your code obtain the mount tables and search on the &#039;&#039;device&#039;&#039;  (e.g. {{Code|/dev/sda1}} or {{Code|/dev/sdb1}}) and obtain the corresponding mounted {{Code|/media/usbN}} location, where N is a number 0-9.&lt;br /&gt;
&lt;br /&gt;
===Saving and Retrieving Data===&lt;br /&gt;
&lt;br /&gt;
This section covers getting data on and off of the SBC.  There are two main methods of simply moving data on and off the SBC - via a [[#Via a USB Key|USB key]], and via [[#Over the Network (SCP)|copy over the network]] - and a third method for moving and installing data when it concerns [[#Backing Up Your Data|backing up lower level system data]].&lt;br /&gt;
&lt;br /&gt;
====Via a USB Key====&lt;br /&gt;
&lt;br /&gt;
After plugging in a USB data key, first you need to [[#Using USB Data Keys | find out the location]] where that data key was mounted.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the location of the USB key is {{Code|/media/usb0/}}, and we want to copy the file {{Code|data.txt}} to the USB key.  Your SSH session might look something like this, using [[#ls|ls]] and [[#mount|mount]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# ls&lt;br /&gt;
data.txt&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
root@phidgetsbc:~# cp data.txt /media/usb0/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cp&#039;&#039;&#039; program copies data from a source to a destination.  The syntax is {{Code|cp from to}}, where here we are copying from {{Code|data.txt}} to {{Code|/media/usb0/}}.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caution:&#039;&#039;&#039; Even if there is no USB key mounted at {{Code|/media/usb0/}}, this use of {{Code|cp}} will still work &#039;&#039;with no errors&#039;&#039;!  This is because there is still a file called {{Code|/media/usb0/}}, there is just no USB key file system &#039;&#039;mounted&#039;&#039; to that point.  So be sure to run [[#mount|mount]] or use some other method of determining that there is, in fact, a USB data key attached and where it is mounted to.&lt;br /&gt;
&lt;br /&gt;
====Over the Network (SCP)====&lt;br /&gt;
&lt;br /&gt;
SCP is a command line program already installed on Linux and Mac OS, and downloadable for free on Windows.  We discuss it and give examples in the [[#SSH|SSH]] section, but remember it here when you&#039;re trying to get data on and off of the SBC.  With SSH or a terminal already open, you&#039;ll probably find it to be much faster and easier than dealing with a USB key.&lt;br /&gt;
&lt;br /&gt;
====Backing Up Your Data====&lt;br /&gt;
&lt;br /&gt;
For the web interface, you can save and restore all web interface settings under the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} tab.&lt;br /&gt;
&lt;br /&gt;
To save the settings of what packages are installed for later re-installation, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg --get-selections &amp;gt; installedPrograms.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then save the file {{Code|installedPrograms.txt}} externally.  If you have to completely wipe the SBC, you can just reinstall the whole list by moving the {{Code|installedPrograms.txt}} file back onto the SBC, and then typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg –set-selections &amp;lt; installedPrograms.txt&lt;br /&gt;
apt-get dselect-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also remember to externally save:&lt;br /&gt;
* Your {{Code|~/.bashrc}} settings file if you&#039;ve changed it&lt;br /&gt;
* Your {{Code|crontab}} file if [[#Via Cron|you&#039;ve edited it]]&lt;br /&gt;
* Any data files or code you&#039;ve created&lt;br /&gt;
&lt;br /&gt;
It is important to save these settings often, and at points where you know the system is running well.  It may be tempting to create a backup right before you [[#Recovery System|wipe the SBC and start from scratch]], but often the reason you are having problems then is some setting or change, and backing these up and reinstalling them will only reinstall the problem.&lt;br /&gt;
&lt;br /&gt;
To truly back the files up, you must copy them to an external computer or location using either a [[#Via a USB Key|USB Key]] or [[#Over the Network (SCP) | over the network]].  Then they can be copied back if needed later.&lt;br /&gt;
&lt;br /&gt;
If you are looking to restore data on an SBC that will not boot properly, you&#039;ll want to be in the [[#Partial Recovery|partial recovery]] portion of our Troubleshooting section.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
The SBC can be quite tricky to debug, because it is a complex and flexible computer.  Common problems and solutions include:&lt;br /&gt;
* You can&#039;t find the SBC on the network at all - refer to the [[#Initial Internet Setup|Initial Internet Setup]] section&lt;br /&gt;
* You have changed some setting or file such that the SBC doesn&#039;t run anymore, or doesn&#039;t run as expected - refer to the [[#Recovery|Recovery]] section&lt;br /&gt;
&lt;br /&gt;
If you are having trouble using Phidgets on the SBC, you should go through the [[OS - Linux#Troubleshooting | Troubleshooting section on the general Linux page]].  Some of the problems on the Linux page (such as library problems) are easier to fix by simply working through the [[#Recovery|Recovery]] section when they occur on the SBC.&lt;br /&gt;
&lt;br /&gt;
Namely, it often helps to simply perform a [[#Factory Reset|factory reset]] on the SBC (save your files and installed program list first, as [[#Backing Up Your Data|described here]]).  Sometimes you change a file or setting within the operating system when you are trying to get something up and running, and this unintentionally affects other programs too.  Performing a factory reset starts you with a clean slate.&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, or the information within this guide, please [[Contact Us|ask us]]!&lt;br /&gt;
&lt;br /&gt;
===Initial Internet Setup===&lt;br /&gt;
&lt;br /&gt;
To set up the SBC, you almost always need a &#039;&#039;wired&#039;&#039; Ethernet connection with DHCP (Dynamic Host Configuration Protocol), and without a firewall.  This connection should be to a &#039;&#039;router&#039;&#039;, not directly plugged in to your computer.&lt;br /&gt;
&lt;br /&gt;
Even if you do not have this type of a connection at home, these types of connections are very common at both offices and universities.  On a Windows or Mac OS computer, you can bring up the [[Phidget Control Panel]] as described in the SBC&#039;s [[1072 User Guide#Getting Started|Getting Started Page]].  Failing this, or on a Linux computer, we discuss some alternate setup methods in this section.  Keep in mind that without a wired, open DHCP connection these setup methods can be difficult and fickle. &lt;br /&gt;
&lt;br /&gt;
====No Wired-Only Connection====&lt;br /&gt;
&lt;br /&gt;
Sometimes it can work to plug the SBC, using Ethernet, directly into an Ethernet port on your home wireless router.  Do not plug it directly into your computer!  (Although in some instances, a direct connection can be made to work on Linux, see the [[#No DHCP|No DHCP]] section below) &lt;br /&gt;
&lt;br /&gt;
This direct-router method is a very picky process, however, and can fail because:&lt;br /&gt;
* Some home and office routers place a firewall between wireless connections (clients) and wired connections (the local area network)&lt;br /&gt;
* Some home and office routers do not by default allow both Ethernet DHCP and wireless DHCP.&lt;br /&gt;
* Some routers and DHCP hubs only provide access to an internet connection, and do not provide local area network inter-connections (this is common on mobile device tethering hubs)&lt;br /&gt;
&lt;br /&gt;
Routers are quite complex, and even with admin privileges it can be a painstaking process to find all the right firewall settings to turn off in order to allow two computers on the network to talk to one another, rather than just connect to the internet.  This is why university or office networks are often ideal for the purpose of setting up the SBC, because these institutions depend on computers on a local network being able to talk together.  University libraries in particular can be a good source of wired DHCP connection ports.  &lt;br /&gt;
&lt;br /&gt;
Covering all of the different router configuration possibilities here, and how to change them to make the SBC work, is essentially impossible.  If you try using the SBC at home or at work, the SBC does not work on the first try when plugged directly into the router via Ethernet, and you want to make that connection work rather than seeking out an alternate for the initial setup, you should find documentation specific to your router (usually available online) and properly configure it.&lt;br /&gt;
&lt;br /&gt;
The good news is that if you can find an Ethernet DHCP connection &#039;&#039;just once&#039;&#039; for a short time, you can use that connection to configure the SBC to work on your home wireless network.  During that initial connection, you can enable wireless and set up as many wireless DHCP connections (with passwords) that you need.  Once wireless is enabled and set up, you can take the SBC home to your wireless router and the SBC will automatically seek out and connect to its remembered networks as they appear.  At that point, you can also use wireless like a normal internet, web interface, and SSH connection.&lt;br /&gt;
&lt;br /&gt;
====No Link Local Addressing====&lt;br /&gt;
&lt;br /&gt;
If you have a wired DHCP connection, no firewall, and no link local addressing (e.g. bonjour or avahi is not installed) then you will need access to the DHCP router logs.  From the router logs, you should see the connection (or attempted connection) by the SBC within the logs.  From that log entry, you should either be able to determine the IP address for the SBC, or see what happens when the router blocks access.  The IP address can be used in place of the link local address for both the web interface and for SSH.&lt;br /&gt;
&lt;br /&gt;
====No DHCP====&lt;br /&gt;
&lt;br /&gt;
The SBC will first try to use DHCP, but then it will revert to responding to a link local address under bonjour and avahi.  If you are depending on this, please wait &#039;&#039;&#039;at least three minutes&#039;&#039;&#039; after the SBC boots for the SBC to fail in obtaining a DHCP connection and properly revert to link local addressing.&lt;br /&gt;
&lt;br /&gt;
If you have a static IP setup, and want to use link local addressing rather than accessing the router logs, this should usually work by default on Windows and Mac OS (e.g. type the address such as {{Code|phidgetsbc.local}} into a web browser).  If it doesn&#039;t work automatically, there is not much you can do and you should seek out a wired DHCP connection elsewhere.&lt;br /&gt;
&lt;br /&gt;
On Linux, it also should work by default, but you have the additional option of explicitly adding routes that look within the default network settings for the SBC.  From a terminal (as root), type:&lt;br /&gt;
* {{Code|route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0 metric 99}}&lt;br /&gt;
* {{Code|route add default dev eth0 metric 99}}&lt;br /&gt;
You can also compile and use the {{Code|phidgetsbclist.c}} example (use the provided Makefile, don&#039;t use gcc) in the [{{SERVER}}/downloads/libraries/libphidget.tar.gz Phidget Linux Libraries] package, under the {{Code|examples}} folder.  This will allow you to see if the SBC is detected on the network at all.   Note that to use this option you must have the Phidget Libraries and the Phidget WebService installed on your Linux computer - in-depth instructions to do this are on the [[OS - Linux|main Linux page]].&lt;br /&gt;
&lt;br /&gt;
===Recovery System===&lt;br /&gt;
&lt;br /&gt;
You can either boot the SBC into recovery mode and attempt to recover files and settings, or you can completely wipe the SBC by performing a factory reset.  If the LEDs do not turn on normally (red on constantly, green on at first start, then off, then on when fully booted) then you&#039;ll want to read the [[#Hardware Issues|hardware issues]] section.&lt;br /&gt;
&lt;br /&gt;
====Partial Recovery====&lt;br /&gt;
&lt;br /&gt;
The recovery system can be entered in two ways:&lt;br /&gt;
# From the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} web interface page.&lt;br /&gt;
# By holding down the reset button for 20+ seconds - until the green light has switched from flashing slowly to flashing quickly.&lt;br /&gt;
&lt;br /&gt;
The recovery system runs an [[#SSH|SSH]] server where the username and password both are {{Code|root}}.&lt;br /&gt;
&lt;br /&gt;
If the main filesystem has been damaged/misconfigured in such a way that it won’t boot, you may be able to fix the issue or recover important files before running a full factory reset. From an SSH connection to the recovery system, you can mount the main root filesystem with the following commands (assuming it’s not damaged):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
ubiattach /dev/ubi_ctrl -m 6&lt;br /&gt;
mount -t ubifs /dev/ubi0_0 /mnt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Factory Reset====&lt;br /&gt;
&lt;br /&gt;
This restores the kernel and root filesystem from backup, overwriting any changes that may have been made and &#039;&#039;completely wiping the system&#039;&#039; to the state that it got shipped in. (You can save your files and installed program list first, as [[#Backing Up Your Data|described here]].)  This can be enacted one of two ways.&lt;br /&gt;
# Use the reset button:&lt;br /&gt;
##Enter the recovery mode by holding down the reset button for 20+ seconds as above (until fast flashing)&lt;br /&gt;
##Wait for a full boot (i.e. you can see it on the [[Phidget Control Panel]], or can SSH with username and password as {{Code|root}})&lt;br /&gt;
##Hold down the reset button again, but this time for only 10 seconds (until slow flashing)&lt;br /&gt;
##Wait for the SBC to fully reset and reboot (at least three minutes) - the LED will turn off and on again when this occurs&lt;br /&gt;
##*Note that after a factory reboot the SSH server will be disabled&lt;br /&gt;
##*Also note that after a factory reboot the SBC creates new SSH keys, and reverts to the {{Code|phidgetsbc.local}} address&lt;br /&gt;
# Via the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, where you can follow the instructions&lt;br /&gt;
&lt;br /&gt;
====Hardware Issues====&lt;br /&gt;
&lt;br /&gt;
The LEDs are an indicator of the hardware working properly.  The normal boot process is:&lt;br /&gt;
* Red LED: Turns on from moment of power being applied.&lt;br /&gt;
* Green LED: Turns on momentarily when power applied, then turns off momentarily, then turns on and stays on when booted.&lt;br /&gt;
&lt;br /&gt;
If the green status LED never turns on (or fails to turn on the second time), the boot process is failing somewhere.  This could be due to:&lt;br /&gt;
* A damaged OS - Try performing a [[#Factory Reset|Factory Reset]]&lt;br /&gt;
* If this fails, it is likely hardware damage (very difficult to diagnose, please [[Contact Us|contact us]])&lt;br /&gt;
&lt;br /&gt;
If neither LED turns on, hardware damage is even more likely.  Unless the path to the red LED is the one thing that has been damaged, the device is likely not receiving and using power.&lt;br /&gt;
* Try performing a [[#Factory Reset|Factory Reset]], and if that does not work please [[Contact Us|contact us]]&lt;br /&gt;
&lt;br /&gt;
=====USB Issues=====&lt;br /&gt;
&lt;br /&gt;
On the Phidget SBC2, there is a hardware issue that is unrelated to the LEDs.  It is a USB problem, and manifests in many ways:&lt;br /&gt;
* Strange behaviour when some devices but not others are plugged in to the SBC&lt;br /&gt;
* Strange behaviour with combinations of devices&lt;br /&gt;
* Failure (or intermittent failure) to see Phidgets on the USB hub, or USB keys on the hub&lt;br /&gt;
&lt;br /&gt;
This problem is fixable, either on your own or by sending your SBC back to Phidgets.  For an in-depth solution, see the [[SBC2_USB_Hub_Fix | SBC2 Hub Fix Page]].&lt;br /&gt;
&lt;br /&gt;
===Updating Your SBC===&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve owned your SBC for a while and want to update your packages, you can run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...to &#039;&#039;update&#039;&#039; your software source list and then &#039;&#039;upgrade&#039;&#039; to the latest version of all installed software.  If you are used to Mac OS or Windows, note that this does not just update the non-kernel parts of the operating system, it updates every additional piece of software you have installed.&lt;br /&gt;
&lt;br /&gt;
To update the SBC software itself (e.g. the kernel), it is easiest to use the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, to enter a page that will give you the option to update.  You will need to have an update file on a USB key inserted into the SBC, of type:&lt;br /&gt;
* UBI Image (system_ubi.img), or &lt;br /&gt;
* Kernel image (uImage), or&lt;br /&gt;
* Phidget Upgrade package containing both UBI and Kernel images (phidgetsbc*.bin)&lt;br /&gt;
&lt;br /&gt;
These are either obtained from the Phidgets website, or are a custom kernel / filesystem that you can create yourself, if you are experienced.&lt;br /&gt;
&lt;br /&gt;
The reason why this information is in troubleshooting is that you should certainly [[#Backing Up Your Data|back up your system]] before trying this.  And, it is quite rare to need to upgrade the kernel or filesystem on the SBC, so something serious should be going on before you attempt it.  Try using the [[#Recovery System|recovery system]] first.&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
Now that you have the basic libraries installed, you can pick your language and begin programming!  &lt;br /&gt;
&lt;br /&gt;
If you are not using the [[#WebService | webservice]] to control a Phidget over a network, your next step will be to delve into the use of your specific language.  Each page has its own set of specific libraries, code examples, and setup instructions.  &lt;br /&gt;
&lt;br /&gt;
On SBC Linux, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Java | Java]]&lt;br /&gt;
*[[Language - Python | Python]]&lt;br /&gt;
&lt;br /&gt;
These languages may also run on the SBC, but we do not yet directly offer SBC support for them:&lt;br /&gt;
* [[Language - Ruby|Ruby]]&lt;br /&gt;
* [[Language - C Sharp|C#]] (using Mono)&lt;br /&gt;
&lt;br /&gt;
You can probably figure out how to install and use them by a combination of the language pages linked above, and the section on [[#Installing Other Languages|installing other languages on the SBC]].&lt;br /&gt;
&lt;br /&gt;
==WebService==&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the [[Phidget WebService]] installed, and the SBC automatically starts the WebService at boot.&lt;br /&gt;
&lt;br /&gt;
To practice using the WebService, and to learn more about it, we have hands-on examples on the [[OS - Linux|general Linux page]], starting in the [[OS - Linux#Using the WebService|using the WebService section]].&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Shutting off USB ports to save power===&lt;br /&gt;
The SBC3 has an on-board USB hub that can control power to the ports. To do this unbind and rebind the USB drivers.&lt;br /&gt;
&lt;br /&gt;
To turn off the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/unbind}}&lt;br /&gt;
&lt;br /&gt;
To turn on the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/bind}}&lt;br /&gt;
&lt;br /&gt;
These will also cause detach and attach events for the Phidget devices, respectively. While the drivers are unbound, you will not get any hot plug events for any devices on USB.&lt;br /&gt;
&lt;br /&gt;
===Using a Touchscreen===&lt;br /&gt;
Please note that this will ONLY work with an SBC3 since it has a USB 2.0 hub:&lt;br /&gt;
&lt;br /&gt;
Using a touchscreen with the SBC is a great way to get user input and visual feedback from an SBC otherwise devoid of visual output.  The SBC does not have any conventional display ports such as VGA, DVI, or HDMI but it does have a number of USB ports and USB displays do exist.  With the upgrade to a USB 2.0 hub on the SBC3 from the earlier models which had USB 1 hubs the SBC now has enough capability to operate a screen over USB.  We don&#039;t recommend running a standard desktop environment since the processor is too slow to really keep up with a typical desktop it does make for an excellent interface for a kiosk, instrumentation control panel or  other, similar use case.  This document is going to go through the process of enabling support for a typical USB display as well as installing a fairly compact desktop environment called xfce on the SBC.  &lt;br /&gt;
&lt;br /&gt;
The screen I will be using is from a company called [http://lilliputweb.net/ Lilliput].  Specifically a UM-70 model.  Before you begin, please make sure that you have the screen plugged into the SBC, it will also be useful to have a spare USB keyboard and mouse handy as you will need them once you are no longer using an SSH terminal to communicate with the SBC.&lt;br /&gt;
&lt;br /&gt;
[[File:lilliputoff.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Getting the display to function====&lt;br /&gt;
Begin by logging into the web configuration page for your SBC and upgrading all of the packages on the SBC.  Be sure to include the full Debian package repository.  For more information on how to do this refer to the  [[OS - Phidget SBC#Getting Started - External Computer|getting started]] section of the Phidget SBC documentation.  Once you are fully up to date open an SSH session with the SBC and navigate to the &amp;quot;/etc&amp;quot; folder.  Open inittab with a terminal-based text editor such as nano and add the following to the bottom of the file, just above the {{code|T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100}} line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
1:2345:respawn:/sbin/getty 38400 tty1 &lt;br /&gt;
2:23:respawn:/sbin/getty 38400 tty2 &lt;br /&gt;
3:23:respawn:/sbin/getty 38400 tty3 &lt;br /&gt;
4:23:respawn:/sbin/getty 38400 tty4 &lt;br /&gt;
5:23:respawn:/sbin/getty 38400 tty5 &lt;br /&gt;
6:23:respawn:/sbin/getty 38400 tty6 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reboot your system.  After a few minutes you should see the LCD screen come up with a standard Linux terminal interface and a login prompt.  This is all well and good but this isn&#039;t really appreciably better than simply using an SSH session to communicate with the SBC.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputlogin.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Setting up Xfce====&lt;br /&gt;
In order to get a traditional windowing environment we still need to install a desktop manager as well as a number of supporting packages.  Log in and make sure everything is still up to date with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install the following packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xserver-xorg lxde xfce4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the SBC asks you if you want to continue, just type &amp;quot;Y&amp;quot; and press enter.  &lt;br /&gt;
&lt;br /&gt;
This will install the xfce desktop environment and any other necessary programs on the SBC.  When it&#039;s done, restart the SBC.  When it boots back up it should boot directly to a login screen instead of the terminal interface.  Log in, and you are good to go.  It won&#039;t be particularly fast, but don&#039;t worry, the SBC does not have a dedicated video processor on it so it&#039;s perfectly normal for it to be slow.  What&#039;s important is that it works.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputdesktop.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Calibrating the touch screen====&lt;br /&gt;
Unfortunately, by default the screen is calibrated to believe the bottom of the screen is on the right hand side.  This has the effect of making the touch functionality more or less useless until it has been properly calibrated.  To do this, install the following package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xinput-calibrator&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now use xinput calibrator to measure the parameters of your screen.  Launch xinput calibrator (called Calibrate Touchscreen in the programs menu) and follow the instructions on the screen.  The screen should now be functioning at full potential.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Using a Different Wireless Adapter===&lt;br /&gt;
&lt;br /&gt;
The support for the wireless adaptor that Phidgets sells is written into the SBC kernel.  Hence, we do not support using other adaptors. &lt;br /&gt;
&lt;br /&gt;
However, Linux is very flexible, and it is possible (though not easy) to write a custom kernel for the SBC and add support for a new wireless adaptor.  We can&#039;t help you with this, but we do provide some basic guidelines for [[#Custom Kernel and Filesystem|building your own kernel]].  You can also have a look at our thoughts on our own experience with choosing a Wifi adapter: [[Alternative Wi-Fi Adapters on the SBC]].&lt;br /&gt;
&lt;br /&gt;
===Using a Different Webcam===&lt;br /&gt;
&lt;br /&gt;
In addition to the webcam that Phidgets sells, you have the option to use many different webcams with the SBC.  There is a [http://www.ideasonboard.org/uvc/#devices long list] of compatible webcams.&lt;br /&gt;
&lt;br /&gt;
The common thread for these webcams is that they use UVC - the USB Video Class - drivers for Linux.  You can then use [[#mount|mount]] to find out what video device your webcam is mounted under.&lt;br /&gt;
&lt;br /&gt;
===Taking Pictures With the Webcam===&lt;br /&gt;
&lt;br /&gt;
Probably the most straightforward way to use a webcam for pictures rather than video is to use the {{Code|opencv}} library.  You can get it by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libcv2.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there is no {{Code|libcv2.1}} package, you can perform {{Code|apt-cache search libcv}} to find the current version.&lt;br /&gt;
&lt;br /&gt;
The opencv libraries can also be used within Python, by installing the link between them:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python-opencv&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then taking pictures from within code becomes quite simple.  For example, in Python, taking and saving an image is four lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
#! /usr/bin/python&lt;br /&gt;
&lt;br /&gt;
import cv&lt;br /&gt;
&lt;br /&gt;
# The webcam is located at /dev/video0 &lt;br /&gt;
# OpenCV only needs the number after video&lt;br /&gt;
webcam = cv.CaptureFromCAM(0)&lt;br /&gt;
&lt;br /&gt;
frame = cv.QueryFrame(webcam)&lt;br /&gt;
&lt;br /&gt;
cv.SaveImage(&amp;quot;image.jpg&amp;quot;, frame)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the complete OpenCV documentation, see [http://opencv.willowgarage.com/documentation/index.html The OpenCV Reference], and specifically the section on [http://opencv.willowgarage.com/documentation/reading_and_writing_images_and_video.html Reading and Writing Images].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The SBC is probably not as powerful for image processing and transport when compared to your desktop computer.  Try running your image processing code on the SBC from an early point in development.  During those test runs, you can visit the first System page of the [[#SBC Web Interface|SBC Web Interface]] to check the processor and memory use.  For more information on processor power, check the specification for your SBC (on the product page on [{{SERVER}} our main website]) as well as our discussion of [[#Pushing Processor Limits|pushing processor limits]] below.&lt;br /&gt;
&lt;br /&gt;
===Checking System Logs===&lt;br /&gt;
&lt;br /&gt;
The SBC maintains two logs: a kernel log and a system log.  &lt;br /&gt;
&lt;br /&gt;
The kernel log is for low-level occurrences, such as devices attaching and leaving the USB hub, recording what drivers are being used, and so on.&lt;br /&gt;
&lt;br /&gt;
The system log (syslog) is for normal chatter from the operating system.  Any program with the right permissions can use it (though you need to know the method to write to it, information all around the Internet can help) and it contains everything from the Ethernet going up and down, to webserver requests, and so on.  If you don&#039;t run many programs or services on the SBC, the syslog will essentially be a mirror of the kernel log, because the kernel is the only thing talking.&lt;br /&gt;
&lt;br /&gt;
You can check these logs by using the web interface in the {{Code|System &amp;amp;rarr; Logs}} tab.&lt;br /&gt;
&lt;br /&gt;
Or you can perform more powerful filtering and displaying via an SSH terminal.  For example, {{Code|dmesg}} is the command to display the kernel log, and {{Code|tail}} prints the last ten lines of input.  So, if you are trying to see if you can get a device to be detected on USB, you can run &amp;lt;code&amp;gt;dmesg | tail&amp;lt;/code&amp;gt; to print the latest ten lines of kernel log data.&lt;br /&gt;
&lt;br /&gt;
The actual locations of the log files (for filtering and reading) are:&lt;br /&gt;
* {{Code|/var/log/syslog}} &lt;br /&gt;
* {{Code|/var/log/dmesg}}&lt;br /&gt;
But don&#039;t edit them directly!  Always follow the advice and procedures around the Internet on how to properly log items to syslog.&lt;br /&gt;
&lt;br /&gt;
===X Forwarding===&lt;br /&gt;
&lt;br /&gt;
Although most tasks can be done using the [[#SBC Web Interface|SBC Web Interface]] or [[#SSH|SSH]], you can also set up X11 forwarding on the SBC.  X11 is the window manager base, which provides a graphical windowing system on the SBC.  Although you probably won&#039;t connect directly to the X11 manager (i.e. by plugging a screen directly into the SBC), X11 also gives a user the ability to forward graphical windows over SSH.  You will need the following packages installed:&lt;br /&gt;
* {{Code|x11-common}}&lt;br /&gt;
* {{Code|xbase-clients}}&lt;br /&gt;
After installing, make sure that the line in {{Code|/etc/ssh/sshd_config}} has a line that says:&lt;br /&gt;
:{{Code|X11Forwarding yes}}&lt;br /&gt;
Then log out and log back into the SBC.  This second time you log in, use the {{Code|-X}} switch to turn on X forwarding for that connection:&lt;br /&gt;
:{{Code|ssh -X root@phidgetsbc.local}}&lt;br /&gt;
Then you should be able to run programs that launch a window, and it will launch remotely and appear on the computer you have the SSH connection from.&lt;br /&gt;
&lt;br /&gt;
===Pushing Processor Limits===&lt;br /&gt;
&lt;br /&gt;
The SBC, though more powerful than many embedded computers out there, is probably about as powerful as your smartphone.  If you hook up 1 ms Phidget sampling devices to all six of its USB ports, events and packets will probably get lost.  The exact data rates you can accomplish depend on:&lt;br /&gt;
* What else is running on the SBC&lt;br /&gt;
* How efficient your code is for external operations (like File I/O)&lt;br /&gt;
* Other minor details (e.g. the temperature of the SBC, etc)&lt;br /&gt;
&lt;br /&gt;
If you want to achieve data rates as fast as possible, try these tips:&lt;br /&gt;
* Program in C, not in an interpreted language (Python, Java, .NET)&lt;br /&gt;
* Perform file I/O as little as possible.  Locally cache data, manage your writing to a file in a separate thread, and use low-level write calls.&lt;br /&gt;
* Change the [[#Custom Kernel and Filesystem|filesystem]] to a faster, non-compressed file system.&lt;br /&gt;
** Alternatively, use a high-data-rate USB key.&lt;br /&gt;
* Keep other running processes to a minimum. &lt;br /&gt;
** If you are running code locally right on the SBC, turn off the Phidget WebService.&lt;br /&gt;
&lt;br /&gt;
===Custom Kernel and Filesystem===&lt;br /&gt;
&lt;br /&gt;
You can compile your own kernel and flash it to the board. It is left up to the user to configure an appropriate cross-compiler for kernel development. You may also be able to compile a new kernel on-board.  We have a kernel development kit, complete with patch file and README:&lt;br /&gt;
* [{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Compiling a new, custom kernel is somewhat complex.  If the SBC is your first experience with Linux, writing a custom kernel will be difficult.  However, it will probably also be very rewarding because you can put whatever you like into it.  We might be able to offer additional suggestions, but ultimately you&#039;re on your own here. &lt;br /&gt;
&lt;br /&gt;
You may be able to write a custom kernel right on the SBC, but the easiest way is to develop the kernel on an external computer.  And the easiest way to develop on an external computer is for that computer to also be Linux, even just in a Virtual Machine.  The time spent loading a copy of Linux into a virtual machine (such as VirtualBox, which is free) onto your computer will probably be less time than setting up a standard compiler on Windows to cross-compile.&lt;br /&gt;
&lt;br /&gt;
On your external Linux system, you will need:&lt;br /&gt;
* A cross-compiling toolchain for the ARM processor, which we briefly describe on the [[OS - Linux#Cross-Compiling with a Custom Toolchain | main Linux page]], and &lt;br /&gt;
* The [{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package] from the Phidgets website.  &lt;br /&gt;
The kernel development kit has a brief README file which describes how to obtain the proper kernel and patch, configure, customize, and build it.&lt;br /&gt;
&lt;br /&gt;
We have an application guide in progress, which walks through building a custom kernel to add Bluetooth support to the SBC.  Please contact us if you would like more information.  Even if you are trying to add support for hardware other than a bluetooth modem, or wondering if support even exists in the kernel for your modem (3G, alternate wireless, etc) you will probably find the application guide helpful.  Follow it up to the point where you run the program {{Code|menuconfig}} (you don&#039;t need an SBC to do this), which will give you a menu of all drivers you can enable in the SBC kernel.&lt;br /&gt;
&lt;br /&gt;
After making your new kernel, you should have a uImage and modules target for your Makefile.  At this point you can transfer your kernel files onto the SBC, make their targets, and transfer them into the nand memory.  This involves erasing the old kernel, flashing the new kernel, installing the new kernel modules, and rebooting.  From the SBC, in the kernel directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
make uImage; make modules&lt;br /&gt;
flash-eraseall /dev/mtd3&lt;br /&gt;
nandwrite -p /dev/mtd3 arch/arm/boot/uImage&lt;br /&gt;
make modules-install&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Custom kernels can also be flashed from the [[#Recovery System | Recovery System]].&lt;br /&gt;
&lt;br /&gt;
If you need to create a root filesystem image, the filesystem type is UBIFS, and the commands to create it are:&lt;br /&gt;
&lt;br /&gt;
====For SBC2:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====For SBC3:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You then flash ‘system_ubi.img’ (not ‘system_ubifs.img’) from the recovery system.&lt;br /&gt;
&lt;br /&gt;
Again, like the custom kernel creation, the need to create a custom root filesystem is essentially non-existent except for those advanced users who already know they need it... and furthermore, you are almost entirely on your own.&lt;br /&gt;
&lt;br /&gt;
===Saving a file system to flash to multiple SBC&#039;s===&lt;br /&gt;
You may want to create a complete backup of your SBC root filesystem, which can then be flashed to other SBCs. This is how it could be done:&lt;br /&gt;
&lt;br /&gt;
You will need a USB drive - we have had issues using cheap flash drives, so a real USB drive is recommended. Make sure it&#039;s empty, as it will be reformatted.&lt;br /&gt;
&lt;br /&gt;
All of these commands are executed on your SBC, while logged in over SSH.&lt;br /&gt;
&lt;br /&gt;
First, re-format the USB drive as ext3. Assuming the USB drive is sda and has a single partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
mkfs.ext3 /dev/sda1&lt;br /&gt;
mount -t ext3 /dev/sda1 /media/usb0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remount / as readonly, so it doesn&#039;t change as we&#039;re copying it. To do this, we need to kill all running processes except sshd:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
service udev stop&lt;br /&gt;
service ifplugd stop&lt;br /&gt;
service rsyslog stop&lt;br /&gt;
service avahi-daemon stop&lt;br /&gt;
service phidgetwebservice stop&lt;br /&gt;
service ntp stop&lt;br /&gt;
service busybox-httpd stop&lt;br /&gt;
service dbus stop&lt;br /&gt;
service cron stop&lt;br /&gt;
pkill dhclient&lt;br /&gt;
mount -o remount,ro /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the remount says that / is busy, do a &#039;ps auxww&#039; and &#039;pkill&#039; anything else that may be running until it remounts properly.&lt;br /&gt;
&lt;br /&gt;
Then, copy / to the flash drive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkdir /media/usb0/root&lt;br /&gt;
mount --bind / /mnt/&lt;br /&gt;
cp -a /mnt/* /media/usb0/root/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, clean up the copy - removing files specific to this board. We also remove the APT cache to save space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
find /media/usb0/root/var/log -type f -print0 | xargs -0 rm -f&lt;br /&gt;
rm -rf /media/usb0/root/var/lib/apt/lists/*&lt;br /&gt;
mkdir /media/usb0/root/var/lib/apt/lists/partial&lt;br /&gt;
rm -f /media/usb0/root/var/cache/apt/*.bin&lt;br /&gt;
rm /media/usb0/root/etc/udev/rules.d/70-persistent-net.rules&lt;br /&gt;
rm /media/usb0/root/etc/ssh/ssh_host_*&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
then, create the ubinize.cfg file:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi	&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs0&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi		&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
vol_flags=autoresize	&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: you may need to increase vol_size if your filesystem is larger.&lt;br /&gt;
&lt;br /&gt;
then, create the UBI image from the copy:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then, unmount the drive to ensure everything is written out properly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you can remove the /root/ folder and system_ubifs.img. system_ubi.img can be flashed to other SBCs using the recovery system.&lt;br /&gt;
&lt;br /&gt;
==Software Details==&lt;br /&gt;
&lt;br /&gt;
For even more advanced uses of the SBC, it may help to know the gritty details of the SBC software system.&lt;br /&gt;
&lt;br /&gt;
;Operating System&lt;br /&gt;
:Debian/GNU Linux&lt;br /&gt;
:Kernel 2.6.X or higher (generally kept up to date with latest releases, use {{Code|uname -r}} to check the kernel version)&lt;br /&gt;
&lt;br /&gt;
;Main Filesystem (rootfs)&lt;br /&gt;
:UBIFS (a raw flash type of file system)&lt;br /&gt;
:Mounted in a 460 MB Nand partition (in Read/Write mode)&lt;br /&gt;
&lt;br /&gt;
;Kernel&lt;br /&gt;
:uImage format&lt;br /&gt;
:Has its own 3MiB partition on bare Nand&lt;br /&gt;
&lt;br /&gt;
;Web Interface Scripts and Configuration Data&lt;br /&gt;
:Located in {{Code|/etc/webif}}&lt;br /&gt;
:Modifying these scripts can be done; however, it is very easy to enter invalid data that could cause the system to behave unexpectedly or not boot.&lt;br /&gt;
&lt;br /&gt;
;User Applications uploaded through Web Interface&lt;br /&gt;
:Located in {{Code|/usr/userapps}}&lt;br /&gt;
&lt;br /&gt;
;Webcam Device Location&lt;br /&gt;
:{{Code|/dev/video0}}&lt;br /&gt;
:Numbers increase with more webcams&lt;br /&gt;
&lt;br /&gt;
;Date and Time&lt;br /&gt;
:Set using ntp (network time protocol) at boot&lt;br /&gt;
:The ntp daemon continues to run in the background and will periodically update the clock &lt;br /&gt;
:The network keeps the SBC very close to real time&lt;br /&gt;
:Also there is a real-time clock with battery backup which will preserve date/time across reboots, power removal&lt;br /&gt;
:The real-time clock is synced to system time during reboot/shutdown&lt;br /&gt;
:If power is unplugged suddenly, and the network not restored, the real-time clock may not have the correct time&lt;br /&gt;
&lt;br /&gt;
;Wireless Networking System&lt;br /&gt;
:Wireless adapter support for the wireless adapter that Phidgets sells is written into the kernel&lt;br /&gt;
:It supports WEP and WPA&lt;br /&gt;
:It is best configured through the configuration interface.&lt;br /&gt;
&lt;br /&gt;
;Nand Layout&lt;br /&gt;
:The board contains 512MiB on Nand. This nand is split into 7 partitions as follows:&lt;br /&gt;
:0: u-boot		 size: 256K		 Read Only&lt;br /&gt;
:1: u-boot_env		 size: 128K		 Read Only&lt;br /&gt;
:2: recovery_kernel	 size: 2M		 Read Only&lt;br /&gt;
:3: kernel		 size: 3M		 Writable&lt;br /&gt;
:4: flashfs	 	 size: ~3.625M	 	 Read Only&lt;br /&gt;
:5: recovery_fs		 size: ~ 43M		 Read Only&lt;br /&gt;
:6: rootfs		 size: ~ 460M		 Writable&lt;br /&gt;
: The final size of flashfs/recovery_fs/rootfs depends on the image size at production, and on the number/location of bad blocks in the NAND.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: U-Boot and recovery kernel and filesystem cannot be written from Linux - this is a safety measure.&lt;br /&gt;
&lt;br /&gt;
;Boot Loader&lt;br /&gt;
:U-Boot is used for setting up the processor and booting Linux, and is only accessible via a serial connection. &lt;br /&gt;
:Normal users will not need to use or modify it.&lt;br /&gt;
:Be very careful when modifying the u-boot partition. If it is damaged or overwritten, it is difficult to fix.&lt;br /&gt;
:When using U-Boot, a prompt will appear via serial shortly after power on.  &lt;br /&gt;
:The environment variables will help you determine how to boot Linux on the SBC&lt;br /&gt;
:You can also refer to the [http://www.denx.de/wiki/DULG/Manual U-Boot documentation]&lt;br /&gt;
&lt;br /&gt;
;Boot Process&lt;br /&gt;
:From power on...&lt;br /&gt;
:1. Processor loads first 4 bytes from NAND into Steppingstone and runs it.&lt;br /&gt;
:2. Steppingstone sets up RAM, copies u-boot from NAND into RAM and runs U-Boot.&lt;br /&gt;
:3. U-Boot initializes the processor, sets GPIO state, etc., copies the linux kernel into RAM, sets up the kernel command line arguments, checks that the kernel image is valid, and boots it.&lt;br /&gt;
:4. Linux boots, bringing up USB, Networking, NAND, etc. and then mounts the rootfs NAND partition on /.&lt;br /&gt;
:5. init gets run as the parents of all processes, as uses the /etc/inittab script to bring up the system. This includes mounting other filesystems, settings the hostname, and running the scripts in /etc/init.d, among other things.&lt;br /&gt;
:6. inittab then turns the green LED on.&lt;br /&gt;
:7. inittab then sets up a getty on the first serial port, ready for interfacing using the debug board.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|PHP Curl|Curl doesn&#039;t install smoothly}}&lt;br /&gt;
&lt;br /&gt;
There is an issue with the embedded version of PHP5.3, try forcing it to install the specific version that you need.  This can be done with the following command:&lt;br /&gt;
&lt;br /&gt;
{{Code|apt-get install php5-common&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;5.3.3-7+squeeze14}}&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|FTDI Errors|FTDI adapters do not appear to work with the SBC}}&lt;br /&gt;
&lt;br /&gt;
The 3.1.6 version of the Linux kernel which is used on some versions of the SBC has a bug that causes issues with FTDI drivers and makes them malfunction.  To solve this problem you must upgrade the kernel to a newer version.  You can find the files [[#Quick Downloads| here]].&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|USB Memory Key mounting|Sometimes USB Memory Keys mount at more than one location}}&lt;br /&gt;
&lt;br /&gt;
When you insert a memory key, the SBC will load it as a device (e.g. {{Code|/dev/sda1}}) and it will also &#039;&#039;mount&#039;&#039; the key for reading and writing within the {{Code|/media/}} directory.  The {{Code|/media/}} directory version will be called something like {{Code|usb0}}.  &lt;br /&gt;
At times, an inserted memory key will get mounted in more than one location.  You can observe if this occurs by checking the currently mounted devices with the command {{Code|mount}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
/dev/sda1 on /media/usb1 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will note that the same device ({{Code|/dev/sda1}}) is now mounted at &#039;&#039;both&#039;&#039; {{Code|/media/usb0}} and {{Code|/media/usb1}}.  To fix this problem as it occurs, you can use {{Code|umount}} (notice there is no letter &#039;n&#039;) to unmount the second instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# umount /media/usb1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In practice, this should not be a problem, because writing to or reading from either {{Code|usb0}} or {{Code|usb1}} will have the same effect on the memory key.  However, if you hard-code a media location into your program (i.e. expecting {{Code|/media/usb0}} to be the first USB key you insert and {{Code|/media/usb1}} to be the second key) your program will sometimes work and sometimes fail.  &lt;br /&gt;
&lt;br /&gt;
To get around this within code, find the mount point for each device as it appears.  The devices, such as {{Code|/dev/sda1}} will always refer to the actual memory key.  But, they cannot be written to directly without being mounted, so you will have to parse the mount table (what is returned from {{Code|mount}}) within your code to find the device and its corresponding mount point.&lt;br /&gt;
&lt;br /&gt;
This is a problem with the standard embedded Debian automount program, and we have no known fix.&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|Perl Locale Errors on SSH|No Locales Installed}}&lt;br /&gt;
&lt;br /&gt;
By default, no locales are installed on the SBC.  If you use [[#apt|apt]] a lot to install and manage your software on the SBC, you will get messages like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
perl: warning: Setting locale failed.&lt;br /&gt;
perl: warning: Please check that your locale settings:&lt;br /&gt;
	LANGUAGE = (unset),&lt;br /&gt;
	LC_ALL = (unset),&lt;br /&gt;
	LANG = &amp;quot;en_CA.UTF-8&amp;quot;&lt;br /&gt;
    are supported and installed on your system.&lt;br /&gt;
perl: warning: Falling back to the standard locale (&amp;quot;C&amp;quot;).&lt;br /&gt;
locale: Cannot set LC_CTYPE to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_MESSAGES to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_ALL to default locale: No such file or directory&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To squelch these messages, you should install and reconfigure your locale like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install locales&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command will show you a long list from which you should pick your location, by language.  For example, en_CA is english_Canada.  Here in Calgary, we use en_CA.UTF-8 and so for the first question we would input locale &amp;quot;114&amp;quot; and for the second (system) question we would input {{Code|en_CA}} for the locale.&lt;br /&gt;
&lt;br /&gt;
This might give you a locale undefined error, in which case you can generate the locale (for us, again, it is en_CA):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
locale-gen en_CA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=MediaWiki:Common.js&amp;diff=23884</id>
		<title>MediaWiki:Common.js</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=MediaWiki:Common.js&amp;diff=23884"/>
		<updated>2017-04-12T18:36:00Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/**&lt;br /&gt;
 * Redirect User:Name/skin.js and skin.css to the current skin&#039;s pages&lt;br /&gt;
 * (unless the &#039;skin&#039; page really exists)&lt;br /&gt;
 * @source: http://www.mediawiki.org/wiki/Snippets/Redirect_skin.js&lt;br /&gt;
 * @rev: 2&lt;br /&gt;
 */&lt;br /&gt;
if ( mw.config.get( &#039;wgArticleId&#039; ) == 0 &amp;amp;&amp;amp; mw.config.get( &#039;wgNamespaceNumber&#039; ) == 2 ) {&lt;br /&gt;
        var titleParts = mw.config.get( &#039;wgPageName&#039; ).split( &#039;/&#039; );&lt;br /&gt;
        // Make sure there was a part before and after the slash&lt;br /&gt;
        // And that the latter is &#039;skin.js&#039; or &#039;skin.css&#039;&lt;br /&gt;
        if ( titleParts.length == 2 ) {&lt;br /&gt;
                var userSkinPage = titleParts.shift() + &#039;/&#039; + mw.config.get( &#039;skin&#039; );&lt;br /&gt;
                if ( titleParts.slice(-1) == &#039;skin.js&#039; ) {&lt;br /&gt;
                        window.location.href = mw.util.wikiGetlink( userSkinPage + &#039;.js&#039; );&lt;br /&gt;
                } else if ( titleParts.slice(-1) == &#039;skin.css&#039; ) {&lt;br /&gt;
                        window.location.href = mw.util.wikiGetlink( userSkinPage + &#039;.css&#039; );&lt;br /&gt;
                }&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// Book specific&lt;br /&gt;
var wgBookName = ( mw.config.get( &#039;wgPageName&#039; ).split( &#039;/&#039;, 1)[0] || &#039;&#039; ).split( &#039;:&#039;, 2 ).join( &#039;:&#039; );&lt;br /&gt;
importStylesheet(&#039;MediaWiki:Common.css/&#039; + wgBookName);&lt;br /&gt;
 &lt;br /&gt;
// Imported scripts&lt;br /&gt;
importScript(&#039;MediaWiki:Common.js/Relics.js&#039;);&lt;br /&gt;
importScript(&#039;MediaWiki:Common.js/ExtraTools.js&#039;);&lt;br /&gt;
importScript(&#039;MediaWiki:Common.js/CollapseElements.js&#039;);&lt;br /&gt;
importScript(&#039;MediaWiki:Common.js/NavigationTabs.js&#039;);&lt;br /&gt;
importScript(&#039;MediaWiki:Common.js/Displaytitle.js&#039;);&lt;br /&gt;
importScript(&#039;MediaWiki:Common.js/RandomBook.js&#039;);&lt;br /&gt;
importScript(&#039;MediaWiki:Common.js/Perbook.js&#039;);&lt;br /&gt;
importScript(&#039;MediaWiki:Common.js/tabs.js&#039;);&lt;br /&gt;
importScript(&#039;MediaWiki:Common.js/top.js&#039;);&lt;br /&gt;
importScript(&#039;MediaWiki:Common.js/review.js&#039;);&lt;br /&gt;
importScript(&#039;MediaWiki:Common.js/Categories.js&#039;);&lt;br /&gt;
importScript(&#039;MediaWiki:Common.js/use.js&#039;);&lt;br /&gt;
 &lt;br /&gt;
if ( mw.config.get( &#039;wgCanonicalSpecialPageName&#039; ) == &#039;Watchlist&#039; ) {&lt;br /&gt;
	importScript(&#039;MediaWiki:Common.js/WatchlistNotice.js&#039;);&lt;br /&gt;
} else if ( $.inArray( mw.config.get( &#039;wgAction&#039; ), [&#039;edit&#039;, &#039;submit&#039;, &#039;upload&#039;] ) != -1 ) {&lt;br /&gt;
	importScript(&#039;MediaWiki:Common.js/Special_characters.js&#039;);&lt;br /&gt;
	importScript(&#039;MediaWiki:Common.js/Toolbox.js&#039;);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// Load sysop-specific JavaScript/CSS from [[MediaWiki:Common.js/Sysop.js]] and [[MediaWiki:Common.css/Sysop.css]]&lt;br /&gt;
if ( $.inArray( &#039;sysop&#039;, mw.config.get(&#039;wgUserGroups&#039;)) &amp;gt; -1 ) {&lt;br /&gt;
 importStylesheet(&#039;MediaWiki:Common.css/Sysop.css&#039;);&lt;br /&gt;
 if ( !window.disableSysopJS ) {&lt;br /&gt;
  $(function(){&lt;br /&gt;
   importScript(&#039;MediaWiki:Common.js/Sysop.js&#039;);&lt;br /&gt;
  });&lt;br /&gt;
 }&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=MediaWiki:Common.css&amp;diff=23881</id>
		<title>MediaWiki:Common.css</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=MediaWiki:Common.css&amp;diff=23881"/>
		<updated>2016-10-31T10:19:29Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/*////////////////////////////////////////////////////////////////////////////////////////////////////////&lt;br /&gt;
// Hides the title for specific pages&lt;br /&gt;
*/&lt;br /&gt;
body.page-Main_Page h1.firstHeading { display:none; }&lt;br /&gt;
body.page-RTD_Ad_Landing_Page h1.firstHeading { display:none; }&lt;br /&gt;
body.page-Temperature_and_Humidity_Ad_Landing_Page h1.firstHeading { display:none; }&lt;br /&gt;
body.page-Ambient_Temperature_Ad_Landing_Page h1.firstHeading { display:none; }&lt;br /&gt;
body.page-IR_Temperature_Ad_Landing_Page h1.firstHeading { display:none; }&lt;br /&gt;
body.page-Thermocouple_Ad_Landing_Page h1.firstHeading { display:none; }&lt;br /&gt;
body.page-Temperature_Ad_Landing_Page h1.firstHeading { display:none; }&lt;br /&gt;
&lt;br /&gt;
/*////////////////////////////////////////////////////////////////////////////////////////////////////////&lt;br /&gt;
// Hides category links at bottom of pages &lt;br /&gt;
*/&lt;br /&gt;
#catlinks { display: none; }&lt;br /&gt;
#mw-normal-catlinks { display: none; }&lt;br /&gt;
&lt;br /&gt;
/*////////////////////////////////////////////////////////////////////////////////////////////////////////&lt;br /&gt;
// Hides the thumbnail magnify link and the &amp;quot;powered by mediawiki&amp;quot; icon.&lt;br /&gt;
*/&lt;br /&gt;
.magnify {display: none}&lt;br /&gt;
//#footer-poweredbyico { display: none; }&lt;br /&gt;
&lt;br /&gt;
/*////////////////////////////////////////////////////////////////////////////////////////////////////////&lt;br /&gt;
// Makes the level 4 header italic so it looks different from level 3. &lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
h4{&lt;br /&gt;
font-style: italic;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*///////////////////////////////////////////////////////////////////////////////////////////////////////*/&lt;br /&gt;
&lt;br /&gt;
/*////////////////////////////////////////////////////////////////////////////////////////////////////////&lt;br /&gt;
// The following code enables numberless tables of contents.&lt;br /&gt;
// When &amp;lt;div class=&amp;quot;nonumtoc&amp;quot;&amp;gt; is used on the table of contents, the ToC will display without numbers.&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
.nonumtoc .tocnumber { display: none; }&lt;br /&gt;
.nonumtoc #toc ul,&lt;br /&gt;
.nonumtoc .toc ul {&lt;br /&gt;
    line-height: 1.5em;&lt;br /&gt;
    list-style: none;&lt;br /&gt;
    margin: .3em 0 0;&lt;br /&gt;
    padding: 0;&lt;br /&gt;
}&lt;br /&gt;
.nonumtoc #toc ul ul, &lt;br /&gt;
.nonumtoc .toc ul ul { &lt;br /&gt;
    margin: 0 0 0 2em; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Allow limiting of which header levels are shown in a TOC;&lt;br /&gt;
   &amp;lt;div class=&amp;quot;toclimit-3&amp;quot;&amp;gt;, for instance, will limit to&lt;br /&gt;
   showing ==headings== and ===headings=== but no further&lt;br /&gt;
   (as long as there are no =headings= on the page, which&lt;br /&gt;
   there shouldn&#039;t be according to the MoS). */&lt;br /&gt;
.toclimit-2 .toclevel-1 ul,&lt;br /&gt;
.toclimit-3 .toclevel-2 ul,&lt;br /&gt;
.toclimit-4 .toclevel-3 ul,&lt;br /&gt;
.toclimit-5 .toclevel-4 ul,&lt;br /&gt;
.toclimit-6 .toclevel-5 ul,&lt;br /&gt;
.toclimit-7 .toclevel-6 ul {&lt;br /&gt;
    display: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*////////////////////////////////////////////////////////////////////////////////////////////////////////*/&lt;br /&gt;
&lt;br /&gt;
/*//////////////////////////////////////////////////////////////////////////////////////////&lt;br /&gt;
// Makes the typical source code div container&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
div.source {&lt;br /&gt;
  background-color: #f3f3f3; &lt;br /&gt;
  /*border-color: #1c9edb;*/ &lt;br /&gt;
  /*Fake border:*/&lt;br /&gt;
  font-size: 10pt;&lt;br /&gt;
  border-color: #555555; &lt;br /&gt;
  border-width:2px; &lt;br /&gt;
  border-style: dashed;&lt;br /&gt;
  padding:6px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Hide edit links */&lt;br /&gt;
.mw-editsection { display:none!important; }&lt;br /&gt;
.editsection { display:none!important; }&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=23872</id>
		<title>Driver Changelog</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Driver_Changelog&amp;diff=23872"/>
		<updated>2016-09-21T22:29:30Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Administrative]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===2.1.8.20160921===&lt;br /&gt;
*macOS release&lt;br /&gt;
**Fixed USB bug where devices plugged in before boot were inaccessible until unplugged/re-plugged, under OS X 10.11. &lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160202===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Labview 7.1 support&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160107===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Don&#039;t throw an exception on EncoderPositionChangeEventArgs.Time in the .Net library when time it unknown - just return 0x7fffffff&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20160104===&lt;br /&gt;
*Mac/Windows release&lt;br /&gt;
**New firmware for 1042 and 1044, fixing digital gyro&lt;br /&gt;
===2.1.8.20151217===&lt;br /&gt;
*Fixed 1045 bug where it will display an unknown ambient temperature sometimes&lt;br /&gt;
*Fixed a crash in the windows control panel&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151020===&lt;br /&gt;
*Windows release&lt;br /&gt;
**Fixed an issue where the examples would error when trying to run them from the control panel.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20151009===&lt;br /&gt;
*OS X and Windows release&lt;br /&gt;
**Upgraded firmware for 1024, 1032, 1041, 1042, 1043, 1044 and 1067 to address issues with these Phidgets on OS X El Capitan&lt;br /&gt;
*SBC release&lt;br /&gt;
**Support for multiple webcams &lt;br /&gt;
===2.1.8.20150821===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Support OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150805===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Preliminary support for OS X 10.11 El Capitan&lt;br /&gt;
===2.1.8.20150410===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed Makefile phidget21.h target issues&lt;br /&gt;
===2.1.8.20150326===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed issue with webservice buttons not being visible in the control panel&lt;br /&gt;
===2.1.8.20150323===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Updated icons with new company logo&lt;br /&gt;
===2.1.8.20150227===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Added copyright/licence headers to source code files&lt;br /&gt;
**Updated cvtutf files to a newer version&lt;br /&gt;
===2.1.8.20150109===&lt;br /&gt;
*Windows-only&lt;br /&gt;
**Fixed examples for Labview 8.5&lt;br /&gt;
===2.1.8.20141209===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Added support for armv7s and arm64 to the iOS library. Dropped support for armv6. Requires iOS 5.1.1 or later.&lt;br /&gt;
===2.1.8.20141202===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Labview release to support older versions&lt;br /&gt;
===2.1.8.20141119===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed an issue with the 2.1.8.20141117 release where nothing was actually installed.&lt;br /&gt;
===2.1.8.20141117===&lt;br /&gt;
*OS X-only release&lt;br /&gt;
**Fixed a code-signing issue that make the installer appear unsigned on OS X 10.10&lt;br /&gt;
**Dropped support for OS X 10.4&lt;br /&gt;
===2.1.8.20140905===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added an IA32 folder to the windows libraries download - this supports Windows on the Intel Galileo platform&lt;br /&gt;
===2.1.8.20140428===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to C# Stepper GUI Example&lt;br /&gt;
===2.1.8.20140319===&lt;br /&gt;
*CPhidget_getDeviceClass can now be called on handle before it is attached.&lt;br /&gt;
*Added support for 64-bit Max/MSP (Version 6.1+) on both OS X and Windows.&lt;br /&gt;
===2.1.8.20140227===&lt;br /&gt;
*Deals with 1046 bug in v100 and v101 firmware.&lt;br /&gt;
**No longer reports bad values that appear right after a channel is enabled.&lt;br /&gt;
**Fixes issue where changing the gain while channel 0 is disabled would sometimes cause bad readings.&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20131105===&lt;br /&gt;
* Fixed a defect in the Flash examples for the 1012 (Outputs 11-16 were not addressed properly).&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20130926===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support setting label on 1067 from Windows&lt;br /&gt;
===2.1.8.20130820===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Added logging option to control panel / C# full examples&lt;br /&gt;
===2.1.8.20130802===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fix for Windows 8 issue where only &#039;Uninitialized Phidget Handle&#039; would show up in the Manager, and Phidgets could not be opened.&lt;br /&gt;
===2.1.8.20130723===&lt;br /&gt;
*Improvement to java: we don&#039;t attach/detach our native threads for each event, just one attach, then detach before the thread exits.&lt;br /&gt;
**This increases performance, esp. when debugging on Android.&lt;br /&gt;
*Improvement to Android: We reuse the UsbRequest object rather then creating a new one for each transfer. This reduces logcat messages tremendously, and increases performance.&lt;br /&gt;
===2.1.8.20130710===&lt;br /&gt;
*Android-only release&lt;br /&gt;
**Added extra android target architectures: x86, MIPS, armeabi-v7a&lt;br /&gt;
===2.1.8.20130618===&lt;br /&gt;
*Changed setCompassCorrectionParameters() API call so that compass calibration parameters are written out to non-volatile storage on 1042/1044, so that they persist across power cycles. Previously, calibration data would need to be re-programmed at each attach.&lt;br /&gt;
*Changes to C# Spatial example:&lt;br /&gt;
**Compass calibration parameter set dialog removed from for 1042/1044 because parameters are set by the calibration software - and thus do not need setting in the example.&lt;br /&gt;
**Stores/restores parameters for 1056 based on serial number, so multiple different calibrations can be maintained.&lt;br /&gt;
===2.1.8.20130607===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixes to compass calibration software for 1042/1044&lt;br /&gt;
===2.1.8.20130419===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed setCompassCorrectionParameters in the COM library&lt;br /&gt;
===2.1.8.20130327===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Changed Windows installer to stop virus-scanner false positives&lt;br /&gt;
**Dropped support for Windows 2000&lt;br /&gt;
===2.1.8.20130320===&lt;br /&gt;
*Added EPHIDGET_NOTFOUND exception to Dictionary.getKey() for when the key is not found.&lt;br /&gt;
*Added exceptions back into the Java library - they have been missing since 2.1.8.20121015 release.&lt;br /&gt;
===2.1.8.20130313===&lt;br /&gt;
*Updates to Matlab support&lt;br /&gt;
**Works properly on Matlab 7+, on Windows, Mac, Linux without needing changes to .m files.&lt;br /&gt;
===2.1.8.20130221===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Encoder Index event added to C and .NET libraries&lt;br /&gt;
===2.1.8.20121218===&lt;br /&gt;
*Webservice version: 1.0.10&lt;br /&gt;
**Support for 1024, 1032&lt;br /&gt;
*Support for 1024, 1032&lt;br /&gt;
*fixed bug where if one half of a composite device is open, and PHIDGET_USB_ERROR_FLAG gets set, the device may never re-attach.&lt;br /&gt;
===2.1.8.20121015===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Support for new pressure/light sensors in example.&lt;br /&gt;
===2.1.8.20120914===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Improved firmware upgrading in control panel - it was giving some false-errors on some machines.&lt;br /&gt;
===2.1.8.20120912===&lt;br /&gt;
*Fixed bug where 1065 could fail to attach when opened over webservice&lt;br /&gt;
*Fixed bug where close() could deadlock on Phidgets opened over the webservice&lt;br /&gt;
*Changed LED64 LED Brightness from int to double&lt;br /&gt;
**this may cause issues when controlling the LED64 over the webservice and library/webservice are not the same version&lt;br /&gt;
**the old setDiscreteLED call will remain, deprecated, with an int argument for compatibility.&lt;br /&gt;
===2.1.8.20120716===&lt;br /&gt;
*Linux-Only Release&lt;br /&gt;
**Fixed a bug where opening a device in two program at once would cause an attach-detach cycle as they fight each other for control.&lt;br /&gt;
===2.1.8.20120713===&lt;br /&gt;
*Mac-Only Release&lt;br /&gt;
**Added signing of the Mac installer, so Mountain Lion (OS X 10.8) doesn&#039;t refuse to run it.&lt;br /&gt;
===2.1.8.20120615===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that caused java to crash on events introduced in 2.1.8.20120612&lt;br /&gt;
===2.1.8.20120612===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed another bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120606===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed a bug that will cause Unity3D to hang on exit after having used Phidgets.&lt;br /&gt;
===2.1.8.20120525===&lt;br /&gt;
*Windows-only release&lt;br /&gt;
**Fixed PhidgetIR sendRawData bug in .NET on 64-bit machines.&lt;br /&gt;
===2.1.8.20120514===&lt;br /&gt;
*Linux-only release&lt;br /&gt;
**Fixed a bug that causes a segfault with libusb-1.0 under 64-bit Linux.&lt;br /&gt;
===2.1.8.20120507===&lt;br /&gt;
*Mac/Linux-only release&lt;br /&gt;
**Fixes a setLabel bug introduced in 2.1.8.20120503&lt;br /&gt;
===2.1.8.20120503===&lt;br /&gt;
*Fixed some spelling mistakes&lt;br /&gt;
*Moved to libusb-1.0&lt;br /&gt;
**This resolves a bug where having a webcam plugged in caused a memory leak in the webservice.&lt;br /&gt;
*Fixed bug with advanced servo where setting acceleration to accelerationMax would cause an exception for some servo types&lt;br /&gt;
===2.1.8.20120216===&lt;br /&gt;
*Fixed bug with RFID Reader on OS X and Linux, as well as .NET over the webservice&lt;br /&gt;
*Fixed bug that could cause the Java Phidget Manager to crash during garbage collection.&lt;br /&gt;
===2.1.8.20120131===&lt;br /&gt;
*Fixed RFID Reader bug that caused tag event to not get thrown in .NET Applications&lt;br /&gt;
*Changed compass bearing calculations in spatial C# example&lt;br /&gt;
===2.1.8.20120123===&lt;br /&gt;
*Added support for 1061 v300+&lt;br /&gt;
*Fixed a bug where the firmware version could be mis-reported over Bonjour&lt;br /&gt;
===2.1.8.20111220===&lt;br /&gt;
*Fixed a bug in AppleScript where closing a Phidget opened via label would give a &#039;Connection Invalid&#039; error.&lt;br /&gt;
*Fixed a bug where the webservice may fail to start on Linux systems that don&#039;t support IPv6 (ie. SBC2).&lt;br /&gt;
*Fixed issue where ratiometric state on newest interfacekit wouldn&#039;t be read back properly if it was false during attach.&lt;br /&gt;
*Fixed webservice issue where ratiometric state would not be reported properly for newest interfacekits&lt;br /&gt;
*Increased the number of overrun errors ignored during initial attach for InterfaceKit.&lt;br /&gt;
*Fixed an issue with the iPhone library and header&lt;br /&gt;
===2.1.8.20111219===&lt;br /&gt;
*fixed various other webservice stability/performance/memory leak bugs&lt;br /&gt;
*Faster connection to SBC-connected Phidgets from Mac OS&lt;br /&gt;
*Don&#039;t report packetlost or overrun errors that happen during early initialization - these are just noise.&lt;br /&gt;
*Fixed a bug in the webservice tree removal function that could cause memory leaks.&lt;br /&gt;
*Fixed bug where Webservice would crash on Linux if the chosen serverID was already under use on the network&lt;br /&gt;
*Stopped sending hardware Error Events before the Attach event - they are now queued up and sent after Attach&lt;br /&gt;
*Fixed a crash in the [[Phidget Control Panel]]&lt;br /&gt;
*Added ability to remove dictionary keys from a key change listener&lt;br /&gt;
*Reduced the number of false &#039;pending command not finished&#039; error events on Close()&lt;br /&gt;
*Fixed a webservice bug where exceptions/false attach events could occur when close() is called soon after open&lt;br /&gt;
*Fixed bug where closing a PhidgetRFID soon after attach could cause a crash&lt;br /&gt;
*Fixed webservice but on MacOS where client could exit with SIG_PIPE error&lt;br /&gt;
*Fixed webservice bug where the server would sometimes exit(1) after many connect/disconnect cycles&lt;br /&gt;
*Fixed webservice bug where client could deadlock during close()&lt;br /&gt;
*Fixed webservice bug where opening a single remote phidget multiple times from the same application would fail&lt;br /&gt;
*Fixed a webservice bug where sockets weren&#039;t being closed properly sometimes&lt;br /&gt;
*Fixed a webservice bug where pre-attach error events wouldn&#039;t get through&lt;br /&gt;
*Fixed a bug where the webservice running on Linux would stop responding to clients after ~300 connect/disconnect cycles&lt;br /&gt;
*Fixed bug where a Phidget would become inaccessible until the app is restarted if a thread creation failed&lt;br /&gt;
*Fixed webservice bug where connect is slow on Windows when multiple clients are running simultaneously&lt;br /&gt;
*Fixed webservice bug where authentication would fail on a valid password&lt;br /&gt;
*Fixed webservice bug where attach may never happen, and would require a close()/open()&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20111121===&lt;br /&gt;
*Added support for new servo types to all libraries&lt;br /&gt;
*Fixed min/max position/velocity causing invalid arg exception on servo/advservo&lt;br /&gt;
*IPv6 support on MacOS&lt;br /&gt;
*Fixed some memory leaks&lt;br /&gt;
*Fixed hostname lookup issue on Mac OS with Back To My Mac enabled.&lt;br /&gt;
===2.1.8.20111028===&lt;br /&gt;
*Fixed Applescript bugs and released examples&lt;br /&gt;
*Added openLabel to .NET, Java, COM&lt;br /&gt;
*Setting change trigger to 0 on interfacekit will not set event mode.&lt;br /&gt;
**Previously setting change trigger to 0 after setting data rate would supersede the data rate setting, which is probably unexpected.&lt;br /&gt;
===2.1.8.20110630 - MacOS Only===&lt;br /&gt;
*handle USB bug introduced in MacOS 10.6.8&lt;br /&gt;
===2.1.8.20110615===&lt;br /&gt;
*Added error event when trying to open Phidgets with an unsupported version&lt;br /&gt;
===2.1.8.20110614 - Windows Only===&lt;br /&gt;
*Fixed bug in C# Spatial example&lt;br /&gt;
*Added support for negative gains in 1056&lt;br /&gt;
===2.1.8.20110601 - MacOS Only===&lt;br /&gt;
*Fixed AppleScript issues&lt;br /&gt;
===2.1.8.20110527===&lt;br /&gt;
*Fixed AS3.0 library (Flash/Flex) - wouldn&#039;t connect to webservice as of last release&lt;br /&gt;
*Fixed bug where webservice doesn&#039;t release a closed Phidget&lt;br /&gt;
*Fixed bug where devices that don&#039;t support label didn&#039;t show up on MacOS&lt;br /&gt;
*Fixed iPhone library issues&lt;br /&gt;
===2.1.8.20110524===&lt;br /&gt;
*AppleScript support added&lt;br /&gt;
*fixed problem with Spatial in .NET on 64-bit Windows&lt;br /&gt;
*Added remote setLabel to mac preference pane.&lt;br /&gt;
*fixed a bug where label characters 7,8,9 would be read back corrupted on certain devices.&lt;br /&gt;
**labels &amp;gt;7 characters that exhibit this bug will now be truncated to 7 characters when being read back&lt;br /&gt;
**call setLabel again using this library or newer to support 10 character labels.&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to &amp;lt;=7 characters on these devices.&lt;br /&gt;
*fixed bug on MacOS where serial number and/or label strings could be read wrong.&lt;br /&gt;
*better support for recovering misbehaving devices in Linux&lt;br /&gt;
*fixed a deadlock on linux when Avahi is installed but not running&lt;br /&gt;
*clear list of attached devices when closing remote manager&lt;br /&gt;
*Added support for Unicode labels&lt;br /&gt;
**To maintain compatibility with older library versions, limit labels to ASCII.&lt;br /&gt;
*Added open by label&lt;br /&gt;
*Webservice protocol version up to 1.0.9 (for open by label)&lt;br /&gt;
*Made opening multiple device is one application faster.&lt;br /&gt;
*TextLCD changes:&lt;br /&gt;
**cursor is disabled while writing to the display or setting a custom character to prevent display artifacts&lt;br /&gt;
**cursor is disabled when a full line is written so it doesn&#039;t go to the start of another line&lt;br /&gt;
**1204 should be stable&lt;br /&gt;
**setDisplayCharacter supports 0x00-0xff&lt;br /&gt;
*stopped property reflected more accurately in the C# stepper example&lt;br /&gt;
*Added error events to mac examples&lt;br /&gt;
===2.1.8.20110329 - Windows only===&lt;br /&gt;
*Fixed problem with control panel encoder example where enable wouldn&#039;t work&lt;br /&gt;
*Fixed issue with SpatialData, GPSPositionChange, PHChange and WeightChange events in Labview 64-bit&lt;br /&gt;
===2.1.8.20110322===&lt;br /&gt;
*Fixed [[Phidget Control Panel]] memory leak when Bonjour in installed but not running&lt;br /&gt;
*Fixed current sense formula on 1061_0 v200&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetAdvancedServo&lt;br /&gt;
*Fixed bug in old PhidgetTemperatureSensor&lt;br /&gt;
&lt;br /&gt;
===2.1.8.20110310===&lt;br /&gt;
*Fixed bug in webservice protocol while using the PhidgetServo&lt;br /&gt;
*Fixed some Labview bugs&lt;br /&gt;
*Added some Java and VB.NET examples&lt;br /&gt;
===2.1.8.20110301===&lt;br /&gt;
*Full Support for 1002, 1011, 1040, 1046, 1054, 1065, 1204&lt;br /&gt;
*New webservice version - 1.0.8&lt;br /&gt;
**Support for new devices&lt;br /&gt;
**Support for error events&lt;br /&gt;
===2.1.7.20110203===&lt;br /&gt;
*fixed crash on close of remote Phidget on MacOS&lt;br /&gt;
*C# ifkit example bugfix - crashed on 1015/1016&lt;br /&gt;
*webservice improvements&lt;br /&gt;
*Switch to IP address for SBC config in browser&lt;br /&gt;
*Faster IP lookup for SBCs in control panel&lt;br /&gt;
===2.1.7.20101222 / 2.1.7.20101223===&lt;br /&gt;
*fixed getServerID on Linux&lt;br /&gt;
*removed report ack&lt;br /&gt;
**this was causing some bad side effects&lt;br /&gt;
*manual .local lookups on Windows&lt;br /&gt;
**much faster then letting Windows do it itself&lt;br /&gt;
*Support for new Labview library&lt;br /&gt;
*Fixed PhidgetIR bug where library would crash if repeat code is longer then IR_MAX_REPEAT_LENGTH&lt;br /&gt;
===2.1.7.20101103===&lt;br /&gt;
*Decreased Phidget Webservice event latency on Windows&lt;br /&gt;
*Preliminary support for 1002, 1011, 1040, 1045, 1046, 1054, 1065, 1204 (C, .NET)&lt;br /&gt;
*Webservice version updated to 1.0.7&lt;br /&gt;
**support for 1045, 1011, 1204&lt;br /&gt;
*Fixed a bug where webservice connections could be unexpectedly lost&lt;br /&gt;
*Bugfix: couldn&#039;t set interfacekit data rate over webservice.&lt;br /&gt;
*Fixed some memory leaks in the Mac library&lt;br /&gt;
*Fixed bug where blocking for &amp;gt;2 seconds in an events handler when opening remotely could cause a crash.&lt;br /&gt;
===2.1.7.20100803===&lt;br /&gt;
*Windows only release&lt;br /&gt;
*fixed setLabel in WindowsCE&lt;br /&gt;
*fixed getHashCode in .NET library - needed for working with Phidgets in Labview via .NET&lt;br /&gt;
===2.1.7.20100621===&lt;br /&gt;
*Linux only release - autotools updates&lt;br /&gt;
**call ldconfig automatically&lt;br /&gt;
**remove old phidget21 library (pre-autotools) when installing new one.&lt;br /&gt;
===2.1.7.20100620===&lt;br /&gt;
*Linux only release - added version.sh for autoreconf&lt;br /&gt;
===2.1.7.20100618===&lt;br /&gt;
*Linux only release - added udev/hotplug files&lt;br /&gt;
===2.1.7.20100617===&lt;br /&gt;
*Linux only release&lt;br /&gt;
*Transitioned to autotools in linux for phidget21 / webservice&lt;br /&gt;
*phidget21 library and webservice are now separate downloads&lt;br /&gt;
===2.1.7.20100525===&lt;br /&gt;
*full support for PhidgetSpatial and PhidgetIR in all libraries&lt;br /&gt;
*fixed 1031 not attaching in AS3.0&lt;br /&gt;
*Better error messages in JNI&lt;br /&gt;
*Updated error codes, device ID/Class lists in Java, Flash, COM, etc.&lt;br /&gt;
*Fixed TemperatureSensor version 200,201,202 bug - ambient sensor would not report negative temperatures.&lt;br /&gt;
*Revised temperaturesensor API to report tempMin/tempMax and errors more accurately.&lt;br /&gt;
*Added initial events for encoder digital inputs&lt;br /&gt;
*full support for 1047&lt;br /&gt;
*Added new device support to WindowsCE&lt;br /&gt;
*Updated mac examples for 1047, 1048&lt;br /&gt;
===2.1.6.20100504===&lt;br /&gt;
*Windows only Release&lt;br /&gt;
**Added 1131 and 1132 to InterfaceKit example in MSI&lt;br /&gt;
===2.1.6.20100428===&lt;br /&gt;
*limit data rate maximum to 16ms over the webservice for devices that expose dataRate (InterfaceKit, Spatial)&lt;br /&gt;
*fixed bug where TextLCD 8/8/8 would stay in Bonjour list after webservice is shutdown&lt;br /&gt;
*set/get Brightness for 1203_2&lt;br /&gt;
*Support 1048 in C# example&lt;br /&gt;
*webservice version incremented to 1.0.6&lt;br /&gt;
**TextLCD set/get brightness&lt;br /&gt;
**PhidgetIR support&lt;br /&gt;
**PhidgetSpatial support&lt;br /&gt;
**1047 support (enable, index)&lt;br /&gt;
===2.1.6.20100406===&lt;br /&gt;
*Support for 1018_2 (dataRate)&lt;br /&gt;
*Webservice version incremented to 1.0.5&lt;br /&gt;
===2.1.6.20100401===&lt;br /&gt;
*Updated InterfaceKit example with new sensors&lt;br /&gt;
*make Windows connect cancelable&lt;br /&gt;
*make pending zeroconf lookups cancelable during close&lt;br /&gt;
===2.1.6.20100318===&lt;br /&gt;
*Mac only release&lt;br /&gt;
**Added WillSleep and Wakeup events to give user control of Phidgets immediately before and after a system sleep (MacOS Only).&lt;br /&gt;
===2.1.6.20100317===&lt;br /&gt;
*Windows only release&lt;br /&gt;
**Some of the examples were being built using an out of date .NET library&lt;br /&gt;
===2.1.6.20100310===&lt;br /&gt;
*MaxMSP fix - 2.1.6.20100126 introduced a bug for some Phidgets where openremote/open by serial didn&#039;t work and MaxMSP would sometimes crash.&lt;br /&gt;
**No code changes to any of the other libraries.&lt;br /&gt;
===2.1.6.20100304===&lt;br /&gt;
*stopped property changes trigger events over webservice so they are noticed.&lt;br /&gt;
**more compatible with how local open works&lt;br /&gt;
*added 5 new servos&lt;br /&gt;
*fixed bug where remote close would not set detached so a subsequent open would not always connect.&lt;br /&gt;
*handle UninitializeZeroconf better - shut down thread before closing handles, fixes hang on SBC&lt;br /&gt;
*fixed bug on Mac where detaching 2 or more Phidgets at the same time caused a crash&lt;br /&gt;
*fixed close blocking because of a pending connect (mac, linux)&lt;br /&gt;
*Final support for 1031 in all libraries.&lt;br /&gt;
===2.1.6.20100129===&lt;br /&gt;
*Implemented initial events in Flash&lt;br /&gt;
**Flash behaviour should now be identical to C library local and remote.&lt;br /&gt;
*Fix RFID issue where close could cause crash&lt;br /&gt;
*increment webservice version to 1.0.4&lt;br /&gt;
*fixed RFID remote open&lt;br /&gt;
**Flash would never get an attach event if the reader had been previously opened&lt;br /&gt;
**Initial tag event would not be fired when a tag was present and the antenna was enabled prior to open&lt;br /&gt;
*fixed openRemote failing on Mac&lt;br /&gt;
*fixed deadlock in webservice which could be hit by opening/closing a device over and over again.&lt;br /&gt;
*fixed bug in stepper, which caused seg fault on SBC on position change events.&lt;br /&gt;
===2.1.6.20100126===&lt;br /&gt;
*added network open support in Max/MSP&lt;br /&gt;
===2.1.6.20100115===&lt;br /&gt;
*Increased network performance for Linux/MacOS&lt;br /&gt;
*Added five servo types&lt;br /&gt;
===2.1.6.20091215===&lt;br /&gt;
*Fixed busy loop in Linux openRemote&lt;br /&gt;
*JNI Library relocated to /Library/Java/Extensions on MacOS&lt;br /&gt;
===2.1.6.20091211===&lt;br /&gt;
*Heartbeat now works on Linux as well (had to make sockets non-blocking)&lt;br /&gt;
===2.1.6.20091130===&lt;br /&gt;
*Added heartbeat to webservice (client side)&lt;br /&gt;
**Better detects network failures by using active polling timeouts&lt;br /&gt;
*Fixed 0/8/8 over webservice&lt;br /&gt;
===2.1.6.20091020===&lt;br /&gt;
*Fixed 1052 counting issue on 1070 (-1 reported as 255)&lt;br /&gt;
*Fixed issue where Phidget21 would try to reinstall from a limited user account or when the Control Panel was disabled.&lt;br /&gt;
*64-bit kernel support in Snow Leopard&lt;br /&gt;
===2.1.6.20090928===&lt;br /&gt;
*Support for PhidgetSBC (1070)&lt;br /&gt;
*zeroconf can handle starting up before the mdns daemon, and will keep trying to connect.&lt;br /&gt;
*fixed 1066 not showing up on Mac&lt;br /&gt;
*added advanced servo example to mac pref pane&lt;br /&gt;
*implemented proper error handling in COM&lt;br /&gt;
**default behavious remains the same, enable proper error handling with &#039;EnableVerboseErrors&#039;&lt;br /&gt;
*implemented error events in Java&lt;br /&gt;
===2.1.6.20090917===&lt;br /&gt;
*Updated webservice protocol version to 1.0.3&lt;br /&gt;
*Fixed stepper under AS3.0&lt;br /&gt;
*added setServoType, getServoType, setServoParameters to PhidgetServo and PhidgetAdvancedServo&lt;br /&gt;
*possible race condition fixed in webservice (pdictclient.c:907)&lt;br /&gt;
===2.1.6.20090902 (mac only release)===&lt;br /&gt;
*Support MacOSX 10.6, drop support for 10.3.9, require 10.4 or newer&lt;br /&gt;
**Fully 64-bit compliant, library supports ppc, i386, x86_64&lt;br /&gt;
===2.1.6.20090806===&lt;br /&gt;
*Added 1049 support&lt;br /&gt;
*Fixed RFID tag events over webservice&lt;br /&gt;
===2.1.6.20090804===&lt;br /&gt;
*Added 1051_2 support&lt;br /&gt;
*Fixed various small initialization issues - stepper, adv servo, rfid&lt;br /&gt;
*Added 32-bit library install to 64-bit installer&lt;br /&gt;
**VB6.0, etc. need the 32-bit COM library on 64-bit windows&lt;br /&gt;
===2.1.6.20090717===&lt;br /&gt;
*?&lt;br /&gt;
===2.1.6.20090708===&lt;br /&gt;
*Added DeviceID to zeroconf&lt;br /&gt;
*fixed RFID.LastTag in .NET&lt;br /&gt;
*Changed the error codes returned by error events; error events now have their own set of error codes rather then sharing the function return codes.&lt;br /&gt;
*Added support for 1047, 1048&lt;br /&gt;
*Added error event codes rather then trying to reuse the EPHIDGET return codes.&lt;br /&gt;
*fixed TextLCD issue where display could get corrupted during a detach/attach&lt;br /&gt;
*made mac more reliable on attach&lt;br /&gt;
*more error logging on mac&lt;br /&gt;
===2.1.6.20090525===&lt;br /&gt;
*fixed RFID not attaching via webservice if a tag is present.&lt;br /&gt;
*bugfix related to double free on detach event.&lt;br /&gt;
*Implemented getKey&lt;br /&gt;
*Added MIPS II support to Windows CE&lt;br /&gt;
===2.1.6.20090430===&lt;br /&gt;
*Added ActiveX interface to COM library&lt;br /&gt;
*Added stepper and advancedServo to Flex .swc library&lt;br /&gt;
===2.1.6.20090417===&lt;br /&gt;
*added PhidgetIR prototype support to C library&lt;br /&gt;
*properly handles sleeping on OSX&lt;br /&gt;
*fixed some webservice field initializations in Flash and C&lt;br /&gt;
*fixed security exceptions in [[Phidget Control Panel]] under Vista&lt;br /&gt;
*added [[Phidget Control Panel]] to start menu&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090318 (Examples/AS3.0 only release)===&lt;br /&gt;
*Fixed AdvancedServo in Flash - wouldn&#039;t attach&lt;br /&gt;
===2.1.6.20090317===&lt;br /&gt;
*[[Phidget Control Panel]] properly supports Vista UAC and Limited user accounts in XP, etc.&lt;br /&gt;
*Added 64-bit release of Phidget21.msi for Windows&lt;br /&gt;
&lt;br /&gt;
===2.1.6.20090312===&lt;br /&gt;
*added 1064, 1059 to WindowsCE&lt;br /&gt;
*fixed opening 1051 over webservice&lt;br /&gt;
*fixed opening 1015/1016 over webservice broken in last release&lt;br /&gt;
===2.1.6.20090302===&lt;br /&gt;
*Advanced servo bugfix: stopped would stop being true if min/max was set to exclude current position.&lt;br /&gt;
*linux USB improvements when many Phidgets are attached and opened at once.&lt;br /&gt;
*1031 support in phidget21, webservice, .NET - hidden until product release&lt;br /&gt;
**CPhidgetLED_setVoltage&lt;br /&gt;
**CPhidgetLED_getVoltage&lt;br /&gt;
**CPhidgetLED_setCurrentLimit&lt;br /&gt;
**CPhidgetLED_getCurrentLimit&lt;br /&gt;
*unknown timechange == PUNK_INT in encoder position change event&lt;br /&gt;
**1st position change event&lt;br /&gt;
**&amp;gt; 30 seconds time change&lt;br /&gt;
*AS3 updates&lt;br /&gt;
**updated to 1.0.2 webservice&lt;br /&gt;
**encoder position change events report relative change rather then absolute position&lt;br /&gt;
**encoder adds getTimeChange function for timing encoder changes&lt;br /&gt;
*webservice updated to 1.0.2&lt;br /&gt;
**Authorization is asynchronous&lt;br /&gt;
**Doesn&#039;t match the old version checking, so errors will not be nice when trying to connect to an old webservice&lt;br /&gt;
**Sends out all initial data, so it&#039;s just like opening locally&lt;br /&gt;
**supports interfacekit Raw sensor value&lt;br /&gt;
**supports labels on remoteIP managers&lt;br /&gt;
*avahi bugfix&lt;br /&gt;
*webservice more stable against forcefully closed clients&lt;br /&gt;
*closing a network Phidget won&#039;t block - ever.&lt;br /&gt;
**no longer using quit, just closing the socket&lt;br /&gt;
*added libavahi-client.so.3 reference to linux library.&lt;br /&gt;
*Fixed bug with opening one phidget with serial and no serial at the same time over the webservice&lt;br /&gt;
===2.1.5.20090105===&lt;br /&gt;
*[[Phidget Control Panel]] stability improvements&lt;br /&gt;
*added CPhidgetSBC_getHostname&lt;br /&gt;
*advanced servo 1 motor current sense equation - support should now be complete&lt;br /&gt;
*webservice and network code bugfixes - crash / deadlock during close, problems with concurrent connections, etc.&lt;br /&gt;
*fixed close on remote and remoteIP managers&lt;br /&gt;
*name of RFID changed from &amp;quot;Phidget RFID 4-output&amp;quot; to &amp;quot;Phidget RFID 2-output&amp;quot; - updated anything referencing old name.&lt;br /&gt;
&lt;br /&gt;
===2.1.5.20081023===&lt;br /&gt;
*added advanced servo and stepper examples to VB6.0, VB.NET and C&lt;br /&gt;
*added deviceClass and deviceID&lt;br /&gt;
*updated Mac examples&lt;br /&gt;
*webservice protocol version enforcement&lt;br /&gt;
*internal fix/rework of device id&#039;s etc.&lt;br /&gt;
*Fixed memory leaks in webservice and phidget21 network code.&lt;br /&gt;
*Dictionary and network stability improvements.&lt;br /&gt;
*duplicate calls to open or close are now silently ignored.&lt;br /&gt;
===2.1.4.20080924===&lt;br /&gt;
*Old TextLCD 0/8/8&#039;s can now have both halves open at the same time on Windows&lt;br /&gt;
*fixed bug with composite devices on linux&lt;br /&gt;
*fixed manager on linux to better deal with unique devices&lt;br /&gt;
===2.1.4.20080922===&lt;br /&gt;
*Updated Delphi files&lt;br /&gt;
*TextLCD can display 0x80-0xFF characters from Java&lt;br /&gt;
*getAttachedDevices works for mdns managers&lt;br /&gt;
*fixed a deadlock in the webservice&lt;br /&gt;
*better network error handling / password support for windows C# examples&lt;br /&gt;
*waitForAttachment will return EPHIDGET_CLOSED if the handle is closed while it is waiting.&lt;br /&gt;
*added EPHIDGET_CLOSED&lt;br /&gt;
*joining central threads checks whether they are trying to be joined by themselves first (avoid deadlocks).&lt;br /&gt;
*changed context of error event to be free from locks (can call close, open, etc. from them).&lt;br /&gt;
===2.1.4.20080821===&lt;br /&gt;
*zeroconf threads exit cleanly on last _close (apple zeroconf)&lt;br /&gt;
*Added advanced servo and stepper to Max&lt;br /&gt;
===2.1.4.20080811 (mac only release)===&lt;br /&gt;
*Fixed manager on Mac (wasn&#039;t working at all since 2.1.4.20080808)&lt;br /&gt;
===2.1.4.20080808===&lt;br /&gt;
*added CPhidgetSBC and CPhidgetSBCManager to the c library - these interfaces are hidden from users and meant to be used internally (for now).&lt;br /&gt;
*CPhidgetManager_open no longer blocks to send out initial attach events. These initial events are sent from the CentralThread context like all other attach events.&lt;br /&gt;
*fixed CThread_wait_on_event on Linux&lt;br /&gt;
*added CPhidgetGeneric interface for prototyping to C, .NET libraries. product ID is 0x99. These are only visible in debug releases, only to be used internally.&lt;br /&gt;
===2.1.4.20080715===&lt;br /&gt;
*udev rules fixed for product IDs with alpha-hex values&lt;br /&gt;
*blocking in an attach event does not block calls to open anymore&lt;br /&gt;
*RFID tag event handlers can now handle blocking - tag lost is timed after the tag handler exits.&lt;br /&gt;
===2.1.4.20080623===&lt;br /&gt;
*Flex .swc library was out of sync&lt;br /&gt;
*fixed CPhidgetManager_getAttachedDevices for network managers&lt;br /&gt;
*Added CPhidgetManager_freeAttachedDevicesArray&lt;br /&gt;
===2.1.4.20080613===&lt;br /&gt;
*Max/MSP RFID fixed&lt;br /&gt;
*0/0/8 and advanced servo added to CE&lt;br /&gt;
*fixed flash policy file server in webservice&lt;br /&gt;
*webservice with password and asynchronous together work now&lt;br /&gt;
===2.1.4.20080602===&lt;br /&gt;
*phidget21.h -&amp;gt; phidget21int.h so as not to be confused with generated phidget21.h&lt;br /&gt;
*some changes to Makefile fro crosscompiling&lt;br /&gt;
*no more vbscript in msi&lt;br /&gt;
===2.1.4.20080513===&lt;br /&gt;
*removed long long from COM - not supported by VB6.0&lt;br /&gt;
*added LastTag to RFID in .NET&lt;br /&gt;
===2.1.4.20080428===&lt;br /&gt;
*support Mac OS X 10.3.9 again&lt;br /&gt;
*Rev up to 2.1.4&lt;br /&gt;
*finalize Phidget Stepper API - Phidget Stepper requires 2.1.4 as a minimum&lt;br /&gt;
*fixed serverConnect and serverDisconnect handlers for manager and dictionary in COM&lt;br /&gt;
*Changed:&lt;br /&gt;
**PhidgetStepper and PhidgetAdvancedServo&lt;br /&gt;
***MotorPosition -&amp;gt; Position&lt;br /&gt;
***MotorOn -&amp;gt; Engaged&lt;br /&gt;
***MotorStopped -&amp;gt; Stopped&lt;br /&gt;
*Added:&lt;br /&gt;
**CPhidgetStepper_getCurrentLimit&lt;br /&gt;
**CPhidgetEncoder_getPosition&lt;br /&gt;
**CPhidgetEncoder_setPosition&lt;br /&gt;
**CPhidgetMotorControl_getVelocity&lt;br /&gt;
**CPhidgetMotorControl_setVelocity&lt;br /&gt;
**CPhidgetMotorControl_set_OnVelocityChange_Handler&lt;br /&gt;
**CPhidgetServo_setEngaged&lt;br /&gt;
**CPhidgetServo_getEngaged&lt;br /&gt;
**CPhidgetServo_getPosition&lt;br /&gt;
**CPhidgetServo_setPosition&lt;br /&gt;
**CPhidgetServo_set_OnPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getPositionMax&lt;br /&gt;
**CPhidgetServo_getPositionMin&lt;br /&gt;
**Count functions&lt;br /&gt;
*Deprecated:&lt;br /&gt;
**CPhidgetEncoder_getEncoderPosition&lt;br /&gt;
**CPhidgetEncoder_setEncoderPosition&lt;br /&gt;
**CPhidgetMotorControl_getMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_setMotorSpeed&lt;br /&gt;
**CPhidgetMotorControl_set_OnMotorChange_Handler&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorPosition&lt;br /&gt;
**CPhidgetServo_setMotorPosition&lt;br /&gt;
**CPhidgetServo_set_OnMotorPositionChange_Handler&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**Num functions&lt;br /&gt;
*Added ability to deprecate funcitons in the C library - compiler will issue a warning when they are used.&lt;br /&gt;
*added names to some arguments in phidget21.h&lt;br /&gt;
*fixes to the webservice for initial state stuff - now it behaves almost like non-webservice, with guaranteed initial events, but we don&#039;t guarantee initial state in the attach event yet. Min/Max, Num motors, inputs, etc. are all guaranteed in the attach handler.&lt;br /&gt;
*Finalized support for Phidget Stepper&lt;br /&gt;
===2.1.3.20080402===&lt;br /&gt;
*Fixed windows BUG - Device Type was showing up wrong&lt;br /&gt;
*CPhidgetStepper_getPosition -&amp;gt; CPhidgetStepper_getCurrentPosition&lt;br /&gt;
===2.1.3.20080327===&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_setMotorPositionMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorStopped&lt;br /&gt;
*changes to API&lt;br /&gt;
**CPhidgetStepper_setMotorPosition -&amp;gt; CPhidgetStepper_setTargetMotorPosition&lt;br /&gt;
**added CPhidgetStepper_getTargetMotorPosition&lt;br /&gt;
**Stepper MotorSpeed -&amp;gt; Velocity&lt;br /&gt;
**Stepper and AdvancedServo MaxVelocity -&amp;gt; VelocityLimit&lt;br /&gt;
*add waitForAttachment to COM&lt;br /&gt;
*COM getbool (not indexed) will now return FALSE on false (rather then always returning true)&lt;br /&gt;
*fixed write thread timeouts - was setting attached after starting write thread so write thread would see a detached device and exit immediately&lt;br /&gt;
===2.1.3.20080206===&lt;br /&gt;
*changed long long to __int64, to be happy in borland C++&lt;br /&gt;
*added:&lt;br /&gt;
**CPhidgetStepper_getMaxMotorSpeed&lt;br /&gt;
**CPhidgetStepper_setMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorOn&lt;br /&gt;
**CPhidgetStepper_getMotorStopped&lt;br /&gt;
**CPhidgetStepper_setCurrentMotorPosition&lt;br /&gt;
*removed CPhidgetStepper_setVelocity&lt;br /&gt;
*added CPhidgetStepper_setMaxVelocity, CPhidgetStepper_getMaxVelocity&lt;br /&gt;
===2.1.3.20080114===&lt;br /&gt;
*Added new functions to Flash API&lt;br /&gt;
*Added new functions to Webservice Protocol&lt;br /&gt;
*Added new functions to COM Library&lt;br /&gt;
*Added new functions to Java Library&lt;br /&gt;
*All device fiels in C library cleaned up and made consistent&lt;br /&gt;
*Open in windows is exclusive - this needs to be tested for stability&lt;br /&gt;
*No data will be returned / accepted if it lies outside of max/min range&lt;br /&gt;
*if a data value is unknown, user variable is set to PUNK_INT, PUNK_DBL, or PUNK_BOOL, and return value is EPHIDGET_UNKNOWNVAL&lt;br /&gt;
*Proper Device initializations on Attach:&lt;br /&gt;
**triggers are set to defaults on attach&lt;br /&gt;
**device state is read in and preserved on attach&lt;br /&gt;
**during attach event, all sensor data, etc. is provided if available&lt;br /&gt;
**no data events until after the attach event returns&lt;br /&gt;
**everything initialized by the time waitForAttachment returns&lt;br /&gt;
**after attach event returns, a full set of initial state data events are thrown&lt;br /&gt;
*.NET collections are readonly, and never NULL (but empty when phidget detached)&lt;br /&gt;
*.NET callbacks no longer catch and hide all exceptions&lt;br /&gt;
**make sure to use try/catch blocks especially in Attach when accessing properties that may not be initialized.&lt;br /&gt;
*added min/max functions:&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMax&lt;br /&gt;
**CPhidgetAccelerometer_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMax&lt;br /&gt;
**CPhidgetAdvancedServo_getAccelerationMin&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMax&lt;br /&gt;
**CPhidgetAdvancedServo_getVelocityMin&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetAdvancedServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMax&lt;br /&gt;
**CPhidgetMotorControl_getAccelerationMin&lt;br /&gt;
**CPhidgetPHSensor_getPHMax&lt;br /&gt;
**CPhidgetPHSensor_getPHMin&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMax&lt;br /&gt;
**CPhidgetPHSensor_getPotentialMin&lt;br /&gt;
**CPhidgetServo_getMotorPositionMax&lt;br /&gt;
**CPhidgetServo_getMotorPositionMin&lt;br /&gt;
**CPhidgetStepper_getAccelerationMax&lt;br /&gt;
**CPhidgetStepper_getAccelerationMin&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMax&lt;br /&gt;
**CPhidgetStepper_getMotorSpeedMin&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMax&lt;br /&gt;
**CPhidgetStepper_getMotorPositionMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getPotentialMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperatureMin&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMax&lt;br /&gt;
**CPhidgetTemperatureSensor_getTemperatureMin&lt;br /&gt;
*Added functions:&lt;br /&gt;
**CPhidgetTemperatureSensor_getAmbientTemperature&lt;br /&gt;
**CPhidgetTemperatureSensor_getThermocoupleType&lt;br /&gt;
**CPhidgetTemperatureSensor_setThermocoupleType&lt;br /&gt;
**CPhidget_set_OnServerConnectHandler&lt;br /&gt;
**CPhidget_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetDictionary_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerConnectHandler&lt;br /&gt;
**CPhidgetManager_set_OnServerDisconnectHandler&lt;br /&gt;
**CPhidgetDictionary_getServerID&lt;br /&gt;
**CPhidgetDictionary_getServerAddress&lt;br /&gt;
**CPhidgetDictionary_getServerStatus&lt;br /&gt;
**CPhidgetManager_getServerID&lt;br /&gt;
**CPhidgetManager_getServerAddress&lt;br /&gt;
**CPhidgetManager_getServerStatus&lt;br /&gt;
**CPhidgetServo_setMotorOn&lt;br /&gt;
**CPhidgetServo_getMotorOn&lt;br /&gt;
*Removed functions:&lt;br /&gt;
**CPhidgetServo_setMotorOff&lt;br /&gt;
*TemperatureSensor:&lt;br /&gt;
**Ambient sensor is accessed with it&#039;s own function&lt;br /&gt;
**first thermocouple is Index 0 everywhere&lt;br /&gt;
**no ambient sensor events&lt;br /&gt;
*getServerID is implemented&lt;br /&gt;
*changed the internal network structure (added CPhidgetRemote)&lt;br /&gt;
*reworked the USB code (mostly on Windows)&lt;br /&gt;
**Better handles closing, ESD events, timeouts&lt;br /&gt;
**fixed issues with Encoder, RFID stopping reading after a certain time.&lt;br /&gt;
**added USB error flag&lt;br /&gt;
*openRemote functions have been implemented&lt;br /&gt;
**these require bonjour (mac / windows) or avahi (linux) to be installed on both the client and server&lt;br /&gt;
**if they are not, you get EPHIDGET_UNSUPPORTED when you call them&lt;br /&gt;
*openRemoteIP functions are asynchronous and persistent&lt;br /&gt;
*include cphidgetconstants.h in phidget21.h for users&lt;br /&gt;
===2.1.2.20071108===&lt;br /&gt;
*start of chagelog&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=23869</id>
		<title>OS - Phidget SBC</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=23869"/>
		<updated>2016-08-11T17:52:49Z</updated>

		<summary type="html">&lt;p&gt;Patrick: /* Quick Downloads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
{{OSLang|[[File:icon-Linux.png|64x64px|link=OS - Linux]]|On the Single Board Computer (SBC), Phidgets can be either plugged directly into one of the USB ports or run over a network using the [[#WebService | WebService]].}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Unlike our other supported operating systems, the SBC &#039;&#039;&#039;does not require downloads&#039;&#039;&#039; unless you are doing something advanced like loading the firmware or developing your own kernel.  You will know if you need these downloads, otherwise, the SBC should work as described on the [[1073 User Guide#Getting Started|SBC3 Getting Started Guide]] right out of the box.&lt;br /&gt;
&lt;br /&gt;
*[[Software License]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC (1070):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc-minimal.bin Minimal Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc-full.bin Full Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/buildroot-phidgetsbc.tar.gz Buildroot/Kernel Sources]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC2 (1072):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc2/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc2.bin SBC2 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC2 Kernel Development Package] (How-to and patch file)&lt;br /&gt;
&#039;&#039;&#039;The PhidgetSBC3 has different firmware packages based on the kernel version. In order to determine the device version of your SBC3, see the [[1073_User_Guide#SBC_Web_Interface|web configuration page]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:sbcver.jpg|thumb|562px|link=|The system information table is found on the Status -&amp;gt; System tab of the &#039;&#039;&#039;[[1073_User_Guide#SBC_Web_Interface|web configuration page]]&#039;&#039;&#039; of the SBC.]]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.6.3:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc3/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3_1.0.0.20121213.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-kerneldev_1.0.0.20121213.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-upgrade_3.6.3_3.14.27.tar.gz SBC3 Kernel upgrade package (3.6.3 -&amp;gt; 3.14.27)]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.14.27:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc3/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3_1.0.2.20160425.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-update_3.14.27.tar.gz SBC3 Kernel update package (3.14.27)]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-kerneldev_1.0.2.20160425.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Note that, instead of using the firmware to update your SBC, updates should normally be done via the System -&amp;gt; Packages page on your SBC3 web interface. It is rarely necessary to completely re-flash your device..&lt;br /&gt;
&amp;lt;br clear = all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Getting Started with the Phidget SBC Debian Linux==&lt;br /&gt;
&lt;br /&gt;
The Single Board Computer (SBC) is a unique Phidget.  It is a computer with a Linux operating system.  It can compile code, save files, manage background jobs, host information over the web, and more.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If this is your first time&#039;&#039;&#039; using the Phidget SBC, you will want to start with the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  After that, here we will get you started on topics beyond those in the getting started guide, including how to write Phidget code to run on the SBC.  You &#039;&#039;&#039;do not need this page&#039;&#039;&#039; if you are simply using the SBC to broadcast data from Phidgets over the network - it does that automatically.  We describe how to verify and use this in the [[1073 User Guide#Getting Started | Getting Started Guide]].&lt;br /&gt;
&lt;br /&gt;
This page will show you how to:&lt;br /&gt;
* Install the ability to write and develop code on the SBC itself&lt;br /&gt;
* Use the command line for basic coding tasks&lt;br /&gt;
* Troubleshoot the SBC&#039;s network&lt;br /&gt;
It will also give additional specifications, which are useful for doing more advanced things with the SBC hardware and software.&lt;br /&gt;
&lt;br /&gt;
Before reading this page, you should have done the following via the Getting Started Guide:&lt;br /&gt;
* Set up networking on your SBC, via either Ethernet or wireless&lt;br /&gt;
* Set up an admin password&lt;br /&gt;
* Learned the IP address or link local address of the SBC&lt;br /&gt;
We will use this information in setting up the libraries and drivers to use the SBC for writing and running code.&lt;br /&gt;
&lt;br /&gt;
Conceivably, you could simply use the SBC like any Linux computer, and do all of your development and compiling of Phidget code on the SBC itself.  In practice this gets complicated as the SBC does not have a keyboard or screen.  So usually, you will want to develop your code an external computer and copy files and settings over to the SBC via a network.  This makes this Getting Started section unique, in that we show you how to set up both computers:&lt;br /&gt;
* Your [[#Getting Started - External Computer | External Development Computer]], usually your main desktop or laptop which will transfer files and settings to and from the SBC&lt;br /&gt;
* The [[#Getting Started - The SBC (Debian Linux) | SBC]] itself, which needs programming language libraries to use Phidgets.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - External Computer===&lt;br /&gt;
&lt;br /&gt;
You have two ways to connect to the SBC from an external computer: via the [[#SBC Web Interface|SBC Web Interface]] and over the more powerful but complex [[#SSH | Secure Shell (SSH)]].&lt;br /&gt;
&lt;br /&gt;
====SBC Web Interface====&lt;br /&gt;
&lt;br /&gt;
You have already worked extensively with the web interface in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  This was the tool within a web browser which was opened either via the [[Phidget Control Panel]] on Windows, or by simply entering the IP or link local address into an internet browser.  It allowed you to set the password, set up internet connectivity, and so on.  &lt;br /&gt;
&lt;br /&gt;
This section doesn&#039;t have more information on the interface; rather, it simply serves as a reminder that you have the web interface as an available tool.  Examples, including screenshots, are placed where appropriate in this document.  The web interface will probably stay your initial go-to way to connect to the SBC, especially for tasks that benefit from graphical interaction, like setting up wireless or using the webcam.&lt;br /&gt;
&lt;br /&gt;
====SSH====&lt;br /&gt;
&lt;br /&gt;
The most flexible way to transfer files and commands to and from the SBC is via a program called &#039;&#039;&#039;ssh&#039;&#039;&#039;.  The ssh program provides command line text access over a network into the SBC.  Using it, you can run programs and give the SBC commands.  The ssh program has a companion program called &#039;&#039;&#039;scp&#039;&#039;&#039; which can copy files back and forth.  If you are unfamiliar with ssh, you can think of it like the command line or a Mac terminal, but with a remote connection to a different computer.  It is a minimal yet effective way to interact with a remote computer.&lt;br /&gt;
&lt;br /&gt;
Before connecting over ssh, you will need:&lt;br /&gt;
* The &#039;&#039;&#039;IP address&#039;&#039;&#039; (such as 168.254.3.0) or &#039;&#039;&#039;link local address&#039;&#039;&#039; (such as phidgetsbc.local) of the SBC&lt;br /&gt;
* The &#039;&#039;&#039;admin password&#039;&#039;&#039; for the SBC&lt;br /&gt;
Both of these items can be found by following the steps in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].&lt;br /&gt;
&lt;br /&gt;
You will also need to enable SSH on the SBC side.  This can be done through the [[#SBC Web Interface| Web Interface]], under {{Code|Network &amp;amp;rarr; Settings}}, by changing the &#039;&#039;SSH Server&#039;&#039; radio button to &#039;&#039;Enabled&#039;&#039; and saving your changes:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_turn_on_ssh.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
=====SSH on Windows=====&lt;br /&gt;
&lt;br /&gt;
The ssh program is not installed on Windows by default.  But, there are a variety of SSH programs available for free. One simple and commonly used program is [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY], and it has the advantage that the executable doesn&#039;t need to install, it just runs.&lt;br /&gt;
&lt;br /&gt;
With PuTTY, when you first run the program it will ask you what to connect to.  Enter the IP address or link local address of the SBC, and then click the SSH radio button right below the address, which will change the port to 22.  Then click open, and you&#039;ll have an ssh connection to the SBC open in a terminal.  It will prompt you for a user name ({{Code|root}}) and password (the admin password).&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, there is an SCP component to PuTTY, called PSCP, which is available from the same [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY download page].  Use of PSCP will be similar with the address, username, and password, except that you will be transferring files instead of sending commands.&lt;br /&gt;
&lt;br /&gt;
=====SSH on Linux and Mac OS=====&lt;br /&gt;
&lt;br /&gt;
Linux and Mac OS already have ssh installed by default.  To run ssh simply open a terminal...&lt;br /&gt;
* {{Code|Ctrl-Alt-T}} on Linux &lt;br /&gt;
* {{Code|Applications &amp;amp;rarr; Utilities &amp;amp;rarr; Terminal}} on Mac OS &lt;br /&gt;
...and type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
ssh root@phidgetsbc.local&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have re-named your SBC, include that name instead of the {{Code|phidgetsbc.local}} link address.  Or, you can use the SBC&#039;s IP address, e.g. something like {{Code|ssh root@168.254.3.0}}&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, the command follows the form of: {{Code|scp from to}}&lt;br /&gt;
&lt;br /&gt;
So, to copy a file {{Code|/root/data.txt}} from the SBC to your local machine, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
scp root@phidgetsbc.local:/root/data.txt .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note the use of the dot &#039;&#039;&#039;.&#039;&#039;&#039; to indicate that scp should put the file in the current local directory.   If you&#039;re not sure what folder the terminal is operating in type {{Code|pwd}} to print the working directory.  Terminals usually start by default in your home folder.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - The SBC (Debian Linux)===&lt;br /&gt;
&lt;br /&gt;
The SBC runs Linux, which is a full operating system. It is stripped down compared to a full desktop release of Linux, but you can compile code on it, run programs, schedule tasks, create and manage files, run a web server, and much, much more.&lt;br /&gt;
&lt;br /&gt;
At this point you have connected to the SBC via the [[#SBC Web Interface|web interface]], and probably also through [[#SSH|SSH]].  This section will help you install libraries and drivers that you probably want - i.e. support for C, Java, and Python.  After this section, you&#039;ll be well into the depths of using the SBC as a computer, and so you&#039;ll probably want to keep the [[#Using SBC Linux|Using SBC Linux section]] open for reference while you work if you are not already familiar with Linux.&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the following Phidget functionality installed:&lt;br /&gt;
* The Phidget C libraries {{Code|libphidget21.so}}&lt;br /&gt;
* The Phidget [[#WebService | WebService]]&lt;br /&gt;
(If you are simply curious what these are and how they get installed, we describe the process on the [[OS - Linux | general Linux page]].)&lt;br /&gt;
&lt;br /&gt;
But to compile C programs, or run Java programs, or use Python, you will need to install these languages onto the SBC.  &lt;br /&gt;
&lt;br /&gt;
Before installing anything on the SBC, however, (even via a button on the web interface) make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
====Installing C/C++ and Java====&lt;br /&gt;
&lt;br /&gt;
The simplest way to install C/C++  and Java on the SBC is via the web interface.  There is a button under {{Code|System &amp;amp;rarr; Packages}} to install C support (including {{Code|gcc}}) and another button to install Java support:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_packages_web.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
You have to check that you are running the same version of Java on your development machine (where you plan on compiling the java programs) as the SBC is running. To do this type the following into the terminal on your computer and from ssh on the SBC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
Java -version&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need to update the version of Java on your SBC, use the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install openjdk-7-jre-headless&lt;br /&gt;
su&lt;br /&gt;
update-alternatives --config java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you&#039;re ready to begin programming.  We have programming pages for both [[Language - C/C++|C/C++]] and for [[Language - Java|Java]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].  &lt;br /&gt;
&lt;br /&gt;
If you want to avoid using the [[#SSH|SSH]] interface on the SBC entirely, and you want to write your program in Java and run it continuously from boot (which is the only option if you want to avoid [[#SSH|SSH]]), we have a [[#Program in Java with the Web Interface|very in-depth section]] on that topic.&lt;br /&gt;
&lt;br /&gt;
====Installing Python====&lt;br /&gt;
&lt;br /&gt;
Installing Python has two steps.  First, you&#039;ll need to install the basic ability to run python, and then you&#039;ll need to install the Phidget Python module.  Both steps (and both options) require that you issue the relevant commands through an [[#SSH|SSH terminal]].&lt;br /&gt;
&lt;br /&gt;
=====Basic Python=====&lt;br /&gt;
&lt;br /&gt;
The base Python functionality can be downloaded and installed in one step with [[#apt|apt]] (i.e. in a terminal, type):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will give you Python, and now you just have to install the Phidget Python module to gain Phidget functionality. If the installation fails because it can&#039;t find python, you need to enable the full repository as described in [[#Getting Started_-_The_SBC_(Debian_Linux)|this section]], and then perform an apt-get update.&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 1: Use a USB Key=====&lt;br /&gt;
&lt;br /&gt;
Copy the [{{SERVER}}/downloads/libraries/PhidgetsPython.zip Python Libraries] onto a USB key.  Unpack the zip file into a folder on the USB key.  Insert the key into the SBC.&lt;br /&gt;
&lt;br /&gt;
You will have to figure out where the USB key (and the Phidget Python library folder) is now located.  We describe how in the general [[#Using USB Data Keys | Using USB Data Keys]] section.&lt;br /&gt;
&lt;br /&gt;
After you know the place where the USB key is mounted, in a terminal go to that directory (e.g. type {{Code|cd /media/usb0/}}), enter the unpacked Phidget Python Library folder, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have an whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 2: Use the Internet=====&lt;br /&gt;
&lt;br /&gt;
Rather than using a USB key to transfer the file, the SBC can download it directly from the internet.  You will need {{Code|wget}} and {{Code|unzip}} installed, both of which are small:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install wget&lt;br /&gt;
apt-get install unzip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the web link address for the [{{SERVER}}/downloads/libraries/PhidgetsPython.zip Python Libraries].&lt;br /&gt;
&lt;br /&gt;
In an SSH terminal to the SBC, type: {{Code|wget http://www.python_library_link}} where instead of http://www.python_library_link you insert the link you just copied. Copying into a terminal can usually be done via the right-click menu.&lt;br /&gt;
&lt;br /&gt;
This will download the Phidget python libraries to the folder you ran the {{Code|wget}} command in.  Unzip the downloaded file using the command {{Code|unzip file}}, where file is the filename from {{Code|wget}}. Or try typing {{Code|ls}} to list the names of a file in the directory, which should include the unzipped folder.  Enter the unzipped folder (e.g. use {{Code|cd}} to change directory), and install the Phidget Python libraries:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have a whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
====Installing Other Languages====&lt;br /&gt;
&lt;br /&gt;
You may also be able to program on the SBC using [[Language - Ruby|Ruby]] and [[Language - C Sharp|C# under Mono]], though we do not offer in-depth support for these languages on the SBC.  The installation procedures should more or less follow that of [[#Installing Python|installing python]] on the SBC, except you will be installing Ruby or Mono.  Performing package searches using [[#apt|apt cache search]] can help you find the relevant software.&lt;br /&gt;
&lt;br /&gt;
For C#, as of 2012 the {{Code|mono-complete}} package is broken on the Debian Squeeze repository.  Rather, you have to install the Mono runtime and Mono compiler separately.&lt;br /&gt;
&lt;br /&gt;
To install the runtime package (and its dependencies), use [[#apt|apt]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-runtime&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to install the C# compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-gmcs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or the Visual Basic compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-vbnc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, the system and library packages do not link correctly for the version 2.0 of Mono.  If this is the case, your code will compile fine, but when you try to run it, you will get an error like:&lt;br /&gt;
&lt;br /&gt;
:{{Code|The assembly mscorlib.dll was not found or could not be loaded.}}&lt;br /&gt;
:{{Code|It should have been installed in the `/usr/lib/mono/1.0/mscorlib.dll&#039; directory.}}&lt;br /&gt;
&lt;br /&gt;
In this case, you need to install these two packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libmono-corlib1.0-cil&lt;br /&gt;
apt-get install libmono-system1.0-cil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we found these packages to work by working through the tree structure.  As a general rule, you can find these dependencies by using install (here, {{Code|apt-get install mono-complete}}) to get a sense of the package tree structure.  This will possibly tell you that the packages are broken, but at the same time this will list the dependencies of the packages.  Trying to install individual dependencies will show you that although a root-package fails, the sub-packages will sometimes succeed, and install what you need.&lt;br /&gt;
&lt;br /&gt;
If you want to use a specific dll or library that is not available in this reduced version of mono, you can install mono complete by switching from Emdebian+Debian to just Debian.  To do this:&lt;br /&gt;
&lt;br /&gt;
In {{Code|/etc/apt/preferences}} make the following changes:&lt;br /&gt;
:{{Code|Package: *}}&lt;br /&gt;
:{{Code|&amp;lt;nowiki&amp;gt;Pin: release a=stable&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
:{{Code|Pin-Priority: 1010}}&lt;br /&gt;
	&lt;br /&gt;
In {{Code|/etc/apt/sources.list/mutistrap-debian.list}} remove the emdebian line.&lt;br /&gt;
&lt;br /&gt;
Apply the changes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get dist-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many packages will be &#039;downgraded&#039; from the emdebian to debian versions.  Delete the {{Code|&amp;lt;nowiki&amp;gt;/etc/apt/preferences&amp;lt;/nowiki&amp;gt;}} file and install mono-complete:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install monodoc-http mono-complete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Choose monodoc-http explicitly, because otherwise the install fails on monodoc-browser.&lt;br /&gt;
&lt;br /&gt;
After this process, you can compile your C# Code.cs Phidget source file the same way as on a generic [[Language - C Sharp#Linux|Linux with Mono]] system.  Please refer to that page on how to obtain the *.dll Phidget resource file and compile your code.  On the SBC, however, because you are already running as root (the Super User), you do not need &#039;sudo&#039; and indeed the SBC will give you an error if you use it.  Instead, compiling and running will look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
gmcs Code.cs -r:Phidget21.NET.dll&lt;br /&gt;
mono Code.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using SBC Linux==&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve set up communication with the SBC, and installed whichever programming language support you need, you&#039;re probably ready for a short tour of useful tools on the SBC&#039;s version of Linux.&lt;br /&gt;
&lt;br /&gt;
First, you will by default be running on the SBC as &#039;&#039;&#039;root&#039;&#039;&#039;, which is the super-user.  For Linux users, this probably makes you nervous because you know you can overwrite important system files without the system asking for additional permission.  As a Windows or Mac OS user - although you may usually run your computer as an administrator - your familiar system usually prompts you to confirm before you do anything really dangerous, and this will &#039;&#039;&#039;not&#039;&#039;&#039; happen on the SBC as the root user.&lt;br /&gt;
&lt;br /&gt;
Next, there is no installed help on the SBC.  Help on Linux is usually called &#039;man pages&#039; which is short for &#039;the manual pages&#039;.  On a full Linux system, usually if you need help with any command you can type, for example, {{Code|man ls}} and it will give you help with the program [[#ls|ls]].  But these help pages take up significant space, and they are widely available online.  So, if you need more help with a certain command, you can always type {{Code|man command}} into your favourite search engine.&lt;br /&gt;
&lt;br /&gt;
Finally, the SBC has no windowing system.  For Linux users, this means no X-windows (Gnome, KDE, etc).  And as a Windows or Mac user, you can think of it as running all of your programs and commands through the terminal or DOS prompt command line.  The SBC provides all of the functionality of an operating system (e.g. process scheduling, file management, etc) but without any graphical interface.  The only exception is the [[#SBC Web Interface|web interface]], which gives graphical access to a limited part of what the SBC can do.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands===&lt;br /&gt;
&lt;br /&gt;
If you are doing more with the SBC than simply running pre-written programs [[#Writing a Phidget Program|in Java to run continuously from boot]], you will be interacting with the SBC&#039;s Linux operating system over the command line by using [[#SSH|SSH]].  This section discusses useful programs already installed on the SBC, and how to run them on the command line.&lt;br /&gt;
&lt;br /&gt;
====ls====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;ls&#039;&#039;&#039; program lists the contents of a directory.&lt;br /&gt;
&lt;br /&gt;
It will show both files and folders, but not files that start with a &amp;quot;.&amp;quot; (these are hidden files on Linux).&lt;br /&gt;
*If you also want to show hidden files, use {{Code|ls -a}}&lt;br /&gt;
*If you want more information, such as size and date modified, use {{Code|ls -l}}&lt;br /&gt;
*Commands can be combined, like {{Code|ls -al}}&lt;br /&gt;
&lt;br /&gt;
====cd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cd&#039;&#039;&#039; program changes to a new directory.&lt;br /&gt;
&lt;br /&gt;
For example, {{Code|cd /root}} changes into the directory at the base of the file tree called &#039;&#039;root&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* Linux uses forward slashes&lt;br /&gt;
* The base of all directories is &amp;quot;/&amp;quot; (not &amp;quot;C:\&amp;quot;)&lt;br /&gt;
* The tilde symbol (~) is short for your home directory (i.e. when you are root, this is short for &amp;quot;/root&amp;quot;)&lt;br /&gt;
* The double dot &amp;quot;..&amp;quot; means move one directory higher (for example from {{Code|/root/data/}} to {{Code|/root/}})&lt;br /&gt;
&lt;br /&gt;
====pwd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;pwd&#039;&#039;&#039; program prints the current directory you are working in.  (&#039;P&#039;rint &#039;W&#039;orking &#039;D&#039;irectory)&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
:{{Code|root@phidgetsbc:~# pwd}}&lt;br /&gt;
:{{Code|/root}}&lt;br /&gt;
&lt;br /&gt;
====cp, mv, and rm====&lt;br /&gt;
&lt;br /&gt;
These programs are copy (&#039;&#039;&#039;cp&#039;&#039;&#039;), move (&#039;&#039;&#039;mv&#039;&#039;&#039;), and remove (&#039;&#039;&#039;rm&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Copy copies a file from one location and pastes it to another.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|cp data.txt data_backup.txt}} will put a copy of the file {{Code|data.txt}} into {{Code|data_backup.txt}}&lt;br /&gt;
&lt;br /&gt;
Move moves a file (this is also useful for renaming files) to a new destination.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|mv data.txt data_backup.txt}} will put the contents of {{Code|data.txt}} into {{Code|data_backup.txt}}, and then will remove {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Remove deletes a file.&lt;br /&gt;
&lt;br /&gt;
For example, typing {{Code|rm data.txt}} will delete {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Note that &#039;&#039;&#039;rm&#039;&#039;&#039; is final.  Once you remove a file using {{Code|rm}}, it is gone forever.  There is no recycle bin, no temporary trash, nothing other than backups you may have personally created in the past!&lt;br /&gt;
&lt;br /&gt;
Directories can only be removed with {{Code|rmdir}}, and then only if they are empty.  If you want to remove a directory and all the files in it, use {{Code|rm -rf directory}} but be &#039;&#039;&#039;very, very careful&#039;&#039;&#039; with this command.  Trying to remove everything within a directory (e.g. {{Code|rm -rf *}}) is one of the most dangerous commands you can run on a Linux system, as running it from the wrong directory will result in Linux happily removing everything under that directory -- which could be your entire filesystem.&lt;br /&gt;
&lt;br /&gt;
====find====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;find&#039;&#039;&#039; program does what it says - it finds things.  &lt;br /&gt;
&lt;br /&gt;
Unfortunately for the casual user, the find program is very flexible and powerful, and thus not especially intuitive to use.  But, here are some examples:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|find folder -name file.txt}}&lt;br /&gt;
| Looks for all files in a folder (/ for root - or all - folders) with a certain name (* for wildcard)&lt;br /&gt;
| {{Code|find / -name *.jpg}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|find folder -mtime +X}}&lt;br /&gt;
| Looks for all files in a folder modified less than X days ago&lt;br /&gt;
| {{Code|find /root -mtime +30}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====grep====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;grep&#039;&#039;&#039; program takes text input and searches for a term. &lt;br /&gt;
&lt;br /&gt;
For example, if you type {{Code|mount}} to view what devices are mounted (e.g. loaded) on your SBC, you will see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may be a lot of information you don&#039;t need.  If you are only interested in a USB key attachment (as described in the [[#Using USB Data Keys|Using USB Data Keys]] section), you can use grep to filter that one response:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep sda1&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====nano====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;nano&#039;&#039;&#039; program is a small text editor that you can use within an SSH terminal. &lt;br /&gt;
&lt;br /&gt;
Nano can be surprisingly useful for writing short lengths of code right on the SBC, so there is no need to transfer files and keep track of different file versions on different computers.&lt;br /&gt;
&lt;br /&gt;
Nano has all keyboard commands which are listed at the bottom of the screen at all times as a reminder (Ctrl-O to save, Ctrl-X to exit, these expand with a larger terminal window).  And, nano provides what is called &#039;syntax highlighting&#039;, which colours reserved keywords, comments, strings, and so on as appropriate to the programming language you are using.  Nano detects the programming language via the extension of the file ({{Code|.java}} for Java, {{Code|.c}} for C/C++, and {{Code|.py}} for Python).&lt;br /&gt;
&lt;br /&gt;
Typing {{Code|nano test.py}} on an SSH command line and then entering a few lines of Python into the new empty file results in:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_nano_python.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
====apt====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;apt&#039;&#039;&#039; program allows you to install, uninstall, upgrade, and search software available for the SBC.&lt;br /&gt;
For a non-Linux user, the apt framework may be daunting at first, but it actually allows you to keep your system up to date and install and manage software quickly, easily, and for free.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Before installing anything on the SBC, make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-cache search term}}&lt;br /&gt;
| Looks for all programs (packages) that have {{Code|term}} in the title or description&lt;br /&gt;
| {{Code|apt-cache search opencv}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-cache show package}}&lt;br /&gt;
| Shows a lot of data about {{Code|package}} including size, version, etc&lt;br /&gt;
| {{Code|apt-cache show unzip}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-get update}}&lt;br /&gt;
| Gets the most recent listing of available software&lt;br /&gt;
| {{Code|apt-get update}}  (No options)&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-get install program}}&lt;br /&gt;
| Installs {{Code|program}} from the internet&lt;br /&gt;
| {{Code|apt-get install python}}&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====mount====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|mount}} shows you all of the mounted devices on your SBC.  &lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the non-Linux user, the concept of a device may be quite strange.  To give a short summary, everything on Linux that you can read or write is a file.  Webcams are files (i.e. you can &#039;read&#039; photos from them), USB keys are files, and each filesystem (tmp storage, the kernel portion, the main filesystem) are also themselves files.  These files specify what and how something can be written.  These are not necessarily linear, for example, you can see above that the USB key ({{Code|/media/usb0}} is mounted &#039;&#039;within&#039;&#039; the root file system {{Code|rootfs}} which is /.   &lt;br /&gt;
&lt;br /&gt;
So mount gives you an idea of what devices have been &#039;mounted&#039; for reading or writing, and how you can read and write to them.  More information on mount (and its various forms, like {{Code|umount}}) is available widely around the Internet.&lt;br /&gt;
&lt;br /&gt;
====which====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|which}} tells you if and where a program is installed.&lt;br /&gt;
&lt;br /&gt;
For example, on a default SBC, typing {{Code|which python}} will return no results.  But after successfully [[#Installing Python | installing python]], it will return {{Code|/usr/bin/python}} as the location of the python program/binary/executable.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands to Install===&lt;br /&gt;
&lt;br /&gt;
These are other programs you may find useful on the command line.  Although they are not on the SBC by default, these and other programs can usually be installed simply by using [[#apt|apt-get install]], with the exception of gcc.  For example, {{Code|apt-get install wget}} will download and install [[#wget|wget]].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This section and the section on [[#Some Useful Commands|pre-installed commands]] can hardly cover all of the complexities and power of the Linux operating system.  There are many excellent tutorials online, and between them and using [[#apt|apt]] to find and install programs you should be able to learn a lot and perform any number of complex useful tasks.&lt;br /&gt;
&lt;br /&gt;
====gcc====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;gcc&#039;&#039;&#039; program is the C compiler for Linux.&lt;br /&gt;
&lt;br /&gt;
If you are an experienced C/C++ user on Mac or Linux, or if you&#039;ve already read our [[Language - C/C++ | C Language page]], you might think you need to install gcc via {{Code|apt-get}} to compile C code.  However, gcc is not in the package repository for the SBC, so {{Code|apt-get install gcc}} will fail.  Rather, to install gcc, you can do it via the web interface, as described in the [[#Installing C/C++ and Java|Installing C/C++ and Java]] section.&lt;br /&gt;
&lt;br /&gt;
After installing it via the SBC web interface, you can use {{Code|gcc}} normally.&lt;br /&gt;
&lt;br /&gt;
====less====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;less&#039;&#039;&#039; program displays the contents of a text or source code file.  When displaying the file, {{Code|less}} allows you to scroll up and down to read it.&lt;br /&gt;
&lt;br /&gt;
This is useful if you are writing your sensor readings to a data file, and you want to read the data file while it is being written by your main code.  If your data file is called {{Code|data.txt}}, you can type {{Code|less data.txt}} and see the lines in the file, and what they are.&lt;br /&gt;
&lt;br /&gt;
The {{Code|less}} program output can also be piped into another program.  For example, you can use {{Code|less}} and the word search program {{Code|grep}} to find lines within a file with a search term.  For instance, if you have a C source code file {{Code|Program.c}} on the SBC, and you want to see all the lines in {{Code|Program.c}} that contain a variable name {{Code|var}}, you can type: &lt;br /&gt;
:&amp;lt;code&amp;gt;less Program.c | grep var&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====wget====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;wget&#039;&#039;&#039; program allows you to get an online file (over http) and download it to the SBC.&lt;br /&gt;
&lt;br /&gt;
For example, to get the source file (HTML) from the Phidgets home page, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
wget http://www.phidgets.com&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is most useful for downloading libraries, drivers, or anything (zip, tar, etc) you need from the web which is not available by [[#apt|using apt]].&lt;br /&gt;
&lt;br /&gt;
===Writing a Phidget Program===&lt;br /&gt;
&lt;br /&gt;
We provide two ways to write and upload a Phidget Program:&lt;br /&gt;
# The [[#SBC Web Interface|web interface]]:&lt;br /&gt;
#* This is useful for simple projects written in Java that you want to start only at boot&lt;br /&gt;
#* You can also use C projects, but they must be compiled off the SBC for an ARM processor&lt;br /&gt;
# Over [[#SSH|SSH]], which will allow you to write or transfer source code directly to and from the SBC&lt;br /&gt;
#* This is useful for all other projects, such as:&lt;br /&gt;
#** Projects that run at scheduled times (e.g. once per minute)&lt;br /&gt;
#** Projects that use languages other than Java or ARM-compiled C&lt;br /&gt;
Note that you can still run an [[#SSH|SSH]] project at boot, you just have to write and install a startup script.  This is a bit complex, but we do have an example that starts the program {{Code|phidgetwebservice21}} [[OS - Linux#As A Service|at boot using a script]].&lt;br /&gt;
&lt;br /&gt;
Once you know which method you&#039;d like to use, you can continue on to learn how to [[#Program in Java with the Web Interface|Program in Java with the Web Interface]], or how to [[#Program with SSH|Program with SSH]] using Java, C, or Python.  If you are actually typing in source code on the SBC, you&#039;ll find our [[#Developing Code on the SBC|developing code on the SBC section]] useful.&lt;br /&gt;
&lt;br /&gt;
====Program in Java with the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To show how to write, compile, and install Java programs on the SBC, we&#039;ll use the [[Language - Java|Java Hello World]] example code.  You can download the HelloWorld example by downloading the whole [{{SERVER}}/downloads/examples/JavaJNI.zip Java example package].  Make sure you have the same version of [[#Installing C/C++ and Java|Java installed on the SBC]] as you have on your external development machine. Instruction for checking and updating are found on the [[#Installing C/C++ and Java|installation page]].&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how to get the HelloWorld code running on the SBC.  On your external computer:&lt;br /&gt;
&lt;br /&gt;
1. Download the SBC version of the Phidget Java libraries ({{Code|phidget21.jar}}).  You can download this from the [[#SBC Web Interface|web interface]], on the page under {{Code|Projects &amp;amp;rarr; Projects}}, under the &#039;&#039;&#039;Notes&#039;&#039;&#039; section.&lt;br /&gt;
&lt;br /&gt;
2. Place the SBC version of {{Code|phidget21.jar}} into a directory on your external computer.  This will be your working directory that you will use to compile the Java files.&lt;br /&gt;
&lt;br /&gt;
3. Also copy the {{Code|HelloWorld.java}} file into that working directory.&lt;br /&gt;
&lt;br /&gt;
4. Compile the {{Code|HelloWorld.java}} file from within that working directory.  From the command line prompt on Windows, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .;phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In a terminal on Linux or Mac OS, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. You should now have three compiled class files: {{Code|HelloWorld.class}}, {{Code|HelloWorld$1.class}}, and {{Code|HelloWorld$2.class}}.  You don&#039;t need to try and run them, and if you do you may encounter an error because the SBC {{Code|phidget21.jar}} may be slightly different than the Phidget support you have installed on your external computer.&lt;br /&gt;
&lt;br /&gt;
Now we move onto the SBC:&lt;br /&gt;
&lt;br /&gt;
6. Create a new project on the SBC, in the web interface under {{Code|Projects &amp;amp;rarr; Projects}}.  Call it HelloWorld:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_create_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
7. On the next screen, you will be prompted to upload your files.  We will upload the three Java class files, and then click the {{Code|Start}} button:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_web_run_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
8. You&#039;ll note that as it runs, there are two links below the {{Code|Stop}} button: One called {{Code|stdout}}, which is &#039;&#039;Standard Output&#039;&#039;, and one called {{Code|stderr}}, which is &#039;&#039;Standard Error&#039;&#039;.  Usually, when you run a program on the command line, you see both standard out and standard error at the same time - i.e. you get all program output right there in your terminal or command prompt.  But when running a program in the background, Linux splits the output up into normal output and error output as this is very useful for debugging (i.e. you can check if standard error is empty).  &lt;br /&gt;
&lt;br /&gt;
Here, however, if you&#039;re not sure whether the program will run correctly, you should first check {{Code|stderr}} to see if any errors were generated, and then check {{Code|stdout}} to see if the output looks as expected.&lt;br /&gt;
&lt;br /&gt;
To write your own Java program, follow the same process but use your own source code instead of the {{Code|HelloWorld.java}} example.&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, we offer additional help on [[#Via the Web Interface|running a program automatically using the web interface]].&lt;br /&gt;
&lt;br /&gt;
====Program with SSH====&lt;br /&gt;
&lt;br /&gt;
Similarly to starting a program via the [[#Program in Java with the Web Interface|web interface]], we use the Phidget Java {{Code|HelloWorld}} example here.&lt;br /&gt;
&lt;br /&gt;
Make sure you have [[#Installing C/C++ and Java|Java installed on the SBC]].  To compile and run the {{Code|HelloWorld}} example:&lt;br /&gt;
&lt;br /&gt;
1. Open an [[#SSH|SSH terminal]] to the SBC&lt;br /&gt;
&lt;br /&gt;
2. Download the [{{SERVER}}/downloads/examples/JavaJNI.zip Phidget Java Examples] to the SBC, using [[#wget|wget]] (you may need to install {{Code|wget}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
3. Unpack the examples using [[#unzip|unzip]] (you may need to install {{Code|unzip}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
4. The location of {{Code|phidget21.jar}} on the SBC is {{Code|/usr/share/java/phidget21.jar}}.  Within the unzipped example directory, compile the {{Code|HelloWorld.java}} example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:/usr/share/java/phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. To run the {{Code|HelloWorld}} program, use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
java -classpath .:/usr/share/java/phidget21.jar HelloWorld&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, you&#039;ll probably want to learn to [[#Running a Program Automatically|run this Java program automatically]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; If you&#039;re used to using Linux with Phidgets already, you&#039;ll probably notice that you don&#039;t need to switch into root using {{Code|sudo}} on the SBC in order to run programs.  This is because you already are running as root, not because the [[OS - Linux#Setting udev Rules|udev rules are set up]].  So if you set up another user, or [[#Via Cron|run a cron job]] as anything other than root or system, you&#039;ll need to add permission for the Phidget program to run in your [[OS - Linux#Setting udev Rules|udev rules]].&lt;br /&gt;
&lt;br /&gt;
====Developing Code on the SBC====&lt;br /&gt;
&lt;br /&gt;
When you&#039;re not just using pre-written source code, and you&#039;re writing code actually on the SBC itself, you&#039;ll probably want to use [[#nano|nano]].  Other terminal editors on the SBC include {{Code|vi}} which is already installed, and {{Code|emacs}}, which you can install using [[#apt|apt]].  Both {{Code|vi}} and {{Code|emacs}} are much more efficient for the experienced user, but they contain modes and keyboard shortcuts that can seem strange or almost hindering to the casual user.&lt;br /&gt;
&lt;br /&gt;
Regardless of which editor you choose to use, some of your keyboard habits may not transfer well.  For example, in the Linux command line, the command {{Code|Ctrl-C}} means &#039;&#039;stop the currently running program&#039;&#039;, (i.e. your open editor) not copy.  Within most SSH terminals, you can copy and paste using the right-mouse button, and on some terminals (and all native Linux terminals) you can copy by simply highlighting text, and you can paste it using the middle (scroll) mouse button.  On the other hand, if you write a program that hangs on the command line, {{Code|Ctrl-C}} can actually be useful to terminate it.&lt;br /&gt;
&lt;br /&gt;
Also {{Code|Ctrl-Z}} does not mean &#039;&#039;undo&#039;&#039;, rather it means &#039;&#039;run the current program in the background&#039;&#039;.  This is useful because running a program in an SSH terminal simply hangs your SSH input until the program is done.  So typing {{Code|Ctrl-Z}} while the program is running frees up the command line for more input.  But if you accidentally hit {{Code|Ctrl-Z}} while running an editor like [[#nano|nano]], the editor will immediately exit to the command line.  Don&#039;t worry though, it will not stop or lose your work.  You can bring it back up by using the {{Code|fg}} (e.g. &#039;foreground&#039;) command, like {{Code|fg nano}}, and this will automatically bring your nano process back to the front.&lt;br /&gt;
&lt;br /&gt;
===Running a Program Automatically===&lt;br /&gt;
&lt;br /&gt;
For testing your program, you will certainly want to run it via [[#SSH|SSH]] or via the {{Code|Start}} button on the project page on the web interface until you are quite sure it runs well.  However, eventually you will probably want the program to run without your input, either [[#Via the Web Interface|continuously, and starting at boot]], or via a task scheduled to [[#Via Cron|run to completion at certain times]].&lt;br /&gt;
&lt;br /&gt;
Both have their advantages and disadvantages.  Usually, you would want to use the continuous, from-boot methods for event driven code that has to handle a wide variety of user input that could occur at any time.  You would want to use the scheduled method when the SBC needs to perform a repeated task (e.g. reading sensor data) again and again.  The main difference is:&lt;br /&gt;
* With the continuous (boot) method you can have any Phidgets (including sensors, LEDs, input switches, etc) attached and giving events to your code all the time, and&lt;br /&gt;
* With the scheduled (cron) method you have much less of a chance to run into long-term memory management and instability problems with any code you write, because your program runs for only a short time before exiting and getting cleaned up.&lt;br /&gt;
&lt;br /&gt;
====Via the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To use this method, you must have created the program you want to run as [[#Program in Java with the Web Interface | a Java or ARM-compiled C project in the web interface]].  If you would like to use another language, or another way of uploading your project, but you still want to start at boot and run continuously, you will need to use a [[#Via a Boot Script|boot script]].&lt;br /&gt;
&lt;br /&gt;
In the web interface, go to the {{Code|Projects}} tab, and click on the project you would like to run.  Near the bottom of the project page (the one with the {{Code|Start}} and {{Code|Stop}} buttons at the top), there will be a section called {{Code|Startup Settings}}.  You can see a screenshot of the whole project page, including these settings, in the [[#Program in Java with the Web Interface | web interface project section]].&lt;br /&gt;
&lt;br /&gt;
Select the {{Code|Enabled}} radio button.  The other defaults should be fine, unless you specifically know otherwise:&lt;br /&gt;
* For &#039;&#039;Boot Order&#039;&#039;, lower numbers boot first.  Booting later means more programs are available for use, booting earlier means other programs can use your program.  &lt;br /&gt;
* &#039;&#039;Run as a daemon&#039;&#039; starts the program as a daemon, which is a program that runs in the background.  Unless you have &#039;&#039;explicitly&#039;&#039; written your program as a daemon, leave this checked.  (If you don&#039;t know what a daemon is, don&#039;t worry, you haven&#039;t written one, so leave it checked.)  &#039;&#039;Un&#039;&#039;checking this when your program is a normal program will cause the SBC to hang while booting.&lt;br /&gt;
* The &#039;&#039;Executable or Class&#039;&#039; name should be automatically sensed to be your main Java class&lt;br /&gt;
* &#039;&#039;Arguments&#039;&#039; are any command line arguments you need, just as you would type them into the command line&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Your program must be very, very stable to run properly via the web interface.  Imagine your program running continuously for days, or months on end.  Any memory leaks, over time, will render your program (and the SBC) unusable until a reboot.  Counts or other variables that increase within your program and never reset may create a segmentation fault eventually.&lt;br /&gt;
&lt;br /&gt;
If, for stability purposes, you want your program to start, run for a little while, and then exit so that the SBC operating system can clean up the memory each time, you&#039;ll probably want to use [[#Via Cron|Cron]] to run your program instead.&lt;br /&gt;
&lt;br /&gt;
====Via Cron====&lt;br /&gt;
&lt;br /&gt;
Cron can automatically schedule programs - known as &#039;jobs&#039;, or &#039;cron jobs&#039; - at most once per minute.  Less often than that, it is very flexible, allowing you to run it on certain months, weekdays, hours, etc.  Cron simply reads a special file (your {{Code|crontab}}) and runs whatever programs are listed, with whatever timing they are listed with.  The cron program runs all the time in the background, making it what is known as a Linux &#039;&#039;daemon&#039;&#039;, but the programs it starts as jobs run only as long as they naturally would, and then they exit.&lt;br /&gt;
&lt;br /&gt;
If you need your program to run more often than once per minute, have the program schedule itself while still running.  For example, to run every five seconds, run a fast loop,  and sleep for five seconds. Do this twenty times and exit.  Then schedule this once per minute using cron, and your program will in essence run every five seconds.&lt;br /&gt;
&lt;br /&gt;
Setting up a cron job simply entails editing your {{Code|crontab}} file.&lt;br /&gt;
&lt;br /&gt;
First, you&#039;ll probably want to specify your default editor to be [[#nano|nano]]. Otherwise it will default to {{Code|vi}} and you&#039;ll have to figure out {{Code|vi}} in order to add lines to your crontab:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
export EDITOR=nano&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to edit your crontab file, simply type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
crontab -e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each line of the crontab file is one scheduled job.  Lines that start with a hash &amp;quot;#&amp;quot; are comments and are ignored.  There is an example line in the crontab, and a reminder line at the very end.  Essentially, each line should contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
minute hour dayOfMonth month dayOfWeek  command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*{{Code|command}} is the program you want to run (with absolute path, and arguments)&lt;br /&gt;
** For example, {{Code|./myprogram argument1}} won&#039;t work, but {{Code|/root/code/myprogram argument1}} will&lt;br /&gt;
* Each time argument is either a number, a list of numbers separated by commas, or an asterisk&lt;br /&gt;
** For example, * * * * * means every minute for all days and months, 0,30 * * * * means every thirty minutes (i.e. at the top of the hour and at 30 minutes in) for all days and months&lt;br /&gt;
&lt;br /&gt;
If you already have jobs scheduled, you&#039;ll see them in the file that comes up.  You can edit, add, or delete.  &lt;br /&gt;
&lt;br /&gt;
After you save, you&#039;ll see a little message back in the terminal that says the new crontab file was installed, and it is now scheduled!  Cron always starts every boot, and so if you have edited and installed your crontab as above, the scheduling of your program will start properly even after a reboot of the SBC.  However, if you are having strange scheduling problems, you may want to familiarize yourself with the [[#Software Details|software details]] of how the SBC as a whole determines the current date and time.&lt;br /&gt;
&lt;br /&gt;
=====My Cron Job Doesn&#039;t Work!=====&lt;br /&gt;
&lt;br /&gt;
It is actually very common for a script or program to work on the command line but then &#039;&#039;not&#039;&#039; work as a cron job.  The most common reason for this, by far, is that you specify &#039;&#039;relative&#039;&#039; paths in your program to access files rather than &#039;&#039;absolute&#039;&#039; paths.  For example:&lt;br /&gt;
* {{Code|code/project.c}} is a relative path (bad for cron)&lt;br /&gt;
* {{Code|/root/code/project.c}} is an absolute path (good for cron)&lt;br /&gt;
The cron jobs are &#039;&#039;not&#039;&#039; executed from your home directory, or your code directory, so they will not be using the same location you may be using to test your code.  So always use absolute paths.&lt;br /&gt;
&lt;br /&gt;
Another common reason is you may be using environment variables or other settings that are true in a terminal but are &#039;&#039;not&#039;&#039; true by default in the raw system.  You can end up taking many things for granted in a shell, for example the shortcut &amp;quot;~&amp;quot; means home directory in a shell, but not by default in the raw system.  The things that get loaded for a shell (but which are not present in the raw system) are:&lt;br /&gt;
* The settings loaded by {{Code|/etc/profile}}&lt;br /&gt;
* Any settings in {{Code|~/.bashrc}}, which is nothing by default on the SBC&lt;br /&gt;
&lt;br /&gt;
On a full Linux operating system, you would use the logs written to by cron to find the error output and debug it.  On the SBC, however, cron does not write logs (otherwise, these logs would eat up the SBC memory very quickly even for routine jobs).  For short-term debugging, you can write output from your program to a file, and read that file afterwards to figure out what your program is doing.&lt;br /&gt;
&lt;br /&gt;
====Via a Boot Script====&lt;br /&gt;
&lt;br /&gt;
If you want to run your program constantly and for it to start at boot like the [[#Via the Web Interface|web interface would do]], you can install your program into the boot order using a script.  This is a somewhat involved process, and you should be familiar with shell programming in Linux.  For this process, we only offer a [[OS - Linux#As A Service|similar example]] which installs and runs the program {{Code|phidgetwebservice21}} within the boot sequence.&lt;br /&gt;
&lt;br /&gt;
===Using USB Data Keys===&lt;br /&gt;
&lt;br /&gt;
After plugging the USB key in, it won&#039;t just appear on your desktop, so to speak, so you&#039;ll need to figure out where you can read and write to it within the SSH directory structure.&lt;br /&gt;
&lt;br /&gt;
The web interface program can help with this.  After you plug a USB key in, it will show up under {{Code|Status &amp;amp;rarr; System}}.  Or, the USB key and all other attached devices can be seen at {{Code|Status &amp;amp;rarr; USB}}:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_mounted_devices.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
In the screenshot above, you can see that the USB key is located in {{Code|/media/usb0}}.&lt;br /&gt;
&lt;br /&gt;
Alternately, you can use the SSH command {{Code|mount}}, and the searching program {{Code|grep}} which will filter the response of {{Code|mount}} and only return the lines with your search term ({{Code|usb}}):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep usb&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the USB key can be written to and read from using the {{Code|/media/usb0}} directory.  Copying a file to {{Code|/media/usb0}} will copy a file to the USB key.  The same goes for removing, renaming, opening files within your program, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Mount points like {{Code|/media/usb0}} should not be hard-coded into any of your programs.  (See the [[#Common Problems and Solutions | Common Problems and Solutions]] section for more information.)  If you need to obtain the mount point for a freshly mounted USB key within your code, have your code obtain the mount tables and search on the &#039;&#039;device&#039;&#039;  (e.g. {{Code|/dev/sda1}} or {{Code|/dev/sdb1}}) and obtain the corresponding mounted {{Code|/media/usbN}} location, where N is a number 0-9.&lt;br /&gt;
&lt;br /&gt;
===Saving and Retrieving Data===&lt;br /&gt;
&lt;br /&gt;
This section covers getting data on and off of the SBC.  There are two main methods of simply moving data on and off the SBC - via a [[#Via a USB Key|USB key]], and via [[#Over the Network (SCP)|copy over the network]] - and a third method for moving and installing data when it concerns [[#Backing Up Your Data|backing up lower level system data]].&lt;br /&gt;
&lt;br /&gt;
====Via a USB Key====&lt;br /&gt;
&lt;br /&gt;
After plugging in a USB data key, first you need to [[#Using USB Data Keys | find out the location]] where that data key was mounted.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the location of the USB key is {{Code|/media/usb0/}}, and we want to copy the file {{Code|data.txt}} to the USB key.  Your SSH session might look something like this, using [[#ls|ls]] and [[#mount|mount]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# ls&lt;br /&gt;
data.txt&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
root@phidgetsbc:~# cp data.txt /media/usb0/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cp&#039;&#039;&#039; program copies data from a source to a destination.  The syntax is {{Code|cp from to}}, where here we are copying from {{Code|data.txt}} to {{Code|/media/usb0/}}.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caution:&#039;&#039;&#039; Even if there is no USB key mounted at {{Code|/media/usb0/}}, this use of {{Code|cp}} will still work &#039;&#039;with no errors&#039;&#039;!  This is because there is still a file called {{Code|/media/usb0/}}, there is just no USB key file system &#039;&#039;mounted&#039;&#039; to that point.  So be sure to run [[#mount|mount]] or use some other method of determining that there is, in fact, a USB data key attached and where it is mounted to.&lt;br /&gt;
&lt;br /&gt;
====Over the Network (SCP)====&lt;br /&gt;
&lt;br /&gt;
SCP is a command line program already installed on Linux and Mac OS, and downloadable for free on Windows.  We discuss it and give examples in the [[#SSH|SSH]] section, but remember it here when you&#039;re trying to get data on and off of the SBC.  With SSH or a terminal already open, you&#039;ll probably find it to be much faster and easier than dealing with a USB key.&lt;br /&gt;
&lt;br /&gt;
====Backing Up Your Data====&lt;br /&gt;
&lt;br /&gt;
For the web interface, you can save and restore all web interface settings under the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} tab.&lt;br /&gt;
&lt;br /&gt;
To save the settings of what packages are installed for later re-installation, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg --get-selections &amp;gt; installedPrograms.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then save the file {{Code|installedPrograms.txt}} externally.  If you have to completely wipe the SBC, you can just reinstall the whole list by moving the {{Code|installedPrograms.txt}} file back onto the SBC, and then typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg –set-selections &amp;lt; installedPrograms.txt&lt;br /&gt;
apt-get dselect-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also remember to externally save:&lt;br /&gt;
* Your {{Code|~/.bashrc}} settings file if you&#039;ve changed it&lt;br /&gt;
* Your {{Code|crontab}} file if [[#Via Cron|you&#039;ve edited it]]&lt;br /&gt;
* Any data files or code you&#039;ve created&lt;br /&gt;
&lt;br /&gt;
It is important to save these settings often, and at points where you know the system is running well.  It may be tempting to create a backup right before you [[#Recovery System|wipe the SBC and start from scratch]], but often the reason you are having problems then is some setting or change, and backing these up and reinstalling them will only reinstall the problem.&lt;br /&gt;
&lt;br /&gt;
To truly back the files up, you must copy them to an external computer or location using either a [[#Via a USB Key|USB Key]] or [[#Over the Network (SCP) | over the network]].  Then they can be copied back if needed later.&lt;br /&gt;
&lt;br /&gt;
If you are looking to restore data on an SBC that will not boot properly, you&#039;ll want to be in the [[#Partial Recovery|partial recovery]] portion of our Troubleshooting section.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
The SBC can be quite tricky to debug, because it is a complex and flexible computer.  Common problems and solutions include:&lt;br /&gt;
* You can&#039;t find the SBC on the network at all - refer to the [[#Initial Internet Setup|Initial Internet Setup]] section&lt;br /&gt;
* You have changed some setting or file such that the SBC doesn&#039;t run anymore, or doesn&#039;t run as expected - refer to the [[#Recovery|Recovery]] section&lt;br /&gt;
&lt;br /&gt;
If you are having trouble using Phidgets on the SBC, you should go through the [[OS - Linux#Troubleshooting | Troubleshooting section on the general Linux page]].  Some of the problems on the Linux page (such as library problems) are easier to fix by simply working through the [[#Recovery|Recovery]] section when they occur on the SBC.&lt;br /&gt;
&lt;br /&gt;
Namely, it often helps to simply perform a [[#Factory Reset|factory reset]] on the SBC (save your files and installed program list first, as [[#Backing Up Your Data|described here]]).  Sometimes you change a file or setting within the operating system when you are trying to get something up and running, and this unintentionally affects other programs too.  Performing a factory reset starts you with a clean slate.&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, or the information within this guide, please [[Contact Us|ask us]]!&lt;br /&gt;
&lt;br /&gt;
===Initial Internet Setup===&lt;br /&gt;
&lt;br /&gt;
To set up the SBC, you almost always need a &#039;&#039;wired&#039;&#039; Ethernet connection with DHCP (Dynamic Host Configuration Protocol), and without a firewall.  This connection should be to a &#039;&#039;router&#039;&#039;, not directly plugged in to your computer.&lt;br /&gt;
&lt;br /&gt;
Even if you do not have this type of a connection at home, these types of connections are very common at both offices and universities.  On a Windows or Mac OS computer, you can bring up the [[Phidget Control Panel]] as described in the SBC&#039;s [[1072 User Guide#Getting Started|Getting Started Page]].  Failing this, or on a Linux computer, we discuss some alternate setup methods in this section.  Keep in mind that without a wired, open DHCP connection these setup methods can be difficult and fickle. &lt;br /&gt;
&lt;br /&gt;
====No Wired-Only Connection====&lt;br /&gt;
&lt;br /&gt;
Sometimes it can work to plug the SBC, using Ethernet, directly into an Ethernet port on your home wireless router.  Do not plug it directly into your computer!  (Although in some instances, a direct connection can be made to work on Linux, see the [[#No DHCP|No DHCP]] section below) &lt;br /&gt;
&lt;br /&gt;
This direct-router method is a very picky process, however, and can fail because:&lt;br /&gt;
* Some home and office routers place a firewall between wireless connections (clients) and wired connections (the local area network)&lt;br /&gt;
* Some home and office routers do not by default allow both Ethernet DHCP and wireless DHCP.&lt;br /&gt;
* Some routers and DHCP hubs only provide access to an internet connection, and do not provide local area network inter-connections (this is common on mobile device tethering hubs)&lt;br /&gt;
&lt;br /&gt;
Routers are quite complex, and even with admin privileges it can be a painstaking process to find all the right firewall settings to turn off in order to allow two computers on the network to talk to one another, rather than just connect to the internet.  This is why university or office networks are often ideal for the purpose of setting up the SBC, because these institutions depend on computers on a local network being able to talk together.  University libraries in particular can be a good source of wired DHCP connection ports.  &lt;br /&gt;
&lt;br /&gt;
Covering all of the different router configuration possibilities here, and how to change them to make the SBC work, is essentially impossible.  If you try using the SBC at home or at work, the SBC does not work on the first try when plugged directly into the router via Ethernet, and you want to make that connection work rather than seeking out an alternate for the initial setup, you should find documentation specific to your router (usually available online) and properly configure it.&lt;br /&gt;
&lt;br /&gt;
The good news is that if you can find an Ethernet DHCP connection &#039;&#039;just once&#039;&#039; for a short time, you can use that connection to configure the SBC to work on your home wireless network.  During that initial connection, you can enable wireless and set up as many wireless DHCP connections (with passwords) that you need.  Once wireless is enabled and set up, you can take the SBC home to your wireless router and the SBC will automatically seek out and connect to its remembered networks as they appear.  At that point, you can also use wireless like a normal internet, web interface, and SSH connection.&lt;br /&gt;
&lt;br /&gt;
====No Link Local Addressing====&lt;br /&gt;
&lt;br /&gt;
If you have a wired DHCP connection, no firewall, and no link local addressing (e.g. bonjour or avahi is not installed) then you will need access to the DHCP router logs.  From the router logs, you should see the connection (or attempted connection) by the SBC within the logs.  From that log entry, you should either be able to determine the IP address for the SBC, or see what happens when the router blocks access.  The IP address can be used in place of the link local address for both the web interface and for SSH.&lt;br /&gt;
&lt;br /&gt;
====No DHCP====&lt;br /&gt;
&lt;br /&gt;
The SBC will first try to use DHCP, but then it will revert to responding to a link local address under bonjour and avahi.  If you are depending on this, please wait &#039;&#039;&#039;at least three minutes&#039;&#039;&#039; after the SBC boots for the SBC to fail in obtaining a DHCP connection and properly revert to link local addressing.&lt;br /&gt;
&lt;br /&gt;
If you have a static IP setup, and want to use link local addressing rather than accessing the router logs, this should usually work by default on Windows and Mac OS (e.g. type the address such as {{Code|phidgetsbc.local}} into a web browser).  If it doesn&#039;t work automatically, there is not much you can do and you should seek out a wired DHCP connection elsewhere.&lt;br /&gt;
&lt;br /&gt;
On Linux, it also should work by default, but you have the additional option of explicitly adding routes that look within the default network settings for the SBC.  From a terminal (as root), type:&lt;br /&gt;
* {{Code|route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0 metric 99}}&lt;br /&gt;
* {{Code|route add default dev eth0 metric 99}}&lt;br /&gt;
You can also compile and use the {{Code|phidgetsbclist.c}} example (use the provided Makefile, don&#039;t use gcc) in the [{{SERVER}}/downloads/libraries/libphidget.tar.gz Phidget Linux Libraries] package, under the {{Code|examples}} folder.  This will allow you to see if the SBC is detected on the network at all.   Note that to use this option you must have the Phidget Libraries and the Phidget WebService installed on your Linux computer - in-depth instructions to do this are on the [[OS - Linux|main Linux page]].&lt;br /&gt;
&lt;br /&gt;
===Recovery System===&lt;br /&gt;
&lt;br /&gt;
You can either boot the SBC into recovery mode and attempt to recover files and settings, or you can completely wipe the SBC by performing a factory reset.  If the LEDs do not turn on normally (red on constantly, green on at first start, then off, then on when fully booted) then you&#039;ll want to read the [[#Hardware Issues|hardware issues]] section.&lt;br /&gt;
&lt;br /&gt;
====Partial Recovery====&lt;br /&gt;
&lt;br /&gt;
The recovery system can be entered in two ways:&lt;br /&gt;
# From the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} web interface page.&lt;br /&gt;
# By holding down the reset button for 20+ seconds - until the green light has switched from flashing slowly to flashing quickly.&lt;br /&gt;
&lt;br /&gt;
The recovery system runs an [[#SSH|SSH]] server where the username and password both are {{Code|root}}.&lt;br /&gt;
&lt;br /&gt;
If the main filesystem has been damaged/misconfigured in such a way that it won’t boot, you may be able to fix the issue or recover important files before running a full factory reset. From an SSH connection to the recovery system, you can mount the main root filesystem with the following commands (assuming it’s not damaged):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
ubiattach /dev/ubi_ctrl -m 6&lt;br /&gt;
mount -t ubifs /dev/ubi0_0 /mnt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Factory Reset====&lt;br /&gt;
&lt;br /&gt;
This restores the kernel and root filesystem from backup, overwriting any changes that may have been made and &#039;&#039;completely wiping the system&#039;&#039; to the state that it got shipped in. (You can save your files and installed program list first, as [[#Backing Up Your Data|described here]].)  This can be enacted one of two ways.&lt;br /&gt;
# Use the reset button:&lt;br /&gt;
##Enter the recovery mode by holding down the reset button for 20+ seconds as above (until fast flashing)&lt;br /&gt;
##Wait for a full boot (i.e. you can see it on the [[Phidget Control Panel]], or can SSH with username and password as {{Code|root}})&lt;br /&gt;
##Hold down the reset button again, but this time for only 10 seconds (until slow flashing)&lt;br /&gt;
##Wait for the SBC to fully reset and reboot (at least three minutes) - the LED will turn off and on again when this occurs&lt;br /&gt;
##*Note that after a factory reboot the SSH server will be disabled&lt;br /&gt;
##*Also note that after a factory reboot the SBC creates new SSH keys, and reverts to the {{Code|phidgetsbc.local}} address&lt;br /&gt;
# Via the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, where you can follow the instructions&lt;br /&gt;
&lt;br /&gt;
====Hardware Issues====&lt;br /&gt;
&lt;br /&gt;
The LEDs are an indicator of the hardware working properly.  The normal boot process is:&lt;br /&gt;
* Red LED: Turns on from moment of power being applied.&lt;br /&gt;
* Green LED: Turns on momentarily when power applied, then turns off momentarily, then turns on and stays on when booted.&lt;br /&gt;
&lt;br /&gt;
If the green status LED never turns on (or fails to turn on the second time), the boot process is failing somewhere.  This could be due to:&lt;br /&gt;
* A damaged OS - Try performing a [[#Factory Reset|Factory Reset]]&lt;br /&gt;
* If this fails, it is likely hardware damage (very difficult to diagnose, please [[Contact Us|contact us]])&lt;br /&gt;
&lt;br /&gt;
If neither LED turns on, hardware damage is even more likely.  Unless the path to the red LED is the one thing that has been damaged, the device is likely not receiving and using power.&lt;br /&gt;
* Try performing a [[#Factory Reset|Factory Reset]], and if that does not work please [[Contact Us|contact us]]&lt;br /&gt;
&lt;br /&gt;
=====USB Issues=====&lt;br /&gt;
&lt;br /&gt;
On the Phidget SBC2, there is a hardware issue that is unrelated to the LEDs.  It is a USB problem, and manifests in many ways:&lt;br /&gt;
* Strange behaviour when some devices but not others are plugged in to the SBC&lt;br /&gt;
* Strange behaviour with combinations of devices&lt;br /&gt;
* Failure (or intermittent failure) to see Phidgets on the USB hub, or USB keys on the hub&lt;br /&gt;
&lt;br /&gt;
This problem is fixable, either on your own or by sending your SBC back to Phidgets.  For an in-depth solution, see the [[SBC2_USB_Hub_Fix | SBC2 Hub Fix Page]].&lt;br /&gt;
&lt;br /&gt;
===Updating Your SBC===&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve owned your SBC for a while and want to update your packages, you can run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...to &#039;&#039;update&#039;&#039; your software source list and then &#039;&#039;upgrade&#039;&#039; to the latest version of all installed software.  If you are used to Mac OS or Windows, note that this does not just update the non-kernel parts of the operating system, it updates every additional piece of software you have installed.&lt;br /&gt;
&lt;br /&gt;
To update the SBC software itself (e.g. the kernel), it is easiest to use the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, to enter a page that will give you the option to update.  You will need to have an update file on a USB key inserted into the SBC, of type:&lt;br /&gt;
* UBI Image (system_ubi.img), or &lt;br /&gt;
* Kernel image (uImage), or&lt;br /&gt;
* Phidget Upgrade package containing both UBI and Kernel images (phidgetsbc*.bin)&lt;br /&gt;
&lt;br /&gt;
These are either obtained from the Phidgets website, or are a custom kernel / filesystem that you can create yourself, if you are experienced.&lt;br /&gt;
&lt;br /&gt;
The reason why this information is in troubleshooting is that you should certainly [[#Backing Up Your Data|back up your system]] before trying this.  And, it is quite rare to need to upgrade the kernel or filesystem on the SBC, so something serious should be going on before you attempt it.  Try using the [[#Recovery System|recovery system]] first.&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
Now that you have the basic libraries installed, you can pick your language and begin programming!  &lt;br /&gt;
&lt;br /&gt;
If you are not using the [[#WebService | webservice]] to control a Phidget over a network, your next step will be to delve into the use of your specific language.  Each page has its own set of specific libraries, code examples, and setup instructions.  &lt;br /&gt;
&lt;br /&gt;
On SBC Linux, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Java | Java]]&lt;br /&gt;
*[[Language - Python | Python]]&lt;br /&gt;
&lt;br /&gt;
These languages may also run on the SBC, but we do not yet directly offer SBC support for them:&lt;br /&gt;
* [[Language - Ruby|Ruby]]&lt;br /&gt;
* [[Language - C Sharp|C#]] (using Mono)&lt;br /&gt;
&lt;br /&gt;
You can probably figure out how to install and use them by a combination of the language pages linked above, and the section on [[#Installing Other Languages|installing other languages on the SBC]].&lt;br /&gt;
&lt;br /&gt;
==WebService==&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the [[Phidget WebService]] installed, and the SBC automatically starts the WebService at boot.&lt;br /&gt;
&lt;br /&gt;
To practice using the WebService, and to learn more about it, we have hands-on examples on the [[OS - Linux|general Linux page]], starting in the [[OS - Linux#Using the WebService|using the WebService section]].&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Shutting off USB ports to save power===&lt;br /&gt;
The SBC3 has an on-board USB hub that can control power to the ports. To do this unbind and rebind the USB drivers.&lt;br /&gt;
&lt;br /&gt;
To turn off the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/unbind}}&lt;br /&gt;
&lt;br /&gt;
To turn on the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/bind}}&lt;br /&gt;
&lt;br /&gt;
These will also cause detach and attach events for the Phidget devices, respectively. While the drivers are unbound, you will not get any hot plug events for any devices on USB.&lt;br /&gt;
&lt;br /&gt;
===Using a Touchscreen===&lt;br /&gt;
Please note that this will ONLY work with an SBC3 since it has a USB 2.0 hub:&lt;br /&gt;
&lt;br /&gt;
Using a touchscreen with the SBC is a great way to get user input and visual feedback from an SBC otherwise devoid of visual output.  The SBC does not have any conventional display ports such as VGA, DVI, or HDMI but it does have a number of USB ports and USB displays do exist.  With the upgrade to a USB 2.0 hub on the SBC3 from the earlier models which had USB 1 hubs the SBC now has enough capability to operate a screen over USB.  We don&#039;t recommend running a standard desktop environment since the processor is too slow to really keep up with a typical desktop it does make for an excellent interface for a kiosk, instrumentation control panel or  other, similar use case.  This document is going to go through the process of enabling support for a typical USB display as well as installing a fairly compact desktop environment called xfce on the SBC.  &lt;br /&gt;
&lt;br /&gt;
The screen I will be using is from a company called [http://lilliputweb.net/ Lilliput].  Specifically a UM-70 model.  Before you begin, please make sure that you have the screen plugged into the SBC, it will also be useful to have a spare USB keyboard and mouse handy as you will need them once you are no longer using an SSH terminal to communicate with the SBC.&lt;br /&gt;
&lt;br /&gt;
[[File:lilliputoff.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Getting the display to function====&lt;br /&gt;
Begin by logging into the web configuration page for your SBC and upgrading all of the packages on the SBC.  Be sure to include the full Debian package repository.  For more information on how to do this refer to the  [[OS - Phidget SBC#Getting Started - External Computer|getting started]] section of the Phidget SBC documentation.  Once you are fully up to date open an SSH session with the SBC and navigate to the &amp;quot;/etc&amp;quot; folder.  Open inittab with a terminal-based text editor such as nano and add the following to the bottom of the file, just above the {{code|T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100}} line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
1:2345:respawn:/sbin/getty 38400 tty1 &lt;br /&gt;
2:23:respawn:/sbin/getty 38400 tty2 &lt;br /&gt;
3:23:respawn:/sbin/getty 38400 tty3 &lt;br /&gt;
4:23:respawn:/sbin/getty 38400 tty4 &lt;br /&gt;
5:23:respawn:/sbin/getty 38400 tty5 &lt;br /&gt;
6:23:respawn:/sbin/getty 38400 tty6 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reboot your system.  After a few minutes you should see the LCD screen come up with a standard Linux terminal interface and a login prompt.  This is all well and good but this isn&#039;t really appreciably better than simply using an SSH session to communicate with the SBC.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputlogin.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Setting up Xfce====&lt;br /&gt;
In order to get a traditional windowing environment we still need to install a desktop manager as well as a number of supporting packages.  Log in and make sure everything is still up to date with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install the following packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xserver-xorg lxde xfce4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the SBC asks you if you want to continue, just type &amp;quot;Y&amp;quot; and press enter.  &lt;br /&gt;
&lt;br /&gt;
This will install the xfce desktop environment and any other necessary programs on the SBC.  When it&#039;s done, restart the SBC.  When it boots back up it should boot directly to a login screen instead of the terminal interface.  Log in, and you are good to go.  It won&#039;t be particularly fast, but don&#039;t worry, the SBC does not have a dedicated video processor on it so it&#039;s perfectly normal for it to be slow.  What&#039;s important is that it works.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputdesktop.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Calibrating the touch screen====&lt;br /&gt;
Unfortunately, by default the screen is calibrated to believe the bottom of the screen is on the right hand side.  This has the effect of making the touch functionality more or less useless until it has been properly calibrated.  To do this, install the following package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xinput-calibrator&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now use xinput calibrator to measure the parameters of your screen.  Launch xinput calibrator (called Calibrate Touchscreen in the programs menu) and follow the instructions on the screen.  The screen should now be functioning at full potential.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Using a Different Wireless Adapter===&lt;br /&gt;
&lt;br /&gt;
The support for the wireless adaptor that Phidgets sells is written into the SBC kernel.  Hence, we do not support using other adaptors. &lt;br /&gt;
&lt;br /&gt;
However, Linux is very flexible, and it is possible (though not easy) to write a custom kernel for the SBC and add support for a new wireless adaptor.  We can&#039;t help you with this, but we do provide some basic guidelines for [[#Custom Kernel and Filesystem|building your own kernel]].  You can also have a look at our thoughts on our own experience with choosing a Wifi adapter: [[Alternative Wi-Fi Adapters on the SBC]].&lt;br /&gt;
&lt;br /&gt;
===Using a Different Webcam===&lt;br /&gt;
&lt;br /&gt;
In addition to the webcam that Phidgets sells, you have the option to use many different webcams with the SBC.  There is a [http://www.ideasonboard.org/uvc/#devices long list] of compatible webcams.&lt;br /&gt;
&lt;br /&gt;
The common thread for these webcams is that they use UVC - the USB Video Class - drivers for Linux.  You can then use [[#mount|mount]] to find out what video device your webcam is mounted under.&lt;br /&gt;
&lt;br /&gt;
===Taking Pictures With the Webcam===&lt;br /&gt;
&lt;br /&gt;
Probably the most straightforward way to use a webcam for pictures rather than video is to use the {{Code|opencv}} library.  You can get it by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libcv2.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there is no {{Code|libcv2.1}} package, you can perform {{Code|apt-cache search libcv}} to find the current version.&lt;br /&gt;
&lt;br /&gt;
The opencv libraries can also be used within Python, by installing the link between them:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python-opencv&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then taking pictures from within code becomes quite simple.  For example, in Python, taking and saving an image is four lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
#! /usr/bin/python&lt;br /&gt;
&lt;br /&gt;
import cv&lt;br /&gt;
&lt;br /&gt;
# The webcam is located at /dev/video0 &lt;br /&gt;
# OpenCV only needs the number after video&lt;br /&gt;
webcam = cv.CaptureFromCAM(0)&lt;br /&gt;
&lt;br /&gt;
frame = cv.QueryFrame(webcam)&lt;br /&gt;
&lt;br /&gt;
cv.SaveImage(&amp;quot;image.jpg&amp;quot;, frame)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the complete OpenCV documentation, see [http://opencv.willowgarage.com/documentation/index.html The OpenCV Reference], and specifically the section on [http://opencv.willowgarage.com/documentation/reading_and_writing_images_and_video.html Reading and Writing Images].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The SBC is probably not as powerful for image processing and transport when compared to your desktop computer.  Try running your image processing code on the SBC from an early point in development.  During those test runs, you can visit the first System page of the [[#SBC Web Interface|SBC Web Interface]] to check the processor and memory use.  For more information on processor power, check the specification for your SBC (on the product page on [{{SERVER}} our main website]) as well as our discussion of [[#Pushing Processor Limits|pushing processor limits]] below.&lt;br /&gt;
&lt;br /&gt;
===Checking System Logs===&lt;br /&gt;
&lt;br /&gt;
The SBC maintains two logs: a kernel log and a system log.  &lt;br /&gt;
&lt;br /&gt;
The kernel log is for low-level occurrences, such as devices attaching and leaving the USB hub, recording what drivers are being used, and so on.&lt;br /&gt;
&lt;br /&gt;
The system log (syslog) is for normal chatter from the operating system.  Any program with the right permissions can use it (though you need to know the method to write to it, information all around the Internet can help) and it contains everything from the Ethernet going up and down, to webserver requests, and so on.  If you don&#039;t run many programs or services on the SBC, the syslog will essentially be a mirror of the kernel log, because the kernel is the only thing talking.&lt;br /&gt;
&lt;br /&gt;
You can check these logs by using the web interface in the {{Code|System &amp;amp;rarr; Logs}} tab.&lt;br /&gt;
&lt;br /&gt;
Or you can perform more powerful filtering and displaying via an SSH terminal.  For example, {{Code|dmesg}} is the command to display the kernel log, and {{Code|tail}} prints the last ten lines of input.  So, if you are trying to see if you can get a device to be detected on USB, you can run &amp;lt;code&amp;gt;dmesg | tail&amp;lt;/code&amp;gt; to print the latest ten lines of kernel log data.&lt;br /&gt;
&lt;br /&gt;
The actual locations of the log files (for filtering and reading) are:&lt;br /&gt;
* {{Code|/var/log/syslog}} &lt;br /&gt;
* {{Code|/var/log/dmesg}}&lt;br /&gt;
But don&#039;t edit them directly!  Always follow the advice and procedures around the Internet on how to properly log items to syslog.&lt;br /&gt;
&lt;br /&gt;
===X Forwarding===&lt;br /&gt;
&lt;br /&gt;
Although most tasks can be done using the [[#SBC Web Interface|SBC Web Interface]] or [[#SSH|SSH]], you can also set up X11 forwarding on the SBC.  X11 is the window manager base, which provides a graphical windowing system on the SBC.  Although you probably won&#039;t connect directly to the X11 manager (i.e. by plugging a screen directly into the SBC), X11 also gives a user the ability to forward graphical windows over SSH.  You will need the following packages installed:&lt;br /&gt;
* {{Code|x11-common}}&lt;br /&gt;
* {{Code|xbase-clients}}&lt;br /&gt;
After installing, make sure that the line in {{Code|/etc/ssh/sshd_config}} has a line that says:&lt;br /&gt;
:{{Code|X11Forwarding yes}}&lt;br /&gt;
Then log out and log back into the SBC.  This second time you log in, use the {{Code|-X}} switch to turn on X forwarding for that connection:&lt;br /&gt;
:{{Code|ssh -X root@phidgetsbc.local}}&lt;br /&gt;
Then you should be able to run programs that launch a window, and it will launch remotely and appear on the computer you have the SSH connection from.&lt;br /&gt;
&lt;br /&gt;
===Pushing Processor Limits===&lt;br /&gt;
&lt;br /&gt;
The SBC, though more powerful than many embedded computers out there, is probably about as powerful as your smartphone.  If you hook up 1 ms Phidget sampling devices to all six of its USB ports, events and packets will probably get lost.  The exact data rates you can accomplish depend on:&lt;br /&gt;
* What else is running on the SBC&lt;br /&gt;
* How efficient your code is for external operations (like File I/O)&lt;br /&gt;
* Other minor details (e.g. the temperature of the SBC, etc)&lt;br /&gt;
&lt;br /&gt;
If you want to achieve data rates as fast as possible, try these tips:&lt;br /&gt;
* Program in C, not in an interpreted language (Python, Java, .NET)&lt;br /&gt;
* Perform file I/O as little as possible.  Locally cache data, manage your writing to a file in a separate thread, and use low-level write calls.&lt;br /&gt;
* Change the [[#Custom Kernel and Filesystem|filesystem]] to a faster, non-compressed file system.&lt;br /&gt;
** Alternatively, use a high-data-rate USB key.&lt;br /&gt;
* Keep other running processes to a minimum. &lt;br /&gt;
** If you are running code locally right on the SBC, turn off the Phidget WebService.&lt;br /&gt;
&lt;br /&gt;
===Custom Kernel and Filesystem===&lt;br /&gt;
&lt;br /&gt;
You can compile your own kernel and flash it to the board. It is left up to the user to configure an appropriate cross-compiler for kernel development. You may also be able to compile a new kernel on-board.  We have a kernel development kit, complete with patch file and README:&lt;br /&gt;
* [{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Compiling a new, custom kernel is somewhat complex.  If the SBC is your first experience with Linux, writing a custom kernel will be difficult.  However, it will probably also be very rewarding because you can put whatever you like into it.  We might be able to offer additional suggestions, but ultimately you&#039;re on your own here. &lt;br /&gt;
&lt;br /&gt;
You may be able to write a custom kernel right on the SBC, but the easiest way is to develop the kernel on an external computer.  And the easiest way to develop on an external computer is for that computer to also be Linux, even just in a Virtual Machine.  The time spent loading a copy of Linux into a virtual machine (such as VirtualBox, which is free) onto your computer will probably be less time than setting up a standard compiler on Windows to cross-compile.&lt;br /&gt;
&lt;br /&gt;
On your external Linux system, you will need:&lt;br /&gt;
* A cross-compiling toolchain for the ARM processor, which we briefly describe on the [[OS - Linux#Cross-Compiling with a Custom Toolchain | main Linux page]], and &lt;br /&gt;
* The [{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package] from the Phidgets website.  &lt;br /&gt;
The kernel development kit has a brief README file which describes how to obtain the proper kernel and patch, configure, customize, and build it.&lt;br /&gt;
&lt;br /&gt;
We have an application guide in progress, which walks through building a custom kernel to add Bluetooth support to the SBC.  Please contact us if you would like more information.  Even if you are trying to add support for hardware other than a bluetooth modem, or wondering if support even exists in the kernel for your modem (3G, alternate wireless, etc) you will probably find the application guide helpful.  Follow it up to the point where you run the program {{Code|menuconfig}} (you don&#039;t need an SBC to do this), which will give you a menu of all drivers you can enable in the SBC kernel.&lt;br /&gt;
&lt;br /&gt;
After making your new kernel, you should have a uImage and modules target for your Makefile.  At this point you can transfer your kernel files onto the SBC, make their targets, and transfer them into the nand memory.  This involves erasing the old kernel, flashing the new kernel, installing the new kernel modules, and rebooting.  From the SBC, in the kernel directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
make uImage; make modules&lt;br /&gt;
flash-eraseall /dev/mtd3&lt;br /&gt;
nandwrite -p /dev/mtd3 arch/arm/boot/uImage&lt;br /&gt;
make modules-install&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Custom kernels can also be flashed from the [[#Recovery System | Recovery System]].&lt;br /&gt;
&lt;br /&gt;
If you need to create a root filesystem image, the filesystem type is UBIFS, and the commands to create it are:&lt;br /&gt;
&lt;br /&gt;
====For SBC2:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====For SBC3:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You then flash ‘system_ubi.img’ (not ‘system_ubifs.img’) from the recovery system.&lt;br /&gt;
&lt;br /&gt;
Again, like the custom kernel creation, the need to create a custom root filesystem is essentially non-existent except for those advanced users who already know they need it... and furthermore, you are almost entirely on your own.&lt;br /&gt;
&lt;br /&gt;
===Saving a file system to flash to multiple SBC&#039;s===&lt;br /&gt;
You may want to create a complete backup of your SBC root filesystem, which can then be flashed to other SBCs. This is how it could be done:&lt;br /&gt;
&lt;br /&gt;
You will need a USB drive - we have had issues using cheap flash drives, so a real USB drive is recommended. Make sure it&#039;s empty, as it will be reformatted.&lt;br /&gt;
&lt;br /&gt;
All of these commands are executed on your SBC, while logged in over SSH.&lt;br /&gt;
&lt;br /&gt;
First, re-format the USB drive as ext3. Assuming the USB drive is sda and has a single partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
mkfs.ext3 /dev/sda1&lt;br /&gt;
mount -t ext3 /dev/sda1 /media/usb0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remount / as readonly, so it doesn&#039;t change as we&#039;re copying it. To do this, we need to kill all running processes except sshd:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
service udev stop&lt;br /&gt;
service ifplugd stop&lt;br /&gt;
service rsyslog stop&lt;br /&gt;
service avahi-daemon stop&lt;br /&gt;
service phidgetwebservice stop&lt;br /&gt;
service ntp stop&lt;br /&gt;
service busybox-httpd stop&lt;br /&gt;
service dbus stop&lt;br /&gt;
service cron stop&lt;br /&gt;
pkill dhclient&lt;br /&gt;
mount -o remount,ro /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the remount says that / is busy, do a &#039;ps auxww&#039; and &#039;pkill&#039; anything else that may be running until it remounts properly.&lt;br /&gt;
&lt;br /&gt;
Then, copy / to the flash drive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkdir /media/usb0/root&lt;br /&gt;
mount --bind / /mnt/&lt;br /&gt;
cp -a /mnt/* /media/usb0/root/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, clean up the copy - removing files specific to this board. We also remove the APT cache to save space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
find /media/usb0/root/var/log -type f -print0 | xargs -0 rm -f&lt;br /&gt;
rm -rf /media/usb0/root/var/lib/apt/lists/*&lt;br /&gt;
mkdir /media/usb0/root/var/lib/apt/lists/partial&lt;br /&gt;
rm -f /media/usb0/root/var/cache/apt/*.bin&lt;br /&gt;
rm /media/usb0/root/etc/udev/rules.d/70-persistent-net.rules&lt;br /&gt;
rm /media/usb0/root/etc/ssh/ssh_host_*&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
then, create the ubinize.cfg file:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi	&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs0&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi		&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
vol_flags=autoresize	&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: you may need to increase vol_size if your filesystem is larger.&lt;br /&gt;
&lt;br /&gt;
then, create the UBI image from the copy:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then, unmount the drive to ensure everything is written out properly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you can remove the /root/ folder and system_ubifs.img. system_ubi.img can be flashed to other SBCs using the recovery system.&lt;br /&gt;
&lt;br /&gt;
==Software Details==&lt;br /&gt;
&lt;br /&gt;
For even more advanced uses of the SBC, it may help to know the gritty details of the SBC software system.&lt;br /&gt;
&lt;br /&gt;
;Operating System&lt;br /&gt;
:Debian/GNU Linux&lt;br /&gt;
:Kernel 2.6.X or higher (generally kept up to date with latest releases, use {{Code|uname -r}} to check the kernel version)&lt;br /&gt;
&lt;br /&gt;
;Main Filesystem (rootfs)&lt;br /&gt;
:UBIFS (a raw flash type of file system)&lt;br /&gt;
:Mounted in a 460 MB Nand partition (in Read/Write mode)&lt;br /&gt;
&lt;br /&gt;
;Kernel&lt;br /&gt;
:uImage format&lt;br /&gt;
:Has its own 3MiB partition on bare Nand&lt;br /&gt;
&lt;br /&gt;
;Web Interface Scripts and Configuration Data&lt;br /&gt;
:Located in {{Code|/etc/webif}}&lt;br /&gt;
:Modifying these scripts can be done; however, it is very easy to enter invalid data that could cause the system to behave unexpectedly or not boot.&lt;br /&gt;
&lt;br /&gt;
;User Applications uploaded through Web Interface&lt;br /&gt;
:Located in {{Code|/usr/userapps}}&lt;br /&gt;
&lt;br /&gt;
;Webcam Device Location&lt;br /&gt;
:{{Code|/dev/video0}}&lt;br /&gt;
:Numbers increase with more webcams&lt;br /&gt;
&lt;br /&gt;
;Date and Time&lt;br /&gt;
:Set using ntp (network time protocol) at boot&lt;br /&gt;
:The ntp daemon continues to run in the background and will periodically update the clock &lt;br /&gt;
:The network keeps the SBC very close to real time&lt;br /&gt;
:Also there is a real-time clock with battery backup which will preserve date/time across reboots, power removal&lt;br /&gt;
:The real-time clock is synced to system time during reboot/shutdown&lt;br /&gt;
:If power is unplugged suddenly, and the network not restored, the real-time clock may not have the correct time&lt;br /&gt;
&lt;br /&gt;
;Wireless Networking System&lt;br /&gt;
:Wireless adapter support for the wireless adapter that Phidgets sells is written into the kernel&lt;br /&gt;
:It supports WEP and WPA&lt;br /&gt;
:It is best configured through the configuration interface.&lt;br /&gt;
&lt;br /&gt;
;Nand Layout&lt;br /&gt;
:The board contains 512MiB on Nand. This nand is split into 7 partitions as follows:&lt;br /&gt;
:0: u-boot		 size: 256K		 Read Only&lt;br /&gt;
:1: u-boot_env		 size: 128K		 Read Only&lt;br /&gt;
:2: recovery_kernel	 size: 2M		 Read Only&lt;br /&gt;
:3: kernel		 size: 3M		 Writable&lt;br /&gt;
:4: flashfs	 	 size: ~3.625M	 	 Read Only&lt;br /&gt;
:5: recovery_fs		 size: ~ 43M		 Read Only&lt;br /&gt;
:6: rootfs		 size: ~ 460M		 Writable&lt;br /&gt;
: The final size of flashfs/recovery_fs/rootfs depends on the image size at production, and on the number/location of bad blocks in the NAND.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: U-Boot and recovery kernel and filesystem cannot be written from Linux - this is a safety measure.&lt;br /&gt;
&lt;br /&gt;
;Boot Loader&lt;br /&gt;
:U-Boot is used for setting up the processor and booting Linux, and is only accessible via a serial connection. &lt;br /&gt;
:Normal users will not need to use or modify it.&lt;br /&gt;
:Be very careful when modifying the u-boot partition. If it is damaged or overwritten, it is difficult to fix.&lt;br /&gt;
:When using U-Boot, a prompt will appear via serial shortly after power on.  &lt;br /&gt;
:The environment variables will help you determine how to boot Linux on the SBC&lt;br /&gt;
:You can also refer to the [http://www.denx.de/wiki/DULG/Manual U-Boot documentation]&lt;br /&gt;
&lt;br /&gt;
;Boot Process&lt;br /&gt;
:From power on...&lt;br /&gt;
:1. Processor loads first 4 bytes from NAND into Steppingstone and runs it.&lt;br /&gt;
:2. Steppingstone sets up RAM, copies u-boot from NAND into RAM and runs U-Boot.&lt;br /&gt;
:3. U-Boot initializes the processor, sets GPIO state, etc., copies the linux kernel into RAM, sets up the kernel command line arguments, checks that the kernel image is valid, and boots it.&lt;br /&gt;
:4. Linux boots, bringing up USB, Networking, NAND, etc. and then mounts the rootfs NAND partition on /.&lt;br /&gt;
:5. init gets run as the parents of all processes, as uses the /etc/inittab script to bring up the system. This includes mounting other filesystems, settings the hostname, and running the scripts in /etc/init.d, among other things.&lt;br /&gt;
:6. inittab then turns the green LED on.&lt;br /&gt;
:7. inittab then sets up a getty on the first serial port, ready for interfacing using the debug board.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|PHP Curl|Curl doesn&#039;t install smoothly}}&lt;br /&gt;
&lt;br /&gt;
There is an issue with the embedded version of PHP5.3, try forcing it to install the specific version that you need.  This can be done with the following command:&lt;br /&gt;
&lt;br /&gt;
{{Code|apt-get install php5-common&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;5.3.3-7+squeeze14}}&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|FTDI Errors|FTDI adapters do not appear to work with the SBC}}&lt;br /&gt;
&lt;br /&gt;
The 3.1.6 version of the Linux kernel which is used on some versions of the SBC has a bug that causes issues with FTDI drivers and makes them malfunction.  To solve this problem you must upgrade the kernel to a newer version.  You can find the files [[#Quick Downloads| here]].&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|USB Memory Key mounting|Sometimes USB Memory Keys mount at more than one location}}&lt;br /&gt;
&lt;br /&gt;
When you insert a memory key, the SBC will load it as a device (e.g. {{Code|/dev/sda1}}) and it will also &#039;&#039;mount&#039;&#039; the key for reading and writing within the {{Code|/media/}} directory.  The {{Code|/media/}} directory version will be called something like {{Code|usb0}}.  &lt;br /&gt;
At times, an inserted memory key will get mounted in more than one location.  You can observe if this occurs by checking the currently mounted devices with the command {{Code|mount}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
/dev/sda1 on /media/usb1 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will note that the same device ({{Code|/dev/sda1}}) is now mounted at &#039;&#039;both&#039;&#039; {{Code|/media/usb0}} and {{Code|/media/usb1}}.  To fix this problem as it occurs, you can use {{Code|umount}} (notice there is no letter &#039;n&#039;) to unmount the second instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# umount /media/usb1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In practice, this should not be a problem, because writing to or reading from either {{Code|usb0}} or {{Code|usb1}} will have the same effect on the memory key.  However, if you hard-code a media location into your program (i.e. expecting {{Code|/media/usb0}} to be the first USB key you insert and {{Code|/media/usb1}} to be the second key) your program will sometimes work and sometimes fail.  &lt;br /&gt;
&lt;br /&gt;
To get around this within code, find the mount point for each device as it appears.  The devices, such as {{Code|/dev/sda1}} will always refer to the actual memory key.  But, they cannot be written to directly without being mounted, so you will have to parse the mount table (what is returned from {{Code|mount}}) within your code to find the device and its corresponding mount point.&lt;br /&gt;
&lt;br /&gt;
This is a problem with the standard embedded Debian automount program, and we have no known fix.&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|Perl Locale Errors on SSH|No Locales Installed}}&lt;br /&gt;
&lt;br /&gt;
By default, no locales are installed on the SBC.  If you use [[#apt|apt]] a lot to install and manage your software on the SBC, you will get messages like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
perl: warning: Setting locale failed.&lt;br /&gt;
perl: warning: Please check that your locale settings:&lt;br /&gt;
	LANGUAGE = (unset),&lt;br /&gt;
	LC_ALL = (unset),&lt;br /&gt;
	LANG = &amp;quot;en_CA.UTF-8&amp;quot;&lt;br /&gt;
    are supported and installed on your system.&lt;br /&gt;
perl: warning: Falling back to the standard locale (&amp;quot;C&amp;quot;).&lt;br /&gt;
locale: Cannot set LC_CTYPE to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_MESSAGES to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_ALL to default locale: No such file or directory&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To squelch these messages, you should install and reconfigure your locale like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install locales&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command will show you a long list from which you should pick your location, by language.  For example, en_CA is english_Canada.  Here in Calgary, we use en_CA.UTF-8 and so for the first question we would input locale &amp;quot;114&amp;quot; and for the second (system) question we would input {{Code|en_CA}} for the locale.&lt;br /&gt;
&lt;br /&gt;
This might give you a locale undefined error, in which case you can generate the locale (for us, again, it is en_CA):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
locale-gen en_CA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=23868</id>
		<title>OS - Phidget SBC</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=23868"/>
		<updated>2016-08-11T17:52:35Z</updated>

		<summary type="html">&lt;p&gt;Patrick: /* Quick Downloads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
{{OSLang|[[File:icon-Linux.png|64x64px|link=OS - Linux]]|On the Single Board Computer (SBC), Phidgets can be either plugged directly into one of the USB ports or run over a network using the [[#WebService | WebService]].}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Unlike our other supported operating systems, the SBC &#039;&#039;&#039;does not require downloads&#039;&#039;&#039; unless you are doing something advanced like loading the firmware or developing your own kernel.  You will know if you need these downloads, otherwise, the SBC should work as described on the [[1073 User Guide#Getting Started|SBC3 Getting Started Guide]] right out of the box.&lt;br /&gt;
&lt;br /&gt;
*[[Software License]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC (1070):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc-minimal.bin Minimal Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc-full.bin Full Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/buildroot-phidgetsbc.tar.gz Buildroot/Kernel Sources]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC2 (1072):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc2/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc2.bin SBC2 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC2 Kernel Development Package] (How-to and patch file)&lt;br /&gt;
&#039;&#039;&#039;The PhidgetSBC3 has different firmware packages based on the kernel version. In order to determine the device version of your SBC3, see the [[1073_User_Guide#SBC_Web_Interface|web configuration page]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:sbcver.jpg|thumb|562px|link=|The system information table is found on the Status -&amp;gt; System tab of the &#039;&#039;&#039;[[1073_User_Guide#SBC_Web_Interface|web configuration page]]&#039;&#039;&#039; of the SBC.]]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.6.3:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc3/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3_1.0.0.20121213.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-kerneldev_1.0.0.20121213.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-upgrade_3.6.3_3.14.27.tar.gz SBC3 Kernel upgrade package (3.6.3 -&amp;gt; 3.14.27)]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.14.27:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc3/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3_1.0.2.20160425.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-update_3.14.27.tar.gz SBC3 Kernel upgrade package (3.14.27)]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-kerneldev_1.0.2.20160425.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Note that, instead of using the firmware to update your SBC, updates should normally be done via the System -&amp;gt; Packages page on your SBC3 web interface. It is rarely necessary to completely re-flash your device..&lt;br /&gt;
&amp;lt;br clear = all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Getting Started with the Phidget SBC Debian Linux==&lt;br /&gt;
&lt;br /&gt;
The Single Board Computer (SBC) is a unique Phidget.  It is a computer with a Linux operating system.  It can compile code, save files, manage background jobs, host information over the web, and more.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If this is your first time&#039;&#039;&#039; using the Phidget SBC, you will want to start with the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  After that, here we will get you started on topics beyond those in the getting started guide, including how to write Phidget code to run on the SBC.  You &#039;&#039;&#039;do not need this page&#039;&#039;&#039; if you are simply using the SBC to broadcast data from Phidgets over the network - it does that automatically.  We describe how to verify and use this in the [[1073 User Guide#Getting Started | Getting Started Guide]].&lt;br /&gt;
&lt;br /&gt;
This page will show you how to:&lt;br /&gt;
* Install the ability to write and develop code on the SBC itself&lt;br /&gt;
* Use the command line for basic coding tasks&lt;br /&gt;
* Troubleshoot the SBC&#039;s network&lt;br /&gt;
It will also give additional specifications, which are useful for doing more advanced things with the SBC hardware and software.&lt;br /&gt;
&lt;br /&gt;
Before reading this page, you should have done the following via the Getting Started Guide:&lt;br /&gt;
* Set up networking on your SBC, via either Ethernet or wireless&lt;br /&gt;
* Set up an admin password&lt;br /&gt;
* Learned the IP address or link local address of the SBC&lt;br /&gt;
We will use this information in setting up the libraries and drivers to use the SBC for writing and running code.&lt;br /&gt;
&lt;br /&gt;
Conceivably, you could simply use the SBC like any Linux computer, and do all of your development and compiling of Phidget code on the SBC itself.  In practice this gets complicated as the SBC does not have a keyboard or screen.  So usually, you will want to develop your code an external computer and copy files and settings over to the SBC via a network.  This makes this Getting Started section unique, in that we show you how to set up both computers:&lt;br /&gt;
* Your [[#Getting Started - External Computer | External Development Computer]], usually your main desktop or laptop which will transfer files and settings to and from the SBC&lt;br /&gt;
* The [[#Getting Started - The SBC (Debian Linux) | SBC]] itself, which needs programming language libraries to use Phidgets.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - External Computer===&lt;br /&gt;
&lt;br /&gt;
You have two ways to connect to the SBC from an external computer: via the [[#SBC Web Interface|SBC Web Interface]] and over the more powerful but complex [[#SSH | Secure Shell (SSH)]].&lt;br /&gt;
&lt;br /&gt;
====SBC Web Interface====&lt;br /&gt;
&lt;br /&gt;
You have already worked extensively with the web interface in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  This was the tool within a web browser which was opened either via the [[Phidget Control Panel]] on Windows, or by simply entering the IP or link local address into an internet browser.  It allowed you to set the password, set up internet connectivity, and so on.  &lt;br /&gt;
&lt;br /&gt;
This section doesn&#039;t have more information on the interface; rather, it simply serves as a reminder that you have the web interface as an available tool.  Examples, including screenshots, are placed where appropriate in this document.  The web interface will probably stay your initial go-to way to connect to the SBC, especially for tasks that benefit from graphical interaction, like setting up wireless or using the webcam.&lt;br /&gt;
&lt;br /&gt;
====SSH====&lt;br /&gt;
&lt;br /&gt;
The most flexible way to transfer files and commands to and from the SBC is via a program called &#039;&#039;&#039;ssh&#039;&#039;&#039;.  The ssh program provides command line text access over a network into the SBC.  Using it, you can run programs and give the SBC commands.  The ssh program has a companion program called &#039;&#039;&#039;scp&#039;&#039;&#039; which can copy files back and forth.  If you are unfamiliar with ssh, you can think of it like the command line or a Mac terminal, but with a remote connection to a different computer.  It is a minimal yet effective way to interact with a remote computer.&lt;br /&gt;
&lt;br /&gt;
Before connecting over ssh, you will need:&lt;br /&gt;
* The &#039;&#039;&#039;IP address&#039;&#039;&#039; (such as 168.254.3.0) or &#039;&#039;&#039;link local address&#039;&#039;&#039; (such as phidgetsbc.local) of the SBC&lt;br /&gt;
* The &#039;&#039;&#039;admin password&#039;&#039;&#039; for the SBC&lt;br /&gt;
Both of these items can be found by following the steps in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].&lt;br /&gt;
&lt;br /&gt;
You will also need to enable SSH on the SBC side.  This can be done through the [[#SBC Web Interface| Web Interface]], under {{Code|Network &amp;amp;rarr; Settings}}, by changing the &#039;&#039;SSH Server&#039;&#039; radio button to &#039;&#039;Enabled&#039;&#039; and saving your changes:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_turn_on_ssh.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
=====SSH on Windows=====&lt;br /&gt;
&lt;br /&gt;
The ssh program is not installed on Windows by default.  But, there are a variety of SSH programs available for free. One simple and commonly used program is [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY], and it has the advantage that the executable doesn&#039;t need to install, it just runs.&lt;br /&gt;
&lt;br /&gt;
With PuTTY, when you first run the program it will ask you what to connect to.  Enter the IP address or link local address of the SBC, and then click the SSH radio button right below the address, which will change the port to 22.  Then click open, and you&#039;ll have an ssh connection to the SBC open in a terminal.  It will prompt you for a user name ({{Code|root}}) and password (the admin password).&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, there is an SCP component to PuTTY, called PSCP, which is available from the same [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY download page].  Use of PSCP will be similar with the address, username, and password, except that you will be transferring files instead of sending commands.&lt;br /&gt;
&lt;br /&gt;
=====SSH on Linux and Mac OS=====&lt;br /&gt;
&lt;br /&gt;
Linux and Mac OS already have ssh installed by default.  To run ssh simply open a terminal...&lt;br /&gt;
* {{Code|Ctrl-Alt-T}} on Linux &lt;br /&gt;
* {{Code|Applications &amp;amp;rarr; Utilities &amp;amp;rarr; Terminal}} on Mac OS &lt;br /&gt;
...and type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
ssh root@phidgetsbc.local&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have re-named your SBC, include that name instead of the {{Code|phidgetsbc.local}} link address.  Or, you can use the SBC&#039;s IP address, e.g. something like {{Code|ssh root@168.254.3.0}}&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, the command follows the form of: {{Code|scp from to}}&lt;br /&gt;
&lt;br /&gt;
So, to copy a file {{Code|/root/data.txt}} from the SBC to your local machine, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
scp root@phidgetsbc.local:/root/data.txt .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note the use of the dot &#039;&#039;&#039;.&#039;&#039;&#039; to indicate that scp should put the file in the current local directory.   If you&#039;re not sure what folder the terminal is operating in type {{Code|pwd}} to print the working directory.  Terminals usually start by default in your home folder.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - The SBC (Debian Linux)===&lt;br /&gt;
&lt;br /&gt;
The SBC runs Linux, which is a full operating system. It is stripped down compared to a full desktop release of Linux, but you can compile code on it, run programs, schedule tasks, create and manage files, run a web server, and much, much more.&lt;br /&gt;
&lt;br /&gt;
At this point you have connected to the SBC via the [[#SBC Web Interface|web interface]], and probably also through [[#SSH|SSH]].  This section will help you install libraries and drivers that you probably want - i.e. support for C, Java, and Python.  After this section, you&#039;ll be well into the depths of using the SBC as a computer, and so you&#039;ll probably want to keep the [[#Using SBC Linux|Using SBC Linux section]] open for reference while you work if you are not already familiar with Linux.&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the following Phidget functionality installed:&lt;br /&gt;
* The Phidget C libraries {{Code|libphidget21.so}}&lt;br /&gt;
* The Phidget [[#WebService | WebService]]&lt;br /&gt;
(If you are simply curious what these are and how they get installed, we describe the process on the [[OS - Linux | general Linux page]].)&lt;br /&gt;
&lt;br /&gt;
But to compile C programs, or run Java programs, or use Python, you will need to install these languages onto the SBC.  &lt;br /&gt;
&lt;br /&gt;
Before installing anything on the SBC, however, (even via a button on the web interface) make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
====Installing C/C++ and Java====&lt;br /&gt;
&lt;br /&gt;
The simplest way to install C/C++  and Java on the SBC is via the web interface.  There is a button under {{Code|System &amp;amp;rarr; Packages}} to install C support (including {{Code|gcc}}) and another button to install Java support:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_packages_web.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
You have to check that you are running the same version of Java on your development machine (where you plan on compiling the java programs) as the SBC is running. To do this type the following into the terminal on your computer and from ssh on the SBC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
Java -version&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need to update the version of Java on your SBC, use the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install openjdk-7-jre-headless&lt;br /&gt;
su&lt;br /&gt;
update-alternatives --config java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you&#039;re ready to begin programming.  We have programming pages for both [[Language - C/C++|C/C++]] and for [[Language - Java|Java]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].  &lt;br /&gt;
&lt;br /&gt;
If you want to avoid using the [[#SSH|SSH]] interface on the SBC entirely, and you want to write your program in Java and run it continuously from boot (which is the only option if you want to avoid [[#SSH|SSH]]), we have a [[#Program in Java with the Web Interface|very in-depth section]] on that topic.&lt;br /&gt;
&lt;br /&gt;
====Installing Python====&lt;br /&gt;
&lt;br /&gt;
Installing Python has two steps.  First, you&#039;ll need to install the basic ability to run python, and then you&#039;ll need to install the Phidget Python module.  Both steps (and both options) require that you issue the relevant commands through an [[#SSH|SSH terminal]].&lt;br /&gt;
&lt;br /&gt;
=====Basic Python=====&lt;br /&gt;
&lt;br /&gt;
The base Python functionality can be downloaded and installed in one step with [[#apt|apt]] (i.e. in a terminal, type):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will give you Python, and now you just have to install the Phidget Python module to gain Phidget functionality. If the installation fails because it can&#039;t find python, you need to enable the full repository as described in [[#Getting Started_-_The_SBC_(Debian_Linux)|this section]], and then perform an apt-get update.&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 1: Use a USB Key=====&lt;br /&gt;
&lt;br /&gt;
Copy the [{{SERVER}}/downloads/libraries/PhidgetsPython.zip Python Libraries] onto a USB key.  Unpack the zip file into a folder on the USB key.  Insert the key into the SBC.&lt;br /&gt;
&lt;br /&gt;
You will have to figure out where the USB key (and the Phidget Python library folder) is now located.  We describe how in the general [[#Using USB Data Keys | Using USB Data Keys]] section.&lt;br /&gt;
&lt;br /&gt;
After you know the place where the USB key is mounted, in a terminal go to that directory (e.g. type {{Code|cd /media/usb0/}}), enter the unpacked Phidget Python Library folder, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have an whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 2: Use the Internet=====&lt;br /&gt;
&lt;br /&gt;
Rather than using a USB key to transfer the file, the SBC can download it directly from the internet.  You will need {{Code|wget}} and {{Code|unzip}} installed, both of which are small:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install wget&lt;br /&gt;
apt-get install unzip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the web link address for the [{{SERVER}}/downloads/libraries/PhidgetsPython.zip Python Libraries].&lt;br /&gt;
&lt;br /&gt;
In an SSH terminal to the SBC, type: {{Code|wget http://www.python_library_link}} where instead of http://www.python_library_link you insert the link you just copied. Copying into a terminal can usually be done via the right-click menu.&lt;br /&gt;
&lt;br /&gt;
This will download the Phidget python libraries to the folder you ran the {{Code|wget}} command in.  Unzip the downloaded file using the command {{Code|unzip file}}, where file is the filename from {{Code|wget}}. Or try typing {{Code|ls}} to list the names of a file in the directory, which should include the unzipped folder.  Enter the unzipped folder (e.g. use {{Code|cd}} to change directory), and install the Phidget Python libraries:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have a whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
====Installing Other Languages====&lt;br /&gt;
&lt;br /&gt;
You may also be able to program on the SBC using [[Language - Ruby|Ruby]] and [[Language - C Sharp|C# under Mono]], though we do not offer in-depth support for these languages on the SBC.  The installation procedures should more or less follow that of [[#Installing Python|installing python]] on the SBC, except you will be installing Ruby or Mono.  Performing package searches using [[#apt|apt cache search]] can help you find the relevant software.&lt;br /&gt;
&lt;br /&gt;
For C#, as of 2012 the {{Code|mono-complete}} package is broken on the Debian Squeeze repository.  Rather, you have to install the Mono runtime and Mono compiler separately.&lt;br /&gt;
&lt;br /&gt;
To install the runtime package (and its dependencies), use [[#apt|apt]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-runtime&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to install the C# compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-gmcs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or the Visual Basic compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-vbnc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, the system and library packages do not link correctly for the version 2.0 of Mono.  If this is the case, your code will compile fine, but when you try to run it, you will get an error like:&lt;br /&gt;
&lt;br /&gt;
:{{Code|The assembly mscorlib.dll was not found or could not be loaded.}}&lt;br /&gt;
:{{Code|It should have been installed in the `/usr/lib/mono/1.0/mscorlib.dll&#039; directory.}}&lt;br /&gt;
&lt;br /&gt;
In this case, you need to install these two packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libmono-corlib1.0-cil&lt;br /&gt;
apt-get install libmono-system1.0-cil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we found these packages to work by working through the tree structure.  As a general rule, you can find these dependencies by using install (here, {{Code|apt-get install mono-complete}}) to get a sense of the package tree structure.  This will possibly tell you that the packages are broken, but at the same time this will list the dependencies of the packages.  Trying to install individual dependencies will show you that although a root-package fails, the sub-packages will sometimes succeed, and install what you need.&lt;br /&gt;
&lt;br /&gt;
If you want to use a specific dll or library that is not available in this reduced version of mono, you can install mono complete by switching from Emdebian+Debian to just Debian.  To do this:&lt;br /&gt;
&lt;br /&gt;
In {{Code|/etc/apt/preferences}} make the following changes:&lt;br /&gt;
:{{Code|Package: *}}&lt;br /&gt;
:{{Code|&amp;lt;nowiki&amp;gt;Pin: release a=stable&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
:{{Code|Pin-Priority: 1010}}&lt;br /&gt;
	&lt;br /&gt;
In {{Code|/etc/apt/sources.list/mutistrap-debian.list}} remove the emdebian line.&lt;br /&gt;
&lt;br /&gt;
Apply the changes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get dist-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many packages will be &#039;downgraded&#039; from the emdebian to debian versions.  Delete the {{Code|&amp;lt;nowiki&amp;gt;/etc/apt/preferences&amp;lt;/nowiki&amp;gt;}} file and install mono-complete:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install monodoc-http mono-complete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Choose monodoc-http explicitly, because otherwise the install fails on monodoc-browser.&lt;br /&gt;
&lt;br /&gt;
After this process, you can compile your C# Code.cs Phidget source file the same way as on a generic [[Language - C Sharp#Linux|Linux with Mono]] system.  Please refer to that page on how to obtain the *.dll Phidget resource file and compile your code.  On the SBC, however, because you are already running as root (the Super User), you do not need &#039;sudo&#039; and indeed the SBC will give you an error if you use it.  Instead, compiling and running will look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
gmcs Code.cs -r:Phidget21.NET.dll&lt;br /&gt;
mono Code.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using SBC Linux==&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve set up communication with the SBC, and installed whichever programming language support you need, you&#039;re probably ready for a short tour of useful tools on the SBC&#039;s version of Linux.&lt;br /&gt;
&lt;br /&gt;
First, you will by default be running on the SBC as &#039;&#039;&#039;root&#039;&#039;&#039;, which is the super-user.  For Linux users, this probably makes you nervous because you know you can overwrite important system files without the system asking for additional permission.  As a Windows or Mac OS user - although you may usually run your computer as an administrator - your familiar system usually prompts you to confirm before you do anything really dangerous, and this will &#039;&#039;&#039;not&#039;&#039;&#039; happen on the SBC as the root user.&lt;br /&gt;
&lt;br /&gt;
Next, there is no installed help on the SBC.  Help on Linux is usually called &#039;man pages&#039; which is short for &#039;the manual pages&#039;.  On a full Linux system, usually if you need help with any command you can type, for example, {{Code|man ls}} and it will give you help with the program [[#ls|ls]].  But these help pages take up significant space, and they are widely available online.  So, if you need more help with a certain command, you can always type {{Code|man command}} into your favourite search engine.&lt;br /&gt;
&lt;br /&gt;
Finally, the SBC has no windowing system.  For Linux users, this means no X-windows (Gnome, KDE, etc).  And as a Windows or Mac user, you can think of it as running all of your programs and commands through the terminal or DOS prompt command line.  The SBC provides all of the functionality of an operating system (e.g. process scheduling, file management, etc) but without any graphical interface.  The only exception is the [[#SBC Web Interface|web interface]], which gives graphical access to a limited part of what the SBC can do.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands===&lt;br /&gt;
&lt;br /&gt;
If you are doing more with the SBC than simply running pre-written programs [[#Writing a Phidget Program|in Java to run continuously from boot]], you will be interacting with the SBC&#039;s Linux operating system over the command line by using [[#SSH|SSH]].  This section discusses useful programs already installed on the SBC, and how to run them on the command line.&lt;br /&gt;
&lt;br /&gt;
====ls====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;ls&#039;&#039;&#039; program lists the contents of a directory.&lt;br /&gt;
&lt;br /&gt;
It will show both files and folders, but not files that start with a &amp;quot;.&amp;quot; (these are hidden files on Linux).&lt;br /&gt;
*If you also want to show hidden files, use {{Code|ls -a}}&lt;br /&gt;
*If you want more information, such as size and date modified, use {{Code|ls -l}}&lt;br /&gt;
*Commands can be combined, like {{Code|ls -al}}&lt;br /&gt;
&lt;br /&gt;
====cd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cd&#039;&#039;&#039; program changes to a new directory.&lt;br /&gt;
&lt;br /&gt;
For example, {{Code|cd /root}} changes into the directory at the base of the file tree called &#039;&#039;root&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* Linux uses forward slashes&lt;br /&gt;
* The base of all directories is &amp;quot;/&amp;quot; (not &amp;quot;C:\&amp;quot;)&lt;br /&gt;
* The tilde symbol (~) is short for your home directory (i.e. when you are root, this is short for &amp;quot;/root&amp;quot;)&lt;br /&gt;
* The double dot &amp;quot;..&amp;quot; means move one directory higher (for example from {{Code|/root/data/}} to {{Code|/root/}})&lt;br /&gt;
&lt;br /&gt;
====pwd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;pwd&#039;&#039;&#039; program prints the current directory you are working in.  (&#039;P&#039;rint &#039;W&#039;orking &#039;D&#039;irectory)&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
:{{Code|root@phidgetsbc:~# pwd}}&lt;br /&gt;
:{{Code|/root}}&lt;br /&gt;
&lt;br /&gt;
====cp, mv, and rm====&lt;br /&gt;
&lt;br /&gt;
These programs are copy (&#039;&#039;&#039;cp&#039;&#039;&#039;), move (&#039;&#039;&#039;mv&#039;&#039;&#039;), and remove (&#039;&#039;&#039;rm&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Copy copies a file from one location and pastes it to another.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|cp data.txt data_backup.txt}} will put a copy of the file {{Code|data.txt}} into {{Code|data_backup.txt}}&lt;br /&gt;
&lt;br /&gt;
Move moves a file (this is also useful for renaming files) to a new destination.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|mv data.txt data_backup.txt}} will put the contents of {{Code|data.txt}} into {{Code|data_backup.txt}}, and then will remove {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Remove deletes a file.&lt;br /&gt;
&lt;br /&gt;
For example, typing {{Code|rm data.txt}} will delete {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Note that &#039;&#039;&#039;rm&#039;&#039;&#039; is final.  Once you remove a file using {{Code|rm}}, it is gone forever.  There is no recycle bin, no temporary trash, nothing other than backups you may have personally created in the past!&lt;br /&gt;
&lt;br /&gt;
Directories can only be removed with {{Code|rmdir}}, and then only if they are empty.  If you want to remove a directory and all the files in it, use {{Code|rm -rf directory}} but be &#039;&#039;&#039;very, very careful&#039;&#039;&#039; with this command.  Trying to remove everything within a directory (e.g. {{Code|rm -rf *}}) is one of the most dangerous commands you can run on a Linux system, as running it from the wrong directory will result in Linux happily removing everything under that directory -- which could be your entire filesystem.&lt;br /&gt;
&lt;br /&gt;
====find====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;find&#039;&#039;&#039; program does what it says - it finds things.  &lt;br /&gt;
&lt;br /&gt;
Unfortunately for the casual user, the find program is very flexible and powerful, and thus not especially intuitive to use.  But, here are some examples:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|find folder -name file.txt}}&lt;br /&gt;
| Looks for all files in a folder (/ for root - or all - folders) with a certain name (* for wildcard)&lt;br /&gt;
| {{Code|find / -name *.jpg}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|find folder -mtime +X}}&lt;br /&gt;
| Looks for all files in a folder modified less than X days ago&lt;br /&gt;
| {{Code|find /root -mtime +30}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====grep====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;grep&#039;&#039;&#039; program takes text input and searches for a term. &lt;br /&gt;
&lt;br /&gt;
For example, if you type {{Code|mount}} to view what devices are mounted (e.g. loaded) on your SBC, you will see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may be a lot of information you don&#039;t need.  If you are only interested in a USB key attachment (as described in the [[#Using USB Data Keys|Using USB Data Keys]] section), you can use grep to filter that one response:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep sda1&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====nano====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;nano&#039;&#039;&#039; program is a small text editor that you can use within an SSH terminal. &lt;br /&gt;
&lt;br /&gt;
Nano can be surprisingly useful for writing short lengths of code right on the SBC, so there is no need to transfer files and keep track of different file versions on different computers.&lt;br /&gt;
&lt;br /&gt;
Nano has all keyboard commands which are listed at the bottom of the screen at all times as a reminder (Ctrl-O to save, Ctrl-X to exit, these expand with a larger terminal window).  And, nano provides what is called &#039;syntax highlighting&#039;, which colours reserved keywords, comments, strings, and so on as appropriate to the programming language you are using.  Nano detects the programming language via the extension of the file ({{Code|.java}} for Java, {{Code|.c}} for C/C++, and {{Code|.py}} for Python).&lt;br /&gt;
&lt;br /&gt;
Typing {{Code|nano test.py}} on an SSH command line and then entering a few lines of Python into the new empty file results in:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_nano_python.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
====apt====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;apt&#039;&#039;&#039; program allows you to install, uninstall, upgrade, and search software available for the SBC.&lt;br /&gt;
For a non-Linux user, the apt framework may be daunting at first, but it actually allows you to keep your system up to date and install and manage software quickly, easily, and for free.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Before installing anything on the SBC, make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-cache search term}}&lt;br /&gt;
| Looks for all programs (packages) that have {{Code|term}} in the title or description&lt;br /&gt;
| {{Code|apt-cache search opencv}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-cache show package}}&lt;br /&gt;
| Shows a lot of data about {{Code|package}} including size, version, etc&lt;br /&gt;
| {{Code|apt-cache show unzip}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-get update}}&lt;br /&gt;
| Gets the most recent listing of available software&lt;br /&gt;
| {{Code|apt-get update}}  (No options)&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-get install program}}&lt;br /&gt;
| Installs {{Code|program}} from the internet&lt;br /&gt;
| {{Code|apt-get install python}}&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====mount====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|mount}} shows you all of the mounted devices on your SBC.  &lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the non-Linux user, the concept of a device may be quite strange.  To give a short summary, everything on Linux that you can read or write is a file.  Webcams are files (i.e. you can &#039;read&#039; photos from them), USB keys are files, and each filesystem (tmp storage, the kernel portion, the main filesystem) are also themselves files.  These files specify what and how something can be written.  These are not necessarily linear, for example, you can see above that the USB key ({{Code|/media/usb0}} is mounted &#039;&#039;within&#039;&#039; the root file system {{Code|rootfs}} which is /.   &lt;br /&gt;
&lt;br /&gt;
So mount gives you an idea of what devices have been &#039;mounted&#039; for reading or writing, and how you can read and write to them.  More information on mount (and its various forms, like {{Code|umount}}) is available widely around the Internet.&lt;br /&gt;
&lt;br /&gt;
====which====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|which}} tells you if and where a program is installed.&lt;br /&gt;
&lt;br /&gt;
For example, on a default SBC, typing {{Code|which python}} will return no results.  But after successfully [[#Installing Python | installing python]], it will return {{Code|/usr/bin/python}} as the location of the python program/binary/executable.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands to Install===&lt;br /&gt;
&lt;br /&gt;
These are other programs you may find useful on the command line.  Although they are not on the SBC by default, these and other programs can usually be installed simply by using [[#apt|apt-get install]], with the exception of gcc.  For example, {{Code|apt-get install wget}} will download and install [[#wget|wget]].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This section and the section on [[#Some Useful Commands|pre-installed commands]] can hardly cover all of the complexities and power of the Linux operating system.  There are many excellent tutorials online, and between them and using [[#apt|apt]] to find and install programs you should be able to learn a lot and perform any number of complex useful tasks.&lt;br /&gt;
&lt;br /&gt;
====gcc====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;gcc&#039;&#039;&#039; program is the C compiler for Linux.&lt;br /&gt;
&lt;br /&gt;
If you are an experienced C/C++ user on Mac or Linux, or if you&#039;ve already read our [[Language - C/C++ | C Language page]], you might think you need to install gcc via {{Code|apt-get}} to compile C code.  However, gcc is not in the package repository for the SBC, so {{Code|apt-get install gcc}} will fail.  Rather, to install gcc, you can do it via the web interface, as described in the [[#Installing C/C++ and Java|Installing C/C++ and Java]] section.&lt;br /&gt;
&lt;br /&gt;
After installing it via the SBC web interface, you can use {{Code|gcc}} normally.&lt;br /&gt;
&lt;br /&gt;
====less====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;less&#039;&#039;&#039; program displays the contents of a text or source code file.  When displaying the file, {{Code|less}} allows you to scroll up and down to read it.&lt;br /&gt;
&lt;br /&gt;
This is useful if you are writing your sensor readings to a data file, and you want to read the data file while it is being written by your main code.  If your data file is called {{Code|data.txt}}, you can type {{Code|less data.txt}} and see the lines in the file, and what they are.&lt;br /&gt;
&lt;br /&gt;
The {{Code|less}} program output can also be piped into another program.  For example, you can use {{Code|less}} and the word search program {{Code|grep}} to find lines within a file with a search term.  For instance, if you have a C source code file {{Code|Program.c}} on the SBC, and you want to see all the lines in {{Code|Program.c}} that contain a variable name {{Code|var}}, you can type: &lt;br /&gt;
:&amp;lt;code&amp;gt;less Program.c | grep var&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====wget====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;wget&#039;&#039;&#039; program allows you to get an online file (over http) and download it to the SBC.&lt;br /&gt;
&lt;br /&gt;
For example, to get the source file (HTML) from the Phidgets home page, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
wget http://www.phidgets.com&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is most useful for downloading libraries, drivers, or anything (zip, tar, etc) you need from the web which is not available by [[#apt|using apt]].&lt;br /&gt;
&lt;br /&gt;
===Writing a Phidget Program===&lt;br /&gt;
&lt;br /&gt;
We provide two ways to write and upload a Phidget Program:&lt;br /&gt;
# The [[#SBC Web Interface|web interface]]:&lt;br /&gt;
#* This is useful for simple projects written in Java that you want to start only at boot&lt;br /&gt;
#* You can also use C projects, but they must be compiled off the SBC for an ARM processor&lt;br /&gt;
# Over [[#SSH|SSH]], which will allow you to write or transfer source code directly to and from the SBC&lt;br /&gt;
#* This is useful for all other projects, such as:&lt;br /&gt;
#** Projects that run at scheduled times (e.g. once per minute)&lt;br /&gt;
#** Projects that use languages other than Java or ARM-compiled C&lt;br /&gt;
Note that you can still run an [[#SSH|SSH]] project at boot, you just have to write and install a startup script.  This is a bit complex, but we do have an example that starts the program {{Code|phidgetwebservice21}} [[OS - Linux#As A Service|at boot using a script]].&lt;br /&gt;
&lt;br /&gt;
Once you know which method you&#039;d like to use, you can continue on to learn how to [[#Program in Java with the Web Interface|Program in Java with the Web Interface]], or how to [[#Program with SSH|Program with SSH]] using Java, C, or Python.  If you are actually typing in source code on the SBC, you&#039;ll find our [[#Developing Code on the SBC|developing code on the SBC section]] useful.&lt;br /&gt;
&lt;br /&gt;
====Program in Java with the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To show how to write, compile, and install Java programs on the SBC, we&#039;ll use the [[Language - Java|Java Hello World]] example code.  You can download the HelloWorld example by downloading the whole [{{SERVER}}/downloads/examples/JavaJNI.zip Java example package].  Make sure you have the same version of [[#Installing C/C++ and Java|Java installed on the SBC]] as you have on your external development machine. Instruction for checking and updating are found on the [[#Installing C/C++ and Java|installation page]].&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how to get the HelloWorld code running on the SBC.  On your external computer:&lt;br /&gt;
&lt;br /&gt;
1. Download the SBC version of the Phidget Java libraries ({{Code|phidget21.jar}}).  You can download this from the [[#SBC Web Interface|web interface]], on the page under {{Code|Projects &amp;amp;rarr; Projects}}, under the &#039;&#039;&#039;Notes&#039;&#039;&#039; section.&lt;br /&gt;
&lt;br /&gt;
2. Place the SBC version of {{Code|phidget21.jar}} into a directory on your external computer.  This will be your working directory that you will use to compile the Java files.&lt;br /&gt;
&lt;br /&gt;
3. Also copy the {{Code|HelloWorld.java}} file into that working directory.&lt;br /&gt;
&lt;br /&gt;
4. Compile the {{Code|HelloWorld.java}} file from within that working directory.  From the command line prompt on Windows, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .;phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In a terminal on Linux or Mac OS, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. You should now have three compiled class files: {{Code|HelloWorld.class}}, {{Code|HelloWorld$1.class}}, and {{Code|HelloWorld$2.class}}.  You don&#039;t need to try and run them, and if you do you may encounter an error because the SBC {{Code|phidget21.jar}} may be slightly different than the Phidget support you have installed on your external computer.&lt;br /&gt;
&lt;br /&gt;
Now we move onto the SBC:&lt;br /&gt;
&lt;br /&gt;
6. Create a new project on the SBC, in the web interface under {{Code|Projects &amp;amp;rarr; Projects}}.  Call it HelloWorld:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_create_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
7. On the next screen, you will be prompted to upload your files.  We will upload the three Java class files, and then click the {{Code|Start}} button:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_web_run_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
8. You&#039;ll note that as it runs, there are two links below the {{Code|Stop}} button: One called {{Code|stdout}}, which is &#039;&#039;Standard Output&#039;&#039;, and one called {{Code|stderr}}, which is &#039;&#039;Standard Error&#039;&#039;.  Usually, when you run a program on the command line, you see both standard out and standard error at the same time - i.e. you get all program output right there in your terminal or command prompt.  But when running a program in the background, Linux splits the output up into normal output and error output as this is very useful for debugging (i.e. you can check if standard error is empty).  &lt;br /&gt;
&lt;br /&gt;
Here, however, if you&#039;re not sure whether the program will run correctly, you should first check {{Code|stderr}} to see if any errors were generated, and then check {{Code|stdout}} to see if the output looks as expected.&lt;br /&gt;
&lt;br /&gt;
To write your own Java program, follow the same process but use your own source code instead of the {{Code|HelloWorld.java}} example.&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, we offer additional help on [[#Via the Web Interface|running a program automatically using the web interface]].&lt;br /&gt;
&lt;br /&gt;
====Program with SSH====&lt;br /&gt;
&lt;br /&gt;
Similarly to starting a program via the [[#Program in Java with the Web Interface|web interface]], we use the Phidget Java {{Code|HelloWorld}} example here.&lt;br /&gt;
&lt;br /&gt;
Make sure you have [[#Installing C/C++ and Java|Java installed on the SBC]].  To compile and run the {{Code|HelloWorld}} example:&lt;br /&gt;
&lt;br /&gt;
1. Open an [[#SSH|SSH terminal]] to the SBC&lt;br /&gt;
&lt;br /&gt;
2. Download the [{{SERVER}}/downloads/examples/JavaJNI.zip Phidget Java Examples] to the SBC, using [[#wget|wget]] (you may need to install {{Code|wget}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
3. Unpack the examples using [[#unzip|unzip]] (you may need to install {{Code|unzip}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
4. The location of {{Code|phidget21.jar}} on the SBC is {{Code|/usr/share/java/phidget21.jar}}.  Within the unzipped example directory, compile the {{Code|HelloWorld.java}} example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:/usr/share/java/phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. To run the {{Code|HelloWorld}} program, use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
java -classpath .:/usr/share/java/phidget21.jar HelloWorld&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, you&#039;ll probably want to learn to [[#Running a Program Automatically|run this Java program automatically]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; If you&#039;re used to using Linux with Phidgets already, you&#039;ll probably notice that you don&#039;t need to switch into root using {{Code|sudo}} on the SBC in order to run programs.  This is because you already are running as root, not because the [[OS - Linux#Setting udev Rules|udev rules are set up]].  So if you set up another user, or [[#Via Cron|run a cron job]] as anything other than root or system, you&#039;ll need to add permission for the Phidget program to run in your [[OS - Linux#Setting udev Rules|udev rules]].&lt;br /&gt;
&lt;br /&gt;
====Developing Code on the SBC====&lt;br /&gt;
&lt;br /&gt;
When you&#039;re not just using pre-written source code, and you&#039;re writing code actually on the SBC itself, you&#039;ll probably want to use [[#nano|nano]].  Other terminal editors on the SBC include {{Code|vi}} which is already installed, and {{Code|emacs}}, which you can install using [[#apt|apt]].  Both {{Code|vi}} and {{Code|emacs}} are much more efficient for the experienced user, but they contain modes and keyboard shortcuts that can seem strange or almost hindering to the casual user.&lt;br /&gt;
&lt;br /&gt;
Regardless of which editor you choose to use, some of your keyboard habits may not transfer well.  For example, in the Linux command line, the command {{Code|Ctrl-C}} means &#039;&#039;stop the currently running program&#039;&#039;, (i.e. your open editor) not copy.  Within most SSH terminals, you can copy and paste using the right-mouse button, and on some terminals (and all native Linux terminals) you can copy by simply highlighting text, and you can paste it using the middle (scroll) mouse button.  On the other hand, if you write a program that hangs on the command line, {{Code|Ctrl-C}} can actually be useful to terminate it.&lt;br /&gt;
&lt;br /&gt;
Also {{Code|Ctrl-Z}} does not mean &#039;&#039;undo&#039;&#039;, rather it means &#039;&#039;run the current program in the background&#039;&#039;.  This is useful because running a program in an SSH terminal simply hangs your SSH input until the program is done.  So typing {{Code|Ctrl-Z}} while the program is running frees up the command line for more input.  But if you accidentally hit {{Code|Ctrl-Z}} while running an editor like [[#nano|nano]], the editor will immediately exit to the command line.  Don&#039;t worry though, it will not stop or lose your work.  You can bring it back up by using the {{Code|fg}} (e.g. &#039;foreground&#039;) command, like {{Code|fg nano}}, and this will automatically bring your nano process back to the front.&lt;br /&gt;
&lt;br /&gt;
===Running a Program Automatically===&lt;br /&gt;
&lt;br /&gt;
For testing your program, you will certainly want to run it via [[#SSH|SSH]] or via the {{Code|Start}} button on the project page on the web interface until you are quite sure it runs well.  However, eventually you will probably want the program to run without your input, either [[#Via the Web Interface|continuously, and starting at boot]], or via a task scheduled to [[#Via Cron|run to completion at certain times]].&lt;br /&gt;
&lt;br /&gt;
Both have their advantages and disadvantages.  Usually, you would want to use the continuous, from-boot methods for event driven code that has to handle a wide variety of user input that could occur at any time.  You would want to use the scheduled method when the SBC needs to perform a repeated task (e.g. reading sensor data) again and again.  The main difference is:&lt;br /&gt;
* With the continuous (boot) method you can have any Phidgets (including sensors, LEDs, input switches, etc) attached and giving events to your code all the time, and&lt;br /&gt;
* With the scheduled (cron) method you have much less of a chance to run into long-term memory management and instability problems with any code you write, because your program runs for only a short time before exiting and getting cleaned up.&lt;br /&gt;
&lt;br /&gt;
====Via the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To use this method, you must have created the program you want to run as [[#Program in Java with the Web Interface | a Java or ARM-compiled C project in the web interface]].  If you would like to use another language, or another way of uploading your project, but you still want to start at boot and run continuously, you will need to use a [[#Via a Boot Script|boot script]].&lt;br /&gt;
&lt;br /&gt;
In the web interface, go to the {{Code|Projects}} tab, and click on the project you would like to run.  Near the bottom of the project page (the one with the {{Code|Start}} and {{Code|Stop}} buttons at the top), there will be a section called {{Code|Startup Settings}}.  You can see a screenshot of the whole project page, including these settings, in the [[#Program in Java with the Web Interface | web interface project section]].&lt;br /&gt;
&lt;br /&gt;
Select the {{Code|Enabled}} radio button.  The other defaults should be fine, unless you specifically know otherwise:&lt;br /&gt;
* For &#039;&#039;Boot Order&#039;&#039;, lower numbers boot first.  Booting later means more programs are available for use, booting earlier means other programs can use your program.  &lt;br /&gt;
* &#039;&#039;Run as a daemon&#039;&#039; starts the program as a daemon, which is a program that runs in the background.  Unless you have &#039;&#039;explicitly&#039;&#039; written your program as a daemon, leave this checked.  (If you don&#039;t know what a daemon is, don&#039;t worry, you haven&#039;t written one, so leave it checked.)  &#039;&#039;Un&#039;&#039;checking this when your program is a normal program will cause the SBC to hang while booting.&lt;br /&gt;
* The &#039;&#039;Executable or Class&#039;&#039; name should be automatically sensed to be your main Java class&lt;br /&gt;
* &#039;&#039;Arguments&#039;&#039; are any command line arguments you need, just as you would type them into the command line&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Your program must be very, very stable to run properly via the web interface.  Imagine your program running continuously for days, or months on end.  Any memory leaks, over time, will render your program (and the SBC) unusable until a reboot.  Counts or other variables that increase within your program and never reset may create a segmentation fault eventually.&lt;br /&gt;
&lt;br /&gt;
If, for stability purposes, you want your program to start, run for a little while, and then exit so that the SBC operating system can clean up the memory each time, you&#039;ll probably want to use [[#Via Cron|Cron]] to run your program instead.&lt;br /&gt;
&lt;br /&gt;
====Via Cron====&lt;br /&gt;
&lt;br /&gt;
Cron can automatically schedule programs - known as &#039;jobs&#039;, or &#039;cron jobs&#039; - at most once per minute.  Less often than that, it is very flexible, allowing you to run it on certain months, weekdays, hours, etc.  Cron simply reads a special file (your {{Code|crontab}}) and runs whatever programs are listed, with whatever timing they are listed with.  The cron program runs all the time in the background, making it what is known as a Linux &#039;&#039;daemon&#039;&#039;, but the programs it starts as jobs run only as long as they naturally would, and then they exit.&lt;br /&gt;
&lt;br /&gt;
If you need your program to run more often than once per minute, have the program schedule itself while still running.  For example, to run every five seconds, run a fast loop,  and sleep for five seconds. Do this twenty times and exit.  Then schedule this once per minute using cron, and your program will in essence run every five seconds.&lt;br /&gt;
&lt;br /&gt;
Setting up a cron job simply entails editing your {{Code|crontab}} file.&lt;br /&gt;
&lt;br /&gt;
First, you&#039;ll probably want to specify your default editor to be [[#nano|nano]]. Otherwise it will default to {{Code|vi}} and you&#039;ll have to figure out {{Code|vi}} in order to add lines to your crontab:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
export EDITOR=nano&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to edit your crontab file, simply type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
crontab -e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each line of the crontab file is one scheduled job.  Lines that start with a hash &amp;quot;#&amp;quot; are comments and are ignored.  There is an example line in the crontab, and a reminder line at the very end.  Essentially, each line should contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
minute hour dayOfMonth month dayOfWeek  command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*{{Code|command}} is the program you want to run (with absolute path, and arguments)&lt;br /&gt;
** For example, {{Code|./myprogram argument1}} won&#039;t work, but {{Code|/root/code/myprogram argument1}} will&lt;br /&gt;
* Each time argument is either a number, a list of numbers separated by commas, or an asterisk&lt;br /&gt;
** For example, * * * * * means every minute for all days and months, 0,30 * * * * means every thirty minutes (i.e. at the top of the hour and at 30 minutes in) for all days and months&lt;br /&gt;
&lt;br /&gt;
If you already have jobs scheduled, you&#039;ll see them in the file that comes up.  You can edit, add, or delete.  &lt;br /&gt;
&lt;br /&gt;
After you save, you&#039;ll see a little message back in the terminal that says the new crontab file was installed, and it is now scheduled!  Cron always starts every boot, and so if you have edited and installed your crontab as above, the scheduling of your program will start properly even after a reboot of the SBC.  However, if you are having strange scheduling problems, you may want to familiarize yourself with the [[#Software Details|software details]] of how the SBC as a whole determines the current date and time.&lt;br /&gt;
&lt;br /&gt;
=====My Cron Job Doesn&#039;t Work!=====&lt;br /&gt;
&lt;br /&gt;
It is actually very common for a script or program to work on the command line but then &#039;&#039;not&#039;&#039; work as a cron job.  The most common reason for this, by far, is that you specify &#039;&#039;relative&#039;&#039; paths in your program to access files rather than &#039;&#039;absolute&#039;&#039; paths.  For example:&lt;br /&gt;
* {{Code|code/project.c}} is a relative path (bad for cron)&lt;br /&gt;
* {{Code|/root/code/project.c}} is an absolute path (good for cron)&lt;br /&gt;
The cron jobs are &#039;&#039;not&#039;&#039; executed from your home directory, or your code directory, so they will not be using the same location you may be using to test your code.  So always use absolute paths.&lt;br /&gt;
&lt;br /&gt;
Another common reason is you may be using environment variables or other settings that are true in a terminal but are &#039;&#039;not&#039;&#039; true by default in the raw system.  You can end up taking many things for granted in a shell, for example the shortcut &amp;quot;~&amp;quot; means home directory in a shell, but not by default in the raw system.  The things that get loaded for a shell (but which are not present in the raw system) are:&lt;br /&gt;
* The settings loaded by {{Code|/etc/profile}}&lt;br /&gt;
* Any settings in {{Code|~/.bashrc}}, which is nothing by default on the SBC&lt;br /&gt;
&lt;br /&gt;
On a full Linux operating system, you would use the logs written to by cron to find the error output and debug it.  On the SBC, however, cron does not write logs (otherwise, these logs would eat up the SBC memory very quickly even for routine jobs).  For short-term debugging, you can write output from your program to a file, and read that file afterwards to figure out what your program is doing.&lt;br /&gt;
&lt;br /&gt;
====Via a Boot Script====&lt;br /&gt;
&lt;br /&gt;
If you want to run your program constantly and for it to start at boot like the [[#Via the Web Interface|web interface would do]], you can install your program into the boot order using a script.  This is a somewhat involved process, and you should be familiar with shell programming in Linux.  For this process, we only offer a [[OS - Linux#As A Service|similar example]] which installs and runs the program {{Code|phidgetwebservice21}} within the boot sequence.&lt;br /&gt;
&lt;br /&gt;
===Using USB Data Keys===&lt;br /&gt;
&lt;br /&gt;
After plugging the USB key in, it won&#039;t just appear on your desktop, so to speak, so you&#039;ll need to figure out where you can read and write to it within the SSH directory structure.&lt;br /&gt;
&lt;br /&gt;
The web interface program can help with this.  After you plug a USB key in, it will show up under {{Code|Status &amp;amp;rarr; System}}.  Or, the USB key and all other attached devices can be seen at {{Code|Status &amp;amp;rarr; USB}}:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_mounted_devices.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
In the screenshot above, you can see that the USB key is located in {{Code|/media/usb0}}.&lt;br /&gt;
&lt;br /&gt;
Alternately, you can use the SSH command {{Code|mount}}, and the searching program {{Code|grep}} which will filter the response of {{Code|mount}} and only return the lines with your search term ({{Code|usb}}):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep usb&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the USB key can be written to and read from using the {{Code|/media/usb0}} directory.  Copying a file to {{Code|/media/usb0}} will copy a file to the USB key.  The same goes for removing, renaming, opening files within your program, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Mount points like {{Code|/media/usb0}} should not be hard-coded into any of your programs.  (See the [[#Common Problems and Solutions | Common Problems and Solutions]] section for more information.)  If you need to obtain the mount point for a freshly mounted USB key within your code, have your code obtain the mount tables and search on the &#039;&#039;device&#039;&#039;  (e.g. {{Code|/dev/sda1}} or {{Code|/dev/sdb1}}) and obtain the corresponding mounted {{Code|/media/usbN}} location, where N is a number 0-9.&lt;br /&gt;
&lt;br /&gt;
===Saving and Retrieving Data===&lt;br /&gt;
&lt;br /&gt;
This section covers getting data on and off of the SBC.  There are two main methods of simply moving data on and off the SBC - via a [[#Via a USB Key|USB key]], and via [[#Over the Network (SCP)|copy over the network]] - and a third method for moving and installing data when it concerns [[#Backing Up Your Data|backing up lower level system data]].&lt;br /&gt;
&lt;br /&gt;
====Via a USB Key====&lt;br /&gt;
&lt;br /&gt;
After plugging in a USB data key, first you need to [[#Using USB Data Keys | find out the location]] where that data key was mounted.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the location of the USB key is {{Code|/media/usb0/}}, and we want to copy the file {{Code|data.txt}} to the USB key.  Your SSH session might look something like this, using [[#ls|ls]] and [[#mount|mount]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# ls&lt;br /&gt;
data.txt&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
root@phidgetsbc:~# cp data.txt /media/usb0/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cp&#039;&#039;&#039; program copies data from a source to a destination.  The syntax is {{Code|cp from to}}, where here we are copying from {{Code|data.txt}} to {{Code|/media/usb0/}}.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caution:&#039;&#039;&#039; Even if there is no USB key mounted at {{Code|/media/usb0/}}, this use of {{Code|cp}} will still work &#039;&#039;with no errors&#039;&#039;!  This is because there is still a file called {{Code|/media/usb0/}}, there is just no USB key file system &#039;&#039;mounted&#039;&#039; to that point.  So be sure to run [[#mount|mount]] or use some other method of determining that there is, in fact, a USB data key attached and where it is mounted to.&lt;br /&gt;
&lt;br /&gt;
====Over the Network (SCP)====&lt;br /&gt;
&lt;br /&gt;
SCP is a command line program already installed on Linux and Mac OS, and downloadable for free on Windows.  We discuss it and give examples in the [[#SSH|SSH]] section, but remember it here when you&#039;re trying to get data on and off of the SBC.  With SSH or a terminal already open, you&#039;ll probably find it to be much faster and easier than dealing with a USB key.&lt;br /&gt;
&lt;br /&gt;
====Backing Up Your Data====&lt;br /&gt;
&lt;br /&gt;
For the web interface, you can save and restore all web interface settings under the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} tab.&lt;br /&gt;
&lt;br /&gt;
To save the settings of what packages are installed for later re-installation, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg --get-selections &amp;gt; installedPrograms.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then save the file {{Code|installedPrograms.txt}} externally.  If you have to completely wipe the SBC, you can just reinstall the whole list by moving the {{Code|installedPrograms.txt}} file back onto the SBC, and then typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg –set-selections &amp;lt; installedPrograms.txt&lt;br /&gt;
apt-get dselect-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also remember to externally save:&lt;br /&gt;
* Your {{Code|~/.bashrc}} settings file if you&#039;ve changed it&lt;br /&gt;
* Your {{Code|crontab}} file if [[#Via Cron|you&#039;ve edited it]]&lt;br /&gt;
* Any data files or code you&#039;ve created&lt;br /&gt;
&lt;br /&gt;
It is important to save these settings often, and at points where you know the system is running well.  It may be tempting to create a backup right before you [[#Recovery System|wipe the SBC and start from scratch]], but often the reason you are having problems then is some setting or change, and backing these up and reinstalling them will only reinstall the problem.&lt;br /&gt;
&lt;br /&gt;
To truly back the files up, you must copy them to an external computer or location using either a [[#Via a USB Key|USB Key]] or [[#Over the Network (SCP) | over the network]].  Then they can be copied back if needed later.&lt;br /&gt;
&lt;br /&gt;
If you are looking to restore data on an SBC that will not boot properly, you&#039;ll want to be in the [[#Partial Recovery|partial recovery]] portion of our Troubleshooting section.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
The SBC can be quite tricky to debug, because it is a complex and flexible computer.  Common problems and solutions include:&lt;br /&gt;
* You can&#039;t find the SBC on the network at all - refer to the [[#Initial Internet Setup|Initial Internet Setup]] section&lt;br /&gt;
* You have changed some setting or file such that the SBC doesn&#039;t run anymore, or doesn&#039;t run as expected - refer to the [[#Recovery|Recovery]] section&lt;br /&gt;
&lt;br /&gt;
If you are having trouble using Phidgets on the SBC, you should go through the [[OS - Linux#Troubleshooting | Troubleshooting section on the general Linux page]].  Some of the problems on the Linux page (such as library problems) are easier to fix by simply working through the [[#Recovery|Recovery]] section when they occur on the SBC.&lt;br /&gt;
&lt;br /&gt;
Namely, it often helps to simply perform a [[#Factory Reset|factory reset]] on the SBC (save your files and installed program list first, as [[#Backing Up Your Data|described here]]).  Sometimes you change a file or setting within the operating system when you are trying to get something up and running, and this unintentionally affects other programs too.  Performing a factory reset starts you with a clean slate.&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, or the information within this guide, please [[Contact Us|ask us]]!&lt;br /&gt;
&lt;br /&gt;
===Initial Internet Setup===&lt;br /&gt;
&lt;br /&gt;
To set up the SBC, you almost always need a &#039;&#039;wired&#039;&#039; Ethernet connection with DHCP (Dynamic Host Configuration Protocol), and without a firewall.  This connection should be to a &#039;&#039;router&#039;&#039;, not directly plugged in to your computer.&lt;br /&gt;
&lt;br /&gt;
Even if you do not have this type of a connection at home, these types of connections are very common at both offices and universities.  On a Windows or Mac OS computer, you can bring up the [[Phidget Control Panel]] as described in the SBC&#039;s [[1072 User Guide#Getting Started|Getting Started Page]].  Failing this, or on a Linux computer, we discuss some alternate setup methods in this section.  Keep in mind that without a wired, open DHCP connection these setup methods can be difficult and fickle. &lt;br /&gt;
&lt;br /&gt;
====No Wired-Only Connection====&lt;br /&gt;
&lt;br /&gt;
Sometimes it can work to plug the SBC, using Ethernet, directly into an Ethernet port on your home wireless router.  Do not plug it directly into your computer!  (Although in some instances, a direct connection can be made to work on Linux, see the [[#No DHCP|No DHCP]] section below) &lt;br /&gt;
&lt;br /&gt;
This direct-router method is a very picky process, however, and can fail because:&lt;br /&gt;
* Some home and office routers place a firewall between wireless connections (clients) and wired connections (the local area network)&lt;br /&gt;
* Some home and office routers do not by default allow both Ethernet DHCP and wireless DHCP.&lt;br /&gt;
* Some routers and DHCP hubs only provide access to an internet connection, and do not provide local area network inter-connections (this is common on mobile device tethering hubs)&lt;br /&gt;
&lt;br /&gt;
Routers are quite complex, and even with admin privileges it can be a painstaking process to find all the right firewall settings to turn off in order to allow two computers on the network to talk to one another, rather than just connect to the internet.  This is why university or office networks are often ideal for the purpose of setting up the SBC, because these institutions depend on computers on a local network being able to talk together.  University libraries in particular can be a good source of wired DHCP connection ports.  &lt;br /&gt;
&lt;br /&gt;
Covering all of the different router configuration possibilities here, and how to change them to make the SBC work, is essentially impossible.  If you try using the SBC at home or at work, the SBC does not work on the first try when plugged directly into the router via Ethernet, and you want to make that connection work rather than seeking out an alternate for the initial setup, you should find documentation specific to your router (usually available online) and properly configure it.&lt;br /&gt;
&lt;br /&gt;
The good news is that if you can find an Ethernet DHCP connection &#039;&#039;just once&#039;&#039; for a short time, you can use that connection to configure the SBC to work on your home wireless network.  During that initial connection, you can enable wireless and set up as many wireless DHCP connections (with passwords) that you need.  Once wireless is enabled and set up, you can take the SBC home to your wireless router and the SBC will automatically seek out and connect to its remembered networks as they appear.  At that point, you can also use wireless like a normal internet, web interface, and SSH connection.&lt;br /&gt;
&lt;br /&gt;
====No Link Local Addressing====&lt;br /&gt;
&lt;br /&gt;
If you have a wired DHCP connection, no firewall, and no link local addressing (e.g. bonjour or avahi is not installed) then you will need access to the DHCP router logs.  From the router logs, you should see the connection (or attempted connection) by the SBC within the logs.  From that log entry, you should either be able to determine the IP address for the SBC, or see what happens when the router blocks access.  The IP address can be used in place of the link local address for both the web interface and for SSH.&lt;br /&gt;
&lt;br /&gt;
====No DHCP====&lt;br /&gt;
&lt;br /&gt;
The SBC will first try to use DHCP, but then it will revert to responding to a link local address under bonjour and avahi.  If you are depending on this, please wait &#039;&#039;&#039;at least three minutes&#039;&#039;&#039; after the SBC boots for the SBC to fail in obtaining a DHCP connection and properly revert to link local addressing.&lt;br /&gt;
&lt;br /&gt;
If you have a static IP setup, and want to use link local addressing rather than accessing the router logs, this should usually work by default on Windows and Mac OS (e.g. type the address such as {{Code|phidgetsbc.local}} into a web browser).  If it doesn&#039;t work automatically, there is not much you can do and you should seek out a wired DHCP connection elsewhere.&lt;br /&gt;
&lt;br /&gt;
On Linux, it also should work by default, but you have the additional option of explicitly adding routes that look within the default network settings for the SBC.  From a terminal (as root), type:&lt;br /&gt;
* {{Code|route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0 metric 99}}&lt;br /&gt;
* {{Code|route add default dev eth0 metric 99}}&lt;br /&gt;
You can also compile and use the {{Code|phidgetsbclist.c}} example (use the provided Makefile, don&#039;t use gcc) in the [{{SERVER}}/downloads/libraries/libphidget.tar.gz Phidget Linux Libraries] package, under the {{Code|examples}} folder.  This will allow you to see if the SBC is detected on the network at all.   Note that to use this option you must have the Phidget Libraries and the Phidget WebService installed on your Linux computer - in-depth instructions to do this are on the [[OS - Linux|main Linux page]].&lt;br /&gt;
&lt;br /&gt;
===Recovery System===&lt;br /&gt;
&lt;br /&gt;
You can either boot the SBC into recovery mode and attempt to recover files and settings, or you can completely wipe the SBC by performing a factory reset.  If the LEDs do not turn on normally (red on constantly, green on at first start, then off, then on when fully booted) then you&#039;ll want to read the [[#Hardware Issues|hardware issues]] section.&lt;br /&gt;
&lt;br /&gt;
====Partial Recovery====&lt;br /&gt;
&lt;br /&gt;
The recovery system can be entered in two ways:&lt;br /&gt;
# From the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} web interface page.&lt;br /&gt;
# By holding down the reset button for 20+ seconds - until the green light has switched from flashing slowly to flashing quickly.&lt;br /&gt;
&lt;br /&gt;
The recovery system runs an [[#SSH|SSH]] server where the username and password both are {{Code|root}}.&lt;br /&gt;
&lt;br /&gt;
If the main filesystem has been damaged/misconfigured in such a way that it won’t boot, you may be able to fix the issue or recover important files before running a full factory reset. From an SSH connection to the recovery system, you can mount the main root filesystem with the following commands (assuming it’s not damaged):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
ubiattach /dev/ubi_ctrl -m 6&lt;br /&gt;
mount -t ubifs /dev/ubi0_0 /mnt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Factory Reset====&lt;br /&gt;
&lt;br /&gt;
This restores the kernel and root filesystem from backup, overwriting any changes that may have been made and &#039;&#039;completely wiping the system&#039;&#039; to the state that it got shipped in. (You can save your files and installed program list first, as [[#Backing Up Your Data|described here]].)  This can be enacted one of two ways.&lt;br /&gt;
# Use the reset button:&lt;br /&gt;
##Enter the recovery mode by holding down the reset button for 20+ seconds as above (until fast flashing)&lt;br /&gt;
##Wait for a full boot (i.e. you can see it on the [[Phidget Control Panel]], or can SSH with username and password as {{Code|root}})&lt;br /&gt;
##Hold down the reset button again, but this time for only 10 seconds (until slow flashing)&lt;br /&gt;
##Wait for the SBC to fully reset and reboot (at least three minutes) - the LED will turn off and on again when this occurs&lt;br /&gt;
##*Note that after a factory reboot the SSH server will be disabled&lt;br /&gt;
##*Also note that after a factory reboot the SBC creates new SSH keys, and reverts to the {{Code|phidgetsbc.local}} address&lt;br /&gt;
# Via the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, where you can follow the instructions&lt;br /&gt;
&lt;br /&gt;
====Hardware Issues====&lt;br /&gt;
&lt;br /&gt;
The LEDs are an indicator of the hardware working properly.  The normal boot process is:&lt;br /&gt;
* Red LED: Turns on from moment of power being applied.&lt;br /&gt;
* Green LED: Turns on momentarily when power applied, then turns off momentarily, then turns on and stays on when booted.&lt;br /&gt;
&lt;br /&gt;
If the green status LED never turns on (or fails to turn on the second time), the boot process is failing somewhere.  This could be due to:&lt;br /&gt;
* A damaged OS - Try performing a [[#Factory Reset|Factory Reset]]&lt;br /&gt;
* If this fails, it is likely hardware damage (very difficult to diagnose, please [[Contact Us|contact us]])&lt;br /&gt;
&lt;br /&gt;
If neither LED turns on, hardware damage is even more likely.  Unless the path to the red LED is the one thing that has been damaged, the device is likely not receiving and using power.&lt;br /&gt;
* Try performing a [[#Factory Reset|Factory Reset]], and if that does not work please [[Contact Us|contact us]]&lt;br /&gt;
&lt;br /&gt;
=====USB Issues=====&lt;br /&gt;
&lt;br /&gt;
On the Phidget SBC2, there is a hardware issue that is unrelated to the LEDs.  It is a USB problem, and manifests in many ways:&lt;br /&gt;
* Strange behaviour when some devices but not others are plugged in to the SBC&lt;br /&gt;
* Strange behaviour with combinations of devices&lt;br /&gt;
* Failure (or intermittent failure) to see Phidgets on the USB hub, or USB keys on the hub&lt;br /&gt;
&lt;br /&gt;
This problem is fixable, either on your own or by sending your SBC back to Phidgets.  For an in-depth solution, see the [[SBC2_USB_Hub_Fix | SBC2 Hub Fix Page]].&lt;br /&gt;
&lt;br /&gt;
===Updating Your SBC===&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve owned your SBC for a while and want to update your packages, you can run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...to &#039;&#039;update&#039;&#039; your software source list and then &#039;&#039;upgrade&#039;&#039; to the latest version of all installed software.  If you are used to Mac OS or Windows, note that this does not just update the non-kernel parts of the operating system, it updates every additional piece of software you have installed.&lt;br /&gt;
&lt;br /&gt;
To update the SBC software itself (e.g. the kernel), it is easiest to use the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, to enter a page that will give you the option to update.  You will need to have an update file on a USB key inserted into the SBC, of type:&lt;br /&gt;
* UBI Image (system_ubi.img), or &lt;br /&gt;
* Kernel image (uImage), or&lt;br /&gt;
* Phidget Upgrade package containing both UBI and Kernel images (phidgetsbc*.bin)&lt;br /&gt;
&lt;br /&gt;
These are either obtained from the Phidgets website, or are a custom kernel / filesystem that you can create yourself, if you are experienced.&lt;br /&gt;
&lt;br /&gt;
The reason why this information is in troubleshooting is that you should certainly [[#Backing Up Your Data|back up your system]] before trying this.  And, it is quite rare to need to upgrade the kernel or filesystem on the SBC, so something serious should be going on before you attempt it.  Try using the [[#Recovery System|recovery system]] first.&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
Now that you have the basic libraries installed, you can pick your language and begin programming!  &lt;br /&gt;
&lt;br /&gt;
If you are not using the [[#WebService | webservice]] to control a Phidget over a network, your next step will be to delve into the use of your specific language.  Each page has its own set of specific libraries, code examples, and setup instructions.  &lt;br /&gt;
&lt;br /&gt;
On SBC Linux, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Java | Java]]&lt;br /&gt;
*[[Language - Python | Python]]&lt;br /&gt;
&lt;br /&gt;
These languages may also run on the SBC, but we do not yet directly offer SBC support for them:&lt;br /&gt;
* [[Language - Ruby|Ruby]]&lt;br /&gt;
* [[Language - C Sharp|C#]] (using Mono)&lt;br /&gt;
&lt;br /&gt;
You can probably figure out how to install and use them by a combination of the language pages linked above, and the section on [[#Installing Other Languages|installing other languages on the SBC]].&lt;br /&gt;
&lt;br /&gt;
==WebService==&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the [[Phidget WebService]] installed, and the SBC automatically starts the WebService at boot.&lt;br /&gt;
&lt;br /&gt;
To practice using the WebService, and to learn more about it, we have hands-on examples on the [[OS - Linux|general Linux page]], starting in the [[OS - Linux#Using the WebService|using the WebService section]].&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Shutting off USB ports to save power===&lt;br /&gt;
The SBC3 has an on-board USB hub that can control power to the ports. To do this unbind and rebind the USB drivers.&lt;br /&gt;
&lt;br /&gt;
To turn off the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/unbind}}&lt;br /&gt;
&lt;br /&gt;
To turn on the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/bind}}&lt;br /&gt;
&lt;br /&gt;
These will also cause detach and attach events for the Phidget devices, respectively. While the drivers are unbound, you will not get any hot plug events for any devices on USB.&lt;br /&gt;
&lt;br /&gt;
===Using a Touchscreen===&lt;br /&gt;
Please note that this will ONLY work with an SBC3 since it has a USB 2.0 hub:&lt;br /&gt;
&lt;br /&gt;
Using a touchscreen with the SBC is a great way to get user input and visual feedback from an SBC otherwise devoid of visual output.  The SBC does not have any conventional display ports such as VGA, DVI, or HDMI but it does have a number of USB ports and USB displays do exist.  With the upgrade to a USB 2.0 hub on the SBC3 from the earlier models which had USB 1 hubs the SBC now has enough capability to operate a screen over USB.  We don&#039;t recommend running a standard desktop environment since the processor is too slow to really keep up with a typical desktop it does make for an excellent interface for a kiosk, instrumentation control panel or  other, similar use case.  This document is going to go through the process of enabling support for a typical USB display as well as installing a fairly compact desktop environment called xfce on the SBC.  &lt;br /&gt;
&lt;br /&gt;
The screen I will be using is from a company called [http://lilliputweb.net/ Lilliput].  Specifically a UM-70 model.  Before you begin, please make sure that you have the screen plugged into the SBC, it will also be useful to have a spare USB keyboard and mouse handy as you will need them once you are no longer using an SSH terminal to communicate with the SBC.&lt;br /&gt;
&lt;br /&gt;
[[File:lilliputoff.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Getting the display to function====&lt;br /&gt;
Begin by logging into the web configuration page for your SBC and upgrading all of the packages on the SBC.  Be sure to include the full Debian package repository.  For more information on how to do this refer to the  [[OS - Phidget SBC#Getting Started - External Computer|getting started]] section of the Phidget SBC documentation.  Once you are fully up to date open an SSH session with the SBC and navigate to the &amp;quot;/etc&amp;quot; folder.  Open inittab with a terminal-based text editor such as nano and add the following to the bottom of the file, just above the {{code|T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100}} line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
1:2345:respawn:/sbin/getty 38400 tty1 &lt;br /&gt;
2:23:respawn:/sbin/getty 38400 tty2 &lt;br /&gt;
3:23:respawn:/sbin/getty 38400 tty3 &lt;br /&gt;
4:23:respawn:/sbin/getty 38400 tty4 &lt;br /&gt;
5:23:respawn:/sbin/getty 38400 tty5 &lt;br /&gt;
6:23:respawn:/sbin/getty 38400 tty6 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reboot your system.  After a few minutes you should see the LCD screen come up with a standard Linux terminal interface and a login prompt.  This is all well and good but this isn&#039;t really appreciably better than simply using an SSH session to communicate with the SBC.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputlogin.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Setting up Xfce====&lt;br /&gt;
In order to get a traditional windowing environment we still need to install a desktop manager as well as a number of supporting packages.  Log in and make sure everything is still up to date with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install the following packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xserver-xorg lxde xfce4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the SBC asks you if you want to continue, just type &amp;quot;Y&amp;quot; and press enter.  &lt;br /&gt;
&lt;br /&gt;
This will install the xfce desktop environment and any other necessary programs on the SBC.  When it&#039;s done, restart the SBC.  When it boots back up it should boot directly to a login screen instead of the terminal interface.  Log in, and you are good to go.  It won&#039;t be particularly fast, but don&#039;t worry, the SBC does not have a dedicated video processor on it so it&#039;s perfectly normal for it to be slow.  What&#039;s important is that it works.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputdesktop.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Calibrating the touch screen====&lt;br /&gt;
Unfortunately, by default the screen is calibrated to believe the bottom of the screen is on the right hand side.  This has the effect of making the touch functionality more or less useless until it has been properly calibrated.  To do this, install the following package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xinput-calibrator&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now use xinput calibrator to measure the parameters of your screen.  Launch xinput calibrator (called Calibrate Touchscreen in the programs menu) and follow the instructions on the screen.  The screen should now be functioning at full potential.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Using a Different Wireless Adapter===&lt;br /&gt;
&lt;br /&gt;
The support for the wireless adaptor that Phidgets sells is written into the SBC kernel.  Hence, we do not support using other adaptors. &lt;br /&gt;
&lt;br /&gt;
However, Linux is very flexible, and it is possible (though not easy) to write a custom kernel for the SBC and add support for a new wireless adaptor.  We can&#039;t help you with this, but we do provide some basic guidelines for [[#Custom Kernel and Filesystem|building your own kernel]].  You can also have a look at our thoughts on our own experience with choosing a Wifi adapter: [[Alternative Wi-Fi Adapters on the SBC]].&lt;br /&gt;
&lt;br /&gt;
===Using a Different Webcam===&lt;br /&gt;
&lt;br /&gt;
In addition to the webcam that Phidgets sells, you have the option to use many different webcams with the SBC.  There is a [http://www.ideasonboard.org/uvc/#devices long list] of compatible webcams.&lt;br /&gt;
&lt;br /&gt;
The common thread for these webcams is that they use UVC - the USB Video Class - drivers for Linux.  You can then use [[#mount|mount]] to find out what video device your webcam is mounted under.&lt;br /&gt;
&lt;br /&gt;
===Taking Pictures With the Webcam===&lt;br /&gt;
&lt;br /&gt;
Probably the most straightforward way to use a webcam for pictures rather than video is to use the {{Code|opencv}} library.  You can get it by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libcv2.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there is no {{Code|libcv2.1}} package, you can perform {{Code|apt-cache search libcv}} to find the current version.&lt;br /&gt;
&lt;br /&gt;
The opencv libraries can also be used within Python, by installing the link between them:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python-opencv&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then taking pictures from within code becomes quite simple.  For example, in Python, taking and saving an image is four lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
#! /usr/bin/python&lt;br /&gt;
&lt;br /&gt;
import cv&lt;br /&gt;
&lt;br /&gt;
# The webcam is located at /dev/video0 &lt;br /&gt;
# OpenCV only needs the number after video&lt;br /&gt;
webcam = cv.CaptureFromCAM(0)&lt;br /&gt;
&lt;br /&gt;
frame = cv.QueryFrame(webcam)&lt;br /&gt;
&lt;br /&gt;
cv.SaveImage(&amp;quot;image.jpg&amp;quot;, frame)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the complete OpenCV documentation, see [http://opencv.willowgarage.com/documentation/index.html The OpenCV Reference], and specifically the section on [http://opencv.willowgarage.com/documentation/reading_and_writing_images_and_video.html Reading and Writing Images].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The SBC is probably not as powerful for image processing and transport when compared to your desktop computer.  Try running your image processing code on the SBC from an early point in development.  During those test runs, you can visit the first System page of the [[#SBC Web Interface|SBC Web Interface]] to check the processor and memory use.  For more information on processor power, check the specification for your SBC (on the product page on [{{SERVER}} our main website]) as well as our discussion of [[#Pushing Processor Limits|pushing processor limits]] below.&lt;br /&gt;
&lt;br /&gt;
===Checking System Logs===&lt;br /&gt;
&lt;br /&gt;
The SBC maintains two logs: a kernel log and a system log.  &lt;br /&gt;
&lt;br /&gt;
The kernel log is for low-level occurrences, such as devices attaching and leaving the USB hub, recording what drivers are being used, and so on.&lt;br /&gt;
&lt;br /&gt;
The system log (syslog) is for normal chatter from the operating system.  Any program with the right permissions can use it (though you need to know the method to write to it, information all around the Internet can help) and it contains everything from the Ethernet going up and down, to webserver requests, and so on.  If you don&#039;t run many programs or services on the SBC, the syslog will essentially be a mirror of the kernel log, because the kernel is the only thing talking.&lt;br /&gt;
&lt;br /&gt;
You can check these logs by using the web interface in the {{Code|System &amp;amp;rarr; Logs}} tab.&lt;br /&gt;
&lt;br /&gt;
Or you can perform more powerful filtering and displaying via an SSH terminal.  For example, {{Code|dmesg}} is the command to display the kernel log, and {{Code|tail}} prints the last ten lines of input.  So, if you are trying to see if you can get a device to be detected on USB, you can run &amp;lt;code&amp;gt;dmesg | tail&amp;lt;/code&amp;gt; to print the latest ten lines of kernel log data.&lt;br /&gt;
&lt;br /&gt;
The actual locations of the log files (for filtering and reading) are:&lt;br /&gt;
* {{Code|/var/log/syslog}} &lt;br /&gt;
* {{Code|/var/log/dmesg}}&lt;br /&gt;
But don&#039;t edit them directly!  Always follow the advice and procedures around the Internet on how to properly log items to syslog.&lt;br /&gt;
&lt;br /&gt;
===X Forwarding===&lt;br /&gt;
&lt;br /&gt;
Although most tasks can be done using the [[#SBC Web Interface|SBC Web Interface]] or [[#SSH|SSH]], you can also set up X11 forwarding on the SBC.  X11 is the window manager base, which provides a graphical windowing system on the SBC.  Although you probably won&#039;t connect directly to the X11 manager (i.e. by plugging a screen directly into the SBC), X11 also gives a user the ability to forward graphical windows over SSH.  You will need the following packages installed:&lt;br /&gt;
* {{Code|x11-common}}&lt;br /&gt;
* {{Code|xbase-clients}}&lt;br /&gt;
After installing, make sure that the line in {{Code|/etc/ssh/sshd_config}} has a line that says:&lt;br /&gt;
:{{Code|X11Forwarding yes}}&lt;br /&gt;
Then log out and log back into the SBC.  This second time you log in, use the {{Code|-X}} switch to turn on X forwarding for that connection:&lt;br /&gt;
:{{Code|ssh -X root@phidgetsbc.local}}&lt;br /&gt;
Then you should be able to run programs that launch a window, and it will launch remotely and appear on the computer you have the SSH connection from.&lt;br /&gt;
&lt;br /&gt;
===Pushing Processor Limits===&lt;br /&gt;
&lt;br /&gt;
The SBC, though more powerful than many embedded computers out there, is probably about as powerful as your smartphone.  If you hook up 1 ms Phidget sampling devices to all six of its USB ports, events and packets will probably get lost.  The exact data rates you can accomplish depend on:&lt;br /&gt;
* What else is running on the SBC&lt;br /&gt;
* How efficient your code is for external operations (like File I/O)&lt;br /&gt;
* Other minor details (e.g. the temperature of the SBC, etc)&lt;br /&gt;
&lt;br /&gt;
If you want to achieve data rates as fast as possible, try these tips:&lt;br /&gt;
* Program in C, not in an interpreted language (Python, Java, .NET)&lt;br /&gt;
* Perform file I/O as little as possible.  Locally cache data, manage your writing to a file in a separate thread, and use low-level write calls.&lt;br /&gt;
* Change the [[#Custom Kernel and Filesystem|filesystem]] to a faster, non-compressed file system.&lt;br /&gt;
** Alternatively, use a high-data-rate USB key.&lt;br /&gt;
* Keep other running processes to a minimum. &lt;br /&gt;
** If you are running code locally right on the SBC, turn off the Phidget WebService.&lt;br /&gt;
&lt;br /&gt;
===Custom Kernel and Filesystem===&lt;br /&gt;
&lt;br /&gt;
You can compile your own kernel and flash it to the board. It is left up to the user to configure an appropriate cross-compiler for kernel development. You may also be able to compile a new kernel on-board.  We have a kernel development kit, complete with patch file and README:&lt;br /&gt;
* [{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Compiling a new, custom kernel is somewhat complex.  If the SBC is your first experience with Linux, writing a custom kernel will be difficult.  However, it will probably also be very rewarding because you can put whatever you like into it.  We might be able to offer additional suggestions, but ultimately you&#039;re on your own here. &lt;br /&gt;
&lt;br /&gt;
You may be able to write a custom kernel right on the SBC, but the easiest way is to develop the kernel on an external computer.  And the easiest way to develop on an external computer is for that computer to also be Linux, even just in a Virtual Machine.  The time spent loading a copy of Linux into a virtual machine (such as VirtualBox, which is free) onto your computer will probably be less time than setting up a standard compiler on Windows to cross-compile.&lt;br /&gt;
&lt;br /&gt;
On your external Linux system, you will need:&lt;br /&gt;
* A cross-compiling toolchain for the ARM processor, which we briefly describe on the [[OS - Linux#Cross-Compiling with a Custom Toolchain | main Linux page]], and &lt;br /&gt;
* The [{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package] from the Phidgets website.  &lt;br /&gt;
The kernel development kit has a brief README file which describes how to obtain the proper kernel and patch, configure, customize, and build it.&lt;br /&gt;
&lt;br /&gt;
We have an application guide in progress, which walks through building a custom kernel to add Bluetooth support to the SBC.  Please contact us if you would like more information.  Even if you are trying to add support for hardware other than a bluetooth modem, or wondering if support even exists in the kernel for your modem (3G, alternate wireless, etc) you will probably find the application guide helpful.  Follow it up to the point where you run the program {{Code|menuconfig}} (you don&#039;t need an SBC to do this), which will give you a menu of all drivers you can enable in the SBC kernel.&lt;br /&gt;
&lt;br /&gt;
After making your new kernel, you should have a uImage and modules target for your Makefile.  At this point you can transfer your kernel files onto the SBC, make their targets, and transfer them into the nand memory.  This involves erasing the old kernel, flashing the new kernel, installing the new kernel modules, and rebooting.  From the SBC, in the kernel directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
make uImage; make modules&lt;br /&gt;
flash-eraseall /dev/mtd3&lt;br /&gt;
nandwrite -p /dev/mtd3 arch/arm/boot/uImage&lt;br /&gt;
make modules-install&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Custom kernels can also be flashed from the [[#Recovery System | Recovery System]].&lt;br /&gt;
&lt;br /&gt;
If you need to create a root filesystem image, the filesystem type is UBIFS, and the commands to create it are:&lt;br /&gt;
&lt;br /&gt;
====For SBC2:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====For SBC3:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You then flash ‘system_ubi.img’ (not ‘system_ubifs.img’) from the recovery system.&lt;br /&gt;
&lt;br /&gt;
Again, like the custom kernel creation, the need to create a custom root filesystem is essentially non-existent except for those advanced users who already know they need it... and furthermore, you are almost entirely on your own.&lt;br /&gt;
&lt;br /&gt;
===Saving a file system to flash to multiple SBC&#039;s===&lt;br /&gt;
You may want to create a complete backup of your SBC root filesystem, which can then be flashed to other SBCs. This is how it could be done:&lt;br /&gt;
&lt;br /&gt;
You will need a USB drive - we have had issues using cheap flash drives, so a real USB drive is recommended. Make sure it&#039;s empty, as it will be reformatted.&lt;br /&gt;
&lt;br /&gt;
All of these commands are executed on your SBC, while logged in over SSH.&lt;br /&gt;
&lt;br /&gt;
First, re-format the USB drive as ext3. Assuming the USB drive is sda and has a single partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
mkfs.ext3 /dev/sda1&lt;br /&gt;
mount -t ext3 /dev/sda1 /media/usb0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remount / as readonly, so it doesn&#039;t change as we&#039;re copying it. To do this, we need to kill all running processes except sshd:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
service udev stop&lt;br /&gt;
service ifplugd stop&lt;br /&gt;
service rsyslog stop&lt;br /&gt;
service avahi-daemon stop&lt;br /&gt;
service phidgetwebservice stop&lt;br /&gt;
service ntp stop&lt;br /&gt;
service busybox-httpd stop&lt;br /&gt;
service dbus stop&lt;br /&gt;
service cron stop&lt;br /&gt;
pkill dhclient&lt;br /&gt;
mount -o remount,ro /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the remount says that / is busy, do a &#039;ps auxww&#039; and &#039;pkill&#039; anything else that may be running until it remounts properly.&lt;br /&gt;
&lt;br /&gt;
Then, copy / to the flash drive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkdir /media/usb0/root&lt;br /&gt;
mount --bind / /mnt/&lt;br /&gt;
cp -a /mnt/* /media/usb0/root/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, clean up the copy - removing files specific to this board. We also remove the APT cache to save space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
find /media/usb0/root/var/log -type f -print0 | xargs -0 rm -f&lt;br /&gt;
rm -rf /media/usb0/root/var/lib/apt/lists/*&lt;br /&gt;
mkdir /media/usb0/root/var/lib/apt/lists/partial&lt;br /&gt;
rm -f /media/usb0/root/var/cache/apt/*.bin&lt;br /&gt;
rm /media/usb0/root/etc/udev/rules.d/70-persistent-net.rules&lt;br /&gt;
rm /media/usb0/root/etc/ssh/ssh_host_*&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
then, create the ubinize.cfg file:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi	&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs0&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi		&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
vol_flags=autoresize	&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: you may need to increase vol_size if your filesystem is larger.&lt;br /&gt;
&lt;br /&gt;
then, create the UBI image from the copy:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then, unmount the drive to ensure everything is written out properly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you can remove the /root/ folder and system_ubifs.img. system_ubi.img can be flashed to other SBCs using the recovery system.&lt;br /&gt;
&lt;br /&gt;
==Software Details==&lt;br /&gt;
&lt;br /&gt;
For even more advanced uses of the SBC, it may help to know the gritty details of the SBC software system.&lt;br /&gt;
&lt;br /&gt;
;Operating System&lt;br /&gt;
:Debian/GNU Linux&lt;br /&gt;
:Kernel 2.6.X or higher (generally kept up to date with latest releases, use {{Code|uname -r}} to check the kernel version)&lt;br /&gt;
&lt;br /&gt;
;Main Filesystem (rootfs)&lt;br /&gt;
:UBIFS (a raw flash type of file system)&lt;br /&gt;
:Mounted in a 460 MB Nand partition (in Read/Write mode)&lt;br /&gt;
&lt;br /&gt;
;Kernel&lt;br /&gt;
:uImage format&lt;br /&gt;
:Has its own 3MiB partition on bare Nand&lt;br /&gt;
&lt;br /&gt;
;Web Interface Scripts and Configuration Data&lt;br /&gt;
:Located in {{Code|/etc/webif}}&lt;br /&gt;
:Modifying these scripts can be done; however, it is very easy to enter invalid data that could cause the system to behave unexpectedly or not boot.&lt;br /&gt;
&lt;br /&gt;
;User Applications uploaded through Web Interface&lt;br /&gt;
:Located in {{Code|/usr/userapps}}&lt;br /&gt;
&lt;br /&gt;
;Webcam Device Location&lt;br /&gt;
:{{Code|/dev/video0}}&lt;br /&gt;
:Numbers increase with more webcams&lt;br /&gt;
&lt;br /&gt;
;Date and Time&lt;br /&gt;
:Set using ntp (network time protocol) at boot&lt;br /&gt;
:The ntp daemon continues to run in the background and will periodically update the clock &lt;br /&gt;
:The network keeps the SBC very close to real time&lt;br /&gt;
:Also there is a real-time clock with battery backup which will preserve date/time across reboots, power removal&lt;br /&gt;
:The real-time clock is synced to system time during reboot/shutdown&lt;br /&gt;
:If power is unplugged suddenly, and the network not restored, the real-time clock may not have the correct time&lt;br /&gt;
&lt;br /&gt;
;Wireless Networking System&lt;br /&gt;
:Wireless adapter support for the wireless adapter that Phidgets sells is written into the kernel&lt;br /&gt;
:It supports WEP and WPA&lt;br /&gt;
:It is best configured through the configuration interface.&lt;br /&gt;
&lt;br /&gt;
;Nand Layout&lt;br /&gt;
:The board contains 512MiB on Nand. This nand is split into 7 partitions as follows:&lt;br /&gt;
:0: u-boot		 size: 256K		 Read Only&lt;br /&gt;
:1: u-boot_env		 size: 128K		 Read Only&lt;br /&gt;
:2: recovery_kernel	 size: 2M		 Read Only&lt;br /&gt;
:3: kernel		 size: 3M		 Writable&lt;br /&gt;
:4: flashfs	 	 size: ~3.625M	 	 Read Only&lt;br /&gt;
:5: recovery_fs		 size: ~ 43M		 Read Only&lt;br /&gt;
:6: rootfs		 size: ~ 460M		 Writable&lt;br /&gt;
: The final size of flashfs/recovery_fs/rootfs depends on the image size at production, and on the number/location of bad blocks in the NAND.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: U-Boot and recovery kernel and filesystem cannot be written from Linux - this is a safety measure.&lt;br /&gt;
&lt;br /&gt;
;Boot Loader&lt;br /&gt;
:U-Boot is used for setting up the processor and booting Linux, and is only accessible via a serial connection. &lt;br /&gt;
:Normal users will not need to use or modify it.&lt;br /&gt;
:Be very careful when modifying the u-boot partition. If it is damaged or overwritten, it is difficult to fix.&lt;br /&gt;
:When using U-Boot, a prompt will appear via serial shortly after power on.  &lt;br /&gt;
:The environment variables will help you determine how to boot Linux on the SBC&lt;br /&gt;
:You can also refer to the [http://www.denx.de/wiki/DULG/Manual U-Boot documentation]&lt;br /&gt;
&lt;br /&gt;
;Boot Process&lt;br /&gt;
:From power on...&lt;br /&gt;
:1. Processor loads first 4 bytes from NAND into Steppingstone and runs it.&lt;br /&gt;
:2. Steppingstone sets up RAM, copies u-boot from NAND into RAM and runs U-Boot.&lt;br /&gt;
:3. U-Boot initializes the processor, sets GPIO state, etc., copies the linux kernel into RAM, sets up the kernel command line arguments, checks that the kernel image is valid, and boots it.&lt;br /&gt;
:4. Linux boots, bringing up USB, Networking, NAND, etc. and then mounts the rootfs NAND partition on /.&lt;br /&gt;
:5. init gets run as the parents of all processes, as uses the /etc/inittab script to bring up the system. This includes mounting other filesystems, settings the hostname, and running the scripts in /etc/init.d, among other things.&lt;br /&gt;
:6. inittab then turns the green LED on.&lt;br /&gt;
:7. inittab then sets up a getty on the first serial port, ready for interfacing using the debug board.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|PHP Curl|Curl doesn&#039;t install smoothly}}&lt;br /&gt;
&lt;br /&gt;
There is an issue with the embedded version of PHP5.3, try forcing it to install the specific version that you need.  This can be done with the following command:&lt;br /&gt;
&lt;br /&gt;
{{Code|apt-get install php5-common&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;5.3.3-7+squeeze14}}&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|FTDI Errors|FTDI adapters do not appear to work with the SBC}}&lt;br /&gt;
&lt;br /&gt;
The 3.1.6 version of the Linux kernel which is used on some versions of the SBC has a bug that causes issues with FTDI drivers and makes them malfunction.  To solve this problem you must upgrade the kernel to a newer version.  You can find the files [[#Quick Downloads| here]].&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|USB Memory Key mounting|Sometimes USB Memory Keys mount at more than one location}}&lt;br /&gt;
&lt;br /&gt;
When you insert a memory key, the SBC will load it as a device (e.g. {{Code|/dev/sda1}}) and it will also &#039;&#039;mount&#039;&#039; the key for reading and writing within the {{Code|/media/}} directory.  The {{Code|/media/}} directory version will be called something like {{Code|usb0}}.  &lt;br /&gt;
At times, an inserted memory key will get mounted in more than one location.  You can observe if this occurs by checking the currently mounted devices with the command {{Code|mount}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
/dev/sda1 on /media/usb1 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will note that the same device ({{Code|/dev/sda1}}) is now mounted at &#039;&#039;both&#039;&#039; {{Code|/media/usb0}} and {{Code|/media/usb1}}.  To fix this problem as it occurs, you can use {{Code|umount}} (notice there is no letter &#039;n&#039;) to unmount the second instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# umount /media/usb1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In practice, this should not be a problem, because writing to or reading from either {{Code|usb0}} or {{Code|usb1}} will have the same effect on the memory key.  However, if you hard-code a media location into your program (i.e. expecting {{Code|/media/usb0}} to be the first USB key you insert and {{Code|/media/usb1}} to be the second key) your program will sometimes work and sometimes fail.  &lt;br /&gt;
&lt;br /&gt;
To get around this within code, find the mount point for each device as it appears.  The devices, such as {{Code|/dev/sda1}} will always refer to the actual memory key.  But, they cannot be written to directly without being mounted, so you will have to parse the mount table (what is returned from {{Code|mount}}) within your code to find the device and its corresponding mount point.&lt;br /&gt;
&lt;br /&gt;
This is a problem with the standard embedded Debian automount program, and we have no known fix.&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|Perl Locale Errors on SSH|No Locales Installed}}&lt;br /&gt;
&lt;br /&gt;
By default, no locales are installed on the SBC.  If you use [[#apt|apt]] a lot to install and manage your software on the SBC, you will get messages like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
perl: warning: Setting locale failed.&lt;br /&gt;
perl: warning: Please check that your locale settings:&lt;br /&gt;
	LANGUAGE = (unset),&lt;br /&gt;
	LC_ALL = (unset),&lt;br /&gt;
	LANG = &amp;quot;en_CA.UTF-8&amp;quot;&lt;br /&gt;
    are supported and installed on your system.&lt;br /&gt;
perl: warning: Falling back to the standard locale (&amp;quot;C&amp;quot;).&lt;br /&gt;
locale: Cannot set LC_CTYPE to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_MESSAGES to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_ALL to default locale: No such file or directory&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To squelch these messages, you should install and reconfigure your locale like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install locales&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command will show you a long list from which you should pick your location, by language.  For example, en_CA is english_Canada.  Here in Calgary, we use en_CA.UTF-8 and so for the first question we would input locale &amp;quot;114&amp;quot; and for the second (system) question we would input {{Code|en_CA}} for the locale.&lt;br /&gt;
&lt;br /&gt;
This might give you a locale undefined error, in which case you can generate the locale (for us, again, it is en_CA):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
locale-gen en_CA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=23867</id>
		<title>OS - Phidget SBC</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=23867"/>
		<updated>2016-08-11T16:20:54Z</updated>

		<summary type="html">&lt;p&gt;Patrick: /* Quick Downloads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
{{OSLang|[[File:icon-Linux.png|64x64px|link=OS - Linux]]|On the Single Board Computer (SBC), Phidgets can be either plugged directly into one of the USB ports or run over a network using the [[#WebService | WebService]].}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Unlike our other supported operating systems, the SBC &#039;&#039;&#039;does not require downloads&#039;&#039;&#039; unless you are doing something advanced like loading the firmware or developing your own kernel.  You will know if you need these downloads, otherwise, the SBC should work as described on the [[1073 User Guide#Getting Started|SBC3 Getting Started Guide]] right out of the box.&lt;br /&gt;
&lt;br /&gt;
*[[Software License]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC (1070):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc-minimal.bin Minimal Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc-full.bin Full Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/buildroot-phidgetsbc.tar.gz Buildroot/Kernel Sources]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC2 (1072):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc2/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc2.bin SBC2 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC2 Kernel Development Package] (How-to and patch file)&lt;br /&gt;
&#039;&#039;&#039;The PhidgetSBC3 has different firmware packages based on the kernel version. In order to determine the device version of your SBC3, see the [[1073_User_Guide#SBC_Web_Interface|web configuration page]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:sbcver.jpg|thumb|562px|link=|The system information table is found on the Status -&amp;gt; System tab of the &#039;&#039;&#039;[[1073_User_Guide#SBC_Web_Interface|web configuration page]]&#039;&#039;&#039; of the SBC.]]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.6.3:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc3/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3_1.0.0.20121213.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-kerneldev_1.0.0.20121213.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-upgrade_3.6.3_3.14.27.tar.gz SBC3 Kernel upgrade package (3.6.3 -&amp;gt; 3.14.27)]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.14.27:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc3/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3_1.0.2.20160425.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-upgrade_3.14.27.tar.gz SBC3 Kernel upgrade package (3.14.27)]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-kerneldev_1.0.2.20160425.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Note that, instead of using the firmware to update your SBC, updates should normally be done via the System -&amp;gt; Packages page on your SBC3 web interface. It is rarely necessary to completely re-flash your device..&lt;br /&gt;
&amp;lt;br clear = all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Getting Started with the Phidget SBC Debian Linux==&lt;br /&gt;
&lt;br /&gt;
The Single Board Computer (SBC) is a unique Phidget.  It is a computer with a Linux operating system.  It can compile code, save files, manage background jobs, host information over the web, and more.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If this is your first time&#039;&#039;&#039; using the Phidget SBC, you will want to start with the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  After that, here we will get you started on topics beyond those in the getting started guide, including how to write Phidget code to run on the SBC.  You &#039;&#039;&#039;do not need this page&#039;&#039;&#039; if you are simply using the SBC to broadcast data from Phidgets over the network - it does that automatically.  We describe how to verify and use this in the [[1073 User Guide#Getting Started | Getting Started Guide]].&lt;br /&gt;
&lt;br /&gt;
This page will show you how to:&lt;br /&gt;
* Install the ability to write and develop code on the SBC itself&lt;br /&gt;
* Use the command line for basic coding tasks&lt;br /&gt;
* Troubleshoot the SBC&#039;s network&lt;br /&gt;
It will also give additional specifications, which are useful for doing more advanced things with the SBC hardware and software.&lt;br /&gt;
&lt;br /&gt;
Before reading this page, you should have done the following via the Getting Started Guide:&lt;br /&gt;
* Set up networking on your SBC, via either Ethernet or wireless&lt;br /&gt;
* Set up an admin password&lt;br /&gt;
* Learned the IP address or link local address of the SBC&lt;br /&gt;
We will use this information in setting up the libraries and drivers to use the SBC for writing and running code.&lt;br /&gt;
&lt;br /&gt;
Conceivably, you could simply use the SBC like any Linux computer, and do all of your development and compiling of Phidget code on the SBC itself.  In practice this gets complicated as the SBC does not have a keyboard or screen.  So usually, you will want to develop your code an external computer and copy files and settings over to the SBC via a network.  This makes this Getting Started section unique, in that we show you how to set up both computers:&lt;br /&gt;
* Your [[#Getting Started - External Computer | External Development Computer]], usually your main desktop or laptop which will transfer files and settings to and from the SBC&lt;br /&gt;
* The [[#Getting Started - The SBC (Debian Linux) | SBC]] itself, which needs programming language libraries to use Phidgets.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - External Computer===&lt;br /&gt;
&lt;br /&gt;
You have two ways to connect to the SBC from an external computer: via the [[#SBC Web Interface|SBC Web Interface]] and over the more powerful but complex [[#SSH | Secure Shell (SSH)]].&lt;br /&gt;
&lt;br /&gt;
====SBC Web Interface====&lt;br /&gt;
&lt;br /&gt;
You have already worked extensively with the web interface in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  This was the tool within a web browser which was opened either via the [[Phidget Control Panel]] on Windows, or by simply entering the IP or link local address into an internet browser.  It allowed you to set the password, set up internet connectivity, and so on.  &lt;br /&gt;
&lt;br /&gt;
This section doesn&#039;t have more information on the interface; rather, it simply serves as a reminder that you have the web interface as an available tool.  Examples, including screenshots, are placed where appropriate in this document.  The web interface will probably stay your initial go-to way to connect to the SBC, especially for tasks that benefit from graphical interaction, like setting up wireless or using the webcam.&lt;br /&gt;
&lt;br /&gt;
====SSH====&lt;br /&gt;
&lt;br /&gt;
The most flexible way to transfer files and commands to and from the SBC is via a program called &#039;&#039;&#039;ssh&#039;&#039;&#039;.  The ssh program provides command line text access over a network into the SBC.  Using it, you can run programs and give the SBC commands.  The ssh program has a companion program called &#039;&#039;&#039;scp&#039;&#039;&#039; which can copy files back and forth.  If you are unfamiliar with ssh, you can think of it like the command line or a Mac terminal, but with a remote connection to a different computer.  It is a minimal yet effective way to interact with a remote computer.&lt;br /&gt;
&lt;br /&gt;
Before connecting over ssh, you will need:&lt;br /&gt;
* The &#039;&#039;&#039;IP address&#039;&#039;&#039; (such as 168.254.3.0) or &#039;&#039;&#039;link local address&#039;&#039;&#039; (such as phidgetsbc.local) of the SBC&lt;br /&gt;
* The &#039;&#039;&#039;admin password&#039;&#039;&#039; for the SBC&lt;br /&gt;
Both of these items can be found by following the steps in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].&lt;br /&gt;
&lt;br /&gt;
You will also need to enable SSH on the SBC side.  This can be done through the [[#SBC Web Interface| Web Interface]], under {{Code|Network &amp;amp;rarr; Settings}}, by changing the &#039;&#039;SSH Server&#039;&#039; radio button to &#039;&#039;Enabled&#039;&#039; and saving your changes:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_turn_on_ssh.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
=====SSH on Windows=====&lt;br /&gt;
&lt;br /&gt;
The ssh program is not installed on Windows by default.  But, there are a variety of SSH programs available for free. One simple and commonly used program is [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY], and it has the advantage that the executable doesn&#039;t need to install, it just runs.&lt;br /&gt;
&lt;br /&gt;
With PuTTY, when you first run the program it will ask you what to connect to.  Enter the IP address or link local address of the SBC, and then click the SSH radio button right below the address, which will change the port to 22.  Then click open, and you&#039;ll have an ssh connection to the SBC open in a terminal.  It will prompt you for a user name ({{Code|root}}) and password (the admin password).&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, there is an SCP component to PuTTY, called PSCP, which is available from the same [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY download page].  Use of PSCP will be similar with the address, username, and password, except that you will be transferring files instead of sending commands.&lt;br /&gt;
&lt;br /&gt;
=====SSH on Linux and Mac OS=====&lt;br /&gt;
&lt;br /&gt;
Linux and Mac OS already have ssh installed by default.  To run ssh simply open a terminal...&lt;br /&gt;
* {{Code|Ctrl-Alt-T}} on Linux &lt;br /&gt;
* {{Code|Applications &amp;amp;rarr; Utilities &amp;amp;rarr; Terminal}} on Mac OS &lt;br /&gt;
...and type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
ssh root@phidgetsbc.local&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have re-named your SBC, include that name instead of the {{Code|phidgetsbc.local}} link address.  Or, you can use the SBC&#039;s IP address, e.g. something like {{Code|ssh root@168.254.3.0}}&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, the command follows the form of: {{Code|scp from to}}&lt;br /&gt;
&lt;br /&gt;
So, to copy a file {{Code|/root/data.txt}} from the SBC to your local machine, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
scp root@phidgetsbc.local:/root/data.txt .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note the use of the dot &#039;&#039;&#039;.&#039;&#039;&#039; to indicate that scp should put the file in the current local directory.   If you&#039;re not sure what folder the terminal is operating in type {{Code|pwd}} to print the working directory.  Terminals usually start by default in your home folder.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - The SBC (Debian Linux)===&lt;br /&gt;
&lt;br /&gt;
The SBC runs Linux, which is a full operating system. It is stripped down compared to a full desktop release of Linux, but you can compile code on it, run programs, schedule tasks, create and manage files, run a web server, and much, much more.&lt;br /&gt;
&lt;br /&gt;
At this point you have connected to the SBC via the [[#SBC Web Interface|web interface]], and probably also through [[#SSH|SSH]].  This section will help you install libraries and drivers that you probably want - i.e. support for C, Java, and Python.  After this section, you&#039;ll be well into the depths of using the SBC as a computer, and so you&#039;ll probably want to keep the [[#Using SBC Linux|Using SBC Linux section]] open for reference while you work if you are not already familiar with Linux.&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the following Phidget functionality installed:&lt;br /&gt;
* The Phidget C libraries {{Code|libphidget21.so}}&lt;br /&gt;
* The Phidget [[#WebService | WebService]]&lt;br /&gt;
(If you are simply curious what these are and how they get installed, we describe the process on the [[OS - Linux | general Linux page]].)&lt;br /&gt;
&lt;br /&gt;
But to compile C programs, or run Java programs, or use Python, you will need to install these languages onto the SBC.  &lt;br /&gt;
&lt;br /&gt;
Before installing anything on the SBC, however, (even via a button on the web interface) make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
====Installing C/C++ and Java====&lt;br /&gt;
&lt;br /&gt;
The simplest way to install C/C++  and Java on the SBC is via the web interface.  There is a button under {{Code|System &amp;amp;rarr; Packages}} to install C support (including {{Code|gcc}}) and another button to install Java support:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_packages_web.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
You have to check that you are running the same version of Java on your development machine (where you plan on compiling the java programs) as the SBC is running. To do this type the following into the terminal on your computer and from ssh on the SBC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
Java -version&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need to update the version of Java on your SBC, use the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install openjdk-7-jre-headless&lt;br /&gt;
su&lt;br /&gt;
update-alternatives --config java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you&#039;re ready to begin programming.  We have programming pages for both [[Language - C/C++|C/C++]] and for [[Language - Java|Java]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].  &lt;br /&gt;
&lt;br /&gt;
If you want to avoid using the [[#SSH|SSH]] interface on the SBC entirely, and you want to write your program in Java and run it continuously from boot (which is the only option if you want to avoid [[#SSH|SSH]]), we have a [[#Program in Java with the Web Interface|very in-depth section]] on that topic.&lt;br /&gt;
&lt;br /&gt;
====Installing Python====&lt;br /&gt;
&lt;br /&gt;
Installing Python has two steps.  First, you&#039;ll need to install the basic ability to run python, and then you&#039;ll need to install the Phidget Python module.  Both steps (and both options) require that you issue the relevant commands through an [[#SSH|SSH terminal]].&lt;br /&gt;
&lt;br /&gt;
=====Basic Python=====&lt;br /&gt;
&lt;br /&gt;
The base Python functionality can be downloaded and installed in one step with [[#apt|apt]] (i.e. in a terminal, type):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will give you Python, and now you just have to install the Phidget Python module to gain Phidget functionality. If the installation fails because it can&#039;t find python, you need to enable the full repository as described in [[#Getting Started_-_The_SBC_(Debian_Linux)|this section]], and then perform an apt-get update.&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 1: Use a USB Key=====&lt;br /&gt;
&lt;br /&gt;
Copy the [{{SERVER}}/downloads/libraries/PhidgetsPython.zip Python Libraries] onto a USB key.  Unpack the zip file into a folder on the USB key.  Insert the key into the SBC.&lt;br /&gt;
&lt;br /&gt;
You will have to figure out where the USB key (and the Phidget Python library folder) is now located.  We describe how in the general [[#Using USB Data Keys | Using USB Data Keys]] section.&lt;br /&gt;
&lt;br /&gt;
After you know the place where the USB key is mounted, in a terminal go to that directory (e.g. type {{Code|cd /media/usb0/}}), enter the unpacked Phidget Python Library folder, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have an whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 2: Use the Internet=====&lt;br /&gt;
&lt;br /&gt;
Rather than using a USB key to transfer the file, the SBC can download it directly from the internet.  You will need {{Code|wget}} and {{Code|unzip}} installed, both of which are small:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install wget&lt;br /&gt;
apt-get install unzip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the web link address for the [{{SERVER}}/downloads/libraries/PhidgetsPython.zip Python Libraries].&lt;br /&gt;
&lt;br /&gt;
In an SSH terminal to the SBC, type: {{Code|wget http://www.python_library_link}} where instead of http://www.python_library_link you insert the link you just copied. Copying into a terminal can usually be done via the right-click menu.&lt;br /&gt;
&lt;br /&gt;
This will download the Phidget python libraries to the folder you ran the {{Code|wget}} command in.  Unzip the downloaded file using the command {{Code|unzip file}}, where file is the filename from {{Code|wget}}. Or try typing {{Code|ls}} to list the names of a file in the directory, which should include the unzipped folder.  Enter the unzipped folder (e.g. use {{Code|cd}} to change directory), and install the Phidget Python libraries:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have a whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
====Installing Other Languages====&lt;br /&gt;
&lt;br /&gt;
You may also be able to program on the SBC using [[Language - Ruby|Ruby]] and [[Language - C Sharp|C# under Mono]], though we do not offer in-depth support for these languages on the SBC.  The installation procedures should more or less follow that of [[#Installing Python|installing python]] on the SBC, except you will be installing Ruby or Mono.  Performing package searches using [[#apt|apt cache search]] can help you find the relevant software.&lt;br /&gt;
&lt;br /&gt;
For C#, as of 2012 the {{Code|mono-complete}} package is broken on the Debian Squeeze repository.  Rather, you have to install the Mono runtime and Mono compiler separately.&lt;br /&gt;
&lt;br /&gt;
To install the runtime package (and its dependencies), use [[#apt|apt]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-runtime&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to install the C# compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-gmcs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or the Visual Basic compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-vbnc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, the system and library packages do not link correctly for the version 2.0 of Mono.  If this is the case, your code will compile fine, but when you try to run it, you will get an error like:&lt;br /&gt;
&lt;br /&gt;
:{{Code|The assembly mscorlib.dll was not found or could not be loaded.}}&lt;br /&gt;
:{{Code|It should have been installed in the `/usr/lib/mono/1.0/mscorlib.dll&#039; directory.}}&lt;br /&gt;
&lt;br /&gt;
In this case, you need to install these two packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libmono-corlib1.0-cil&lt;br /&gt;
apt-get install libmono-system1.0-cil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we found these packages to work by working through the tree structure.  As a general rule, you can find these dependencies by using install (here, {{Code|apt-get install mono-complete}}) to get a sense of the package tree structure.  This will possibly tell you that the packages are broken, but at the same time this will list the dependencies of the packages.  Trying to install individual dependencies will show you that although a root-package fails, the sub-packages will sometimes succeed, and install what you need.&lt;br /&gt;
&lt;br /&gt;
If you want to use a specific dll or library that is not available in this reduced version of mono, you can install mono complete by switching from Emdebian+Debian to just Debian.  To do this:&lt;br /&gt;
&lt;br /&gt;
In {{Code|/etc/apt/preferences}} make the following changes:&lt;br /&gt;
:{{Code|Package: *}}&lt;br /&gt;
:{{Code|&amp;lt;nowiki&amp;gt;Pin: release a=stable&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
:{{Code|Pin-Priority: 1010}}&lt;br /&gt;
	&lt;br /&gt;
In {{Code|/etc/apt/sources.list/mutistrap-debian.list}} remove the emdebian line.&lt;br /&gt;
&lt;br /&gt;
Apply the changes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get dist-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many packages will be &#039;downgraded&#039; from the emdebian to debian versions.  Delete the {{Code|&amp;lt;nowiki&amp;gt;/etc/apt/preferences&amp;lt;/nowiki&amp;gt;}} file and install mono-complete:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install monodoc-http mono-complete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Choose monodoc-http explicitly, because otherwise the install fails on monodoc-browser.&lt;br /&gt;
&lt;br /&gt;
After this process, you can compile your C# Code.cs Phidget source file the same way as on a generic [[Language - C Sharp#Linux|Linux with Mono]] system.  Please refer to that page on how to obtain the *.dll Phidget resource file and compile your code.  On the SBC, however, because you are already running as root (the Super User), you do not need &#039;sudo&#039; and indeed the SBC will give you an error if you use it.  Instead, compiling and running will look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
gmcs Code.cs -r:Phidget21.NET.dll&lt;br /&gt;
mono Code.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using SBC Linux==&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve set up communication with the SBC, and installed whichever programming language support you need, you&#039;re probably ready for a short tour of useful tools on the SBC&#039;s version of Linux.&lt;br /&gt;
&lt;br /&gt;
First, you will by default be running on the SBC as &#039;&#039;&#039;root&#039;&#039;&#039;, which is the super-user.  For Linux users, this probably makes you nervous because you know you can overwrite important system files without the system asking for additional permission.  As a Windows or Mac OS user - although you may usually run your computer as an administrator - your familiar system usually prompts you to confirm before you do anything really dangerous, and this will &#039;&#039;&#039;not&#039;&#039;&#039; happen on the SBC as the root user.&lt;br /&gt;
&lt;br /&gt;
Next, there is no installed help on the SBC.  Help on Linux is usually called &#039;man pages&#039; which is short for &#039;the manual pages&#039;.  On a full Linux system, usually if you need help with any command you can type, for example, {{Code|man ls}} and it will give you help with the program [[#ls|ls]].  But these help pages take up significant space, and they are widely available online.  So, if you need more help with a certain command, you can always type {{Code|man command}} into your favourite search engine.&lt;br /&gt;
&lt;br /&gt;
Finally, the SBC has no windowing system.  For Linux users, this means no X-windows (Gnome, KDE, etc).  And as a Windows or Mac user, you can think of it as running all of your programs and commands through the terminal or DOS prompt command line.  The SBC provides all of the functionality of an operating system (e.g. process scheduling, file management, etc) but without any graphical interface.  The only exception is the [[#SBC Web Interface|web interface]], which gives graphical access to a limited part of what the SBC can do.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands===&lt;br /&gt;
&lt;br /&gt;
If you are doing more with the SBC than simply running pre-written programs [[#Writing a Phidget Program|in Java to run continuously from boot]], you will be interacting with the SBC&#039;s Linux operating system over the command line by using [[#SSH|SSH]].  This section discusses useful programs already installed on the SBC, and how to run them on the command line.&lt;br /&gt;
&lt;br /&gt;
====ls====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;ls&#039;&#039;&#039; program lists the contents of a directory.&lt;br /&gt;
&lt;br /&gt;
It will show both files and folders, but not files that start with a &amp;quot;.&amp;quot; (these are hidden files on Linux).&lt;br /&gt;
*If you also want to show hidden files, use {{Code|ls -a}}&lt;br /&gt;
*If you want more information, such as size and date modified, use {{Code|ls -l}}&lt;br /&gt;
*Commands can be combined, like {{Code|ls -al}}&lt;br /&gt;
&lt;br /&gt;
====cd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cd&#039;&#039;&#039; program changes to a new directory.&lt;br /&gt;
&lt;br /&gt;
For example, {{Code|cd /root}} changes into the directory at the base of the file tree called &#039;&#039;root&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* Linux uses forward slashes&lt;br /&gt;
* The base of all directories is &amp;quot;/&amp;quot; (not &amp;quot;C:\&amp;quot;)&lt;br /&gt;
* The tilde symbol (~) is short for your home directory (i.e. when you are root, this is short for &amp;quot;/root&amp;quot;)&lt;br /&gt;
* The double dot &amp;quot;..&amp;quot; means move one directory higher (for example from {{Code|/root/data/}} to {{Code|/root/}})&lt;br /&gt;
&lt;br /&gt;
====pwd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;pwd&#039;&#039;&#039; program prints the current directory you are working in.  (&#039;P&#039;rint &#039;W&#039;orking &#039;D&#039;irectory)&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
:{{Code|root@phidgetsbc:~# pwd}}&lt;br /&gt;
:{{Code|/root}}&lt;br /&gt;
&lt;br /&gt;
====cp, mv, and rm====&lt;br /&gt;
&lt;br /&gt;
These programs are copy (&#039;&#039;&#039;cp&#039;&#039;&#039;), move (&#039;&#039;&#039;mv&#039;&#039;&#039;), and remove (&#039;&#039;&#039;rm&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Copy copies a file from one location and pastes it to another.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|cp data.txt data_backup.txt}} will put a copy of the file {{Code|data.txt}} into {{Code|data_backup.txt}}&lt;br /&gt;
&lt;br /&gt;
Move moves a file (this is also useful for renaming files) to a new destination.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|mv data.txt data_backup.txt}} will put the contents of {{Code|data.txt}} into {{Code|data_backup.txt}}, and then will remove {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Remove deletes a file.&lt;br /&gt;
&lt;br /&gt;
For example, typing {{Code|rm data.txt}} will delete {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Note that &#039;&#039;&#039;rm&#039;&#039;&#039; is final.  Once you remove a file using {{Code|rm}}, it is gone forever.  There is no recycle bin, no temporary trash, nothing other than backups you may have personally created in the past!&lt;br /&gt;
&lt;br /&gt;
Directories can only be removed with {{Code|rmdir}}, and then only if they are empty.  If you want to remove a directory and all the files in it, use {{Code|rm -rf directory}} but be &#039;&#039;&#039;very, very careful&#039;&#039;&#039; with this command.  Trying to remove everything within a directory (e.g. {{Code|rm -rf *}}) is one of the most dangerous commands you can run on a Linux system, as running it from the wrong directory will result in Linux happily removing everything under that directory -- which could be your entire filesystem.&lt;br /&gt;
&lt;br /&gt;
====find====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;find&#039;&#039;&#039; program does what it says - it finds things.  &lt;br /&gt;
&lt;br /&gt;
Unfortunately for the casual user, the find program is very flexible and powerful, and thus not especially intuitive to use.  But, here are some examples:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|find folder -name file.txt}}&lt;br /&gt;
| Looks for all files in a folder (/ for root - or all - folders) with a certain name (* for wildcard)&lt;br /&gt;
| {{Code|find / -name *.jpg}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|find folder -mtime +X}}&lt;br /&gt;
| Looks for all files in a folder modified less than X days ago&lt;br /&gt;
| {{Code|find /root -mtime +30}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====grep====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;grep&#039;&#039;&#039; program takes text input and searches for a term. &lt;br /&gt;
&lt;br /&gt;
For example, if you type {{Code|mount}} to view what devices are mounted (e.g. loaded) on your SBC, you will see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may be a lot of information you don&#039;t need.  If you are only interested in a USB key attachment (as described in the [[#Using USB Data Keys|Using USB Data Keys]] section), you can use grep to filter that one response:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep sda1&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====nano====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;nano&#039;&#039;&#039; program is a small text editor that you can use within an SSH terminal. &lt;br /&gt;
&lt;br /&gt;
Nano can be surprisingly useful for writing short lengths of code right on the SBC, so there is no need to transfer files and keep track of different file versions on different computers.&lt;br /&gt;
&lt;br /&gt;
Nano has all keyboard commands which are listed at the bottom of the screen at all times as a reminder (Ctrl-O to save, Ctrl-X to exit, these expand with a larger terminal window).  And, nano provides what is called &#039;syntax highlighting&#039;, which colours reserved keywords, comments, strings, and so on as appropriate to the programming language you are using.  Nano detects the programming language via the extension of the file ({{Code|.java}} for Java, {{Code|.c}} for C/C++, and {{Code|.py}} for Python).&lt;br /&gt;
&lt;br /&gt;
Typing {{Code|nano test.py}} on an SSH command line and then entering a few lines of Python into the new empty file results in:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_nano_python.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
====apt====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;apt&#039;&#039;&#039; program allows you to install, uninstall, upgrade, and search software available for the SBC.&lt;br /&gt;
For a non-Linux user, the apt framework may be daunting at first, but it actually allows you to keep your system up to date and install and manage software quickly, easily, and for free.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Before installing anything on the SBC, make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-cache search term}}&lt;br /&gt;
| Looks for all programs (packages) that have {{Code|term}} in the title or description&lt;br /&gt;
| {{Code|apt-cache search opencv}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-cache show package}}&lt;br /&gt;
| Shows a lot of data about {{Code|package}} including size, version, etc&lt;br /&gt;
| {{Code|apt-cache show unzip}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-get update}}&lt;br /&gt;
| Gets the most recent listing of available software&lt;br /&gt;
| {{Code|apt-get update}}  (No options)&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-get install program}}&lt;br /&gt;
| Installs {{Code|program}} from the internet&lt;br /&gt;
| {{Code|apt-get install python}}&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====mount====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|mount}} shows you all of the mounted devices on your SBC.  &lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the non-Linux user, the concept of a device may be quite strange.  To give a short summary, everything on Linux that you can read or write is a file.  Webcams are files (i.e. you can &#039;read&#039; photos from them), USB keys are files, and each filesystem (tmp storage, the kernel portion, the main filesystem) are also themselves files.  These files specify what and how something can be written.  These are not necessarily linear, for example, you can see above that the USB key ({{Code|/media/usb0}} is mounted &#039;&#039;within&#039;&#039; the root file system {{Code|rootfs}} which is /.   &lt;br /&gt;
&lt;br /&gt;
So mount gives you an idea of what devices have been &#039;mounted&#039; for reading or writing, and how you can read and write to them.  More information on mount (and its various forms, like {{Code|umount}}) is available widely around the Internet.&lt;br /&gt;
&lt;br /&gt;
====which====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|which}} tells you if and where a program is installed.&lt;br /&gt;
&lt;br /&gt;
For example, on a default SBC, typing {{Code|which python}} will return no results.  But after successfully [[#Installing Python | installing python]], it will return {{Code|/usr/bin/python}} as the location of the python program/binary/executable.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands to Install===&lt;br /&gt;
&lt;br /&gt;
These are other programs you may find useful on the command line.  Although they are not on the SBC by default, these and other programs can usually be installed simply by using [[#apt|apt-get install]], with the exception of gcc.  For example, {{Code|apt-get install wget}} will download and install [[#wget|wget]].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This section and the section on [[#Some Useful Commands|pre-installed commands]] can hardly cover all of the complexities and power of the Linux operating system.  There are many excellent tutorials online, and between them and using [[#apt|apt]] to find and install programs you should be able to learn a lot and perform any number of complex useful tasks.&lt;br /&gt;
&lt;br /&gt;
====gcc====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;gcc&#039;&#039;&#039; program is the C compiler for Linux.&lt;br /&gt;
&lt;br /&gt;
If you are an experienced C/C++ user on Mac or Linux, or if you&#039;ve already read our [[Language - C/C++ | C Language page]], you might think you need to install gcc via {{Code|apt-get}} to compile C code.  However, gcc is not in the package repository for the SBC, so {{Code|apt-get install gcc}} will fail.  Rather, to install gcc, you can do it via the web interface, as described in the [[#Installing C/C++ and Java|Installing C/C++ and Java]] section.&lt;br /&gt;
&lt;br /&gt;
After installing it via the SBC web interface, you can use {{Code|gcc}} normally.&lt;br /&gt;
&lt;br /&gt;
====less====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;less&#039;&#039;&#039; program displays the contents of a text or source code file.  When displaying the file, {{Code|less}} allows you to scroll up and down to read it.&lt;br /&gt;
&lt;br /&gt;
This is useful if you are writing your sensor readings to a data file, and you want to read the data file while it is being written by your main code.  If your data file is called {{Code|data.txt}}, you can type {{Code|less data.txt}} and see the lines in the file, and what they are.&lt;br /&gt;
&lt;br /&gt;
The {{Code|less}} program output can also be piped into another program.  For example, you can use {{Code|less}} and the word search program {{Code|grep}} to find lines within a file with a search term.  For instance, if you have a C source code file {{Code|Program.c}} on the SBC, and you want to see all the lines in {{Code|Program.c}} that contain a variable name {{Code|var}}, you can type: &lt;br /&gt;
:&amp;lt;code&amp;gt;less Program.c | grep var&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====wget====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;wget&#039;&#039;&#039; program allows you to get an online file (over http) and download it to the SBC.&lt;br /&gt;
&lt;br /&gt;
For example, to get the source file (HTML) from the Phidgets home page, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
wget http://www.phidgets.com&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is most useful for downloading libraries, drivers, or anything (zip, tar, etc) you need from the web which is not available by [[#apt|using apt]].&lt;br /&gt;
&lt;br /&gt;
===Writing a Phidget Program===&lt;br /&gt;
&lt;br /&gt;
We provide two ways to write and upload a Phidget Program:&lt;br /&gt;
# The [[#SBC Web Interface|web interface]]:&lt;br /&gt;
#* This is useful for simple projects written in Java that you want to start only at boot&lt;br /&gt;
#* You can also use C projects, but they must be compiled off the SBC for an ARM processor&lt;br /&gt;
# Over [[#SSH|SSH]], which will allow you to write or transfer source code directly to and from the SBC&lt;br /&gt;
#* This is useful for all other projects, such as:&lt;br /&gt;
#** Projects that run at scheduled times (e.g. once per minute)&lt;br /&gt;
#** Projects that use languages other than Java or ARM-compiled C&lt;br /&gt;
Note that you can still run an [[#SSH|SSH]] project at boot, you just have to write and install a startup script.  This is a bit complex, but we do have an example that starts the program {{Code|phidgetwebservice21}} [[OS - Linux#As A Service|at boot using a script]].&lt;br /&gt;
&lt;br /&gt;
Once you know which method you&#039;d like to use, you can continue on to learn how to [[#Program in Java with the Web Interface|Program in Java with the Web Interface]], or how to [[#Program with SSH|Program with SSH]] using Java, C, or Python.  If you are actually typing in source code on the SBC, you&#039;ll find our [[#Developing Code on the SBC|developing code on the SBC section]] useful.&lt;br /&gt;
&lt;br /&gt;
====Program in Java with the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To show how to write, compile, and install Java programs on the SBC, we&#039;ll use the [[Language - Java|Java Hello World]] example code.  You can download the HelloWorld example by downloading the whole [{{SERVER}}/downloads/examples/JavaJNI.zip Java example package].  Make sure you have the same version of [[#Installing C/C++ and Java|Java installed on the SBC]] as you have on your external development machine. Instruction for checking and updating are found on the [[#Installing C/C++ and Java|installation page]].&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how to get the HelloWorld code running on the SBC.  On your external computer:&lt;br /&gt;
&lt;br /&gt;
1. Download the SBC version of the Phidget Java libraries ({{Code|phidget21.jar}}).  You can download this from the [[#SBC Web Interface|web interface]], on the page under {{Code|Projects &amp;amp;rarr; Projects}}, under the &#039;&#039;&#039;Notes&#039;&#039;&#039; section.&lt;br /&gt;
&lt;br /&gt;
2. Place the SBC version of {{Code|phidget21.jar}} into a directory on your external computer.  This will be your working directory that you will use to compile the Java files.&lt;br /&gt;
&lt;br /&gt;
3. Also copy the {{Code|HelloWorld.java}} file into that working directory.&lt;br /&gt;
&lt;br /&gt;
4. Compile the {{Code|HelloWorld.java}} file from within that working directory.  From the command line prompt on Windows, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .;phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In a terminal on Linux or Mac OS, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. You should now have three compiled class files: {{Code|HelloWorld.class}}, {{Code|HelloWorld$1.class}}, and {{Code|HelloWorld$2.class}}.  You don&#039;t need to try and run them, and if you do you may encounter an error because the SBC {{Code|phidget21.jar}} may be slightly different than the Phidget support you have installed on your external computer.&lt;br /&gt;
&lt;br /&gt;
Now we move onto the SBC:&lt;br /&gt;
&lt;br /&gt;
6. Create a new project on the SBC, in the web interface under {{Code|Projects &amp;amp;rarr; Projects}}.  Call it HelloWorld:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_create_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
7. On the next screen, you will be prompted to upload your files.  We will upload the three Java class files, and then click the {{Code|Start}} button:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_web_run_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
8. You&#039;ll note that as it runs, there are two links below the {{Code|Stop}} button: One called {{Code|stdout}}, which is &#039;&#039;Standard Output&#039;&#039;, and one called {{Code|stderr}}, which is &#039;&#039;Standard Error&#039;&#039;.  Usually, when you run a program on the command line, you see both standard out and standard error at the same time - i.e. you get all program output right there in your terminal or command prompt.  But when running a program in the background, Linux splits the output up into normal output and error output as this is very useful for debugging (i.e. you can check if standard error is empty).  &lt;br /&gt;
&lt;br /&gt;
Here, however, if you&#039;re not sure whether the program will run correctly, you should first check {{Code|stderr}} to see if any errors were generated, and then check {{Code|stdout}} to see if the output looks as expected.&lt;br /&gt;
&lt;br /&gt;
To write your own Java program, follow the same process but use your own source code instead of the {{Code|HelloWorld.java}} example.&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, we offer additional help on [[#Via the Web Interface|running a program automatically using the web interface]].&lt;br /&gt;
&lt;br /&gt;
====Program with SSH====&lt;br /&gt;
&lt;br /&gt;
Similarly to starting a program via the [[#Program in Java with the Web Interface|web interface]], we use the Phidget Java {{Code|HelloWorld}} example here.&lt;br /&gt;
&lt;br /&gt;
Make sure you have [[#Installing C/C++ and Java|Java installed on the SBC]].  To compile and run the {{Code|HelloWorld}} example:&lt;br /&gt;
&lt;br /&gt;
1. Open an [[#SSH|SSH terminal]] to the SBC&lt;br /&gt;
&lt;br /&gt;
2. Download the [{{SERVER}}/downloads/examples/JavaJNI.zip Phidget Java Examples] to the SBC, using [[#wget|wget]] (you may need to install {{Code|wget}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
3. Unpack the examples using [[#unzip|unzip]] (you may need to install {{Code|unzip}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
4. The location of {{Code|phidget21.jar}} on the SBC is {{Code|/usr/share/java/phidget21.jar}}.  Within the unzipped example directory, compile the {{Code|HelloWorld.java}} example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:/usr/share/java/phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. To run the {{Code|HelloWorld}} program, use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
java -classpath .:/usr/share/java/phidget21.jar HelloWorld&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, you&#039;ll probably want to learn to [[#Running a Program Automatically|run this Java program automatically]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; If you&#039;re used to using Linux with Phidgets already, you&#039;ll probably notice that you don&#039;t need to switch into root using {{Code|sudo}} on the SBC in order to run programs.  This is because you already are running as root, not because the [[OS - Linux#Setting udev Rules|udev rules are set up]].  So if you set up another user, or [[#Via Cron|run a cron job]] as anything other than root or system, you&#039;ll need to add permission for the Phidget program to run in your [[OS - Linux#Setting udev Rules|udev rules]].&lt;br /&gt;
&lt;br /&gt;
====Developing Code on the SBC====&lt;br /&gt;
&lt;br /&gt;
When you&#039;re not just using pre-written source code, and you&#039;re writing code actually on the SBC itself, you&#039;ll probably want to use [[#nano|nano]].  Other terminal editors on the SBC include {{Code|vi}} which is already installed, and {{Code|emacs}}, which you can install using [[#apt|apt]].  Both {{Code|vi}} and {{Code|emacs}} are much more efficient for the experienced user, but they contain modes and keyboard shortcuts that can seem strange or almost hindering to the casual user.&lt;br /&gt;
&lt;br /&gt;
Regardless of which editor you choose to use, some of your keyboard habits may not transfer well.  For example, in the Linux command line, the command {{Code|Ctrl-C}} means &#039;&#039;stop the currently running program&#039;&#039;, (i.e. your open editor) not copy.  Within most SSH terminals, you can copy and paste using the right-mouse button, and on some terminals (and all native Linux terminals) you can copy by simply highlighting text, and you can paste it using the middle (scroll) mouse button.  On the other hand, if you write a program that hangs on the command line, {{Code|Ctrl-C}} can actually be useful to terminate it.&lt;br /&gt;
&lt;br /&gt;
Also {{Code|Ctrl-Z}} does not mean &#039;&#039;undo&#039;&#039;, rather it means &#039;&#039;run the current program in the background&#039;&#039;.  This is useful because running a program in an SSH terminal simply hangs your SSH input until the program is done.  So typing {{Code|Ctrl-Z}} while the program is running frees up the command line for more input.  But if you accidentally hit {{Code|Ctrl-Z}} while running an editor like [[#nano|nano]], the editor will immediately exit to the command line.  Don&#039;t worry though, it will not stop or lose your work.  You can bring it back up by using the {{Code|fg}} (e.g. &#039;foreground&#039;) command, like {{Code|fg nano}}, and this will automatically bring your nano process back to the front.&lt;br /&gt;
&lt;br /&gt;
===Running a Program Automatically===&lt;br /&gt;
&lt;br /&gt;
For testing your program, you will certainly want to run it via [[#SSH|SSH]] or via the {{Code|Start}} button on the project page on the web interface until you are quite sure it runs well.  However, eventually you will probably want the program to run without your input, either [[#Via the Web Interface|continuously, and starting at boot]], or via a task scheduled to [[#Via Cron|run to completion at certain times]].&lt;br /&gt;
&lt;br /&gt;
Both have their advantages and disadvantages.  Usually, you would want to use the continuous, from-boot methods for event driven code that has to handle a wide variety of user input that could occur at any time.  You would want to use the scheduled method when the SBC needs to perform a repeated task (e.g. reading sensor data) again and again.  The main difference is:&lt;br /&gt;
* With the continuous (boot) method you can have any Phidgets (including sensors, LEDs, input switches, etc) attached and giving events to your code all the time, and&lt;br /&gt;
* With the scheduled (cron) method you have much less of a chance to run into long-term memory management and instability problems with any code you write, because your program runs for only a short time before exiting and getting cleaned up.&lt;br /&gt;
&lt;br /&gt;
====Via the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To use this method, you must have created the program you want to run as [[#Program in Java with the Web Interface | a Java or ARM-compiled C project in the web interface]].  If you would like to use another language, or another way of uploading your project, but you still want to start at boot and run continuously, you will need to use a [[#Via a Boot Script|boot script]].&lt;br /&gt;
&lt;br /&gt;
In the web interface, go to the {{Code|Projects}} tab, and click on the project you would like to run.  Near the bottom of the project page (the one with the {{Code|Start}} and {{Code|Stop}} buttons at the top), there will be a section called {{Code|Startup Settings}}.  You can see a screenshot of the whole project page, including these settings, in the [[#Program in Java with the Web Interface | web interface project section]].&lt;br /&gt;
&lt;br /&gt;
Select the {{Code|Enabled}} radio button.  The other defaults should be fine, unless you specifically know otherwise:&lt;br /&gt;
* For &#039;&#039;Boot Order&#039;&#039;, lower numbers boot first.  Booting later means more programs are available for use, booting earlier means other programs can use your program.  &lt;br /&gt;
* &#039;&#039;Run as a daemon&#039;&#039; starts the program as a daemon, which is a program that runs in the background.  Unless you have &#039;&#039;explicitly&#039;&#039; written your program as a daemon, leave this checked.  (If you don&#039;t know what a daemon is, don&#039;t worry, you haven&#039;t written one, so leave it checked.)  &#039;&#039;Un&#039;&#039;checking this when your program is a normal program will cause the SBC to hang while booting.&lt;br /&gt;
* The &#039;&#039;Executable or Class&#039;&#039; name should be automatically sensed to be your main Java class&lt;br /&gt;
* &#039;&#039;Arguments&#039;&#039; are any command line arguments you need, just as you would type them into the command line&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Your program must be very, very stable to run properly via the web interface.  Imagine your program running continuously for days, or months on end.  Any memory leaks, over time, will render your program (and the SBC) unusable until a reboot.  Counts or other variables that increase within your program and never reset may create a segmentation fault eventually.&lt;br /&gt;
&lt;br /&gt;
If, for stability purposes, you want your program to start, run for a little while, and then exit so that the SBC operating system can clean up the memory each time, you&#039;ll probably want to use [[#Via Cron|Cron]] to run your program instead.&lt;br /&gt;
&lt;br /&gt;
====Via Cron====&lt;br /&gt;
&lt;br /&gt;
Cron can automatically schedule programs - known as &#039;jobs&#039;, or &#039;cron jobs&#039; - at most once per minute.  Less often than that, it is very flexible, allowing you to run it on certain months, weekdays, hours, etc.  Cron simply reads a special file (your {{Code|crontab}}) and runs whatever programs are listed, with whatever timing they are listed with.  The cron program runs all the time in the background, making it what is known as a Linux &#039;&#039;daemon&#039;&#039;, but the programs it starts as jobs run only as long as they naturally would, and then they exit.&lt;br /&gt;
&lt;br /&gt;
If you need your program to run more often than once per minute, have the program schedule itself while still running.  For example, to run every five seconds, run a fast loop,  and sleep for five seconds. Do this twenty times and exit.  Then schedule this once per minute using cron, and your program will in essence run every five seconds.&lt;br /&gt;
&lt;br /&gt;
Setting up a cron job simply entails editing your {{Code|crontab}} file.&lt;br /&gt;
&lt;br /&gt;
First, you&#039;ll probably want to specify your default editor to be [[#nano|nano]]. Otherwise it will default to {{Code|vi}} and you&#039;ll have to figure out {{Code|vi}} in order to add lines to your crontab:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
export EDITOR=nano&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to edit your crontab file, simply type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
crontab -e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each line of the crontab file is one scheduled job.  Lines that start with a hash &amp;quot;#&amp;quot; are comments and are ignored.  There is an example line in the crontab, and a reminder line at the very end.  Essentially, each line should contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
minute hour dayOfMonth month dayOfWeek  command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*{{Code|command}} is the program you want to run (with absolute path, and arguments)&lt;br /&gt;
** For example, {{Code|./myprogram argument1}} won&#039;t work, but {{Code|/root/code/myprogram argument1}} will&lt;br /&gt;
* Each time argument is either a number, a list of numbers separated by commas, or an asterisk&lt;br /&gt;
** For example, * * * * * means every minute for all days and months, 0,30 * * * * means every thirty minutes (i.e. at the top of the hour and at 30 minutes in) for all days and months&lt;br /&gt;
&lt;br /&gt;
If you already have jobs scheduled, you&#039;ll see them in the file that comes up.  You can edit, add, or delete.  &lt;br /&gt;
&lt;br /&gt;
After you save, you&#039;ll see a little message back in the terminal that says the new crontab file was installed, and it is now scheduled!  Cron always starts every boot, and so if you have edited and installed your crontab as above, the scheduling of your program will start properly even after a reboot of the SBC.  However, if you are having strange scheduling problems, you may want to familiarize yourself with the [[#Software Details|software details]] of how the SBC as a whole determines the current date and time.&lt;br /&gt;
&lt;br /&gt;
=====My Cron Job Doesn&#039;t Work!=====&lt;br /&gt;
&lt;br /&gt;
It is actually very common for a script or program to work on the command line but then &#039;&#039;not&#039;&#039; work as a cron job.  The most common reason for this, by far, is that you specify &#039;&#039;relative&#039;&#039; paths in your program to access files rather than &#039;&#039;absolute&#039;&#039; paths.  For example:&lt;br /&gt;
* {{Code|code/project.c}} is a relative path (bad for cron)&lt;br /&gt;
* {{Code|/root/code/project.c}} is an absolute path (good for cron)&lt;br /&gt;
The cron jobs are &#039;&#039;not&#039;&#039; executed from your home directory, or your code directory, so they will not be using the same location you may be using to test your code.  So always use absolute paths.&lt;br /&gt;
&lt;br /&gt;
Another common reason is you may be using environment variables or other settings that are true in a terminal but are &#039;&#039;not&#039;&#039; true by default in the raw system.  You can end up taking many things for granted in a shell, for example the shortcut &amp;quot;~&amp;quot; means home directory in a shell, but not by default in the raw system.  The things that get loaded for a shell (but which are not present in the raw system) are:&lt;br /&gt;
* The settings loaded by {{Code|/etc/profile}}&lt;br /&gt;
* Any settings in {{Code|~/.bashrc}}, which is nothing by default on the SBC&lt;br /&gt;
&lt;br /&gt;
On a full Linux operating system, you would use the logs written to by cron to find the error output and debug it.  On the SBC, however, cron does not write logs (otherwise, these logs would eat up the SBC memory very quickly even for routine jobs).  For short-term debugging, you can write output from your program to a file, and read that file afterwards to figure out what your program is doing.&lt;br /&gt;
&lt;br /&gt;
====Via a Boot Script====&lt;br /&gt;
&lt;br /&gt;
If you want to run your program constantly and for it to start at boot like the [[#Via the Web Interface|web interface would do]], you can install your program into the boot order using a script.  This is a somewhat involved process, and you should be familiar with shell programming in Linux.  For this process, we only offer a [[OS - Linux#As A Service|similar example]] which installs and runs the program {{Code|phidgetwebservice21}} within the boot sequence.&lt;br /&gt;
&lt;br /&gt;
===Using USB Data Keys===&lt;br /&gt;
&lt;br /&gt;
After plugging the USB key in, it won&#039;t just appear on your desktop, so to speak, so you&#039;ll need to figure out where you can read and write to it within the SSH directory structure.&lt;br /&gt;
&lt;br /&gt;
The web interface program can help with this.  After you plug a USB key in, it will show up under {{Code|Status &amp;amp;rarr; System}}.  Or, the USB key and all other attached devices can be seen at {{Code|Status &amp;amp;rarr; USB}}:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_mounted_devices.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
In the screenshot above, you can see that the USB key is located in {{Code|/media/usb0}}.&lt;br /&gt;
&lt;br /&gt;
Alternately, you can use the SSH command {{Code|mount}}, and the searching program {{Code|grep}} which will filter the response of {{Code|mount}} and only return the lines with your search term ({{Code|usb}}):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep usb&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the USB key can be written to and read from using the {{Code|/media/usb0}} directory.  Copying a file to {{Code|/media/usb0}} will copy a file to the USB key.  The same goes for removing, renaming, opening files within your program, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Mount points like {{Code|/media/usb0}} should not be hard-coded into any of your programs.  (See the [[#Common Problems and Solutions | Common Problems and Solutions]] section for more information.)  If you need to obtain the mount point for a freshly mounted USB key within your code, have your code obtain the mount tables and search on the &#039;&#039;device&#039;&#039;  (e.g. {{Code|/dev/sda1}} or {{Code|/dev/sdb1}}) and obtain the corresponding mounted {{Code|/media/usbN}} location, where N is a number 0-9.&lt;br /&gt;
&lt;br /&gt;
===Saving and Retrieving Data===&lt;br /&gt;
&lt;br /&gt;
This section covers getting data on and off of the SBC.  There are two main methods of simply moving data on and off the SBC - via a [[#Via a USB Key|USB key]], and via [[#Over the Network (SCP)|copy over the network]] - and a third method for moving and installing data when it concerns [[#Backing Up Your Data|backing up lower level system data]].&lt;br /&gt;
&lt;br /&gt;
====Via a USB Key====&lt;br /&gt;
&lt;br /&gt;
After plugging in a USB data key, first you need to [[#Using USB Data Keys | find out the location]] where that data key was mounted.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the location of the USB key is {{Code|/media/usb0/}}, and we want to copy the file {{Code|data.txt}} to the USB key.  Your SSH session might look something like this, using [[#ls|ls]] and [[#mount|mount]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# ls&lt;br /&gt;
data.txt&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
root@phidgetsbc:~# cp data.txt /media/usb0/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cp&#039;&#039;&#039; program copies data from a source to a destination.  The syntax is {{Code|cp from to}}, where here we are copying from {{Code|data.txt}} to {{Code|/media/usb0/}}.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caution:&#039;&#039;&#039; Even if there is no USB key mounted at {{Code|/media/usb0/}}, this use of {{Code|cp}} will still work &#039;&#039;with no errors&#039;&#039;!  This is because there is still a file called {{Code|/media/usb0/}}, there is just no USB key file system &#039;&#039;mounted&#039;&#039; to that point.  So be sure to run [[#mount|mount]] or use some other method of determining that there is, in fact, a USB data key attached and where it is mounted to.&lt;br /&gt;
&lt;br /&gt;
====Over the Network (SCP)====&lt;br /&gt;
&lt;br /&gt;
SCP is a command line program already installed on Linux and Mac OS, and downloadable for free on Windows.  We discuss it and give examples in the [[#SSH|SSH]] section, but remember it here when you&#039;re trying to get data on and off of the SBC.  With SSH or a terminal already open, you&#039;ll probably find it to be much faster and easier than dealing with a USB key.&lt;br /&gt;
&lt;br /&gt;
====Backing Up Your Data====&lt;br /&gt;
&lt;br /&gt;
For the web interface, you can save and restore all web interface settings under the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} tab.&lt;br /&gt;
&lt;br /&gt;
To save the settings of what packages are installed for later re-installation, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg --get-selections &amp;gt; installedPrograms.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then save the file {{Code|installedPrograms.txt}} externally.  If you have to completely wipe the SBC, you can just reinstall the whole list by moving the {{Code|installedPrograms.txt}} file back onto the SBC, and then typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg –set-selections &amp;lt; installedPrograms.txt&lt;br /&gt;
apt-get dselect-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also remember to externally save:&lt;br /&gt;
* Your {{Code|~/.bashrc}} settings file if you&#039;ve changed it&lt;br /&gt;
* Your {{Code|crontab}} file if [[#Via Cron|you&#039;ve edited it]]&lt;br /&gt;
* Any data files or code you&#039;ve created&lt;br /&gt;
&lt;br /&gt;
It is important to save these settings often, and at points where you know the system is running well.  It may be tempting to create a backup right before you [[#Recovery System|wipe the SBC and start from scratch]], but often the reason you are having problems then is some setting or change, and backing these up and reinstalling them will only reinstall the problem.&lt;br /&gt;
&lt;br /&gt;
To truly back the files up, you must copy them to an external computer or location using either a [[#Via a USB Key|USB Key]] or [[#Over the Network (SCP) | over the network]].  Then they can be copied back if needed later.&lt;br /&gt;
&lt;br /&gt;
If you are looking to restore data on an SBC that will not boot properly, you&#039;ll want to be in the [[#Partial Recovery|partial recovery]] portion of our Troubleshooting section.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
The SBC can be quite tricky to debug, because it is a complex and flexible computer.  Common problems and solutions include:&lt;br /&gt;
* You can&#039;t find the SBC on the network at all - refer to the [[#Initial Internet Setup|Initial Internet Setup]] section&lt;br /&gt;
* You have changed some setting or file such that the SBC doesn&#039;t run anymore, or doesn&#039;t run as expected - refer to the [[#Recovery|Recovery]] section&lt;br /&gt;
&lt;br /&gt;
If you are having trouble using Phidgets on the SBC, you should go through the [[OS - Linux#Troubleshooting | Troubleshooting section on the general Linux page]].  Some of the problems on the Linux page (such as library problems) are easier to fix by simply working through the [[#Recovery|Recovery]] section when they occur on the SBC.&lt;br /&gt;
&lt;br /&gt;
Namely, it often helps to simply perform a [[#Factory Reset|factory reset]] on the SBC (save your files and installed program list first, as [[#Backing Up Your Data|described here]]).  Sometimes you change a file or setting within the operating system when you are trying to get something up and running, and this unintentionally affects other programs too.  Performing a factory reset starts you with a clean slate.&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, or the information within this guide, please [[Contact Us|ask us]]!&lt;br /&gt;
&lt;br /&gt;
===Initial Internet Setup===&lt;br /&gt;
&lt;br /&gt;
To set up the SBC, you almost always need a &#039;&#039;wired&#039;&#039; Ethernet connection with DHCP (Dynamic Host Configuration Protocol), and without a firewall.  This connection should be to a &#039;&#039;router&#039;&#039;, not directly plugged in to your computer.&lt;br /&gt;
&lt;br /&gt;
Even if you do not have this type of a connection at home, these types of connections are very common at both offices and universities.  On a Windows or Mac OS computer, you can bring up the [[Phidget Control Panel]] as described in the SBC&#039;s [[1072 User Guide#Getting Started|Getting Started Page]].  Failing this, or on a Linux computer, we discuss some alternate setup methods in this section.  Keep in mind that without a wired, open DHCP connection these setup methods can be difficult and fickle. &lt;br /&gt;
&lt;br /&gt;
====No Wired-Only Connection====&lt;br /&gt;
&lt;br /&gt;
Sometimes it can work to plug the SBC, using Ethernet, directly into an Ethernet port on your home wireless router.  Do not plug it directly into your computer!  (Although in some instances, a direct connection can be made to work on Linux, see the [[#No DHCP|No DHCP]] section below) &lt;br /&gt;
&lt;br /&gt;
This direct-router method is a very picky process, however, and can fail because:&lt;br /&gt;
* Some home and office routers place a firewall between wireless connections (clients) and wired connections (the local area network)&lt;br /&gt;
* Some home and office routers do not by default allow both Ethernet DHCP and wireless DHCP.&lt;br /&gt;
* Some routers and DHCP hubs only provide access to an internet connection, and do not provide local area network inter-connections (this is common on mobile device tethering hubs)&lt;br /&gt;
&lt;br /&gt;
Routers are quite complex, and even with admin privileges it can be a painstaking process to find all the right firewall settings to turn off in order to allow two computers on the network to talk to one another, rather than just connect to the internet.  This is why university or office networks are often ideal for the purpose of setting up the SBC, because these institutions depend on computers on a local network being able to talk together.  University libraries in particular can be a good source of wired DHCP connection ports.  &lt;br /&gt;
&lt;br /&gt;
Covering all of the different router configuration possibilities here, and how to change them to make the SBC work, is essentially impossible.  If you try using the SBC at home or at work, the SBC does not work on the first try when plugged directly into the router via Ethernet, and you want to make that connection work rather than seeking out an alternate for the initial setup, you should find documentation specific to your router (usually available online) and properly configure it.&lt;br /&gt;
&lt;br /&gt;
The good news is that if you can find an Ethernet DHCP connection &#039;&#039;just once&#039;&#039; for a short time, you can use that connection to configure the SBC to work on your home wireless network.  During that initial connection, you can enable wireless and set up as many wireless DHCP connections (with passwords) that you need.  Once wireless is enabled and set up, you can take the SBC home to your wireless router and the SBC will automatically seek out and connect to its remembered networks as they appear.  At that point, you can also use wireless like a normal internet, web interface, and SSH connection.&lt;br /&gt;
&lt;br /&gt;
====No Link Local Addressing====&lt;br /&gt;
&lt;br /&gt;
If you have a wired DHCP connection, no firewall, and no link local addressing (e.g. bonjour or avahi is not installed) then you will need access to the DHCP router logs.  From the router logs, you should see the connection (or attempted connection) by the SBC within the logs.  From that log entry, you should either be able to determine the IP address for the SBC, or see what happens when the router blocks access.  The IP address can be used in place of the link local address for both the web interface and for SSH.&lt;br /&gt;
&lt;br /&gt;
====No DHCP====&lt;br /&gt;
&lt;br /&gt;
The SBC will first try to use DHCP, but then it will revert to responding to a link local address under bonjour and avahi.  If you are depending on this, please wait &#039;&#039;&#039;at least three minutes&#039;&#039;&#039; after the SBC boots for the SBC to fail in obtaining a DHCP connection and properly revert to link local addressing.&lt;br /&gt;
&lt;br /&gt;
If you have a static IP setup, and want to use link local addressing rather than accessing the router logs, this should usually work by default on Windows and Mac OS (e.g. type the address such as {{Code|phidgetsbc.local}} into a web browser).  If it doesn&#039;t work automatically, there is not much you can do and you should seek out a wired DHCP connection elsewhere.&lt;br /&gt;
&lt;br /&gt;
On Linux, it also should work by default, but you have the additional option of explicitly adding routes that look within the default network settings for the SBC.  From a terminal (as root), type:&lt;br /&gt;
* {{Code|route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0 metric 99}}&lt;br /&gt;
* {{Code|route add default dev eth0 metric 99}}&lt;br /&gt;
You can also compile and use the {{Code|phidgetsbclist.c}} example (use the provided Makefile, don&#039;t use gcc) in the [{{SERVER}}/downloads/libraries/libphidget.tar.gz Phidget Linux Libraries] package, under the {{Code|examples}} folder.  This will allow you to see if the SBC is detected on the network at all.   Note that to use this option you must have the Phidget Libraries and the Phidget WebService installed on your Linux computer - in-depth instructions to do this are on the [[OS - Linux|main Linux page]].&lt;br /&gt;
&lt;br /&gt;
===Recovery System===&lt;br /&gt;
&lt;br /&gt;
You can either boot the SBC into recovery mode and attempt to recover files and settings, or you can completely wipe the SBC by performing a factory reset.  If the LEDs do not turn on normally (red on constantly, green on at first start, then off, then on when fully booted) then you&#039;ll want to read the [[#Hardware Issues|hardware issues]] section.&lt;br /&gt;
&lt;br /&gt;
====Partial Recovery====&lt;br /&gt;
&lt;br /&gt;
The recovery system can be entered in two ways:&lt;br /&gt;
# From the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} web interface page.&lt;br /&gt;
# By holding down the reset button for 20+ seconds - until the green light has switched from flashing slowly to flashing quickly.&lt;br /&gt;
&lt;br /&gt;
The recovery system runs an [[#SSH|SSH]] server where the username and password both are {{Code|root}}.&lt;br /&gt;
&lt;br /&gt;
If the main filesystem has been damaged/misconfigured in such a way that it won’t boot, you may be able to fix the issue or recover important files before running a full factory reset. From an SSH connection to the recovery system, you can mount the main root filesystem with the following commands (assuming it’s not damaged):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
ubiattach /dev/ubi_ctrl -m 6&lt;br /&gt;
mount -t ubifs /dev/ubi0_0 /mnt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Factory Reset====&lt;br /&gt;
&lt;br /&gt;
This restores the kernel and root filesystem from backup, overwriting any changes that may have been made and &#039;&#039;completely wiping the system&#039;&#039; to the state that it got shipped in. (You can save your files and installed program list first, as [[#Backing Up Your Data|described here]].)  This can be enacted one of two ways.&lt;br /&gt;
# Use the reset button:&lt;br /&gt;
##Enter the recovery mode by holding down the reset button for 20+ seconds as above (until fast flashing)&lt;br /&gt;
##Wait for a full boot (i.e. you can see it on the [[Phidget Control Panel]], or can SSH with username and password as {{Code|root}})&lt;br /&gt;
##Hold down the reset button again, but this time for only 10 seconds (until slow flashing)&lt;br /&gt;
##Wait for the SBC to fully reset and reboot (at least three minutes) - the LED will turn off and on again when this occurs&lt;br /&gt;
##*Note that after a factory reboot the SSH server will be disabled&lt;br /&gt;
##*Also note that after a factory reboot the SBC creates new SSH keys, and reverts to the {{Code|phidgetsbc.local}} address&lt;br /&gt;
# Via the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, where you can follow the instructions&lt;br /&gt;
&lt;br /&gt;
====Hardware Issues====&lt;br /&gt;
&lt;br /&gt;
The LEDs are an indicator of the hardware working properly.  The normal boot process is:&lt;br /&gt;
* Red LED: Turns on from moment of power being applied.&lt;br /&gt;
* Green LED: Turns on momentarily when power applied, then turns off momentarily, then turns on and stays on when booted.&lt;br /&gt;
&lt;br /&gt;
If the green status LED never turns on (or fails to turn on the second time), the boot process is failing somewhere.  This could be due to:&lt;br /&gt;
* A damaged OS - Try performing a [[#Factory Reset|Factory Reset]]&lt;br /&gt;
* If this fails, it is likely hardware damage (very difficult to diagnose, please [[Contact Us|contact us]])&lt;br /&gt;
&lt;br /&gt;
If neither LED turns on, hardware damage is even more likely.  Unless the path to the red LED is the one thing that has been damaged, the device is likely not receiving and using power.&lt;br /&gt;
* Try performing a [[#Factory Reset|Factory Reset]], and if that does not work please [[Contact Us|contact us]]&lt;br /&gt;
&lt;br /&gt;
=====USB Issues=====&lt;br /&gt;
&lt;br /&gt;
On the Phidget SBC2, there is a hardware issue that is unrelated to the LEDs.  It is a USB problem, and manifests in many ways:&lt;br /&gt;
* Strange behaviour when some devices but not others are plugged in to the SBC&lt;br /&gt;
* Strange behaviour with combinations of devices&lt;br /&gt;
* Failure (or intermittent failure) to see Phidgets on the USB hub, or USB keys on the hub&lt;br /&gt;
&lt;br /&gt;
This problem is fixable, either on your own or by sending your SBC back to Phidgets.  For an in-depth solution, see the [[SBC2_USB_Hub_Fix | SBC2 Hub Fix Page]].&lt;br /&gt;
&lt;br /&gt;
===Updating Your SBC===&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve owned your SBC for a while and want to update your packages, you can run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...to &#039;&#039;update&#039;&#039; your software source list and then &#039;&#039;upgrade&#039;&#039; to the latest version of all installed software.  If you are used to Mac OS or Windows, note that this does not just update the non-kernel parts of the operating system, it updates every additional piece of software you have installed.&lt;br /&gt;
&lt;br /&gt;
To update the SBC software itself (e.g. the kernel), it is easiest to use the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, to enter a page that will give you the option to update.  You will need to have an update file on a USB key inserted into the SBC, of type:&lt;br /&gt;
* UBI Image (system_ubi.img), or &lt;br /&gt;
* Kernel image (uImage), or&lt;br /&gt;
* Phidget Upgrade package containing both UBI and Kernel images (phidgetsbc*.bin)&lt;br /&gt;
&lt;br /&gt;
These are either obtained from the Phidgets website, or are a custom kernel / filesystem that you can create yourself, if you are experienced.&lt;br /&gt;
&lt;br /&gt;
The reason why this information is in troubleshooting is that you should certainly [[#Backing Up Your Data|back up your system]] before trying this.  And, it is quite rare to need to upgrade the kernel or filesystem on the SBC, so something serious should be going on before you attempt it.  Try using the [[#Recovery System|recovery system]] first.&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
Now that you have the basic libraries installed, you can pick your language and begin programming!  &lt;br /&gt;
&lt;br /&gt;
If you are not using the [[#WebService | webservice]] to control a Phidget over a network, your next step will be to delve into the use of your specific language.  Each page has its own set of specific libraries, code examples, and setup instructions.  &lt;br /&gt;
&lt;br /&gt;
On SBC Linux, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Java | Java]]&lt;br /&gt;
*[[Language - Python | Python]]&lt;br /&gt;
&lt;br /&gt;
These languages may also run on the SBC, but we do not yet directly offer SBC support for them:&lt;br /&gt;
* [[Language - Ruby|Ruby]]&lt;br /&gt;
* [[Language - C Sharp|C#]] (using Mono)&lt;br /&gt;
&lt;br /&gt;
You can probably figure out how to install and use them by a combination of the language pages linked above, and the section on [[#Installing Other Languages|installing other languages on the SBC]].&lt;br /&gt;
&lt;br /&gt;
==WebService==&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the [[Phidget WebService]] installed, and the SBC automatically starts the WebService at boot.&lt;br /&gt;
&lt;br /&gt;
To practice using the WebService, and to learn more about it, we have hands-on examples on the [[OS - Linux|general Linux page]], starting in the [[OS - Linux#Using the WebService|using the WebService section]].&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Shutting off USB ports to save power===&lt;br /&gt;
The SBC3 has an on-board USB hub that can control power to the ports. To do this unbind and rebind the USB drivers.&lt;br /&gt;
&lt;br /&gt;
To turn off the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/unbind}}&lt;br /&gt;
&lt;br /&gt;
To turn on the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/bind}}&lt;br /&gt;
&lt;br /&gt;
These will also cause detach and attach events for the Phidget devices, respectively. While the drivers are unbound, you will not get any hot plug events for any devices on USB.&lt;br /&gt;
&lt;br /&gt;
===Using a Touchscreen===&lt;br /&gt;
Please note that this will ONLY work with an SBC3 since it has a USB 2.0 hub:&lt;br /&gt;
&lt;br /&gt;
Using a touchscreen with the SBC is a great way to get user input and visual feedback from an SBC otherwise devoid of visual output.  The SBC does not have any conventional display ports such as VGA, DVI, or HDMI but it does have a number of USB ports and USB displays do exist.  With the upgrade to a USB 2.0 hub on the SBC3 from the earlier models which had USB 1 hubs the SBC now has enough capability to operate a screen over USB.  We don&#039;t recommend running a standard desktop environment since the processor is too slow to really keep up with a typical desktop it does make for an excellent interface for a kiosk, instrumentation control panel or  other, similar use case.  This document is going to go through the process of enabling support for a typical USB display as well as installing a fairly compact desktop environment called xfce on the SBC.  &lt;br /&gt;
&lt;br /&gt;
The screen I will be using is from a company called [http://lilliputweb.net/ Lilliput].  Specifically a UM-70 model.  Before you begin, please make sure that you have the screen plugged into the SBC, it will also be useful to have a spare USB keyboard and mouse handy as you will need them once you are no longer using an SSH terminal to communicate with the SBC.&lt;br /&gt;
&lt;br /&gt;
[[File:lilliputoff.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Getting the display to function====&lt;br /&gt;
Begin by logging into the web configuration page for your SBC and upgrading all of the packages on the SBC.  Be sure to include the full Debian package repository.  For more information on how to do this refer to the  [[OS - Phidget SBC#Getting Started - External Computer|getting started]] section of the Phidget SBC documentation.  Once you are fully up to date open an SSH session with the SBC and navigate to the &amp;quot;/etc&amp;quot; folder.  Open inittab with a terminal-based text editor such as nano and add the following to the bottom of the file, just above the {{code|T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100}} line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
1:2345:respawn:/sbin/getty 38400 tty1 &lt;br /&gt;
2:23:respawn:/sbin/getty 38400 tty2 &lt;br /&gt;
3:23:respawn:/sbin/getty 38400 tty3 &lt;br /&gt;
4:23:respawn:/sbin/getty 38400 tty4 &lt;br /&gt;
5:23:respawn:/sbin/getty 38400 tty5 &lt;br /&gt;
6:23:respawn:/sbin/getty 38400 tty6 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reboot your system.  After a few minutes you should see the LCD screen come up with a standard Linux terminal interface and a login prompt.  This is all well and good but this isn&#039;t really appreciably better than simply using an SSH session to communicate with the SBC.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputlogin.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Setting up Xfce====&lt;br /&gt;
In order to get a traditional windowing environment we still need to install a desktop manager as well as a number of supporting packages.  Log in and make sure everything is still up to date with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install the following packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xserver-xorg lxde xfce4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the SBC asks you if you want to continue, just type &amp;quot;Y&amp;quot; and press enter.  &lt;br /&gt;
&lt;br /&gt;
This will install the xfce desktop environment and any other necessary programs on the SBC.  When it&#039;s done, restart the SBC.  When it boots back up it should boot directly to a login screen instead of the terminal interface.  Log in, and you are good to go.  It won&#039;t be particularly fast, but don&#039;t worry, the SBC does not have a dedicated video processor on it so it&#039;s perfectly normal for it to be slow.  What&#039;s important is that it works.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputdesktop.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Calibrating the touch screen====&lt;br /&gt;
Unfortunately, by default the screen is calibrated to believe the bottom of the screen is on the right hand side.  This has the effect of making the touch functionality more or less useless until it has been properly calibrated.  To do this, install the following package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xinput-calibrator&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now use xinput calibrator to measure the parameters of your screen.  Launch xinput calibrator (called Calibrate Touchscreen in the programs menu) and follow the instructions on the screen.  The screen should now be functioning at full potential.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Using a Different Wireless Adapter===&lt;br /&gt;
&lt;br /&gt;
The support for the wireless adaptor that Phidgets sells is written into the SBC kernel.  Hence, we do not support using other adaptors. &lt;br /&gt;
&lt;br /&gt;
However, Linux is very flexible, and it is possible (though not easy) to write a custom kernel for the SBC and add support for a new wireless adaptor.  We can&#039;t help you with this, but we do provide some basic guidelines for [[#Custom Kernel and Filesystem|building your own kernel]].  You can also have a look at our thoughts on our own experience with choosing a Wifi adapter: [[Alternative Wi-Fi Adapters on the SBC]].&lt;br /&gt;
&lt;br /&gt;
===Using a Different Webcam===&lt;br /&gt;
&lt;br /&gt;
In addition to the webcam that Phidgets sells, you have the option to use many different webcams with the SBC.  There is a [http://www.ideasonboard.org/uvc/#devices long list] of compatible webcams.&lt;br /&gt;
&lt;br /&gt;
The common thread for these webcams is that they use UVC - the USB Video Class - drivers for Linux.  You can then use [[#mount|mount]] to find out what video device your webcam is mounted under.&lt;br /&gt;
&lt;br /&gt;
===Taking Pictures With the Webcam===&lt;br /&gt;
&lt;br /&gt;
Probably the most straightforward way to use a webcam for pictures rather than video is to use the {{Code|opencv}} library.  You can get it by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libcv2.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there is no {{Code|libcv2.1}} package, you can perform {{Code|apt-cache search libcv}} to find the current version.&lt;br /&gt;
&lt;br /&gt;
The opencv libraries can also be used within Python, by installing the link between them:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python-opencv&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then taking pictures from within code becomes quite simple.  For example, in Python, taking and saving an image is four lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
#! /usr/bin/python&lt;br /&gt;
&lt;br /&gt;
import cv&lt;br /&gt;
&lt;br /&gt;
# The webcam is located at /dev/video0 &lt;br /&gt;
# OpenCV only needs the number after video&lt;br /&gt;
webcam = cv.CaptureFromCAM(0)&lt;br /&gt;
&lt;br /&gt;
frame = cv.QueryFrame(webcam)&lt;br /&gt;
&lt;br /&gt;
cv.SaveImage(&amp;quot;image.jpg&amp;quot;, frame)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the complete OpenCV documentation, see [http://opencv.willowgarage.com/documentation/index.html The OpenCV Reference], and specifically the section on [http://opencv.willowgarage.com/documentation/reading_and_writing_images_and_video.html Reading and Writing Images].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The SBC is probably not as powerful for image processing and transport when compared to your desktop computer.  Try running your image processing code on the SBC from an early point in development.  During those test runs, you can visit the first System page of the [[#SBC Web Interface|SBC Web Interface]] to check the processor and memory use.  For more information on processor power, check the specification for your SBC (on the product page on [{{SERVER}} our main website]) as well as our discussion of [[#Pushing Processor Limits|pushing processor limits]] below.&lt;br /&gt;
&lt;br /&gt;
===Checking System Logs===&lt;br /&gt;
&lt;br /&gt;
The SBC maintains two logs: a kernel log and a system log.  &lt;br /&gt;
&lt;br /&gt;
The kernel log is for low-level occurrences, such as devices attaching and leaving the USB hub, recording what drivers are being used, and so on.&lt;br /&gt;
&lt;br /&gt;
The system log (syslog) is for normal chatter from the operating system.  Any program with the right permissions can use it (though you need to know the method to write to it, information all around the Internet can help) and it contains everything from the Ethernet going up and down, to webserver requests, and so on.  If you don&#039;t run many programs or services on the SBC, the syslog will essentially be a mirror of the kernel log, because the kernel is the only thing talking.&lt;br /&gt;
&lt;br /&gt;
You can check these logs by using the web interface in the {{Code|System &amp;amp;rarr; Logs}} tab.&lt;br /&gt;
&lt;br /&gt;
Or you can perform more powerful filtering and displaying via an SSH terminal.  For example, {{Code|dmesg}} is the command to display the kernel log, and {{Code|tail}} prints the last ten lines of input.  So, if you are trying to see if you can get a device to be detected on USB, you can run &amp;lt;code&amp;gt;dmesg | tail&amp;lt;/code&amp;gt; to print the latest ten lines of kernel log data.&lt;br /&gt;
&lt;br /&gt;
The actual locations of the log files (for filtering and reading) are:&lt;br /&gt;
* {{Code|/var/log/syslog}} &lt;br /&gt;
* {{Code|/var/log/dmesg}}&lt;br /&gt;
But don&#039;t edit them directly!  Always follow the advice and procedures around the Internet on how to properly log items to syslog.&lt;br /&gt;
&lt;br /&gt;
===X Forwarding===&lt;br /&gt;
&lt;br /&gt;
Although most tasks can be done using the [[#SBC Web Interface|SBC Web Interface]] or [[#SSH|SSH]], you can also set up X11 forwarding on the SBC.  X11 is the window manager base, which provides a graphical windowing system on the SBC.  Although you probably won&#039;t connect directly to the X11 manager (i.e. by plugging a screen directly into the SBC), X11 also gives a user the ability to forward graphical windows over SSH.  You will need the following packages installed:&lt;br /&gt;
* {{Code|x11-common}}&lt;br /&gt;
* {{Code|xbase-clients}}&lt;br /&gt;
After installing, make sure that the line in {{Code|/etc/ssh/sshd_config}} has a line that says:&lt;br /&gt;
:{{Code|X11Forwarding yes}}&lt;br /&gt;
Then log out and log back into the SBC.  This second time you log in, use the {{Code|-X}} switch to turn on X forwarding for that connection:&lt;br /&gt;
:{{Code|ssh -X root@phidgetsbc.local}}&lt;br /&gt;
Then you should be able to run programs that launch a window, and it will launch remotely and appear on the computer you have the SSH connection from.&lt;br /&gt;
&lt;br /&gt;
===Pushing Processor Limits===&lt;br /&gt;
&lt;br /&gt;
The SBC, though more powerful than many embedded computers out there, is probably about as powerful as your smartphone.  If you hook up 1 ms Phidget sampling devices to all six of its USB ports, events and packets will probably get lost.  The exact data rates you can accomplish depend on:&lt;br /&gt;
* What else is running on the SBC&lt;br /&gt;
* How efficient your code is for external operations (like File I/O)&lt;br /&gt;
* Other minor details (e.g. the temperature of the SBC, etc)&lt;br /&gt;
&lt;br /&gt;
If you want to achieve data rates as fast as possible, try these tips:&lt;br /&gt;
* Program in C, not in an interpreted language (Python, Java, .NET)&lt;br /&gt;
* Perform file I/O as little as possible.  Locally cache data, manage your writing to a file in a separate thread, and use low-level write calls.&lt;br /&gt;
* Change the [[#Custom Kernel and Filesystem|filesystem]] to a faster, non-compressed file system.&lt;br /&gt;
** Alternatively, use a high-data-rate USB key.&lt;br /&gt;
* Keep other running processes to a minimum. &lt;br /&gt;
** If you are running code locally right on the SBC, turn off the Phidget WebService.&lt;br /&gt;
&lt;br /&gt;
===Custom Kernel and Filesystem===&lt;br /&gt;
&lt;br /&gt;
You can compile your own kernel and flash it to the board. It is left up to the user to configure an appropriate cross-compiler for kernel development. You may also be able to compile a new kernel on-board.  We have a kernel development kit, complete with patch file and README:&lt;br /&gt;
* [{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Compiling a new, custom kernel is somewhat complex.  If the SBC is your first experience with Linux, writing a custom kernel will be difficult.  However, it will probably also be very rewarding because you can put whatever you like into it.  We might be able to offer additional suggestions, but ultimately you&#039;re on your own here. &lt;br /&gt;
&lt;br /&gt;
You may be able to write a custom kernel right on the SBC, but the easiest way is to develop the kernel on an external computer.  And the easiest way to develop on an external computer is for that computer to also be Linux, even just in a Virtual Machine.  The time spent loading a copy of Linux into a virtual machine (such as VirtualBox, which is free) onto your computer will probably be less time than setting up a standard compiler on Windows to cross-compile.&lt;br /&gt;
&lt;br /&gt;
On your external Linux system, you will need:&lt;br /&gt;
* A cross-compiling toolchain for the ARM processor, which we briefly describe on the [[OS - Linux#Cross-Compiling with a Custom Toolchain | main Linux page]], and &lt;br /&gt;
* The [{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package] from the Phidgets website.  &lt;br /&gt;
The kernel development kit has a brief README file which describes how to obtain the proper kernel and patch, configure, customize, and build it.&lt;br /&gt;
&lt;br /&gt;
We have an application guide in progress, which walks through building a custom kernel to add Bluetooth support to the SBC.  Please contact us if you would like more information.  Even if you are trying to add support for hardware other than a bluetooth modem, or wondering if support even exists in the kernel for your modem (3G, alternate wireless, etc) you will probably find the application guide helpful.  Follow it up to the point where you run the program {{Code|menuconfig}} (you don&#039;t need an SBC to do this), which will give you a menu of all drivers you can enable in the SBC kernel.&lt;br /&gt;
&lt;br /&gt;
After making your new kernel, you should have a uImage and modules target for your Makefile.  At this point you can transfer your kernel files onto the SBC, make their targets, and transfer them into the nand memory.  This involves erasing the old kernel, flashing the new kernel, installing the new kernel modules, and rebooting.  From the SBC, in the kernel directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
make uImage; make modules&lt;br /&gt;
flash-eraseall /dev/mtd3&lt;br /&gt;
nandwrite -p /dev/mtd3 arch/arm/boot/uImage&lt;br /&gt;
make modules-install&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Custom kernels can also be flashed from the [[#Recovery System | Recovery System]].&lt;br /&gt;
&lt;br /&gt;
If you need to create a root filesystem image, the filesystem type is UBIFS, and the commands to create it are:&lt;br /&gt;
&lt;br /&gt;
====For SBC2:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====For SBC3:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You then flash ‘system_ubi.img’ (not ‘system_ubifs.img’) from the recovery system.&lt;br /&gt;
&lt;br /&gt;
Again, like the custom kernel creation, the need to create a custom root filesystem is essentially non-existent except for those advanced users who already know they need it... and furthermore, you are almost entirely on your own.&lt;br /&gt;
&lt;br /&gt;
===Saving a file system to flash to multiple SBC&#039;s===&lt;br /&gt;
You may want to create a complete backup of your SBC root filesystem, which can then be flashed to other SBCs. This is how it could be done:&lt;br /&gt;
&lt;br /&gt;
You will need a USB drive - we have had issues using cheap flash drives, so a real USB drive is recommended. Make sure it&#039;s empty, as it will be reformatted.&lt;br /&gt;
&lt;br /&gt;
All of these commands are executed on your SBC, while logged in over SSH.&lt;br /&gt;
&lt;br /&gt;
First, re-format the USB drive as ext3. Assuming the USB drive is sda and has a single partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
mkfs.ext3 /dev/sda1&lt;br /&gt;
mount -t ext3 /dev/sda1 /media/usb0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remount / as readonly, so it doesn&#039;t change as we&#039;re copying it. To do this, we need to kill all running processes except sshd:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
service udev stop&lt;br /&gt;
service ifplugd stop&lt;br /&gt;
service rsyslog stop&lt;br /&gt;
service avahi-daemon stop&lt;br /&gt;
service phidgetwebservice stop&lt;br /&gt;
service ntp stop&lt;br /&gt;
service busybox-httpd stop&lt;br /&gt;
service dbus stop&lt;br /&gt;
service cron stop&lt;br /&gt;
pkill dhclient&lt;br /&gt;
mount -o remount,ro /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the remount says that / is busy, do a &#039;ps auxww&#039; and &#039;pkill&#039; anything else that may be running until it remounts properly.&lt;br /&gt;
&lt;br /&gt;
Then, copy / to the flash drive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkdir /media/usb0/root&lt;br /&gt;
mount --bind / /mnt/&lt;br /&gt;
cp -a /mnt/* /media/usb0/root/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, clean up the copy - removing files specific to this board. We also remove the APT cache to save space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
find /media/usb0/root/var/log -type f -print0 | xargs -0 rm -f&lt;br /&gt;
rm -rf /media/usb0/root/var/lib/apt/lists/*&lt;br /&gt;
mkdir /media/usb0/root/var/lib/apt/lists/partial&lt;br /&gt;
rm -f /media/usb0/root/var/cache/apt/*.bin&lt;br /&gt;
rm /media/usb0/root/etc/udev/rules.d/70-persistent-net.rules&lt;br /&gt;
rm /media/usb0/root/etc/ssh/ssh_host_*&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
then, create the ubinize.cfg file:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi	&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs0&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi		&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
vol_flags=autoresize	&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: you may need to increase vol_size if your filesystem is larger.&lt;br /&gt;
&lt;br /&gt;
then, create the UBI image from the copy:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then, unmount the drive to ensure everything is written out properly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you can remove the /root/ folder and system_ubifs.img. system_ubi.img can be flashed to other SBCs using the recovery system.&lt;br /&gt;
&lt;br /&gt;
==Software Details==&lt;br /&gt;
&lt;br /&gt;
For even more advanced uses of the SBC, it may help to know the gritty details of the SBC software system.&lt;br /&gt;
&lt;br /&gt;
;Operating System&lt;br /&gt;
:Debian/GNU Linux&lt;br /&gt;
:Kernel 2.6.X or higher (generally kept up to date with latest releases, use {{Code|uname -r}} to check the kernel version)&lt;br /&gt;
&lt;br /&gt;
;Main Filesystem (rootfs)&lt;br /&gt;
:UBIFS (a raw flash type of file system)&lt;br /&gt;
:Mounted in a 460 MB Nand partition (in Read/Write mode)&lt;br /&gt;
&lt;br /&gt;
;Kernel&lt;br /&gt;
:uImage format&lt;br /&gt;
:Has its own 3MiB partition on bare Nand&lt;br /&gt;
&lt;br /&gt;
;Web Interface Scripts and Configuration Data&lt;br /&gt;
:Located in {{Code|/etc/webif}}&lt;br /&gt;
:Modifying these scripts can be done; however, it is very easy to enter invalid data that could cause the system to behave unexpectedly or not boot.&lt;br /&gt;
&lt;br /&gt;
;User Applications uploaded through Web Interface&lt;br /&gt;
:Located in {{Code|/usr/userapps}}&lt;br /&gt;
&lt;br /&gt;
;Webcam Device Location&lt;br /&gt;
:{{Code|/dev/video0}}&lt;br /&gt;
:Numbers increase with more webcams&lt;br /&gt;
&lt;br /&gt;
;Date and Time&lt;br /&gt;
:Set using ntp (network time protocol) at boot&lt;br /&gt;
:The ntp daemon continues to run in the background and will periodically update the clock &lt;br /&gt;
:The network keeps the SBC very close to real time&lt;br /&gt;
:Also there is a real-time clock with battery backup which will preserve date/time across reboots, power removal&lt;br /&gt;
:The real-time clock is synced to system time during reboot/shutdown&lt;br /&gt;
:If power is unplugged suddenly, and the network not restored, the real-time clock may not have the correct time&lt;br /&gt;
&lt;br /&gt;
;Wireless Networking System&lt;br /&gt;
:Wireless adapter support for the wireless adapter that Phidgets sells is written into the kernel&lt;br /&gt;
:It supports WEP and WPA&lt;br /&gt;
:It is best configured through the configuration interface.&lt;br /&gt;
&lt;br /&gt;
;Nand Layout&lt;br /&gt;
:The board contains 512MiB on Nand. This nand is split into 7 partitions as follows:&lt;br /&gt;
:0: u-boot		 size: 256K		 Read Only&lt;br /&gt;
:1: u-boot_env		 size: 128K		 Read Only&lt;br /&gt;
:2: recovery_kernel	 size: 2M		 Read Only&lt;br /&gt;
:3: kernel		 size: 3M		 Writable&lt;br /&gt;
:4: flashfs	 	 size: ~3.625M	 	 Read Only&lt;br /&gt;
:5: recovery_fs		 size: ~ 43M		 Read Only&lt;br /&gt;
:6: rootfs		 size: ~ 460M		 Writable&lt;br /&gt;
: The final size of flashfs/recovery_fs/rootfs depends on the image size at production, and on the number/location of bad blocks in the NAND.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: U-Boot and recovery kernel and filesystem cannot be written from Linux - this is a safety measure.&lt;br /&gt;
&lt;br /&gt;
;Boot Loader&lt;br /&gt;
:U-Boot is used for setting up the processor and booting Linux, and is only accessible via a serial connection. &lt;br /&gt;
:Normal users will not need to use or modify it.&lt;br /&gt;
:Be very careful when modifying the u-boot partition. If it is damaged or overwritten, it is difficult to fix.&lt;br /&gt;
:When using U-Boot, a prompt will appear via serial shortly after power on.  &lt;br /&gt;
:The environment variables will help you determine how to boot Linux on the SBC&lt;br /&gt;
:You can also refer to the [http://www.denx.de/wiki/DULG/Manual U-Boot documentation]&lt;br /&gt;
&lt;br /&gt;
;Boot Process&lt;br /&gt;
:From power on...&lt;br /&gt;
:1. Processor loads first 4 bytes from NAND into Steppingstone and runs it.&lt;br /&gt;
:2. Steppingstone sets up RAM, copies u-boot from NAND into RAM and runs U-Boot.&lt;br /&gt;
:3. U-Boot initializes the processor, sets GPIO state, etc., copies the linux kernel into RAM, sets up the kernel command line arguments, checks that the kernel image is valid, and boots it.&lt;br /&gt;
:4. Linux boots, bringing up USB, Networking, NAND, etc. and then mounts the rootfs NAND partition on /.&lt;br /&gt;
:5. init gets run as the parents of all processes, as uses the /etc/inittab script to bring up the system. This includes mounting other filesystems, settings the hostname, and running the scripts in /etc/init.d, among other things.&lt;br /&gt;
:6. inittab then turns the green LED on.&lt;br /&gt;
:7. inittab then sets up a getty on the first serial port, ready for interfacing using the debug board.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|PHP Curl|Curl doesn&#039;t install smoothly}}&lt;br /&gt;
&lt;br /&gt;
There is an issue with the embedded version of PHP5.3, try forcing it to install the specific version that you need.  This can be done with the following command:&lt;br /&gt;
&lt;br /&gt;
{{Code|apt-get install php5-common&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;5.3.3-7+squeeze14}}&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|FTDI Errors|FTDI adapters do not appear to work with the SBC}}&lt;br /&gt;
&lt;br /&gt;
The 3.1.6 version of the Linux kernel which is used on some versions of the SBC has a bug that causes issues with FTDI drivers and makes them malfunction.  To solve this problem you must upgrade the kernel to a newer version.  You can find the files [[#Quick Downloads| here]].&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|USB Memory Key mounting|Sometimes USB Memory Keys mount at more than one location}}&lt;br /&gt;
&lt;br /&gt;
When you insert a memory key, the SBC will load it as a device (e.g. {{Code|/dev/sda1}}) and it will also &#039;&#039;mount&#039;&#039; the key for reading and writing within the {{Code|/media/}} directory.  The {{Code|/media/}} directory version will be called something like {{Code|usb0}}.  &lt;br /&gt;
At times, an inserted memory key will get mounted in more than one location.  You can observe if this occurs by checking the currently mounted devices with the command {{Code|mount}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
/dev/sda1 on /media/usb1 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will note that the same device ({{Code|/dev/sda1}}) is now mounted at &#039;&#039;both&#039;&#039; {{Code|/media/usb0}} and {{Code|/media/usb1}}.  To fix this problem as it occurs, you can use {{Code|umount}} (notice there is no letter &#039;n&#039;) to unmount the second instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# umount /media/usb1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In practice, this should not be a problem, because writing to or reading from either {{Code|usb0}} or {{Code|usb1}} will have the same effect on the memory key.  However, if you hard-code a media location into your program (i.e. expecting {{Code|/media/usb0}} to be the first USB key you insert and {{Code|/media/usb1}} to be the second key) your program will sometimes work and sometimes fail.  &lt;br /&gt;
&lt;br /&gt;
To get around this within code, find the mount point for each device as it appears.  The devices, such as {{Code|/dev/sda1}} will always refer to the actual memory key.  But, they cannot be written to directly without being mounted, so you will have to parse the mount table (what is returned from {{Code|mount}}) within your code to find the device and its corresponding mount point.&lt;br /&gt;
&lt;br /&gt;
This is a problem with the standard embedded Debian automount program, and we have no known fix.&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|Perl Locale Errors on SSH|No Locales Installed}}&lt;br /&gt;
&lt;br /&gt;
By default, no locales are installed on the SBC.  If you use [[#apt|apt]] a lot to install and manage your software on the SBC, you will get messages like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
perl: warning: Setting locale failed.&lt;br /&gt;
perl: warning: Please check that your locale settings:&lt;br /&gt;
	LANGUAGE = (unset),&lt;br /&gt;
	LC_ALL = (unset),&lt;br /&gt;
	LANG = &amp;quot;en_CA.UTF-8&amp;quot;&lt;br /&gt;
    are supported and installed on your system.&lt;br /&gt;
perl: warning: Falling back to the standard locale (&amp;quot;C&amp;quot;).&lt;br /&gt;
locale: Cannot set LC_CTYPE to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_MESSAGES to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_ALL to default locale: No such file or directory&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To squelch these messages, you should install and reconfigure your locale like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install locales&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command will show you a long list from which you should pick your location, by language.  For example, en_CA is english_Canada.  Here in Calgary, we use en_CA.UTF-8 and so for the first question we would input locale &amp;quot;114&amp;quot; and for the second (system) question we would input {{Code|en_CA}} for the locale.&lt;br /&gt;
&lt;br /&gt;
This might give you a locale undefined error, in which case you can generate the locale (for us, again, it is en_CA):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
locale-gen en_CA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=23810</id>
		<title>OS - Phidget SBC</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=23810"/>
		<updated>2016-04-25T16:08:35Z</updated>

		<summary type="html">&lt;p&gt;Patrick: /* Quick Downloads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
{{OSLang|[[File:icon-Linux.png|64x64px|link=OS - Linux]]|On the Single Board Computer (SBC), Phidgets can be either plugged directly into one of the USB ports or run over a network using the [[#WebService | WebService]].}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Unlike our other supported operating systems, the SBC &#039;&#039;&#039;does not require downloads&#039;&#039;&#039; unless you are doing something advanced like loading the firmware or developing your own kernel.  You will know if you need these downloads, otherwise, the SBC should work as described on the [[1073 User Guide#Getting Started|SBC3 Getting Started Guide]] right out of the box.&lt;br /&gt;
&lt;br /&gt;
*[[Software License]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC (1070):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc-minimal.bin Minimal Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc-full.bin Full Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/buildroot-phidgetsbc.tar.gz Buildroot/Kernel Sources]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC2 (1072):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc2/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc2.bin SBC2 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC2 Kernel Development Package] (How-to and patch file)&lt;br /&gt;
&#039;&#039;&#039;The PhidgetSBC3 has different firmware packages based on the kernel version. In order to determine the device version of your SBC3, see the [[1073_User_Guide#SBC_Web_Interface|web configuration page]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:sbcver.jpg|thumb|562px|link=|The system information table is found on the Status -&amp;gt; System tab of the &#039;&#039;&#039;[[1073_User_Guide#SBC_Web_Interface|web configuration page]]&#039;&#039;&#039; of the SBC.]]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.6.3:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc3/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3_1.0.0.20121213.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-kerneldev_1.0.0.20121213.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-upgrade_3.6.3_3.14.27.tar.gz SBC3 Kernel upgrade package (3.6.3 -&amp;gt; 3.14.27)]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.14.27:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc3/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3_1.0.2.20160425.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-kerneldev_1.0.2.20160425.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Note that, instead of using the firmware to update your SBC, updates should normally be done via the System -&amp;gt; Packages page on your SBC3 web interface. It is rarely necessary to completely re-flash your device..&lt;br /&gt;
&amp;lt;br clear = all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Getting Started with the Phidget SBC Debian Linux==&lt;br /&gt;
&lt;br /&gt;
The Single Board Computer (SBC) is a unique Phidget.  It is a computer with a Linux operating system.  It can compile code, save files, manage background jobs, host information over the web, and more.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If this is your first time&#039;&#039;&#039; using the Phidget SBC, you will want to start with the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  After that, here we will get you started on topics beyond those in the getting started guide, including how to write Phidget code to run on the SBC.  You &#039;&#039;&#039;do not need this page&#039;&#039;&#039; if you are simply using the SBC to broadcast data from Phidgets over the network - it does that automatically.  We describe how to verify and use this in the [[1073 User Guide#Getting Started | Getting Started Guide]].&lt;br /&gt;
&lt;br /&gt;
This page will show you how to:&lt;br /&gt;
* Install the ability to write and develop code on the SBC itself&lt;br /&gt;
* Use the command line for basic coding tasks&lt;br /&gt;
* Troubleshoot the SBC&#039;s network&lt;br /&gt;
It will also give additional specifications, which are useful for doing more advanced things with the SBC hardware and software.&lt;br /&gt;
&lt;br /&gt;
Before reading this page, you should have done the following via the Getting Started Guide:&lt;br /&gt;
* Set up networking on your SBC, via either Ethernet or wireless&lt;br /&gt;
* Set up an admin password&lt;br /&gt;
* Learned the IP address or link local address of the SBC&lt;br /&gt;
We will use this information in setting up the libraries and drivers to use the SBC for writing and running code.&lt;br /&gt;
&lt;br /&gt;
Conceivably, you could simply use the SBC like any Linux computer, and do all of your development and compiling of Phidget code on the SBC itself.  In practice this gets complicated as the SBC does not have a keyboard or screen.  So usually, you will want to develop your code an external computer and copy files and settings over to the SBC via a network.  This makes this Getting Started section unique, in that we show you how to set up both computers:&lt;br /&gt;
* Your [[#Getting Started - External Computer | External Development Computer]], usually your main desktop or laptop which will transfer files and settings to and from the SBC&lt;br /&gt;
* The [[#Getting Started - The SBC (Debian Linux) | SBC]] itself, which needs programming language libraries to use Phidgets.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - External Computer===&lt;br /&gt;
&lt;br /&gt;
You have two ways to connect to the SBC from an external computer: via the [[#SBC Web Interface|SBC Web Interface]] and over the more powerful but complex [[#SSH | Secure Shell (SSH)]].&lt;br /&gt;
&lt;br /&gt;
====SBC Web Interface====&lt;br /&gt;
&lt;br /&gt;
You have already worked extensively with the web interface in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  This was the tool within a web browser which was opened either via the [[Phidget Control Panel]] on Windows, or by simply entering the IP or link local address into an internet browser.  It allowed you to set the password, set up internet connectivity, and so on.  &lt;br /&gt;
&lt;br /&gt;
This section doesn&#039;t have more information on the interface; rather, it simply serves as a reminder that you have the web interface as an available tool.  Examples, including screenshots, are placed where appropriate in this document.  The web interface will probably stay your initial go-to way to connect to the SBC, especially for tasks that benefit from graphical interaction, like setting up wireless or using the webcam.&lt;br /&gt;
&lt;br /&gt;
====SSH====&lt;br /&gt;
&lt;br /&gt;
The most flexible way to transfer files and commands to and from the SBC is via a program called &#039;&#039;&#039;ssh&#039;&#039;&#039;.  The ssh program provides command line text access over a network into the SBC.  Using it, you can run programs and give the SBC commands.  The ssh program has a companion program called &#039;&#039;&#039;scp&#039;&#039;&#039; which can copy files back and forth.  If you are unfamiliar with ssh, you can think of it like the command line or a Mac terminal, but with a remote connection to a different computer.  It is a minimal yet effective way to interact with a remote computer.&lt;br /&gt;
&lt;br /&gt;
Before connecting over ssh, you will need:&lt;br /&gt;
* The &#039;&#039;&#039;IP address&#039;&#039;&#039; (such as 168.254.3.0) or &#039;&#039;&#039;link local address&#039;&#039;&#039; (such as phidgetsbc.local) of the SBC&lt;br /&gt;
* The &#039;&#039;&#039;admin password&#039;&#039;&#039; for the SBC&lt;br /&gt;
Both of these items can be found by following the steps in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].&lt;br /&gt;
&lt;br /&gt;
You will also need to enable SSH on the SBC side.  This can be done through the [[#SBC Web Interface| Web Interface]], under {{Code|Network &amp;amp;rarr; Settings}}, by changing the &#039;&#039;SSH Server&#039;&#039; radio button to &#039;&#039;Enabled&#039;&#039; and saving your changes:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_turn_on_ssh.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
=====SSH on Windows=====&lt;br /&gt;
&lt;br /&gt;
The ssh program is not installed on Windows by default.  But, there are a variety of SSH programs available for free. One simple and commonly used program is [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY], and it has the advantage that the executable doesn&#039;t need to install, it just runs.&lt;br /&gt;
&lt;br /&gt;
With PuTTY, when you first run the program it will ask you what to connect to.  Enter the IP address or link local address of the SBC, and then click the SSH radio button right below the address, which will change the port to 22.  Then click open, and you&#039;ll have an ssh connection to the SBC open in a terminal.  It will prompt you for a user name ({{Code|root}}) and password (the admin password).&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, there is an SCP component to PuTTY, called PSCP, which is available from the same [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY download page].  Use of PSCP will be similar with the address, username, and password, except that you will be transferring files instead of sending commands.&lt;br /&gt;
&lt;br /&gt;
=====SSH on Linux and Mac OS=====&lt;br /&gt;
&lt;br /&gt;
Linux and Mac OS already have ssh installed by default.  To run ssh simply open a terminal...&lt;br /&gt;
* {{Code|Ctrl-Alt-T}} on Linux &lt;br /&gt;
* {{Code|Applications &amp;amp;rarr; Utilities &amp;amp;rarr; Terminal}} on Mac OS &lt;br /&gt;
...and type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
ssh root@phidgetsbc.local&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have re-named your SBC, include that name instead of the {{Code|phidgetsbc.local}} link address.  Or, you can use the SBC&#039;s IP address, e.g. something like {{Code|ssh root@168.254.3.0}}&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, the command follows the form of: {{Code|scp from to}}&lt;br /&gt;
&lt;br /&gt;
So, to copy a file {{Code|/root/data.txt}} from the SBC to your local machine, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
scp root@phidgetsbc.local:/root/data.txt .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note the use of the dot &#039;&#039;&#039;.&#039;&#039;&#039; to indicate that scp should put the file in the current local directory.   If you&#039;re not sure what folder the terminal is operating in type {{Code|pwd}} to print the working directory.  Terminals usually start by default in your home folder.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - The SBC (Debian Linux)===&lt;br /&gt;
&lt;br /&gt;
The SBC runs Linux, which is a full operating system. It is stripped down compared to a full desktop release of Linux, but you can compile code on it, run programs, schedule tasks, create and manage files, run a web server, and much, much more.&lt;br /&gt;
&lt;br /&gt;
At this point you have connected to the SBC via the [[#SBC Web Interface|web interface]], and probably also through [[#SSH|SSH]].  This section will help you install libraries and drivers that you probably want - i.e. support for C, Java, and Python.  After this section, you&#039;ll be well into the depths of using the SBC as a computer, and so you&#039;ll probably want to keep the [[#Using SBC Linux|Using SBC Linux section]] open for reference while you work if you are not already familiar with Linux.&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the following Phidget functionality installed:&lt;br /&gt;
* The Phidget C libraries {{Code|libphidget21.so}}&lt;br /&gt;
* The Phidget [[#WebService | WebService]]&lt;br /&gt;
(If you are simply curious what these are and how they get installed, we describe the process on the [[OS - Linux | general Linux page]].)&lt;br /&gt;
&lt;br /&gt;
But to compile C programs, or run Java programs, or use Python, you will need to install these languages onto the SBC.  &lt;br /&gt;
&lt;br /&gt;
Before installing anything on the SBC, however, (even via a button on the web interface) make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
====Installing C/C++ and Java====&lt;br /&gt;
&lt;br /&gt;
The simplest way to install C/C++  and Java on the SBC is via the web interface.  There is a button under {{Code|System &amp;amp;rarr; Packages}} to install C support (including {{Code|gcc}}) and another button to install Java support:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_packages_web.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
You have to check that you are running the same version of Java on your development machine (where you plan on compiling the java programs) as the SBC is running. To do this type the following into the terminal on your computer and from ssh on the SBC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
Java -version&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need to update the version of Java on your SBC, use the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install openjdk-7-jre-headless&lt;br /&gt;
su&lt;br /&gt;
update-alternatives --config java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you&#039;re ready to begin programming.  We have programming pages for both [[Language - C/C++|C/C++]] and for [[Language - Java|Java]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].  &lt;br /&gt;
&lt;br /&gt;
If you want to avoid using the [[#SSH|SSH]] interface on the SBC entirely, and you want to write your program in Java and run it continuously from boot (which is the only option if you want to avoid [[#SSH|SSH]]), we have a [[#Program in Java with the Web Interface|very in-depth section]] on that topic.&lt;br /&gt;
&lt;br /&gt;
====Installing Python====&lt;br /&gt;
&lt;br /&gt;
Installing Python has two steps.  First, you&#039;ll need to install the basic ability to run python, and then you&#039;ll need to install the Phidget Python module.  Both steps (and both options) require that you issue the relevant commands through an [[#SSH|SSH terminal]].&lt;br /&gt;
&lt;br /&gt;
=====Basic Python=====&lt;br /&gt;
&lt;br /&gt;
The base Python functionality can be downloaded and installed in one step with [[#apt|apt]] (i.e. in a terminal, type):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will give you Python, and now you just have to install the Phidget Python module to gain Phidget functionality. If the installation fails because it can&#039;t find python, you need to enable the full repository as described in [[#Getting Started_-_The_SBC_(Debian_Linux)|this section]], and then perform an apt-get update.&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 1: Use a USB Key=====&lt;br /&gt;
&lt;br /&gt;
Copy the [{{SERVER}}/downloads/libraries/PhidgetsPython.zip Python Libraries] onto a USB key.  Unpack the zip file into a folder on the USB key.  Insert the key into the SBC.&lt;br /&gt;
&lt;br /&gt;
You will have to figure out where the USB key (and the Phidget Python library folder) is now located.  We describe how in the general [[#Using USB Data Keys | Using USB Data Keys]] section.&lt;br /&gt;
&lt;br /&gt;
After you know the place where the USB key is mounted, in a terminal go to that directory (e.g. type {{Code|cd /media/usb0/}}), enter the unpacked Phidget Python Library folder, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have an whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 2: Use the Internet=====&lt;br /&gt;
&lt;br /&gt;
Rather than using a USB key to transfer the file, the SBC can download it directly from the internet.  You will need {{Code|wget}} and {{Code|unzip}} installed, both of which are small:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install wget&lt;br /&gt;
apt-get install unzip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the web link address for the [{{SERVER}}/downloads/libraries/PhidgetsPython.zip Python Libraries].&lt;br /&gt;
&lt;br /&gt;
In an SSH terminal to the SBC, type: {{Code|wget http://www.python_library_link}} where instead of http://www.python_library_link you insert the link you just copied. Copying into a terminal can usually be done via the right-click menu.&lt;br /&gt;
&lt;br /&gt;
This will download the Phidget python libraries to the folder you ran the {{Code|wget}} command in.  Unzip the downloaded file using the command {{Code|unzip file}}, where file is the filename from {{Code|wget}}. Or try typing {{Code|ls}} to list the names of a file in the directory, which should include the unzipped folder.  Enter the unzipped folder (e.g. use {{Code|cd}} to change directory), and install the Phidget Python libraries:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have a whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
====Installing Other Languages====&lt;br /&gt;
&lt;br /&gt;
You may also be able to program on the SBC using [[Language - Ruby|Ruby]] and [[Language - C Sharp|C# under Mono]], though we do not offer in-depth support for these languages on the SBC.  The installation procedures should more or less follow that of [[#Installing Python|installing python]] on the SBC, except you will be installing Ruby or Mono.  Performing package searches using [[#apt|apt cache search]] can help you find the relevant software.&lt;br /&gt;
&lt;br /&gt;
For C#, as of 2012 the {{Code|mono-complete}} package is broken on the Debian Squeeze repository.  Rather, you have to install the Mono runtime and Mono compiler separately.&lt;br /&gt;
&lt;br /&gt;
To install the runtime package (and its dependencies), use [[#apt|apt]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-runtime&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to install the C# compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-gmcs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or the Visual Basic compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-vbnc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, the system and library packages do not link correctly for the version 2.0 of Mono.  If this is the case, your code will compile fine, but when you try to run it, you will get an error like:&lt;br /&gt;
&lt;br /&gt;
:{{Code|The assembly mscorlib.dll was not found or could not be loaded.}}&lt;br /&gt;
:{{Code|It should have been installed in the `/usr/lib/mono/1.0/mscorlib.dll&#039; directory.}}&lt;br /&gt;
&lt;br /&gt;
In this case, you need to install these two packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libmono-corlib1.0-cil&lt;br /&gt;
apt-get install libmono-system1.0-cil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we found these packages to work by working through the tree structure.  As a general rule, you can find these dependencies by using install (here, {{Code|apt-get install mono-complete}}) to get a sense of the package tree structure.  This will possibly tell you that the packages are broken, but at the same time this will list the dependencies of the packages.  Trying to install individual dependencies will show you that although a root-package fails, the sub-packages will sometimes succeed, and install what you need.&lt;br /&gt;
&lt;br /&gt;
If you want to use a specific dll or library that is not available in this reduced version of mono, you can install mono complete by switching from Emdebian+Debian to just Debian.  To do this:&lt;br /&gt;
&lt;br /&gt;
In {{Code|/etc/apt/preferences}} make the following changes:&lt;br /&gt;
:{{Code|Package: *}}&lt;br /&gt;
:{{Code|&amp;lt;nowiki&amp;gt;Pin: release a=stable&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
:{{Code|Pin-Priority: 1010}}&lt;br /&gt;
	&lt;br /&gt;
In {{Code|/etc/apt/sources.list/mutistrap-debian.list}} remove the emdebian line.&lt;br /&gt;
&lt;br /&gt;
Apply the changes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get dist-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many packages will be &#039;downgraded&#039; from the emdebian to debian versions.  Delete the {{Code|&amp;lt;nowiki&amp;gt;/etc/apt/preferences&amp;lt;/nowiki&amp;gt;}} file and install mono-complete:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install monodoc-http mono-complete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Choose monodoc-http explicitly, because otherwise the install fails on monodoc-browser.&lt;br /&gt;
&lt;br /&gt;
After this process, you can compile your C# Code.cs Phidget source file the same way as on a generic [[Language - C Sharp#Linux|Linux with Mono]] system.  Please refer to that page on how to obtain the *.dll Phidget resource file and compile your code.  On the SBC, however, because you are already running as root (the Super User), you do not need &#039;sudo&#039; and indeed the SBC will give you an error if you use it.  Instead, compiling and running will look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
gmcs Code.cs -r:Phidget21.NET.dll&lt;br /&gt;
mono Code.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using SBC Linux==&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve set up communication with the SBC, and installed whichever programming language support you need, you&#039;re probably ready for a short tour of useful tools on the SBC&#039;s version of Linux.&lt;br /&gt;
&lt;br /&gt;
First, you will by default be running on the SBC as &#039;&#039;&#039;root&#039;&#039;&#039;, which is the super-user.  For Linux users, this probably makes you nervous because you know you can overwrite important system files without the system asking for additional permission.  As a Windows or Mac OS user - although you may usually run your computer as an administrator - your familiar system usually prompts you to confirm before you do anything really dangerous, and this will &#039;&#039;&#039;not&#039;&#039;&#039; happen on the SBC as the root user.&lt;br /&gt;
&lt;br /&gt;
Next, there is no installed help on the SBC.  Help on Linux is usually called &#039;man pages&#039; which is short for &#039;the manual pages&#039;.  On a full Linux system, usually if you need help with any command you can type, for example, {{Code|man ls}} and it will give you help with the program [[#ls|ls]].  But these help pages take up significant space, and they are widely available online.  So, if you need more help with a certain command, you can always type {{Code|man command}} into your favourite search engine.&lt;br /&gt;
&lt;br /&gt;
Finally, the SBC has no windowing system.  For Linux users, this means no X-windows (Gnome, KDE, etc).  And as a Windows or Mac user, you can think of it as running all of your programs and commands through the terminal or DOS prompt command line.  The SBC provides all of the functionality of an operating system (e.g. process scheduling, file management, etc) but without any graphical interface.  The only exception is the [[#SBC Web Interface|web interface]], which gives graphical access to a limited part of what the SBC can do.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands===&lt;br /&gt;
&lt;br /&gt;
If you are doing more with the SBC than simply running pre-written programs [[#Writing a Phidget Program|in Java to run continuously from boot]], you will be interacting with the SBC&#039;s Linux operating system over the command line by using [[#SSH|SSH]].  This section discusses useful programs already installed on the SBC, and how to run them on the command line.&lt;br /&gt;
&lt;br /&gt;
====ls====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;ls&#039;&#039;&#039; program lists the contents of a directory.&lt;br /&gt;
&lt;br /&gt;
It will show both files and folders, but not files that start with a &amp;quot;.&amp;quot; (these are hidden files on Linux).&lt;br /&gt;
*If you also want to show hidden files, use {{Code|ls -a}}&lt;br /&gt;
*If you want more information, such as size and date modified, use {{Code|ls -l}}&lt;br /&gt;
*Commands can be combined, like {{Code|ls -al}}&lt;br /&gt;
&lt;br /&gt;
====cd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cd&#039;&#039;&#039; program changes to a new directory.&lt;br /&gt;
&lt;br /&gt;
For example, {{Code|cd /root}} changes into the directory at the base of the file tree called &#039;&#039;root&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* Linux uses forward slashes&lt;br /&gt;
* The base of all directories is &amp;quot;/&amp;quot; (not &amp;quot;C:\&amp;quot;)&lt;br /&gt;
* The tilde symbol (~) is short for your home directory (i.e. when you are root, this is short for &amp;quot;/root&amp;quot;)&lt;br /&gt;
* The double dot &amp;quot;..&amp;quot; means move one directory higher (for example from {{Code|/root/data/}} to {{Code|/root/}})&lt;br /&gt;
&lt;br /&gt;
====pwd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;pwd&#039;&#039;&#039; program prints the current directory you are working in.  (&#039;P&#039;rint &#039;W&#039;orking &#039;D&#039;irectory)&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
:{{Code|root@phidgetsbc:~# pwd}}&lt;br /&gt;
:{{Code|/root}}&lt;br /&gt;
&lt;br /&gt;
====cp, mv, and rm====&lt;br /&gt;
&lt;br /&gt;
These programs are copy (&#039;&#039;&#039;cp&#039;&#039;&#039;), move (&#039;&#039;&#039;mv&#039;&#039;&#039;), and remove (&#039;&#039;&#039;rm&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Copy copies a file from one location and pastes it to another.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|cp data.txt data_backup.txt}} will put a copy of the file {{Code|data.txt}} into {{Code|data_backup.txt}}&lt;br /&gt;
&lt;br /&gt;
Move moves a file (this is also useful for renaming files) to a new destination.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|mv data.txt data_backup.txt}} will put the contents of {{Code|data.txt}} into {{Code|data_backup.txt}}, and then will remove {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Remove deletes a file.&lt;br /&gt;
&lt;br /&gt;
For example, typing {{Code|rm data.txt}} will delete {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Note that &#039;&#039;&#039;rm&#039;&#039;&#039; is final.  Once you remove a file using {{Code|rm}}, it is gone forever.  There is no recycle bin, no temporary trash, nothing other than backups you may have personally created in the past!&lt;br /&gt;
&lt;br /&gt;
Directories can only be removed with {{Code|rmdir}}, and then only if they are empty.  If you want to remove a directory and all the files in it, use {{Code|rm -rf directory}} but be &#039;&#039;&#039;very, very careful&#039;&#039;&#039; with this command.  Trying to remove everything within a directory (e.g. {{Code|rm -rf *}}) is one of the most dangerous commands you can run on a Linux system, as running it from the wrong directory will result in Linux happily removing everything under that directory -- which could be your entire filesystem.&lt;br /&gt;
&lt;br /&gt;
====find====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;find&#039;&#039;&#039; program does what it says - it finds things.  &lt;br /&gt;
&lt;br /&gt;
Unfortunately for the casual user, the find program is very flexible and powerful, and thus not especially intuitive to use.  But, here are some examples:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|find folder -name file.txt}}&lt;br /&gt;
| Looks for all files in a folder (/ for root - or all - folders) with a certain name (* for wildcard)&lt;br /&gt;
| {{Code|find / -name *.jpg}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|find folder -mtime +X}}&lt;br /&gt;
| Looks for all files in a folder modified less than X days ago&lt;br /&gt;
| {{Code|find /root -mtime +30}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====grep====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;grep&#039;&#039;&#039; program takes text input and searches for a term. &lt;br /&gt;
&lt;br /&gt;
For example, if you type {{Code|mount}} to view what devices are mounted (e.g. loaded) on your SBC, you will see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may be a lot of information you don&#039;t need.  If you are only interested in a USB key attachment (as described in the [[#Using USB Data Keys|Using USB Data Keys]] section), you can use grep to filter that one response:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep sda1&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====nano====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;nano&#039;&#039;&#039; program is a small text editor that you can use within an SSH terminal. &lt;br /&gt;
&lt;br /&gt;
Nano can be surprisingly useful for writing short lengths of code right on the SBC, so there is no need to transfer files and keep track of different file versions on different computers.&lt;br /&gt;
&lt;br /&gt;
Nano has all keyboard commands which are listed at the bottom of the screen at all times as a reminder (Ctrl-O to save, Ctrl-X to exit, these expand with a larger terminal window).  And, nano provides what is called &#039;syntax highlighting&#039;, which colours reserved keywords, comments, strings, and so on as appropriate to the programming language you are using.  Nano detects the programming language via the extension of the file ({{Code|.java}} for Java, {{Code|.c}} for C/C++, and {{Code|.py}} for Python).&lt;br /&gt;
&lt;br /&gt;
Typing {{Code|nano test.py}} on an SSH command line and then entering a few lines of Python into the new empty file results in:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_nano_python.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
====apt====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;apt&#039;&#039;&#039; program allows you to install, uninstall, upgrade, and search software available for the SBC.&lt;br /&gt;
For a non-Linux user, the apt framework may be daunting at first, but it actually allows you to keep your system up to date and install and manage software quickly, easily, and for free.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Before installing anything on the SBC, make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-cache search term}}&lt;br /&gt;
| Looks for all programs (packages) that have {{Code|term}} in the title or description&lt;br /&gt;
| {{Code|apt-cache search opencv}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-cache show package}}&lt;br /&gt;
| Shows a lot of data about {{Code|package}} including size, version, etc&lt;br /&gt;
| {{Code|apt-cache show unzip}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-get update}}&lt;br /&gt;
| Gets the most recent listing of available software&lt;br /&gt;
| {{Code|apt-get update}}  (No options)&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-get install program}}&lt;br /&gt;
| Installs {{Code|program}} from the internet&lt;br /&gt;
| {{Code|apt-get install python}}&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====mount====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|mount}} shows you all of the mounted devices on your SBC.  &lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the non-Linux user, the concept of a device may be quite strange.  To give a short summary, everything on Linux that you can read or write is a file.  Webcams are files (i.e. you can &#039;read&#039; photos from them), USB keys are files, and each filesystem (tmp storage, the kernel portion, the main filesystem) are also themselves files.  These files specify what and how something can be written.  These are not necessarily linear, for example, you can see above that the USB key ({{Code|/media/usb0}} is mounted &#039;&#039;within&#039;&#039; the root file system {{Code|rootfs}} which is /.   &lt;br /&gt;
&lt;br /&gt;
So mount gives you an idea of what devices have been &#039;mounted&#039; for reading or writing, and how you can read and write to them.  More information on mount (and its various forms, like {{Code|umount}}) is available widely around the Internet.&lt;br /&gt;
&lt;br /&gt;
====which====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|which}} tells you if and where a program is installed.&lt;br /&gt;
&lt;br /&gt;
For example, on a default SBC, typing {{Code|which python}} will return no results.  But after successfully [[#Installing Python | installing python]], it will return {{Code|/usr/bin/python}} as the location of the python program/binary/executable.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands to Install===&lt;br /&gt;
&lt;br /&gt;
These are other programs you may find useful on the command line.  Although they are not on the SBC by default, these and other programs can usually be installed simply by using [[#apt|apt-get install]], with the exception of gcc.  For example, {{Code|apt-get install wget}} will download and install [[#wget|wget]].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This section and the section on [[#Some Useful Commands|pre-installed commands]] can hardly cover all of the complexities and power of the Linux operating system.  There are many excellent tutorials online, and between them and using [[#apt|apt]] to find and install programs you should be able to learn a lot and perform any number of complex useful tasks.&lt;br /&gt;
&lt;br /&gt;
====gcc====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;gcc&#039;&#039;&#039; program is the C compiler for Linux.&lt;br /&gt;
&lt;br /&gt;
If you are an experienced C/C++ user on Mac or Linux, or if you&#039;ve already read our [[Language - C/C++ | C Language page]], you might think you need to install gcc via {{Code|apt-get}} to compile C code.  However, gcc is not in the package repository for the SBC, so {{Code|apt-get install gcc}} will fail.  Rather, to install gcc, you can do it via the web interface, as described in the [[#Installing C/C++ and Java|Installing C/C++ and Java]] section.&lt;br /&gt;
&lt;br /&gt;
After installing it via the SBC web interface, you can use {{Code|gcc}} normally.&lt;br /&gt;
&lt;br /&gt;
====less====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;less&#039;&#039;&#039; program displays the contents of a text or source code file.  When displaying the file, {{Code|less}} allows you to scroll up and down to read it.&lt;br /&gt;
&lt;br /&gt;
This is useful if you are writing your sensor readings to a data file, and you want to read the data file while it is being written by your main code.  If your data file is called {{Code|data.txt}}, you can type {{Code|less data.txt}} and see the lines in the file, and what they are.&lt;br /&gt;
&lt;br /&gt;
The {{Code|less}} program output can also be piped into another program.  For example, you can use {{Code|less}} and the word search program {{Code|grep}} to find lines within a file with a search term.  For instance, if you have a C source code file {{Code|Program.c}} on the SBC, and you want to see all the lines in {{Code|Program.c}} that contain a variable name {{Code|var}}, you can type: &lt;br /&gt;
:&amp;lt;code&amp;gt;less Program.c | grep var&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====wget====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;wget&#039;&#039;&#039; program allows you to get an online file (over http) and download it to the SBC.&lt;br /&gt;
&lt;br /&gt;
For example, to get the source file (HTML) from the Phidgets home page, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
wget http://www.phidgets.com&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is most useful for downloading libraries, drivers, or anything (zip, tar, etc) you need from the web which is not available by [[#apt|using apt]].&lt;br /&gt;
&lt;br /&gt;
===Writing a Phidget Program===&lt;br /&gt;
&lt;br /&gt;
We provide two ways to write and upload a Phidget Program:&lt;br /&gt;
# The [[#SBC Web Interface|web interface]]:&lt;br /&gt;
#* This is useful for simple projects written in Java that you want to start only at boot&lt;br /&gt;
#* You can also use C projects, but they must be compiled off the SBC for an ARM processor&lt;br /&gt;
# Over [[#SSH|SSH]], which will allow you to write or transfer source code directly to and from the SBC&lt;br /&gt;
#* This is useful for all other projects, such as:&lt;br /&gt;
#** Projects that run at scheduled times (e.g. once per minute)&lt;br /&gt;
#** Projects that use languages other than Java or ARM-compiled C&lt;br /&gt;
Note that you can still run an [[#SSH|SSH]] project at boot, you just have to write and install a startup script.  This is a bit complex, but we do have an example that starts the program {{Code|phidgetwebservice21}} [[OS - Linux#As A Service|at boot using a script]].&lt;br /&gt;
&lt;br /&gt;
Once you know which method you&#039;d like to use, you can continue on to learn how to [[#Program in Java with the Web Interface|Program in Java with the Web Interface]], or how to [[#Program with SSH|Program with SSH]] using Java, C, or Python.  If you are actually typing in source code on the SBC, you&#039;ll find our [[#Developing Code on the SBC|developing code on the SBC section]] useful.&lt;br /&gt;
&lt;br /&gt;
====Program in Java with the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To show how to write, compile, and install Java programs on the SBC, we&#039;ll use the [[Language - Java|Java Hello World]] example code.  You can download the HelloWorld example by downloading the whole [{{SERVER}}/downloads/examples/JavaJNI.zip Java example package].  Make sure you have the same version of [[#Installing C/C++ and Java|Java installed on the SBC]] as you have on your external development machine. Instruction for checking and updating are found on the [[#Installing C/C++ and Java|installation page]].&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how to get the HelloWorld code running on the SBC.  On your external computer:&lt;br /&gt;
&lt;br /&gt;
1. Download the SBC version of the Phidget Java libraries ({{Code|phidget21.jar}}).  You can download this from the [[#SBC Web Interface|web interface]], on the page under {{Code|Projects &amp;amp;rarr; Projects}}, under the &#039;&#039;&#039;Notes&#039;&#039;&#039; section.&lt;br /&gt;
&lt;br /&gt;
2. Place the SBC version of {{Code|phidget21.jar}} into a directory on your external computer.  This will be your working directory that you will use to compile the Java files.&lt;br /&gt;
&lt;br /&gt;
3. Also copy the {{Code|HelloWorld.java}} file into that working directory.&lt;br /&gt;
&lt;br /&gt;
4. Compile the {{Code|HelloWorld.java}} file from within that working directory.  From the command line prompt on Windows, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .;phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In a terminal on Linux or Mac OS, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. You should now have three compiled class files: {{Code|HelloWorld.class}}, {{Code|HelloWorld$1.class}}, and {{Code|HelloWorld$2.class}}.  You don&#039;t need to try and run them, and if you do you may encounter an error because the SBC {{Code|phidget21.jar}} may be slightly different than the Phidget support you have installed on your external computer.&lt;br /&gt;
&lt;br /&gt;
Now we move onto the SBC:&lt;br /&gt;
&lt;br /&gt;
6. Create a new project on the SBC, in the web interface under {{Code|Projects &amp;amp;rarr; Projects}}.  Call it HelloWorld:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_create_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
7. On the next screen, you will be prompted to upload your files.  We will upload the three Java class files, and then click the {{Code|Start}} button:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_web_run_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
8. You&#039;ll note that as it runs, there are two links below the {{Code|Stop}} button: One called {{Code|stdout}}, which is &#039;&#039;Standard Output&#039;&#039;, and one called {{Code|stderr}}, which is &#039;&#039;Standard Error&#039;&#039;.  Usually, when you run a program on the command line, you see both standard out and standard error at the same time - i.e. you get all program output right there in your terminal or command prompt.  But when running a program in the background, Linux splits the output up into normal output and error output as this is very useful for debugging (i.e. you can check if standard error is empty).  &lt;br /&gt;
&lt;br /&gt;
Here, however, if you&#039;re not sure whether the program will run correctly, you should first check {{Code|stderr}} to see if any errors were generated, and then check {{Code|stdout}} to see if the output looks as expected.&lt;br /&gt;
&lt;br /&gt;
To write your own Java program, follow the same process but use your own source code instead of the {{Code|HelloWorld.java}} example.&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, we offer additional help on [[#Via the Web Interface|running a program automatically using the web interface]].&lt;br /&gt;
&lt;br /&gt;
====Program with SSH====&lt;br /&gt;
&lt;br /&gt;
Similarly to starting a program via the [[#Program in Java with the Web Interface|web interface]], we use the Phidget Java {{Code|HelloWorld}} example here.&lt;br /&gt;
&lt;br /&gt;
Make sure you have [[#Installing C/C++ and Java|Java installed on the SBC]].  To compile and run the {{Code|HelloWorld}} example:&lt;br /&gt;
&lt;br /&gt;
1. Open an [[#SSH|SSH terminal]] to the SBC&lt;br /&gt;
&lt;br /&gt;
2. Download the [{{SERVER}}/downloads/examples/JavaJNI.zip Phidget Java Examples] to the SBC, using [[#wget|wget]] (you may need to install {{Code|wget}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
3. Unpack the examples using [[#unzip|unzip]] (you may need to install {{Code|unzip}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
4. The location of {{Code|phidget21.jar}} on the SBC is {{Code|/usr/share/java/phidget21.jar}}.  Within the unzipped example directory, compile the {{Code|HelloWorld.java}} example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:/usr/share/java/phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. To run the {{Code|HelloWorld}} program, use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
java -classpath .:/usr/share/java/phidget21.jar HelloWorld&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, you&#039;ll probably want to learn to [[#Running a Program Automatically|run this Java program automatically]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; If you&#039;re used to using Linux with Phidgets already, you&#039;ll probably notice that you don&#039;t need to switch into root using {{Code|sudo}} on the SBC in order to run programs.  This is because you already are running as root, not because the [[OS - Linux#Setting udev Rules|udev rules are set up]].  So if you set up another user, or [[#Via Cron|run a cron job]] as anything other than root or system, you&#039;ll need to add permission for the Phidget program to run in your [[OS - Linux#Setting udev Rules|udev rules]].&lt;br /&gt;
&lt;br /&gt;
====Developing Code on the SBC====&lt;br /&gt;
&lt;br /&gt;
When you&#039;re not just using pre-written source code, and you&#039;re writing code actually on the SBC itself, you&#039;ll probably want to use [[#nano|nano]].  Other terminal editors on the SBC include {{Code|vi}} which is already installed, and {{Code|emacs}}, which you can install using [[#apt|apt]].  Both {{Code|vi}} and {{Code|emacs}} are much more efficient for the experienced user, but they contain modes and keyboard shortcuts that can seem strange or almost hindering to the casual user.&lt;br /&gt;
&lt;br /&gt;
Regardless of which editor you choose to use, some of your keyboard habits may not transfer well.  For example, in the Linux command line, the command {{Code|Ctrl-C}} means &#039;&#039;stop the currently running program&#039;&#039;, (i.e. your open editor) not copy.  Within most SSH terminals, you can copy and paste using the right-mouse button, and on some terminals (and all native Linux terminals) you can copy by simply highlighting text, and you can paste it using the middle (scroll) mouse button.  On the other hand, if you write a program that hangs on the command line, {{Code|Ctrl-C}} can actually be useful to terminate it.&lt;br /&gt;
&lt;br /&gt;
Also {{Code|Ctrl-Z}} does not mean &#039;&#039;undo&#039;&#039;, rather it means &#039;&#039;run the current program in the background&#039;&#039;.  This is useful because running a program in an SSH terminal simply hangs your SSH input until the program is done.  So typing {{Code|Ctrl-Z}} while the program is running frees up the command line for more input.  But if you accidentally hit {{Code|Ctrl-Z}} while running an editor like [[#nano|nano]], the editor will immediately exit to the command line.  Don&#039;t worry though, it will not stop or lose your work.  You can bring it back up by using the {{Code|fg}} (e.g. &#039;foreground&#039;) command, like {{Code|fg nano}}, and this will automatically bring your nano process back to the front.&lt;br /&gt;
&lt;br /&gt;
===Running a Program Automatically===&lt;br /&gt;
&lt;br /&gt;
For testing your program, you will certainly want to run it via [[#SSH|SSH]] or via the {{Code|Start}} button on the project page on the web interface until you are quite sure it runs well.  However, eventually you will probably want the program to run without your input, either [[#Via the Web Interface|continuously, and starting at boot]], or via a task scheduled to [[#Via Cron|run to completion at certain times]].&lt;br /&gt;
&lt;br /&gt;
Both have their advantages and disadvantages.  Usually, you would want to use the continuous, from-boot methods for event driven code that has to handle a wide variety of user input that could occur at any time.  You would want to use the scheduled method when the SBC needs to perform a repeated task (e.g. reading sensor data) again and again.  The main difference is:&lt;br /&gt;
* With the continuous (boot) method you can have any Phidgets (including sensors, LEDs, input switches, etc) attached and giving events to your code all the time, and&lt;br /&gt;
* With the scheduled (cron) method you have much less of a chance to run into long-term memory management and instability problems with any code you write, because your program runs for only a short time before exiting and getting cleaned up.&lt;br /&gt;
&lt;br /&gt;
====Via the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To use this method, you must have created the program you want to run as [[#Program in Java with the Web Interface | a Java or ARM-compiled C project in the web interface]].  If you would like to use another language, or another way of uploading your project, but you still want to start at boot and run continuously, you will need to use a [[#Via a Boot Script|boot script]].&lt;br /&gt;
&lt;br /&gt;
In the web interface, go to the {{Code|Projects}} tab, and click on the project you would like to run.  Near the bottom of the project page (the one with the {{Code|Start}} and {{Code|Stop}} buttons at the top), there will be a section called {{Code|Startup Settings}}.  You can see a screenshot of the whole project page, including these settings, in the [[#Program in Java with the Web Interface | web interface project section]].&lt;br /&gt;
&lt;br /&gt;
Select the {{Code|Enabled}} radio button.  The other defaults should be fine, unless you specifically know otherwise:&lt;br /&gt;
* For &#039;&#039;Boot Order&#039;&#039;, lower numbers boot first.  Booting later means more programs are available for use, booting earlier means other programs can use your program.  &lt;br /&gt;
* &#039;&#039;Run as a daemon&#039;&#039; starts the program as a daemon, which is a program that runs in the background.  Unless you have &#039;&#039;explicitly&#039;&#039; written your program as a daemon, leave this checked.  (If you don&#039;t know what a daemon is, don&#039;t worry, you haven&#039;t written one, so leave it checked.)  &#039;&#039;Un&#039;&#039;checking this when your program is a normal program will cause the SBC to hang while booting.&lt;br /&gt;
* The &#039;&#039;Executable or Class&#039;&#039; name should be automatically sensed to be your main Java class&lt;br /&gt;
* &#039;&#039;Arguments&#039;&#039; are any command line arguments you need, just as you would type them into the command line&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Your program must be very, very stable to run properly via the web interface.  Imagine your program running continuously for days, or months on end.  Any memory leaks, over time, will render your program (and the SBC) unusable until a reboot.  Counts or other variables that increase within your program and never reset may create a segmentation fault eventually.&lt;br /&gt;
&lt;br /&gt;
If, for stability purposes, you want your program to start, run for a little while, and then exit so that the SBC operating system can clean up the memory each time, you&#039;ll probably want to use [[#Via Cron|Cron]] to run your program instead.&lt;br /&gt;
&lt;br /&gt;
====Via Cron====&lt;br /&gt;
&lt;br /&gt;
Cron can automatically schedule programs - known as &#039;jobs&#039;, or &#039;cron jobs&#039; - at most once per minute.  Less often than that, it is very flexible, allowing you to run it on certain months, weekdays, hours, etc.  Cron simply reads a special file (your {{Code|crontab}}) and runs whatever programs are listed, with whatever timing they are listed with.  The cron program runs all the time in the background, making it what is known as a Linux &#039;&#039;daemon&#039;&#039;, but the programs it starts as jobs run only as long as they naturally would, and then they exit.&lt;br /&gt;
&lt;br /&gt;
If you need your program to run more often than once per minute, have the program schedule itself while still running.  For example, to run every five seconds, run a fast loop,  and sleep for five seconds. Do this twenty times and exit.  Then schedule this once per minute using cron, and your program will in essence run every five seconds.&lt;br /&gt;
&lt;br /&gt;
Setting up a cron job simply entails editing your {{Code|crontab}} file.&lt;br /&gt;
&lt;br /&gt;
First, you&#039;ll probably want to specify your default editor to be [[#nano|nano]]. Otherwise it will default to {{Code|vi}} and you&#039;ll have to figure out {{Code|vi}} in order to add lines to your crontab:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
export EDITOR=nano&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to edit your crontab file, simply type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
crontab -e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each line of the crontab file is one scheduled job.  Lines that start with a hash &amp;quot;#&amp;quot; are comments and are ignored.  There is an example line in the crontab, and a reminder line at the very end.  Essentially, each line should contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
minute hour dayOfMonth month dayOfWeek  command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*{{Code|command}} is the program you want to run (with absolute path, and arguments)&lt;br /&gt;
** For example, {{Code|./myprogram argument1}} won&#039;t work, but {{Code|/root/code/myprogram argument1}} will&lt;br /&gt;
* Each time argument is either a number, a list of numbers separated by commas, or an asterisk&lt;br /&gt;
** For example, * * * * * means every minute for all days and months, 0,30 * * * * means every thirty minutes (i.e. at the top of the hour and at 30 minutes in) for all days and months&lt;br /&gt;
&lt;br /&gt;
If you already have jobs scheduled, you&#039;ll see them in the file that comes up.  You can edit, add, or delete.  &lt;br /&gt;
&lt;br /&gt;
After you save, you&#039;ll see a little message back in the terminal that says the new crontab file was installed, and it is now scheduled!  Cron always starts every boot, and so if you have edited and installed your crontab as above, the scheduling of your program will start properly even after a reboot of the SBC.  However, if you are having strange scheduling problems, you may want to familiarize yourself with the [[#Software Details|software details]] of how the SBC as a whole determines the current date and time.&lt;br /&gt;
&lt;br /&gt;
=====My Cron Job Doesn&#039;t Work!=====&lt;br /&gt;
&lt;br /&gt;
It is actually very common for a script or program to work on the command line but then &#039;&#039;not&#039;&#039; work as a cron job.  The most common reason for this, by far, is that you specify &#039;&#039;relative&#039;&#039; paths in your program to access files rather than &#039;&#039;absolute&#039;&#039; paths.  For example:&lt;br /&gt;
* {{Code|code/project.c}} is a relative path (bad for cron)&lt;br /&gt;
* {{Code|/root/code/project.c}} is an absolute path (good for cron)&lt;br /&gt;
The cron jobs are &#039;&#039;not&#039;&#039; executed from your home directory, or your code directory, so they will not be using the same location you may be using to test your code.  So always use absolute paths.&lt;br /&gt;
&lt;br /&gt;
Another common reason is you may be using environment variables or other settings that are true in a terminal but are &#039;&#039;not&#039;&#039; true by default in the raw system.  You can end up taking many things for granted in a shell, for example the shortcut &amp;quot;~&amp;quot; means home directory in a shell, but not by default in the raw system.  The things that get loaded for a shell (but which are not present in the raw system) are:&lt;br /&gt;
* The settings loaded by {{Code|/etc/profile}}&lt;br /&gt;
* Any settings in {{Code|~/.bashrc}}, which is nothing by default on the SBC&lt;br /&gt;
&lt;br /&gt;
On a full Linux operating system, you would use the logs written to by cron to find the error output and debug it.  On the SBC, however, cron does not write logs (otherwise, these logs would eat up the SBC memory very quickly even for routine jobs).  For short-term debugging, you can write output from your program to a file, and read that file afterwards to figure out what your program is doing.&lt;br /&gt;
&lt;br /&gt;
====Via a Boot Script====&lt;br /&gt;
&lt;br /&gt;
If you want to run your program constantly and for it to start at boot like the [[#Via the Web Interface|web interface would do]], you can install your program into the boot order using a script.  This is a somewhat involved process, and you should be familiar with shell programming in Linux.  For this process, we only offer a [[OS - Linux#As A Service|similar example]] which installs and runs the program {{Code|phidgetwebservice21}} within the boot sequence.&lt;br /&gt;
&lt;br /&gt;
===Using USB Data Keys===&lt;br /&gt;
&lt;br /&gt;
After plugging the USB key in, it won&#039;t just appear on your desktop, so to speak, so you&#039;ll need to figure out where you can read and write to it within the SSH directory structure.&lt;br /&gt;
&lt;br /&gt;
The web interface program can help with this.  After you plug a USB key in, it will show up under {{Code|Status &amp;amp;rarr; System}}.  Or, the USB key and all other attached devices can be seen at {{Code|Status &amp;amp;rarr; USB}}:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_mounted_devices.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
In the screenshot above, you can see that the USB key is located in {{Code|/media/usb0}}.&lt;br /&gt;
&lt;br /&gt;
Alternately, you can use the SSH command {{Code|mount}}, and the searching program {{Code|grep}} which will filter the response of {{Code|mount}} and only return the lines with your search term ({{Code|usb}}):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep usb&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the USB key can be written to and read from using the {{Code|/media/usb0}} directory.  Copying a file to {{Code|/media/usb0}} will copy a file to the USB key.  The same goes for removing, renaming, opening files within your program, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Mount points like {{Code|/media/usb0}} should not be hard-coded into any of your programs.  (See the [[#Common Problems and Solutions | Common Problems and Solutions]] section for more information.)  If you need to obtain the mount point for a freshly mounted USB key within your code, have your code obtain the mount tables and search on the &#039;&#039;device&#039;&#039;  (e.g. {{Code|/dev/sda1}} or {{Code|/dev/sdb1}}) and obtain the corresponding mounted {{Code|/media/usbN}} location, where N is a number 0-9.&lt;br /&gt;
&lt;br /&gt;
===Saving and Retrieving Data===&lt;br /&gt;
&lt;br /&gt;
This section covers getting data on and off of the SBC.  There are two main methods of simply moving data on and off the SBC - via a [[#Via a USB Key|USB key]], and via [[#Over the Network (SCP)|copy over the network]] - and a third method for moving and installing data when it concerns [[#Backing Up Your Data|backing up lower level system data]].&lt;br /&gt;
&lt;br /&gt;
====Via a USB Key====&lt;br /&gt;
&lt;br /&gt;
After plugging in a USB data key, first you need to [[#Using USB Data Keys | find out the location]] where that data key was mounted.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the location of the USB key is {{Code|/media/usb0/}}, and we want to copy the file {{Code|data.txt}} to the USB key.  Your SSH session might look something like this, using [[#ls|ls]] and [[#mount|mount]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# ls&lt;br /&gt;
data.txt&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
root@phidgetsbc:~# cp data.txt /media/usb0/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cp&#039;&#039;&#039; program copies data from a source to a destination.  The syntax is {{Code|cp from to}}, where here we are copying from {{Code|data.txt}} to {{Code|/media/usb0/}}.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caution:&#039;&#039;&#039; Even if there is no USB key mounted at {{Code|/media/usb0/}}, this use of {{Code|cp}} will still work &#039;&#039;with no errors&#039;&#039;!  This is because there is still a file called {{Code|/media/usb0/}}, there is just no USB key file system &#039;&#039;mounted&#039;&#039; to that point.  So be sure to run [[#mount|mount]] or use some other method of determining that there is, in fact, a USB data key attached and where it is mounted to.&lt;br /&gt;
&lt;br /&gt;
====Over the Network (SCP)====&lt;br /&gt;
&lt;br /&gt;
SCP is a command line program already installed on Linux and Mac OS, and downloadable for free on Windows.  We discuss it and give examples in the [[#SSH|SSH]] section, but remember it here when you&#039;re trying to get data on and off of the SBC.  With SSH or a terminal already open, you&#039;ll probably find it to be much faster and easier than dealing with a USB key.&lt;br /&gt;
&lt;br /&gt;
====Backing Up Your Data====&lt;br /&gt;
&lt;br /&gt;
For the web interface, you can save and restore all web interface settings under the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} tab.&lt;br /&gt;
&lt;br /&gt;
To save the settings of what packages are installed for later re-installation, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg --get-selections &amp;gt; installedPrograms.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then save the file {{Code|installedPrograms.txt}} externally.  If you have to completely wipe the SBC, you can just reinstall the whole list by moving the {{Code|installedPrograms.txt}} file back onto the SBC, and then typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg –set-selections &amp;lt; installedPrograms.txt&lt;br /&gt;
apt-get dselect-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also remember to externally save:&lt;br /&gt;
* Your {{Code|~/.bashrc}} settings file if you&#039;ve changed it&lt;br /&gt;
* Your {{Code|crontab}} file if [[#Via Cron|you&#039;ve edited it]]&lt;br /&gt;
* Any data files or code you&#039;ve created&lt;br /&gt;
&lt;br /&gt;
It is important to save these settings often, and at points where you know the system is running well.  It may be tempting to create a backup right before you [[#Recovery System|wipe the SBC and start from scratch]], but often the reason you are having problems then is some setting or change, and backing these up and reinstalling them will only reinstall the problem.&lt;br /&gt;
&lt;br /&gt;
To truly back the files up, you must copy them to an external computer or location using either a [[#Via a USB Key|USB Key]] or [[#Over the Network (SCP) | over the network]].  Then they can be copied back if needed later.&lt;br /&gt;
&lt;br /&gt;
If you are looking to restore data on an SBC that will not boot properly, you&#039;ll want to be in the [[#Partial Recovery|partial recovery]] portion of our Troubleshooting section.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
The SBC can be quite tricky to debug, because it is a complex and flexible computer.  Common problems and solutions include:&lt;br /&gt;
* You can&#039;t find the SBC on the network at all - refer to the [[#Initial Internet Setup|Initial Internet Setup]] section&lt;br /&gt;
* You have changed some setting or file such that the SBC doesn&#039;t run anymore, or doesn&#039;t run as expected - refer to the [[#Recovery|Recovery]] section&lt;br /&gt;
&lt;br /&gt;
If you are having trouble using Phidgets on the SBC, you should go through the [[OS - Linux#Troubleshooting | Troubleshooting section on the general Linux page]].  Some of the problems on the Linux page (such as library problems) are easier to fix by simply working through the [[#Recovery|Recovery]] section when they occur on the SBC.&lt;br /&gt;
&lt;br /&gt;
Namely, it often helps to simply perform a [[#Factory Reset|factory reset]] on the SBC (save your files and installed program list first, as [[#Backing Up Your Data|described here]]).  Sometimes you change a file or setting within the operating system when you are trying to get something up and running, and this unintentionally affects other programs too.  Performing a factory reset starts you with a clean slate.&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, or the information within this guide, please [[Contact Us|ask us]]!&lt;br /&gt;
&lt;br /&gt;
===Initial Internet Setup===&lt;br /&gt;
&lt;br /&gt;
To set up the SBC, you almost always need a &#039;&#039;wired&#039;&#039; Ethernet connection with DHCP (Dynamic Host Configuration Protocol), and without a firewall.  This connection should be to a &#039;&#039;router&#039;&#039;, not directly plugged in to your computer.&lt;br /&gt;
&lt;br /&gt;
Even if you do not have this type of a connection at home, these types of connections are very common at both offices and universities.  On a Windows or Mac OS computer, you can bring up the [[Phidget Control Panel]] as described in the SBC&#039;s [[1072 User Guide#Getting Started|Getting Started Page]].  Failing this, or on a Linux computer, we discuss some alternate setup methods in this section.  Keep in mind that without a wired, open DHCP connection these setup methods can be difficult and fickle. &lt;br /&gt;
&lt;br /&gt;
====No Wired-Only Connection====&lt;br /&gt;
&lt;br /&gt;
Sometimes it can work to plug the SBC, using Ethernet, directly into an Ethernet port on your home wireless router.  Do not plug it directly into your computer!  (Although in some instances, a direct connection can be made to work on Linux, see the [[#No DHCP|No DHCP]] section below) &lt;br /&gt;
&lt;br /&gt;
This direct-router method is a very picky process, however, and can fail because:&lt;br /&gt;
* Some home and office routers place a firewall between wireless connections (clients) and wired connections (the local area network)&lt;br /&gt;
* Some home and office routers do not by default allow both Ethernet DHCP and wireless DHCP.&lt;br /&gt;
* Some routers and DHCP hubs only provide access to an internet connection, and do not provide local area network inter-connections (this is common on mobile device tethering hubs)&lt;br /&gt;
&lt;br /&gt;
Routers are quite complex, and even with admin privileges it can be a painstaking process to find all the right firewall settings to turn off in order to allow two computers on the network to talk to one another, rather than just connect to the internet.  This is why university or office networks are often ideal for the purpose of setting up the SBC, because these institutions depend on computers on a local network being able to talk together.  University libraries in particular can be a good source of wired DHCP connection ports.  &lt;br /&gt;
&lt;br /&gt;
Covering all of the different router configuration possibilities here, and how to change them to make the SBC work, is essentially impossible.  If you try using the SBC at home or at work, the SBC does not work on the first try when plugged directly into the router via Ethernet, and you want to make that connection work rather than seeking out an alternate for the initial setup, you should find documentation specific to your router (usually available online) and properly configure it.&lt;br /&gt;
&lt;br /&gt;
The good news is that if you can find an Ethernet DHCP connection &#039;&#039;just once&#039;&#039; for a short time, you can use that connection to configure the SBC to work on your home wireless network.  During that initial connection, you can enable wireless and set up as many wireless DHCP connections (with passwords) that you need.  Once wireless is enabled and set up, you can take the SBC home to your wireless router and the SBC will automatically seek out and connect to its remembered networks as they appear.  At that point, you can also use wireless like a normal internet, web interface, and SSH connection.&lt;br /&gt;
&lt;br /&gt;
====No Link Local Addressing====&lt;br /&gt;
&lt;br /&gt;
If you have a wired DHCP connection, no firewall, and no link local addressing (e.g. bonjour or avahi is not installed) then you will need access to the DHCP router logs.  From the router logs, you should see the connection (or attempted connection) by the SBC within the logs.  From that log entry, you should either be able to determine the IP address for the SBC, or see what happens when the router blocks access.  The IP address can be used in place of the link local address for both the web interface and for SSH.&lt;br /&gt;
&lt;br /&gt;
====No DHCP====&lt;br /&gt;
&lt;br /&gt;
The SBC will first try to use DHCP, but then it will revert to responding to a link local address under bonjour and avahi.  If you are depending on this, please wait &#039;&#039;&#039;at least three minutes&#039;&#039;&#039; after the SBC boots for the SBC to fail in obtaining a DHCP connection and properly revert to link local addressing.&lt;br /&gt;
&lt;br /&gt;
If you have a static IP setup, and want to use link local addressing rather than accessing the router logs, this should usually work by default on Windows and Mac OS (e.g. type the address such as {{Code|phidgetsbc.local}} into a web browser).  If it doesn&#039;t work automatically, there is not much you can do and you should seek out a wired DHCP connection elsewhere.&lt;br /&gt;
&lt;br /&gt;
On Linux, it also should work by default, but you have the additional option of explicitly adding routes that look within the default network settings for the SBC.  From a terminal (as root), type:&lt;br /&gt;
* {{Code|route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0 metric 99}}&lt;br /&gt;
* {{Code|route add default dev eth0 metric 99}}&lt;br /&gt;
You can also compile and use the {{Code|phidgetsbclist.c}} example (use the provided Makefile, don&#039;t use gcc) in the [{{SERVER}}/downloads/libraries/libphidget.tar.gz Phidget Linux Libraries] package, under the {{Code|examples}} folder.  This will allow you to see if the SBC is detected on the network at all.   Note that to use this option you must have the Phidget Libraries and the Phidget WebService installed on your Linux computer - in-depth instructions to do this are on the [[OS - Linux|main Linux page]].&lt;br /&gt;
&lt;br /&gt;
===Recovery System===&lt;br /&gt;
&lt;br /&gt;
You can either boot the SBC into recovery mode and attempt to recover files and settings, or you can completely wipe the SBC by performing a factory reset.  If the LEDs do not turn on normally (red on constantly, green on at first start, then off, then on when fully booted) then you&#039;ll want to read the [[#Hardware Issues|hardware issues]] section.&lt;br /&gt;
&lt;br /&gt;
====Partial Recovery====&lt;br /&gt;
&lt;br /&gt;
The recovery system can be entered in two ways:&lt;br /&gt;
# From the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} web interface page.&lt;br /&gt;
# By holding down the reset button for 20+ seconds - until the green light has switched from flashing slowly to flashing quickly.&lt;br /&gt;
&lt;br /&gt;
The recovery system runs an [[#SSH|SSH]] server where the username and password both are {{Code|root}}.&lt;br /&gt;
&lt;br /&gt;
If the main filesystem has been damaged/misconfigured in such a way that it won’t boot, you may be able to fix the issue or recover important files before running a full factory reset. From an SSH connection to the recovery system, you can mount the main root filesystem with the following commands (assuming it’s not damaged):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
ubiattach /dev/ubi_ctrl -m 6&lt;br /&gt;
mount -t ubifs /dev/ubi0_0 /mnt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Factory Reset====&lt;br /&gt;
&lt;br /&gt;
This restores the kernel and root filesystem from backup, overwriting any changes that may have been made and &#039;&#039;completely wiping the system&#039;&#039; to the state that it got shipped in. (You can save your files and installed program list first, as [[#Backing Up Your Data|described here]].)  This can be enacted one of two ways.&lt;br /&gt;
# Use the reset button:&lt;br /&gt;
##Enter the recovery mode by holding down the reset button for 20+ seconds as above (until fast flashing)&lt;br /&gt;
##Wait for a full boot (i.e. you can see it on the [[Phidget Control Panel]], or can SSH with username and password as {{Code|root}})&lt;br /&gt;
##Hold down the reset button again, but this time for only 10 seconds (until slow flashing)&lt;br /&gt;
##Wait for the SBC to fully reset and reboot (at least three minutes) - the LED will turn off and on again when this occurs&lt;br /&gt;
##*Note that after a factory reboot the SSH server will be disabled&lt;br /&gt;
##*Also note that after a factory reboot the SBC creates new SSH keys, and reverts to the {{Code|phidgetsbc.local}} address&lt;br /&gt;
# Via the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, where you can follow the instructions&lt;br /&gt;
&lt;br /&gt;
====Hardware Issues====&lt;br /&gt;
&lt;br /&gt;
The LEDs are an indicator of the hardware working properly.  The normal boot process is:&lt;br /&gt;
* Red LED: Turns on from moment of power being applied.&lt;br /&gt;
* Green LED: Turns on momentarily when power applied, then turns off momentarily, then turns on and stays on when booted.&lt;br /&gt;
&lt;br /&gt;
If the green status LED never turns on (or fails to turn on the second time), the boot process is failing somewhere.  This could be due to:&lt;br /&gt;
* A damaged OS - Try performing a [[#Factory Reset|Factory Reset]]&lt;br /&gt;
* If this fails, it is likely hardware damage (very difficult to diagnose, please [[Contact Us|contact us]])&lt;br /&gt;
&lt;br /&gt;
If neither LED turns on, hardware damage is even more likely.  Unless the path to the red LED is the one thing that has been damaged, the device is likely not receiving and using power.&lt;br /&gt;
* Try performing a [[#Factory Reset|Factory Reset]], and if that does not work please [[Contact Us|contact us]]&lt;br /&gt;
&lt;br /&gt;
=====USB Issues=====&lt;br /&gt;
&lt;br /&gt;
On the Phidget SBC2, there is a hardware issue that is unrelated to the LEDs.  It is a USB problem, and manifests in many ways:&lt;br /&gt;
* Strange behaviour when some devices but not others are plugged in to the SBC&lt;br /&gt;
* Strange behaviour with combinations of devices&lt;br /&gt;
* Failure (or intermittent failure) to see Phidgets on the USB hub, or USB keys on the hub&lt;br /&gt;
&lt;br /&gt;
This problem is fixable, either on your own or by sending your SBC back to Phidgets.  For an in-depth solution, see the [[SBC2_USB_Hub_Fix | SBC2 Hub Fix Page]].&lt;br /&gt;
&lt;br /&gt;
===Updating Your SBC===&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve owned your SBC for a while and want to update your packages, you can run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...to &#039;&#039;update&#039;&#039; your software source list and then &#039;&#039;upgrade&#039;&#039; to the latest version of all installed software.  If you are used to Mac OS or Windows, note that this does not just update the non-kernel parts of the operating system, it updates every additional piece of software you have installed.&lt;br /&gt;
&lt;br /&gt;
To update the SBC software itself (e.g. the kernel), it is easiest to use the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, to enter a page that will give you the option to update.  You will need to have an update file on a USB key inserted into the SBC, of type:&lt;br /&gt;
* UBI Image (system_ubi.img), or &lt;br /&gt;
* Kernel image (uImage), or&lt;br /&gt;
* Phidget Upgrade package containing both UBI and Kernel images (phidgetsbc*.bin)&lt;br /&gt;
&lt;br /&gt;
These are either obtained from the Phidgets website, or are a custom kernel / filesystem that you can create yourself, if you are experienced.&lt;br /&gt;
&lt;br /&gt;
The reason why this information is in troubleshooting is that you should certainly [[#Backing Up Your Data|back up your system]] before trying this.  And, it is quite rare to need to upgrade the kernel or filesystem on the SBC, so something serious should be going on before you attempt it.  Try using the [[#Recovery System|recovery system]] first.&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
Now that you have the basic libraries installed, you can pick your language and begin programming!  &lt;br /&gt;
&lt;br /&gt;
If you are not using the [[#WebService | webservice]] to control a Phidget over a network, your next step will be to delve into the use of your specific language.  Each page has its own set of specific libraries, code examples, and setup instructions.  &lt;br /&gt;
&lt;br /&gt;
On SBC Linux, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Java | Java]]&lt;br /&gt;
*[[Language - Python | Python]]&lt;br /&gt;
&lt;br /&gt;
These languages may also run on the SBC, but we do not yet directly offer SBC support for them:&lt;br /&gt;
* [[Language - Ruby|Ruby]]&lt;br /&gt;
* [[Language - C Sharp|C#]] (using Mono)&lt;br /&gt;
&lt;br /&gt;
You can probably figure out how to install and use them by a combination of the language pages linked above, and the section on [[#Installing Other Languages|installing other languages on the SBC]].&lt;br /&gt;
&lt;br /&gt;
==WebService==&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the [[Phidget WebService]] installed, and the SBC automatically starts the WebService at boot.&lt;br /&gt;
&lt;br /&gt;
To practice using the WebService, and to learn more about it, we have hands-on examples on the [[OS - Linux|general Linux page]], starting in the [[OS - Linux#Using the WebService|using the WebService section]].&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Shutting off USB ports to save power===&lt;br /&gt;
The SBC3 has an on-board USB hub that can control power to the ports. To do this unbind and rebind the USB drivers.&lt;br /&gt;
&lt;br /&gt;
To turn off the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/unbind}}&lt;br /&gt;
&lt;br /&gt;
To turn on the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/bind}}&lt;br /&gt;
&lt;br /&gt;
These will also cause detach and attach events for the Phidget devices, respectively. While the drivers are unbound, you will not get any hot plug events for any devices on USB.&lt;br /&gt;
&lt;br /&gt;
===Using a Touchscreen===&lt;br /&gt;
Please note that this will ONLY work with an SBC3 since it has a USB 2.0 hub:&lt;br /&gt;
&lt;br /&gt;
Using a touchscreen with the SBC is a great way to get user input and visual feedback from an SBC otherwise devoid of visual output.  The SBC does not have any conventional display ports such as VGA, DVI, or HDMI but it does have a number of USB ports and USB displays do exist.  With the upgrade to a USB 2.0 hub on the SBC3 from the earlier models which had USB 1 hubs the SBC now has enough capability to operate a screen over USB.  We don&#039;t recommend running a standard desktop environment since the processor is too slow to really keep up with a typical desktop it does make for an excellent interface for a kiosk, instrumentation control panel or  other, similar use case.  This document is going to go through the process of enabling support for a typical USB display as well as installing a fairly compact desktop environment called xfce on the SBC.  &lt;br /&gt;
&lt;br /&gt;
The screen I will be using is from a company called [http://lilliputweb.net/ Lilliput].  Specifically a UM-70 model.  Before you begin, please make sure that you have the screen plugged into the SBC, it will also be useful to have a spare USB keyboard and mouse handy as you will need them once you are no longer using an SSH terminal to communicate with the SBC.&lt;br /&gt;
&lt;br /&gt;
[[File:lilliputoff.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Getting the display to function====&lt;br /&gt;
Begin by logging into the web configuration page for your SBC and upgrading all of the packages on the SBC.  Be sure to include the full Debian package repository.  For more information on how to do this refer to the  [[OS - Phidget SBC#Getting Started - External Computer|getting started]] section of the Phidget SBC documentation.  Once you are fully up to date open an SSH session with the SBC and navigate to the &amp;quot;/etc&amp;quot; folder.  Open inittab with a terminal-based text editor such as nano and add the following to the bottom of the file, just above the {{code|T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100}} line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
1:2345:respawn:/sbin/getty 38400 tty1 &lt;br /&gt;
2:23:respawn:/sbin/getty 38400 tty2 &lt;br /&gt;
3:23:respawn:/sbin/getty 38400 tty3 &lt;br /&gt;
4:23:respawn:/sbin/getty 38400 tty4 &lt;br /&gt;
5:23:respawn:/sbin/getty 38400 tty5 &lt;br /&gt;
6:23:respawn:/sbin/getty 38400 tty6 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reboot your system.  After a few minutes you should see the LCD screen come up with a standard Linux terminal interface and a login prompt.  This is all well and good but this isn&#039;t really appreciably better than simply using an SSH session to communicate with the SBC.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputlogin.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Setting up Xfce====&lt;br /&gt;
In order to get a traditional windowing environment we still need to install a desktop manager as well as a number of supporting packages.  Log in and make sure everything is still up to date with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install the following packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xserver-xorg lxde xfce4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the SBC asks you if you want to continue, just type &amp;quot;Y&amp;quot; and press enter.  &lt;br /&gt;
&lt;br /&gt;
This will install the xfce desktop environment and any other necessary programs on the SBC.  When it&#039;s done, restart the SBC.  When it boots back up it should boot directly to a login screen instead of the terminal interface.  Log in, and you are good to go.  It won&#039;t be particularly fast, but don&#039;t worry, the SBC does not have a dedicated video processor on it so it&#039;s perfectly normal for it to be slow.  What&#039;s important is that it works.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputdesktop.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Calibrating the touch screen====&lt;br /&gt;
Unfortunately, by default the screen is calibrated to believe the bottom of the screen is on the right hand side.  This has the effect of making the touch functionality more or less useless until it has been properly calibrated.  To do this, install the following package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xinput-calibrator&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now use xinput calibrator to measure the parameters of your screen.  Launch xinput calibrator (called Calibrate Touchscreen in the programs menu) and follow the instructions on the screen.  The screen should now be functioning at full potential.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Using a Different Wireless Adapter===&lt;br /&gt;
&lt;br /&gt;
The support for the wireless adaptor that Phidgets sells is written into the SBC kernel.  Hence, we do not support using other adaptors. &lt;br /&gt;
&lt;br /&gt;
However, Linux is very flexible, and it is possible (though not easy) to write a custom kernel for the SBC and add support for a new wireless adaptor.  We can&#039;t help you with this, but we do provide some basic guidelines for [[#Custom Kernel and Filesystem|building your own kernel]].  You can also have a look at our thoughts on our own experience with choosing a Wifi adapter: [[Alternative Wi-Fi Adapters on the SBC]].&lt;br /&gt;
&lt;br /&gt;
===Using a Different Webcam===&lt;br /&gt;
&lt;br /&gt;
In addition to the webcam that Phidgets sells, you have the option to use many different webcams with the SBC.  There is a [http://www.ideasonboard.org/uvc/#devices long list] of compatible webcams.&lt;br /&gt;
&lt;br /&gt;
The common thread for these webcams is that they use UVC - the USB Video Class - drivers for Linux.  You can then use [[#mount|mount]] to find out what video device your webcam is mounted under.&lt;br /&gt;
&lt;br /&gt;
===Taking Pictures With the Webcam===&lt;br /&gt;
&lt;br /&gt;
Probably the most straightforward way to use a webcam for pictures rather than video is to use the {{Code|opencv}} library.  You can get it by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libcv2.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there is no {{Code|libcv2.1}} package, you can perform {{Code|apt-cache search libcv}} to find the current version.&lt;br /&gt;
&lt;br /&gt;
The opencv libraries can also be used within Python, by installing the link between them:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python-opencv&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then taking pictures from within code becomes quite simple.  For example, in Python, taking and saving an image is four lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
#! /usr/bin/python&lt;br /&gt;
&lt;br /&gt;
import cv&lt;br /&gt;
&lt;br /&gt;
# The webcam is located at /dev/video0 &lt;br /&gt;
# OpenCV only needs the number after video&lt;br /&gt;
webcam = cv.CaptureFromCAM(0)&lt;br /&gt;
&lt;br /&gt;
frame = cv.QueryFrame(webcam)&lt;br /&gt;
&lt;br /&gt;
cv.SaveImage(&amp;quot;image.jpg&amp;quot;, frame)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the complete OpenCV documentation, see [http://opencv.willowgarage.com/documentation/index.html The OpenCV Reference], and specifically the section on [http://opencv.willowgarage.com/documentation/reading_and_writing_images_and_video.html Reading and Writing Images].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The SBC is probably not as powerful for image processing and transport when compared to your desktop computer.  Try running your image processing code on the SBC from an early point in development.  During those test runs, you can visit the first System page of the [[#SBC Web Interface|SBC Web Interface]] to check the processor and memory use.  For more information on processor power, check the specification for your SBC (on the product page on [{{SERVER}} our main website]) as well as our discussion of [[#Pushing Processor Limits|pushing processor limits]] below.&lt;br /&gt;
&lt;br /&gt;
===Checking System Logs===&lt;br /&gt;
&lt;br /&gt;
The SBC maintains two logs: a kernel log and a system log.  &lt;br /&gt;
&lt;br /&gt;
The kernel log is for low-level occurrences, such as devices attaching and leaving the USB hub, recording what drivers are being used, and so on.&lt;br /&gt;
&lt;br /&gt;
The system log (syslog) is for normal chatter from the operating system.  Any program with the right permissions can use it (though you need to know the method to write to it, information all around the Internet can help) and it contains everything from the Ethernet going up and down, to webserver requests, and so on.  If you don&#039;t run many programs or services on the SBC, the syslog will essentially be a mirror of the kernel log, because the kernel is the only thing talking.&lt;br /&gt;
&lt;br /&gt;
You can check these logs by using the web interface in the {{Code|System &amp;amp;rarr; Logs}} tab.&lt;br /&gt;
&lt;br /&gt;
Or you can perform more powerful filtering and displaying via an SSH terminal.  For example, {{Code|dmesg}} is the command to display the kernel log, and {{Code|tail}} prints the last ten lines of input.  So, if you are trying to see if you can get a device to be detected on USB, you can run &amp;lt;code&amp;gt;dmesg | tail&amp;lt;/code&amp;gt; to print the latest ten lines of kernel log data.&lt;br /&gt;
&lt;br /&gt;
The actual locations of the log files (for filtering and reading) are:&lt;br /&gt;
* {{Code|/var/log/syslog}} &lt;br /&gt;
* {{Code|/var/log/dmesg}}&lt;br /&gt;
But don&#039;t edit them directly!  Always follow the advice and procedures around the Internet on how to properly log items to syslog.&lt;br /&gt;
&lt;br /&gt;
===X Forwarding===&lt;br /&gt;
&lt;br /&gt;
Although most tasks can be done using the [[#SBC Web Interface|SBC Web Interface]] or [[#SSH|SSH]], you can also set up X11 forwarding on the SBC.  X11 is the window manager base, which provides a graphical windowing system on the SBC.  Although you probably won&#039;t connect directly to the X11 manager (i.e. by plugging a screen directly into the SBC), X11 also gives a user the ability to forward graphical windows over SSH.  You will need the following packages installed:&lt;br /&gt;
* {{Code|x11-common}}&lt;br /&gt;
* {{Code|xbase-clients}}&lt;br /&gt;
After installing, make sure that the line in {{Code|/etc/ssh/sshd_config}} has a line that says:&lt;br /&gt;
:{{Code|X11Forwarding yes}}&lt;br /&gt;
Then log out and log back into the SBC.  This second time you log in, use the {{Code|-X}} switch to turn on X forwarding for that connection:&lt;br /&gt;
:{{Code|ssh -X root@phidgetsbc.local}}&lt;br /&gt;
Then you should be able to run programs that launch a window, and it will launch remotely and appear on the computer you have the SSH connection from.&lt;br /&gt;
&lt;br /&gt;
===Pushing Processor Limits===&lt;br /&gt;
&lt;br /&gt;
The SBC, though more powerful than many embedded computers out there, is probably about as powerful as your smartphone.  If you hook up 1 ms Phidget sampling devices to all six of its USB ports, events and packets will probably get lost.  The exact data rates you can accomplish depend on:&lt;br /&gt;
* What else is running on the SBC&lt;br /&gt;
* How efficient your code is for external operations (like File I/O)&lt;br /&gt;
* Other minor details (e.g. the temperature of the SBC, etc)&lt;br /&gt;
&lt;br /&gt;
If you want to achieve data rates as fast as possible, try these tips:&lt;br /&gt;
* Program in C, not in an interpreted language (Python, Java, .NET)&lt;br /&gt;
* Perform file I/O as little as possible.  Locally cache data, manage your writing to a file in a separate thread, and use low-level write calls.&lt;br /&gt;
* Change the [[#Custom Kernel and Filesystem|filesystem]] to a faster, non-compressed file system.&lt;br /&gt;
** Alternatively, use a high-data-rate USB key.&lt;br /&gt;
* Keep other running processes to a minimum. &lt;br /&gt;
** If you are running code locally right on the SBC, turn off the Phidget WebService.&lt;br /&gt;
&lt;br /&gt;
===Custom Kernel and Filesystem===&lt;br /&gt;
&lt;br /&gt;
You can compile your own kernel and flash it to the board. It is left up to the user to configure an appropriate cross-compiler for kernel development. You may also be able to compile a new kernel on-board.  We have a kernel development kit, complete with patch file and README:&lt;br /&gt;
* [{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Compiling a new, custom kernel is somewhat complex.  If the SBC is your first experience with Linux, writing a custom kernel will be difficult.  However, it will probably also be very rewarding because you can put whatever you like into it.  We might be able to offer additional suggestions, but ultimately you&#039;re on your own here. &lt;br /&gt;
&lt;br /&gt;
You may be able to write a custom kernel right on the SBC, but the easiest way is to develop the kernel on an external computer.  And the easiest way to develop on an external computer is for that computer to also be Linux, even just in a Virtual Machine.  The time spent loading a copy of Linux into a virtual machine (such as VirtualBox, which is free) onto your computer will probably be less time than setting up a standard compiler on Windows to cross-compile.&lt;br /&gt;
&lt;br /&gt;
On your external Linux system, you will need:&lt;br /&gt;
* A cross-compiling toolchain for the ARM processor, which we briefly describe on the [[OS - Linux#Cross-Compiling with a Custom Toolchain | main Linux page]], and &lt;br /&gt;
* The [{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package] from the Phidgets website.  &lt;br /&gt;
The kernel development kit has a brief README file which describes how to obtain the proper kernel and patch, configure, customize, and build it.&lt;br /&gt;
&lt;br /&gt;
We have an application guide in progress, which walks through building a custom kernel to add Bluetooth support to the SBC.  Please contact us if you would like more information.  Even if you are trying to add support for hardware other than a bluetooth modem, or wondering if support even exists in the kernel for your modem (3G, alternate wireless, etc) you will probably find the application guide helpful.  Follow it up to the point where you run the program {{Code|menuconfig}} (you don&#039;t need an SBC to do this), which will give you a menu of all drivers you can enable in the SBC kernel.&lt;br /&gt;
&lt;br /&gt;
After making your new kernel, you should have a uImage and modules target for your Makefile.  At this point you can transfer your kernel files onto the SBC, make their targets, and transfer them into the nand memory.  This involves erasing the old kernel, flashing the new kernel, installing the new kernel modules, and rebooting.  From the SBC, in the kernel directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
make uImage; make modules&lt;br /&gt;
flash-eraseall /dev/mtd3&lt;br /&gt;
nandwrite -p /dev/mtd3 arch/arm/boot/uImage&lt;br /&gt;
make modules-install&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Custom kernels can also be flashed from the [[#Recovery System | Recovery System]].&lt;br /&gt;
&lt;br /&gt;
If you need to create a root filesystem image, the filesystem type is UBIFS, and the commands to create it are:&lt;br /&gt;
&lt;br /&gt;
====For SBC2:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====For SBC3:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You then flash ‘system_ubi.img’ (not ‘system_ubifs.img’) from the recovery system.&lt;br /&gt;
&lt;br /&gt;
Again, like the custom kernel creation, the need to create a custom root filesystem is essentially non-existent except for those advanced users who already know they need it... and furthermore, you are almost entirely on your own.&lt;br /&gt;
&lt;br /&gt;
===Saving a file system to flash to multiple SBC&#039;s===&lt;br /&gt;
You may want to create a complete backup of your SBC root filesystem, which can then be flashed to other SBCs. This is how it could be done:&lt;br /&gt;
&lt;br /&gt;
You will need a USB drive - we have had issues using cheap flash drives, so a real USB drive is recommended. Make sure it&#039;s empty, as it will be reformatted.&lt;br /&gt;
&lt;br /&gt;
All of these commands are executed on your SBC, while logged in over SSH.&lt;br /&gt;
&lt;br /&gt;
First, re-format the USB drive as ext3. Assuming the USB drive is sda and has a single partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
mkfs.ext3 /dev/sda1&lt;br /&gt;
mount -t ext3 /dev/sda1 /media/usb0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remount / as readonly, so it doesn&#039;t change as we&#039;re copying it. To do this, we need to kill all running processes except sshd:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
service udev stop&lt;br /&gt;
service ifplugd stop&lt;br /&gt;
service rsyslog stop&lt;br /&gt;
service avahi-daemon stop&lt;br /&gt;
service phidgetwebservice stop&lt;br /&gt;
service ntp stop&lt;br /&gt;
service busybox-httpd stop&lt;br /&gt;
service dbus stop&lt;br /&gt;
service cron stop&lt;br /&gt;
pkill dhclient&lt;br /&gt;
mount -o remount,ro /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the remount says that / is busy, do a &#039;ps auxww&#039; and &#039;pkill&#039; anything else that may be running until it remounts properly.&lt;br /&gt;
&lt;br /&gt;
Then, copy / to the flash drive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkdir /media/usb0/root&lt;br /&gt;
mount --bind / /mnt/&lt;br /&gt;
cp -a /mnt/* /media/usb0/root/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, clean up the copy - removing files specific to this board. We also remove the APT cache to save space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
find /media/usb0/root/var/log -type f -print0 | xargs -0 rm -f&lt;br /&gt;
rm -rf /media/usb0/root/var/lib/apt/lists/*&lt;br /&gt;
mkdir /media/usb0/root/var/lib/apt/lists/partial&lt;br /&gt;
rm -f /media/usb0/root/var/cache/apt/*.bin&lt;br /&gt;
rm /media/usb0/root/etc/udev/rules.d/70-persistent-net.rules&lt;br /&gt;
rm /media/usb0/root/etc/ssh/ssh_host_*&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
then, create the ubinize.cfg file:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi	&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs0&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi		&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
vol_flags=autoresize	&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: you may need to increase vol_size if your filesystem is larger.&lt;br /&gt;
&lt;br /&gt;
then, create the UBI image from the copy:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then, unmount the drive to ensure everything is written out properly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you can remove the /root/ folder and system_ubifs.img. system_ubi.img can be flashed to other SBCs using the recovery system.&lt;br /&gt;
&lt;br /&gt;
==Software Details==&lt;br /&gt;
&lt;br /&gt;
For even more advanced uses of the SBC, it may help to know the gritty details of the SBC software system.&lt;br /&gt;
&lt;br /&gt;
;Operating System&lt;br /&gt;
:Debian/GNU Linux&lt;br /&gt;
:Kernel 2.6.X or higher (generally kept up to date with latest releases, use {{Code|uname -r}} to check the kernel version)&lt;br /&gt;
&lt;br /&gt;
;Main Filesystem (rootfs)&lt;br /&gt;
:UBIFS (a raw flash type of file system)&lt;br /&gt;
:Mounted in a 460 MB Nand partition (in Read/Write mode)&lt;br /&gt;
&lt;br /&gt;
;Kernel&lt;br /&gt;
:uImage format&lt;br /&gt;
:Has its own 3MiB partition on bare Nand&lt;br /&gt;
&lt;br /&gt;
;Web Interface Scripts and Configuration Data&lt;br /&gt;
:Located in {{Code|/etc/webif}}&lt;br /&gt;
:Modifying these scripts can be done; however, it is very easy to enter invalid data that could cause the system to behave unexpectedly or not boot.&lt;br /&gt;
&lt;br /&gt;
;User Applications uploaded through Web Interface&lt;br /&gt;
:Located in {{Code|/usr/userapps}}&lt;br /&gt;
&lt;br /&gt;
;Webcam Device Location&lt;br /&gt;
:{{Code|/dev/video0}}&lt;br /&gt;
:Numbers increase with more webcams&lt;br /&gt;
&lt;br /&gt;
;Date and Time&lt;br /&gt;
:Set using ntp (network time protocol) at boot&lt;br /&gt;
:The ntp daemon continues to run in the background and will periodically update the clock &lt;br /&gt;
:The network keeps the SBC very close to real time&lt;br /&gt;
:Also there is a real-time clock with battery backup which will preserve date/time across reboots, power removal&lt;br /&gt;
:The real-time clock is synced to system time during reboot/shutdown&lt;br /&gt;
:If power is unplugged suddenly, and the network not restored, the real-time clock may not have the correct time&lt;br /&gt;
&lt;br /&gt;
;Wireless Networking System&lt;br /&gt;
:Wireless adapter support for the wireless adapter that Phidgets sells is written into the kernel&lt;br /&gt;
:It supports WEP and WPA&lt;br /&gt;
:It is best configured through the configuration interface.&lt;br /&gt;
&lt;br /&gt;
;Nand Layout&lt;br /&gt;
:The board contains 512MiB on Nand. This nand is split into 7 partitions as follows:&lt;br /&gt;
:0: u-boot		 size: 256K		 Read Only&lt;br /&gt;
:1: u-boot_env		 size: 128K		 Read Only&lt;br /&gt;
:2: recovery_kernel	 size: 2M		 Read Only&lt;br /&gt;
:3: kernel		 size: 3M		 Writable&lt;br /&gt;
:4: flashfs	 	 size: ~3.625M	 	 Read Only&lt;br /&gt;
:5: recovery_fs		 size: ~ 43M		 Read Only&lt;br /&gt;
:6: rootfs		 size: ~ 460M		 Writable&lt;br /&gt;
: The final size of flashfs/recovery_fs/rootfs depends on the image size at production, and on the number/location of bad blocks in the NAND.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: U-Boot and recovery kernel and filesystem cannot be written from Linux - this is a safety measure.&lt;br /&gt;
&lt;br /&gt;
;Boot Loader&lt;br /&gt;
:U-Boot is used for setting up the processor and booting Linux, and is only accessible via a serial connection. &lt;br /&gt;
:Normal users will not need to use or modify it.&lt;br /&gt;
:Be very careful when modifying the u-boot partition. If it is damaged or overwritten, it is difficult to fix.&lt;br /&gt;
:When using U-Boot, a prompt will appear via serial shortly after power on.  &lt;br /&gt;
:The environment variables will help you determine how to boot Linux on the SBC&lt;br /&gt;
:You can also refer to the [http://www.denx.de/wiki/DULG/Manual U-Boot documentation]&lt;br /&gt;
&lt;br /&gt;
;Boot Process&lt;br /&gt;
:From power on...&lt;br /&gt;
:1. Processor loads first 4 bytes from NAND into Steppingstone and runs it.&lt;br /&gt;
:2. Steppingstone sets up RAM, copies u-boot from NAND into RAM and runs U-Boot.&lt;br /&gt;
:3. U-Boot initializes the processor, sets GPIO state, etc., copies the linux kernel into RAM, sets up the kernel command line arguments, checks that the kernel image is valid, and boots it.&lt;br /&gt;
:4. Linux boots, bringing up USB, Networking, NAND, etc. and then mounts the rootfs NAND partition on /.&lt;br /&gt;
:5. init gets run as the parents of all processes, as uses the /etc/inittab script to bring up the system. This includes mounting other filesystems, settings the hostname, and running the scripts in /etc/init.d, among other things.&lt;br /&gt;
:6. inittab then turns the green LED on.&lt;br /&gt;
:7. inittab then sets up a getty on the first serial port, ready for interfacing using the debug board.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|PHP Curl|Curl doesn&#039;t install smoothly}}&lt;br /&gt;
&lt;br /&gt;
There is an issue with the embedded version of PHP5.3, try forcing it to install the specific version that you need.  This can be done with the following command:&lt;br /&gt;
&lt;br /&gt;
{{Code|apt-get install php5-common&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;5.3.3-7+squeeze14}}&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|FTDI Errors|FTDI adapters do not appear to work with the SBC}}&lt;br /&gt;
&lt;br /&gt;
The 3.1.6 version of the Linux kernel which is used on some versions of the SBC has a bug that causes issues with FTDI drivers and makes them malfunction.  To solve this problem you must upgrade the kernel to a newer version.  You can find the files [[#Quick Downloads| here]].&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|USB Memory Key mounting|Sometimes USB Memory Keys mount at more than one location}}&lt;br /&gt;
&lt;br /&gt;
When you insert a memory key, the SBC will load it as a device (e.g. {{Code|/dev/sda1}}) and it will also &#039;&#039;mount&#039;&#039; the key for reading and writing within the {{Code|/media/}} directory.  The {{Code|/media/}} directory version will be called something like {{Code|usb0}}.  &lt;br /&gt;
At times, an inserted memory key will get mounted in more than one location.  You can observe if this occurs by checking the currently mounted devices with the command {{Code|mount}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
/dev/sda1 on /media/usb1 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will note that the same device ({{Code|/dev/sda1}}) is now mounted at &#039;&#039;both&#039;&#039; {{Code|/media/usb0}} and {{Code|/media/usb1}}.  To fix this problem as it occurs, you can use {{Code|umount}} (notice there is no letter &#039;n&#039;) to unmount the second instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# umount /media/usb1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In practice, this should not be a problem, because writing to or reading from either {{Code|usb0}} or {{Code|usb1}} will have the same effect on the memory key.  However, if you hard-code a media location into your program (i.e. expecting {{Code|/media/usb0}} to be the first USB key you insert and {{Code|/media/usb1}} to be the second key) your program will sometimes work and sometimes fail.  &lt;br /&gt;
&lt;br /&gt;
To get around this within code, find the mount point for each device as it appears.  The devices, such as {{Code|/dev/sda1}} will always refer to the actual memory key.  But, they cannot be written to directly without being mounted, so you will have to parse the mount table (what is returned from {{Code|mount}}) within your code to find the device and its corresponding mount point.&lt;br /&gt;
&lt;br /&gt;
This is a problem with the standard embedded Debian automount program, and we have no known fix.&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|Perl Locale Errors on SSH|No Locales Installed}}&lt;br /&gt;
&lt;br /&gt;
By default, no locales are installed on the SBC.  If you use [[#apt|apt]] a lot to install and manage your software on the SBC, you will get messages like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
perl: warning: Setting locale failed.&lt;br /&gt;
perl: warning: Please check that your locale settings:&lt;br /&gt;
	LANGUAGE = (unset),&lt;br /&gt;
	LC_ALL = (unset),&lt;br /&gt;
	LANG = &amp;quot;en_CA.UTF-8&amp;quot;&lt;br /&gt;
    are supported and installed on your system.&lt;br /&gt;
perl: warning: Falling back to the standard locale (&amp;quot;C&amp;quot;).&lt;br /&gt;
locale: Cannot set LC_CTYPE to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_MESSAGES to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_ALL to default locale: No such file or directory&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To squelch these messages, you should install and reconfigure your locale like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install locales&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command will show you a long list from which you should pick your location, by language.  For example, en_CA is english_Canada.  Here in Calgary, we use en_CA.UTF-8 and so for the first question we would input locale &amp;quot;114&amp;quot; and for the second (system) question we would input {{Code|en_CA}} for the locale.&lt;br /&gt;
&lt;br /&gt;
This might give you a locale undefined error, in which case you can generate the locale (for us, again, it is en_CA):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
locale-gen en_CA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=23724</id>
		<title>OS - Phidget SBC</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=23724"/>
		<updated>2015-09-01T17:26:00Z</updated>

		<summary type="html">&lt;p&gt;Patrick: /* Saving a file system to flash to multiple SBC&amp;#039;s */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
{{OSLang|[[File:icon-Linux.png|64x64px|link=OS - Linux]]|On the Single Board Computer (SBC), Phidgets can be either plugged directly into one of the USB ports or run over a network using the [[#WebService | WebService]].}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Unlike our other supported operating systems, the SBC &#039;&#039;&#039;does not require downloads&#039;&#039;&#039; unless you are doing something advanced like loading the firmware or developing your own kernel.  You will know if you need these downloads, otherwise, the SBC should work as described on the [[1073 User Guide#Getting Started|SBC3 Getting Started Guide]] right out of the box.&lt;br /&gt;
&lt;br /&gt;
*[[Software License]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC (1070):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc-minimal.bin Minimal Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc-full.bin Full Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/buildroot-phidgetsbc.tar.gz Buildroot/Kernel Sources]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC2 (1072):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc2/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc2.bin SBC2 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC2 Kernel Development Package] (How-to and patch file)&lt;br /&gt;
&#039;&#039;&#039;The PhidgetSBC3 has different firmware packages based on the kernel version. In order to determine the device version of your SBC3, see the [[1073_User_Guide#SBC_Web_Interface|web configuration page]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:sbcver.jpg|thumb|562px|link=|The system information table is found on the Status -&amp;gt; System tab of the &#039;&#039;&#039;[[1073_User_Guide#SBC_Web_Interface|web configuration page]]&#039;&#039;&#039; of the SBC.]]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.6.3:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc3/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3_1.0.0.20121213.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-kerneldev_1.0.0.20121213.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-upgrade_3.6.3_3.14.27.tar.gz SBC3 Kernel upgrade package (3.6.3 -&amp;gt; 3.14.27)]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.14.27:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc3/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3_1.0.1.20150108.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-kerneldev_1.0.1.20150108.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Note that, instead of using the firmware to update your SBC, updates should normally be done via the System -&amp;gt; Packages page on your SBC3 web interface. It is rarely necessary to completely re-flash your device..&lt;br /&gt;
&amp;lt;br clear = all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Getting Started with the Phidget SBC Debian Linux==&lt;br /&gt;
&lt;br /&gt;
The Single Board Computer (SBC) is a unique Phidget.  It is a computer with a Linux operating system.  It can compile code, save files, manage background jobs, host information over the web, and more.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If this is your first time&#039;&#039;&#039; using the Phidget SBC, you will want to start with the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  After that, here we will get you started on topics beyond those in the getting started guide, including how to write Phidget code to run on the SBC.  You &#039;&#039;&#039;do not need this page&#039;&#039;&#039; if you are simply using the SBC to broadcast data from Phidgets over the network - it does that automatically.  We describe how to verify and use this in the [[1073 User Guide#Getting Started | Getting Started Guide]].&lt;br /&gt;
&lt;br /&gt;
This page will show you how to:&lt;br /&gt;
* Install the ability to write and develop code on the SBC itself&lt;br /&gt;
* Use the command line for basic coding tasks&lt;br /&gt;
* Troubleshoot the SBC&#039;s network&lt;br /&gt;
It will also give additional specifications, which are useful for doing more advanced things with the SBC hardware and software.&lt;br /&gt;
&lt;br /&gt;
Before reading this page, you should have done the following via the Getting Started Guide:&lt;br /&gt;
* Set up networking on your SBC, via either Ethernet or wireless&lt;br /&gt;
* Set up an admin password&lt;br /&gt;
* Learned the IP address or link local address of the SBC&lt;br /&gt;
We will use this information in setting up the libraries and drivers to use the SBC for writing and running code.&lt;br /&gt;
&lt;br /&gt;
Conceivably, you could simply use the SBC like any Linux computer, and do all of your development and compiling of Phidget code on the SBC itself.  In practice this gets complicated as the SBC does not have a keyboard or screen.  So usually, you will want to develop your code an external computer and copy files and settings over to the SBC via a network.  This makes this Getting Started section unique, in that we show you how to set up both computers:&lt;br /&gt;
* Your [[#Getting Started - External Computer | External Development Computer]], usually your main desktop or laptop which will transfer files and settings to and from the SBC&lt;br /&gt;
* The [[#Getting Started - The SBC (Debian Linux) | SBC]] itself, which needs programming language libraries to use Phidgets.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - External Computer===&lt;br /&gt;
&lt;br /&gt;
You have two ways to connect to the SBC from an external computer: via the [[#SBC Web Interface|SBC Web Interface]] and over the more powerful but complex [[#SSH | Secure Shell (SSH)]].&lt;br /&gt;
&lt;br /&gt;
====SBC Web Interface====&lt;br /&gt;
&lt;br /&gt;
You have already worked extensively with the web interface in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  This was the tool within a web browser which was opened either via the [[Phidget Control Panel]] on Windows, or by simply entering the IP or link local address into an internet browser.  It allowed you to set the password, set up internet connectivity, and so on.  &lt;br /&gt;
&lt;br /&gt;
This section doesn&#039;t have more information on the interface; rather, it simply serves as a reminder that you have the web interface as an available tool.  Examples, including screenshots, are placed where appropriate in this document.  The web interface will probably stay your initial go-to way to connect to the SBC, especially for tasks that benefit from graphical interaction, like setting up wireless or using the webcam.&lt;br /&gt;
&lt;br /&gt;
====SSH====&lt;br /&gt;
&lt;br /&gt;
The most flexible way to transfer files and commands to and from the SBC is via a program called &#039;&#039;&#039;ssh&#039;&#039;&#039;.  The ssh program provides command line text access over a network into the SBC.  Using it, you can run programs and give the SBC commands.  The ssh program has a companion program called &#039;&#039;&#039;scp&#039;&#039;&#039; which can copy files back and forth.  If you are unfamiliar with ssh, you can think of it like the command line or a Mac terminal, but with a remote connection to a different computer.  It is a minimal yet effective way to interact with a remote computer.&lt;br /&gt;
&lt;br /&gt;
Before connecting over ssh, you will need:&lt;br /&gt;
* The &#039;&#039;&#039;IP address&#039;&#039;&#039; (such as 168.254.3.0) or &#039;&#039;&#039;link local address&#039;&#039;&#039; (such as phidgetsbc.local) of the SBC&lt;br /&gt;
* The &#039;&#039;&#039;admin password&#039;&#039;&#039; for the SBC&lt;br /&gt;
Both of these items can be found by following the steps in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].&lt;br /&gt;
&lt;br /&gt;
You will also need to enable SSH on the SBC side.  This can be done through the [[#SBC Web Interface| Web Interface]], under {{Code|Network &amp;amp;rarr; Settings}}, by changing the &#039;&#039;SSH Server&#039;&#039; radio button to &#039;&#039;Enabled&#039;&#039; and saving your changes:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_turn_on_ssh.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
=====SSH on Windows=====&lt;br /&gt;
&lt;br /&gt;
The ssh program is not installed on Windows by default.  But, there are a variety of SSH programs available for free. One simple and commonly used program is [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY], and it has the advantage that the executable doesn&#039;t need to install, it just runs.&lt;br /&gt;
&lt;br /&gt;
With PuTTY, when you first run the program it will ask you what to connect to.  Enter the IP address or link local address of the SBC, and then click the SSH radio button right below the address, which will change the port to 22.  Then click open, and you&#039;ll have an ssh connection to the SBC open in a terminal.  It will prompt you for a user name ({{Code|root}}) and password (the admin password).&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, there is an SCP component to PuTTY, called PSCP, which is available from the same [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY download page].  Use of PSCP will be similar with the address, username, and password, except that you will be transferring files instead of sending commands.&lt;br /&gt;
&lt;br /&gt;
=====SSH on Linux and Mac OS=====&lt;br /&gt;
&lt;br /&gt;
Linux and Mac OS already have ssh installed by default.  To run ssh simply open a terminal...&lt;br /&gt;
* {{Code|Ctrl-Alt-T}} on Linux &lt;br /&gt;
* {{Code|Applications &amp;amp;rarr; Utilities &amp;amp;rarr; Terminal}} on Mac OS &lt;br /&gt;
...and type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
ssh root@phidgetsbc.local&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have re-named your SBC, include that name instead of the {{Code|phidgetsbc.local}} link address.  Or, you can use the SBC&#039;s IP address, e.g. something like {{Code|ssh root@168.254.3.0}}&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, the command follows the form of: {{Code|scp from to}}&lt;br /&gt;
&lt;br /&gt;
So, to copy a file {{Code|/root/data.txt}} from the SBC to your local machine, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
scp root@phidgetsbc.local:/root/data.txt .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note the use of the dot &#039;&#039;&#039;.&#039;&#039;&#039; to indicate that scp should put the file in the current local directory.   If you&#039;re not sure what folder the terminal is operating in type {{Code|pwd}} to print the working directory.  Terminals usually start by default in your home folder.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - The SBC (Debian Linux)===&lt;br /&gt;
&lt;br /&gt;
The SBC runs Linux, which is a full operating system. It is stripped down compared to a full desktop release of Linux, but you can compile code on it, run programs, schedule tasks, create and manage files, run a web server, and much, much more.&lt;br /&gt;
&lt;br /&gt;
At this point you have connected to the SBC via the [[#SBC Web Interface|web interface]], and probably also through [[#SSH|SSH]].  This section will help you install libraries and drivers that you probably want - i.e. support for C, Java, and Python.  After this section, you&#039;ll be well into the depths of using the SBC as a computer, and so you&#039;ll probably want to keep the [[#Using SBC Linux|Using SBC Linux section]] open for reference while you work if you are not already familiar with Linux.&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the following Phidget functionality installed:&lt;br /&gt;
* The Phidget C libraries {{Code|libphidget21.so}}&lt;br /&gt;
* The Phidget [[#WebService | WebService]]&lt;br /&gt;
(If you are simply curious what these are and how they get installed, we describe the process on the [[OS - Linux | general Linux page]].)&lt;br /&gt;
&lt;br /&gt;
But to compile C programs, or run Java programs, or use Python, you will need to install these languages onto the SBC.  &lt;br /&gt;
&lt;br /&gt;
Before installing anything on the SBC, however, (even via a button on the web interface) make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
====Installing C/C++ and Java====&lt;br /&gt;
&lt;br /&gt;
The simplest way to install C/C++  and Java on the SBC is via the web interface.  There is a button under {{Code|System &amp;amp;rarr; Packages}} to install C support (including {{Code|gcc}}) and another button to install Java support:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_packages_web.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
You have to check that you are running the same version of Java on your development machine (where you plan on compiling the java programs) as the SBC is running. To do this type the following into the terminal on your computer and from ssh on the SBC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
Java -version&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need to update the version of Java on your SBC, use the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install openjdk-7-jre-headless&lt;br /&gt;
su&lt;br /&gt;
update-alternatives --config java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you&#039;re ready to begin programming.  We have programming pages for both [[Language - C/C++|C/C++]] and for [[Language - Java|Java]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].  &lt;br /&gt;
&lt;br /&gt;
If you want to avoid using the [[#SSH|SSH]] interface on the SBC entirely, and you want to write your program in Java and run it continuously from boot (which is the only option if you want to avoid [[#SSH|SSH]]), we have a [[#Program in Java with the Web Interface|very in-depth section]] on that topic.&lt;br /&gt;
&lt;br /&gt;
====Installing Python====&lt;br /&gt;
&lt;br /&gt;
Installing Python has two steps.  First, you&#039;ll need to install the basic ability to run python, and then you&#039;ll need to install the Phidget Python module.  Both steps (and both options) require that you issue the relevant commands through an [[#SSH|SSH terminal]].&lt;br /&gt;
&lt;br /&gt;
=====Basic Python=====&lt;br /&gt;
&lt;br /&gt;
The base Python functionality can be downloaded and installed in one step with [[#apt|apt]] (i.e. in a terminal, type):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will give you Python, and now you just have to install the Phidget Python module to gain Phidget functionality. If the installation fails because it can&#039;t find python, you need to enable the full repository as described in [[#Getting Started_-_The_SBC_(Debian_Linux)|this section]], and then perform an apt-get update.&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 1: Use a USB Key=====&lt;br /&gt;
&lt;br /&gt;
Copy the [{{SERVER}}/downloads/libraries/PhidgetsPython.zip Python Libraries] onto a USB key.  Unpack the zip file into a folder on the USB key.  Insert the key into the SBC.&lt;br /&gt;
&lt;br /&gt;
You will have to figure out where the USB key (and the Phidget Python library folder) is now located.  We describe how in the general [[#Using USB Data Keys | Using USB Data Keys]] section.&lt;br /&gt;
&lt;br /&gt;
After you know the place where the USB key is mounted, in a terminal go to that directory (e.g. type {{Code|cd /media/usb0/}}), enter the unpacked Phidget Python Library folder, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have an whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 2: Use the Internet=====&lt;br /&gt;
&lt;br /&gt;
Rather than using a USB key to transfer the file, the SBC can download it directly from the internet.  You will need {{Code|wget}} and {{Code|unzip}} installed, both of which are small:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install wget&lt;br /&gt;
apt-get install unzip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the web link address for the [{{SERVER}}/downloads/libraries/PhidgetsPython.zip Python Libraries].&lt;br /&gt;
&lt;br /&gt;
In an SSH terminal to the SBC, type: {{Code|wget http://www.python_library_link}} where instead of http://www.python_library_link you insert the link you just copied. Copying into a terminal can usually be done via the right-click menu.&lt;br /&gt;
&lt;br /&gt;
This will download the Phidget python libraries to the folder you ran the {{Code|wget}} command in.  Unzip the downloaded file using the command {{Code|unzip file}}, where file is the filename from {{Code|wget}}. Or try typing {{Code|ls}} to list the names of a file in the directory, which should include the unzipped folder.  Enter the unzipped folder (e.g. use {{Code|cd}} to change directory), and install the Phidget Python libraries:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have a whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
====Installing Other Languages====&lt;br /&gt;
&lt;br /&gt;
You may also be able to program on the SBC using [[Language - Ruby|Ruby]] and [[Language - C Sharp|C# under Mono]], though we do not offer in-depth support for these languages on the SBC.  The installation procedures should more or less follow that of [[#Installing Python|installing python]] on the SBC, except you will be installing Ruby or Mono.  Performing package searches using [[#apt|apt cache search]] can help you find the relevant software.&lt;br /&gt;
&lt;br /&gt;
For C#, as of 2012 the {{Code|mono-complete}} package is broken on the Debian Squeeze repository.  Rather, you have to install the Mono runtime and Mono compiler separately.&lt;br /&gt;
&lt;br /&gt;
To install the runtime package (and its dependencies), use [[#apt|apt]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-runtime&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to install the C# compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-gmcs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or the Visual Basic compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-vbnc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, the system and library packages do not link correctly for the version 2.0 of Mono.  If this is the case, your code will compile fine, but when you try to run it, you will get an error like:&lt;br /&gt;
&lt;br /&gt;
:{{Code|The assembly mscorlib.dll was not found or could not be loaded.}}&lt;br /&gt;
:{{Code|It should have been installed in the `/usr/lib/mono/1.0/mscorlib.dll&#039; directory.}}&lt;br /&gt;
&lt;br /&gt;
In this case, you need to install these two packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libmono-corlib1.0-cil&lt;br /&gt;
apt-get install libmono-system1.0-cil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we found these packages to work by working through the tree structure.  As a general rule, you can find these dependencies by using install (here, {{Code|apt-get install mono-complete}}) to get a sense of the package tree structure.  This will possibly tell you that the packages are broken, but at the same time this will list the dependencies of the packages.  Trying to install individual dependencies will show you that although a root-package fails, the sub-packages will sometimes succeed, and install what you need.&lt;br /&gt;
&lt;br /&gt;
If you want to use a specific dll or library that is not available in this reduced version of mono, you can install mono complete by switching from Emdebian+Debian to just Debian.  To do this:&lt;br /&gt;
&lt;br /&gt;
In {{Code|/etc/apt/preferences}} make the following changes:&lt;br /&gt;
:{{Code|Package: *}}&lt;br /&gt;
:{{Code|&amp;lt;nowiki&amp;gt;Pin: release a=stable&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
:{{Code|Pin-Priority: 1010}}&lt;br /&gt;
	&lt;br /&gt;
In {{Code|/etc/apt/sources.list/mutistrap-debian.list}} remove the emdebian line.&lt;br /&gt;
&lt;br /&gt;
Apply the changes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get dist-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many packages will be &#039;downgraded&#039; from the emdebian to debian versions.  Delete the {{Code|&amp;lt;nowiki&amp;gt;/etc/apt/preferences&amp;lt;/nowiki&amp;gt;}} file and install mono-complete:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install monodoc-http mono-complete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Choose monodoc-http explicitly, because otherwise the install fails on monodoc-browser.&lt;br /&gt;
&lt;br /&gt;
After this process, you can compile your C# Code.cs Phidget source file the same way as on a generic [[Language - C Sharp#Linux|Linux with Mono]] system.  Please refer to that page on how to obtain the *.dll Phidget resource file and compile your code.  On the SBC, however, because you are already running as root (the Super User), you do not need &#039;sudo&#039; and indeed the SBC will give you an error if you use it.  Instead, compiling and running will look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
gmcs Code.cs -r:Phidget21.NET.dll&lt;br /&gt;
mono Code.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using SBC Linux==&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve set up communication with the SBC, and installed whichever programming language support you need, you&#039;re probably ready for a short tour of useful tools on the SBC&#039;s version of Linux.&lt;br /&gt;
&lt;br /&gt;
First, you will by default be running on the SBC as &#039;&#039;&#039;root&#039;&#039;&#039;, which is the super-user.  For Linux users, this probably makes you nervous because you know you can overwrite important system files without the system asking for additional permission.  As a Windows or Mac OS user - although you may usually run your computer as an administrator - your familiar system usually prompts you to confirm before you do anything really dangerous, and this will &#039;&#039;&#039;not&#039;&#039;&#039; happen on the SBC as the root user.&lt;br /&gt;
&lt;br /&gt;
Next, there is no installed help on the SBC.  Help on Linux is usually called &#039;man pages&#039; which is short for &#039;the manual pages&#039;.  On a full Linux system, usually if you need help with any command you can type, for example, {{Code|man ls}} and it will give you help with the program [[#ls|ls]].  But these help pages take up significant space, and they are widely available online.  So, if you need more help with a certain command, you can always type {{Code|man command}} into your favourite search engine.&lt;br /&gt;
&lt;br /&gt;
Finally, the SBC has no windowing system.  For Linux users, this means no X-windows (Gnome, KDE, etc).  And as a Windows or Mac user, you can think of it as running all of your programs and commands through the terminal or DOS prompt command line.  The SBC provides all of the functionality of an operating system (e.g. process scheduling, file management, etc) but without any graphical interface.  The only exception is the [[#SBC Web Interface|web interface]], which gives graphical access to a limited part of what the SBC can do.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands===&lt;br /&gt;
&lt;br /&gt;
If you are doing more with the SBC than simply running pre-written programs [[#Writing a Phidget Program|in Java to run continuously from boot]], you will be interacting with the SBC&#039;s Linux operating system over the command line by using [[#SSH|SSH]].  This section discusses useful programs already installed on the SBC, and how to run them on the command line.&lt;br /&gt;
&lt;br /&gt;
====ls====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;ls&#039;&#039;&#039; program lists the contents of a directory.&lt;br /&gt;
&lt;br /&gt;
It will show both files and folders, but not files that start with a &amp;quot;.&amp;quot; (these are hidden files on Linux).&lt;br /&gt;
*If you also want to show hidden files, use {{Code|ls -a}}&lt;br /&gt;
*If you want more information, such as size and date modified, use {{Code|ls -l}}&lt;br /&gt;
*Commands can be combined, like {{Code|ls -al}}&lt;br /&gt;
&lt;br /&gt;
====cd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cd&#039;&#039;&#039; program changes to a new directory.&lt;br /&gt;
&lt;br /&gt;
For example, {{Code|cd /root}} changes into the directory at the base of the file tree called &#039;&#039;root&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* Linux uses forward slashes&lt;br /&gt;
* The base of all directories is &amp;quot;/&amp;quot; (not &amp;quot;C:\&amp;quot;)&lt;br /&gt;
* The tilde symbol (~) is short for your home directory (i.e. when you are root, this is short for &amp;quot;/root&amp;quot;)&lt;br /&gt;
* The double dot &amp;quot;..&amp;quot; means move one directory higher (for example from {{Code|/root/data/}} to {{Code|/root/}})&lt;br /&gt;
&lt;br /&gt;
====pwd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;pwd&#039;&#039;&#039; program prints the current directory you are working in.  (&#039;P&#039;rint &#039;W&#039;orking &#039;D&#039;irectory)&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
:{{Code|root@phidgetsbc:~# pwd}}&lt;br /&gt;
:{{Code|/root}}&lt;br /&gt;
&lt;br /&gt;
====cp, mv, and rm====&lt;br /&gt;
&lt;br /&gt;
These programs are copy (&#039;&#039;&#039;cp&#039;&#039;&#039;), move (&#039;&#039;&#039;mv&#039;&#039;&#039;), and remove (&#039;&#039;&#039;rm&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Copy copies a file from one location and pastes it to another.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|cp data.txt data_backup.txt}} will put a copy of the file {{Code|data.txt}} into {{Code|data_backup.txt}}&lt;br /&gt;
&lt;br /&gt;
Move moves a file (this is also useful for renaming files) to a new destination.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|mv data.txt data_backup.txt}} will put the contents of {{Code|data.txt}} into {{Code|data_backup.txt}}, and then will remove {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Remove deletes a file.&lt;br /&gt;
&lt;br /&gt;
For example, typing {{Code|rm data.txt}} will delete {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Note that &#039;&#039;&#039;rm&#039;&#039;&#039; is final.  Once you remove a file using {{Code|rm}}, it is gone forever.  There is no recycle bin, no temporary trash, nothing other than backups you may have personally created in the past!&lt;br /&gt;
&lt;br /&gt;
Directories can only be removed with {{Code|rmdir}}, and then only if they are empty.  If you want to remove a directory and all the files in it, use {{Code|rm -rf directory}} but be &#039;&#039;&#039;very, very careful&#039;&#039;&#039; with this command.  Trying to remove everything within a directory (e.g. {{Code|rm -rf *}}) is one of the most dangerous commands you can run on a Linux system, as running it from the wrong directory will result in Linux happily removing everything under that directory -- which could be your entire filesystem.&lt;br /&gt;
&lt;br /&gt;
====find====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;find&#039;&#039;&#039; program does what it says - it finds things.  &lt;br /&gt;
&lt;br /&gt;
Unfortunately for the casual user, the find program is very flexible and powerful, and thus not especially intuitive to use.  But, here are some examples:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|find folder -name file.txt}}&lt;br /&gt;
| Looks for all files in a folder (/ for root - or all - folders) with a certain name (* for wildcard)&lt;br /&gt;
| {{Code|find / -name *.jpg}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|find folder -mtime +X}}&lt;br /&gt;
| Looks for all files in a folder modified less than X days ago&lt;br /&gt;
| {{Code|find /root -mtime +30}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====grep====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;grep&#039;&#039;&#039; program takes text input and searches for a term. &lt;br /&gt;
&lt;br /&gt;
For example, if you type {{Code|mount}} to view what devices are mounted (e.g. loaded) on your SBC, you will see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may be a lot of information you don&#039;t need.  If you are only interested in a USB key attachment (as described in the [[#Using USB Data Keys|Using USB Data Keys]] section), you can use grep to filter that one response:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep sda1&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====nano====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;nano&#039;&#039;&#039; program is a small text editor that you can use within an SSH terminal. &lt;br /&gt;
&lt;br /&gt;
Nano can be surprisingly useful for writing short lengths of code right on the SBC, so there is no need to transfer files and keep track of different file versions on different computers.&lt;br /&gt;
&lt;br /&gt;
Nano has all keyboard commands which are listed at the bottom of the screen at all times as a reminder (Ctrl-O to save, Ctrl-X to exit, these expand with a larger terminal window).  And, nano provides what is called &#039;syntax highlighting&#039;, which colours reserved keywords, comments, strings, and so on as appropriate to the programming language you are using.  Nano detects the programming language via the extension of the file ({{Code|.java}} for Java, {{Code|.c}} for C/C++, and {{Code|.py}} for Python).&lt;br /&gt;
&lt;br /&gt;
Typing {{Code|nano test.py}} on an SSH command line and then entering a few lines of Python into the new empty file results in:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_nano_python.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
====apt====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;apt&#039;&#039;&#039; program allows you to install, uninstall, upgrade, and search software available for the SBC.&lt;br /&gt;
For a non-Linux user, the apt framework may be daunting at first, but it actually allows you to keep your system up to date and install and manage software quickly, easily, and for free.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Before installing anything on the SBC, make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-cache search term}}&lt;br /&gt;
| Looks for all programs (packages) that have {{Code|term}} in the title or description&lt;br /&gt;
| {{Code|apt-cache search opencv}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-cache show package}}&lt;br /&gt;
| Shows a lot of data about {{Code|package}} including size, version, etc&lt;br /&gt;
| {{Code|apt-cache show unzip}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-get update}}&lt;br /&gt;
| Gets the most recent listing of available software&lt;br /&gt;
| {{Code|apt-get update}}  (No options)&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-get install program}}&lt;br /&gt;
| Installs {{Code|program}} from the internet&lt;br /&gt;
| {{Code|apt-get install python}}&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====mount====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|mount}} shows you all of the mounted devices on your SBC.  &lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the non-Linux user, the concept of a device may be quite strange.  To give a short summary, everything on Linux that you can read or write is a file.  Webcams are files (i.e. you can &#039;read&#039; photos from them), USB keys are files, and each filesystem (tmp storage, the kernel portion, the main filesystem) are also themselves files.  These files specify what and how something can be written.  These are not necessarily linear, for example, you can see above that the USB key ({{Code|/media/usb0}} is mounted &#039;&#039;within&#039;&#039; the root file system {{Code|rootfs}} which is /.   &lt;br /&gt;
&lt;br /&gt;
So mount gives you an idea of what devices have been &#039;mounted&#039; for reading or writing, and how you can read and write to them.  More information on mount (and its various forms, like {{Code|umount}}) is available widely around the Internet.&lt;br /&gt;
&lt;br /&gt;
====which====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|which}} tells you if and where a program is installed.&lt;br /&gt;
&lt;br /&gt;
For example, on a default SBC, typing {{Code|which python}} will return no results.  But after successfully [[#Installing Python | installing python]], it will return {{Code|/usr/bin/python}} as the location of the python program/binary/executable.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands to Install===&lt;br /&gt;
&lt;br /&gt;
These are other programs you may find useful on the command line.  Although they are not on the SBC by default, these and other programs can usually be installed simply by using [[#apt|apt-get install]], with the exception of gcc.  For example, {{Code|apt-get install wget}} will download and install [[#wget|wget]].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This section and the section on [[#Some Useful Commands|pre-installed commands]] can hardly cover all of the complexities and power of the Linux operating system.  There are many excellent tutorials online, and between them and using [[#apt|apt]] to find and install programs you should be able to learn a lot and perform any number of complex useful tasks.&lt;br /&gt;
&lt;br /&gt;
====gcc====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;gcc&#039;&#039;&#039; program is the C compiler for Linux.&lt;br /&gt;
&lt;br /&gt;
If you are an experienced C/C++ user on Mac or Linux, or if you&#039;ve already read our [[Language - C/C++ | C Language page]], you might think you need to install gcc via {{Code|apt-get}} to compile C code.  However, gcc is not in the package repository for the SBC, so {{Code|apt-get install gcc}} will fail.  Rather, to install gcc, you can do it via the web interface, as described in the [[#Installing C/C++ and Java|Installing C/C++ and Java]] section.&lt;br /&gt;
&lt;br /&gt;
After installing it via the SBC web interface, you can use {{Code|gcc}} normally.&lt;br /&gt;
&lt;br /&gt;
====less====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;less&#039;&#039;&#039; program displays the contents of a text or source code file.  When displaying the file, {{Code|less}} allows you to scroll up and down to read it.&lt;br /&gt;
&lt;br /&gt;
This is useful if you are writing your sensor readings to a data file, and you want to read the data file while it is being written by your main code.  If your data file is called {{Code|data.txt}}, you can type {{Code|less data.txt}} and see the lines in the file, and what they are.&lt;br /&gt;
&lt;br /&gt;
The {{Code|less}} program output can also be piped into another program.  For example, you can use {{Code|less}} and the word search program {{Code|grep}} to find lines within a file with a search term.  For instance, if you have a C source code file {{Code|Program.c}} on the SBC, and you want to see all the lines in {{Code|Program.c}} that contain a variable name {{Code|var}}, you can type: &lt;br /&gt;
:&amp;lt;code&amp;gt;less Program.c | grep var&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====wget====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;wget&#039;&#039;&#039; program allows you to get an online file (over http) and download it to the SBC.&lt;br /&gt;
&lt;br /&gt;
For example, to get the source file (HTML) from the Phidgets home page, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
wget http://www.phidgets.com&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is most useful for downloading libraries, drivers, or anything (zip, tar, etc) you need from the web which is not available by [[#apt|using apt]].&lt;br /&gt;
&lt;br /&gt;
===Writing a Phidget Program===&lt;br /&gt;
&lt;br /&gt;
We provide two ways to write and upload a Phidget Program:&lt;br /&gt;
# The [[#SBC Web Interface|web interface]]:&lt;br /&gt;
#* This is useful for simple projects written in Java that you want to start only at boot&lt;br /&gt;
#* You can also use C projects, but they must be compiled off the SBC for an ARM processor&lt;br /&gt;
# Over [[#SSH|SSH]], which will allow you to write or transfer source code directly to and from the SBC&lt;br /&gt;
#* This is useful for all other projects, such as:&lt;br /&gt;
#** Projects that run at scheduled times (e.g. once per minute)&lt;br /&gt;
#** Projects that use languages other than Java or ARM-compiled C&lt;br /&gt;
Note that you can still run an [[#SSH|SSH]] project at boot, you just have to write and install a startup script.  This is a bit complex, but we do have an example that starts the program {{Code|phidgetwebservice21}} [[OS - Linux#As A Service|at boot using a script]].&lt;br /&gt;
&lt;br /&gt;
Once you know which method you&#039;d like to use, you can continue on to learn how to [[#Program in Java with the Web Interface|Program in Java with the Web Interface]], or how to [[#Program with SSH|Program with SSH]] using Java, C, or Python.  If you are actually typing in source code on the SBC, you&#039;ll find our [[#Developing Code on the SBC|developing code on the SBC section]] useful.&lt;br /&gt;
&lt;br /&gt;
====Program in Java with the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To show how to write, compile, and install Java programs on the SBC, we&#039;ll use the [[Language - Java|Java Hello World]] example code.  You can download the HelloWorld example by downloading the whole [{{SERVER}}/downloads/examples/JavaJNI.zip Java example package].  Make sure you have the same version of [[#Installing C/C++ and Java|Java installed on the SBC]] as you have on your external development machine. Instruction for checking and updating are found on the [[#Installing C/C++ and Java|installation page]].&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how to get the HelloWorld code running on the SBC.  On your external computer:&lt;br /&gt;
&lt;br /&gt;
1. Download the SBC version of the Phidget Java libraries ({{Code|phidget21.jar}}).  You can download this from the [[#SBC Web Interface|web interface]], on the page under {{Code|Projects &amp;amp;rarr; Projects}}, under the &#039;&#039;&#039;Notes&#039;&#039;&#039; section.&lt;br /&gt;
&lt;br /&gt;
2. Place the SBC version of {{Code|phidget21.jar}} into a directory on your external computer.  This will be your working directory that you will use to compile the Java files.&lt;br /&gt;
&lt;br /&gt;
3. Also copy the {{Code|HelloWorld.java}} file into that working directory.&lt;br /&gt;
&lt;br /&gt;
4. Compile the {{Code|HelloWorld.java}} file from within that working directory.  From the command line prompt on Windows, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .;phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In a terminal on Linux or Mac OS, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. You should now have three compiled class files: {{Code|HelloWorld.class}}, {{Code|HelloWorld$1.class}}, and {{Code|HelloWorld$2.class}}.  You don&#039;t need to try and run them, and if you do you may encounter an error because the SBC {{Code|phidget21.jar}} may be slightly different than the Phidget support you have installed on your external computer.&lt;br /&gt;
&lt;br /&gt;
Now we move onto the SBC:&lt;br /&gt;
&lt;br /&gt;
6. Create a new project on the SBC, in the web interface under {{Code|Projects &amp;amp;rarr; Projects}}.  Call it HelloWorld:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_create_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
7. On the next screen, you will be prompted to upload your files.  We will upload the three Java class files, and then click the {{Code|Start}} button:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_web_run_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
8. You&#039;ll note that as it runs, there are two links below the {{Code|Stop}} button: One called {{Code|stdout}}, which is &#039;&#039;Standard Output&#039;&#039;, and one called {{Code|stderr}}, which is &#039;&#039;Standard Error&#039;&#039;.  Usually, when you run a program on the command line, you see both standard out and standard error at the same time - i.e. you get all program output right there in your terminal or command prompt.  But when running a program in the background, Linux splits the output up into normal output and error output as this is very useful for debugging (i.e. you can check if standard error is empty).  &lt;br /&gt;
&lt;br /&gt;
Here, however, if you&#039;re not sure whether the program will run correctly, you should first check {{Code|stderr}} to see if any errors were generated, and then check {{Code|stdout}} to see if the output looks as expected.&lt;br /&gt;
&lt;br /&gt;
To write your own Java program, follow the same process but use your own source code instead of the {{Code|HelloWorld.java}} example.&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, we offer additional help on [[#Via the Web Interface|running a program automatically using the web interface]].&lt;br /&gt;
&lt;br /&gt;
====Program with SSH====&lt;br /&gt;
&lt;br /&gt;
Similarly to starting a program via the [[#Program in Java with the Web Interface|web interface]], we use the Phidget Java {{Code|HelloWorld}} example here.&lt;br /&gt;
&lt;br /&gt;
Make sure you have [[#Installing C/C++ and Java|Java installed on the SBC]].  To compile and run the {{Code|HelloWorld}} example:&lt;br /&gt;
&lt;br /&gt;
1. Open an [[#SSH|SSH terminal]] to the SBC&lt;br /&gt;
&lt;br /&gt;
2. Download the [{{SERVER}}/downloads/examples/JavaJNI.zip Phidget Java Examples] to the SBC, using [[#wget|wget]] (you may need to install {{Code|wget}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
3. Unpack the examples using [[#unzip|unzip]] (you may need to install {{Code|unzip}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
4. The location of {{Code|phidget21.jar}} on the SBC is {{Code|/usr/share/java/phidget21.jar}}.  Within the unzipped example directory, compile the {{Code|HelloWorld.java}} example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:/usr/share/java/phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. To run the {{Code|HelloWorld}} program, use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
java -classpath .:/usr/share/java/phidget21.jar HelloWorld&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, you&#039;ll probably want to learn to [[#Running a Program Automatically|run this Java program automatically]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; If you&#039;re used to using Linux with Phidgets already, you&#039;ll probably notice that you don&#039;t need to switch into root using {{Code|sudo}} on the SBC in order to run programs.  This is because you already are running as root, not because the [[OS - Linux#Setting udev Rules|udev rules are set up]].  So if you set up another user, or [[#Via Cron|run a cron job]] as anything other than root or system, you&#039;ll need to add permission for the Phidget program to run in your [[OS - Linux#Setting udev Rules|udev rules]].&lt;br /&gt;
&lt;br /&gt;
====Developing Code on the SBC====&lt;br /&gt;
&lt;br /&gt;
When you&#039;re not just using pre-written source code, and you&#039;re writing code actually on the SBC itself, you&#039;ll probably want to use [[#nano|nano]].  Other terminal editors on the SBC include {{Code|vi}} which is already installed, and {{Code|emacs}}, which you can install using [[#apt|apt]].  Both {{Code|vi}} and {{Code|emacs}} are much more efficient for the experienced user, but they contain modes and keyboard shortcuts that can seem strange or almost hindering to the casual user.&lt;br /&gt;
&lt;br /&gt;
Regardless of which editor you choose to use, some of your keyboard habits may not transfer well.  For example, in the Linux command line, the command {{Code|Ctrl-C}} means &#039;&#039;stop the currently running program&#039;&#039;, (i.e. your open editor) not copy.  Within most SSH terminals, you can copy and paste using the right-mouse button, and on some terminals (and all native Linux terminals) you can copy by simply highlighting text, and you can paste it using the middle (scroll) mouse button.  On the other hand, if you write a program that hangs on the command line, {{Code|Ctrl-C}} can actually be useful to terminate it.&lt;br /&gt;
&lt;br /&gt;
Also {{Code|Ctrl-Z}} does not mean &#039;&#039;undo&#039;&#039;, rather it means &#039;&#039;run the current program in the background&#039;&#039;.  This is useful because running a program in an SSH terminal simply hangs your SSH input until the program is done.  So typing {{Code|Ctrl-Z}} while the program is running frees up the command line for more input.  But if you accidentally hit {{Code|Ctrl-Z}} while running an editor like [[#nano|nano]], the editor will immediately exit to the command line.  Don&#039;t worry though, it will not stop or lose your work.  You can bring it back up by using the {{Code|fg}} (e.g. &#039;foreground&#039;) command, like {{Code|fg nano}}, and this will automatically bring your nano process back to the front.&lt;br /&gt;
&lt;br /&gt;
===Running a Program Automatically===&lt;br /&gt;
&lt;br /&gt;
For testing your program, you will certainly want to run it via [[#SSH|SSH]] or via the {{Code|Start}} button on the project page on the web interface until you are quite sure it runs well.  However, eventually you will probably want the program to run without your input, either [[#Via the Web Interface|continuously, and starting at boot]], or via a task scheduled to [[#Via Cron|run to completion at certain times]].&lt;br /&gt;
&lt;br /&gt;
Both have their advantages and disadvantages.  Usually, you would want to use the continuous, from-boot methods for event driven code that has to handle a wide variety of user input that could occur at any time.  You would want to use the scheduled method when the SBC needs to perform a repeated task (e.g. reading sensor data) again and again.  The main difference is:&lt;br /&gt;
* With the continuous (boot) method you can have any Phidgets (including sensors, LEDs, input switches, etc) attached and giving events to your code all the time, and&lt;br /&gt;
* With the scheduled (cron) method you have much less of a chance to run into long-term memory management and instability problems with any code you write, because your program runs for only a short time before exiting and getting cleaned up.&lt;br /&gt;
&lt;br /&gt;
====Via the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To use this method, you must have created the program you want to run as [[#Program in Java with the Web Interface | a Java or ARM-compiled C project in the web interface]].  If you would like to use another language, or another way of uploading your project, but you still want to start at boot and run continuously, you will need to use a [[#Via a Boot Script|boot script]].&lt;br /&gt;
&lt;br /&gt;
In the web interface, go to the {{Code|Projects}} tab, and click on the project you would like to run.  Near the bottom of the project page (the one with the {{Code|Start}} and {{Code|Stop}} buttons at the top), there will be a section called {{Code|Startup Settings}}.  You can see a screenshot of the whole project page, including these settings, in the [[#Program in Java with the Web Interface | web interface project section]].&lt;br /&gt;
&lt;br /&gt;
Select the {{Code|Enabled}} radio button.  The other defaults should be fine, unless you specifically know otherwise:&lt;br /&gt;
* For &#039;&#039;Boot Order&#039;&#039;, lower numbers boot first.  Booting later means more programs are available for use, booting earlier means other programs can use your program.  &lt;br /&gt;
* &#039;&#039;Run as a daemon&#039;&#039; starts the program as a daemon, which is a program that runs in the background.  Unless you have &#039;&#039;explicitly&#039;&#039; written your program as a daemon, leave this checked.  (If you don&#039;t know what a daemon is, don&#039;t worry, you haven&#039;t written one, so leave it checked.)  &#039;&#039;Un&#039;&#039;checking this when your program is a normal program will cause the SBC to hang while booting.&lt;br /&gt;
* The &#039;&#039;Executable or Class&#039;&#039; name should be automatically sensed to be your main Java class&lt;br /&gt;
* &#039;&#039;Arguments&#039;&#039; are any command line arguments you need, just as you would type them into the command line&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Your program must be very, very stable to run properly via the web interface.  Imagine your program running continuously for days, or months on end.  Any memory leaks, over time, will render your program (and the SBC) unusable until a reboot.  Counts or other variables that increase within your program and never reset may create a segmentation fault eventually.&lt;br /&gt;
&lt;br /&gt;
If, for stability purposes, you want your program to start, run for a little while, and then exit so that the SBC operating system can clean up the memory each time, you&#039;ll probably want to use [[#Via Cron|Cron]] to run your program instead.&lt;br /&gt;
&lt;br /&gt;
====Via Cron====&lt;br /&gt;
&lt;br /&gt;
Cron can automatically schedule programs - known as &#039;jobs&#039;, or &#039;cron jobs&#039; - at most once per minute.  Less often than that, it is very flexible, allowing you to run it on certain months, weekdays, hours, etc.  Cron simply reads a special file (your {{Code|crontab}}) and runs whatever programs are listed, with whatever timing they are listed with.  The cron program runs all the time in the background, making it what is known as a Linux &#039;&#039;daemon&#039;&#039;, but the programs it starts as jobs run only as long as they naturally would, and then they exit.&lt;br /&gt;
&lt;br /&gt;
If you need your program to run more often than once per minute, have the program schedule itself while still running.  For example, to run every five seconds, run a fast loop,  and sleep for five seconds. Do this twenty times and exit.  Then schedule this once per minute using cron, and your program will in essence run every five seconds.&lt;br /&gt;
&lt;br /&gt;
Setting up a cron job simply entails editing your {{Code|crontab}} file.&lt;br /&gt;
&lt;br /&gt;
First, you&#039;ll probably want to specify your default editor to be [[#nano|nano]]. Otherwise it will default to {{Code|vi}} and you&#039;ll have to figure out {{Code|vi}} in order to add lines to your crontab:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
export EDITOR=nano&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to edit your crontab file, simply type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
crontab -e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each line of the crontab file is one scheduled job.  Lines that start with a hash &amp;quot;#&amp;quot; are comments and are ignored.  There is an example line in the crontab, and a reminder line at the very end.  Essentially, each line should contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
minute hour dayOfMonth month dayOfWeek  command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*{{Code|command}} is the program you want to run (with absolute path, and arguments)&lt;br /&gt;
** For example, {{Code|./myprogram argument1}} won&#039;t work, but {{Code|/root/code/myprogram argument1}} will&lt;br /&gt;
* Each time argument is either a number, a list of numbers separated by commas, or an asterisk&lt;br /&gt;
** For example, * * * * * means every minute for all days and months, 0,30 * * * * means every thirty minutes (i.e. at the top of the hour and at 30 minutes in) for all days and months&lt;br /&gt;
&lt;br /&gt;
If you already have jobs scheduled, you&#039;ll see them in the file that comes up.  You can edit, add, or delete.  &lt;br /&gt;
&lt;br /&gt;
After you save, you&#039;ll see a little message back in the terminal that says the new crontab file was installed, and it is now scheduled!  Cron always starts every boot, and so if you have edited and installed your crontab as above, the scheduling of your program will start properly even after a reboot of the SBC.  However, if you are having strange scheduling problems, you may want to familiarize yourself with the [[#Software Details|software details]] of how the SBC as a whole determines the current date and time.&lt;br /&gt;
&lt;br /&gt;
=====My Cron Job Doesn&#039;t Work!=====&lt;br /&gt;
&lt;br /&gt;
It is actually very common for a script or program to work on the command line but then &#039;&#039;not&#039;&#039; work as a cron job.  The most common reason for this, by far, is that you specify &#039;&#039;relative&#039;&#039; paths in your program to access files rather than &#039;&#039;absolute&#039;&#039; paths.  For example:&lt;br /&gt;
* {{Code|code/project.c}} is a relative path (bad for cron)&lt;br /&gt;
* {{Code|/root/code/project.c}} is an absolute path (good for cron)&lt;br /&gt;
The cron jobs are &#039;&#039;not&#039;&#039; executed from your home directory, or your code directory, so they will not be using the same location you may be using to test your code.  So always use absolute paths.&lt;br /&gt;
&lt;br /&gt;
Another common reason is you may be using environment variables or other settings that are true in a terminal but are &#039;&#039;not&#039;&#039; true by default in the raw system.  You can end up taking many things for granted in a shell, for example the shortcut &amp;quot;~&amp;quot; means home directory in a shell, but not by default in the raw system.  The things that get loaded for a shell (but which are not present in the raw system) are:&lt;br /&gt;
* The settings loaded by {{Code|/etc/profile}}&lt;br /&gt;
* Any settings in {{Code|~/.bashrc}}, which is nothing by default on the SBC&lt;br /&gt;
&lt;br /&gt;
On a full Linux operating system, you would use the logs written to by cron to find the error output and debug it.  On the SBC, however, cron does not write logs (otherwise, these logs would eat up the SBC memory very quickly even for routine jobs).  For short-term debugging, you can write output from your program to a file, and read that file afterwards to figure out what your program is doing.&lt;br /&gt;
&lt;br /&gt;
====Via a Boot Script====&lt;br /&gt;
&lt;br /&gt;
If you want to run your program constantly and for it to start at boot like the [[#Via the Web Interface|web interface would do]], you can install your program into the boot order using a script.  This is a somewhat involved process, and you should be familiar with shell programming in Linux.  For this process, we only offer a [[OS - Linux#As A Service|similar example]] which installs and runs the program {{Code|phidgetwebservice21}} within the boot sequence.&lt;br /&gt;
&lt;br /&gt;
===Using USB Data Keys===&lt;br /&gt;
&lt;br /&gt;
After plugging the USB key in, it won&#039;t just appear on your desktop, so to speak, so you&#039;ll need to figure out where you can read and write to it within the SSH directory structure.&lt;br /&gt;
&lt;br /&gt;
The web interface program can help with this.  After you plug a USB key in, it will show up under {{Code|Status &amp;amp;rarr; System}}.  Or, the USB key and all other attached devices can be seen at {{Code|Status &amp;amp;rarr; USB}}:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_mounted_devices.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
In the screenshot above, you can see that the USB key is located in {{Code|/media/usb0}}.&lt;br /&gt;
&lt;br /&gt;
Alternately, you can use the SSH command {{Code|mount}}, and the searching program {{Code|grep}} which will filter the response of {{Code|mount}} and only return the lines with your search term ({{Code|usb}}):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep usb&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the USB key can be written to and read from using the {{Code|/media/usb0}} directory.  Copying a file to {{Code|/media/usb0}} will copy a file to the USB key.  The same goes for removing, renaming, opening files within your program, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Mount points like {{Code|/media/usb0}} should not be hard-coded into any of your programs.  (See the [[#Common Problems and Solutions | Common Problems and Solutions]] section for more information.)  If you need to obtain the mount point for a freshly mounted USB key within your code, have your code obtain the mount tables and search on the &#039;&#039;device&#039;&#039;  (e.g. {{Code|/dev/sda1}} or {{Code|/dev/sdb1}}) and obtain the corresponding mounted {{Code|/media/usbN}} location, where N is a number 0-9.&lt;br /&gt;
&lt;br /&gt;
===Saving and Retrieving Data===&lt;br /&gt;
&lt;br /&gt;
This section covers getting data on and off of the SBC.  There are two main methods of simply moving data on and off the SBC - via a [[#Via a USB Key|USB key]], and via [[#Over the Network (SCP)|copy over the network]] - and a third method for moving and installing data when it concerns [[#Backing Up Your Data|backing up lower level system data]].&lt;br /&gt;
&lt;br /&gt;
====Via a USB Key====&lt;br /&gt;
&lt;br /&gt;
After plugging in a USB data key, first you need to [[#Using USB Data Keys | find out the location]] where that data key was mounted.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the location of the USB key is {{Code|/media/usb0/}}, and we want to copy the file {{Code|data.txt}} to the USB key.  Your SSH session might look something like this, using [[#ls|ls]] and [[#mount|mount]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# ls&lt;br /&gt;
data.txt&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
root@phidgetsbc:~# cp data.txt /media/usb0/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cp&#039;&#039;&#039; program copies data from a source to a destination.  The syntax is {{Code|cp from to}}, where here we are copying from {{Code|data.txt}} to {{Code|/media/usb0/}}.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caution:&#039;&#039;&#039; Even if there is no USB key mounted at {{Code|/media/usb0/}}, this use of {{Code|cp}} will still work &#039;&#039;with no errors&#039;&#039;!  This is because there is still a file called {{Code|/media/usb0/}}, there is just no USB key file system &#039;&#039;mounted&#039;&#039; to that point.  So be sure to run [[#mount|mount]] or use some other method of determining that there is, in fact, a USB data key attached and where it is mounted to.&lt;br /&gt;
&lt;br /&gt;
====Over the Network (SCP)====&lt;br /&gt;
&lt;br /&gt;
SCP is a command line program already installed on Linux and Mac OS, and downloadable for free on Windows.  We discuss it and give examples in the [[#SSH|SSH]] section, but remember it here when you&#039;re trying to get data on and off of the SBC.  With SSH or a terminal already open, you&#039;ll probably find it to be much faster and easier than dealing with a USB key.&lt;br /&gt;
&lt;br /&gt;
====Backing Up Your Data====&lt;br /&gt;
&lt;br /&gt;
For the web interface, you can save and restore all web interface settings under the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} tab.&lt;br /&gt;
&lt;br /&gt;
To save the settings of what packages are installed for later re-installation, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg --get-selections &amp;gt; installedPrograms.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then save the file {{Code|installedPrograms.txt}} externally.  If you have to completely wipe the SBC, you can just reinstall the whole list by moving the {{Code|installedPrograms.txt}} file back onto the SBC, and then typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg –set-selections &amp;lt; installedPrograms.txt&lt;br /&gt;
apt-get dselect-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also remember to externally save:&lt;br /&gt;
* Your {{Code|~/.bashrc}} settings file if you&#039;ve changed it&lt;br /&gt;
* Your {{Code|crontab}} file if [[#Via Cron|you&#039;ve edited it]]&lt;br /&gt;
* Any data files or code you&#039;ve created&lt;br /&gt;
&lt;br /&gt;
It is important to save these settings often, and at points where you know the system is running well.  It may be tempting to create a backup right before you [[#Recovery System|wipe the SBC and start from scratch]], but often the reason you are having problems then is some setting or change, and backing these up and reinstalling them will only reinstall the problem.&lt;br /&gt;
&lt;br /&gt;
To truly back the files up, you must copy them to an external computer or location using either a [[#Via a USB Key|USB Key]] or [[#Over the Network (SCP) | over the network]].  Then they can be copied back if needed later.&lt;br /&gt;
&lt;br /&gt;
If you are looking to restore data on an SBC that will not boot properly, you&#039;ll want to be in the [[#Partial Recovery|partial recovery]] portion of our Troubleshooting section.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
The SBC can be quite tricky to debug, because it is a complex and flexible computer.  Common problems and solutions include:&lt;br /&gt;
* You can&#039;t find the SBC on the network at all - refer to the [[#Initial Internet Setup|Initial Internet Setup]] section&lt;br /&gt;
* You have changed some setting or file such that the SBC doesn&#039;t run anymore, or doesn&#039;t run as expected - refer to the [[#Recovery|Recovery]] section&lt;br /&gt;
&lt;br /&gt;
If you are having trouble using Phidgets on the SBC, you should go through the [[OS - Linux#Troubleshooting | Troubleshooting section on the general Linux page]].  Some of the problems on the Linux page (such as library problems) are easier to fix by simply working through the [[#Recovery|Recovery]] section when they occur on the SBC.&lt;br /&gt;
&lt;br /&gt;
Namely, it often helps to simply perform a [[#Factory Reset|factory reset]] on the SBC (save your files and installed program list first, as [[#Backing Up Your Data|described here]]).  Sometimes you change a file or setting within the operating system when you are trying to get something up and running, and this unintentionally affects other programs too.  Performing a factory reset starts you with a clean slate.&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, or the information within this guide, please [[Contact Us|ask us]]!&lt;br /&gt;
&lt;br /&gt;
===Initial Internet Setup===&lt;br /&gt;
&lt;br /&gt;
To set up the SBC, you almost always need a &#039;&#039;wired&#039;&#039; Ethernet connection with DHCP (Dynamic Host Configuration Protocol), and without a firewall.  This connection should be to a &#039;&#039;router&#039;&#039;, not directly plugged in to your computer.&lt;br /&gt;
&lt;br /&gt;
Even if you do not have this type of a connection at home, these types of connections are very common at both offices and universities.  On a Windows or Mac OS computer, you can bring up the [[Phidget Control Panel]] as described in the SBC&#039;s [[1072 User Guide#Getting Started|Getting Started Page]].  Failing this, or on a Linux computer, we discuss some alternate setup methods in this section.  Keep in mind that without a wired, open DHCP connection these setup methods can be difficult and fickle. &lt;br /&gt;
&lt;br /&gt;
====No Wired-Only Connection====&lt;br /&gt;
&lt;br /&gt;
Sometimes it can work to plug the SBC, using Ethernet, directly into an Ethernet port on your home wireless router.  Do not plug it directly into your computer!  (Although in some instances, a direct connection can be made to work on Linux, see the [[#No DHCP|No DHCP]] section below) &lt;br /&gt;
&lt;br /&gt;
This direct-router method is a very picky process, however, and can fail because:&lt;br /&gt;
* Some home and office routers place a firewall between wireless connections (clients) and wired connections (the local area network)&lt;br /&gt;
* Some home and office routers do not by default allow both Ethernet DHCP and wireless DHCP.&lt;br /&gt;
* Some routers and DHCP hubs only provide access to an internet connection, and do not provide local area network inter-connections (this is common on mobile device tethering hubs)&lt;br /&gt;
&lt;br /&gt;
Routers are quite complex, and even with admin privileges it can be a painstaking process to find all the right firewall settings to turn off in order to allow two computers on the network to talk to one another, rather than just connect to the internet.  This is why university or office networks are often ideal for the purpose of setting up the SBC, because these institutions depend on computers on a local network being able to talk together.  University libraries in particular can be a good source of wired DHCP connection ports.  &lt;br /&gt;
&lt;br /&gt;
Covering all of the different router configuration possibilities here, and how to change them to make the SBC work, is essentially impossible.  If you try using the SBC at home or at work, the SBC does not work on the first try when plugged directly into the router via Ethernet, and you want to make that connection work rather than seeking out an alternate for the initial setup, you should find documentation specific to your router (usually available online) and properly configure it.&lt;br /&gt;
&lt;br /&gt;
The good news is that if you can find an Ethernet DHCP connection &#039;&#039;just once&#039;&#039; for a short time, you can use that connection to configure the SBC to work on your home wireless network.  During that initial connection, you can enable wireless and set up as many wireless DHCP connections (with passwords) that you need.  Once wireless is enabled and set up, you can take the SBC home to your wireless router and the SBC will automatically seek out and connect to its remembered networks as they appear.  At that point, you can also use wireless like a normal internet, web interface, and SSH connection.&lt;br /&gt;
&lt;br /&gt;
====No Link Local Addressing====&lt;br /&gt;
&lt;br /&gt;
If you have a wired DHCP connection, no firewall, and no link local addressing (e.g. bonjour or avahi is not installed) then you will need access to the DHCP router logs.  From the router logs, you should see the connection (or attempted connection) by the SBC within the logs.  From that log entry, you should either be able to determine the IP address for the SBC, or see what happens when the router blocks access.  The IP address can be used in place of the link local address for both the web interface and for SSH.&lt;br /&gt;
&lt;br /&gt;
====No DHCP====&lt;br /&gt;
&lt;br /&gt;
The SBC will first try to use DHCP, but then it will revert to responding to a link local address under bonjour and avahi.  If you are depending on this, please wait &#039;&#039;&#039;at least three minutes&#039;&#039;&#039; after the SBC boots for the SBC to fail in obtaining a DHCP connection and properly revert to link local addressing.&lt;br /&gt;
&lt;br /&gt;
If you have a static IP setup, and want to use link local addressing rather than accessing the router logs, this should usually work by default on Windows and Mac OS (e.g. type the address such as {{Code|phidgetsbc.local}} into a web browser).  If it doesn&#039;t work automatically, there is not much you can do and you should seek out a wired DHCP connection elsewhere.&lt;br /&gt;
&lt;br /&gt;
On Linux, it also should work by default, but you have the additional option of explicitly adding routes that look within the default network settings for the SBC.  From a terminal (as root), type:&lt;br /&gt;
* {{Code|route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0 metric 99}}&lt;br /&gt;
* {{Code|route add default dev eth0 metric 99}}&lt;br /&gt;
You can also compile and use the {{Code|phidgetsbclist.c}} example (use the provided Makefile, don&#039;t use gcc) in the [{{SERVER}}/downloads/libraries/libphidget.tar.gz Phidget Linux Libraries] package, under the {{Code|examples}} folder.  This will allow you to see if the SBC is detected on the network at all.   Note that to use this option you must have the Phidget Libraries and the Phidget WebService installed on your Linux computer - in-depth instructions to do this are on the [[OS - Linux|main Linux page]].&lt;br /&gt;
&lt;br /&gt;
===Recovery System===&lt;br /&gt;
&lt;br /&gt;
You can either boot the SBC into recovery mode and attempt to recover files and settings, or you can completely wipe the SBC by performing a factory reset.  If the LEDs do not turn on normally (red on constantly, green on at first start, then off, then on when fully booted) then you&#039;ll want to read the [[#Hardware Issues|hardware issues]] section.&lt;br /&gt;
&lt;br /&gt;
====Partial Recovery====&lt;br /&gt;
&lt;br /&gt;
The recovery system can be entered in two ways:&lt;br /&gt;
# From the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} web interface page.&lt;br /&gt;
# By holding down the reset button for 20+ seconds - until the green light has switched from flashing slowly to flashing quickly.&lt;br /&gt;
&lt;br /&gt;
The recovery system runs an [[#SSH|SSH]] server where the username and password both are {{Code|root}}.&lt;br /&gt;
&lt;br /&gt;
If the main filesystem has been damaged/misconfigured in such a way that it won’t boot, you may be able to fix the issue or recover important files before running a full factory reset. From an SSH connection to the recovery system, you can mount the main root filesystem with the following commands (assuming it’s not damaged):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
ubiattach /dev/ubi_ctrl -m 6&lt;br /&gt;
mount -t ubifs /dev/ubi0_0 /mnt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Factory Reset====&lt;br /&gt;
&lt;br /&gt;
This restores the kernel and root filesystem from backup, overwriting any changes that may have been made and &#039;&#039;completely wiping the system&#039;&#039; to the state that it got shipped in. (You can save your files and installed program list first, as [[#Backing Up Your Data|described here]].)  This can be enacted one of two ways.&lt;br /&gt;
# Use the reset button:&lt;br /&gt;
##Enter the recovery mode by holding down the reset button for 20+ seconds as above (until fast flashing)&lt;br /&gt;
##Wait for a full boot (i.e. you can see it on the [[Phidget Control Panel]], or can SSH with username and password as {{Code|root}})&lt;br /&gt;
##Hold down the reset button again, but this time for only 10 seconds (until slow flashing)&lt;br /&gt;
##Wait for the SBC to fully reset and reboot (at least three minutes) - the LED will turn off and on again when this occurs&lt;br /&gt;
##*Note that after a factory reboot the SSH server will be disabled&lt;br /&gt;
##*Also note that after a factory reboot the SBC creates new SSH keys, and reverts to the {{Code|phidgetsbc.local}} address&lt;br /&gt;
# Via the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, where you can follow the instructions&lt;br /&gt;
&lt;br /&gt;
====Hardware Issues====&lt;br /&gt;
&lt;br /&gt;
The LEDs are an indicator of the hardware working properly.  The normal boot process is:&lt;br /&gt;
* Red LED: Turns on from moment of power being applied.&lt;br /&gt;
* Green LED: Turns on momentarily when power applied, then turns off momentarily, then turns on and stays on when booted.&lt;br /&gt;
&lt;br /&gt;
If the green status LED never turns on (or fails to turn on the second time), the boot process is failing somewhere.  This could be due to:&lt;br /&gt;
* A damaged OS - Try performing a [[#Factory Reset|Factory Reset]]&lt;br /&gt;
* If this fails, it is likely hardware damage (very difficult to diagnose, please [[Contact Us|contact us]])&lt;br /&gt;
&lt;br /&gt;
If neither LED turns on, hardware damage is even more likely.  Unless the path to the red LED is the one thing that has been damaged, the device is likely not receiving and using power.&lt;br /&gt;
* Try performing a [[#Factory Reset|Factory Reset]], and if that does not work please [[Contact Us|contact us]]&lt;br /&gt;
&lt;br /&gt;
=====USB Issues=====&lt;br /&gt;
&lt;br /&gt;
On the Phidget SBC2, there is a hardware issue that is unrelated to the LEDs.  It is a USB problem, and manifests in many ways:&lt;br /&gt;
* Strange behaviour when some devices but not others are plugged in to the SBC&lt;br /&gt;
* Strange behaviour with combinations of devices&lt;br /&gt;
* Failure (or intermittent failure) to see Phidgets on the USB hub, or USB keys on the hub&lt;br /&gt;
&lt;br /&gt;
This problem is fixable, either on your own or by sending your SBC back to Phidgets.  For an in-depth solution, see the [[SBC2_USB_Hub_Fix | SBC2 Hub Fix Page]].&lt;br /&gt;
&lt;br /&gt;
===Updating Your SBC===&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve owned your SBC for a while and want to update your packages, you can run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...to &#039;&#039;update&#039;&#039; your software source list and then &#039;&#039;upgrade&#039;&#039; to the latest version of all installed software.  If you are used to Mac OS or Windows, note that this does not just update the non-kernel parts of the operating system, it updates every additional piece of software you have installed.&lt;br /&gt;
&lt;br /&gt;
To update the SBC software itself (e.g. the kernel), it is easiest to use the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, to enter a page that will give you the option to update.  You will need to have an update file on a USB key inserted into the SBC, of type:&lt;br /&gt;
* UBI Image (system_ubi.img), or &lt;br /&gt;
* Kernel image (uImage), or&lt;br /&gt;
* Phidget Upgrade package containing both UBI and Kernel images (phidgetsbc*.bin)&lt;br /&gt;
&lt;br /&gt;
These are either obtained from the Phidgets website, or are a custom kernel / filesystem that you can create yourself, if you are experienced.&lt;br /&gt;
&lt;br /&gt;
The reason why this information is in troubleshooting is that you should certainly [[#Backing Up Your Data|back up your system]] before trying this.  And, it is quite rare to need to upgrade the kernel or filesystem on the SBC, so something serious should be going on before you attempt it.  Try using the [[#Recovery System|recovery system]] first.&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
Now that you have the basic libraries installed, you can pick your language and begin programming!  &lt;br /&gt;
&lt;br /&gt;
If you are not using the [[#WebService | webservice]] to control a Phidget over a network, your next step will be to delve into the use of your specific language.  Each page has its own set of specific libraries, code examples, and setup instructions.  &lt;br /&gt;
&lt;br /&gt;
On SBC Linux, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Java | Java]]&lt;br /&gt;
*[[Language - Python | Python]]&lt;br /&gt;
&lt;br /&gt;
These languages may also run on the SBC, but we do not yet directly offer SBC support for them:&lt;br /&gt;
* [[Language - Ruby|Ruby]]&lt;br /&gt;
* [[Language - C Sharp|C#]] (using Mono)&lt;br /&gt;
&lt;br /&gt;
You can probably figure out how to install and use them by a combination of the language pages linked above, and the section on [[#Installing Other Languages|installing other languages on the SBC]].&lt;br /&gt;
&lt;br /&gt;
==WebService==&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the [[Phidget WebService]] installed, and the SBC automatically starts the WebService at boot.&lt;br /&gt;
&lt;br /&gt;
To practice using the WebService, and to learn more about it, we have hands-on examples on the [[OS - Linux|general Linux page]], starting in the [[OS - Linux#Using the WebService|using the WebService section]].&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Shutting off USB ports to save power===&lt;br /&gt;
The SBC3 has an on-board USB hub that can control power to the ports. To do this unbind and rebind the USB drivers.&lt;br /&gt;
&lt;br /&gt;
To turn off the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/unbind}}&lt;br /&gt;
&lt;br /&gt;
To turn on the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/bind}}&lt;br /&gt;
&lt;br /&gt;
These will also cause detach and attach events for the Phidget devices, respectively. While the drivers are unbound, you will not get any hot plug events for any devices on USB.&lt;br /&gt;
&lt;br /&gt;
===Using a Touchscreen===&lt;br /&gt;
Please note that this will ONLY work with an SBC3 since it has a USB 2.0 hub:&lt;br /&gt;
&lt;br /&gt;
Using a touchscreen with the SBC is a great way to get user input and visual feedback from an SBC otherwise devoid of visual output.  The SBC does not have any conventional display ports such as VGA, DVI, or HDMI but it does have a number of USB ports and USB displays do exist.  With the upgrade to a USB 2.0 hub on the SBC3 from the earlier models which had USB 1 hubs the SBC now has enough capability to operate a screen over USB.  We don&#039;t recommend running a standard desktop environment since the processor is too slow to really keep up with a typical desktop it does make for an excellent interface for a kiosk, instrumentation control panel or  other, similar use case.  This document is going to go through the process of enabling support for a typical USB display as well as installing a fairly compact desktop environment called xfce on the SBC.  &lt;br /&gt;
&lt;br /&gt;
The screen I will be using is from a company called [http://lilliputweb.net/ Lilliput].  Specifically a UM-70 model.  Before you begin, please make sure that you have the screen plugged into the SBC, it will also be useful to have a spare USB keyboard and mouse handy as you will need them once you are no longer using an SSH terminal to communicate with the SBC.&lt;br /&gt;
&lt;br /&gt;
[[File:lilliputoff.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Getting the display to function====&lt;br /&gt;
Begin by logging into the web configuration page for your SBC and upgrading all of the packages on the SBC.  Be sure to include the full Debian package repository.  For more information on how to do this refer to the  [[OS - Phidget SBC#Getting Started - External Computer|getting started]] section of the Phidget SBC documentation.  Once you are fully up to date open an SSH session with the SBC and navigate to the &amp;quot;/etc&amp;quot; folder.  Open inittab with a terminal-based text editor such as nano and add the following to the bottom of the file, just above the {{code|T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100}} line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
1:2345:respawn:/sbin/getty 38400 tty1 &lt;br /&gt;
2:23:respawn:/sbin/getty 38400 tty2 &lt;br /&gt;
3:23:respawn:/sbin/getty 38400 tty3 &lt;br /&gt;
4:23:respawn:/sbin/getty 38400 tty4 &lt;br /&gt;
5:23:respawn:/sbin/getty 38400 tty5 &lt;br /&gt;
6:23:respawn:/sbin/getty 38400 tty6 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reboot your system.  After a few minutes you should see the LCD screen come up with a standard Linux terminal interface and a login prompt.  This is all well and good but this isn&#039;t really appreciably better than simply using an SSH session to communicate with the SBC.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputlogin.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Setting up Xfce====&lt;br /&gt;
In order to get a traditional windowing environment we still need to install a desktop manager as well as a number of supporting packages.  Log in and make sure everything is still up to date with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install the following packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xserver-xorg lxde xfce4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the SBC asks you if you want to continue, just type &amp;quot;Y&amp;quot; and press enter.  &lt;br /&gt;
&lt;br /&gt;
This will install the xfce desktop environment and any other necessary programs on the SBC.  When it&#039;s done, restart the SBC.  When it boots back up it should boot directly to a login screen instead of the terminal interface.  Log in, and you are good to go.  It won&#039;t be particularly fast, but don&#039;t worry, the SBC does not have a dedicated video processor on it so it&#039;s perfectly normal for it to be slow.  What&#039;s important is that it works.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputdesktop.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Calibrating the touch screen====&lt;br /&gt;
Unfortunately, by default the screen is calibrated to believe the bottom of the screen is on the right hand side.  This has the effect of making the touch functionality more or less useless until it has been properly calibrated.  To do this, install the following package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xinput-calibrator&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now use xinput calibrator to measure the parameters of your screen.  Launch xinput calibrator (called Calibrate Touchscreen in the programs menu) and follow the instructions on the screen.  The screen should now be functioning at full potential.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Using a Different Wireless Adapter===&lt;br /&gt;
&lt;br /&gt;
The support for the wireless adaptor that Phidgets sells is written into the SBC kernel.  Hence, we do not support using other adaptors. &lt;br /&gt;
&lt;br /&gt;
However, Linux is very flexible, and it is possible (though not easy) to write a custom kernel for the SBC and add support for a new wireless adaptor.  We can&#039;t help you with this, but we do provide some basic guidelines for [[#Custom Kernel and Filesystem|building your own kernel]].  You can also have a look at our thoughts on our own experience with choosing a Wifi adapter: [[Alternative Wi-Fi Adapters on the SBC]].&lt;br /&gt;
&lt;br /&gt;
===Using a Different Webcam===&lt;br /&gt;
&lt;br /&gt;
In addition to the webcam that Phidgets sells, you have the option to use many different webcams with the SBC.  There is a [http://www.ideasonboard.org/uvc/#devices long list] of compatible webcams.&lt;br /&gt;
&lt;br /&gt;
The common thread for these webcams is that they use UVC - the USB Video Class - drivers for Linux.  You can then use [[#mount|mount]] to find out what video device your webcam is mounted under.&lt;br /&gt;
&lt;br /&gt;
===Taking Pictures With the Webcam===&lt;br /&gt;
&lt;br /&gt;
Probably the most straightforward way to use a webcam for pictures rather than video is to use the {{Code|opencv}} library.  You can get it by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libcv2.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there is no {{Code|libcv2.1}} package, you can perform {{Code|apt-cache search libcv}} to find the current version.&lt;br /&gt;
&lt;br /&gt;
The opencv libraries can also be used within Python, by installing the link between them:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python-opencv&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then taking pictures from within code becomes quite simple.  For example, in Python, taking and saving an image is four lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
#! /usr/bin/python&lt;br /&gt;
&lt;br /&gt;
import cv&lt;br /&gt;
&lt;br /&gt;
# The webcam is located at /dev/video0 &lt;br /&gt;
# OpenCV only needs the number after video&lt;br /&gt;
webcam = cv.CaptureFromCAM(0)&lt;br /&gt;
&lt;br /&gt;
frame = cv.QueryFrame(webcam)&lt;br /&gt;
&lt;br /&gt;
cv.SaveImage(&amp;quot;image.jpg&amp;quot;, frame)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the complete OpenCV documentation, see [http://opencv.willowgarage.com/documentation/index.html The OpenCV Reference], and specifically the section on [http://opencv.willowgarage.com/documentation/reading_and_writing_images_and_video.html Reading and Writing Images].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The SBC is probably not as powerful for image processing and transport when compared to your desktop computer.  Try running your image processing code on the SBC from an early point in development.  During those test runs, you can visit the first System page of the [[#SBC Web Interface|SBC Web Interface]] to check the processor and memory use.  For more information on processor power, check the specification for your SBC (on the product page on [{{SERVER}} our main website]) as well as our discussion of [[#Pushing Processor Limits|pushing processor limits]] below.&lt;br /&gt;
&lt;br /&gt;
===Checking System Logs===&lt;br /&gt;
&lt;br /&gt;
The SBC maintains two logs: a kernel log and a system log.  &lt;br /&gt;
&lt;br /&gt;
The kernel log is for low-level occurrences, such as devices attaching and leaving the USB hub, recording what drivers are being used, and so on.&lt;br /&gt;
&lt;br /&gt;
The system log (syslog) is for normal chatter from the operating system.  Any program with the right permissions can use it (though you need to know the method to write to it, information all around the Internet can help) and it contains everything from the Ethernet going up and down, to webserver requests, and so on.  If you don&#039;t run many programs or services on the SBC, the syslog will essentially be a mirror of the kernel log, because the kernel is the only thing talking.&lt;br /&gt;
&lt;br /&gt;
You can check these logs by using the web interface in the {{Code|System &amp;amp;rarr; Logs}} tab.&lt;br /&gt;
&lt;br /&gt;
Or you can perform more powerful filtering and displaying via an SSH terminal.  For example, {{Code|dmesg}} is the command to display the kernel log, and {{Code|tail}} prints the last ten lines of input.  So, if you are trying to see if you can get a device to be detected on USB, you can run &amp;lt;code&amp;gt;dmesg | tail&amp;lt;/code&amp;gt; to print the latest ten lines of kernel log data.&lt;br /&gt;
&lt;br /&gt;
The actual locations of the log files (for filtering and reading) are:&lt;br /&gt;
* {{Code|/var/log/syslog}} &lt;br /&gt;
* {{Code|/var/log/dmesg}}&lt;br /&gt;
But don&#039;t edit them directly!  Always follow the advice and procedures around the Internet on how to properly log items to syslog.&lt;br /&gt;
&lt;br /&gt;
===X Forwarding===&lt;br /&gt;
&lt;br /&gt;
Although most tasks can be done using the [[#SBC Web Interface|SBC Web Interface]] or [[#SSH|SSH]], you can also set up X11 forwarding on the SBC.  X11 is the window manager base, which provides a graphical windowing system on the SBC.  Although you probably won&#039;t connect directly to the X11 manager (i.e. by plugging a screen directly into the SBC), X11 also gives a user the ability to forward graphical windows over SSH.  You will need the following packages installed:&lt;br /&gt;
* {{Code|x11-common}}&lt;br /&gt;
* {{Code|xbase-clients}}&lt;br /&gt;
After installing, make sure that the line in {{Code|/etc/ssh/sshd_config}} has a line that says:&lt;br /&gt;
:{{Code|X11Forwarding yes}}&lt;br /&gt;
Then log out and log back into the SBC.  This second time you log in, use the {{Code|-X}} switch to turn on X forwarding for that connection:&lt;br /&gt;
:{{Code|ssh -X root@phidgetsbc.local}}&lt;br /&gt;
Then you should be able to run programs that launch a window, and it will launch remotely and appear on the computer you have the SSH connection from.&lt;br /&gt;
&lt;br /&gt;
===Pushing Processor Limits===&lt;br /&gt;
&lt;br /&gt;
The SBC, though more powerful than many embedded computers out there, is probably about as powerful as your smartphone.  If you hook up 1 ms Phidget sampling devices to all six of its USB ports, events and packets will probably get lost.  The exact data rates you can accomplish depend on:&lt;br /&gt;
* What else is running on the SBC&lt;br /&gt;
* How efficient your code is for external operations (like File I/O)&lt;br /&gt;
* Other minor details (e.g. the temperature of the SBC, etc)&lt;br /&gt;
&lt;br /&gt;
If you want to achieve data rates as fast as possible, try these tips:&lt;br /&gt;
* Program in C, not in an interpreted language (Python, Java, .NET)&lt;br /&gt;
* Perform file I/O as little as possible.  Locally cache data, manage your writing to a file in a separate thread, and use low-level write calls.&lt;br /&gt;
* Change the [[#Custom Kernel and Filesystem|filesystem]] to a faster, non-compressed file system.&lt;br /&gt;
** Alternatively, use a high-data-rate USB key.&lt;br /&gt;
* Keep other running processes to a minimum. &lt;br /&gt;
** If you are running code locally right on the SBC, turn off the Phidget WebService.&lt;br /&gt;
&lt;br /&gt;
===Custom Kernel and Filesystem===&lt;br /&gt;
&lt;br /&gt;
You can compile your own kernel and flash it to the board. It is left up to the user to configure an appropriate cross-compiler for kernel development. You may also be able to compile a new kernel on-board.  We have a kernel development kit, complete with patch file and README:&lt;br /&gt;
* [{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Compiling a new, custom kernel is somewhat complex.  If the SBC is your first experience with Linux, writing a custom kernel will be difficult.  However, it will probably also be very rewarding because you can put whatever you like into it.  We might be able to offer additional suggestions, but ultimately you&#039;re on your own here. &lt;br /&gt;
&lt;br /&gt;
You may be able to write a custom kernel right on the SBC, but the easiest way is to develop the kernel on an external computer.  And the easiest way to develop on an external computer is for that computer to also be Linux, even just in a Virtual Machine.  The time spent loading a copy of Linux into a virtual machine (such as VirtualBox, which is free) onto your computer will probably be less time than setting up a standard compiler on Windows to cross-compile.&lt;br /&gt;
&lt;br /&gt;
On your external Linux system, you will need:&lt;br /&gt;
* A cross-compiling toolchain for the ARM processor, which we briefly describe on the [[OS - Linux#Cross-Compiling with a Custom Toolchain | main Linux page]], and &lt;br /&gt;
* The [{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package] from the Phidgets website.  &lt;br /&gt;
The kernel development kit has a brief README file which describes how to obtain the proper kernel and patch, configure, customize, and build it.&lt;br /&gt;
&lt;br /&gt;
We have an application guide in progress, which walks through building a custom kernel to add Bluetooth support to the SBC.  Please contact us if you would like more information.  Even if you are trying to add support for hardware other than a bluetooth modem, or wondering if support even exists in the kernel for your modem (3G, alternate wireless, etc) you will probably find the application guide helpful.  Follow it up to the point where you run the program {{Code|menuconfig}} (you don&#039;t need an SBC to do this), which will give you a menu of all drivers you can enable in the SBC kernel.&lt;br /&gt;
&lt;br /&gt;
After making your new kernel, you should have a uImage and modules target for your Makefile.  At this point you can transfer your kernel files onto the SBC, make their targets, and transfer them into the nand memory.  This involves erasing the old kernel, flashing the new kernel, installing the new kernel modules, and rebooting.  From the SBC, in the kernel directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
make uImage; make modules&lt;br /&gt;
flash-eraseall /dev/mtd3&lt;br /&gt;
nandwrite -p /dev/mtd3 arch/arm/boot/uImage&lt;br /&gt;
make modules-install&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Custom kernels can also be flashed from the [[#Recovery System | Recovery System]].&lt;br /&gt;
&lt;br /&gt;
If you need to create a root filesystem image, the filesystem type is UBIFS, and the commands to create it are:&lt;br /&gt;
&lt;br /&gt;
====For SBC2:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====For SBC3:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You then flash ‘system_ubi.img’ (not ‘system_ubifs.img’) from the recovery system.&lt;br /&gt;
&lt;br /&gt;
Again, like the custom kernel creation, the need to create a custom root filesystem is essentially non-existent except for those advanced users who already know they need it... and furthermore, you are almost entirely on your own.&lt;br /&gt;
&lt;br /&gt;
===Saving a file system to flash to multiple SBC&#039;s===&lt;br /&gt;
You may want to create a complete backup of your SBC root filesystem, which can then be flashed to other SBCs. This is how it could be done:&lt;br /&gt;
&lt;br /&gt;
You will need a USB drive - we have had issues using cheap flash drives, so a real USB drive is recommended. Make sure it&#039;s empty, as it will be reformatted.&lt;br /&gt;
&lt;br /&gt;
All of these commands are executed on your SBC, while logged in over SSH.&lt;br /&gt;
&lt;br /&gt;
First, re-format the USB drive as ext3. Assuming the USB drive is sda and has a single partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
mkfs.ext3 /dev/sda1&lt;br /&gt;
mount -t ext3 /dev/sda1 /media/usb0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remount / as readonly, so it doesn&#039;t change as we&#039;re copying it. To do this, we need to kill all running processes except sshd:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
service udev stop&lt;br /&gt;
service ifplugd stop&lt;br /&gt;
service rsyslog stop&lt;br /&gt;
service avahi-daemon stop&lt;br /&gt;
service phidgetwebservice stop&lt;br /&gt;
service ntp stop&lt;br /&gt;
service busybox-httpd stop&lt;br /&gt;
service dbus stop&lt;br /&gt;
service cron stop&lt;br /&gt;
pkill dhclient&lt;br /&gt;
mount -o remount,ro /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the remount says that / is busy, do a &#039;ps auxww&#039; and &#039;pkill&#039; anything else that may be running until it remounts properly.&lt;br /&gt;
&lt;br /&gt;
Then, copy / to the flash drive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkdir /media/usb0/root&lt;br /&gt;
mount --bind / /mnt/&lt;br /&gt;
cp -a /mnt/* /media/usb0/root/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, clean up the copy - removing files specific to this board. We also remove the APT cache to save space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
find /media/usb0/root/var/log -type f -print0 | xargs -0 rm -f&lt;br /&gt;
rm -rf /media/usb0/root/var/lib/apt/lists/*&lt;br /&gt;
mkdir /media/usb0/root/var/lib/apt/lists/partial&lt;br /&gt;
rm -f /media/usb0/root/var/cache/apt/*.bin&lt;br /&gt;
rm /media/usb0/root/etc/udev/rules.d/70-persistent-net.rules&lt;br /&gt;
rm /media/usb0/root/etc/ssh/ssh_host_*&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
then, create the ubinize.cfg file:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi	&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs0&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi		&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
vol_flags=autoresize	&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: you may need to increase vol_size if your filesystem is larger.&lt;br /&gt;
&lt;br /&gt;
then, create the UBI image from the copy:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then, unmount the drive to ensure everything is written out properly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you can remove the /root/ folder and system_ubifs.img. system_ubi.img can be flashed to other SBCs using the recovery system.&lt;br /&gt;
&lt;br /&gt;
==Software Details==&lt;br /&gt;
&lt;br /&gt;
For even more advanced uses of the SBC, it may help to know the gritty details of the SBC software system.&lt;br /&gt;
&lt;br /&gt;
;Operating System&lt;br /&gt;
:Debian/GNU Linux&lt;br /&gt;
:Kernel 2.6.X or higher (generally kept up to date with latest releases, use {{Code|uname -r}} to check the kernel version)&lt;br /&gt;
&lt;br /&gt;
;Main Filesystem (rootfs)&lt;br /&gt;
:UBIFS (a raw flash type of file system)&lt;br /&gt;
:Mounted in a 460 MB Nand partition (in Read/Write mode)&lt;br /&gt;
&lt;br /&gt;
;Kernel&lt;br /&gt;
:uImage format&lt;br /&gt;
:Has its own 3MiB partition on bare Nand&lt;br /&gt;
&lt;br /&gt;
;Web Interface Scripts and Configuration Data&lt;br /&gt;
:Located in {{Code|/etc/webif}}&lt;br /&gt;
:Modifying these scripts can be done; however, it is very easy to enter invalid data that could cause the system to behave unexpectedly or not boot.&lt;br /&gt;
&lt;br /&gt;
;User Applications uploaded through Web Interface&lt;br /&gt;
:Located in {{Code|/usr/userapps}}&lt;br /&gt;
&lt;br /&gt;
;Webcam Device Location&lt;br /&gt;
:{{Code|/dev/video0}}&lt;br /&gt;
:Numbers increase with more webcams&lt;br /&gt;
&lt;br /&gt;
;Date and Time&lt;br /&gt;
:Set using ntp (network time protocol) at boot&lt;br /&gt;
:The ntp daemon continues to run in the background and will periodically update the clock &lt;br /&gt;
:The network keeps the SBC very close to real time&lt;br /&gt;
:Also there is a real-time clock with battery backup which will preserve date/time across reboots, power removal&lt;br /&gt;
:The real-time clock is synced to system time during reboot/shutdown&lt;br /&gt;
:If power is unplugged suddenly, and the network not restored, the real-time clock may not have the correct time&lt;br /&gt;
&lt;br /&gt;
;Wireless Networking System&lt;br /&gt;
:Wireless adapter support for the wireless adapter that Phidgets sells is written into the kernel&lt;br /&gt;
:It supports WEP and WPA&lt;br /&gt;
:It is best configured through the configuration interface.&lt;br /&gt;
&lt;br /&gt;
;Nand Layout&lt;br /&gt;
:The board contains 512MiB on Nand. This nand is split into 7 partitions as follows:&lt;br /&gt;
:0: u-boot		 size: 256K		 Read Only&lt;br /&gt;
:1: u-boot_env		 size: 128K		 Read Only&lt;br /&gt;
:2: recovery_kernel	 size: 2M		 Read Only&lt;br /&gt;
:3: kernel		 size: 3M		 Writable&lt;br /&gt;
:4: flashfs	 	 size: ~3.625M	 	 Read Only&lt;br /&gt;
:5: recovery_fs		 size: ~ 43M		 Read Only&lt;br /&gt;
:6: rootfs		 size: ~ 460M		 Writable&lt;br /&gt;
: The final size of flashfs/recovery_fs/rootfs depends on the image size at production, and on the number/location of bad blocks in the NAND.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: U-Boot and recovery kernel and filesystem cannot be written from Linux - this is a safety measure.&lt;br /&gt;
&lt;br /&gt;
;Boot Loader&lt;br /&gt;
:U-Boot is used for setting up the processor and booting Linux, and is only accessible via a serial connection. &lt;br /&gt;
:Normal users will not need to use or modify it.&lt;br /&gt;
:Be very careful when modifying the u-boot partition. If it is damaged or overwritten, it is difficult to fix.&lt;br /&gt;
:When using U-Boot, a prompt will appear via serial shortly after power on.  &lt;br /&gt;
:The environment variables will help you determine how to boot Linux on the SBC&lt;br /&gt;
:You can also refer to the [http://www.denx.de/wiki/DULG/Manual U-Boot documentation]&lt;br /&gt;
&lt;br /&gt;
;Boot Process&lt;br /&gt;
:From power on...&lt;br /&gt;
:1. Processor loads first 4 bytes from NAND into Steppingstone and runs it.&lt;br /&gt;
:2. Steppingstone sets up RAM, copies u-boot from NAND into RAM and runs U-Boot.&lt;br /&gt;
:3. U-Boot initializes the processor, sets GPIO state, etc., copies the linux kernel into RAM, sets up the kernel command line arguments, checks that the kernel image is valid, and boots it.&lt;br /&gt;
:4. Linux boots, bringing up USB, Networking, NAND, etc. and then mounts the rootfs NAND partition on /.&lt;br /&gt;
:5. init gets run as the parents of all processes, as uses the /etc/inittab script to bring up the system. This includes mounting other filesystems, settings the hostname, and running the scripts in /etc/init.d, among other things.&lt;br /&gt;
:6. inittab then turns the green LED on.&lt;br /&gt;
:7. inittab then sets up a getty on the first serial port, ready for interfacing using the debug board.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|PHP Curl|Curl doesn&#039;t install smoothly}}&lt;br /&gt;
&lt;br /&gt;
There is an issue with the embedded version of PHP5.3, try forcing it to install the specific version that you need.  This can be done with the following command:&lt;br /&gt;
&lt;br /&gt;
{{Code|apt-get install php5-common&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;5.3.3-7+squeeze14}}&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|FTDI Errors|FTDI adapters do not appear to work with the SBC}}&lt;br /&gt;
&lt;br /&gt;
The 3.1.6 version of the Linux kernel which is used on some versions of the SBC has a bug that causes issues with FTDI drivers and makes them malfunction.  To solve this problem you must upgrade the kernel to a newer version.  You can find the files [[#Quick Downloads| here]].&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|USB Memory Key mounting|Sometimes USB Memory Keys mount at more than one location}}&lt;br /&gt;
&lt;br /&gt;
When you insert a memory key, the SBC will load it as a device (e.g. {{Code|/dev/sda1}}) and it will also &#039;&#039;mount&#039;&#039; the key for reading and writing within the {{Code|/media/}} directory.  The {{Code|/media/}} directory version will be called something like {{Code|usb0}}.  &lt;br /&gt;
At times, an inserted memory key will get mounted in more than one location.  You can observe if this occurs by checking the currently mounted devices with the command {{Code|mount}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
/dev/sda1 on /media/usb1 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will note that the same device ({{Code|/dev/sda1}}) is now mounted at &#039;&#039;both&#039;&#039; {{Code|/media/usb0}} and {{Code|/media/usb1}}.  To fix this problem as it occurs, you can use {{Code|umount}} (notice there is no letter &#039;n&#039;) to unmount the second instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# umount /media/usb1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In practice, this should not be a problem, because writing to or reading from either {{Code|usb0}} or {{Code|usb1}} will have the same effect on the memory key.  However, if you hard-code a media location into your program (i.e. expecting {{Code|/media/usb0}} to be the first USB key you insert and {{Code|/media/usb1}} to be the second key) your program will sometimes work and sometimes fail.  &lt;br /&gt;
&lt;br /&gt;
To get around this within code, find the mount point for each device as it appears.  The devices, such as {{Code|/dev/sda1}} will always refer to the actual memory key.  But, they cannot be written to directly without being mounted, so you will have to parse the mount table (what is returned from {{Code|mount}}) within your code to find the device and its corresponding mount point.&lt;br /&gt;
&lt;br /&gt;
This is a problem with the standard embedded Debian automount program, and we have no known fix.&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|Perl Locale Errors on SSH|No Locales Installed}}&lt;br /&gt;
&lt;br /&gt;
By default, no locales are installed on the SBC.  If you use [[#apt|apt]] a lot to install and manage your software on the SBC, you will get messages like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
perl: warning: Setting locale failed.&lt;br /&gt;
perl: warning: Please check that your locale settings:&lt;br /&gt;
	LANGUAGE = (unset),&lt;br /&gt;
	LC_ALL = (unset),&lt;br /&gt;
	LANG = &amp;quot;en_CA.UTF-8&amp;quot;&lt;br /&gt;
    are supported and installed on your system.&lt;br /&gt;
perl: warning: Falling back to the standard locale (&amp;quot;C&amp;quot;).&lt;br /&gt;
locale: Cannot set LC_CTYPE to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_MESSAGES to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_ALL to default locale: No such file or directory&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To squelch these messages, you should install and reconfigure your locale like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install locales&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command will show you a long list from which you should pick your location, by language.  For example, en_CA is english_Canada.  Here in Calgary, we use en_CA.UTF-8 and so for the first question we would input locale &amp;quot;114&amp;quot; and for the second (system) question we would input {{Code|en_CA}} for the locale.&lt;br /&gt;
&lt;br /&gt;
This might give you a locale undefined error, in which case you can generate the locale (for us, again, it is en_CA):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
locale-gen en_CA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=23723</id>
		<title>OS - Phidget SBC</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=OS_-_Phidget_SBC&amp;diff=23723"/>
		<updated>2015-09-01T17:23:17Z</updated>

		<summary type="html">&lt;p&gt;Patrick: /* Saving a file system to flash to multiple SBC&amp;#039;s */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
{{OSLang|[[File:icon-Linux.png|64x64px|link=OS - Linux]]|On the Single Board Computer (SBC), Phidgets can be either plugged directly into one of the USB ports or run over a network using the [[#WebService | WebService]].}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Unlike our other supported operating systems, the SBC &#039;&#039;&#039;does not require downloads&#039;&#039;&#039; unless you are doing something advanced like loading the firmware or developing your own kernel.  You will know if you need these downloads, otherwise, the SBC should work as described on the [[1073 User Guide#Getting Started|SBC3 Getting Started Guide]] right out of the box.&lt;br /&gt;
&lt;br /&gt;
*[[Software License]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC (1070):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc-minimal.bin Minimal Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc-full.bin Full Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/buildroot-phidgetsbc.tar.gz Buildroot/Kernel Sources]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC2 (1072):&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc2/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc2.bin SBC2 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC2 Kernel Development Package] (How-to and patch file)&lt;br /&gt;
&#039;&#039;&#039;The PhidgetSBC3 has different firmware packages based on the kernel version. In order to determine the device version of your SBC3, see the [[1073_User_Guide#SBC_Web_Interface|web configuration page]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:sbcver.jpg|thumb|562px|link=|The system information table is found on the Status -&amp;gt; System tab of the &#039;&#039;&#039;[[1073_User_Guide#SBC_Web_Interface|web configuration page]]&#039;&#039;&#039; of the SBC.]]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.6.3:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc3/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3_1.0.0.20121213.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-kerneldev_1.0.0.20121213.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-upgrade_3.6.3_3.14.27.tar.gz SBC3 Kernel upgrade package (3.6.3 -&amp;gt; 3.14.27)]&lt;br /&gt;
&#039;&#039;&#039;For PhidgetSBC3 (1073) kernel version 3.14.27:&#039;&#039;&#039;&lt;br /&gt;
*[{{SERVER}}/downloads/sbc3/changelog changelog]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3_1.0.1.20150108.bin SBC3 Firmware]&lt;br /&gt;
*[{{SERVER}}/downloads/libraries/phidgetsbc3-kerneldev_1.0.1.20150108.tar.gz SBC3 Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Note that, instead of using the firmware to update your SBC, updates should normally be done via the System -&amp;gt; Packages page on your SBC3 web interface. It is rarely necessary to completely re-flash your device..&lt;br /&gt;
&amp;lt;br clear = all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Getting Started with the Phidget SBC Debian Linux==&lt;br /&gt;
&lt;br /&gt;
The Single Board Computer (SBC) is a unique Phidget.  It is a computer with a Linux operating system.  It can compile code, save files, manage background jobs, host information over the web, and more.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If this is your first time&#039;&#039;&#039; using the Phidget SBC, you will want to start with the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  After that, here we will get you started on topics beyond those in the getting started guide, including how to write Phidget code to run on the SBC.  You &#039;&#039;&#039;do not need this page&#039;&#039;&#039; if you are simply using the SBC to broadcast data from Phidgets over the network - it does that automatically.  We describe how to verify and use this in the [[1073 User Guide#Getting Started | Getting Started Guide]].&lt;br /&gt;
&lt;br /&gt;
This page will show you how to:&lt;br /&gt;
* Install the ability to write and develop code on the SBC itself&lt;br /&gt;
* Use the command line for basic coding tasks&lt;br /&gt;
* Troubleshoot the SBC&#039;s network&lt;br /&gt;
It will also give additional specifications, which are useful for doing more advanced things with the SBC hardware and software.&lt;br /&gt;
&lt;br /&gt;
Before reading this page, you should have done the following via the Getting Started Guide:&lt;br /&gt;
* Set up networking on your SBC, via either Ethernet or wireless&lt;br /&gt;
* Set up an admin password&lt;br /&gt;
* Learned the IP address or link local address of the SBC&lt;br /&gt;
We will use this information in setting up the libraries and drivers to use the SBC for writing and running code.&lt;br /&gt;
&lt;br /&gt;
Conceivably, you could simply use the SBC like any Linux computer, and do all of your development and compiling of Phidget code on the SBC itself.  In practice this gets complicated as the SBC does not have a keyboard or screen.  So usually, you will want to develop your code an external computer and copy files and settings over to the SBC via a network.  This makes this Getting Started section unique, in that we show you how to set up both computers:&lt;br /&gt;
* Your [[#Getting Started - External Computer | External Development Computer]], usually your main desktop or laptop which will transfer files and settings to and from the SBC&lt;br /&gt;
* The [[#Getting Started - The SBC (Debian Linux) | SBC]] itself, which needs programming language libraries to use Phidgets.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - External Computer===&lt;br /&gt;
&lt;br /&gt;
You have two ways to connect to the SBC from an external computer: via the [[#SBC Web Interface|SBC Web Interface]] and over the more powerful but complex [[#SSH | Secure Shell (SSH)]].&lt;br /&gt;
&lt;br /&gt;
====SBC Web Interface====&lt;br /&gt;
&lt;br /&gt;
You have already worked extensively with the web interface in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].  This was the tool within a web browser which was opened either via the [[Phidget Control Panel]] on Windows, or by simply entering the IP or link local address into an internet browser.  It allowed you to set the password, set up internet connectivity, and so on.  &lt;br /&gt;
&lt;br /&gt;
This section doesn&#039;t have more information on the interface; rather, it simply serves as a reminder that you have the web interface as an available tool.  Examples, including screenshots, are placed where appropriate in this document.  The web interface will probably stay your initial go-to way to connect to the SBC, especially for tasks that benefit from graphical interaction, like setting up wireless or using the webcam.&lt;br /&gt;
&lt;br /&gt;
====SSH====&lt;br /&gt;
&lt;br /&gt;
The most flexible way to transfer files and commands to and from the SBC is via a program called &#039;&#039;&#039;ssh&#039;&#039;&#039;.  The ssh program provides command line text access over a network into the SBC.  Using it, you can run programs and give the SBC commands.  The ssh program has a companion program called &#039;&#039;&#039;scp&#039;&#039;&#039; which can copy files back and forth.  If you are unfamiliar with ssh, you can think of it like the command line or a Mac terminal, but with a remote connection to a different computer.  It is a minimal yet effective way to interact with a remote computer.&lt;br /&gt;
&lt;br /&gt;
Before connecting over ssh, you will need:&lt;br /&gt;
* The &#039;&#039;&#039;IP address&#039;&#039;&#039; (such as 168.254.3.0) or &#039;&#039;&#039;link local address&#039;&#039;&#039; (such as phidgetsbc.local) of the SBC&lt;br /&gt;
* The &#039;&#039;&#039;admin password&#039;&#039;&#039; for the SBC&lt;br /&gt;
Both of these items can be found by following the steps in the [[1073 User Guide#Getting Started | Getting Started Guide for the SBC]].&lt;br /&gt;
&lt;br /&gt;
You will also need to enable SSH on the SBC side.  This can be done through the [[#SBC Web Interface| Web Interface]], under {{Code|Network &amp;amp;rarr; Settings}}, by changing the &#039;&#039;SSH Server&#039;&#039; radio button to &#039;&#039;Enabled&#039;&#039; and saving your changes:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_turn_on_ssh.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
=====SSH on Windows=====&lt;br /&gt;
&lt;br /&gt;
The ssh program is not installed on Windows by default.  But, there are a variety of SSH programs available for free. One simple and commonly used program is [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY], and it has the advantage that the executable doesn&#039;t need to install, it just runs.&lt;br /&gt;
&lt;br /&gt;
With PuTTY, when you first run the program it will ask you what to connect to.  Enter the IP address or link local address of the SBC, and then click the SSH radio button right below the address, which will change the port to 22.  Then click open, and you&#039;ll have an ssh connection to the SBC open in a terminal.  It will prompt you for a user name ({{Code|root}}) and password (the admin password).&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, there is an SCP component to PuTTY, called PSCP, which is available from the same [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY download page].  Use of PSCP will be similar with the address, username, and password, except that you will be transferring files instead of sending commands.&lt;br /&gt;
&lt;br /&gt;
=====SSH on Linux and Mac OS=====&lt;br /&gt;
&lt;br /&gt;
Linux and Mac OS already have ssh installed by default.  To run ssh simply open a terminal...&lt;br /&gt;
* {{Code|Ctrl-Alt-T}} on Linux &lt;br /&gt;
* {{Code|Applications &amp;amp;rarr; Utilities &amp;amp;rarr; Terminal}} on Mac OS &lt;br /&gt;
...and type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
ssh root@phidgetsbc.local&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have re-named your SBC, include that name instead of the {{Code|phidgetsbc.local}} link address.  Or, you can use the SBC&#039;s IP address, e.g. something like {{Code|ssh root@168.254.3.0}}&lt;br /&gt;
&lt;br /&gt;
To copy files back and forth, the command follows the form of: {{Code|scp from to}}&lt;br /&gt;
&lt;br /&gt;
So, to copy a file {{Code|/root/data.txt}} from the SBC to your local machine, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
scp root@phidgetsbc.local:/root/data.txt .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note the use of the dot &#039;&#039;&#039;.&#039;&#039;&#039; to indicate that scp should put the file in the current local directory.   If you&#039;re not sure what folder the terminal is operating in type {{Code|pwd}} to print the working directory.  Terminals usually start by default in your home folder.&lt;br /&gt;
&lt;br /&gt;
===Getting Started - The SBC (Debian Linux)===&lt;br /&gt;
&lt;br /&gt;
The SBC runs Linux, which is a full operating system. It is stripped down compared to a full desktop release of Linux, but you can compile code on it, run programs, schedule tasks, create and manage files, run a web server, and much, much more.&lt;br /&gt;
&lt;br /&gt;
At this point you have connected to the SBC via the [[#SBC Web Interface|web interface]], and probably also through [[#SSH|SSH]].  This section will help you install libraries and drivers that you probably want - i.e. support for C, Java, and Python.  After this section, you&#039;ll be well into the depths of using the SBC as a computer, and so you&#039;ll probably want to keep the [[#Using SBC Linux|Using SBC Linux section]] open for reference while you work if you are not already familiar with Linux.&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the following Phidget functionality installed:&lt;br /&gt;
* The Phidget C libraries {{Code|libphidget21.so}}&lt;br /&gt;
* The Phidget [[#WebService | WebService]]&lt;br /&gt;
(If you are simply curious what these are and how they get installed, we describe the process on the [[OS - Linux | general Linux page]].)&lt;br /&gt;
&lt;br /&gt;
But to compile C programs, or run Java programs, or use Python, you will need to install these languages onto the SBC.  &lt;br /&gt;
&lt;br /&gt;
Before installing anything on the SBC, however, (even via a button on the web interface) make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
====Installing C/C++ and Java====&lt;br /&gt;
&lt;br /&gt;
The simplest way to install C/C++  and Java on the SBC is via the web interface.  There is a button under {{Code|System &amp;amp;rarr; Packages}} to install C support (including {{Code|gcc}}) and another button to install Java support:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_packages_web.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
You have to check that you are running the same version of Java on your development machine (where you plan on compiling the java programs) as the SBC is running. To do this type the following into the terminal on your computer and from ssh on the SBC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
Java -version&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need to update the version of Java on your SBC, use the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install openjdk-7-jre-headless&lt;br /&gt;
su&lt;br /&gt;
update-alternatives --config java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you&#039;re ready to begin programming.  We have programming pages for both [[Language - C/C++|C/C++]] and for [[Language - Java|Java]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].  &lt;br /&gt;
&lt;br /&gt;
If you want to avoid using the [[#SSH|SSH]] interface on the SBC entirely, and you want to write your program in Java and run it continuously from boot (which is the only option if you want to avoid [[#SSH|SSH]]), we have a [[#Program in Java with the Web Interface|very in-depth section]] on that topic.&lt;br /&gt;
&lt;br /&gt;
====Installing Python====&lt;br /&gt;
&lt;br /&gt;
Installing Python has two steps.  First, you&#039;ll need to install the basic ability to run python, and then you&#039;ll need to install the Phidget Python module.  Both steps (and both options) require that you issue the relevant commands through an [[#SSH|SSH terminal]].&lt;br /&gt;
&lt;br /&gt;
=====Basic Python=====&lt;br /&gt;
&lt;br /&gt;
The base Python functionality can be downloaded and installed in one step with [[#apt|apt]] (i.e. in a terminal, type):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will give you Python, and now you just have to install the Phidget Python module to gain Phidget functionality. If the installation fails because it can&#039;t find python, you need to enable the full repository as described in [[#Getting Started_-_The_SBC_(Debian_Linux)|this section]], and then perform an apt-get update.&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 1: Use a USB Key=====&lt;br /&gt;
&lt;br /&gt;
Copy the [{{SERVER}}/downloads/libraries/PhidgetsPython.zip Python Libraries] onto a USB key.  Unpack the zip file into a folder on the USB key.  Insert the key into the SBC.&lt;br /&gt;
&lt;br /&gt;
You will have to figure out where the USB key (and the Phidget Python library folder) is now located.  We describe how in the general [[#Using USB Data Keys | Using USB Data Keys]] section.&lt;br /&gt;
&lt;br /&gt;
After you know the place where the USB key is mounted, in a terminal go to that directory (e.g. type {{Code|cd /media/usb0/}}), enter the unpacked Phidget Python Library folder, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have an whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
=====Install Phidget Python Method 2: Use the Internet=====&lt;br /&gt;
&lt;br /&gt;
Rather than using a USB key to transfer the file, the SBC can download it directly from the internet.  You will need {{Code|wget}} and {{Code|unzip}} installed, both of which are small:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install wget&lt;br /&gt;
apt-get install unzip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the web link address for the [{{SERVER}}/downloads/libraries/PhidgetsPython.zip Python Libraries].&lt;br /&gt;
&lt;br /&gt;
In an SSH terminal to the SBC, type: {{Code|wget http://www.python_library_link}} where instead of http://www.python_library_link you insert the link you just copied. Copying into a terminal can usually be done via the right-click menu.&lt;br /&gt;
&lt;br /&gt;
This will download the Phidget python libraries to the folder you ran the {{Code|wget}} command in.  Unzip the downloaded file using the command {{Code|unzip file}}, where file is the filename from {{Code|wget}}. Or try typing {{Code|ls}} to list the names of a file in the directory, which should include the unzipped folder.  Enter the unzipped folder (e.g. use {{Code|cd}} to change directory), and install the Phidget Python libraries:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 python setup.py install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you&#039;re ready to begin writing Python code for the SBC.  For more help on writing and using Python with Phidgets, we have a whole [[Language - Python | page on that topic]].  Remember that if you&#039;re unfamiliar with Linux, we have help on using files and running programs automatically in the [[#Using SBC Linux|Using SBC Linux section]].&lt;br /&gt;
&lt;br /&gt;
====Installing Other Languages====&lt;br /&gt;
&lt;br /&gt;
You may also be able to program on the SBC using [[Language - Ruby|Ruby]] and [[Language - C Sharp|C# under Mono]], though we do not offer in-depth support for these languages on the SBC.  The installation procedures should more or less follow that of [[#Installing Python|installing python]] on the SBC, except you will be installing Ruby or Mono.  Performing package searches using [[#apt|apt cache search]] can help you find the relevant software.&lt;br /&gt;
&lt;br /&gt;
For C#, as of 2012 the {{Code|mono-complete}} package is broken on the Debian Squeeze repository.  Rather, you have to install the Mono runtime and Mono compiler separately.&lt;br /&gt;
&lt;br /&gt;
To install the runtime package (and its dependencies), use [[#apt|apt]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-runtime&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to install the C# compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-gmcs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or the Visual Basic compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install mono-vbnc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, the system and library packages do not link correctly for the version 2.0 of Mono.  If this is the case, your code will compile fine, but when you try to run it, you will get an error like:&lt;br /&gt;
&lt;br /&gt;
:{{Code|The assembly mscorlib.dll was not found or could not be loaded.}}&lt;br /&gt;
:{{Code|It should have been installed in the `/usr/lib/mono/1.0/mscorlib.dll&#039; directory.}}&lt;br /&gt;
&lt;br /&gt;
In this case, you need to install these two packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libmono-corlib1.0-cil&lt;br /&gt;
apt-get install libmono-system1.0-cil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we found these packages to work by working through the tree structure.  As a general rule, you can find these dependencies by using install (here, {{Code|apt-get install mono-complete}}) to get a sense of the package tree structure.  This will possibly tell you that the packages are broken, but at the same time this will list the dependencies of the packages.  Trying to install individual dependencies will show you that although a root-package fails, the sub-packages will sometimes succeed, and install what you need.&lt;br /&gt;
&lt;br /&gt;
If you want to use a specific dll or library that is not available in this reduced version of mono, you can install mono complete by switching from Emdebian+Debian to just Debian.  To do this:&lt;br /&gt;
&lt;br /&gt;
In {{Code|/etc/apt/preferences}} make the following changes:&lt;br /&gt;
:{{Code|Package: *}}&lt;br /&gt;
:{{Code|&amp;lt;nowiki&amp;gt;Pin: release a=stable&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
:{{Code|Pin-Priority: 1010}}&lt;br /&gt;
	&lt;br /&gt;
In {{Code|/etc/apt/sources.list/mutistrap-debian.list}} remove the emdebian line.&lt;br /&gt;
&lt;br /&gt;
Apply the changes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get dist-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many packages will be &#039;downgraded&#039; from the emdebian to debian versions.  Delete the {{Code|&amp;lt;nowiki&amp;gt;/etc/apt/preferences&amp;lt;/nowiki&amp;gt;}} file and install mono-complete:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install monodoc-http mono-complete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Choose monodoc-http explicitly, because otherwise the install fails on monodoc-browser.&lt;br /&gt;
&lt;br /&gt;
After this process, you can compile your C# Code.cs Phidget source file the same way as on a generic [[Language - C Sharp#Linux|Linux with Mono]] system.  Please refer to that page on how to obtain the *.dll Phidget resource file and compile your code.  On the SBC, however, because you are already running as root (the Super User), you do not need &#039;sudo&#039; and indeed the SBC will give you an error if you use it.  Instead, compiling and running will look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
gmcs Code.cs -r:Phidget21.NET.dll&lt;br /&gt;
mono Code.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using SBC Linux==&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve set up communication with the SBC, and installed whichever programming language support you need, you&#039;re probably ready for a short tour of useful tools on the SBC&#039;s version of Linux.&lt;br /&gt;
&lt;br /&gt;
First, you will by default be running on the SBC as &#039;&#039;&#039;root&#039;&#039;&#039;, which is the super-user.  For Linux users, this probably makes you nervous because you know you can overwrite important system files without the system asking for additional permission.  As a Windows or Mac OS user - although you may usually run your computer as an administrator - your familiar system usually prompts you to confirm before you do anything really dangerous, and this will &#039;&#039;&#039;not&#039;&#039;&#039; happen on the SBC as the root user.&lt;br /&gt;
&lt;br /&gt;
Next, there is no installed help on the SBC.  Help on Linux is usually called &#039;man pages&#039; which is short for &#039;the manual pages&#039;.  On a full Linux system, usually if you need help with any command you can type, for example, {{Code|man ls}} and it will give you help with the program [[#ls|ls]].  But these help pages take up significant space, and they are widely available online.  So, if you need more help with a certain command, you can always type {{Code|man command}} into your favourite search engine.&lt;br /&gt;
&lt;br /&gt;
Finally, the SBC has no windowing system.  For Linux users, this means no X-windows (Gnome, KDE, etc).  And as a Windows or Mac user, you can think of it as running all of your programs and commands through the terminal or DOS prompt command line.  The SBC provides all of the functionality of an operating system (e.g. process scheduling, file management, etc) but without any graphical interface.  The only exception is the [[#SBC Web Interface|web interface]], which gives graphical access to a limited part of what the SBC can do.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands===&lt;br /&gt;
&lt;br /&gt;
If you are doing more with the SBC than simply running pre-written programs [[#Writing a Phidget Program|in Java to run continuously from boot]], you will be interacting with the SBC&#039;s Linux operating system over the command line by using [[#SSH|SSH]].  This section discusses useful programs already installed on the SBC, and how to run them on the command line.&lt;br /&gt;
&lt;br /&gt;
====ls====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;ls&#039;&#039;&#039; program lists the contents of a directory.&lt;br /&gt;
&lt;br /&gt;
It will show both files and folders, but not files that start with a &amp;quot;.&amp;quot; (these are hidden files on Linux).&lt;br /&gt;
*If you also want to show hidden files, use {{Code|ls -a}}&lt;br /&gt;
*If you want more information, such as size and date modified, use {{Code|ls -l}}&lt;br /&gt;
*Commands can be combined, like {{Code|ls -al}}&lt;br /&gt;
&lt;br /&gt;
====cd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cd&#039;&#039;&#039; program changes to a new directory.&lt;br /&gt;
&lt;br /&gt;
For example, {{Code|cd /root}} changes into the directory at the base of the file tree called &#039;&#039;root&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* Linux uses forward slashes&lt;br /&gt;
* The base of all directories is &amp;quot;/&amp;quot; (not &amp;quot;C:\&amp;quot;)&lt;br /&gt;
* The tilde symbol (~) is short for your home directory (i.e. when you are root, this is short for &amp;quot;/root&amp;quot;)&lt;br /&gt;
* The double dot &amp;quot;..&amp;quot; means move one directory higher (for example from {{Code|/root/data/}} to {{Code|/root/}})&lt;br /&gt;
&lt;br /&gt;
====pwd====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;pwd&#039;&#039;&#039; program prints the current directory you are working in.  (&#039;P&#039;rint &#039;W&#039;orking &#039;D&#039;irectory)&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
:{{Code|root@phidgetsbc:~# pwd}}&lt;br /&gt;
:{{Code|/root}}&lt;br /&gt;
&lt;br /&gt;
====cp, mv, and rm====&lt;br /&gt;
&lt;br /&gt;
These programs are copy (&#039;&#039;&#039;cp&#039;&#039;&#039;), move (&#039;&#039;&#039;mv&#039;&#039;&#039;), and remove (&#039;&#039;&#039;rm&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Copy copies a file from one location and pastes it to another.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|cp data.txt data_backup.txt}} will put a copy of the file {{Code|data.txt}} into {{Code|data_backup.txt}}&lt;br /&gt;
&lt;br /&gt;
Move moves a file (this is also useful for renaming files) to a new destination.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a file {{Code|data.txt}}, typing {{Code|mv data.txt data_backup.txt}} will put the contents of {{Code|data.txt}} into {{Code|data_backup.txt}}, and then will remove {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Remove deletes a file.&lt;br /&gt;
&lt;br /&gt;
For example, typing {{Code|rm data.txt}} will delete {{Code|data.txt}}.&lt;br /&gt;
&lt;br /&gt;
Note that &#039;&#039;&#039;rm&#039;&#039;&#039; is final.  Once you remove a file using {{Code|rm}}, it is gone forever.  There is no recycle bin, no temporary trash, nothing other than backups you may have personally created in the past!&lt;br /&gt;
&lt;br /&gt;
Directories can only be removed with {{Code|rmdir}}, and then only if they are empty.  If you want to remove a directory and all the files in it, use {{Code|rm -rf directory}} but be &#039;&#039;&#039;very, very careful&#039;&#039;&#039; with this command.  Trying to remove everything within a directory (e.g. {{Code|rm -rf *}}) is one of the most dangerous commands you can run on a Linux system, as running it from the wrong directory will result in Linux happily removing everything under that directory -- which could be your entire filesystem.&lt;br /&gt;
&lt;br /&gt;
====find====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;find&#039;&#039;&#039; program does what it says - it finds things.  &lt;br /&gt;
&lt;br /&gt;
Unfortunately for the casual user, the find program is very flexible and powerful, and thus not especially intuitive to use.  But, here are some examples:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|find folder -name file.txt}}&lt;br /&gt;
| Looks for all files in a folder (/ for root - or all - folders) with a certain name (* for wildcard)&lt;br /&gt;
| {{Code|find / -name *.jpg}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|find folder -mtime +X}}&lt;br /&gt;
| Looks for all files in a folder modified less than X days ago&lt;br /&gt;
| {{Code|find /root -mtime +30}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====grep====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;grep&#039;&#039;&#039; program takes text input and searches for a term. &lt;br /&gt;
&lt;br /&gt;
For example, if you type {{Code|mount}} to view what devices are mounted (e.g. loaded) on your SBC, you will see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may be a lot of information you don&#039;t need.  If you are only interested in a USB key attachment (as described in the [[#Using USB Data Keys|Using USB Data Keys]] section), you can use grep to filter that one response:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep sda1&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====nano====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;nano&#039;&#039;&#039; program is a small text editor that you can use within an SSH terminal. &lt;br /&gt;
&lt;br /&gt;
Nano can be surprisingly useful for writing short lengths of code right on the SBC, so there is no need to transfer files and keep track of different file versions on different computers.&lt;br /&gt;
&lt;br /&gt;
Nano has all keyboard commands which are listed at the bottom of the screen at all times as a reminder (Ctrl-O to save, Ctrl-X to exit, these expand with a larger terminal window).  And, nano provides what is called &#039;syntax highlighting&#039;, which colours reserved keywords, comments, strings, and so on as appropriate to the programming language you are using.  Nano detects the programming language via the extension of the file ({{Code|.java}} for Java, {{Code|.c}} for C/C++, and {{Code|.py}} for Python).&lt;br /&gt;
&lt;br /&gt;
Typing {{Code|nano test.py}} on an SSH command line and then entering a few lines of Python into the new empty file results in:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_nano_python.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
====apt====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;apt&#039;&#039;&#039; program allows you to install, uninstall, upgrade, and search software available for the SBC.&lt;br /&gt;
For a non-Linux user, the apt framework may be daunting at first, but it actually allows you to keep your system up to date and install and manage software quickly, easily, and for free.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Before installing anything on the SBC, make sure that the &#039;&#039;Include full Debian Package Repository&#039;&#039; option is checked in the web interface under {{Code|System &amp;amp;rarr; Packages}}.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SSH Command&lt;br /&gt;
! What it Does&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-cache search term}}&lt;br /&gt;
| Looks for all programs (packages) that have {{Code|term}} in the title or description&lt;br /&gt;
| {{Code|apt-cache search opencv}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-cache show package}}&lt;br /&gt;
| Shows a lot of data about {{Code|package}} including size, version, etc&lt;br /&gt;
| {{Code|apt-cache show unzip}}&lt;br /&gt;
|- &lt;br /&gt;
| {{Code|apt-get update}}&lt;br /&gt;
| Gets the most recent listing of available software&lt;br /&gt;
| {{Code|apt-get update}}  (No options)&lt;br /&gt;
|-&lt;br /&gt;
| {{Code|apt-get install program}}&lt;br /&gt;
| Installs {{Code|program}} from the internet&lt;br /&gt;
| {{Code|apt-get install python}}&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====mount====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|mount}} shows you all of the mounted devices on your SBC.  &lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the non-Linux user, the concept of a device may be quite strange.  To give a short summary, everything on Linux that you can read or write is a file.  Webcams are files (i.e. you can &#039;read&#039; photos from them), USB keys are files, and each filesystem (tmp storage, the kernel portion, the main filesystem) are also themselves files.  These files specify what and how something can be written.  These are not necessarily linear, for example, you can see above that the USB key ({{Code|/media/usb0}} is mounted &#039;&#039;within&#039;&#039; the root file system {{Code|rootfs}} which is /.   &lt;br /&gt;
&lt;br /&gt;
So mount gives you an idea of what devices have been &#039;mounted&#039; for reading or writing, and how you can read and write to them.  More information on mount (and its various forms, like {{Code|umount}}) is available widely around the Internet.&lt;br /&gt;
&lt;br /&gt;
====which====&lt;br /&gt;
&lt;br /&gt;
The program {{Code|which}} tells you if and where a program is installed.&lt;br /&gt;
&lt;br /&gt;
For example, on a default SBC, typing {{Code|which python}} will return no results.  But after successfully [[#Installing Python | installing python]], it will return {{Code|/usr/bin/python}} as the location of the python program/binary/executable.&lt;br /&gt;
&lt;br /&gt;
===Some Useful Commands to Install===&lt;br /&gt;
&lt;br /&gt;
These are other programs you may find useful on the command line.  Although they are not on the SBC by default, these and other programs can usually be installed simply by using [[#apt|apt-get install]], with the exception of gcc.  For example, {{Code|apt-get install wget}} will download and install [[#wget|wget]].  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This section and the section on [[#Some Useful Commands|pre-installed commands]] can hardly cover all of the complexities and power of the Linux operating system.  There are many excellent tutorials online, and between them and using [[#apt|apt]] to find and install programs you should be able to learn a lot and perform any number of complex useful tasks.&lt;br /&gt;
&lt;br /&gt;
====gcc====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;gcc&#039;&#039;&#039; program is the C compiler for Linux.&lt;br /&gt;
&lt;br /&gt;
If you are an experienced C/C++ user on Mac or Linux, or if you&#039;ve already read our [[Language - C/C++ | C Language page]], you might think you need to install gcc via {{Code|apt-get}} to compile C code.  However, gcc is not in the package repository for the SBC, so {{Code|apt-get install gcc}} will fail.  Rather, to install gcc, you can do it via the web interface, as described in the [[#Installing C/C++ and Java|Installing C/C++ and Java]] section.&lt;br /&gt;
&lt;br /&gt;
After installing it via the SBC web interface, you can use {{Code|gcc}} normally.&lt;br /&gt;
&lt;br /&gt;
====less====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;less&#039;&#039;&#039; program displays the contents of a text or source code file.  When displaying the file, {{Code|less}} allows you to scroll up and down to read it.&lt;br /&gt;
&lt;br /&gt;
This is useful if you are writing your sensor readings to a data file, and you want to read the data file while it is being written by your main code.  If your data file is called {{Code|data.txt}}, you can type {{Code|less data.txt}} and see the lines in the file, and what they are.&lt;br /&gt;
&lt;br /&gt;
The {{Code|less}} program output can also be piped into another program.  For example, you can use {{Code|less}} and the word search program {{Code|grep}} to find lines within a file with a search term.  For instance, if you have a C source code file {{Code|Program.c}} on the SBC, and you want to see all the lines in {{Code|Program.c}} that contain a variable name {{Code|var}}, you can type: &lt;br /&gt;
:&amp;lt;code&amp;gt;less Program.c | grep var&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====wget====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;wget&#039;&#039;&#039; program allows you to get an online file (over http) and download it to the SBC.&lt;br /&gt;
&lt;br /&gt;
For example, to get the source file (HTML) from the Phidgets home page, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
wget http://www.phidgets.com&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is most useful for downloading libraries, drivers, or anything (zip, tar, etc) you need from the web which is not available by [[#apt|using apt]].&lt;br /&gt;
&lt;br /&gt;
===Writing a Phidget Program===&lt;br /&gt;
&lt;br /&gt;
We provide two ways to write and upload a Phidget Program:&lt;br /&gt;
# The [[#SBC Web Interface|web interface]]:&lt;br /&gt;
#* This is useful for simple projects written in Java that you want to start only at boot&lt;br /&gt;
#* You can also use C projects, but they must be compiled off the SBC for an ARM processor&lt;br /&gt;
# Over [[#SSH|SSH]], which will allow you to write or transfer source code directly to and from the SBC&lt;br /&gt;
#* This is useful for all other projects, such as:&lt;br /&gt;
#** Projects that run at scheduled times (e.g. once per minute)&lt;br /&gt;
#** Projects that use languages other than Java or ARM-compiled C&lt;br /&gt;
Note that you can still run an [[#SSH|SSH]] project at boot, you just have to write and install a startup script.  This is a bit complex, but we do have an example that starts the program {{Code|phidgetwebservice21}} [[OS - Linux#As A Service|at boot using a script]].&lt;br /&gt;
&lt;br /&gt;
Once you know which method you&#039;d like to use, you can continue on to learn how to [[#Program in Java with the Web Interface|Program in Java with the Web Interface]], or how to [[#Program with SSH|Program with SSH]] using Java, C, or Python.  If you are actually typing in source code on the SBC, you&#039;ll find our [[#Developing Code on the SBC|developing code on the SBC section]] useful.&lt;br /&gt;
&lt;br /&gt;
====Program in Java with the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To show how to write, compile, and install Java programs on the SBC, we&#039;ll use the [[Language - Java|Java Hello World]] example code.  You can download the HelloWorld example by downloading the whole [{{SERVER}}/downloads/examples/JavaJNI.zip Java example package].  Make sure you have the same version of [[#Installing C/C++ and Java|Java installed on the SBC]] as you have on your external development machine. Instruction for checking and updating are found on the [[#Installing C/C++ and Java|installation page]].&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how to get the HelloWorld code running on the SBC.  On your external computer:&lt;br /&gt;
&lt;br /&gt;
1. Download the SBC version of the Phidget Java libraries ({{Code|phidget21.jar}}).  You can download this from the [[#SBC Web Interface|web interface]], on the page under {{Code|Projects &amp;amp;rarr; Projects}}, under the &#039;&#039;&#039;Notes&#039;&#039;&#039; section.&lt;br /&gt;
&lt;br /&gt;
2. Place the SBC version of {{Code|phidget21.jar}} into a directory on your external computer.  This will be your working directory that you will use to compile the Java files.&lt;br /&gt;
&lt;br /&gt;
3. Also copy the {{Code|HelloWorld.java}} file into that working directory.&lt;br /&gt;
&lt;br /&gt;
4. Compile the {{Code|HelloWorld.java}} file from within that working directory.  From the command line prompt on Windows, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .;phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In a terminal on Linux or Mac OS, this will be:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. You should now have three compiled class files: {{Code|HelloWorld.class}}, {{Code|HelloWorld$1.class}}, and {{Code|HelloWorld$2.class}}.  You don&#039;t need to try and run them, and if you do you may encounter an error because the SBC {{Code|phidget21.jar}} may be slightly different than the Phidget support you have installed on your external computer.&lt;br /&gt;
&lt;br /&gt;
Now we move onto the SBC:&lt;br /&gt;
&lt;br /&gt;
6. Create a new project on the SBC, in the web interface under {{Code|Projects &amp;amp;rarr; Projects}}.  Call it HelloWorld:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_create_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
7. On the next screen, you will be prompted to upload your files.  We will upload the three Java class files, and then click the {{Code|Start}} button:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_web_run_project.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
8. You&#039;ll note that as it runs, there are two links below the {{Code|Stop}} button: One called {{Code|stdout}}, which is &#039;&#039;Standard Output&#039;&#039;, and one called {{Code|stderr}}, which is &#039;&#039;Standard Error&#039;&#039;.  Usually, when you run a program on the command line, you see both standard out and standard error at the same time - i.e. you get all program output right there in your terminal or command prompt.  But when running a program in the background, Linux splits the output up into normal output and error output as this is very useful for debugging (i.e. you can check if standard error is empty).  &lt;br /&gt;
&lt;br /&gt;
Here, however, if you&#039;re not sure whether the program will run correctly, you should first check {{Code|stderr}} to see if any errors were generated, and then check {{Code|stdout}} to see if the output looks as expected.&lt;br /&gt;
&lt;br /&gt;
To write your own Java program, follow the same process but use your own source code instead of the {{Code|HelloWorld.java}} example.&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, we offer additional help on [[#Via the Web Interface|running a program automatically using the web interface]].&lt;br /&gt;
&lt;br /&gt;
====Program with SSH====&lt;br /&gt;
&lt;br /&gt;
Similarly to starting a program via the [[#Program in Java with the Web Interface|web interface]], we use the Phidget Java {{Code|HelloWorld}} example here.&lt;br /&gt;
&lt;br /&gt;
Make sure you have [[#Installing C/C++ and Java|Java installed on the SBC]].  To compile and run the {{Code|HelloWorld}} example:&lt;br /&gt;
&lt;br /&gt;
1. Open an [[#SSH|SSH terminal]] to the SBC&lt;br /&gt;
&lt;br /&gt;
2. Download the [{{SERVER}}/downloads/examples/JavaJNI.zip Phidget Java Examples] to the SBC, using [[#wget|wget]] (you may need to install {{Code|wget}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
3. Unpack the examples using [[#unzip|unzip]] (you may need to install {{Code|unzip}} using [[#apt|apt]].)&lt;br /&gt;
&lt;br /&gt;
4. The location of {{Code|phidget21.jar}} on the SBC is {{Code|/usr/share/java/phidget21.jar}}.  Within the unzipped example directory, compile the {{Code|HelloWorld.java}} example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
javac -classpath .:/usr/share/java/phidget21.jar HelloWorld.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. To run the {{Code|HelloWorld}} program, use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
java -classpath .:/usr/share/java/phidget21.jar HelloWorld&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that you have a running program, you&#039;ll probably want to learn to [[#Running a Program Automatically|run this Java program automatically]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; If you&#039;re used to using Linux with Phidgets already, you&#039;ll probably notice that you don&#039;t need to switch into root using {{Code|sudo}} on the SBC in order to run programs.  This is because you already are running as root, not because the [[OS - Linux#Setting udev Rules|udev rules are set up]].  So if you set up another user, or [[#Via Cron|run a cron job]] as anything other than root or system, you&#039;ll need to add permission for the Phidget program to run in your [[OS - Linux#Setting udev Rules|udev rules]].&lt;br /&gt;
&lt;br /&gt;
====Developing Code on the SBC====&lt;br /&gt;
&lt;br /&gt;
When you&#039;re not just using pre-written source code, and you&#039;re writing code actually on the SBC itself, you&#039;ll probably want to use [[#nano|nano]].  Other terminal editors on the SBC include {{Code|vi}} which is already installed, and {{Code|emacs}}, which you can install using [[#apt|apt]].  Both {{Code|vi}} and {{Code|emacs}} are much more efficient for the experienced user, but they contain modes and keyboard shortcuts that can seem strange or almost hindering to the casual user.&lt;br /&gt;
&lt;br /&gt;
Regardless of which editor you choose to use, some of your keyboard habits may not transfer well.  For example, in the Linux command line, the command {{Code|Ctrl-C}} means &#039;&#039;stop the currently running program&#039;&#039;, (i.e. your open editor) not copy.  Within most SSH terminals, you can copy and paste using the right-mouse button, and on some terminals (and all native Linux terminals) you can copy by simply highlighting text, and you can paste it using the middle (scroll) mouse button.  On the other hand, if you write a program that hangs on the command line, {{Code|Ctrl-C}} can actually be useful to terminate it.&lt;br /&gt;
&lt;br /&gt;
Also {{Code|Ctrl-Z}} does not mean &#039;&#039;undo&#039;&#039;, rather it means &#039;&#039;run the current program in the background&#039;&#039;.  This is useful because running a program in an SSH terminal simply hangs your SSH input until the program is done.  So typing {{Code|Ctrl-Z}} while the program is running frees up the command line for more input.  But if you accidentally hit {{Code|Ctrl-Z}} while running an editor like [[#nano|nano]], the editor will immediately exit to the command line.  Don&#039;t worry though, it will not stop or lose your work.  You can bring it back up by using the {{Code|fg}} (e.g. &#039;foreground&#039;) command, like {{Code|fg nano}}, and this will automatically bring your nano process back to the front.&lt;br /&gt;
&lt;br /&gt;
===Running a Program Automatically===&lt;br /&gt;
&lt;br /&gt;
For testing your program, you will certainly want to run it via [[#SSH|SSH]] or via the {{Code|Start}} button on the project page on the web interface until you are quite sure it runs well.  However, eventually you will probably want the program to run without your input, either [[#Via the Web Interface|continuously, and starting at boot]], or via a task scheduled to [[#Via Cron|run to completion at certain times]].&lt;br /&gt;
&lt;br /&gt;
Both have their advantages and disadvantages.  Usually, you would want to use the continuous, from-boot methods for event driven code that has to handle a wide variety of user input that could occur at any time.  You would want to use the scheduled method when the SBC needs to perform a repeated task (e.g. reading sensor data) again and again.  The main difference is:&lt;br /&gt;
* With the continuous (boot) method you can have any Phidgets (including sensors, LEDs, input switches, etc) attached and giving events to your code all the time, and&lt;br /&gt;
* With the scheduled (cron) method you have much less of a chance to run into long-term memory management and instability problems with any code you write, because your program runs for only a short time before exiting and getting cleaned up.&lt;br /&gt;
&lt;br /&gt;
====Via the Web Interface====&lt;br /&gt;
&lt;br /&gt;
To use this method, you must have created the program you want to run as [[#Program in Java with the Web Interface | a Java or ARM-compiled C project in the web interface]].  If you would like to use another language, or another way of uploading your project, but you still want to start at boot and run continuously, you will need to use a [[#Via a Boot Script|boot script]].&lt;br /&gt;
&lt;br /&gt;
In the web interface, go to the {{Code|Projects}} tab, and click on the project you would like to run.  Near the bottom of the project page (the one with the {{Code|Start}} and {{Code|Stop}} buttons at the top), there will be a section called {{Code|Startup Settings}}.  You can see a screenshot of the whole project page, including these settings, in the [[#Program in Java with the Web Interface | web interface project section]].&lt;br /&gt;
&lt;br /&gt;
Select the {{Code|Enabled}} radio button.  The other defaults should be fine, unless you specifically know otherwise:&lt;br /&gt;
* For &#039;&#039;Boot Order&#039;&#039;, lower numbers boot first.  Booting later means more programs are available for use, booting earlier means other programs can use your program.  &lt;br /&gt;
* &#039;&#039;Run as a daemon&#039;&#039; starts the program as a daemon, which is a program that runs in the background.  Unless you have &#039;&#039;explicitly&#039;&#039; written your program as a daemon, leave this checked.  (If you don&#039;t know what a daemon is, don&#039;t worry, you haven&#039;t written one, so leave it checked.)  &#039;&#039;Un&#039;&#039;checking this when your program is a normal program will cause the SBC to hang while booting.&lt;br /&gt;
* The &#039;&#039;Executable or Class&#039;&#039; name should be automatically sensed to be your main Java class&lt;br /&gt;
* &#039;&#039;Arguments&#039;&#039; are any command line arguments you need, just as you would type them into the command line&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Your program must be very, very stable to run properly via the web interface.  Imagine your program running continuously for days, or months on end.  Any memory leaks, over time, will render your program (and the SBC) unusable until a reboot.  Counts or other variables that increase within your program and never reset may create a segmentation fault eventually.&lt;br /&gt;
&lt;br /&gt;
If, for stability purposes, you want your program to start, run for a little while, and then exit so that the SBC operating system can clean up the memory each time, you&#039;ll probably want to use [[#Via Cron|Cron]] to run your program instead.&lt;br /&gt;
&lt;br /&gt;
====Via Cron====&lt;br /&gt;
&lt;br /&gt;
Cron can automatically schedule programs - known as &#039;jobs&#039;, or &#039;cron jobs&#039; - at most once per minute.  Less often than that, it is very flexible, allowing you to run it on certain months, weekdays, hours, etc.  Cron simply reads a special file (your {{Code|crontab}}) and runs whatever programs are listed, with whatever timing they are listed with.  The cron program runs all the time in the background, making it what is known as a Linux &#039;&#039;daemon&#039;&#039;, but the programs it starts as jobs run only as long as they naturally would, and then they exit.&lt;br /&gt;
&lt;br /&gt;
If you need your program to run more often than once per minute, have the program schedule itself while still running.  For example, to run every five seconds, run a fast loop,  and sleep for five seconds. Do this twenty times and exit.  Then schedule this once per minute using cron, and your program will in essence run every five seconds.&lt;br /&gt;
&lt;br /&gt;
Setting up a cron job simply entails editing your {{Code|crontab}} file.&lt;br /&gt;
&lt;br /&gt;
First, you&#039;ll probably want to specify your default editor to be [[#nano|nano]]. Otherwise it will default to {{Code|vi}} and you&#039;ll have to figure out {{Code|vi}} in order to add lines to your crontab:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
export EDITOR=nano&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, to edit your crontab file, simply type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
crontab -e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each line of the crontab file is one scheduled job.  Lines that start with a hash &amp;quot;#&amp;quot; are comments and are ignored.  There is an example line in the crontab, and a reminder line at the very end.  Essentially, each line should contain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
minute hour dayOfMonth month dayOfWeek  command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*{{Code|command}} is the program you want to run (with absolute path, and arguments)&lt;br /&gt;
** For example, {{Code|./myprogram argument1}} won&#039;t work, but {{Code|/root/code/myprogram argument1}} will&lt;br /&gt;
* Each time argument is either a number, a list of numbers separated by commas, or an asterisk&lt;br /&gt;
** For example, * * * * * means every minute for all days and months, 0,30 * * * * means every thirty minutes (i.e. at the top of the hour and at 30 minutes in) for all days and months&lt;br /&gt;
&lt;br /&gt;
If you already have jobs scheduled, you&#039;ll see them in the file that comes up.  You can edit, add, or delete.  &lt;br /&gt;
&lt;br /&gt;
After you save, you&#039;ll see a little message back in the terminal that says the new crontab file was installed, and it is now scheduled!  Cron always starts every boot, and so if you have edited and installed your crontab as above, the scheduling of your program will start properly even after a reboot of the SBC.  However, if you are having strange scheduling problems, you may want to familiarize yourself with the [[#Software Details|software details]] of how the SBC as a whole determines the current date and time.&lt;br /&gt;
&lt;br /&gt;
=====My Cron Job Doesn&#039;t Work!=====&lt;br /&gt;
&lt;br /&gt;
It is actually very common for a script or program to work on the command line but then &#039;&#039;not&#039;&#039; work as a cron job.  The most common reason for this, by far, is that you specify &#039;&#039;relative&#039;&#039; paths in your program to access files rather than &#039;&#039;absolute&#039;&#039; paths.  For example:&lt;br /&gt;
* {{Code|code/project.c}} is a relative path (bad for cron)&lt;br /&gt;
* {{Code|/root/code/project.c}} is an absolute path (good for cron)&lt;br /&gt;
The cron jobs are &#039;&#039;not&#039;&#039; executed from your home directory, or your code directory, so they will not be using the same location you may be using to test your code.  So always use absolute paths.&lt;br /&gt;
&lt;br /&gt;
Another common reason is you may be using environment variables or other settings that are true in a terminal but are &#039;&#039;not&#039;&#039; true by default in the raw system.  You can end up taking many things for granted in a shell, for example the shortcut &amp;quot;~&amp;quot; means home directory in a shell, but not by default in the raw system.  The things that get loaded for a shell (but which are not present in the raw system) are:&lt;br /&gt;
* The settings loaded by {{Code|/etc/profile}}&lt;br /&gt;
* Any settings in {{Code|~/.bashrc}}, which is nothing by default on the SBC&lt;br /&gt;
&lt;br /&gt;
On a full Linux operating system, you would use the logs written to by cron to find the error output and debug it.  On the SBC, however, cron does not write logs (otherwise, these logs would eat up the SBC memory very quickly even for routine jobs).  For short-term debugging, you can write output from your program to a file, and read that file afterwards to figure out what your program is doing.&lt;br /&gt;
&lt;br /&gt;
====Via a Boot Script====&lt;br /&gt;
&lt;br /&gt;
If you want to run your program constantly and for it to start at boot like the [[#Via the Web Interface|web interface would do]], you can install your program into the boot order using a script.  This is a somewhat involved process, and you should be familiar with shell programming in Linux.  For this process, we only offer a [[OS - Linux#As A Service|similar example]] which installs and runs the program {{Code|phidgetwebservice21}} within the boot sequence.&lt;br /&gt;
&lt;br /&gt;
===Using USB Data Keys===&lt;br /&gt;
&lt;br /&gt;
After plugging the USB key in, it won&#039;t just appear on your desktop, so to speak, so you&#039;ll need to figure out where you can read and write to it within the SSH directory structure.&lt;br /&gt;
&lt;br /&gt;
The web interface program can help with this.  After you plug a USB key in, it will show up under {{Code|Status &amp;amp;rarr; System}}.  Or, the USB key and all other attached devices can be seen at {{Code|Status &amp;amp;rarr; USB}}:&lt;br /&gt;
&lt;br /&gt;
[[File:sbc_mounted_devices.png|link=|alt=]]&lt;br /&gt;
&lt;br /&gt;
In the screenshot above, you can see that the USB key is located in {{Code|/media/usb0}}.&lt;br /&gt;
&lt;br /&gt;
Alternately, you can use the SSH command {{Code|mount}}, and the searching program {{Code|grep}} which will filter the response of {{Code|mount}} and only return the lines with your search term ({{Code|usb}}):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount | grep usb&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the USB key can be written to and read from using the {{Code|/media/usb0}} directory.  Copying a file to {{Code|/media/usb0}} will copy a file to the USB key.  The same goes for removing, renaming, opening files within your program, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Mount points like {{Code|/media/usb0}} should not be hard-coded into any of your programs.  (See the [[#Common Problems and Solutions | Common Problems and Solutions]] section for more information.)  If you need to obtain the mount point for a freshly mounted USB key within your code, have your code obtain the mount tables and search on the &#039;&#039;device&#039;&#039;  (e.g. {{Code|/dev/sda1}} or {{Code|/dev/sdb1}}) and obtain the corresponding mounted {{Code|/media/usbN}} location, where N is a number 0-9.&lt;br /&gt;
&lt;br /&gt;
===Saving and Retrieving Data===&lt;br /&gt;
&lt;br /&gt;
This section covers getting data on and off of the SBC.  There are two main methods of simply moving data on and off the SBC - via a [[#Via a USB Key|USB key]], and via [[#Over the Network (SCP)|copy over the network]] - and a third method for moving and installing data when it concerns [[#Backing Up Your Data|backing up lower level system data]].&lt;br /&gt;
&lt;br /&gt;
====Via a USB Key====&lt;br /&gt;
&lt;br /&gt;
After plugging in a USB data key, first you need to [[#Using USB Data Keys | find out the location]] where that data key was mounted.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the location of the USB key is {{Code|/media/usb0/}}, and we want to copy the file {{Code|data.txt}} to the USB key.  Your SSH session might look something like this, using [[#ls|ls]] and [[#mount|mount]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# ls&lt;br /&gt;
data.txt&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
root@phidgetsbc:~# cp data.txt /media/usb0/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;cp&#039;&#039;&#039; program copies data from a source to a destination.  The syntax is {{Code|cp from to}}, where here we are copying from {{Code|data.txt}} to {{Code|/media/usb0/}}.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Caution:&#039;&#039;&#039; Even if there is no USB key mounted at {{Code|/media/usb0/}}, this use of {{Code|cp}} will still work &#039;&#039;with no errors&#039;&#039;!  This is because there is still a file called {{Code|/media/usb0/}}, there is just no USB key file system &#039;&#039;mounted&#039;&#039; to that point.  So be sure to run [[#mount|mount]] or use some other method of determining that there is, in fact, a USB data key attached and where it is mounted to.&lt;br /&gt;
&lt;br /&gt;
====Over the Network (SCP)====&lt;br /&gt;
&lt;br /&gt;
SCP is a command line program already installed on Linux and Mac OS, and downloadable for free on Windows.  We discuss it and give examples in the [[#SSH|SSH]] section, but remember it here when you&#039;re trying to get data on and off of the SBC.  With SSH or a terminal already open, you&#039;ll probably find it to be much faster and easier than dealing with a USB key.&lt;br /&gt;
&lt;br /&gt;
====Backing Up Your Data====&lt;br /&gt;
&lt;br /&gt;
For the web interface, you can save and restore all web interface settings under the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} tab.&lt;br /&gt;
&lt;br /&gt;
To save the settings of what packages are installed for later re-installation, you can type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg --get-selections &amp;gt; installedPrograms.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then save the file {{Code|installedPrograms.txt}} externally.  If you have to completely wipe the SBC, you can just reinstall the whole list by moving the {{Code|installedPrograms.txt}} file back onto the SBC, and then typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dpkg –set-selections &amp;lt; installedPrograms.txt&lt;br /&gt;
apt-get dselect-upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also remember to externally save:&lt;br /&gt;
* Your {{Code|~/.bashrc}} settings file if you&#039;ve changed it&lt;br /&gt;
* Your {{Code|crontab}} file if [[#Via Cron|you&#039;ve edited it]]&lt;br /&gt;
* Any data files or code you&#039;ve created&lt;br /&gt;
&lt;br /&gt;
It is important to save these settings often, and at points where you know the system is running well.  It may be tempting to create a backup right before you [[#Recovery System|wipe the SBC and start from scratch]], but often the reason you are having problems then is some setting or change, and backing these up and reinstalling them will only reinstall the problem.&lt;br /&gt;
&lt;br /&gt;
To truly back the files up, you must copy them to an external computer or location using either a [[#Via a USB Key|USB Key]] or [[#Over the Network (SCP) | over the network]].  Then they can be copied back if needed later.&lt;br /&gt;
&lt;br /&gt;
If you are looking to restore data on an SBC that will not boot properly, you&#039;ll want to be in the [[#Partial Recovery|partial recovery]] portion of our Troubleshooting section.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
The SBC can be quite tricky to debug, because it is a complex and flexible computer.  Common problems and solutions include:&lt;br /&gt;
* You can&#039;t find the SBC on the network at all - refer to the [[#Initial Internet Setup|Initial Internet Setup]] section&lt;br /&gt;
* You have changed some setting or file such that the SBC doesn&#039;t run anymore, or doesn&#039;t run as expected - refer to the [[#Recovery|Recovery]] section&lt;br /&gt;
&lt;br /&gt;
If you are having trouble using Phidgets on the SBC, you should go through the [[OS - Linux#Troubleshooting | Troubleshooting section on the general Linux page]].  Some of the problems on the Linux page (such as library problems) are easier to fix by simply working through the [[#Recovery|Recovery]] section when they occur on the SBC.&lt;br /&gt;
&lt;br /&gt;
Namely, it often helps to simply perform a [[#Factory Reset|factory reset]] on the SBC (save your files and installed program list first, as [[#Backing Up Your Data|described here]]).  Sometimes you change a file or setting within the operating system when you are trying to get something up and running, and this unintentionally affects other programs too.  Performing a factory reset starts you with a clean slate.&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, or the information within this guide, please [[Contact Us|ask us]]!&lt;br /&gt;
&lt;br /&gt;
===Initial Internet Setup===&lt;br /&gt;
&lt;br /&gt;
To set up the SBC, you almost always need a &#039;&#039;wired&#039;&#039; Ethernet connection with DHCP (Dynamic Host Configuration Protocol), and without a firewall.  This connection should be to a &#039;&#039;router&#039;&#039;, not directly plugged in to your computer.&lt;br /&gt;
&lt;br /&gt;
Even if you do not have this type of a connection at home, these types of connections are very common at both offices and universities.  On a Windows or Mac OS computer, you can bring up the [[Phidget Control Panel]] as described in the SBC&#039;s [[1072 User Guide#Getting Started|Getting Started Page]].  Failing this, or on a Linux computer, we discuss some alternate setup methods in this section.  Keep in mind that without a wired, open DHCP connection these setup methods can be difficult and fickle. &lt;br /&gt;
&lt;br /&gt;
====No Wired-Only Connection====&lt;br /&gt;
&lt;br /&gt;
Sometimes it can work to plug the SBC, using Ethernet, directly into an Ethernet port on your home wireless router.  Do not plug it directly into your computer!  (Although in some instances, a direct connection can be made to work on Linux, see the [[#No DHCP|No DHCP]] section below) &lt;br /&gt;
&lt;br /&gt;
This direct-router method is a very picky process, however, and can fail because:&lt;br /&gt;
* Some home and office routers place a firewall between wireless connections (clients) and wired connections (the local area network)&lt;br /&gt;
* Some home and office routers do not by default allow both Ethernet DHCP and wireless DHCP.&lt;br /&gt;
* Some routers and DHCP hubs only provide access to an internet connection, and do not provide local area network inter-connections (this is common on mobile device tethering hubs)&lt;br /&gt;
&lt;br /&gt;
Routers are quite complex, and even with admin privileges it can be a painstaking process to find all the right firewall settings to turn off in order to allow two computers on the network to talk to one another, rather than just connect to the internet.  This is why university or office networks are often ideal for the purpose of setting up the SBC, because these institutions depend on computers on a local network being able to talk together.  University libraries in particular can be a good source of wired DHCP connection ports.  &lt;br /&gt;
&lt;br /&gt;
Covering all of the different router configuration possibilities here, and how to change them to make the SBC work, is essentially impossible.  If you try using the SBC at home or at work, the SBC does not work on the first try when plugged directly into the router via Ethernet, and you want to make that connection work rather than seeking out an alternate for the initial setup, you should find documentation specific to your router (usually available online) and properly configure it.&lt;br /&gt;
&lt;br /&gt;
The good news is that if you can find an Ethernet DHCP connection &#039;&#039;just once&#039;&#039; for a short time, you can use that connection to configure the SBC to work on your home wireless network.  During that initial connection, you can enable wireless and set up as many wireless DHCP connections (with passwords) that you need.  Once wireless is enabled and set up, you can take the SBC home to your wireless router and the SBC will automatically seek out and connect to its remembered networks as they appear.  At that point, you can also use wireless like a normal internet, web interface, and SSH connection.&lt;br /&gt;
&lt;br /&gt;
====No Link Local Addressing====&lt;br /&gt;
&lt;br /&gt;
If you have a wired DHCP connection, no firewall, and no link local addressing (e.g. bonjour or avahi is not installed) then you will need access to the DHCP router logs.  From the router logs, you should see the connection (or attempted connection) by the SBC within the logs.  From that log entry, you should either be able to determine the IP address for the SBC, or see what happens when the router blocks access.  The IP address can be used in place of the link local address for both the web interface and for SSH.&lt;br /&gt;
&lt;br /&gt;
====No DHCP====&lt;br /&gt;
&lt;br /&gt;
The SBC will first try to use DHCP, but then it will revert to responding to a link local address under bonjour and avahi.  If you are depending on this, please wait &#039;&#039;&#039;at least three minutes&#039;&#039;&#039; after the SBC boots for the SBC to fail in obtaining a DHCP connection and properly revert to link local addressing.&lt;br /&gt;
&lt;br /&gt;
If you have a static IP setup, and want to use link local addressing rather than accessing the router logs, this should usually work by default on Windows and Mac OS (e.g. type the address such as {{Code|phidgetsbc.local}} into a web browser).  If it doesn&#039;t work automatically, there is not much you can do and you should seek out a wired DHCP connection elsewhere.&lt;br /&gt;
&lt;br /&gt;
On Linux, it also should work by default, but you have the additional option of explicitly adding routes that look within the default network settings for the SBC.  From a terminal (as root), type:&lt;br /&gt;
* {{Code|route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0 metric 99}}&lt;br /&gt;
* {{Code|route add default dev eth0 metric 99}}&lt;br /&gt;
You can also compile and use the {{Code|phidgetsbclist.c}} example (use the provided Makefile, don&#039;t use gcc) in the [{{SERVER}}/downloads/libraries/libphidget.tar.gz Phidget Linux Libraries] package, under the {{Code|examples}} folder.  This will allow you to see if the SBC is detected on the network at all.   Note that to use this option you must have the Phidget Libraries and the Phidget WebService installed on your Linux computer - in-depth instructions to do this are on the [[OS - Linux|main Linux page]].&lt;br /&gt;
&lt;br /&gt;
===Recovery System===&lt;br /&gt;
&lt;br /&gt;
You can either boot the SBC into recovery mode and attempt to recover files and settings, or you can completely wipe the SBC by performing a factory reset.  If the LEDs do not turn on normally (red on constantly, green on at first start, then off, then on when fully booted) then you&#039;ll want to read the [[#Hardware Issues|hardware issues]] section.&lt;br /&gt;
&lt;br /&gt;
====Partial Recovery====&lt;br /&gt;
&lt;br /&gt;
The recovery system can be entered in two ways:&lt;br /&gt;
# From the {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore}} web interface page.&lt;br /&gt;
# By holding down the reset button for 20+ seconds - until the green light has switched from flashing slowly to flashing quickly.&lt;br /&gt;
&lt;br /&gt;
The recovery system runs an [[#SSH|SSH]] server where the username and password both are {{Code|root}}.&lt;br /&gt;
&lt;br /&gt;
If the main filesystem has been damaged/misconfigured in such a way that it won’t boot, you may be able to fix the issue or recover important files before running a full factory reset. From an SSH connection to the recovery system, you can mount the main root filesystem with the following commands (assuming it’s not damaged):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
ubiattach /dev/ubi_ctrl -m 6&lt;br /&gt;
mount -t ubifs /dev/ubi0_0 /mnt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Factory Reset====&lt;br /&gt;
&lt;br /&gt;
This restores the kernel and root filesystem from backup, overwriting any changes that may have been made and &#039;&#039;completely wiping the system&#039;&#039; to the state that it got shipped in. (You can save your files and installed program list first, as [[#Backing Up Your Data|described here]].)  This can be enacted one of two ways.&lt;br /&gt;
# Use the reset button:&lt;br /&gt;
##Enter the recovery mode by holding down the reset button for 20+ seconds as above (until fast flashing)&lt;br /&gt;
##Wait for a full boot (i.e. you can see it on the [[Phidget Control Panel]], or can SSH with username and password as {{Code|root}})&lt;br /&gt;
##Hold down the reset button again, but this time for only 10 seconds (until slow flashing)&lt;br /&gt;
##Wait for the SBC to fully reset and reboot (at least three minutes) - the LED will turn off and on again when this occurs&lt;br /&gt;
##*Note that after a factory reboot the SSH server will be disabled&lt;br /&gt;
##*Also note that after a factory reboot the SBC creates new SSH keys, and reverts to the {{Code|phidgetsbc.local}} address&lt;br /&gt;
# Via the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, where you can follow the instructions&lt;br /&gt;
&lt;br /&gt;
====Hardware Issues====&lt;br /&gt;
&lt;br /&gt;
The LEDs are an indicator of the hardware working properly.  The normal boot process is:&lt;br /&gt;
* Red LED: Turns on from moment of power being applied.&lt;br /&gt;
* Green LED: Turns on momentarily when power applied, then turns off momentarily, then turns on and stays on when booted.&lt;br /&gt;
&lt;br /&gt;
If the green status LED never turns on (or fails to turn on the second time), the boot process is failing somewhere.  This could be due to:&lt;br /&gt;
* A damaged OS - Try performing a [[#Factory Reset|Factory Reset]]&lt;br /&gt;
* If this fails, it is likely hardware damage (very difficult to diagnose, please [[Contact Us|contact us]])&lt;br /&gt;
&lt;br /&gt;
If neither LED turns on, hardware damage is even more likely.  Unless the path to the red LED is the one thing that has been damaged, the device is likely not receiving and using power.&lt;br /&gt;
* Try performing a [[#Factory Reset|Factory Reset]], and if that does not work please [[Contact Us|contact us]]&lt;br /&gt;
&lt;br /&gt;
=====USB Issues=====&lt;br /&gt;
&lt;br /&gt;
On the Phidget SBC2, there is a hardware issue that is unrelated to the LEDs.  It is a USB problem, and manifests in many ways:&lt;br /&gt;
* Strange behaviour when some devices but not others are plugged in to the SBC&lt;br /&gt;
* Strange behaviour with combinations of devices&lt;br /&gt;
* Failure (or intermittent failure) to see Phidgets on the USB hub, or USB keys on the hub&lt;br /&gt;
&lt;br /&gt;
This problem is fixable, either on your own or by sending your SBC back to Phidgets.  For an in-depth solution, see the [[SBC2_USB_Hub_Fix | SBC2 Hub Fix Page]].&lt;br /&gt;
&lt;br /&gt;
===Updating Your SBC===&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve owned your SBC for a while and want to update your packages, you can run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...to &#039;&#039;update&#039;&#039; your software source list and then &#039;&#039;upgrade&#039;&#039; to the latest version of all installed software.  If you are used to Mac OS or Windows, note that this does not just update the non-kernel parts of the operating system, it updates every additional piece of software you have installed.&lt;br /&gt;
&lt;br /&gt;
To update the SBC software itself (e.g. the kernel), it is easiest to use the web interface, under {{Code|System &amp;amp;rarr; Backup &amp;amp; Restore &amp;amp;rarr; Go button}}, to enter a page that will give you the option to update.  You will need to have an update file on a USB key inserted into the SBC, of type:&lt;br /&gt;
* UBI Image (system_ubi.img), or &lt;br /&gt;
* Kernel image (uImage), or&lt;br /&gt;
* Phidget Upgrade package containing both UBI and Kernel images (phidgetsbc*.bin)&lt;br /&gt;
&lt;br /&gt;
These are either obtained from the Phidgets website, or are a custom kernel / filesystem that you can create yourself, if you are experienced.&lt;br /&gt;
&lt;br /&gt;
The reason why this information is in troubleshooting is that you should certainly [[#Backing Up Your Data|back up your system]] before trying this.  And, it is quite rare to need to upgrade the kernel or filesystem on the SBC, so something serious should be going on before you attempt it.  Try using the [[#Recovery System|recovery system]] first.&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
Now that you have the basic libraries installed, you can pick your language and begin programming!  &lt;br /&gt;
&lt;br /&gt;
If you are not using the [[#WebService | webservice]] to control a Phidget over a network, your next step will be to delve into the use of your specific language.  Each page has its own set of specific libraries, code examples, and setup instructions.  &lt;br /&gt;
&lt;br /&gt;
On SBC Linux, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Java | Java]]&lt;br /&gt;
*[[Language - Python | Python]]&lt;br /&gt;
&lt;br /&gt;
These languages may also run on the SBC, but we do not yet directly offer SBC support for them:&lt;br /&gt;
* [[Language - Ruby|Ruby]]&lt;br /&gt;
* [[Language - C Sharp|C#]] (using Mono)&lt;br /&gt;
&lt;br /&gt;
You can probably figure out how to install and use them by a combination of the language pages linked above, and the section on [[#Installing Other Languages|installing other languages on the SBC]].&lt;br /&gt;
&lt;br /&gt;
==WebService==&lt;br /&gt;
&lt;br /&gt;
The SBC comes with the [[Phidget WebService]] installed, and the SBC automatically starts the WebService at boot.&lt;br /&gt;
&lt;br /&gt;
To practice using the WebService, and to learn more about it, we have hands-on examples on the [[OS - Linux|general Linux page]], starting in the [[OS - Linux#Using the WebService|using the WebService section]].&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Shutting off USB ports to save power===&lt;br /&gt;
The SBC3 has an on-board USB hub that can control power to the ports. To do this unbind and rebind the USB drivers.&lt;br /&gt;
&lt;br /&gt;
To turn off the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/unbind}}&lt;br /&gt;
&lt;br /&gt;
To turn on the ports {{code|echo &amp;quot;1-1&amp;quot; &amp;gt;/sys/bus/usb/drivers/usb/bind}}&lt;br /&gt;
&lt;br /&gt;
These will also cause detach and attach events for the Phidget devices, respectively. While the drivers are unbound, you will not get any hot plug events for any devices on USB.&lt;br /&gt;
&lt;br /&gt;
===Using a Touchscreen===&lt;br /&gt;
Please note that this will ONLY work with an SBC3 since it has a USB 2.0 hub:&lt;br /&gt;
&lt;br /&gt;
Using a touchscreen with the SBC is a great way to get user input and visual feedback from an SBC otherwise devoid of visual output.  The SBC does not have any conventional display ports such as VGA, DVI, or HDMI but it does have a number of USB ports and USB displays do exist.  With the upgrade to a USB 2.0 hub on the SBC3 from the earlier models which had USB 1 hubs the SBC now has enough capability to operate a screen over USB.  We don&#039;t recommend running a standard desktop environment since the processor is too slow to really keep up with a typical desktop it does make for an excellent interface for a kiosk, instrumentation control panel or  other, similar use case.  This document is going to go through the process of enabling support for a typical USB display as well as installing a fairly compact desktop environment called xfce on the SBC.  &lt;br /&gt;
&lt;br /&gt;
The screen I will be using is from a company called [http://lilliputweb.net/ Lilliput].  Specifically a UM-70 model.  Before you begin, please make sure that you have the screen plugged into the SBC, it will also be useful to have a spare USB keyboard and mouse handy as you will need them once you are no longer using an SSH terminal to communicate with the SBC.&lt;br /&gt;
&lt;br /&gt;
[[File:lilliputoff.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Getting the display to function====&lt;br /&gt;
Begin by logging into the web configuration page for your SBC and upgrading all of the packages on the SBC.  Be sure to include the full Debian package repository.  For more information on how to do this refer to the  [[OS - Phidget SBC#Getting Started - External Computer|getting started]] section of the Phidget SBC documentation.  Once you are fully up to date open an SSH session with the SBC and navigate to the &amp;quot;/etc&amp;quot; folder.  Open inittab with a terminal-based text editor such as nano and add the following to the bottom of the file, just above the {{code|T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100}} line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
1:2345:respawn:/sbin/getty 38400 tty1 &lt;br /&gt;
2:23:respawn:/sbin/getty 38400 tty2 &lt;br /&gt;
3:23:respawn:/sbin/getty 38400 tty3 &lt;br /&gt;
4:23:respawn:/sbin/getty 38400 tty4 &lt;br /&gt;
5:23:respawn:/sbin/getty 38400 tty5 &lt;br /&gt;
6:23:respawn:/sbin/getty 38400 tty6 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reboot your system.  After a few minutes you should see the LCD screen come up with a standard Linux terminal interface and a login prompt.  This is all well and good but this isn&#039;t really appreciably better than simply using an SSH session to communicate with the SBC.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputlogin.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Setting up Xfce====&lt;br /&gt;
In order to get a traditional windowing environment we still need to install a desktop manager as well as a number of supporting packages.  Log in and make sure everything is still up to date with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install the following packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xserver-xorg lxde xfce4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the SBC asks you if you want to continue, just type &amp;quot;Y&amp;quot; and press enter.  &lt;br /&gt;
&lt;br /&gt;
This will install the xfce desktop environment and any other necessary programs on the SBC.  When it&#039;s done, restart the SBC.  When it boots back up it should boot directly to a login screen instead of the terminal interface.  Log in, and you are good to go.  It won&#039;t be particularly fast, but don&#039;t worry, the SBC does not have a dedicated video processor on it so it&#039;s perfectly normal for it to be slow.  What&#039;s important is that it works.  &lt;br /&gt;
&lt;br /&gt;
[[File:lilliputdesktop.jpg|center|400px|link=]]&lt;br /&gt;
&lt;br /&gt;
====Calibrating the touch screen====&lt;br /&gt;
Unfortunately, by default the screen is calibrated to believe the bottom of the screen is on the right hand side.  This has the effect of making the touch functionality more or less useless until it has been properly calibrated.  To do this, install the following package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install xinput-calibrator&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now use xinput calibrator to measure the parameters of your screen.  Launch xinput calibrator (called Calibrate Touchscreen in the programs menu) and follow the instructions on the screen.  The screen should now be functioning at full potential.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Using a Different Wireless Adapter===&lt;br /&gt;
&lt;br /&gt;
The support for the wireless adaptor that Phidgets sells is written into the SBC kernel.  Hence, we do not support using other adaptors. &lt;br /&gt;
&lt;br /&gt;
However, Linux is very flexible, and it is possible (though not easy) to write a custom kernel for the SBC and add support for a new wireless adaptor.  We can&#039;t help you with this, but we do provide some basic guidelines for [[#Custom Kernel and Filesystem|building your own kernel]].  You can also have a look at our thoughts on our own experience with choosing a Wifi adapter: [[Alternative Wi-Fi Adapters on the SBC]].&lt;br /&gt;
&lt;br /&gt;
===Using a Different Webcam===&lt;br /&gt;
&lt;br /&gt;
In addition to the webcam that Phidgets sells, you have the option to use many different webcams with the SBC.  There is a [http://www.ideasonboard.org/uvc/#devices long list] of compatible webcams.&lt;br /&gt;
&lt;br /&gt;
The common thread for these webcams is that they use UVC - the USB Video Class - drivers for Linux.  You can then use [[#mount|mount]] to find out what video device your webcam is mounted under.&lt;br /&gt;
&lt;br /&gt;
===Taking Pictures With the Webcam===&lt;br /&gt;
&lt;br /&gt;
Probably the most straightforward way to use a webcam for pictures rather than video is to use the {{Code|opencv}} library.  You can get it by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install libcv2.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there is no {{Code|libcv2.1}} package, you can perform {{Code|apt-cache search libcv}} to find the current version.&lt;br /&gt;
&lt;br /&gt;
The opencv libraries can also be used within Python, by installing the link between them:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install python-opencv&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then taking pictures from within code becomes quite simple.  For example, in Python, taking and saving an image is four lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
#! /usr/bin/python&lt;br /&gt;
&lt;br /&gt;
import cv&lt;br /&gt;
&lt;br /&gt;
# The webcam is located at /dev/video0 &lt;br /&gt;
# OpenCV only needs the number after video&lt;br /&gt;
webcam = cv.CaptureFromCAM(0)&lt;br /&gt;
&lt;br /&gt;
frame = cv.QueryFrame(webcam)&lt;br /&gt;
&lt;br /&gt;
cv.SaveImage(&amp;quot;image.jpg&amp;quot;, frame)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the complete OpenCV documentation, see [http://opencv.willowgarage.com/documentation/index.html The OpenCV Reference], and specifically the section on [http://opencv.willowgarage.com/documentation/reading_and_writing_images_and_video.html Reading and Writing Images].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The SBC is probably not as powerful for image processing and transport when compared to your desktop computer.  Try running your image processing code on the SBC from an early point in development.  During those test runs, you can visit the first System page of the [[#SBC Web Interface|SBC Web Interface]] to check the processor and memory use.  For more information on processor power, check the specification for your SBC (on the product page on [{{SERVER}} our main website]) as well as our discussion of [[#Pushing Processor Limits|pushing processor limits]] below.&lt;br /&gt;
&lt;br /&gt;
===Checking System Logs===&lt;br /&gt;
&lt;br /&gt;
The SBC maintains two logs: a kernel log and a system log.  &lt;br /&gt;
&lt;br /&gt;
The kernel log is for low-level occurrences, such as devices attaching and leaving the USB hub, recording what drivers are being used, and so on.&lt;br /&gt;
&lt;br /&gt;
The system log (syslog) is for normal chatter from the operating system.  Any program with the right permissions can use it (though you need to know the method to write to it, information all around the Internet can help) and it contains everything from the Ethernet going up and down, to webserver requests, and so on.  If you don&#039;t run many programs or services on the SBC, the syslog will essentially be a mirror of the kernel log, because the kernel is the only thing talking.&lt;br /&gt;
&lt;br /&gt;
You can check these logs by using the web interface in the {{Code|System &amp;amp;rarr; Logs}} tab.&lt;br /&gt;
&lt;br /&gt;
Or you can perform more powerful filtering and displaying via an SSH terminal.  For example, {{Code|dmesg}} is the command to display the kernel log, and {{Code|tail}} prints the last ten lines of input.  So, if you are trying to see if you can get a device to be detected on USB, you can run &amp;lt;code&amp;gt;dmesg | tail&amp;lt;/code&amp;gt; to print the latest ten lines of kernel log data.&lt;br /&gt;
&lt;br /&gt;
The actual locations of the log files (for filtering and reading) are:&lt;br /&gt;
* {{Code|/var/log/syslog}} &lt;br /&gt;
* {{Code|/var/log/dmesg}}&lt;br /&gt;
But don&#039;t edit them directly!  Always follow the advice and procedures around the Internet on how to properly log items to syslog.&lt;br /&gt;
&lt;br /&gt;
===X Forwarding===&lt;br /&gt;
&lt;br /&gt;
Although most tasks can be done using the [[#SBC Web Interface|SBC Web Interface]] or [[#SSH|SSH]], you can also set up X11 forwarding on the SBC.  X11 is the window manager base, which provides a graphical windowing system on the SBC.  Although you probably won&#039;t connect directly to the X11 manager (i.e. by plugging a screen directly into the SBC), X11 also gives a user the ability to forward graphical windows over SSH.  You will need the following packages installed:&lt;br /&gt;
* {{Code|x11-common}}&lt;br /&gt;
* {{Code|xbase-clients}}&lt;br /&gt;
After installing, make sure that the line in {{Code|/etc/ssh/sshd_config}} has a line that says:&lt;br /&gt;
:{{Code|X11Forwarding yes}}&lt;br /&gt;
Then log out and log back into the SBC.  This second time you log in, use the {{Code|-X}} switch to turn on X forwarding for that connection:&lt;br /&gt;
:{{Code|ssh -X root@phidgetsbc.local}}&lt;br /&gt;
Then you should be able to run programs that launch a window, and it will launch remotely and appear on the computer you have the SSH connection from.&lt;br /&gt;
&lt;br /&gt;
===Pushing Processor Limits===&lt;br /&gt;
&lt;br /&gt;
The SBC, though more powerful than many embedded computers out there, is probably about as powerful as your smartphone.  If you hook up 1 ms Phidget sampling devices to all six of its USB ports, events and packets will probably get lost.  The exact data rates you can accomplish depend on:&lt;br /&gt;
* What else is running on the SBC&lt;br /&gt;
* How efficient your code is for external operations (like File I/O)&lt;br /&gt;
* Other minor details (e.g. the temperature of the SBC, etc)&lt;br /&gt;
&lt;br /&gt;
If you want to achieve data rates as fast as possible, try these tips:&lt;br /&gt;
* Program in C, not in an interpreted language (Python, Java, .NET)&lt;br /&gt;
* Perform file I/O as little as possible.  Locally cache data, manage your writing to a file in a separate thread, and use low-level write calls.&lt;br /&gt;
* Change the [[#Custom Kernel and Filesystem|filesystem]] to a faster, non-compressed file system.&lt;br /&gt;
** Alternatively, use a high-data-rate USB key.&lt;br /&gt;
* Keep other running processes to a minimum. &lt;br /&gt;
** If you are running code locally right on the SBC, turn off the Phidget WebService.&lt;br /&gt;
&lt;br /&gt;
===Custom Kernel and Filesystem===&lt;br /&gt;
&lt;br /&gt;
You can compile your own kernel and flash it to the board. It is left up to the user to configure an appropriate cross-compiler for kernel development. You may also be able to compile a new kernel on-board.  We have a kernel development kit, complete with patch file and README:&lt;br /&gt;
* [{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package]&lt;br /&gt;
&lt;br /&gt;
Compiling a new, custom kernel is somewhat complex.  If the SBC is your first experience with Linux, writing a custom kernel will be difficult.  However, it will probably also be very rewarding because you can put whatever you like into it.  We might be able to offer additional suggestions, but ultimately you&#039;re on your own here. &lt;br /&gt;
&lt;br /&gt;
You may be able to write a custom kernel right on the SBC, but the easiest way is to develop the kernel on an external computer.  And the easiest way to develop on an external computer is for that computer to also be Linux, even just in a Virtual Machine.  The time spent loading a copy of Linux into a virtual machine (such as VirtualBox, which is free) onto your computer will probably be less time than setting up a standard compiler on Windows to cross-compile.&lt;br /&gt;
&lt;br /&gt;
On your external Linux system, you will need:&lt;br /&gt;
* A cross-compiling toolchain for the ARM processor, which we briefly describe on the [[OS - Linux#Cross-Compiling with a Custom Toolchain | main Linux page]], and &lt;br /&gt;
* The [{{SERVER}}/downloads/libraries/phidgetsbc2-kerneldev.tar.gz SBC Kernel Development Package] from the Phidgets website.  &lt;br /&gt;
The kernel development kit has a brief README file which describes how to obtain the proper kernel and patch, configure, customize, and build it.&lt;br /&gt;
&lt;br /&gt;
We have an application guide in progress, which walks through building a custom kernel to add Bluetooth support to the SBC.  Please contact us if you would like more information.  Even if you are trying to add support for hardware other than a bluetooth modem, or wondering if support even exists in the kernel for your modem (3G, alternate wireless, etc) you will probably find the application guide helpful.  Follow it up to the point where you run the program {{Code|menuconfig}} (you don&#039;t need an SBC to do this), which will give you a menu of all drivers you can enable in the SBC kernel.&lt;br /&gt;
&lt;br /&gt;
After making your new kernel, you should have a uImage and modules target for your Makefile.  At this point you can transfer your kernel files onto the SBC, make their targets, and transfer them into the nand memory.  This involves erasing the old kernel, flashing the new kernel, installing the new kernel modules, and rebooting.  From the SBC, in the kernel directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
make uImage; make modules&lt;br /&gt;
flash-eraseall /dev/mtd3&lt;br /&gt;
nandwrite -p /dev/mtd3 arch/arm/boot/uImage&lt;br /&gt;
make modules-install&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Custom kernels can also be flashed from the [[#Recovery System | Recovery System]].&lt;br /&gt;
&lt;br /&gt;
If you need to create a root filesystem image, the filesystem type is UBIFS, and the commands to create it are:&lt;br /&gt;
&lt;br /&gt;
====For SBC2:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====For SBC3:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r $ROOTFS/ system_ubifs.img&lt;br /&gt;
ubinize -o system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where {{Code|ubinize.cfg}} contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
# Section header&lt;br /&gt;
[rootfs]		&lt;br /&gt;
# Volume mode (other option is static)&lt;br /&gt;
mode=ubi		&lt;br /&gt;
# Source image&lt;br /&gt;
image=system_ubifs.img	&lt;br /&gt;
# Volume ID in UBI image&lt;br /&gt;
vol_id=0		&lt;br /&gt;
# Volume size&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
# Allow for dynamic resize&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
# Volume name&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
# Autoresize volume at first mount&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You then flash ‘system_ubi.img’ (not ‘system_ubifs.img’) from the recovery system.&lt;br /&gt;
&lt;br /&gt;
Again, like the custom kernel creation, the need to create a custom root filesystem is essentially non-existent except for those advanced users who already know they need it... and furthermore, you are almost entirely on your own.&lt;br /&gt;
&lt;br /&gt;
===Saving a file system to flash to multiple SBC&#039;s===&lt;br /&gt;
You may want to create a complete backup of your SBC root filesystem, which can then be flashed to other SBCs. This is how it could be done:&lt;br /&gt;
&lt;br /&gt;
You will need a USB flash drive - at least 2GB is recommended. Make sure it&#039;s empty, as it will be reformatted.&lt;br /&gt;
&lt;br /&gt;
All of these commands are executed on your SBC, while logged in over SSH.&lt;br /&gt;
&lt;br /&gt;
First, re-format the USB drive as ext3. Assuming the USB drive is sda and has a single partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
mkfs.ext3 /dev/sda1&lt;br /&gt;
mount -t ext3 /dev/sda1 /media/usb0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remount / as readonly, so it doesn&#039;t change as we&#039;re copying it. To do this, we need to kill all running processes except sshd:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
service udev stop&lt;br /&gt;
service ifplugd stop&lt;br /&gt;
service rsyslog stop&lt;br /&gt;
service avahi-daemon stop&lt;br /&gt;
service phidgetwebservice stop&lt;br /&gt;
service ntp stop&lt;br /&gt;
service busybox-httpd stop&lt;br /&gt;
service dbus stop&lt;br /&gt;
service cron stop&lt;br /&gt;
pkill dhclient&lt;br /&gt;
mount -o remount,ro /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the remount says that / is busy, do a &#039;ps auxww&#039; and &#039;pkill&#039; anything else that may be running until it remounts properly.&lt;br /&gt;
&lt;br /&gt;
Then, copy / to the flash drive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkdir /media/usb0/root&lt;br /&gt;
mount --bind / /mnt/&lt;br /&gt;
cp -a /mnt/* /media/usb0/root/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, clean up the copy - removing files specific to this board. We also remove the APT cache to save space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
find /media/usb0/root/var/log -type f -print0 | xargs -0 rm -f&lt;br /&gt;
rm -rf /media/usb0/root/var/lib/apt/lists/*&lt;br /&gt;
mkdir /media/usb0/root/var/lib/apt/lists/partial&lt;br /&gt;
rm -f /media/usb0/root/var/cache/apt/*.bin&lt;br /&gt;
rm /media/usb0/root/etc/udev/rules.d/70-persistent-net.rules&lt;br /&gt;
rm /media/usb0/root/etc/ssh/ssh_host_*&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
then, create the ubinize.cfg file:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi	&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=83MiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs0&lt;br /&gt;
vol_flags=autoresize&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
cd /media/usb0&lt;br /&gt;
cat &amp;gt; ubinize.cfg &amp;lt;&amp;lt; EOF&lt;br /&gt;
[rootfs]		&lt;br /&gt;
mode=ubi		&lt;br /&gt;
image=/media/usb0/system_ubifs.img	&lt;br /&gt;
vol_id=0		&lt;br /&gt;
vol_size=64128KiB&lt;br /&gt;
vol_type=dynamic	&lt;br /&gt;
vol_name=rootfs		&lt;br /&gt;
vol_flags=autoresize	&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: you may need to increase vol_size if your filesystem is larger.&lt;br /&gt;
&lt;br /&gt;
then, create the UBI image from the copy:&lt;br /&gt;
&lt;br /&gt;
For SBC3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -F -m 4KiB -e 248KiB -c 4000 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 4KiB -p 256KiB ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For SBC2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mkfs.ubifs -m 2KiB -e 126KiB -c 4050 -r /media/usb0/root /media/usb0/system_ubifs.img&lt;br /&gt;
ubinize -o /media/usb0/system_ubi.img -m 2KiB -p 128KiB -s 512 ubinize.cfg&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then, unmount the drive to ensure everything is written out properly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
umount /dev/sda1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you can remove the /root/ folder and system_ubifs.img. system_ubi.img can be flashed to other SBCs using the recovery system.&lt;br /&gt;
&lt;br /&gt;
==Software Details==&lt;br /&gt;
&lt;br /&gt;
For even more advanced uses of the SBC, it may help to know the gritty details of the SBC software system.&lt;br /&gt;
&lt;br /&gt;
;Operating System&lt;br /&gt;
:Debian/GNU Linux&lt;br /&gt;
:Kernel 2.6.X or higher (generally kept up to date with latest releases, use {{Code|uname -r}} to check the kernel version)&lt;br /&gt;
&lt;br /&gt;
;Main Filesystem (rootfs)&lt;br /&gt;
:UBIFS (a raw flash type of file system)&lt;br /&gt;
:Mounted in a 460 MB Nand partition (in Read/Write mode)&lt;br /&gt;
&lt;br /&gt;
;Kernel&lt;br /&gt;
:uImage format&lt;br /&gt;
:Has its own 3MiB partition on bare Nand&lt;br /&gt;
&lt;br /&gt;
;Web Interface Scripts and Configuration Data&lt;br /&gt;
:Located in {{Code|/etc/webif}}&lt;br /&gt;
:Modifying these scripts can be done; however, it is very easy to enter invalid data that could cause the system to behave unexpectedly or not boot.&lt;br /&gt;
&lt;br /&gt;
;User Applications uploaded through Web Interface&lt;br /&gt;
:Located in {{Code|/usr/userapps}}&lt;br /&gt;
&lt;br /&gt;
;Webcam Device Location&lt;br /&gt;
:{{Code|/dev/video0}}&lt;br /&gt;
:Numbers increase with more webcams&lt;br /&gt;
&lt;br /&gt;
;Date and Time&lt;br /&gt;
:Set using ntp (network time protocol) at boot&lt;br /&gt;
:The ntp daemon continues to run in the background and will periodically update the clock &lt;br /&gt;
:The network keeps the SBC very close to real time&lt;br /&gt;
:Also there is a real-time clock with battery backup which will preserve date/time across reboots, power removal&lt;br /&gt;
:The real-time clock is synced to system time during reboot/shutdown&lt;br /&gt;
:If power is unplugged suddenly, and the network not restored, the real-time clock may not have the correct time&lt;br /&gt;
&lt;br /&gt;
;Wireless Networking System&lt;br /&gt;
:Wireless adapter support for the wireless adapter that Phidgets sells is written into the kernel&lt;br /&gt;
:It supports WEP and WPA&lt;br /&gt;
:It is best configured through the configuration interface.&lt;br /&gt;
&lt;br /&gt;
;Nand Layout&lt;br /&gt;
:The board contains 512MiB on Nand. This nand is split into 7 partitions as follows:&lt;br /&gt;
:0: u-boot		 size: 256K		 Read Only&lt;br /&gt;
:1: u-boot_env		 size: 128K		 Read Only&lt;br /&gt;
:2: recovery_kernel	 size: 2M		 Read Only&lt;br /&gt;
:3: kernel		 size: 3M		 Writable&lt;br /&gt;
:4: flashfs	 	 size: ~3.625M	 	 Read Only&lt;br /&gt;
:5: recovery_fs		 size: ~ 43M		 Read Only&lt;br /&gt;
:6: rootfs		 size: ~ 460M		 Writable&lt;br /&gt;
: The final size of flashfs/recovery_fs/rootfs depends on the image size at production, and on the number/location of bad blocks in the NAND.&lt;br /&gt;
: &#039;&#039;&#039;Note&#039;&#039;&#039;: U-Boot and recovery kernel and filesystem cannot be written from Linux - this is a safety measure.&lt;br /&gt;
&lt;br /&gt;
;Boot Loader&lt;br /&gt;
:U-Boot is used for setting up the processor and booting Linux, and is only accessible via a serial connection. &lt;br /&gt;
:Normal users will not need to use or modify it.&lt;br /&gt;
:Be very careful when modifying the u-boot partition. If it is damaged or overwritten, it is difficult to fix.&lt;br /&gt;
:When using U-Boot, a prompt will appear via serial shortly after power on.  &lt;br /&gt;
:The environment variables will help you determine how to boot Linux on the SBC&lt;br /&gt;
:You can also refer to the [http://www.denx.de/wiki/DULG/Manual U-Boot documentation]&lt;br /&gt;
&lt;br /&gt;
;Boot Process&lt;br /&gt;
:From power on...&lt;br /&gt;
:1. Processor loads first 4 bytes from NAND into Steppingstone and runs it.&lt;br /&gt;
:2. Steppingstone sets up RAM, copies u-boot from NAND into RAM and runs U-Boot.&lt;br /&gt;
:3. U-Boot initializes the processor, sets GPIO state, etc., copies the linux kernel into RAM, sets up the kernel command line arguments, checks that the kernel image is valid, and boots it.&lt;br /&gt;
:4. Linux boots, bringing up USB, Networking, NAND, etc. and then mounts the rootfs NAND partition on /.&lt;br /&gt;
:5. init gets run as the parents of all processes, as uses the /etc/inittab script to bring up the system. This includes mounting other filesystems, settings the hostname, and running the scripts in /etc/init.d, among other things.&lt;br /&gt;
:6. inittab then turns the green LED on.&lt;br /&gt;
:7. inittab then sets up a getty on the first serial port, ready for interfacing using the debug board.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|PHP Curl|Curl doesn&#039;t install smoothly}}&lt;br /&gt;
&lt;br /&gt;
There is an issue with the embedded version of PHP5.3, try forcing it to install the specific version that you need.  This can be done with the following command:&lt;br /&gt;
&lt;br /&gt;
{{Code|apt-get install php5-common&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;5.3.3-7+squeeze14}}&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|FTDI Errors|FTDI adapters do not appear to work with the SBC}}&lt;br /&gt;
&lt;br /&gt;
The 3.1.6 version of the Linux kernel which is used on some versions of the SBC has a bug that causes issues with FTDI drivers and makes them malfunction.  To solve this problem you must upgrade the kernel to a newer version.  You can find the files [[#Quick Downloads| here]].&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|USB Memory Key mounting|Sometimes USB Memory Keys mount at more than one location}}&lt;br /&gt;
&lt;br /&gt;
When you insert a memory key, the SBC will load it as a device (e.g. {{Code|/dev/sda1}}) and it will also &#039;&#039;mount&#039;&#039; the key for reading and writing within the {{Code|/media/}} directory.  The {{Code|/media/}} directory version will be called something like {{Code|usb0}}.  &lt;br /&gt;
At times, an inserted memory key will get mounted in more than one location.  You can observe if this occurs by checking the currently mounted devices with the command {{Code|mount}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# mount&lt;br /&gt;
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)&lt;br /&gt;
proc on /proc type proc (rw,noexec,nosuid,nodev)&lt;br /&gt;
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)&lt;br /&gt;
udev on /dev type tmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
procbususb on /proc/bus/usb type usbfs (rw)&lt;br /&gt;
/dev/sda1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
/dev/sda1 on /media/usb1 type vfat (rw,noexec,nodev,sync,noatime,nodiratime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will note that the same device ({{Code|/dev/sda1}}) is now mounted at &#039;&#039;both&#039;&#039; {{Code|/media/usb0}} and {{Code|/media/usb1}}.  To fix this problem as it occurs, you can use {{Code|umount}} (notice there is no letter &#039;n&#039;) to unmount the second instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@phidgetsbc:~# umount /media/usb1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In practice, this should not be a problem, because writing to or reading from either {{Code|usb0}} or {{Code|usb1}} will have the same effect on the memory key.  However, if you hard-code a media location into your program (i.e. expecting {{Code|/media/usb0}} to be the first USB key you insert and {{Code|/media/usb1}} to be the second key) your program will sometimes work and sometimes fail.  &lt;br /&gt;
&lt;br /&gt;
To get around this within code, find the mount point for each device as it appears.  The devices, such as {{Code|/dev/sda1}} will always refer to the actual memory key.  But, they cannot be written to directly without being mounted, so you will have to parse the mount table (what is returned from {{Code|mount}}) within your code to find the device and its corresponding mount point.&lt;br /&gt;
&lt;br /&gt;
This is a problem with the standard embedded Debian automount program, and we have no known fix.&lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|Perl Locale Errors on SSH|No Locales Installed}}&lt;br /&gt;
&lt;br /&gt;
By default, no locales are installed on the SBC.  If you use [[#apt|apt]] a lot to install and manage your software on the SBC, you will get messages like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
perl: warning: Setting locale failed.&lt;br /&gt;
perl: warning: Please check that your locale settings:&lt;br /&gt;
	LANGUAGE = (unset),&lt;br /&gt;
	LC_ALL = (unset),&lt;br /&gt;
	LANG = &amp;quot;en_CA.UTF-8&amp;quot;&lt;br /&gt;
    are supported and installed on your system.&lt;br /&gt;
perl: warning: Falling back to the standard locale (&amp;quot;C&amp;quot;).&lt;br /&gt;
locale: Cannot set LC_CTYPE to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_MESSAGES to default locale: No such file or directory&lt;br /&gt;
locale: Cannot set LC_ALL to default locale: No such file or directory&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To squelch these messages, you should install and reconfigure your locale like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install locales&lt;br /&gt;
dpkg-reconfigure locales&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command will show you a long list from which you should pick your location, by language.  For example, en_CA is english_Canada.  Here in Calgary, we use en_CA.UTF-8 and so for the first question we would input locale &amp;quot;114&amp;quot; and for the second (system) question we would input {{Code|en_CA}} for the locale.&lt;br /&gt;
&lt;br /&gt;
This might give you a locale undefined error, in which case you can generate the locale (for us, again, it is en_CA):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
locale-gen en_CA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Wire_Transfer_Bank_Information&amp;diff=23696</id>
		<title>Wire Transfer Bank Information</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Wire_Transfer_Bank_Information&amp;diff=23696"/>
		<updated>2015-06-03T16:15:27Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Wire transfers are only accepted for orders over $200 (excluding shipping charges)===&lt;br /&gt;
&lt;br /&gt;
Please e-mail accounting@phidgets.com when a wire transfer has been sent; let us know the amount of the transfer and which invoice(s) you are paying.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Any fees charged by the sending bank are your responsibility. Please make sure that the amount sent to us covers the invoice(s) total amount due.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you have any questions call us at 403.282.7335, send us a fax at 403.282.7332, or e-mail us at accounting@phidgets.com.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Wire Transfer Bank Information USD|USD Bank Information]]&lt;br /&gt;
&lt;br /&gt;
[[Wire Transfer Bank Information CAD|CAD Bank Information]]&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Wire_Transfer_Bank_Information_CAD&amp;diff=23695</id>
		<title>Wire Transfer Bank Information CAD</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Wire_Transfer_Bank_Information_CAD&amp;diff=23695"/>
		<updated>2015-06-03T16:11:22Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Wire transfers are only accepted for orders over $200 (excluding shipping charges)===&lt;br /&gt;
&lt;br /&gt;
Please e-mail accounting@phidgets.com when a wire transfer has been sent; let us know the amount of the transfer and which invoice(s) you are paying.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Any fees charged by the sending bank are your responsibility. Please make sure that the amount sent to us covers the invoice(s) total amount due.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you have any questions call us at 403.282.7335, send us a fax at 403.282.7332, or e-mail us at accounting@phidgets.com.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the information that you must provide your bank to transfer &#039;&#039;&#039;Canadian funds&#039;&#039;&#039; to our CAD bank account.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#d1d1d1;&amp;quot; colspan=2|[[File:cdn_flag.gif|link=]] &#039;&#039;&#039;Transfers in CANADIAN CURRENCY&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Swift Code:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| HKBCCATT&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Bank Name:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| HSBC Bank Canada&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Branch Address&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| 347 58 Ave SE, Calgary, Alberta T2H 0P3&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Branch Transit:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| 10019&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Institution:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| 016&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Beneficiary Account Number:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| 057377-001&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Beneficiary Name:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Phidgets Inc.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Beneficiary Address:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Unit #1 6115 4th St. S.E. &amp;lt;br /&amp;gt;Calgary, AB, Canada T2H2H9&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Bank Phone:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| 1.403.517.3063&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If your bank requires our &amp;quot;14-digit account number&amp;quot; use: 10019057377001&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Wire_Transfer_Bank_Information_CAD&amp;diff=23694</id>
		<title>Wire Transfer Bank Information CAD</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Wire_Transfer_Bank_Information_CAD&amp;diff=23694"/>
		<updated>2015-06-03T16:11:04Z</updated>

		<summary type="html">&lt;p&gt;Patrick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Wire transfers are only accepted for orders over $200 (excluding shipping charges)===&lt;br /&gt;
&lt;br /&gt;
Please e-mail accounting@phidgets.com when a wire transfer has been sent; let us know the amount of the transfer and which invoice(s) you are paying.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Any fees charged by the sending bank are your responsibility. Please make sure that the amount sent to us covers the invoice(s) total amount due.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you have any questions call us at 403.282.7335, send us a fax at 403.282.7332, or e-mail us at accounting@phidgets.com.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the information that you must provide your bank to transfer &#039;&#039;&#039;Canadian funds&#039;&#039;&#039; to our CAD bank account.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#d1d1d1;&amp;quot; colspan=2|[[File:cdn_flag.gif|link=]] &#039;&#039;&#039;Transfers in CANADIAN CURRENCY&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Swift Code:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| HKBCCATT&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Bank Name:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| HSBC Bank Canada&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Branch Address&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| 347 58 Ave SE, Calgary, Alberta T2H 0P3&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Branch Transit:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| 10019&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Institution:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| 016&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Beneficiary Account Number:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| 057377-001&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Beneficiary Name:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Phidgets Inc.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Beneficiary Address:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Unit #1 6115 4th St. S.E. &amp;lt;br /&amp;gt;Calgary, AB, Canada T2H2H9&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Bank Phone:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| 1.403.517.3063&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you bank requires our &amp;quot;14-digit account number&amp;quot; use: 10019057377001&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Wire_Transfer_Bank_Information_CAD&amp;diff=23693</id>
		<title>Wire Transfer Bank Information CAD</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Wire_Transfer_Bank_Information_CAD&amp;diff=23693"/>
		<updated>2015-06-03T16:10:46Z</updated>

		<summary type="html">&lt;p&gt;Patrick: Created page with &amp;quot;===Wire transfers are only accepted for orders over $200 (excluding shipping charges)===  Please e-mail accounting@phidgets.com when a wire transfer has been sent; let us know...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Wire transfers are only accepted for orders over $200 (excluding shipping charges)===&lt;br /&gt;
&lt;br /&gt;
Please e-mail accounting@phidgets.com when a wire transfer has been sent; let us know the amount of the transfer and which invoice(s) you are paying.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Any fees charged by the sending bank are your responsibility. Please make sure that the amount sent to us covers the invoice(s) total amount due.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you have any questions call us at 403.282.7335, send us a fax at 403.282.7332, or e-mail us at accounting@phidgets.com.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the information that you must provide your bank to transfer &#039;&#039;&#039;Canadian funds&#039;&#039;&#039; to our CAD bank account.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#d1d1d1;&amp;quot; colspan=2|[[File:cdn_flag.gif|link=]] &#039;&#039;&#039;Transfers in CANADIAN CURRENCY&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Swift Code:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| HKBCCATT&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Bank Name:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| HSBC Bank Canada&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Branch Address&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| 347 58 Ave SE, Calgary, Alberta T2H 0P3&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Branch Transit:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| 10019&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Institution:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| 016&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Beneficiary Account Number:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| 057377-001&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Beneficiary Name:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Phidgets Inc.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Beneficiary Address:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Unit #1 6115 4th St. S.E. &amp;lt;br /&amp;gt;Calgary, AB, Canada T2H2H9&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Bank Phone:&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| 1.403.517.3063&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you bank requires our &amp;quot;14-digit account number&amp;quot; use: 10019057377001&lt;/div&gt;</summary>
		<author><name>Patrick</name></author>
	</entry>
</feed>