27
1072_0_Product_Manual - February 24, 2011 2:52 PM
If your program uses phidget21.jar, you must include it on the Classpath. On the SBC this looks like:
java -cp .:/usr/share/java/phidget21.jar -jar MyProgram.jar
Note:
Some IDEs, such as Eclipse and Netbeans, automatically create jar files when you build your project. Simply
look in your build output folders for your .jar file.
C/C++
First, install ‘libphidget21-dev’ and ‘build-essential’ via ‘apt-get install’, or Install ‘C/C++ Development Tools/Headers’
via the ‘System: Packages’ web interface page.
C programs can be compiled on the PhidgetSBC itself, via the SSH interface, or off-board using a cross compiler. Use
of a cross compiler is not strictly documented here.
If you need to log data from a custom application, you can either log directly to the application directory with the
size limits of the userspace in mind, or to /tmp if the data should be erased on reboot. Alternatively, you can use a
flash drive, which are mounted automatically at /media/usb(0-9) when plugged in.
Other Languages
Other languages, such as Python, Mono, etc. are easy to support by installing the correct packages. These are not
however explicitly supported/documented by Phidgets currently.
Debian/Packages
The PhidgetSBC runs Debian. We have included packages from the Emdebian project where available in order to
reduce space requirements. This is hidden from the end user.
Full access to the Debian package repository is available. In order to enable access to all packages, enable ‘Include
full Debian Package Repository’ on the ‘System: Packages’ page. Editing the Apt sources list files by hand is not
recommended, as these may be overwritten during boot.
For an overview of apt-get and dpkg, see the Debian documentation.
Phidget Dictionary
Communication between a custom application on the PhidgetSBC and the outside world can be facilitated by using
the dictionary interface of the Phidget Webservice. The dictionary lets you set and listen for key/value pairs over
the network, and take action accordingly. This could be used to post data or listen for commands over the network,
while maintaining reliability and ultimate control on the PhidgetSBC itself in case of network failure.
See the Phidget Programming manual for its use in your language of choice.
SSH/SFTP
The built-in SSH Server can be enabled to allow console access to the PhidgetSBC. By default, this server is disabled.
SSH access to the PhidgetSBC is enabled in the Network: Settings configuration page on the PhidgetSBC. Enabling
the server for the first time can take several minutes as the encryption keys are generated.
Once SSH is enabled, connect to the PhidgetSBC using its hostname or IP address (e.g. ‘ssh [email protected]’).
You must login using the ‘root’ account using same password set for the web interface. You may wish to set up a
restricted user account for general use rather then running under the root account full-time.
Files can be sent to the board using scp or by uploading through the web interface in Userspace: Userspace
Browser, or via sftp.
Text files (source code, etc.) can be edited using vi or with the web interface.
On Windows, we recommend Putty for an SSH client. You can get this at http://www.chiark.greenend.org.
uk/~sgtatham/putty/download.html.