How to send a downlink to an end device without the device sending an uplink

Good morning

I explain my intention: I have 2 loRa nodes that control each valve for opening and closing the water and, with a pressure sensor, it then confirms whether the water passes or not.

To do this I thought of sending a message to the node in question so it executed the instruction and gave me back the state of the water flow.

I’m having difficulty because I can’t send a message from the gateway to the node without the node making the request.

Is it possible to do this?

Hi ABInformatica,

yes it is possible to send downlink without transmitting uplink first.
Either you configure class B for your device, then you can define receive windows in a specific interval. Or you configure class C. Then your device opens the receive window as long as it transmits an uplink packet. But the device is not in sleep mode which costs much of energy.

BR / DeHi

1 Like

In the end I put it in class C and as soon as you queue the message sends it directly.

But I can’t take the message with arduino.
I am using ABP and I would like to turn on an LED when I want from the server but I don’t know how to do it, are you capable?

What do you mean? You are not able to receive the downlink from the server?
This can due to various problems.
Maybe your node can not process the SF of the downlink packet. In ABP, you can define e.g. the SF of RX2.

BR/DeHi

In practice I would like the arduino MKR 1300 to always listen and when I send it the message to turn on the led, execute the command.

Like this video by SemTech.

I want to turn on the lamps in the living room, bedroom, bathroom with the LoRa system.

I imagine that from the server I send the command to turn on the lamp and the Arduino MKR WAN 1300 will always be listening and when it receives the message it turns on / off the lamp.

How can I put Arduino always listening?

1 Like

You need

  1. turn the Arduino based endnode LoRa modem to Class C.
  2. Program the LoRa modem to send specific trigger command/byte to SPI or another one logical interface regarding received over the air data.
  3. program the arduino to listen a specific port/trigger and perform certain actions depending on the event received.
    Anyway it depends on which controller with LoRa You are will be use.

Then as a gateway I use iC880a connected to Raspi 3 B + where I installed the S.O. Full.
Configured in class c.

The node is an Arduino MKR WAN 1300 and with the test skatch “LoraSendAndReceive” from arduino I send a command and the server responds with a message queued and Arduino receives it.

I took the skatch and modified it by looping the following code:

char rcv[64];
int i = 0;
while (modem.available()) {
  rcv[i % 64] = (char)modem.read();
  ++i;
}



String data_received = rcv;
if (data_received == "") {
  Serial.println("Data receved NON ricevo: " + data_received);
} else {
  
  Serial.println("Data receved: " + data_received);

  //Serial.println("Received: ");
 
  for (unsigned int j = 0; j < i; j++) {
    Serial.println("Sono nel FOR");
    Serial.print(rcv[j] >> 4, HEX);
    Serial.print(rcv[j] & 0xF, HEX);
    Serial.print(" ");
  }
  return;
}

But I don’t get anything, in my opinion I’m wrong to use this code in a loop but I’m not sure.

Has anyone already had experience with Arduino MKR WAN 1300?

Or I can also change Hardware if you recommend which one to use, the battery must last at least 5 years.

Thanks

Use this as generic calculator to calculate battery life and capacity:
C = Battery capacity (mAh)
BL= Battery life (years)
Is = Current when device is in sleep mode (mA)
Itx = Current when device is in transmit mode (mA)
Irx = Current when device is in Receive mode (mA)
Imeas = Current when device is in measurement mode (mA) [it depends on technology used and application]
Ttx = Amount of time that device is in Transmit (TX) mode (ms)
Trx = Amount of time that device is in Receive (RX) mode (ms)
Tmeas = Amount of time that device is in measurement mode (ms) [depends on technology used and application]
Ta = Amount of time that device is active (ms)
Ta = Ttx+ Trx +Tmeas
U = Usable capacity after taking into account self-discharge (%)
N = Number of times the device will be active per day
cU = Capacity after taking into account discharge rate (mAh) = C*(U/100)
T = Milliseconds per hour = 3600000
cA = Active capacity usage per day = N*(TtxItx + TrxIrx + TmeasImeas)
cS = Sleep capacity usage per day = Is
( 24-((Ttx + Trx + Tmeas)*N/T) )
cT = Total capacity consumed per day = cA+cS
Battery Life (days) = (cU/cT)/24
Battery Life (years) = days/365.24

P.S. for class C endnoes highly recommended to use the external power.

Thanks for the information but the last of my thoughts for now is the battery life.

Someone can tell me how to turn on a lamp or an LED with Arduino MKR WAN 1300 because on this forum nobody knows how this board works.

I think it’s better to ask about this board here.
and read some docs here

Thanks try to see them on their forum.

Hii there ,is this issue solved for you,i need to implement the same for my lorawan devices can you help me with that.

1 Like