Forum Replies Created
-
AuthorPosts
-
Hi Renzo, I apologize for replying late! In fact the problem is the one you mentioned, that is the application of RSSI. Thank you!
I wanted to ask you another thing, is the encryption with the two constants CRYPT_H and CRYPT_L with a maximum value of 255 for each, which are multiplied, AES type?
Also, with FIXED mode, and Encryption, am I sure that no “smart thief” can intercept the sent command, to use it to send it to the receiving station with LoRa? 😛
Thanks for the reply Renzo. Yes, the key is the same for both devices.
I set it like this:
configuration.CRYPT.CRYPT_H = 123; configuration.CRYPT.CRYPT_L = 123;
however, the strings I receive on the transmitter have strange characters.
However it doesn’t matter, since I finished the project and set up as I told you earlier like this:rs.data.substring(0,2) == "on"
Thanks so much for your patience!
Without the Crypt, the strings are correct. Instead since I set the encryption key, the strings arrive strange.
This is the transmitter:
#include "Arduino.h" #include "LoRa_E220.h" LoRa_E220 e220ttl(3, 2); #define button 9 bool status; void setup() { Serial.begin(9600); pinMode(button, INPUT_PULLUP); delay(500); e220ttl.begin(); } String msg; void loop() { if(!digitalRead(button)){ status=!status; delay(200); } if(status){ msg = "on"; //on e220ttl.sendFixedMessage(0, 3, 4, msg); Serial.println(msg); } else { msg = "off"; //off e220ttl.sendFixedMessage(0, 3, 4, msg); Serial.println(msg); } }
This is the receiver:
#include "Arduino.h" #include "LoRa_E220.h" #define relay 12 LoRa_E220 e220ttl(3, 2); void setup() { Serial.begin(9600); pinMode(relay, OUTPUT); delay(500); e220ttl.begin(); } void loop() { if (e220ttl.available() > 0) { ResponseContainer rs = e220ttl.receiveMessage(); Serial.println(rs.data); if (rs.data == "on" ) { //ON digitalWrite(relay, HIGH); } else if (rs.data == "off" ) { //OFF digitalWrite(relay, LOW); } } }
Thanks Renzo!
I set it up successfully! There is only one small problem: if the transmitter lora module sends an “on” or “off” string, the transmitter rs.data reads like this: “on%?d05”I fixed it by making a substring like this:
if(rs.data.substring(0,2) == "on"){ digitalWrite(relay, HIGH); }
But I was wondering why the transmitter in rs.data doesn’t give me “on” and “off” without the other weird characters.
Both the receiver and the transmitter have been set to fixed transmission, with the same baud rate and all other settings.
Thanks, Renzo!
So, Have I to input like this?configuration.CRYPT.CRYPT_H = 123456; configuration.CRYPT.CRYPT_L = 123456;
Where ‘123456’ is my key, right?
Thank you very much Renzo. This way I am sure that no one can clone the message I send?
Also is possible an example of how to set these instructions?
configuration.CRYPT.CRYPT_H; configuration.CRYPT.CRYPT_L;
Should I leave them like this as you wrote them? Or do I have to give it values? like that:
configuration.CRYPT.CRYPT_H = X; configuration.CRYPT.CRYPT_L = Z;
-
AuthorPosts