mirror of
https://gitee.com/qpy-solutions/tracker-v2.git
synced 2025-05-19 02:58:25 +08:00
update: quecIot ota
This commit is contained in:
parent
f2fe7e3332
commit
f44388a9a8
@ -179,26 +179,26 @@ class QuecThing(object):
|
||||
elif event == 7:
|
||||
if errcode == 10700:
|
||||
log.info('New OTA plain.')
|
||||
self.downlink_queue(('ota_plain', data))
|
||||
self.downlink_queue(('object_model', ('ota_status', 1)))
|
||||
self.downlink_queue.put(('ota_plain', data))
|
||||
self.downlink_queue.put(('object_model', [('ota_status', 1)]))
|
||||
elif errcode == 10701:
|
||||
log.info('The module starts to download.')
|
||||
self.downlink_queue(('object_model', ('ota_status', 2)))
|
||||
self.downlink_queue.put(('object_model', [('ota_status', 2)]))
|
||||
elif errcode == 10702:
|
||||
log.info('Package download.')
|
||||
self.downlink_queue(('object_model', ('ota_status', 2)))
|
||||
self.downlink_queue.put(('object_model', [('ota_status', 2)]))
|
||||
elif errcode == 10703:
|
||||
log.info('Package download complete.')
|
||||
self.downlink_queue(('object_model', ('ota_status', 2)))
|
||||
self.downlink_queue.put(('object_model', [('ota_status', 2)]))
|
||||
elif errcode == 10704:
|
||||
log.info('Package updating.')
|
||||
self.downlink_queue(('object_model', ('ota_status', 2)))
|
||||
self.downlink_queue.put(('object_model', [('ota_status', 2)]))
|
||||
elif errcode == 10705:
|
||||
log.info('Firmware update complete.')
|
||||
self.downlink_queue(('object_model', ('ota_status', 3)))
|
||||
self.downlink_queue.put(('object_model', [('ota_status', 3)]))
|
||||
elif errcode == 10706:
|
||||
log.info('Failed to update firmware.')
|
||||
self.downlink_queue(('object_model', ('ota_status', 4)))
|
||||
self.downlink_queue.put(('object_model', [('ota_status', 4)]))
|
||||
|
||||
def dev_info_report(self):
|
||||
quecIot.devInfoReport([i for i in range(1, 13)])
|
||||
|
@ -105,7 +105,7 @@ class default_values_app(object):
|
||||
|
||||
loc_method = _loc_method.gps
|
||||
|
||||
work_mode = _work_mode.lowenergy
|
||||
work_mode = _work_mode.cycle
|
||||
|
||||
work_cycle_period = 30
|
||||
|
||||
@ -177,7 +177,7 @@ class default_values_sys(object):
|
||||
|
||||
ota_status = _ota_status.none
|
||||
|
||||
cloud = _cloud.AliYun
|
||||
cloud = _cloud.quecIot
|
||||
|
||||
cloud_init_params = {}
|
||||
|
||||
|
@ -109,9 +109,12 @@ def test_tracker():
|
||||
# log.info('[.] sleep 3')
|
||||
# utime.sleep(3)
|
||||
|
||||
log.info('[.] test tracker.loc_report()')
|
||||
loc_report_res = tracker.loc_report()
|
||||
log.info('[.] loc_report_res:', loc_report_res)
|
||||
# log.info('[.] test tracker.loc_report()')
|
||||
# loc_report_res = tracker.loc_report()
|
||||
# log.info('[.] loc_report_res:', loc_report_res)
|
||||
|
||||
log.info('[.] test tracker.remote.check_ota()()')
|
||||
tracker.remote.check_ota()
|
||||
|
||||
# log.info('[.] sleep 3')
|
||||
# utime.sleep(3)
|
||||
|
Loading…
x
Reference in New Issue
Block a user