Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Resources
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DeepMay
Resources
Commits
c2f8ae7a
Commit
c2f8ae7a
authored
Jul 31, 2022
by
Kirsa
Browse files
Options
Downloads
Patches
Plain Diff
Added LoRa
parent
a9fbf116
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/lora_example.py
+15
-0
15 additions, 0 deletions
examples/lora_example.py
examples/lora_settings.py
+37
-0
37 additions, 0 deletions
examples/lora_settings.py
libraries/sx127x.py
+1
-1
1 addition, 1 deletion
libraries/sx127x.py
with
53 additions
and
1 deletion
examples/lora_example.py
0 → 100644
+
15
−
0
View file @
c2f8ae7a
import
sys
sys
.
path
.
insert
(
0
,
'
libraries
'
)
from
libraries.sx127x
import
SX127x
import
machine
from
time
import
sleep
import
sx127x
from
lora_settings
import
lora1
counter
=
0
while
True
:
payload
=
'
Hello ({0})
'
.
format
(
counter
)
print
(
'
TX: {}
'
.
format
(
payload
))
lora1
.
println
(
payload
)
counter
+=
1
sleep
(
5
)
This diff is collapsed.
Click to expand it.
examples/lora_settings.py
0 → 100644
+
37
−
0
View file @
c2f8ae7a
from
machine
import
Pin
,
SPI
from
sx127x
import
SX127x
lora_default
=
{
'
frequency
'
:
418500000
,
'
frequency_offset
'
:
0
,
'
tx_power_level
'
:
14
,
'
signal_bandwidth
'
:
125e3
,
'
spreading_factor
'
:
9
,
'
coding_rate
'
:
5
,
'
preamble_length
'
:
8
,
'
implicitHeader
'
:
False
,
'
sync_word
'
:
0x33
,
'
enable_CRC
'
:
True
,
'
invert_IQ
'
:
False
,
'
debug
'
:
False
,
}
lora_pins
=
{
'
dio_0
'
:
26
,
'
cs
'
:
18
,
'
reset
'
:
23
,
'
sck
'
:
5
,
'
miso
'
:
19
,
'
mosi
'
:
27
,
}
lora_spi
=
SPI
(
baudrate
=
10000000
,
polarity
=
0
,
phase
=
0
,
bits
=
8
,
firstbit
=
SPI
.
MSB
,
sck
=
Pin
(
lora_pins
[
'
sck
'
],
Pin
.
OUT
,
Pin
.
PULL_DOWN
),
mosi
=
Pin
(
lora_pins
[
'
mosi
'
],
Pin
.
OUT
,
Pin
.
PULL_UP
),
miso
=
Pin
(
lora_pins
[
'
miso
'
],
Pin
.
IN
,
Pin
.
PULL_UP
),
)
lora1
=
SX127x
(
lora_spi
,
pins
=
lora_pins
,
parameters
=
lora_default
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
libraries/sx127x.py
+
1
−
1
View file @
c2f8ae7a
...
@@ -98,7 +98,7 @@ class SX127x:
...
@@ -98,7 +98,7 @@ class SX127x:
self
.
pins
=
pins
self
.
pins
=
pins
self
.
parameters
=
parameters
self
.
parameters
=
parameters
self
.
pin_ss
=
Pin
(
self
.
pins
[
"
s
s
"
],
Pin
.
OUT
)
self
.
pin_ss
=
Pin
(
self
.
pins
[
"
c
s
"
],
Pin
.
OUT
)
self
.
lock
=
False
self
.
lock
=
False
self
.
implicit_header_mode
=
None
self
.
implicit_header_mode
=
None
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment