Skip to content
Snippets Groups Projects
Commit b2aa4eaf authored by CARNEIRO--GILLET Alexandre's avatar CARNEIRO--GILLET Alexandre
Browse files
parents 92aeec55 762ace36
Branches
No related tags found
No related merge requests found
No preview for this file type
......@@ -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
}
File added
File added
# 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)
{
"py_ignore": [
".vscode",
".gitignore",
".git",
"env",
"venv"
],
"name": "Ping"
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment