Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit c4948da

Browse files
authored
Merge pull request #441 from pycom/release_rc7_again
Release rc7 again
2 parents e264b4c + 325f89c commit c4948da

19 files changed

+922
-318
lines changed

esp32/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ifeq ($(wildcard boards/$(BOARD)/.),)
1414
$(error Invalid BOARD specified)
1515
endif
1616

17-
IDF_VERSION=3.3.1
17+
IDF_HASH=d072c55
1818

1919
TARGET ?= boot_app
2020

esp32/application.mk

+2-1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ APP_UTIL_SRC_C = $(addprefix util/,\
186186
timeutils.c \
187187
esp32chipinfo.c \
188188
pycom_general_util.c \
189+
str_utils.c \
189190
)
190191

191192
APP_FATFS_SRC_C = $(addprefix fatfs/src/,\
@@ -819,7 +820,7 @@ $(OBJ): | $(GEN_PINS_HDR)
819820

820821
# Check Dependencies (IDF version, Frozen code and IDF LIBS)
821822
CHECK_DEP:
822-
$(Q) bash tools/idfVerCheck.sh $(IDF_PATH) "$(IDF_VERSION)"
823+
$(Q) bash tools/idfVerCheck.sh $(IDF_PATH) "$(IDF_HASH)"
823824
$(Q) bash tools/mpy-build-check.sh $(BOARD) $(BTYPE) $(VARIANT)
824825
$(Q) $(PYTHON) check_secure_boot.py --SECURE $(SECURE)
825826
ifeq ($(COPY_IDF_LIB), 1)

esp32/frozen/Pybytes/_OTA.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,24 @@ def update_device_network_config(self, fcota, config):
5757
def get_current_version(self):
5858
return os.uname().release
5959

60-
def get_update_manifest(self):
60+
def get_update_manifest(self, fwtype=None, token=None):
6161
current_version = self.get_current_version()
6262
sysname = os.uname().sysname
6363
wmac = hexlify(machine.unique_id()).decode('ascii')
64-
request_template = "manifest.json?current_ver={}&sysname={}&wmac={}&ota_slot={}"
65-
req = request_template.format(current_version, sysname, wmac, hex(pycom.ota_slot()))
64+
if fwtype == 'pymesh':
65+
request_template = "manifest.json?current_ver={}&sysname={}&token={}&ota_slot={}&wmac={}&fwtype={}"
66+
req = request_template.format(current_version, sysname, token, hex(pycom.ota_slot()), wmac.upper(), fwtype)
67+
else:
68+
request_template = "manifest.json?current_ver={}&sysname={}&wmac={}&ota_slot={}"
69+
req = request_template.format(current_version, sysname, wmac, hex(pycom.ota_slot()))
6670
manifest_data = self.get_data(req).decode()
6771
manifest = ujson.loads(manifest_data)
6872
gc.collect()
6973
return manifest
7074

71-
def update(self, customManifest=None):
75+
def update(self, customManifest=None, fwtype=None, token=None):
7276
try:
73-
manifest = self.get_update_manifest() if not customManifest else customManifest
77+
manifest = self.get_update_manifest(fwtype, token) if not customManifest else customManifest
7478
except Exception as e:
7579
print('Error reading the manifest, aborting: {}'.format(e))
7680
return 0
@@ -240,7 +244,6 @@ def get_data(self, req, dest_path=None, hash=False, firmware=False):
240244
fp = open(dest_path, 'wb')
241245

242246
if firmware:
243-
print('start')
244247
pycom.ota_start()
245248

246249
h = uhashlib.sha1()

esp32/frozen/Pybytes/_coap.py

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
'''
2+
Copyright (c) 2020, Pycom Limited.
3+
This software is licensed under the GNU GPL version 3 or any
4+
later version, with permitted additional terms. For more information
5+
see the Pycom Licence v1.0 document supplied with this file, or
6+
available at https://www.pycom.io/opensource/licensing
7+
'''
8+
9+
from network import WLAN
10+
from network import Coap
11+
# import uselect
12+
# import _thread
13+
# import machine
14+
15+
16+
class COAPClient():
17+
def __init__(self, target_server, port):
18+
self.__coap_server = target_server
19+
self.__coap_server_port = port
20+
21+
wlan = WLAN(mode=WLAN.STA)
22+
self.__device_ip = wlan.ifconfig()[0]
23+
24+
Coap.init(str(wlan.ifconfig()[0]), service_discovery=False)
25+
26+
def send_coap_message(self, message, method, uri_path, token, include_options=True):
27+
message_id = Coap.send_request(
28+
self.__coap_server,
29+
method,
30+
uri_port=int(self.__coap_server_port),
31+
uri_path=uri_path,
32+
payload=message,
33+
token=token,
34+
include_options=include_options
35+
)
36+
return message_id
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
'''
2+
Copyright (c) 2020, Pycom Limited.
3+
This software is licensed under the GNU GPL version 3 or any
4+
later version, with permitted additional terms. For more information
5+
see the Pycom Licence v1.0 document supplied with this file, or
6+
available at https://www.pycom.io/opensource/licensing
7+
'''
8+
9+
10+
class PeriodicalPin:
11+
12+
TYPE_DIGITAL = 0
13+
TYPE_ANALOG = 1
14+
TYPE_VIRTUAL = 2
15+
16+
def __init__(self, persistent, pin_number, message_type, message, pin_type):
17+
self.pin_number = pin_number
18+
self.message_type = message_type
19+
self.message = message
20+
self.pin_type = pin_type

0 commit comments

Comments
 (0)