#circuitpython-dev
1 messages · Page 422 of 1
by the time you return, we will be working on CircuitPython 9 🙃
@jaunty juniper RTD ^^
hmffff that's a super useful error message
Read the Docs build information
Build id: 16910203
Project: circuitpython
Version: latest
Commit: None
Date: 2022-05-14T12:49:43.558024Z
State: finished
Success: False
versus
Read the Docs build information
Build id: 16909970
Project: circuitpython
Version: latest
Commit: 9fb4582cc881d6b45e3eebfee64308549b64df84
Date: 2022-05-14T11:39:27.431669Z
State: finished
Success: False
I don't understand, no error message, it just stops at git clean -d -f -f
that's the example:
submodules:
include:
- one
- two
recursive: true
that's what we have:
submodules:
include:
- extmod/ulab
- frozen
so it might be because "frozen" is not actually a submodule
so that means we would have to list them all manually ? >_>
Looks like you can use submodules.exclude to exclude the ones we don't want, like the broadcom firmware, but that is still tedious. can't use include and exclude at the same time
we can call a custom command too, looking at that
can you use the cross-RTD links and not fetch the submodules? Are the links that will be created here in this RTD, or are they across to the libraries RTD?
RTD calls the matrix, to list submodules the matrix needs to know what is inside the frozen modules directories. For a directory called Adafruit_CircuitPython_CircuitPlayground, the RTD is called circuitplayground (how do we know that ? is it always the same format ?), but we want adafruit_circuitplayground in the list. I don't want to do string transformations (like replace("_circuitpython_","_")) and some are not on RTD
I think the matrix script looks either for a directory (that is not examples/, etc.), or it looks for the top level .py file?
no string transforms are necessary. It determines the import name from the submodule code
it takes every .py and every directory that contains py files that is not in the exclude list
but that requires checking out the frozen directory
same algo is used for freezing
yep
that is the original motivation
so if you could do a custom command that just fetches submodules under a particular dir? or could get the info from .gitmodules
build:
os: ubuntu-20.04
tools:
python: "3"
jobs:
post_install:
- git submodule update --init --force frozen
that is simple
that's also what I expected the submodules rule to do, but it doesn't do that, nor accept globs
there's probably an issue for that 🙂
now I have a new error that seems unrelated and might just be a difference in configuration between my test repo and the core https://readthedocs.org/projects/circuitpython-neradoc/builds/16910376/
trying to parse the version name?
oh right !
i had that issue before in some way
it passes with a tag 👍
shall I test test that ? (it takes the github ref, but it's for a fetch)
jobs:
post_install:
- python tools/ci_fetch_deps.py docs main
i'm not sure what you mean
reuse the ci script that fetches the submodules, the same one that is used for the docs test action
instead of having to sync the rtd conf with it
sure, that seems straightforward, and would pick up any special casing it needs to do in the future
will be afk for a while
Dan,
Unable to reproduce problem. It looks like you fixed it.
Bruce
Closes #6399
Make Readthedocs's own build process use ci_fetch_deps.py to checkout the submodules in the same way the CI does. That doesn't make github docs CI and the RTD build use the exact same steps (which they didn't already), but submodule dependencies are now in a single place.
Note: the previous version caused an error because RTD's submodule clause requires exact submodules, it doesn't do parent directories like frozen or patterns like frozen/*.
@jaunty juniper When I merge #6400, it should build the docs, I think. It skipped the doc build in the PR build
I am not sure there is a reason to bother to let the current built go to completion, but I will, just in case.
@jaunty juniper
that's a relief
Where is the code that is responsible for the tab completion prompts in REPL? Would it be possible to add 1) the files in the root of CIRCUITPY and 2) the files / directories inside of CIRCUITPY/lib/ That way it could auto-complete import [beginning of filename][Tab]
Looks like here maybe: https://github.com/adafruit/circuitpython/blob/main/py/repl.c
Oh, nice. Thank you
didn't find it first, found the MP PR to backport the feature (which I remembered happened), the poster's name, then searched for them in the CP repo 🔎 🕵️
Note: I personally would prefer that the Serial writes would queue the data and work asynchronous. And in those case where you need to need to know that the data has completed before doing something that you would
add the uart.flush() type capability.
I have not tried any of this on the SAMD, but for example I just tried out the changes for RPI2040 that allowed the RS485 pin to be logically set. And to show why it was needed on the RP2040, here is a sketch running that sets a pin fo...
Automated website update for release 7.3.0-rc.0 by Blinka.
New boards:
- pewpew_lcd
- cytron_maker_feather_aiot_s3
- lilygo_ttgo_t-oi-plus
- zrichard_rp2.65-f
@idle owl, ran the .pre-commit-config.yaml patch on a few of the libraries and it looks excellent so far so I'm going to let it run
Sounds good!
Is there something speical about the floppy library that it's .pre-commit-config.yaml is different?
Or is it just based on an older? That's the only I don't think the patch managed to get
Otherwise, the patch is complete! The few I've checked don't seem to have any CI issues, but happy to fix any I botched 
floppy was added just recently, so it's probably not up to date
I can patch it today then! I'll also PR the cookiecutter as well so future repos will be up to date as well.
Cookiecutter is patched with the same changes!
CircuitPython version
Adafruit CircuitPython 7.2.5 on 2022-04-06; Adafruit KB2040 with rp2040
Board ID:adafruit_kb2040
Code/REPL
import board
import collections
import neopixel
import time
from digitalio import DigitalInOut, Direction, Pull
ROW_PINS = [
board.D5,
board.A0,
board.D6,
board.SCK,
board.D8,
board.MOSI,
board.D9,
board.D10,
]
COL_PINS = [
board.D2,
board.A3,
board.D3,
boar...
Could you post a schematic of your board? The definition of "row" and "column" is arbitrary, and the diode placement could be done either way. I tried to follow what I thought were typical examples. It sounds like some more documentation would be helpful.
CircuitPython version
Adafruit CircuitPython 7.3.0-rc.0 on 2022-05-15; Adafruit Matrix Portal M4 with samd51j19
Board ID:matrixportal_m4
Code/REPL
from adafruit_matrixportal.matrixportal import MatrixPortal as mp
m = mp(width=64, height=64, bit_depth=6)
# following lines are NOT needed to produce error
# error occurs with or without attached matrix
m.set_background("/bats.bmp")
while True:
continue
Behavior
Traceback (most recent cal...
One thing I noticed during the patch is that the floppy library isn't available to CircuitPython librarians, should it be or is it still WIP? I don't think I had write access.
Fixed- CircuitPython Librarians only had read access.
Thanks!
@dhalbert I didn't have a schematic handy, but hopefully I'm able to make things clearer with a bit more descriptions below.
The board I'm using is the Adafruit kb2040 (based on the rp2040). The issue was discovered using kmk, which uses keypad.KeyMatrix. In the process of troubleshooting I tested KMK code, keypad.KeyMatrix code, and then created my own matrix scanning loop. This was done in the process of isolating the issue in software after I verified that my connections were all solid,...
The intent of columns_to_anodes was whether the columns were connected to the anodes or the cathodes of the diodes, e.g. whether the diodes were flipped. But I see you could also interpret it as having the diodes on the rows rather than the columns.
Did you model your keyboard wiring on an existing schematic? Any example schematic that is wired the same way would be helpful for me to look at. Or even a picture, if it's point-to-point wiring. Thanks!
@idle owl I reverted part of the cookiecutter patch but tagged you in it.
Could the following modules be checked?
boardbusiobitbangiodigitaliopwmiodisplayiostorageneopixel_writeanalogioqriofontioterminaliomicrocontrolleraudiomp3rp2pioalarmbitmaptools
Thanks!
@tekktrik I checked the boxes and cleaned up the list a bit. If you copy/paste the list to make your own comment here in the same style. I think you'll be able to check the boxes yourself. I'll remove the list from the first post then.
@makermelissa Do you know why this might happen?
@Craigxyzzy so just
m = mp(width=64, height=64, bit_depth=6)
is enough to trigger it? Could you try some of the earlier 7.3.0 beta versions? Thanks.
https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/matrixportal_m4/en_US/
Remaining modules:
- [ ] future
- [ ] _bleio
- [ ] _eve
- [ ] _pew
- [ ] _stage
- [ ] adafruit_bus_device
- [ ] adafruit_pixelbuf
- [ ] aesio
- [ ] alarm
- [ ] analogio
- [ ] atexit
- [ ] audiobusio
- [ ] audiocore
- [ ] audioio
- [ ] audiomixer
- [ ] audiomp3
- [ ] audiopwmio
- [ ] bitbangio
- [ ] bitmaptools
- [ ] bitops
- [ ] board
- [ ] busio
- [ ] camera
- [ ] canio
- [ ] circuitpython_typing
- [ ] countio
- [ ] digitalio
- [ ]...
Maybe try decreasing the bit depth. This will reduce the number of possible colors, but also decrease memory usage. More information is available here: https://learn.adafruit.com/rgb-led-matrices-matrix-panels-with-circuitpython.
@tulip sleet replacement did same thing?
https://forums.adafruit.com/viewtopic.php?f=60&t=190755
@dhalbert yes, I understand that the variable means if anodes or cathodes are econnected to the columns.
The way I interpret it is that when that value is true, columns are essentially outputs and when scanning the columns go high. When the variable is false, the columns are inputs, and it's the rows that are driven. I.E. columns_to_anodes = True means that conventional current goes from column pins to row pins; when set to false, the conventional current goes from the row pins to the co...
Do you have one to try 7.2.5 on?
a m4sk? yes.
UF2 Bootloader v1.23.1-adafruit.1-210-g795abd2 SFHWRO
Model: Hallowing Mask M4
Board-ID: SAMD51G19A-Mask-v0
current bootloader. leave that? or update?
i am somewhat baffled. I would ask for one back, but maybe they're in Europe?
Try it with the old bootloader, then try it again after updating the bootloader
Adafruit CircuitPython 7.2.5 on 2022-04-06; Adafruit Monster M4SK with samd51j19
>>> import os
>>> os.listdir()
['.fseventsd', '.metadata_never_index', '.Trashes', 'lib', 'boot_out.txt', 'System Volume Information', 'config.eye', 'hazel', 'splash.bmp']
>>>
want me to erase the FS somehow? it's got stuff from whatever eye thing was last being tested on it.
yah sure, to get initial conditions
use the REPL erase_filesystem() method?
that's fine
Adafruit CircuitPython 7.2.5 on 2022-04-06; Adafruit Monster M4SK with samd51j19
>>> import os
>>> os.listdir()
['.fseventsd', '.metadata_never_index', '.Trashes', 'code.py', 'lib', 'boot_out.txt']
>>>
seems fine? that's with older bootloader.
next step is try bootloader update?
yes, as the poster did, same version
UF2 Bootloader v3.14.0 SFHWRO
Model: Hallowing Mask M4
Board-ID: SAMD51G19A-Mask-v0
Adafruit CircuitPython 7.2.5 on 2022-04-06; Adafruit Monster M4SK with samd51j19
>>> import os
>>> os.listdir()
['.fseventsd', '.metadata_never_index', '.Trashes', 'code.py', 'lib', 'boot_out.txt']
>>>
works
in general, it seems like something they are doing. very doubtful a hardware failure would happen on two copies, and also after initially working fine upon arrival.
but no idea what they might be doing. their description all seems fine.
any chance it's some as-yet-unknown OS or 3rd party software thing?
it seems unlikely. The "You are in safe mode because:
CIRCUITPY drive could not be found or created." messages really has nothing to do with USB.
marginal power?
That is an indicator the startup code could not mount or reformat the CIRCUITPY drive. ... maybe ... I have a couple of Macs I could try this on after the meetings
if they could try both boards on some other computer... I'm not sure if they said they had access to non-Macs or not
we have an internal CPy meeting in a few minutes, then the regular weekly meeting
<@&356864093652516868> The weekly meeting will occur here on Discord in about 1 hour. You can fill in notes ahead of time in the shared document: https://docs.google.com/document/d/1fc8UvMSBTq0x2Sh94_R6pSRm1v81sZCWA4L7TwsFzfg/edit?usp=sharing Looking forward to seeing you there.
CircuitPython Weekly for May 16, 2022 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 ...
also that thread contains a post from lm2425 who says they have the same trouble, also purchased from Pi Hut, so I am wondering about a bad batch
worth following up with them as well
maybe we can get an Arduino program to identify the flash chip that's on the board, see if it's the right one (and if it responds in Arduino)
I am also experiencing this problem on CircuitPython 7.2.5 on the nRF52840.
If I stop advertising while scanning, it works.
So this (pseudocode) works, in a loop
while True:
ble.stop_advertising()
ble.start_scan(...)
# do whatever with the scan results
ble.stop_scan()
ble.start_advertising(...)
lm245's thread is here:
https://forums.adafruit.com/viewtopic.php?f=60&t=190755
claiming same thing happens on mac and win...but win8 😦
I don't have issues with my monster m4sk on my intel mac mini
updated the bootloader with the UF2, installed 7.2.5
i'm still leaning toward hw issue
ok. yah. guess still possible. i think worth raising issue. ill do that and cc you.
@tulip sleet the test UF2 does show some SPI flash info
i'll check that id # later
do you see that same ID wit hthe test program? That's the ID from the user photo
is there a picture of the chip?
nope. just front of board.
i get 0xC84017
@lone axle I'm adding the EMC2101 thing to In The Weeds under my name but feel free to edit/add to it.
Thank you.
Ok, got it. Good catch.
@tulip sleet, @slender iron Is one of you up for reading the core status section during the meeting today?
I'm around and happy to
Before I go down the rabbit hole - decorators also work for classes in CPY, right?
I've seen them for functions and methods but can't recall for classes
@lone axle cater JEDEC ID is two nibbles mfr id, two nibbles chip id, one nibble type, and one nibble capacity, so the last 7 says it's the right capacity
it looks like they have a different chip than the one CP is configured for
Like @ at sign decorator? I think I've only ever seen them used with functions. Mostly @property is the one I've seen.
matrixportal include support for all these:
EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C"
Yeah exactly, I guess I can test it out real fast here
Monster Mask only has GD25Q64C, EF4017 is W25Q64FVSIG
oops i was looking at matrixportal -- I'm mixing up issues
EXTERNAL_FLASH_DEVICES = GD25Q64C
I can post a build with EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64FV"
ok that's not good. @tidal kiln I will make a build supporting the other chip as well, and we can have them try it
we crossed, sure, go ahead, post it in that thread
I think that's the right value
should be derivable from https://github.com/adafruit/nvm.toml
It does work with classes, cool!
def add_wacky(cls):
def wrap_add_wacky(cls):
cls.wacky = lambda x: print("Wacky!")
return cls
return wrap_add_wacky(cls)
@add_wacky
class TestClass:
def __init__(self, a):
self.a = a
inst = TestClass("haha")
inst.wacky()
A totally useful example of course
@jaunty juniper it might be W25Q64JVxQ instead, that's much more common with our boards
@lone axle We'll be right there. Finishing up a meeting.
I'll put a few, and ask for a picture of the chip too
PyCon US 2022 Highlights: https://ehmatthes.com/blog/pycon_2022_highlights/
It’s been three years since any of us have been able to attend PyCon in person. I had mixed feelings about attending this year because despite what most of us are being told officially, Covid isn’t over.
Micro:bit Educational Foundation feedback: https://form.jotform.com/221313264750346
Pico Dual Circle Displays: https://twitter.com/todbot/status/1524482667919552513
"I'm not Hello World, you're Hello World!"
Two GC9A01 round TFT LCDs being driven by CircuitPython on a Raspberry Pi Pico, battery powered with an Adafruit QT Py BFF
136
Smart Cooler monitor using CPX and CircuitPython: https://blog.adafruit.com/2022/05/16/smart-cooler-monitor-using-circuit-playground-express/
@timid lintel Very cool, nice work!
You can read it, sorry only can half listen at the moment
Yay Liz & Paul!
hmm, it really shouldnt matter? all diode matrices wire the same way.... didya try maybe swapping cols/rows passed in?
Good luck pursuing the slightly revised new chapter @solar whale. Have always enjoyed your expertise, insights, and humor. Great laugh, BTW.
@solar whale bummer. you're a great help and contributor here. will be missed. enjoy the change of focus. thanks for all the fish!
Thanks so much!
Thanks!
oh, and if you know of a remote file editing protocol that is used in phone apps then let me know. maybe we want circuitpython to do the same
This came up during the Sprints as well.
I think the only thing @tulip sleet had mentioned in one of my PRs was grouping doc things in the core if possible to save CI runs.
I know use of Protocol is also pinned to 3.7
Oh I didn't realize, cool!
i think!
example of the 30 files https://github.com/adafruit/circuitpython/compare/main...TG-Techie:maybe_precommit_error
Nope, you're right Dan!
pre-commit also works to run it manually. We stumbled onto that during the Sprints.
@ladyada, I did swap cols<->rows. If I swap those (and also change the columns_to_anodes accordingly) the buggy behavior goes away.
The problem I'm trying to solve is that (to me) it seems like the code does not work if the output pins of the matrix are passed in as columns. The code appears to not be symmetrical, even though the documentation seems to indicate that it's a supported case.
I wrote my own python matrix scanner, and don't see the buggy behavior either.
I think if the ...
Some protocols live in here: https://github.com/adafruit/Adafruit_CircuitPython_Typing
It's the weird reason you can have failed import and still not fail on type annotations for CircuitPython, that took me a minute to wrap my head around haha
Thank you for your website and products. I'm a happy user with an enhancement request: Add a 'PyPortal' category to learn.adafruit.com, to ensure PyPortal products are &...
This page ends up being functional pretty similar to the "category" page it seems: https://learn.adafruit.com/products/4116/guides
imho it's important it shows up in all existing PyPortal learn guides
@marble hornet hmm, it might be true that MicroPython does not support annotations with square brackets. Would need to test. We do use Protocols, but as subclasses, e.g. in adafruit_requests:
lass CommonCircuitPythonSocketType(CommonSocketType, Protocol):
thanks @idle owl that would be great
@marble hornet: this works:
>>> def f(x: Protocol):
... pass
...
...
...
>>> def f(x: Protocol[True]):
... pass
in CircuitPython
even if it didn't, you could always use string annotations, since that defers evaluation of what is inside the tstring
I think that's it!
the from __future__ import annotations I added does not actually do anything at all; it is a no-op. I simply made it possible to add that statement without it causing an error
I don't think string annotations work in class base lists?
class Foo(Protocol[T]):pass # doesn't work on circuitpython
# or
class Bar("Protocol[T]"):pass # Errors on cpython and CP
# etc
It's more of a warning if anything as well, for some of them
i see, that was not a case I thought of
Thanks y'all!
If we want to support that syntax, I think there are two-ish (and a half) possible ways to do it?
Is there a reason you would need to use strings?
Enough for a PR?
Is it something other than something not being defined yet?
what does it do to inherit from a protocol in python ??
I think so, b/c the circuitpython_typing library is only used on cpython right?
Its how you normally use, it's what makes a usable typing Protocol
@lone axle please email when the newsletter PR is in. Thanks!
Will do.
You can just define all the methods and attributes in that definition
but you don't need to inherit, a Protocol declares in a type annotation what attributes you expect
Basically - since CPY will discard type annotations, only Blinka platforms get angry if type annotations aren't real and defined
@marble hornet can you point to an example of using generic Protocol inheritance
Python Enhancement Proposals (PEPs)
I'm going to drop and start getting the video and notes uploaded. Thanks all.
ah generic types
thank you
@lone axle did you say you were gonna respond on the EMC2101 PR?
we solve that by putting the protocols in a module that is guarded by try: import typing
Yep, I will here in a bit. Need to wrap up the post meeting tasks and will be taking a short walk soon. It's top on my list when I get back into it after that.
so your issue is that you want to put implementation in the class Something(Protocol) to inherit from ?
@jaunty juniper we are discussing this in the audio chat
I will say, what would be nice about getting away from try/except, is that my type checker will always say that something either what it is, or Unbound because it recognizes that the import could fail
@tulip sleet @jaunty juniper cool. looks like general source of issue has been found:
https://forums.adafruit.com/viewtopic.php?f=60&t=190755&start=30#p925222
just need to formalize a solution based on getting info on what chips got used
ok, sorry I shouldn't get into it, typing in python is not my battle
right! I think we're coming from the same place.
I'll make a PR to discuss it
And/or if you have input and wanna chat I'm around a lot this week
Yeah definitely, though my input is gonna probably more about things like that since I'm core-ignorant haha
Honestly just having the TYPE_CHECKING or something that will get VS Code to stop being so mad and (fairly) calling everything Union[X, Unbound] would be neato hahaha
@jaunty juniper your MONSTER M4SK fix works! If you do a PR I could do a quick release. Which chip did you add that worked?
but I also want to investigate the MatrixPortal memory issue, so i would probably wait for that
to make sure there isn't a fix needed for that as well
I blindly put all the chips that match 64 Mb winbond, they should know what they put on the boards at the fab though !
EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ,W25Q64JVxM,W25Q64FV"
i have an inquiry in for that, and I think I can look at the factory fab stuff too to find out
according to the work orders, it is either Gigadevice GD25Q64CSIGR; or Winbond W25Q64JVSSIQ
that makes sense to me, that is a completely typical substitution, and those are the two parts we often use for this
what is the cost of adding flash types ?
uses up internal flash space
could there be other boards that have had/could have that substitution that we could anticipate ?
2+ displays really isn't supported so I'm not sure what could be the issue. The next step I'd take is to use a JLink on the RP2040 to determine the backtrace of where it hangs. On the S3 you could do a debug build and see what backtrace is output to the UART.
look for any other boards that have only GD25Q64C or GD25Q16C
and not the W25Q
we have a lot with GD25Q16C only, I don't think we are substituting those
ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk
10:EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ, GD25Q64C"
ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk
10:EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ, GD25Q64C"
ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk
10:EXTERNAL_FLASH_DEVICES = GD25Q64C
ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk
10:EXTERNAL_FLASH_DEVICES = GD25Q64C
ports/atmel-samd/boards/pygamer/mpconfigboard.mk
10:EXTERNAL_FLASH_DEVICES = GD25Q64C
ports/atmel-samd/boards/pyportal/mpconfigboard.mk
10:EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ, GD25Q64C"
ports/atmel-samd/boards/pyportal_titano/mpconfigboard.mk
10:EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ, GD25Q64C"
ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk
10:EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ, GD25Q64C"
ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.mk
9:EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ"
removed non-adafruit boards, so add to hallowing_m4, monster_m4sk, and pygamer
Monster M4sks are in the wild with W25Q64JVSSIQ flash chips.
Anticipate other similar substitutions on a couple of boards just in case.
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/1koPkyRaRg548N7dqxa-ymx8nybmd6kUSXxO-g8ZQDaw/edit?usp=sharing
CircuitPython Weekly for May 23rd 2022 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 participate, ...
@idle owl it looks like the pre-commit upgrade of reuse broke some CIs
due to an unused license
Ok. I'll look into it. I've had to add license types before.
m=mp(width=64,height=64,bit_depth=1) works 730b0
m=mp(width=64,height=64,bit_depth=1) works 730b1
m=mp(width=64,height=64,bit_depth=1) works 730b2
m=mp(width=64,height=64,bit_depth=1) works 730rc0
m=mp(width=64,height=64,bit_depth=2) fails 730b0
m=mp(width=64,height=64,bit_depth=2) fails 730b1
m=mp(width=64,height=64,bit_depth=2) fails 730b2
m=mp(width=64,height=64,bit_depth=2) fails 730rc0
image looks improper on 64x64 matrix:
m=mp(width=32,height=32,bit_depth=1) works 730rc0
m...
@proven garnet Hiya! So we broke some CI. Apparently you can no longer have unused licenses in a repository, or that's what it looks like from the one linked above. I deleted the unused license from the LICENSES directory, and it passed. Is there a reasonable way to sort out what's not passing, and see if it's Reuse-update related?
@proven garnet In related news, the Library Infrastructure checks are failing on "incorrect pre-commit version/reuse version", meaning we need to update the version Adabot is checking for.
Ooh looks like Eva did it.
N. m. hehe.
😅, your not alone in having that same issue.
Yikes. Yeah, a bit_depth of 2 is very low and shouldn't be failing.
@tulip sleet @jaunty juniper worth opening a new issue for the qspi thing? for sake of tracking (not seeing one)
actually. maybe the PR is good enough. just want to give forums a link to keep an eye on.
PR is fine, I think.
@tulip sleet Ok, so this guide page.... Is meant to explain the difference between .mpy, .py and frozen libraries. I have a snippet of one of the conversations that came out of me asking about it here, and it gets into why .py files take up more memory than .mpy files, e.g. explaining exactly what memory is being used (compiling, and then the resulting bytecode which must be stored in memory during and after the compilation).
Is this getting too much in the weeds for this guide page? Or do you think it's worth including.
It would allow me to differentiate between the mpy and py memory usage, but maybe it's too much.
I'm trying to make sure this also answers a lot of questions we get. Because we do get a lot of questions about this topic.
People ask all the time for the explanation, so I don't think it's too much. import of an .mpy loads the compiled code, import of a .py must compile the code. In both cases the compiled code lives in RAM, and the resulting compiled code is basically the same size in either case. But the compilation takes extra RAM temporarily during the compilation, and if there's not enough RAM available, it will fail. Compilation may also cause some fragmentation, but we are mostly able to avoid that.
I am probably just repeating what you said in the guide
Not yet, I didn't. That's a great wording.
Thank you!
I'm definitely going to pass this by you before putting it in moderation.
you can bring a pre-made cake to someone's house, or you can make it at their house. Either case, the final cake is the same size. But if you make it their house, you need space and resources temporarily to make it.
not sure that's a great analogy
This looks great. Could you change the base for this PR to the 7.3.x branch? Thanks.
If you swap the rows and columns, the key matrix is electrically the same as if you just flipped all the diodes to the opposite direction. There is nothing that the code could do to recognize the difference (and work in one case while not working in the other), both cases are electrically identical. It would really help to see the schematic of your matrix.
Also, what does it mean the code "does not work"? Do you get an error message? Do wrong keys register? No key presses register at all? ...
Well that's frustrating, but hooray! We found the botch! 
Let me check out gh CLI...
Could you post a link to the kit, and if they would help, photos of the board(s)?
The interval you are using is 0.2 secs or 200 msecs. That is a very long scanning time. 0.02 is the default. The errors you are seeing are:
expected keystrokes are sent, but also undesired keystrokes are sent. The undesired keystrokes are always on the same column next row over.
The code is just looking for a completed circuit between a row and a column pin, It could do that in either direction. I'm not sure why it should matter which is the input and which is the output.
Are the...
Okay I thiiiiiiiink I can get a list together of the libraries that the patch failed for using gh
@idle owl
Thanks!
I tested a few variations of changing objects while the group they belong to was hidden. Here is the base test script:
import time
import displayio
import terminalio
import vectorio
from adafruit_display_text.bitmap_label import Label
import board
display = board.DISPLAY
display.auto_refresh = False
main_group = displayio.Group()
palette = displayio.Palette(1)
palette[0] = 0x125690
circle = vectorio.Circle(pixel_shader=palette, radius=25, x=70, y=40)
main_group.a...
I am not saying you haven't detected a problem. But the lack of symmetry in the code is deliberate: I compensated by reversing the detection direction. It was smaller this way.
I think this is ready now. I've tested several more scenarios around it and everything has worked as expected so far.
Am interested in getting clarification from @WarriorOfWire about what possible issues may still exist as well as feedback from anyone else.
@idle owl @slender iron Wrote a script to find the latest CI triggered by me in the main branch across all the libraries (should be the patch). The only one that was flagged was the AzureIoT, but I am pretty confident it worked because it found another failure, though it's cause wasn't that, which I submitted a PR for: https://github.com/adafruit/Adafruit_CircuitPython_ESP_ATcontrol/pull/57
So I think that was the only one. Happy to share the script if anyone wants to check
Thank you, @proven garnet!
No worries! Glad it wasn't any larger of a problem!
I made a small 2x2 test setup of four https://www.adafruit.com/product/4978, NeoKey breakout. On these boards, the A connection is the anode, and the C connection is the cathode. Here is the schematic. I only used the SWITCHA and SWITCHC pins.

I wired the SWITCHAs together as thecolumns, and the SWITCHCs together as the rows. I believe this corresponds exactly to y...
I tried the code on a different matrix that is wired in the same manner that I know to work, and the undesired behavior is not present.
@dhalbert thank you for looking into this and for putting time into attempting to replicate the problem. I think that by having the same piece of code work on the known-good matrix, I can safely assume that the code for which I opened this github issue is not the culprit.
To answer your previous question, there are no capacitors on the board.
I manag...
Thank you for your troubleshooting patience. If you figure out what is different about that board, let us know. I wondered if perhaps one of the diodes was backwards or shorted, but I'm not sure that would cause the problems you saw.
is there any guidance on building cirPy on windows? or is this a nix/mac only ballgame unless I want to do some digging
the Buiding Circuitpython guide uses WSL on windows
yeah fair enough. WSL breaks my existing VM stack which is kind of fun so I was hoping I wouldn't have to deal with that whole affair
oh well nbd
to that end- are there docs on making board configurations? Or just infer from existing
ah, this is useful in it's own way- I was on https://docs.circuitpython.org/
there is, but I think it needs slight updating ? Just copy from an existing one that's similar enough, there's not much more to it, we'll help you if there's something missing
https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython
I've got a little sparkfun esp32s2 which is pretty similar to the adafruit feather so it shouldn't be much work
which one ?
esp32-s2 thing plus
oh yeah that should be rather simple
The “cleanup” I’m talking about is the “dirty area” left behind when a displayio object has changed location. It’s tracked by the “dirty area” and ends up going through a draw on the next frame. The object is supposed to not draw areas that it is no longer interested in, which leaves the bit flag byte array region covering those areas as 0 which means “this shape didn’t set those pixels’ values.”
I might be misremembering the lifecycle here in group - it has been a while!
The thing I’...
A friend of mine had a similar problem, and we got it down to the diodes he used — instead of fast signal diodes like the 1N4148, he used some random rectifier diodes, that turned out to be too slow to switch properly during scanning. Replacing them with signal diodes fixed the problem.
If you have a working VM setup, could you just create another VM instance and load Ubuntu on it? No need for WSL in that case.
Refactor community call for what is wanted and needed in CircuitPython into one line with a link for each year. Add 2021 and 2022 to awesome-list.
Yep, that's what's going on lol
@deshipu That could be the case, I'm going to try changing the diodes to a known part. This may align with the fact that I have the same kit, working properly with a Pro-Micro, but that one works at 16MHz rather than 120MHz, which may also align with the loop/transposition workaround.
When you mentioned that the circuits transposed were electrically the same, I recognized that it was the same intuition I had when trying it, the difference is in running the code, the issue with multiple key...
Should fontio.FontProtocol be moved to circuitpython_typing? It needs the Glyph class defined, and I don't know if it makes sense to effectively have to mirror that in the other library in case it changes.
It just means right now one Protocol needs the stubs while type annotating
@proven garnet Grabbing a couple of documents, but otherwise I'm ready when you are.
Sweet! Be right there
The stack size on ESP32-xx may be too small. This code gets a stack overflow on an ESP32-S2 board running 7.2.5
>>> import re
>>> _REQUEST_RE = re.compile(r"(\S+)\s+(\S+)\s")
>>> _REQUEST_RE.match("GET /" + ("a" * 135) + " whatev")
Traceback (most recent call last):
File "", line 1, in
RuntimeError: maximum recursion depth exceeded
>>> _REQUEST_RE.match("GET /" + ("a" * 134) + " whatev")
(originally noted in https://github.com/adafruit/Adafruit_CircuitPython_HTTPServe...
Just a thought....
I routinely compile custom images with MICROPY_ENABLE_PYSTACK turned off and MICROPY_STACKESS turned on. I don't know what I'm trading off with these settings but I've been assuming I've just been making the garbage collector's job harder and reducing the amount of memory I'm able to allocate in my applications.
If the advantage of using the stacks is to keep larger chunks of contiguous memory available, I wonder if they are still necessary on the new multi megabyte m...
This is failing really early, due to Protomatter (used by RGBMatrix) being unable to allocate a large enough chunk. It's not due to the libraries. Still investigating.
@tulip sleet I decided to make your cake analogy work because I felt like you mostly had it on point, but it needed a little more content to really work. Or, I wrote something terrible that should be deleted. 😆 You can bring a ready-to-eat cake to your friend's house, or you can show up with the plan to bake the same cake at your friend's house. Both completed cakes will take up the same amount of space. However, waiting to bake the cake means you'll need more space and resources before the cake is ready to eat, to combine the ingredients, bake it, and frost it. If it turns out your friend doesn't have the space available, or is missing a crucial ingredient, you wouldn't be able to complete the cake. Basically, if you're unsure whether you'll have everything needed to bake a cake at your friend's house, it's better to show up with a completed cake to ensure there is cake to be had!
I figured this was in the correct place. The libraries are only a wrapper for helping to initialize it.
Other than import order sometimes mattering, and dealing with memory allocation, what other "issues" can one run into with CircuitPython libraries? This is something that would be generalisable to all libraries, not something involving a specific library.
memory fragmentation?
loading the wrong library, because you have a leftover .py file lying around? (they take precedence)
Oooooooh yes. Definitely.
naming your test code the same as the library you want to test (for example "neopixel") and wondering why when you import it, it doesn't have all the things it was supposed to have, only your code
Excellent
shadowing the built-in libraries in general
especially when some 3rd party library uses it, and not you yourself
shadowing?
if you have neopixel.py it will get loaded instead of the built-in neopixel
ahh right right ok
not sure if this is relevant here, there is one common mistake with the library API, when people read what parameters a function takes, and then pass them as positional parameters, but don't realize some of the are keyword-only parameters, and then they get a confusing error saying that they provided a wrong number of parameters
or a directory, which is seen as a package module
like don't put all your neopixel scripts and files in a neopixel/ folder
Oh like foo(10, 12, True) when it's supposed to be foo(x=10, y=12, position=True)?
@idle owl yup
This is a good one too.
Yah that might be a little too in the weeds for this page.
Got it on the list
maybe it would be good to mention that modules are only ever imported once, even if you import them in multiple files or many places, the subsequent imports simply do nothing and give you the already imported library
Oh, fair enough. I always thought it caused issues to do that. Didn't realise it was a non-issue.
some people might expect it would re-load the library
Agreed
for instance, in the repl, you can import your code to test it, but a second import won't run it anymore
you can also exploit it to set a global on an imported library in one file, and read it in another :P
which is how you can get the correct keyboard layout in macropad hotkeys
(using a module global variable in the macros scripts to share the Keycode instance)
seems like fun!
So my "Memory Fragmentation" section contains the following. Is there more to be added / a better way to explain it? A memory allocation failure does not necessarily mean you are entirely out of memory. It specifically means that there is not a single large enough chunk of memory to import a library of the given size. CircuitPython memory can become fragmented the more you do, and have smaller chunks of memory available across the entire heap, but not a single chunk big enough to complete a particular task.
Comes right after the "Memory Allocation" section. So that's not an oblique reference it starts with.
If this is in the context of import, yes. Fragmentation can block allocation of any chunk of memory that needs to be contiguous, such as a large buffer.
"It specifically means" in the case of import
Ah, ok. I guess, I want it to be in the context of everything? I'm not sure how to explain it beyond what I posted.
Or at least in the full context of libraries
Does that limit the scope to import at that point? Or are there further bits involving the library files etc.
"It specifically means that there is not a single large enough chunk of memory" to allocate the chunk requested. In the case of importing a .mpy file, the library is imported into a single chunk`. In the case of importing a .py file, you could run out of memory because more RAM than you have available is needed for compilation. In that case, the chunk needed is not necessarily large.
so there is that optimization thing, that once a module is finished importing, it's moved to the end of available memory, because it's unlikely to be ever freed — and this decreases fragmentation
but I'm not sure we want to got that deep about this
so in the kitchen example, you have run out of counterspace, or whatever. It's not that you necessarily need a huge chunk of counterspace all at once, but you keep using up sections of counterspace until there's none left. "I can't find anywhere to put the sugar down!"
Nice ok
i'm not sure the kitchen analogy is going to be that helpful in detail, maybe, maybe not
"there is no way I can make a cake in this closet"
I feel like maybe not. I probably won't extend the reference beyond earlier usage.
once you finish with one part of the cake, you clean up all the utensils you used to make it, and move the finished part to the end of the counter, to make room for the next step
OK here's what I have now: ```A memory allocation failure does not necessarily mean you are entirely out of memory. CircuitPython memory can become fragmented the more you do, and have smaller chunks of memory available across the entire heap that add up to the amount needed, but not a single chunk big enough to complete a particular task. Fragmentation can block allocation of any chunk of memory that needs to be contiguous, such as a large buffer. In the context of importing a library file, it specifically means that there is not a single large enough chunk of memory to allocate the memory requested.
In the case of importing a .mpy file, the compiled bytecode is imported in a single chunk. In the case of importing a .py file, the size of the chunk needed for compilation may exceed the size of the chunks available, in which case, you would run out of memory before there is even any bytecode to import.
CircuitPython does do some optimisation to avoid memory fragmentation. Once a library is imported successfully, it is moved to the end of the available memory, which decreases fragmentation. Some fragmentation is unavoidable over time, but the import optimisation definitely helps with avoiding as much initially.```
you don't need a single large chunk for compilation necessarily. You might need a lot of smaller chunks, which get used, and then discarded. So the "large chunk" is more for .mpy than .py.
I'm actually not even sure that .mpy needs a single large chunk, though I thought so . @slender iron could verify
Ok thanks for the clarification
I don't think mpy needs a large chunk either. strings and functions will take linear space
what about the AST representation and so on? I don't even know if micropython has an intermediate representation...
I don't think it does... but I'm not sure
so, the dotenv library handles errors weirdly by logging and changing part of the return value: https://github.com/theskumar/python-dotenv/blob/master/src/dotenv/main.py#L208=
should I throw an exception, return the same weird tuple or just silently fail?
is this so it won't fail catastrophically if your .env is messed up?
I'm not sure why they do it that way
so if for instance the password key does not exist, but you need it, it will return "SORRY, NO PASSWORD" or equivalent for the value?
are there issues about it?
the most common is probably trying to write a read-only file
printing isn't really a solution
no, not at all. It doesn't seem to be a high priority to fail more obviously in a non-interactive environment
ya
@slender iron If you search for "strict" in the closed issues, there is some idea it might be more stritc, but stuff like this got closed without being added: https://github.com/theskumar/python-dotenv/pull/263
so they return a tuple on error, but a string otherwise?
if not os.path.exists(dotenv_path):
logger.warning("Can't delete from %s - it doesn't exist.", dotenv_path)
return None, key_to_unset
removed = False
with rewrite(dotenv_path, encoding=encoding) as (source, dest):
for mapping in with_warn_for_invalid_lines(parse_stream(source)):
if mapping.key == key_to_unset:
removed = True
else:
dest.write(mapping.original.string)
if not removed:
logger.warning("Key %s not removed from %s - key doesn't exist.", key_to_unset, dotenv_path)
return None, key_to_unset
return removed, key_to_unset
It is never going to return False, key_to_unset because the if not removed: will catch both None and False
ya...
🤷
I'll just return None
i have something else to talk to you about: more fragmentation after 1.18 merge, I think
np
I tried this out and tweaked it a bit to match the Titano display size.
https://user-images.githubusercontent.com/2406189/168932620-c4ccb417-963f-4703-90c3-6f5eae2f10ce.mp4
It's behavior seems normal / expected to me. It's quite "flashy" because of the short sleeps and being made hidden / visible but I think that is expected with this code.
The camera feed / streamed recording it came from has glitch some during the video but the display itself doesn't have the same pause glitch in...
It appears that there is more fragmentation starting in 7.3.0 than in 7.2.x. It is not clear why, but we started 7.3.0 immediately with the MicroPython 1.18 merge, and a build of the PR merge commit shows the problem.
Well I just tried your example code on a Feather S2 and a DevKit S3 using my CircuitPython images with the stacks turned off and they both failed. The Feather returned the recursion depth error and the DevKit crashed into safe mode.
It would appear turning off the stacks isn't going to help with this error.
There is still a C stack that's running and is presumably used by the C-based re code. It think it may be that stack that is not big enough.
Okay, cool! This looks perfect; seems like I’m misremembering. If it was as I thought I remembered then the problem would be plain to see with this tester. Thank you kindly for humoring my uncertainty.
This looks great to me. Thank you for sticking with this change!
@dsohrabian We would be quite interested in the simplest example program you have that seems to cause trouble, including your descriptions of what is returned from the requests. 5kB reponses might eventually lead to memory fragmentation, depending on how you hang on to the results. But there also might be bugs in the ESP32 firmware.
After testing, I believe that the hanging issue happens when I import adafruit_matrixportal Matrix object. I have commented out the whole board object in my ...
so I built circuitpython for the sparkfun ESP32S2 thing board
except it's spamming invalid header 0xfffffff out the whahoozie with this bit of text every second or so
steps taken:
clone the esp32s2 feather board configuration and modify the board name in mpconfigboard.h/k
make board=sparkfun_thing_plus_esp32s2 (the new folder)
sudo esptool.py --port /dev/ttyUSB0 erase_flash
sudo python3 esptool.py --port /dev/ttyUSB0 --chip esp32s2 write-flash -z 0x1000 ../circuitpython/ports/espressif/build-sparkfun_esp32s2_thing_plus/firmware.bin
which are the steps listed on the micropython site which I perhaps mistakenly assumed would translate here
aaand I've just noticed that the feather is not the s2-wroom which is probably what's causing this :bleh:
heya folks! It's not really CircuitPython related (except that I'm CircuitPython related!) but I'll be sharing a few photos during this trip. https://photos.app.goo.gl/u2c52WapAATLQ65u6 including the smallest elevator I've ever been in. I am having a great time but I miss y'all.
doesn't appear to have been it, used the saola_1_wroom configuration to the exact same issue
so it was something to do with the offset... writing to 0 instead of 0x1000 fixed that part
I suppose reading that in the output of the build would have helped because it says the start addr right there
but now the UART port outputs naught but ESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT) Saved PC:0x4002c15e SPIWP:0xee mode:DIO, clock div:2 load:0x3ffe6100,len:0x1368 load:0x4004c000,len:0xa4c load:0x40050000,len:0x2d60 entry 0x4004c1f8
which I'm pretty sure isn't what it should be outputting
here's what I get on the debug output on the FeatherS2, followed by a few more lines in green as ESP-IDF boots I assume
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:2
load:0x3ffe6100,len:0x1368
load:0x4004c000,len:0xa4c
load:0x40050000,len:0x2d60
entry 0x4004c1f8
~~that's what comes after:
I (79) spi_flash: detected chip: winbond
I (79) spi_flash: flash io: qio
I (80) cpu_start: Starting scheduler on PRO CPU.
I (82) gpio: GPIO[21]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
```~~
[wait no, I had not erased first, the green lines come from tinyuf2]
it looks like it's just bootlooping I think
because it's just dumping that text above in a loop
ah
RTC_SW_CPU_RST
hm
maybe it thinks the RST pin is held down?
or something?
that should just be... directly wired though right?
and even then...
I hadn't 😄 😇
ok yeah so it's definitely bootlooping
observationally the feather appears to just interrupt the power for reset if I read the schematic right which I'm probably not?

I think I'm probably onto something now because flashing the espressif_saola_1_wroom board boots to SP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT) SPIWP:0xee mode:DIO, clock div:2 load:0x3ffe6100,len:0x1368 load:0x4004c000,len:0xa4c load:0x40050000,len:0x2d60 entry 0x4004c1f8
and doesn't bootloop
it doesn't give a console or anything like I think it's supposed to but
it is my understanding that the reset pin on the ESP is actually the enable pin
so there is no hardware "reset", only power on
makes sense
but with the saola board firmware we're finally somewhere
whoops I already posted that
which I believe is the reasons it needs an external circuit to allow double-click reset to be detected (as the memory is wiped on poweron)
interesting
so should I expect a cirpy console on uart or do I need to get the native usb pins out (which luckily is just a trace cut+jumper to solder)
you would need the USB, unless setup for repl on debug uart
gotya
what does one need to do to setup repl on debug uart
lemme check
I believe you would need these in mpconfigboard.h:
#define DEBUG_UART_RX (&pin_GPIO16)
#define DEBUG_UART_TX (&pin_GPIO5)
with the right pins
👍 thanks
or maybe that's just the debug output ?
unthank
is that just a pin definition as above or
yes
rethank
alright well that was a fun little adventure but it looks like I'm pretty much set
@dhalbert As @anecdata @jepler mention, I think the hang/freeze is coming from MatrixPortal library.
This import from my code above seems to be the only common thread from prior discussion here and similar symptom of hanging.
from adafruit_matrixportal.matrix import Matrix
I don't know if the repeating post/get requests that are happening in main loop on code.py are coincidental or not.
@tannewt I have not followed this. Do you want to review before merging?
@dahanzimin Are you still awaiting the USB PID from Espressif, or is the one in the commit what you got?
@s-ol I have not forgotten this, but am deferring it until after I finish working on 7.3.0 final.
@slender iron the fragmentation problem looks like it's straightforward. The usual automatic gc_collect() after an import was removed in the v1.18 merge, so restoring that should fix things. py/builtinimport.c was very much reworked in v1.18
np, bugs are to fix
Should I program all the Lilygo boards ?
just dropping by 👋
yes no no yes yes yes no no yes no ?
Nice find @tulip sleet ! Interesting it makes that much impact
@warm flame we're happy to support more boards (we treat it as a metric or at least a cause for celebration, since we just passed 300), so if you have the boards for testing why not!
not yet, but I am looking to buy some of them. I like the ones with battery packs on them
It's probably wise to only add support for a board you have in hand
note that we don't do suffix-less ESP32 (yet) which I think is most of their boards
It would be nice to have support for copy.deepcopy (or some alternative) on circuitpython. I'm relatively new to circuitpython myself so maybe there is already a simple way to include the copy module when compiling circuitpython and I don't know about it. A cursory look shows the copy module relies on the types module which is also not included.
There is a version here, written for MicroPython, which would probably work:
https://github.com/micropython/micropython-lib/blob/master/python-stdlib/copy/copy.py
-
Fixes #6402.
-
The automatic garbage collection done after an
importgot lost in the MicroPython v1.18 merge, which rewrote the import code extensively. Restore it. This reduces heap fragmentation, which can make prevent allocating big buffers after significant imports. -
Improved error message for
RGBMatrixbeing unable to allocate buffers. Previously, it just threw a blankMemoryError.
@jaunty juniper I'm back poking at this situation- do you know what common_hal_never_reset_pin is about? I've found it adds pins to a mapping used somewhere, but I've really got no idea what this accomplishes
it's one of the handful of differences between the adafruit feather def and the espressif devkit
the only real others are the pins.c and reset_board turns on i2c power
actually
what calls reset_board, board_deinit etc?
One request. Thanks for finding this!
How about using https://github.com/adafruit/circuitpython/blob/main/py/runtime.c#L1595= instead. That will have a better error message without introducing a new string.
I believe main.c calls reset and deinit
hm ok
I just skimmed it and it looks good. Thanks to @WarriorOfWire for the main review.
Unfortunately I don't know the size of the buffer Protomatter was trying to allocate, so I don't have a size argument to pass. It only passes back an error code.
I see a bunch of opportunities to consolidate errror messages and reduce the number of separate messages to translate (#6392). So I'm hoping to reduce the number of messages post 7.3.0. That was the idea of making this a %q message. For example:
~/repos/circuitpython/locale$ ag "allocate" circuitpython.pot
513:msgid "Att...
@WarriorOfWire For sure, I'm happy to do additional testing for edge cases to make sure I've not broken anything. Thank you for having a look and pointing me toward the right way to get this accomplished! I probably would have gone "off the rails" for a few parts of this change without your guidance and point in the right direction. Much appreciated!
Automated website update for release 7.3.0-rc.1 by Blinka.
@tulip sleet When you're done with the release, and you have a moment, I'd appreciate some feedback on this guide page. I still need to add a couple of screenshots so it's not so wall-of-text-y, but I think the text content is ready. https://learn.adafruit.com/welcome-to-circuitpython/library-file-types?preview_token=WsdVgHQVBTr9iHLerIfyWA
@stuck elbow or @jaunty juniper if you're up for providing feedback and able to view the link above (I don't know how public the previews are), I would also appreciate it.
I am just waiting for builds; i'll take a look now!
Even better! Thanks, epic CI time!
@tulip sleet If you end up wanting to make edits, let me know so I can back out of any editing I'm doing.
Oh I need to mention somewhere that the Project Bundle will download frozen modules, but it's ok, they don't run, they simply take up disk space. And how to delete them if you run out of disk space.
I feel like the Project Bundler should be mentioned on the existing Libraries page, and then linked into the Frozen Modules section with the info about how they work together in the File Types guide page. We don't mention it anywhere in this guide, afaik.
what do you want to say about it ?
the "download bundle" buttons and how the code is organized inside the zip would be useful maybe
That it exists, how to use it, and why it makes things easier. I don't think all that needs to be on the File Types page. Put that on the CircuitPython Libraries page, and then link that section in the File Types page when I explain the situation with frozen modules and the bundler.
Good point.
@idle owl
- do you want to say how using mpy-cross makes it possible to import some libraries that couldn't even be imported in .py form on small boards, because they take too much RAM to compile on the board?
- "there is nowhere to download frozen libraries, because they are built into CircuitPython" -> ... because a frozen library is built in to in the CircuitPython build for particular boards [or equiv]. Just to emphasize they are not built in to CPy in general.
- "If there are not frozen modules" -> "If there are no frozen modules"
- bold
CIRCUITPY/on second mention - "memory" usually means RAM. Sometimes people are confused and think that because there's still room on CIRCUITPY, they should be able to import. Maybe define "memory", or use RAM (and explain the difference?)
- Title of page could be "Library File Types and Frozen Libraries", since that's a major part of the page.
Yes! Thank you. And I was unhappy with the title, but wasn't thinking about how to update it.
I really like this page; it is a really thorough and readable explanation of something we have to explain constantly
That's what I was going for 🙂
the mpy files seem pretty surface level similar to the cpy cache files
if I read it right
@tulip sleet Re: RAM vs memory. Hmm. Maybe include a note at the beginning that for the purposes... wait no. Because I'm about to add something about disk space. Which means the entire page cannot be said to be using "memory" and "RAM" interchangeably. Ok, I'll update it to RAM.
yes, they are like .pyc: the result of compiling into bytecodes
Only 44 instances of memory to update. 😖
so maybe have to define RAM vs diskspace
no global search/replace in guide pages, right?
Correct, I have to do it manually. Search in page, and change them up.
is the largest distinction that an mpy can have C code embedded?
have we enabled that in CP ? I don't think anyone has tried
I was just looking over the micropy docs and it mentioned that
.pyc get generated and saved in __pycache__. .mpy are generated manually, not automatically. Also the bytecode formats between CPython and MicroPython/CircuitPython are different
yeah I assumed the bytecode was different was just curious if that was kind of the end of it or if there was something more
upcoming version of MicroPython will allow executing bytecodes directly from .mpy files, so they don't have to be loaded into RAM, but they have to be contiguous in the filesystem, which we can't guarantee with the FAT filesystem
that's a pretty tidy improvement though
I've been playing around with nuitka at work and started wondering about it and hardware
probably generates too much boilerplate to work
Ok, yeah, I definitely need to explain the difference because I can't change "Memory Allocation" to "RAM Allocation" because the actual error is "memory allocation failed". I'll ping you in a minute here, Dan, for feedback on this. It feels a bit stilted.
will merge after builds finish
CircuitPython is unaware of disk space, right? Like it won't error when you're out of it. Only your computer will? Or editor will fail to save or whatever..?
Success with cp730rc1 - Thank You @dhalbert @tannewt @makermelissa Closing issue.
I think this can be quite bit shorter. You can just say that "memory" in this guide means RAM, random access memory, which is the read/write memory in the microcontroller. So sometimes you would just say "memory", and sometimes you would say "CIRCUITPY filesystem space". I'm not sure about "disk space", there is no disk, but it is the vernacular.
Ok thank you
CircuitPython will tell you if CIRCUITPY is full if you try to write to it from Python
CircuitPython will? In the serial console or something?
I've only ever seen popups on my machine.
The host notices if the disk is file if the host is writing to CIRCUITPY. But CIRCUITPY will throw an OSError with the ENOSPC code ("no space left on device") if you try to write to a full disk from Python
Ah ok. Huh.
so that only happens if you mount CIRCUITPY r/w, etc.
Can you take another look?
There is one section that references CIRCUITPY filesystem space, which can also be considered memory. Filesystem space is not RAM; it is where files are stored
That is better.
You could use "RAM memory" once here to make it clearer: The result is a file that is smaller and uses less RAM memory.
Yeah ok. That seems like a solid idea.
"This page refers regularly to library file memory usage, as well as to RAM usage."
these are the same thing, 'This page talks about library file memory (RAM) usage". "as well as" kinda makes one think they might be idfferent things
Exactly. It made way less sense as an intro to this section once it was shortened.
Fixed. Thank you!
I think I'm going to do some future proofing and refer to the 7.3.0 version of mpy-cross. Even though we're not stable yet.
do you want to talk about volatile vs non-volatile
aka, whether you lose data on power loss
I don't think so. This is more about libraries, the explanation of RAM is simply because I used "memory" and "RAM" interchangeably on the page.
kk
os.getenv() will use it (when available) to load variables from
/.env
This will also be useful when we need secrets or config for
CircuitPython outside of the VM (like WiFi credentials.)
Fixes #4212
Tested with .env:
key=value
key2 = value2
'key3' = 'value with spaces '
# comment
key4 = value3 # comment 2
'key5'=value4
key=value5 # overrides the first one
key 6 = value 6 # won't be found
key7 = value unquoted # will go to end?
multiline = 'hello
world
how are you?'
key8 = ' escaped \\ \' '
And code.py:
import time
# time.sleep(10)
import dotenv
keys = ["wifi_ssid", "wifi_password", "foo", "key", "key1", "key2", "key3", "key4", "key5",...
if user code does wifi.connect() should stopping the VM also stop wifi?
Or we can leave it connected and only reconnect if connect() is given a different ssid
@jaunty juniper thoughts on wifi connection lifetime?
I'm thinking I'll track if a socket is opened by the VM and close those that were
@jaunty juniper Were you able to view the guide preview I linked earlier? I wrote up the Project Bundle section on a separate page so it wasn't ever in an incomplete state on the live page. You could take a look if you like, and let me know if there's anything obvious missing or better said. Ignore the page title, it's a throwaway page. https://learn.adafruit.com/welcome-to-circuitpython/project-bundle-section-for-cp-libs-page?preview_token=WsdVgHQVBTr9iHLerIfyWA
Time for dins here. Be around later!
@dhalbert ,Thank you for your attention. I have applied for PID in Lexin ands ubmitted them PID,I don't know what else to do next, just waiting for the merger?
@大汉子民你还在等待来自Espressif的USB PID,还是在提交中的那个是你得到的?
how should I reference pin TXD0 (pin 37) in pins.c?
I also see { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, for a number of boards- how does this pull pins?
that would be IO43 ?
that's the bus pins defined in mpconfigboard.h
oh, just based off sequence
which should be the same as SDA and SCL
it should be explicit somewhere in the datasheet, some table I guess
you'd think so wouldn't you
but if it is I can't find it https://cdn.sparkfun.com/assets/b/4/8/0/c/esp32-s2-wroom_module_datasheet.pdf
yeah but this doesn't strictly list IO43 which is what I was getting caught on
it does
Unfortunatly not much pogress in https://github.com/Xinyuan-LilyGO/LILYGO-T-display-RP2040/issues/5. Still waiting for the PID.
tinyuf2 0.9.2 was released, adding the Hiibot IoTS2 files to the assets.
Thanks for the update on the USB PID.
Two comments about your custom library:
-
The usual way to do this is to keep the library in a separate repo, and add it as a submodule. This will allow you to maintain the library separately, and not depend on the
circuitpythonrepo for source control. Also it reduces the size ofcircuitpythonand minimizes the custom code in it. -
Consider whether you need to freeze the library. The reason we freeze libraries into certain firmware images ...
Note also the pre-commit failures here: https://github.com/adafruit/circuitpython/runs/6398538029?check_suite_focus=true. For some files, there is simply extraneous whitespace or a missing newline at the end of the file. For the Python files, they may be failing black or pylint in some way. If you move to your own repo and a submodule, they will not be checked (you could of course check them yourself).
@tulip sleet is that weird ESP32S2 TFT feather issue CP only? boards that have that behavior work fine with factory reset UF2?
TFT is working when "double click" switch to get loader
and after a ROM reload. Once any CircuitPython other
than 7,1.1 is loaded, the TFT is off by default.
seems CP only
it should be fixed now
just checking behavior here:
https://forums.adafruit.com/viewtopic.php?f=57&t=191289
sounds like even the bootloader screen works in those situations
forgot the bootloader did that
It sounds like it might have been fixed in 7.3.x but not in 7.2.x, so have them try the 7.3.0-rc.1
but if bootloader is dark also, that'd be something else?
they didn't say they double-clicked. They could try the factory reset. I'd start with that and see if it doesn't show.
it didn't
wait I don't remember that the ESP32-S2 TFT has a boot screen
yah. it shows UF2 splash (not sure what else to call it) when in bootloader mode.
that's the UF2 bootloader, but not the raw bootloader. If they loaded with the raw bootloader, it wouldn't show
I would have them erase the whole thing and reinstall the factory reset with UF2 bootloader. Also, the double-click is a bit tricky, have to wait for purple
the factory reset is a UF2 (well one of them), they say they tried that. that would have required getting into UF2 bootloader mode.
the original load is loading a .bin
ok, I see, two boards, one doesn't work, yes fishy
learn page has two "factory reset" options:
https://learn.adafruit.com/adafruit-esp32-s2-tft-feather/factory-reset
it is a bit unclear what they actually did
yes, I would pursue having them do exactly the same thing on both boards
I have had to full-erase at least one Feather ESP32-S2 to get it to work right
@jaunty juniper just fyi. see above. relates to a forum thread.
Addresses #6392.
To reduce firmware size, this PR uses argument validators where possible and consolidates and simplifies various error messages.
- I went through all the
mp_raisecalls, and used validators fromargcheck.cto simplify the validation. A few new validators were added, building on #4891. - Added
mp_arg_error_invalid(qstr), which raisesValueErrorwith the message"Invalid %q". This is useful many places, where there were previously more specialized but not neces...
oh hey another library that crashes because of typing annotations !
Uff.
They have played us for absolute fools, Python was never supposed to have strict typing.
put me on record as being against breaking libraries, bloating code, ram and the core to jump through hoops to add typing to python of all languages.
amen
opened an issue in adafruit_rfm9x
unit tests, on the other hand...
you can add the type annotations in a separate file, then it doesn't add any bloat or break anything
I think that would make a lot of sense in CP
TIL typing.Literal only got added in 3.8, whoops. I can submit a hotfix PR now and for others using Literal, I don't think it's ever been guarded so far like Protocol has
I also submitted issues for the other libraries with the same issue, less than a handful.
Using stubs would be cool, I never really thought about the effect on RAM until it came up in this week's meeting
Add support for VCC-GND Studio YD-RP2040
- Details: http://152.32.187.208:8080/yd-data/YD-RP2040/
- Request for PID: https://github.com/WeActTC/WeActStudio.RP2040CoreBoard/issues/2
Meant to say I can take care of this either today or tomorrow
Add support for WeAct Studio Pico
CircuitPython version
CircuitPython 6.0.0 beta 1 and later
Code/REPL
import board
from adafruit_ht16k33.segments import BigSeg7x4
i2c = board.I2C()
display = BigSeg7x4(i2c)
display.brightness = 0.5
display.print("ABCD")
Behavior
Can't find the device when the I2C voltage is 3.3 and running CircuitPython 6.0.0 Beta 1 or later.
Description
I have kind of a weird issue here. This is a follow up for guide feedback. The guide for https://...
Never mind, @lone axle is faster than me
Thanks!
Thanks for finding them and making issues and doing the first one. These were top on the stack when I sat down to work a bit ago and figured I could knock them out real fast after I saw the first one.
See my comment here: https://forums.adafruit.com/viewtopic.php?f=60&t=186294&hilit=segment&start=15#p903654 about my success fixing this for a previous user by using stronger pullups. As I think you know, this display has two power pins, one 5v for the display itself and for the controller, and one for the I2C voltage, which in this case is 3.3V.
@tulip sleet my pr ran out of flash so I was looking into graphing section sizes
my PR gains back some flash, would it help?
Graph as in dependencies
are you trying to get it to run on M0?
I'm using the artifact from a7afd66 (
adafruit-circuitpython-lilygo_t_display_rp2040-en_US-20220320-1472b86.uf2). One of my boards seems to work, the other seems to have an issue with the display. It's wired as the demo (https://github.com/Xinyuan-LilyGO/LILYGO-T-display-RP2040/blob/main/firmware/firmware.uf2) runs fine.
Is there anyway to get this build artifact without setting up a ...
C3 space worries me
how much RAM on C3?
Don’t remember, on my phone
Np
Build artifacts are here: https://github.com/adafruit/circuitpython/actions/runs/2032460774. Click on the lilygo "Details" link above, then click on "Summary", and then scroll down.
is there anything blocking https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/pull/117 ?
Thank you very much for your help. We use this board to promote the programming education of circuit Python in China, and use the graphical programming software mixly in primary and middle school students. They often don't want complex lib operation
Note also the pre-commit failures here: https://github.com/adafruit/circuitpython/runs/6398538029?check_suite_focus=true. For some files, there is simply extraneous whitespace or a missing newline at the end of the file. For the Python files, they may be failing
blackorpylintin some way. If you move to your own repo and a submodule, they will not be checked (you could of course check them yourself).
Sorry, I will pay attention to this detail later. Thank you for your answers and help
Here is some info about using pre-commit to check the files: https://learn.adafruit.com/building-circuitpython/build-circuitpython#install-pre-commit-3096511-10
Great work! I had one comment where I think an if may still be able to be removed but I may be wrong. I didn't see anywhere else where the values changed.
I wonder if there may be a few new questions where it does not say why a pin is invalid (e.g. not a DAC pin) and now just says invalid. But probably worth the space savings.
I wonder if there may be a few new questions where it does not say why a pin is invalid (e.g. not a DAC pin) and now just says invalid. But probably worth the space savings.
If you look at the backtrace and the line in question, I think it will be clear it's invalid because of the context. There were already cases where the messages just said "Invalid pin" without further explanation; this just takes advantage of regularizing that.
Thanks, I thought I had caught all of these.
Thanks! I think it could go in just like this, but there are a few items I spotted along the way.
use raise_ValueError_invalid_pin here too?
Interrupts aren't blocked here (not sure why, if it's OK not to then remove it from samd?) so range validation could be used
worth adding a comment why not use range validation here?
same semantics, yes, missed that.
This is really an IndexError, because the upper bound is dynamic. But I did add a comment.
There may be some other such cases, and I will consider adding a special validator that notes it's an index.
Again, better as an IndexError.
Adding mp_arg_validate_index_range() to handle such cases. It will raise IndexError() with a more appropriate message.
Yes, these should really be RuntimeError. I found these and other cases, and made them RuntimeError. Maybe they should also be %q'd, but they are quite short as is.
good idea; added that routine and changed a number of places to use it
Yes, the docstring said clock, and the actual keyword was clk, so I chose clock. But no one complained about this, so I doubt if there's much code if any code that is using clk. So I consider this more of a bug fix. We have done similar fixes a few times for incorrect keyword args.
I wasn't sure about this so I left it alone. Made it 1.
Interestingly, some ports test for writes without MOSI or reads without MISO, and some do not. For instance, on atmel-samd, a write without MOSI does not raise an error.
Thanks! I think it could go in just like this, but there are a few items I spotted along the way.
With the latest round of changes, Trinket M0 is now up to 544 bytes saved.
Wow danh
🤯 look at all that room!
@idle owl I had forgotten my personal laptop that I do dev stuff on at the office, so I just got it back. I'll get it set up for Adabot and try to submit at least one patch for review this weekend. I'll scream let you know if I have trouble getting it set up!
Also, I think I found the way to crunch multiple commits into a single patch; might try to test it with this patch if it makes sense!
Ok, that's a good solution and one I can add to the guide. I'll verify it fixes it first.
Ok, I verified it works. Thanks.
I just installed the build for the Lilygo T-OI plus... looks like it is not operational
I f-ed up somewhere
Can someone helps me compile the build on Debian ?
you are following the instructions?
What compiler should I use
it says in the instructions
it's described in the Building CircuitPython guide
thanks
I messed up the board.c I think
oh dear. I'll have to test stuff all over the weekend
lol
installing all tools to be able to build circuitpython for that specific board is long
the ESP IDF environment is quite something
and I should have installed it in circuitpython directory but didn't
so I end up with 2 copies of it
OK, sounds good! No worries about timing.
my make BOARD=lilygo_ttgo_t-oi_plus returns me : find: ‘../../extmod/ulab/code’: No such file or directory
make: *** No rule to make target 'lib/protomatter/src/core.c', needed by 'build-lilygo_ttgo_t-oi_plus/genhdr/qstr.split'. Stop.
did you run make fetch-submodules ?
Where did you purchase the board? Do we know if raspberry pi is ok requesting a PID on a manufacturer's behalf?
Awesome work! Let's merge this and tag 8.0.0-alpha.0 since it changes some exception types.
any advice on how robust the rs485_dir timing is on the RP2040? are we better off doing our own software implementation where we can tweak the timing? Is it more or less robust at higher baudrates?
Awesome work! Let's merge this and tag 8.0.0-alpha.0 since it changes some exception types.
I agree. Then we can merge the postponed 8.0.0 PR's, and implement the hanging 8.0.0 issues.
thx, should be more responsive than doing it at the python level but might be to fast for some transceivers, looks like it's time to experiment
Is there a known issue around make fetch-submodules and the pico SDK?
From https://github.com/raspberrypi/pico-sdk
* branch 2062372d203b372849d573f252cf7c6dc2800c0a -> FETCH_HEAD
! [rejected] 1.3.0 -> 1.3.0 (would clobber existing tag)
fatal: run_command returned non-zero status for ports/raspberrypi/sdk
.
make: *** [Makefile:332: fetch-submodules] Error 128
no, I haven't seen that
seems like that means they changed the 1.3 tag
(which is bad form imo)
1.3.1 is free
Where did you purchase the board?
Got it from Aliexpress.
Do we know if raspberry pi is ok requesting a PID on a manufacturer's behalf?
Did not work so far for #6037. They want that the OEM manufacturer is requesting the PID.
Hi @deshipu We are ready to merge this now. main is now for 8.0.0 development. Do you have time to fix the merge conflicts?
@lone axle @slender iron https://github.com/raspberrypi/pico-sdk/issues/773
there is a 1.3.1 now
is that entire diagram encoded in the URL? 🙂
- Fixes issue with 1.3.0 tag being moved in
pico-sdk. - Let's update anyway.
How does the 'Download Project Bundle' button on learn guides "choose" which files to include in the bundle download? I found an instance on this page: https://learn.adafruit.com/circuitpython-made-easy-on-circuit-playground-express/play-file where the examples make use of some .wav files but the bundles come with .mp3 files instead of the .wav ones. I clicked through the github link and can see that the library repo this is embedded from includes both mp3 and wav files. But somehow the bundle button is omitting the .wav and including the mp3 even though this particular example is using the wav.
I also notice github seems to be changing the name of raw file downloads. when I click these buttons:
I end up with files named examples_dip.wav and examples_rise.wav instead of just dip.wav and rise.wav as is used in the code.
Even downloading from the github page directly with this button results in the file named examples_dip.wav
I assume maybe github changed this behavior at some point? I'm not sure why they wouldn't serve it using the original filename which they definitely know.
what is the URL?
I would think is Learn Guide behavior,
that is totally weird, this seems like a misfeature
totally agree, cannot fathom why they would think people want the filename to be altered.
maybe it's accidental and there is some bug with a slash somewhere in their system.
trying this on the circuitpython repo: https://github.com/adafruit/circuitpython/raw/main/py/argcheck.c, I get a redirect and it just downloads in the browser
redirects to https://raw.githubusercontent.com/adafruit/circuitpython/main/py/argcheck.c, so maybe it is a repo setting??
hmm, that is a human-readable file, but the .wav files are not...
interesting, or maybe examples/ is a special case directory?
I think this might be a browser thing! https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/blob/main/examples/dip.wav does different things in Firefox and Chrome
sorry, tried wrong link
Strange, that would be even weirder for a browser to decide to change it's name. I get the same results in both Chrome and FF here.
i was using the blob instead of the raw link
$ curl -I https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/raw/main/examples/dip.wav
HTTP/2 302
...
location: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/main/examples/dip.wav
...
$ curl -I https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/main/examples/dip.wav
HTTP/2 200
cache-control: max-age=300
content-disposition: attachment; filename=examples/dip.wav
Note the filename=examples/dip.wav. The browser can't do that so it substitutes _ for /
so the original link does a temp redirect to raw.githubusercontent.com
I tested this successfully with a custom build using the branch from https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/pull/117 on a CPX. I ran many of the examples from this guide: https://learn.adafruit.com/circuitpython-made-easy-on-circuit-playground-express/circuit-playground-express-library and found them working as expected.
On the CPX builds using current repo the remaining free space for an English language build was:
251864 bytes used, 1576 bytes free in ...
We're not sure if this behavior is old or new. Do you know? This kind of URL: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/main/examples/dip.wav is ca...
In 8.0.0, we are gaining space initially, on a number of small builds. How do we spend it? I was originally going to put back onewireio, but I'm thinking that making f-strings uniformly is quite advantageous, because it simplifies writing many examples and libraries.
We could do that in 8.0.0, but would it be possible in 7.3.0? This PR, starting as draft, tests which builds will fail. In 8.0.0, f-strings takes only 440 bytes more in a Trinket M0 build.
I was able to get in touch with a human from VCC-GND Studio. The PID should be requested now.
@slender iron turning on f-strings everywhere in 7.3.0 looks like it is going to work with just one board shrink; I am a little psyched about that; it will remove consideration of whether one has to use format() or not in library and example code. Made it ready to review. Going for a walk.
that's something worth having everywhere
speaking of f-strings, I completely missed we had that:
Adafruit CircuitPython 7.2.4 on 2022-03-31; Adafruit CLUE nRF52840 Express with nRF52840
>>> value = 1
>>> padding = 5
>>> f"{value:0{padding}d}"
'00001'
I believe the difference in space that you find might be in part due to the fact that the Circuitpython PR has not been rebased on latest. And neither has the library PR. Here is what I get when I make sure to pick the right ones:
247828 bytes used, 5612 bytes free in flash firmware space out of 253440 bytes (247.5kB).
246772 bytes used, 6668 bytes free in flash firmware space out of 253440 bytes (247.5kB).
That's 1056 bytes saved. The latest bundle's bluefruit.mpy is 1222 byte...
@dhalbert Thank you for your help. Now all checks have passed. What else do I need to do for this merger?
Observing UART problems also with a FeatherS3.
If connecting RX to TX and sending bytes to the UART data is coming with an offset.
As if the queue is not working correctly. Initially, after a reset, the send characters are received 2 or three characters "later"
With every reload of the code this gap increases.
Also, additional UART's created on other Pins than TX and RX are instantiated with no problems but do not work at all.
This was fixed at some point after 7.0:
Adafruit CircuitPython 7.2.0 on 2022-02-24; Adafruit CLUE nRF52840 Express with nRF52840
>>>
paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== val = 1.2345
=== digits = 2
=== f"{val:.{digits}f}"
===
'1.23'
This is fixed in latest, thanks to Micropython 1.18
lexer: support nested [] and {} characters within f-string params
Adafruit CircuitPython 7.3.0-rc.1 on 2022-05-18; Adafruit CLUE nRF52840 Express with nRF52840
>>>
paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== arr = [1, 2, 3]
=== print(arr) # [1, 2, 3]
=== print(arr[1:]) # [2, 3]
=== print(f"asdf{arr}") # asdf[1, 2, 3]
=== print(f"asdf{arr[1:]}") #...
so much good stuff happening! 👋
is mpy version different for 8? Will we need some update inside of circup? I'm noticing I can't install libraries with it on a build started from current main:
❯ circup install adafruit_display_text
Found device at /media/timc/CIRCUITPY, running CircuitPython 8.0.0-alpha.0-dirty.
Searching for dependencies for: ['adafruit_display_text']
Ready to install: ['adafruit_bitmap_font', 'adafruit_display_text']
Traceback (most recent call last):
File "/home/timc/.local/bin/circup", line 8, in <module>
sys.exit(main())
File "/home/timc/.local/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/home/timc/.local/lib/python3.8/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/home/timc/.local/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/timc/.local/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/timc/.local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/timc/.local/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/timc/.local/lib/python3.8/site-packages/circup/__init__.py", line 1316, in install
install_module(
File "/home/timc/.local/lib/python3.8/site-packages/circup/__init__.py", line 1016, in install_module
bundle_path = os.path.join(bundle.lib_dir(bundle_platform), module_name)
File "/home/timc/.local/lib/python3.8/site-packages/circup/__init__.py", line 123, in lib_dir
self.basename.format(platform=PLATFORMS[platform], tag=tag),
KeyError: '8mpy'
8 is not going to be different. We will do that in 9, when we merge MicroPython 1.19. circup needs an update to know about 8.
8 may be superseded by 9 relatively quickly. We thought 1.19 was quite imminent, but it is a big change, and there are still some PR's in progress in MicroPython. And 1.19 will be a big change for MicroPython, so we might wait a bit for it to shake out.
so we won't need to make CP8 versions of the bundles since the mpy format doesn't change (and we don't do versioning based on code compatibility). It is a potential support issue, what with the bundle having "7.x" in the name. We could change the name but that means changing conventions and therefore tools at many levels.
(meanwhile circup can just be told to treat 8 as 7)
I think we will anyway, we usually do, even if they are the same, so it's not a question. We'll have both 7.x and 8.x bundles, same as what we did for 6.x and 7.x
we haven't published the 8.x.x release yet; the alpha.0 tag is just a stake in the sand
we won't publish an 8.x.x release until 7.3.0 final.
since there is only one "unstable" listing on circuitpython.org downloads pages
ok so, when that happens, the bundles add the 8.x and we can just add it to circup
yes, we have to update circup, update the bundle builds, and update circuitpython.org/libraries
also RTD has to be updated
decreasing the frequency of the PWM that drives the display brightness.
Resolves: #6236
I tested successfully on PyPortal Tiano, PyPortal (Standard), and Feather ESP32-S2 TFT.
With this change brightness of all levels 0.1 - 1.0 seems to work well on all 3 of those devices. (values below 0.4 don't work on the Titano under current main).
There is a small amount of extra noise generated by this change that is audible coming from the speaker while it's enabled. But it's quite fai...
Automated website update for release 7.3.0-rc.2 by Blinka.
I'll test the boards with integral audio: PyPortals, PyGamer, PyBadge, Clue, FunHouse. So far I confirmed that the lower-frequency 500Hz PWM signal bleeds through on the Titano, but it's not significant in my opinion. The spectrum analyzer didn't show any significant additional signals above the existing 60Hz and on-board digital noise on the input of the speaker amplifier.
Driver support for the Electret Microphone Amplifier - MAX4466 with Adjustable Gain to work with circuit python.
Current setup is MAX4466 ---> adafruit voice bonnet --> raspberrypi W via the JST and pin connectors and would love to access the circuit python audio libraries with this microphone hardware.
same as rc.1, except f-strings enabled in all builds (so now in small M0 builds, for instance)
@fathom sand Besides https://github.com/adafruit/circuitpython/issues/6254, there is also https://github.com/adafruit/circuitpython/pull/6349
Looks good after the new changes
@dhalbert can you offer any tips on how to debug the Matrix object in MatrixPortal library? Do I keep using lower and lower level objects until the freeze doesn't occur?
I am looking at some issues with chunked responses, but if you have an example, that would be great. If it's small enough, paste it inline in a comment. Otherwise you can upload it as a .txt file or a .zip file. Thanks!
This looks good; thank you for making the submodule.
One question before merging: why is the sdkconfig empty? See the others in boards/*/sdkconfig. Some just specify CONFIG_LWIP_LOCAL_HOSTNAME; others have more settings.
Here's a summary of board test results comparing the existing main distribution of CircuitPython with the newly modified test version. I performed two audio noise tests, one using a spectrum analyzer to characterize the overall noise and to measure the contribution of the PWM signal. The other test was more subjective and was conducted by holding the speaker very close to the ear. Ear buds were used in addition to the speaker when testing the PyGamer.
<img width="812" alt="Screen Shot 2022...
However, if the Titano displayio brightness PWM frequency setting could be built independently of the other boards, then only the Titano would exhibit the slight increase in audio noise.
We could certainly customize per board by adding a setting value. I'm not sure I understand which values you recommend for which boards.
However, if the Titano displayio brightness PWM frequency setting could be built independently of the other boards, then only the Titano would exhibit the slight increase in audio noise.
We could certainly customize per board by adding a setting value. I'm not sure I understand which values you recommend for which boards.
Only the frequency of the PWM pin that drives the backlight controller needs to be set differently for the Titano build.
@CedarGroveStudios Thanks!
@FoamyGuy We could add yet another argument to the Display constructor. I don't think this should be compile-time only for the TItano, because someone could use a similar display as a non-builtin display, and would want the PWM frequency option.
The shared-module constructor argument list is getting kind of ridiculously long. Perhaps we should make a struct definition, with reasonable defaults, and pass the struct. This is a breaking change, but would result...
what are you expecting to be able to do with the microphone?
Thanks @fabaff and @bergdahl
I( made an invisible change to UK English to try to trigger a new PR earlier; did not succeed.)
OK thank you for taking a look.
transit_board_20220521.zip
This is a .zip of my project. It has a secrets.py that needs wifi and aio values.
I successfully ran this on my MatrixPortal M4 for 24 hours when I don't use my display module and only call requests. So I suspect the requests are not the primary cause, and it could be a joint or separate issue with the display libraries.
In a nutshell my ...
The Titano spectrum chart showing the overall audio noise and 50kHz and 500Hz PWM signal contribution.
<img width="936" alt="titano_summary_2022-05-21" src="https://user-images.githubusercontent.com/29906257/169680419-bc83f99f-b509-499c-bd80-83228ccdde39.png">
@dahanzimin is it ready for review again?
@dahanzimin is it ready for review again?
OK, thank you again. As always, I will promote circuitpython in another region. The board program has been added and can be reviewed again. Thank you
Looks good to me! Thanks for addressing our requests. I see that https://github.com/adafruit/circuitpython-org/pull/946 for the Mixgo CE board. But are there now two boards, or are they different modes of the same board? Since there are two builds, I think you will want another entry in circuitpython.org.
Why are you including the library as a frozen?
Yes, the same board has different modes (considering that many computers cannot read the drive letter when programming), in circuit python org. Need two web pages to support it? Submit another (mixgo_ ce_ serial) page later.
Add a frozen py file for the Round Carrier into the RP2040 Stamp build so users can use import stamp_round_carrier_board as board for ease of use just like with the regular carrier before.
@makermelissa Thanks for your help and support. adafruit/circuitpython#6383has been merged. The same board corresponds to different modes (circuit Python combines two boards). Here are also two pages to correspond. Thank you
Yes, if there are two builds, you will need another page for the other download.
@dahanzimin - the merge documentation build failed, I believe because the frozen library was in the board directory rather than in frozen/. Could you submit another PR that moves the submodule to the frozen/ directory, and change your mpconfigboard.mk files appropriately?
To test this before pushing the new PR, go to the top level and do make html. You will need to do pip3 install -r requirements.doc.txt to get all the Python libraries to build the documentaiton.
I like the idea of it being a constructor argument so that it can be set as needed for each device / display. Refactoring the constructor to taking a DisplayConfiguration or DisplayOptions or something like that with all of the values contained in an object instead of the long list of arguments directly does seem like an improvement to me, but would require a fairly large amount of changes if I understand correctly. All display driver libraries and all built-in display initializations for...
I think we don't really need a DisplayConfiguration for the Python side, because of argument defaulting. But it would make things easier on the C side, because we wouldn't have to change all the calls every time we added another argument.
Confirming that after building with DEBUG_UART, the REPL is fine over TX/RX.
I was also surprised that the Circuit Python build uses more memory than the MicroPython usb build but then I know it doesn't make much sense to give this board much attention until the BLE REPL is available.
A side distraction: As a workaround, is there a way to release the board.LITE pin for independent use?
A side distraction: As a workaround, is there a way to release a board.LITE pin for independent use?
Release the displays, and re-initialize it without the backlight pin.
Hi, is there anyone having success to talk to a DFR0627 board using CircuitPython?
I can see the board showing up in a i2c.scan()
I also can write to and read from the board.
But “nothing” seems to work.
Even writing a value to a register and reading the register back always only gives 0 as the value read.
Any hints are very welcomed!
https://wiki.dfrobot.com/Gravity%3A IIC to Dual UART Module SKU%3A DFR0627
wiki: This IIC to Dual UART module provides 2Mbps maximum communication rate, and each sub UART has independent 256-byte FIFO hardware buffer for transmitting and receiving. At most four such modules can be connected onto one controller board to expand 8 hardware serial ports.
I am experiancing problems while using busio.UART on a Feather ESP32-S3 No PSRAM (and other ESP32-S3 boards)
Assuming TX and RX are connected!
''''
import sys
import time
import board
import busio
import supervisor
uart = busio.UART(board.TX, board.RX, timeout=0.01)
again = 0
count = 0
while True:
if supervisor.runtime.serial_bytes_available:
k = sys.stdin.read(1)
if ord(k) == 27:
break
again += 1
if again > 100:
count += 1
s = f"hello uart! {count}".encode()
uart.write(s)
print("sending:", s)
again = 0
if False:
r = uart.read(uart.in_waiting)
time.sleep(0.01)
else:
r = uart.read()
if r:
print("receiving:", r)
print("done")
''''
The code above "behaves" very different if used on a M4 board compared to a ESP32-S3 board using the same CP version.
(Tested today with CircuitPython 7.3.0-rc.2 on a ItsyBitsy M4 vs. a Feather ESP32-S3 No PSRAM)
And chainging "if False:" to "If True:" does not change the results.
It even seems that the "offset" of the buffer / queue in the ESP32-S3 is increasing with every restart of the code.py app.
@fathom sand please add to that issue we discussed, or maybe open a new issue -- I don't remember whether it was an aside in the original issue or not.
If you are testing the DFR6027 on an ESP32-S3, note there are multiple reported bugs in the ESP-IDF SDK for S3. In particular we found it doesn't do clock stretching well. Could you try it on another board, like M4?
so, int.from_bytes is weirdly defined as taking 2-3 arguments, but ignores the 3rd argument, and C python does not take a 3rd argument, so I'm tempted to do that (or use MP_DEFINE_CONST_FUN_OBJ_3 if I get that correctly), or am I missing something ?
- STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(int_from_bytes_fun_obj, 3, 4, int_from_bytes);
+ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(int_from_bytes_fun_obj, 3, 3, int_from_bytes);
CPython takes signed as the 3rd arg, I think: https://docs.python.org/3/library/stdtypes.html?highlight=from_bytes#int.from_bytes
it's keyword only though ?
so, it should error on int.from_bytes(bytes([0x10,0x00]),"big",444444)
it should; there is minimal validation on some of these keyword-only functions, inherited from micropython
and it doesn't take keyword arguments (in CP)
so yes, maybe the right thing is to not permit the third arg, which is not implemented and cannot be a keyword
I ran into this in some other case; I'll look for it
I guess it was this: https://github.com/adafruit/circuitpython/issues/5407
CircuitPython version
Adafruit CircuitPython 7.3.0-rc.2 on 2022-05-21; Raspberry Pi Pico with rp2040
Code/REPL
b = (0xFEED).to_bytes(2,"little")
# next line is not correct code
x = int.from_bytes(b, 2, "little")
print(x==0xFEED)
Behavior
C Python raises a TypeError if too many arguments:
int.from_bytes(bytes([0xFE,0xED]), 2, "big")
Traceback (most recent call last):
File "", line 1, in
TypeError: from_bytes() takes exactly 2 posit...
@dahanzimin This should fix the build problem mentioned here: https://github.com/adafruit/circuitpython/pull/6383#issuecomment-1133908828.
@dahanzimin I am fixing this in #6420.
Thank you. I'm already repairing it dahanzimin/circuitpython/commit/,Actions are in progress
I did my tests with a ItsyBitsy M4.
@dhalbert,Thank you. Please add another level of directory,FROZEN_MPY_DIRS += $(TOP)/frozen/mixgo_circuitpython_lib/mixgoce_lib.because dahanzimin/circuitpython_lib is still adding other board libraries
Maybe adding some examples to the documentation would be enough:
int.from_bytes(b"\x00\x01","little") # returns 256
int.from_bytes(b"\x00\x01","big") # returns 1
(1).to_bytes(2,"little") # returns b'\x01\x00'
(1).to_bytes(2,"big") # returns b'\x00\x01'
@dhalbert Noticing that it only happens when a Matrix object is instantiated while also using requests. By itself, requests work fine indefinitely (24+ hours)
@dahanzimin if you want to fix it in your own PR, that is fine. Then I can approve your PR (I cannot approve my own). Right now our build is broken, so that's why I went ahead and made a PR.
Please add another level of directory,
FROZEN_MPY_DIRS += $(TOP)/frozen/mixgo_circuitpython_lib/mixgoce_lib.because dahanzimin/circuitpython_lib is still adding other board libraries
Are these libraries for other boards? Would you consider br...
@idle owl, got patches for the .pylintrc files, I can PR those to adabot repo tonight. I should also draft PR those changes to the BNO055 repo right? Anything else I need to do?
@tulip sleet trying to understand from last meeting, if CircuitPython had a typing module with an attribute TYPE_CHECKING that was always false, would it be able to be optimized? And if so, would that be for the core or mpy?
Or is that not correct?
Jeff showed a way to optimize it, using the trick of const(an integer)
but I don't think we necessarily want to make typing a required library everywhere. What problem are we trying to solve?
Maybe we could make it an almost no-op builtin
More of just wondering if moving away from using the try/except block to something that could be optimized
The try/except block is cheap, but it does add a little extra code in the .mpy
The only issue I can think of is that you it would make CPython code compatibility more difficult because you probably don't actually want to wrap it in something that won't run at runtime
we could make a typing that just had the TYPE_CHECKING = false in it, but you still need to avoid from typing import TYPE_CHECKING, Optional etc.
What is an example of using it vs not, and are there CPython precedents
I'm very sorry to bring you trouble. I'm a member of the mixly team, because GitHub is not very friendly in China, and the project is mainly in gitee
I typically don't think there's a use case actually in CPython the way we might use it, since there isnt much of a penalty to just importing it I imagine
Plus the annotations do actually need to be imported
The above ticket was superseded in https://github.com/micropython/micropython/pull/5026 and merged :)
No, use from __future__ import annotations so from typing import Union etc can be conditional. At least, I think it's preferable
Without doing something clever in the compiler from typing import TYPE_CHECKING doesn't seem to allow dead code elimination
I thought that was your idea
no, you presented that 🙂
maybe I said something that inspired you
I think I didn't say const, but proposed defining it. You came up with the const() int idea
Hmmm we could add a bit of code to make it as though every file had TYPE_CHECKING = const(0) though. Too bad if someone wants to use that identifier for anything else, ever
Oh okay, that's neat
importing a const doesn't make it a const in the module where that imported into. It'd be in the compiler, at the beginning of every module, the constant table is populated with an entry for TYPE_CHECKING with a value of 0.
MICROPY_PY_SYS_SETTRACE is now available, but we don't turn it on. But requires MICROPY_PERSISTENT_CODE_SAVE to be 1 and MICROPY_COMP_CONST to be 0.
==> typing.py <==
TYPE_CHECKING = 7
==> typetrick.py <==
TYPE_CHECKING = const(0) # If this line was implicitly at the top of every module...
from typing import TYPE_CHECKING # and we had a mini-typing module...
import typing
print(TYPE_CHECKING, typing.TYPE_CHECKING)
0 7
This doesn't show that the unused code optimization takes place for sure, but I think it's a good sign.
i will be afk for a while
@dhalbert
`Run sudo apt-add-repository -y -u ppa:pybricks/ppa
sudo apt-add-repository -y -u ppa:pybricks/ppa
sudo apt-get install -y gettext uncrustify
pip3 install black polib pyyaml
shell: /usr/bin/bash -e {0}
env:
pythonLocation: /opt/hostedtoolcache/Python/3.10.[4](https://github.com/adafruit/circuitpython/runs/6557101266?check_suite_focus=true...
Closing because I added the proposed solution of the higher value pull-ups to the guide already.
I had the same problem with a brand new ESP32-S2 TFT. 7.3.0-Beta.2 cleared up the issue.
FWIW this solve the issue for me as well.
<@&356864093652516868> The Weekly Community meeting is in < 40 minutes. Everyone is welcome! If you plan to participate, please leave your hug reports and status update in the notes document. Hope to see you all there! https://docs.google.com/document/d/1koPkyRaRg548N7dqxa-ymx8nybmd6kUSXxO-g8ZQDaw/edit?usp=sharing
CircuitPython Weekly for May 23rd 2022 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 participate, ...
Note: I am still playing with this. I am deducing maybe from some of the information in the PJRC forum thread I mentioned above that maybe some of the header details may be causing it.
I have changed so far that the boot data was different than a normal teensy Arduino build: In particular the size field was 8MB (T4.1) where on Arduino builds it is the size of data written to flash... So I have that one updated...
But now wondering about differences in the first block the flash config...
I ran the failed check again and it passed this time.
Thanks for following up with them @fabaff
We're finishing up an internal meeting. We'll be there as soon as we're done.
@inland tusk Can you mute please?
@proven garnet without spoiling what you are going to say, I am super interested in your "image transfer setup for the BluefruitConnect library". I think there was only Arduino implementation available so far. I have a direct use for this (if I find some dithering code).
I noticed a tiny error in the example code for using the countio module where the RISE constant wasn't be referenced properly, based on the way countio was being imported.
I think Jeff may have added some dithering functionality to bitmaptools somewhat recently.
I muted @inland tusk for now
@idle owl you muted him for you, but @slender iron muted him for everyone
Oh, I need to map to a fixed palette of 100+ colours... I guess I will have to work a little bit to make something that work for me.
😊
does anyone remember the visualizer of people working on an open source code base?
its an animation
Yes, just a sec Scott
Should it be circup detecting frozen module and not installing the matching mpy?
@slender iron https://github.com/acaudwell/Gource
thank you!
Make the directory read only
I've definitely had issues with symbolic links in windows
hehe nice
Haha sorry for being text only
Need to unlock my voice rights
I basically tried to get the library to work with the image transfer but still WIP
I can share my branch with you
I might have wrote an issue long time ago to say it was missing. 🙂
Yes please.
It so far looks like the app isn't sending it properly
