48 lines
1.5 KiB
Python
Raw Normal View History

2022-03-24 16:01:12 +08:00
# Copyright (c) Quectel Wireless Solution, Co., Ltd.All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
2022-03-03 09:53:51 +08:00
from usr.tracker import Tracker
2022-03-23 19:42:23 +08:00
from usr.settings import settings
from usr.settings import default_values_sys
2022-03-31 13:41:08 +08:00
from usr.settings import PROJECT_NAME
from usr.settings import PROJECT_VERSION
2022-03-03 09:53:51 +08:00
from usr.logging import getLogger
log = getLogger(__name__)
2022-03-03 09:53:51 +08:00
def main():
2022-03-23 19:42:23 +08:00
log.info('PROJECT_NAME: %s' % PROJECT_NAME)
log.info('PROJECT_VERSION: %s' % PROJECT_VERSION)
current_settings = settings.get()
2022-03-24 13:30:00 +08:00
tracker = Tracker()
2022-03-23 19:42:23 +08:00
# Start Device Check
tracker.device_check()
2022-03-24 13:30:00 +08:00
2022-03-23 19:42:23 +08:00
# Start OTA Check
if current_settings['sys']['cloud'] == default_values_sys._cloud.quecIot and \
current_settings['app']['sw_ota'] is True:
tracker.remote.check_ota()
# Start PowerManage
2022-03-24 13:30:00 +08:00
# Init Low Energy Work Mode
tracker.power_manage.low_energy_init()
# Start RTC
2022-03-23 19:42:23 +08:00
tracker.power_manage.start_rtc()
2022-03-03 09:53:51 +08:00
if __name__ == '__main__':
main()