Here is the problem. I have build a ttn network based project. I can send to the things network which will send it over http to a php file and then to a database. But when I send a message back it gets back the whole way to the arduino but i don't know how I can do something with that data. In the lora send and recieve tutorial you can only read out messages in your serial monitor. How can I transform that incomming message to a function. For example put a led on and off.
here is my recieving part of the code:
if (!modem.available()) {
Serial.println("No downlink message received at this time.");
}
char rcv[64];
int i = 0;
while (modem.available()) {
rcv[i++] = (char)modem.read();
}
Serial.println("Received: ");
for (unsigned int j = 0; j < i; j++) {
Serial.print(rcv[j] >> 4, HEX);
Serial.print(rcv[j] & 0xF, HEX);
Serial.print(" ");
}
Serial.println();
From this part I tried something but this doesn't work. You see what i'm trying to do?
char cont = Serial.read();
Serial.println(cont);
if(cont == 'exact message I send from ttn'){
digitalWrite(flitser, HIGH);
digitalWrite(sirene, HIGH);
}