Giter Site home page Giter Site logo

duronflo / nad-rs232-rest Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rbott/nad-rs232-rest

0.0 1.0 0.0 22 KB

Connects to a NAD Electronics Amp via RS232 and implements a simple RESTful API + mqtt pub/sub

License: GNU General Public License v3.0

Python 100.00%

nad-rs232-rest's Introduction

NAD-RS232-REST

This is a small python script which does the following:

  • connect via RS232 to a NAD Electronics Amplifier (tested with a C-368 model)
  • connect to a MQTT broker and publish all messages from the device
  • subscribe to a given topic and forward all messages as commands to the device
  • implement a simple REST-API to query/configure the C-368 device

Dependencies

This has been tested on the following setup:

  • Raspberry Pi 3, running Debian Jessie
  • Python 2.7 and python-pip from official packages
  • the following installed via pip: paho-mqtt, pyserial, flask
  • a PL2303-type USB2Serial Adapter

Known Limitations

The current state of this program is 'proof-of-concept', therefore it lacks many import aspects:

  • proper error handling
  • configuration via arguments/config file
  • clean code :-)
  • you can not disable mqtt
  • no virtualenv

REST API Examples

Query the current power state:

curl http://example.host:3333/nad/c368/v1.0/Main/Power
{
  "command": "main.power", 
  "error": 0, 
  "value": "on"
}

Set the current power:

curl -X PUT http://example.host:3333/nad/c368/v1.0/Main/Power/on
{
  "command": "main.power", 
  "error": 0, 
  "value": "on"
}

Overview of commands for NAD C328

Übersicht von RS232 Befehlen für den NAD C328Permalink

  • Ein- und Ausschalten: Main.Power=ON|OFF
  • Quelle eines vor/zurück schalten: Main.Source+|-
  • Direkte Quelle anwählen: Main.Source=STREAM|OPT1|OPT2|BT|TV
  • Lautstärke um im ein Inkrement erhöhen/verringern: Main.Volume+|-
  • Direkte Lautstärke einstellen: Main.Volume=-20

nad-rs232-rest's People

Contributors

rbott avatar duronflo avatar

Watchers

James Cloos 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.