Giter Club home page Giter Club logo

usb-relay-module's Introduction

Intro

Cross-platform project for controlling USB relay modules based on HID technology.

CI Status

CI

Ubuntu | Windows

How to get project source code

Clone main project:

git clone https://github.com/nkh-lab/usb-relay-module.git

Clone submodule projects:

git submodule update --init

How to build

The following describes how to build and use CLI applications: getrelay and setrelay.

If you also want to use GUI application - relaybox, follow the GUI Application guide.

Linux

Install depedencies, e.g. for Ubuntu:

sudo apt-get install libudev-dev

Build:

mkdir build && cd build
cmake ..
make

Windows

The following describes how to build the project from the command line for the compiler from Visual Studio.

Add msbuild to PATH environment variable if it's unset:

set PATH=%PATH%;<path to msbuild>

Build:

mkdir build && cd build
cmake -G "Visual Studio 17 2022" ..
cmake --build . --config Release

Portable

To be able to use the output binaries outside of the project, use the appropriate scripts from the tools folder to build the portable package (build/portable and its archive build/usbrelaymodule-portable.tar.gz), for example for Ubuntu:

./tools/build-portable-linux.sh

How to use getrelay and setrelay

These are CLI applications, use --help command to see usage description.

Usage examples

Example: Get information about detected module

./getrelay
path:             /dev/hidraw6
vendor_id:        0x16c0
product_id:       0x05df
serial_number:
release_number:   256
manufacturer:     www.dcttech.com
product:          USBRelay2
interface_number: 0
module_name:      R3
channel_1:        0
channel_2:        0

Example: Set first channel to 1 (ON) then to 0 (OFF) of module R3

./setrelay R3_1=1
...
./setrelay R3_1=0

Example: Rename module R3 to Mod4

./setrelay R3=Mod4

Troubleshooting and other documentation

Troubleshooting documentation is available at:

And here is the contents page of all available documentation:

usb-relay-module's People

Contributors

nkh-lab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

rufusvs

usb-relay-module'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.