Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Capteur autonome Penn Avel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pronto 3
Capteur autonome Penn Avel
Compare revisions
a0267cceaeee568344a48a832d293b879a0723c4 to c50fc1caee5c28172fec0e321d532507b4230145
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
pronto-3/capteur-autonome-penn-avel
Select target project
No results found
c50fc1caee5c28172fec0e321d532507b4230145
Select Git revision
Branches
main
1 result
Swap
Target
pronto-3/capteur-autonome-penn-avel
Select target project
pronto-3/capteur-autonome-penn-avel
1 result
a0267cceaeee568344a48a832d293b879a0723c4
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
modifs non commit de la dernière fois
· 09312c50
CARNEIRO--GILLET Alexandre
authored
1 month ago
09312c50
Merge branch 'main' of
https://gitlab-df.imt-atlantique.fr/pronto-3/capteur-autonome-penn-avel
· c50fc1ca
CARNEIRO--GILLET Alexandre
authored
1 month ago
c50fc1ca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Autre/pygate 2/main.py
+7
-4
7 additions, 4 deletions
Autre/pygate 2/main.py
GW-custom/LoRa_homemade/main.py
+3
-20
3 additions, 20 deletions
GW-custom/LoRa_homemade/main.py
with
10 additions
and
24 deletions
Autre/pygate 2/main.py
View file @
c50fc1ca
from
network
import
WLAN
import
time
import
machine
from
machine
import
RTC
import
pycom
from
machine
import
RTC
from
network
import
WLAN
print
(
'
\n
Starting LoRaWAN concentrator
'
)
# Disable Hearbeat
...
...
@@ -27,12 +28,14 @@ machine.callback(trigger = (machine.PYGATE_START_EVT | machine.PYGATE_STOP_EVT |
print
(
'
Connecting to WiFi...
'
,
end
=
''
)
# Connect to a Wifi Network
wlan
=
WLAN
(
mode
=
WLAN
.
STA
)
wlan
.
connect
(
ssid
=
'
ObjetsConnectes
'
,
auth
=
(
WLAN
.
WPA2
,
'
Pandemie2021
'
))
wlan
.
connect
(
ssid
=
'
Redmi Note 8 (2021)
'
,
auth
=
(
WLAN
.
WPA2
,
'
lemotdepassecestca
'
))
#wlan.connect(ssid='iPhone de Charlotte', auth=(WLAN.WPA2, 'azilisenoraalan'))
while
not
wlan
.
isconnected
():
timout
=
10
# seconds
while
not
wlan
.
isconnected
()
and
timout
>
0
:
print
(
'
.
'
,
end
=
''
)
time
.
sleep
(
1
)
timout
-=
1
print
(
"
OK
"
)
# Sync time via NTP server for GW timestamps on Events
...
...
This diff is collapsed.
Click to expand it.
GW-custom/LoRa_homemade/main.py
View file @
c50fc1ca
...
...
@@ -49,7 +49,7 @@ def blink_led(times, interval):
led
.
value
(
0
)
# Eteindre la LED
time
.
sleep
(
interval
)
# Attendre un certain temps
def
configure_lora
(
frequency
,
sf
,
bw
,
TXPR
,
RXPR
,
TX_power
):
def
configure_lora
():
send_at_command
(
""
)
send_at_command
(
"
+MODE=TEST
"
)
...
...
@@ -90,7 +90,7 @@ def send_to_sensor_community_sht30(temp, humid):
url
=
"
https://api.sensor.community/v1/push-sensor-data/
"
headers
=
{
"
Content-Type
"
:
"
application/json
"
,
"
X-Pin
"
:
"
7
"
,
# 7 = SHT30
"
X-Pin
"
:
"
7
"
,
# 7 = SHT30
ou DHT22
"
X-Sensor
"
:
"
esp32-900881266
"
}
data
=
{
...
...
@@ -129,23 +129,6 @@ def try_receive():
wifi_connect
()
# Connexion au Wi-Fi
wlan
=
network
.
WLAN
(
network
.
STA_IF
)
print
(
wlan
.
ifconfig
())
import
urequests
try
:
r
=
urequests
.
post
(
"
http://httpbin.org/post
"
,
json
=
{
"
test
"
:
123
})
print
(
"
Réponse HTTP:
"
,
r
.
status_code
)
print
(
r
.
text
)
r
.
close
()
except
Exception
as
e
:
print
(
"
Erreur:
"
,
e
)
uart
=
UART
(
2
,
baudrate
=
9600
,
tx
=
17
,
rx
=
16
)
...
...
@@ -154,7 +137,7 @@ led = Pin(2, Pin.OUT) # GPIO 2 pour la LED bleue intégrée
# Initialisation du module LoRa
blink_led
(
3
,
0.5
)
# Clignoter la LED 3 fois au démarrage
print
(
"
\n\n
Initialisation du module LoRa-E5...
\n
"
)
configure_lora
(
868000000
,
12
,
125
,
12
,
15
,
14
)
# Configurer le module LoRa avec les paramètres souhaités
configure_lora
()
# Configurer le module LoRa avec les paramètres souhaités
send_at_command
(
"
+TEST=RXLRPKT
"
)
# Commencer la réception des paquets LoRa
led
.
value
(
1
)
# Rallumer la LED après l'initialisation
...
...
This diff is collapsed.
Click to expand it.