Giter VIP home page Giter VIP logo

zigbee4java's Introduction

ZigBee API for Java

ZigBee API for Java is a fork of ZB4OSGI for usage without OSGI. Changes include removal of OSGI related dependencies and refactored API.

ZB4OSGI: http://zb4osgi.aaloa.org/

Questions can be sent to the following email address: '[email protected]'.

You can also contact me directly: '[email protected]'.

Discussion Group

The URL to the discussion group: https://groups.google.com/d/forum/zigbee4java

FAQ

The URL to the FAQ: https://groups.google.com/d/forum/zigbee4java

Hardware

This library provides API to ZigBee network through CC2531 dongle.

Example hardware that can be controlled with zigbee4java:

  1. Philips Hue Bulb

Prerequisites

  1. Java 7
  2. Maven 3 and/or Gradle
  3. CC2531 dongle with USB serial / coordinator firmware. Flashing new firmware requires CCDEBUGGER hardware component.
  4. Second CC2531 dongle if you want to have cheap packet sniffer. There are probably better packet sniffers out there.

Buying Hardware

You need to buy the following items:

  1. http://www.ti.com/tool/cc2531emk (NOTE: Buy two if you want to use another as packet sniffer.)
  2. http://www.ti.com/tool/cc-debugger

Flashing Dongle

  1. Download and install Z-STACK-HOME from http://www.ti.com/tool/z-stack
  2. View CCDEBUGGER user guide: http://www.ti.com/lit/ug/swru197h/swru197h.pdf
  3. Flash CC2531ZNP-Pro-Secure_Standard.hex with Smart RF Studio included in Z-STACK-HOME.

Maven Repository

Serial-comm and zigbee4java dependencies can be found from the following repository for convenience.

<repositories>
    <repository>
        <id>bubblecloud-cloudbees-release</id>
        <url>http://repository-bubblecloud.forge.cloudbees.com/release/</url>
    </repository>
</repositories>

Using as a Dependency

Maven:

<dependencies>
    <dependency>
        <groupId>org.bubblecloud.zigbee4java</groupId>
        <artifactId>zigbee-api</artifactId>
        <version>2.0.2</version>
    </dependency>

    <dependency>
        <groupId>org.bubblecloud.zigbee4java</groupId>
        <artifactId>zigbee-serial-javase</artifactId>
        <version>2.0.2</version>
    </dependency>
</dependencies>

Gradle:

dependencies
{
    compile 'org.bubblecloud.zigbee:zigbee-api:2.0.2'
    compile 'org.bubblecloud.zigbee:zigbee-serial-javase:2.0.2'
}

Building from Sources

Maven:

git clone https://github.com/tlaukkan/zigbee4java.git zigbee4java
cd zigbee4java
mvn clean install

Gradle:

git clone https://github.com/tlaukkan/zigbee4java.git zigbee4java
cd zigbee4java
gradlew clean build

Usage

ZigBeeSerialPortImpl serialPort = new ZigBeeSerialPortImpl("/dev/ttyACM0", 38400);
ZigBeeConsole console = new ZigBeeConsole(serialPort, 4951, 11, false);
zigbeeApi.startup();

Device lamp = zigbeeApi.getZigBeeApiContext().getDevice("00:17:88:01:00:BE:51:EC/11");

Basic basic = lamp.getCluster(Basic);
String manufactureName = basic.getManufacturerName();

OnOff onOff = lamp.getCluster(OnOff.class);
onOff.on();

int onOffAttributeIndex = 0;
Reporter reporter = onOff.getAttribute(onOffAttributeIndex).getReporter();
reporter.addReportListener(reportListener);

Examples

  1. ZigBeeConsole.java

zigbee4java's People

Contributors

tlaukkan avatar chris-hatton avatar presslab-us avatar cdjackson avatar alcastelo avatar yxrwang avatar

Watchers

James Cloos avatar Paul Lin 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.