Commit graph

36193 commits

Author SHA1 Message Date
f28f0857c1 it does something! 2024-06-26 15:15:14 -05:00
38b6d8d07c ugh etc 2024-06-26 15:06:05 -05:00
bd57793763 move zigbee stuff to own file
it crashes though

```
ZBOSS: common/zb_init_default.c:181   ED build
ZBOSS: common/zb_init_default.c:187   sizes: g_zb 7408 sched 224 bpool 16 nwk 912 aps 3040 addr 284 zdo 840
ZBOSS: common/zb_init_default.c:196   sec 2
ZBOSS: common/zb_init_default.c:198   zcl 600
ZBOSS: common/zb_init_default.c:201   zll 960
ZBOSS: common/zb_init_default.c:207   nvram 140
ZBOSS: common/zb_init_default.c:210   buttons 200
ZBOSS: common/zb_init_default.c:212   err_ind 4
ZBOSS: common/zb_init_default.c:218   scheduler q size 80
ZBOSS: common/zb_init_default.c:221   g_mac 816 g_imac 28
ZBOSS: common/zb_init_default.c:225   Configurable mem build, use ZBOSS lib defaults = 0
ZBOSS: common/zb_init_default.c:231   ZB_IOBUF_POOL_SIZE 80 ZB_NWK_IN_Q_SIZE 40 ZB_MAC_PENDING_QUEUE_SIZE 20 ZB_APS_DST_BINDING_TABLE_SIZE 16 ZB_APS_BIND_TRANS_TABLE_SIZE 20 ZB_N_APS_RETRANS_ENTRIES 27
ZBOSS: common/zb_init_default.c:261   ZB_N_APS_KEY_PAIR_ARR_MAX_SIZE 8 ZB_IEEE_ADDR_TABLE_SIZE 64 ZB_NEIGHBOR_TABLE_SIZE 64 ZB_NWK_ROUTING_TABLE_SIZE 0 ZB_APS_DUPS_TABLE_SIZE 32
E (904) ESP_ZIGBEE_CORE: Unknown device type!
ZBOSS: zdo/af_descriptor.c:357   ep_count 1
ZBOSS: zdo/zdo_app_prod_conf.c:144   no production config block found
ZBOSS: zdo/zdo_app_prod_conf.c:781   no valid production configuration found, signaling to application
I (929) _zig: ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL
I (935) _zig: Initialize Zigbee stack
ZBOSS: common/zb_debug.c:64   Assertion failed /builds/thread_zigbee/esp-zboss/components/zboss_stack/zboss/zdo/zdo_commissioning.c:104
Zigbee stack assertion failed zdo/zdo_commissioning.c:104

abort() was called at PC 0x4215c519 on core 0
Core  0 register dump:
MEPC    : 0x40802be0  RA      : 0x4080e362  SP      : 0x40839430  GP      : 0x4081efc0
TP      : 0x407cf974  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130
S0/FP   : 0x4083946c  S1      : 0x4083946c  A0      : 0x4083946c  A1      : 0x4083944e
A2      : 0x00000000  A3      : 0x40839499  A4      : 0x00000001  A5      : 0x40830000
A6      : 0x00000000  A7      : 0x76757473  S2      : 0x40839450  S3      : 0x00000000
S4      : 0x004bdef2  S5      : 0x0000004d  S6      : 0x00000000  S7      : 0x00000000
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000
T3      : 0x6e6d6c6b  T4      : 0x6a696867  T5      : 0x66656463  T6      : 0x62613938
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000007  MTVAL   : 0x00000000
MHARTID : 0x00000000

Stack memory:
40839430: 0x00000000 0x00000000 0x4083946c 0x408164fa 0x00000000 0x0000004d 0x004bdef2 0x00000030
...
```
2024-06-26 14:10:49 -05:00
cd5c3fd114 smash the partition table and allow debug libs 2024-06-25 12:44:27 -05:00
a1e5c548eb WIP 2024-06-18 15:47:46 -05:00
7c85f6a15a ensure variable is initialized 2024-06-13 11:41:24 -05:00
e00e2473db doc fix 2024-06-13 11:39:40 -05:00
4d4d654677 MP3Decoder: set the nonblocking flag as needed
this makes SSL sockets (which return readable when not yet actually
readable) work better.
2024-06-13 11:11:17 -05:00
3215f6c4ff SSLSocket: handle exceptions during protocol read/write operations
These protocol operations should not raise exceptions, but sometimes
they do. Catch the exception and extract the errno value if available.

At the same time, harmonize the argument types for the underlying C
routines
2024-06-12 16:41:19 -05:00
49a612056e take micropython tricks for selectability of ssl sockets 2024-06-10 12:07:48 -05:00
7969638740 SSLSocket: Add stream protocol
including select. This assumes that the SSL layer is readable/writable
exactly when the underlying socket is readable/writable.
2024-06-07 14:49:35 -05:00
Scott Shawcroft
5d9129a716
Merge pull request #9314 from dhalbert/workflow-abs-path-fix-2
Further fix to use absolute paths in remote workflows
2024-06-07 10:24:51 -07:00
Scott Shawcroft
d9387bc654
Merge pull request #9300 from bill88t/nodemcu_esp32c2
Add NodeMcu ESP32-C2
2024-06-07 10:00:21 -07:00
Dan Halbert
e4f6656df6 Further fix to use absolute paths in remote workflows 2024-06-06 16:56:24 -04:00
Scott Shawcroft
6b3665a4d5
Merge pull request #9303 from dhalbert/picow-usb-host-off
picow: turn off CIRCUITPY_USB_HOST and CIRCUITPY_PICODVI
2024-06-06 13:05:57 -07:00
Bill Sideris
1790c75cf5
Update paperwork elsewhere too 2024-06-06 22:35:07 +03:00
Bill Sideris
24f91dbde7
Update paperwork 2024-06-06 22:32:42 +03:00
Scott Shawcroft
1aa17b39b6
Merge pull request #9284 from jepler/mp3-stream
MP3: Stream them
2024-06-06 12:15:30 -07:00
Scott Shawcroft
76cc0a14d6
Merge pull request #9311 from dhalbert/web-workflow-use-abs-path
Web workflow: use absolute paths to avoid paths being adjusted by current directory
2024-06-06 12:12:23 -07:00
Dan Halbert
6ec5d3fabe web_workflow.c: use absolute path 2024-06-05 23:29:47 -04:00
6c9eaf1415 MP3Decoder: better handle underflows of mp3 stream
* Don't consume in the case of "indata overflow".
   Doing so leaves us at a bad boundary within the MP3 data
   and can continue decoding from an inappropriate spot
   i.e., one that looks likede mp3 data but is NOT.

   because there are many crashing bugs in the helix mp3 library on
   invalid input data, we must do our best to avoid them, and this
   is one way to do that.

 * clear the output buffer in the case there's not a sync word in the
   buffer. this can also happen when too little data is available.

   this changes more "stuttering" conditions into "silent" conditions.

With these changes, I can get through 3+ plays of "idea.mp3" from a local
http server with long pauses (but not stuttering glitches or safe mode
crashes).

I was also able to play through 10+ minutes of http://ice2.somafm.com/dronezone-128-mp3
without crashing or "end of stream", though again there are pauses
due to packet loss.

I think this is good now, except for the problems that arise when
the socket layer doesn't deliver a fresh packet for a long time.
2024-06-05 14:52:07 -05:00
Bill Sideris
2af48f2e65
Merge branch 'main' into nodemcu_esp32c2 2024-06-05 21:38:44 +03:00
Bill Sideris
2d18769a3b
Update creator stuff 2024-06-05 21:34:59 +03:00
cb295c57d7 MP3Decoder: Make it possible to start in the middle of an MP3
You can now, e.g.,
```
with open("/whatever.mp3") as mp3_file:
    mp3_file.seek(16000*30)
    decoder.file = mp3_file
    i2s.play(decoder)
```
to start about 30 seconds into a 128kbit/s CBR track.

If a track is looped, the loop will start at the beginning.

This also changes the behavior if the track is started & stopped: it will
continue from where it left off, except if it had prevously run to
completion. To get other behavior, you can seek the file and then re-assign
the file property.
2024-06-05 10:33:40 -05:00
Dan Halbert
d86e072e54
Merge pull request #9292 from skerr92/rpga_feather
add odt rpga feather
2024-06-05 10:17:26 -04:00
Seth Kerr
5dcefaf551 add odt rpga feather 2024-06-05 07:58:25 -06:00
Dan Halbert
604b862949
Merge pull request #9307 from UnexpectedCircuitPython/um_feathers3_neo
Added new UM FeatherS3 Neo.
2024-06-04 21:17:48 -04:00
Seon Rozenblum
bb1f1abad4 Added new UM FeatherS3 Neo. 2024-06-05 10:19:18 +10:00
6f6b680c18 MP3Decoder: improve some comments 2024-06-04 12:24:34 -05:00
4465f85027 evo m51: disable MP3 playback
& sort block of configuration settings
2024-06-04 12:18:29 -05:00
f4993b9b8a monster m4sk: disable a bunch of non-applicable modules
this hardware lacks the necessary I/O to connect any of these buses.

(re)enable synthio, it should fit now.
2024-06-04 12:18:04 -05:00
Dan Halbert
90cce2f36b
Merge pull request #9299 from tannewt/time_to_refresh
Make time_to_refresh return 0 correctly
2024-06-04 12:34:56 -04:00
Dan Halbert
597d5ccd2a
Merge pull request #9297 from weblate/weblate-circuitpython-main
Translations update from Hosted Weblate
2024-06-04 12:33:35 -04:00
Dan Halbert
46b172e168 picow: turn off CIRCUITPY_USB_HOST and CIRCUITPY_PICODVI 2024-06-04 12:31:57 -04:00
Hosted Weblate
1a8f3e22bf
Merge remote-tracking branch 'origin/main' 2024-06-04 18:27:58 +02:00
Scott Shawcroft
4cb4abf56a
Merge pull request #9296 from squix78/pendrive-s3
Add support for ThingPulse Pendrive S3
2024-06-04 09:27:54 -07:00
Bill Sideris
ccdcecc252
Initial nodemcu_esp32c2 board configuration (dupe creator id) 2024-06-04 15:56:27 +03:00
Daniel Eichhorn
3855d82f86
Use PID allocated in Espressif Repository 2024-06-04 07:37:39 +02:00
Daniel Eichhorn
d7975afa83
Merge branch 'adafruit:main' into pendrive-s3 2024-06-04 07:34:24 +02:00
Scott Shawcroft
254cac059e
Make time_to_refresh return 0 correctly
Redo Feather C6 pinout so it include standard D# labels for feathers

Fixes #9244
2024-06-03 15:33:11 -07:00
f81a3aed68 MP3Decoder: avoid all blocking reads in background
This gets MP3 playback of a soma.fm stream working for up to a minute
at a time, though it's still vulnerable to network glitches.

 * the buffer can empty, in which case a single block of audio
   plays repeatedly in max headroom stutter fashion
 * the server eventually (after 1 to 5 5 minutes) stops getting packets
   at all. At this point stream playback stops, with the internal error
   indicating a problem MP3 decoding (which doesn't quite make sense):
   -9, ERR_MP3_INVALID_HUFFCODES.
 * other combinations of audiomixer buffer & mp3 buffer might give
   different results
```py
import time

import adafruit_connection_manager
import adafruit_requests
import audiobusio
import audiomixer
import audiomp3
import board
import wifi

pool = adafruit_connection_manager.get_radio_socketpool(wifi.radio)
ssl_context = adafruit_connection_manager.get_radio_ssl_context(wifi.radio)
requests = adafruit_requests.Session(pool, ssl_context)

# todo: parse PLS files like https://somafm.com/nossl/dronezone.pls
# todo: figure out why https URLs don't work at all (missing select?)
# STREAMING_URL = "http://ice2.somafm.com/dronezone-128-mp3"
STREAMING_URL = "http://ice4.somafm.com/tikitime-128-mp3"


def get_mp3_stream():
    if STREAMING_URL.startswith("http:") or STREAMING_URL.startswith("https:"):
        return requests.get(STREAMING_URL, headers={"connection": "close"}).socket
    return open(STREAMING_URL, "rb")


mixer_buffer_size = 1152 * 2
mp3_buffer = bytearray(32768)

with audiobusio.I2SOut(
    bit_clock=board.D12, word_select=board.D13, data=board.D11
) as i2s, get_mp3_stream() as stream, audiomp3.MP3Decoder(
    stream, mp3_buffer
) as sample, audiomixer.Mixer(
    channel_count=2, sample_rate=44100, buffer_size=mixer_buffer_size
) as m:

    v = m.voice[0]
    print(sample)

    i2s.play(m)

    v.play(sample, loop=False)
    while v.playing:
        time.sleep(0.1)
```
2024-06-03 15:49:14 -05:00
Hosted Weblate
c2b374c7f8
Merge remote-tracking branch 'origin/main' 2024-06-03 22:19:29 +02:00
Dan Halbert
b1e4bc3073
Merge pull request #9298 from tyeth/correct-branch-logic-custom-builds
Correct custom board build branch logic
2024-06-03 16:19:24 -04:00
tyeth
d687580c3d Correct custom board build branch logic 2024-06-03 20:07:08 +01:00
Hosted Weblate
6f6821d61a
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/
2024-06-03 19:22:08 +02:00
Scott Shawcroft
dc3edf4e24
Merge pull request #9277 from Sola85/improve_espulp
Fix "espulp module broken in CircuitPython 9"
2024-06-03 10:21:56 -07:00
Dan Halbert
8db7a85756
Merge pull request #9295 from dhalbert/pypi-uncrustify
Use micropython-uncrustify from pypi instead of apt package
2024-06-03 11:33:50 -04:00
Dan Halbert
b2a350e49f
Merge pull request #9293 from tyeth/custom_builds_for_forks_and_branches
Custom builds for forks and branches
2024-06-03 11:33:34 -04:00
Dan Halbert
13b31ca8c7 requirements-dev.txt: silabs needs setuptools 2024-06-02 15:00:51 -04:00
Daniel Eichhorn
3cbad86140 Use unique PID 2024-06-02 19:15:53 +02:00