Commit Graph

29306 Commits

Author SHA1 Message Date
Jeff Epler
6e350a65cf
Merge pull request #7076 from bill88t/early-wifi
Implement async wifi connection on picow
2022-10-17 19:54:58 -05:00
Jeff Epler
3b7feccd9b
picow: Implement stop_station
Weirdly we have to stop the AP too (which we never started),
or cyw43_tcpip_link_status still reports that STA is connected.
As long as AP mode isn't implemented, this doesn't matter and
we can just do it.
2022-10-17 19:42:10 -05:00
Jeff Epler
508c80da8d
socketpool: add sendall
The standard Python 'fix' for 'send()' returning prematurely is to
use the 'sendall()' method instead. However, this method was not
available.  adafruit_httpserver will probably need to code a version
of it for older versions or for Airlift, but when it's available
this code works (Tested on picow sending 8192 bytes) and may be more
efficient.

(implementing 'sendall' in python should take care to slice a memoryview
rather than the original buffer)
2022-10-17 19:42:09 -05:00
Jeff Epler
57756863ef
picow: depending on memory pressure, may only be able to write 1 MSS
Foamyguy discovered that trying to send >2920 bytes at once consistently
failed. I further discovered that sometimes trying to send >1460 bytes
would fail too.  By "fail", I mean that it would take a very long time
(around 200 * 50ms) before erroneously reporting that all bytes were
written.

In my testing, this change causes larger writes to successfully
send either 2920 or 1460 bytes (possibly after doing some 50ms waits
for a previous packet to clear).

The documentation of socket.send always stated that it COULD send fewer
bytes than requested, but adafruit_httpserver assumed that the number
of requested bytes were always sent, so after this change alone,
adafruit_httpserver will still not work properly.

Closes: #7077 (albeit fixes are needed in adafruit_httpserver too)
2022-10-17 19:42:07 -05:00
Jeff Epler
861b22730e
picow: if initial write fails, write at most 1 TCP MSS of data 2022-10-17 19:28:02 -05:00
Jeff Epler
1975742d9f
picow: fix formatting numbers in lwip debug output 2022-10-17 19:28:02 -05:00
Jeff Epler
6128f4e5af
picow: add resolution of ".local" names 2022-10-17 19:28:01 -05:00
Jeff Epler
bd3ed2e93d
Merge pull request #7075 from jepler/picow-fix-ipv4addr-unconnected
picow: ask at a lower level if the interface is up
2022-10-17 19:27:49 -05:00
MicroDev
029e57dd54
Merge pull request #7074 from jepler/remove-mp-hashlib-doc
remove hashlib, zlib from micropython modules index
2022-10-18 00:18:04 +05:30
MicroDev
eeddcdb09c
Merge pull request #7071 from weblate/weblate-circuitpython-main
Translations update from Hosted Weblate
2022-10-18 00:12:55 +05:30
microDev
fb91c2f436
cleanup sdkconfig-esp32.defaults
- remove log level: set by -opt or -debug sdkconfig
- remove lwip hostname: set by board specific sdkconfig
2022-10-17 22:05:20 +05:30
Bill Sideris
47c373e67e
Use cyw43_tcpip_link_status instead 2022-10-17 18:33:32 +03:00
Bill Sideris
bce024f59e
Implement async wifi connection on picow 2022-10-17 18:17:14 +03:00
Jeff Epler
47541afc7c
picow: ask at a lower level if the interface is up
Closes: #7072

```
Adafruit CircuitPython 8.0.0-beta.2-9-g5192082e64-dirty on 2022-10-17; Raspberry Pi Pico W with rp2040
>>> import wifi
>>> print(wifi.radio.ipv4_address)
None
>>> import os
>>> wifi.radio.connect(os.getenv('WIFI_SSID'), os.getenv('WIFI_PASSWORD'))
>>> print(wifi.radio.ipv4_address)
10.0.2.94
```
2022-10-17 10:08:50 -05:00
Jeff Epler
07dda44b20
remove hashlib, zlib from micropython modules index
.. these have been converted to shared-bindings style
and have their own documentation now that better matches our
implementation.

Closes: #7034
2022-10-17 09:57:44 -05:00
microDev
434c6d5604
fix uf2 bootloader condition in makefile 2022-10-17 19:45:48 +05:30
microDev
5114ae7a31
fix 2MB-no-uf2 partition table 2022-10-17 19:44:08 +05:30
microDev
f86377e0f1
fix 4MB-no-uf2 partition table 2022-10-17 19:42:41 +05:30
Hosted Weblate
e4953a4935
Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/
2022-10-17 01:55:36 +02:00
Hosted Weblate
12be7b136a
Merge remote-tracking branch 'origin/main' 2022-10-17 01:55:31 +02:00
Dan Halbert
5192082e64
Merge pull request #7064 from jepler/rp2-cyw43-pin-in-use
Fix GPIO state when initializing CYW43 pin
2022-10-15 21:36:55 -04:00
Jim Mussared
55169e0b4d
extmod/uasyncio/task.py: Fix crash when non-awaited task is awaited.
A task that has been sent to the loop's exception handler due to being
re-scheduled twice will then subsequently cause a `raise None` if it is
subsequently awaited. In the C version of task.py, this causes a segfault.

This makes the await succeed (via raising StopIteration instead).

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-15 14:58:07 -05:00
Jeff Epler
d4b1d4d430
Fix GPIO state when initializing CYW43 pin
Closes: #7063
2022-10-15 13:10:22 -05:00
Jeff Epler
e590d27bf8
Use CircuitPython _TICKS_PERIOD
.. since Adafruit_CircuitPython_asyncio is hard-coded to this _TICKS_PERIOD
not the one that would otherwise be used on Unix

This fixes all the uasyncio test failures on Unix
2022-10-15 10:49:31 -05:00
Dan Halbert
8c16093963
Merge pull request #7061 from MicroDev1/espressif
Improve `dualbank` errors
2022-10-15 08:31:36 -04:00
microDev
e7b25dbf73
improve dualbank errors 2022-10-15 13:20:10 +05:30
Dan Halbert
747e9f96b4
Merge pull request #7058 from jepler/ioctl-poll
Use micropython #defines for stream polling operations
2022-10-14 23:13:47 -04:00
Jeff Epler
6a8bc738ec
Make it easy to test just a subset of tests
with e.g., 'make TEST_EXTRA="extmod/uasyncio*.py" test'
2022-10-14 17:07:27 -05:00
Jeff Epler
4f190c9228
Handle tests that just won't stop 2022-10-14 16:40:10 -05:00
Jeff Epler
963a51487a
unix Makefile: easy wait to print test failures as diffs 2022-10-14 14:44:52 -05:00
Jeff Epler
798f6ec71f
Switch tests to run on Adafruit_CircuitPython_asyncio (fails)
This also depends on https://github.com/adafruit/Adafruit_CircuitPython_Ticks/pull/8
otherwise adafruit_ticks is unimportable and the tests are just skipped.

Several of the tests fail, and one runs forever instead of terminating.

We should fix our asyncio until the tests patch, then incorporate this
change.
2022-10-14 14:44:52 -05:00
Dan Halbert
496057e149
Merge pull request #7057 from jepler/ci-set-matrix-improvements
Ci set matrix improvements
2022-10-14 13:18:12 -04:00
Jeff Epler
068b7c4af8
Use micropython #defines for stream polling operations
We adopted the file "py/ioctl.h" and the ioctl names beginning
with MP_IOCTL_POLL while micropython went with "py/stream.h" and
MP_STREAM_POLL.

Align with upstream.

Closes #6711
2022-10-14 12:15:30 -05:00
Jeff Epler
d08b43f704
We refer to port multiple times, make it convenient 2022-10-14 11:33:04 -05:00
Jeff Epler
641a398a54
only build subset of boards for bindings changes 2022-10-14 11:33:03 -05:00
Jeff Epler
3b600ac9b3
Potentially compute settings of fewer boards
.. when the file is within ports, just get the settings for boards
within the port
2022-10-14 11:33:03 -05:00
Jeff Epler
ad130e87f0
Parallelize finding board settings
This reduces the _elapsed_ time running the script from ~90s to ~15s
on my AMD Ryzen 7 5700U. The CPU time is still around 2 minutes.
2022-10-14 11:33:03 -05:00
Jeff Epler
25164030e2
Don't recompute 'all_ports_all_boards'
This looks modestly expensive, and it's trivial to cache it.
2022-10-14 11:33:02 -05:00
Jeff Epler
cab4063057
Make it easier to locally test ci_set_matrix
Now you can e.g., `tools/ci_set_matrix.py ports/raspberrypi/mpconfigport.h`
and see what outputs would be set.
2022-10-14 11:33:02 -05:00
Jeff Epler
81154b4ee6
Revert "don't build other ports due to common-hal changes"
This reverts commit 91985cef7e.
2022-10-14 11:32:58 -05:00
Dan Halbert
b4c2ef13e4
Merge pull request #7055 from dhalbert/ci_set_matrix_fixes
don't build other ports due to common-hal changes
2022-10-14 12:29:10 -04:00
Dan Halbert
0ce84b27e8
Merge pull request #7053 from CytronTechnologies/add-pin-definitions-maker-feather-aiot-s3
Added Pin Definitions for Cytron Maker Feather AIoT S3
2022-10-14 11:31:53 -04:00
Dan Halbert
91985cef7e don't build other ports due to common-hal changes 2022-10-14 11:26:37 -04:00
Dan Halbert
062d63ee3a
Merge pull request #7050 from jepler/picow-wirelsess-off-in-deep-sleep
picow: Turn off wifi co-processor regulator when entering deep sleep
2022-10-14 08:17:16 -04:00
Dan Halbert
8caafd9079
Merge pull request #7051 from jepler/picow-hashlib
implement hashlib for picow
2022-10-14 08:14:41 -04:00
Dan Halbert
25e9985dd5
Merge pull request #7052 from MicroDev1/espressif
Fix espressif log level
2022-10-14 08:13:02 -04:00
Kong Wai Weng
fc00a6675e Added some pin definitions to match with the Arduino core. 2022-10-14 17:25:24 +08:00
microDev
66b539d768
fix espressif log level 2022-10-14 11:33:10 +05:30
Jeff Epler
3b3fe44174
implement hashlib for picow 2022-10-13 20:42:50 -05:00
Jeff Epler
0c5fd55c16
picow: Turn off wifi co-processor regulator when entering deep sleep
This reduces power consumption during true deep sleep.

In my measurements with ppk2 and a program that _irrevocably_ entered
deep sleep (no time alarm or pin alarm), power usage as measured on a
ppk2 decreased from ~10mA to ~1mA.
2022-10-13 20:10:10 -05:00