-
Notifications
You must be signed in to change notification settings - Fork 218
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
A new multi command protocol #36
Comments
Obviously there's nothing hyper optimized, but you can: (1) Chain multiple settings or commands in a single HTTP request. I tried to make the API truly RESTful. So you can do, for example:
(2) There's also an undocumented feature of the v6 UDP protocol that @Lstt2005 found/requested. Basically you can set multiple things in the same packet:
This is basically capable of setting any valid combination of settings in a single UDP packet. I implemented it in the udp_presets branch. Hoping for @Lstt2005 to test it out, but I'll merge that and the LT8900 stuff into a version branch soon. Both of these options are a little more bloated than something that was hyper-optimized for latency and performance, but they seem to work pretty well. |
Do you feel like either of these options accomplish what you want? |
Still the optimization should be sending commands for multiple groups/bulbtype in one frame. |
Staying within the same bulbtype different deviceIDs can be turned on off in almost complete sync. and if I'm aware of that you can combine up to deviceIDs in each bulb, that could be a solution also, but then these must be linked and handled in the right order by the upper software layer... in my case a C# service. |
Ah, yeah. I can imagine it being important to support multiple groups or bulb types in some circumstances. You can't do that with the REST API (although you could use 0 for lol, no. I don't think documentation for this protocol exists. I was just looking at the raw packets coming in. I think this probably has the same limitation, though. Only supports a single group (or all groups) for a single bulb type. I think if we wanted to do this, I'd prefer to adapt the REST API. While I love the idea of a protocol that's more performant, I think I'd prefer to not support a fourth protocol (HTTP, v5 UDP, v6 UDP being the other three). Do you feel like that'd work? Could maybe do something like
This seems pretty sane to me, actually. Could potentially even do the same thing for all of the other URL parameters, but that starts to feel a little dicey. |
I should say that nominal documentation for the UDP protocols can be found here, but it's really sparse and even erroneous in some places. |
The rest way seems ok, but if it could be extended to support multiple deviceIDs, together with different groups, then we are getting closer. |
Yeah there's nothing preventing the same pattern from getting used for the other URL tokens. For example: esp/gateways/0x0000,0x0001/rgb_cct,rgb/0,1 It does start to feel a little janky at this point, but I'm not sure other protocols would feel better. You're right, though, it would feel weird to support multiple groups without supporting multiple device IDs. |
esp/gateways/0x0000,0x0001/rgb_cct,rgb/0,1 |
Cool. This is a good idea. Thanks! :) |
This project/tool/gateway just gets better and better...... excellent |
Can any chance make support (maiby in library?) for support miltiple gateways in MiLIght app V3 (in tabs of gateways) works with one ESP - maybe on other UPD ports? Very cool and comfortable application for bulbs and LED strips.. |
@WoodsterDK -- woohoo, that's the right direction! :D @Lstt2005 -- this probably warrants a separate ticket. :) I did make an attempt at figuring out how to do that, but I don't think it's possible. |
:)
:(((( |
Took a stab at this in the multi_protocol branch. This format should work:
It's not as performant as I'd hoped, but I think that's just because the NRF is slow. Maybe you'll have more luck with the LT8900. :) |
Interesting, will have a chance to test it tomorrow. |
It does not seem to work... tried: |
Regarding performance..... is it the http part, or the decoding of the parameters that is slow do you think? |
Ahh. In doubt if I chose the right branch. |
Yeah, it's still living in the The HTTP part is actually quite performant considering it involves opening a TCP connection and all that jazz. The part that feels sluggish, I think, is sending the RF packets to a bunch of different devices. re: MQTT, I'm not opposed if it provides value, but I've had a hard time understanding why MQTT (async by design) is a good fit for something that controls your lights (which feels like it should be synchronous). |
Perhaps skipping the nRF will boost performance feel. |
Skipping the nRF meaning using an LT8900 instead? I hope so, but I still don't have one to test out. :) |
Still cannot get it to work - tried with latest v1.2.0. |
Do you see errors? Could you maybe compile with I've tested this pretty extensively with multiple bulb types, groups, IDs, etc., and have had no issues. |
Got it working... the hub got a different IP for the first time in ages.... so right IP and it works... doh. The solution as is works, and it is only a look wise problem. |
I'm quite sure most of the time spent in each request is spent sending the RF packets and/or switching RF configs. I added some timing printfs to verify this. Testing multiple commands out of band from the HTTP parsing stuff is a good way to verify this, though. I'll try that within the next few days. |
The project as it is already supports the existing protocols, and therefor also the different software that uses them, but what about making a high performance WIFI command protocol, that supports multiple actions in one frame.
This will remove some WIFI overhead.
This can be done using different methods:
The text was updated successfully, but these errors were encountered: