@lafleur
I have been using the transportinit() and transportpowerdown(), as suggested and it has been working fine if I was just sending data...
But when I needed to receive data from the controller, I was never receiving any data from the controller, even if I allowed a RX window of 20 sec or more.
On Wake up, If I remove the call to transportinit(), all work fine again... TX and RX work just fine...
What going on here?? Why is system working without the need to call transportinit() as you suggested.
using a SAMD processor M0
IDE 1.8.1
MySensor 2.1.1
My current code base:
https://github.com/trlafleur/Soil_Moisture_Sensor_MS_R1.1-RFM95
/* **************** System Sleep ******************* */
void systemSleep()
{
debug1(PSTR("\n*** Going to Sleep ***\n"));
wait (100);
// put led's, radio and flash to sleep
// Turn off LED's
// Put Flash to sleep
// Put Radio and transport to Sleep
transportPowerDown(); // Shut down radio and MySensor transport
interrupts(); // make sure interrupts are on...
LowPower.standby(); // SAMD sleep from LowPower systems
// .... we will wake up from sleeping here if triggered from an interrupt
interrupts(); // make sure interrupts are on...
}
/* **************** System Wake-up from Sleep ******************* */
void systemWakeUp()
{
// re enable LED's if needed
// wake up Flash if needed
// wake up MySensor transport and Radio from Sleep
//transportInit();
// as MySensor had NO sleep or Watch Dog for SAMD, this will
// wake us up so that we can send and receive messages
while (!isTransportReady()) { // Make sure transport is ready
_process();
interrupts(); // make sure interrupts are on...
}