- This topic has 1 reply, 2 voices, and was last updated 1 year, 7 months ago by .
Viewing 1 reply thread
Viewing 1 reply thread
- You must be logged in to reply to this topic.
Home › Forums › The libraries hosted on the site › EByte LoRa e220 UART devices LLCC68 › Go to sleep after sending data – safeguarding
Hi,
I realised that if you use the commands:
ResponseStatus rs = e220ttl.sendMessage(&struct1, sizeof(struct1));
Serial.print(rs.getResponseDescription());
and even if the outcome is “Success” it does NOT mean the message was sent.
The only way to make sure transmission is finished is to observe AUX input – it takes around 360ms and (probably) it depends on the amount of data to be sent:
#define AUX xx
pinMode(AUX,INPUT);
while (digitalRead(AUX) == 0) {}
and once it is LOW, you can safely send E220 to sleep, i.e. this way:
#define M0 19
#define M1 21
pinMode(M0, OUTPUT);
pinMode(M1, OUTPUT);
digitalWrite(M0, 1);
digitalWrite(M1, 1);
Hi Zygfryd,
sorry if I answer only now. Yes, if you set AUX, you get better optimization in terms of time, if you don’t set AUX, I use an arbitrary amount of time that covers the wide case with minimum time, but It can be possible that not all if you have an issue in a particular aspect I advise adding a delay to be sure of the sending.
Bye Renzo
More