Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Distributed Off-Grid Monitoring - Sensor Firmware and Gateway Consumers
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
CS408 Environmental Monitoring Independent of Existing Infrastructure
Distributed Off-Grid Monitoring - Sensor Firmware and Gateway Consumers
Merge requests
!6
Update sensor config from api; CO2 Sensor; Refactor & Tidy-Up
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Update sensor config from api; CO2 Sensor; Refactor & Tidy-Up
update-sensor-config-from-api
into
DEV
Overview
0
Commits
7
Pipelines
0
Changes
1
Merged
Callum Inglis
requested to merge
update-sensor-config-from-api
into
DEV
3 years ago
Overview
0
Commits
7
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
4fb81b60
Prev
Next
Show latest version
1 file
+
4
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
4fb81b60
Typo Fixes - getSensorConfig(...)
· 4fb81b60
Callum Inglis
authored
3 years ago
RaspberryPi_Receiver/Pi_Receiver.py
+
4
−
3
Options
@@ -126,7 +126,7 @@ class Co2(object):
class
API
():
def
getSensorConfig
(
self
,
sensorUID
):
headers
=
{
'
Content-Type
'
:
'
Application/json
'
}
response
=
requests
.
post
(
API_URL
+
'
/
api/
'
+
secrets
.
API_KEY
+
'
/sensor/getConfig/
'
+
sensorUID
,
headers
=
headers
)
response
=
requests
.
post
(
API_URL
+
'
/
'
+
secrets
.
API_KEY
+
'
/sensor/getConfig/
'
+
sensorUID
,
headers
=
headers
)
if
(
response
.
status_code
!=
200
):
return
None
@@ -282,8 +282,9 @@ def ackMsg(sensorResponse):
# Retrieve up-to-date sensor config from API & Transmit back to sensor
updated_sensor_config
=
API
().
getSensorConfig
(
sensorResponse
.
sensorMetadata
.
uid
)
data
.
updateConfigPollingFrequency
(
updated_sensor_config
[
'
txAfterNReadings
'
])
data
.
updateConfigTxAfterNReadings
(
updated_sensor_config
[
'
pollingFrequency
'
])
if
updated_sensor_config
is
not
None
:
data
.
updateConfigPollingFrequency
(
updated_sensor_config
[
'
txAfterNReadings
'
])
data
.
updateConfigTxAfterNReadings
(
updated_sensor_config
[
'
pollingFrequency
'
])
if
DEBUG
>
1
:
print
(
data
.
ToJson
())
Loading