GithubHelp home page GithubHelp logo

redcrab2016 / rfxtrx Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 487 KB

RFXCOM devices (RFXtrx device serie) communication (Send / Receive / Config) in Java for Linux (All arch.)

Java 83.24% Shell 0.24% JavaScript 16.53%
domotic rfxcom java rfxcom-device rfxtrx linux raspberry raspberrypi java-environment

rfxtrx's Introduction

RFXCOM for Java


Software License Agreement
Copyright 2011-2016, RFXCOM ALL RIGHTS RESERVED. This code is owned by RFXCOM, and is protected under Netherlands Copyright Laws and Treaties and shall be subject to the
exclusive jurisdiction of the Netherlands Courts. The information from this file may freely be used to create programs to exclusively interface with RFXCOM products only. Any other use or unauthorized reprint of this material is prohibited. No part of this file may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system without express written permission from RFXCOM.

The above copyright notice shall be included in all copies or substantial portions of this Software.

This project is targeted to use RFXCOM device from Java environment

The aim is to be able to use RFXCOM devices (as RFXtrx433E devices in a java environment).

This project is firstly design to be use in Linux Raspberry Pi java context. This Project exist because default RFXCOM public provided tools is targeted for Windows(r) environment.

There is no Java native library dependency, the project invokes standard linux command instead (mkfifo, stty ...) to be able to configure and use the serial port, by this way the program is directly runnable everywhere without any architecture limitation. Therefore the target is "Only Linux alike system, enabled with USB FTDI serial port device, and a Java JVM available"


Install and Run on PI or other Linux machine

Environment

  • Java + Javac: Oracle or OpenJDK 1.8
  • Kernet module for FTDI USB devices (RFXCOM device seen as /dev/ttyUSBx (with x above or equal to 0)
  • User is able to access to /dev/ttyUSBx (e.g user has secondary group on 'dialout')

Get project

Clone this project on a dedicated folder on you Raspberry Pi or Linux Machine In this project all compiled class are already provided in build folder.

Configure

if your device is not /dev/ttyUSB0 then you need to change the file config.properties To enable the listening of particular protocol you've to modify the file config.properties , the key rfxtrx.protocol.enable

Compile project

Execute (this project already provide the compiled classes, compilation is needed only if you change the source code)

./compile.sh

Execute project

Direct mode

./run.sh

Simple daemonized mode

nohup ./run.sh 1>trace.log 2>&1

Use the project

During execution the project has an input and an output

The Input : Send a message over the air

When the project runs, a named pipe pipeMsgSend is created by default at the same location as the config.properties file. To send a message over the air (through RFXCOM device) just print out the command to pipeMsgSend example, to Switch On a Chacon power plug on House 'I' address 1

$> echo "chacon_on('I',1)" > pipeMsgSend

The available commands are defined in extension.js file The base command library is defined in file src/ysm/domo/rfxcom/rfxtrx/protocol/generateMessage.js

The Output : Execute something when a message is received

When a message is recieved for a particular protocol enabled (see key rfxtrx.protocol.enable in config.properties) then the script event.sh is invoked with a set of RFXCOM_* environment variables You may customized the event.sh script with your own purpose or change the keys rfxtrx.protocol.event.* in config.properties file to execute another shell script or executable

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.