diff --git a/tp1/arduino/LoRaReceiver/LoRaReceiver.ino b/tp1/arduino/LoRaReceiver/LoRaReceiver.ino index 4e99c0f..b3a1cd0 100644 --- a/tp1/arduino/LoRaReceiver/LoRaReceiver.ino +++ b/tp1/arduino/LoRaReceiver/LoRaReceiver.ino @@ -5,8 +5,6 @@ void setup() { Serial.begin(9600); while (!Serial); - Serial.println("Applejack is best pony ! Received by Pauline Srifi ~"); - if (!LoRa.begin(864E6)) { Serial.println("Starting LoRa failed!"); while (1); diff --git a/tp1/arduino/LoRaSender/LoRaSender.ino b/tp1/arduino/LoRaSender/LoRaSender.ino index be0d21a..9e451d8 100644 --- a/tp1/arduino/LoRaSender/LoRaSender.ino +++ b/tp1/arduino/LoRaSender/LoRaSender.ino @@ -7,7 +7,7 @@ void setup() { Serial.begin(9600); while (!Serial); - Serial.println("Applejack is best pony ! Send by Pauline Srifi ~"); + //Serial.println("Applejack is best pony ! Send by Pauline Srifi ~"); if (!LoRa.begin(864E6)) { Serial.println("Starting LoRa failed!"); @@ -15,7 +15,7 @@ void setup() { } } -int generateRandomTemp() { //-50 to 150 +int generateRandomTemp() { //50 to 250 int r = (rand() % (150 - (-50) + 1)) + (-50); return r; } @@ -24,9 +24,8 @@ void loop() { int temp = generateRandomTemp(); // send packet LoRa.beginPacket(); - LoRa.print("Pauline temp is "); LoRa.print(temp); - LoRa.println("°."); + Serial.println("envoi de " + temp); LoRa.endPacket(); counter++; diff --git a/tp1/python/Lecture_portcom.py b/tp1/python/Lecture_portcom.py index bd9b09d..590a98a 100644 --- a/tp1/python/Lecture_portcom.py +++ b/tp1/python/Lecture_portcom.py @@ -9,7 +9,7 @@ ser.timeout=10 ser.open() f=open('datas.csv','w') -for uwu in range(0,10) : +for uwu in range(0,30) : x = ser.readline() t = datetime.datetime.now() diff --git a/tp1/python/datas.csv b/tp1/python/datas.csv index 9723172..f498e35 100644 --- a/tp1/python/datas.csv +++ b/tp1/python/datas.csv @@ -1,10 +1,30 @@ -b'Applejack is best pony ! Received by Pauline Srifi ~\r\n'; 2022-09-15 16:16:06.340607 -b'h%l\xcc\x12.\x9d\x14\x13Pauline temp is 115\xc2\xb0.\r\n'; 2022-09-15 16:16:09.275030 -b'Pauline temp is 121\xc2\xb0.\r\n'; 2022-09-15 16:16:14.333684 -b'Pauline temp is -1\xc2\xb0.\r\n'; 2022-09-15 16:16:19.390743 -b'Pauline temp is -43\xc2\xb0.\r\n'; 2022-09-15 16:16:24.449501 -b'Pauline temp is -26\xc2\xb0.\r\n'; 2022-09-15 16:16:29.507680 -b'Pauline temp is -24\xc2\xb0.\r\n'; 2022-09-15 16:16:34.566655 -b'Pauline temp is 112\xc2\xb0.\r\n'; 2022-09-15 16:16:39.624938 -b'Pauline temp is -50\xc2\xb0.\r\n'; 2022-09-15 16:16:44.681967 -b'Pauline temp is -2\xc2\xb0.\r\n'; 2022-09-15 16:16:49.740181 +b'LoRa Receiver\r\n'; 2022-10-06 15:46:03.754135 +b"Received packet 'Pauline temp is 119\xc2\xb0.\r\n"; 2022-10-06 15:46:04.628907 +b"' with RSSI -18\r\n"; 2022-10-06 15:46:04.628907 +b"Received packet 'Pauline temp is 75\xc2\xb0.\r\n"; 2022-10-06 15:46:09.686425 +b"' with RSSI -19\r\n"; 2022-10-06 15:46:09.686425 +b"Received packet 'Pauline temp is -45\xc2\xb0.\r\n"; 2022-10-06 15:46:14.745451 +b"' with RSSI -18\r\n"; 2022-10-06 15:46:14.746421 +b"Received packet 'Pauline temp is 126\xc2\xb0.\r\n"; 2022-10-06 15:46:19.805067 +b"' with RSSI -18\r\n"; 2022-10-06 15:46:19.807069 +b"Received packet 'Pauline temp is 31\xc2\xb0.\r\n"; 2022-10-06 15:46:24.862189 +b"' with RSSI -18\r\n"; 2022-10-06 15:46:24.862845 +b"Received packet 'Pauline temp is 93\xc2\xb0.\r\n"; 2022-10-06 15:46:29.919918 +b"' with RSSI -18\r\n"; 2022-10-06 15:46:29.921870 +b"Received packet 'Pauline temp is 125\xc2\xb0.\r\n"; 2022-10-06 15:46:34.980235 +b"' with RSSI -18\r\n"; 2022-10-06 15:46:34.982238 +b"Received packet 'Pauline temp is -32\xc2\xb0.\r\n"; 2022-10-06 15:46:40.038848 +b"' with RSSI -19\r\n"; 2022-10-06 15:46:40.040878 +b"Received packet 'Pauline temp is 29\xc2\xb0.\r\n"; 2022-10-06 15:46:45.096257 +b"' with RSSI -19\r\n"; 2022-10-06 15:46:45.097299 +b"Received packet 'Pauline temp is 115\xc2\xb0.\r\n"; 2022-10-06 15:46:50.155526 +b"' with RSSI -19\r\n"; 2022-10-06 15:46:50.157563 +b"Received packet 'Pauline temp is 121\xc2\xb0.\r\n"; 2022-10-06 15:46:55.214600 +b"' with RSSI -19\r\n"; 2022-10-06 15:46:55.216627 +b"Received packet 'Pauline temp is -1\xc2\xb0.\r\n"; 2022-10-06 15:47:00.271691 +b"' with RSSI -19\r\n"; 2022-10-06 15:47:00.271691 +b"Received packet 'Pauline temp is -43\xc2\xb0.\r\n"; 2022-10-06 15:47:05.331263 +b"' with RSSI -18\r\n"; 2022-10-06 15:47:05.333305 +b"Received packet 'Pauline temp is -26\xc2\xb0.\r\n"; 2022-10-06 15:47:10.389773 +b"' with RSSI -19\r\n"; 2022-10-06 15:47:10.389773 +b"Received packet 'Pauline temp is -24\xc2\xb0.\r\n"; 2022-10-06 15:47:15.448382