-
Notifications
You must be signed in to change notification settings - Fork 29
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
CAD detected #25
Comments
Sorry, I have never used the CAD function before and I am not willing to
try and debug your code.
Are you using a Grasshopper?
Why are you using PABoost? Is this supported by your hardware?
Can you get plain old LoRaRadio to work?
On first read the logic seems off in your CAD example but I might just be
missing something...
…On Mon, May 25, 2020 at 11:11 AM pipesg ***@***.***> wrote:
Hello,
I am using your boards (grasshopper and cricket) to develop an animal
tracker by using the LoRa radio not LoRaWAN. To reduce the power
consumption from the tracker I will like to use a low energy design provide
by Semtech (AN1200.17) using the channel activity detection (CAD) of the
radio. I am not very proficient in programming so perhaps I am missing
something or doing something incorrect, but I am not able to detect the
preambles. I have also asked this in GrumpyOldPizza/ArduinoCore-stm32l0
repository but without replies, so sorry for duplicate the question.
I am using two simple programs, one to send a message with a long preamble
(10 seconds) and another implementing the CAD function;
Preamble send
`#include "LoRaRadio.h"
#define myLed 13
void setup( void )
{
Serial.begin(115200);
pinMode(myLed, OUTPUT);
digitalWrite(myLed, LOW);
LoRaRadio.begin(865200000);
LoRaRadio.setFrequency(865200000);
LoRaRadio.setTxPower(14);
LoRaRadio.setPreambleLength (300);
LoRaRadio.setBandwidth(LoRaRadio.BW_125);
LoRaRadio.setSpreadingFactor(LoRaRadio.SF_12);
LoRaRadio.setCodingRate(LoRaRadio.CR_4_5);
LoRaRadio.setLnaBoost(true);
delay (2000);
}
void loop( void )
{
unsigned long previous = millis ();
digitalWrite(myLed, HIGH);
LoRaRadio.beginPacket();
LoRaRadio.write(1);
LoRaRadio.endPacket();
while (LoRaRadio.busy());
unsigned long last = millis ();
last -= previous;
Serial.println (last);
digitalWrite(myLed, LOW);
delay(3000);
}`
CAD
`#include "LoRaRadio.h"
bool CadDone;
bool CadDetected;
void setup( void ){
Serial.begin(115200);
LoRaRadio.begin(865200000);
LoRaRadio.setFrequency(865200000);
LoRaRadio.setTxPower(14);
LoRaRadio.setBandwidth(LoRaRadio.BW_125);
LoRaRadio.setSpreadingFactor(LoRaRadio.SF_12);
LoRaRadio.setCodingRate(LoRaRadio.CR_4_5);
LoRaRadio.setLnaBoost(true);
LoRaRadio.onCad(CADcallback);
}
void loop( void ){
CadDone = false;
CadDetected = false;
Serial.print ("Caddone: "); Serial.println (CadDone);
unsigned long cadinit = millis ();
LoRaRadio.cad ();
while (LoRaRadio.busy());
unsigned long cadend = millis ();
Serial.print ("Caddone: "); Serial.println (CadDone);
Serial.print ("CadDetected: "); Serial.println (CadDetected);
cadend -= cadinit;
Serial.print ("Cad length: "); Serial.println (cadend);
Serial.println ();
delay (1500);
}
void CADcallback (void){
CadDone = true;
CadDetected = LoRaRadio.cadDetected ();
}`
I am quite that the CAD is executing because the the caend-cadinit lenght
is the same as the estimated time in the LoRa calculator by Semtech but the
program is not able to detect the preambles by using LoRaRadio.cadDetected
() function.
Any help would be greatly welcome, thanks in advance!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#25>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTDLKVPVPSLQSNSKBGJ3PLRTKYDXANCNFSM4NJWJQQQ>
.
|
Hi, |
Hello,
I am using your boards (grasshopper and cricket) to develop an animal tracker by using the LoRa radio not LoRaWAN. To reduce the power consumption from the tracker I will like to use a low energy design provide by Semtech (AN1200.17) using the channel activity detection (CAD) of the radio. I am not very proficient in programming so perhaps I am missing something or doing something incorrect, but I am not able to detect the preambles. I have also asked this in GrumpyOldPizza/ArduinoCore-stm32l0 repository but without replies, so sorry for duplicate the question.
I am using two simple programs, one to send a message with a long preamble (10 seconds) and another implementing the CAD function;
Preamble send
`#include "LoRaRadio.h"
#define myLed 13
void setup( void )
{
Serial.begin(115200);
pinMode(myLed, OUTPUT);
digitalWrite(myLed, LOW);
LoRaRadio.begin(865200000);
LoRaRadio.setFrequency(865200000);
LoRaRadio.setTxPower(14);
LoRaRadio.setPreambleLength (300);
LoRaRadio.setBandwidth(LoRaRadio.BW_125);
LoRaRadio.setSpreadingFactor(LoRaRadio.SF_12);
LoRaRadio.setCodingRate(LoRaRadio.CR_4_5);
LoRaRadio.setLnaBoost(true);
delay (2000);
}
void loop( void )
{
unsigned long previous = millis ();
digitalWrite(myLed, HIGH);
LoRaRadio.beginPacket();
LoRaRadio.write(1);
LoRaRadio.endPacket();
while (LoRaRadio.busy());
unsigned long last = millis ();
last -= previous;
Serial.println (last);
digitalWrite(myLed, LOW);
delay(3000);
}`
CAD
`#include "LoRaRadio.h"
bool CadDone;
bool CadDetected;
void setup( void ){
Serial.begin(115200);
LoRaRadio.begin(865200000);
LoRaRadio.setFrequency(865200000);
LoRaRadio.setTxPower(14);
LoRaRadio.setBandwidth(LoRaRadio.BW_125);
LoRaRadio.setSpreadingFactor(LoRaRadio.SF_12);
LoRaRadio.setCodingRate(LoRaRadio.CR_4_5);
LoRaRadio.setLnaBoost(true);
LoRaRadio.onCad(CADcallback);
}
void loop( void ){
CadDone = false;
CadDetected = false;
Serial.print ("Caddone: "); Serial.println (CadDone);
unsigned long cadinit = millis ();
LoRaRadio.cad ();
while (LoRaRadio.busy());
unsigned long cadend = millis ();
Serial.print ("Caddone: "); Serial.println (CadDone);
Serial.print ("CadDetected: "); Serial.println (CadDetected);
cadend -= cadinit;
Serial.print ("Cad length: "); Serial.println (cadend);
Serial.println ();
delay (1500);
}
void CADcallback (void){
CadDone = true;
CadDetected = LoRaRadio.cadDetected ();
}`
I am quite that the CAD is executing because the the caend-cadinit lenght is the same as the estimated time in the LoRa calculator by Semtech but the program is not able to detect the preambles by using LoRaRadio.cadDetected () function.
Any help would be greatly welcome, thanks in advance!
The text was updated successfully, but these errors were encountered: