diff --git a/data/tracker_config.json b/data/tracker_config.json index d400b5a..f2f9933 100644 --- a/data/tracker_config.json +++ b/data/tracker_config.json @@ -5,7 +5,7 @@ "symbol": "j", "comment": "", "smart_beacon": { - "active": false, + "active": true, "slowRate": 120, "slowSpeed": 3, "fastRate": 60, diff --git a/src/LoRa_APRS_Tracker.cpp b/src/LoRa_APRS_Tracker.cpp index 56a7a0f..0f32ac3 100644 --- a/src/LoRa_APRS_Tracker.cpp +++ b/src/LoRa_APRS_Tracker.cpp @@ -92,6 +92,8 @@ void setup() { } void loop() { + currentBeacon = &Config.beacons[myBeaconsIndex]; + powerManagement.batteryManager(); userButton.tick(); utils::checkDisplayEcoMode(); @@ -100,23 +102,11 @@ void loop() { bool gps_time_update = gps.time.isUpdated(); bool gps_loc_update = gps.location.isUpdated(); GPS_Utils::setDateFromData(); - - currentBeacon = &Config.beacons[myBeaconsIndex]; - MSG_Utils::checkReceivedMessage(LoRa_Utils::receivePacket()); STATION_Utils::checkListenedTrackersByTimeAndDelete(); int currentSpeed = (int)gps.speed.kmph(); - /*if (gps_loc_update != gps_loc_update_valid) { - gps_loc_update_valid = gps_loc_update; - if (gps_loc_update) { - logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Loop", "GPS fix state went to VALID"); - } else { - logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Loop", "GPS fix state went to INVALID"); - } - }*/ - lastTx = millis() - lastTxTime; if (!send_update && gps_loc_update && currentBeacon->smartBeaconState) { GPS_Utils::calculateDistanceTraveled();