Code Monkey home page Code Monkey logo

treelight's Introduction

TreeLight

Build Status

Don't loose any time connecting your ESP8266 to MQTT. Just include this lib and with minimal extra code, your device is up and running. It comes with a handy webpage too so you can have a quick look at the status of your device.

Installing & usage

I seriously recommend using Platformio. Check out https://platformio.org/.

You'll have to add -DTEMPLATE_PLACEHOLDER=\'~\' to the build flags for proper working of this lib.

A full platformio.ini could look like this:

[env:esp8266]
platform = espressif8266
board = d1_mini
framework = arduino
lib_deps =
  5495
  ESP Async WebServer
  ArduinoJson
  AsyncMqttClient
  https://github.com/bertmelis/TreeLight.git
build_flags =
  -Wl,-Tesp8266.flash.4m1m.ld
  -DTEMPLATE_PLACEHOLDER=\'~\'
monitor_speed = 74880

-DTEMPLATE_PLACEHOLDER=\'~\' is important as it changes the default '%' in EspAsyncWebserver as this interferes with CSS in the webpage.

Also, see the example for further guidance. If you still can't figure out how to use, please create an issue.

Disclaimer

I created this library for my own personal needs. As the MIT license states, it comes with no warranty or fit for purpose. If it doesn't fit your use case, feel free to fork/copy/adapt/change... I do like to have some credit and maybe you can share your improvements?

This library is still in developement. Next on the to do list are:

  • ESP32 support --> didn't test, but compiles!
  • enable settable values from webpage
  • enable settable values from MQTT
  • enable changing WiFi and MQTT parameters

treelight's People

Contributors

bertmelis avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mlaber membero wuifi

treelight's Issues

Wrong Lib?

when compiling simple examples from this repro like blinker.ino, I always get this error message:

C:\Users\WG.W2K\Documents\Arduino\libraries\TreeLight-baseTopic\src\TreeLight.cpp: In member function 'void TreeLightClass::_printBuffer()':

C:\Users\WG.W2K\Documents\Arduino\libraries\TreeLight-baseTopic\src\TreeLight.cpp:341:32: error: no matching function for call to 'TreeLightClass::clearQueue(std::queue<unsigned char>&)'

       clearQueue(_messageBuffer);

                                ^

C:\Users\WG.W2K\Documents\Arduino\libraries\TreeLight-baseTopic\src\TreeLight.cpp:341:32: note: candidate is:

In file included from C:\Users\WG.W2K\Documents\Arduino\libraries\async-mqtt-client-master\src/AsyncMqttClient.h:4:0,

                 from C:\Users\WG.W2K\Documents\Arduino\libraries\TreeLight-baseTopic\src\TreeLight.h:56,

                 from C:\Users\WG.W2K\Documents\Arduino\libraries\TreeLight-baseTopic\src\TreeLight.cpp:26:

C:\Users\WG.W2K\Documents\Arduino\libraries\async-mqtt-client-master\src/AsyncMqttClient.hpp:84:8: note: bool AsyncMqttClient::clearQueue()

   bool clearQueue();  // Not MQTT compliant!

        ^

C:\Users\WG.W2K\Documents\Arduino\libraries\async-mqtt-client-master\src/AsyncMqttClient.hpp:84:8: note:   candidate expects 0 arguments, 1 provided

exit status 1

Fehler beim Kompilieren für das Board LOLIN(WEMOS) D1 R2 & mini.

I tried several different libs. The most important one seems to be the 'AsyncMqttClient' from Marvin Roger. But I have always the same error. Is there anybody who could give me a hint how to go further? Without a working Treelight I cannot compile the esp8266-heating-sketch.

Can't receive any MQTT messages

Hi Bert,
thanks for the great work with Vitowifi and TreeLight. I've been trying for a few day now to get TreeLight to work, but I don't seem to be able to receive any MQTT messages, not even with the examples.
The blinker example seems to publish "blinker/led" and I am able to receive the state in Openhab.
But sending to "blinker/led" or "blinker/led/set" does not work somehow.

Any ideas?

Thanks in advance for your help.

Cheers,
Thomas

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.