Coder Social home page Coder Social logo

wwwutz / brickd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tinkerforge/brickd

0.0 2.0 0.0 8.58 MB

Brick Daemon - bridge between USB connection from Bricks/Bricklets and language bindings (socket)

Home Page: http://www.tinkerforge.com/en/doc/Software/Brickd.html

License: GNU General Public License v2.0

C 89.83% Shell 1.52% Python 1.07% C++ 7.58%

brickd's Introduction

Brick Daemon

This repository contains the source code of the Brick Daemon.

Compiling the Source Code

Brick Daemon uses the common Tinkerforge daemonlib:

http://github.com/Tinkerforge/daemonlib

It has to be cloned or symlinked to the src/daemonlib directory before the source code can be compiled.

Also the following libraries are required:

  • libusb-1.0
  • libudev (optional for USB hotplug, Linux only)
  • pm-utils (optional for suspend/resume handling, Linux only)

On Debian based Linux distributions try:

sudo apt-get install build-essential pkg-config libusb-1.0-0-dev libudev-dev pm-utils

On Fedora Linux try:

sudo yum groupinstall "Development Tools"
sudo yum install libusb1-devel libudev-devel pm-utils-devel

For Windows and Mac OS X a suitable pre-compiled libusb binary is part of this repository.

Linux

A Makefile is provided to compile the source code using GCC and install the result:

cd src/brickd
make
sudo make install

Run the following commands to register brickd for autostart on Debian based Linux distribution and start it:

sudo update-rc.d brickd defaults
sudo /etc/init.d/brickd start

Windows

A batch file compile.bat is provided to compile the source code using the Visual Studio (MSVC) or Windows Driver Kit (WDK) compiler. Open a MSVC or WDK command prompt:

cd src\brickd
compile.bat

The brickd.exe binary is created in src\brickd\dist.

There is also a Makefile to compile the source code using MinGW:

cd src\brickd
mingw32-make

The brickd.exe binary is created in src\brickd\dist.

Mac OS X

A Makefile is provided to compile the source code using GCC:

cd src/brickd
make

The brickd binary is created in src/brickd.

Building Packages

Packages can be build for multiple platforms.

Linux, Windows and Mac OS X

The Python script src/brickd/build_pkg.py can build a Debian package for Linux, a NSIS based setup.exe for Windows and a Disk Image for Mac OS X. Run:

python build_pkg.py

On Linux this has to be executed as root and on Windows this has to be executed from a MSVC or WDK command prompt because it invokes the platform specific commands to compile the source code.

The installer/package is created in src/brickd.

OpenWrt

There is also a Makefile to build an OpenWrt package. To include the package into your OpenWrt build simply link or copy the src/build_data/openwrt folder to the package directory of your OpenWrt build tree, select the brickd2 package in the menuconfig and build.

Commandline Options

Common:

  • --help shows help and exits
  • --version shows version number and exits
  • --check-config checks config file for errors
  • --debug sets all log levels to debug
  • --libusb-debug set libusb log level to debug

Windows only:

  • --install registers Brick Daemon as service and starts it
  • --uninstall stops service and unregisters it
  • --console forces start as console application
  • --log-to-file writes log messages to file

USB Hotplug Detection

Brick Daemon can autodetect USB hotplug. Different systems are used for this:

  • libusb's own hotplug callbacks (if available)
  • device notifications on Windows
  • libudev on Linux
  • IOKit notifications on Mac OS X

On Linux brickd will also check for added or removed Bricks if the SIGUSR1 signal is received. This is used on OpenWrt where the hotplug2 daemon is told to tell brickd about USB hotplug this way, instead of using libudev on OpenWrt.

brickd's People

Contributors

batti avatar bjoern-r avatar borg42 avatar iia avatar photron avatar tewdreyer avatar wwwutz avatar

Watchers

 avatar  avatar

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.