#circuitpython-dev

1 messages · Page 75 of 1

onyx hinge
#

as well, LCDs may have gamma correction registers (ST7789 does)

#

but just what goes in those registers is 🤯 😰

tiny peak
#

I ask because I've started working on a gamma calibration thing for Feather TFT. (compare checkerboard dither to solid colors, etc). When I tried initializing my ST7789 with the four different built in gamma curves (2.2 default, 1.8, 2.5, and 1.0), the default 2.2 gamma seems the closest.

onyx hinge
tiny peak
#

What I found with my DIY calibration tool is that the ST7789 with 2.2 gamma preset is fairly close to the the luma response of a color managed sRGB computer monitor, but not quite (stretched a bit). I'm wondering if there's some 24-bit RGB to 5/6 bit RGB565 happening with >>3 and >>2 somewhere, and if maybe that's skewing the curve (vs mapping 8-bit 2.2 gamma to 16-bit linear, scaling that, then mapping back to 5 or 6-bit 2.2 gamma)

#

thanks for the suggestions, I'll check out those links

onyx hinge
#

Bitmapfilter is all rgb565 so if it's a problem with 888 to 565 conversion that's not gonna help

tiny peak
#

ah, okay... what I'm ultimately hoping for is to be able to have sRGB PNG files displayed through displayio and actually look pretty reasonable. At the moment, it's in the ballpark, but still kinda contrasty and overexposed, with some color shifting.

#

Thanks for the input. I've got some trails to follow, but I wanted to make sure I'm not overlooking previous work.

tulip sleet
#

@lone axle I am working on the library, and pylint is now complaining about "too many arguments" for quite a few of its functions. I disagree. What's your opinion: should I disable in .pre-commit-config.yaml or should i disable for each such function? What's our usual? I looked in the bundle and I only found one library (esp32spi) that disables in .pre-commit-config.yaml.

#

maybe in the code, so pylint doesn't complain even without using pre-commit

#

and should I do it for each function, or just at the top of the file?

stuck elbow
#

or maybe you could change the max number of arguments for pylint

tulip sleet
#

good point, in .pylintrc

#

hmm, we don't do that anywhere, surprisingly

stuck elbow
#

hmm, looks like you could work around it by using keyword arguments

tulip sleet
#

max-args=5 right now, so that's any kind of args

stuck elbow
#

ah, sorry

#

love the consistent naming

#

wonder if they run it on their own code

devout crater
#

Hey, just did a fresh install of circuitpython and I can't import board. Any advice?

tulip sleet
devout crater
#

Thonny

tulip sleet
#

did you put it in CircuitPython mode and connect a board? See the lower right margin

#

all boards have board

stuck elbow
#

Hmm, I wonder if the keypad module could run on the ULP on esp32-s3...

#

then it could wake from deep sleep...

tulip sleet
#

well, when you go into deep sleep, you can deinit the keypad obj and just wake up on any of those pins

stuck elbow
#

unless it's the shift register one

tulip sleet
#

aha

devout crater
#

That did it

#

Thank you, I figured it was something small

slender iron
stuck elbow
tulip sleet
stuck elbow
#

I'm just thinking aloud, it's not like I have the energy to do anything anyways

#

touch keypad would be the priority for me anyways

#

would be useful for musical instruments

lone axle
# tulip sleet <@382939733107408897> I am working on the library, and pylint is now complaining...

I am a bit late getting back to this, I think most typical is individual pylint exceptions on functions that have too many arguments. However I would also say that I feel 5 arguments is a fairly low limit, and I would have no problem with increasing that a bit in the overrall config to try to lessen the cases where individual ignores are needed.

I'm not entirely sure where the limit of 5 came from, if that is mostly arbitrary or actually enshrined somewhere as a more official "best practice"

tulip sleet
stuck elbow
#

as far as I am familiar with python style guides, it's arbitrary

stuck elbow
#

tbf I find most of pylint defaults to be too restrictive

tulip sleet
#

agree with that

stuck elbow
#

I think they are meant to show off the feature to new users, who are then expected to immediately raise them

manic glacierBOT
manic glacierBOT
#

I investigated this but didn't find a solution

  • I looked for differences between our link files & the official one. There were differences, but trying to harmonize them (where it comes to the uninitialized data section) didn't solve anything
  • Under a picoprobe debugger, if I use the debugger to reset (ctrl-c break and then issue the gdb command "run") during the safe mode window, it works
  • In the repl, programmatically resetting to safe mode works, which also goes by the same "...
manic glacierBOT
manic glacierBOT
#

I will try your patch and report back.

It would be useful to know if setting the ipv4_dns property, which does have to be an IPV4Address, is also crashing; and it might serve as a workaround for you in your code.

Currently I am using wifi.radio.set_ipv4_address() which takes IPV4Address arguments. That works fine. I will test the setter too. The main reason I actually tried wifi.radio.dns was that I wanted to set more than one DNS, which is not supported as I learned.

manic glacierBOT
manic glacierBOT
#

CircuitPython version

9.1.4

Code/REPL

make -C mpy-cross

Behavior

make: Entering directory '/cygdrive/d/WORK/241018 RACE DEVICE/CP/circuitpython/mpy-cross'

  • Verbosity options: any combination of "steps commands rules", as make V=... or env var BUILD_VERBOSE
    Cannot determine version.

CircuitPython must be built from a git clone with tags.
If you cloned from a fork, fetch the tags from adafruit/circuitpython as follows:

make fetch-ta...
manic glacierBOT
lone axle
#

I was taking a look over this cp.org PR to add this cezerio esp32c6 dev device https://github.com/adafruit/circuitpython-org/pull/1491. The link provided there (https://cezerio.com/cezerio_dev_esp32c6) looks like a normal albeit somewhat minimal product page, but it's lacking any clear picture that shows the device. Also the "buy with paypal" button just links back to the page you're already on. If you click back out to the home page of that cezerio.com website there is a row of product listings, one of them lists that device name and does show a picture (attached), but that appears to be a different device by a different company. A quick search on the image led to https://deneyapkart.org/en which does seem to be the MCU that is depicted, and it claims a different processor (Tensillica LX6). The row of products on that cezerio home page also seems to randomly include some clothing based placeholders that are unrelated to anything else on the site.

Perhaps this is not a big deal, just a brand new device with a website containing placeholder images and product listings for a device that is not quite ready to sell yet?

I wanted to mention though and ask if there are any guidelines around how "done" and accurate the pages linked from circuitpython.org need to be? Is it okay if they don't seem to show the actual hardware? If there is a link in the description labeled "purchase" but it goes to a page that doesn't seem to allow purchasing is that an issue?

tulip sleet
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

TM1814 LED strips use an overall strip brightness value that is transmitted as the first 64 bits of data.

To allow the brightness to be dynamically updated, these 8 bytes of the header need to be modifiable.

However, the "transmit buffer" is a read-only object and is only intended to be available inside the _transmit method, so there appears to be no way to update the header (or, for that matter, trailer) values.

Possible approaches:

  1. A new pair of methods "update_{header,trai...
manic glacierBOT
#

@jepler I think it was to save memory by not allocating the post-brightness buffer until a non-1.0 brightness was set.

I think an option 6 where transmit is given a bytearray instead of a bytes object may be best. That way the transmit function can mutate it (to set brightness) before transmitting it. The buffer still stays "internal" then too. The subclass will want to override the brightness property so that the internal post-brightness buffer is never allocated.

onyx hinge
lone axle
manic glacierBOT
onyx hinge
#

@lone axle I appreciate it. Feel free to @ me, open an issue, or whatever is convenient for you when you have feedback

lone axle
# onyx hinge <@382939733107408897> If you have the time I made a library today and could use ...

I try to delete the extra copyright lines that end up in the examples like https://github.com/adafruit/Adafruit_CircuitPython_tm1814/blob/main/examples/tm1814_led_animation.py#L1. I don't think they actually upset reuse, but my understanding is that the earlier copyright attributed to Scott is really meant to apply to the template file inside of the cookiecutter. Once it's in a new library and has real code for the library added to I think having only the newer copyright for when the library was created and the code added is sufficient.

Though I don't know if this is documented anywhere, and in any case isn't really a huge problem AFAIK.

Everything else that you've got is looking good to me.

onyx hinge
#

OK I zapped those lines

#

(btw I'm thrilled to have a library that uses ruff, not pylint 🙂 🙂 )

lone axle
#

Agree'd I created one recently as well and like the streamlining of format, pylint, and import ordering all under one tool.

manic glacierBOT
#

Motivated by https://forums.adafruit.com/viewtopic.php?t=214213

errno.EROFS and errno.NOSPC didn't exist, but they get nicer error messages already mp_common_errno_to_str(). Add them. A user wanted to check for errno.EROFS and was surprised it was not available. errno. EROFS is common, given that CIRCUITPY is read-only when connected to USB.

These have not been added to the smallest builds, for space reasons.

tulip sleet
#

lowercase is non-standard for part numbers

#

or is that the mfr nomenclature

lone axle
tulip sleet
#

that should do it 🙂

#

... changed

#

PR submitted to Bundles for a rename also

lone axle
#

Thank you!

tulip sleet
#

and I had to do more changes in the repo itself (cookie-cutter files)

#

you probably are seeing that PR also

lone axle
#

Merged now, and made a new release for it.

tulip sleet
#

@lone axle by the way, I tried making a PR from my fork of the Bundle repo, and it failed pre-commit, looking for pkg_resources.

lone axle
tulip sleet
#

locally

#

it was having trouble with reuse

#
 hook id: reuse
- exit code: 1

Traceback (most recent call last):
  File "/home/halbert/.cache/pre-commit/repoc0_u0tiy/py_env-python3/bin/reuse", line 5, in <module>
    from reuse._main import main
  File "/home/halbert/.cache/pre-commit/repoc0_u0tiy/py_env-python3/lib/python3.12/site-packages/reuse/__init__.py", line 14, in <module>
    from pkg_resources import DistributionNotFound, get_distribution
ModuleNotFoundError: No module named 'pkg_resources'
#

I tried updating to the latest pre-commit actions, but it didn't help. My pip modules are very up to date

#

i am constantly running into this with pre-commit. Somehow I get it to work eventually in other repos, but it's really confusing.

lone axle
#

Ahh, yeah I see that locally as well on a fresh clone

tulip sleet
#

we saw this with pylint 2.x.x. Updating it fixed things. THe pre-commit author is constantly saying to update virtualenv, but that's not the fix

#

and he's very curt about this kind of error

lone axle
#

Maybe reuse needs to be a newer version

tulip sleet
#

I just upgraded to 4.0.3 locally, still, the same thing

lone axle
#

I will try 4.0.3 too

tulip sleet
#

it was 3.0.2, I can try 3.0.1

#

no diff

lone axle
#

Ahh, 4.0.3 exists as well and is the latest release. I did try that one and it runs for me as well.

#

are you in py3.12 environment?

tulip sleet
#

yes...

#

in a venv

#

hmm pre-commit was at 3.8.0, but 4.0.1 is availaable

#

ah, it worked!!

lone axle
#

weird, it looks like all the same versions as me. Yeah there is a newer pre-commit I'll try that as well, I am on 3.8.0 now as well.

$ pip show pre-commit
Name: pre-commit
Version: 3.8.0
#

4.0.1 runs for me as well.

tulip sleet
#

i am baffled, but it's back to working

#

ah, no, broke again

#

i did pre-commit clean and the pre-commit install to get a fresh pre-commit setup.

#

so it was breaking some of the time for you, or not at all?

lone axle
tulip sleet
#

thanks, I will try some more things later. The last this broke, the cause was something seemingly unrelated, but I can't remember what that was now. :/

lone axle
#

I believe every time that I have seen ModuleNotFoundError: No module named 'pkg_resources' it's been related to having older versions of libraries trying to run under python 3.12.

tulip sleet
#

i'll try updating everything, which is not a single option to pip3

lone axle
#

it looks like the bundle actions are set to py3.10 https://github.com/adafruit/Adafruit_CircuitPython_Bundle/blob/main/.github/workflows/build.yml#L24 which is why the same error hasn't occurred in the actions runs yet. But it would be good to go ahead and update to a newer version of reuse in the bundle repo, at least up to 3.0.1 to match the libraries, or even 4.0.3 to just bring it up to the current latest. Then we shouldn't have that issue when we update the actions container python version.

tulip sleet
lone axle
#

If a device has _bleio listed in the "Built-in modules available" on the downloads page does that mean that it supports BLE?

manic glacierBOT
#

I'm not sure if this is related but I'm seeing a similar "random" hard crash with an ESP32-C3 type device using very simple code. Maybe this can help narrow it down.

CircuitPython version

Adafruit CircuitPython 9.1.4 on 2024-09-17; Maker Go ESP32C3 Supermini with ESP32-C3

Issue

adafruit_httpserver is manually installed from adafruit-circuitpython-bundle-9.x-mpy-20241019.zip

Generally I do 4 or 5 requests curl http://testhost/foobar then just let it sit not doing anythin...

stark aurora
#

Anyone busy with circuit Python on most recent Nordic or Silicon Laboratories micro controllers with integrated Bluetooth ?

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.4 on 2024-09-17; Adafruit Circuit Playground Bluefruit with nRF52840

Code/REPL

...
import errno
...
try:
    with open("/textfile.txt", "a") as fp:
        ...
except OSError as e:
    print(e)  # for example prints "[Errno 30] Read-only filesystem"
    if e.errno == 30:
    ...

Behavior

The provided code works fine. The "print(e)" results in the string "[Errno 30] Read-only filesystem" an...

manic glacierBOT
tulip sleet
# stark aurora Anyone busy with circuit Python on most recent Nordic or Silicon Laboratories mi...

There is a silabs port, but maybe not for the chips you want?
Nordic has moved to zephyr from SoftDevice for its more recent chips. This requires a complete rewrite on our part of the chip-specific code, including BLE. For a while zephyr wasn't suitable, because it didn't allow run-time assignment of pins to functionality, which you can do in CircuitPython. This has changed but updating the nordic/ port to zephyr is not a high priority.

tulip sleet
#

@lone axle I had to fix some things about the BLE library because it was broken after a recent PR. I merged the changes without review in case someone wanted to use main or a release was made accidentally. (I did test my changes!)

And I ran into max-args again. Rather than put disable=too-many-arguments in about 10 places, I changed max-arg= in the .pylintrc. This seemed like a more reasonable solution in this case, because the library is pervasively full of longer arg lists.

lone axle
#

sounds good to me. Thank you.

manic glacierBOT
manic glacierBOT
#

@dhalbert Same issue

Adafruit CircuitPython 9.2.0-beta.1 on 2024-10-11; Maker Go ESP32C3 Supermini with ESP32-C3

As far as I can tell, server.poll() might be the cause.

Currently using the following code.py that still crashes:

import wifi
import socketpool
from adafruit_httpserver import Server

pool = socketpool.SocketPool(wifi.radio)
server = Server(pool, debug=False)

while True:
   try:
      server.poll() 

   except Exception as e:
      print(str(e))
#

@dhalbert Same issue

Adafruit CircuitPython 9.2.0-beta.1 on 2024-10-11; Maker Go ESP32C3 Supermini with ESP32-C3

As far as I can tell, server.poll() might be the cause.

Currently using the following code.py that still crashes:

import wifi
import socketpool
from adafruit_httpserver import Server

pool = socketpool.SocketPool(wifi.radio)
server = Server(pool, debug=False)

while True:
   try:
      server.poll() 

   except Exception as e:
      prin...
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.0-beta.1 on 2024-10-11; Adafruit Feather RP2350 with rp2350a
Board ID:adafruit_feather_rp2350
UID:A5C743E96A479942

Code/REPL

# SPDX-FileCopyrightText: 2024 Scott Shawcroft for Adafruit Industries
# Error chercking by Anne Barela
#
# Docs: https://docs.circuitpython.org/en/latest/shared-bindings/picodvi/
#       index.html#picodvi.Framebuffer
#
#       States: color_depth can be 1, 2, 4, 8, 16
#      ...
manic glacierBOT
manic glacierBOT
manic glacierBOT
orchid basinBOT
#

@FoamyGuy Manufacturing process has been still continuing so i have not had "cezerio dev ESP32C6" yet. I will get it in 3 weeks; then i will add photographs instead of images.
We are developer&manufacturer of electonics development boards and modules under "Deneyapkart" brand.
"cezerio" is a new brand and its website is under construction, related stock images and photos are used temporarily.

lone axle
#

Do circuitpython-org listings have to be 1-to-1 with boards added to the core circuitpython repo? Or can some be doubled up?

The seeed_xiao_esp32_s3_sense board was added to the core here https://github.com/adafruit/circuitpython/pull/9530/files and has been added to circtuitpython.org already.

My understanding is that this device is essentially a seeed_xiao_esp32s3 MCU and the "sense" indicates the addition of the camera module.

We don't have a board in the core for the standard seeed_xiao_esp32s3, only the "sense" one.

Is it neccessary to add that plain board to the core in order to add the plain one to circuitpython.org? or could a new listing in .org for the plain one just re-use the same board_id in order to be linked to the existing board definition that is technically for "sense" but should work for both if I understand.

tulip sleet
# lone axle Do circuitpython-org listings have to be 1-to-1 with boards added to the core ci...

In this particular case, I think it's an oversight that there isn't a board for the plain seeed_xiao_esp32s3 (I remember someone else raising that), and it makes sense to have two boards. There are cases where there is a very minor different a few Adafruit boards that may or may not have a BME280, or the PyBadge LC/non-LC. But this is a pretty different board, with dedicated pins for the camera, and some different compile settings.

stuck elbow
#

but seeed_xiao_esp32_s3 is exactly the same pcb, only the mezzanine connecor for the camera board is not soldered

tulip sleet
lone axle
#

I hadn't noticed the difference of that connector not soldered.

tulip sleet
#

we could have one build. But are there other mezzanine boards? Is the camera "BFF" available separately?

#

there is a provision for board aliases, as you probably know

lone axle
tulip sleet
#

i think it's easier just to make a separate board, like their other xiao boards

#

but it would need a separate USB PID

#

maybe they already have one?

lone axle
#

I am not sure how or where to find that for seeed hardware.

tulip sleet
stuck elbow
tulip sleet
#

thanks, I think two boards it is, as noted above

stuck elbow
#

the pid may be a problem

stuck elbow
#

I know, I started it ;-)

tulip sleet
#

oh 🙂

stuck elbow
#

and they've been asked for the pid before that too

orchid basinBOT
manic glacierBOT
lone axle
slender iron
slender iron
stuck elbow
slender iron
#

xiao rp2350 is already in

#

s3 without sense isn't

lone axle
#

There was a PR submitted to add the s3 without sense to circuitpython-org. which is what set me down the trail of asking here.

slender iron
#

I don't see a board def for it though

lone axle
#

right, there isn't one in the core yet.

lone axle
#

I noticed the PyPI downloads for libraries is still up over a million this week (closer to 2 million now). I was curious and had a quick look back through the last few reports and found that the 10/7 shows ~450k, the next day 10/8 doubles to just over 1 million, and since then it has steadily risen.

onyx hinge
#

@lone axle fwiw I think that "circuitpython librarians" are something that exist within the Adafruit github organization, and does not exist within the Circuitpython github organization. I don't know if you can have a group/role from one organization in another organization or if someone has to manually create it and keep it up to date.

#

<@&356864093652516868> We're about 35 minutes out from the weekly meeting so please add your notes to the doc if you haven't already: https://docs.google.com/document/d/1sFQK8Cn37B9dAOMinQ33eyYkPvlUz7M3em01pG8sxYI/edit -- I look forward to catching up with y'all

lone axle
#

Ah, I see. Adabot and a handful of other individual accounts do get listed as a choice. They must have been added seperately.

#

Whoops, thank you for the meeting ping.

onyx hinge
lone axle
#

I don't know of any changes to the portion of adabot that pulls those stats together.

manic glacierBOT
lone axle
#

10/7 was the day that I patched libraries which would have had a higher than usual amount of actions running and presumably caused a spike on that day. But I don't know of any reason the elevated levels would have persisted beyond that day.

manic glacierBOT
random junco
onyx hinge
#
#include "llm/function-for/square_area returning the area of a square given the length of a side. it takes a double and returns a double."printf("Area of a square with edge %f is %f\n", 2., square_area(2.));``` of course prints `Area of a square with edge 2.000000 is 4.000000`

And  even though it was designed for C it works with python:

$ python llm/python-for/"program to print the square root of its commandline argments.py" 3 4 5
The square root of 3 is 1.7320508075688772
The square root of 4 is 2.0
The square root of 5 is 2.23606797749979```

tulip sleet
#

I agree: 👆 is truly outrageous and hideous, kind of a Halloween hack 🙂

onyx hinge
#
You are a Python program generator.
Make sure to give as your response only a Python program with no other text.

Here is what I request:
```I didn't include the prompt for `python-for` on github but here it is
#

thanks @lone axle !

tulip sleet
#

thanks Tim!

lone axle
#

Have a great week everyone

#

Here is the notes document for next Monday’s CircuitPython Weekly Meeting. It is at the normal time of 11am Pacific / 2pm US Eastern here on Discord. Add your hug reports and status updates to the document before the meeting. If you are unable to attend but would still like to contribute, feel free to add your notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1vvHWl7D4dSyDvFFgiD5f34eFZlOEqSTLFveNxFvdh84/edit?usp=sharing

manic glacierBOT
manic glacierBOT
manic glacierBOT
tulip sleet
onyx hinge
#

@tulip sleet that's weird. From my limited networking experience it's pretty common to use that as a "wildcard address" (probably not a technical term) when creating a server.

#

I'd look at the code converting strings to IP addresses (getaddrinfo), which I recently tromped on for ipv6 stuff

tulip sleet
#

right -- it was causing a safe mode crash on the C3. I also tested on S3 and it wasn't crashing, but I think it wasn't working either.

onyx hinge
#

like, does ping("0.0.0.0") or connect crash in the same way?

#

(it probably wouldn't WORK if nothing's listening, but it shouldn't crash)

tulip sleet
#

I'll try it with 9.1.4, which does not have your changes, I think

onyx hinge
#

let me know if you start to see fingers pointing to me and I can take over. RN I'm working on the TM1814 guide.

tulip sleet
#

np

#

tnx

onyx hinge
#

thank you!

stuck elbow
#

when waiting for connections, it means "all interfaces"

vague thicket
#

Hi @slender iron , I managed to catch one of those ESP32-P4_EV boards. Could you please give me any hint on how to flash CPY .bin to it? I tried webflasher, but that one does not know the board. Then I tried flash download tool, but I´m probably flashing it to the wrong address so it is not working either. Many thanks in advance.

slender iron
#

CP has a make flash target that should work

#

it uses the esp flashing python

vague thicket
slender iron
#

ya, esptool should work

manic glacierBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
#

At some point I gave up and installed WSL.

The problem is that the machine I was trying to build everything on didn't have WSL. In short, I think we should just rely on WSL and not expect to be able to build anything on Windows. Given that the rest of the build process didn't go very smoothly either, I don't think it can be beaten without Linux.

In the end, I was able to build everything I wanted using WSL. I'm trying to connect two displays to one device as shown in this article: https...

#

CircuitPython version

Adafruit CircuitPython 9.1.4
Adafruit CircuitPython 9.2.0-beta.1

Code/REPL

It was written for rp2040-zero and the code works perfectly.
But this code doesn't work for esp32-c3 based boards.


import board, supervisor
import neopixel

pixels = neopixel.NeoPixel(board.GP16, 1, auto_write=True)

while True:
    if supervisor.runtime.usb_connected:
        pixels[0] = (0,255,0)
    else:
        pixels[0] = (255,0,0)

##...

manic glacierBOT
manic glacierBOT
orchid basinBOT
slender iron
#

@tulip sleet I tend to like enum enough to think we should probably add it to large boards

orchid basinBOT
orchid basinBOT
#

Bumps webrick from 1.8.1 to 1.8.2.

Release notes
Sourced from webrick's releases.

v1.8.2
What's Changed

Drop commented-out line by @​olleolleolle in ruby/webrick#108
Add Ruby 3.1 & 3.2 to CI matrix by @​tricknotes in ruby/webrick#109
Fix/redos by @​ooooooo-q in ruby/webrick#114
Raise HTTPStatus::BadRequest for requests with invalid/duplicate content-length headers by @​jeremyevans in ruby/webrick#120
Bump actions/checkout from 3 to 4 by @​dependabot i...

manic glacierBOT
#

This is an expansion of the work on https://github.com/adafruit/circuitpython/pull/9640 to begin creating "filter-based" audio effects (original issue: https://github.com/adafruit/circuitpython/issues/8974).

The only effect added to this module at the moment is the standard Filter effect which utilizes the Biquad filter system borrowed from synthio so that it can be processed on other audio sources (ie: wave file, microphone, etc). The downside with sharing this processing with `synt...

manic glacierBOT
manic glacierBOT
#

This error occurred in the doc build:

audiofilters/__init__.pyi:17: error: Incompatible default for argument "filter" (default has type "None", argument has type "Biquad")  [assignment]
audiofilters/__init__.pyi:17: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
audiofilters/__init__.pyi:17: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
Found 1 error in 1 file (c...
manic glacierBOT
manic glacierBOT
#

Reproduced, but only on ESP32-C3. Test program:

import wifi
import socketpool
from adafruit_httpserver import Server
import time

time.sleep(5)
print("IP addr", wifi.radio.ipv4_address)

pool = socketpool.SocketPool(wifi.radio)
server = Server(pool, debug=False)

# port 80 will get EADDRINUSE due to web workflow
# Either IP adddress will cause a crash eventually.
server.start("0.0.0.0", 8000)
#server.start(str(wifi.radio.ipv4_address), 8000)

while True:
   try:
    ...
orchid basinBOT
manic glacierBOT
manic glacierBOT
#

First of all, thanks for the PSRAM code which we borrowed for arduino-pico! It made things much easier to get PSRAM .heap and .data running for us when the Pico2 came out!

We recently ran into an issue where flash writes caused data loss in PSRAM. Basically the same two issues you discovered and worked around, we had the pleasure of discovering and working around on our own. We added the QMI register save/restore and the XIP cache cl...

#

Our engineers have made initial progress in developing a driver for the W55RP20, but we've encountered a few difficulties that we would like to address with your team. Below is a brief overview of the situation:

The W55RP20 is a SiP project that integrates the RP2040 and W5500 in one chip. Internally, the dies are connected via general GPIO pins, not the typical SPI pins. As a result, a PIO program is needed to configure these pins for SPI communication.

Our engineers then decided ...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Fixes #9735.

The MicroPython folks discovered this ESP-IDF bug: https://github.com/espressif/esp-idf/issues/14456, which can be worked around by doing CONFIG_ESP_SYSTEM_HW_STACK_GUARD=n on both ESP32-C3 and ESP32-C6. See
https://github.com/espressif/esp-idf/issues/14456
https://github.com/micropython/micropython/issues/15667
https://github.com/micropython/micropython/pull/15771
https://github.com/micropython/micropython/pull/15997
I saw this initially and kept in mind. It sounded si...

manic glacierBOT
#

Running this test program, with a settings.toml containing valid values for CIRCUITPY_WIFI_SSID and CIRCUITPY_WIFI_PASSWORD, will cause a hard fault with a few minutes.

It takes around 1-5 minutes to restart in safe mode, though I have seen it run longer. No interaction with the HTTP server is needed. I simply restart code.py and wait.

import wifi
import socketpool
from adafruit_httpserver import Server
import time

time.sleep(5)
print("IP addr", wifi.radio.ipv4_addres...
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.0-beta.1-13-g9c49eb34f6 on 2024-10-17; Raspberry Pi Pico W with rp2040

Code/REPL

>>> import wifi
>>> wifi.radio.start_dhcp()
Zurückverfolgung (jüngste Aufforderung zuletzt):
  Datei "", Zeile 1, in 
NotImplementedError: ipv6
>>> wifi.radio.start_dhcp(ipv6=False)

Behavior

see above

Description

The first call to start_dhcp() without arguments fails, although the default for ipv6 is `Fa...

lone axle
#

What are the thoughts around the Xiao S3 (non-sense) device from: https://github.com/adafruit/circuitpython-org/pull/1500 that device isn't included in the core currently, based on conversation here it seems there has been some delay / trouble getting a PID for it in order to be added to the core.

Would we want to hold out for a PID and if / when one is assigned then it can be added to both the core and the .org listing at the same time?

Or would we want to treat it as an alias in the .org listing and have it match up to the seeed_xiao_esp32_s3_sense which is in the core now?

AFAIK the devices are basically the same except for the the connector that the camera add-on plugs in to is omitted on the non-sense version, it's position on the board is there, just no connector soldered.

tulip sleet
lone axle
# tulip sleet where did the sense USB PID come from? Or is it really the PID for the base boar...

I'm not sure. In the PR where it was added to the core, the author does mention that they were having trouble with VID/PID initially https://github.com/adafruit/circuitpython/pull/9530#issuecomment-2295256805. I don't see any comments mentioning any resolution to that. But the actions did start passing so I'm assuming that some did get put in at some point.

GitHub

For some reason, my old USB_VID and USB_PID values does not compile a correct firmware. This one, make a USB drive available.

#

The ones originally submitted with that PR were

USB_VID = 0x303A
USB_PID = 0x80D1

But the new ones that it was changed to are:

USB_VID = 0x2886
USB_PID = 0x8056
manic glacierBOT
tulip sleet
#

I'll ping the author with a query

manic glacierBOT
lone axle
#

I found a few different "device finder" utilities that let you search by VID / PID, and this list which seems to be used by linux http://www.linux-usb.org/usb.ids. In all the places I've found so far seeed is listed as VID 0x2886 but the only PID listed for them is 0x0002 for the Seeeduino Lite.

I know they have more devices than that, but it seems their PIDs don't or haven't yet propogated into the data that these sites are pulling from.

brazen hatch
#

2 fun facts.

  1. With just tape and pressure the psram chip on the feather rp2350 works.
  2. If it makes bad contact, the system just continues working, forgetting the psram.
#

(I wanted to test before I solder)

#

Just, pretending it didn't exist.

slender iron
manic glacierBOT
tulip sleet
#

@slender iron the STACK_GUARD being enabled depends on SOC_ASSIST_DEBUG_SUPPORTED being defined, which is also true on ESP-C2, C5, P4. My inclination is therefor to turn it off everywhere, since it might also be causing problems elsewhere that just haven't been reported yet. Would you disagree with that?

slender iron
#

Nope, that's fine with me

tulip sleet
#

will do

slender iron
#

I don't like kconfig either

tulip sleet
#

@slender iron I will make release notes and do an rc.0!

slender iron
#

🚀

manic glacierBOT
#

Replaces: #9483 that branch accidentally got some unintended changes to files that were unrelated and I could not figure out how to properly revert those changes so I've just made a new branch and PR.

This adds functions to vectorio for testing intersection between the 3 different supported shapes.

Testing was performed on the PyGamer and Pimoroni PicoSystem with this test code and some variations of it to call the different various functions inside the main loop.

import t...
tulip sleet
#

@lone axle It would be nice to get the vectoio intersection stuff in for 9.2.0, but it looks there are build size problems. I'd expect a 9.2.1 not too long in the future. How would that be?

orchid basinBOT
manic glacierBOT
#

Thanks for the merge, @dhalbert !

@dcooperdalrymple This looks fine, but it has three unchecked boxes in the task list in the first post. Is there further testing and documentation to do? If so, maybe we should make this draft? Or are you done?

The work listed in the original checklist is mostly done. I think it's best to keep additional effects within this module to separate PRs.

I do have a minor modification in mind to the audiofilters.Filter class (removing reliance on `synth...

lone axle
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 9.2.0-rc.0
orchid basinBOT
manic glacierBOT
#

This is a minor modification to the previously merged PR https://github.com/adafruit/circuitpython/pull/9744.

This modification adds the following methods to the audiofilters.Filter class:

  • audiofilters.Filter.low_pass_filter
  • audiofilters.Filter.high_pass_filter
  • audiofilters.Filter.bass_pass_filter

These new methods help facilitate the generation of synthio.Biquad objects for the filter effect without requiring an instance of synthio.Synthesizer. It also ensures that...

#

I've changed this PR to a draft, because I am currently contemplating the possibility of implementing multiple synthio.Biquad objects on a single audiofilters.Filter effect. Doing so would require that the synthio.Biquad objects generated by the newly added methods (ie: audiofilters.Filter.low_pass_filter) would not automatically update the audiofilters.Filter.filter property.

manic glacierBOT
tulip sleet
#

https://blog.adafruit.com/2024/10/23/circuitpython-9-2-0-release-candidate-0-released/

  • New audiodelays and audiofilters modules. These modules are experimental, and the API may change.
  • Bug fixes
Adafruit Industries - Makers, hackers, artists, designers and engineers!

From the GitHub release page: This is CircuitPython 9.2.0-rc.0, a release candidate for 9.2.0 final. This release is believed to be stable, and is meant for testing before the final release of 9.2.…

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.0-rc.0 on 2024-10-23; Adafruit Feather RP2350 with rp2350a
ESP-PSRAM-64H soldered on

Code/REPL

>>> from os import urandom
>>> a = urandom(7340032) # 7ish megs, do not reload
>>> import microcontroller
>>> microcontroller.reset()
# Then once it's up
>>> import gc
>>> gc.mem_alloc()
1312
>>> gc.mem_free()
776512
>>>

Behavior

Also cold booting, sends the board to safemode, assuming it doesn...

onyx hinge
#

@fleet hollow hey I appreciate the DM but I'd prefer to have technical discussions on the open channels.

I'm not against adding other filter types that fit within the biquad "mold". As much as anything, the current set was seen as a minimum viable filter set, and roughly since then I haven't been allocated (& haven't made a good case for) more work in that area.

I mentioned making biquad filters settable (including as you noted from other blocks) over in #live-broadcast-chat . I sorta think it would be better to work on that first and then add more filter types second.

The "way to calculate" I mentioned I wrote up at https://emergent.unpythonic.net/01717331483 -- you can evaluate "one and a half" 5th degree polynomials to get an adequate approximation of sin(x) AND cos(x) for the same angle x, which is quite likely to be fast enough to allow recalculating filter coefficients every N samples just like LFOs are now.

#
    mp_float_t s = MICROPY_FLOAT_C_FUN(sin)(w0);
    mp_float_t c = MICROPY_FLOAT_C_FUN(cos)(w0);
``` as you probably know most of the biquad routines start by calculating sin & cos of "w0", which is related to the characteristic frequency of the filter
#

now a GOOD property of the current biquad is.. you can construct them from Python code, synthio.Biquad is a constructable tuple-like object with 5 fields, so you can write your own filter styles in Python code. that would break if we made biquad an object with kind, w0, and Q fields that take block inputs so it's an incompatible change..

fleet hollow
onyx hinge
#

so this would be a "circuitpython 10" thing. I don't think many people are probably creating biquads from their 5 coefficients but i also wouldn't rule it out. Having biquads that could be manipulated by LFOs would be far preferable. imo.

#

(or you have two kinds of biquad? idk)

fleet hollow
#

I'm not 100% familiar with the structure of synthio.BlockInput, but based on synthio.Math, I would think it's possible to layer BlockInputs. Biquad could be updated so that each coefficient is capable of being a BlockInput and then the filter types themselves could be classes which extend Biquad.

onyx hinge
#

anyway I am gonna sign off for the evening. Thanks for taking the time to chat a bit.

#

if you want to chat at greater length we can always have an audio or video chat here on the adafruit discord.

fleet hollow
manic glacierBOT
#
    { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
    
    // Add GP6 and GP7
    { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) },
    { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) },

    // KSO Pins (Key Scan Output)
    { MP_ROM_QSTR(MP_QSTR_KSO0), MP_ROM_PTR(&pin_GPIO8) },
    { MP_ROM_QSTR(MP_QSTR_KSO1), MP_ROM_PTR(&pin_GPIO9) },
    { MP_ROM_QSTR(MP_QSTR_KSO2), MP_ROM_PTR(&pin_GPIO10) },
    { MP_ROM_QSTR(MP_QSTR_KSO3), MP_ROM_PTR(&pin_GPIO...
frozen hill
#

Hey guys
I’ve been playing with a Raspberry Pico 2 and Pimoroni Pico Plus 2 and have come across the same issue with both.

After a while (in some cases a few days) the devices stop mounting

I’m about to mount into boot mode without issue, but the non-boot-mode stops mounting.

I've tried the flashnuke, and reinstalling CPY - the mount will appear for a short while...and then drop again (and stop mounting). I have this issue on both Mac and Windows....what am i doing wrong!?

tulip sleet
frozen hill
tulip sleet
frozen hill
#

a couple of minutes - i'm unable to pin down if it's when saving or not...it's almost as if it has an unstable connecti on (i've drived different cables etc.)

tulip sleet
#

which version of CircuitPython? Have you tried the latest (9.2.0-rc.0, from last night)?

frozen hill
#

oo no - will try now (wasn't aware a new one dropped)

#

sadly seem to get same issue

tulip sleet
#

I started up a Pico 2 with the latest and will just let it sit and see what happens

frozen hill
#

you might be onto something - changed the code to Hello World and it's 'holding' - about to try my previous code...

onyx hinge
#

@fleet hollow @blissful pollen I let it get under my skin and worked on BlockBiquad today. Here a sine wave midi note 72 is played normally, then with a low pass filter that sweeps up, then with a high pass filter that sweeps up, and finally with a band pass filter that sweeps up. I'll be making a PR later this morning I hope. I'll let one of you who knows the new audio filter stuff wire it in there, it's only wired to synthio so far.

fleet hollow
manic glacierBOT
onyx hinge
#

I didn't test it on HW yet

manic glacierBOT
#
[adafruit/circuitpython] New branch created: synthio-blockbiquad
manic glacierBOT
#

Looking great so far, but I have a few quick notes:

  • I assume you're using the property name synthio.BlockBiquad.kind to avoid confusion with the global, type. Have you considered using synthio.BlockBiquad.mode with the enum synthio.FilterMode instead?
  • Looking over the calculations within common_hal_synthio_block_biquad_tick, I don't immediately see any reason why synthio.BlockBiquad.kind needs to be read-only. It may be nice to be able to switch between filter types without ...
manic glacierBOT
#

@AirplanegoBrr Showing anger doesn't make things happen. Your point about the documentation being ambiguous is taken, and I've opened a PR for that: #9758.

I just thought showing it on the compatibility list is a bit misleading- if you need extra hardware for something to work it should be mentioned but I guess that could mess up a lot of other boards and their documentation.

I apologize for getting upset in my last comment.

#

I just thought showing it on the compatibility list is a bit misleading- if you need extra hardware for something to work it should be mentioned but I guess that could mess up a lot of other boards and their documentation.

This has bugged me a lot. I've bought boards hoping to make them work with BLE and found there's a big catch meaning it's just not going to happen. In the end it seems if you don't have nRF52840 then BLE just isn't going to work.

manic glacierBOT
#

In the end it seems if you don't have nRF52840 then BLE just isn't going to work.

There is more than nRF52840. Status of current BLE implementations:

  • native, on nRF52840 and nRF52833 boards
  • native, on Espressif 8MB boards, except ESP32-S2, which doesn't have hardware support for BLE. Right now the extra code for BLE doesn't fit on 4MB boards because of an OTA update partition that is almost never used. In CircuitPython 10, we'll change the partition configuration and enable BLE on ...
crimson ferry
#

danh... Pico W "The module situation appears to be changing now" (from PR above)... does that mean other RP form factors with Pico W features could be possible?

lone axle
#

Would it make sense to merge beta to main in https://github.com/circuitpython/web-editor when we make 9.2.0 stable? The two are not strictly related as far as I understand it but I do think it would be nice to do them in relative proximity.

tulip sleet
#

now that it's available separately, it can be incorporated into third-party mfr designs

crimson ferry
#

@tulip sleet thanks, that's great news, I hadn't seen that

tulip sleet
lone axle
#

I used the beta branch a some while I was working on the serial chart functionality and had no issues with it. I could do some more thorough testing across a wider range of hardware as well. I stuck to mostly a single device during that time.

tulip sleet
#

main thing is if it works on non-CIRCUITPY-drive boards

#

I've seen a few complaints about uploading being slow. I have been using it a little when testing some C3 fixes. I have found viper-ide.org to be faster and somewhat more stable

lone axle
tulip sleet
#

USB connection is only serial

#

@slender iron could I ask:

void port_heap_init(void) {
    uint32_t *heap_bottom = port_heap_get_bottom();
    uint32_t *heap_top = port_heap_get_top();
    size_t size = (heap_top - heap_bottom) * sizeof(uint32_t);
    _heap = tlsf_create_with_pool(heap_bottom, size, 64 * 1024 * 1024);
    _ram_pool = tlsf_get_pool(_heap);
    if (_psram_size > 0) {
        _psram_pool = tlsf_add_pool(_heap, (void *)0x11000004, _psram_size - 4);
    }
}
#

why are you starting the PSRAM pool at +4 past the beginning of PSRAM? It's not clear to me yet whether tlsf_add_pool() is expecting something to be zero'd

slender iron
#

It does some weird tricks to set memory before addresses in some cases

#

so that gives a bit of buffer

tulip sleet
#

it being RP2350 or tlsf?

#

or the PSRAM

slender iron
#

tlsf

#

does weird things looking behind the pointer

tulip sleet
#

I thought maybe that. Maybe I will just try zeroing that word.

manic glacierBOT
#

The last two commits add double buffering and a last_read property which (a) returns the buffer which was last completely filled by background writes and (b) self-clears, so that if the property is read again before the next buffer swap, it will return an empty buffer. This allows data read in the background to be recorded to SD with code as simple as

with open(filename, 'w') as f:
    while True:
        f.write(self.pcm.pio.last_read)

With the double-buffering and...

manic glacierBOT
#

I considered caching f0 & q values but decided against it until we had evidence these calculations were a problem.

Naming suggestions are always appreciated, thanks.

I could make the type/kind assignable and see what happens. I mentioned in the docs being unsure about the situation with the x[] and y[] coefficients when changing the F & Q numbers, but I'm even more dubious that those numbers would make any sense when changing the filter type, since that's like the hugest step change p...

tulip sleet
manic glacierBOT
#

I took your suggestion to rename FilterType to FilterMode. I also added the notch filter from https://webaudio.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html.

shelf & peaking don't seem to be useful until it's possible to have multiple filters (and/or their application is beyond my knowledge); they also pose a problem in that they have an additional "A" parameter related to overall gain. Presumably all BlockBiquads would have an "A" or "gain" property that would be ignored if it is not...

manic glacierBOT
#
  • Fixes #9755.

The cache invalidation in #9752 needed to use volatile pointers to point to the cache maintenance entries so they would be set correctly and in the right order.

Note that the code from pico-sdk does use volatile:
https://github.com/earlephilhower/arduino-pico/pull/2551/files
It comes from the discussion here:
https://forums.raspberrypi.com/viewtopic.php?t=378249
That code also uses _compiler_memory_barrier(), which may not be needed, but it helps guarantee order...

manic glacierBOT
#

I think part of the problem is that the Pico-W is not just another "single board". It is a board that has created a whole ecosystem. It is used in many educational projects. It is one of the few boards that work on two batteries with voltages down to 1.8V. Some manufacturers only produce RPxxxx based boards (Pimoroni is a prominent example). And like here in Germany, it is sometimes hard to buy quality boards from Adafruit, so if you want ESP32 boards, you have to order in China and the qua...

manic glacierBOT
manic glacierBOT
#

just to add to this.
I think it is very useful to have a board that does what the pico does in that it is available in normal and wireless versions and it saves cost.
This does mean that if someone buys the pico W then they want the wireless capability.
Also it is useful to have a good all-round board with ON BOARD wifi instead of having to use a extra wifi board that adds to cost and complexity.
And the pico is quite popular so there would be many users that would use BLE on it if it was...

orchid basinBOT
#

@bato3 the list of built-in modules on the downloads page now links to the documentation page for each module.

I still believe that the device simpletest scripts would be nice as well in order to have a single place that illustrates usage of the built-in hardware on the device. The module documentation pages are great, but are split up by module, and cover only the core built-in modules so wouldn't represent any hardware that also requires a python library. With simpletest for the device...

lone sandalBOT
manic glacierBOT
#

Shall I mark the original Biquad APIs deprecated? (only one of the 3 Synthesizer functions show, but all would be deprecated)

diff --git a/shared-bindings/synthio/Biquad.c b/shared-bindings/synthio/Biquad.c
index 79a9fa4593..2323551a91 100644
--- a/shared-bindings/synthio/Biquad.c
+++ b/shared-bindings/synthio/Biquad.c
@@ -38,7 +38,11 @@ static const mp_arg_t biquad_properties[] = {
 
 //| class Biquad:
 //|     def __init__(self, b0: float, b1: float, b2: float, a1: float, a...
orchid basinBOT
#

I found a schematic here: https://www.wemos.cc/en/latest/_static/files/sch_s3_pro_v1.0.0.pdf

In my understanding, it seems to indicate that the Button 0 should connect IO0 with GND when it's being pushed
image

So I think it should be possible to use the instructions from the bootloader section of the downloads page:

Press and hold down the BOOT or 0 button.
Press and release the RESET or RST button...

orchid basinBOT
#

Resolves: #1390

The lack of installer button caused an exception to be thrown when attempting to access attributes of null.

Since this occured in a for loop going over the download buttons when it failed on the first iteration it stopped subsequent iterations from ever happening.

The solution proposed is to check for null before attempting to access properties of the element.

I confirmed the issue reported in the issue on the W5500-EVB-Pico both on the live site and in a local b...

tidal kiln
#

can code.py start faster than 5ms on power up? context is for dealing with a power on delay for attached i2c device.

stuck elbow
#

another solution is to add a way to restart the i2c device

tidal kiln
#

this is for stock builds. nothing fancy.

slender iron
#

should we lock the pico w ble issue?

tidal kiln
#

@slender iron thanks. so generally not possible. by the time code.py is going, its way past the device's POR timing.

slender iron
#

ya. in that case you'll want to control power to the device from code.py

tidal kiln
#

and if that is being done, the necessary delay can be in user code

slender iron
#

right

orchid basinBOT
orchid basinBOT
slender iron
tulip sleet
#

done

slender iron
#

thanks!

tulip sleet
orchid basinBOT
pastel panther
#

are there any tools that one could use to modify a CP UF2 file to edit the filesystem on the CIRCUITPY drive? My goal is to be able to pre-install several libraries, boot.py, code.py on the target device, along with flashing the device with CP.

#

Currently I have a two step process that goes like

  1. Put board into UF2 bootrom, copy over CP UF2
  2. Wait for CIRCUITPY to come up, copy over libraries and code
#

I'd like to be able to just point folks at the current version of a UF2 that includes the latest release of code

tulip sleet
#

this doesn't work on boards where CIRCUITPY is in a separate external flash chip, because the bootloader doesn't know anything about it.

#

which boards are you thinking of?

tulip sleet
slender iron
#

I unsubscribed from it so I won't see it in my email anyway

pastel panther
#

I'm thinking of the pico or other RP2040 based boards

#

I tracked down the code that writes the default files for a new filesystem but wasn't sure if that was the best route to go down

tulip sleet
#

rp2040 bootloader doesn't have CURRENT.UF2, but there is a way to do this with picotool.

pastel panther
#

Oh? ok I'll take a look

tulip sleet
#

picotool save

#

the resulting UF2 is very large and takes a long time to load. I once tried to prune the zeros (or ones?) out of it but didn't succeed.

#

but I didn't try for very long

pastel panther
#

well that's something

orchid basinBOT
orchid basinBOT
orchid basinBOT
orchid basinBOT
#

@dhalbert I'm not sure if I understand what you mean all the way about covering multiple possibilities. But I think yes if I am understanding.

It will link to whatever value is in the board file's metadata for download_instructions. In the case of esp32 based devices as the initial issue was about that would go to the learn guide quickstart page for esp32 https://learn.adafruit.com/circuitpython-with-esp32-quick-start. For different devices it could conceivably be to a different guide p...

onyx hinge
#

(also, hi!)

pastel panther
orchid basinBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
#

shelf & peaking don't seem to be useful until it's possible to have multiple filters (and/or their application is beyond my knowledge)...

I'm planning to add support for multiple filters within audiofilters.Filter in the near future to make it possible to build EQ-like filters. I'm good with not working about those filter modes until that is ready.

Shall I mark the original Biquad APIs deprecated? (only one of the 3 Synthesizer functions shown, but all would be deprecated)

Defi...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.0-rc.0 on 2024-10-23; SparkFun Pro Micro RP2350 with rp2350a

Code/REPL

import gc
gc.mem_free()

Behavior

REPL either hangs or system crashes (USB drive disconnect/reconnect)

Description

Right after unboxing my new RP2350 board installed CircuitPython 9.2.0-rc.0 and ran the above command, which hung the REPL. Attempting to allocate a large amount of memory with x = [0]*10000 also causes a ha...

onyx hinge
#

<@&356864093652516868> Hi! Just a quick and unexpected reminder to double check the time of the meeting the next two Mondays: Much of the world changes to winter / standard time this Sunday, but the US does not change until November 4. You can view our meeting calendar online in your browser's configured timezone: https://open-web-calendar.hosted.quelltext.eu/calendar.html?url=https%3A%2F%2Fraw.githubusercontent.com%2Fadafruit%2Fadafruit-circuitpython-weekly-meeting%2Fmain%2Fmeeting.ical&title=CircuitPython Meeting Schedule&tab=agenda&tabs=month&tabs=agenda

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Circuitpython releases 9.1.4 and 9.2.0 manage apparently correctly the 4MB Flash but both lack PSRAM management.
You can find in circuitpython-main/ports/espressif/boards/ttgo_t8_v1_7/mpconfigboard.mk that there is no PSRAM declaration:

CIRCUITPY_CREATOR_ID = 0x000C303A
CIRCUITPY_CREATION_ID = 0x00320005

IDF_TARGET = esp32

CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

CIRCUITPY_ESPCAMERA = 0

Looking at Adafruit FeatherS2 for...

manic glacierBOT
#

Since the gifio.OnDiskGif always uses RGB565 format for its bitmap, instead a indexed image as it should, it uses a lot of memory (four times more than it would do for a 16-color image normally). To work around that for large gifs, it would be nice to display several smaller gif images instead, but share the bitmap object, or at least its memory buffer, between the OnDiskGif instances, so that we could update several smaller images, wait for the next frame, update them again, wait for the...

lone sandalBOT
manic glacierBOT
#

I'm relatively inexperienced and just started looking at the Pico W for a project which requires BLE support.

The above thread left me a little confused, hoping someone will help me:

some say: Pico W does not support BLE. However, it seems MicroPython supports BLE on the Pico W; it's just CircuitPython which doesn't support that combination. Is this true? and if so, what are the repercussions of using MicroPython instead of CP?

Or, is it possible to use a combination of the two,...

manic glacierBOT
manic glacierBOT
manic glacierBOT
empty salmon
#

How is the EXTERNAL_FLASH_DEVICES board files parameter used? I was looking at the CircuitPython repository and I was not able to find how the specific chip identifier(s) are used during the build process. I assume different chips have different command codes but I didn’t find anything.

manic glacierBOT
#

Some I2C devices, e.g. the newer Sensirion sensors, use NACK for specific signaling. For instance, upon an I2C write, the CRC byte is NACKed when incorrect. Or an I2C read header is NACKed when no data is available (yet). Therefore, it would be helpful, if a specific exception would be raised that would further indicate the byte of the transmission that got NACKed. Currently, there's a generic OSError No5 that indicates a failure of the I2C transmission.

empty salmon
# stuck elbow what are you trying to do?

I am trying to figure out what flash chips CircuitPython supports and how. (Not just “does it support xyz?”)
What specifically is it doing with the EXTERNAL_FLASH_DEVICES value(s)?

orchid basinBOT
#

Hi Tim, thank you for your investigation and time taken to create your reply. I followed the link to the schematic. Next I measured the connections of the switch with pcb marking "0" with a Ohm-meter. I can confirm that this switch on my Lolin S3 Pro board connects to GND when pushed.. I don't understand and don't remember, in this moment, how I came to the experience that moved me to create this "issue".
The board is, in this moment, flashed with: "Adafruit CircuitPython 9.1.0 on 2024-07-10...

manic glacierBOT
manic glacierBOT
#

@bfschris CircuitPython is a friendly fork of MicroPython, so the base language is essentially the same. The API to access hardware functionality (I2C, GPIO, etc.) is different. CircuitPython has deliberately turned off threading -and certain interrupt handling functionality -- we encourage asyncio use instead (see this FAQ.

The Blinka library allows you to use CircuitPython code under MicroPyt...

tulip sleet
#

@onyx hinge I will go ahead and do 9.2.0 final, unless you have anything else you think should go in.

onyx hinge
#

@tulip sleet I'm good with that. There are some interesting PRs in the pipeline but none are critical to a good 9.2.0 that I could see. I didn't look at the issues list but I know you do a good job triaging that (for which, thanks!)

tulip sleet
#

Agree - 9.2.1 with improvements can follow.

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 9.2.0
#

I noticed https://github.com/adafruit/circuitpython/pull/9753 and thought: wouldn't it be nice if we could test it on host computers. It turned out to be relatively easy to add the vectorio module to unix coverage builds.

$ ./build-coverage/micropython 
CircuitPython 9.2.0-rc.0-1-g2f1102da6a-dirty on 2024-10-28; linux [GCC 12.2.0] version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> import displayio, vectorio
>>> palette = displayio.Palette(1)
>>> circle = vectorio.Circle(pixe...
orchid basinBOT
manic glacierBOT
manic glacierBOT
#

thanks @dhalbert - this brings up another question related to how the system might behave between application code and servicing the BT stack, considering there's not a co-processor dedicated to BT.

I feel it's rather off-topic from this thread, however, so I posted something to the Adafruit forums. Would you mind weighing in?

https://forums.adafruit.com/viewtopic.php?t=214487

thanks much -

orchid basinBOT
#

This feels to me like a fairly niche / maintenance focused feature.

My initial inclination would be to implement it without a visual UI. The current filter checkboxes add the values checked to to the URL as parameters e.g. ?features=Display which then makes it behave like a search term limiting the list to only device which have the specified features.

I would propose to modify the JS that handles the limiting based on features functionality to support a negative modifier in the va...

#

Thanks @johnnohj I like the 'installation instructions' button up above the download links.

I was thinking about some way of ensuring the .uf2 button appears on line with the language selection and perhaps a note that indicates the .bin file is for advanced use cases? (At the very least, delete the reference to the .bin in my mock-up) The intention being to steer newer users to the .uf2 so they can nab the file and click through to the instructions without needing to navigate back ...

manic glacierBOT
#

Sorry to interrupt, but could you add "PITCH" to audio files (audiocore.WaveFile and audiocore.RawSample) ? It would be great to see this implemented on the RP2040

Just curious can you give an example of what you mean with adding pitch? Just to ensure I am clear on it.

As to the RP2040 the code should compile and run, the main issue is performance and code size. If you have a RP2040 and know how you could enable the audioeffects for that board and compile it to test. It is something i...

orchid basinBOT
#

The latest commit moves this button to up above the download buttons and next to the release notes link:
image

It turns out that the width of the button originally was actually a tad larger than the width of the other download buttons in that column, which resulted in the arrow icon getting wrapped onto the next line down and looking weird. I reworded the button to use "INSTALL" instead of "INSTALLATION" t...

manic glacierBOT
tulip sleet
onyx hinge
#

hmmm that's interesting [gathering a bit more info before I explain]

#

I have a feather rp2350 with a soldered PSRAM (not sure if relevant). It will NOT enter the bootloader in the normal way (hold BOOT and click RESET). It WILL enter the bootloader if I plug it in while holding BOOT

#

if it's already entered CircuitPython and I do BOOT+RESET it is in a state where neither CP nor the UF2 bootloader seem to be running

#

hitting RESET again without BOOT boots it into CircuitPython

orchid basinBOT
orchid basinBOT
manic glacierBOT
#

"Pitch" transposition on an audio sample without modifying the playback speed is not something that is currently available. Technically, you could feed sample data into synthio.Note, do some math to work out the frequency to get normal playback, and then modify the bend property to change the "pitch". The side effect is that that will change the overall rate of playback. I have a library which helps handle most of that functionality: https://circuitpython-synthvoice.readthedocs.io/en/la...

orchid basinBOT
manic glacierBOT
#

"Pitch" transposition on an audio sample without modifying the playback speed is not something that is currently available. Technically, you could feed sample data into synthio.Note, do some math to work out the frequency to get normal playback, and then modify the bend property to change the "pitch". The side effect is that that will change the overall rate of playback. I have a library which helps handle most of that functionality: https://circuitpython-synthvoice.readthedocs.io/en/...

manic glacierBOT
onyx hinge
#

Do we document the minimum arm-none-eabi-gcc version required to build CircuitPython? 10.x doesn't work these days, at least with rp2350.

orchid basinBOT
#

I started this on a branch here: https://github.com/FoamyGuy/circuitpython-org/tree/check_boardid_filename

One thing that we'll need to decide is if / how to deal with the ones that are already merged in and would not pass this check, here is the current list:

# core: 
board_id filename mismatch: thingpulse_pendrive_s3 != ThingPulse_PendriveS3
board_id filename mismatch: adafruit_feather_rp2040_rfm != adafruit_feather_rp2040_rfm69
board_id filename mismatch: challenger_rp2350_b...
tulip sleet
kind river
#

Any interest in helping add OpenThread as a network interface? I started a while back but kept getting hard faults

onyx hinge
#

@tulip sleet my thinking is we could put a #if (gcc version check fails) #error bad gcc version, after being tripped up with a weird non-booting firmware from gcc 10.

tulip sleet
#

@lone axle I don't see "HOW TO INSTALL" buttons in circuitpython.org right now. Maybe one PR cancelled the other??

#

It should have merged, though

lone axle
#

That button will only show if the relavent metadata field is set to the guide URL. I can work later on adding the ESP32 link for all of the devices that use that MCU.

tulip sleet
#

ah, ok, thanks, I thought there was a generic link for ESPnn

lone axle
#

Do we want all Adafruit devices to link to their relavent guide pages?

#

the issue was raised initially for ESP32 since it has a different way to install. But I could see that button being nice to have for devices that use the normal installation process as well as a pointer for anyone who found the download page but hasn't been to the learn guide for it yet.

onyx hinge
#

wdyt?

tulip sleet
#

for main we want 13. I would tell anyone building from main to use 13 before I tried to debug any problems that might be compile related

#

you could put these checks in mpconfigport.h since they will probably drift apart later. 13 is a coincidence right now

onyx hinge
#

I hope we would never want gcc 21 for one arm platform and gcc 23 for another

buoyant lagoon
#

or, is it only an issue for the arm gcc?

orchid basinBOT
onyx hinge
#

<@&356864093652516868> howdy folks! Please accept this late beep to let you know the public meeting's in about 15 minutes! You can add to the notes doc at https://docs.google.com/document/d/1vvHWl7D4dSyDvFFgiD5f34eFZlOEqSTLFveNxFvdh84/edit?usp=sharing and then join us in the voice channel if you're able!

onyx hinge
stuck elbow
#

i think there were linker bugs

onyx hinge
#

it's entirly possible that the version dependency is something else, most folks get a whole toolchain packaged up by arm (gcc+binutils) and it's known by the gcc version number + their own suffix

stuck elbow
#

in the link time optimization stuff

onyx hinge
#

@buoyant lagoon now I'm looking at gcc7 release notes and trying to guess your secret plans .. the removed CPU/architecture list is pretty short, just gcj and sh5/sh64 that I saw

lone axle
#

This SAO has:

  • A RP2040 MCU
  • 4 MB flash
  • A MAX98357A I2S amplifier
  • 4 capacitive touch pads
  • A Teeny-weeny speaker
  • A USB Type-C receptacle (data only)
  • A Circuitpython fork (lol)
  • An addressable RGB LED
  • A debug header
  • An ON/OFF switch. Yes, this SAO is highly optimized for consuming power.

To top it all of, the capacitive touch p...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.0 on 2024-10-28; BLING! with ESP32S3

Code/REPL

import json
import ipaddress

ip = ipaddress.IPv4Address('1.1.1.1')
dict = { 'string': 'this is a string', 'ip': ip }
print(json.dumps(dict))

Behavior

Description

calling json.dump() or json.dumps() with an IPv4Address object produces invalid JSON. The dotted quad should be quoted and isn't.

The problem is that it calls the [print ...

thorny jay
#

Hug report: Thank you all for 9.2.0

manic glacierBOT
lone axle
#

Thanks for hosting Jeff, have a great week everyone!

onyx hinge
#

@lone axle looks like there's "page.path" in the jekyll predefined variables https://jekyllrb.com/docs/variables/#page-variables maybe try that

Jekyll • Simple, blog-aware, static sites

Jekyll traverses your site looking for files to process. Any files with front matter are subject to processing. For each of these files, Jekyll makes a variety of data available via Liquid. The following is a reference of the available data.

lone axle
#

Nice! thank you

manic glacierBOT
#

I think what a lot of people want (including myself) is the ability to change the playback rate of a sample, independent of the sample rate. You can do this if you don't use AudioMixer, but then you incur the clicks/pops of starting/stopping the audio system or USB accesses.

I've come across a lot of code like this:

import time, random, board, audiocore, audiopwmio
wave = audiocore.WaveFile("/StreetChicken.wav")  # sample rate 22050 Hz
audio = audiopwmio.PWMAudioOut(board.SPEAK...
lone axle
#

in the docs for page.path it mentions "This can be overridden in the front matter." which means if it does contain the value that we want it should be possible to override it for any that do end up having a specific reason to keep their mismatched names should any arise.

orchid basinBOT
#

Bumps rexml from 3.3.6 to 3.3.9.

Release notes
Sourced from rexml's releases.

REXML 3.3.9 - 2024-10-24
Improvements

Improved performance.

GH-210
Patch by NAITOH Jun.

Fixes

Fixed a parse bug for text only invalid XML.

GH-215
Patch by NAITOH Jun.

Fixed a parse bug that &#0x...; is accepted as a character
reference.

Thanks

NAITOH Jun

REXML 3.3.8 - 2024-09-29
Improvements

SAX2: Improve parse performance.

GH-207
Patch by NAITOH Jun.

Fixes
...

buoyant lagoon
onyx hinge
#

@buoyant lagoon aha

upper radish
#

(Is this a good channel to ask about the CircuitPythonistas role?)

serene schooner
#

Hi folks, for ~6 weeks I have been trying to get Bluetooth running on my ESP32 Pico board. I finally have gotten CircuitPython running on the board but have been running into this error:
urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.1.0h 27 Mar 2018'. See: https://github.com/urllib3/urllib3/issues/2168
I am NOT a command line guy or for that matter a Python guy. I come from SQL and this stuff is making me batsh**t crazy. Anyone have any ideas?
Yes I have been on the Adafruit Forun site and while the answers I get are good they are usuallt 10,000 feet over my head and I have to keep waiting for answers and just found out about this Discord where I hope I can get answers in a more timely manner.
THANKS in advance for any pointers so I can stop beating my head against this.

#

YES, I did see the migration guide and for me it was like reading ancient Greek

serene schooner
#

Made no sense on how to remove the SSL issue and actually get libraries onto the Pico

tulip sleet
serene schooner
tulip sleet
#

when do you see that error?

serene schooner
#

When I try to run circup from a terminal window: circup :circup --host 192.168.5.130 --password JBPASS install --auto
I also get the error just running circup install -auto

#

Heres the entire message with the command used:
JoesiMac-5:ESP32 jbanko$ circup --host 192.168.5.130 --password JBPASS install --auto
Traceback (most recent call last):
File "/Users/jbanko/ESP32/esp32-env/bin/circup", line 5, in <module>
from circup import main
File "/Users/jbanko/ESP32/esp32-env/lib/python3.7/site-packages/circup/init.py", line 9, in <module>
from circup.shared import DATA_DIR, BAD_FILE_FORMAT, extract_metadata, _get_modules_file
File "/Users/jbanko/ESP32/esp32-env/lib/python3.7/site-packages/circup/shared.py", line 15, in <module>
import requests
File "/Users/jbanko/ESP32/esp32-env/lib/python3.7/site-packages/requests/init.py", line 43, in <module>
import urllib3
File "/Users/jbanko/ESP32/esp32-env/lib/python3.7/site-packages/urllib3/init.py", line 42, in <module>
"urllib3 v2.0 only supports OpenSSL 1.1.1+, currently "
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.1.0h 27 Mar 2018'. See: https://github.com/urllib3/urllib3/issues/2168

GitHub

Warning Did you see this URL in an error message? Please read our migration guide which covers what you should do to continue using the latest version of urllib3. There were some integration issues...

onyx hinge
# serene schooner When I try to run circup from a terminal window: circup :circup --host 192.168.5...

OK it's starting to make sense how you could see such a message: circup (running on your computer) uses requests, requests uses urllib3, and urllib3 requires openssl "1.1.1+".

Your error message shows that your Python version installed on your computer is very old (3.7). You will need to use a newer version of Python to resolve this problem.

I do not know offhand the correct way to install or update python on macos-based computers.

tulip sleet
#

you don't have to use circup. You can just download and unzip the bundles and copy the library files or directories over individually.

serene schooner
#

Thats what kills me. I did an install from the Python site and it's supposed to be 3.9.14 , I think but yet I'm seeing all these Python 3.7 messages which also probably means I'm going to have to save all my texts of command I've written and restart the Mac

onyx hinge
#

@tulip sleet since it's a wifi board I think just unzipping is not an option here

tulip sleet
onyx hinge
#

Yeah I think you need to resolve why python 3.7 is being used. your messages indicate you're using a "virtual environment" or "venv"; a venv is tied to a specific Python version, so you'll want to recreate your virutal envronment making sure it is created by the right Python version

tulip sleet
#

it's a lot easier to develop on a board that has a CIRCUITPY drive, though you may not want to get a new board

serene schooner
#

My iMac is Ventura 13.6.4 and my MacBook Air is Sonoma 14.2.1 (Thanks Apple for auto updating me to a system which kills my music software)

onyx hinge
#

(assuming that it's compatible, again I don't know much about macos)

tulip sleet
#

if you are going to install python on macos, I'd recommend using brew, instead of installing it standalone. It will handle the PATH stuff better.

onyx hinge
#

I'd listen to danh about that

serene schooner
#

I just did the update and it might have been 3.13

tulip sleet
#

the macbook air should Python 3.9, I think

serene schooner
#

Is there a way to restart Python without restarting the Mac

tulip sleet
#

it's a question of finding out where it was installed, setting up a venv using that Python, and then installing circup. brew will take care of some of that

#

you don't restart python, but you do need it on your path, or know hwere it was installed

serene schooner
#

Just to let you folks know how clueless I am about command line AND Python, what the heck is brew?

tulip sleet
#

it's what developers and other folks use to install third-party command-line software and other software on macOS cleanly

serene schooner
#

setting up a venv???? command line clueless......

tulip sleet
#

that's what I mean, you don't necessarily want to go there

#

do you have any other non-mac computers, even a raspberry pi?

#

i think you will not get these errors with the 3.9 Python on Sonoma. That should be new enough.

serene schooner
#

not that I use. a couple of old windows laptops I haven't used in decades. A dozen or so Arduino boards, but thats it

#

installing brew on my imac as we speak

#

both macs have brew and now when I do a python3 command I get 3.13 on the iMac and the MacBook Air

serene schooner
tulip sleet
serene schooner
#

what were those 2 Pull request messages about?

serene schooner
#

BTW, many thanks!! I think I just got saved a few days of bouncing messages off the forum

tulip sleet
#

This is the core development channel. Probably better to switch to #help-with-circuitpython . Those are automated messages from github

serene schooner
#

Ahh. @danh thanks for the info. I have both of those pages open. Who knew that getting sensor data sent back to an iPhone BT app would be this difficult to get running. Wish I'd known about this Dioscored channel earlier. I'm dropping onto #help-with-circuitpython . Again, many thanks. I feel like I'm getting somewhere!

onyx hinge
#

Here is the notes document for next Monday’s CircuitPython Weekly Meeting. It is at the normal time of 11am Pacific / 2pm US Eastern here on Discord. Add your hug reports and status updates to the document before the meeting. If you are unable to attend but would still like to contribute, feel free to add your notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1SwEhvqe79PPybH0QJnaPW-138ecPd9IYVdVukvgCi_Y/edit?usp=sharing

onyx hinge
#

got a weird message from circup, but it didn't repeat when I ran the same command again .. latest version. ```$ circup install -U -a
Found device at /media/jepler/CIRCUITPY, running CircuitPython 9.2.0.
Downloading latest bundles for adafruit/Adafruit_CircuitPython_Bundle (20241024).
py:
Extracting: [####################################] 100%
8.x-mpy:
Extracting: [####################################] 100%
9.x-mpy:
Extracting: [####################################] 100%

OK

Auto file: code.py
Auto file path: code.py
Auto file path: /media/jepler/CIRCUITPY/code.py
Searching for dependencies for: ['adafruit_led_animation', 'adafruit_tm1814']
Ready to install: ['adafruit_led_animation', 'adafruit_pioasm', 'adafruit_pixelbuf', 'adafruit_tm1814']

Installing from local path: adafruit_led_animation
Traceback (most recent call last):
File "/home/jepler/.local/bin/circup", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/jepler/.local/lib/python3.11/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jepler/.local/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/jepler/.local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jepler/.local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jepler/.local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jepler/.local/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jepler/.local/lib/python3.11/site-packages/circup/commands.py", line 379, in install
ctx.obj["backend"].install_module(
File "/home/jepler/.local/lib/python3.11/site-packages/circup/backends.py", line 161, in install_module
new_module_size = os.path.getsize(metadata["path"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen genericpath>", line 50, in getsize
FileNotFoundError: [Errno 2] No such file or directory: 'adafruit_led_animation'

plucky tulip
onyx hinge
#

It's not impossible that was the case hmm

plucky tulip
onyx hinge
#

I destroyed the evidence but I think I was in my CIRCUITPY or maybe CIRCUITPY/lib path

onyx hinge
lone axle
onyx hinge
#

@lone axle OK, good to know.

onyx hinge
#

I'm probably not intended to give you that authorization uniltaterally 😁

manic glacierBOT
cursive ingot
fathom sand
#

I want to move my Bluetooth Keyboard code from a ITSYBITSY NRF52840 to a ESP32S3 board and to use BLE.

I found in Github something about "Add ESP BLE GATT server support
#9222" but I am unable to find a small working BLE HID KEYBOARD sample.

Are there samples out there which can run on a ESP32S3 and CP 9?

Can anyone point me to a CircuitPython 9.2.0 sample?

PS: What I found is a sample for MicroPython

#

Something similar like this for CP would be great.

#

I currently have a Feather S3 board.

fathom sand
#

And it is working fine with CP 9.2.0

manic glacierBOT
#

I've decided to have the new methods simply return the synthio.Biquad object rather than update the filter property, because that will work better for future updates to this class (support for multiple biquads).

I've also added a deprecation notice in correspondence with https://github.com/adafruit/circuitpython/pull/9756. However, this does cause an error in the docs because that PR hasn't been merged yet and synthio.BlockBiquad doesn't exist in this branch.

I don't plan on doing...

orchid basinBOT
austere acorn
cursive ingot
manic glacierBOT
#

Support the processing of multiple synthio.Biquad objects within audiofilters.Filter by renaming filter to filters and requiring it be a List[synthio.Biquad].

import board
import audiobusio
import audiofilters
import audiocore
import synthio

audio = audiobusio.I2SOut(bit_clock=board.GP0, word_select=board.GP1, data=board.GP2)

wave_file = open("StreetChicken.wav", "rb")
wave = audiocore.WaveFile(wave_file)

synth = synthio.Synthesizer(channel_count=wave.c...
#

When you're working on allowing multiple filters, please see whether you can structure it so that synthio can share the code. e.g., if a structure more complicated than an list is needed / has to be traversed when filtering some samples, do it as a function both uses can call. Or, at least, make your best guess as to how that would need to work.

@jepler Here's the PR for multiple filters within audiofilters.Filter: https://github.com/adafruit/circuitpython/pull/9772. Currently, it's no...

wraith crow
cursive ingot
#

Ty

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.0 on 2024-10-28; Adafruit Feather RP2350 with rp2350a
Board ID:adafruit_feather_rp2350
UID:A4E22C9B6217AF8D

Code/REPL

# in boot.py
go_dev_mode = 0xff # change to crash

if go_dev_mode:
    if microcontroller.nvm[0:1] == b"\x00":
        microcontroller.nvm[0:1] = b"\xff"
else:
    if microcontroller.nvm[0:1] == b"\xff":
        microcontroller.nvm[0:1] = b"\x00"

Behavior

In boot.py...

...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.0 on 2024-10-30; Raspberry Pi Pico with rp2040

Code/REPL

from .test import test

print('main.py')

Behavior

Auto-chargement activé. Copiez ou sauvegardez les fichiers via USB pour les lancer ou démarrez le REPL pour le désactiver.
code.py sortie :
Traceback (appels les plus récents en dernier) :
  Fichier "code.py", ligne 1, dans 
ImportError: ne peut importer relativement
Exécution du c...
#

The relative import syntax is for modules that are within a package, but the main Python code does not reside "in a package". You get something similar when you try to perform the same action on standard desktop Python (3.11 on my system), though the message is different:

$ echo 'from .test import test' > issue9774.py
$ python issue9774.py 
Traceback (most recent call last):
  File "/home/jepler/issue9774.py", line 1, in <module>
    from .test import test
ImportError: attempted re...
#

I should mention that I need relative imports in the root folder for the following reason (hope I'll avoid the XY problem) :

  • I am coding a project on my main computer, targeting a raspberry pi pico
  • In this project I want to run unit tests, linting, black, etc. on the source code
  • As the main file has to be called code.py I can't put it in the root folder of my project or in my PYTHONPATH, because it would shadow the code module required by pytest and oth...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I tried reproducing this on Adafruit CircuitPython 9.2.0 on 2024-10-28; Raspberry Pi Pico 2 with rp2350a.

full content of boot.py:

# in boot.py
import microcontroller
go_dev_mode = 0xff # change to crash

if go_dev_mode:
    if microcontroller.nvm[0:1] == b"\x00":
        microcontroller.nvm[0:1] = b"\xff"
else:
    if microcontroller.nvm[0:1] == b"\xff":
        microcontroller.nvm[0:1] = b"\x00"

Full content of code.py:

import microcontroller
import superv...
onyx hinge
#

@lone axle dunno if you're continuing to iterate on circuitpython.org but I like the little badge style "features" and wondered if you considered using a similar style for built-in modules and frozen modules. This would have the side effect of fixing the "space comma space" and "erroneous trailing space" afflicting the built in modules list.

lone axle
onyx hinge
#

one thing that would be important is whether it'll still invite clicking to go to the docs (not that I know whether many people reach the docs that way, but I do consider it a valuable feature)

#

without a user study you'll just be guessing of course

manic glacierBOT
#

The cyw43-driver module is updated to commit faf36381 which corresponds to tag v1.0.4 plus 10 additional commits from main. This version is the same as that shipped with SDK 2.0.0 and documented on pg. 647 of "Raspberry Pi Pico-series C/C++ SDK.

This change affects the RP2040 Pico W at this time, but also affects RP2350 boards that include the Raspberry Pi RM2 (CYW43439) module (like the Pimo...

lone axle
manic glacierBOT
#

New audio effects class, audiofilters.Distortion, to distort audio samples using one of the available modes available in the audiofilters.DistortionMode enum.

Todo:

  • [ ] Reduce floating point computation overhead for DistortionMode.CLIP, DistortionMode.OVERDRIVE and DistortionMode.WAVESHAPE algorithms.
  • [ ] Test with unsigned and 8 bit sources.

Comments:

  • Should tone-shaping of some form be included within this class or require the use of an audiofilters.Filter effect?...
lone axle
#

Is there any easy way to tell a neopixel to turn on to white and have it sort out automatically to use (255,255,255) on a standard RGB, or (0,0,0,255) on a RGBW? setting it to (255,255,255) if self.pixel_object.bpp == 3 else (0,0,0,255) works but feels kind of verbose.

tulip sleet
#

neither is there a way to tell it to turn off completely, automating the 3 vs 4 byte value

#

I don't think

lone axle
#

Ah, good point.

tulip sleet
#

it looks like it converts (n,n,n) to (0,0,0,n)

lone axle
#

Oh, interesting. I'll have to try to do some more specific testing. Though I'm not sure if I have any that have white channel. I was working off of feedback from someone running code that I helped them write and ended up adding that ternary, I can't recall if there was a specific error that led me to adding it though.

fleet hollow
# manic glacier

Sorry, too many tabs and I accidentally pasted this link into the wrong one 😢

manic glacierBOT
#

The first 100 lines of a 700+ line program.

`# Set the DS3231 time from GPS time.

Eventually adjust DS3231 for more accurate time keeping.

import gc
import os
import sys
import time
import board
import busio
import random
import binascii
import neopixel
import displayio
import traceback
import digitalio
import terminalio
import supervisor
import microcontroller

import adafruit_gps
import adafruit_ds3231
import adafruit_displayio_ssd1306
from ...

manic glacierBOT
manic glacierBOT
#

Would need CircuitPython API to select the MCU pins to use.

We also may want to consider adding ssl to boards with enough resources that would not ordinarily have it (this would also expand the set of boards that could use WIZnet ethernet as an SPI peripheral with ssl).

I don't see mention of this module on the Raspberry Pi site, but it is incorporated in 3rd-party products, for example @pimoroni RM2 breakout ...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.0 on 2024-10-28; Pimoroni Pico Plus 2 with rp2350b

Code/REPL

import board
import audiobusio
import audiocore
import audiodelays
import audiofilters
import time

audio = audiobusio.I2SOut(bit_clock=board.GP0, word_select=board.GP1, data=board.GP2)

wave_file = open("StreetChicken.wav", "rb")
wave = audiocore.WaveFile(wave_file)

effect1 = audiofilters.Filter( # No filter specified, passes audio thr...
#

I've just tested this scenario but with using two audiofilters.Filter objects and got the error. Then again with two audiodelays.Echo objects and wasn't able to recreate the crash. So, it looks like I'm to blame here (https://github.com/adafruit/circuitpython/pull/9744). I'll do more investigation into what could be causing the fault.

manic glacierBOT
#

This boot.py has invalid syntax:

if go_dev_mode:
    if microcontroller.nvm[0:1] == b"\x00":
        microcontroller.nvm[0:1] = b"\xff"
elif:
    if microcontroller.nvm[0:1] == b"\xff":
        microcontroller.nvm[0:1] = b"\x00"
else:
    microcontroller.nvm[0:1] = b"\x00"

You can't have elif: -- that's a syntax error. If that's really what you have in boot.py, you'll see an "Invalid syntax"error inboot_out.txt`, and the safe mode would be due to something else.
...

manic glacierBOT
#

Changed back. I'll have to go look for your smarter code.

`import time
import board
import storage
import neopixel
import digitalio
import microcontroller

go_dev_mode = 0xff # change to crash

if go_dev_mode == 0xff:
if microcontroller.nvm[0:1] == b"\x00":
microcontroller.nvm[0:1] = b"\xff"
else:
if microcontroller.nvm[0:1] == b"\xff":
microcontroller.nvm[0:1] = b"\x00"
`

manic glacierBOT
#

Dan,

I had to change your 'smaller' code example as below.
go_dev_mode now has to be True or False.
The line starting with mode (#2) results in 'mode' being set to True or False. So in the 'if' line go_dev_mode must be True or False. I could not get it to work when go_dev_mode was set to 0x00 or 0xff.

`
go_dev_mode = True
mode = (microcontroller.nvm[0] == 0xff)
if mode != go_dev_mode:
microcontroller.nvm[0] = 0xff if go_dev_mode else 0x00

`

orchid basinBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

A confusing version of this is if you had previous code which used the display and then you switch to the new synthio code but CircuitPython holds the display active. I had this on an EDU PICO recently. This would be even worse if the display was no longer connected losing the visual cue!

I see the code in this issue uses displayio.release_displays() but most people won't include that in code that was never intended to use a display.

#

I added extra code to my boot.py file. The NeoPixel flashes as appropriate before the crash. It runs fully. It looks like after the byte in NVM is changed the crash happens during the boot.py hand-off to code.py. I commented out line 47.

`

boot.py for Practice Montior for Feather

This will be called at startup.

Blink the NeoPixel blue 5 times, then look at the BOOT button.

If the button is not pushed, we want "run" mode,

and will mount the flash in non-USB mode, s...

lone axle
#

Are there any tests that get run against the unix port? I see lots of .py and .py.exp files in the tests folder and it's various subfolders. Is there an example I can look at anywhere that runs one or all of those and validates the expected output?

#

Ah, I should've poked a little further. I found the run-tests workflow and run_tests.py file that seem to be the mechanism responsible for that.

manic glacierBOT
#

We can set some of them lower than 13 if necessary on a per-port basis. At least esp32 and arm ports all use 13 from what I could see.

I recently lost some time because CircuitPython for rp2040 built with gcc 10 just didn't work (wouldn't boot). It seems preferable to stop the build if it's an older version of GCC than the one we use in CI, unless we specifically test some older versions.

#

@b-blake I am unable to cause safe mode with the boot.py you gave. Here is a much simpler test, which always writes microcontroller.nvm[0]:

boot.py

import microcontroller

microcontroller.nvm[0] = (microcontroller.nvm[0] + 1) % 256

code.py

import microcontroller
import time

while True:
    time.sleep(1)
    print(f"{microcontroller.nvm[0]=}")

You should see micrcontroller.nvm[0] increment by 1 after each reset or power cycle.

Does this cause safe...

olive vessel
#

hey folks, I am working on a port for a new Feather board based on the STM32L433. It's similar to the Swan (which uses an STM32L4R5) but with less flash and ram and is a single bank part. I am close to getting an intial build going but am running to this issue in supervisor/internal_flash.c

gmake BOARD=cygnet
- Verbosity options: any combination of "steps commands rules", as `make V=...` or env var BUILD_VERBOSE
QSTR not updated
Module registrations not updated
Root pointer registrations not updated
supervisor/internal_flash.c: In function 'supervisor_flash_read_blocks':
supervisor/internal_flash.c:293:14: error: 'sector_start_addr' may be used uninitialized [-Werror=maybe-uninitialized]
  293 |     uint32_t sector_start_addr;
      |              ^~~~~~~~~~~~~~~~~
supervisor/internal_flash.c:292:14: error: 'sector_size' may be used uninitialized [-Werror=maybe-uninitialized]
  292 |     uint32_t sector_size;
      |              ^~~~~~~~~~~
supervisor/internal_flash.c: In function 'supervisor_flash_write_blocks':
supervisor/internal_flash.c:327:12: error: 'sector_size' may be used uninitialized [-Werror=maybe-uninitialized]
  327 |         if (sector_size > sizeof(_flash_cache)) {
      |            ^
supervisor/internal_flash.c:322:18: note: 'sector_size' was declared here
  322 |         uint32_t sector_size;
      |                  ^~~~~~~~~~~
supervisor/internal_flash.c:323:18: error: 'sector_start_addr' may be used uninitialized [-Werror=maybe-uninitialized]
  323 |         uint32_t sector_start_addr;
      |                  ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
-e See https://learn.adafruit.com/building-circuitpython; Adafruit Discord #circuitpython-dev
gmake: *** [../../py/mkrules.mk:93: build-cygnet/supervisor/internal_flash.o] Error 1

I've run gmake board=swan_r5 to confirm that I didn't introduce a regression for other boards so it looks like I'm missing an initialization step for these two variables

#

following the code path in internal_flash.c it doesn't look like I've missed a step, but any pointers here would be appreciated

manic glacierBOT
#

A common modulation techniques for synthesizers is modulation of the duty cycle on one or more oscillators. A simple example of a triangle wave LFO modulating a square or approximate square wave. It would be useful to have some efficient way of varying the duty cycle on at least a square wave and having that controlled by the usual myriad of synthio options.

Workarounds

I've been doing this by reading the value from an LFO and ma...

tulip sleet
spare jacinth
# olive vessel hey folks, I am working on a port for a new Feather board based on the STM32L433...

NOTE: im not sure im looking at the right (version of the) file (line numbers on your error message dont match with what im seeing in github)

on a quick glance over the code, seems like the variables get passed (their addresses) into flash_get_sector_info which populates their value. but the compiler might not be smart enough to notice all of that "machinery"

seems "safe" initializing, adding = 0 to the variable declarations, to silence the error.... values will later get overwritten

olive vessel
#

thanks @spare jacinth I did that, and it helped me uncover the actual issue, which was an issue with the flash_layout for the STM32L433

#

appreciate it!

manic glacierBOT
#

I have found that the problem is adafruit_foo.py {sometimes}. Below is my boot.pt and a very cut down code.py, all of it. If you run as it is, it runs fine, just like Dan's boot.py & code.py. If you uncomment any one of the ignored adafruit_ libraries, it crashes. Why it likes and doesn't like is a mystery to me. FYI I have unzipped all the afafruit libraries in the /lib directory

boot.py
`
import microcontroller
microcontroller.nvm[1] = 1 - microcontroller.nvm[1]
print(m...

#

CircuitPython version

Adafruit CircuitPython 9.2.0 on 2024-10-28; Pimoroni Pico Plus 2 with rp2350b

Code/REPL

>>> import microcontroller
>>> microcontroller.cpu.temperature
-1160.06

Behavior

see above

Description

This works fine on a Pico2 with a RP2350A. I don't have any other RP2350B board so I can't verify if it is board specific or due to the B-version of the chip.

Additional information

No response

manic glacierBOT
manic glacierBOT
#
 * RP2040, RP2350 QFN-60: User ADC inputs are on 0-3 (GPIO 26-29), the temperature sensor is on input 4.
 * RP2350 QFN-80 : User ADC inputs are on 0-7 (GPIO 40-47), the temperature sensor is on input 8.
/**
 * The ADC channel number of the on-board temperature sensor
 */
#ifndef ADC_TEMPERATURE_CHANNEL_NUM
#define ADC_TEMPERATURE_CHANNEL_NUM (NUM_ADC_CHANNELS - 1)
#endif

Looks like the hard-coded channel value in common_hal_mcu_processor_get_temperature should be ...

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.4 on 2024-09-17; Cytron EDU PICO W with rp2040

Code/REPL

v1.1 of [synthio-pwm-workaround-benchmark.py](https://github.com/kevinjwalters/circuitpython-examples/blob/master/pico/synthio-pwm-workaround-benchmark.py)

Behavior

The code runs but careful inspection of output indicates misbehaviour and Control-C appears to work but doesn't go all the way to REPL and maybe 15 seconds later the desktop o/s s...

#
  • Fixes #9773.
  • Fixes #9770.

The lower-level flash-write code in supervisor/internal_flash.c does cache flushing when PSRAM is in use. Some of that code is duplicated in microcontroller.nvm, but it didn't have the cache flushing.

  • Make a simple API to wrap around low-level flash writes.
  • Call it from the nvm code, and use it in internal_flash.c.
  • Update to a safer cache-flushing scheme, as mentioned in #9770.

Also see:
https://forums.raspberrypi.com/viewtopic.php?t=37...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CPython does something yet different, which we should emulate for compatibility. I would not expect ipaddress.IPv4Address to work directly in a dict to convert to json, but str() should work.

Python 3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> import ipaddress
>>> ip = ipaddress.IPv4Address('1.1.1.1')
>>> ip
IPv4Address('1.1.1.1')           # This is what we should do for v...
manic glacierBOT
manic glacierBOT
orchid basinBOT
#

I have looked at the Seeed Xiao ESP32S3 basic board and the Sense board in more detail. The difference, as @deshipu noted, is that the Sense has the camera add on board.

There is a special very dense multi-pin connector on the base board for connecting the camera board. Because of that, the pins used for the camera are otherwise inaccessible.

Therefore, I would be inclined to make the base board be an alias of the sense board in circuitpython.org, and just have one build. Then we can av...

manic glacierBOT
#

I've closely compared audiodelays.Echo and audiofilters.Filter and haven't found a direct solution yet. On the other hand, I've found a new problem. Playing a Filter through a Delay which hasn't yet been loaded with a sample causes a crash. When doing this the other way around (Delay -> Filter) or Delay -> Delay, this error doesn't occur.

''' python3
import audiodelays
import audiofilters

properties = {
"sample_rate": 48000,
"bits_per_sample": 16,
"channel_count...

orchid basinBOT
#

Mentioned recently on discord by @jepler

Trying out changing the style on the built-in and frozen modules to match the newly added feature "tags". Also added an inverse effect on hover to help further convey to the user that they are clickable (unlike the feature ones currently)

They also still retain their "pointer" mouse icon on hover.

In the screenshot countio was hovered, but my screenshot utility can't show the mouse.
![image](https://github.com/user-attachments/assets/5908e...

fleet hollow
lone sandalBOT
orchid basinBOT
blissful pollen
manic glacierBOT
manic glacierBOT
#
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

When I wrote the PR my feeling was that it's good to generate valid JSON from arbitrary objects when possible, but I agree with the argument that you shouldn't serialize it when it can't be properly deserialized.

I really dislike knowingly creating invalid JSON; that just feels like a bad practice.

What do y'all prefer? If you want I'm happy to rewrite the PR to throw the exception that CPython throws and that Dan mentioned, or to do something else.

wanton dirge
#

Sorry to pop this on the weekend but it was the time I could find to poke at it...

I'm seeing the readthedocs CI build fail on my port PR for MAX32690 (https://github.com/adafruit/circuitpython/pull/9667). I think it may be failing because my docs scripts (e.g. conf.py for Sphinx) are out of sync with the up-to-date CircuitPython main branch. In particular the versions I have generates a warning due to using get_html_theme_path which is deprecated.

Seems like the best solution would be to sync my fork & rebase the port/max32690 branch from the up-to-date main branch to get those files up-to-date. The CONTRIBUTING.md seemed to express a desire for not rebasing. What's the preferred method to resolve this? I'll leave a comment on the PR reflecting the answer but just want to verify before doing something that makes someone's life harder 😅

manic glacierBOT
#

Fixed mishandling of NULL sample within get_buffer method (used by audiosample api) of the newly added audiofilters.Filter class in 9.2.0. The error would occur when either no sample was loaded (ie: .play(...)) or .stop() was called when feeding into another audiosample object. See https://github.com/adafruit/circuitpython/issues/9778 for more details and examples.

The method now feeds "silence" audio data into the output buffer and prevents an infinite while loop.

tulip sleet
manic glacierBOT
#

Hi Kevin, I recommend looking into the waveform_loop_start and waveform_loop_end properties of a synthio.Note object (https://docs.circuitpython.org/en/latest/shared-bindings/synthio/index.html#synthio.Note.waveform_loop_start).

Say you want to have a range of 1% to 99% duty cycle, you could generate a square wave array (bigger will provide better detail as you get closer to 99%) to load into waveform. If your array is of 1024 elements, you could get 99% duty cycle with a value of ...

manic glacierBOT
#

The following int properties of synthio.Note have been updated to support synthio.BlockInput:

  • synthio.Note.waveform_loop_start
  • synthio.Note.waveform_loop_end
  • synthio.Note.ring_waveform_loop_start
  • synthio.Note.ring_waveform_loop_end

The most common use-case for this feature is controlling PWM/duty-cycle on a square waveform with a synthio.LFO object (see example below), but it could be utilized for other wave-shaping scenarios.

This PR addresses the following ...

manic glacierBOT
#

Thanks, I'd forgotten about the waveform start/end offsets. This does seem to be a good way to accomplish modulating the duty cycle and I agree that the idea of having them act as BlockInputs is interesting.

I don't think modifying a property such as waveform or waveform_loop_end from Python code can give an effective update rate of more than the number of samples generated at one go, because Python code is not being evaluated while samples are being calculated.

fresh kestrel
#

Can I support with Bluetooth on Pico W?
I was reading the thread at https://github.com/adafruit/circuitpython/issues/7693

Scott mentioned that he'd happy to guide people who want to take on this work.
I might either be up for this myself, or willing to sponsor someone who is.

I reached out to Scott via email, and due to parental leave, he recommended I check here for guidance.

Please let me know how I can best support.
(I'm not great with Discord though, so email might be more useful: ruben@verborgh.org)

manic glacierBOT
#

@dcooperdalrymple I'll give it a go. I had thought about ulab slices with moving around a big array as I think they are implemented with views rather than copies.

For LFOs it would be nice to be able to override the default update rate. I have been running at 64k for both AudioMixer and Synth with PWM audio out so it's not as coarse as the example I cited. I did notice it so perhaps I started with some code at 16k as I was doing more bassy stuff and then noted the issue.

I haven't yet e...

tulip sleet
fresh kestrel
manic glacierBOT
#

Is there a way to modify both waveform_loop_start and waveform_loop_end atomically? My instinct is to maintain the same sample length if possible.

I just inspected the intial values and end looks wrong?

>>> len(waveform) ; (note.waveform_loop_start, note.waveform_loop_end)
1024
(0, 16384)

Oh, maybe the waveform_max_length is a static value and doesn't represent the actual waveform length?

>>> note.waveform_loop_end = 512
>>> (note.waveform_loop_start, note....
tulip sleet
#

I'll discuss with the person in question about whether they want to go public yet or not.

manic glacierBOT
#

In the example I shared originally, the duty cycle does not change linearly and produces an output that is not the best demonstration of controlling a square wave duty cycle through synthio.

I've modified the example to demonstrate controlling duty cycle with LFO in a linear fashion. This uses a "window" technique by controlling both waveform_loop_start and waveform_loop_end in tandem. The loop "window" should always have a size of SIZE // 2 (this would be affected by any drift betwe...

#

The problem is that there are many, many print routines for native objects, and ideally they would all raise an exception when asked to print to json. So this is just one among many. Instead of taking up code space, we could consider a more general solution that provides for JSON printing for the few objects that work (ints, floats, bools, strings, dicts, sequences), and automatically forbids other things. But that's a low level fix that probably needs a flag or an optional extra field in the...

manic glacierBOT
#

I'm volunteering to help make this happen, either by implementing this myself or supporting someone who does.

I'm new to the CircuitPython source code, but have experience with cross-language integration (notably C/C++ modules for Node.js) and I expect I'd be able to port https://github.com/micropython/micropython/pull/10739 with the right guidance.

Equally happy to offer support/sponsorship to anyone already working on this or planning to. Feel free to reach out at ruben@verborgh.org t...

orchid basinBOT
manic glacierBOT
#

Hi Kevin, I realized this morning that I was thinking about the problem wrong. I've added an updated example within the PR I created last night that demonstrates full PWM control in a much better fashion. https://github.com/adafruit/circuitpython/pull/9788#issuecomment-2454815764

Essentially, you'll just need a standard 50/50 square waveform and create a "window" of half of the waveform data. Then, you can move that "window" around left or right to get different duty cycles. Here's a terri...

#

Here's the updated example (without synthio.BlockInput) using the logic above:

import audiobusio
import board
import synthio
import ulab.numpy as np
import time

SIZE = 2048
VOLUME = 32000
SAMPLE_RATE = 48000

audio = audiobusio.I2SOut(bit_clock=board.GP0, word_select=board.GP1, data=board.GP2)
synth = synthio.Synthesizer(sample_rate=SAMPLE_RATE)
audio.play(synth)

waveform = np.concatenate((
    np.full(SIZE // 2, VOLUME, dtype=np.int16),
    np.full(SIZE //...
orchid basinBOT
manic glacierBOT
#

I just inspected the intial values and end looks wrong?

>>> len(waveform) ; (note.waveform_loop_start, note.waveform_loop_end)
1024
(0, 16384)

Oh, maybe the waveform_max_length is a static value and doesn't represent the actual waveform length?

waveform_loop_end defaults to the maximum allowed waveform size within synthio. When synthio iterates over the waveform data, it will loop around at the maximum index of the waveform data before `waveform_loop...

orchid basinBOT
#

I think we have way too many modules now for how we designed this originally. This is just too big of a tag cloud to be very useful. Trying to think of a better solution here...

@dhalbert Am I right in assuming that the modules shown are what is included in that uf2 download? So, we are auto-including all of those modules in the download? Or is that just showing what is available, and the user has to manually install any additional modules they want to include from that list?

manic glacierBOT
#

What is the security hole about computing a value in the .yaml during an action instead of computing the value and putting it in the environment? (I'd think maybe it is the other way around.)

zizmor calls this "template injection". https://woodruffw.github.io/zizmor/audits/#template-injection and github has detailed how this is unsafe in a shell context here: https://securitylab.github.com/resources/github-actions-untrusted-input/#script-injections

Compare what happens when the malici...

#

this looks nice and simple, appreciate you picking up the work and unlocking some new capabilities!

It's especially nice that with properly configured blocks you can make sure the "window" remains always the same size for square wave modulation!

I think the docstrings need to be updated to reflect that out of range values for start/end are always clipped to 0/len-1, and none are ever rejected with ValueError anymore.

@kevinjwalters please test if you can

#

The test failure occurs because the repr of a note has changed slightly:

-(Note(frequency=830.6076004423605, panning=0.0, amplitude=1.0, bend=0.0, waveform=None, waveform_loop_start=0, waveform_loop_end=16384, envelope=None, filter=None, ring_frequency=0.0, ring_bend=0.0, ring_waveform=None, ring_waveform_loop_start=0, ring_waveform_loop_end=16384),)
+(Note(frequency=830.6076004423605, panning=0.0, amplitude=1.0, bend=0.0, waveform=None, waveform_loop_start=0.0, waveform_loop_end=16384...
manic glacierBOT
orchid basinBOT
manic glacierBOT
#

yes, failed tests stop everything else from building, so it'll need to be fixed.

In ports/unix make VARIANT=coverage test is the basic way to build & run tests that include synthio.

You can make VARIANT=coverage print-failures. Then in the tests directory there's a script endorse.py which can be used to copy the new output file into an expected (".exp") file, or you can do it manually in the shell or however you like to manipulate/rename files.

The third target to know about ...

tulip sleet
lone axle
manic glacierBOT
#

I kept the conditions mostly the same, but it's now handled within the calls to synthio_block_slot_get_limited. I've updated the docstrings to remove references to ValueError since that is no longer applicable. The major difference is that the code no longer checks the loop_start/loop_end values to see if they are outside the range and instead just clamps them to the valid range. I've removed portions of the docstrings which mentioned this.

onyx hinge
#

@tulip sleet (I think you're hosting?) I'm happy to read core or blinka sections at your request

tulip sleet
onyx hinge
#

OK, sounds good

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.4 on 2024-09-17; Waveshare ESP32-S3-Zero with ESP32S3

Code/REPL

e = espnow.ESPNow(250,31)

Behavior

When selecting integer 31 upon creation of the ESPNow object (which should be selecting line 626 here https://github.com/espressif/esp-idf/blob/a9d0f22193acdf47a5a4db36832ae7068818962b/components/esp_wifi/include/esp_wifi_types.h#L626), communication fails between 2 Waveshare ESP32-S3-zero devices. In...

tulip sleet
#

<@&356864093652516868> meeting starting momentarily

onyx hinge
#

[I could do without the spooky sound effects, Discord!]

buoyant lagoon
#

spooky time is over!

lone axle
onyx hinge
#

and zero issues not assigned a milestone because Dan has been keeping on top of things

turbid radish
#

🎉

onyx hinge
#

makes sense tim

#

Most of Europe changed a week ago I think

#

thanks Dan!

lone axle
#

Thanks for hosting Dan! have a great week everyone 🎉

turbid radish
#

Thanks Dan!

solar whale
#

👋 Thanks Dan. Have a great week, all!

onyx hinge
#

Oh! Next week's meeting is on Tuesday November 12 as we observe the Veterans Day holiday on November 11.

tulip sleet
#

<@&356864093652516868> Ha, I am wrong. Next Monday is Veteran's Day in the US, so the meeting will be on Tuesday next week. I'll trim that audio or something from the recording, since it is wrong.

buoyant lagoon
#

it both fixes the error, and adds some fun "yes we know" to it

tulip sleet
#

my main issue is finding a usable editing program on Linux

lone axle
tulip sleet
#

i keep trying different ones, and they either crash, or making selections seems difficult. Maybe I did settle on openshot last time -- I can't remember

tulip sleet
#

@lone axle did you make a backup recording? Mine is echo-y for the remote participants (only you and Jeff). Not a really big deal, but if you have one, I'll take it. thanks.

manic glacierBOT
manic glacierBOT
#

I would not know where to start to build it myself.
For now, it looks like this has not been implemented in CircuitPython. I've switched to Micropython and was able to make it work there.

Micropython code for reference, with initialization sequence as per the Micropython documentation :

import network
import espnow

sta = network.WLAN(network.STA_IF)
network.phy_mode(network.MODE_LR)
sta.active(True)
sta.disconnect()

e = espnow.ESPNow()
e.active(True)

Not sure if ...