From 37dfd33259232e70bf55bc9e5852a6b75d4b23b7 Mon Sep 17 00:00:00 2001
From: Julien Cluzel <julien.cluzel@imt-atlantique.net>
Date: Tue, 22 Apr 2025 10:18:07 +0200
Subject: [PATCH] PingPong

---
 .DS_Store                                     | Bin 8196 -> 8196 bytes
 .../Projects/LoRa_Mac_TEST1/src/main.cpp      |   2 +-
 GW-custom/.DS_Store                           | Bin 0 -> 6148 bytes
 GW-custom/PingPong/.DS_Store                  | Bin 0 -> 6148 bytes
 GW-custom/PingPong/Ping/main.py               |  41 ++++++++++++++++++
 GW-custom/PingPong/Ping/pymakr.conf           |  10 +++++
 6 files changed, 52 insertions(+), 1 deletion(-)
 create mode 100644 GW-custom/.DS_Store
 create mode 100644 GW-custom/PingPong/.DS_Store
 create mode 100644 GW-custom/PingPong/Ping/main.py
 create mode 100644 GW-custom/PingPong/Ping/pymakr.conf

diff --git a/.DS_Store b/.DS_Store
index 8b0c842067349a560540f07db1ea33a8e53caf03..93c7ee11b42e7cdb637f3bca07eeb89216994648 100644
GIT binary patch
delta 47
zcmZp1XmQxUA;h?2@;QM*Zi(t@Ljw~X1ru}2$)1AJj9rr#2+1>cZ$2QD$GBNv<SI7+
DW-$)g

delta 21
dcmZp1XmQxUAvF1{!0ydQgt8eo>xo?B1^`|@2uT0{

diff --git a/Capteur-autonome/Projects/LoRa_Mac_TEST1/src/main.cpp b/Capteur-autonome/Projects/LoRa_Mac_TEST1/src/main.cpp
index 1768d92..fafd627 100644
--- a/Capteur-autonome/Projects/LoRa_Mac_TEST1/src/main.cpp
+++ b/Capteur-autonome/Projects/LoRa_Mac_TEST1/src/main.cpp
@@ -44,5 +44,5 @@ void loop() {
   String command = "AT+TEST=TXLRSTR,\"" + message + "\"";
 
   sendCommand(command);
-  delay(5000);  // 5 secondes entre chaque message
+  delay(1000);  // 5 secondes entre chaque message
 }
diff --git a/GW-custom/.DS_Store b/GW-custom/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..b89645ad3007847f94deb2f70380691b38a2856b
GIT binary patch
literal 6148
zcmZQzU|@7AO)+F(5MW?n;9!8zEL;p&0Z1N%F(jFwA|Odduo>|T84URhxeTccxlp-L
zYBU5!LtyZR04VSBGWam$GXyatG9c&QM1~ZG)THv_f~1`MBnAeCZAk?=nZ+dr2G<yw
zm|0la*g4oaxH)2jGxE!WOA<>;i=7gSqCvcn{QR6G7&|d3EHkw{UO>b-Kd&S)GcUCW
zq$D^qB{eCrC?-5JFD1X+DZex?r5LOiD#5|Y!5J?gR$XmouA^XTUaO-}ZE0knqhMle
zR$I%-A*!rz9TcCPlbe^{0SQ`0MhMNo3#DOHCj$cm9{-gE7v<&T=cR*6L~v0Uz>vw1
z$B@ntz>p83k^H}d?*5mkt~N9<(NQolx5N_yT@bJ041sQJ{>n)=3{K9^Er93+lN=0a
ze$UN!ae>A?$KLqOQxD%h=7`O#-24=x)D>h9wi7Krzz!QFXcPj_Jj20FBlAa%9Swoe
z5E!~404g68pf#fdlx~2~ASnh$1_p2!fRTZL1?EdgKY#%w2hs|nL0UmHNGk&)hy^wS
ztd)Tgs+AGk4FTx`bxA-pSUUqF16Vr)BLi4F1FV{3glK1AgxbsqYRG`hg=lABglK1A
zglLC3Z<HPlfzc3vh5$2!768@%t_%#g`u`ABqvU7^jE2Cl3;{+KmtYqsQ00lkd!V`&
zRG%h5<w3PSs5)i@)zc7tASGZ~Cdh!I1egPn18D_S`{1gWkpWVZk2VBgAv8*lh5-FT
F004Jsu^j*a

literal 0
HcmV?d00001

diff --git a/GW-custom/PingPong/.DS_Store b/GW-custom/PingPong/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..9979d8b0454d3736f0b32db838e44ebf21bc0481
GIT binary patch
literal 6148
zcmZQzU|@7AO)+F(5MW?n;9!8z4DAe90Z1N%F(jFwA}k>DKxX8m8wMxm=N3T4iJ?Gx
zSr`HsG8yt1(y{1=%jM>~xFqG|CxIL+o-2Lx@a<!c3=9lN@+o-b3o=M{8!_%5RWlj_
zqaiRF0;3@?8UjNt1Q;O>=HQ0VqvU7^jE2By2*5)CR6Zy`+V%_%P`Uv^gQOT385qD_
z07g(V9IA^E)DM8D0ci!P0ci!%Agv6HAQo62td)V00n`IvU|<AyLqIgBO9G<7+8G$Z
zHiP(J?F@`yn;94wA=()jA=()jp*<8vh;{}>h;{}>u<cOCjZ&i_Fd72z5MYL|1VHt_
zD+2?r{y#+3C^;GeqaiRXLx7RRCD_FYTq$GsAE>Sc)u#za(u|-w8KMUy4XW0`RWTD}
kKv4pwl#zh}q!lC&u8J8M7{E38XhQ%NLZkF(2+%(S0FcfoqyPW_

literal 0
HcmV?d00001

diff --git a/GW-custom/PingPong/Ping/main.py b/GW-custom/PingPong/Ping/main.py
new file mode 100644
index 0000000..d9f29c1
--- /dev/null
+++ b/GW-custom/PingPong/Ping/main.py
@@ -0,0 +1,41 @@
+# main.py -- put your code here!
+from network import LoRa
+import socket
+import time
+
+# Please pick the region that matches where you are using the device
+
+lora = LoRa(mode=LoRa.LORA, region=LoRa.EU868, adr=False)
+print('Coding rate {}'.format(lora.coding_rate()))
+
+#lora.sf(12)
+print('SF {}'.format(lora.sf()))
+
+s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
+
+s.setblocking(False)
+
+# Code pour le Pong ; réception puis émission
+#i = 0
+#while True:
+ #   if s.recv(64) == b'Ping':
+ #       print('je recois Ping du Node A')
+ #       print(lora.stats())
+  #      #print(lora.coding_rate())
+  #      s.send('Pong')
+  #      print('Pong {}'.format(i))
+  #      i = i+1
+  #  time.sleep(5)
+
+# Code pour le Ping ; uniquement émission
+msg = 'Ping'
+#msg = 'Ping hello i m devui' + (ubinascii.hexlify(lora.mac()).decode('ascii'))
+#print(msg)
+i = 0
+while True:
+    s.send(msg)
+    print('Ping {}'.format(i))
+    print(lora.stats())
+    i= i+1
+    time.sleep(5)
+
diff --git a/GW-custom/PingPong/Ping/pymakr.conf b/GW-custom/PingPong/Ping/pymakr.conf
new file mode 100644
index 0000000..8401178
--- /dev/null
+++ b/GW-custom/PingPong/Ping/pymakr.conf
@@ -0,0 +1,10 @@
+{
+  "py_ignore": [
+    ".vscode",
+    ".gitignore",
+    ".git",
+    "env",
+    "venv"
+  ],
+  "name": "Ping"
+}
\ No newline at end of file
-- 
GitLab