LSatan / SmartRC-CC1101-Driver-Lib

This driver library can be used for many libraries that use a simple RF ASK module, with the advantages of the cc1101 module. It offers many direct setting options as in SmartRF Studio and calculates settings such as MHz directly.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Receive Buffer is larger than 61 and ELECHOUSE_cc1101.CheckRxFifo(150) prints dummy values

jayateertha043 opened this issue · comments

Issues -

  1. I am able to get signal only when ELECHOUSE_cc1101.CheckRxFifo(150) is used, when ELECHOUSE_cc1101.CheckReceiveFlag() is used it doesn't detect any signal.
  2. Without if(rsi>-80) check the buffer prints dummy values filled with 00 (ex- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...)
  3. In all the case even when no signal is detected, empty buffer 00 00 00 00 00 00 is printed and buffer length of received data is always greater than 61. (Hope CC1101 can handle only 61 bytes of data, but buffer is always greater than 190 - even for dummy 00 00 00 00 00 00 00 00 00 00 ...)

Code -

void loop()
{
  byte buffer[300] = {0};
  if (ELECHOUSE_cc1101.CheckRxFifo(150))
  {
    if (ELECHOUSE_cc1101.CheckCRC())
    {
      int rsi = ELECHOUSE_cc1101.getRssi();
      byte lqi = ELECHOUSE_cc1101.getLqi();
      int len = ELECHOUSE_cc1101.ReceiveData(buffer);
      
      if (rsi>-80)
      {
        
        Serial.println("RSI: ");
        Serial.println(rsi);
        Serial.printf("\nBuffer Size:%d", len);
        Serial.println();
        buffer[len] = '\0';
        dump_byte_array(buffer, len);
        Serial.println();
      }
    }
  }
  // webSocket.loop();
}

I would highly suggest you become more familiar with the datasheet for the cc1101, this lib AND the examples. I would be willing to bet you do not have gdo hooked up, or you do not have it defined as the ELECHOUSE_cc1101.CheckReceiveFlag() only works if you have gdo.

Screenshot 2024-01-14 11 19 36 PM

Notice how it returns 0 which is false. No gdo= if (ELECHOUSE_cc1101.CheckReceiveFlag() ) is always false.

  1. My advice depends on what you have set which is not shown, if you turned off PQT or messed with/completely turned off the sync mode (or even only used carrier) you are going to get more noise since there is constantly RF noise everywhere. The 0's aren't necessarily "dummy" values could be a very faint signal. You need filters to get what you are interested in. I typically use decoders as my filters on the Yardstick one and then feed it lowball values which is nearly everything.

  2. It depends on what the FIFOTHR register is set at. Page 72 of the data sheet gives the details but there could be as much as 64 bytes of data in the buffer before overflow, or as little as 4 bytes in the buffer before overflow. Interestingly, I haven't seen any functions in this lib that set FIFOTHR, which would default at 33bytes TXfifo and 32bytes RXfifo