I am using a Adafruit Feather M0 RFM95 LoRa Radio. I am trying to find a way to put the radio module to sleep. In the documentation they mentioned that it can be done by calling " radio.sleep();" (https://learn.adafruit.com/adafruit-fea ... management). But I was unable to find radio.sleep(); in Arduino.
I even though about setting the RX pinout(0) to LOW but it didn't work. There are some LoRa radio control pinouts (4,7,8) I am not sure what functionality they have reset, but setting 4 and 7 to LOW seems to not serve the purpose. I referred this page for the pinouts (https://cdn-learn.adafruit.com/download ... module.pdf)
After setting the pin to LOW, the node is still receiving the signal.
I am fairly new, so I don't have much knowledge regarding this, but any help is appreciated.
Thank you
Code: Select all
#define RX 0
int flag = 0;
void loop()
{
if (rf95.available())
{
digitalWrite(LED, HIGH);
flag = flag+1;
// Should be a message for us now
uint8_t buf[RH_RF95_MAX_MESSAGE_LEN];
uint8_t len = sizeof(buf);
if (rf95.recv(buf, &len))
{
if(flag == 1){ // set the radio off after receiving 1st message
digitalWrite(RX, LOW);
flag = flag+1;
}
RH_RF95::printBuffer("Received out: ", buf, len);
delay(1000);
// create a reply
}
else
{
Serial.println("Receive failed");
}
}
}