Lora send but can't receive well

Hi friends,
I wrote codes for simple a gateway and a node. gateway send a message to node. but after 5 or 6 times send and receive, the node is hanging and not receive from gateway.
I attach the codes below:

#include <SPI.h>
#include <LoRa.h>
String inString = “”;
String outgoing; // outgoing message
long lastSendTime = 0; // last send time
int interval = 10000; // interval between sends

void setup() {
while (!Serial);
Serial.println(“LoRa node”);
if (!LoRa.begin(433E6)){
Serial.println(“Starting LoRa failed!”);
while (1);
// register the receive callback
// put the radio into receive mode

void loop() {

void onReceive(int packetSize) {
if (packetSize == 0) return; // if there’s no packet, return
String incoming = “”;
while (LoRa.available()) {
incoming += (char)LoRa.read();
Serial.print("Message: " + incoming);

result is not permanent. gateway send 4 or 5 time to node but after that node can’t receive anything.!!! I tried many changes in my code but at first lets discuss about this simple one. please help me. thanks.

Hei @sofiavenus ,

It would be very hard to help you.
First of all you have not mentioned which RAK products you are using. What is the node, what about the gateway, etc.
How about the network server, are you using TTN, as the category you listed the post in suggests?
Can we have some logs from the node/gateway that show their behavior.