OS - Phidget SBC: Difference between revisions

From Phidgets Support
No edit summary
Line 3: Line 3:
__TOC__
__TOC__


[[Category:OS]]
[[File:icon-Linux.png|64x64px|link=OS - Linux]] On the Single Board Computer (SBC), Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].
__TOC__


==Getting Started (Libraries and Drivers)==
==Getting Started (Libraries and Drivers)==

Revision as of 17:29, 23 February 2012

Icon-Linux.pngOn 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.


Getting Started (Libraries and Drivers)

The 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.

To learn the basics about the SBC, we have a handy web interface to interact with the

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 is quite complicated as the SBC does not have a keyboard or screen. So usually, you will want to develop your code on 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:

Getting Started - SBC Debian Linux

Getting Started - External Development Computer=

The simplest way to transfer files to and from the SBC is via a program called ssh. The ssh program provides command line access over a network into the SBC, so you can run programs and give the SBC commands. For Linux users, this will be familiar territory. If you are using Windows or Mac OS, and are unfamiliar with ssh


Linux

To set up the SBC with Linux, you will need an Ethernet (i.e. wired) DHCP internet connection. If you intend to use the SBC wirelessly, you only need this wired Ethernet connection once, to set up the wireless connection.

You may have one of these at home, where you can plug the SBC right into the router. Alternatively, you might have this type of connection via the wall Ethernet at work, or at a University.

As another option, you can use a switch and plug your computer and the SBC into the switch, and enable the wired connection.

ifconfig


Troubleshooting

If the examples do not work but USB does work (i.e. your computer can consistently see the device in the hardware), take a moment to check the basics:

  • No other programs, drivers, or processes are using that USB port in software
  • You are running the example program as root (or your udev rules have been set properly)
  • You are using libusb 0.1 (not 1.0 or later)
  • You have compiled versions of libphidget21.a and libphidget21.so in your system library location (usually /usr/lib)
  • The Phidget libraries are the latest version (visit the getting started section to download them)
  • Your Linux kernel version is 2.6 or later (type uname -r in a terminal to get your kernel version)
  • Check the common problems section below, some specific combinations can cause problems

If your problem doesn't seem to be fixed by these steps, make sure that the Phidget is seen consistently by USB (if it is erratic, try our general troubleshooting guide). If you are still having problems after the troubleshooting guide, please ask us!

Programming Languages

Now that you have the basic libraries installed, you can pick your language and begin programming!

If you are not using the 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.

On Linux, we recommend the following languages:

Webservice

Advanced Uses

Setting udev Rules

Common Problems and Solutions

Low Speed Phidgets (Max of 8): Linux will only schedule one low-speed interrupt transfer per millisecond.

You can find out the type of your Phidget by attaching it and then running dmesg | tail, which will display the type of Phidget from your kernel logs, as described above in the 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.