- This topic has 1 reply, 2 voices, and was last updated 1 year, 5 months ago by .
- 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
3D Printer 3D printer upgrade ABB Arduino Arduino IDE Arduino SAMD boards Aurora AWS CNC Cyclone PCB Factory Cyclone PCB Factory how to build It Display DynamoDB E32 E70 EByte esp01 esp32 esp8266 File System Firmware i2c Library LoRa MicroPython Milling PCB My PCB Networking PCB pinout Power saving Raspberry Pi REST API RF rp2040 SD Card Sensors Sleep and Wake UP SPI STM32 Temperature Tutorial Web Server Wemos D1 mini WiFi