Git Product home page Git Product logo

denon's Introduction

Denon AVR control for ESP32 over Telnet and RS232

A fully asynchron Denon AVR control library over Telnet or UART for ESP32 in Arduino IDE

Dependecies

Usage

This library makes use of the AsyncTCP library and or the HardwareSerial Library and is thereby fully async. There is no need to call any repeated function in the Loop. Received messages are called in callback functions. If you only want to send Commands to an AVR no callback function has to be used.

There is a Table in the "commands.h" file that has the basic Commands.

##Initializing the class is without any constructors. Example:

DENON_AVR X3700H;

##The begin functions (usually called in setup()) are:

  bool begin(IPAddress _ip); -> comunication over Telnet with knon IP Adress
  bool begin(); -> communication over Telnet with unknown IP Adess (DNS lookup)
  bool begin(HardwareSerial *serialPort); -> communication over UART

Example for use of Telnet with known IP:

X3700H.begin(avrIP);

##The callback functions are:

  void onConnect(ConnHandler callbackFunc); // Telnet only
  void onDisconnect(DisconnHandler callbackFunc); // Telnet only
  void onDenonResponse(ResponseHandler callbackFunc); // Telnet & UART
  void onError(ErrorHandler callbackFunc); // Telnet & UART

Example for Message callback:

X3700H.onDenonResponse(denonResponseCallbackFunction);

##Functions to send a command to the AVR:

  bool set(const char* _command, const char *_value);
  bool set(const char* _command, int i);
  String get(const char* _command);

Example to send a command for Main zone Power on:

  X3700H.set(MAIN_ZONE, ON);
//Example to send command for increasing Volume:
  X3700H.set(MAIN_VOLUME, UP);

Volume Control

As the Volume control is kind of strange, I wrote a DenonVolume Library to help ease of changing Volume: To change the Volume now all you have to do is:

  X3700H.Volume++; //Volume goes up by 0.5
  X3700H.Volume--; //Volume goes down by 0.5
  X3700H.Volume+1; //increase Volume by 1
  X3700H.Volume = 10.5 // set Volume to 10.5

The Volume received (either feedback for the new Volume that was sent to AVR or other Volume change coming from AVR) is automatically stored properly, so nothing to do there as well.

it is supposed to be very intuitive and again relyes on Callbacks only, so nothing else has to be done and the commands are send to the AVR

Newest feature: DenonProperties

  • add properties like Power, Input...
  • declare custom callbacks for these properties
  • received values are stored
  • !! properties have to be created after there is a DENON_AVR object!
  •  DenonProperties *SamplingRate = new DenonProperties(FS);
     void SamplingRateChanged(int i){}
    // in setup:
      SamplingRate->onStateUpdate(SamplingRateChanged);
    // anywhere else:
      SamplingRate->get(INTEGER));
      SamplingRate->set("441"); // of course, this is just an example..
    
To see a full example have a look at the example.ino file

#LICENCE
This is published under GNU Lesser Public Lincence

denon's People

Contributors

janphoffmann avatar snapplecap84 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.