Sending data between 2 Rak4630

Hey, I’m really new to this Lora,rak,etc thing and currently I was able to start my first project ,which is sending some that from rak4630 to the TTN and i was able to complete that,some steps forward and now I’m able to visualize that data on DataCake and also having it on a MySqlDB.

Issue:Now my question is how can I,while reading the data from the sensors and sending it to a gateway (using rak4630), send a number being it 1 OR 0 to another rak4630 (

basically:

        rak4630(1)-->gateway;
        rak4630(1)-->rak4630(2);
        rak4630(2)-->gateway

) ,so if i get a read on the sensors between X and Y i want to send to the other board that 1 or 0 and at the same time this board must send also some readings to the gateway.

Setup:wisgate edge lite 2, 2 rak4631 and some sensors

Welcome to RAK forum @Vasco ,

The way I understand it, you need to configure your RAK4630 as LoRaWAN End-Device and LoRa P2P. This is not possible simultaneously. You have to choose if you are going to act as a LoRaWAN End-Device or as a LoRa P2P TX/RX node, one at a time.

This is not impossible to do but you have to do some firmware tricks to accomplish this requirement. Some points you need to consider.

  • You have to restart the module if you need to switch mode from LoRaWAN to LoRa P2P.
  • You can perform software reset.
  • You can store some states in flash if you need but likely you will a non-volatile memory with high life/endurance. Since if you switch mode, you might need to store some states or conditions.
  • You might need some clock/timing to synchronize the modules when to act as LoRaWAN end-device and when to act as LoRa P2P TX/RX node.
  • You need to consider memory space use since you will compile both LoRa P2P and LoRaWAN stack in a single device.

I haven’t done this though so I will look forward on how you’ll do it.

1 Like

Thanks for the reply @carlrowan ,

If I understood that correctly,I have to be switching between LoraWan End-Device and Lora P2P ?.
Can RAK4630 do that?
More precisely , I will be reading values and when the value gets between X and Y , i will need to do a software reset to change to P2P and send a value to the other RAK4630 ,and then this second one will send a data to the gateway when activated by the first one, and the first one will reset again to turn itself to End-Device .
Correct me if I’m wrong ,
Thanks

Hi @Vasco ,

Switching should be possible. You’ll be only limited by the size of memory your code will occupy. You have to take now that initialization of LoRaWAN and LoRA P2P are different. Also its callbacks and functions. I haven’t tried it but I will give it a try.

The sequence you said is exactly what I mean. You need to switch the nodes functions.

1 Like

Hi again @carlrowan ,
I was here thinking ,can I use my gateway to send a value to an End-Device?Like the first end-device send a value to the gateway and then the gateway sends that value to the second end-device .Is that possible?
It would be better than be switching between P2P and End-Device

Hi @Vasco ,

The gateway cannot send value to a device. It is the LoRaWAN network server that performs this action via downlink. That is possible but you need to create an integration on the LoRaWAN network server that when a certain uplink is sent, it will generate a downlink. However, take note that LoRaWAN end-devices isn’t designed to get downlink packets in frequent intervals.

Hello @carlrowan again,
Sorry for this late reply,I have another question.

Imagine that I want to create an app to turn on and off a rak13007 by LoRaWAN network .
So basically the user clicks on a button and then it send a message to the network server to send a downlink to the rak4630 is it possible?

Yes. That is possible.

You can refer on this tutorial in our Knowledge Hub as reference - Manage LoRaWAN Downlinks to Configure the Uplink Interval of CO2 Monitoring Device with TTS V3 and Ubidots | RAKwireless Documentation Center

This one uses Ubidots button widgets to send downlinks to the end-device and change the interval of sending uplinks.

1 Like