cp2004 / OctoPrint-WLED

What could be better than using OctoPrint or WLED? A plugin to use both!
https://plugins.octoprint.org/plugins/wled
GNU Affero General Public License v3.0
61 stars 8 forks source link

UDP connection to a WLED instance [Feature Request] #1

Closed m00x-pixel closed 3 years ago

m00x-pixel commented 4 years ago

Maybe it can be possible to work with the WLED API from Aircookie via UDP wireless connection. (ESP8266/ESP32 with connected LEDs)

So you can can have an small printer status light within the living room and see the state without going to the printer in the other room.

cp2004 commented 4 years ago

Interesting idea... I kind of feel like it would get too complicated to integrate this with this plugin, and would be more suitable for it's own plugin. Shouldn't be too hard for me to replace the effect runner class in this plugin to a different one that sends HTTP requests.

I had never heard of Aircookie's WLED before, looks nice. I haven't got time now, but will investigate.

cp2004 commented 4 years ago

Just seen I can pick up an ESP8266 board for £4.99 👀

m00x-pixel commented 4 years ago

It would be nice if it will be possible. Thanks to look into.

Yes, the ESP8266 are really cheap. I using already many of them with lights and backlight for TV using UDP and hyperion server

saikek commented 4 years ago

It also would be possible to send data via MQTT. Then Tasmota devieces can also work.

Prutsium commented 4 years ago

Just wanted to create the same request. The advantage to be able to use WLED is that the LED and printer could be seperate from each other as there would be a wireless connection.

In my case i would use Nanoleaf (clone running WLED) thats in my living room.

cp2004 commented 4 years ago

You'll all be pleased to know I've started research into developing this plugin. 🙂 It'll take a while, but I have some ideas of how to go about it. Will ping you here when I have a beta kind of version to get some feedback, it'll be a new plugin.

saikek commented 4 years ago

Check this guys: https://github.com/Aircoookie/WLED

Probably something can be used as an example. https://github.com/Aircoookie/WLED/blob/f66c28a1bca36ced44666621e0b4f2b3fcc7a8fa/wled00/mqtt.cpp

ejdprops commented 4 years ago

Feel free to reach out to me. I managed to quickly link my Octoprint to my WLED using events in the Octoprint config file and sending an http request to my WLED based on Octoprint requests. It was super easy and I’m a total noob when it comes to Octoprint and RPi. All it took was connecting these two processes:

https://tynick.com/blog/01-28-2020/controlling-wled-with-raspberry-pi-using-the-wled-api/ https://docs.octoprint.org/en/master/events/index.html

I’m at work and can’t connect to my Octoprint Pi at the moment, or I’d include the actual code I put in my config.yaml as well.

This seems much easier to me than fiddling with UDP connections or complicated MQTT calls (both of which I know absolutely nothing about). Since my Octoprint instance and WLED are both local on my network and mDNS is working on my router for both, I didn’t even need to use the IP address for the WLED instance and could just use the .local reference.

cp2004 commented 4 years ago

That's pretty much what I'm going to try and do, making this plugin but integrated nicely. Don't see much point in using UDP or MQTT, was just going to hit the http API connected to some events with a nice settings page.

I looked into using the home assistant WLED library and was in contact with its author, but it might be a little difficult to 'just do' since it is written to be async. Working on it between large releases on my other plugins so it might take a while.

cp2004 commented 3 years ago

I set myself a goal of creating this plugin in 2020, and with just hours to go I am going to consider my goal met 😄

I've just pushed my latest work. The current features of this plugin are event-reactive setting of WLED effects. It fully supports per-segment control, so you should be able to create some cool things. So, it is technically 'fully working'!

The UI takes a little getting used to, but I hope that with a few minor improvements & bug fixes it can become more streamlined. There's a couple of different states that need more work, and some better error messages (they're handled in the backend, just silently). I also want to implement discovery of WLED devices before it goes out to the plugin repository.

At this point, I still don't recommend installing it, since it is under rapid development and I might end up breaking everything before putting it back together again later.

Just thought I'd provide a small update, so that you know this request has not been forgotten about and is in fact under very active work!

m00x-pixel commented 3 years ago

Thank for the update. It sounds really good.

cp2004 commented 3 years ago

Current target for release on the repository: 11th March. Aiming for earlier than that, but that is the absolute goal. It will be done by then. If I write it down, then I can't let it slide... hopefully

cp2004 commented 3 years ago

The plugin is on it's way to the plugin repository 🚀

cp2004 commented 3 years ago

Thanks for the patience here, it took a little longer than I expected due to other plugins and work elsewhere, but I made it 🙂

Now just to prepare for a wave of users... Enjoy the plugin 🥳