Skip to content

Commit

Permalink
value page shows very high time value between reading and sending
Browse files Browse the repository at this point in the history
  • Loading branch information
ricki-z committed Aug 8, 2017
1 parent 92da8bb commit 2af4917
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
24 changes: 14 additions & 10 deletions airrohr-firmware/airrohr-firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2420,6 +2420,8 @@ void loop() {
starttime_SDS = act_milli;
}

server.handleClient();

if (send_now) {
if (dht_read) {
debug_out(F("Call sensorDHT"), DEBUG_MAX_INFO, 1);
Expand Down Expand Up @@ -2640,15 +2642,8 @@ void loop() {
if (! send_failed) { sending_time = (4 * sending_time + sum_send_time) / 5; }
debug_out(F("Time for sending data: "), DEBUG_MIN_INFO, 0);
debug_out(String(sending_time), DEBUG_MIN_INFO, 1);
// Resetting for next sampling
last_data_string = data;
lowpulseoccupancyP1 = 0;
lowpulseoccupancyP2 = 0;
sample_count = 0;
last_micro = 0;
min_micro = 1000000000;
max_micro = 0;
starttime = millis(); // store the start time


if (WiFi.status() != WL_CONNECTED) { // reconnect if connection lost
int retry_count = 0;
debug_out(F("Connection lost, reconnecting "), DEBUG_MIN_INFO, 0);
Expand All @@ -2660,9 +2655,18 @@ void loop() {
}
debug_out("", DEBUG_MIN_INFO, 1);
}

// Resetting for next sampling
last_data_string = data;
lowpulseoccupancyP1 = 0;
lowpulseoccupancyP2 = 0;
sample_count = 0;
last_micro = 0;
min_micro = 1000000000;
max_micro = 0;
starttime = millis(); // store the start time
first_cycle = false;
}
if (config_needs_write) { writeConfig(); create_basic_auth_strings(); }
server.handleClient();
yield();
}
3 changes: 3 additions & 0 deletions perl-scripts/test_pms1003.pl
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#! /usr/bin/perl

# decoding data from Plantronics PMS 1003, PMS 7003

use strict;

my $data_file = shift or die "Usage: $0 <device path>\n";
Expand Down

0 comments on commit 2af4917

Please sign in to comment.