Skip to content

Commit ac460dd

Browse files
authored
Merge branch 'main' into esp32
2 parents 09b754f + 2f9de1c commit ac460dd

Some content is hidden

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

62 files changed

+2217
-306
lines changed

docs/library/hashlib.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
.. module:: hashlib
77
:synopsis: hashing algorithms
8+
:noindex:
89

910
|see_cpython_module| :mod:`cpython:hashlib`.
1011

docs/workflows.md

Lines changed: 47 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,44 @@ not protected by basic auth in case the device is someone elses.
286286

287287
Only `GET` requests are supported and will return `405 Method Not Allowed` otherwise.
288288

289+
#### `/cp/devices.json`
290+
291+
Returns information about other devices found on the network using MDNS.
292+
293+
* `total`: Total MDNS response count. May be more than in `devices` if internal limits were hit.
294+
* `devices`: List of discovered devices.
295+
* `hostname`: MDNS hostname
296+
* `instance_name`: MDNS instance name. Defaults to human readable board name.
297+
* `port`: Port of CircuitPython Web API
298+
* `ip`: IP address
299+
300+
Example:
301+
```sh
302+
curl -v -L http://circuitpython.local/cp/devices.json
303+
```
304+
305+
```json
306+
{
307+
"total": 1,
308+
"devices": [
309+
{
310+
"hostname": "cpy-951032",
311+
"instance_name": "Adafruit Feather ESP32-S2 TFT",
312+
"port": 80,
313+
"ip": "192.168.1.235"
314+
}
315+
]
316+
}
317+
```
318+
319+
#### `/cp/serial/`
320+
321+
322+
Serves a basic serial terminal program when a `GET` request is received without the
323+
`Upgrade: websocket` header. Otherwise the socket is upgraded to a WebSocket. See WebSockets below for more detail.
324+
325+
This is an authenticated endpoint in both modes.
326+
289327
#### `/cp/version.json`
290328

291329
Returns information about the device.
@@ -323,36 +361,6 @@ curl -v -L http://circuitpython.local/cp/version.json
323361
}
324362
```
325363

326-
#### `/cp/devices.json`
327-
328-
Returns information about other devices found on the network using MDNS.
329-
330-
* `total`: Total MDNS response count. May be more than in `devices` if internal limits were hit.
331-
* `devices`: List of discovered devices.
332-
* `hostname`: MDNS hostname
333-
* `instance_name`: MDNS instance name. Defaults to human readable board name.
334-
* `port`: Port of CircuitPython Web API
335-
* `ip`: IP address
336-
337-
Example:
338-
```sh
339-
curl -v -L http://circuitpython.local/cp/devices.json
340-
```
341-
342-
```json
343-
{
344-
"total": 1,
345-
"devices": [
346-
{
347-
"hostname": "cpy-951032",
348-
"instance_name": "Adafruit Feather ESP32-S2 TFT",
349-
"port": 80,
350-
"ip": "192.168.1.235"
351-
}
352-
]
353-
}
354-
```
355-
356364
### Static files
357365

358366
* `/favicon.ico` - Blinka
@@ -361,4 +369,12 @@ curl -v -L http://circuitpython.local/cp/devices.json
361369

362370
### WebSocket
363371

364-
Coming soon!
372+
The CircuitPython serial interactions are available over a WebSocket. A WebSocket begins as a
373+
special HTTP request that gets upgraded to a WebSocket. Authentication happens before upgrading.
374+
375+
WebSockets are *not* bare sockets once upgraded. Instead they have their own framing format for data.
376+
CircuitPython can handle PING and CLOSE opcodes. All others are treated as TEXT. Data to
377+
CircuitPython is expected to be masked UTF-8, as the spec requires. Data from CircuitPython to the
378+
client is unmasked. It is also unbuffered so the client will get a variety of frame sizes.
379+
380+
Only one WebSocket at a time is supported.

extmod/ulab

Submodule ulab updated 109 files

locale/ID.po

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2383,6 +2383,10 @@ msgstr "argumen harus berupa ndarrays"
23832383
msgid "array and index length must be equal"
23842384
msgstr ""
23852385

2386+
#: extmod/ulab/code/numpy/io/io.c
2387+
msgid "array has too many dimensions"
2388+
msgstr ""
2389+
23862390
#: py/objarray.c shared-bindings/alarm/SleepMemory.c
23872391
#: shared-bindings/nvm/ByteArray.c
23882392
msgid "array/bytes required on right side"
@@ -2750,6 +2754,10 @@ msgstr ""
27502754
msgid "convolve arguments must not be empty"
27512755
msgstr ""
27522756

2757+
#: extmod/ulab/code/numpy/io/io.c
2758+
msgid "corrupted file"
2759+
msgstr ""
2760+
27532761
#: extmod/ulab/code/numpy/poly.c
27542762
msgid "could not invert Vandermonde matrix"
27552763
msgstr ""
@@ -2841,6 +2849,10 @@ msgstr ""
28412849
msgid "empty"
28422850
msgstr ""
28432851

2852+
#: extmod/ulab/code/numpy/io/io.c
2853+
msgid "empty file"
2854+
msgstr ""
2855+
28442856
#: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c
28452857
msgid "empty heap"
28462858
msgstr "heap kosong"
@@ -2944,7 +2956,7 @@ msgstr ""
29442956
msgid "first argument must be a tuple of ndarrays"
29452957
msgstr ""
29462958

2947-
#: extmod/ulab/code/numpy/vector.c
2959+
#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c
29482960
msgid "first argument must be an ndarray"
29492961
msgstr ""
29502962

@@ -3092,7 +3104,7 @@ msgstr ""
30923104
msgid "incorrect padding"
30933105
msgstr "lapisan (padding) tidak benar"
30943106

3095-
#: extmod/ulab/code/ndarray.c
3107+
#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c
30963108
msgid "index is out of bounds"
30973109
msgstr ""
30983110

@@ -3159,6 +3171,10 @@ msgstr ""
31593171
msgid "input matrix is singular"
31603172
msgstr ""
31613173

3174+
#: extmod/ulab/code/numpy/create.c
3175+
msgid "input must be 1- or 2-d"
3176+
msgstr ""
3177+
31623178
#: extmod/ulab/code/numpy/carray/carray.c
31633179
msgid "input must be a 1D ndarray"
31643180
msgstr ""
@@ -3167,11 +3183,7 @@ msgstr ""
31673183
msgid "input must be a dense ndarray"
31683184
msgstr ""
31693185

3170-
#: extmod/ulab/code/numpy/create.c
3171-
msgid "input must be a tensor of rank 2"
3172-
msgstr ""
3173-
3174-
#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c
3186+
#: extmod/ulab/code/user/user.c
31753187
msgid "input must be an ndarray"
31763188
msgstr ""
31773189

@@ -3372,7 +3384,7 @@ msgid "max_length must be 0-%d when fixed_length is %s"
33723384
msgstr ""
33733385

33743386
#: extmod/ulab/code/ndarray.c
3375-
msgid "maximum number of dimensions is 4"
3387+
msgid "maximum number of dimensions is "
33763388
msgstr ""
33773389

33783390
#: py/runtime.c
@@ -3621,7 +3633,7 @@ msgstr "panjang data string memiliki keganjilan (odd-length)"
36213633
msgid "off"
36223634
msgstr ""
36233635

3624-
#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c
3636+
#: extmod/ulab/code/utils/utils.c
36253637
msgid "offset is too large"
36263638
msgstr ""
36273639

@@ -3772,6 +3784,7 @@ msgid "pow() with 3 arguments requires integers"
37723784
msgstr ""
37733785

37743786
#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h
3787+
#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h
37753788
#: supervisor/shared/safe_mode.c
37763789
msgid "pressing boot button at start up.\n"
37773790
msgstr ""
@@ -4207,6 +4220,14 @@ msgstr ""
42074220
msgid "unsupported types for %q: '%q', '%q'"
42084221
msgstr ""
42094222

4223+
#: extmod/ulab/code/numpy/io/io.c
4224+
msgid "usecols is too high"
4225+
msgstr ""
4226+
4227+
#: extmod/ulab/code/numpy/io/io.c
4228+
msgid "usecols keyword must be specified"
4229+
msgstr ""
4230+
42104231
#: py/objint.c
42114232
#, c-format
42124233
msgid "value must fit in %d byte(s)"
@@ -4248,14 +4269,28 @@ msgstr "indeks sumbu salah"
42484269
msgid "wrong axis specified"
42494270
msgstr "sumbu yang ditentukan salah"
42504271

4251-
#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c
4272+
#: extmod/ulab/code/numpy/io/io.c
4273+
msgid "wrong dtype"
4274+
msgstr ""
4275+
4276+
#: extmod/ulab/code/numpy/transform.c
4277+
msgid "wrong index type"
4278+
msgstr ""
4279+
4280+
#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c
4281+
#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c
4282+
#: extmod/ulab/code/numpy/vector.c
42524283
msgid "wrong input type"
42534284
msgstr "tipe input salah"
42544285

42554286
#: extmod/ulab/code/numpy/transform.c
42564287
msgid "wrong length of condition array"
42574288
msgstr ""
42584289

4290+
#: extmod/ulab/code/numpy/transform.c
4291+
msgid "wrong length of index array"
4292+
msgstr ""
4293+
42594294
#: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c
42604295
msgid "wrong number of arguments"
42614296
msgstr "jumlah argumen salah"

0 commit comments

Comments
 (0)