#circuitpython-dev
1 messages · Page 67 of 1
Yeah, even if that gets separated out into a separate connect, I wonder if a smaller max timeout could be used
is there a better place to discuss library design? It doesn’t seem to fit really here or in #help-with-circuitpython
Yeah, I struggle with where also. I usually do here, or open up a PR...
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?
I had toyed with looking at 1-wire and opened an issue https://github.com/adafruit/circuitpython/issues/8498 I don't know if they are relevant but there were a couple of info links I had run across
it'd be grand to have SDIO support on espressif family microcontrollers. Modules are enabled by putting CIRCUITPY_SDIOIO = 1. This can be in the board's mpboardconfig.mk, like ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk:CIRCUITPY_SDIOIO = 1 or at the port level as in ports/cxd56/mpconfigport.mk:CIRCUITPY_SDIOIO = 1.
(make BOARD=whatever clean after changing those .mk files)
As best I can tell, the changes are what's intended. github doesn't seem to like loading such a large diff but I did some local git work and it looks sensible.
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...
sorry for merging this prematurely. I should have left the review but not merged, but I was in a hurry and the board looked green. mea culpa
You didn't miss anything! It was green! I only saw the issue when I was doing a build locally for other reasons. I should have done more local testing.
I don't think this is actually causing any problems, but I should get rid of the warning.
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...
<@&356864093652516868> and anyone else who's interested: The weekly CircuitPython meeting will start in about two hours, at 2 pm US Eastern time. If you're planning on submitting notes but haven't written them up yet, here's the notes document: https://docs.google.com/document/d/19GmXK8VzVgchFclJTfG4C6ejqNsg9emYgCgpcv1PVZ4/edit?usp=sharing
@wraith crow @onyx hinge - excellent help and references - thanks heaps.
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...
The Internet here is not good enough to support me joining with voice but hello from pycon! I'll be back next week.
PewPew for Playdate. Contribute to cwalther/pew-playdate development by creating an account on GitHub.
Time to start a devlog about this, since I’m making some progress lately! The project has been going for about a year, so this first story-so-far post will be a little long. PewPew PewPew is a family of small homebrew game consoles designed to teach game programming with Python. With an 8×8 pixel display and an API whose documentation fits o...
panic is the company
It does help
I really like that plan, thanks for talking this on. I think Circuitpython-connector has a better ring to it :grin:
That sounds like an AWESOME idea for a hackathon challenge!
I'm interested in any thoughts or feedback about this plan or the name of the integration library.
I think it'd be simpler to add a second CLI entry point into this repo instead of splitting it apart. It takes more coordination if it is multiple libraries.
Installing circup can just install the new command as well.
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.
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
Thanks for hosting Dan.
Thanks for hosting Dan. Hope everyone has a great week!
500 boards!
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
This is the ticket opened over the weekend with the issues: https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT/issues/216
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.
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.
The arguments to the display initialization in board.c are pretty much the same as in the Python code, so you can probably copy an existing board (maybe even the badger), and replace those args (and fix anything else that's different). Also check the other files in the board directory.
It seems that the Build and Validate Stubs task inside of the docs job in actions failed for the release of 9.0.4 https://github.com/adafruit/circuitpython/actions/runs/8709993694/job/23890925410 This resulted in pypi not getting a 9.0.4 version of circuitpython-stubs so it's still showing 9.0.3 is the latest stable release at https://pypi.org/project/circuitpython-stubs/
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
yes, this build problem was fixed post 9.0.4, but I can't regenerate the stubs easily. I could just copy them to 9.0.4 bit 9.0.3 is good enough
Do you have a github repo with your current efforts for your board? That would be easier for someone to take look and notice any obvious changes that need to be made assuming you already have a correct pins file.
Not yet, but I'm currently hacking away at things and will give it an upload soon. I need to do a once over on pins.c still, but it should be more or less correct, at least for the epaper display
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
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.
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?)
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.
Yeah, I've been scouring a bunch of different examples and libraries so far, and they've been pretty helpful
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.
the settings in the CircuitPython Python library supposedly should be fine
https://github.com/ben-hawks/circuitpython/tree/main/ports/raspberrypi/boards/aivillage_dc32_badge I went ahead and pushed stuff to a repo finally. It builds successfully and I get a REPL no problem! That being said, there are some issues with the display, it seems to be able to connect and refresh, but shows basically garbage on the screen, even with a simple test script
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).
That is a lot to configure. Someone with eink experience will have to answer that one.
Yeah 😅 I'm sure its a matter of finding the right settings, things seem to be "working" hardware wise (I've seen and had some hardware failures before with this board, and the eink fails different for hardware errors in my experience), but Just something config/driver wise
This is currently what i get with what's committed to the repo
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
when the battery is fully charged, what would be a typical value?
around 4.5 (recalculated for the graph attached to message, I did not logged the raw values) but I have not encountered this issue on battery (perhaps because battery runs out faster than it takes to trigger the behavior). The pic above is when all of the devices connected via usb.
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?
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
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)
I just posted measurements on T-Display S3 with fully charged battery (and usb connected)
ok, thanks, I will try flashing 9.1.0 beta and see if issue occurs again after some hours
another couple of ideas if it reproduces on 9.1.0:
- 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.
- 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.
Yeah, makes sense. Perhaps a learn guide. As it is, I'm working on some features for a package that the code editor uses, that could also be beneficial to the installer here, so there will likely be some changes to make it work on more boards. But once that's all in place, it would make sense to write something with better documentation.
Thanks. This will work for the moment. If we think of improvements in the future, we can add them at that time.
Good ideas. Thanks for the suggestions. :) A lot of the enforcements were added after I had written the guide and you're right that it needs some updating.
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...
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 least TLSv1.2, if not also TLSv1.3 and we'd try the "best" one first.
There are test hosts here for TLSv1.0, v1.1, and v1.2: https://badssl.com/. You can just try a connect or a request from those.
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...
This is from Python? The c code should be analogous to the Python code so there must be a mismatch somewhere
Can you try setting it to v1.2? v1.3 may not be supported.
Closing for now. Please reopen if you have further questions.
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.
Yeah, I think there's something different, but I'm just trying to parse and figure out where the issue is
I'll take a look at your board code
That would be incredible, thank you!!
I think it is your ramxcount and ramycount
the python library patches those values
you can hard code it for your board
Ah, I think I haven't updated the repo yet, I did hardcode those values and its still failing :(
Let me push my updates really quickly
Oh wait, its patching the ramx and ramycount values? I didnt realise, I thought it was patching the Driver_control values
I think it is
you can change the driver to print out start_sequence 🙂
maybe display size?
Update the MacroPad RP2040 page to refresh the keypad supported firmware(s).
Went ahead and did that, this is what the python driver's start sequence is:
Start Sequence:
\x12\x80\x14\x11\x1\x3\x3c\x1\x5\x2c\x1\x36\x3\x1\x17\x4\x3\x41\x0\x32\x4e\x1\x1\x4f\x2\x0\x0\x1\x3\x27\x1\x0\x22\x1\xf4
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 😅
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.
Also update the libraries to the latest as of today. There have been changes even today that will not be in the bundle until tonight.
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):
...
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
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...
I'd suggest you test the same thing with MicroPython.
It's odd that the SSL module doesn't support options like verify certificate (to false) and TLS version - is this to save code space?
remind me which version we match?
we most recently merged from MicroPython v1.20, last october
We are using mbedtls under the covers. It may or may not provide some of this functionality. We implemented a subset to cover most use cases. Additions are welcome via PR.
MP 1.20 Warning: exception chaining not supported
1.22 is probably the same, Jeff enhanced what was there
It is, just checked
If I file a bug (which I will), do you think it would get into 9.1.0?
it's not a bug, it's a deliberate deficiency, and it's not so easy to fix
ahh
depends on how much it gets you to write a PR? :p
if jeff didnt do it back there, there's probably a good reason for it
whether it was about time to write it, code complexity/mainteinance, flash/ram consumption, etc... i dont know
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
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?
Does this make sense:
# MicroPython doesn't support exception chaining
# and CircuitPython can't chain on non-base exceptions
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.
given this is about making the feature better, i dont think it goes any further from the current they-dont-have-it state
but may still be quite a bit of work to get it working, and perhaps not too useful anyway...
I'm not actually back to work until the 28th
what about raise Base from Sub and raise Sub from Base?
the spirit speaks 🙂
tests/circuitpython/traceback_test_chained.py in the source tree and its associated .exp file shows what we test
and of course then cast one of them, eg something like: base = Exception(subclass.args) or the like
So the issue is (as you can see from the code sample) an issue where we don't raise a helpful exception
as in... maybe you can get it to work if one of them is not MMQTTException but Exception and you could recover part of its contents/information
I would love to but I feel like I'd be over my head when it comes to TLS ....
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
@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
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) == Exceptioninstead ofisinstance(inner, Exception)
(however that idea translates into the C API :p)
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
Will take a look at the code after dinner but will probably not get a fix done hahahaha
Maybe looks at compile time (C-defined) classes, but not runtime (py-defined) ones, then
Time to start dumping data into github :p
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)
more info:
raise Exception("inner") from "Exception"
raises a Hard Fault
but:
raise MMQTTException("inner") from "Exception"
Doesn't
The cause was that setting the __cause__ property on an exception didn't set the built in exception object's cause property, so it's necessary to fetch the property from the actual object when needed.
WHATTTT!!!!!
I'm not actually back to work until the 28th.....
Did he also invent the time machine?
probably.
pycon is sprints today so I'm at my computer and wasn't concentrating on anything anyway
Well, thank you. I didn't even get the bug open yet
Will test as soon as the builds complete
Looking at the compilations settings, the Espressif boards are compiled to support TLSv1.2. The link you posted above is not what the source code looks like any more. It enforces a minimum TLS version based on the compilation options.
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...
@tulip sleet if the exception fix and esp32spi get into the next beta - we'll be in an awesome spot for networking
@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 ...
@justmobilize so are you saying it works for you? Not sure :)
@dhalbert , yes I now see both exceptions. This works perfectly
Thank you for the quick fix!
it will - i have to merge from 9.0.x but I will do that
Is there any other testing that's needed? I could see this coming up somewhere else...
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.
I didn't test RAW, only used the (interim) NTP lib to test UDP.
Wondering why is double-buffering disabled here?
https://github.com/adafruit/circuitpython/blob/2854dbe37f52dc9ebf48035dfc82bba83c8f9cac/ports/atmel-samd/common-hal/pwmio/PWMOut.c#L278-L286
and why is it necessary to wait for sync?
https://github.com/adafruit/circuitpython/blob/2854dbe37f52dc9ebf48035dfc82bba83c8f9cac/ports/atmel-samd/common-hal/pwmio/PWMOut.c#L275-L276
Thanks!
I’ll give it a read through first thing in the morning.
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.
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.
Correct about BLE workflow as well. It's not currently supported by Circup, but it could be added theoretically.
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
good call. I'll also add a bit about why you'd use it.
@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)
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?
Nope, there isn't.
The answer is right there on the page you linked
workarounds, such as using other organisations’ VIDs without permission, or simply making up a VID and PID. These solutions make things worse for everyone, by damaging the assumption that a VID/PID combination is unique to a given device
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.
@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.
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.
This is really stretching what I know about TLS but you're right. I wrote a small shim around circuitpython's socket class so I could inject some logging. The first thing it sends is:
No problem - I am looking at a number of things about the SSL implementation that I had not tried to understand in detail previously, in order to figure out why we're having other problems, such as memory issues. For instance, I did not know about the TLSv1.2 compilation option.
I'll merge from 9.0.x and update all the frozen libs soon. Let me do that in separate PR's.
@dhalbert I wasn't going to open this fully. I wanted to test things out on a bunch of boards and my local build system isn't working. I'll close this out by the end of the day. I also wanted to give Paul a link to download and try (I was trying to be patient and not bother you about it...)
I want to update all the frozen libraries at once, and there are one or two outstanding PR's, I think.
Automated website update for release 9.0.5 by Blinka.
@short tendon I restarted the build. I just couldn't read your mind 🙂 . Fine to do that -- just tell us in the PR.
After it was cancelled, it couldn't start up again
I restarted the wrong thing. What's wrong with your build env, could you use help with that?
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
I am about to do a 9.0.x branch merge PR.
Sounds good. I'll just wait for the next beta
Merge changes in 9.0.5 to main. Some 9.0.4 -> 9.0.5 changes were already done, so this really ends up just being #9266.
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)
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,
)
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...
@tulip sleet, I wonder how helpful something like https://github.com/adafruit/circuitpython/issues/9265#issuecomment-2125248117 would be as a CP library, that if it was installed ConnectionManager would automatically wrap the socket...
I think this is a useful thing, but I don't think it needs to be added to ConnectionManager. It think setting it up to log should be manual for now, to make it clear what's happening, and to avoid extra code in ConnectionManager. It's the kind of thing we could put in a Learn Guide
Could you file this as an issue and describe the versions you are using, and what's on the board (flash, PSRAM or not, etc.). Thanks.
So the only code that would be added to CM, would be the import and if it works, the 2 liner if/then wrap
will do.
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)
creating a wrapped socketpool makes sense. You have a socketpool that will wrap the underlyling socketpool.socket in a specified wrapping class. I am just leery of doing of doing the wrapping automatically if the library is present. That's also could be a nuisance because preventing it means you have to rename or remove the LoggingSocket library.
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)
Many vendors will give out PIDs for devices with their micro. Links are at the bottom of this page https://pid.codes/faq/
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"""
...
yes, that makes sense
and why is it necessary to wait for sync?
I don't think it is necessary. It was just a choice we made during the original implementation.
Wondering why is double-buffering disabled here?
No idea. Its been years since this code was added.
Cool. Would we want that in the main bundle, or should I make it for the community bundle?
community bundle for now, because we don't want to necessarily be responsible for suppot
I will go ahead and merge this. The RAW case seems like it should be the same. We can fix if there's something pathological.
how long did you have to wait before it got stuck? I would try to reproduce this locally, but I don't have that board. I hope it would be possible to reproduce otherwise. It does seem like something is going wrong with the ADC rather than the pin itself. I looked for similar issues in the esp-idf repo but didn't find any
its kinda random, can happen anytime from 3~6 hours and then randomly fix itself or get broken again, but it happens on all 8 devices that i have. There are other stuff happening on devices, like wifi connection, sensor reading over I2C, etc. - not sure if it can be related. I will also try reproducing it isolated without any other additional code.
thanks for trying that
just writing a loop to poll the value over and over might do something
Ok! I'm going to be looking at this and #7747
adafruit_connection_manager
adafruit_ESP32SPI
adafruit_requests
In particular, ESP32SPI fixes a bug introduced in 9.1.0-beta.2.
@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.
Automated website update for release 9.1.0-beta.3 by Blinka.
New boards:
- bradanlanestudio_explorer_rp2040
- esp32-wrover-dev-cam
- espressif_esp8684_devkitc_02_n4
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.
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...
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?
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
Something I've been playing with. Created a playground note for a wrapper to get the radio for a device. I can now run the same networking based code with no changes on ALL my CP devices!
https://adafruit-playground.com/u/justmobilize/pages/get-radio
feedback appreciated
@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?
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.
was there a battery attached?
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
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)
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?
... maybe ... though that ADC channel is not activated, so in theory it should not make any difference.
Thanks. I will try different ways to come up with minimal reproducible setup.
Adding my vote - want to run some idle animations while the radio is connecting, etc.
@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.
Others:-
raytac_mdbt50q-db-40
raytac_mdbt50q-rx
TG-Watch
ai_thinker_esp32-c3s
ai_thinker_esp32-c3s-2m
ai-thinker-esp32-cam
beetle-esp32-c3
columbia-dsl-sensor
crcibernetica-ideaboard
lilygo_ttgo_t-01c3
lilygo_ttgo_t-oi-plus
morpheans_morphesp-240
zrichard_rp2.65-f
cp32-m4
kicksat-sprite
silicognition-m4-shim
@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...
@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?
Yes, Feathers, or the QT Py's.
Is there a specific QT Py that has the smallest?
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)
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.
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
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)
Synthesizer aways produces audio samples even if no notes are playing, so it's effectively an infinite stream of audio. Loop=true/false only matters when an audio stream ends
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
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;
}
}
}
Because it doesn't return DONE
ah thanks, that's a good toe-hold
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-picousing the "Pico" board type works after reset
The board uses a 16MB Winbond W25Q128JVPQ. I've recompiled the standardraspberry_pi_picoCircuitPython to include this chip inmpconfigboard.mkwithEXTERNAL_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?
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..
@devout jolt a stab in the dark but try using this setting https://github.com/adafruit/circuitpython/blob/8.2.x/ports/raspberrypi/boards/adafruit_feather_rp2040/pico-sdk-configboard.h
this is familiar and can be due to the clock oscillator not starting in time. There's an adjustment for that, which we added to all the adafruit boards... hold on while I find it.
oh, there, it is , I hadn't scrolled down. jepler points to what I was going to
Ah hah! That’s the setting I was vaguely recalling. Thanks @tulip sleet & @onyx hinge! I’ll try it out
@cristians-12 There are no default RX, TX pins on this board, but according to the Lolin board convention you should use pins 39, 37, so:
import board
SerialPort.begin(9600, SERIAL_8N1, board.IO37, board.IO39);
According to ESP policy you can use/define any pin as hardware I2C, SPI, and UART
The root cause of this is #2179. Closing in favor of that issue.
The root cause of this is #2179. Closing in favor of that issue.
The original problem here is that when .value raises an exception, it causes dir(a) to not show .value. That is a dir(analogio.AnalogIn) will show value. TThe root cause of this is #2179.
There is a documentation problem that says you can't use AnalogIn at all when wifi is in use on the ESP32. That is wrong. You can't use ADC2, but ADC1 works. I will fix the documentation.
@braye I looked at the stack trace and thought that perhaps something was being set up incorrectly or not set up. Here is a UF2 that has some logging printouts in tud_hid_set_report_cb() and also has CIRCUITPY_CONSOLE_UART... set up as you did. Could you try this and send the output? Thanks very much. This is build on 9.1.0-beta.2.
@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...
@devout jolt let me know if the oscillator fix doesn't solve your issue. I can help with flash bringup
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 64to theraspberry_pi_pico/pico-sdk-configboard.hboard? - 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 theraspberry_pi_picoboard because it has all GPIOs inboardand usually its flash choice works well enough.
(also didn't it used to be thatmicrocontroller.pins.*wasn't completely filled out, just being aliases forboard.*? But I see that's no longer the case at least on RP2040. maybe I'm thinking of a different chip arch)
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.
There are a ton of Pico clones of various shapes. When people ask about the 16MB clones, I usually point them to the gnd_yd_rp2040 but it doesn't have all the GPIOs brought out to board. Lately, I've noticed CircuitPython is autodetecting the 16MB flash even when a 2MB flash is configured. Maybe since v9?
flash size has always been autodetected. you still risk the wrong access settings though
so a generic board would have to include all known expected flash chips
sounds like
EXETERNAL_FLASH_DEVICES in mpconfigboard.mk is required.
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...
@dhalbert , I think this firmware was built for the wrong board. I'm using the sparkfun_pro_micro_rp2040, and it looks like this was built for the sparkfun_micromod_rp2040. It throws an error about referencing board.NEOPIXEL when I flash it to my device.
Whoops, sorry! That was a copy/paste error. Here is a build for sparkfun_pro_micro_rp2040:
logging-sparkfun_pro_micro_rp2040.uf2.zip
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.

I'd estimate it's probably a days work to add the rule, fix the doc, and update all the boards currently using hyphens.
Looks good to me, thanks for cleaning this up!
I'm phone access only (travelling 😀) so I didn't search the core to understand the MAX3421E parameter impact but the changes look good to me.
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...
The board_id's are also used for https://circuitpython.org, so if you rename a board, you need to make that still work with both the 9.0.x and the 9.1.0 versions. There is a board_alias feature in the code for the website, but I'm not sure you can have more than one alias.
Issue noted in https://forums.adafruit.com/viewtopic.php?t=211010 (wbeebe).
Espressif moved the RGB LED. Quoting from their doc:
Both the initial and v1.1 versions of ESP32-S3-DevKitC-1 are available on the market. The main difference lies in the GPIO assignment for the RGB LED: the initial version uses GPIO48, whereas v1.1 uses GPIO38.
Creating n...
Thanks everyone for your reviews!
It definitely seems to be the case that 9.0.5 exhibits the crashing behavior, and 9.1.0-beta.3 does not.
OK, sounds great! I'll declare this "fixed" in 9.1.0. I hope that works for you, and that the KVM is usable now.
Not crashing is enough for me :) Thanks for the help!
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...
Right now this is not possible, sadly. I don't know if there's a specific issue requesting this functionality though. @lone axle did a guide that created a fullscreens editor and I think it created the cursor programmatically, but I'm not sure of the details, and I don't think it worked with the >>> REPL
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...
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....
This pull request fixes Issue #8770 as well as a few more minor issues with the existing espulp implementation. The changes/issues addressed are:
RISCVULP 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 theFSM, while others had access...
- Enhances
docs/shared_bindings_matrix.pyto optionally add more board details to the returned dict - Adds
docs/board_summaries.py, which creates.csvreports 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...
I have enabled the _eve module by default for all ESP boards with a flash size greater than 2MB as of commit 8d57867. For boards that already have a display, I have still enabled the _eve module for future use.
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
Re this thread: https://forums.adafruit.com/viewtopic.php?f=58&t=175096 Some weirdness trying to use dir() with the CPX. Can recreate it: Adafruit CircuitPython 6.1.0 on 2021-01-21; Adafruit Ci...
Looks like I'm not the first to find it. Thanks!
Yeah, goes all the way back to #2179 apparently
And it is a MP issue, so not a whole lot to be done...
There's already a CP patch in there, so maybe... https://github.com/adafruit/circuitpython/blob/781c577745338128e1994d0b63fe95d75f3ef786/py/modbuiltins.c#L173
I tried fixing this a few years ago, and ran into more problems than I would have expected.
I'm surprised they haven't. I can imagine a ton of hidden bugs from calling a property without realizing it
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()
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.
PR looks good, module looks amazing even by my cranky code standards.
Looks like a lovely excuse for me to give ULP a try.
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...
@stuck elbow @devout jolt @split ocean you may wanna take a look at https://github.com/adafruit/circuitpython/pull/9279 and have opinions
Neat! What is the retrigger key for and why does it take an LFO?
Neat! What is the
retriggerkey for and why does it take an LFO?
It resets the LFO to the initial state.
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.
Neat! What is the
retriggerkey for and why does it take an LFO?It resets the LFO to the initial state.
I see. This mirrors the Synthesizer.change() API (which I don't use much)
Would this new functionality be appropriate for automating filter changes too? Filter modulation currently has to be done by hand, creating a detached LFO on note press, reading it repeatedly and applying it to Synthesizer.low_pass_filter(). I suspect not, but thought I'd ask. 😀
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...
laser = [laser_note, laser_lfo, 0.3, -laser_note]
This seems more confusing to me, if the intent is the sequence is meant to represent a timed set of calls to Synthesizer.change()
And I think that for sanity's sake we should also automatically stop all notes at the end of the sequence.
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.
Do we even still need the change method when we can trigger events simultaneously with sequences now?
I just encountered to time_to_refresh never reaching 0.0 bug.
I am handling paper refreshes through asyncio and track the time_to_refresh to know when it can be refreshed.
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:
- 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...
It's easy to understand for you, because you already know how the
changefunction 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...
So something like:
laser = [NoteOn(laser_note), laser_lfo, 0.3, NoteOff(laser_note)]
synth.play(laser, loop=True)
for example?
Happy to use a different approach, though new types seem to chew up a bunch of flash.
Yes this is not a solution to changing filters dynamically.
Compared to the async routine this code guarantees changes happen atomically when respect to sample generation and that delays are consistent. Also it never generates garbage.
Compared to the async routine this code guarantees changes happen atomically when respect to sample generation and that delays are consistent. Also it never generates garbage.
For the records: the issue is #9244 and creating a PR is on my todo-list.
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...
For portable (across boards) code, this would be a bummer.
board_id is how code is supposed to tell what it's running on.
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...
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...
@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...
@dhalbert Are you suggesting that we should eventually (once we know how we want the language to look like) go the way of the PIO assembly, and just specify a text string with the language in it, and parse it into whatever internal structure we need?
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...
@deshipu No, no, I'm saying you're inventing a programming language that's represented as a data structure. Let's see if we need a new language, and if so, what are its primitives, and then see how to represent that language. The language representation does not need to be text.
@dhalbert It's a data format, for it to be a programming language, I would expect it to have control structures. Specifically, it's a time series data.
I'm not saying it's a Turing complete language. I'm saying that conceptually it specifies operations and their arguments. And I could easily imagine it starting to have conditionals, loops, etc. By my definition MIDI sequences are a programming language, yes. Maybe you'd disagree.
We wouldn't need a
releaseanymore, 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...
Perhaps instead of putting this in synthio directly, we could only have a minimal, bare-bones way of playing a sequence of notes in the background, designed to be minimal, and have a separate sequencer module written in Python that uses a user-friendly interface?
I don't have opinions on what constitutes a programming language, but i would love to be able to create something like nanoloop in CircuitPython to run on a PyBadge/PyGamer https://youtu.be/Kxdgo86mSW0?si=zvaASdwh1RzFwVB9&t=306
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 ...
Time stamps: I suppose they COULD be relative to the start of the sequence. Does this make anything better/worse on the whole? Related question: is there a better "unit" than seconds?
This one I know! At least for music, you want "beats", with a tempo specified globally, and then one beat being one "tick" in that tempo. Fractional beats would be rare.
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.
@jedgarpark I think this is already possible!
@jedgarpark I think this is already possible!
It is sorta. I built it. And the timing is too sloppy to be useful. I ended up porting it all to Arduino.
@todbot Same for me, the only thing I didn't like is adding of the "start" and "stop" operations, because that's different from what other similar modules do.
But if we assume there will be a Python module that will give us a more convenient interface (as I assumed for my sound effect library), then the exact format doesn't really matter.
@deshipu @todbot yes, the timing needs to be rock solid for this, and i'm thinking the use of four synthio voices so it is a sequencer with build in synthesizer that outputs audio would be more taxing than sending out MIDI.
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'
I was loosely following this article but it is out of date: https://learn.adafruit.com/extending-circuitpython?view=all
are you sure your source files are being compiled? You can use the V= options to see all the compilation lines, and also check in the build directory for the proper .o files.
(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?
Your right it doesn't seem to be compiling my module, which is strange because I had compiler errors before. Okay I found it, SRC_PATTERS += aurora_epaper/% mistyped PATTERNS. 🤦♂️
Thanks!
Ack, thanks for the pointer!
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 ...
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 🙂
I’ll add it!
I've updated the published release notes for 9.0.5 and 9.1.0-beta.3. I also added ESP32-C2, which is present in beta.3, but not 9.0.x.
Nice!
I removed this line from espressif/boards/adafruit_qualia_s3_rgb666/mpconfigboard.mk.
The configuration is refactored to espressif/mpconfigport.mk at commit https://github.com/adafruit/circuitpython/commit/8d578670be362d3f462a5dda2bd5ed6fb290c50c
Closing in favor of #2676.
@jepler wondering what is your latest thinking on this? Recently I opened #9225 with an eye towards DSP sorts of things but as I become more familiar with the codebase I am realizing that really the thing is to do is to integrate input from built-in, I2S, and even SPI ADCs into the synthio/audiomixer framework.
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?
<@&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!
CircuitPython Weekly Meeting for Tuesday, May 28, 2024 This week’s meeting is on Tuesday due to a US holiday on Monday. Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates before the meeting, alphabetically by your username. During the meeti...
If you're making your own board that you'd like to release as an official board (as opposed to some product where CircuitPython is not visible to the user, say), then it's fine to make that a contributed board. You can get a USB PID from https://github.com/raspberrypi/usb-pid or from https://pid.codes.
If you want to fork and maintain your own version, we ask that you not call it "CircuitPython". See https://docs.circuitpython.org/en/latest/README.html#branding
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.
Adds support for AutosportLabs ESP32-CAN-X2 dual can bus development board.
One request re VID/PID. Rest looks fine.
This is a "reusable" VID/PID, but we would prefer that you get a unique one. You can apply for one from Espressif at https://github.com/espressif/usb-pids, or you can get one from https://pid.codes, assuming your design is open source.
Raspberrypi implies that you need a company and a minimum quantity, and that you should use a standard one if possible. pid.codes says it needs to be open-source hardware, which I'm not sure if it would be if it has a Pico W in it? Maybe that just counts as a component?
Is there any concern about "CircuitPython" text inside it / instructions about what to do with version info etc?
you can change the strings that print "CircuitPython"
i'm confused, are you distributing this? So there is more than one?
There are currently 135 as far as we know
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?
I was wondering about freezing additional adafruit libraries too. Though we accidentally packaged adafruit_bus_device even though it was frozen, and removing it only seemed to save 30 bytes.
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
No I'm comparing with and without adafruit_bus_device on the CIRCUITPY drive on stock PicoW image
There is a python version of bus device too I think https://github.com/adafruit/Adafruit_CircuitPython_BusDevice. It was converted to C and added to the core more recently.
Deleting it saved 30 bytes of RAM
are you leaning toward a fork or just submitting a board?
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?
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.
almost the whole size. IMporting it adds a few dict entries but nothing else
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...
OK, that's great! I didn't look carefully enough and thought it was this: https://wiki.nonchip.de/usbid, but that's a different PID.
@candid sun i can finish the meeting if you want
Sorry I think my computer dropped internet
Thanks for hosting Liz. Have a great week everyone!
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
@tulip sleet am I good to merge and release this: https://github.com/adafruit/Adafruit_CircuitPython_AWS_IOT/pull/27?
Yes. To make a release, title it "x.y.z - something something", and use the Generate Release Notes button. That is all you need do to get it into the bundle and pypi
Done!
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
CircuitPython Weekly Meeting for June 3, 2024 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates before the meeting, alphabetically by your username. During the meeting, we go through them in order. If you can’t make the meeting and would st...
sorry I missed it but I had to catch up with some local friends over lunch. ❤️
on topic of speech synthesis and SAM, I just learned about https://components.espressif.com/components/jmattsson/picotts
Can confirm that this works with other SPI devices: I was unable to mix audio without crashing when loading WAVs from a microSD reader. Increased the buffer size and am now able to load and play as usual.
I have reproduced this problem. with a simplified version of your test programs on a Feather and ItsyBitsy nRF52840 I see that it's looping forever in ble_drv_add_event_handler_entry(). I think this may be due to insufficient locking around a data structure, but need to look further.
Adds entry for Autosport Labs ESP32-CAN-X2 board
@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?
@lone axle may be doing "sweeps" and releasing things as needed, or if you have the necessary access you are welcome to do it manually. (the instructions for doing so were reviewed recently if you're feeling rusty: <#circuitpython-dev message>)
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.
thanks both!
It appears to be failing because you have non-standard features under the features heading. We have it limited to just a few because it is used for filtering. You can move your board specific ones into the description.
@makermelissa Hi, I'm trying to figure out the date_added field format. I tried both YYYY-D-M and YYYY-M-D - and both are failing CI.
Currently it is date_added: 2024-28-5.
How should I format the date_added field?
Thanks!
The date should be in YYYY-MM-DD form, with leading zeros if necessary. So: 2024-05-28
Thanks for the discussion. I've noted one board that is designed for driving other displays and shouldn't be on this list.
@tannewt how do you feel about this addition?
@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?
Yup, I'm mostly around. Just gonna do lunch and a short walk sometime
(before our internal meetings)
I'm around as well
now is fine, or if you want an early lunch, can wait until after that. I have no more scheduled events today
We're in the video of our shared DM
Give me 5
@matemaciek can you take a look at this? It looks like you contributed this code.
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...
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
Was video recorded so we can watch it too?
@devout jolt the video was recorded and will be released on the pycon youtube channel sometime in the coming months
awesome!
I'd prefer to have new boards for these. That way the status LED will work too. We can use ccache to speed up additional board builds.
C5, C6, C61 and P4 all have low power RISC-V cores. (Defined as SOC_LP_CORE_SUPPORTED in ESP-IDF.) So, I'd vote for FSM on ESP32 because that's the only option. On S2 and S3, I'd go RISC-V because it is the future and improving tooling for it is more worth while. (A RISC-V assembler would be awesome IMO.)
My hope was to use clang for basic RISC-V code beca...
Thanks for fixing this up @Sola85 !
One request. Looks good otherwise. Neat spreadsheet!
Since this isn't used in doc generation, mind moving it to tools?
Hi @felipejfc, us Adafruit funded folks haven't done ESP-Now stuff. We're happy to help you debug this. The first step I do is with a debug build DEBUG=1 and then see the UART output for ESP-IDF logging. We're available US work hours on Discord: https://adafru.it/discord in #circuitpython-dev
The message will now say e.g.,
2021-1-21 is an invalid date for example-board. The format must be YYYY-MM-DD, using leading zeros if necessary
The leading zeroes are actually optional, so the correct date format is either YYYY-M-D or YYYY-MM-DD.
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 ...
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...
Thanks for the comments. I didn't know that more ESP's are coming that only have the RISCV ulp. I've made another suggestion for how we can keep both FSM and RISCV ulp in a separate PR.
The new PR only deviates from this one by one commit.
Circuitpython has it's own fork of idf.
https://github.com/adafruit/esp-idf
Wonder if you've got a prettier way of doing this relative import:
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 ...
The abs-path function would have to be seperate in order to reuse in areas like the mount function.
Also, it may be worth consider fixing this externally into perhaps a mount_manager module.
It's a lot of edits to the core.
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
A few boards freeze it to save RAM or because the manufacturer has chosen to freeze it.
Ah, good to know. Then I will propose a change enabling the use both ulps simultaneously in that repo instead!
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
@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?
I think it's controlled by this checkbox from the create (or update) release page. I'll try checking that box now and updating it.
Thanks -- I missed that!
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.
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
[we're discussing over on #1417 whether the YYYY-MM-DD format is required; I believe that it is]
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...
I think there is a similar one here: https://github.com/mytechnotalent/CircuitPython_Unittest
A repo that provides the MP-Lib unittest.py to CircuitPython to allow makers to take full advantage of Python's unittest within CircuitPython. - mytechnotalent/CircuitPython_Unittest
ha, my code looks almost the same
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
I think its leftovers from older code.
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...
- 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 ...
@gkecskes78 Would you like to test this? It fixes your #9198. Build artifacts are here: https://github.com/adafruit/circuitpython/actions/runs/9309095462?pr=9285
some full ports after these code changes :-/ I'll do .. something .. about it.
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?
So I could create a PR removing these lines from all these files?
The PR to adafruit/esp-idf mentioned above got merged. I therefore pulled these changes and enabled the RISCV ulp again on supporting boards. See also the updated description of this PR above.
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...
Added IO33 which was also missing. I didn't realize it when doing the first PR...
https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitm-1.html
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...
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 ...
This looks like normal SPI to me:
I think there is a bug on your side. I'd encourage you to use a logic analyzer to compare what CP does to your working Arduino example.
Now that I say it, this is normal SPI. However the pixel format isn't the normal RGB565 because this is three bytes. CircuitPython doesn't support this layout currently.
Do you have an idea of what it might look like to support RGB565? I'd be willing to take a look at the addition.
@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 😀
it isn't too hard to add another color format
After I finish some stuff adding a new board to CP I’ll see about adding support for RGB565
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
No, I just have a spi one that I’d love to use on a project
Plus a few people have come to my library asking if it was working yet
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...
Please don't add a new error string if something close already exists
mp_raise_ValueError(MP_ERROR_TEXT("Invalid argument"));
There is also "Invalid %q" that you can use if you know which of the two is invalid. That'd be more specific.
Thank you for getting this going! Just a couple comments about error checking. Generally we don't want to add new messages unless they are very specific.
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...
So I could create a PR removing these lines from all these files?
Yes please!
looping an MP3 stream can't work, and it makes the core very unhappy, so don't do it.
Please raise an exception when this is tried.
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...
The ILI9488 also supports RGB565. That is what I am using. You will find that in the datasheet as well.
RGB565 is only supported in 8b and 16b data bus. SPI only supports RGB111 and RGB666.
Too much hassle for too little accuracy gains.
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
- 387654d
https://github.com/adafruit/circuitpython/pull/9290/commits/387654d84381659673af2ef7472f77c2b8bc6b96
Add adafruit_feather_rp2040_adaloggerFile C...
Images automagically compressed by Calibre's image-actions ✨
Compression reduced images by 59.5%, saving 19.80 MB.
| Filename | Before | After | Improvement |
|---|---|---|---|
| assets/images/boards/large/adafruit_pixel_trinkey_m0.jpg | 257.57 KB | 135.66 KB | -47.3% |
| assets/images/boards/large/adafruit_trrs_trinkey_m0.jpg | 268.12 KB | 147.42 KB | -45.0% |
| assets/images/boards/... |
[oddly this PR didn't build even though our build.yml file looks like it should occur based on any pull request]
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...
adafruit_thermistor is quite simple. It uses analogio.AnalogIn. I'm thinking there is an ADC problem.
Thanks! This makes sense to me, but I did not test and don't know the API.
If GH says the ble bonding was merged 9hrs ago, shouldn't the S3 blobs have something dated the 31st May or 1st June? GB+ US same.
https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/adafruit_feather_esp32s3_tft/en_US/
Ahh, I've just seen the assets in the build action, but they don't contain the s3 related tft feather builds, that must be it, not ideal / thought concerning.
I believe If they were skipped, that would mean the code change doesn't affect that board...
@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.
however, I think it's "correct": adafruit_feather_esp32s3_tft does not enable _bleio, but the only changes in PR9289 are in _bleio
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
ifeq ($(CIRCUITPY_ESP_FLASH_SIZE),4MB)
CIRCUITPY_BLEIO = 0
endif
``` maybe it's this stanza?
in ports/espressif/mpconfigport.mk
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)
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
typical error of approximation, note the scale
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...
is there a way to disable FLOPPY in rp2040 builds?
ah wait, CIRCUITPY_FLOPPYIO = 0
Adds a CircuitPython build for RPGA Feather. PID is under review with pid.codes. I've tested this on my boards and it works as expected.
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...
The division by zero error is:
if self.high_side:
# Thermistor connected from analog input to high logic level.
reading = self.pin.value / 64
reading = (1023 * self.series_resistor) / reading
if the analog pin value is 0, then it divides by 0.
This updates the custom builds action to support forks, also renaming it to increase visibility as it has been off the bottom of the actions list for a while, but might be more used if more seen.
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...
This removes definitions of the otherwise unused variable board_display_obj in 36 board.c files.
Fixes #9283
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...
#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
...
This adds support for the ThingPulse Pendrive S3:
https://thingpulse.com/product/esp32-s3-pendrive-s3-128mb/
I couldn't find out how to add a reference to the CIRCUITPY drive. Is there a way I can define the default content of the drive?
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
I probably wasn't clear. You should go to https://github.com/espressif/usb-pids and follow the readme to allocate your own PID using Espressif VID. They (Espressif) have a process to allocate customer PIDs using their VID.
Adafruit allocates PIDs for its VID 0x239a. You can't choose one from that space. As @skieast mentioned, please read https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython/frequently-asked-questions about how to get a VID/PID combination for your board.
renaming it to increase visibility as it has been off the bottom of the actions list for a while,
Could you show a screen shot?
We should document this in the Building CircuitPython guide!
For people who are considering the question of how to deal with building sequencers to use with synthio, I've been working on a CircuitPython sequencer thing that you might find interesting. It more or less works now, but I haven't tested it very thoroughly: https://github.com/samblenny/txtseq
I'm planning to write up a Playgrounds guide about it. [edit: the Playground guide is up]
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, **...
I'm mystified why builds were working before without the setuptools in requirements-dev.txt. But adding that fixes a problem with the silabs builds.
Makes sense. Do docs or learn need to be updated too?
I was testing it during the weekend extensively and looks fine.
Thanks for the fix !
How often are PRs processed on Learning Guides? and/or Whom do I communicate with to answer any open questions on a PR? (2813)
TIL: sending image attachments as part of email replies doesn't work.
My phone sees this:
@gkecskes78 Thank you for testing!
You can add another comment to the PR asking if they are any questions. When I saw this PR I thought it should be tested on, say, a CPX, to make sure the problem you are seeing is across all IR implementations. It is worth investigating whether/why this wasn't caught before. I'd want to test a remote control to see what it sends, for instance.
i am now looking more carefully. It looks like they are indeed reversed. We'll need to change some text in the guides, too.
@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.
The library code was fixed really recently by tkomde's PR's. But that change should have been carried over into the Learn Guides, and wasn't.
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
OK. I will update the PR with the duration changes.
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 ^^
OK, after an embarrassing copy/paste error, he learning guide PR has been updated 🫣
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?
is ads1x15 a subproject?
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.
We already have master_doc = "index" in the repo here: https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15/blob/main/docs/conf.py#L44 but based on the second sentence there about restructuring or creating a symlink I'm not sure if this literal variable in the code is what they are talking about.
I'm not sure how to tell honestly.
I think it is. I didn't bother to check. I am trying to log in now to rtd
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.
ok, it is a subproject
Is something like Display_Text a subproject?
yes, every CPy library should be a subprojevct
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.
I'm wondering if an older version is using README.html. That library has multiple version of the docs available. See https://docs.circuitpython.org/projects/ads1x15/en/latest/ and click on v:latest at the bottom of the left sidebar
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.
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.
I think there are many libraries with multiple numeric versions listed. I'm not sure why some have it and some don't. Maybe it's the webhook settings, but it's not obvious to me.
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.
Thanks!
We should look at that list of build actions more carefully. Some are inapplicable, like the cc3200 port...
Do docs or learn need to be updated too?
Worth checking. I looked, and not that I can see. uncrustify is only used in this repo.
Just to be clear, you are getting things like the watchdog crash or divide by zero on 9.1.0-beta.3 as well as 9.0.x, right? We moved to a new version of ESP-IDF for 9.1.0, and I want to make sure that version still has the issue.
it was specifically https://learn.adafruit.com/building-circuitpython/linux#install-build-tools-on-ubuntu-2986713 that I wondered about, but you must have updated it already. thanks!
there may be a couple of references left in the source tree to the apt/dpkg-based installation method:
origin/main:.devcontainer/common_tools.sh:sudo apt-get -y install uncrustify mtools
origin/main:ports/silabs/README.md: sudo apt install default-jre gcc-arm-none-eabi wget python3 python3-pip git git-lfs gettext uncrustify
<@&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!
CircuitPython Weekly Meeting for June 3, 2024 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates before the meeting, alphabetically by your username. During the meeting, we go through them in order. If you can’t make the meeting and would st...
Is there a way I can define the default content of the drive?
Not really. It takes up space in the flash image so we try to keep it minimal.
Please get your own USB VID/PID combination as folks commented on the commit about.
This looks good. Invalid %q is the same string regardless of what MP_QSTR you give it. So you could also do that in a follow up PR.
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 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?
is your esp-idf folder up to date?
I did make fetch-port-submodules and did esp-idf/install.sh afterwards, that should do it?
check git status too
seems good
@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
this is for seeed_xiao_esp32s3 that is not yet merged, so maybe something about the board definitions changed?
can you try it on beta.3 instead of .0
the ESP-IDF submodule might not be up to date in your clone
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.
I think it is OPI
thanks
iirc
compiling...
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...
success, thanks everyone
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.
I'd probably be more help when talking it over video
yeah just doing a quick brain dump
Re: Micrpython1.23 - OpenAMP sounds really interesting, C<->PY dual cpu coordination. Also the Frozen module size reductions
Sorry about that. All sorted out now.
This code should work for circup ble: https://github.com/adafruit/Adafruit_CircuitPython_BLE_File_Transfer/blob/main/examples/ble_file_transfer_listdirs.py
[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]
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)?
Somewhere in between. Not sure we need full OpenAMP but it is intended that you load firmware as you need it
I have tooling I intend to bind C state to a python object for access
the blurb about openamp talks about shared memory scheme, but the G0 wouldn't share memory with the CircuitPython CPU
oh didn;t read it yet, thanks
[thanks for reading that]
re: in the weeds python versions... macOS Ventura on M1 is python 3.9.6
thanks for hosting foamyguy!
Thanks
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
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
CircuitPython Weekly Meeting for June 10, 2024 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates before the meeting, alphabetically by your username. During the meeting, we go through them in order. If you can’t make the meeting and would s...
Sorry Dan, I was initially under the impression I didn't have push ability to adafruit/circuitpython so I couldn't test it running with the adafruit repo owner. I did obviously test it against forks.
Turned out I mised something in the logic for branches when not a fork, so I've now resolved it and tested and it runs on adafruit repo fine.
@willow totem did you cancel the new PR build?
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.
@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...
Same energy 😄
(I don't think this is a bad solution, but it did make me chuckle)
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...
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.
Nice! Did you get the external ram supported too?
Not yet, I wanted to figure out the flash thing first, since the H750 has plenty of ram for basics.
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...
Makes total sense! Great progress!
Thank you! 😺
@hybrid scarab how does the ulab CI work now for these?
Hmm it's actually copying the existing config file and changing a setting with sed, which ... doesn't exist 😬
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>\"
power is blinking so I may disappear
Ooof, hope all is okay!
ya, just windy
UPS ftw
I feel like I need more context for what you are trying to do
Redo Feather C6 pinout so it include standard D# labels for feathers. Also, make busy pin wait interruptable.
Fixes #9244
I don't think it's relevant anymore, though the issue in the CircuitPython codebase- I think- still applies
I get your point that it is seding a value not in that file
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
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
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 🤣 🤣
ya 🙂 its on our "it'd be nice" list
You need less planning and more ADHD, works wonders!
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...
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...
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 ?
Sent from Mars?
OK
08:33:07.9326 MTC Sol 53473
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...
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.
CircuitPython version
latest
Code/REPL
-
Behavior
Description
No response
Additional information
No response
@dhalbert every seen anything like this? It fails with could not fetch 'user-fork' from the remote when talking about the esp-idf submodule, see this build log line:
https://github.com/tyeth/circuitpython/actions/runs/9358284335/job/25759793899#step:9:4428
@willow totem re #9301 above: did you turn on verbose logging or something? I've never seen so much in the log
it is failing earlier with another fatal error: https://github.com/tyeth/circuitpython/actions/runs/9358284335/job/25759793899#step:9:148
(too many @Tyeths 🙂 ) could you add an avatar or maybe be Tyethg or something? )
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...
As core developers, we very rarely run CI jobs in our own fork
I pinged you in discord if you want to discuss this now.
good morning 😄 yeah I turned on git trace 🫣
And sadly someone stole the #tyeth name once discord switched over
Sorry, ignore that error, it's where I publish both local and global git configs, but the git config global file doesn't exist
what's the git command that is actually causing the failure?
I'm both Tyeths on this server (.tyeth and tyethgundry)
@tyeth
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)
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?
right, let me give you minor background, I saw the transport 'file' not allowed and saw that was symlinks being denied, so I added that config option and that error went away but the user-fork remote being mentioned in the submodule fetch still happened, so I removed that config option. Probably a red herring.
https://github.com/tyeth/circuitpython/actions/runs/9356074069/job/25752665288
yes
I think the filterblob:none may resolve the file transport error you see there.
This is the first job where I enabled the allow symlinks and you see it moans about not finding "fork" (the remote name of parent repo) for submodule:
https://github.com/tyeth/circuitpython/actions/runs/9356365363/job/25753659619
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.
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
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**
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
oh fascinating, and a good point
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?
i thought I'd get around that detached head by doing a branch for the remote fork branch (checkout -b bla tyeth/bla)
Just cos my machine hates life, and I'm often switching between 2 low power laptops and a stationary gaming laptop
@tulip sleet is there any more work on my end for the minimqtt PR: https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT/pull/210 ?
sorry it fell off the list, I'll take a look today
np
are you not chez vous a lot of the time?
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
maybe remote desktop access to a stationary higher-powered machine...
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 🌟
happy to cogitate on this
love that word
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
DM'd you re something as well
or something in the network stack I suppose
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.
I tested again with a 320kb bitrate MP3 and did not see a crash. I'm going to take this issue of this 9.1.0 milestone for now, but happy to keep debugging.
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...
We were talking about an RC soon
so maybe stable in the next week or two?
How are you starting the device and connection each day? Is it a fresh power up?
Looks good! Thanks for getting a PID.
- 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.
Looks good overall. One question and two builds to fix.
What changes? Would it be better to enable the shared posix routines?
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 ...
@bablokb @anecdata pinging for interest
@slender iron (he/him) I just read that ESP-IDF 5.2.2 was released
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...
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
Good question. So I actually leave the device plugged into my docking station over USB. It is battery powered as well. So each morning I come in, hook up my laptop to the docking station which provides data and power to the device, but it is possible it was already powered on from the day before and running on battery but it would be in deep sleep mode.
Just a note for future readers, and a reminder to self:
It was proposed the older ubuntu runners (22.04) may need git updating via PPA etc, so retest on latest runners.
I updated the comments to be clearer about what is different and why.
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...
Yup! We'd totally accept it. We just haven't had anyone implement it.
Any precomputed values or peripheral settings that depend on the current clock rate would need to be changed, unless we specifically said "that's your problem".
@hathach This is of interest to you. We updated TinyUSB in 9.1.0-beta.3.
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...
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...
I want to do some more testing of this and at least determine that the unexpected end of playback is affecting only streams, not mp3 files.
Possibly the commit that introduced regression #9306
@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
I think it could. It could use a bit of logic right before here that checks for the argument to be a URL and if found, downloads it to a tmp location and then overwrites name with the path to the locally downloaded copy.
I'm not certain about pip's syntax though. I think I've seen it used like this once or twice, but not familair with the exact syntax.
although modules that aren't a single file would be more tricky
Added support for my new FeatherS3 Neo board.
Added support for my new FeatherS3 Neo board for the 9.0.x series in case a new build is done before 9.1.0 is out.
Thanks for using the new file headers. We're not sure if there will be a 9.0.6, but we can merge.
Thanks for using the new file headers. We're not sure if there will be a 9.0.6, but we can merge.
Sure, no problem. I just wanted to make sure this was here in case there is a 9.0.6, or 9.1.x is delayed.
Awesome. Are you doing any work around there, or am I safe to try to add it and open a PR?
feel free if you'd like. I'm working on BLE support which shouldn't intersect with this code too much I think.
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...
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
If you have STEMMA_SCL and STEMMA_SDA, how about STEMMA_I2C? There are a number of boards with that. See one for how to specify multiple sets of I2C board objects.
One comment re possible board.STEMMA_I2C()
This has SCL/SDA as 10/11 and 8/9, but pins.c has the opposite.
What is CSN? Did you mean CS ??
no, I meant CSN but for the sake of consistency with other boards it'll be CS. the F_CSN is intentional though as it's how the pin is labeled on the FPGA.
Allow me one more question: how does the board get a listing here? https://circuitpython.org/downloads
I (wrongly?) assumed that adding it to this repository would do that...
And to add to the end of the last post, the S3 feather sometween about 11pm and 2am disconnected and reconnected 4 times and finally stopped in Safe Model with an "Internal watchdog timer expired".
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?
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.
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
Hey all, wondering if you've got recommendations for tools, config and workflow for JLink debugging on RP2040?
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
maybe i needed to also use --upgrade to skip cache
anyway, i got it with the specific 9.1 tag, no worries
Ah, that could be if it was already installed. I explicitly uninstalled before.
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
Thanks @tulip sleet 😄
On either board, do you have a settings.toml with CIRCUITPY_WIFI_SSID and CIRCUITPY_WIFI_PASSWORD? That will connect to the wifi network. In other words, wifi will be active even if not mentioned in the test program.
It certainly sounds like the boards are hard-crashing resetting spontaneously. I will try a very simple test that simply reads as fast as possible from the ADC.
@slender iron @tulip sleet I see some old docs for gdb on samd21, do you use similar procedure for all ports?
gdb works well on SAMD and nRF. It seems more problematic on Espressif due to very limited hw breakpoints. We tend to do a lot of printf debugging anyway. Sometimes we do pin toggling if things are time critical. Sometimes writing to a UART if we are debugging USB, etc.
How about rp2040?
I keep wanting to like fancy debugging tools, then falling back to pin toggling and printf's
i have not tried the rp2040 debugging tools (picotool, etc.), but it's supposed to work
#9224 (merged after this issue was reported) forces a chdir to top level when the VM is restarted. So that fixes it being "sticky", if that's the problem. But if you are using the web workflow while the program is running and has done an os.chdir(), I guess we need to fix that
I use the gdb approach for arm cores when I need to
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...
but usually start with print debugging
(github copilot is good at autocompleting print debug statements)
@lone axle or @tulip sleet can I add https://github.com/jelmer/dulwich to the circup requirements? It's what poetry uses. This way it could clone a branch
i missed the motivation for doing a clone instead of just fetching files or directories from github directly
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
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
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
and this is a special case for a branch, when you want something not in the bundle?
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.
So I see it for a few cases:
- Something not in a bundle (like a personal repo)
- Pinning a version (for cases like breaking changes)
- Grabbing a specific file
Since many users aren't developers, they won't have git
you can also get a branch as a zip from github: ```$ wget -q -O pioasm-main.zip https://github.com/adafruit/Adafruit_CircuitPython_PIOASM/zipball/main; unzip -l pioasm-main.zip | grep README
2969 2024-05-29 13:19 adafruit-Adafruit_CircuitPython_PIOASM-73170eb/README.rst
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.
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.
Yeah, but then you need to make sure it can unzip...
unzip is built into cpython, I think
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
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
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
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.
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
Allow me one more question: how does the board get a listing here? https://circuitpython.org/downloads I (wrongly?) assumed that adding it to this repository would do that...
Nope, one more step: https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website
Ok, thanks! I don't like errno either so I'm happy to avoid it.
https://github.blog/2024-06-03-arm64-on-github-actions-powering-faster-more-efficient-build-systems/
Ultimately, I'm worried that overall the reliability isn't good enough and this is going to bring more support requests than working mp3 streams.
Can you get backtraces for the hard fault over UART? Merging it in this state may allow someone else to find a more reproducible case.
[but not for free actions, if I understand correctly; these are grouped under "larger runners": https://docs.github.com/en/actions/using-github-hosted-runners/about-larger-runners/about-larger-runners]
@slender iron how can I get debug tracebacks without changing the optimization level? right now playback doesn't keep up in a debug build
I'll ping you if I don't get it sorted out .. it'd be after my lunch, it's 11:53 here