diff --git a/.DS_Store b/.DS_Store index 8b0c842067349a560540f07db1ea33a8e53caf03..93c7ee11b42e7cdb637f3bca07eeb89216994648 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Capteur-autonome/Projects/LoRa_Mac_TEST1/src/main.cpp b/Capteur-autonome/Projects/LoRa_Mac_TEST1/src/main.cpp index 1768d9211ab81f68bc6de33e74220509b301b64d..fafd627e8bf9e73d478968935629579a829617f1 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 Binary files /dev/null and b/GW-custom/.DS_Store differ diff --git a/GW-custom/PingPong/.DS_Store b/GW-custom/PingPong/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..9979d8b0454d3736f0b32db838e44ebf21bc0481 Binary files /dev/null and b/GW-custom/PingPong/.DS_Store differ diff --git a/GW-custom/PingPong/Ping/main.py b/GW-custom/PingPong/Ping/main.py new file mode 100644 index 0000000000000000000000000000000000000000..d9f29c10d6335c2692c6c4c4c0ba5e82daca8114 --- /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 0000000000000000000000000000000000000000..8401178c91c9f110fd87a672022036324e9d43e4 --- /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