Skip to content

jldupont/phidgets-amqp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project consists of an AMQP API to Phidgets devices.

Applications

  • "phidgets-amqp-manager" : publishes the messages "Attached", "Detached", "Error" and "Devices"

  • "phidgets-amqp-ifk" : publishes the messages "Din", "Dout", "Ain" and "Error"

  • "phidgets-amqp-sensors" : publishes the message "State" which reflects the current state of an input. This application must be configured through "sensors.config" file located in "~/.phidgets-amqp" directory.

The latter ("phidgets-amqp-ifk") requires "phidgets-amqp-manager" to be running: it subscribes to the "Devices" signal in order to be notified of new "InterfaceKit" devices to service.

AMQP Exchanges

The applications use the following exchanges:

  • "com.phidgets"
  • "org.sensors"

Messages Types

On the "com.phidgets" exchange, there are the following message keys:

  • "devices.devices"
  • "device.state.attached"
  • "device.state.detached"
  • "device.state.error"
  • "device.io.din"
  • "device.io.dout"
  • "device.io.ain"

On the "org.sensors" exchange, there are the following message keys:

  • "state.io.#" (e.g. "state.io.din" , "state.io.dout", "state.io.ain")
  • "config"

Message Format

The format used is JSON.

AMQP Configuration

If the defaults aren't satisfactory, the file "~/.phidgets-amqp/amqp.config" (YAML format) can be customized. It is checked for modification(s) at regular interval and reloaded if need be.

The following parameters are supported:

  • host
  • userid
  • password
  • virtual_host

Example:

## Using YAML "maps"
host:          "localhost:5672"
userid:       "joe"
password:     "blo"
virtual_host: "\"

Sensors configuration

Example "sensors.config" file (YAML syntax):

Devices:

 ## Device unique id i.e. serial
 80860:
  pins:
   -
    type: din
    pin:  3
    name: porte_fournaise
   - 
    type: din
   	pin:  4 
   	name: porte_escalier
   -
    type: din
    pin:  0
    name: porte_garage_1
   -
    type: din
    pin:  1
    name: porte_garage_2

States:
 porte_escalier:
  0: Open
  1: Closed
 porte_garage_1:
  0: Open
  1: Closed
 porte_garage_2:
  0: Open
  1: Closed
 porte_fournaise:
  0: Open
  1: Closed

Installation

There are 2 methods:

  1. Use the Ubuntu Debian repository jldupont with the package "rbsynclastfm"

  2. Use the "Download Source" function of this git repo and use "sudo make install"

Dependencies

  • python-amqplib
  • Phidgets Library (available in the PPA)
  • Python Phidgets Library (available in the PPA)

About

Phidgets applications with interfacing through AMQP messaging bus

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages