#circuitpython-dev
1 messages ยท Page 52 of 1
Resetting Serial Port...
Serial port reset
Attempting to get board attention
10
>>> import os
>>> os.chdir('/')
>>> import supervisor
>>> supervisor.runtime.autoreload=False
>>> import writefile
>>> Copying tinyc6.py to tinyc6.py
Local Dir: /Users/seon Remote (micro) Dir: /
Local file: tinyc6.py Remote (micro) file: tinyc6.py
writefile.wf('tinyc6.py')
############################################################*
Transmission Errors: 0
seon@seon-m2-max-studio ~ %
at least for a COPY ๐
once I get my testjig going with this and it works, I'll revisit refactoring all of it into a command line version rather than input based, then I'll pass it back to you ๐
Cool ๐
Well, that's not working @wraith crow ๐ฆ
>>> import os
>>> os.listdir()
['?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', 'boot_out.txt']
>>> ```
It's just one of those days ๐
Wow, looks like a directory corruption of some sort, not sure how that could be done from the python code. Did you try a binary copy?
no, just a normal and safe copy
give it an erase_filesystem and try the binary
I erase the entire flash on every test
this is what I see if I dont copy the files
>>> os.listdir()
['boot_out.txt']
>>> ```
This is happening on a rPI - didn't see this issues on my Mac.
I'll keep digging
Back when I wrote this, I was using Windows, I wonder if it has something to do with line termination or directory separator differences between Linux and PC/MAC
I'll pull out my TinyPico and give it a try on Ubuntu
ok, it only seems to happen if I issue 2 COPY or CCOPY commands in a row
# subprocess.call("python mubootstrap.py /home/pi/testjig/shipping_files/tinyc6/cpy_do_io.py code.py", shell=True)```
this works..
but if I uncomment the second line, it corrupts
both flush and clsoe ser when they are done.
I got it - needed a slight delay between the 2 CCOPY commands
Well that's good, I guess the copy should perform the delay after it's finshed.
I wonder if the wildcard copies would have the same problem
noen of this is teh fault of your code - it wasn't designed to be run liek I am running it.
๐
The C6 is probably faster than anything I was using as well
And I'm totally abusing your code, hahahaha
LOL, well I did only use it with the wonky user interface which meant it was probably impossible to run two copy commands right after each other
I do not remember what my motivation was for not permitting a negative amplitude. however note that in synthio_note_step the type of the loudness[2] parameter is uint16_t, so converting a negative number may lead to unexpected results.
I think that if the functionality you're looking for can be implemented without introducing a new "CV" class I'd rather do it that way.
On the tinypico wildcard (*.py) copies didn't have a problem so I suspect the C6 is too fast for what writefile is trying to do. The wildcard function (multicpy) doesn't appear to have any delays and it does multiple copies one after another
I'm not wildcarding them as I have to rename then as they copy. So it will be due to the way I am butchering your code ;). It's all good - working great now - just implementing the RDEL function so I can remove writefile.py once testing is done
Your code was a total life saver for me... without it, I'd not be able to etst any of my new TinyC6 boards or ship them next week! Thanks heaps @wraith crow !!!! Please DM me your address details and I'l send you a bunch of my gear!
Thank you! This looks nice and simple and adds good functionality. I have two small comments that may help result in better docstrings, please take a look.
Can you clarify this docstring too? I think I'd add "If it's zero, or greater than or equal to the length of the waveform, the loop occurs at the end of the waveform", or something along those lines.
Can you clarify this docstring? I think it "must be greater than or equal to zero and less than ..."
I used 16384 as the maximum length of a waveform (which maybe should have been 16383 since the upper bound is inclusive); this should probably match, which means it would be good if there was a #define for it in shared-module/synthio/__init__.h.
I don't have any notes that show why I used 16384 instead of a higher value like 32767. I may have been concerned about overflow in arithmetic.
As I am interested in this, I wrote a sample.
Confirmed with CircuitPython 8.2.7 and MacOS Sonoma 14.1.
https://github.com/jins-tkomoda/circuitpython-custom-hid-reportmap-sample
Let's try this and see if we got back enough space with recent changes. If so, this Closes: #8454
Thank you! This looks like a nice bit of added functionality. I have a few small comments that I hope will lead to better docstrings, please take a look.
Adafruit CircuitPython 9.0.0-alpha.5 on 2023-11-15; Adafruit QT Py ESP32-S3 no psram with ESP32S3
code.py output (the first few times) :
]0;๐192.168.0.144 | code.py | 9.0.0-alpha.5\scanning
Traceback (most recent call last):
File "code.py", line 5, in
File "adafruit_ble/init.py", line 271, in start_scan
ValueError: Prefix buffer must be on the heap
]0;๐192.168.0.144 | 271@adafruit_ble/init.py ValueError | 9.0.0-alpha.5
Code done running.
**After repeated run...
The module is now included, and works as expected.
It's currently on the repo https://github.com/bill88t/CircuitPython_AXP313A
I will continue to maintain the module and ship incremental fixes and updates.
If Adafruit wants to own the repo, that is fine by me, and I will transfer it.
>>> import storage; storage.erase_filesystem()
[13:16:35.031] Disconnected
[13:16:36.032] Warning: Could not open tty device (No such file or directory)
[13:16:36.032] Waiting for tty device.....
Hi @jepler! Thanks for chiming on this. I have no issue updating those docstrings (which were rushed initially) and creating that global #define, but after further thought, I want discuss some potential modifications first.
- These properties may be simplified and more semantic if they were a single tuple called
waveform_loopsuch as(start, end). - I do like needing to specify the index of the loop end, but it may be wiser to instead ask for the loop length. Currently,
loop_endis ...
Allowing a higher maximum size would definitely be a plus for sampling, but I vote we leave that for a separate PR. Creating the #define will help make the process of changing that value in the future easier, though.
I hav no idea what's wrong.
@brazen hatch I will see if I can figure out that failure.
It is happening during ci_set_matrix, which is the script that decides what CI actually needs to be performed, such as which boards to build. It does this based on a list of files changed. One of the files changing matches "frozen", so it iterates over all boards and checks whether the board's FROZEN_MPY_DIRS match that frozen module (if so, that board needs to be built)
It appears to be unexpected that a board would not have a FROZEN_MPY_DIRS value; boards that don't freeze anything must be intended to have an empty value, not no value.
[snippage]
KeyError: 'FROZEN_MPY_DIRS'
```the problem is possible for me to reproduce locally on main branch, so it's not a problem that you caused.
It happened as I added the new frozen module for the pmic
right, which triggers the "a modified file matches 'frozen'" code, which maybe doesn't trigger very often.
yea, it's visible
So prolly that bit isn't working very well.
I have no idea how this didn't pop up already.
Aren't the frozen modules updated?
The problem appears to have been introduced sometime since 9.0.0-alpha.0 and maybe we haven't updated frozen modules since then.
OK it is a latent bug previously hidden: https://github.com/adafruit/circuitpython/commit/e40abda1bc42e8154b0818c8a747664e775ac407
When a frozen module was added or updated, a build error would occur during CI: KeyError: 'FROZEN_MPY_DIRS'.
In e40abda1bc I decided that it should be an error if all the expected keys were not defined in the board settings dict. I made this change and all seemed to be well; however, my testing did not exercise the case that a frozen module was changed.
It turns out that FROZEN_MPY_DIRS was not being set in the board settings dict because the output of print-FROZEN_MPY_DIRS was "`...
ping @bill88t -- if your git knowledge is up to it, you could merge this into your #8623 and see if it fixes the build error you encountered.
@onyx hinge did. Now let's see if ci will pass.
https://github.com/adafruit/circuitpython/actions/runs/6914871514/job/18813168126
These new CP builds never fail to amaze.
-17kb ram used.
It's calculated with gc.mem_alloc() + gc.mem_free() at boot time.
I guess whatever idf uses ends up shrinking the other heap.
I guess I will have to probe it on-the-fly
It appears someone's discord bot when a bit click happy and clicked on every reaction emoji :/
This indeed fixes the issue. Many thanks for the quick fix!
what are you referring to? does it need moderator attention?
I don't know if it needs attention, but if you check the reaction icons for the last day or two on this channel and I also peeked at the help-with-circuitpython channel FSXPilot18 added an additional click to each. Maybe they were just really happy to be part of the community but it did seem like a flag that a bot was in operation.
I have no idea if it represents any possible issue, but bots always make me nervous
@wraith crow can you link to a specific post with the reaction emoji? I scrolled a bit but didn't immediately see one.
oh so you're seeing that a single user is adding their identical reaction to each existing reaction.
got it. I'll mention it to other mods and we will keep an eye out.
a person by that handle was more active in discussions on this server a year or two ago (or so), but perhaps it's a newer account
I'm happy leaving it to the mods now, but I guess the account could have been pinged with a question asking about it I probably don't know what I don't know ๐
Thanks to Jepler's fix, CI is passing now.
The port is complete.
Are we going to transfer the pmic repo or is it fine as is?
I'm also having issues with I2SOut causing my esp32-s3 to crash and enter safe mode. I can reproduce it with the code from the MAX98357 learn guide for the sine wave output. There error I get is that the watchdog timer expired.
# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import time
import array
import math
import audiocore
import board
import audiobusio
sample_rate = 8000
tone_volume = .1 # Increase or decreas...
hi
meme's microphones are very good for voice recognition and word detection projects
is there any way to get some value from an memes microphone, like INMP441?
I am not sure #8615 resolved the problem. A similar error occured in https://github.com/adafruit/circuitpython/actions/runs/6906615046/job/18792200464?pr=8628 which included the change from this PR:
devkit_xg24_brd2601b: Building languages: en_US, de_DE, en_GB, en_x_pirate, es, fil, fr, ID, it_IT, ja, nl, pl, pt_BR, ru, sv, tr, zh_Latn_pinyin
Error: Build devkit_xg24_brd2601b for en_US took 19.95s and failed
make: Entering directory '/home/runner/work/circuitpython/circuitpython/ports...
has anyone seen NeoPixels freak out on ESP32-S3?```
Traceback (most recent call last):
File "code.py", line 1238, in <module>
File "neopixel.py", line 180, in _transmit
RuntimeError: Input/output error
Traceback (most recent call last):
File "code.py", line 1238, in <module>
File "neopixel.py", line 180, in _transmit
RuntimeError: All timers in use
Uhh no? Does it work with neopixel_write?
I don't know, this only happens occasionally, on certain boards (same code, but could be subtle differences in operation due to different run parameters). This used to happen on some ESP32-S2 boards, and I wrote a function to deinit and reinit the NeoPixel, and that let me limp along. But just curious if this gets seen in the wild by others.
Nope. Never seen it. Even the cursed ESP32-Cx are fine with it.
And I have done days of uptime.
I think this may have been specific to SAMD and obviously not the same situation but I saw the same error on this issue: https://github.com/adafruit/circuitpython/issues/7747 , perhaps it provides a clue?
do you use pwm or anything else that uses a timer?
you can have only so many things that use timers at once
no pwm, or any other peripherals really, other than led and wifi. I think the timer exception arises only if I ignore the I/O exception a few times ...plus rtc and watchdog
but other boards running the same code don't get this exception.
it seems like the S3 has a lot of timer issues
The USB PID for arduino_nano_esp32s3 was 0x0070. This is the PID Arduino uses for DFU. This caused the serial port not to show up on Windows if the Arduino ESP32 BSP was installed into Arduino and the corresponding Windows drivers to be installed. They took precedence over treating this as a normal serial port.
MicroPython uses 0x056B. We have use that correct PID for arduino_nano_esp32s3_inverted_status_led. Workaround is to use that build for now. The original PR flipped back and for...
sounds likely, I guess I'll put the de-init/re-init function back in, but it just seemed like it should recover better than that
CircuitPython version
9.0.0.0-alpha5
Code/REPL
# SPDX-FileCopyrightText: 2021 Jose David M.
# SPDX-FileCopyrightText: 2023 Melissa LeBlanc-Williams for Adafruit Industries
#
# SPDX-License-Identifier: MIT
# NOTE: Make sure you've set up your settings.toml file before running this example
# https://learn.adafruit.com/getting-started-with-web-workflow-using-the-code-editor/
"""
This example shows a web address QR on the display
"""
import time
i...
I rebooted with the error back in place, here's the attached code file with all needed assets + libraries (in py format) in case it's some formatting issue with the example and copyright I only half modified
line61isNot60.zip
I don't have a strong feeling about a pair of properties vs a single property that is a tuple. Here are some things to consider:
- with a tuple, you can guarantee the assignment is atomic (both start and end updated at the same time)
- you can check that
0 <= start < endand reject some nonsense - (but you can't check
end < len(waveform)since waveform can be updated dynamically with a waveform of a different length
Creating a fresh tuple requires allocations, but so do many thin...
makes sense, thanks for the sleuthing
I think that's normal.
=== # test 1
===
=== foo = "test1"
===
=== print("Checking TileGrid", foo
=== ) # close the parens on the next line is OK
=== print("some more stuff")
===
===
Checking TileGrid test1
some more stuff
=== # test 2
===
=== foo = "test1"
===
=== print("Checking TileGrid", foo
=== print("some more stuff") # line 6
===
Traceback (most recent call last):
File "<stdin>", line 6
SyntaxError: invalid syntax
I'm trying my luck upstream first - https://github.com/micropython/micropython/pull/13000 - I'll close this PR out for the time being. Hopefully can just port this back here!
The new memory management is finally truly stable I think.
I get ya, I suppose I've been spoilt by other languages that show the offending lines contents and first character/token that breaches syntax. I wonder if the exception shouldn't be the line that never finishes correctly, so on a multi-line if / print, the print is never complete so the start is the beginning of the error. Maybe a more informative syntax error could be given containing the offending statements with line numbers.
maybe this migrates to a feature request / close as wont fix
The CPython parser is better about this:
print (3
if 0:
pass
CPython:
File "/home/halbert/foo.py", line 1
print (3
^
SyntaxError: '(' was never closed
CircuitPython/MicroPython:
File "/home/halbert/foo.py", line 2
SyntaxError: invalid syntax
But the MicroPython parser just works differently, so I wouldn't characterize this as "wrong".
Closing as inherent, but it's an interesting observation.
We usually don't merge from MicroPython upstream until they release a major version, so if it looks like this is approximately the way it's going to go, fine to leave this open. Once you update the asyncio submodule here, I think the tests will run?
oh, yeah, we should think about this.
We have previously allowed frozen modules that are in personal accounts and organization:
url = https://github.com/pewpew-game/pew-pewpew-standalone-10.x.git
url = https://github.com/python-ugame/circuitpython-stage.git
url = https://github.com/pypewpew/pew-pewpew-lcd.git
url = https://github.com/dahanzimin/circuitpython_lib.git
url = https://github.com/elecfreaks/circuitpython_ef_music.git
url = https://github.com/elecfreaks/circuitpy...
Yes, a numbered release of the library is required.
Updated to use the cookiecutter style and created tags. I do not have any readthedocs experience, and I would like to skip it for now.
Once I get to know it a bit more, I will update the library accordingly.
It's kinda my first time ever submitting a module at any capacity.
I up until this point, made modules for myself, and packaged them the ljinux way (CircuitMPY).
I honestly didn't even know cookiecutter exists up until now.
I've been kinda living under a rock when it comes to proper module distribution.
I will try to get to know the CP way, but currently I lack the experience of the dependencies.
I do not have any pylint or readthedocs experience I do not know how to set them up.
added new board called Raspberry Breadstick from Breadstick Innovations
this board config is for rev0.2
I see this issue has been closed.
I am testing an SSD1608 and see that the text_area.y is ignored. i.e. on first refresh the test is in the correct location. On the subsequent refresh the x position is correct the y position it at the top of the display.
The workaround is to use the same trick suggested by @anecdata ...
CODE:
displayio.release_displays()
spi = busio.SPI(SCK_PIN, MOSI_PIN)
display_bus = displayio.FourWire(spi, command=DC_PIN, chip_select=CS_PIN, reset=RESET_PI...
CircuitPython version
CircuitPython 8.2.8 running on Solderparty RP2040 Stamp
Code/REPL
displayio.release_displays()
spi = busio.SPI(SCK_PIN, MOSI_PIN)
display_bus = displayio.FourWire(spi, command=DC_PIN, chip_select=CS_PIN, reset=RESET_PIN, baudrate=1000000)
time.sleep(1)
display = adafruit_ssd1608.SSD1608(display_bus, width=200, height=200, busy_pin=BUSY_PIN)
display_group = displayio.Group()
background_bitmap = displayio.Bitmap(INK_WIDTH, INK_HE...
CircuitPython version
Adafruit CircuitPython 8.2.8 on 2023-11-16; Bee-Data-Logger with ESP32S3
Board ID:smartbeedesigns_bee_data_logger
Code/REPL
import time, alarm, board, adafruit_ds3231
i2c = board.I2C()
rtc = adafruit_ds3231.DS3231(i2c)
if alarm.wake_alarm == None:
rtc.datetime = time.struct_time((2024, 1 , 1, 12, 30, 0 ,0,-1,-1))
alarm_epoch = time.mktime(time.struct_time((2024, 1 , 1, 12, 30, 5 , 0,-1,-1)))
alarm.exit_and_deep_s...
@mzhboy There's a solder jumper on the Studio YD boards that needs to be connected in order to supply the ADC_VREF to the RP2040. Without it, the RP2040's ADC can't function so you will not get a valid temperature reading.
@jepler should %S be in all languages, or should synthetic take care of that?
"%S" and other messages listed in locale/synthetic.pot should never be offered by weblate for translation, because they do not appear in locale/circuitpython.pot.
I am trying to figure out what's up with that
I was just about to ask ๐
In #8639 Dan noticed that weblate was still offering "%S" as a string to translate. I don't understand why this occurs, because the string is no longer in circuitpython.pot; so weblate should move it to the "fuzzy" section of the .po files when it synchronizes them.
I also noticed that the "%02X" string should never be localized and moved it to synthetic.pot.
After making that change, I ran "make translate" followed by "make msgmerge"; normally we rely on weblate running this step, but ...
Something unrelated is breaking some jobs in CI. I'll re-run these when it's done.
Run sudo apt-get update
Get:1 file:/etc/apt/apt-mirrors.txt Mirrorlist [142 B]
Get:6 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease [3531 B]
Hit:2 http://azure.archive.ubuntu.com/ubuntu jammy InRelease
[...]
Reading package lists...
E: Repository 'https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease' changed its 'Origin' value from 'microsoft-ubuntu-jammy-prod jammy' to...
Repository metadata like that is supposed to stay consistent; erroring when it changes is apt's way of helping keep you from updating to something you didn't expect (like when the "stable" release of debian is updated, which is a time you need to take care updating your packages). I hope this is just a mistake they made in deploying some of their apt package servers that will be fixed. Otherwise, a LOT of workflows will be broken.
the re-run worked; looks like a glitch
if so yay
maybe human-caused and quickly fixed
pulp 3, mentioned in the erorr message is for "software repository management" https://pulpproject.org/about-pulp-3/
Pythonโs PyPI replaces RPMs as the main packaging method, which allows for easy installation across Linux distributions.
What in the world.
Describe the issue i may have missed an announcement? $ sud oapt-get upatte E: Repository 'http://packages.microsoft.com/repos/code stable InRelease' changed its 'Origin' value from...
looks like they've fixed it but maybe it's slow in rolling out. On the re-run of those actions, there's at least one that got the "pulp 3" error.
- I've decided to keep the current implementation mostly because I'm not a big fan of the current method of handling note envelopes.
- I was not aware of the use of memoryview in this way. I see that as a great option for basic waveshaping, but it does conflict with the needs of sampling.
- I've added in the define as
SYNTHIO_WAVEFORM_SIZEand also made the slight adjustment of requiring that the loop_end parameter be at least 1. This makes sense from a semantic point of view, but make se...
ping @todbot @jedgarpark in case you have feedback
I pushed some small tweaks to the documentation.
@onyx hinge I merged the %S etc. fix so you can proceed with the weblate stuff
thank you
weblate is now unlocked and open for translations. I hope this vanquishes the "%S" from the po files for good now.
@onyx hinge looks like those proposed changes are sneaking back in, see latest in https://github.com/adafruit/circuitpython/pull/8639
maybe need to undo the latest user changes
I did that
After I merged, it did a force push with the latest user changes, hmm
https://hosted.weblate.org/projects/circuitpython/main/#repository the admin interface on weblate shows 0 pending changes + 0 outgoing commits
because I used "reset all changes in the weblate repository"
I don't know why I am seeing these, then: https://github.com/adafruit/circuitpython/pull/8639/files. Maybe we just close the PR?
This is a wonderful addition, thanks Cooper! I'll be loading this onto some boards shortly.
@bill88t Did you see this guide, which has ReadTheDocs info? https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library
One minor thing.
The frozen library is OK with me, but minimizing PR's to update the library would be good. I don't want to have to churn all of CircuitPython for that. If you are going to write this up, describe how to override the frozen library by putting the newer version in the top level of CIRCUITPY.
>>> sys.path
['', '/', '.frozen', '/lib']
@tulip sleet Would you please clarify what you want me to do? Add a note to readme & code comments?
no, if you write this up somewhere as a Learn Guide or a Playground note or a blog post or something, just mention that the frozen version of the library can be overriden by putting the newer version in / on CIRCUITPY
but doesn't have to be in the PR
<@&356864093652516868> Happy thanksgiving week to y'all. We'll be holding our weekly meeting in about 1 hour from now. Please take the time to add any notes you have to the notes doc: https://docs.google.com/document/d/1wQlnIywB9v88w8W-PSWXyB9DKKyS06AnKd6TS4s87pk/edit?usp=sharing and if you would like the host (me) to read them out during the meeting just write a parenthetical note to that effect
CircuitPython Weekly Meeting for November 20, 2023 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you canโt make the meeting and would still like to pa...
Since it's thanksgiving week, I'd like to invite folks who want to do either or both of the following:
- in hug reports, tell us something you are grateful for
- in status updates, tell us about a thanksgiving or other holiday tradition that is particularly meaningful to you
This doesn't have to be related to circuitpython in any way, except that it's something you'd like to share with your fellows in this community.
For the "state of" section, I can grab the "blinka" section, as Melissa is out this week. @tulip sleet @lone axle are you able to do the core & libaries sections as you often do?
sure
Yep, I am good for the library section.
@onyx hinge a little overdriving (scratchy-sounding) on your mic audio
tiny bit
that is better now
Erin's SMS guide, linked from newsletter, is 404
@turbid radish ^^
Great job on the documentation, @jepler! I didn't want to get my hands too dirty on that one, but I think you nailed it. I'll try to put together a standalone gist soon to better demonstrate the use of synthio for sampling. Plus, I think the recent addition of synthio.Synthesizer.note_info could help make this even better.
Thank you. Have a wonderful Thanksgiving holiday!
Thanks for hosting Jeff. Hope everyone has a Happy Thanksgiving and great week!
thanks for hosting Jeff!
hello!
my $dayjob is security and operations at a CI/CD company, my passion is in release engineering, python and microcontrollers.
Is there anything that I can do in the circuitpython dev space that you all need that aligns with any of the above? I know that I will need to absorb the current culture, but I'm willing to do the legwork to get to be able to help. Is there a list of infra related bugs or glitches that people just don't have time for that I can chew on?
Thanks for your offer. You can review the existing open issues. There is a tooling label, for example: https://github.com/adafruit/circuitpython/labels/tooling. There are also other repos that are used for CircuitPython: all the Adafruit_CircuitPython_* libraries, and various infrastruture repos: https://github.com/adafruit/circuitpython-org/issues, https://github.com/adafruit/adabot/issues (for instance https://github.com/adafruit/adabot/issues/263 is right now a problem
https://github.com/adafruit/circuitpython-build-tools/issues
oh nice! I shall go start reading them and seeing if I can get the build environment setup
do you all need any resources that I may be able to wrangle for the community?
do you mean CPU cycles? We are fine on that
we use GitHub Actions, and since we are open-source, we get free runs
yea, CPU is the easiest one for me to go get the sales folk to flip the "this project is free" bit
ahh
I work for CircleCI
first things first, let me get those links opened up and start reading
Please rename the folder to include the manufacturer first. Maybe jr_creative_raspberry_breadstick? I want to make sure it is clear that it isn't from Raspberry Pi.
This may be split heap related.
I have an easy fix for this, but I'm debugging other things at the same time.
Here's my quick sampler demonstration using the loop parameters of this build: code.py & video demonstration.
I don't think so. It looks like SharpDisplay knows to bail if the SPI lock fails:
displayio_display_core_start_refresh no longer manages SPI buses so that doesn't matter for FrameBufferDisplay anymore.
This is not fixed. I tested it at f3920c49dc7c717beb630ada61e61d75de2cf60d.
It looks like the native_group() call is being a passed a super object and mp_obj_cast_to_native_base() doesn't know how to convert that to the native base. I'm not sure if that's what it should do or if it shouldn't be passed the super object in the first place.
A non-displayio example would be really helpful because then we could add a test for it and debug via the unix port.
I wrote a gist that shows what may be as many as 3 distinct problems with subclassing, properties, & super(). The test uses NativeBaseClass, a class that @tannewt recently added to the unix coverage build for exactly this sort of testing (thanks!). This test runs on only on the "unix coverage build", not on microcontrollers.
class N(NativeBaseClass):
@property
def subtest(self):
return super().test
@subtest.setter
def subtest(self, value):
...
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/1QDaoWlm2Ar_MKxavn5JsRf88OjvyVv1W40qtqwVWhQk/edit?usp=sharing
I setup readthedocs https://circuitpython-axp313a.readthedocs.io/
and added notices for overriding the frozen module in both the docs and the readme.
I hope I did it alright. It certainly looks fine but idk, it's 5am.
Remove this commented-out code.
Also I noted something in the README in the library: https://github.com/bill88t/CircuitPython_AXP313A/issues/1#issuecomment-1820153112. Assuming you fix that, you may want to re-release and advance the version in this PR.
But go to sleep :)
Ah, of course there will be a thread on that parameter to pull that will stretch into other areas of synthio -- I appreciate your reminder to look deeper. My limited knowledge of C++ might slow me down a bit, but I'll see what I can find. Hopefully it's just used as a multiplier to control gain.
Regarding negative amplitude values, allowing the amplitude to control a signal's phase is very "op-amp" like and would likely resolve the current CV issue without resorting to a new class.
It seems like the USB Host support for the Raspberry Pi Pico W has now landed in CircuitPython. However, when I run the following:
import board
import usb_host
print("before...")
usb_host.Port(board.GP16, board.GP17)
print("after...")
I see this error message...
RuntimeError: All state machines in use
Is the USB Host support "not quite there yet" or should this be working?
Not used it myself, but im pretty sure i've seen people running it (or at least getting further than that)
That error message looks PIO-related, which makes no sense to me if you dont have any other code ๐
Are you using some stable (8.x) build or an experimental one(9.x)?
9.x
That message only occurs 3 times in the code... one is spurious (framebuffer code), the other is when there really is no room for another state machine (possible), and the last one is from the usb_host code (which I am actually using here, so it's the most likely cause)
Maybe it's too much to drive the RPI Pico W with WiFi and USB Host (via PIO) at the same time?
Alright, fixed. Thanks for the heads up about the frozen module prioritization!
Could you try a simple example in 9.0.0-alpha.2 vs 9.0.0-alpha.5? This might be a storage management issue. Thanks.
It looks like usb_host is trying to claim 2 PIO's, but 1 is already in use by the CWY43 chip's interface.
so maybe this is just not going to work
But isnt that an opt-in when actually using the wireless capabilities?
Maybe they are tho
@spare jacinth You'd think so, so perhaps it's being overly zealous about claiming the CYW43's PIO.
I'll take a quick dive into the code and get back.
I don't see any use of pio in common-hal/wifi; I'm confused
It's in the SDK.
oooh
sdk/rp2_common/pico_cyw43_driver/cyw43_bus_pio_spi.[c,pio]
doh. we aren't running the "circuitpy" tests at CI time. ```diff
diff --git a/tests/run-tests.py b/tests/run-tests.py
index 4d738e8e37..927121fda0 100755
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -977,6 +977,7 @@ the last matching regex is used:
if args.test_dirs is None:
test_dirs = (
"basics",
-
"circuitpython", # CIRCUITPY-CHANGE "micropython", "misc", "extmod",
The CYW43 PIO is claimed in cyw43_spi_init that gets invoked early out of port_init.
So, the claim is independent of whether or not wifi is inited.
I count on it being there for _bleio, too.
Bottom line is that on a Pico W usb_host will never work with wifi or _bleio. It would be some fairly invasive surgery to get usb_host to work without wifi or _bleio.
Flashing a Pico W with a Pico .uf2 would allow usb_host to function, but the functions re-routed through the CYW43's GPIO pins will not work. That's the LED and VSYS sensing.
The RT6154A PS control would be lost, too.
I wonder why PIO is used for SPI instead of regular SPI. But maybe the right pins are not connected to the module and it is impossible.
From my notes:| Wire | RP2040 | CYW43439 | RT6154A | Notes |
|-|--------|----------|-------|--|
| WL_GPIO0 | | GPIO0 | | replaces GPIO25<br>Green LED D2 |
| WL_GPIO1 | | GPIO1 | PS/SYNC | replaces GPIO23<br>100K pull low |
| WL_GPIO2 | | GPIO2 | | replaces GPIO24<br>VBUS / 2 |
| WL_ON | GPIO23 | WL_REG_ON<br> BT_REG_ON | | |
| WL_D | GPIO24 | SDIO_CMD<br>470R SDIO_DATA0<br>10K SDIO_DATA1<br>SDIO_DATA2 | | gSPI DI<br>gSPI DO<br>gSPI IRQ<br>gSPI NC|
| WL_CS | GPIO25 | SDIO_DATA3 | | gSPI CS|
| WL_CLK | GPIO29_ADC3 | SDIO_CLK | | gSPI SCLK<br>10K pull low |
to leave both SPI peripherals free for user-code, i guess... tho it's probably more useful to have a PIO than a second SPI bus (and can maybe even fit SPI on that PIO)
(Sorry about the formatting, I guess discord doesn't do tables)
I could hope it was a library compile-time option, but I haven't looked
i would like to think they did not use "bad" pins on the design, forcing to use PIO ๐คฃ
Maybe we should just turn off usb host on the Pico W build
The Pico W designers stole GPIO23, 24, 25, and 29 for the CYW43 SPI interface.
Good idea. I don't see any clear path to making it work.
so your chart above: looks like the pins are OK?
Not sure what you mean?
that the PIO SPI pins used for CYW43 are assignable to the same functions on a hw SPI peripheral? I am not sure about some of the abbreviations
OK, I see where you're going. The CYW43 uses a SPI variant they call gSPI, so my best guess is that a stock SPI port won't work with the CYW43, thus the gSPI emulation via PIO.
it looks like you can choose SPI vs SDIO to talk to the CYW43? There are some uncommented compile switches
The board itself isn't made to handle that, though. The resister network on the SDIO pins allows muxing data in/out on a single pin in gSPI mode, so you'd need to spin a new board to use SDIO.
This closes #8564 (ping @cedargrovestudios)
While working on this issue, I noticed that the "circuitpython" tests were not being run by "make test" and therefore not during CI. (this probably happened during one of the recent micropython merges; I marked the changes as CIRCUITPY-CHANGE) There were several problems with the tests themselves. I fixed them, updated some expected outputs, and restored running the tests when expected.
The final unrelated change to tools/git-checkout-latest-t...
there are two cpoies of the cyw43 driver; we have one in ports/raspberrypi/lib and there is one in the sdk
Right. We're actually using the one in ports/raspberrypi/lib. I don't know why.
It does let us choose a version independent of the SDK.
at one point we had to carry changes vs what was in the sdk. and fwiw micropython carries a copy of cyw43 driver in (top level) lib/ but maybe for other reasons.
If we're using the sdk one then we should remove the other one.
I prefer to leave it as it is, i.e., we choose the version not the SDK.
oh I mis-read what you said.
as long as they are not linked in API requirements. I think originally the driver may not have been in the SDK. There was a long delay while the vendor fixed some firmware things.
If the george-robotics version is no longer being used by MicroPython, I think maybe we should switch to the SDk version.
because it will be up to date wrt bug fixes, etc.
the george-robotics one was something that MPy used in advance
The george-robotics is the upstream version for the SDK.
hah, ok!
I'm picking up useful bug fixes not in the version imported by the SDK.
that clinches it
Re: george-robotics, I've got a couple of minor issues queued up on the driver. Is there someone there I should mark them with to get their attention?
george is Damien George of MPy, so he will get all the GitHub notifications anywy
Thanks! I've got local patches so I'm not blocked.
Please do take note of the added markdown. I can't test locally.
Mentioning AXP313A is pretty important as users will be unable to use the camera without it.
Also, even though the board has a display interface, I did not add the tag Display, since it doesn't ship with one.
Meanwhile, for the camera I did add the tag since it ships with a OV2640.
CircuitPython version
8.2.7
Code/REPL
RCVRID = 0x001 #CHANGE THIS LINE
# RP2040 CAN Bus Feather
from time import sleep
import time
import board
import neopixel
from rainbowio import colorwheel
from digitalio import DigitalInOut, Pull
from adafruit_mcp2515.canio import Message, RemoteTransmissionRequest
from adafruit_mcp2515 import MCP2515 as CAN
import adafruit_mcp2515.canio as canio
COLORS = {
0x0: (0,0,0,0),
0x1: (255,0,0,0),
0x...
You may want to test 9.0-alpha builds, since the memory management system changed a good bit.
@tulip sleet want me to review 8642 (jeff's synthio + test PR)?
oh sure, I forgot that; I am deep in debugging printouts in ESP32-S3 BLE
kk, I'm not stuck into anything
This updates the commented lines in mpconfigboard.mk with new CREATOR/CREATION IDs after getting feedback from Scott regarding my initial guesses.
Added my new TinyC6 to the boards and updated a bunch of board images to their latest versions.
Fixes #8631.
Seems to fix ESP32-S3 BLE acting as a simple central. See https://forums.adafruit.com/viewtopic.php?t=206024 for user problems. I will point the users in that thread to the artifacts once this has built.
Tested on a BerryMed Pulse Oximeter with the library's simpletest.
Notes:
- #8631 fix fixes a problem exposed by the new split heap use.
BLE_ERR_SUCCESSis 0, but was being used in places where the return values are actuallyBLE_HS_*. Nimble has multiple sets of ...
Nothing obviously wrong, and user tests show it improves status quo. Thanks!
A small number of hallowing m0 express boards were manufactured with an incorrect flash chip (2MB instead of 8MB).
If you have received one of these boards, contact support AT adafruit DOT com for refund/replacement options. They can be identified by the marking "25Q16JVSIQ" on the 8-leg Winbond flash chip near the switch -- the bottom chip highlighted in the image below.
However, ...
Would you advise the use of 9.0-alpha on a production setting with code like this? It is not going to change in functionality.
Testing the alpha build might give us some clues about what the problem is. I don't think we would necessarily advise it for use in production. but if it works better than 8.2.x that is a selling point. "Stable" is in the eye of the beholder. Alpha builds are generally not deliberately unstable.
This updates the way that Task is handled in the C module for asyncio which implements tasks & task queues. The goal is to bring asyncio in CircuitPython slightly closer to CPython.
This adds the following methods to Task:
get_coro()- how CPython exposes the coroutine backing the task (CPython Docs)result()- a helper method from CPython for returning the successful response ([CPython Docs](http...
This is a follow up from https://github.com/adafruit/circuitpython/pull/8576 & is the same code as in https://github.com/micropython/micropython/pull/13000
This is different from #8576 in that it doesn't define the exceptions as part of the C code and instead pulls them in from the asyncio context that's passed to the Task. While I personally think that approach is an anti-pattern (I think most of that could be avoided by defining the exceptions in C & fixing how the loop is defined) it...
Fixes #8321.
Adds more information to uploaded build filenames, e.g.:
was
adafruit-circuitpython-adafruit_feather_esp32s2-en_US-20231122-b2c32cf.uf2
will be
adafruit-circuitpython-adafruit_feather_esp32s2-en_US-20231122-main-PR8645-b2c32cf.uf2
Ouch. Build failed for one of the smallest devices that there's not enough flash. This increases things by a few hundred bytes so that might indeed be the case?
If that's the only failure I'll be opening this PR
Hi,
Can you please help to add this new board : Cytron Maker UNO RP2040 ?
Thanks
This board should have CIRCUITPY_ULAB turned off. That will make plenty of room. Not sure why longints are turned off on both these boards. The maker chose the original settings. Given what it's for, I think ulab off is fine.
drops ulab from the thunderpack v12 to drastically reduce the byte usage of flash
This is to fix the failure in #8647
Add this change to #8647 instead, so we don't have to do two full builds.
Add this change to #8647 instead, so we don't have to do two full builds.
Sure - wasn't sure the approach that should be done for this & how it would affect rollbacks.
Sure - wasn't sure the approach that should be done for this & how it would affect rollbacks.
This is minor enough that it's fine. We have often had to slim down multiple builds in the past when new features are added.
Done - closing in favor of including this fully within #8647
Added the commit from #8650 to this PR instead.
Now working, for example:
adafruit-circuitpython-adafruit_feather_esp32s2-en_US-20231122-main-PR8648-140f910.uf2 in artifacts
Hopefully will continue to work on upload to S3 when merged.
CircuitPython version
Adafruit CircuitPython 9.0.0-alpha.2-13-gdc5845fa41 on 2023-11-04; Adafruit Camera with ESP32S3
Code/REPL
# I do not have a minimized standalone program that reproduces the problem
Behavior
You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Hard fault: memory access or instruction error.
Please file an issue with your program at github.com/adafruit/circuitpython/issues.
Press reset to exit s...
I deserve to be whacked on the nose with a rolled up newspaper for how low-effort that bug report was. ๐ but my mandate was to not "just ignore it" if I saw crashes while working on this rather complex project so there you go.
Hi - one typo, and pre-commit says there are blank lines with trailing spaces in pins.c. See https://learn.adafruit.com/building-circuitpython/build-circuitpython#install-pre-commit-3096511 for more information about using pre-commit locally to catch these kinds of things.
You can also set some editors to automatically remove trailing spaces and trailing blank lines.
Typo
{ MP_ROM_QSTR(MP_QSTR_LED21), MP_ROM_PTR(&pin_GPIO21) },
import time
import board
import displayio
import fourwire
import adafruit_ssd1680
I'm trying to run the Pi Pico with U2IF but I can't find the 'fourwire' module. Is it supported?
renamed folder to breadstick_raspberry.
note our company name is Breadstick Innovations but the product name is Raspberry Breadstick. ๐
I guess fourwire is a 9ism. I'm going to use 8.2.8 for now.
CircuitPython version
Adafruit CircuitPython 8.2.8 on 2023-11-16; Bee-Data-Logger with ESP32S3
AND
Adafruit CircuitPython 8.2.0-rc.0 on 2023-06-23; Bee-Data-Logger with ESP32S3
Board ID:smartbeedesigns_bee_data_logger
Code/REPL
import frequencyio, board, time
frequency = frequencyio.FrequencyIn(board.D41)
while True:
print(frequency.value)
frequency.clear()
time.sleep(1)
Behavior
Signal is generated with an external sign...
@dhalbert
The Windows version is 10 22H2, I'm using Visual Studio Code with joedevivo's CircuitPython extension
The data coming in is coming in every second, and is something like this:
byte buf[] = {0, 0, 0x0A};
I think the problem is related to the data = uart.readline() line. When I run the code on a MatrixPortal M4 without a UART source attached, eventually the code will crash on that line (but not hard fault).
So ma...
There is a micropython lib to this driver but not in circuit python.
Drive large matrix
regards
Oh yes please! I finf a 4x8 matrix from sure electronic and looking for a way to use it with circuitpython rp2040 board.
@dhalbert I've updated to 9.0.0-alpha.5 and... so far so good! I haven't been able to make it hard fault yet and it's been running for 3 hours without crashing.
[converting to draft while discussion on the MP PR may produce improvements]
@dhalbert After running through the night without problems, I think this is solved by the update to version 9.
I have seem multiple reports of hard-fault with httpserver, although none with clear indication of what might be causing them.
If I may suggest one thing, please try setting the poll_interval on serve_forever() or add time.sleep() between calling .poll().
https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer/blob/1c5c41a2c4cf76bf1305b5b77cf3911b8dd977ad/adafruit_httpserver/server.py#L175
Even better would be making it a async function with asyncio.sleep() and running ...
This worked for the PR builds, but the merge build has an incorrect name, e.g.
adafruit-circuitpython-8086_commander-de_DE-20231124-no-branch-3aac226.uf2. So needs more work.
The following git command will show the current branch name (or show "HEAD" if you currently have a 'detatched head'): git rev-parse --abbrev-ref HEAD
The nRF implementation of BLE will clear bonding information stored in flash whenever bleio_reset() is invoked. Since it is invoked during CP restart, bonding information will not persist across a CP restart. I'm wondering if this is the desired behavior?
It is supposed to happen only on Adapter.erase_bonding, and that is how it used to work. Not sure if/when that changed, but itโs not deliberate. It definitely didnโt previously erase that
Happy day after t-day, Dan! Yeah, it didn't look right to me. I won't duplicate that behavior in rp2. What do you think about adding a method to _bleio.adapter that explicitly resets bonding info?
That is i: Adapter.erase_bonding(). Already exists. I will look at the history to see what changed.
On my phone right now ๐
Take your time. I'm heading out for a walk.
The following git command will show the current branch name (or show "HEAD" if you currently have a 'detatched head'):
git rev-parse --abbrev-ref HEAD
I was doing something similar, but GITHUB_BASE_REF was the same thing. I expected that value to be available on the merge build, but apparently not. In addition, the PULL value appears to not be present, and I thought it was the same build step. I'll need to re-check those.
Aapter.erase_bonding() calls bonding_erase_storage(), which unconditionally erases the bonding flash area, and then marks the boundaries with a magic number.
bleio_reset() calls bonding_reset(), which calls bonding_erase_storage() only if either magic number is no longer there (indicating flash corruption or a flash erase). So it's not always erasing the bonding info
That's a relief. My sincere apologies, I should have given it a closer reading.
np - I thought you encountered this in use
Trying to convince ChatGPT to run the unix build of CircuitPython.
It appears that running the micropython executable is not successful due to a mismatch in the GLIBC version. The current environment does not have the required GLIBC versions (2.33 and 2.34) that micropython depends on.
Running CircuitPython 9.0 preview on ChatGPT Code Interpreter:
https://chat.openai.com/share/d9201dc2-db02-4845-a168-5f1bb247cd36
CircuitPython version
Adafruit CircuitPython 9.0.0-alpha.5 on 2023-11-15; Raspberry Pi Pico W with rp2040
8.2.8; Raspberry Pi Pico W
8.2.2; Raspberry Pi Pico W
8.2.2; Arduino Nano RP2040 Connect
Code/REPL
None
Behavior
Hi, 3 people in my group are unable to copy files to the root of CIRCUITPY on MacOS Sonoma. Sorry for the second-hand report - if I start things off here, hopefully others can comment if needed.
On first sight, everyone think...
We think this is the same underlying issue as #8449. It manifests in more than one way
I hadn't seen any mentions of the writes outright failing from the perspective of MacOS (except when neglecting to eject properly).
Also I'm not quite clear in the other issue about 8MB vs 16MB. The Nano Connect's CIRCUITPY is a little under 16, does that count as "small" or not?
Also I'm not quite clear in the other issue about 8MB vs 16MB. The Nano Connect's CIRCUITPY is a little under 16, does that count as "small" or not?
The mounted filesystem size affects whether or not Sonoma delays writes to the USB MSC. We've found that filesystems in excess of 8M do not exhibit delayed writes. A board with a 16MB flash will not experience delayed writes. But, because its resulting filesystem will be smaller than 8MB, one with an 8MB flash will.
We've found that filesystems in excess of 8MB do not exhibit delayed writes
The Arduino Nano RP2040 Connect has a filesystem bigger than 8MB, so that means it experiences this issue but not what's described in 8449.
Below is a writeup I did onrequest to send to someone external, on November 13. It describes both problems.
When attempting to characterize the problem, I instrumented the writes that were being requested via USB. I could not actually find a clear pattern of delayed writes on <8MB vs no delayed writes on larger filesystems. I saw delayed writes on both, but it was not clear how the writes were being delayed in metadata vs data, and when what should have been an atomic transaction was compl...
Below is a writeup I did on request to send to someone external, on November 13. It describes both problems.
When attempting to characterize the problem, I instrumented the writes that were being requested via USB. I could not actually find a clear pattern of delayed writes on <8MB vs no delayed writes on larger filesystems. I saw delayed writes on both, but it was not clear how the writes were being delayed in metadata vs data, and when what should have been an atomic transaction was comp...
The Arduino Nano RP2040 Connect has a filesystem bigger than 8MB, so that means it experiences this issue but not what's described in 8449.
That's not good news. If you don't mind, please note this in #8449 so that we can track it all in one place. In the end, #8449 comes down to unpredictable delays between writes regardless of the symptoms described in the various entries.
I hadn't seen any mentions of the writes outright failing from the perspective of MacOS (except when neglecting to eject properly).
See https://github.com/adafruit/circuitpython/issues/8449#issuecomment-1804861258 (and what I just posted).
@dhalbert That failures are being seen on a ~15MB filesystem is concerning.
Did we test filesystems >8MB but <16MB? Are those FAT16? I don't have the boards at hand to check at the moment.
I tested on an RP2040 Metro with 16MB. The filesystem was FAT16 and CP had my FAT12/16 partition ID patch. The resulting filesystem was ~15MB.
Earlier today I wrote up what appears to be the best workaround right now:
https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#macos-sonoma-14-dot-x-disk-errors-writing-to-circuitpy-3160304
I'll refine this when I have time next week.
Earlier today I wrote up what appears to be the best workaround right now:
https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#macos-sonoma-14-dot-x-disk-errors-writing-to-circuitpy-3160304
I'll refine this when I have time next week.
That's my favorite workaround, too. I can do some testing on the Metro tomorrow if you like. Let me know what you'd like me to try.
This script lacks a sleep at the end of the loop. Would that improve anything? All examples include a call to sleep, and I assume this is a best practice scenario.
Senders may typically have a delay between messages, but if the device is primarily listening for messages, there should be no delay and you want to minimize the other processing in the main loop. There's not much buffering in the CAN hardware (2 receive buffers and 3 send buffers), so loops need to complete in a timely manner relative to the frequency of incoming messages.
CircuitPython version
8.2.8, 9.0.0a5 and 8.1.0
Code/REPL
> mpremote cp data.json :
Behavior
Similar issue was discussed in the context of Thonny (#7158), but the problem is reproducable also with mpremote.
Tried CP 8.2.8 and 9.0.0a5 on macOS Sonoma, Windows 11 and Ubuntu 23.10, also tried CP 8.1.0 on Ubuntu. All these tests failed in similar way -- mpremote would start writing the file but after a while wouldn't get Raw paste confirmation from...
The same device (SeeedStudio XIAO-ESP32C3) is having problems also when trying to write files via the plain raw-REPL mode or via plain paste mode. In paste mode the echo starts going off after a while, in raw mode the OK confirmation does not appear.
Nevertheless, I don't think the problem is specific to writing files. I changed the file writing procedure to a no-op, but made sure that the amount of serial communication stayed the same. The problem still persisted.
@dhalbert thank you for this great effort. I modified the workaround code a bit to work on my system (allowing for renamed drives to work as well)
#!/bin/zsh
#
# This works around bug where, by default, macOS 14.x writes part of a file
# immediately, and then doesn't update the directory for 20-60 seconds, causing
# the file system to be corrupted.
#
disky=`df | grep $1 | cut -d" " -f1`
sudo umount $1
sudo mkdir $1
sleep 2
sudo mount -v -o noasync -t ...
@tulip sleet Mind looking at this PR? Turns out setBrightness(0) does not turn the display off, just does a 1/16 brighntess.
https://github.com/adafruit/Adafruit_LED_Backpack/pull/78
Reading this thread before, I'd got the impression it was an issue mainly affecting auto-reload. But turns out it's a much more serious issue that can cause write errors and file corruption, particularly when trying to write files at the root of the drive.
eightycc wrote,
Because of the way that FAT12 is structured on the device, it's more likely that the problem will manifest as missing files/corrupted or zero-length files when the affected files are at the root of the filesystem.
...
Any chance of getting credit for the script?ย ย Itโs not a masterpiece but it did take a couple of hours to get right.
โโโโโโโโโโโโ
Michael Czeiszperger
Greensboro, NC
@.***
On Nov 24, 2023 at 10:03โฏPM -0500, Dan Halbert @.***>, wrote:
Earlier today I wrote up what appears to be the best workaround right now:
https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#macos-sonoma-14-dot-x-disk-errors-writing-to-circuitpy-3160304
I'll refine this when I hav...
Oh, the ESP32-Cx serial implementation is at fault here, no doubt about that.
The same flush desync/incomplete bug from what I can tell.
@czei noted in my comment, I didn't see that you had written the original version.
Any chance of getting credit for the script?ย ย Itโs not a masterpiece but it did take a couple of hours to get right.
@czei Happy to give you credit. I wrote this up in a hurry while away from home. I have credited you in the Learn Guide page: https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#macos-sonoma-14-dot-x-disk-errors-writing-to-circuitpy-3160304
[@dmcomm:] Should we close #8657 ?
I would like to consolidate these, and perhaps extract the most pertinent posts from each issue into a new shorter issue, since this issue already has hidden posts because it is so long.
A simple thing I had missed.
this is needed to try the debug logging in https://github.com/adafruit/adabot/pull/361
Another member reported that Arduino Nano RP2040 Connect is affected, which it shouldn't be based on previous results here, because it has a filesystem >8MB. I'm trying to follow up with him about that.
It was giving exactly the same symptoms, but flash nuke and fresh CircuitPython fixed the problem. Also tried another flash nuke and downgrading to 7.0.0 in case it was an issue left over from an older filesystem, but still fine. Must have been random filesystem corruption or something. S...
OK, I'm going to close this in favor of #8449, based on @dmcomm's comment here: https://github.com/adafruit/circuitpython/issues/8449#issuecomment-1826863626
Another member reported that Arduino Nano RP2040 Connect is affected, which it shouldn't be based on previous results here, because it has a filesystem >8MB. I'm trying to follow up with him about that.
It was giving exactly the same symptoms, but flash nuke and fresh CircuitPython fixed the problem. Also tried another flas...
I apparently started my branch from an out of date ref, leading to the merge conflict.
I took a look at this issue to see what may be missing. The issue is the current IDF does not support getting the status of the request to the target device. The IDF intends you to fill the "write" buffer if you have something to write and read the "read" buffer if you need to read. As requests come in the hardware either reads/writes from those buffers.
CircuitPython's API is designed to provide an I2CTargetRequest object if a request has come in, but with the IDF we do not know when a re...
The I2C API has been revamped in ESP-IDF 5.2: see https://docs.espressif.com/projects/esp-idf/en/latest/esp32/migration-guides/release-5.x/5.2/peripherals.html. But I'm not sure it helps solve the above.
hopefully something interesting shows up in the overnight logs soon. My money is on something being wrong with the "delay when rate limited" code but I don't know what that thing is. Or else we're looking in the wrong place. It's too bad the cancellation doesn't start by sending ctrl-c / KeyboardInterrupt so we can get a traceback for where the script is stuck, that'd be super helpful.
does it kill -9 the process or just kill the process? I think we could catch the right signal and get a traceback?
catch SIGTERM
I don't know what it does; it might just shut down the whole VM for all I know.
we could also try running it under timeout (from package coreutils, probably installed by default): timeout -s INT 18000 [commandline to run adabot normally]. That should terminate it with SIGINT (KeyboardInterrupt) after 5 hours, getting us a traceback.
timeout may not work right with threads or subprocesses but I don't think adabot is doing that
i added more notes to that issue
I am developing a new board. I have the build working. Now I am focusing on the integrated elements - neopixels, speaker, and an eInk display. (the prototype hardware has eInk using an SSD1608 but the final hardware may have a different driver chip depending on supplies).
For eInk, I see some boards use โfrozenโ python code while others have C code.
Which is preferred or when should one method be used vs another?
I think the only board that uses frozen code is the maker badge, and I suspect that it's because they didn't figure out how to do the display initialization in board.c
or maybe because different hardware revision require different code
oh, I see, different revisions actually use different displays
Thanks. I will start to dig for the startup, shutdown, and refresh code.
ALARM would be great as the ESP32C3 has a very low power state (the reason I got one).
The rotaryio lib is quite good as it is but I have a suggestion for an addition to it: The ability to have a reset pin that sets the counter to 0. When using the rotaryio library to track relitive positions it can be usefull to be able to reset the counter when another pin is triggered.
In my case I have a large geared circle (the rotating dome of a full size R2D2) connected to a rotary encoder that tracks the relitive position of the head, to "home" it I use a hall effect sensor that can ...
I've run into this with an RPi Pico (2020). The remount script seems to let it work (I've only tried once so far).
I filed feedback FB13416096.
This is also called the "index" signal by folks coming from a CNC background. (which is my background)
This should be feasible to add to the "softencoder" implementations, which are based on a microcontroller-level pin change interrupt followed by software decoding of the quadrature data into position based on a state table look-up. The "softencoder" is used by all our ports that implement IncrementalEncoder except espressif.
The limitation of the "softencoder" approach is twofold:
...
Attempting a fresh clone and checkout of 8.2.x, I've been seeing this error when I try to build mpy-cross:
(.venv) rabeles@ub2004:~/Development/circuitpython-sonoma$ make -C mpy-cross
make: Entering directory '/home/rabeles/Development/circuitpython-sonoma/mpy-cross'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
mkdir -p build/genhdr
GEN build/genhdr/moduledefs.h
QSTR updated
Traceback (most recent call last):
File "/home/rabeles/Development/circuitpython-sonoma/mpy-cross/../py/maketranslationdata.py", line 30, in <module>
import huffman
ModuleNotFoundError: No module named 'huffman'
make: *** [../py/py.mk:274: build/genhdr/compression.generated.h] Error 1
make: Leaving directory '/home/rabeles/Development/circuitpython-sonoma/mpy-cross'
Manually doing pip install huffman resolves the problem. I don't see any recent changes to requirements-dev.txt that could account for this.
Uhh is s3 (not the cpu, the aws thing) alright? I'm getting an empty page. Nvm, it was university wifi being sus.
We have a fork of huffman in .gitmodules. It should have been set up when the submodules were fixed
That gives me a clue. I'm working from a fork and have seen problems with submodules getting out of synch with Adafruit's upstream repo.
Problem was a corrupted fork on github. Nuking the fork and starting over fixes it. The fork was a few months old and had had 8.2.x and main re-synched several times. Thanks for the clue!
i've found that when we change the URL of a submodule, git is not great at doing the right thing. I generally do make remove-all-submodules and start over, or just re-clone
With the fork nuke, re-fork, and re-clone I can see that significant work has been done to speed up fetch-port-submodules. Very nice and my thanks to all who worked on it!
curious... espressif watchdog seems to work correctly... the CircuitPython API is in seconds and the Espressif API is in milliseconds, but I don't see any *1000 in here https://github.com/adafruit/circuitpython/blame/3aac226d53386f5e8234400b9e3f84e973e9e7ee/ports/espressif/common-hal/watchdog/WatchDogTimer.c#L87 or here https://github.com/adafruit/circuitpython/blob/3aac226d53386f5e8234400b9e3f84e973e9e7ee/shared-bindings/watchdog/WatchDogTimer.c#L95
watchdog.timeout = 2147483.* works ((2**31-1)/1000), watchdog.timeout = 2147484 trips immediately. Significantly larger values cause a reset.
That issue in adabot was originally about speed, but I think the problem turned out to be the incorrect rate limiting code. I had considered whether something could be parallelized (async or threads) but since the github API rate limit of 5000/hour is still coming into play, I don't think that'd end up reducing the total duration by much. it'd just maybe spend more time waiting for rate limit reset.
If there are any Mac & Circup users willing to test out the version of Circup from this PR: https://github.com/adafruit/circup/pull/163 it'd be greatly appreciated. While working on this I had managed to break it for Windows, but it's back to working now. I'd hate to find out I also broke it somehow on Mac. That's the last of the main 3 OS's that hasn't been tried yet.
Thanks for adding. The additional markdown is fine.
Thank you for updating. You may want to also update the Bling, Blizzard S3, and TinyWATCH S3 descriptions. I wasn't able to find much info on those.
<@&356864093652516868> Reminder that our regular Monday discord audio meeting is in about 2 hours in the #circuitpython-dev channel and the CircuitPython voice channel. Please add your hug reports and status updates before the meeting if you haven't done so already. https://docs.google.com/document/d/1QDaoWlm2Ar_MKxavn5JsRf88OjvyVv1W40qtqwVWhQk/edit?usp=sharing
Aaargh, no notes for me again... I am since a few weeks in Home Assistant, ESPHome, and smart doorbell.
Sure there will be some future integration with Circuit Python, either with mqtt or as currently plan with a Feather Prop Maker RP2040 that play a Xmas music on a speaker when the doorbell relay is activating a GPIO.
I really like the ESPHome YAML to firmware solution that feel like the CI/CD of IoT device (especially with OTA update). Since it is an ESP32 running in my smart-doorbell, I feel like it could run CircuitPython too, and the YAML file already indicate what GPIO (Arduino numbering) is used for what (here a relay and a button input).
At least one thing is obvious... I am addicted to the fast iteration from CircuitPython, and the wait to compile and flash the ESP32 is really a pain (even with everything automated). You just keep waiting before you can test your code. ๐
you can put non-CircuitPython things in the notes doc, and this is relevant
Not this time, but I will try to present my "solution to a non existing problem"... however as I cannot make my doorbell ring at 2AM, it would be hard to present in a Show and Tell. ๐
@eightycc Im hoping to use bluetooth on the Pi pico W for a wireless keyboard with KMK.
I didn't realise there was not support for it until after I had bought it lol, but I works great connected via USB.
we've got a good crowd ๐
Please subscribe and tell your friends, students, colleagues
create an e-mail address for your pets and subscribe them too
๐
๐
Also tried the new qualia library. Got an arc demo working easily. Thank you Melissa.
Hi @idle owl !!
is "stuffing and dressing are similar but yet different in a specific way" a camp you're considering?
That is a valid camp.
@gilded cradle Erin and I solved the immediate problem but I think you may want to take another look at it in more detail. It was a good foundation, there's just some bug the cause of which was not immediately obvious to me so I papered over it instead.
The recipe started out with a terse explanation of multiple camps, followed by a statement about how, now that it has been addressed, the author better not hear about it in the comments. Apparently this is a contentious issue.
you know how comment sections on the internet are
Indeed.
BLE to pulse oximeter sounds neat.
temp ban = temporary ban?
or temperature bandage? lol
yes
openweathermap bans for 24 hours if you exceeed their limit, there is no throttling.
๐งต ๐ก
๐ ๐พ
you are inspiring me right now kattni ๐คฒ
๐ข Sorry to hear that Scott. Wish you and your family prayers.
Thanks everyone!
thank you dan
Thanks for hosting Dan!
Thanks Dan!
thanks for hosting @tulip sleet !
Thanks
you're welcome, all!
Thanks for hosting Dan. Have a great week everyone!
Nice to hear from you again Kattni <3. Hope everyone has a great week. Thank you for hosting Dan.
I've never heard of Framework laptops before. Their "expansion cards" that allow you to add whichever ports you value most look like a great idea to me.
you can also make your own custom ports, and of course people have
also, the main board is a good starting point for cyberdecks
Nice, I'm not quite ready for a new laptop yet, but these will be on my short list to check out further when I am.
I really like the repairability and upgradeability of it.
github is acting up: https://githubstatus.com
Cool! I hadn't noticed yet how the main board is also made to be easily replaceable too. Did you load it up with Arch or changing to something new?
Arch. Pretty much setup like my desktop
Iโm confused about USB VID:PID for my board
I see unique USB vendor/product IDs on most boards.
When I read the Adafruit instructions there are links to the vendors of the MCUs. Iโm using an RP2040. When I go the Raspberry Pi link, it implies I should not use unique IDs (except in specials cases).
Should my new RP2040 board have its own VID:PID for CircuitPython?
@spare jacinth can circuitpython_toml be used to read & re-write settings.toml? Say I'm trying to programmatically update WIFI_SSID environment variable or whatever.. (& that I've solved the writable-CIRCUITPY problem)
Adafruit generally has separate PIDs for the software but I think many third party boards just share one PID for all software.
@slender iron - this is my first CircuitPython based board.
Is the right step to request VID:PID from Raspberry Pi?
Please test with an "Absolute Latest" build. This has updates to the ESP IDF that might fix this.
as long as you have a write-able filesystem it should work
the small test suite focuses on the parser actually reading what is intended (from strings), so working with files & dumping the RAM data to a string/file may not be 100% correct
https://github.com/elpekenin/circuitpython_toml/blob/main/tests.py
code could definitely use quite some upgrades, but it does more than what i needed and havent played with it in a while
added a counter = 0, restarted board without showing CIRCUITPY, restarted again and it was a 1 @onyx hinge ๐ ```py
import toml
FILE = "settings.toml"
data = toml.load(FILE)
data["counter"] += 1
toml.dump(data, FILE)
i can see how changing the file at runtime may need a reboot for some pieces of code which read on startup and work with that same value all along the code's lifecycle, tho (only C code, probably?)
@spare jacinth would you like me to file an issue? I hit an exception that I think should not occur. ```>>> toml.dumps({'y': {}})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jepler/src/community-bundle/libraries/helpers/toml/toml/_toml.py", line 392, in dumps
del table, _order
UnboundLocalError: local variable 'table' referenced before assignment
oops, sure
im completely fine removing on del's to be honest ๐คฃ
but i thought they may be a good idea to clear RAM without waiting for GC
that would be the fastest solution, wouldn't it
I think calling del on a local just before returning from a function won't make much difference.
@spare jacinth thanks for toml & for taking a look at my issue. The specific issue didn't actually affect what I was trying to do, I ran into it while kicking the tires.
for sure makes code easier as i dont have to keep track on what can/should or cant/must not be deleted (and slightly shorter too)
no idea about the actual performance hit (nor am i willing to measure :P)
welp, gonna remove 'em all and throw a new release, thx for the testing
you're welcome!
My library has already been merged: https://github.com/adafruit/CircuitPython_Community_Bundle/pull/196
Closing this :)
trying to Integrate board DISPLAY
I will confess to not knowing what I am doing. That said, I've been trying to add an ePaperDisplay to a board.
CircuitPython compiles and the UF2 will load.
Here is the REPL output ...
>>> import board
>>> dir(board)
['__class__', '__name__', 'A0', 'A1', 'A2', 'A3', 'DISPLAY', 'GP0', 'GP1', 'GP10', 'GP11', 'GP12', 'GP13', 'GP14', 'GP15', 'GP16', 'GP17', 'GP18', 'GP19', 'GP2', 'GP20', 'GP21', 'GP22', 'GP23', 'GP24', 'GP25', 'GP26', 'GP26_A0', 'GP27', 'GP27_A1', 'GP28', 'GP28_A2', 'GP29', 'GP29_A3', 'GP3', 'GP4', 'GP5', 'GP6', 'GP7', 'GP8', 'GP9', 'I2C', 'I2S_BIT_CLOCK', 'I2S_DATA', 'I2S_WORD_SELECT', 'LED', 'MISO', 'MOSI', 'NEOPIXEL', 'RX', 'SCK', 'SCL', 'SDA', 'SPEAKER', 'SPI', 'STEMMA_I2C', 'TX', 'UART', 'board_id']
>>> dir(board.DISPLAY)
['__class__']
>>> print(type(board.DISPLAY))
<class 'NoneType'>
DISPLAY appears on the board but it is NoneType rather than ePaperDisplay.
Here is the board code: https://github.com/bradanlane/circuitpython/tree/dck01_board/ports/raspberrypi/boards/dck01
hey i'm having issues with my Adafruit Metro m7, it wont recognize the SD card.
`
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 25, in <module>
OSError: [Errno 19] No such device
Code done running.
`
REPL output
code:
`# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
SPDX-License-Identifier: MIT
import os
import busio
import digitalio
import board
import storage
import adafruit_sdcard
The SD_CS pin is the chip select line.
The Adalogger Featherwing with ESP8266 Feather, the SD CS pin is on board.D15
The Adalogger Featherwing with Atmel M0 Feather, it's on board.D10
The Adafruit Feather M0 Adalogger use board.SD_CS
For the breakout boards use any pin that is not taken by SPI
SD_CS = board.SD_CS # setup for M0 Adalogger; change as needed
Connect to the card and mount the filesystem.
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
cs = digitalio.DigitalInOut(SD_CS)
sdcard = adafruit_sdcard.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")
Use the filesystem as normal! Our files are under /sd
This helper function will print the contents of the SD
def print_directory(path, tabs=0):
for file in os.listdir(path):
stats = os.stat(path + "/" + file)
filesize = stats[6]
isdir = stats[0] & 0x4000
if filesize < 1000:
sizestr = str(filesize) + " bytes"
elif filesize < 1000000:
sizestr = "%0.1f KB" % (filesize / 1000)
else:
sizestr = "%0.1f MB" % (filesize / 1000000)
prettyprintname = ""
for _ in range(tabs):
prettyprintname += " "
prettyprintname += file
if isdir:
prettyprintname += "/"
print("{0:<40} Size: {1:>10}".format(prettyprintname, sizestr))
# recursively print directory contents
if isdir:
print_directory(path + "/" + file, tabs + 1)
print("Files on filesystem:")
print("====================")
print_directory("/sd")`
its calling the error at the line: storage.mount(vfs, "/sd")
Weekly check-in on this found some updates in Adabot that haven't been brought into here yet.
We version this along with major versions so that we don't break old html.
Did the branch for your device start from main anytime recently? or is it a bit out of date? I noticed here https://github.com/bradanlane/circuitpython/blob/dck01_board/ports/raspberrypi/boards/dck01/board.c#L143 you have displayio_fourwire_obj_t but in main recently this was changed to be fourwire_fourwire_obj_t like this one: https://github.com/adafruit/circuitpython/blob/main/ports/raspberrypi/boards/pimoroni_inky_frame_5_7/board.c#L65
I'm not sure if that is related to your problems or perhaps just because your branch is behind a little compared to main. Might be worth trying to update and / or copy what you can from board.c in the pimoroni inky frame 5.7" file it's also an rp2040 based device with built-in epaper display.
One other difference I noticed is that you have a board_deinit function whereas that pimoroni device doesn't. Did you add that for a specific reason? or was it copied from somewhere else or something? You showed this effect happening in REPL which ordinarily would be accessed via Ctrl-C. That might be calling deinit which is then making your display None by the time you try to access it from REPL code.
Thanks. I just checked and it doesn't appear that it will be overwritten by the sass stuff.
@lone axle - I started with 8.2.x because that is stable.
Most of my copy/paste camp from the pimoroni badger board.
I used REPL just to be succinct. I get the same issue when running code.py and using board.DISPLAY
I also got the same errors before I added the pimoroni code to deinit
Just glancing at it, the error does seem that is is failing to set the bus and assing it to display. Not sure if you have ever done any printf debugging in CP?
One thing that jumps out in: common_hal_busio_spi_construct(spi, DEFAULT_SPI_BUS_SCK, DEFAULT_SPI_BUS_MOSI, NULL, false); do you know the SPI_BUS_SCK and _MOSI are mapping to the correct pins?
I see. Do you have one of the badger devices that you can compare behavior to? I'm not familiar with them, the inky frame is the only pico + eink one I've used. I'm not certain about the deinit code, it may not be the issue either.
Yes. The pins are correct. The display works if I do all the coding from within CircuitPython and use the adafruit mpy module for the display
I do not have any CircuitPython board with an integrated ePaper display.
I will compare my code with the โinky frameโ.
I feel the issue is that the display[0] object is not being constructed but I have no way to debug that code.
Thought I had an idea but no. You could try to post the REPL code that does work and I can take a look, but things seem right. I agree with you that it seems it isn't being constructed
@blissful pollen - thanks. I am going to step away from it for tonight and start fresh tomorrow. I will share the non-integrated code and output in the morning.
Thanks Scott (@tannewt ),
I'll give 9.0.0-alpha.5 a try and respond
CircuitPython version
Adafruit CircuitPython 8.2.8 on 2023-11-16; Raspberry Pi Pico with rp2040
Code/REPL
boot.py:
import board
import digitalio
import storage
# For my Pi Picoโฆ
switch = digitalio.DigitalInOut(board.GP22)
switch.direction = digitalio.Direction.INPUT
switch.pull = digitalio.Pull.UP
print("Remounting storage: " + ("read/write" if switch.value else "read-only"))
storage.remount("/", switch.value)
code.py:
import time
...
Out of curiosity, can i see how many times my lib gets downloaded thru circup? ๐คฃ
I filed an issue about that a couple of weeks ago: https://github.com/adafruit/circup/issues/190
@onyx hinge now that the adabot timezone thing is fixed, i can't remember, did you push forward the submodule commit in circuitpython-org again?
@tulip sleet I did not.
ok, I will make a PR
there are some interesting approved but not merged PR's in adabot too
This seems to me to be the simplest alternative to #8556
(ping @mjsir911)
Need next weeks note doc changed so I can start adding in my hug reports for next week.
i'm working on it ๐
Here is the notes document for next Mondayโs CircuitPython Weekly Meeting. It is at the normal time of 11am Pacific / 2pm US Eastern here on Discord. Add your hug reports and status updates in th edocument before the meeting. If you are unable to attend but would still like to contribute, feel free to add your notes and weโll read them off during the meeting. Hope to see you there! <@&356864093652516868>
https://docs.google.com/document/d/1S1W7c3Rq2PIV4TVrRahtz3Em5cfJpEEPi6sSyW_mk5U/edit?usp=sharing
Currently, the write function of the I2CTarget implementation of the RP2040 is limited to a message length of 16 bytes. If the I2C host requests more than 16 bytes, only 0-bytes are transmitted even if the buffer defined by the user is longer.
Apparently, this is due to a 16-byte buffer length limit in the implementation
int common_hal_i2ctarget_i2c_target_write_byte(i2ctarget_i2c_target_obj_t *self, uint8_t data) {
if (self->peripheral->hw->raw_intr_stat & I2C_IC_INTR_STAT_R_...
This makes sense to me. @tannewt?
I"m going to make this a draft while https://github.com/micropython/micropython/pull/13000 is in process.
@blissful pollen @lone axle - progress: I have board.DISPLAY appearing now. The ePaperDisplay doesnโt display anything (which I assume comes down to the start/stop/refresh sequences).
Two issues were at play: (1) โsome error(s)โ in the code, and (2) you canโt use displayio.release_displays() because it will get rid of the board.DISPLAY ๐คฆ๐ฝ
Hi @noqman -
There are still two problems with the formatting. See https://github.com/adafruit/circuitpython/actions/runs/6967019048/job/18958156375?pr=8649
mpconfigboard.mkneeds a single newline at the end.- There are lines that consist solely of spaces in
pins.c.
I would fix these for you but you have not given permission for maintainers to push to your PR branch.
File a PR for https://github.com/adafruit/circuitpython-org to describe the board too. See https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website for details.
is there someone I should contact or ping about this PR? https://github.com/adafruit/CircuitPython_NAU7802/pull/10
Probably just a matter of waiting until someone has time to look at it
No idea bout the actual code there, but i would take the chance to change for readability ```diff
- if not x in y
- if x not in y
I don't normally use the former - will take a look
might have been a typo ๐คท๐ฝโโ๏ธ
Nah, you just followed the existing pattern, looking at the diff
yep, I see now
And changed existing lines to f-string
I made a general comment about the whole library argument style, which is a bit contorted.
In the long run, I think we might create a new library with an incompatible API that is simpler. There is already an inconsistency about the library is named.
or make an incompatible change, and rename the library, in a version update.
do we need to pin <python 3.12 for this error? https://github.com/adafruit/Adafruit_Blinka_bleio/actions/runs/7017009839/job/19089406611?pr=65
I'll keep an eye out
I don't want to do this. There may be cases where web workflow is the only way to interact with a device.
Workflows should be active in safe mode so that you can recover.
I would compare the build actions with Adafruit_Blinka_displayio, which does not seem to pin to <3.12 and does work (unless it hasn't yet been run against 3.12)
an assumption recently added in #8655
How do you know the length of the decompressed string? Suppose the buffer is too short, what happens? Is it OK if the buffer is larger than necessary?
Right now the progress bar is only for multi-file uploads. The new Fetch API has an experimental body type support for ReadableStream but it isn't support across browsers yet. https://developer.mozilla.org/en-US/docs/Web/API/Request#browser_compatibility
- Disable Nagle at the end of error messages so they are sent before the socket is closed.
- Correctly discard file contents when the PUT file is too large.
- Correctly reset file size after failure to setting it too large.
- Change diskinfo.json to be list of disks in preparation of supporting multiple disks.
- Bump version to 3 for the above change.
- Document diskinfo.json.
Fixes #8109
@slender iron there's some kind of problem with pylint 2.17.x and python 3.12. It is not pre-commit's fault, but the author is abrasive enough that it's hard to figure that out.
i.e., this will fail in the same way:
$ docker run -it python:3.12 /bin/bash
# pip install git+https://github.com/pycqa/pylint@v2.17.4
Collecting git+https://github.com/pycqa/pylint@v2.17.4
...
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
What's odd is installing the same pylint from pypi is just fine. The same problem affects 2.17.7, the last of the 2.x series. So I think the short term thing to do is pin python to 3.11 and the long term thing to do is go to pylint 3.x and python 3.x. (cc @gilded cradle)
Another possibility: because it DOES install via pip, the hook can be changed to a "local" hook with an additional pip dependency: ```yaml
SPDX-FileCopyrightText: 2020 Diego Elio Pettenรฒ
SPDX-License-Identifier: Unlicense
repos:
- repo: local
hooks:- id: pylint
name: pylint (library code)
types: [python]
entry: pylint
language: python
additional_dependencies: ["pylint==2.17.4"]
- id: pylint
are we using pylint 3.x elsewhere? I am wondering why we don't see the same failure elsewhere.
This is just a note about the internal API (the function I'm commenting is a new static function added in #8655). The message length comes from decompress_length(message) and implementation wise it's stored as the first bits of the message itself. this was more efficient than storing a huffman-encoded NUL byte at the end of the str.
Earlier this year I made some abortive attempts to expand asyncio support in CircuitPython. Since then I've put all my ideas into a fork of MicroPython that's based on FreeRTOS to give support for asyncio, threads, and more. If you're inclined to check it out, I'm desperate for feedback. Thanks!
https://github.com/gneverov/micropythonrt
What I got from the author of pre-commit is that it needs to be run in a venv when run under python 3.12. I'm not sure how to do that with github actions, but it's probably the long term key to getting around the failures.
I think this was broken by https://github.com/adafruit/circuitpython/pull/7836. It adds a catch all break when no new connection is available that skips the websocket_background call.
Hey @tulip sleet - I know it was just released, but have you had a chance to check the latest macOS beta that dropped last night? I doubt they've fixed anything, but I can always hope!
It was skipped in many cases which breaks ctrl-cing running code.
Fixes #8132
I'm not sure what is left to do. So, I'm closing this.
MacOS Sonoma 14.2 beta4 is out today and sadly shows no improvement with small filesystems. But it did break Discord for me so if youโve been testing macOS betas you might want to sit this one out.
for devices that reset themselves, the workaround has to be applied after every reset (or basically before each time you want to touch the filesystem from the Mac)?
I take it back about Discord, it suddenly unbroke itself.
Yup. The work around seems to work reliably until the device is ejected, at which point you need to redo it. Reset causes ejection.
ugh, I'm not updating my Macs so far, but may have to bite the bullet at some point... my editor (BBEdit) realizes when a device goes away and comes back and I can then save changes ...presumably it would also be OK with reset+workaround
Agree -- Remaining issue is up-steam server side which I was able to work around.
I'm a compulsive updater but Apple's working hard on breaking me of the habit ๐ At this point I'm updating this one machine ASAP just in blind hope that they'll have fixed the bug.
My gut feeling is that the problem is deep in a library they're using but don't maintain and that it won't actually get fixed until macOS 15 bundles in an updated version of the library that happens to fix it, unless there's some tsunami of attention drawn to it.
is there a way to non-destructively test whether the device is mounted properly in Sonoma?
I don't know of a way to inspect the device to see whether it will actually work or not ๐ฆ It'd be great if we could. I haven't observed filesystem corruption from attempting to write a small file to the device and having it fail, but I wouldn't want to count on that being okay.
(I'll need a script to find and workaround all of the mounted devices, none named CIRCUITPY ...maybe a single-button macropad to kick it off ๐ )
I'll admit it, I've lost the recipe for ice. How do re-build the translation .pot?
NM. make translate, just needed to drop the extraneous s.
@keen eagle Thanks for the confirmation it's still broken - boo hoo ๐ฆ
This is by design and not a bug. configure only applies until the next configure is called. It doesn't get undone automatically.
can you tell from the mount flags, e.g., noasync showing up in the mount output?
or maybe I am misinterpreting the q. Thought it was whether the remount script had been run yet or not
that's my interpretation.
The workaround I've been using doesn't even need the noasync option, I just:
/dev/disk6s1 on /Volumes/CIRCUITPY (msdos, local, nodev, nosuid, noowners, noatime)
root@Johns-Mac-Studio ~ # umount /dev/disk6s1
root@Johns-Mac-Studio ~ # mkdir /Volumes/CIRCUITPY
root@Johns-Mac-Studio ~ # mount -t msdos /dev/disk6s1 /Volumes/CIRCUITPY
Just realized this doesn't set exactly the same options, but when I run
mount -t msdos -o nodev,nosuid,noatime /dev/disk6s1 /Volumes/CIRCUITPY
to get the same mount options it still works (I mean, one of those options doesn't magically help or hurt)
But that's a good point, if you use noasync it'll be easy to spot
In case you didn't see it, Dan made a good point about it being easy to tell if you use the noasync workaround
Hallowing M0 Express was supposed to have adafruit_bus_device turned on, but it was not because the line was:
CIRCUITPY_BUSDEVICE = 1 # lis3dh needs it
The value must be exactly 1 when it's checked in the other makefiles, and the comment adds noise (trailing space, I think; the comment may still be removed).
Fixed a few other files that potentially had the same problem.
Also adds support for the mistaken Hallowing M0 2MB flash chip (should be 8MB). Only a few of these we...
oh nice, thanks romkey and dan
Right, it's just the remount that does the trick. The flags are a red herring.
Does this force a flush too?
* `root`: Filesystem path to the root of the disk.
The adafruit_esp32s2_camera has been revised to adafruit_esp32s3_camera. However, it still exists in the 8.2.x branch of CircuitPython, so it's possible that it may pop up again if a new 8.x release is made. This will hide it from the search results and if somebody goes to the URL, it will redirect them to the adafruit_esp32s2_camera page.
On the flow3r badge we use https://github.com/lieff/minimp3 in combination with micropython which gave us decent performance on the ESP32-S3 without any optimized assembly needed. Compiled with -O2.
Licensing is a bit mixed in the firmware but if you want a reference:
https://git.flow3r.garden/flow3r/flow3r-firmware/-/tree/main/components?ref_type=heads
So, I spent some time troubleshooting an out of sockets error that another user was having yesterday.
They were using both requests and mqtt. In the end the issue was that requests kept getting re-initialized and thus couldn't clean up the sockets.
In an environment with such limited resources, it would seem handy to have a socket handler that could track and close out sockets (similar to request.Session) when you are using multiple methods.
Is this something people would get behind? Is there a better place to bring this up? I'm happy to do the work and draft up a few options.
In all reality, I may do this for myself regardless, but would much rather build something that can integrate with what already exists and for everyone to use.
I'm not sure what happened. Your commit f2b39ae contained some extraneous changes unrelated to to your new board. Merging from upstream did not fix that. If you git reset --hard back to 6d02f12 and then just fix mpconfigboard.mk and pins.c and git push -f, I think it will be OK.
I can remove it from 8.2.x. We have several pending changes to 8.2.8, so there will be an 8.2.9 in the not too distant future.
WisdPi Tiny RP2040
A tiny cool RP2040 dev board with 4MB flash
- Smaller Size
- 23 GPIOs
- WS2812 RGB LED
- USB Type-C

https://wiki.wisdpi.com/rpi-pico-rp2040/wisdpi-tiny-rp2040
WisdPi Ardu2040M
RP2040 Arduino-st...
(already added to circuitpython repo)
[I know this was already merged, but: I think this comment is out of date, this info is in nvm.toml now]
That sounds like a nice piece of functionality to me. This is a good place to discuss it. If you happen to be around on a Monday during the weekly meeting you could raise the topic for more discussion there as well if you'd like. If you do end up getting into it perhaps make an issue on requests or whatever repo is most relavent so that discussion can move to a more direct location related to the changes.
Never shipped. Superseded by adafruit_esp32s3_camera. See https://github.com/adafruit/circuitpython-org/pull/1289.
Alright then. I just thought the reset_reason checker blocked it.
Closing PR.
CircuitPython version
Adafruit CircuitPython 8.2.7 and 9.0.0-alpha4; ItsyBitsy NRF52840 Express
Code/REPL
#https://learn.adafruit.com/ble-hid-keyboard-buttons-with-circuitpython/ble-keyboard-buttons-libraries-and-code
import time
import board
from digitalio import DigitalInOut, Direction, Pull
import adafruit_ble
from adafruit_ble.advertising import Advertisement
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafru...
That's great to hear. If people think it's a good idea, I'd rather hash out a high level plan before starting. Too many times I've done work to have it not the way maintainers want it and it goes unused. My Monday's are meeting free at work, so as long as it's not at a super strange time, I would love to join.
It's at 11am Pacific / 2pm US Eastern time. In the top pinned message of this channel there is a link to a google docs sheet that we use for the meeting. You can add your name and some introduction of the topic to the 'In the Weeds' section of that doc.
This is due to a newly introduced bug in the adafruit_hid library. It mistakenly waits for USB to ready to make sure the HID device is ready to send to, even if the device is a BLE, not a USB device. I'll fix the library.
@tulip sleet Greetings! I am in a position to need to update some code on a project. I am aware of the remount script, and will check the Learn guide you linked to in the Sonoma issue. I wanted to ask first, am I going to corrupt it by simply plugging it in? Or is it opening and editing a file that does that failmagic? Also, does the Sonoma issue affect updating CircuitPython firmware?
it does not necessarily corrupt anything, but the writes are delayed. You may need to wait tens of seconds for a write to complete. If you copy larger files or several files you may get write errors. It is not clear that this corrupts the filesystem inherently. If you pull or reset the board before the writes finish it will be corrupted.
Oh interesting. I thought it was guaranteed.
Which is to say, I thought CP would autoreload before the write completed.
Consistently.
I have the code copied locally, so if I bork it, I'm ok other than getting libs and settings.toml back on there.
All of this to increase brightness of some LEDs. ๐
copying UF2's is OK on _some_baords BOOT py drive pretends to be big enough (>8MB). However, it's smaller than that on SAMD boards.
it will auto-reload, and get an I/O error, and when the write completes, it will auto-reload again, and probably work
Ahh ok.
This is an ESP32-S?.
I don't remember which, have to check in a minute here.
2
it appears as a 32ishMB drive
Oh nice ok.
This is code using AIO for time to control some DotStars. Am I good to try 9x?
I know I need to update libs.
eh, probably, but you don't need to
I'll wait then ๐
I think there may be filesystem wroite issues about writing many files on 9.0.0 on some Espressif.
It won't give you any useful info, I'm not actively developing it.
Hmm ok
Thank you for the info!
Why don't we just add
ret = mbedtls_ssl_config_defaults(&o->conf,
server_side ? MBEDTLS_SSL_IS_SERVER : MBEDTLS_SSL_IS_CLIENT,
MBEDTLS_SSL_TRANSPORT_STREAM,
MBEDTLS_SSL_PRESET_DEFAULT);
if (ret != 0) {
goto cleanup;
}
to common_hal_ssl_sslcontext_wrap_socket? Is there more that's supposed to be done? I'll make a fork and test t...
@tulip sleet It did exactly what you said it would, and worked fine when I let it finish the write and reload on its own. Thanks again! My little plants thank you as well. They have been without good lighting for a couple of months at this point. They're not dead, but they're definitely not thriving like before. Hopefully this helps. ๐
Yet another โmajor thank youโ to the Adafruit team. A little comment in their SSD1681 code was the last piece of the puzzle for my CircuitPython build with an integrated ePaper display ๐คฉ
(the height of 200px is 2 bytes and so their code uses 200+0x60 as the ram height value)
Added board support for the ESP32-S2-WROVER based Flipper Zero Wi-Fi Dev board
I think we luck out on .uf2 writes because it's the contents of the blocks that flashing code pays attention to. Any metadata it throws into ye olde bit bucket.
In all of the cases I've looked at, data gets written immediately, it's the metadata that gets delayed.
I'm running some tracing now on iOS. So far, it looks good, i.e., no delays. On the bad side, iOS writes to the device every few seconds, so autoreload will go crazy.
Testing with latest released iOS, 17.1.1
@gilded cradle there's a property overscan_left that can be put in tft_timings. The unpublished page titled "Qualia S3 RGB-666 with HD458001C40 4.58" 320x960 Bar Display" is an example of using overscan_left. In theory there could also be overscan on the top/right/bottom but this is not implemented.
Internally, circuitypython creates a (width + overscan_left)-pixel wide framebuffer, but makes logical "column 0" be the 60th pixel, in this case.
Ok, cool. That's basically like the ST7789 displays like the 135x240 with the row and column offsets.
@mortal kernel thanks for the testing
NP, the iOS results are a bit of a relief. I've made the tracing code more informative, it now IDs the area of the filesystem that is being written to.
what I saw with something very similar to your original tracing code was that even on Ventura, I was seeing "delayed writes". However, it was not at all clear to me whether they were part of a transaction that was not related to the original file write (e.g. clearing the dirty bit, or setting access time, or something or other that happened later). I would have wanted a parsed view of what was being written to the FAT and to the directory entries. I did not attempt that at the time, and am not asking you to do it.
basically, more semantic logging in oofats
Already done. I've ingested the filesystem's VBR, analyzed it, and determined the block # ranges for the various areas.
well, nice! are you dumping the directory entries, or anything like that
I've learned to avoid making mods to oofatfs.
No, but I could.
jsut to see, aha, that is writing the file you requested, as opposed to one macOS's innumerable helper files
I see. At this point I'm just IDing the area (MBR, VBR, FAT, root dir, or data), but I could go a bit deeper.
maybe wireshark parsers could already do this
i have a meeting in five minutes, but are your changes in a branch somewhere?
Just local right now. The tracing is all in supervisor/shared/flash.c.
my thoughts were mostly to give a better Apple Feedback; maybe this can wait until we see whether they are doing anything (though it's opaque)
OK, more later. But I am going to trace a >8M filesystem next.
Where did the Espressif PID come from? Typically, third-party boards using Espresso's VID will request custom PIDs here:
https://github.com/espressif/usb-pids
The pid came from lsusb with the stock firmware. And ESP32-S2 is the product name https://www.espressif.com/sites/default/files/documentation/esp32-s2-wrover_esp32-s2-wrover-i_datasheet_en.pdf
Added notes for next weeks meeting
As a general rule, is it better to create an issue for each pull request, or can you make a pull request for a circuit python library without opening an issue?
Pull is fine without an issue
Issues are better for work that hasnโt been done yet
So we donโt lose track
Ok cool, I still need to verify with myself that what I think is true is actually true, but it's an optimization for a library so there isn't an "issue" with the library and I wasn't sure about the proper order of things. Thank you!
Hi, I have implemented all your suggestions. Please let me know if any further revisions or changes are needed.
Thank you and I truly appreciate your guidance.
OK, this looks fine. Thanks for your patience with the formatting changes!
The data/nvm.toml submodule is showing changes. It should not need updating. Maybe it's out of date in your local clone or in your fork?
Otherwise things like fine!
Please re-check which pins are usable. I noted some unneeded pins but did not thoroughly review.
These are not needed (and "VARIENT" is spelled wrong).
USB only; not available for general use. Do not include.
You mentioned that this is the existing PID: do you mean on the Flipper Zero or on the WiFi module only?
well that's a new one. the workflow for adding a helpful comment on a PR in the case of an error in the original workflow .. had an error https://github.com/adafruit/Adafruit_CircuitPython_Bundle/actions/runs/7047239446/job/19180678968#step:2:5
CircuitPython version
Adafruit CircuitPython 8.2.8 on 2023-11-16; Adafruit QT Py ESP32S2 with ESP32S2
Code/REPL
# SPDX-FileCopyrightText: 2022 Dan Halbert for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
import board
import neopixel
import mdns
import socketpool
import wifi
from adafruit_httpserver import Server, Route, as_route, Request, Response, GET, POST
mdns_server = mdns.Server(wifi.radio)
mdns_server.hostname = "efcx"
m...
You may not be able to try this, but do you see the same crashes when you don't use mDNS?
Good question, Dan. Since this crash took overnight to manifest, it will take a while to test this out.
I plan to try running this code as-is, but attaching the board to a power supply instead of a computer to see if that resolves the problem. If it does not, then I will try removing the mDNS element from the code. That is a "would-be-nice" but not essential element of the project I envision, so I can live without it.
I am attempting to send a logging message to just the UART by calling console_uart_printf. Oddly, for a '\n' I get just a newline rather than the expected return (i.e., the terminal advances to the next line with the line position stuck at the end of the previous line).
I've tried '\r\n' but behavior remains the same.
The reason I'm trying to do this is that when I send large amounts of trace over the normal USB endpoint it induces unpredictable I/O errors on USB MSC in use concurrently.
Problem persists in latest macOS Version 14.2 Beta (23C5055b).
I think this should work. I'd expect the \r\n to work just fine
Oddly, the '\r' in the '\r\n' gets stripped somewhere before the string gets sent. Here's what I'm doing:
#define DEBUG_PRINTF(...) console_uart_printf(__VA_ARGS__)
...
DEBUG_PRINTF("Flash filesystem info:\r\n");
ah, it does go through mp_vprintf
I don't see any stripping there
and it spits it back to the uart
I don't either. What's doubly strange is that if use the usual mp_printf, it works as expected.
mp_printf adds it right?
Not sure what you mean?
Interesting. Any thoughts on how I can get console_uart_printf to behave?
I'm not sure where it is dropping the \r. I'd expect giving both to work
Let me set up GDB and I'll try tracing it. It's just...weird.
Sigh, another Feedback submitted. Apparently one way to get through to Apple is to submit a new Feedback for every beta and full release of the OS, referencing past Feedbacks. My feedback ids if anyone wants to reference them FB13269327 FB13428357 (I've referenced all mentioned here in mine)
The
data/nvm.tomlsubmodule is showing changes. It should not need updating. Maybe it's out of date in your local clone or in your fork?Otherwise things like fine!
This is intentional because the boards have new flash chips on them.
OK, got it. I didn't see the latest PR to nvm.toml.
@tulip sleet and @onyx hinge, have time to chat about busio.SPI changes to help them live outside the vm?
I'm around. Dunno that I have any insights. But happy to listen to what you're thinking
Got it. I was picking up a stale firmware.elf. `\r\n' do indeed work.
I've been thinking a lot about this and I think we'll need to require that the FS be backed by a native object for reading and writing blocks. MP actually allows for Python implemented block io but that would lead to running Python functions at anytime while other user code runs.
can we do that easier if we requre using sdcardio (which is already semi-native)
Right now display core will move I2C and SPI objects that they need to keep outside the VM. This is bug prone. Instead we should ensure the used object is already outside the Python VM. It can either be statically allocated (likely for use in board) or allocated dynamically to the outer heap.
This will be easier once we move to a model where only one dis...
The MAX3421 adds USB host support via an external chip attached over SPI.
We should add support for it in a 9.x release. It will require the use of a SPI bus from the board module initially because those are statically allocated and live after Python VM.
After #8675 (likely CP 10) is done to always allocate SPI objects outside the VM heap, then we can support any SPI object.
When a USB drive is plugged in, we should automount it in CircuitPython and make it available over the CP workflow.
When a SD card is inserted into a board defined SD card port, we should automount it in CircuitPython and make it available over the CP workflow. The SPI or SDIO bus will need to be board defined so it is statically allocated.
Yup, exactly. Using the native sdcardio or sdio rather than the Python sd card library would be required.
@tulip sleet @onyx hinge I think I covered what we talked about in the above issues. Please chime in if I missed anything
probably time for us to do a 9.0 issue pass to punt features and bugs
these look good!
yes, definitely
could do it tomw sometime before your streaming, or early next week
that could work for me. could do it during the stream too if we're ok with interruptions
though that is 5-7 my time, might be possible
before is fine with me too
May I instead suggest an fstab of sorts?
settings.toml:
*insert root table items here*
[FILESYSTEMS] # Boards that can afford to spend time to search, have flash space for parsing tables. This can be made into a #ifdef
SPI = "/lib" # This would try to autodetect if an sdcard can be found on board.SPI and try to mount it to "/lib"
whateverSPI = "/mnt/test" # This would try to autodetect if an sdcard can be found on board.whateverSPI and try to mount it to "/mnt/test", if "/mnt" d...
My idea was to automount to a predictable location. /automount/<fslabel> for example. User code can manually mount to a different path.
Sure, that could be the default behavior, but if an fstab-like thing was made, it could pretty much mean nobody would need to manually mount stuff.
It wouldn't even be that much code to add on top of the rest.
It could just be a determine_mountpoint function that calls an upgraded getenv that has a minimal table support.
If the key is found & can be used, it would mount it there, in any other case, /automount.
Currently reloads may take a bit of time as wifi reconnects, workflows are reset and stuff is reinitialized.
It may be just a few seconds just a few seconds right now, but it still feels like a hang.
As more stuff is added however and retries, errors or external delays occur, this time will increase.
It may be worth considering some form of logging for this process.
It could be some text set to the title (that would look great on display boards), or just have some prints.
When the wifi dev board has its stock firmware, thats where I got the vid,pid
I'm trying to diagnose a panic and/or safe mode in RP2040 CircuitPython when it's plugged into a RP2040 USB Host Feather that's a usb_host. I've got a build that enables the device's serial REPL with CIRCUITPY_CONSOLE_UART_TX and ..._RX and can see that it's panicking or safe mode-ing.
Are there any other debug flags I can enable to get more print-based insight or do I have to hook up a debugger?
CircuitPython version
Adafruit CircuitPython 8.2.8 on 2023-11-16; Seeeduino XIAO RP2040 with rp2040
Code/REPL
import audiobusio
import board
DATA = board.A1
LRCLK = board.A2
BCLK = board.A3
audio = audiobusio.I2SOut(BCLK, LRCLK, DATA)
Behavior
Traceback (most recent call last):
File "main.py", line 25, in
ValueError: Bit clock and word select must be sequential pins
Description
The code is taken from https://le...
The pins must be consecutive because I2S is implemented using PIO, which requires sequential pins. There isn't a provision for having them in reverse order, though that might be theoretically possible by supplying a different PIO program.
So I'm guessing this XIAO has a different pin breakout. But which way are you orienting the audio BFF? It mounts back-to-back against the QT Py. See the photo here: https://learn.adafruit.com/adafruit-audio-bff/overview
Hi!, I'm representative from Cytron Technologies and I wanted to inform you that we have decided to scrap the Cytron Maker Zero SAMD21 project, and we won't be launching the product. In light of this decision, I kindly request your assistance in removing all related files from the repository and website.
Let me know if there's anything I can assist you with in this process.
Thank you
CircuitPython version
Hello,
I'm attempting to play a .wav file on the audio jack using the Raspberry Pi Pico W. My code snippet for configuring the audio channels is as follows:
Code/REPL
dac = audiopwmio.PWMAudioOut(left_channel=board.GP20, right_channel=board.GP21)
Behavior
ValueError: Stereo left must be on PWM channel A
Description
However, due to a hardware constraint, the default mapping of the audio channels is reversed on my boa...
As requested, here is a report of a memory error with CP 9.0 the works under 8
The code runs OK with CP 8.2.8 but gives the following error with 9.0 Alpha.5
Adafruit CircuitPython 9.0.0-alpha.5 on 2023-11-15; Adafruit QT Py ESP32S2 with ESP32S2
>>>
>>>
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
ip 10.0.0.53
Traceback (most recent call last):
File "adafruit_requests.py", line 515, in _get_socket
espi...
The old one is gone so we link to the overall pico(w) documentation page
You'll want a debug probe and GDB to troubleshoot that. If you're still stuck I can share some tips to get you set up.
Keyboard
The keyboard is an ESP32-C3 chip running its own firmware and communicating via I2C. A keyboard backlight is present, it can be turned on by pressing Alt+B. There is no way to enable that via I2C, but the keyboard can be updated to support it.
There is a separate UART interface (2 of 6 pins) on the main board that can be used t...
I have them mounted back to back. That's what I wasn't sure if it was a RP2040 thing. Looking at the specifics for gpio arrangement on the Adafruit QT Py RP2040 and the Xiao RP2040 it looks like the gpio pins are reversed. It appears that Adafruit should mention that the bff isn't compatible with the Xiao version
Thanks. Was this board ever shipped?
The board data also needs to be removed from _data/files.json.
Should we also expect a PR to remove it from the circuitpython? The board was added here https://github.com/adafruit/circuitpython/pull/6432.
how to make the keyboard work in REPL
Good question! Unfortunately, there isn't a way to use the T-Keyboard to input characters the REPL on the T-Deck.
It might be feasible to add support for that. CircuitPython recently added a repl.py file that, if present, will run before the REPL is loaded. A driver could probably be created to accept input from the T-Keyboard, but more research is required. I haven't tried it.
Looks good. Are you ready to merge? If so, remove it from draft status and we'll merge, and you can proceed on the circuitpython-org PR as well.
As a general rule you're better off opening a new issue rather than updating closed ones. Closed issues are harder for the Adafruit folks to track. I think this is a great question to open as an issue :D.
I'm thinking a virtual REPL using the python exec() command and a simple I2C keyboard handler wouldn't be too hard to write and might be a decent stop gap in lieu of CircuitPython native support. It could just be placed in code.py.
As a side note, [PyDOS](https://github.com/RetiredWiz...
@dhalbert I'm double checking some pins, and want to do some quick testing; but pretty much done. Thanks for the help!
@jepler @tannewt My understanding is that we could support bit clock and word select pins in reverse order but we'd need two more PIO programs to handle that case. Is that true?
I encountered an issue that sounded similar, but wasn't. I wanted to document my issue for anyone who stumbles upon this thread.
Issue:
I'm working with a Metro ESP32-S2 and the Adafruit RGB Matrix Shield. I had a pretty easy time getting a 32x64 matrix up and running, but ran into issues later on in the development process. I found that running code.py worked just fine, but when I dropped into the REPL, I wound up with white lines across my screen when I called `displayio.release_displ...
debugger is the way to go because you can break on reset_into_safe_mode() to get a back trace
@tulip sleet @onyx hinge I'm at my desk if you want to do a 9.0 sweep
sure, in a couple minutes
๐
I am going to open all the 9.0.0 bugs in tabs as prep
๐
want to do it in a private video chat or public?
(anyone here is free to chime in and be added. we just had some random folks yesterday)
we could do it in the CIrcuitPython channel to make it more obvious, or it could be private
I just saw this; happy to join (cc @tulip sleet)
@onyx hinge we are in the channel
Check whether 7 pixels works fine or not.
Looks like the neopixel transmit won't be using DMA until 12. Without DMA, the PIO FIFO is filled from a while loop that calls background tasks: https://github.com/adafruit/circuitpython/blob/main/ports/raspberrypi/common-hal/rp2pio/StateMachine.c#L869C13-L869C33
This leaves it susceptible to audio buffer fills that may mess up the neopixel transmission. Perhaps we should lower the dma threshold to where it kicks in any time the FIFO is too small.
Closing in favor of #8678.
I tested this on the pycamera revision and the web app. quality 4 & 27 were clearly different.
Let's turn I2CTarget off for now since it doesn't really work if it can't read data. I'll turn it off, and then make it long term.
Let's retest after 9.0.0-alpha.6, which has significant web workflow changes.
@jepler may have seen something like this when making a request before the http server was up.
In the camera app, I create a webserver, then create the pycamera object, and finally enter the webserver's main loop.
I have seen that when I make a request before it has fully initialized the camera, that request can get lost.
note that introducing an AudioMixer and playing the RawSample on it may be an effective workaround.
Hello all,
I just flashed circuitpython on my T-Desck and it all works correctly. But to my great surprise I cannot use the REPL keyboard directly from the T-Desck.
Following advice, I'm going to dig around to create a little circuit python script.
It was pointed out to me that there was the execution of the repl.py script before loading the console, as you had planned a development in this direction.
Can we help at our level?
It would be great to have a smaller example that does not require full KMK to reproduce.
Yes it's due to my lack of knowledge of git I will continue here I will leave you the link
Related to #8370, maybe.
Could you now test with a 9.0.0-alpha release? Thanks.
Can we help at our level?
By "we", do you mean you are associated with LilyGo?
There's no way to inject characters into the REPL right now, but maybe such functionality could be added. CPython has the code module which has some functionality like this. We didn't know about code when we chose code.py.
out of curiosity, did it work for your usecase?
perhaps was just a theoretical question? (:
Will this need a PR to TinyUF2 as well?
No I am not associated with Lilygo but I translate the text with Google translate so my English is approximate
@Freyr86 I pulled the keyboard logic from PyDOS and added a simple REPL loop which I think works pretty well. You can find the routine here: https://github.com/RetiredWizard/tdeck_repl
In most cases, these two lines:
pool = socketpool.SocketPool(wifi.radio)
requests = adafruit_requests.Session(pool, ssl.create_default_context())
should only get executed once, near the start of code.
Once that's done, you should be able to make requests, enable and disable wifi, connect to wifi, at will without safe mode.
@RetiredWizard well seen it works on my side I will do some tests thank you very much
Looks like dynamic service support has been added to ESP nimble and is in IDF 5.1.2: https://github.com/espressif/esp-idf/commit/94ad8f1a6a8ad7edfa806ddb672a1e34102e0a7a
Will this need a PR to TinyUF2 as well?
It should not. New boards do not need to be added to TinyUSB. Were you thinking of something specific?
Will this need a PR to TinyUF2 as well?
It should not. New boards do not need to be added to TinyUSB. Were you thinking of something specific?
Since the board doesn't ship with a UF2 bootloader on flash, wouldn't one always need to use esptool for any install/updates? (it is ESP32-S2 based, so there isn't a UF2 bootloader in ROM)
Hmm, well, if you were to put some prints when a client connects, you would probably see no client connection for the missing request.
Do keep in mind if you plan to debug it, it's truly random as to when it will fail. For ftp it may do 200 sockets and then fail, or fail on the first one.
I was playing around with this and realized that any user scripts that are imported from the virtual REPL will need the following import block added:
try:
from tdeck_repl import input
except:
pass
Sorry I misread TinyUF2 as TinyUSB. There are some existing UF2 bootloaders that could be used, since it's a standard module. So not necessary, but could be done to get the LEDs to work.
I was thinking about it too, I'm going to use your script to emulate a "nano" if I can do it but I think it can do it
I'm not sure if there's an issue already for spurious espidf.MemoryError:. I get these on Requests sock.connect somewhat frequently on 8.2.8, when espidf memory is plentiful, even early after a reset. Several resets later, it will just automatically work. I can only guess there's some non-deterministic espidf activities that trigger this (early after startup, and after running for some time). May not be related to espied memory at all. May be unrelated to this particular issue.
Your ...
Dev machine discussion: Any experience or thoughts you have with doing large compiles on modern CPU's with "perfomance" and "efficiency" cores, like Intel 15-13500 (6p+8e) or i7-13700 (8p+8e) or even i9-13900 (8p+16e)?
I currently have an Optiplex i7-8700 (6 cores) I got off-
lease at a good price, which is honestly pretty fine. A 3x-4x improvement is what I would think worthwhile to replace it, in the long run. I'm not really interested in the big power-hungry unlocked processors.
It is not clear to me what software development speed gains the efficiency cores add. Compiling CircuitPython has some parallelizable parts and some serialized parts (e.g., linking). I see a few benchmarks of large compiles (e.g. chromium), but the testing is on gaming processors and is pretty incomplete.
It would be neat to support I2C keyboards natively in CircuitPython. That'd enable using the keyboard when the VM isn't running too. We've started doing this with USB keyboards in CircuitPython 9.
(moved to thread)
@lone axle will you temporarily add me to the circuitpythonistas role before the call on Monday?
Done - just let us know if you want us to turn it off at some point if you don't want the notifications
Thanks. I'll see how busy it gets. I'm trying to dedicate time to Adafruit because, well it's a wonderful community. I want to deserve the tag if it's going to stick around.
Glad to have you here and if you want to chat in the meeting, you'll need it. It's only 2 notifications a week (a reminder before the meeting and after when the next week's doc is posted and pinned). ๐
Oh that's nothing ๐ I'm used to channels that hit me 100s of times a day...
It seems like there's really just one thing needed to enable "custom REPL": code.compile_command which is a lot like builtin compile except that it can tell if code is "incomplete" and returns None in that case (instead of a code object or raising an exception). With code.compile_command you can build a repl that knows when to print "..." continuation lines, etc. but could take input from any source that you could make work from Python code.
mp_repl_continue_with_input is basically the implementation of "check if this repl-command is complete"
OK, I have run two tests with the board plugged into a power supply instead of the computer. Both failed.
In the first test I left the code as it was with mDNS above. This test ran for about 36 hours with a loop on another computer using the board's webserver to change the neopixel color every minute.
In the second test I commented out the mDNS lines. This one failed after about 90 minutes.
I doubt that the length of time between failures indicates very much, but the failure itself i...
The most immediate help is to use a safemode.py file:
https://learn.adafruit.com/circuitpython-safe-mode
There are many other things that can be done for general robustness of circuit python projects. The Adafruit Discord server is a great place to ask about circuit python usage and customization.
wait there is a compile??
I have been execing everything..
I don't even have it in builtins
it would trully be revolutionary having it though
@brazen hatch hmm I was testing on the unix "coverage" build
#if MICROPY_PY_BUILTINS_COMPILE
{ MP_ROM_QSTR(MP_QSTR_compile), MP_ROM_PTR(&mp_builtin_compile_obj) },
#endif
oh, alright, is there a reason this isn't enabled in normal boards?
I would looooove compiling stuff during runtime
```if you felt like doing a build you should try enabling it
It doesn't look like it pulls in much extra stuff
alright, I have the perfect workload to throw to it
ljinux is around 8 nested execs
if I compile all of that and it works
because the mpy is one thing, but all the programs are .py
loaded as text and exec'ed directly
I will just have to implement a try-compile function in program loading and do per-port tests.
@RetiredWizard Would you like to talk more directly? I have a few questions about your script?
Freyr86 ind discord
Here is a fully annotated trace that shows the failure.
The test machine is a MacBook Air M1 running Sonoma 14.1.1. The test board is a Metro RP2040. CP is branch 8.2.x with debugging and trace extensions. Flash size has been reduced to 500KB.
The following trace data shows that MacOS delays for 13.3 seconds after writing the file data to the flash. After the delay MacOS writes the root directory with the correct file size and cluster number, then writes the FAT table with the corre...
@eightycc This is great, detailed data! I would be interested in your debugging print patches. We could conditionalize them and keep them in the main line.
@dhalbert The tracing code is on branch sonoma-8.2.x of my forked CP repo https://github.com/eightycc/circuitpython. It's a bit rough, if you'll give me some pointers on how you'd like to make it conditional for the main branch I'll be happy to prepare a pull.
Here is a fully annotated trace that shows the failure also occuring on a >8MB filesystem. It appeared that the problem was resolved when running with a >8MB filesystem, but the tracing shows that the problem is still there.
Comparing this trace with the previous (<8MB filesystem) trace shows that operations occurred in a different order (initial data and directory writes are reversed). It's possible that the ordering difference makes the symptoms less obvious, but it's clear that the lo...
Tested a good bit on S3 and C6.
It was an iceberg. ๐
I don't even know why am I even trying to get to the bottom of this.
I did it.
It was much simplier afterall
oh
It's absolutely amazing.
The speedup is very substancial.
Oh why wasn't this the default?
ยฏ_(ใ)_/ยฏ
Here is what I get:
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
ip 10.0.0.53
espidf.get_total_psram()=2097152
espidf.heap_caps_get_total_size()=2272023
espidf.heap_caps_get_free_size()=1981999
espidf.heap_caps_get_largest_free_block()=1900544
Traceback (most recent call last):
File "adafruit_requests.py", line 515, in _get_socket
espidf.MemoryError:
The above exception was the direct cause of the following exceptio...
This enables builtins.compile() for all espressif boards.
This is currently in draft as I want to run more tests and see how it affects storage space.
I have already implemented compilation support within ljinux which heavily relies on exec and the results are pretty impressive.
However since I still haven't made a benchmark, I have no numbers to present.
I suggest as you try for yourselves.
I want to enable this on more and more ports, but I plan on doing it in different PRs, on...
@RetiredWizard pinging for interest.
global crun
try:
from builtins import compile
def crun(code: str) -> None:
exec(compile(code, "", "exec"))
except ImportError:
def crun(code: str) -> None:
exec(code)
I fully implemented it for ljinux. If there is compiler functionality on the board it compiles and unloads the raw code.
I tested on esp32, s3, c3.
The speedup is most apparent on the slower boards. c3 and regular esp32 became much more responsive.
It's perfectly stable. Marking as ready for review.
I would never have predicted a performance improvement from this. I can see why if you can cache the result of compile() and use it multiple times it could make a difference.
I made some benchmark code and ran it on the unix port on my desktop computer (amd64)
import time
n = 100_000
def timeit(title, f):
t0 = time.time()
for _ in range(n): f()
t1 = time.time()
dt = t1 - t0
print(f"{title:<20}: {dt:8.3f}")
def crun(s):
return exec(compile(s,...
I swapped the exec with exec(compile()) in PyDOS. I haven't run any benchmarks but PyDOS doesn't seem to run much different. I have been testing on an S3 so I'll give the C3/ESP32 chips a try as well but PyDOS actually ran pretty well on those chips.
I don't think I fully understand how the compile command should be used. PyDOS only executes a single python line at a time so I'm not sure I see where the speedup comes from.
Still on the ESP32-S3, I decided to try timing a program:
Running with exec(compile())
(8155376)/>bench
time
The current time is: 13:01:20
turtle
Turtle time! Lets draw a rainbow benzene
Press Enter to continue...
time
The current time is: 13:01:53
Running with just exec()
(8160288)/>bench
time
The current time is: 00:01:33
turtle
Turtle time! Lets draw a rainbow benzene
Press Enter to continue...
time
The current time is: 00:01:41
The turtle p...
First of all, applications like ljinux are python scripts for the most part, not shell scripts.
So the kernel does not get back control at all while the app runs.
And for long running apps that have plenty of loops and/or user interactions, like nano for example, where we open it once and spend minutes inside, not having to re-interpret anything is pretty massive.
In the backround the code is just looping over and over. If the loops are in ASM already, it's instant.
Let's spice up the c...
@brazen hatch I figured that was the difference, PyDOS isn't going to see the same speed increases....
yea yours goes in and out of the kernel
mine doesnt
I load and run big chunks
so it really works wonders for me
Yea I should prolly disable compile for my scripts too
I should only keep it for py programs
I really need to make a bench prog too
rn I just use nano scrolling as a bench and overall responsiveness
k let's now do JIT so everyone is happi
๐
@wraith crow something you could still do is have a bytecode cache and store compilations
this will have a speed increase, but is a mess to micromanage
I have yet to determine how much ram do the big bytecodes take.
If it's nominal, we could maybe just keep everything and only wipe it on an exception handler
I haven't really worried too much about execution speed, my headache has been memory so adding caching logic might speed things up a bit but I probably wouldn't be able to run as much on the RP2040's and smaller modules
I mean, not keeping exec text in ram during execution is an improvement as by itself, it's just a matter of if it's a net gain or loss with keeping bytecode
I'll test
PyBasic is the only program that I wish would run faster but in order to run any decent sized basic programs I had to make it execute basic code one line at a time from flash so I don't think there' any hope for speeding it up
Remember I'm only executing one line of text at a time so there's not much in memory, I loop through the script file and execute each line as I read it
Scratch that, it's been a while ๐ I do read the entire script into memory
Now I don't understand why I'm not seeing some improvement with the turtle program :/
Or at least the same performance
I have to go for today, but I can prolly take a look at it tomorrow.
I wonder if I could dualboot ljinux and pydos on a single board. That would be cursed.
I am seeing these same errors consistently on a FunHouse with 9.0.0 alpha 5 (and each alpha all the way back to 2, also with the absolute newest UF2 at the top of the list at the time of this writing 1f5e692.uf2):
Traceback (most recent call last):
File "adafruit_requests.py", line 515, in _get_socket
espidf.MemoryError:
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "code.py", line 36, in <module>
File "ad...
yea ljinux can run without a root even too, I wonder though if I could make it run pretty with everything.
and make a boot menu
There's a lot of board specific and auxiliary stuff that takes up flash space but isn't needed
same here
After some Discord discussions will @bill88t I was really confused by my earlier benchmark results and re-tested. Upon re-testing the compile option ran in 8 seconds rather than the 33 seconds I got earlier.
I was using web workflow to move some files back and forth and was seeing issues with the web workflow apparently locking up the serial REPL and possibly crashing the WiFi interface. I haven't been able to isolate for a reproducible issue yet but I suspect it was WiFi issues that slowe...
Great work!ย ย Youโd think with all of this detailed documentation the problem would be easy to fix.
โโโโโโโโโโโโ
Michael Czeiszperger
Greensboro, NC
@.***
Trace Data
Filesystem characteristics
type: FAT16
sectors: 30720
sector_size: 512
resvd_sectors: 1
clusters: 7664
cluster_size: 4
root_entries: 512
sectors_per_track: 63
heads_per_cylinder: 255
fat_size: 31
fats: 1
start_fat: 1
start_root_dir: 32
start_data: 64
MacOS write file data to the fi...
how fun would it be if I could store the bytecode and do diy .pyc files
like, store a sha hash and the bytecode and then retrieve it later
Hi, no this board were never shipped. Its only at prototype level.
Yeah, I will also do a PR to remove it from the circuitpython
Hi,
As per request I removed maker-zero-samd21 files. If there is anything else I missed, please let me know.
Thank you!
This is fine - thanks. Could you also submit a PR based on branch 8.2.x so it's removed from both active branches? Or switch the base for this PR to 8.2.x, and we'll merge it up to main.
CircuitPython version
Adafruit CircuitPython 9.0.0-alpha.5-31-g1f5e69243e on 2023-12-03; LILYGO T-DECK with ESP32S3
Code/REPL
import time
from sys import stdin
from supervisor import runtime
cmd = ""
while cmd != 'q':
print(time.time())
time.sleep(5)
if runtime.serial_bytes_available:
cmd = stdin.read(1)
Behavior
The code.py file occasionally stops displaying time updates when the circuitpy drive is ejected in prepar...
I too made an oopsie with my testing (today it's borked tests day apparently).
I had removed my code setter and since I didn't reload I was using an earlier value on my testing above.
Old code (fixed):
import time
n = 1000
def timeit(title, f):
t0 = time.time()
for _ in range(n): f()
t1 = time.time()
dt = t1 - t0
print(f"{title:<20}: {dt:8.3f}")
codestr = """
for i in range(1000):
a = sum(range(100)) ^ i
b = int(a / 3)
"""
cod...
Hi,
Here is the PR based on 8.2.x.. Please let me know if I have done it the way you requested.
thank you
While testing some other things a few weeks, I copied files using the shell to an Espressif 9.0.0 filesystem and got write errors. I haven't had time to try this again to try to duplicate it consistently, but I am wondering if there is an underlying problem in filesystem writes, which might explain this and several other bugs as well.
I'm going to try to run this adabot patch today: https://github.com/adafruit/adabot/blob/main/patches/11OCT2023-add-sphinx-rtd-theme-to-docs-reqs.patch anyone who gets alerts for library commits and later releases will likely see an increase in traffic from that.
thanks @lone axle
@tulip sleet @gilded cradle @lone axle can I call on youse to read the sub-sections of "State of"?
sure
Yep, good for me as well.
yeah
I found about 30 libraries that seem to have different branch permissions from the rest. These libraries failed to push the change from the patch and output an error like Protected branch update failed for refs/heads/main
I don't see much of a pattern in the ones that are like this, they seem like a pretty random set to me.
If there is a desire to look into their permissions and try to normalize them with the rest of the library repos I can save off a list of them seperately for someone with appropriate level of permission to go thru?
The error also mentions Changes must be made through a pull request. I'm going to start working through the list and making PRs with the same change as the patch. I'm Hoping to get all of them merged and then do 1 release sweep once everything is merged.
I doubt it's intentional that libraries have inconsistent permissions like that.
there is a setting "Allow specified actors to bypass required pull requests" that would theoretically allow adabot to bypass branch protection. It is not set in the first lib I looked at (busdevice).
For the patches I think the changes come from the user that runs the patch, not adabot directly. So these commits show me as the author. I think when adabot makes commits inside of actions tasks they come from Adabot account directly though.
I will make a list of the repos with oddities.
I also just found another weird one, this PR doesn't have circuitpythonlibrarians in the list of potential reviewers to suggest https://github.com/adafruit/Adafruit_CircuitPython_MAX1704x/pull/13 Don't think I've seen that before.
I think the title of the doc is wrong CircuitPython Weekly Meeting for December 3, 2023 it should be December 4. ๐
fixed ๐ thanks