-
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
Version with original LT8900(LT8910-8920) module #18
Comments
Nice, I like this! :) |
But i am beginner in С++ and I not able to write this LT8910 version, but i ready to help you :) |
Chris, it's possible, that you can make in foreseeable future library with support LT8910 or no? :) |
I like the idea from a cleanliness perspective, but given that Henryk's PL1167 emulator code works pretty well, and NRF24L01s seem to be more available, I'm not sure there's much practical value. What are the biggest advantages that you see? |
Probably you are right. Simply at the first stage, it was much easier for me, as a beginner, to work and explore data packets, using literally small sketches .. And in practical application, it is possible that it is not needed. |
#include <SPI.h> const char *ssid = ".."; // cannot be longer than 32 characters! const uint8_t PIN_NRF_RST = 4; LT8900 lt(PIN_NRF_CS, PIN_NRF_PKT, PIN_NRF_RST); //Thanks to Henryk and Erantimus for providing details and checksum code. uint8_t recieve_code() {
return bbuf[packetSize]; void setup_wifi() { delay(4); WiFi.begin(ssid, pass); while (WiFi.status() != WL_CONNECTED) { void setup() SPI.begin(); lt.begin(); char sbuf[32]; //verify chip registers.
} void loop()
lt.setSyncWord(0x1809000000007236);
lt.setSyncWordLength(0x11);
// lt.whatsUp(Serial);
} |
That's all code. |
Gotcha. Makes sense. Nice to not need to deal with CRC and bit fiddling. But given that it's all handled in a pretty reliable way (thanks to Henryk), I'm not sure it makes sense to switch, especially since it seems like the NRF24L01 is a more popular xceiver. |
Hi there, |
Interesting. I've not noticed anything funky with the nrf24s. Do you mind sharing what kinds of issues you saw? Yeah, I'd imagine it's possible to construct a different implementation of I ordered some of these things a few days ago, but they probably won't be here for a few weeks. I can play around with it then. Obviously happy to look at a PR before then. |
Yeah, instability and quite slow. |
Aah, interesting. Yeah I'm not doing anything that requires nearly that level of precision or performance. Definitely sounds like it's worth investigating. :) |
I looked at the project, and thought about making a copy of PL1167_nRF24.cpp and make a PL1167_PL8900.cpp leaving the unnecessary functions empty making it compatible with the milightclient.... but it seems the RF24 is well incorporated.... maybe it is better to make a clone of the milightclient, accessing the new module directly, and then differ when init the client module. |
If need, i can be a tester with LT8900 or LT8920..:) |
I feel like
Obviously some things like the reference to an Then it'd just be a matter of passing or constructing a different type of |
I think the AbstractPL1167 can be omitted, and then there must be added to RadioStack also. |
RadioStack is just meant to be pairs of MiLightRadio and MiLightRadioConfig. I think stuff specific to the NRF would be pulled into the NRF-specific implementation of MiLightRadio. The interfaces are messy and bleed into each other because the transport layer wasn't an important abstraction. Obviously we'd want to clean that up before adding a new impl. :) Let me know if I can help out making the code more amenable to this. |
I will try to make a mockup, and then you can come with some inputs afterwards. |
Just an update - I can receive something, but will just tidy up the code... hopefully something within a day or two |
Awesome :) |
There might be added a further pin setup for a hardware reset pin - if set to '0' then it is not used. Furthermore a setup of RF module used: nRF or LT8900 compatible... |
I have reception running, and also transmission, one thing though is I have three RGB_CCT bulbs on the same group, and when sending an on/off - one or two does not respond, but then one is reacting as it should. And then the behaviour shuffles between the bulbs.... it is late here - will look into it the next few days. |
Might be some timing issues caused by the stream and my resend function... can be sortes. |
Awesome! I'm excited to test this out. I noticed yesterday while testing some of the UDP changes that something seems pretty sluggish, and I'm wondering if it's the NRF. Could totally be my rather unoptimized UDP handling too, but one can hope :) |
Have you tried multiple RGB_CCT bulbs in a group with the nRF interface.... do they all respond as they should - I keep getting the same issue, where they shuffle in the behaviour? |
Yeah, I have three different groups of RGB+CCT bulbs I've been using. Two of them have three bulbs, the other has two. They all at least appear to act in unison. It's definitely necessary to send repeat packets. I'm sending 30-50 on each channel the bulbs listen on. This might be excessive, but I've found that it's a good balance of responsiveness and reliability. Bulbs do seem to ignore packets that have the same sequence value as the last packet they saw. I noticed this when replaying packets. I haven't tried sending packets with decreasing sequence numbers. My remotes and wifi box definitely seem to send packets with increasing sequence values. As far as I've been able to tell, official devices are only sending the same packet multiple times per action, and not multiple packets. |
For best result on the other bulbs I've used around 100 transmissions spread across all channels. |
Gotcha, interesting. I suppose it depends a bit on timing and signal strength? What's PlatformIO doing? Hope I didn't break something. :( Right, makes sense that it'd only need to be different. Only meant to suggest that the official devices seem to increment the sequence number by one rather than changing it by some other function. |
PlatformIO is running again with latest v1.1.0 - but still the same. |
Problem solved:) - stupid mistake with an internal value being used instead of the right one - will clean up the code, and try to make a way to switch between the two interfaces. |
Bummer! How tight are the connections with the module? This is sounding a little bit like behavior I saw when connecting an NRF that had shorter headers, and wasn't making good connections with the dupont wires. I soldered a prototype board with some socket headers instead and the same module worked just fine. @WoodsterDK, any insight here? |
#include <SPI.h> extern "C" { LT8900 lt(PIN_NRF_CS, PIN_NRF_PKT, PIN_NRF_RST); { void setup_wifi() { delay(4); void setup() void loop() Result on boot: 0 = 6fe0 Tx_EN=0 |
So sounds like you're saying this sketch works well with your LT89 radio, but it's sluggish in the milight firmware? I still don't have one to test with, so it's hard for me to be helpful debugging until I do. :( |
I see. Yes, this sketch works well ans super fast. But in my case, i have LT8920 (Lt8900 and LT8920 have some difference between initialise registers). *WM: AutoConnect Exception (9): ctx: sys
|
Hmm... how much difference is there in the initialization of the LT8920 and the LT8900? It's sorta sounding like the code is not compatible. Exception 9, I think, is kinda like segfault. It's hard for me to test because I have neither of these devices. I'll test compatibility with the LT8900 when it gets here, but no idea when that'll be :( |
LT8900 showed up today! I didn't realize how tiny they are. @WoodsterDK -- sending works very reliably. Seems like it's as reliable as the NRF. Receiving seems quite a bit flakier, though. It takes multiple seconds (~5) for a packet to show up, and it clogs up the whole thing while listening is running. It seems like if it receives too many packets at once, it'll get killed by WDT. Here's some logs with DEBUG_PRINTF turned on:
@Lstt2005 -- is this consistent with what you see? Does transmit work for you? I'll poke around a bit. |
Yes, I have almost the same situation ... The transfer works, but very rarely ... Maybe some trouble in initialise module? |
Potentially. Can you put your LT8900 code on gist? |
https://gist.github.com/Lstt2005/93d36a9a5dd56193ec239bd0454c275f |
I meant whatever library you're using to control the LT8900. You're including something, it looks like:
|
https://bitbucket.org/robvanderveer/lt8900lib |
I took a stab at improving read reliability in the lt8900_reads branch. Can you give that a try, @Lstt2005? Writes are still working very reliably for me, though. Having a hard time reproducing the flakiness you're seeing. I can try poking at differences in the setup code later. |
Work! Super fast receive, but: 1.Many doubles; When i press Group 1 ON, i sniff: Packet received (9 bytes): Decoded: Decoded: Decoded: Decoded: Decoded: Decoded: Decoded: Decoded: Decoded: Decoded: Decoded: Decoded: Decoded: Decoded: Decoded: Decoded: Decoded: Decoded: Decoded: Decoded: Decoded: |
Cool. Yeah, I expect duplicates. I think sniffing is really only useful to determine the remote ID, and having de-duplicated packets doesn't help with that. Are there reasons I'm not considering for deduping? I didn't make any changes to the transmit code, so if it wasn't working for you before I wouldn't expect it to work now. It's pretty strange that send is not working when receiving is. Are you positive all of the pin configs are consistent with the example you pasted? Are you able to send with the example sketch you pasted above? |
I sniff with my second NRF24:
Virtual command not control LED strip. |
Wait, so you can see the LT8900 sending packets via another ESP, but it's not controlling the strip? In your examples, the LT8900 radio is not sending "all on/off" commands. It's sending "group 1 on/off" commands. Make sure you have "all" selected in the group list. |
Yes.
You are right! But if I have "all" selected in the group list, nothing change:
Raw packet: 6E 35 09 DB 1E F0 C0 DD 22
Raw packet: 00 DB BB 54 66 D0 96 65 23
Raw packet: A1 15 BA E5 D9 B4 5F DB 23
Raw packet: 00 DB BB 54 66 CD 97 65 2D |
Gotcha. And the same thing works with an NRF? |
Just flash another ESP WITH an NRF (with lt8900_reads branch), NRF work and control led strip fine... |
Wacky. And it seems like they're sending the same packets, right? Do you think it's possible it's a range thing? What happens if you move the LT8900 really close to the LED controller? |
Try all things:
In all cases my NRF sniffer see stable packets (from 10 cm on one table with LT8920 to 10 meters). |
Change from 5 to 50 - very very unstable...Maybe my module broken? Can try tomorrow - after tomorrow another LT8920.. |
Yeah, my experience is that it needs to be in the vicinity of 50 for it to be reliable. Maybe try rebooting the ESP after setting it to 50. It should work without a reboot, but doesn't hurt to try. You could also try increasing it even more. Given that you're seeing the commands showing up on your NRF, I sort of doubt it's a problem with the module. :\ |
Nice! :) |
Hi, |
Also, LT8920 works well with D1 mini. |
Chris! Is it possible make version of library with support original LT8910 module support? It's fully describe in https://bitbucket.org/robvanderveer/lt8900lib
IMHO is easer and simple, that use VIRTUAL NRF24...
I use it to decode all packets.
It's cost in Cina on Taobao - ¥ 3.35 ( 约USD 0.49)
This guys also use this module https://authometion.com/shop/it/
Their forum -http://www.authometion.com/forum/viewforum.php?f=2
Their repo - https://github.com/pmoscetta/authometion-milight
The text was updated successfully, but these errors were encountered: