#circuitpython-dev
1 messages · Page 75 of 1
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.
see e.g., 9.2.26 and 9.2.27 of https://www.buydisplay.com/download/ic/ST7789.pdf
In CircuitPython, bitmapfilter could perform gamma correction given a LUT: https://docs.circuitpython.org/en/latest/shared-bindings/bitmapfilter/index.html#bitmapfilter.lookup
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
Bitmapfilter is all rgb565 so if it's a problem with 888 to 565 conversion that's not gonna help
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.
@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?
or maybe you could change the max number of arguments for pylint
max-args=5 right now, so that's any kind of args
Hey, just did a fresh install of circuitpython and I can't import board. Any advice?
on a board? You are probably not really running the code on the board, but instead are running it on the host computer. Which editor are you using?
Thonny
did you put it in CircuitPython mode and connect a board? See the lower right margin
all boards have board
Hmm, I wonder if the keypad module could run on the ULP on esp32-s3...
then it could wake from deep sleep...
well, when you go into deep sleep, you can deinit the keypad obj and just wake up on any of those pins
unless it's the shift register one
aha
Nope
That did it
Thank you, I figured it was something small
You'd need a recompiled version of it since the ULP is FSM or risc-v
I was thinking entirely custom rewrite, so yes.
Maybe this is more of an alarm.pin.ShiftRegister functionality, instead of needing to swap out the keypad impl for ULP
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
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"
I ended up doing it mostly per file in the PR I was working on. I think max-args=5 is the out of the box value. I wonder what ruff's default is
as far as I am familiar with python style guides, it's arbitrary
tbf I find most of pylint defaults to be too restrictive
agree with that
I think they are meant to show off the feature to new users, who are then expected to immediately raise them
@BlitzCityDIY Are the boards on the tripler in the same place as in @jepler's photo?
The hardware setup I'm using is with a Pico 2, PiCowbell Camera and a PiCowbell Tripler.
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 "...
I tested with a Pico 2, PiCowbell Camera, and the tripler. I used the 1.54" ST7789 240x240 display and a 100mm EYESPI cable. I put the Pico 2 in the same position as the EYESPI cable, an the camera in the middle.
I ran the test program in the original post for several hours, and saw no problems.
I will try your patch and report back.
It would be useful to know if setting the
ipv4_dnsproperty, 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.
Setter works fine and #9727 fixes the issue. Thanks!
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...
i did try rearranging the boards and had the same result. i think where no one else has been able to recreate it's okay to close this- it's probably some undiagnosed issue with my setup
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?
I agree that the PR should supply images of the actual product, not just pinout diagrams. I also think that it's weird that the website pictures are not the board in question. It's fine to bring this up as comments in the PR. I can understand that the vendor might want a circuitpython.org listing before it's ready to sell, but this seems really early.
Might be worth trying another Pico 2 if you have one, or another Cowbell doubler/tripler. Maybe there's an unsoldered pin?
@DogushC Are there any photographs available of the real device? No other boards use a rendered pinout for the image here, photographs are preferred.
The link listed in the description under purchase (https://cezerio.com/cezerio_dev_esp32c6) leads to a page with a "buy with paypal" button, but that button appears to be a link pointing to the same page that you're already on. Is it actually possible to purchase this device?
On the home page of of cezerio.com there is a row of product ...
I have been trying this with some similar code, and haven't yet been able to reproduce. I'm moving this forward to 9.x.x for now.
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:
- A new pair of methods "update_{header,trai...
@tannewt I have a vague recollection that you had a good and strong motivation for NOT letting the caller pass in the buffer, and preferred to add header/trailer arguments instead. Is my memory right? Can you reconstruct your position on this?
@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.
@lone axle If you have the time I made a library today and could use another pair of eyes before I tag the first release. I don't do this much but I think you know the details pretty well https://github.com/adafruit/Adafruit_CircuitPython_tm1814
I can take a look in a little bit.
This permits modifying the brightness of TM1814 strips at runtime. Tested with a modified version of the WIP tm1814 library.
Closes: #9729
@lone axle I appreciate it. Feel free to @ me, open an issue, or whatever is convenient for you when you have feedback
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.
OK I zapped those lines
(btw I'm thrilled to have a library that uses ruff, not pylint 🙂 🙂 )
Agree'd I created one recently as well and like the streamlining of format, pylint, and import ordering all under one tool.
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.
- fixes some issues raised in #9708
Changes:
- Note in documentation that
_bleio.Connection.pair(bond=False)is not implemented, and validate thatbond==True. - Print a better message on espressif and nordic when trying to pair when pairing is already in progress. Right now it prints "unknown ..." and gives a numeric error code.
@onyx hinge @lone axle should it be TM1814 or tm1814 in the repo name?
lowercase is non-standard for part numbers
or is that the mfr nomenclature
Ah, I didn't notice that. I do think uppercase is typical for our driver library names.
There are some that mix case i.e. https://github.com/adafruit/Adafruit_CircuitPython_ACeP7In/ but it's more of an abbreviation than a part number.
I'm not sure about how to change the name, perhaps it's possible in the settings page. I do know that Github treats the repo name in the URL as case in-sensitive so https://github.com/adafruit/Adafruit_CircuitPython_TM1814/ still resolves to the same repo.
https://github.com/adafruit/Adafruit_CircuitPython_tm1814/settings has a Rename button
that should do it 🙂
... changed
PR submitted to Bundles for a rename also
Thank you!
and I had to do more changes in the repo itself (cookie-cutter files)
you probably are seeing that PR also
Merged now, and made a new release for it.
@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.
Do you mean pre-commit running locally or in github actions?
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.
Ahh, yeah I see that locally as well on a fresh clone
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
Maybe reuse needs to be a newer version
in cookiecutter and new libraries we're up to 3.0.1 https://github.com/adafruit/Adafruit_CircuitPython_TM1814/blob/main/.pre-commit-config.yaml#L19
I just upgraded to 4.0.3 locally, still, the same thing
if you try 3.0.1 specifically does it run? I just tried that one and it did run
I will try 4.0.3 too
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?
yes...
in a venv
hmm pre-commit was at 3.8.0, but 4.0.1 is availaable
ah, it worked!!
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.
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?
the single case that it broke for me was with the reuse version set to 0.12.1 inside of .pre-commit-config.yaml. After updating that to 3.0.1 and the couple of newer ones that I've tried now it always suceeded.
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. :/
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.
i'll try updating everything, which is not a single option to pip3
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.
I updated absolutely everything (got a one-liner from stackoverflow, and now it's fine). There were many updates, so I'll never know which one. Thanks for your help.
If a device has _bleio listed in the "Built-in modules available" on the downloads page does that mean that it supports BLE?
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...
Anyone busy with circuit Python on most recent Nordic or Silicon Laboratories micro controllers with integrated Bluetooth ?
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...
I just noticed Dan addressed this yesterday. See https://github.com/adafruit/circuitpython/pull/9731.
But I don't think Dan's issue https://github.com/adafruit/circuitpython/pull/9731 addresses my request above for improved documentation...
@c--- Could you try 9.2.0-beta.1?
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.
@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.
sounds good to me. Thank you.
@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...
Is this a duplicate of #9460 ?
It might be but it's a much simpler reproducer, which is great. We should try to fix this and then see ask @mMerlin if #9460 is fixed.
I consider this a showstopper for 9.2.0.
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
# ...
@c--- The test program above generates continuous ServerStopped exceptions. This is more easily seen if you do
while True:
try:
server.poll()
except Exception as e:
print(type(e))
to print the type rather than the string form of the exception.
You do need a server.start(). However, in your original test program, you had:
server.start("0.0.0.0", 80)
If I...
What are the implications of this discovery for #9460 which was thought to be the same (or at least related) bug. That does not use the 0.0.0.0 address.
What are the implications of this discovery for #9460 which was thought to be the same (or at least related) bug. That does not use the 0.0.0.0 address.
I don't think these are the same.
@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.
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.
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.
but seeed_xiao_esp32_s3 is exactly the same pcb, only the mezzanine connecor for the camera board is not soldered
ah, ok, it wasn't clear to me from the photo.
I hadn't noticed the difference of that connector not soldered.
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
A seperate board definition still may make sense though in order to omit camera_data_tuple and several of the CAM_XX pins https://github.com/adafruit/circuitpython/blob/main/ports/espressif/boards/seeed_xiao_esp32_s3_sense/pins.c#L13C33-L13C50. Those might be confusing for a person who does have the standard board and ends up trying interact with those pins.
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?
I am not sure how or where to find that for seeed hardware.
SEEED has its own USB VID, 0x2886; they are allocating them, but it's done rather slowly. There may discussion in the other seeeed board PR's
The actions run failed due to missing images in the large and small folders. This page covers the process of scaling images to the appropriate sizes for those two folders. https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/preparing-the-images
at the moment there are none, and you can't buy the camera module separately, and the connector on the xiao side is missing
thanks, I think two boards it is, as noted above
the pid may be a problem
I know, I started it ;-)
oh 🙂
and they've been asked for the pid before that too
This board_id didn't match the core repo which broke the download link for this board, and added a 2nd "unknown" instance to the downloads listing.
I tested this fix locally and it seems to resolve the issue, leaving only a single instance listed and the firmware download buttons work now
Less important (but it sure would have helped me), the documentation at https://docs.circuitpython.org/en/latest/docs/library/errno.html could be improved from "The codes available may vary per CircuitPython build" (please avoid disclaimers like this) to where to find the list that applies to my situation.
I have opened #9737 to cover this.
If anyone has a moment today and can take a look at the PRs for the screenshot utility: https://github.com/circuitpython/CircuitPython_Library_Screenshot_Maker/pulls, there are fixes to a few of the open issues that would be great to have. That repo doesn't seem to allow requesting review from circuitpython librarians.
Not necessarily because _bleio can be provided via an external airlift.
Are there any outstanding PID requests from them? We've tried to backchannel with them over email about it.
I haven't been paying attention after the xiao s3 sense merged to be honest, but I expect that sooner or later someone will submit a PR for the xiao rpRP2350, and of course the xiao s3 without sense would require another request
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.
I don't see a board def for it though
right, there isn't one in the core yet.
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.
@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
CircuitPython Weekly Meeting for October 21, 2024 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates before the meeting, alphabetically by your username. During the meeting, we go through them in order. If you can’t make the meeting and woul...
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.
@lone axle @tulip sleet I wonder if it's real or if something's gone wrong with the measurement script. I assume without looking at adabot that we didn't change anything on our end about retrieving the stats.
https://pypistats.org/packages/adafruit-circuitpython-requests requests sure has gotten more downloaded over the last 60 days if you look at just the peak values
PyPI Download Stats
I don't know of any changes to the portion of adabot that pulls those stats together.
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.
I can't find an example but Luke (@wren6991) has said it works without overclocking.
Opened #9739 to implement 800x480 output. This will close with doc updates.
Thank you Dan. You are the most responsive person I've encountered regarding Adafruit issues. I finally quit submitting Adafruit-related MakeCode issues (https://github.com/microsoft/pxt-adafruit/issues) due to no apparent management there for years.
@ricknun. Thank you -- we all try to be responsive. We don't control MakeCode at all except to provide links to it: that code is entirely maintained by Microsoft, and they have varying amounts of time to spend.
I think this was just covered in https://forums.adafruit.com/viewtopic.php?t=214284. Maybe that is you?
RP2350 only support 640x480 output currently.
Fixes #9736
Looks good - it's clear -- thanks!
CircuitPython version
Adafruit CircuitPython 9.1.4 on 2024-09-17; Adafruit Circuit Playground Bluefruit with nRF52840
Code/REPL
None.
Behavior
See Description.
Description
https://docs.circuitpython.org/projects/turtle/en/stable/api.html#adafruit_turtle.Color says colors are "Standard colors". This led to significant time spent finding https://learn.adafruit.com/circuitpython-led-animations/colors and using the list I found there. Then I le...
#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```
I agree: 👆 is truly outrageous and hideous, kind of a Halloween hack 🙂
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 !
thanks Tim!
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
CircuitPython Weekly Meeting for October 28, 2024 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates before the meeting, alphabetically by your username. During the meeting, we go through them in order. If you can’t make the meeting and woul...
Ouch. I have the RP2350 and I got the Adafruit 5" 800x480 display (which doesn't upscale) so the limitation that RP2350 cannot do 800x480 means the display will have to be set aside.
@tannewt is 800x480 implemented for RP2350 per above? I looked at the PR and the code header comments appeared that for RP2350 (vs RP2040) "On RP2350, output resolution is always 640x480"
It is not implemented. The issue is to track its implementation.
@onyx hinge https://github.com/adafruit/circuitpython/issues/9735 is about 0.0.0.0 not working as an HTTP server address. I'm not sure whether this ever worked -- I'll find out. But does this ring any bells for you? Fine if not. I will pursue it in any case.
@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
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.
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)
I'll try it with 9.1.4, which does not have your changes, I think
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.
thank you!
for connection purposes, 0.0.0.0 counts as 127.0.0.1
when waiting for connections, it means "all interfaces"
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.
Make sure you are using the external usb to serial converter. The internal one is broken
CP has a make flash target that should work
it uses the esp flashing python
Oh, OK. I have to find one. Can I flash it with esptool as well?
ya, esptool should work
From #9702 (dupe):
@DatanoiseTV
As part of work on the PicoADK V2 and initial CircuitPython support, I was wondering if SDIO support is coming?
This works really well earlephilhower/arduino-pico#1560 (comment)
Would be great to see support for this in 9.2.
Links are now all dead links.
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)
##...
The C3 doesn't have USB support as far as I remember.
@deshipu But the chip detects the Serial connection perfectly. So far it looks more like a bug.
How does it detect serial connection?
@deshipu
if supervisor.runtime.serial_connected:
pass
That seems correct to me? Since the board is using an external USB to serial chip, USB is never connected to the microcontroller itself, so the False response is correct.
Quoting from https://circuitpython.org/board/adafruit_qtpy_esp32c3/
ESP32-C3 is a low-cost microcontroller from Espressif that supports 2.4 GHz Wi-Fi and Bluetooth® Low Energy (Bluetooth LE). It has built-in USB-to-Serial, but not native USB - it cannot act as a keyboard or disk drive. The chip used here has 4MB of Flash memory, 400 KB of SRAM and can easily handle TLS connections.
@deshipu Aaah, thank you so much!
That explains everything.
Given that the rest of the build process didn't go very smoothly either,
Have you tried building in the cloud? See .devcontainer/Readme.md. You don't need to install anything on your computer. The cloud build-environment is Linux, but there are no prerequisites for your computer (except that you have a browser).
@bablokb It's actually a very interesting idea.
It seems like we could make our own fork and build it through actions?
Adafruit has categorized this enhancement as "long term", meaning that Adafruit folks are not likely to be working on it in the near future. We would welcome community members picking up the work, of course.
I think actions work differently, although they probably use the same sort of infrastructure.
There is an archived version available here: https://web.archive.org/web/20210727135908/http://daveastels.com/trinket-m0-express-hack.html It's missing some of the original images, but it's got a lot of information for anyone who would want to create one of these.
I think it'd be good to link to that one and note it in the text as an archived version.
I'm going to close this for now. https://forums.adafruit.com/viewtopic.php?t=214284 diagnosed the problem as using a non-Unixish-shell.
@tulip sleet I tend to like enum enough to think we should probably add it to large boards
I don't have any specific experience with the reported issue about the older version. But upgrading does seem fine to me.
I did a test build from this branch locally and poked around the site a bit and did not find anything out of the ordinary.
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...
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...
Here's a video to provide a quick explanation of the module and a demonstration of the effect: https://www.youtube.com/watch?v=PoQpTWsgTkw
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...
Thanks for catching that. I hadn't built the docs yet myself. I'll have it fixed today.
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:
...
Updated changes with new archived URL. Not sure if I did it right for the Board URL line though.
Updated links to use the archived version of the old web page no longer online.
Thanks, looks good! I added a couple of comments.
I tested it and worked for me.
The mix_down_sample was used if the 32-bit value could be over the 16-bit size, but for a filter and with the mix will this ever be the case? I don't think a filter will ever make a single value larger then it started, and neither will the mix calculation.
Is this just to make the mixing easier, or is there a reason to not just use the original samples on line 296 to do the mix?
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 ...
Filter resonance can cause spikes in the output (ie: self-oscillation). I'm not against taking out this calculation, but it may reduce unexpected peaks in some situations. However, removing it would certainly simplify the module.
I think you have a point here. The second filter buffer (which I was just using as a copy for mixing later) isn't exactly necessary if we can pull from the original sample again in the mix loop.
After some quick testing with mix_down_sample removed, I think it is best to keep it as is. Without it, the output experiences significant clipping within the example above (tested with a resonance of 2.0).
I've updated the module with this change and it performs as expected.
@dhalbert The documentation should be fixed. It's fairly straightforward for now, so let me know if there's anything else that needs to be updated within the docs.
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...
Makes sense, just wanted to ensure it was required. Since we use this now in 3 places, I am thinking we need to look at making a generic version that can be called from everywhere. For me, doesn't have to be right now, but next time one of us updates a filter may be worth looking at.
Thanks @Atalanttore, @Sokromatrix, and @wtuemura!
Thanks @earlephilhower! @tannewt would you like to do a PR?
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...
I'm closing this in favor of #9749. There are several red herrings above, which are irrelevant to the actual issue.
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...
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.
where did the sense USB PID come from? Or is it really the PID for the base board?
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.
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
Fixes #9750. Thanks @bablokb for the diagnosis!
0x2886 is SEEED's VID, so that came from them somehow 🙂
I'll ping the author with a query
@djairjr Could you post more info and maybe a link about where you got the USB PID from? It looks like you got it from Seeed.
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.
2 fun facts.
- With just tape and pressure the psram chip on the feather rp2350 works.
- 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.
Folks who want to add Seeed support should just use pid.codes since it isn't someone from Seeed adding it.
Yes, I'll make a PR. I think I got this code from MicroPython so I'll check there too. :-)
belated thanks from me as well!
Please match the generated style for disable so that when it gets auto-changed it is consistent. Yes, kconfig is weird using comments in a disable.
This comment will disappear when these files are automatically updated using make update-all-sdkconfig
# CONFIG_ESP_SYSTEM_HW_STACK_GUARD is not set
# CONFIG_ESP_SYSTEM_HW_STACK_GUARD is not set
Clean alone can lead to crashes.
Fixes #9746
@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?
Nope, that's fine with me
will do
I removed it. Reinforcing my dislike of Kconfig.
I removed these in favor of turning it off completely in sdkconfig.defaults. See comment.
I don't like kconfig either
CONFIG_ESP_SYSTEM_HW_STACK_GUARD is enabled when SOC_ASSIST_DEBUG_SUPPORTED is defined, which is true for ESP32-C2, C3, C6, P4, and will eventually be true for C5 and C61, according to comments in ESP-IDF. So I just turned it off with not set in sdkconfig.defaults.
@slender iron I will make release notes and do an rc.0!
🚀
@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?
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...
closing this in favor or #9753
After talking with @tannewt, I'll merge this for 9.2.0, but label both audiodelays and audioeffects as "experimental: API may change". So people can try them but also we can feel free to modify the API.
Agreed. Looks good to me.
@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?
OK I think it looks good now.
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...
waiting for 9.2.1 is good with me.
@DogushC okay, thank you. Lets wait until you've got photos of the device. You can commit them to this branch once the boards come.
Automated website update for release 9.2.0-rc.0 by Blinka.
New boards:
- cezerio_dev_ESP32C6
- solderparty_esp32p4_stamp_xl
@dhalbert , i've got the USB/PID and VID in this message: https://github.com/adafruit/circuitpython/issues/9507#issuecomment-2298119726
with @marcobrianza
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_filteraudiofilters.Filter.high_pass_filteraudiofilters.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.
The audiofilters module and the first effect in the category, audiofilters.Filter, has been added to the core (#9744) with more coming. :smile_cat:
https://blog.adafruit.com/2024/10/23/circuitpython-9-2-0-release-candidate-0-released/
- New
audiodelaysandaudiofiltersmodules. These modules are experimental, and the API may change. - Bug fixes
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...
@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..
Totally understand, @onyx hinge. I'm rather new to the community and still learning.
That sounds like a great way to approach the problem and get to efficient realtime audio filters. There isn't any rush that I am aware of on the other filter types, so improving the foundation first is probably the best place to start.
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)
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.
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.
Custom Biquads is likely a much smaller use-case than BlockInput support.
{ 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...
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!?
so you're saying CIRCUITPY no longer appears. When that happens, are you still able to connect to the REPL via a serial connection?
It soundsl ike the flash is getting overwritten or corrupted in some way. Does your program do any writing to CIRCUITPY (after a remount), or does this happen just when you are editing files, and suddenly CIRCUITPY gets dropped?
When it no longer appears - I'm unable to connect to it (access/write to the drive, connect vial REPL etc.)
the mount will reappear for a short while
how long is a short while?
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.)
which version of CircuitPython? Have you tried the latest (9.2.0-rc.0, from last night)?
is code.py doing anything or is the Hello, World one?
I started up a Pico 2 with the latest and will just let it sit and see what happens
you might be onto something - changed the code to Hello World and it's 'holding' - about to try my previous code...
@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.
Wow, great work! Looking forward to checking out the PR. I'll definitely test it out on my side. As for audiofilters.Filter, it mostly borrows from the practices within synthio.Synthesizer. If the method definitions haven't changed within shared-module/synthio/Biquad.h, then we should be okay. If the updates go outside of that domain, I'll need to make a few updates to match.
If Bluetooth isn't supported on the Pico, it should be removed from "Available on these boards" and a note should link back to this issue. Ridiculous.
I didn't test it on HW yet
If Bluetooth isn't supported on the Pico, it should be removed from "Available on these boards" and a note should link back to this issue. Ridiculous.
It is available if you attach an AirLift ESP32.
... for frequency & q_factor. Not tested on HW but it looks good in a manual host computer test. Here, a sine wave is played 4 times:
first, unfiltered. Then with 3 frequency-swept filters: low-, high- and band-pass. The band pass filter has a much higher Q-factor than the other filters.
This needs to be separately wired into the new audio filtering code
All right! Thanks for checking.
fwiw this fixed several security alerts that were probably irrelevant to our use of cryptography; see https://github.com/adafruit/circuitpython/security/dependabot/1 (may only be visible to organization members)
Looking great so far, but I have a few quick notes:
- I assume you're using the property name
synthio.BlockBiquad.kindto avoid confusion with the global,type. Have you considered usingsynthio.BlockBiquad.modewith the enumsynthio.FilterModeinstead? - Looking over the calculations within
common_hal_synthio_block_biquad_tick, I don't immediately see any reason whysynthio.BlockBiquad.kindneeds to be read-only. It may be nice to be able to switch between filter types without ...
It's confusing that _bleio can mean native BLE support or AirLift-based support. Explain this more thoroughly in a note in the doc
@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.
@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.
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 ...
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?
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.
See for example https://shop.pimoroni.com/products/pimoroni-pico-plus-2-w, which use a "Raspberry Pi" labeled module. This module was not available separately previously.
now that it's available separately, it can be incorporated into third-party mfr designs
@tulip sleet thanks, that's great news, I hadn't seen that
I am not sure if beta is buggy or not.
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.
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
I think I have one these https://circuitpython.org/board/adafruit_feather_huzzah32/ I could test with. I believe that doesn't have the drive. I don't have any of the C3 based ones yet, but could pick some up.
it's plain ESP32, yes, that would be a good test
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
It does some weird tricks to set memory before addresses in some cases
so that gives a bit of buffer
I thought maybe that. Maybe I will just try zeroing that word.
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...
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...
i see you mention resetting x[] and y[] but .. we don't have access to them when setting the property, because they're associated with a note. You can have the same filter on multiple notes, and each note has its own x[] and y[].
I think maybe this is some caching problem? I used the nocache psram address for the psram heap pool instead of the cache psram address, and it does not have the problem seen in the issue.
@todbot ping in case of interest
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...
I was able to reproduce this problem. I also experimentally changed the PSRAM memory address to point the uncached access address space, and that does not show the problem. So I think it is some problem with the caching.
- 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...
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...
Passes every test I threw at it. The only thing I didn't test is for corruption.
Everything in the issue is fixed with this commit, thanks!
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...
@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...
The download bootloader zip button is now working properly and does download the appropriate file.
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...
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
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...
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...
The difference between is described in a comment here: https://github.com/adafruit/circuitpython-org/issues/1440#issuecomment-2253342689
Resolves: #1268
Added note about no labels on silkscreen and which pins are configured by default
can code.py start faster than 5ms on power up? context is for dealing with a power on delay for attached i2c device.
you can compile custom firmware with the safe mode check disabled, not sure you will get it down to 5ms though
another solution is to add a way to restart the i2c device
this is for stock builds. nothing fancy.
for example, could this even happen with CP?
https://forums.adafruit.com/viewtopic.php?t=214382
i'm guessing CP somes up slow enough it'll be > than the 5ms
CP waits over a second after a power on reset before running code.py. The wait is for the safe mode button press
should we lock the pico w ble issue?
@slender iron thanks. so generally not possible. by the time code.py is going, its way past the device's POR timing.
and if that is being done, the necessary delay can be in user code
right
But you have spent a lot of time on
tlsf, so maybe I am wrong.
I bet you are right. I could have been trying to fix this caching issue by doing the offset.
Thanks for the investigation and fix!
The latest commit fixed the device that had a build problem.
Reminder to self: Once this is merged, update the page here: https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/adding-to-downloads#header-3034486 with the Castellated Pads option as well.
Resolves: #1087
With this change the list has limited height and can scroll.
Screencast from 2024-10-25 13-34-47.webm
can someone review https://github.com/adafruit/actions-ci-circuitpython-libs/pull/24 please?
done
thanks!
why I don't like asking questions on stackoverflow: https://stackoverflow.com/questions/79124216/does-a-c-pointer-to-volatile-treat-the-addressed-memory-as-volatile-when-it-is-s
you can see my original q here: https://stackoverflow.com/posts/79124216/revisions, which I thought was pretty clear, but well...
Resolves: #1035
I added them below the built-in modules inside of purple "tag" elements.
The do not currently do anything when clicked.
This was my interpretation of the "little boxes" mentioned in the linked issue. I am open to feedback on the style or placement of them.
Currently I have a two step process that goes like
- Put board into UF2 bootrom, copy over CP UF2
- 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
On many boards where the filesystem is in internal flash, you can copy CURRENT.UF2 from the bootloader, and it will include all of flash, including CIRCUITPY
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?
maybe wait a bit; if there's no further discussion, we can leave it alone. Locking it will provoke reactions too (though not visible ones)
I unsubscribed from it so I won't see it in my email anyway
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
rp2040 bootloader doesn't have CURRENT.UF2, but there is a way to do this with picotool.
Oh? ok I'll take a look
see README https://github.com/raspberrypi/picotool and I'm sure it's written up elsewhere too
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
well that's something
FYI - I just used the Installer for the first time on a few MagTags - These were MagTags that had not been used for quite some time and were way out of date. The Full Install worked perfectly. Thanks for this tool.
Resolves: #1034
Make the download_instructions metadata field valid for CircuitPython core in addition to Blinka. If it has a value add a button linking to it to the download page.
I've only added the metadata to a single esp32 so far, but the rest of them could get updated to point to this guide if the way this has been added looks okay.
Maybe it should be inverted / outline only like the open installer button? So that there is only a single solid purple filled one?
Does the "Installation Instructions" link cover multiple possibilities? In that case maybe it shouldn't be a button like the others, but a link in the text above? Or, some distinct kind of button. Otherwise it looks like one of several similar choices.
@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...
It currently matches the style that is used for the same concept on Blinka devices:
However it's not a 'clean' comparisson because there also is no download button or installer button.
@pastel panther way back in the day I made this https://github.com/jepler/mkfatimg -- if there's a way to concatenate uf2 files you could put the CP one followed by a UF2 created from the image that this program made. I've never used it "for real", though, and it's years stale.
(also, hi!)
👋
I was thinking of distinguishing the "instructions" link from the data/action links:
or
or
The placement in these examples is not great, but I'm just trying to show some variations on style and placement.
(If I may contribute a suggestion)
Sorry to interrupt, but could you add "PITCH" audio files (audiocore.WaveFile and audiocore.RawSample) ?
It would be great to see this implemented on the RP2040.
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...
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...
<@&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
This was reported earlier in #9755 and was fixed in #9759, and will be in 9.2.0 final. You can try the artifacts in #9759 if you'd like.
Based on suggestion by deʃhipu to help katylase on #help-with-circuitpython
Not all the translations fit, sorry!
You could turn off CIRCUITPY_BLEIO_HCI, that is probably less popular than gifio would be.
I didn't know meowbits had ble...
I didn't know meowbits had ble...
They don't, that is for attaching an external AirLift.
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.
Are you sure GIFIO is still enable?
It feel like it has been lost in the diff, I don't see the line, nor as =0 nor as =1. Or by default if it is not there it is =1?
Are you sure GIFIO is still enable? It feel like it has been lost in the diff, I don't see the line, nor as =0 nor as =1. Or by default if it is not there it is =1?
It is on by default if displayio is on.
Thanks guys! I'll try it right away!^^
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...
Do you feel like you could submit a PR? Most of us don't have this board available to test.
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...
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,...
Hi - please use the new header formats for all the .c and .h files. You have them for some but not all files.
You can omit these - the defaults will work.
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
@noelanderson This PR has two-year old commits in it? Are you trying to make a PR to adafruit/circuitpython or to your own repo?
@bfschris Circuitpython does not support BLE on the pico w, micropython does support BLE on the pico but there are some things that micropython cannot do and circuitpython is needed for, I also think circuitpython is more popular.
I dont think a combination is possible but someone else would have to verify that.
I hope this clears things up for you.
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.
what are you trying to do?
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.
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)?
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...
@ItsTerm1n4l - thanks much, that does help.
Does anyone happen to know where I could find a comparison chart of the two? or some kind of analysis of the pros/cons for the Pico W platform? My goal being to see whether I can accept the reduced feature-set of micropython or whether the Pico W experiment is a dead-end for me.
thanks again -
One more question: Can anyone recommend a different platform with similar power consumption, size and cost to the Pico W, which will work with Circuitpython and support BLE and Wifi natively (with no add-on boards)?
@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...
@onyx hinge I will go ahead and do 9.2.0 final, unless you have anything else you think should go in.
@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!)
Agree - 9.2.1 with improvements can follow.
Since this thing has a specific display type built in, disabling other displays makes sense as a trade-off.
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...
Automated website update for release 9.2.0 by Blinka.
@dhalbert - thanks so much and my apologies, making you repeat yourself. I see now that I kept glossing over the nRF52840 as just a BLE solution (like, a BT dedicated chip), but I see now that it's integrated w/ the M4 processor. At first glance, your ItsyBitsy might work for my project, if we can forgo the WiFi.
(Adafruit ItsyBitsy nRF52840 Express - Bluetooth LE)
thanks again!
Yes, on nRF and Espressif, the chips include a radio, so it's an integrated solution, instead of a co-processor, like on the Pico W.
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 -
Neat! Thanks for adding this.
I tested it successfully with a unix port build locally. (my first time building the unix port :tada: )
No worries, sometimes these things have a mind of their own! I've also seen devices do weird things and then later been unable to get it to repeat.
Sorry that it took so long to reply to your issue here, I'm glad it's working for you now!
Thanks @johnnohj I like the 'installation instructions' button up above the download links. I'll tinker with it today and try to get it shifted up to there.
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 ...
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...
The latest commit moves this button to up above the download buttons and next to the release notes link:
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...
Unfortunately, I don't have such examples for implementing this in code. But I can explain using the example of a DAW, let's say I have an Ableton and a piece of sound, I want to change the "Pitch" to it, I go into the clip settings and move the transposition knob, thereby I change the "Pitch".
Closes #9739
Might need some more work to properly document the modes that become usable (see #9736)
I think I have one of the 800x480 panels that would be made usable by this code, but I have to dig it out.
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
I poked at this for a little bit but did not end up finding the right way or place to change the filtering behavior to invert it for the "not" effect. I do think it's possible, but might be more complex than my original comment makes it sound even if we do skip the visual UI.
How about "HOW TO INSTALL" as opposed to "INSTALL INSTRUCTIONS"?
I too think the .UF2 should be first.
"HOW TO INSTALL" fits nicely and I do think it's better than using "INSTRUCTIONS".
The latest commit changes to that.
I've created #1517 to track swapping the UF2 and BIN buttons. I think I have a relatively simple idea to implement it, if that works out I'll submit a seperate PR for it.
"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...
Devices that have downloads for both will list the UF2 download above the BIN download with this change.
"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 thefrequencyto get normal playback, and then modify thebendproperty 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/...
Playing back a sample at a different rate will of course change both the pitch and the tempo. Changing pitch and tempo independently (including changing pitch while preserving tempo) requires a more sophisticated algorithm (see e.g., https://gstreamer.freedesktop.org/documentation/audiofx/scaletempo.html?gi-language=c which cites "WSOLA" as the underlying algorithm).
Reminder to self: Once this is merged, update the page here: https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/adding-to-downloads#header-3034486 with the Castellated Pads option as well.
I just did this.
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.
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...
https://learn.adafruit.com/building-circuitpython/linux says to install 13.2Rel1. It doesn't say it's the minimum, it just says "use this"
Any interest in helping add OpenThread as a network interface? I started a while back but kept getting hard faults
@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.
@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
the only board that has the URL filled in so far is the huzzah 32 feather: https://circuitpython.org/board/adafruit_feather_huzzah32/ ( I had to "hard refresh" with ctrl + f5 to force the CSS to get refreshed instead of the cached file for it to appear correct)
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.
ah, ok, thanks, I thought there was a generic link for ESPnn
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.
#error GCC versions lower than 12 are known to miscompile CircuitPython for ARM microcontrollers
#endif
For my own convenience I'd probably write this, because I have arm gcc 12 across a range of machines .. but at the moment xtensa gcc and riscv gcc for the espressif port are ALSO at 13 and our official recommendation for all ARM ports is also 13 so maybe I want 13.
wdyt?
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
I hope we would never want gcc 21 for one arm platform and gcc 23 for another
what does it need from 10 that is special? ive got a target i want to eventually support, that is gcc6 based...
or, is it only an issue for the arm gcc?
Update the 'how to install' link to the device specific guide page for huzzah 32 feather.
<@&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!
CircuitPython Weekly Meeting for October 28, 2024 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates before the meeting, alphabetically by your username. During the meeting, we go through them in order. If you can’t make the meeting and woul...
tbh I don't know, except that I built it and it didn't work (compiled but would not start circuitpython)
i think there were linker bugs
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
in the link time optimization stuff
ah
@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
Attached: 1 video
Proof-of-concept done! Vinyl scratching SAO seems to be working electronically. Now to try and cram everything on the PCB, and improve the code 😅
🎶 Sound up! 🎶
#hackaday #supercon #sao
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...
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 ...
Hug report: Thank you all for 9.2.0
Change ipaddress_ipv4address_print() to quote the IPv4Address if kind is PRINT_JSON
Fixes issue 9768
Without fix:
With fix:
Thanks for hosting Jeff, have a great week everyone!
@lone axle looks like there's "page.path" in the jekyll predefined variables https://jekyllrb.com/docs/variables/#page-variables maybe try that
Nice! thank you
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...
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.
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 �x...; 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
...
https://github.com/itszor/vc4-toolchain never got upstreamed
A port of the GNU toolchain to the Raspberry Pi's VideoCore4 processor. - itszor/vc4-toolchain
@buoyant lagoon aha
(Is this a good channel to ask about the CircuitPythonistas role?)
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
Made no sense on how to remove the SSL issue and actually get libraries onto the Pico
CircuitPython itself doesn't use urllib3 or OpenSSL at all. You shouldn't be getting those errors in CircuitPython. It sounds like you are running code on the host computer.
Yes, I am using code.circuitpython.org on a Chrome browser. Using 2 different Macs, an iMacand a MacBook Air
when do you see that error?
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
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.
what versions of macos are on your computers
you don't have to use circup. You can just download and unzip the bundles and copy the library files or directories over individually.
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
@tulip sleet since it's a wifi board I think just unzipping is not an option here
thonny or code.circuitpython.org would work
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
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
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)
also the current python version is 3.13.0 so if you're just starting out it might be better to go all the way to the current, not to 3.9. https://www.python.org/downloads/macos/
(assuming that it's compatible, again I don't know much about macos)
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.
I'd listen to danh about that
I just did the update and it might have been 3.13
the macbook air should Python 3.9, I think
Is there a way to restart Python without restarting the Mac
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
Just to let you folks know how clueless I am about command line AND Python, what the heck is brew?
it's what developers and other folks use to install third-party command-line software and other software on macOS cleanly
setting up a venv???? command line clueless......
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.
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
i have the ESP32 Pico board connected on the iMac with code.circuitpython.org
To understand about venv, you can see https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi. It's RPi-centric, but the explanations should help.
what were those 2 Pull request messages about?
BTW, many thanks!! I think I just got saved a few days of bouncing messages off the forum
This is the core development channel. Probably better to switch to #help-with-circuitpython . Those are automated messages from github
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!
New info from RPI engineers give a slightly better/safer method.
https://github.com/earlephilhower/arduino-pico/pull/2563
https://forums.raspberrypi.com/viewtopic.php?t=378249#p2263677
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
CircuitPython Weekly Meeting for November 4, 2024 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates before the meeting, alphabetically by your username. During the meeting, we go through them in order. If you can’t make the meeting and wo...
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'
Seems like it was trying to install from the device itself? Installing from local path: adafruit_led_animation
Did you have a copy of the lib on the CIRCYTPY's root of file system?
It's not impossible that was the case hmm
Or maybe you had you terminal opened in directory that had a copy of adafruit_led_animation?
I destroyed the evidence but I think I was in my CIRCUITPY or maybe CIRCUITPY/lib path
@lone axle if we've given you the ability to poke "merge" in circuitpython you should exercise it in https://github.com/adafruit/circuitpython/pull/9766 🙂
github reports that I am not authorized to merge to that base branch.
@lone axle OK, good to know.
I'm probably not intended to give you that authorization uniltaterally 😁
CircuitPython version
Adafruit CircuitPython 9.2 macropad rp2040
Code/REPL
File "adafruit_debouncer.py", line 32, in
ImportError: no module named 'adafruit_ticks'
Behavior
fails to load
Description
File "adafruit_debouncer.py", line 32, in
ImportError: no module named 'adafruit_ticks'
Additional information
No response
Hi everyone,
I would like to check if Pull Request #6057 is still relevant.
https://github.com/adafruit/circuitpython/pull/6057
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.
Sorry for the "noise" ...
under https://github.com/adafruit/Adafruit_CircuitPython_HID/issues/121
I found what I was looking for,
And it is working fine with CP 9.2.0
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...
This device doesn't have them
relevant in what way? it's been merged 2 years ago
I'have a pin that turn on every time i start my board if i turn it off in the boot.py file or in the main directly it s go back to on when the program finish so im looking to turn it off from circuipython itself
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...
If you're building custom firmware or firmware for a new board, then I believe the PR you referenced is still relevant, yes.
Ty
On a similar topic, I'd also like to support mono sources within a stereo AudioMixer (ie: mono sample with panning). But I think both of these problems likely belong in a new Issue.
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...
...
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...
You may mean to write from test import test instead
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.pyI can't put it in the root folder of my project or in my PYTHONPATH, because it would shadow thecodemodule required by pytest and oth...
At least the following 4 names are always supported for the primary code file:
"code.txt", "code.py", "main.py", "main.txt"
so maybe one of the .txt files would help with what you're trying to do.
Well thanks @jepler, you just made my day
At least the following 4 names are always supported for the primary code file:
"code.txt", "code.py", "main.py", "main.txt"so maybe one of the .txt files would help with what you're trying to do.
I use main.py exactly for that reason. It allows me to run unittests both with CPython on the desktop computer, and in Circuitpython. No complaints about shadowing.
fwiw just referring back to my private notes I tested microcontroller.nvm on rp2350 back on September 17 and didn't see this. However, I didn't record my exact testing steps. I was most likely testing on the Pico 2 and probably wasn't resetting the board during my testing procedure, just immediately reading the value back.
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...
@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.
I hadn't thought of it before, but I like the idea. It should be fairly easy to try it out I think. I'll do that a bit later today.
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
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...
We could potentially add underline to the white text of the modules to denote that they're links. They will also still retain the "pointer" mouse cursor which typically indicates clickable things like links.
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.OVERDRIVEandDistortionMode.WAVESHAPEalgorithms. - [ ] 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.Filtereffect?...
Just created a draft PR for a Distortion effect: https://github.com/adafruit/circuitpython/pull/9776
I also tried to reproduce, on a Feather RP2350, with PSRAM https://www.adafruit.com/product/4677 installed, running 9.2.0 final. I did not get a crash, either by reset or power cycle.
My boot.py was exactly as above. I tried 0x00 and 0xff as values for go_dev_mode. My code.py was just a print statement.
@b-blake What is in your code.py?
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.
neither is there a way to tell it to turn off completely, automating the 3 vs 4 byte value
I don't think
Ah, good point.
hmm, see the code here, where it converts 3-value to a white value: https://github.com/adafruit/Adafruit_CircuitPython_Pixelbuf/blob/228cf76e356289dc1e80262299373cac666774c3/adafruit_pixelbuf.py#L247
it looks like it converts (n,n,n) to (0,0,0,n)
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.
Sorry, too many tabs and I accidentally pasted this link into the wrong one 😢
My boot.py
import time
import board
import storage
import neopixel
import digitalio
import microcontroller
go_dev_mode = 0x12# change to crash
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"
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 ...
When I change the value:
- I save the boot.py. The code.py restarts just fine. Sometimes it waits for a key in jepler's code.
- I push the RESET button on the Feather RP2350. The NeoPixel starts flashing Yellow
- I open COM13 and REPL says the MCU is in Safe Mode.
- I push RESET again and all is fine and code.py runs and waits for a key stroke.
I think we need to add more fluff for the full effects package as well.
- Maybe a bitcrasher?
I think we need to add more fluff for the full effects package as well.
* Maybe a bitcrasher?
I don't know exactly what you mean by "fluff", but the audiofilters.DistortionMode.LOFI is a bitcrusher. In fact, it may need to be renamed to better represent that.
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 ...
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.
Thanks! We'll need to test Pico W (RP2040) for any regressions, unless you have done so already.
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.
...
Yup,
Let me change it back and retest.
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"
`
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
`
Images automagically compressed by Calibre's image-actions ✨
Compression reduced images by 31.1%, saving 1.65 MB.
| Filename | Before | After | Improvement |
|---|---|---|---|
| assets/images/boards/large/challenger_rp2350_bconnect.jpg | 190.31 KB | 128.78 KB | -32.3% |
| assets/images/boards/large/challenger_rp2350_wifi6_ble5.jpg | 191.94 KB | 131.16 KB | -31.7% |
| assets/images/boa... |
I am just looking for a small piece of code that causes the safe mode problem, regardless of whether or not it's really doing the mode logic correctly.
@dhalbert I carefully reviewed the 10 commits picked up by this change. The only intersection with Pico W WIFI is in AP password handling. Built "Adafruit CircuitPython 9.2.0-3-g169595eb4a on 2024-10-31; Raspberry Pi Pico W with rp2040" and ran Adafruit Pico W Wifi examples. No regressions.
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...
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.
Here is a .zip of my boot file.
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]:
import microcontroller
microcontroller.nvm[0] = (microcontroller.nvm[0] + 1) % 256
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...
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
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...
All those tests run against the unix port.
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
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!
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
If you remove your cut-down boot.py, does safe mode not happen?
Could you erase CIRCUITPY and reinstall those libraries? It's possible one or more of them is corrupted in some way that's causing a hard crash.
Thanks, that's straightforward; I'll attempt to reproduce.
No change is crash. I was not clear
* 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 ...
I've reproduced this and am working on a fix.
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...
Cautioning the developer when doing something wrong is helpful. Thanks!
- 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
nvmcode, and use it ininternal_flash.c. - Update to a safer cache-flushing scheme, as mentioned in #9770.
Also see:
https://forums.raspberrypi.com/viewtopic.php?t=37...
@b-blake #9783 has a prospective fix. There are builds to try in the "Artifacts" listing here if you would like to test: https://github.com/adafruit/circuitpython/actions/runs/11637328418?pr=9783
Yes, I will do that. Won't be before Tuesday though.
I can change the message because it's not actually the case that e.g., arm gcc 12 is "known to miscompile" the raspberrypi port, but this is the general idea of stopping folks from accidentally building with a gcc version different than what we use during CI
makes sense as a potential bug source.
Fixes #9781
Tested with
- Pico (rp2040)
- Pico2 (rp2350a)
- Pimoroni Pico Plus2 (rp2350b)
@dhalbert @jepler
Your fix works great on my Feather RP2350!
Still curious why including the adafruit_ libraries caused the crash. The relationship eludes me.
thank you for writing this & testing it across all the MCUs!
If you haven't found it yet, this sounds like get_buffer is still being called and not finding a sample so calling random memory.
Still curious why including the adafruit_ libraries caused the crash. The relationship eludes me.
Thanks for testing. I don't think it's a specific library, but it may have to do with the size of the library. I got it down to importing adafruit_display_text, which is fairly large. As I trimmed things out, it stopped crashing.
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...
See https://github.com/adafruit/circuitpython/issues/9768#issuecomment-2453051428. We want to be compatible with CPython, which will not produce valid JSON with an ipaddress.IPv4Address object either. But instead we should print the address as IPv4Address(...), and similarly for IPv6Address.
In general, CircuitPython inherits from MicroPython the limitation that use of incorrect types in json.dumps is not diagnosed.
This issue has been reported upstream at Micropython with the response that "This was a design decision. It's undefined behaviour if you serialise something that can't be serialised" https://github.com/micropython/micropython/issues/1719
And documented in Micropython. we may not be reproducing this portion of the documentation in the circuitpython online docs. https://docs.micropython.org/en/latest/genrst/modules.html#json-module-does-not-throw-exception-when-object-is-not-serialisable
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...
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...
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.
, causing an infinite while loop (https://github.com/dcooperdalrymple/circuitpython/blob/24a8927d0ce1d77addd584bf809ab73cb0386e75/shared-modul...
zizmor is "A tool for finding security issues in GitHub Actions setups." It found multiple diagnostics in our actions; I have made an attempt to fix the findings.
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.)
What the title says. Just a one line change.
This makes sure boot_out.txt is created in the scenario that someone wipes from safemode, so that tools that look for it find it.
This is a good idea -- thanks! I might have encountered someone with exactly this situation recently.
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.
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 😅
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.
Fix has been implemented in https://github.com/adafruit/circuitpython/pull/9787. The solution was rather simple and all examples now function correctly.
it's fine to rebase your own fork. Just be careful you don't introduce any regressions of submodules., etc.
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 ...
The following int properties of synthio.Note have been updated to support synthio.BlockInput:
synthio.Note.waveform_loop_startsynthio.Note.waveform_loop_endsynthio.Note.ring_waveform_loop_startsynthio.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 ...
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.
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)
@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...
I am talking to someone privately who is also working on this, albeit slowly. In the meantime, go ahead and offer help in the thread.
Thanks, I'll try that indeed. The thread just seemed to be going in many directions 😅
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....
I'd say don't bother to advocate, since that isn't necessary. Just offer help.
I'll discuss with the person in question about whether they want to go public yet or not.
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...
Super, I appreciate it!
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...
The purple tags are really "loud" visually. I think I would prefer leaving the current styling for modules as is (but fix the comma spacing), and changing the feature tags to look like the module tags. The feature tags could also be made clickable, so you get a search of all boards with that feature.
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 //...
I prefer them a bit more muted as they are now as well. The features should pop more than the modules.
Taking this further, I kind of think the module links shouldn't be in that box at all. They are overwhelming to most users just trying to install CP.
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_lengthis 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...
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?
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
some more need to be fixed here, but never mind that for now. the whole too-long list should be checked.
yes, these should have been KW_ONLY all along, good catch. I think it's an undiagnosed error in the core if a KW_ARG_ONLY argument is followed by a non-KW_ARG_ONLY argument.
do these docstrings need to be updated? I haven't read below to see how you deal with out of range values from a varying BlockInput
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...
To do this without spending a lot of code, a new type flag is used for this.
This behavior is in line with standard Python.
Closes: #9768
And changed the features list to use the modules styling as mentioned in the discussion in #1524.
I found information from the liquid docs here: https://shopify.github.io/liquid/tags/iteration/ that ultimately led to a fix for the extra commas issue.
The extra spaces before the comma seem to be caused by the closing of `` on the next line instead of the some one as the contents.
Closing this one. #1525 provides a fix for the commas and spacing as well as switches the features over to be styled like the modules.
@tylerdcooper all of the modules listed are included in the UF2 file. If the user downloads that UF2 file they will be able to use any of those modules without having to manually load anything else.
Also note the module list is also here for each board: https://docs.circuitpython.org/en/latest/shared-bindings/support_matrix.html
I haven't figured out how to build unix build-standard with synthio support just yet, but I'll dive into that soon. I'm assuming your solution is to update the tests to use floats instead rather than attempt to get integers working with BlockInput?
And I'd rather fix the tests first before merging.
This is exactly what I had in mind from #9768, but I hadn't checked whether we had room. Thank you for doing this quickly!
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 ...
Thank you very much for the instruction, @jepler ! I'll tackle that this afternoon and get the PR ready for merging.
<@&356864093652516868> The weekly CircuitPython meeting will be held here in discord in the CircuitPython audio channel and the #circuitpython-dev text channel in two hours (note that Daily Savings Time stoppoed in the US over the wekeend). Contribute your notes to the notes document: https://docs.google.com/document/d/1SwEhvqe79PPybH0QJnaPW-138ecPd9IYVdVukvgCi_Y/edit?usp=sharing
@tulip sleet if you get a moment can you take a look at https://github.com/adafruit/circuitpython-org/pull/1504. The typo you noted before is fixed, but it looks like github blocks it until the requested changes are marked approved on it.
This is subsumed by #9789.
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.
I'll keep this conversation open until you've reviewed the changes. Let me know if you have any other suggestions.
@tulip sleet (I think you're hosting?) I'm happy to read core or blinka sections at your request
sure, could you read core, and I'll read blinka (because I have a comment there anyway)?
OK, sounds good
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...
In arduino, I think the correct method to set long range mode is this :
esp_wifi_set_protocol( ESP_IF_WIFI_STA, WIFI_PROTOCOL_LR));
Is this exposed method in Circuitpython?
<@&356864093652516868> meeting starting momentarily
[I could do without the spooky sound effects, Discord!]
spooky time is over!
This week I took a look through the issues on the CircuitPython.org repository and implemented several fixes and enhancements found within them. These changes are live now, so you can check them ou…
and zero issues not assigned a milestone because Dan has been keeping on top of things
🎉
https://github.com/issues <- for logged in users, defaults to showing all your open issues across all of github
makes sense tim
Most of Europe changed a week ago I think
thanks Dan!
Thanks for hosting Dan! have a great week everyone 🎉
Thanks Dan!
👋 Thanks Dan. Have a great week, all!
Oh! Next week's meeting is on Tuesday November 12 as we observe the Veterans Day holiday on November 11.
<@&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.
some youtubers just dub a very clear text to speech clip over mistakes, for the lulz
it both fixes the error, and adds some fun "yes we know" to it
my main issue is finding a usable editing program on Linux
I have had decent luck making basic video edits with https://www.openshot.org/. Though much like photoshop and similar the interface is a bit overwhelming with a million features.
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
@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.
I did, I will spot check that it came out real fast and upload and then share a link in a moment.
got it
I don't find esp_wifi_set_protocol in the current core implementation, and it's not exposed to Python code as a CircuitPython API, so default of b/g/n is used. For now, I would think 1Mbps would be best for range.
I think the rates 0x10-0x1F require 802.11ax, which is only supported so far in the WiFi-6 ESP32 variants: C5, C6.
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 ...
I don't know that this is right. Isn't memset always working in byte units, in which case this is likely to fill with all zeros (the lower 8 bits of 32768)?
@dcooperdalrymple @todbot can either of you do a review of this PR on the technical side? I don't think you can mark it "approved" but your comments would be helpful.