Code Monkey home page Code Monkey logo

Comments (12)

envy avatar envy commented on August 23, 2024 2

So I made it possible for start() to accept a nullptr which disables the webserver part.
I also added a callback_assign function to assign grozp addresses to callbacks. Together with the config_set_type functions that should be enough to configure the library without using the web UI.

You can now achieve a webserver-less and EEPROM-less library by calling knx.start(nullptr) instead of knx.start() and removing knx.load(). Configuration is then done using callback_assign and config_set_type or the default value of config items.

Please test the changes.

from esp-knx-ip.

envy avatar envy commented on August 23, 2024 1

Hi,

Can be modified a little your library so as to be just the KNX-IP Interface without the Webserver?

Yes, I can add this.

Like an option to turn off the webserver and eeprom features, and to set manually the address and callbacks?

Without EEPROM should already be possible, just don't call knx.load().
EEPROM is only accessed there and by the webserver code.
However, there is no function yet for assigning callbacks from code, I will add this.

from esp-knx-ip.

ascillato avatar ascillato commented on August 23, 2024

wow!!! so fast!!! I will test it. Thanks a lot 👍

from esp-knx-ip.

ascillato avatar ascillato commented on August 23, 2024

Hi, works great! 👍

I made small changes for make my program work with it.

Added few functions to the library:

// Physical Address Set and Get:
config_set_physical_addr ( area, line, member );
config_get_physical_addr ();

// The Reverse of GA_to_address ( area, line, member ):
area_from_address ( address_t );
line_from_address ( address_t );
member_from_address ( address_t );

// Address set by area, line, member on GA and Callbacks>
config_set_ga ( id, area, line, member );
callback_assign ( id, area, line, member );

Also, I made a Sonoff_DHT11.ino as example of manual set of address on the code. With some comments on using the Start() function

I'm making a Pull Request with this changes for you to review.

from esp-knx-ip.

ascillato avatar ascillato commented on August 23, 2024

The Start(server) function to use an already running webserver is a very good idea also with root_prefix 👍

An idea:

When Root_Prefix is different than "", a Home or Return Button should show up on the KNX Config Page. What do you think?

from esp-knx-ip.

envy avatar envy commented on August 23, 2024

Sorry, but I'm going to reject all those pull requests.

#23 You added a bunch of addresses specific to your use-case and there is also a DHT sensor added. The example is meant to show the feature-set of the library in a minimal way.
#22 I don't want to move the files into a subfolder. AFAIK it is fine for Arduino libraries to have the files in the root folder
#21 See above.
#20, #19, #18 I added the physical address functions myself, but named them differently (17c390d).
I also extended the address_t union to include ga and pa members making it possible to read out area, line and member easily without extra functions.
Lastly, I want the public API to expect address_t and not have overloads for every function with uint8_t area, uint8_t line, uint8_t member. That's why GA_to_address exists, to make this easier. But now, you can even do

address_t a;
a.ga.area = 1;
a.ga.line = 2;
a.ga.member = 3;

or address_t a = {.ga={line, area, member}} (Yes, you need to switch line and area, or use GA_to_address) (432439a)

from esp-knx-ip.

envy avatar envy commented on August 23, 2024

Regarding the ROOT_PREFIX thing, I'm currently undecided on what I want to do.
There is another issue (#15) that requested runtime specification of the prefix and also a backlink to the root, if a prefix was given.

Currently, I'm more inclined to make it possible to register links that are all shown in the web UI instead of a fixed link back to the root.

We'll see, I've not decided yet.

from esp-knx-ip.

ascillato avatar ascillato commented on August 23, 2024

Hi,

No problem with those PR. I make those pull requests just as ideas to be discussed and as an example of setting addresses by code 👍
I like your approach for the tranformation of GroupAddress to area, line and member. It is more elegant.
I will re make my tests with your modifications.

As the ESP_KNX_IP library is intended to be a library to be included on other proyects, what do you think of:

1- Posibility of adding buttons with links (as you said) and buttons to callbacks?
2- Posibility of turning off the buttons EEPROM SAVE, EEPROM RESTORE and REBOOT?
3- Posibility of changing the webpage title?
4- Posibility of setting the webpage text (so as a language translation be posible by code)
5- Posibility of a custom arrange of all the objects on the webpage. Then, I will post here an example.

If you want, I can help you with the code and with the Wiki.

Thanks a lot.

from esp-knx-ip.

ascillato avatar ascillato commented on August 23, 2024

Made the PR #26 #27 #28 to:

  • Added #ifndef ROOT_PREFIX to have the option to set the Root Prefix before calling the #include <esp-knx-ip.h>, so as to eliminate the need of modifying the library.

  • Changing the name of ntohs to __ntohs to eliminate conflict when using ESP8266 LWIP library.

Made the PR #35, #30 to update Examples to match new routines names as knx.answer_1bit, etc

from esp-knx-ip.

envy avatar envy commented on August 23, 2024

Hi, I created some issues to track some ideas seperately. (#36, #37, #38)

Posibility of adding buttons with links (as you said) and buttons to callbacks?

What do you mean with "buttons to callbacks"? Buttons to issue callbacks from the webui?

Posibility of a custom arrange of all the objects on the webpage. Then, I will post here an example.

How would you specify arrangement of objects? xy-coordinates? Some kind of grid?

from esp-knx-ip.

ascillato avatar ascillato commented on August 23, 2024

What do you mean with "buttons to callbacks"? Buttons to issue callbacks from the webui?

Yes! exactly 👍

How would you specify arrangement of objects? xy-coordinates? Some kind of grid?

Can be in the order you register them on the main application code. Also can be everything centered.
#36

from esp-knx-ip.

ascillato avatar ascillato commented on August 23, 2024

Closing this issue as all the questions I had were answer. Thanks 👍

New topics continue in their specific issues.

from esp-knx-ip.

Related Issues (20)

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.