8000 New Stable version 1.18.2 · pycom/pycom-micropython-sigfox@c7efa88 · 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 c7efa88

Browse files
author
iwahdan88
committed
New Stable version 1.18.2
- Fixed socke.connect Crash problem when LoRa/Sifgfox initialized before Wifi/LTE - Updates and bug fixes for LTE module - Fixed bug in spi.read()..The parameter write=.. in spi.read() was ignored. Instead always 0x55 was sent. - Updates to MQTT lib. - Added API to Get/set DNS servers. - Updated Sequans FW upgrade scripts - Enabled LCP Echo interval in IDF - Improvedd PPP session suspend/resume - Wifi AP mode on boot now is using only Default AP and SSID -> Initially the onboot wifi mode was using the ssid/pwd configured in pycom-config saved in flash which caused inconvenience for some users when switching between Pybytes FW and other Base FWs since the AP would be brought up with same ssid/pwd. This is now removed and in next releases wifi config saved in flash will be improved for more efficiency and relaiability.
1 parent d1c5ea9 commit c7efa88

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+294
-101
lines changed
-1.41 KB
Binary file not shown.

esp32/bootloader/lib/liblog.a

-140 Bytes
Binary file not shown.

esp32/bootloader/lib/libmicro-ecc.a

-52 Bytes
Binary file not shown.

esp32/bootloader/lib/libsoc.a

-592 Bytes
Binary file not shown.

esp32/bootloader/lib/libspi_flash.a

-72 Bytes
Binary file not shown.

esp32/frozen/Common/MQTTMsgHandler.py

Lines changed: 12 additions & 6 deletions
F438
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def createSocketConnection(self):
7979
self._sock = None
8080

8181
self._sock = socket.socket()
82+
self._sock.settimeout(30)
8283
if self._cafile:
8384
self._sock = ssl.wrap_socket(
8485
self._sock,
@@ -153,7 +154,11 @@ def priority_send(self, packet):
153154
return msg_sent
154155

155156
def _receive_packet(self):
156-
if not self._poll.poll(self._receive_timeout):
157+
try:
158+
if not self._poll.poll(self._receive_timeout):
159+
return False
160+
except Exception as err:
161+
print("Poll error: {0}".format(err))
157162
return False
158163

159164
# Read message type
@@ -257,14 +262,15 @@ def _io_thread_func(self):
257262
self._verify_connection_state()
258263

259264
self._out_packet_mutex.acquire()
260-
if self._out_packet_mutex.locked() and len(self._output_queue) > 0:
261-
packet=self._output_queue[0]
262-
if self._send_packet(packet):
263-
self._output_queue.pop(0)
265+
if self._ping_failures == 0:
266+
if self._out_packet_mutex.locked() and len(self._output_queue) > 0:
267+
packet=self._output_queue[0]
268+
if self._send_packet(packet):
269+
self._output_queue.pop(0)
264270
self._out_packet_mutex.release()
265271

266272
self._receive_packet()
267273
self._callShadowCallback()
268274

269275
if len(self._output_queue) >= self._draining_cutoff:
270-
time.sleep(self._draining_interval)
276+
time.sleep(self._draining_interval)

esp32/frozen/LTE/sqnsbr.py

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

esp32/frozen/LTE/sqnsupgrade.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
2-
VERSION = "1.2.1"
2+
VERSION = "1.2.2"
33

4-
# Copyright (c) 2018, Pycom Limited.
4+
# Copyright (c) 2019, Pycom Limited.
55
#
66
# This software is licensed under the GNU GPL version 3 or any
77
# later version, with permitted additional terms. For more information
@@ -188,37 +188,32 @@ def __hangup_modem(self, delay, debug):
188188
self.__serial.read()
189189
if not self.__kill_ppp_ok:
190190
self.__serial.write(b"+++")
191-
time.sleep_ms(delay)
191+
time.sleep_ms(1150)
192192
resp = self.__serial.read()
193193
if debug: print('Response (+++ #1): {}'.format(resp))
194194
self.__check_resp(resp, True)
195195
self.__serial.write(b"AT\r\n")
196-
time.sleep_ms(delay)
196+
time.sleep_ms(250)
197197
resp = self.__serial.read()
198198
if debug: print('Response (AT #1) {}'.format(resp))
199199
self.__check_resp(resp)
200200
if resp is not None:
201201
if b'OK' not in resp and not self.__kill_ppp_ok:
202202
self.__serial.write(b"AT\r\n")
203-
time.sleep_ms(delay)
203+
time.sleep_ms(250)
204204
resp = self.__serial.read()
205205
if debug: print('Response (AT #2) {}'.format(resp))
206206
self.__check_resp(resp)
207207
if resp is not None and b'OK' in resp:
208208
return True
209209
self.__serial.write(b"+++")
210-
time.sleep_ms(delay)
210+
time.sleep_ms(1150)
211211
resp = self.__serial.read()
212212
if debug: print('Response (+++ #2): {}'.format(resp))
213213
self.__check_resp(resp, True)
214214
if resp is not None and b'OK' in resp:
215-
# self.__serial.write(b"ATH\r\n")
216-
# time.sleep_ms(delay)
217-
# resp = self.__serial.read()
218-
# if debug: print('Response (ATH #1) {}'.format(resp))
219-
# self.__check_resp(resp)
220215
self.__serial.write(b"AT\r\n")
221-
time.sleep_ms(delay)
216+
time.sleep_ms(250)
222217
resp = self.__serial.read()
223218
if debug: print('Response (AT #2) {}'.format(resp))
224219
self.__check_resp(resp)
@@ -380,7 +375,7 @@ def __run(self, file_path=None, baudrate=921600, port=None, resume=False, load_f
380375
else:
381376
if debug: print('Loading {}'.format(file_path))
382377
blobsize = os.stat(file_path)[6]
383-
if blobsize < 10240:
378+
if blobsize < 128:
384379
print('Firmware file is too small!')
385380
reconnect_uart()
386381
sys.exit(1)
@@ -460,6 +455,11 @@ def __run(self, file_path=None, baudrate=921600, port=None, resume=False, load_f
460455
print('Starting STP [FFF]')
461456
else:
462457
print('Starting STP ON_THE_FLY')
458+
459+
self.__serial.read(100)
460+
if verbose: print("Sending AT+CFUN=4")
461+
resonse = self.__serial.write(b'AT+CFUN=4\r\n')
462+
if verbose: print("AT+CFUN=4 returned {}".format(response))
463463
self.__serial.read(100)
464464

465465
if load_fff:

esp32/lib/libbootloader_support.a

-1.83 KB
Binary file not shown.

esp32/lib/libbt.a

-32.4 KB
Binary file not shown.

esp32/lib/libcxx.a

-368 Bytes
Binary file not shown.

esp32/lib/libdriver.a

-4.82 KB
Binary file not shown.

esp32/lib/libesp32.a

-6.95 KB
Binary file not shown.

esp32/lib/libesp_adc_cal.a

-284 Bytes
Binary file not shown.

esp32/lib/libexpat.a

-688 Bytes
Binary file not shown.

esp32/lib/libfreertos.a

-2.39 KB
Binary file not shown.

esp32/lib/libheap.a

-788 Bytes
Binary file not shown.

esp32/lib/libjsmn.a

-68 Bytes
Binary file not shown.

esp32/lib/libjson.a

-232 Bytes
Binary file not shown.

esp32/lib/liblog.a

-200 Bytes
Binary file not shown.

esp32/lib/liblwip.a

-9.91 KB
Binary file not shown.

esp32/lib/libmbedtls.a

-7.73 KB
Binary file not shown.

esp32/lib/libmicro-ecc.a

-88 Bytes
Binary file not shown.

esp32/lib/libnewlib.a

-760 Bytes
Binary file not shown.

esp32/lib/libnghttp.a

-2.98 KB
Binary file not shown.

esp32/lib/libnvs_flash.a

-1.26 KB
Binary file not shown.

esp32/lib/libopenssl.a

-1.06 KB
Binary file not shown.

esp32/lib/libpthread.a

-548 Bytes
Binary file not shown.

esp32/lib/libsdmmc.a

-268 Bytes
Binary file not shown.

esp32/lib/libsoc.a

-932 Bytes
Binary file not shown.

esp32/lib/libspi_flash.a

-888 Bytes
Binary file not shown.

esp32/lib/libtcpip_adapter.a

-308 Bytes
Binary file not shown.

esp32/lib/libvfs.a

-496 Bytes
Binary file not shown.

esp32/lib/libwpa_supplicant.a

-4.59 KB
Binary file not shown.

esp32/lib/libxtensa-debug-module.a

-244 Bytes
Binary file not shown.

esp32/lte/lteppp.c

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@
3838
/******************************************************************************
3939
DEFINE TYPES
4040
******************************************************************************/
41-
41+
typedef enum
42+
{
43+
LTE_PPP_IDLE = 0,
44+
LTE_PPP_RESUMED,
45+
LTE_PPP_SUSPENDED
46+
}ltepppconnstatus_t;
4247
/******************************************************************************
4348
DECLARE EXPORTED DATA
4449
******************************************************************************/
@@ -48,6 +53,7 @@ extern TaskHandle_t xLTETaskHndl;
4853
DECLARE PRIVATE DATA
4954
******************************************************************************/
5055
static char lteppp_trx_buffer[LTE_UART_BUFFER_SIZE];
56+
static char lteppp_queue_buffer[LTE_UART_BUFFER_SIZE];
5157
static uart_dev_t* lteppp_uart_reg;
5258
static QueueHandle_t xCmdQueue;
5359
static QueueHandle_t xRxQueue;
@@ -68,6 +74,8 @@ static bool lteppp_enabled = false;
6874

6975
static bool ltepp_ppp_conn_up = false;
7076

77+
static ltepppconnstatus_t lteppp_connstatus = LTE_PPP_IDLE;
78+
7179
/******************************************************************************
7280
DECLARE PRIVATE FUNCTIONS
7381
******************************************************************************/
@@ -153,6 +161,8 @@ void lteppp_init(void) {
153161
lteppp_enabled = false;
154162

155163
xTaskCreatePinnedToCore(TASK_LTE, "LTE", LTE_TASK_STACK_SIZE / sizeof(StackType_t), NULL, LTE_TASK_PRIORITY, &xLTETaskHndl, 1);
164+
165+
lteppp_connstatus = LTE_PPP_IDLE;
156166
}
157167

158168
void lteppp_start (void) {
@@ -188,11 +198,13 @@ void lteppp_connect (void) {
188198
pppapi_set_default(lteppp_pcb);
189199
pppapi_set_auth(lteppp_pcb, PPPAUTHTYPE_PAP, "", "");
190200
pppapi_connect(lteppp_pcb, 0);
201+
lteppp_connstatus = LTE_PPP_IDLE;
191202
}
192203

193204
void lteppp_disconnect(void) {
194205
pppapi_close(lteppp_pcb, 0);
195206
vTaskDelay(150);
207+
lteppp_connstatus = LTE_PPP_IDLE;
196208
}
197209

198210
void lteppp_send_at_command (lte_task_cmd_data_t *cmd, lte_task_rsp_data_t *rsp) {
@@ -288,6 +300,16 @@ bool ltepp_is_ppp_conn_up(void)
288300
{
289301
return ltepp_ppp_conn_up;
290302
}
303+
304+
void lteppp_suspend(void)
305+
{
306+
lteppp_connstatus = LTE_PPP_SUSPENDED;
307+
}
308+
309+
void lteppp_resume(void)
310+
{
311+
lteppp_connstatus = LTE_PPP_RESUMED;
312+
}
291313
/******************************************************************************
292314
DEFINE PRIVATE FUNCTIONS
293315
******************************************************************************/
@@ -458,8 +480,28 @@ static bool lteppp_check_sim_present(void) {
458480
// PPP output callback
459481
static uint32_t lteppp_output_callback(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx) {
460482
LWIP_UNUSED_ARG(ctx);
461-
uint32_t tx_bytes = uart_write_bytes(LTE_UART_ID, (const char*)data, len);
462-
uart_wait_tx_done(LTE_UART_ID, LTE_TRX_WAIT_MS(len) / portTICK_RATE_MS);
483+
uint32_t tx_bytes;
484+
static uint32_t top =0;
485+
if (lteppp_connstatus == LTE_PPP_IDLE || lteppp_connstatus == LTE_PPP_RESUMED) {
486+
if(top > 0 && lteppp_connstatus == LTE_PPP_RESUMED)
487+
{
488+
uart_write_bytes(LTE_UART_ID, (const char*)lteppp_queue_buffer, top+1);
489+
uart_wait_tx_done(LTE_UART_ID, LTE_TRX_WAIT_MS(top+1) / portTICK_RATE_MS);
490+
}
491+
top = 0;
492+
tx_bytes = uart_write_bytes(LTE_UART_ID, (const char*)data, len);
493+
uart_wait_tx_done(LTE_UART_ID, LTE_TRX_WAIT_MS(len) / portTICK_RATE_MS);
494+
}
495+
else
496+
{
497+
memcpy(&(lteppp_queue_buffer[top]), (const char*)data, len);
498+
top += len;
499+
if(top > LTE_UART_BUFFER_SIZE)
500+
{
501+
top = LTE_UART_BUFFER_SIZE -1;
502+
}
503+
return len;
504+
}
463505
return tx_bytes;
464506
}
465507

esp32/lte/lteppp.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,8 @@ extern void connect_lte_uart (void);
103103

104104
extern bool ltepp_is_ppp_conn_up(void);
105105

106+
extern void lteppp_suspend(void);
107+
108+
extern void lteppp_resume(void);
109+
106110
#endif // _LTEPPP_H_

esp32/mods/machspi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ STATIC void pybspi_transfer (mach_spi_obj_t *self, const char *txdata, char *rxd
195195
for (int i = 0; i < len; i += self->wlen) {
196196
uint32_t _rxdata = 0;
197197
uint32_t _txdata;
198-
if (txdata) {
199-
memcpy(&_txdata, &txdata[i], self->wlen);
198+
if (txchar) {
199+
_txdata = *txchar;
200200
} else {
201201
_txdata = 0x55555555;
202202
}

0 commit comments

Comments
 (0)
0