8000 Update pybytes to 1.5.0 (#133) · pycom/pycom-micropython-sigfox@9f6e28e · GitHub
[go: up one dir, main page]

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

Commit 9f6e28e

Browse files
authored
Update pybytes to 1.5.0 (#133)
1 parent 2186b33 commit 9f6e28e

File tree

5 files changed

+27
-12
lines changed

5 files changed

+27
-12
lines changed

esp32/frozen/Pybytes/_pybytes.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -273,16 +273,13 @@ def connect(self):
273273
self.enable_terminal()
274274

275275
# CHECK PYMESH FIRMWARE VERSION
276-
try:
277-
if os.uname().pymesh:
278-
try:
279-
from pybytes_pymesh_config import PybytesPymeshConfig
280-
except:
281-
from _pybytes_pymesh_config import PybytesPymeshConfig
282-
self.__pymesh = PybytesPymeshConfig(self)
283-
self.__pymesh.pymesh_init()
284-
except Exception as e:
285-
print("Exception: {}".format(e))
276+
if hasattr(os.uname(), 'pymesh'):
277+
try:
278+
from pybytes_pymesh_config import PybytesPymeshConfig
279+
except:
280+
from _pybytes_pymesh_config import PybytesPymeshConfig
281+
self.__pymesh = PybytesPymeshConfig(self)
282+
self.__pymesh.pymesh_init()
286283
else:
287284
print('ERROR! Could not connect to Pybytes!')
288285

esp32/frozen/Pybytes/_pybytes_constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class constants:
9696
__FCOTA_COMMAND_FILE_UPDATE = 0x02
9797
__FCOTA_PING = 0x03
9898
__FCOTA_COMMAND_FILE_DELETE = 0x04
99+
__FCOTA_COMMAND_FILE_UPDATE_NO_RESET = 0x05
99100

100101
__DEVICE_TYPE_WIPY = 0x00
101102
__DEVICE_TYPE_LOPY = 0x01

esp32/frozen/Pybytes/_pybytes_protocol.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,23 @@ def __process_recv_message(self, message):
276276
else:
277277
self.send_fcota_ping("file update failed!")
278278

279+
elif (command == constants.__FCOTA_COMMAND_FILE_UPDATE_NO_RESET):
280+
bodyString = body[1:len(body)].decode()
281+
splittedBody = bodyString.split(',')
282+
if (len(splittedBody) >= 2):
283+
path = splittedBody[0]
284+
print_debug(2, path[len(path)-7:len(path)])
285+
if (path[len(path)-7:len(path)] != '.pymakr'):
286+
self.send_fcota_ping('updating file...')
287+
newContent = bodyString[len(path)+1:len(body)]
288+
if (self.__FCOTA.update_file_content(path, newContent) is True): # noqa
289+
size = self.__FCOTA.get_file_size(path)
290+
self.send_fcota_file(newContent, path, size)
291+
else:
292+
self.send_fcota_ping('file update failed!')
293+
else:
294+
self.send_fcota_ping("file update failed!")
295+
279296
elif (command == constants.__FCOTA_PING):
280297
self.send_fcota_ping('')
281298

esp32/frozen/Pybytes/_pybytes_pymesh_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def write_config(self, wmac, file='/flash/pymesh_config.json', pymeshSettings={}
150150
"ble_api": False,
151151
"ble_name_prefix": "Device-{}".format(wmac),
152152
"br_prio": 0,
153-
"br_ena": False,
153+
"br_ena": customSettings["br_ena"],
154154
"autostart": True
155155
}
156156

esp32/pycom_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define SIGFOX_VERSION_NUMBER "1.0.1"
1818

1919
#if (VARIANT == PYBYTES)
20-
#define PYBYTES_VERSION_NUMBER "1.4.0"
20+
#define PYBYTES_VERSION_NUMBER "1.5.0"
2121
#endif
2222

2323
#endif /* VERSION_H_ */

0 commit comments

Comments
 (0)
0