Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
049d6bab
Commit
049d6bab
authored
Feb 14, 2022
by
Eric Duminil
Browse files
Updated decode lorawan
parent
067cca9b
Pipeline
#5820
passed with stage
in 2 minutes and 39 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/ampel-firmware.ino
View file @
049d6bab
...
...
@@ -98,7 +98,7 @@ void setup() {
}
#if defined(ESP32)
if
(
config
::
lorawan_active
())
{
if
(
config
::
is_
lorawan_active
())
{
lorawan
::
initialize
();
}
#endif
...
...
@@ -109,7 +109,7 @@ void setup() {
*****************************************************************/
void
loop
()
{
#if defined(ESP32)
if
(
config
::
lorawan_active
())
{
if
(
config
::
is_
lorawan_active
())
{
//LMIC Library seems to be very sensitive to timing issues, so run it first.
lorawan
::
process
();
...
...
@@ -140,7 +140,7 @@ void loop() {
}
#if defined(ESP32)
if
(
config
::
lorawan_active
())
{
if
(
config
::
is_
lorawan_active
())
{
lorawan
::
preparePayloadIfTimeHasCome
(
sensor
::
co2
,
sensor
::
temperature
,
sensor
::
humidity
);
}
#endif
...
...
ampel-firmware/lorawan.cpp
View file @
049d6bab
...
...
@@ -206,14 +206,19 @@ namespace lorawan {
// Prepare upstream data transmission at the next possible time.
LMIC_setTxData2
(
1
,
buff
,
sizeof
(
buff
),
0
);
//NOTE: To decode in TheThingsNetwork:
//function Decoder(bytes, port) {
// return {
// co2: bytes[0] * 20,
// temp: bytes[1] / 5.0 - 10,
// rh: bytes[2] / 2.0
// };
//}
// function decodeUplink(input) {
// return {
// data: {
// co2: input.bytes[0] * 20,
// temp: input.bytes[1] / 5.0 - 10,
// rh: input.bytes[2] / 2.0
// },
// warnings: [],
// errors: []
// };
// }
}
}
...
...
ampel-firmware/web_config.cpp
View file @
049d6bab
...
...
@@ -348,7 +348,7 @@ namespace config {
// LORAWAN
#if defined(ESP32)
bool
lorawan_active
()
{
bool
is_
lorawan_active
()
{
return
web_config
::
loraParams
.
isActive
();
}
#endif
...
...
ampel-firmware/web_config.h
View file @
049d6bab
...
...
@@ -53,7 +53,7 @@ namespace config {
// LORAWAN
#if defined(ESP32)
bool
lorawan_active
();
// also defined for ESP8266, and set to false
bool
is_
lorawan_active
();
// also defined for ESP8266, and set to false
#endif
// Transmission rate
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment