#circuitpython-dev

1 messages · Page 67 of 1

short tendon
#

But if it wasn't connected it would wait 5 seconds before continuing...

crimson ferry
#

Yeah, even if that gets separated out into a separate connect, I wonder if a smaller max timeout could be used

short tendon
#

Yeah, I struggle with where also. I usually do here, or open up a PR...

alpine holly
#

I'm toying with adding 4-wire SPI SD-Card (SDIO/MMC) support for esp32 - i.e. implementing sdioio library for esp32. I have the tech know-how to make it work, but no "administrative" understanding of what I need to do inside my "ports/espressif/boards/ai-thinker-esp32-cam" folder to cause this lib to be included, and what else I need to do to generally make this work available for anyone else with esp32... is there anyone reading this who can either lay out the steps I need to take, or point me to someplace that might explain it?

wraith crow
onyx hinge
#

(make BOARD=whatever clean after changing those .mk files)

manic glacierBOT
manic glacierBOT
#

There is some build warning here that is being ignored that I need to track down. It doesn't seem to affect the generated code, though. I did a smoke test and various qstrs look fine, so not sure if it's related to qstr generation.

From a local build of pico w, but I see this one any build:

Root pointer registrations updated
GEN build-raspberry_pi_pico_w/genhdr/root_pointers.h
Module registrations updated
GEN build-raspberry_pi_pico_w/genhdr/moduledefs.h
QSTR updated
GEN build-r...
manic glacierBOT
#

MicroPython has removed all uses of STATIC and replaced them with static: https://github.com/micropython/micropython/pull/13763/ . We'll see this in our next merge from upstream.

This PR gets a head-start on that by replacing STATIC, but in CircuitPython files only. We'll wait for the MicroPython merge to pick up their own changes for this. Doing this now will save some work during the merge, and will consolidate this change in the next release along with other many-file changes done...

tulip sleet
alpine holly
#

@wraith crow @onyx hinge - excellent help and references - thanks heaps.

manic glacierBOT
#

I've given this some additional thought and I am thinking about this tentative plan:

Move backends.py from the Circup repo into a newly created repo (and probably shared.py but need to look closer to confirm). I'm not sure that "Backends" is the best name for it in the context of being it's own library. I am thinking either "circuitpython-connector" or "circuitpython-integration" both of which are a little more relavent to the libraries purpose in my mind. Backend to me implies that i...

onyx hinge
#

The Internet here is not good enough to support me joining with voice but hello from pycon! I'll be back next week.

lone axle
slender iron
#

panic is the company

lone axle
turbid radish
#

It does help

manic glacierBOT
lone axle
#

That sounds like an AWESOME idea for a hackathon challenge!

manic glacierBOT
lone axle
#

if you have or are willing to make a simplified reproducer that illustrates that issue (removing some code alowing it not to crash) it would be good to post it in an issue on the nina-fw repo perhaps.

manic glacierBOT
#

I have been doing some benchmarking and the slowness of PWM setting immediately popped out. Looks like it is a known issue which still need to be fixed? And is there any background on if/how the SAMD PWM peripheral is different from e.g. the RP2040's, which requires setting it to be handled differently?

I don't think it needs to be different. It just hasn't been updated. See https://github.com/adafruit/circuitpython/issues/7653#issuecomment-1447322516

silver tapir
#

Thanks for hosting Dan.

lone axle
#

Thanks for hosting Dan. Hope everyone has a great week!

slender iron
#

500 boards!

tulip sleet
#

Here is the notes document for next Tuesday's CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord, but is a day later than usual due to a US Monday holiday. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1EvRvqSdQW_nMZFkgvgHDKlqHlMl08z2QehnGhNohHSA/edit?usp=sharing

opal crystal
#

I see I was mentioned with my Playdate project – thanks @turbid radish ! Just one addition to what's mentioned in the notes doc (although as far as I see the newsletter has gone out already): I’m better reachable on Mastodon than X, https://mstdn.social/@isziaui.

scenic ibex
#

Heya! I was told it'd probably make more sense to post things over here vs #help-with-circuitpython , so I'll repost a few bits about what I'm trying to do:
Short version is I've got a custom board I've made that is super similar to the badger2040w in design, which I want to use circuitpython for (and previously, I've been successful in just using the prebuilt badger2040w distribution for it, I sorta designed it to be basically pin compatible for it), but due to some supply issues, I'd like to switch to using a SSD1680 based display vs the UC8151D that the Badger2040w and the past revision of my board uses, along with a few other more obvious tweaks. I've found a few sources and am prepared to dive into mountains of other datasheets and code to figure it out ( Waveshare's Arduino Driver and Docs being a primary resource, along with the official adafruit_SSD1680 circuitpy library, and the SSD1680 docs themselves ) , but figured I'd ask around to see if someone's done similar stuff before that I can use as a base.
I have stumbled across the Czech Maker's Maker Badge: https://circuitpython.org/board/maker_badge/ , which uses a SSD1680 based display, but in the firmware they just instantiate things on the python side vs in board.c, meaning the display doesn't show up as a "built in" part of things. I'm a bit unsure of how it works, but I assume that means it doesn't display nice error/crash messages on the screen like it would if it was properly setup/initialized in board.c, so I'd like to try and figure it out if at all possible.

tulip sleet
lone axle
#

At the very end of the log it seems to indicate success building the stubs, but then immediately afterward it fails to find the file that would have been built.

Successfully built circuitpython_stubs-9.0.4.tar.gz and circuitpython_stubs-9.0.4-py3-none-any.whl
make[1]: Leaving directory '/home/runner/work/circuitpython/circuitpython'
WARNING: Requirement 'circuitpython-stubs/dist/circuitpython-stubs-*.tar.gz' looks like a filename, but the file does not exist
Processing ./circuitpython-stubs/dist/circuitpython-stubs-*.tar.gz
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/home/runner/work/circuitpython/circuitpython/circuitpython-stubs/dist/circuitpython-stubs-*.tar.gz'

make: *** [Makefile:281: check-stubs] Error 1
Error: Process completed with exit code 2.
#

All 3 of the 9.1.0 beta releases did complete their actions successfully and upload artifacts to pypi successfully so those are available as pre-release versions. beta.1 and beta.2 both were released after 9.0.4 as well

tulip sleet
midnight ember
scenic ibex
#

I think I've been able to parse a good bit of it and at least understand what I'm looking at more, but some of the LUT config options are still going over my head at the moment

midnight ember
#

Sounds like you're headed in the right direction. Because the init sequence is already done in the library that's actually one of the hardest things to figure out and it's already been done. The build configs might take a lot of trial and error so don't get discouraged, keep at it.

scenic ibex
#

it seems like some drivers I've found do set the LUTs explicitly, but the more adafruit/circuitpython adjacent ones don't (using default settings probably?)

midnight ember
#

I don't have any experience with einks but just glancing over the maker badge and pybadge they're different enough from a TFT where I can't offer any solid advice on the build config. I'm used to working with TFT's. There are many eink builds in ports/boards to look into for examples even if they're slightly different from what you might need, looking into other examples helps.

scenic ibex
#

Yeah, I've been scouring a bunch of different examples and libraries so far, and they've been pretty helpful

midnight ember
#

Any boards from adafruit with ssd1680 can be found by searching the store https://www.adafruit.com/search?q=ssd1680 and then you can probably find them in ports/boards. The closest example is probably the Pimoroni InkyPhat but I couldn't find the port for it, seems like it's for the Raspberry Pi only.

#

Well, it might have been the closest example if there was a port for it. Maybe it's in ports but I couldn't find it.

tulip sleet
scenic ibex
stuck hatch
#

Hello.
Sorry, not sure if's the right place to ask, but thought maybe asking here first before filling github issue would be better. 🙇‍♂️
I am using Circuitpython 9.0.4 on T-Display S3, to have multiple DIY air quality sensors. Along with air metrics I also measure voltage on USB/battery like voltage_in = analogio.AnalogIn(board.BATTERY) and have issue with analog reading being "stuck" after some hours of use (3~6 hours) on some random(?) high value.

>>> import analogio
>>> import board
>>> voltage_in = analogio.AnalogIn(board.BATTERY)
>>> voltage_in.value
61761
>>> voltage_in.value
61761
>>> voltage_in.value
61761
>>> voltage_in.value
61761

It either goes back to normal after few hours, or after fully disconnecting from power and restarting device again. microcontroller.reset() from code does not resolve the issue. Same issue happens on multiple boards (tested on 8 different boards).
I was wondering if it is the hardware design issue with T-Display S3, or could be related to circuitpython? I do not remember this issue happening before when I used c++ on Arduino IDE for same boards (but I have not tested it extensively back then so could be wrong).

midnight ember
scenic ibex
scenic ibex
#

This is currently what i get with what's committed to the repo

scenic ibex
# scenic ibex

Yeah, so I can confirm the board works hardware wise with the screen - if I initialize it in python using the circuitpython lib, things work file with this example: https://github.com/adafruit/Adafruit_CircuitPython_SSD1680/blob/main/examples/ssd1680_four_corners.py
but on boot as things are configured in board.c , things are still broke

GitHub

CircuitPython displayio driver for SSD1680-based ePaper displays - adafruit/Adafruit_CircuitPython_SSD1680

tulip sleet
stuck hatch
tulip sleet
#

so without it being stuck (like being first plugged in), if you did the REPL code above, what raw value would you see?

#

there is battery charging circuitry on the board, as I think you know

#

if you unplug the battery, is it still stuck?

stuck hatch
#

just tested

>>> import analogio
>>> import board
>>> voltage_in = analogio.AnalogIn(board.BATTERY)
>>> voltage_in.value
45596
>>> voltage_in.value
47244
>>> voltage_in.value
47185
>>> voltage_in.value
47165
#

the ones that stuck run without battery, so basically measuring usb voltage

tulip sleet
#

is that the same case in what you just posted?

#

we do a pretty thorough reset of the ADC when the AnalogIn is created. You could try CircuitPython 9.1.0-beta.2, which has a newer version of the underlying Espressif SDK (ESP-IDF 5.2.1)

stuck hatch
#

ok, thanks, I will try flashing 9.1.0 beta and see if issue occurs again after some hours

tulip sleet
# stuck hatch ok, thanks, I will try flashing 9.1.0 beta and see if issue occurs again after s...

another couple of ideas if it reproduces on 9.1.0:

  1. measure the voltage at the battery pin itself, just to check that there's not some hardware problem that is causing the charging pin to go too high.
  2. The BATTERY pin is GPIO4, which uses ADC1. Try measuring the voltage on another ADC1 pin and see if it is stuck too. Ground that other pin, measure again, and then check the BATTERY pin again. See http://wiki.fluidnc.com/en/hardware/ESP32-S3_Pin_Reference for which pins use ADC1.
orchid basinBOT
manic glacierBOT
#

I'm using circuitpython 9.0.4 on an m5stack dial and it works great, but I can't connect to my MQTT broker:

1716232267: OpenSSL Error[0]: error:1402542E:SSL routines:ACCEPT_SR_CLNT_HELLO:tlsv1 alert protocol version
1716232267: Client  disconnected: Protocol error.

I would like to be able to:

ssl_context = ssl.create_default_context()
ssl_context.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1  # Disable TLS 1.0 and 1.1...
manic glacierBOT
#

Yes, I would be happy to try the latest version! My broker is set for tls
1.3 and later, I looked at mosquitto.conf yesterday - when I get back to my
office I will post an updated mosquitto.conf to confirm this, and I can try
beta.2.

On Tue, May 21, 2024 at 12:14 PM Dan Halbert @.***>
wrote:

Could you try 9.1.0-beta.2 and see if there is any difference in behavior?

Which TLS versions is your broker supporting? I am surprised, because I
thought we supported at l...

slender iron
# scenic ibex

This is from Python? The c code should be analogous to the Python code so there must be a mismatch somewhere

manic glacierBOT
scenic ibex
slender iron
scenic ibex
slender iron
#

the python library patches those values

#

you can hard code it for your board

scenic ibex
scenic ibex
slender iron
#

I think it is

#

you can change the driver to print out start_sequence 🙂

#

maybe display size?

orchid basinBOT
scenic ibex
#

it does look like it's modifying the "driver control" values vs the ramx/ramycount values

#

I did go ahead and update the repo to the current code I'm using, though its changed a rreasonable bit since I've been trying a bunch 😅

manic glacierBOT
#

Setting the broker to use v1.2 and even v1.1 still didn't work, but now I'm thinking maybe the TLS version isn't the issue:

1716314886: OpenSSL Error[0]: error:1402542E:SSL routines:ACCEPT_SR_CLNT_HELLO:tlsv1 alert protocol version
1716314886: Client <unknown> disconnected: Protocol error.

I don't know. Mosquitto is pretty standard - it's probably the #1 MQTT broker used by people who use CircuitPython (I would imagine) so I'm mystified. Trying beta.2 now.

#

The M5Dial has an M5Stamp inside, which is 8MB flash, but no PSRAM. We've seen problems with running out of memory on similar configurations when setting up HTTPS with your own certificates. Is the logging you're showing here from mosquitto? What is being printed on the REPL serial port in CircuitPython?

If you could come up with a minimal example, that would be great. And show us the (readacted as needed) mosquitto config.

manic glacierBOT
#

Here's a really simple example:

import time
import board
import busio
from digitalio import DigitalInOut
import adafruit_minimqtt.adafruit_minimqtt as MQTT
import wifi
import socketpool
import ssl

print("Connecting WiFi")
r = wifi.radio
r.connect("RIT-WiFi")
print(r.connected)


# Define callback methods which are called when events occur
def connected(client, userdata, flags, rc):
    print("Connected to MQTT broker!")

def disconnected(client, userdata, rc):
   ...
short tendon
#

okay, is something broken with exceptions? This:

from adafruit_minimqtt.adafruit_minimqtt import MMQTTException
l = None
def x():
  raise MMQTTException("test 1")

for i in range(5):
    try:
        x()
    except MMQTTException as e:
        l = e
raise MMQTTException("test 2") from l

only gives the traceback:

Traceback (most recent call last):
  File "<stdin>", line 14, in <module>
MMQTTException: ('test 2', None)

Where as this:

l = None
def x():
  raise Exception("test 1")
for i in range(5):
    try:
        x()
    except Exception as e:
        l = e
raise Exception("test 2") from l

gives (as I expect):

Traceback (most recent call last):
  File "<stdin>", line 6, in <module>
  File "<stdin>", line 3, in x
Exception: test 1

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 9, in <module>
Exception: test 2
manic glacierBOT
#

Just for the fun of it, I converted umqtt.simple to work with the socketpool, and got the same exact results:

import struct
import socketpool
import wifi
import ssl

class MQTTException(Exception):
    pass

class MQTTClient:

    def __init__(self, client_id, server, port=0, user=None, password=None, keepalive=0,
                 ssl=False, ssl_params={}):
        if port == 0:
            port = 8883 if ssl else 1883
        self.client_id = client_id
        self.soc...
spare jacinth
tulip sleet
manic glacierBOT
short tendon
tulip sleet
#

we most recently merged from MicroPython v1.20, last october

manic glacierBOT
short tendon
tulip sleet
#

1.22 is probably the same, Jeff enhanced what was there

short tendon
#

It is, just checked

#

If I file a bug (which I will), do you think it would get into 9.1.0?

tulip sleet
#

it's not a bug, it's a deliberate deficiency, and it's not so easy to fix

short tendon
#

ahh

spare jacinth
#

whether it was about time to write it, code complexity/mainteinance, flash/ram consumption, etc... i dont know

tulip sleet
#

we really depend on MicroPython for the core langauge stuff. We have added a small amount of extra stuff, but not much. We don't want to diverge that much

short tendon
#

If I were to put a comment in code, why I'm not doing a raise/from what could I add that would make sence?

tulip sleet
short tendon
#

Does this make sense:

# MicroPython doesn't support exception chaining
# and CircuitPython can't chain on non-base exceptions
tulip sleet
#

I'm not sure whether from ... is not implemented as you wish or what the issue is. You could file an issue but it would be long term. It might have to do with native vs non-native

#

@onyx hinge could speak to this when he is back. He is returning from PyCon today.

spare jacinth
onyx hinge
#

I'm not actually back to work until the 28th

spare jacinth
tulip sleet
#

the spirit speaks 🙂

onyx hinge
#

tests/circuitpython/traceback_test_chained.py in the source tree and its associated .exp file shows what we test

spare jacinth
short tendon
#

So the issue is (as you can see from the code sample) an issue where we don't raise a helpful exception

spare jacinth
manic glacierBOT
short tendon
#

Yeah, for now I'm just going to add the other one to the exception string. I'll let Dan help me figure it out

onyx hinge
#

@spare jacinth looks like some kind of bug in the implementation. you can file an issue. a reduced test case looks like it could be ```py
class C(Exception):
pass

try:
raise C("inner")
except Exception as e:
raise C("outer") from e

spare jacinth
#

will let Justin make the issue as it was not me who ran into the problem

#

this is on a few-months-old build of 9.0, but should be good for reference: ```py

class C(Exception):
... pass
...
raise C("inner") from C("outer")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
C: inner

raise C("inner") from Exception("outer")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
C: inner

raise Exception("inner") from Exception("outer")
Exception: outer

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
Exception: inner

raise Exception("inner") from C("Outer")
C: Outer

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
Exception: inner

#

so the bug feels to be along the lines of:

code does type(inner) == Exception instead of isinstance(inner, Exception)

(however that idea translates into the C API :p)

short tendon
#

I think it's more then that, since this works:

>>> raise ValueError("inner") from OSError("outer")
OSError: outer

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: inner
spare jacinth
spare jacinth
#

Time to start dumping data into github :p

spare jacinth
#

i dont think this even deserves to open an issue, leaving the message here: ```
~/circuitpython$ make fetch-all-submodules
python3 tools/ci_fetch_deps.py all
/home/elpekenin/circuitpython/tools/ci_fetch_deps.py:14: SyntaxWarning: invalid escape sequence '.'
version_str = re.search("([0-9].)[0-9]", version_str).group(0)

short tendon
#

more info:

raise Exception("inner") from "Exception"

raises a Hard Fault

but:

raise MMQTTException("inner") from "Exception"

Doesn't

manic glacierBOT
short tendon
#

WHATTTT!!!!!

spare jacinth
#

woah, that was quick

#

i was still fetching submodules 🤣

short tendon
#

I'm not actually back to work until the 28th.....

#

Did he also invent the time machine?

spare jacinth
#

probably.

onyx hinge
#

pycon is sprints today so I'm at my computer and wasn't concentrating on anything anyway

short tendon
#

Well, thank you. I didn't even get the bug open yet

#

Will test as soon as the builds complete

spare jacinth
#

or you can build yourself :p

#

dont be lazy hehe

manic glacierBOT
manic glacierBOT
#

Tested on a UM FeatherS3:

This code will fail, since the MQTT server isn't connecting vis SSL, but on a SSL port:

import adafruit_connection_manager
import wifi
esp = wifi.radio
pool = adafruit_connection_manager.get_radio_socketpool(esp)
ssl_context = adafruit_connection_manager.get_radio_ssl_context(esp)
import adafruit_minimqtt.adafruit_minimqtt as MQTT
mqtt_client = MQTT.MQTT(
     broker="io.adafruit.com",
     username="ADAFRUIT_AIO_USERNAME",
     password="ADAF...
short tendon
#

@tulip sleet if the exception fix and esp32spi get into the next beta - we'll be in an awesome spot for networking

manic glacierBOT
#

@elpekenin noticed this problem:

$ make fetch-all-submodules 
python3 tools/ci_fetch_deps.py all
/home/elpekenin/circuitpython/tools/ci_fetch_deps.py:14: SyntaxWarning: invalid escape sequence '\.'
  version_str = re.search("([0-9]\.*)*[0-9]", version_str).group(0)

That regexp should be a raw string. The vast majority of regexp strings are now raw strings, but I found a few more. A new were not really necessary, but made them raw strings for consistency, and one is easier to ...

tulip sleet
manic glacierBOT
lone axle
#

I have written out several new pages covering the usage of circup in the main learn guide for it https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup/usage-new?preview_token=AHSc_2Exy7L12vsR-P3oqw This link goes to the new Usage page, it now has sub-pages for the different commands which are linked in the navigation. The new pages aren't published yet, but I think they're visible for a bit with the token that is in the URL.

If anyone is interested / willing to look over the new pages it is most appreciated. If the new pages are looking good we can make them published and swap out the old Usage page.

random junco
blissful pollen
# lone axle I have written out several new pages covering the usage of circup in the main le...

Reads fine, nothing stood out for me. I did like how you gave a few common examples but felt like they didn't really show what I should expect as output in return.

E.g. for freeze you show circup freeze but just the command not what I may see in return.

Not a big deal or even a reason to not publish, but an idea for the future potentially.

Another thought was that you talk about connected and Web workflow, but maybe a note that (I'm assuming) BLE workflow isn't supported yet.

lone axle
#

Thank you!

I did think about adding an "Example Output" section to the commands as well. I can add that. I think it would be a nice addition. It doesn't necessarily need to show the output of all of the examples but at least the most basic usage output would be nice to see.

lone axle
blissful pollen
#

And I agree you don't need output on all the commands, even one is nice. Or part of one just to show what to expect.

Again minor on freeze maybe a "why" you would use this? It is the only one I think people may wonder why. The rest are pretty self-explanatory

lone axle
#

good call. I'll also add a bit about why you'd use it.

short tendon
#

@lone axle I think a call out on update and maybe even an example for how it looks for a major update would be a nice add. And the fact that a major update could break code.

I also think a page on fonts could be helpful, since you need to add the bundle, and getting the naming right can be fun (like only certain font sizes are available)

pure spade
#

Hello there, I have a question about USB VID/PID. I am trying to submit my Circuitpython board support to the mainstream repo and I didn't noticed that my VID/PID in the mpboardconfig.mk was copy pasted from another board. So I started a request for PID at https://pid.codes but I am not sure the procedure will go through since my board is not open hardware yet. So my question is: Is there a VID/PID pair that can be used for any board?

austere acorn
stuck hatch
# tulip sleet another couple of ideas if it reproduces on 9.1.0: 1. measure the voltage at the...

It is still reproducible in 9.1.0 beta2. I checked as you wrote and here are the results:

ADC1_0 GPIO1  board.IO1   stuck at 61761
ADC1_1 GPIO2  board.IO2   stuck at 61761
ADC1_2 GPIO3  board.IO3   first read 61761, next always 0. Reading any stuck GPIO resets next read back to 61761, 0 after that.
ADC1_3 GPIO4  board.BATTERY stuck at 61761
ADC1_4 GPIO5  board.LCD_RST in use
ADC1_5 GPIO6  board.LCD_CS  in use
ADC1_6 GPIO7  board.LCD_DC  in use
ADC1_7 GPIO8  board.LCD_WR  in use
ADC1_8 GPIO9  board.LCD_RD  in use
ADC1_9 GPIO10 board.IO10    same as GPIO3

if I short GPIO1/2 to ground, it reads 0, if unshort immediately back to 61761. Did not had multimeter with me today to measure exactly (sensors deployed not nearby), I will check next time what are the actual voltages.

random junco
#

@lone axle I think the new CircUp Learn Guide looks great - and I learned a bunch. I don't have much to add that others haven't already mentioned. Two tiny things - is it CircUp or Circup? It's inconsistent in the guide. And in the first sentence under Contributing, I'd change Repo to Repository, it matches the rest of the learn guide. Looks great, nice job.

lone axle
# random junco <@382939733107408897> I think the new CircUp Learn Guide looks great - and I lea...

Thank you. Originally it was CircUp but I've never really seen much usage of that stylization with the capital 'U'. In the process of re-writing the pages I've been trying to change all instances of it to "Circup" as a proper noun for it's name, or circup when used as a literal part of a command. I have started locally a branch of the repo with that change as well but it's not complete yet, I'll submit it as a PR soon though.

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 9.0.5
orchid basinBOT
tulip sleet
#

@short tendon I restarted the build. I just couldn't read your mind 🙂 . Fine to do that -- just tell us in the PR.

short tendon
tulip sleet
#

I restarted the wrong thing. What's wrong with your build env, could you use help with that?

short tendon
#

Probably. I run it under WSL. I seldom need to build, so I haven't spent much time on it

#

I'll push my branch back up in a bit, and add comments in it

tulip sleet
#

I am about to do a 9.0.x branch merge PR.

short tendon
#

Sounds good. I'll just wait for the next beta

manic glacierBOT
tulip sleet
#

https://blog.adafruit.com/2024/05/22/circuitpython-9-0-5-released/

  • Fix exception chaining for non-built-in exceptions.
  • Waveshare RP2040-GEEK: fix pin names to match board.
  • circuitpython-stubs 9.0.5 is available on PyPi (9.0.4 was missing due to a build problem)
Adafruit Industries - Makers, hackers, artists, designers and engineers!

From the GitHub release page: This is CircuitPython 9.0.5, the latest bugfix release of CircuitPython, and is a new stable release. WARNING for nRF52 boards only: If your board has an nRF52 UF2 boo…

solar whale
#

I have been trying to use the espcamera module with a WaveShare ESP32S3 Pico board but every time I try to initialize the camera, it crashes into Safe Mode - memory access or instruction error https://circuitpython.org/board/waveshare_esp32_s3_pico/ https://www.waveshare.com/wiki/ESP32-S3-Pico I am using one of the OV5640 pico camera boards with it. Is there anything obvious about this board or its memory devices that might make it incompatible with espcamera?

This is a WiFi development board with compact size, plenty peripheral interfaces, integrated low-power Wi-Fi System-on-Chip (SoC) and mass memory, supporting Raspberry Pi Pico expansion board ecosystem.Equipped with hardware crypto accelerator, RNG, HMAC and Digital Signature module, it can meet ...

#

FWIW this is the init code that is crashing whn the call to espcamera.Camera is made ``` def init(self) -> None: # pylint: disable=too-many-statements
self._i2c = busio.I2C(board.IO16,board.IO15)
self._camera_device = None
self.camera = None

def init_camera(self, init_autofocus=True) -> None:
    """Initialize the camera, by default including autofocus"""

    print("Initializing camera")
    self.camera = espcamera.Camera(
        data_pins=[board.IO17,board.IO18,board.IO33,board.IO34,board.IO35,board.IO36,board.IO37,board.IO38],
        pixel_clock_pin=board.IO14,
        vsync_pin=board.IO11,
        href_pin=board.IO13,
        powerdown_pin=board.IO12,
        reset_pin=board.IO39,
        pixel_format=espcamera.PixelFormat.RGB565,
        frame_size=espcamera.FrameSize.VGA,
        framebuffer_count=2,
        i2c = self._i2c,
    )
manic glacierBOT
#

If this helps, you can do this:

        underlying_sock = pool.socket(pool.AF_INET, pool.SOCK_STREAM)
        sock = LoggingSocket(underlying)

all it does is spits out the writes. For what I was doing (trying to see the TLS handshake, which is the very first thing it does) it was helpful. Mainly because I discovered that if you paste the hex to ChatGPT and tell it that it's a TLS negotiation, it will decode the whole thing for you.

class LoggingSocket:
    def __in...
short tendon
tulip sleet
tulip sleet
short tendon
#

So the only code that would be added to CM, would be the import and if it works, the 2 liner if/then wrap

short tendon
#

otherwise, you would need to wrap the socketpool getsocket which would be more complex

#

Just a thought...

#

I can definatly build out a playground note with this though (and wrapping the socketpool)

tulip sleet
short tendon
#

makes sense. so something like:

pool = adafruit_connection_manager.get_radio_socketpool(radio)
logging_pool = adafruit_logging_socket.wrap_pool(pool)
logging_pool.log_send()
requests = adafruit_requests.Session(logging_pool)
slender iron
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.0-beta.2-9-g4c39995ad5 on 2024-05-20; Waveshare ESP32-S3-Pico with ESP32S3

Code/REPL

def __init__(self) -> None:  # pylint: disable=too-many-statements
        self._i2c = busio.I2C(board.IO16,board.IO15)
        self._camera_device = None
        self.camera = None



    def init_camera(self, init_autofocus=True) -> None:
        """Initialize the camera, by default including autofocus"""

       ...
manic glacierBOT
short tendon
tulip sleet
tulip sleet
stuck hatch
tulip sleet
#

thanks for trying that

#

just writing a loop to poll the value over and over might do something

manic glacierBOT
tulip sleet
#

@slender iron I made 9.1.0-beta.3 release notes. It includes your Espressif BLE work and all C file header changes, and the frozen modules update fixes a PyPortal issue. If you have time to approve https://github.com/adafruit/circuitpython/pull/9271 (update froze modules), I can make a beta.3 release.

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 9.1.0-beta.3
orchid basinBOT
tulip sleet
#

https://blog.adafruit.com/2024/05/22/circuitpython-9-1-0-beta-3-released/

Initial implementation of BLE GATT server support on Espressif chips. Pairing/bonding is not yet implemented.
Update TinyUSB; includes USB host fixes.
Fix exception chaining for non-built-in exceptions.

Adafruit Industries - Makers, hackers, artists, designers and engineers!

From the GitHub release page: This is CircuitPython 9.1.0-beta.3, a beta for CircuitPython 9.1.0, and is a new unstable release. This release has known bugs that will be addressed before 9.1.0 fina…

manic glacierBOT
#

The MQTT library and other libraries have received a bunch of changes over the past week or so, including having to do with timeouts. Could you re-test with 9.1.0-beta.2 and the latest libraries so we can get a new baseline? There are changes that will not be in the bundles until tonight, so you could fetch from the repos or just wait until tomorrow.

I have since switched to Feather ESP32-S2 with RFM69 which works really well and consumes far les power than the Wifi transport so I can no...

orchid basinBOT
#

Removed old data about the GRB LED on IO10 as they have fixed this. Schematic on their site shows the RGB LED connected to IO21 and I also confirmed that

led = NeoPixel(NEOPIXEL, 1)
led[0] = (255,0,0)

makes the LED turn RED.

Also no idea how to put in this request, but the board module on this does not have a BUTTON however the board has a button on IO01. Can the CP module be updated to include a BUTTON?

scenic ibex
#

The issue in the end was really dumb, it ended up being that busy_state in the ...epaperdisplay_construct was set to False from the previous display I was using, but the driver code for the SSD1680 sets it to True, I just missed it when reading/transferring the settings 🤦‍♂️

#

I also had to find that start_col was set to 8 for this board, which in set in the driver code only if it's not passed in kwargs, so I also missed that bit first time around

#

with both those issues solved, it seems to work like expected! I still have some cleanup and addtional changes to make to the board def, but i'll likely be opening a PR to add the board soon :D

short tendon
#

feedback appreciated

manic glacierBOT
stuck hatch
# tulip sleet just writing a loop to poll the value over and over might do something

upd, I ran board with nothing attached and only AnalogIn read cycle for a day. From logs I can see it restarted a few times, but readings did not get above 60k like the other boards.
It looks like either i2c sensor or wifi or something else in code might affect that 🤔
I guess I will try by the method of elimination test what may cause it.

stuck hatch
#

no, but the same is in the other sensors that get stuck.
When it is stuck (while being connected with usb), it does not matter if I attach battery, power from usb, or both, it still stuck at same value over 60k

tulip sleet
#

that is pretty odd. Add back the wifi first, because the wifi uses ADC2 (thought that should not affect ADC1). If that does nothing, yes, try the I2C and disable wifi (so we are trying one thing at a time)

stuck hatch
#

on devices that get stuck, I run sensor on I2C with GPIO1 and GPIO2 which on ADC1, I suspect maybe that could be the issue?

tulip sleet
#

... maybe ... though that ADC channel is not activated, so in theory it should not make any difference.

stuck hatch
#

Thanks. I will try different ways to come up with minimal reproducible setup.

manic glacierBOT
manic glacierBOT
#

@tannewt As a note, this board used - instead of _ for the spaces for the board name making it not a valid python identifier (Reminder, #6979 and #7267).

Is it too late to fix this one?

I think the first step is adding a test that will fail if the board name isn't an id. Otherwise we'll continue to have this problem. After we have that, we can fix all the cases that need to be fixed.

manic glacierBOT
#

@tannewt As a note, this board used - instead of _ for the spaces for the board name making it not a valid python identifier (Reminder, #6979 and #7267).

Is it too late to fix this one?

Why would it need to be a valid python identifier?

If someone wants this to be a rule and actually has a sensible reason why - all the board porting instructions need to be changed so that everyone knows this... it's actually quite confusing already - there's at least 3 names involved (a hum...

short tendon
#

@tulip sleet if I wanted to get some devices with less ram (have a m4, pico-w) would you recommend this one: https://www.adafruit.com/product/5323? Any others to make sure I have a good set to play with?

tulip sleet
short tendon
#

Is there a specific QT Py that has the smallest?

crimson ferry
#

all S2s have the same internal RAM, same for all S3s ...the difference is amount of PSRAM, there are some variations without PSRAM

#

(or with less, but 2MB I think is the min PSRAM, so not helpful if you're looking for less memory)

tulip sleet
#

there is 8MB flash / 0 MB PSRAM (no PSRAM), and 4/2. It has to do with what's embedded in the little silver modules.

crimson ferry
#

STM32F405 has 128KB available to user, I think M0 is the only thing smaller (32)

#

I think you can typically load a no-PSRAM UF2 onto a similar board with PSRAM (flash should match though), and CircuitPython won't recognize the extra memory

burnt tangle
#

Hey, could someone please point me to the magic that enables the press() calls here to actually make sound? I'm not seeing how DMA is still going when play() is called without loop=True

audio = audiobusio.I2SOut(board.I2S_BIT_CLOCK, board.I2S_WORD_SELECT, board.I2S_DATA)

synth = synthio.Synthesizer(sample_rate=44100)
audio.play(synth)

while True:
    synth.press(65)  # midi note 65 = F4
    time.sleep(0.5)
    synth.release(65)  # release the note we pressed
    time.sleep(2)
onyx hinge
#

The samples are produced by a call of a function like "get buffer" in shared-module synthio. I can't be more specific right now, I'm mobile

burnt tangle
#

Thanks, details would be appreciated when able, not seeing how things don't grind to a halt like in audio_dma.c:

    if (get_buffer_result == GET_BUFFER_DONE) {
        if (dma->loop) {
            audiosample_reset_buffer(dma->sample, dma->single_channel_output, dma->audio_channel);
        } else {
            // Set channel trigger to ourselves so we don't keep going.
            dma_channel_hw_t *c = &dma_hw->ch[dma_channel];
            c->al1_ctrl =
                (c->al1_ctrl & ~DMA_CH0_CTRL_TRIG_CHAIN_TO_BITS) |
                (dma_channel << DMA_CH0_CTRL_TRIG_CHAIN_TO_LSB);

            if (output_length_used == 0 &&
                !dma_channel_is_busy(dma->channel[0]) &&
                !dma_channel_is_busy(dma->channel[1])) {
                // No data has been read, and both DMA channels have now finished, so it's safe to stop.
                audio_dma_stop(dma);
                dma->playing_in_progress = false;
            }
        }
    }
onyx hinge
#

Because it doesn't return DONE

burnt tangle
#

ah thanks, that's a good toe-hold

devout jolt
#

I'm working with a custom RP2040 and I think I have a flash-related issue. What I observe:

  • Getting to RPI-RP2 works and I can upload a CircuitPython UF2 no problem
  • CircuitPython runs well for as long as the board stays powered on
  • On reset , CircuitPython does not come up (no USB device)
  • Programming the board with arduino-pico using the "Pico" board type works after reset
    The board uses a 16MB Winbond W25Q128JVPQ. I've recompiled the standard raspberry_pi_pico CircuitPython to include this chip in mpconfigboard.mk with EXTERNAL_FLASH_DEVICES = "W25Q128JVxQ"
    My questions:
  • Did I change mpconfigboard.mk correctly?
  • How do I turn on UART serial debug messages again?
  • How can I further debug this?
ornate breach
#

I trying to open a bin file, and I know that memory is a bit tight, is there a way to get a little bit larger memory allocation?

#

the bin file is 104kb, gc.mem_free() says I have 154880 free

#

allocation fails by 56320 or 72448 bytes respectively

#

just depends on reload

#
code.py output:
Mem Free:  160608 Mem Alloc 2976```
#

ah wait, I realized I built for a different fpga.. lemme try and use the right file..

#

that makes a world of a difference lol..

onyx hinge
tulip sleet
#

oh, there, it is , I hadn't scrolled down. jepler points to what I was going to

devout jolt
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@tannewt As a note, this board used - instead of _ for the spaces for the board name making it not a valid python identifier (Reminder, #6979 and #7267).
Is it too late to fix this one?

Why would it need to be a valid python identifier?

Some folks use the board id in a module name.

If someone wants this to be a rule and actually has a sensible reason why - all the board porting instructions need to be changed so that everyone knows this... it's actually quite c...

slender iron
#

@devout jolt let me know if the oscillator fix doesn't solve your issue. I can help with flash bringup

devout jolt
#

Yep @slender iron that was totally it. I remembered doing this on another board and totally forgot about it.
So follow up questions:

  • Could we add #define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64 to the raspberry_pi_pico/pico-sdk-configboard.h board?
  • Generally, what about having a "generic RP2040" and maybe "generic ESP32 S3" and similar boards? (Like what arduino-esp32 does)
    When bringing up a new RP2040 board, I often use the raspberry_pi_pico board because it has all GPIOs in board and usually its flash choice works well enough.
    (also didn't it used to be that microcontroller.pins.* wasn't completely filled out, just being aliases for board.*? But I see that's no longer the case at least on RP2040. maybe I'm thinking of a different chip arch)
tulip sleet
# devout jolt Yep <@252717193496756235> that was totally it. I remembered doing this on anothe...

We could add that to raspberry_pi_pico, but it seems like it's not needed on those boards. Either their choice of crystal-related components is very good or they toss the ones with this issue during QA. So that's why we didn't add it.

Maybe a generic board is appropriate, as it might benefit people who have some off-brand thing that they don't necessarily want to create a custom board for.

devout jolt
slender iron
#

flash size has always been autodetected. you still risk the wrong access settings though

tulip sleet
#

so a generic board would have to include all known expected flash chips

#

sounds like

#

EXETERNAL_FLASH_DEVICES in mpconfigboard.mk is required.

manic glacierBOT
#

I tested this on a Pico W with CircuitPython 9.1.0-beta.3, with this SD card breakout: https://www.adafruit.com/product/4682, a 4GB card, and the test program below. I plugged it in to a host computer or to a USB 5V adapter. A fast blink means there's trouble. A slow blink is fine.

I could not reproduce the problem. If this is still an issue for you, could you try with 9.1.0-beta.3, and using sdcardio instead of adafruit_sdcard?

Interestingly, I had a bad jumper wire, which caused p...

manic glacierBOT
manic glacierBOT
#

Some tiny improvements.

The grove port pins are labeled as G1 & G2 on the physical product.
The current definition has literally every other name for the pins, other than these.
Note: They have never been labeled as any of the other names in docs or on the physical product.
Since this board was added in 9.0.x and not 9.1 I think we should leave the rest of the other pin names as is.

The port itself is labeled PORT.A, not the pins.
![IMG_2024-05-25-01-00-52-226](https://github.com/ad...

manic glacierBOT
#

Thanks for the quick response! Some bad news, though... With this firmware it's not hard faulting at all when plugged into the KVM! I've had it plugged in for about 15 minutes at this point with no issues at all. It's not quite working correctly but that was the case beforehand, so I think that's unrelated to the crashes I was experiencing.

Oddly, I'm also not seeing any output besides the normal output from boot.py and code.py. Not sure if that's what you would expect.

manic glacierBOT
manic glacierBOT
manic glacierBOT
bright robin
#

Is there a way we can get a visible cursor on the device LCD when running the REPL.
I can do line editing with the Cardputer's built in keyboard, but there's no cursor on the built in display so you have to guess where you are on the line.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Ok @dhalbert working on your request... But first I wanted to confirm both my RP and the OLED are "OK". This code was running before and still work fine: https://twitter.com/DavidGlaude/status/1375557719646740482?s=20 So there is an "issue" with the "I Voted" code (or something "different"):

Hi David,
Interesting project! I'm trying to get the same display with Feather, FeatherWing and the SCD-30. Could you kindly share the code you used? I get it to work with a Metro board on a smaller...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Hello,

Just started yesterday with this board, many problems with the Waveshare's Wiki web page. First someone put a faulted firmware on the Wiki, without their pico-gpio file for the Pins number. So many of their examples even didn't work as they use this file cause examples are written for their "raspberry's pico kit". For who're interested the good micropython firmware is in the examples zip file.

I tried also circuitpython, who's more easy to flash, and it even surprised me, the RGB...

onyx hinge
manic glacierBOT
#

CircuitPython version

Tested both 9.1.0 beta 3 and 9.0.1

Code/REPL

]0;🐍Wi-Fi: off | REPL | 9.1.0-beta.3\
Adafruit CircuitPython 9.1.0-beta.3 on 2024-05-22; ESP32-C6-DevKitC-1-N8 with ESP32C6
>>> import os
>>> import espnow
>>> espnow.ESPNow()

Behavior

Traceback (most recent call last):
]0;🐍Wi-Fi: No IP | REPL | 9.1.0-beta.3\ File "", line 1, in
espidf.IDFError: Generic Failure

Description

Error happen right when trying to initialize...

manic glacierBOT
#

Just two notes:

I have a CP version of this board with pin-names compatible to the Pico-W. And I am using this board with this CP version as a drop-in replacement for the real Pico. My code works without (almost) no change. Connectivity is better and the ESP32-S3 has much more RAM, so I don't run into the problems I have with the Pico-W.

The only things that are not working are the VSYS-ADC (this is because of technical reasons, the ESP32-S3 always has 3V3 on VSYS) and the neopixel-LED....

manic glacierBOT
#

This pull request fixes Issue #8770 as well as a few more minor issues with the existing espulp implementation. The changes/issues addressed are:

  • RISCV ULP is now disabled for all boards, as discussed in Issue #8770. This was necessary because with IDF Version 5.0, espressif only allows one type of ULP to be active at compile time, as documented here. This meant that some boards had access to only the FSM, while others had access...
manic glacierBOT
#
  • Enhances docs/shared_bindings_matrix.py to optionally add more board details to the returned dict
  • Adds docs/board_summaries.py, which creates .csv reports from that dict, enabling visualizations like this
  • Useful for answering questions like "what boards use which ports and processors?", "what boards have the most pins?", and "for what ports/processors is this module implement...
manic glacierBOT
short tendon
#

Not sure where to post this. Looking it's a bug with with CircutPython 9.1.0 Beta 3 and MicroPython 1.22.2:

class I:
  @property
  def i(self):
    print("why hello there")

and then

>>> i = I()
>>> dir(i)
why hello there
['__class__', '__module__', '__qualname__', '__dict__', 'i']

So calling dir on an object actually calls the properties... Which can be bad if those properties do things

burnt tangle
short tendon
#

Looks like I'm not the first to find it. Thanks!

urban knoll
#

Yeah, goes all the way back to #2179 apparently

short tendon
#

And it is a MP issue, so not a whole lot to be done...

urban knoll
tulip sleet
short tendon
#

I'm surprised they haven't. I can imagine a ton of hidden bugs from calling a property without realizing it

tulip sleet
#

MicroPython discourages use of properties because it's less efficient than methods. CircuitPython was more interested in typical Python style, so we use properties more and fixed them up slightly to work better, though not dir()

short tendon
#

Oh, that's weird. But I guess it makes sense

#

On a random note. I found this working through the socket logger. Which I now have in a pretty good spot.

manic glacierBOT
manic glacierBOT
#

For example, given a suitable definition of laser_note and laser_lfo, this sequence will play a laser sound for around 3/10 of a second:

laser = [
   {"press":laser_note, "retrigger":laser_lfo},
   0.3,
   {"release":laser_note}
]

this may not even work (I simply dashed it off while at the airport) but it shows the general idea of what @deshipu and I talked about at PyConUS. ping @jedgarpark @todbot

The same foundation would seem to enable basic drum machine style seq...

onyx hinge
manic glacierBOT
#

This is completely wild fantasizing, just to see what we could do.

In theory, there is no reason to make all the changes in one step, because as long as there is no delay in the list of steps, all steps should execute at the same time. So maybe we could simplify it by allowing a Note and an LFO to appear as a step, alongside the Float, instead of dicts? The LFO would get re-triggered then, but there is some ambiguity about what should happen with the note - we need some way of marking if i...

#

I also have slight problem with putting the start and stop commands in the synth.change function. Arguably, they are "higher level" operations than the press, release and retrigger, and I already confused start with press and stop with release. I know that it's convenient from the C code point of view to have everything done with one function with a lot of different keyword arguments, but it could get out of control pretty fast.

#

To me, this feature currently seems identical to an async function we can currently write, like:

async def play_laser_sequence():
  synth.change(press=laser_note, retrigger=laser_lfo)
  await asyncio.sleep(0.3)
  synth.change(release=laser_note)

I really like the idea of a "list of change() commands` as a basis for a sequencer. It's simple to understand. But a common use of a sequencer is to set it playing in a loop and modifying the contents as is plays. So I feel it...

#

I would like to discuss further which type of ULP should be available. My gut was that riscv would be more useful, because it can be targeted with a gcc toolchain.

I would certainly love if the RISCV ULP were more accessible as it is definitely the more capable of the two ulps, and I do hope that espressif addresses the underlying issue preventing us from using both.
My motivation for going with FSM in this PR was two-fold:

  1. It is available on more boards (RISCV is only available on ...
#

Risquev would be a lot more useful since it can be targetted by gcc, but it would be a lot less intuitive for a beginner to work with.
Plus, it's probably gonna be a nightmare on windows.
(I haven't touched windows since 2018, so I can only guess)

The ULP assembly seems very friendly and simple from a quick read.
That can be a selling point for education imo.
Also, on the fly recompilation with other data (.format() configurable variables)?

Plus as Sola85 stated, og esp32 is a pre...

#

It's easy to understand for you, because you already know how the change function works, and feel perfectly at home with the idea that keyword arguments are the same thing as a dict. It's harder to explain this to new users, especially if the change method is removed anyways (because the same thing can now be done with sequences).

Other users might be more familiar with the interface already provided by the audio*io.AudioOut, audiomixer.Mixer and audiomixer.MixerVoice where you h...

manic glacierBOT
#

It's easy to understand for you, because you already know how the change function works, [...]

Well to be fair, until today I had totally forgotten .change() existed because I only use .press() and `.release(). And if you were to ask me yesterday "What should a sequence data structure look like for synthio?" I would've said something like "List of NoteOn and NoteOff messages, just like MIDI". I feel anyone using a sequencer concept has to be conversant with this base level underst...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Happy to use a different approach, though new types seem to chew up a bunch of flash.

Let's consider using play method with the sequence of dicts:

laser = [{'press': laser_note}, {'retrigger': laser_lfo}, 0.3, {'release': laser_note}]
synth.play(laser, loop=True)

I can see several potential inconveniences here:

  • The strings are arbitrary. If I were to come up with a verb describing starting a note, I don't think I would come up with "press". I suppose this is the...
manic glacierBOT
manic glacierBOT
#

Agreed @deshipu. The dict originally proposed is more verbose than I'd like. What about a list where "element 0 is 'pressed', element 1 is 'released', element 2 is 'retrigger'" (i.e. matching .change()'s positional args):

laser = [ [laser_note, None, laser_lfo],   # press, release, retrigger
          0.3,
          [None, laser_note, None] ]  # press, release, retrigger

Hmm that looks even more dangerous. Would namedtuple be about the same cost as as dict?

Regardless...

manic glacierBOT
#

I will say a few things here:

You are inventing a (tiny) programming language. I have seen this a lot in various contexts. A question I always ask is whether you need a new language, or do you have one already? We do, and @todbot points out how to use Python and async to do things. If the primitives are not want you want, they could be changed.

Assuming you still want to make a language:

A dict or a named tuple is a kind of verbose way of doing this, and a bit expensive. There's a fi...

manic glacierBOT
#

@todbot this looks terribly complex and fragile to me. Again, that's not a concern for me, because in my use case the representation would be hidden from the user, but just for the sake of brainstorming, what would happen if duration became and attribute of the Note?

We wouldn't need a release anymore, because every note would be automatically released when its duration expires. We wouldn't need a delay (we could have an "empty" Note for pauses) anymore either. We could then simply jus...

#

I've wanted a better musical timing facility than is currently available at the user level. CircuitPython is unusable in many musical contexts because of its sloppy timing. Even a "timed list of synth.change() calls" as currently proposed is better than what we can do now. And as DSLs go, is pretty simple. I'd very much welcome a richer one though.

But to me editing of the submitted list is key: without that, it's basically the same as the fire-and-forget nature of `audio.play(WaveFil...

#

We wouldn't need a release anymore, because every note would be automatically released when its duration expires. We wouldn't need a delay (we could have an "empty" Note for pauses) anymore either. We could then simply just have a sequence of Notes, and changing their timing would be just a matter of iterating over them and changing their duration, or maybe inserting some additional pauses in between them.

You got it. This is what most sequencers do: store NoteEvents with a gate_time ...

#

In so far as programming is telling the computer what to do, it's programming, for sure. But the thing that we want to express is ultimately a static piece of data – what notes should be played with what effects and what timings. The temporal nature of the data does make it look like a set of operations, but that's not the only representation possible. After all, you can always describe static data by (one possible) procedure leading to producing that data. Like you can describe an image by a...

#

This is a bit of a brain dump, sorry!

For me the reason to use a data structure instead of Python code is because the "evaluation" is occurring in a C background task, at a moment when we need to provide more audio samples under a deadline or playback will glitch. We routinely have trouble when we try to allow the C background task call back out to general Python code. (that said, if you're evil you can supply a python generator with the current implementation; when this breaks you get to ...

#

In MIDI, the timing resolution is "ticks" or "pulses" with 24 PPQ (24 pulses per quarter note) being the most common. (see MIDI beat clock)
I don't think this is necessarily required for synthio though, seconds is fine.

Overall I thought the "list of calls to synth.change()" was fine and assumed we'd build user-level sequencer classes that wrapped that and converted from a more human-readable format.

sly mist
#

I am trying to get a module to compile and include in my firmware package, but the I keep getting linker errors.
I have my files in shared-module/aurora_epaper and shared-bindings/aurora_epaper. I think I have added the necessary compile flags and files to py/circuitpy_mpconfig.mk and py/circuitpy_defns.mk to have it included, however I still get linker errors because some of my functions are used in shared-module/displayio/__init__.c and It cant find them.

Here is the relevant make output:

#
xtensa-esp-elf/bin/ld: warning: build-offsummit_2024/firmware.elf has a LOAD segment with RWX permissions
xtensa-esp-elf/bin/ld: warning: build-offsummit_2024/firmware.elf has a LOAD segment with RWX permissions
xtensa-esp-elf/bin/ld: build-offsummit_2024/shared-module/displayio/__init__.o:(.literal.common_hal_displayio_release_displays+0x8): undefined reference to `aurora_framebuffer_type'
xtensa-esp-elf/bin/ld: build-offsummit_2024/shared-module/displayio/__init__.o:(.literal.common_hal_displayio_release_displays+0x10): undefined reference to `common_hal_aurora_epaper_framebuffer_deinit'
xtensa-esp-elf/bin/ld: build-offsummit_2024/shared-module/displayio/__init__.o:(.literal.reset_displays+0x0): undefined reference to `common_hal_aurora_epaper_framebuffer_reset'
xtensa-esp-elf/bin/ld: build-offsummit_2024/shared-module/displayio/__init__.o:(.literal.displayio_gc_collect+0x4): undefined reference to `common_hal_aurora_epaper_framebuffer_collect_ptrs'
xtensa-esp-elf/bin/ld: build-offsummit_2024/shared-module/displayio/__init__.o: in function `common_hal_displayio_release_displays':
__init__.c:(.text.common_hal_displayio_release_displays+0x11c): undefined reference to `common_hal_aurora_epaper_framebuffer_deinit'
xtensa-esp-elf/bin/ld: build-offsummit_2024/shared-module/displayio/__init__.o: in function `reset_displays':
__init__.c:(.text.reset_displays+0x156): undefined reference to `common_hal_aurora_epaper_framebuffer_reset'
xtensa-esp-elf/bin/ld: build-offsummit_2024/shared-module/displayio/__init__.o: in function `displayio_gc_collect':
__init__.c:(.text.displayio_gc_collect+0x33): undefined reference to `common_hal_aurora_epaper_framebuffer_collect_ptrs'
xtensa-esp-elf/bin/ld: __init__.c:(.text.displayio_gc_collect+0x86): undefined reference to `common_hal_aurora_epaper_framebuffer_collect_ptrs'
tulip sleet
small comet
#

(just checking) is there a "standard" stanza one can currently opt into (say) the pre-commit yaml file for a library, to run mypy type checks?

sly mist
#

Thanks!

small comet
manic glacierBOT
#

Without a major change to the architecture of synthio, timing ultimately will refer to groups of 256 samples; 5.805…ms at 44.1kHz, for instance. Whether the duration is a fractional second or a (possibly fractional) MIDI beat, it'd be rounded. So say you're at 132bpm -- each beat will be 78.303… sample groups, or, put another way, you could actually achieve 132.51…bpm. (and then you get 78=2x3x13 subdivisions, which can't support equal 16th notes, they'd have to be alternating between 19 and ...

atomic summit
#

Hey @tulip sleet Not a big thing, but the release notes for 9.1 betas don't have ESP32-C6 listed under port status.

It definitely should - C6 has been working great since 9.0.2 and I've been shipping 9.0.x on my TinyC6 boards without issue 🙂

tulip sleet
manic glacierBOT
steady mulch
#

Hi, my team has a hardware design with a Pico W in it. RAM is getting tight on the Pico W image on CircuitPython 8, and currently blocking upgrade to 9. There are savings to be made in code that was written when there seemed to be plenty of RAM, but may not go far enough.
If we were looking to add an official board, is there a minimum quantity to be considered, and would it require its own USB VID/PID despite being a Pico W? (Noting that Badger 2040 W has one.)
If we were looking to release a modified CircuitPython ourselves, are there guidelines about that?

candid sun
#

<@&356864093652516868> We'll have our weekly meeting in about 90 minutes from now in this text channel and in the circuitpython voice channel. Please take the time to add your notes in advance to the document: https://docs.google.com/document/d/1EvRvqSdQW_nMZFkgvgHDKlqHlMl08z2QehnGhNohHSA/edit -- I look forward to everyone's updates!

tulip sleet
#

I think a regular board definition with more features turned off (PICO DVI, USB host, etc.) may get you back enough RAM.

#

Or you can ship with 8.2.x for now.

manic glacierBOT
manic glacierBOT
steady mulch
steady mulch
tulip sleet
#

i'm confused, are you distributing this? So there is more than one?

steady mulch
#

There are currently 135 as far as we know

tulip sleet
#

if your board is open-source, that should be fine. we have our own open-source boards that have proprietary chips in them

#

it's a component

#

is the badger a similar example?

steady mulch
tulip sleet
#

adafruit_bus_device is not a python library, it's C code. Did you also put it in FROZEN_MPY_DIRS or whatever?

#

it's fine to freeze our libraries

steady mulch
#

No I'm comparing with and without adafruit_bus_device on the CIRCUITPY drive on stock PicoW image

lone axle
steady mulch
#

Deleting it saved 30 bytes of RAM

tulip sleet
#

are you leaning toward a fork or just submitting a board?

steady mulch
#

Undecided. Submitting a board would make some things easier but there could be issues with not having control over lib versions if it does have extra frozen libs in it

#

Or indeed if we can make it work with stock PicoW

#

Yes I'd say the Badger is similar

#

Generally if you freeze a lib, do you expect to save the whole size of the mpy in RAM or is the difference much less?

tulip sleet
#

i think whether we remove some stuff or not from the current Pico W build is still up in the air. Also I want to look at the RAM consumption.

tulip sleet
lone axle
manic glacierBOT
#

Hi @dhalbert , we actually purchased this PID from https://www.mcselec.com/index.php?page=shop.product_details&flypage=shop.flypage&product_id=92&category_id=20&option=com_phpshop&Itemid=1

As you can see, their VID was grandfathered in, and USB-ORG would never issue a VID for 0x16D0.

0x07F2 is one of 4 PIDs we purchased from MCS. I have confidence they won't re-issue these PIDs from something else.

I'm happy to forward my order confirmation to you via email.

With that, is it O...

tulip sleet
#

@candid sun i can finish the meeting if you want

candid sun
#

Sorry I think my computer dropped internet

lone axle
#

Thanks for hosting Liz. Have a great week everyone!

tulip sleet
#

thanks!

#

@lone axle the thing I sent you in email about the readthedocs default change isn't private, it was just the easiest way to get it to you. If there's anything to discuss here is fine

short tendon
tulip sleet
candid sun
#

Here is the notes document for next Monday’s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868>

https://docs.google.com/document/d/1A-m8lDphnjKaPfIkQtyfb1Tb0lk9HHPnEFO8wNgLTIQ/edit?usp=sharing

onyx hinge
#

sorry I missed it but I had to catch up with some local friends over lunch. ❤️

stuck elbow
manic glacierBOT
manic glacierBOT
solar whale
#

@onyx hinge Thanks for merging the ov5640 PR -- i't's been awhile since I did a PR, Should I generate a new release or is that something that will be done by someone else?

onyx hinge
lone axle
#

I typically do a pass and release any with new commits on monday's (but haven't done one this week due to the holiday).

Making the release directly after PRs merged is good especially if you want it to make it into bundle and circup ASAP. But if it gets skipped no worries because I'll get to it during that weekly pass.

solar whale
#

OK -- I'll give it a try now.

#

Done -- hopefully correctly....

onyx hinge
#

thanks both!

orchid basinBOT
orchid basinBOT
manic glacierBOT
tulip sleet
#

@slender iron @onyx hinge I would be up for another 9.x.x issue (and maybe some PR's) triage meeting. Do you have time today?

slender iron
#

Yup, I'm mostly around. Just gonna do lunch and a short walk sometime

#

(before our internal meetings)

onyx hinge
#

I'm around as well

tulip sleet
#

now is fine, or if you want an early lunch, can wait until after that. I have no more scheduled events today

slender iron
onyx hinge
#

Give me 5

manic glacierBOT
manic glacierBOT
#

This original behavior seems to exist in micropython 1.22

MicroPython v1.23.0-preview.352.g50b43fec1 on 2024-05-29; linux [GCC 12.2.0] version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> import os, vfs
>>> vfs.mount(os.VfsPosix("/tmp"), "/sub/dir")
>>> os.listdir("/")
['sub/dir', 'home', 'nix', 'lib', 'initrd.img', 'etc', 'run', 'libx32', 'sbin', 'usr', 'bin', 'vmlinuz', 'vmlinuz.old', 'bob', 'var', 'boot', 'dev', 'core', 'lib64', 'initrd.img.old', 'srv', 'opt', 'media', 'lib...
onyx hinge
#

oh, cool, debian is back to updating gcc-arm-none-eabi. stable has 12.2, testing and sid have 13.2. I thought they had stopped/gotten way behind

#

also huh: TIL that google sheets has trouble exporting slides presentations with emoji, even when exporting as PDF. there are 2 missing emoji in the PDF of my presentation.

Also, I have now posted the slides of my presentation: https://emergent.unpythonic.net/files/sandbox/Connecting Old to New with CircuitPython.pdf
and you can also see the version inside google sheets with speaker notes and a few animations which also don't come through in PDF: https://docs.google.com/presentation/d/1524EXIJRLf5XJSetKCbnN5ilNuicdJ7i1ZHUpgpIevQ/edit?usp=sharing

devout jolt
onyx hinge
#

@devout jolt the video was recorded and will be released on the pycon youtube channel sometime in the coming months

manic glacierBOT
orchid basinBOT
orchid basinBOT
manic glacierBOT
#

Just saw this discussion mentioned in the weekly meeting notes. FWIW, I've been off in my corner for the past week and a half tinkering with a CircuitPython sequencer idea. I'm building a thing to translate plaintext song notation files into timed MIDI messages over USB MIDI.

For song notation, I'm using a text file format that borrows ideas from the abc music standard for describing note sequences in ...

manic glacierBOT
#

This is an alternative to PR #9277. In that PR, this issue in the esp-idf was circumvented by disabling one of the ULPs for every type of esp32.
Here, instead we copy one file (namely ports/espressif/bindings/espulp/ulp_riscv.c) from the esp-idf into the circuitpython repo, in order to make the necessary functions for the riscv ulp available at compile time (as suggested by @tannewt [here](https://github.com/adafruit/circuitpython/issue...

manic glacierBOT
#

Sat down and made an FSM (Finite State Machine) diagram for parsing paths.
I don't wanna imagine doing this in C.

We would need to take any relative paths and convert them to absolute.
That means also handling /path/to/some/weird/../weirder/./place and handling invalid fat32 characters in this parse.
Then from absolute paths we would need to look into the mount table (my brain stores it as a dict {"/absolute/path": vfsobject}), and then do the following mad procedure:

  • split the ...
alpine rapids
#

Hey folks! I forget, is the neopixel library ever included with a board (like as a frozen library), or does it always need to be installed separately?

#

Just asking b/c I'm working on adding a new board and it has an onboard ws2812

tulip sleet
manic glacierBOT
#

I just learned that circuitpython maintains its own fork of esp-idf. I have submitted a PR https://github.com/adafruit/esp-idf/pull/16 to that repo which would fix the underlying issue preventing us from using both ULPs.

Should that PR get merged, we can enable both ULPs in this PR, by simply adding CONFIG_ULP_COPROC_TYPE_RISCV=y to sdkconfig-esp32s2.defaults and sdkconfig-esp32s3.defaults

solar whale
#

@lone axle I made a new release for the OV5640 library yesterday (1.2.0) and it looks like it got into the bundle OK and it shows up in the repo under releases, but in the github repository, it still shows 1.1.6 with the "latest" tag. Did I miss some step?

lone axle
solar whale
#

Thanks -- I missed that!

lone axle
#

That seems to have done the trick, the main github page for the repo shows the newer release now.

They put that check mark kind of inconveniently close to the "submit" button IMO. I know I have accidentally clicked the check while aiming for the button. It defaults to checked for me when the page loads, but I'm not sure if I configured it to do that somehow. For me it means if I click it then it becomes unchecked and I need to click again.

spare jacinth
#

exploring a weird idea, would anyone use something like this? 🤣
debating whether to add some more functionality and PR'ing to the bundle

import utest

class Example(utest.TestCase):
   def test_foo(self):
       with self.assertRaises(ValueError):
           raise ValueError

   def test_bar(self):
       with self.assertRaises(ValueError):
           raise OSError

   @utest.skip
   def test_skip(self):
       self.fail("should have been skipped")

Example(failfast=False)
code.py output:
test_foo: success
test_bar: failed
         OSError was raised while expecting ValueError
test_skip: skipped

orchid basinBOT
#

The yaml timestamp type is documented as requiring a 4-digit year and 2-digit day/month. We previously made changes to ensure that dates are always written as YYYY-MM-DD, because of how jekyll treats front matter.

Having some dates in a different format was one of the problems with correctly ordering the RSS feed. We need to flag this as an error during our CI process, because when the incorr...

lone axle
spare jacinth
#

ha, my code looks almost the same

manic glacierBOT
#

CircuitPython version

n.a.

Code/REPL

n.a.

Behavior

n.a.

Description

While porting CP to a new device, I discovered that many board.c files (I found 37) have this statement:

fourwire_fourwire_obj_t board_display_obj;

Strange thing is that this variable is only declared, but never used within the complete codebase.

Is there some special magic creating code that actually uses this variable?

Additional information

No response

manic glacierBOT
manic glacierBOT
#

This sorta plays MP3s from http servers. A128kbit/s VBR MP3 file served from a standard HTTP server works pretty well, while soma.fm streams don't play as well. This may be connected to the fact that it uses smaller TCP packet sizes, or that my other sample mp3 that I tested with is VBR so overall it's less data. Right now that's just a guess.

import time

import adafruit_connection_manager
import adafruit_requests
import audiobusio
import audiomixer
import audiomp3
import boar...
manic glacierBOT
#
  • Fixes #9198.

Intermittently, the loop in ble_drv_add_event_handler_entry() which walks down the linked list of existing event handlers, would loop infinitely. The list of handlers had a cycle in it. In addition, the entries in the list were damaged. This made me suspect a gc problem.

Some of the list entries were on the heap, and some were not. If some entry were not reachable during a gc, then that block of storage would have been recycled.

The easiest way to fix this was walk ...

manic glacierBOT
manic glacierBOT
ornate breach
#

Is there a way to change whether CS is toggled on every byte with FourWire?

#

I was looking and it looks like someone made a patch to do that in bus_core, but perhaps that can be an optional argument?

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I have an ILI9488 SPI display that I've been working on a driver for. Unfortunately, I can't seem to get it to work with the standard bus device as it looks like the display driver is expecting each byte over SPI to be clocked individually rather than sending it all over one clock.

@bablokb has their own version of the ili9488 driver in which they use a custom build of circuitpython that employs the patch here [bus core patch](https://github.com/bablokb/circuitpython-examples/blob/master/wav...

manic glacierBOT
#

My patch does not operate on bytes, but on words (i.e. 16bit wide units). And this is only necessary if the SPI-bus on the MCU side is connected to two serial-in, parallel-out shift registers that translate 8bit-SPI to 16bit-parallel. The shift-registers themselves are connected as 16bit-parallelbus input to the ILI9488.

So a very special setup on the display-side. Many ILI9488 displays just connect the SPI-bus of the MCU directly to the chip. These types of displays do not need the patc...

manic glacierBOT
#

I mean, either way there seems to be something not working right with any init sequence when using SPI with the ILI9488 devices when using SPI. I've tried with an init sequence derived from the data sheet, from TFT_eSPI (Arduino works), with similar sequences from adjacent displays.

I still tend to think the issue might lay with how bus core is sending the spi data to the display. I've compared sending the same init sequence that works with Arduino, and it's not sending the same data. This ...

manic glacierBOT
ornate breach
#

@slender iron I did see the difference in spi data when I looked at it a month or two ago with my logic analyzer. I didn’t think to look what the color format was 😀

slender iron
#

it isn't too hard to add another color format

ornate breach
#

After I finish some stuff adding a new board to CP I’ll see about adding support for RGB565

slender iron
#

the trickiest bit will be that its 3 bytes

#

@ornate breach are you making a custom board for it? you could switch to parallel connection

#

it has RGB565 parallel support

ornate breach
#

No, I just have a spi one that I’d love to use on a project

slender iron
ornate breach
#

Plus a few people have come to my library asking if it was working yet

manic glacierBOT
#

RGB565 is what we support currently. It is 16 bits.

You'll want something like RGB666 in 24 bits. I think the 3 bytes of 24 bits will be the hardest part because we usually only do power of twos 1, 2, 4 bits and 1, 2 and 4 bytes.

Most of the color conversion code is here:
https://github.com/adafruit/circuitpython/blob/main/shared-module/displayio/ColorConverter.c

You'll likely need to change https://github.com/adafruit/circuitpython/blob/c47f013b9f7596fdaec67a71a891c96ec1f9df84/sha...

#

These errors aren't very helpful because they don't suggest what to fix. Either add more specific checks before this to give an error message (and try to reuse an existing message) or use CHECK_ESP_RESULT() to check the output:
https://github.com/adafruit/circuitpython/blob/c47f013b9f7596fdaec67a71a891c96ec1f9df84/ports/espressif/bindings/espidf/__init__.h#L21

This maps ESP-IDF errors to Python errors:
https://github.com/adafruit/circuitpython/blob/c47f013b9f7596fdaec67a71a891c96ec1f9...

manic glacierBOT
#

Please raise an exception when this is tried.

I'll look into ways to do this, but right now it's not clear to me how you could do this. You don't know until you attempt a seek whether the stream can be rewound, but you don't know if you're looping until the audio sink (e.g., the I2SAudioOutObject) actually tries to loop back that loop=True is even specified. So, the context where the problem occurs is in a background task.

#

With this PR I intend to expose the calibrated voltage read on espressif mcus and provide directly converted voltages for the rest of the ports.

Why? Espressif ADC is kinda useless for voltage readouts otherwise.
The bit shifts that take place in .value make it incredibly difficult to have an accurate reading converted back to volts from python.
There is no reason to lose detail. The ESP-IDF already provides the reading to millivolts, so why not use that?

For the rest of the ports t...

#

Please raise an exception when this is tried.

I'll look into ways to do this, but right now it's not clear to me how you could do this. You don't know until you attempt a seek whether the stream can be rewound, but you don't know if you're looping until the audio sink (e.g., the I2SAudioOutObject) actually tries to loop back that loop=True is even specified. So, the context where the problem occurs is in a background task.

I think the simplest thing is to add an api to the sampl...

manic glacierBOT
manic glacierBOT
#

yay i will test tonite

On Fri, May 31, 2024 at 6:40 PM Dan Halbert @.***>
wrote:

@ladyada https://github.com/ladyada

You can view, comment on, or merge this pull request online at:

https://github.com/adafruit/circuitpython/pull/9290
Commit Summary

File C...

orchid basinBOT
manic glacierBOT
#

CircuitPython version

1) Adafruit CircuitPython 9.0.5 on 2024-05-22; Waveshare ESP32-S3-Zero with ESP32S3
2) Adafruit CircuitPython 9.1.0-beta.3 on 2024-05-22; Waveshare ESP32-S3-Zero with ESP32S3
3) Adafruit CircuitPython 9.0.4 on 2024-04-16; Adafruit Feather ESP32-S3 TFT with ESP32S3

Code/REPL

import gc
import time
import board
import neopixel
from rainbowio import colorwheel
from adafruit_thermistor import Thermistor

led = neopixel.NeoPixel(boa...
manic glacierBOT
willow totem
short tendon
#

I believe If they were skipped, that would mean the code change doesn't affect that board...

onyx hinge
#

@willow totem looking at the related PR run https://github.com/adafruit/circuitpython/actions/runs/9327213101 I can see that adafruit_feather_esp32s3_tft was not built. you can see a list of all artifacts on that page. One that _was_built on github is also on s3: https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/adafruit_feather_esp32_v2/en_US/

If PR9289 "should have" made a difference on the adafruit_feather_esp32s3_tft board then there's a bug in the tooling which should be reported as an issue.

GitHub

CircuitPython - a Python implementation for teaching coding with microcontrollers - Merge pull request #9289 from tannewt/esp_ble_bonding · adafruit/circuitpython@f810f4d

#

however, I think it's "correct": adafruit_feather_esp32s3_tft does not enable _bleio, but the only changes in PR9289 are in _bleio

willow totem
#

in my head, all the s3 boards should be affected, but I could well be wrong

#

ah, got it, I expected most s3 boards to have _bleio switched on

#

I appreciate those with displays lack more space

onyx hinge
#
ifeq ($(CIRCUITPY_ESP_FLASH_SIZE),4MB)
CIRCUITPY_BLEIO = 0
endif
``` maybe it's this stanza?
#

in ports/espressif/mpconfigport.mk

willow totem
#

Thanks, that allows me to play if desperate, for now I'll probably drop the tft board BLE testing (he says reaching to update his fork)

onyx hinge
#

some code to efficiently calculate sin/cos to ~4.5 digits that might come in handy for making synthio filters tweakable in real time: https://gist.github.com/jepler/fe74b3f0a0f409f208b94fb3b840a7cb

no need to call 2 expensive trig functions, just calculate two related degree-5 polynomials. About 9 float multiplies & 6 float add/subtracts for sin & cos.

hopefully that'd make it fast enough to re-calculate the filter parameters every 256 audio samples, so the filter parameters can be controlled via LFOs...

not that I'm continuing work on this right now, but the exercise of making a quick sin+cos approximation was interesting to me

Gist

GitHub Gist: instantly share code, notes, and snippets.

#

typical error of approximation, note the scale

manic glacierBOT
#

Thanks for the feedback! I made some changes to hopefully improve the error messages. Here, I opted for CHECK_ESP_RESULT which would raise an Invalid Argument error if the period_index is wrong. I could have used Invalid %q to specify that it's the period_index that is wrong. But that would have meant a new string, and here the user can easily figure out which argument is wrong based on the description of the function.

#

And here I also chose CHECK_ESP_RESULT for the ulp_*_run() functions, since (to my understanding of the possible failure modes of these functions) there is nothing to user can do in the case that these functions fail. Hence it doesn't make sense to waste more memory for error messages explaining what exactly went wrong.

For the ulp_*_load_binary() functions on the other hand, CHECK_ESP_RESULT would raise a rather confusing ESP_ERR_NOT_SUPPORTED in case of an invalid binary. So in...

ornate breach
#

is there a way to disable FLOPPY in rp2040 builds?

#

ah wait, CIRCUITPY_FLOPPYIO = 0

manic glacierBOT
#

Additional observation this morning. Put the S3 TFT feather on to a breadboard so I could hook up physical thermistors. Only change to the code is the resistors I used are in a 1k SIP, so the setup code for the two thermistors changed from 10k to 1k. Crashed in the 194th loop with a divide by zero error that I have been seeing periodically. If I simply try a CTRL-D or a Save in MU to soft boot the code immediately crashes on the first loop. Repeated CTRL-D multiple times in a row to verify. R...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Which is what I thought might be happening when I was running with no hardware connected to the pins where random noise at the open pins could result in a zero reading. This is why I then made sure to add the thermistors & resistors this morning so there would be no way there should be 0V at the pin and I still experienced the divide by zero fault. It ran the loop 193 times with valid room temperature mid/upper 70°Fs readings for both thermistors then 3 seconds later on loop 194 read the firs...

manic glacierBOT
manic glacierBOT
#

MicroPython depends on a particular version of uncrustify to format its C code. This version is available from https://launchpad.net/~pybricks/+archive/ubuntu/ppa, but not for Ubuntu 24.04. A .deb from a previous version could be installed, but that's not necessarily a long-term solution. (The long-term solution is to update to a newer version of uncrustify.)

The maintainer of that PPA has now created a PyPi package for that version of uncrustify: https://pypi.org/project/micropython...

manic glacierBOT
#

#include <Adafruit_NeoPixel.h>

// Define the pin and the number of LEDs
#define LED_PIN 6
#define LED_COUNT 1

// Initialize the NeoPixel library
Adafruit_NeoPixel strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);

void setup() {
strip.begin(); // Initialize the strip
strip.show(); // Initialize all pixels to 'off'
strip.setBrightness(50); // Set brightness (0-255)
}

void loop() {
// Cycle through different colors
setColor(255, 0, 0); // Red
...

manic glacierBOT
manic glacierBOT
#

First is to get your own VID/PID as per the instructions here https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython/frequently-asked-questions
I believe you are currently using an Adafruit combo.

There's probably more and I don't know the answer to your question for defining the initial content. You can include frozen modules in the firmware by following instructions here: https://learn.adafruit.com/building-circuitpython/adding-frozen-modules

manic glacierBOT
manic glacierBOT
tiny peak
#

I'm planning to write up a Playgrounds guide about it. [edit: the Playground guide is up]

manic glacierBOT
#

That's a great idea (adding it to the docs).

I think the actions list is both alphabetically and last used, so normally
it's off screen, but currently as I've been hammering the builds for BLE
testing it might be visible.

This is what my phone see's

Whereas with this change the single board action will be second (just above
Build boards), along with supporting forks and branch selection (only used
if version/tag is default of latest)

On Sun, 2 Jun 2024, 20:10 Dan Halbert, **...

manic glacierBOT
manic glacierBOT
manic glacierBOT
empty salmon
#

How often are PRs processed on Learning Guides? and/or Whom do I communicate with to answer any open questions on a PR? (2813)

manic glacierBOT
tulip sleet
tulip sleet
empty salmon
#

@tulip sleet - thanks for the advice. The PR mentions what is was tested on. I could have added that the tests were not don't on other hardware because I didn't have them.

My initial experience confused me - how could the error be in all the guides, it must be me - until I realized the error was in the learning guides but not is the library example code.

tulip sleet
#

The library code changes the 550's to 560's. Could you push a change that does that too?

#

I approved but then realized they should be 560's to be consistent

empty salmon
#

OK. I will update the PR with the duration changes.

tulip sleet
#

let me check the header values too

#

header values are 9000, 4500 in the library

#

maybe retest on your own setup with those header values to make sure they work ok

#

@empty salmon ^^

empty salmon
#

OK, after an embarrassing copy/paste error, he learning guide PR has been updated 🫣

lone axle
# tulip sleet <@382939733107408897> the thing I sent you in email about the readthedocs defau...

Regarding the RTD deprecation of README.html I'm taking a closer look into it now with the intention of making any changes we need this week if possible. However I'm unsure of a few things:

Are we actually using the deprecated technique? Inside a local copy of a library repo (asd1x15, the 1st one in the lsit) when I build the docs the file that gets output is index.html as far as I can see there is no README.html involved anywhere in our docs build. If I try loading a URL like https://docs.circuitpython.org/projects/ads1x15/en/latest/README.html I get a 404 page, Whereas https://docs.circuitpython.org/projects/ads1x15/en/latest/index.html loads the same page as the same URL sans index.html.

I'm wondering if they have some tool or metric they used to generate that list of repos, and if so why it only includes some libraries and not all of them. AFAIK the configuration is fairly consistent across libraries, but perhaps this subset still has something different about it? Or maybe the rest of the libraries are now considered sub-projects of circuitpython, so they aren't listed out specifically in the list?

tulip sleet
#

is ads1x15 a subproject?

lone axle
#

One of the 'how to update your project' steps mentions:

Migrate your Sphinx documentation to use master_doc = "index" instead of master_doc = "README". This can be done by re-structuring your documentation or by creating a symlink from of index.rst -> README.rst.

lone axle
tulip sleet
lone axle
#

The RTD configuration is something I don't have much insight into. A few of the libraries that I started, I created the docs for and still have access to admin/settings on. But the vast majority I do not have access. I'm also not exactly sure how the sub-project / parent-project relationship works in RTD, but in my mind there is one that is at least tied to the way the custom docs URLs work.

tulip sleet
#

ok, it is a subproject

lone axle
tulip sleet
#

yes, every CPy library should be a subprojevct

lone axle
#

okay, I'm at a loss for why only those ones in the email were listed then and not all of them.

#

That makes me think they had some tool to "check" for ones affected, but it's unclear to me what about these ones would make them affected by the deprecation. vs other like display_text for instance.

tulip sleet
lone axle
#

Ahhhh

tulip sleet
#

i'll see whether that library is unusual in having all those versions. it might be a setting issue. Or maybe it was one of a few libraries long again that used README.html.

lone axle
#

it looks like only the oldest one 0.2.1. README.html is 404 on 0.3.0

#

I think typically libraries show just latest and stable. I don't recall ever seeing that big list of versions. Though I also don't open that pull up thing too much.

#

it does also look like all the ones in the list are similar with old numbered versions existing.

tulip sleet
tulip sleet
# lone axle I think typically libraries show just `latest` and `stable`. I don't recall ever...

I started deleting the numeric versions on some libraries, but it's very tedious because a single library might have several dozen such versions. I'm thinking it's not worth it at all: the README.html links are on really old versions that nobody is going to click on anyway. At some point we should figure out why some have numeric versions and some don't, and maybe clean that up with some RTD API scripts, but it doesn't seem very important after all.

manic glacierBOT
lone axle
#

<@&356864093652516868> the weekly meeting will be occuring here on discord at the usual time of 2pm eastern / 11am pacific, which is about 1 hour from now. The notes document is available here: https://docs.google.com/document/d/1A-m8lDphnjKaPfIkQtyfb1Tb0lk9HHPnEFO8wNgLTIQ/edit?usp=sharing for you to put in hug reports and status updates. We looking forward to hearing from you in a bit!

manic glacierBOT
stuck elbow
#

I keep getting /home/sheep/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: __init__.c:(.text.common_hal_espidf_get_total_psram+0x12): undefined reference to esp_psram_get_size'` when trying to compile main or 9.1.0-beta.0 for the esp, any ideas?

slender iron
stuck elbow
#

I did make fetch-port-submodules and did esp-idf/install.sh afterwards, that should do it?

slender iron
#

check git status too

stuck elbow
#

seems good

onyx hinge
#

@stuck elbow could be a mismatch about whether psram is enabled in esp-idf-config?

#

@slender iron @tulip sleet I have my gpio profiling data ^^^ give me a moment to explain it

stuck elbow
#

this is for seeed_xiao_esp32s3 that is not yet merged, so maybe something about the board definitions changed?

tulip sleet
#

the ESP-IDF submodule might not be up to date in your clone

slender iron
#

git status would show that

#

board def stuff changed with 9 but its been a while

stuck elbow
#

I added CIRCUITPY_ESP_PSRAM_SIZE = 8MB CIRCUITPY_ESP_PSRAM_MODE = oct CIRCUITPY_ESP_PSRAM_FREQ = 80m to the mpconfigport.mk, now I get CMake Error at esp-idf/tools/cmake/project.cmake:587 (message): SDKCONFIG_DEFAULTS '/home/sheep/dev/circuitpython/circuitpython/ports/espressif/esp-idf-config/sdkconfig-psram-oct.defaults' does not exist.

slender iron
#

I think it is OPI

stuck elbow
#

thanks

slender iron
#

iirc

stuck elbow
#

compiling...

onyx hinge
#

D1 is "get_buffer" from the mp3 stream. it should occur regularly, though there is some variation (not sure why). D0/D2/D3/D4 are related to the buffer fill of the MP3 coded audio from network, drilling down to a progressively smaller portion of the code. D4 is just around the line mp_uint_t out_sz = stream_p->read(MP_OBJ_FROM_PTR(stream), buf, len, &errcode);: After the socket has been determined to be readable we ask for a read of up to len bytes, and it takes quite a long time, nearly 50ms, to complete the read.

I haven't eliminated the possibility that this is GC or something, but my program's not generating garbage and socket recv shouldn't generate garbage either. it feels like something in the network stack...

stuck elbow
#

success, thanks everyone

onyx hinge
#

hmmmm maybe it is my bug. let me think about this a bit more. There's a loop around stream_p->read and it does NOT check readability at each iteration.

slender iron
#

I'd probably be more help when talking it over video

onyx hinge
#

yeah just doing a quick brain dump

willow totem
#

Re: Micrpython1.23 - OpenAMP sounds really interesting, C<->PY dual cpu coordination. Also the Frozen module size reductions

gilded cradle
#

Sorry about that. All sorted out now.

onyx hinge
#

[debian stable's version of uncrustify is still OK for circuitpython but for those running testing the pip-installable version of uncrustify is probably the way to go]

willow totem
#

Would that G0 i2c coprocessor work in a similar OpenAMP (RPC) way, or more like a seesaw with limited predefined i2c methods (while still running cpy on the G0)?

slender iron
#

I have tooling I intend to bind C state to a python object for access

onyx hinge
willow totem
#

oh didn;t read it yet, thanks

onyx hinge
#

[thanks for reading that]

slender iron
#

My intention is that the G0 harness code could allow memory access over i2c

#

🙂

onyx hinge
tiny peak
#

re: in the weeds python versions... macOS Ventura on M1 is python 3.9.6

slender iron
#

thanks for hosting foamyguy!

gilded cradle
#

Thanks

onyx hinge
#

yay -- gpio profiling helped me notice where I was doing a blocking read in the background context. now you can still get a glitch if you cause LOTS of packet loss (putting a finger on the metal can of the module does this pretty reliably). remaining problem: crash when hitting ctrl-c on an mp3 stream

lone axle
#

Here is the notes document for next Monday’s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868>
https://docs.google.com/document/d/1UroZPgqf8H2sqgK9PbootZYyfOgK2PySqTj5470siHA/edit?usp=sharing

manic glacierBOT
#
[adafruit/circuitpython] New branch created: correct-branch-logic-custom-builds
tulip sleet
#

@willow totem did you cancel the new PR build?

willow totem
#

i didn't think so, but maybe accidentally, I was deleting the adafruit branch (not my remote branch tyeth/blah), so was stopping the jobs still using it (the others listed tyeth:blah instead of blah). I'll avoid that from now on.

manic glacierBOT
#

@dwetchells If you reduce the program to something like the below, does it still crash? I have removed all the display and control peripheral code. Does it crash on pretty much any MP3 file?

... appropriate import statements

SD Card setup

sd_cs = board.D13
sdcard = sdcardio.SDCard(spi, sd_cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")

mp3_filename = "something.mp3" # your first filename

mp3_file = open(mp3_filename, "rb")
mp3stream = audiomp3.MP3Decoder(mp3_file)

#

this is now working pretty well for me with the soma.fm "drone" stream on a metro esp32s3

it succeeds in streaming for >2 minutes (not everytime) without glitches.

however, sometimes the stream still stops prematurely, and the looping problem is not properly handled. depending on network characteristics such as packet loss, playback can still glitch; for me this is easily caused by putting my finger on the metal can of the esp32s3 microcontroller module. sometimes it recovers, sometimes...

devout jolt
#

Same energy 😄
(I don't think this is a bad solution, but it did make me chuckle)

manic glacierBOT
#

sometimes plays for 4 minutes, sometimes for 30 seconds. usually says playback has ended, but occasionally hard-faults.

  • non-stream playing works for "a long time", though I probably never played an mp3 from SD card longer than 8 minutes, so while I can do it for hours (e.g., all week-end back when I was testing jeplayer) that's across many, many individual files decoded
  • I haven't tested how much I could just "stream" and discard from a soma.fm stream in regular Python code on the sa...
austere acorn
#

Ohai,
I wasn't sure I would be able to make the CircuitPython meeting today, so I'm posting my update now.

I started working on porting CircuitPython to the Electrosmith Daisy Seed board https://electro-smith.com/products/daisy-seed a couple of months ago, and I gotta say, it was more of a challenge than I imagined 😅 Since the internal flash for the MCU is just 128kB, CircuitPython needs to run entirely from the external flash, and I had a lot to learn about how to do that.

After weeks of figuring out how to get the external flash working in QPI mode (no examples out there for this ISSI flash chip), how to write an external loader for the ST programmer, and how to write the bootloader that will make the jump from internal to external flash, I finally have "Hello World" running on Daisy Seed: REPL working, and on board LED is blinking!
https://www.youtube.com/watch?v=n6aPXO9yjxk

This is still very much a work in progress, but I'm happy I got the first results, and I intend to write a full documentation of my process.

slender iron
austere acorn
manic glacierBOT
#

Yes. I tried everything I could think of came to the conclusion that the library was not compatible. If I went back to 8.x it recognized the sd card. Totally repeatable.

Sent from Mars


From: Dan Halbert @.>
Sent: Monday, June 3, 2024 2:43:40 PM
To: adafruit/circuitpython @.
>
Cc: ThinMan @.>; Mention @.>
Subject: Re: [adafruit/circuitpython] Walkmp3rson learn guide does not work with CP 9.x Freezes and displays USB...

#

One other thing. It tried it using a nRF52480 and it works with cp 9. I thinks it a rp2040 issue if that helps.

Sent from Mars


From: Dan Halbert @.>
Sent: Monday, June 3, 2024 2:43:40 PM
To: adafruit/circuitpython @.
>
Cc: ThinMan @.>; Mention @.>
Subject: Re: [adafruit/circuitpython] Walkmp3rson learn guide does not work with CP 9.x Freezes and displays USB not recognizable on PC Windows (Issue #9211)

@dwetc...

slender iron
austere acorn
slender iron
#

@hybrid scarab how does the ulab CI work now for these?

hybrid scarab
#

specifically:

sed -e '/MICROPY_PY_UHASHLIB/s/1/0/' < circuitpython/ports/unix/mpconfigport.h > circuitpython/ports/unix/mpconfigport_ulab.h
#

Then, during make, supplies CFLAGS_EXTRA="-DMP_CONFIGFILE=\"<mpconfigport_ulab.h>\"

slender iron
#

power is blinking so I may disappear

hybrid scarab
#

Ooof, hope all is okay!

slender iron
#

ya, just windy

#

UPS ftw

#

I feel like I need more context for what you are trying to do

manic glacierBOT
hybrid scarab
slender iron
#

I get your point that it is seding a value not in that file

hybrid scarab
#

The issue being, specifically, that py/mpconfig.h offers a means to override mpconfigport.h which is not respected at all points in the codebase

slender iron
#

that only matters if we used it

#

I suspect we'll reorganize a bunch of that in the future

#

because it means non-port stuff is dependent on a port specific header

hybrid scarab
#

So it's just a vestigial non-feature, then! I had guessed as much

#

In that case I'll back up a little from this rabbit hole and drop its usage from the CI

#

Boy howdy I sure spoiled myself obsessing over build times in our CI 🤣 🤣

slender iron
#

ya 🙂 its on our "it'd be nice" list

hybrid scarab
#

You need less planning and more ADHD, works wonders!

manic glacierBOT
#

I tried the code you have above, only changing some pin assignments to use a TFT FeatherWing with an SD card socket. I am using an Adafruit Feather RP2040. I do not see the hard crash you see after mp3stream = audiomp3.MP3Decoder(mp3_file). I am using a generic Micro Center 16GB SD card.

I am using the two low-bit rateMP3 files from here:
https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/main/MP3_Playback_RP2040/Pico_Multi_File

If you have an MP3 file that causes a cra...

manic glacierBOT
#

Huh. I will tear it down and restart. What pin assignment did you choose. Right now it just crashes the moment it read the SD card. I am using 9.0.2 so maybe it got fixed in 9.0 5. Fingers crossed. Thanks for looking into this. Not sure why the RP2040 is causing the problem for me and the other MC boards are working

Sent from Mars


From: Dan Halbert @.>
Sent: Monday, June 3, 2024 7:50:06 PM
To: adafruit/circuitpython @.
>
Cc: Th...

atomic summit
#

Hey folks - I want to add a new board or 2 to CP, and I'm curious about how far away 9.1 is, or if I should add them to both 9.0x and 9.1 ?

sleek relic
manic glacierBOT
#

I was using a couple of different TFT FeatherWings: https://www.adafruit.com/search?q=tft+featherwing. These don't actually have the correct display (it shows up as a mirror image), but that doesn't matter -- it's not going to affect the operation of the program, because these displays are write-only. But the TFT FeatherWings have an SD socket too, so that provided the SD card for me without having to wire it up. If you have an SD card FeatherWing or similar, you could try that. Else try to m...

lone sandalBOT
manic glacierBOT
#

Yet another aliexpress board that is easy to get.
It's the first decent C2 board I found, so I picked one up.

Works fine, connected to a bunch of wifi networks.

Notes:

  • The two sets of uart pins are internally connected, even if they are labeled differently.
  • There is no status indicator at all.

Pending creator id stuff.

manic glacierBOT
tulip sleet
#

@willow totem re #9301 above: did you turn on verbose logging or something? I've never seen so much in the log

#

(too many @Tyeths 🙂 ) could you add an avatar or maybe be Tyethg or something? )

manic glacierBOT
#

Also Dan, my apologies again, as this one might have been better detected if I'd cleaned the cache before calling the script change good.
Although we can switch the fork option to use the remote name origin, that feels hacky as heck so will see where the bug / issue is before making any radical changes.
Also worth noting the builds do work if the user doesn't cancel the large CI job when they first enable actions in their fork, or upon pushing any change. They also work in the adafruit rep...

tulip sleet
#

As core developers, we very rarely run CI jobs in our own fork

willow totem
willow totem
tulip sleet
#

what's the git command that is actually causing the failure?

tulip sleet
#

@tyeth

willow totem
#

ah, that might be the imposter 😄 she's an artist that liked the tag and was quick to notice the new username requirements

#

I'll stick an image on, like the GH one (a toucan)

tulip sleet
#

could you point me to an earlier run without the verbose logging?

#

I'm not sure which git version is being used, but we could start using --filter=blob:none instead of shallow clones, though that may not have anything to do with this.

#

is this all so you don't have to build locally?

willow totem
willow totem
#

Only by turning on Git Trace did I then see it doing all sorts of fetch things for the recursive submodule init/update at which point it then references the "user-fork" or "fork" remote name for the parent repo instead of remote name for submodule. Why it specified remote at all for submodule fetching I do not know.

tulip sleet
#

I would try to reproduce this locally. It seems like overriding and allowing the file protocol is a bad idea. So the q is why is it trying to do that, and we don't see that in adafruit PR builds

willow totem
#

No, agreed, and I don't see it (transport 'file' not allowed) if the remote is origin (when doing a non-fork normal 500board CI job),** although I do see the remote name in submodule fetch**

tulip sleet
#

if we are still running on 22.04 then the git version will be too old and the git ppa would need to be set up to fetch a newer git

willow totem
tulip sleet
#

i wonder if this is at all due to the "detached head" thing you see when you check out a remote that is not the main remote for your clone

#

can I step up a level and ask why you don't want to do builds locally?

willow totem
#

i thought I'd get around that detached head by doing a branch for the remote fork branch (checkout -b bla tyeth/bla)

willow totem
misty garnet
tulip sleet
misty garnet
#

np

tulip sleet
willow totem
# tulip sleet @tyeth

I migrate between rooms and the greenhouse 😄 Oh and actually it turns out I'm all three Tyeths in this server

#

the main rig is also crap, but better than the others

tulip sleet
#

maybe remote desktop access to a stationary higher-powered machine...

willow totem
#

That's a very sensible idea.
Don't worry for now Dan, I just thought I'd stick the issue up for visibility and in case anyone had seen similar before, I'll play with runner versions and see what GH say

#

I do really appreciate you taking a look / thinking it through with me though 🌟

tulip sleet
#

happy to cogitate on this

willow totem
#

love that word

onyx hinge
#

yuck, there are lots of crashes if you start fuzzing our mp3 decoder 😕

#

it looks like some kind of memory corruption tends to occur when I exercise the mp3 code using a soma.fm stream. Usually it terminates decoding with an error that indicates bad MP3 format, but sometimes it safe-modes. but I can't capture the stream and decode it too [well I might be able to with tcpdump or ???? but I haven't] so I don't know if it's something about the content of the stream or something about the way it's delivered. It happens much more often than every 5 minutes so it's not TOO bad to iterate on, but I don't have many clues at this point.

#

I thought maybe fuzzing (automated program that creates varied inputs trying to find a program crash) would point me at one obvious thing but instead I have 59 distinct crashes it's discovered 😕

#

I guess I can curl/wget a portion of the stream, then serve it from a local http server. If that errors, I can repeat it as many times as I like; if it doesn't, that tells me it's something about the server.. I think I'll do that next

tulip sleet
onyx hinge
#

or something in the network stack I suppose

manic glacierBOT
#

I am fairly sure I did but re-reading my tedious notes above, I see I don't have an entry stating that. I will double check tonight as the Waveshare should still be running the 9.1.0-beta.3. On the Adafruit S3 TFT I only ran that one on 9.0.4 as I thought it might be the version on the two S2s I have running this code for months without issue but checking one of the S2s, it is at 9.0.3. I can upgrade the S3 TFT tonight to 9.1.0-beta.3 and retest it as well. And I got a notice yesterday that m...

#

Do you think there is any value loading 9.0.3 onto any of the S3 boards since the S2 boards run fine with it? Or do you think this is an S3 specific issue and we should only be looking upward and onward with current versions only?

Based on your testing, I think this is an S3-specific issue. S3 with 9.1.0-beta.3 is the only test still to do, I would say. If that's a fix, great, otherwise I will set up an S3 board and let it run for hours.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.0-beta.3 on 2024-05-22; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3

Code/REPL

# This is the failing line. I am use portalbase library to manage the feather esp32s3 and using the network class to do the connections and get the time from adafruit io
utc_time = self.portalbase.network.get_strftime("%Y-%m-%dT%H:%M:%SZ", location="UTC")

Behavior

  Fi...
slender iron
#

so maybe stable in the next week or two?

manic glacierBOT
#
  • Fixes #9174, or at least improves the situation somewhat.

Free up RAM on the Pico W build so that more networking can be done, by disabling CIRCUITPY_USB_HOST. Note that CIRCUIPY_PICODVI is already turned off by default.

It still seems to be the case that once a networking error happens, the co-processor or its supporting code may get into a bad state that requires a hard reset.

#

Sorry @tannewt I've not managed to get a good debug output as it goes straight to safemode, but when a debug build I didn't see that it just stalled and serial eventually disconnected.

I was testing on the LilyGo T-Display-S3 (as the 4mb flash builds dont have BLEIO), and then eventually on the ESP32v2 Feather (8mb Flash / 2mb PSRAM).
Testing against the Web Bluetooth Dashboard https://adafruit.github.io/Adafruit_WebBluetooth_Dashboard/ with an SHT3x (sht30/31/35 temp+humidity sensor but ...

tulip sleet
#

@slender iron (he/him) I just read that ESP-IDF 5.2.2 was released

slender iron
#

👀

#

I'll update it in my BLE follow up PR

manic glacierBOT
#

MICROPY_STREAMS_POSIX_API enables a number of routines, but we wouldn't be using them all. Probably the linker would avoid pulling them in though?

the posix wrappers also uses the global errno value, which I'd rather avoid (but it does make sense as a POSIX-style wrapper).

mp_stream_rw or calls that end up inside it are not suitable (*there is no mp_stream_read just mp_stream_write for some reason), because we need to take care to check for readability before EACH read call, b...

ornate breach
#

Thanks @slender iron for merging my PID request 😎

#

Now all RPGA feather needs is for the mini panels to arrive, and a circuitpython official build and things will be golden

manic glacierBOT
manic glacierBOT
#

Currently only "RP2040 boards and some i.MX boards" support changing the CPU frequency. In particular, none of the esp32 boards do, despite the hardware being capable of this in principle.

Is this not implemented simply due to lack of significance, or was there a deliberate decision against this? (E.g. was this tried and determined to result in unstable USB/Peripherals/... ?)

Looking through previous discussions on this topic (e.g. https://github.com/adafruit/circuitpython/issues/2284, ...

#

CircuitPython version

Adafruit CircuitPython 9.1.0-beta.3 on 2024-05-22; Raspberry Pi Pico with rp2040

Code/REPL

#### boot.py ####

# rawhid_boot.py --
# any changes here only reflected after board reset

import usb_hid

REPORT_COUNT = 63  # size of report in bytes

CUSTOM_REPORT_DESCRIPTOR = bytes((
    0x06, 0x00, 0xff,  # Usage page (Vendor Defined Page1)
    0x09, 0x01,        # Usage (Vendor Page 1)
    0xA1, 0x01,        # Collection (Appl...
manic glacierBOT
#

Hi Dan, So We picked a new RP2040 Feather board and installed 9.1.3 beta an the required 9.0 libraries.
Using all of what John Parks hardware it still fails. attached is a photo and the code I am using.
If I go back to CP 8 and its libraries. It works just fine. If I use other MCUs they all work except the RP2040. Just so odd I haven't tried a different SD socket yet since it works with CP 8.0x just so odd. I tried serveral SD Cards as well for alot of vendors including what Adafr...

manic glacierBOT
#

Config:
Adafruit CircuitPython 9.1.0-beta.3-16-g9601f4e58b on 2024-06-04; Raspberry Pi Pico W with rp2040
adafruit-circuitpython-bundle-9.x-mpy-20240604 (except for HTTP Server from #88):

Code...

# HTTP[S] Server Test
# Pico W + W5100S hat

import time
time.sleep(3)  # wait for serial
import gc
print(f'{gc.mem_free()=}')

import os
import board
import digitalio
import ssl
import adafr...
manic glacierBOT
short tendon
#

@lone axle question for you. The work you added to use circup to install something from local, could that be expanded to grab something from a URL? like https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Requests/3.2.9/adafruit_requests.py?

#

Ideally mirroring the format of pip

lone axle
#

although modules that aren't a single file would be more tricky

manic glacierBOT
manic glacierBOT
short tendon
lone axle
manic glacierBOT
#

2024-06-04

Waveshare - verified it was still on the beta that I last ran it. From boot_out.txt…
Adafruit CircuitPython 9.1.0-beta.3 on 2024-05-22; Waveshare ESP32-S3-Zero with ESP32S3

Running with TFT to see code running, using 2x 1k SIP packages to create voltage divider at pins D7 & D8 to simulate the thermistors and verified with a meter that each pin had 1.64V at each pin while running..

Looped just over 100 times (~ 5 minutes) before the board disconnected from my iMac...

ornate breach
#

Hey @tulip sleet any chance you can get rpga feather PR looked at? 🙂

#

I saw you were active on gh and figured it was worth an ask

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
spare jacinth
#

does someone need to manually trigger a release for circuitpython-stubs? as in, it is not shipping with #9221
or does it rely on some stable version of CP itself being released?

lone axle
# spare jacinth does someone need to manually trigger a release for `circuitpython-stubs`? as in...

I think it depends on when and to what branch the PR was merged. It was merged to main and I think that when it was merged we had already started the 9.1 beta releases, so new code from main is going into the 9.1 "lineage" not the 9.0 lineage. 9.0.5 was released after #9221 was merged, but I don't think 9.0.5 could have contained a merged from main, just 'fix' stuff for the 9.0 lineage, not new stuff which is going toward 9.1.

You can install the pre-release version now that includes the list command with:

pip install circuitpython-stubs --pre
# Or with a direct version specifier like
 pip install circuitpython-stubs==9.1.0b3

Whenever 9.1 gets a stable release, that will be the first non-pre version that has the list command I think.

spare jacinth
#

ok, thx for the quick and complete answer 🙂

#

figured it was a release kind of thing, but wanted to raise the question in case it relied on some manual trigger 😄

#

--pre doesnt work, also grabs 9.0.5

urban knoll
#

Hey all, wondering if you've got recommendations for tools, config and workflow for JLink debugging on RP2040?

lone axle
# spare jacinth `--pre` doesnt work, also grabs 9.0.5

that is weird, I don't have any idea what could cause that, maybe try updating pip or something? for me right now it's getting the beta:

❯ pip install circuitpython-stubs --pre
Defaulting to user installation because normal site-packages is not writeable
Collecting circuitpython-stubs
  Using cached circuitpython_stubs-9.1.0b3-py3-none-any.whl (844 kB)
Installing collected packages: circuitpython-stubs
Successfully installed circuitpython-stubs-9.1.0b3
spare jacinth
#

maybe i needed to also use --upgrade to skip cache

#

anyway, i got it with the specific 9.1 tag, no worries

lone axle
#

Ah, that could be if it was already installed. I explicitly uninstalled before.

spare jacinth
#

maybe not only uninstalling, i believe pip's caching survives the uninstall, but anyway i dont feel like testing this, i already have the latest hahaha

#

huh, takes 1.5-2 seconds to generate/print the whole list, too many boards

ornate breach
#

Thanks @tulip sleet 😄

manic glacierBOT
urban knoll
tulip sleet
urban knoll
#

How about rp2040?

#

I keep wanting to like fancy debugging tools, then falling back to pin toggling and printf's

tulip sleet
#

i have not tried the rp2040 debugging tools (picotool, etc.), but it's supposed to work

manic glacierBOT
slender iron
manic glacierBOT
#

I tested further. MP3s from the CIRCUITPY drive play reliably. I also enabled the ability to seek inside a file mp3 before starting playback, which was not previously possible.

Streams MP3s from soma.fm or a local http server are still unreliable (playback stutters or stops more than once per minute), and sometimes cause hard faults (more than 1 hard fault per hour). The bit rate or channel count of a http stream is also occasionally reported incorrectly, which prevents playback. I was una...

slender iron
#

but usually start with print debugging

#

(github copilot is good at autocompleting print debug statements)

short tendon
tulip sleet
short tendon
#

I'm still playing with things. If we clone, then we have more control. I'm imagining where I want to pin azure and it has a ton of files. Adding each one and it knowing they need to be in a directory together would be complicated

tulip sleet
#

if you use a clone then you have to make sure it's up to date

#

i thought that maybe the github api would do the file tree enumeration you want

short tendon
#

It would clone, copy files and delete the clone

#

It probably does, but I didn't want to reinvent the wheel

#

Or assume git was installed

tulip sleet
#

and this is a special case for a branch, when you want something not in the bundle?

lone axle
#

Peronally I lean towards just using requests if possible. That is used to pull the bundles already internally anyhow. Or if that can't work for some reason then I'd lean toward assuming git is installed if user wants to use this feature rather than introducing a seperate requirement for it.

short tendon
#

So I see it for a few cases:

  1. Something not in a bundle (like a personal repo)
  2. Pinning a version (for cases like breaking changes)
  3. Grabbing a specific file
#

Since many users aren't developers, they won't have git

onyx hinge
tulip sleet
#

but I think most of these cases are for sophisticated users who will have git installed. doing cp -r locally is not that hard. I'm thinking that these fancier features are not going to get used that much.

lone axle
#

the users installing specific libraries or versions from github directly via URL strike me as more likely to be developers than more general end users.

short tendon
#

Yeah, but then you need to make sure it can unzip...

tulip sleet
#

unzip is built into cpython, I think

onyx hinge
#

the bundle is a zip file, so circup can handle zips right now

#

of course there are no mpy files if it's not a release

short tendon
#

So my goal was to make circup match pip with the requirements

#

Which I would find super useful. Sounds like you all think maybe not

#

I'll probably keep this in a local fork

tulip sleet
#

i think circup does not need to be as good as pip. I see it as an end-user tool. I'm more frustrated by having to remember "Is it upgrade or update, etc.

#

i also see that when Melissa finishes the current work on code.circuitpython.org, that web tool could have library installation/updating added to it, with a list of libraries to click on, etc.

#

right now circup needs python installed, which is a big lift for the average user who is not a developer

#

you could look at MicroPython's mpip tool for inspiration

lone axle
#

The download with requests and unzip route seems like a good one to me. That would allow the similar or same functionality if pip even if implemented differently if I'm understanding correctly. And as Jeff noted that is also how the bundles are operated on by circup already so it would keep the new functionality working similar to existing.

short tendon
#

Sounds good. When I finish my fork, I'll share it. See if there are parts you would like in the main version

#

I'll look at the zip stuff and see if it's as easy as what I've done with dulwich

manic glacierBOT
onyx hinge
manic glacierBOT
onyx hinge
#

@slender iron how can I get debug tracebacks without changing the optimization level? right now playback doesn't keep up in a debug build

slender iron
#

ah! do menuconfig and change the panic handler

#

(can video if you want to)

onyx hinge
#

I'll ping you if I don't get it sorted out .. it'd be after my lunch, it's 11:53 here

slender iron
#

after you do menuconfig the settings will go in the board's sdkconfig

#

and you'll want to do a clean and flash to rebuild the idf