Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sensor System
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Institut für Informatik
QE Research Group
FORTE
Sensor System
Commits
7faa9539
Verified
Commit
7faa9539
authored
1 year ago
by
Zoe Michaela Dietmar Pfister
Browse files
Options
Downloads
Patches
Plain Diff
move INA219 readout in client_central_mast to be the first reading.
parent
b16f5d50
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!43
don't fail if there is no rtc at host, log ESPNow.cpp time response for debugging.
,
!41
Config to definitions
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/client_central_mast/src/main.cpp
+13
-14
13 additions, 14 deletions
client/client_central_mast/src/main.cpp
with
13 additions
and
14 deletions
client/client_central_mast/src/main.cpp
+
13
−
14
View file @
7faa9539
...
...
@@ -11,8 +11,8 @@
static
const
char
*
TAG
=
"MAIN"
;
#def
in
e
TIME_TO_SLEEP
1
/* Time ESP32 will go to sleep (in seconds) */
//
#define DEBUG
constexpr
in
t
TIME_TO_SLEEP
=
1
;
/* Time ESP32 will go to sleep (in seconds) */
#define DEBUG
// #define POWER_MEASUREMENT_EXTRA
TEROS11
teros11_0
{
0
,
SDI12_DATA_PIN
};
...
...
@@ -25,7 +25,7 @@ INA219 ina219{};
RS485
rs485
{};
void
readout
();
void
readout
(
std
::
list
<
Message
>
ina219Messages
);
void
setup
()
{
Serial
.
begin
(
115200
);
...
...
@@ -70,15 +70,17 @@ void setup() {
RS485
::
disablePower
();
ESP_LOGD
(
TAG
,
"Setting up INA219"
);
ina219
.
setup
();
ESP_LOGD
(
TAG
,
"Reading INA219"
);
auto
ina219_messages
=
ina219
.
buildMessages
();
ESP_LOGD
(
TAG
,
"Enabling power to ESPCam"
);
ESPCamUtilities
::
enableESPCam
();
delay
(
15000
);
ESP_LOGD
(
TAG
,
"Disabling power to ESPCam"
);
ESPCamUtilities
::
disableESPCam
();
ESP_LOGD
(
TAG
,
"Setting up INA219"
);
ina219
.
setup
();
ESP_LOGD
(
TAG
,
"Setting up RS485"
);
rs485
.
setup
();
...
...
@@ -91,7 +93,7 @@ void setup() {
teros11_1
.
setup
();
teros11_2
.
setup
();
readout
();
readout
(
ina219_messages
);
ESP_LOGD
(
TAG
,
"Tearing Down RS485"
);
rs485
.
teardown
();
...
...
@@ -126,9 +128,10 @@ void setup() {
}
DeepSleep
::
deepSleepSeconds
(
1
);
#endif
DeepSleep
::
deepSleepSeconds
(
100000
-
(
millis
()
/
1000
));
// DeepSleep::deepSleepSeconds(100000 - (millis() / 1000));
DeepSleep
::
deepSleepSeconds
(
TIME_TO_SLEEP
);
}
void
readout
()
{
void
readout
(
std
::
list
<
Message
>
ina219_messages
)
{
ESP_LOGD
(
TAG
,
"Reading Teros11"
);
auto
teros11_0_messages
=
teros11_0
.
buildMessages
();
...
...
@@ -143,10 +146,6 @@ void readout() {
auto
rs485_messages
=
rs485
.
buildMessages
();
RS485
::
disablePower
();
// TODO: READ INA VALUE BEFORE EVERYTHING ELSE (BEFORE CAM)
ESP_LOGD
(
TAG
,
"Reading INA219"
);
auto
ina219_messages
=
ina219
.
buildMessages
();
std
::
list
<
Message
>
messages
;
messages
.
insert
(
messages
.
end
(),
rs485_messages
.
begin
(),
rs485_messages
.
end
());
messages
.
insert
(
messages
.
end
(),
teros11_0_messages
.
begin
(),
teros11_0_messages
.
end
());
...
...
@@ -162,7 +161,7 @@ void readout() {
std
::
copy
(
messages
.
begin
(),
messages
.
end
(),
messages_array
.
begin
());
#ifdef DEBUG
for
(
auto
&
message
:
messages_array
)
{
for
(
auto
const
&
message
:
messages_array
)
{
ESP_LOGD
(
TAG
,
"Message: %s"
,
message
.
getMessageAsMinifiedJsonString
().
c_str
());
}
#endif
...
...
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