Skip to content
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

Closed
itProfi opened this issue Mar 21, 2017 · 102 comments
Closed

Version with original LT8900(LT8910-8920) module #18

itProfi opened this issue Mar 21, 2017 · 102 comments
Milestone

Comments

@itProfi
Copy link

itProfi commented Mar 21, 2017

Chris! Is it possible make version of library with support original LT8910 module support? It's fully describe in https://bitbucket.org/robvanderveer/lt8900lib
21-03-2017 085506
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

@sidoh
Copy link
Owner

sidoh commented Mar 21, 2017

Nice, I like this! :)

@itProfi
Copy link
Author

itProfi commented Mar 21, 2017

Nice, I like this! :)

But i am beginner in С++ and I not able to write this LT8910 version, but i ready to help you :)

@itProfi
Copy link
Author

itProfi commented Mar 24, 2017

Chris, it's possible, that you can make in foreseeable future library with support LT8910 or no? :)

@sidoh
Copy link
Owner

sidoh commented Mar 24, 2017

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?

@itProfi
Copy link
Author

itProfi commented Mar 24, 2017

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.

@itProfi
Copy link
Author

itProfi commented Mar 24, 2017

#include <SPI.h>
#include "LT8900.h"
#include <ESP8266WiFi.h>
#include <PubSubClient.h>

const char *ssid = ".."; // cannot be longer than 32 characters!
const char *pass = "..."; // WiFi password

const uint8_t PIN_NRF_RST = 4;
const uint8_t PIN_NRF_CS = 5;
const uint8_t PIN_NRF_PKT = 10;
uint8_t bufer;

LT8900 lt(PIN_NRF_CS, PIN_NRF_PKT, PIN_NRF_RST);

//Thanks to Henryk and Erantimus for providing details and checksum code.
//Calculate Checksum - Returns 2 bytes.

uint8_t recieve_code()
{
uint8_t bbuf[20];
int packetSize = lt.read(bbuf, 20);
Serial.print ("RAW packetSize =");
Serial.println(packetSize);
if ((packetSize>1)&&(packetSize<20))

{
digitalWrite(LED_BUILTIN, LOW); // Turn the LED off by making the voltage HIGH
delay(2);
digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH

    Serial.println();
   // Serial.println("Packet read OK");
    uint16_t value = lt.getChannel();
    Serial.print ("Current channel = ");
    Serial.println (value);
    Serial.print("Size of packet = ");
    Serial.print(packetSize);
    Serial.println();

    //dump the packet.
   
    for(int i = 0; i < packetSize; i++)
    {
      if (i) Serial.write(':');
      if (bbuf[i] < 16) Serial.write('0');
      Serial.print(bbuf[i],HEX);

    Serial.println();
   // Serial.write(bbuf,packetSize);
  }

return bbuf[packetSize];
//crc=calc_crc(bbuf,packetSize);
}

void setup_wifi() {

delay(4);
// We start by connecting to a WiFi network
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);

WiFi.begin(ssid, pass);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}

void setup()
{
// put your setup code here, to run once:
pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
digitalWrite(LED_BUILTIN, HIGH);
Serial.begin(256000);
Serial.println(F("\n\nLT8900 module sample, v0.1.\n\n"));

SPI.begin();
SPI.setFrequency(1000000);

lt.begin();
lt.setCurrentControl(12,7);

char sbuf[32];

//verify chip registers.
for (int i = 0; i <= 50; i++)
{
uint16_t value = lt.readRegister(i);

sprintf_P(sbuf, PSTR("%d = %04x\r\n"), i, value);
Serial.print(sbuf);

}
Serial.println(F("Reader mode"));
lt.startListening();
lt.whatsUp(Serial);
Serial.println(F("Boot completed."));
setup_wifi();
}

void loop()
{

lt.setSyncWord(0x55AA00000000050A);
lt.setSyncWordLength(0x01);
lt.setChannel(0x27); //39
lt.startListening();
if (lt.available())
{
 bufer=recieve_code();

lt.setSyncWord(0x1809000000007236);
lt.setSyncWordLength(0x11);
lt.setChannel(0x08); //39
lt.startListening();
if (lt.available())
{
bufer=recieve_code();

lt.setSyncWord(0xBCCD000000009AAB);
lt.setSyncWordLength(0x11);
lt.setChannel(0x03); //3
lt.startListening();
if (lt.available())
{
 bufer=recieve_code();
/// uint8_t crc=calc_crc(bbuf,packetSize);
}

lt.setSyncWord(0xBCCD000000009AAB);
lt.setSyncWordLength(0x11);
lt.setChannel(0x26); //3
lt.startListening();
if (lt.available())
{
 bufer=recieve_code();
}

lt.setSyncWord(0xBCCD000000009AAB);

lt.setSyncWordLength(0x11);
lt.setChannel(0x49); //3
lt.startListening();
if (lt.available())
{
bufer=recieve_code();
}

lt.setSyncWord(0x03805A5A03800380);
lt.setSyncWordLength(0x10);
lt.setChannel(0x05); //5
lt.startListening();

// lt.whatsUp(Serial);
if (lt.available())
{
bufer=recieve_code();
lt.whatsUp(Serial);

} 

}

@itProfi
Copy link
Author

itProfi commented Mar 24, 2017

That's all code.

@sidoh
Copy link
Owner

sidoh commented Mar 24, 2017

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.

@WoodsterDK
Copy link
Contributor

Hi there,
super work decoding the protocol.
I also use the different transciever, and have had quite a few problems with the nRF ones.
With some minor tweaks and the addition of two files + a interface selection it should be doable without much hassle.
It will only be the transport layer, all the magic happens in your layer.

@sidoh
Copy link
Owner

sidoh commented Mar 30, 2017

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 MiLightRadio within MiLightClient and it'd work pretty seamlessly.

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.

@WoodsterDK
Copy link
Contributor

Yeah, instability and quite slow.
I had to implement synced fading and control between different groups, and due to all the recalcs of parameters it never looked visually good.
With the other module - once set up for a type with the matching sync word, it is just a matter of sending a frame, and the channel is just a register to set also.

@sidoh
Copy link
Owner

sidoh commented Mar 30, 2017

Aah, interesting. Yeah I'm not doing anything that requires nearly that level of precision or performance.

Definitely sounds like it's worth investigating. :)

@WoodsterDK
Copy link
Contributor

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.

@itProfi
Copy link
Author

itProfi commented Mar 30, 2017

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..:)

@sidoh
Copy link
Owner

sidoh commented Mar 30, 2017

I feel like MiLightRadio is the right layer of abstraction here. I guess it seems like exactly the interface for the "transport layer" you referred to above. Without knowing exactly what you'll need to do, the methods in this class seem more or less exactly what you what to swap implementations for:

    int begin();
    bool available();
    int read(uint8_t frame[], size_t &frame_length);
    int dupesReceived();
    int write(uint8_t frame[], size_t frame_length);
    int resend();
    int configure();

Obviously some things like the reference to an AbstractPL1167 would need to be pulled into a separate implementation (something like NrfMiLightRadio, maybe?)

Then it'd just be a matter of passing or constructing a different type of MiLightRadio in MiLightClient.

@WoodsterDK
Copy link
Contributor

I think the AbstractPL1167 can be omitted, and then there must be added to RadioStack also.

@sidoh
Copy link
Owner

sidoh commented Mar 30, 2017

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.

@WoodsterDK
Copy link
Contributor

I will try to make a mockup, and then you can come with some inputs afterwards.

@WoodsterDK
Copy link
Contributor

Just an update - I can receive something, but will just tidy up the code... hopefully something within a day or two

@sidoh
Copy link
Owner

sidoh commented Mar 31, 2017

Awesome :)

@WoodsterDK
Copy link
Contributor

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...

@WoodsterDK
Copy link
Contributor

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.

@WoodsterDK
Copy link
Contributor

Might be some timing issues caused by the stream and my resend function... can be sortes.

@sidoh
Copy link
Owner

sidoh commented Mar 31, 2017

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 :)

@WoodsterDK
Copy link
Contributor

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?
What about the frame that is being sent when powering the remotes, could that be a "MASTER" frame the resets the bulbs sequence number, to make them listen again for a low sequence number? Do they respond, if the number decrement instead of increment?

@sidoh
Copy link
Owner

sidoh commented Apr 1, 2017

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.

@WoodsterDK
Copy link
Contributor

For best result on the other bulbs I've used around 100 transmissions spread across all channels.
I've just switched to the v1.1.0 branch - but now PlatformIO is acting up.... doh.
It might be the sequence number just needs to be different from command to command, to prevent acting many times on the re-transmits.

@sidoh
Copy link
Owner

sidoh commented Apr 1, 2017

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.

@WoodsterDK
Copy link
Contributor

PlatformIO is running again with latest v1.1.0 - but still the same.
I can pair all three bulbs with the gateway, but they actually flashed green out of sync, and if I sync with a real remote, they pair and flash green in sync.... so something is off when transmitting the frames.
Reception works super, but just the problem with transmission.
What can it be......they change pattern on pressing the on toggle switch on the web interface.
But the encrypted frame must be OK, as some of the bulbs react.
Can it be related to the switch between channels..... or.... well. Night time here... .I'm off to bed.

@WoodsterDK
Copy link
Contributor

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.

@sidoh
Copy link
Owner

sidoh commented Apr 7, 2017

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?

@itProfi
Copy link
Author

itProfi commented Apr 7, 2017

photo_2017-04-07_19-47-54
See speed, when i pres randomly on FUT091 with my sketch - https://youtu.be/BVwxUvTkozM

#include <SPI.h>
#include "LT8900.h"
#include <ESP8266WiFi.h>
#include <PubSubClient.h>

extern "C" {
#include "ets_sys.h"
#include "os_type.h"
#include "osapi.h"
///#include "mem.h"
#include "user_interface.h"
#include "cont.h"
}
const char *ssid = ".."; // cannot be longer than 32 characters!
const char pass = ".."; // WiFi password
const char
mqtt_server = "m21.cloudmqtt.com";
const uint8_t PIN_NRF_RST = 0;
const uint8_t PIN_NRF_CS = 15;
const uint8_t PIN_NRF_PKT = 5;
uint8_t bufer;

LT8900 lt(PIN_NRF_CS, PIN_NRF_PKT, PIN_NRF_RST);
uint8_t recieve_code()
{
uint8_t bbuf[32];
int packetSize = lt.read(bbuf, 32);
Serial.print ("RAW packetSize =");
Serial.println(packetSize);
if ((packetSize>1)&&(packetSize<32))

{
digitalWrite(LED_BUILTIN, LOW); // Turn the LED off by making the voltage HIGH
delay(2);
digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH
Serial.println();
uint16_t value = lt.getChannel();
Serial.print ("Current channel = ");
Serial.println (value);
Serial.print("Size of packet = ");
Serial.print(packetSize);
Serial.println();
for(int i = 0; i < packetSize; i++)
{
if (i) Serial.write(':');
if (bbuf[i] < 16) Serial.write('0');
Serial.print(bbuf[i],HEX);
Serial.println();
}
return bbuf[packetSize];
}
}

void setup_wifi() {

delay(4);
// We start by connecting to a WiFi network
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}

void setup()
{
// put your setup code here, to run once:
pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
digitalWrite(LED_BUILTIN, HIGH);
Serial.begin(256000);
Serial.println(F("\n\nLT8900 module sample, v0.1.\n\n"));
SPI.begin();
SPI.setFrequency(1000000);
lt.begin();
lt.setCurrentControl(12,7);
char sbuf[32];
//verify chip registers.
for (int i = 0; i <= 50; i++)
{
uint16_t value = lt.readRegister(i);
sprintf_P(sbuf, PSTR("%d = %04x\r\n"), i, value);
Serial.print(sbuf);
}
Serial.println(F("Reader mode"));
lt.startListening();
lt.whatsUp(Serial);
Serial.println(F("Boot completed."));
setup_wifi();
}

void loop()
{
lt.setSyncWord(0x55AA00000000050A);
lt.setSyncWordLength(0x01);
lt.setChannel(0x27); //39
lt.startListening();
if (lt.available())
{
bufer=recieve_code();
}
lt.setSyncWord(0x1809000000007236);
lt.setSyncWordLength(0x01);
lt.setChannel(0x08); //39
lt.startListening();
if (lt.available())
{
bufer=recieve_code();
}
lt.setSyncWord(0x1809000000007236);
lt.setSyncWordLength(0x10);
lt.setChannel(0x027); //39
lt.startListening();
if (lt.available())
{
bufer=recieve_code();
}
lt.setSyncWord(0x1809000000007236);
lt.setSyncWordLength(0x11);
lt.setChannel(0x46); //39
lt.startListening();
if (lt.available())
{
bufer=recieve_code();
}
lt.setSyncWord(0xBCCD000000009AAB);
lt.setSyncWordLength(0x11);
lt.setChannel(0x03); //3
lt.startListening();
if (lt.available())
{
bufer=recieve_code();
}
lt.setSyncWord(0xBCCD000000009AAB);
lt.setSyncWordLength(0x11);
lt.setChannel(0x26); //3
lt.startListening();
if (lt.available())
{
bufer=recieve_code();
}
lt.setSyncWord(0xBCCD000000009AAB);
lt.setSyncWordLength(0x11);
lt.setChannel(0x49); //3
lt.startListening();
if (lt.available())
{
bufer=recieve_code();
}
lt.setSyncWord(0x03805A5A03800380);
lt.setSyncWordLength(0x10);
lt.setChannel(0x05); //5
lt.startListening();
if (lt.available())
{
bufer=recieve_code();
lt.whatsUp(Serial);
}
}

Result on boot:
LT8900 module sample, v0.1.

0 = 6fe0
1 = 5681
2 = 6617
3 = 3000
4 = 9cc9
5 = 6637
6 = 0000
7 = 0030
8 = 6c90
9 = c380
10 = 7ffd
11 = 0000
12 = 0000
13 = 48bd
14 = ffff
15 = 0000
16 = 0000
17 = 0000
18 = 0000
19 = 0000
20 = 0000
21 = 0000
22 = 00ff
23 = 8005
24 = 0067
25 = 1659
26 = 19e0
27 = 1300
28 = 1800
29 = 0000
30 = f413
31 = 0002
32 = 4800
33 = 3fc7
34 = 0800
35 = 0600
36 = 0000
37 = 0000
38 = 0000
39 = 0000
40 = 4401
41 = b000
42 = fdb0
43 = 000f
44 = 0101
45 = 0080
46 = 3f01
47 = 0101
48 = 0140
49 = 0101
50 = 0000
Reader mode

Tx_EN=0
Rx_En=0
Channel=48
CRC=1
FEC=0
FRAMER_ST=1
PKT=1
FIFO=0
FIFO_WR_PTR=0
FIFO_RD_PTR=0
Boot completed.

@sidoh
Copy link
Owner

sidoh commented Apr 9, 2017

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. :(

@itProfi
Copy link
Author

itProfi commented Apr 9, 2017

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).
In my case, i try many modification with code and it's works absolutely unstable..(
When i try sniff RGB_CCT code, i see in a serial:

*WM: AutoConnect
*WM: Connecting as wifi client...
*WM: Using last saved values, should be faster
*WM: Connection result:
*WM: 3
*WM: IP Address:
*WM: 192.168.0.128
Radio module running correctly...
Radio module running correctly...
Radio module running correctly...
Radio module running correctly...
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
ElapsedRX: 1073687072
Packets received: 1073687072
Packet read OK, rec: 1073687072 Frame:
3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 Packet read OK, rec: 1073687072 Frame:
3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 Packet read OK, rec: 1073687072 Frame:
3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 Packet read OK, rec: 1073687072 Frame:
3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 Packet read OK, rec: 1073687072 Frame:
3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 Packet read OK, rec: 1073687072 Frame:
3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 Packet read OK, rec: 1073687072 Frame:
3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 Packet read OK, rec: 1073687072 Frame:
3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 Packet read OK, rec: 1073687072 Frame:
3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 Packet read OK, rec: 1073687072 Frame:
3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 Packet read OK, rec: 1073687072 Frame:
3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 Packet read OK, rec: 1073687072 Frame:
3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 Packet read OK, rec: 1073687072 Frame:
3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 Packet read OK, rec: 1073687072 Frame:
Packet read OK, rec: 1073687072 Frame:
Packet read OK, rec: 1073687072 Frame:
Packet read OK, rec: 1073687072 Frame:
3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20 3FFF2A20

Exception (9):
epc1=0x4023029e epc2=0x00000000 epc3=0x00000000 excvaddr=0x2d504013 depc=0x00000000

ctx: sys
sp: 3ffffd90 end: 3fffffb0 offset: 01a0

stack>>>
3fffff30: 4021d435 3ffec364 00000040 00000001
3fffff40: 3fff5334 40236ab3 3ffed424 3ffed430
3fffff50: 3ffed430 000000be 00000000 0000001e
3fffff60: 00000002 00000018 4021c2a3 3ffeff78
3fffff70: 3ffed424 3fffdcc0 3ffec5d8 3ffec5d8
3fffff80: 00000000 3ffeff78 3fffdab0 3fff1f50
3fffff90: 4021bbcf 3fffdab0 00000000 40202ca3
3fffffa0: 3ffec5d8 40000f49 3fffdab0 40000f49
<<<stack<<<

@sidoh
Copy link
Owner

sidoh commented Apr 11, 2017

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 :(

@sidoh
Copy link
Owner

sidoh commented Apr 12, 2017

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:

LT8900: Packet read fail
ElapsedRX: 1073686160
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
LT8900: Packet less than zero, buffer to small
ElapsedRX: 1073686160
Packets received: 1073686160
Packet read OK, rec: 1073686160 Frame:
3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 Packet read OK, rec: 1073686160 Frame:
3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 Packet read OK, rec: 1073686160 Frame:
3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 Packet read OK, rec: 1073686160 Frame:
3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 Packet read OK, rec: 1073686160 Frame:
3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 Packet read OK, rec: 1073686160 Frame:
3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 Packet read OK, rec: 1073686160 Frame:
3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 Packet read OK, rec: 1073686160 Frame:
3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 Packet read OK, rec: 1073686160 Frame:
3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 Packet read OK, rec: 1073686160 Frame:
3FFF2690 3FFF2690 Packet read OK, rec: 1073686160 Frame:
3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 Packet read OK, rec: 1073686160 Frame:
3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FFF2690 3FF

@Lstt2005 -- is this consistent with what you see? Does transmit work for you?

I'll poke around a bit.

@itProfi
Copy link
Author

itProfi commented Apr 12, 2017

is this consistent with what you see? Does transmit work for you?

Yes, I have almost the same situation ... The transfer works, but very rarely ...

LT8920.pdf
LT8900-ETC.pdf

Maybe some trouble in initialise module?

@sidoh
Copy link
Owner

sidoh commented Apr 12, 2017

Potentially. Can you put your LT8900 code on gist?

@itProfi
Copy link
Author

itProfi commented Apr 12, 2017

Potentially. Can you put your LT8900 code on gist?

https://gist.github.com/Lstt2005/93d36a9a5dd56193ec239bd0454c275f

@sidoh
Copy link
Owner

sidoh commented Apr 12, 2017

I meant whatever library you're using to control the LT8900. You're including something, it looks like:

#include "LT8900.h"

@itProfi
Copy link
Author

itProfi commented Apr 12, 2017

https://bitbucket.org/robvanderveer/lt8900lib
This is original library.

@sidoh
Copy link
Owner

sidoh commented Apr 13, 2017

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.

@itProfi
Copy link
Author

itProfi commented Apr 13, 2017

Work! Super fast receive, but:

1.Many doubles;
2.Not transmit :(

When i press Group 1 ON, i sniff:

Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E
Packet received (9 bytes):
Raw packet: AD 01 8A 90 C5 A5 48 C7 60

Decoded:
Key : AD
b1 : 21
ID : 02F2
Command : 01
Argument : 00
Sequence : B3
Group : 00
Checksum : 8E

@sidoh
Copy link
Owner

sidoh commented Apr 13, 2017

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?

@itProfi
Copy link
Author

itProfi commented Apr 13, 2017

I sniff with my second NRF24:

  1. Real FUT091 - ALL ON:
    Raw packet: E8 F4 D3 4C 3E A8 C6 3D 5C
    Decoded:
    Key : E8
    b1 : 21
    ID : 2651
    Command : 01
    Argument : 00
    Sequence : 4C
    Group : 00
    Checksum : 75

  2. Virtual remote with LT8920, ALL ON:
    Raw packet: 00 DB BB 54 66 D1 AD 66 28
    Decoded:
    Key : 00
    b1 : 20
    ID : 2651
    Command : 01
    Argument : 01
    Sequence : 1F
    Group : 01
    Checksum : 71

  3. Real FUT091 ALL OFF:
    Raw packet: 18 C4 A3 7C 0E 75 17 0D 76
    Decoded:
    Key : 18
    b1 : 21
    ID : 2651
    Command : 01
    Argument : 05
    Sequence : 4D
    Group : 00
    Checksum : 4B
    Packet received (9 bytes):

  4. Virtual remote with LT8920 ALL OFF:
    Raw packet: 00 DB BB 54 66 CA 9A 66 22
    Decoded:
    Key : 00
    b1 : 20
    ID : 2651
    Command : 01
    Argument : 06
    Sequence : 20
    Group : 01
    Checksum : 77

Virtual command not control LED strip.
Maybe difference between real and virtual Argument?

@sidoh
Copy link
Owner

sidoh commented Apr 13, 2017

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.

@itProfi
Copy link
Author

itProfi commented Apr 13, 2017

Wait, so you can see the LT8900 sending packets via another ESP, but it's not controlling the strip?

Yes.

In your examples, the LT8900 radio is not sending "all on/off" commands.

You are right! But if I have "all" selected in the group list, nothing change:

  1. Real FUT091 ALL ON:

Raw packet: 6E 35 09 DB 1E F0 C0 DD 22
Decoded:
Key : 6E
b1 : 21
ID : 2651
Command : 01
Argument : 00
Sequence : 4F
Group : 00
Checksum : EA

  1. Virtual remote with LT8920 ALL ON:

Raw packet: 00 DB BB 54 66 D0 96 65 23
Decoded:
Key : 00
b1 : 20
ID : 2651
Command : 01
Argument : 00
Sequence : 24
Group : 00
Checksum : 74

  1. Real FUT091 ALL OFF:

Raw packet: A1 15 BA E5 D9 B4 5F DB 23
Decoded:
Key : A1
b1 : 21
ID : 2651
Command : 01
Argument : 05
Sequence : 50
Group : 00
Checksum : C7

  1. Virtual remote with LT8920 ALL OFF:

Raw packet: 00 DB BB 54 66 CD 97 65 2D
Decoded:
Key : 00
b1 : 20
ID : 2651
Command : 01
Argument : 05
Sequence : 25
Group : 00
Checksum : 7A

@sidoh
Copy link
Owner

sidoh commented Apr 13, 2017

Gotcha. And the same thing works with an NRF?

@itProfi
Copy link
Author

itProfi commented Apr 13, 2017

Just flash another ESP WITH an NRF (with lt8900_reads branch), NRF work and control led strip fine...

@sidoh
Copy link
Owner

sidoh commented Apr 13, 2017

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?

@itProfi
Copy link
Author

itProfi commented Apr 13, 2017

Try all things:

  1. Move the LT8900 really close to the LED - not stable control (1-2 times from 10);
  2. Use another DC - not stable control (1-2 times from 10);
  3. Use another frequency of SPI - not stable control (1-2 times from 10)....

In all cases my NRF sniffer see stable packets (from 10 cm on one table with LT8920 to 10 meters).
Maybe some with Channels frequency, it's quantity (not 3), number of packets?

@sidoh
Copy link
Owner

sidoh commented Apr 13, 2017

Thanks for trying that!

How many repeat packets do you have configured?

config

@itProfi
Copy link
Author

itProfi commented Apr 13, 2017

Change from 5 to 50 - very very unstable...Maybe my module broken? Can try tomorrow - after tomorrow another LT8920..

@sidoh
Copy link
Owner

sidoh commented Apr 13, 2017

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. :\

@itProfi
Copy link
Author

itProfi commented Apr 16, 2017

For me works fine with this settings:
16-04-2017 205257
Many thanks to all!!

@sidoh
Copy link
Owner

sidoh commented Apr 17, 2017

Nice! :)

@g-rom-info
Copy link

Hi,
I have implemented today your new 1.2 version and wired a PL1167 to my ESP8266 (D1 Mini)
It seems to work properly. I will test it hardly next days :-)
It is better than the nRF24l01 (some bulbs can not receive commands properly even if the signal is emitted several times.)
For your information I burned 2 PL1167. I don't know if it is a wiring problem (I suspect I have crossed PKT and RST pins). I added a passive logic level adapter between ESP8266 and PL1167.
Best regards,

@itProfi
Copy link
Author

itProfi commented Apr 23, 2017

Also, LT8920 works well with D1 mini.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants