-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Remote web server WLED control usermod #3516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remote web server WLED control usermod #3516
Conversation
|
Thank you for your contribution. This seems like a great add-on. Unfortunately I cannot find a reasoning for reinventing the JSON API. Why not just use existing JSON API? Parsing it would be as simple as calling |
You mean just the de-serialization or the whole JSON structure? I did extensive testing to see if there where any memory leaks and had a few (from friends here, also engineers) code reviews. As you can see the code is well documented. Especially the AsyncTCP part and unfortunatelly it doesn't accept https because that's not in the library. We tried compiling several other clients which have https support, but were not successfull. Or do you mean only this part: because from there, our 'own' JSON structure begins, like this: BTW. We drop/free the JSON objects as soon as possible and set the data in a C array. So we save a lot of memory and possible conflicts. The C array is used in the drawOverlay function and in out setEffect function. |
|
I have not yet thoroughly examined the code, I will in time, but on my first glance it is really inefficient by handling a separate set of JSON API (like "segments" you mention). Also using a dynamic JSON document may be inefficient as WLED already has a permanent JSON buffer large enough for handling the largest possible JSON structure. I am proposing to modify your web server code (PHP?) to use existing WLED API and only do |
|
I close this request because I am doing a new request for tbhe v0.0.3 which incorporates the WLED JSON API. |
|
See the new pull request: #3523 |
Hello,
I spent the previous weeks in creating this usermod which I use as a Christmas card :)
I have it compiled on a M5Stack Atom S3 Lite and bought 60 to give to my friends (along with a 60 LED Ring). When my friends receive their 'christmas card' and turn it on... scan a QR code (so they connect to it by Wifi), fill in their WiFi credentials... the WLED is on their WiFi.
Now it requests a URL every (30 seconds) to see which lights of the LED ring needs to be turned ON. My server gives a JSON answer with a number of LEDs. This number is all the people who requested this URL in the past 5 minutes. So you have a 'ring of thought'. You see LED burning for every friend who also has the LED ring on :)
This Usermod is great if you just DROP a WLED device somewhere and you do not have access to it. But the device is able to access internet. You don't have to forward ports.. set up a VPN.. It just pulls it's data every 30 seconds from a URL you give it.
So you local goverment can have their christmass stars in the shopping street all with this usermod :) and they control it remotely without any network hassle...