Code Monkey home page Code Monkey logo

phidutil2's Introduction

phidutil2

Overview

This tool for phidget device described at [1]. Linux documentation can be found at [2]. API is described at [3] (C, 1014_2-PhidgetInterfaceKit 0/0/4).

Prebuilt packages

You can find prebuilt deb packages for libphidget22 and phidutil2 in prebuilt/ directory (for amd64 architecture).

Building the library

In order to build this tool, you'll need libphidget22 library installed.

  1. Install dependencies:
    $ sudo aptitude install libusb-1.0-0-dev libusb-1.0-0 checkinstall
  1. Download library source code. build and install:
    $ wget https://www.phidgets.com/downloads/phidget22/libraries/linux/libphidget22.tar.gz
    $ tar xzvf libphidget22.tar.gz
    $ rm libphidget22.tar.gz
    $ cd libphidget22-1.0.0.20180827/
    $ ./configure --prefix=/usr
    $ make -j4
    $ sudo checkinstall --install=no
    $ sudo chown -R $USER:$USER *
    $ sudo dpkg -i *.deb

udev rules

In order to be able to run phidutil2 tool without sude, copy udev rules from libphidget22 source code directory and restart udev:

    $ sudo cp plat/linux/udev/99-libphidget22.rules /etc/udev/rules.d/
    $ sudo udevadm control --reload-rules
    $ sudo udevadm trigger

Now reconnect your phidget (disconnect and connect USB cable).

Building the tool

Build and install Debian package:

    $ make debian
    $ sudo dpkg -i ../*.deb

Usage

Run phidutil2 --help or man phidutil2 to see the usage details:

Usage: phidutil2 [-v] [-s serialno] [-p portno] state

Options:
	-v		Verbose output
	-s serialno	Phidget serial number
	-p portno	Relay port number (0-3)
	state		0 (OFF) or 1 (ON)

Testing the tool

Connect your phidget to your PC and run next command to test it:

    $ while true; do phidutil2 0; sleep 0.5; phidutil2 1; sleep 0.5; done

You should hear audible relay #0 clicks. Press Ctrl-C to interrupt it.

Authors

Sam Protsenko

License

This project is licensed under the GPLv2.

References

[1] https://www.phidgets.com/?tier=3&catid=46&pcid=39&prodid=1020

[2] https://www.phidgets.com/docs/OS_-_Linux

[3] https://www.phidgets.com/?view=api

phidutil2's People

Contributors

joe-skb7 avatar

Watchers

 avatar  avatar

phidutil2's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.