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

v1.20.0.rc8 #276

Merged
merged 58 commits into from
Mar 6, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
0372114
esp32/micropython: correction to keyboard interrupts exposure
Dec 13, 2018
9df2333
Update pycom_config.h
Xykon Dec 17, 2018
adeebf1
esp32: Fixes in order to get the US915 certification passing.
Jan 3, 2019
e3ca985
esp32/frozen: updated MQTTMsgHandler.py
Jan 7, 2019
036a6d1
es32/lib: updated IDF libs
Jan 7, 2019
4a859e2
esp32/modlte: Enabled suspention of Mesh task in modem upgrade task
Jan 7, 2019
38428ff
mods/machspi.c: Fix the bug in pybspi_transfer() (#9)
husigeza Jan 7, 2019
afcb3c4
Merged changes from v1.20.0 release-candidate
Jan 7, 2019
6144e6d
Merge branch 'master' of https://github.com/pycom/Firmware-Development
Jan 7, 2019
258876e
esp32/modusocket:Added mpy API to get/se/clear DNS Servers Ipv4
Jan 7, 2019
b3e3a8c
Update modusocket.c
Xykon Jan 7, 2019
12dcbdb
esp32/modnetwork: fixed wrong nic selection in case of AF_INET
Jan 11, 2019
dd002a2
esp32/modnetwork.c: fix a linking issue for WIPY, LOPY, SIPY
husigeza Jan 13, 2019
1b5eba3
esp32/modlte: Added flag for legacy attachment method
Jan 14, 2019
9e091a5
esp32/modlte: updated
Xykon Jan 14, 2019
d586893
Merge branch 'attach-legacy'
Jan 14, 2019
a541954
Update sqnsupgrade (#11)
Xykon Jan 15, 2019
215fcd2
esp32/sdkconfig.h: synced with IDF v3.1
Jan 16, 2019
d8769fd
esp32: Removed CRTL-D function in PyBytes Firmware + minor bug fix
Jan 16, 2019
0650a29
esp32: Minor bug fix for Secure Boot
Jan 17, 2019
c887d32
esp32/lteppp: added suspen/resume functinality to lteppp
Jan 14, 2019
d9085a4
esp32/lteppp: improving lteppp suspend/resume mechanism
Jan 15, 2019
81573b3
esp32/lteppp: updated PPP Suspend mechanism
Jan 16, 2019
42f4108
Update to LTE module (#12)
Jan 18, 2019
ff3b397
esp32: updated version
Jan 18, 2019
bda5261
esp32: On Boot wifi AP defaults now to DEFAULT wifi ssid and Password
Jan 18, 2019
a7a2e9e
esp32: help- Removed CRTL-D from PYBYTES build + minor fixes
Jan 18, 2019
c16daf9
esp32: Updated Pypytes scripts
Jan 18, 2019
0b6307f
Merge of Public repo [release-candidate] Head.
Jan 19, 2019
87f2d8b
esp32/ltepp: bug fix for lteppp suspend
Jan 19, 2019
a6ebe1e
Merge HEAD of release-candidate 1.20.0
Jan 21, 2019
b886f41
IDF v3.1 update
Jan 22, 2019
622a235
Merge remote-tracking branch 'public/release-candidate'
Jan 23, 2019
f2a33ba
Fix linking Issue
Jan 23, 2019
a83e360
Esp32/frozen/MQTTlib: Gracefully handle EAGAIN return of Socket.write
Jan 28, 2019
7ce6f7e
esp32/mpthreadport.c: fix an issue in cleaning up user threads during…
husigeza Jan 30, 2019
733cf7e
esp32/mphal: Fix issue causing Device crash when safe booting (CTRL-F…
Jan 31, 2019
1eb354a
esp32/mods/modusocket.c: adding do_handshake for non-blocking sockets…
husigeza Jan 31, 2019
98000bb
build config: make openthread over lora a build-time configuration op…
martijnthe Feb 1, 2019
ad55267
esp32/modlte: Added factory modem reset option , method to check UE c…
Feb 8, 2019
e078fcc
Pymesh feature added from Pygo to Lopy (#16)
Feb 8, 2019
2b28d49
esp32/make: Fix Makefile bug where SIPY FIPY and LOPY4 excluded secur…
Feb 8, 2019
52ece9c
Updated Pybytes scripts + updated pycom version
Feb 8, 2019
a3a8dec
esp32/modlte: minor fix
Feb 8, 2019
3264aaa
Squashed commit of the following:
Feb 15, 2019
caa3669
esp32/modbt: Add API to Enable/Disable bt modem Sleep
Feb 18, 2019
dc4bc94
esp32/modbt: included an init param to enable/disable modem sleep
Feb 18, 2019
a004d14
v1.20.0.rc7.1
Feb 19, 2019
7837d32
esp32/modwlan: Fix Wifi connection resuming after more than 1 machin…
Feb 20, 2019
1aeeda5
Merge remote-tracking branch 'public/release-candidate'
Feb 22, 2019
192d48e
esp32/Jenkins: Disable OpenThread for FiPy-Pybytes Build
Feb 25, 2019
82cd397
Merge branch 'release-candidate' of https://github.com/pycom/pycom-mi…
Mar 1, 2019
916bb4d
Merge branch 'master' of https://github.com/pycom/Firmware-Development
Mar 1, 2019
2cdc603
esp32/machuart: Fix Issue #256
Mar 1, 2019
52da273
Merge pull request #21 from iwahdan88/master
Mar 1, 2019
937d4a4
Pymesh Border Router (#22)
Mar 5, 2019
3ce7552
esp32/sqnsupgrade: Updated to V1.2.3
Mar 6, 2019
8dc29d1
v1.20.0.rc8
Mar 6, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
esp32: Updated Pypytes scripts
  • Loading branch information
iwahdan88 committed Jan 18, 2019
commit c16daf96ae9efb6c4c2ff6653f8211e39a37d45c
26 changes: 15 additions & 11 deletions esp32/frozen/Pybytes/_flash_control_OTA.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
import os
try:
from pybytes_debug import print_debug
except:
from _pybytes_debug import print_debug

class FCOTA:
def __init__(self):
pass

def update_file_content(self, path, newContent):
print('Updating file [{}]'.format(path))
print_debug(2, 'Updating file [{}]'.format(path))

if '.' in path:
f = open(path, 'w')
f.write(newContent)
f.close()
print('File updated')
print_debug(2, 'File updated')
return True
else:
print('Cannot write into a folder')
print_debug(2, 'Cannot write into a folder')

return False

def delete_file(self, path):
print('FCOTA deleting file [{}]'.format(path))
print_debug(2, 'FCOTA deleting file [{}]'.format(path))
try:
if ('.' in path):
os.remove(path)
Expand All @@ -42,10 +46,10 @@ def delete_file(self, path):
os.rmdir(elem)
maxDepth -= 1
else:
print('targetedFiles empty, no file to delete')
print_debug(2, 'targetedFiles empty, no file to delete')
return True
except Exception as ex:
print('FCOTA file deletion failed: {}'.format(ex))
print_debug(2, 'FCOTA file deletion failed: {}'.format(ex))
return False

def convert_bytes(self, num):
Expand All @@ -55,15 +59,15 @@ def convert_bytes(self, num):
num /= 1024.0

def get_file_size(self, path):
print('FCOTA getting file infos [{}]'.format(path))
print_debug(2, 'FCOTA getting file infos [{}]'.format(path))
if '.' in path:
fileInfo = os.stat(path)
print (fileInfo)
print_debug(2, 'printing fileInfo tupple: ' + str(fileInfo))
return self.convert_bytes(fileInfo[6])
return 'Unknown'

def get_file_content(self, path):
print('FCOTA reading file [{}]'.format(path))
print_debug(2, 'FCOTA reading file [{}]'.format(path))

if '.' in path:
f = open(path, 'r')
Expand All @@ -72,8 +76,8 @@ def get_file_content(self, path):
else:
content = 'folder: {}'.format(path)

# print('encoding content')
# print(hexlify(content))
# print_debug(2, 'encoding content')
# print_debug(2, hexlify(content))
# content = hexlify(content)

return content
Expand Down
8 changes: 4 additions & 4 deletions esp32/frozen/Pybytes/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
# SEND VIRTUAL VALUE
# You can currently send Strings, Int32, Float32 and Tuples to pybytes using this method.
# Soon you will be able to send Coordinates, Longs, Unsigned numerical types, and more.
# pybytes.send_virtual_pin_value(False, pin, value)
# pybytes.send_signal(pin, value)

# SEND SENSOR DATA THROUGH VIRTUAL PINS
# # If you use a Pysense, some libraries are necessary to access its sensors
Expand All @@ -90,9 +90,9 @@
# # Define your thread's behaviour, here it's a loop sending sensors data every 10 seconds
# def send_env_data():
# while (pybytes):
# pybytes.send_virtual_pin_value(False, 1, si.humidity())
# pybytes.send_virtual_pin_value(False, 2, si.temperature())
# pybytes.send_virtual_pin_value(False, 3, ltr.light());
# pybytes.send_signal(1, si.humidity())
# pybytes.send_signal(2, si.temperature())
# pybytes.send_signal(3, ltr.light());
# sleep(10)
#
# # Start your thread
Expand Down
38 changes: 20 additions & 18 deletions esp32/frozen/Pybytes/_pybytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class __PERIODICAL_PIN:
TYPE_VIRTUAL = 2

def __init__(self, persistent, pin_number, message_type, message, pin_type):
self.persistent = persistent
self.pin_number = pin_number
self.message_type = message_type
self.message = message
Expand Down Expand Up @@ -72,13 +71,13 @@ def connect_lora_otta(self, timeout=15, nanogateway=False):
return self.__pybytes_connection.connect_lora_otta(timeout, nanogateway)

def connect_sigfox(self):
self.__pybytes_connection.connect_sigfox()
return self.__pybytes_connection.connect_sigfox()

def disconnect(self):
self.__pybytes_connection.disconnect()

def send_custom_message(self, persistent, message_type, message):
self.__pybytes_connection.__pybytes_protocol.send_user_message(persistent, message_type, message)
self.__pybytes_connection.__pybytes_protocol.send_user_message(message_type, message)

def set_custom_message_callback(self, callback):
self.__custom_message_callback = callback
Expand All @@ -93,24 +92,33 @@ def send_scan_info_message(self):
self.__pybytes_connection.__pybytes_protocol.send_scan_info_message(None)

def send_digital_pin_value(self, persistent, pin_number, pull_mode):
self.__pybytes_connection.__pybytes_protocol.send_pybytes_digital_value(persistent, pin_number, pull_mode)
self.__pybytes_connection.__pybytes_protocol.send_pybytes_digital_value(pin_number, pull_mode)

def send_analog_pin_value(self, persistent, pin):
self.__pybytes_connection.__pybytes_protocol.send_pybytes_analog_value(persistent, pin)
self.__pybytes_connection.__pybytes_protocol.send_pybytes_analog_value(pin)

def send_signal(self, pin, value):
self.__pybytes_connection.__pybytes_protocol.send_pybytes_custom_method_values(pin, [value])

def send_virtual_pin_value(self, persistent, pin, value):
self.__pybytes_connection.__pybytes_protocol.send_pybytes_custom_method_values(persistent, pin, [value])
print("This function is deprecated and will be removed in the future. Use send_signal(signalNumber, value)")
self.send_signal(pin, [value])

def __periodical_pin_callback(self, periodical_pin):
if (periodical_pin.pin_type == __PERIODICAL_PIN.TYPE_DIGITAL):
self.send_digital_pin_value(periodical_pin.persistent, periodical_pin.pin_number, None)
elif (periodical_pin.pin_type == __PERIODICAL_PIN.TYPE_ANALOG):
self.send_analog_pin_value(periodical_pin.persistent, periodical_pin.pin_number)

def register_periodical_digital_pin_publish(self, persistent, pin_number, pull_mode, period):
self.send_digital_pin_value(persistent, pin_number, pull_mode)
periodical_pin = __PERIODICAL_PIN(persistent, pin_number, None, None,
self.send_digital_pin_value(pin_number, pull_mode)
periodical_pin = __PERIODICAL_PIN(pin_number, None, None,
__PERIODICAL_PIN.TYPE_DIGITAL)
Timer.Alarm(self.__periodical_pin_callback, period, arg=periodical_pin, periodic=True)

def register_periodical_analog_pin_publish(self, persistent, pin_number, period):
self.send_analog_pin_value(persistent, pin_number)
periodical_pin = __PERIODICAL_PIN(persistent, pin_number, None, None,
__PERIODICAL_PIN.TYPE_ANALOG)
def register_periodical_analog_pin_publish(self, pin_number, period):
self.send_analog_pin_value(pin_number)
periodical_pin = __PERIODICAL_PIN(pin_number, None, None, __PERIODICAL_PIN.TYPE_ANALOG)
Timer.Alarm(self.__periodical_pin_callback, period, arg=periodical_pin, periodic=True)

def add_custom_method(self, method_id, method):
Expand All @@ -126,12 +134,6 @@ def send_battery_level(self, battery_level):
def send_custom_location(self, pin, x, y):
self.__pybytes_connection.__pybytes_protocol.send_custom_location(pin, x, y)

def __periodical_pin_callback(self, periodical_pin):
if (periodical_pin.pin_type == __PERIODICAL_PIN.TYPE_DIGITAL):
self.send_digital_pin_value(periodical_pin.persistent, periodical_pin.pin_number, None)
elif (periodical_pin.pin_type == __PERIODICAL_PIN.TYPE_ANALOG):
self.send_analog_pin_value(periodical_pin.persistent, periodical_pin.pin_number)

def __recv_message(self, message):
if self.__custom_message_callback is not None:
self.__custom_message_callback(message)
Expand Down
39 changes: 1 addition & 38 deletions esp32/frozen/Pybytes/_pybytes_ca.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,4 @@
PYBYTES_CA = """-----BEGIN CERTIFICATE-----
MIIGnTCCBYWgAwIBAgISA3b4lLk2NubwPvU+nkbtPlWpMA0GCSqGSIb3DQEBCwUA
MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD
ExpMZXQncyBFbmNyeXB0IEF1dGhvcml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1uPntPUgfZz7E=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/
MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
DkRTVCBSb290IENBIFgzMB4XDTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0Nlow
Expand Down Expand Up @@ -83,4 +45,5 @@
JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo
Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ
-----END CERTIFICATE-----

"""
40 changes: 21 additions & 19 deletions esp32/frozen/Pybytes/_pybytes_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,25 +275,27 @@ def connect_sigfox(self):
except:
print("This device does not support Sigfox connections")
return
sigfox_config = self.__conf.get('sigfox')
if sigfox_config is not None and sigfox_config.get('RCZ') is not None:
try:
sf_rcz = int(sigfox_config.get('RCZ',0)) - 1
if sf_rcz >= 1 and sf_rcz <= 4:
sigfox = Sigfox(mode=Sigfox.SIGFOX, rcz=sf_rcz)
self.__sigfox_socket = socket.socket(socket.AF_SIGFOX, socket.SOCK_RAW)
self.__sigfox_socket.setblocking(True)
self.__sigfox_socket.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False)
self.__pybytes_library.set_network_type(constants.__NETWORK_TYPE_SIGFOX)
self.__network_type = constants.__NETWORK_TYPE_SIGFOX
self.__connection_status = constants.__CONNECTION_STATUS_CONNECTED_SIGFOX
print("Connected using Sigfox. Only upload stream is supported")
else:
print('Invalid Sigfox RCZ specified in config!')
except Exception as e:
print('Exception in connect_sigfox: {}'.format(e))
else:
print('Invalid Sigfox RCZ specified in config!')
sigfox_config = self.__conf.get('sigfox', {})
if sigfox_config is None or sigfox_config.get('RCZ') is None:
print(constants.__SIGFOX_WARNING)
try:
sf_rcz = int(sigfox_config.get('RCZ', 1)) - 1
if sf_rcz >= 0 and sf_rcz <= 3:
sigfox = Sigfox(mode=Sigfox.SIGFOX, rcz=sf_rcz)
self.__sigfox_socket = socket.socket(socket.AF_SIGFOX, socket.SOCK_RAW)
self.__sigfox_socket.setblocking(True)
self.__sigfox_socket.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False)
self.__network_type = constants.__NETWORK_TYPE_SIGFOX
self.__connection_status = constants.__CONNECTION_STATUS_CONNECTED_SIGFOX
self.__pybytes_protocol.start_Sigfox(self)
print("Connected using Sigfox. Only upload stream is supported")
return True
else:
print('Invalid Sigfox RCZ specified in config!')
return False
except Exception as e:
print('Exception in connect_sigfox: {}'.format(e))
return False

# COMMON
def disconnect(self):
Expand Down
12 changes: 10 additions & 2 deletions esp32/frozen/Pybytes/_pybytes_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ class constants:
__NETWORK_TYPE_SIGFOX = 2
__NETWORK_TYPE_LTE = 3

__INTEGER = 0
__FLOAT = 1
__TUPLE = 2
__STRING = 3

__CONNECTION_STATUS_DISCONNECTED = 0
__CONNECTION_STATUS_CONNECTED_MQTT_WIFI = 1
__CONNECTION_STATUS_CONNECTED_MQTT_LTE = 2
Expand Down Expand Up @@ -53,7 +58,10 @@ class constants:

__WIFI_NETWORK_FORMAT = ">6sBb" # {"ssid":"%s", "mac_addr":"%s", "channel":"%s", "power":"%s"}

__USER_SYSTEM_MASK = 0x80
__PERSISTENT_MASK = 0x40
# __USER_SYSTEM_MASK = 0x80
__NETWORK_TYPE_MASK = 0x30
__TYPE_MASK = 0xF

__SIGFOX_WARNING = """WARNING! Your sigfox radio configuration (RC) is currently using the default (1)
You can set your RC with command (ex: RC 3): pybytes.set_config('sigfox', {'RCZ': 3})
See all available zone options for RC at https://support.sigfox.com/docs/radio-configuration """
Loading