#circuitpython-dev
1 messages · Page 423 of 1
So the result will be a bitmap to use in displayio?
Basically. I think right now it can give both the bitmap and palette
Up to user to do a tilegrid
no, I was not really here
@proven garnet I have a question for you too 😄
ok yeah
Thanks!
Thanks!
If you are using https://gitee.com, I think we could point to a submodule there, since the fetching is done strictly with git, which should not care.
The only issue I see is the error I get when trying to browse a gittee.com repo without being logged in:
为了营造绿色健康的开源社区,推动中国开源生态建设,当前仓库仅限 登录 用户访问。
Gitee 公开仓库作者需要先进行申请,审核后才能开放匿名访问。
如果你是仓库持有者,请检查你是否处于登录状态。
I had to Google translate this to read it, but my understanding is that though it's not the d...
I am going to go ahead and merge this anyway so our builds will work for now, and we can think more at gitee.com later.
Automated website update for release 7.3.0 by Blinka.
To save CI time, cancelling the full build of this PR, since there are no code changes, and will merge anyway.
You should be able to use the same flash config. I redid it to work with nvm.toml and the other iMX boards.
@tulip sleet Are you dropping an 8.0.0-alpha.0 before tomorrow as well? Or not yet?
I'm going to assume no so I can wrap up the newsletter. We'll include it next week if it ends up released.
As soon as 7.3.0 final is up, yes, I can make an 8.0.0-alpha.1 (alpha.0 is already cast in stone, but not released) so i will be on circuitpython.org
but given the build backlog, it will be tonight
I removed the "and its unstable version is foo" from the newsletter. I think it's fine to include it next week.
I will let Anne know what is available if she wants to make last minute changes
Ok sounds good.
@tulip sleet do you know the format of .a archives?
found it: https://en.wikipedia.org/wiki/Ar_(Unix)
The archiver, also known simply as ar, is a Unix utility that maintains groups of files as a single archive file. Today, ar is generally used only to create and update static library files that the link editor or linker uses and for generating .deb packages for the Debian family; it can be used to create archives for any purpose, but has been la...
@FoamyGuy We could merge this as is, and do the harder work later of a settings struct to support custom PWM frequencies. I am not sure of the tradeoff of fixing the Titano problem vs making the other boards slightly noisier.
I updated the frozen CPX PR with the release of the library, let's see if it passes CI
Okay, I'm up for whatever you all think is best. I think I have an idea of how to add the argument as a new argument for Display. I'm less familiar with the process of making the struct to refactor all of those arguments, but willing to give it a try and learn.
A program may have a lot of unused code and data. There can be many reasons:
Well, that is a pretty timely blog entry 🙂
Timely? 2021-02-28. 😉
i am living in the past
what is time anyways
Nothing.
Ok cool. One more request. I just noticed as I was giving this a final look over, your images are square. Could you adjust them so they are rectangular as described here: https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/preparing-the-images
Otherwise this looks good. Thanks.
pretty slow light there 🙂
maybe it was a millisecond
it's been at least 4 years since I was taught the definition of a second xD
apparently it's based on Cesium 133
Today, one second is defined as “9,192,631,770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the cesium 133 atom”
the more you know.
I also had it backwards, 1 meter is defined as 1/299792458 of a second light travel in a vacuum. lol
OK, I will try gitee later. I believe that technology knows no borders. Thank you again for the completion of this tortuous road
Finally, let me ask you a question. Has circuitpython considered the transplantation and construction of esp32-s3 of espressif in terms of AI
local /home/tannewt/repos/circuitpython/ports/espressif/build-ai_thinker_esp32-c3s-2m/extmod/ulab/code/numpy/numpy.o:ulab_numpy_globals_table 367 31729
local /home/tannewt/repos/circuitpython/ports/espressif/build-ai_thinker_esp32-c3s-2m/extmod/ulab/code/numpy/numpy.o:mp_module_ulab_numpy_globals 368 31745
global esp_wifi_init_internal 745 46668
global esp_wifi_init 883 55760
global common_hal_wifi_init 1115 65026
local /home/tannewt/repos/circuitpython/ports/espressif/build-ai_thinker_esp32-c3s-2m/shared-bindings/wifi/__init__.o:wifi___init__ 1116 65046
local /home/tannewt/repos/circuitpython/ports/espressif/build-ai_thinker_esp32-c3s-2m/shared-bindings/wifi/__init__.o:wifi___init___obj 1117 65054
global mesh_nwk_task_main 657 68875
global esp_mesh_nwk_task_init 693 71291
local /home/tannewt/repos/circuitpython/ports/espressif/build-ai_thinker_esp32-c3s-2m/shared-bindings/wifi/__init__.o:wifi_module_globals_table 1379 76698
local /home/tannewt/repos/circuitpython/ports/espressif/build-ai_thinker_esp32-c3s-2m/shared-bindings/wifi/__init__.o:wifi_module_globals 1380 76714
global wifi_module 1381 76722
local /home/tannewt/repos/circuitpython/ports/espressif/build-ai_thinker_esp32-c3s-2m/py/objmodule.o:mp_builtin_module_table 4436 241850
esp_mesh is being brought in and is huge
nope, that's a lie
looks like it kind of tried
I now have what I believe is a working version. So far I have tested it with T4.1 and Sparkfun_teensy_micromod.
will test tomorrow with T4.
Code is up in the branch: https://github.com/KurtE/circuitpython/tree/teensy_retain_fs
I tested plain values, single-quoted values, and multi-line values, and they work for me.
But it doesn't always take the last value for multiple values:
abc=def
abc=ghi
and it gives me the first value, not the second
Adafruit CircuitPython 8.0.0-alpha.0-6-g3dca8a776 on 2022-05-23; Adafruit Metro M4 Express with samd51j19
>>> import dotenv
>>> dotenv.get_key(".env", "abc")
'def'
However, this gives the last value:
abc=def
abc=ghi
abc=jkl
...
guessing on the psram settings for mini-n4r2
The automatic version goes to main where the manual version was going to master
So it appear duplicate in https://circuitpython.org/board/mixgo_ce_serial/
Maybe it is not clearly documented that this section is not to be submitted manually?
The automatic version goes to main where the manual version was going to master
So it appear duplicate.
Maybe it is not clearly documented that this section is not to be submitted manually?
@thorny jay here's that's image packet branch for bluefruit connect https://github.com/tekktrik/Adafruit_CircuitPython_BluefruitConnect/tree/dev/add-image-packet
As far as I can tell the bluefruit is currently having issues picking up the image
Going to try the Arduino library to confirm the app is sending properly
DIdn't realize you made two PR's. Repeated this in my updates to #962, so closing this in favor of #962.
Thanks for noticing this! If you have a suggestion for the README about the auto-"Contribute" section", a PR there would be welcome as well.
Thanks, I need to locate a Bluefruit with screen hardware. My CLUE screen is dead, I found my "TFT Gizmo" but I need to locate my "Circuit Playground Bluefruit". So you try to do this: https://learn.adafruit.com/wireless-image-transfer-with-circuit-playground-bluetooth-and-tft-gizmo but in CircuitPython. And this is more information on the protocol: https://learn.adafruit.com/bluefruit-le-connect/image-transfer . I wonder if it has been used by any other guide...
Yeah pretty much. I used the explanation of the protocol but I'm not able to actually "get" it on my bluefruit (I don't find the leading ! or anything) so something isn't working - almost certainly my code 😂
As mentioned in the issue #6309, The newer Teensy boot loader can retain a file system that is stored in the flash memory as long as it is not in the area that is automatically erased.
Some of this is described on the web page: https://www.pjrc.com/teensy/td_code_security.html
But to do this, the bootloader code looks at specific things in the uploaded data to determine if it will retain any data or not and how much.
The two things I fixed was the Loader is looking for the value: ...
Finally, let me ask you a question. Has circuitpython considered the transplantation and construction of esp32-s3 of espressif in terms of AI
We haven't thought much about AI APIs yet. Please open a new issue if you want to discuss it. We'd probably want to model after an existing Python API
what are you expecting to be able to do with the microphone?
audio signal processing of the sound for use in ML classification. Ideally can process the audio concurrently during data recording
This was discussed for possible inclusion in 7.0 but didn’t happen there. See #4794. Breaking change. Heard an 8.0 might begin soon, so here’s code.
Summary: subtly changes behavior of analog reading on most ports so the result spans the full range from 0 to 65535. As of 7.X, it appears that cxd56 and espressif already do this, but all other ports return a max of 65520 due to a simplified left-shift operation.
Complete incompatible change of moving OneWire to its own onewireio module, so it's no longer a part of bitbangio and busio.
rainbowio was turned off for expediency for some small builds that were overflowing. They are no longer overflowing.
@slender iron I closed 7.3.0 and 7.x.x milestones, created a 7.3.x milestone, and moved all 7.x.x issues to 8.0.0 milestone for now. Could still triage, and some may deserve a backport to 7.3.x.
Oh @idle owl and @trim elm I meant to share with you the repository I made for the patch scripts I've used. Figured there might be something cool to glean if it was public: https://github.com/tekktrik/cpy-library-scripts
Excellent! Thanks for sharing. I feel like we could make another directory on the Adabot repo for library scripts, or I could create a separate repo on Adafruit for them. Eva has a bunch as well. I'll see whether she thinks it makes more sense in Adabot or separate, and we'll see from there.
sounds good @tulip sleet
Sounds good! 
This looks great, thanks! I tested the values that would be generated, but not the actual builds. It will be great to have it consistent across ports.
Ok, so here's the deal. You will need to clean up your script files if necessary, and document them very thoroughly. Once you've completed that (and you can PR it when you're ready so we can go over them together), you can add them to the directory-I-haven't-named-yet on the Adabot repo. Eva will do the same. I think it's important to share them where folks can find them, and since they either tie into Adabot, or do similar things, I feel like that's an excellent place to share them.
WRT documentation, I want it to be something where anyone could pick it up, understand what's going on, and basically be able to run it entirely based on the docs in the file.
Thanks @PaintYourDragon!
Thank you so much for figuring this out. The IVT_HEADER change is just a version number. I'm not sure what changed between 4.1 and 4.3 but it seems to still work just fine.
@tulip sleet have you built CP on your m1?
I have.
nice! limor is trying to get it going
Not for ESP though. If that is what you're looking for.
that is what limor is trying
Hi: Moving some code from a 16bit MSP430 to RP2040 and thought I would also go with CPy. My code sets many registers which have equivalents on RP2040. So my question is "how does one set a register"? Its obviously different since no pointers, etc.
I never took the time because it wasn't on my official list of tasks, and it seemed like a bit of a rabbit hole.
So I thought Limor would be happier if I didn't spend the time.
@hidden rain you'd be better off doing C for register level code
Yes if could do the entire app that way, however, the main part of the code will be CPy. Is there a way to mix and match, or use PIO, or create a little register getter/setter?
a simple C module that just exposes some registers would be quick to write though
How would I "mix", C/C++ as a module? Do you have a link?
I could write the PIO assembly if it can takes arguments and return values.
Disabled ulab to make it fit. We'll need to figure out whether there is unused code that we can get rid of.
Did we decide on ignore-list for the replacement, or were we opting for allowlist and denylist?
@slender iron I feel like you were part of the discussion about this that I'm vaguely remembering. ^^
I'm not sure what the opposite of "ignore-list" would be anyway.
I feel like we decided to go with worked best for the given situation
Hmm. Alright. Thanks.
CircuitPython version
Adafruit CircuitPython 7.3.0 on 2022-05-23; Adafruit QT Py ESP32S2 with ESP32S2
Board ID:adafruit_qtpy_esp32s2
Code/REPL
import board
import rotaryio
class Encoder:
def __init__(self,pin1,pin2):
self.encoder = rotaryio.IncrementalEncoder(pin1, pin2)
self.last_pos = 0
def read(self):
change = 0
if self.encoder.position > self.last_pos:
change = 1
elif self.encode...
watchlist ;-)
Fair enough.
Sounds good, I can do that. Should they be more of a historical "here's what I did as a basis" or "here are more tools to use"?
Um.... Good question. Probably "here are more tools to use".
We'll want a README in the directory I think.
The difference being some scripts are definitely have hyperspecific purposes, but I could refactor the one that checks that state of the latest build to be more generally useful
With maybe the names of each of the scripts and a quick description.
Right, I don't mind if they're hyperspecific. As long as they're documented well.
Sweeto! I can do that, just let me know what the repo ends up being and I can PR it
It'll be Adabot but want a clear name for the directory.
So I'll get back to you as soon as I come up with some ideas. Or an idea.

I don't even know where you come up with these emojis. 😆 I get what you mean based on context, but half the time I'd otherwise have no idea what you meant. I'm getting old.
The perks and curse of joining too many discord servers hahaha
I tested and found that if you reverse the order of the creattion of enc1 and enc2, then the the second one does not work: it doesn't seem to be the choice of pins.
There were recent changes to rotaryio since 7.2.x was branched, in #6207. @domdfcoding, tagging you for interest.
I think the problem may be that pcnt_unit_config() is called twice in ports/espressif/common-hal/rotaryio/IncrementalEncoder.c, but it also finds a free unit each time it's called, so it's allocating two units. I have an idea for a fix.
@dhalbert I'm sorry, I get way more circuitpython-related notifications from github than I am able to read in my free time, so messages like this just fly by me. I rebased it now.
Hi, one rebase/mergish change
autoreload_tick() is gone, so this can be removed. I could not edit the file myself. (Maybe pypewpew can check the box that maintainers can edit PRs?)
just posted a small javascript project to #help-with-projects for those who can make sense of it all
I want to use the treemap to see the code size of different directories of circuitpython
@stuck elbow I can ping you with stuff if it would help, e.g. see x:54 above
Is this iminent? I know two Learn guides that still use it, been on my radar to move them to keypad ahead of time, so just want to know!
Is this imminent? I know two Learn guides that still use it, been on my radar to move them to
keypadahead of time, so just want to know!
It will be in 8.0.0-alpha.x. It is not a change to 7.3.x, so it will not affect the Learn Guide code until 8.0.0 final is realized, which will be some time from now.
Fixes #6429.
- Fixes allocation of PCNT units by some code restructuring.
- No longer passes pcnt init structs by value.
Tested on QT PY ESP32-S2, using a test program similar to what's in #6429. I didn't have two encoders to try it at once, but I moved jumpers back and forth, and the encoder worked on both pairs of pins.
@alustig3 Builds that I think fix this problem are here: https://github.com/adafruit/circuitpython/actions/runs/2381784979. Scroll down a bit to see "Artifacts".
@dhalbert the new build worked for me. Thanks!
Thanks! Approving based on a quick look at the changes and the original reporter saying it's fixed for them. Looks like a sensible improvement.
thanks, once I know there is something to watch for, I see it, it's just the long-time things that I miss
@dhalbert
What does 8.0.0 mean?
Will there be 7.4 / 7.5 / 7.6... versions to be expected?
And, do you really think that the queue problems observed in CircuitPython test code are rooted in the ESP-IDF?
I have a hard time believing that such a basic feature like UART communication is not working well in the ESP-IDF.
There is ongoing discussion about multicore support on RP2040 #4106; whether it's really necessary or how the situation can be improved by grabbing lower-hanging fruit.
@ladyada:
displayio is also handled in the background with DMA...
I've done a little bit of profiling on my project and found that my biggest bottleneck right now is the i2c display: In my project, the displayio update takes ~44ms whe...
Apologies - just realized I didn't set the I2C speed and was using the default 100kHz baudrate. At 1MHz baud display.refresh() now takes ~12ms which is much more reasonable and probably wouldn't be any faster if the CPU waits for the DMA to complete anyway (?)
For some reason, I don't have the option to allow changes to pull requests:

I'm not sure what kind of performance benefit running BACKGROUND_TASKS while doing I2C via DMA would yield, but at the 1MHz max baud the peripheral supports the sending itself is not CPU bound so this is overall less useful than I expected originally.
I did not check the documentation, but I checked 20+ of the latest new board, and only two had that duplicate, and from the same author. So I guess the instruction are OK and the same mistake was done twice by the same author.
Maybe the "Contribute" section could be put elsewhere, more global to the page and not in the same text box, so that what appear in the box is exactly and only what was provided in the md file for this board.
pre-commit.ci web service has the apparently unavoidable behavior that it opens PRs to upgrade pre-commit to "the latest tag", without taking account of whether a tag is stable under python / semver standard practices. It's frustrating, and probably enough to make me turn pre-commit.ci back off for the two repos where I enabled it. fyi, since I'd softly floated the idea of switching to it for CircuitPython libs.. https://github.com/pre-commit-ci/issues/issues/124
pre-commit's author is extremely opinionated!
What does 8.0.0 mean?
We use the "semver" versioning model. 8 is a major version, and means there are incompatible changes in API or (significant) behavior changes.
Will there be 7.4 / 7.5 / 7.6... versions to be expected?
There will be more 7.3.x versions. The rightmost x indicates bug fixes. If we decide to add significant features to 7.x.x, we would go to 7.4.x, etc. Such a decision might depend on how long we expect it to take to get to 8.0.0 final. Our attitude is that in...
At the risk of asking a question that must have already been answered, Should I use asyncio to catch n incomming UART action that would otherwise be an interrupt?
This is for an RP2040
to poll, you would check .in_waiting. So if you can make a task that checks that when it's its turn to run, that would work. But it will not be pre-emptive, since asyncio is cooperative multitasking.
Thats cool. The app will decide 'when' to turn on the listener, so it would it does not need to be pre-emptive! Thanks.
As noted in #962, a contribute section should not be part of the PR, so this is something else to check.
I saw it was in https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/adding-to-downloads (pointing to master) and just removed it. So that was likely the culprit.
Hi, could you add the family field in the top section. It looks like for this one, the value should be atmel-samd. I literally just got done updating the guide with this information: https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/adding-to-downloads
Thanks
Also, it looks like you have some non-standard features. You can check the same guide page for a list of valid values. Thanks.
I just had another thought, but this is more of a bonus. Perhaps it can figure out what the bootloader_id is, check if the value is correct, and if not then inform the user.
Note: This is also waiting on https://github.com/adafruit/circuitpython/pull/6432 to be merged.
@mlhakimz There is apparently some extra white space in the pins.c file. Could you look at the "X" item in https://github.com/adafruit/circuitpython/runs/6589280392?check_suite_focus=true, and remove the whitespace. There is a diff in there showing which line. I would edit your PR but something is preventing that (normally there is a box you can check to allow it).
Found out the adafruit_ntp lib will quite happily sit in a timeout condition for hours- worth PRing a timeout for?
one of the things I was wondering is how you would log that it had timed out- standard py I'd just throw a logging statement in there but I don't think that's the route for cirpy
@dhalbert (@ThomasAtBBTF ) - Sounds like, lots of stuff to keep you busy!
Simple point of reference is that simple UART stuff is working on CircuitPython...
Some simple testing.
MPY: soft reboot
MicroPython v1.18 on 2022-01-17; FeatherS2 with ESP32-S2
Type "help()" for more information.
>>> import machine
>>> uart1 = machine.UART(1, baudrate=9600, tx=43, rx=44)
>>> uart1.write("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
26
>>> print(uart1.read())
b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
>>>
```...
@dhalbert Thanks for reviewing. I have deleted the white spaces you mentioned.
This is fine but one comment about the ordering of the pin names, if you want to change it.
Put the preferred pin name first, if RX is preferred. Same for other pins.
let me know if you don't want to change it and I will merge
@makermelissa Thanks for reviewing. I've added the family field & the bootloader_id (currently waiting for adafruit/uf2-samdx1#190). I also modified the technical specifications to the correct format.
Yes please. I think there is a TimeoutError or maybe it's just OSError
Nah, just raises OSError: [Errno 116] ETIMEDOUT
that'll work
Right now I've just got a format_traceback with some info so it doesn't just fail silently
there's also what to do if it times out for the first invoke
maybe having some list of fallback servers?
@KurtE
Thank you so much for testing this!
Do you have any idea on which ESP-IDF version the Micropython is working?
And on which version we (CircuitPython) is working?
Also, even though I have very little understanding of the inner workings of the CircuitPython UART code, I am pretty sure, that the bug is located in the "receiving code" inside CircuitPython and not in the "sending code".
Reason: I did tests also with another board connected to the UART-pins and the CircuitPython ES...
ie right now it's
def datetime
if time to refetch:
adjustment = get time from ntp
return time + adjustmenet```
roughly
if I change it to
def datetime
if time to refetch:
try:
adjustment = get time from ntp
except:
pass
return time + adjustmenet```
then the first time it's invoked it will be entirely wrong if it times out then
so it needs some fallback support
(but what if all the fallbacks fail too? Should it raise?)
Awesome. Looks good. Just waiting on https://github.com/adafruit/circuitpython/pull/6432 before merging.
the adafruit ntp server isn't working?
@dhalbert I'm keeping the pins order for now. Please merge the PR. Thanks again.
@ThomasAtBBTF
I am not sure which one they are using right now:
Their instructions for build it show:
The ESP-IDF changes quickly and MicroPython only supports certain versions.
Currently MicroPython supports v4.0.2, v4.1.1, v4.2.2, v4.3.2 and v4.4,
although other IDF v4 versions may also work.
And yes it appears like TX may be working:
>>> import board, busio
>>> uart2 = busio.UART(board.IO17, board.IO18, baudrate=115200)
>>> uart2.write(b'1234567890')
10
>>>...
it's timing out every now and then yeah
hrm, ya feel free to improve it
I was wondering why my code was just sitting dead after a couple minutes and it's because of NTP
I am having trouble with the circuit python GPS library. The problem is in the gps.update command. On line 549 in the _parse_gsa section of the function, I am getting an error that "bytes" object has no attribute "decode" I am trying to run the "simple test" example
My setup runs the gps_echotest example fine. It outputs NMEA sentences, so I don't think it's a problem with the GPS
Ok, I made https://treemap.dev and it's example is CircuitPython file sizes
View JSON treemap data online
clicking on the two links on the bottom does nothing, probably because they are covered by something?
click the squares
squares?
there are no squares
rectangles
oh, so it's like a directory browser
ya
with the rectangles sized appropriately
very nice
interesting, so the compiler and the strings are the biggest part of the python itself
kinda makes sense
though I would expect the vm to be bigger than the compiler
@KurtE Thank you so much for testing this! Do you have any idea on which ESP-IDF version the Micropython is working? And on which version we (CircuitPython) is working?
Also, even though I have very little understanding of the inner workings of the CircuitPython UART code, I am pretty sure, that the bug is located in the "receiving code" inside CircuitPython and not in the "sending code".
Reason: I did tests also with another board connected to the UART-pins and the CircuitPyt...
I think it'd be cool to have the # in the url be the root
easier to share links then
though it doesn't have the file itself...
If any of you see these UART problems on ESP32-S3, but not ESP-S2, that would be interesting.
you mean a URL something like:
https://treemap.dev/#/home/tannewt/repos/circuitpython/ports
And it will load directly to that place in the file structure?
right
but the user would still need to provide the file which is weird
back button could work then though
if it had a server side it could keep a copy of the JSON so different users could view the same thing. Or if the circuitpython repo is the primary intended files it could just clone it's own copy of the repo.
it's meant to be generic and is just hosted statically with gh pages
This is a neat visualizer. I didn't quite grok what you were talking about before I saw the example.
i have used tools like that a lot to figure out what's using up all my disk space (back when I didn't have giant disks)
For circuitpython specifically, maybe actions on the core repo could generate the JSON file and this tool could grab it from there?
I read the message from Kurt so that he does not see the problem on MicroPython on a S2
But on CircuitPython on a S3.
I will test with a ESP32-S2 board tomorrow with CircuitPython 7.3
Here is the notes document for next Monday’s CircuitPython Weekly meeting. It is happening 24 HOURS LATER on Tuesday, May 31, 2022 at 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/13ESjBlnO5LdgZWdyrCDvklIvtYcsLqgUnyzM559at9A/edit?usp=sharing
CircuitPython Weekly for May 31, 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, add...
Ah, OK. That's a better time for me anyway
The use case I have is very superficial but I want to run animations on the macropad screen, whilst having the LEDs fade smoothly. Unfortunately if I am writing big changes to the screen the rate the LEDs update slows down and it looks a little off.
So I want to run my displayio things in the other thread so that the standard keyboard features can run indepdently.
If any of you see these UART problems on ESP32-S3, but not ESP-S2, that would be interesting.
I see the problem on a QT PY ESP32 S2 as receiver and Feather RP2040 as transmitter. Bytes are shifted/swapped on the S2. Stopping and Restarting the S2 in the repl causes a unique shift. Stopping and starting the Feather RP2040 in the repl has the same shift offset in the QT PY ESP32 S2.
Adafruit CircuitPython 7.3.0 on 2022-05-23; Adafruit QT Py ESP32S2 with ESP32S2
Is there like a joke going around about May 31st that i'm missing? lol...
I've seen it twice today
no wait
my months are off
The current atmel-samd port does not support RTS/CTS for hardware flow control, even though the underlying SAMx2x/SAMx5x chips are capable of using this mode on async UARTs. This change enables hardware flow control by allowing assignment of pins to RTS/CTS, and enabling selection of the correction pad configuration for the pinout via the CTRLA.TXPO register.
An example of working code looks like this (using the pin configs on the Sparkfun SAMD51 MicroMod):
import board
import bus...
Code looks good! Thank you! :crossed_fingers: all of the builds fit.
Thanks for catching the typo. I've pushed to resolve it, plus re-reviewed and noticed that CTS and RTS pinmux assignments were flipped versus RX/TX. That's fixed too.
If any of you see these UART problems on ESP32-S3, but not ESP-S2, that would be interesting.
I have seen it on both as I mentioned back earlier in this issue (April 9th)
Was hooking up again with a newer S2, that I see for sale on Adafruit:
https://www.adafruit.com/product/4769
And tried for a long time to reinstall CPy... But I screwed up that I did not realize that this Feather S2 is not the same as the Feather S2. Only when I unplugged it from a breadboard did I see that ...
@KurtE Just to make sure:
uart1 = busio.UART(board.TX, board.RX, baudrate=115200)
uart2 = busio.UART(board.IO17, board.IO18, baudrate=115200)
I have the two uarts jumpers so TX->17, 18 -> RX
That would be TX->TX and RX->RX. Did you swap them around? I'd expect TX->RX and RX->TX.
Sorry typo’s yes to to rx…
Sent from my iPad
On May 25, 2022, at 6:45 PM, Dan Halbert @.***> wrote:
@KurtE Just to make sure:
uart1 = busio.UART(board.TX, board.RX, baudrate=115200)
uart2 = busio.UART(board.IO17, board.IO18, baudrate=115200)
I have the two uarts jumpers so TX->17, 18 -> RXThat would be TX->TX and RX->RX. Did you swap them around? I'd expect TX->RX and RX->TX.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are ...
.pylintrc is patched! Here are the failures/errors: https://gist.github.com/tekktrik/d8606ef897da40d039bd9064bd5127ad
I'm trying to solve the bootloop problem from my board. Going to add an issue on it
Tried with 2 different devices same problem
CircuitPython version
adafruit circuit python 7.3.0 RC0
Code/REPL
no codes/ can't acces REPL
Behavior
Bootloop
Description
The firmware has an error, occuring in a continuous bootloop.
Additional information
Working on a solution.
Go figure I flash T-01C3 on the board and everything is working
I flash t-oi plus and bam bootloop
Thanks for helping to correct some errors. When can I download mixgo_ce firmware from the circuitpython-org
I litterally just added pins to the t-01C3
but still nothing
last build for today ...
The button should appear in the next release of CircuitPython, but you can click the Browse S3 button now to see all builds which include any that happen when a Pull Request gets merged.
-flto slows down a build by a factor of two or so. We were also always using -flto-partition=none, which saves more code space than the default -flto-partition=balanced. However, one some builds that need -flto, they don't really need the extra savings of -flto-partition=none. Using the default -flto-partition` reduces build times to 2/3-3/4 of the original.
I did a bunch of experiments to see what space savings were lost, and also tried the other -flto-partition= options.
...
Re-tested with fix. Works great. Also works with a file without a final newline, and with \r\n linebreaks. Thanks - this is going to be be very useful!
ok, great, so gpio and spi groups
if use specific pin(s) it seems
hmm, strange restriction. I'll research this some more, thanks, unless you want to stay on the trail.
@gilded cradle hey. have you ever gone down the "how to run neopixels without sudo" rabbit hole?
You mean on Raspberry Pi? I don't recall doing so, but perhaps I did a while back.
yep. on pi.
I think I looked into it for I2C and SPI but didn't get very far. It was more like peeking into the rabbit hole.
ok. seems like we've all taken a peek 🙂
🙂
@tulip sleet if you're willing. i think you'd be better suited. could get into some lower level stuff you'd be a better ninja at.
I2C I was able to use without sudo by adding pi to the I2C group or something
yes, that seems straightforward, it's neopixels in particular
but neopixel uses /dev/mem which is kernel protected or something
the neopixel lib can use different plumbings under the hood. spi being one of them.
yah, it seems any attempt to use /dev/mem is where it becomes a bigger issue. not as simple as adding a group permission.
@tidal kiln Ready for a shallow dive into Yet Another Schematic?
sure
I do not see a pull-up on A0. Am I missing something or is that correct?
I'm trying to work from as much of the pinouts page for the ESP32-S2 as possible, but obvs there are differences.
do you have eagle installed?
Ok I see some things highlighted
ok. yah. anywhere works.
now can look around at all the highlighted wires and see if there are any pull ups
It's so barely obvious on the schematic what's lit up. 😕 The color change isn't very ... different.
I see it on the board though, which is easier.
yah...it's not a very contrasty color 😦
Looks like a direct connection there, although it also looks like a trace is missing. Might have turned off a layer I shouldn't have.
No.... there's a layer I've never seen before that has the trace in it. Is this a multi-layer board?
It's a direct connection from the pad to the chip on the board.
So I guess no pullups.
@tidal kiln Thanks. I'll remember to do the eyeball-clicky-thing eventually before asking you. 😄
Not sure how I've managed to get this far and never deal with a multi-layer board, or get this far having somehow missed the extra layers entirely when working with previous multi-layer boards. 😄
i think multilayer is only used if necessary. most boards are 2 layer.
i wish the line thickness would also increase
Yeah agreed.
This is at least a huge improvement.
I can see things when zoomed out now
that trick is handy, because it's possible to tie in something like a pull up resistor and, on the schematic, tuck it away in some odd corner that is easy to overlook with just visual scanning.
I went to Options>Set... and checked the High Contrast box in the "Highlight" section of the window, and dragged it around until I was happy with the visual effect.
Sorry if you already knew what I did. Figured I'd share in case you weren't.
huh. i had that on. but never noticed the hue slider.
can use that to dial it in even more
We've added a few improvements to the Swan R5 (STM32L4R5) board that we hope can be included in the next release. This PR brings these changes:
- increases filesystem to 1MB by using bank2 of flash on the L4 as storage for that
- add an
extobject on the board that contains the expanded set of pins on Swan from the castellated edges. - Builds with the UF2 bootloader offset by default.
- adds the UF2 family ID for the STM32L4 and supported STM32 devices
- based on
main. (not 7.3.x...
This fixes the feather_m0_express build overflow when #6407 was merged.
@tannewt My thoughts were that traceback is "nice", but not vital, especially on SAMD21 builds, and getting onewireio consistently back is good. Itsy M0 still doesn't have pulseio, because it has APA102 support for its DotStar, and there's no room. That would be nice to regularize too, but that requires more digging.
@dhalbert and all - quick update, Found the simple example I posted, which is now up at:
https://github.com/KurtE/circuitPython_sketches/blob/main/ESP32 Uarts/simple_version.py
replicates the issue a lot more than my more advanced option which is up there as well:
https://github.com/KurtE/circuitPython_sketches/blob/main/ESP32 Uarts/code.py
The differences mainly have to do with: In simple case I read as many bytes as possible until timeout:
text = input()
te...
Fixes #957. This also corrects a number of things found during testing.
@warm flame is there a UART debug output on the board? It will tell you what the restart reason is
Thanks for the suggestion. If you would like to submit a PR for the unexpected maker feather S2 (or any other boards that you're aware of), that would be awesome. However, I don't think there's much value in going through nearly 400 boards and researching if there's light vs dark images available and nobody has volunteered to do so in nearly 2 years.
The bootrom is likely outputting to the debug UART info about the reset reason. I'd suggest checking that out. You may need a DEBUG=1 build of CircuitPython to enable it.
Want to take this value from the linker script? It is hard coded in internal_flash.h too. Centralizing to the linker would simplify things.
Thanks for the suggestion. The main purposes of having the boards are to allow people with these boards to be able to download the bootloader and showcase the boards that CircuitPython can run on. As you're probably aware we have filters to be able to find boards with certain features, but if we were to unlist or hide the boards, then it would defeat the main purposes.
Perhaps a better idea would be to only show ones available to purchase, though I'm not sure how easy that would be to imp...
Closing because instructions have been added.
Will check tomorrow
#965 will automatically check for this from now on.
This looks really handy! I think you'll want to split raspberrypi (rp2040) from broadcom (raspberry pi SBC boards) though.
@tulip sleet micropython has C nina support: https://github.com/micropython/micropython/blob/master/drivers/ninaw10/nina_wifi_drv.h
Yep, thanks. They're now split. I'm hoping it will save us a lot of manual work and frustration.
the uart pins are attached to the usb chip too. can I check via USB ?
what esp is on the board?
esp32-c3
ah, so maybe the uart is already used for circuitpython
but when I flash the t-01c3 build it works
the t-oi-plus build don't
you could try loading a debug build and seeing if you get any extra output
ya, add DEBUG=1 to the make command
ok
I definitely concur with the intent. However, I'm not sure that's possible, since the literal value is needed before link time. We could add some code to populate the array at startup, but that feels like going one step too far for a relatively small concern.
Given that it's a well known value and hard-coded in the hardware, it's not something that needs to be configurable/flexible - so change is unlikely. The filesystem offsets were duplicated for the original F4/F7 ports, so the situa...
No worries. Just glad to think it over.
on the board image they say gpio20 and gpio21 are UART. But when I look at the schematic they are in esp32-c3 pin 27 28
21 for tx and 20 for rx.
there are usually multiple uarts that are broken out
ok
ya, those look like the default
it is possible that the gpio number isn't the same as the package pin number
ok
I haven't done a ton with the C3
Executing action: all (aliases: build)
Running ninja in directory /home/delarn/Documents/dev/circuitpython/ports/espressif/build
Executing "ninja all"...
[1/6] Performing build step for 'bootloader'
[1/1] cd /home/delarn/Documents/dev/circuitpython/ports/espressif/build/bootloader/esp-idf/esptool_py && /home/delarn/.espressif/python_env/idf4.4_py3.9_env/bin/python /home/delarn/Documents/dev/circuitpython/ports/espressif/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 /home/delarn/Documents/dev/circuitpython/ports/espressif/build/bootloader/bootloader.bin
Bootloader binary size 0x62c0 bytes. 0xd40 bytes (12%) free.
[2/4] Linking CXX executable circuitpython.elf
FAILED: circuitpython.elf
maybe it doesn't help
ok how do I fix this idf.py build error
@slender iron the failed: circuitpython.elf is making me nervoous
I did a idf.py fullclean
idf.py all
just after
[698/700] Linking CXX executable circuitpython.elf
FAILED: circuitpython.elf
again
Any ideas on when this will be fixed? It's a deal breaker for a project I'm working on and hate to have to go to a M0 board...
CircuitPython version
Adafruit CircuitPython 7.3.0 on 2022-05-23; Adafruit Grand Central M4 Express with samd51p20
UF2 Bootloader v3.14.0 SFHWRO
Model: Grand Central M4 Express
Board-ID: SAMD51P20A-GrandCentral-v0
Code/REPL
import displayio
import rgbmatrix
import board
import framebufferio
import audioio
import audiomp3
import digitalio
from controller import Controller
import gc
# RGBMatrix
displayio.release_displays()
matrix = rgbmatr...
This allows the compile stage to optimize most of the translate()
function away and saves a ton of space (~40k on ESP). However, it
requires us to wait for the qstr output before we compile the rest
of our .o files. (Only qstr.o used to wait.)
This isn't as good as the current setup with LTO though. Trinket M0
loses <1k with this setup.
So, we should probably conditionalize this along with LTO.
I swear whenever I take a break from any core work and then come back I mess some upgrade up and break everything in my linux environment. Lesson learned, don't stop working
What caused the Trinket M0
To grow by 1k with this setup? ( duplication of strings? )
Haven't studied the changes yet
I can experiment with this on other builds. Definitely conditionalize on LTO.
If you compiled translate.c with -O3 or something like that, would it help the LTO builds (or the non-LTO builds)?
This code was changed here: https://github.com/adafruit/circuitpython/commit/7100d5e485a93552e035476cb794145d6e194052#diff-a944053c00651f658ae1cb445647c6509c09f656236817a32d11eded4ad449d1R143 about two years ago, before 5.4.0-beta.0. We added a SWRST of the RTC, in preparation for a rework of how ticks are used internally, so we could use less power during time.sleep().
I am not sure we can undo that; we may depend on the tick registers starting at 0, and the RTC being in a known sta...
Thanks for the quick update. I definitely could use an external RTC, it's just a bummer that the board is advertised as including one. Any sense of if this is SAMD51 specific?
after performing the step : source esp-idf/export.sh the script ask me to perform idf.py build
sorry, we have no control over that message. I can add warnings to the Building CircuitPython guide
Thanks
What's the difference between qio and dio ?
for flash chips, 4-bits-wide data is sent over qio. dio is for "dual": 2 bits wide
This is ready for review. The single build failure appears to be a CI problem.
You can often use the same flash chips in several ways: single bit SPI, dual SPI, and Quad SPI
@tulip sleet Nice to know
Now All I need is that the build work
@tulip sleet When I flash the new firmware do I need to flash the bootloader too ?
if you flash the .bin (and erase the chip in advance to remove any partitioing), then you don't need the UF2 bootloader. You can skip that for now to remove an extra possibility of problems.
do you have other ESP32-Sn boards?
ESP32-C3 don't have uf2
oh, sorry, I forgot which board you were working on
so you are just using the ROM bootloader
there is no bootloader to flash
@tulip sleet If I want to check if the build was succesful via debian terminal, how do I do that ?
I think the repl will show up on the tty port the board presents, not sure, I haven't tried it myself. The C3 support is very early.
how do I access the port in terminal ?
let me try it on a QT Py C3 and I'll get back to you. It will be /dev/ttyUSB0 or ttyACM0 or similar
it's on ttyUSB0
you need a terminal program. We recommend tio, so install that, then just do tio /dev/ttyUSB0. ctrl-T is the escape character in tio to send it commands
don't leave tio connected when you are trying to upload the .bin; it will interfere with the upload
ok
I am on tio
:~$ tio /dev/ttyUSB0
[tio 11:56:43] tio v1.32
[tio 11:56:43] Press ctrl-t q to quit
[tio 11:56:43] Connected
can you type at it?
and cursor is flashing
nope
on a reset : ```
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x1 (POWERON),boot:0xd (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:2
load:0x3fcd6100,len:0x16b8
load:0x403ce000,len:0x930
load:0x403d0000,len:0x2d28
entry 0x403ce000
I (31) boot: ESP-IDF 944c01eef 2nd stage bootloader
I (31) boot: compile time 11:25:39
I (31) boot: chip revision: 3
I (33) boot.esp32c3: SPI Speed : 40MHz
I (38) boot.esp32c3: SPI Mode : DIO
I (43) boot.esp32c3: SPI Flash Size : 4MB
I (47) boot: Enabling RNG early entropy source...
I (53) boot: Partition Table:
I (56) boot: ## Label Usage Type ST Offset Length
I (64) boot: 0 nvs WiFi data 01 02 00009000 00005000
I (71) boot: 1 app factory app 00 00 00010000 00200000
I (78) boot: 2 user_fs Unknown data 01 81 00210000 001f0000
I (86) boot: End of partition table
I (90) boot_comm: chip revision: 3, min. application chip revision: 0
I (97) esp_image: segment 0: paddr=00010020 vaddr=3c050020 size=1edc0h (126400) map
I (133) esp_image: segment 1: paddr=0002ede8 vaddr=3fc88e00 size=01230h ( 4656) load
I (134) esp_image: segment 2: paddr=00030020 vaddr=42000020 size=43ac4h (277188) map
I (198) esp_image: segment 3: paddr=00073aec vaddr=3fc8a030 size=004d8h ( 1240) load
I (199) esp_image: segment 4: paddr=00073fcc vaddr=40380000 size=08d40h ( 36160) load
I (213) esp_image: segment 5: paddr=0007cd14 vaddr=50000010 size=00010h ( 16) load
I (216) boot: Loaded app from partition at offset 0x10000
I (219) boot: Disabling RNG early entropy source...
I (235) cpu_start: Pro cpu up.
I (244) cpu_start: Pro cpu start user code
I (244) cpu_start: cpu freq: 160000000
I (244) cpu_start: Application information:
I (247) cpu_start: Project name: circuitpython
I (252) cpu_start: App version: 8.0.0-alpha.0-81-g8dcbd3ab4-dir
I (259) cpu_start: Compile time: Ma 27 2022 11:25:29
I (265) cpu_start: ELF file SHA256: 47ce06cd16a1b45a...
I (271) cpu_start: ESP-IDF: 944c01eef
I (276) heap_init: Initializing. RAM available for dynamic allocation:
I (283) heap_init: At 3FC8CB50 len 000334B0 (205 KiB): DRAM
I (290) heap_init: At 3FCC0000 len 0001F060 (124 KiB): STACK/DRAM
I (296) heap_init: At 50000020 len 00001FE0 (7 KiB): RTCRAM
I (303) spi_flash: detected chip: winbond
I (308) spi_flash: flash io: dio
I (316) sleep: Configure to isolate all GPIO pins in sleep state
I (318) sleep: Enable automatic switching of GPIO sleep configuration
I (326) coexist: coexist rom version 9387209
I (330) cpu_start: Starting scheduler.
Hello, world!
can't type
do you see a /dev/ttyACM0?
will check in a min ... os update
it doesn't look like you've loaded CircuitPython
oh, yes, I see it there
try this build, which is showing up on ACM0 on my QT Py S3: https://circuitpython.org/board/adafruit_qtpy_esp32c3/
the pins will not be right, but it should talk to you
let's try it
I tried to flash wit web esptool
no good
flashing in terminal
same problem
@tulip sleet Just flashed the t-01C3 build and it works
yes
so t01 works but not tOI ? (gack, their model numbers are problematic)
But I need to access those GPIO that are not avalaible in T-01C3 ...
exactly
T-01C3 and t-oiPlus
does the "Absolute Newest" t01 work on the t-oi?
I looked at the build differences and they are minor
yes
where is the schematic for the t-oi?
i am at a loss, so the prebuilt t-OI build that we have does not work, you are saying? Did you try reloading it again?
I'm remaking the build
with default_i2c_bus and default_uart_bus
it may not like the circuitpy bus
I bet we could remove the SRST or do it conditionally on the state of the CTRL register.
It's a little hard to tell, because the build duration times include waiting time, but I think this is saving about 15 minutes, reducing a full build from about 80 minutes to 65 minutes.
@tulip sleet @slender iron in my build folder I got 2 firmware.bin file. one called circuitpython-firmware.bin and the other firmware.bin
firmware.bin is what you want - it's combined with other stuff to make a ful .bin
if you build the 01 firmware yourself, does your own build work?
So I would stay start with the 01, and start making the OI changes, one by one, but I think you are doing that
it could be the never reset stuff - that is my highest suspicion, but just because it's the most complicated change
What caused the Trinket M0 To grow by 1k with this setup? ( duplication of strings? ) Haven't studied the changes yet
I suspect LTO is duplicating copies of the compressed data because each compilation unit (.o) now has it's own copy. So if the same error occurs in two files, there will now be two copies of it. I haven't proven this though.
Has something changed about the mu-editor. I haven't used it in a few months, but IIRC I could open the serial window, do a ctrl-c, and get REPL. Now I get a flashing cursor in the serial window, but nothing else. I am using 1.0.3 with a pybadge. I know the connection work because I can save/modify code.py
yup
make sure you have the rights to /dev/ttyACM0
you probably need to add yourself to the dialout group
I can get a repl with gtkterm just fine. permission should be the same
do you have the gtkterm open right now? because only one program can open the serial connection at a time
There is a gtkterm running but it is connected to /dev/ttyUSB0. If I start a gtkterm, it will connect to /dev/ttyACM0 and display the REPL. If I kill it and restart mu-editor, the behavior is the same.
2022-05-27 18:53:48,250 - mu.modes.base:227(find_device) INFO: Found device on port: ttyACM1
2022-05-27 18:53:48,251 - mu.modes.base:228(find_device) INFO: Serial number: e00fce6898dcda8f48f21674
2022-05-27 18:53:48,257 - mu.modes.base:278(add_repl) INFO: Started REPL on port: /dev/ttyACM1
2022-05-27 18:53:48,257 - mu.modes.base:259(toggle_repl) INFO: Toggle REPL on.
It looks like mu-editor thinks it is starting REPL.
but ACM1
just noticed that.
the pybadge is on acm0, I can verify that with gtkterm. Let me look at my logs and see what got ACM1.
You were rightish! The Boron, which I normally only think of in terms of /dev/ttyUSB0 claimed ACM1 which is what mu-editor is glomming onto. Unplug the boron and things work fine. Thank you!
May 24 21:52:46 alton kernel: usb 1-4.4.2.4.1: Product: Boron CDC Mode
May 24 21:52:46 alton kernel: usb 1-4.4.2.4.1: Manufacturer: Particle
May 24 21:52:46 alton kernel: usb 1-4.4.2.4.1: SerialNumber: e00fce6898dcda8f48f21674
May 24 21:52:46 alton kernel: cdc_acm 1-4.4.2.4.1:1.0: ttyACM1: USB ACM device
One of the rare times a power-only USB will be useful!
I'm having difficulties doing 512-bit rsa key parsing as well.
that seems to be a bug, Mu normally should pick a port whose name starts with "Circuitpython CDC ", and if there are multiple it should show a menu in the bottom right (with possibly useless "circuitpython board" tags for each but still)
(https://gist.github.com/richardanaya/2158b09c52c3b2ea904aaeb48c524062
code.py output:
Traceback (most recent call last):
File "code.py", line 9, in <module>
File "/lib/adafruit_jwt.py", line 101, in generate
RuntimeError: pystack exhausted
```)
Add a link to @todbot's repo and learn guide in the Code section
As mentioned in issue #6274 there was a request to add the ability to statically set your IP address. Using @anecdata's suggestions I have added in this functionality. There are three new methods for wifi.Radio:
stop_dhcp- Stop the DHCP client (required to set a static address)start_dhcp- Start the DHCP client (will automatically grab an IP address if it was stopped)set_ipv4_address- Provide the static IP, subnet and gateway addresses (all are required). This will sto...
Thank you! I had forgotten about awesome-circuitpython. In my list of recs to people!
I'm reinstalling the whole toolchain
@tulip sleet I started by changing the names
@shell bolt do you compile your code with clang?
in mpconfigs and sdkconfig
and adding more pins should be fine
did you reinstall the toolchain with esp-idf/install.sh ? I assume so
I looked into this this afternoon. -Oz without LTO is still too large on SAMD21. It's not possible to -Oz with LTO and lld.
Relevant talk about LTO and sections: https://www.youtube.com/watch?v=hhaPAKUt35E
Changes for it are here: https://github.com/tannewt/circuitpython/tree/clang13
Build of feather_m0_express from dc5565a5c is 65664 bytes free in flash.
With clang -Oz no lto, 12824 bytes are free.
-Oz not supported in the linker: https://reviews.llvm.org/D63976
For which target ?:)
I was trying on m0+ (samd21)
Ah, clang support for arm isn't great, I've mainly used it with Risc-V. There's this POC from Arm, but I haven't tried it: https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm
This adds a tilegrid.contains() function that accepts a touch tuple from adafruit_touchscreen library (or similar) and returns true or false based on whether the touch point is inside the rectangular bounds of this tilegrid.
do you know how different that is compared to normal clang?
@tulip sleet I've added the SDA SCL in the pins but not in the mpconfig
now adding the battery stuff
do I have to do a make clean??
you can do make BOARD=... clean, it can be necessary if there are new strings (which pin names are)
I think it's mostly about the libraries you need to build against, like the C standard library. Here's a good article that may be helpful: https://interrupt.memfault.com/blog/arm-cortexm-with-llvm-clang.
Yup, I followed that. Got it going but it was too large. No size optimized lto
So I know building with PyStack=0 and Stackless=1 probably means you can't tell much from my results, but just in case it helps...
I though I'd try running @richardanaya 's code on my build. As soon as I try and import adafruit_jwt I get the following:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: maximum recursion depth exceeded
Fix board description, no PSRAM.
Not sure if this helps identify anything. I decided to try wave format and the issue does not occur from the file I tested.
wav file: https://learn.adafruit.com/circuitpython-essentials/circuitpython-audio-out
import displayio
import rgbmatrix
import board
import framebufferio
from adafruit_display_shapes.rect import Rect
import audioio
import audiocore
from time import sleep
import gc
# RGBMatrix
displayio.release_displays()
matrix = rgbmatrix.RGBMatrix(
width=...
Hi,
I would like to add a link to the http://pewpew.rtfd.io documentation in here, but I'm at a loss where it would belong. PewPew started as a featherwing for making simple games, but it gradually evolved into several independent devices, and a whole lot of tutorials, guides and example games. I use it for running Python programming workshop, and I think it could be a very useful tool for educators, but where to put it? Under "Guides", because there are tutorials? Under "Code", because of...
I think Frameworks makes sense. It is an ecosystem. There aren't really other examples exactly like it in Frameworks. You could put multiple links in Frameworks if there is more than one "top level".
I think some of the things in Frameworks could really be a new category like "Workflow" or "Programming Tools".
For now I think I will leave this for someone who actually uses and knows the ESP32 hardware/software to debug and update the code to work.
I sort of traced the code, to where I think the data comes in on an ISR, and the handler than calls through a few layers of code to read the stuff from the ESP32, into a buffer. It then returns and then this buffer is copied into a ring buffer. When the data is requested, the code then calls off again through layers to copy all or part of the data f...
This PR contains all of the changes made by cloning a fresh copy of this repo on main branch and then running pre-commit run -a with no other modifications.
Most of the changes are formatting around ** operator with spaces inside of files in tools/ and tests/
We can close this if we don't want the changes from it. I think it was mentioned durning brief discussion during the meeting a few weeks back to make this PR and see if we want to pull in the changes from it.
It would ...
Looks like I had an out of date version of Black which is why all of these things got flagged by the formatter and changed.
This failed actions here because of the format check which led me to look into the versions.
After updating my local black to the same version as the actions container is using I no longer get the big list of changes on fresh clone. :tada:
I have new commits coming that add this as an argument to the display construct function. I need to go through and update all of the devices with built-in display to utilize the new argument to get it ready. I have tested this approach on the Titano and it does seem to work as expected to allow that device the full range of brightness.
@dhalbert Here is a simplified single file version that should be easier to parse through. At its core, it's doing the same thing without object-oriented methods. I got a USB disconnect and hang at about 90 minutes on this one.
I have proposed one fix to the ESP32SPI library to solve a different problem. I'm not sure it has anything to do with this, but worth trying: https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/pull/166
@dsohrabian if you add gc.collect() at the end before or after the time.sleep(30), does it make any difference? I'm wondering if it's fragmentation or not.
Using CircuitPython to control stepper motors is currently pretty ugly. At the moment, I use PWMOut, precalculate the frequency steps needed to provide pseudo acceleration/deceleration, compute the time necessary for the total steps in each PWM window, sit in a timing loop while monitoring a digital input 'limit switch' and end up sorta close to the total number of steps I wanted. I realize that I may get better precision with PulseIO or AudioPWM, but they have their own issues. It would be p...
I'm playing with a Sparkfun SAMD51 Thing Plus which I thought had 4 MB (megabytes) of SPI flash but the CIRCUITPY drive only has about 500K available space. After digging through the CP flash code for a couple days, I finally noticed that the external SPI flash on the Sparkfun board is 4 Mb (megabits) or 512 KB in size.
So this now changes my confusion about this board. Now it appears to have too much Flash. There is 1 MB (megabyte I think 😋 ) internal flash on the ATSAMD51J20 microprocessor but the mpconfigboard.mk file in ports/atmel-samd/boards/sparkfun_samd51_thing_plus does not have the INTERNAL_FLASH_FILESYSTEM flag enabled so I wouldn't expect CP to be using the flash on the controller. I think I saw somewhere that under some conditions CP will cut the available flash in half for the file system and if that's what it's done then the 500K available makes sense.
I guess I have two questions:
-
Did I miss the setting of the INTERNAL_FLASH_FILESYSTEM flag for this build somewhere or is the internal flash selected by some other means?
-
and from a what the heck perspective, why would Sparkfun put a 512KB SPI flash chip on a board with a microcontroller that has 1MB flash onboard?
Thanks for the API writeup. We generally recommend using a PCA9685 or similar to drive steppers, since it takes care of doing this without any timing difficulties. You need motor driver power components anyway, so the PCA9685 is the least of it. What are your reasons for preferring to do it directly?
on chips with internal flash the entire external flash is dedicated to the CIRCUITPY drive, so 500kB for the drive seems to match ?
RP2040 and ESP builds need to share the flash with the CP binary, so it's a different situation
Ah, never tracked down the logic that chooses the external flash if there is internal. Thanks.
as it turns out the thing plus build uses less than half the internal flash, but that just means the space is left unused, it could be filled with more builtin modules in the future
462472 bytes used, 561528 bytes free in flash firmware space out of 1024000 bytes (1000.0kB).
Yeah, it's sort of ironic that the file system would actually have move space if CP ignored the external flash chip
Just for kicks, maybe I'll take another whack at trying to get a custom build of CP to ignore the external flash, my first attempt at that didn't go to well 😆
As far as I can tell, the PCA9585 CP library doesn't really handle any of the specific things I'm looking for, such as generating a precise # of pulses, smooth frequency acceleration/deceleration, and monitoring of limit IO to stop motion. Is there something I'm missing? If I need to separately modify and time the PWM frequency for acceleration, and separately monitor the limit IO, and then communicate over I2C to the PCA9585, that makes my problem even worse with regard to precision stepping...
Actually, if CP cuts internal flash in half, I guess the available space would be the same and maybe my earlier attempt did work and I just didn't notice because the file system is using 512KB either way. Oh well... Thanks I think I can finally put this down now.
CP doesn't cut anything in half, I don't know where you got that, it just takes the space it needs
I understand. Yes, an enhanced seesaw could do something like this. Have you looked at the Tic motor controllers from Pololu?
https://www.pololu.com/category/212/tic-stepper-motor-controllers
https://www.pololu.com/docs/0J71
more accurately the space used by the drive when using internal flash is defined somewhere, and CP uses the rest
This is what led me to that conclusion (in circuitpython/ports/atmel-samd/mpconfigport.h)
// If CIRCUITPY is internal, use half of flash for it.
#if INTERNAL_FLASH_FILESYSTEM
#ifndef CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE
#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (FLASH_SIZE / 2)
#endif
#else
#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0)
#endif
#endif // SAM_D5X_E5X
yeah ok that's the default for samd51
Another interesting possibility would be to use the RP2040 PIO capability to write the short control programs you would need.
Yeah, the Pololu controllers would work, though they are considerably more expensive than the seesaw. They could replace our external stepper drivers for some of our steppers, and we could use the step/dir outputs for the NEMA52 drivers. The Status: Rationed and low stock is a bit concerning :) Not sure of their long term reliability.
I have thought about the RP2040 PIO, and it's a possibility I think, though it's a bit tricky to get the right math for smooth acceleration/deceleration. If ...
Oh, I didn't intentionally update adabot so thank you for double-checking that!
https://github.com/agronholm/exceptiongroup just became aware of this, not sure if it helps with adopting taskgroups in CP
Checking for button presses in the background makes it much easier to write interactive programs, as we no longer have to worry about missing them. It would be nice to have a similar functionality for touch inputs, so that buttons and touch pads would truly be interchangeable, and could be handled by similar code.
Perhaps we could add a TouchPads class to the keypad module, which would only be compiled if touchio is enabled, and which would do the same as keypad.Keys, but with touc...
Fixed STM SPI frequency settings.
Corrected default frequency settings in common_hal_busio_spi_construct.
Fixed common_hal_busio_spi_get_frequency.
Could you explain how it was wrong before? Just want to understand the changes.
@dhalbert No luck, board freezes (LED keeps lit with last update) and USB disconnect.
I am printing gc.mem_free() every round and it is staying stable.
Can you reproduce the error with your own Matrix Portal M4 and LED 64x32? It would be good to know that this isn't a hardware or quality control issue with one of the pieces. This seems like it would be a major and prevalent bug for a product that is advertised to specifically fetch internet data and put it on an LED board. But I don't ...
@kmatch98
Hello,
I have recycled 2 Crestron TSW 750 and I would like to use them but I can't because of the proprietary system.... I saw that you managed to get some of them to work. Could you please tell me how to do it? It would be a shame to throw them away....
I would like to display sensor data or a web page with my home automation like Jeedom or other. I saw that the TSW 750 has a micro sd card but I don't know if I can install a system inside.
Translated with www.DeepL.com/...
gc.mem_free() being stable means that gc is working. But the gc is not compacting, so there can be enough free memory, but it could be fragmented, and not have enough contiguous space for a requested large buffer. If one does gc.collect() before the fragmentation has a chance to happen, then it cn be avoided.
I think it may have to do with what is being fetched. If the HTTP response is of constant length, or nearly so, then the same memory block can get used over and over. If it grows ...
Could you explain how it was wrong before? Just want to understand the changes.
Sure, with pleasure.
Here is some background information:
Default SPI frequency settings are defined by SPI peripheral clock frequency (1) and SPI peripheral prescaler (2).
SPI bus frequency value := peripheral clock frequency (1) / prescaler (2)
The prescaler value is stored in self->prescaler (A). The prescaler register value is stored in self->handle.Init.BaudRatePrescaler (B).
...
Thanks for the fixes and the explanation!
Sorry I know I'm a bit late to this conversation, but I thought I would add this in case it helps anyone else.
It's really easy to change the device name if you want to. Just download the Circuit Python .UF2 file and using a Hex file editor (I used PSPad) search for "CircuitPython Audio". You can then edit the Text, save the changes and install your modified version of the .UF2 file.
The Pi Pico should then appear with the new name you gave it.
Thank you, that is interesting. I have a lot to learn about memory use.
I have gc.collect() sprinkled throughout now. And will see how this goes.
As far the transit site: it definitely tolerates requests every 30 seconds. The site is even hard-coded to auto-refresh on that interval if you leave it open on browser. It is meant for public wear and tear and probably doesn't get much traffic. I push it and fetch 4 times on 30-second interval (which is the ultimate need of this project, bu...
@dhalbert @ThomasAtBBTF @futari-media - I was playing around instrumenting more of the code like setting/clearing IO pins around the ISR and the like, but every time I would start my sketches I am getting a little garbage on the input of each UART...
So I added a call to reset the input like:
uart2 = busio.UART(board.IO17, board.IO18, baudrate=115200)
uart2.timeout = 0.1
uart2.reset_input_buffer()
Which cleared that up, and it also so far has the current test sketch working ...
Awesome! Glad to see that you’re trying to use these displays. In my work I discarded the original circuit board and just used the display touch panel and added different electronics.
Here is some background on what I’ve done.
https://hackaday.io/project/184118-crestron-tss-752-teardown-rebuild
https://hackaday.io/project/183895-crestron-tsw-732-teardown
If you want to just reuse the touch panel display, first you will need to figure out the pin outs for the display connector. ...
@dhalbert One thing I've reproduced a couple times: when I comment out all the Matrix objects and don't engage with the LED matrix in any way, the board hums along and requests for 24 hours+ with no issues. The second I bring the LED display (via adafruit_matrixportal Matrix) into the picture, alongside fetching data online, the system will inevitably hang.
The second I bring the LED display (via adafruit_matrixportal Matrix) into the picture, alongside fetching data online, the system will inevitably hang within couple hours.
Thanks, that is very helpful.
fwiw, for over a month I've had three ESP32-S3 UART senders sending to one UART receiver ESP32-S3, with the following (pretty aggressive) config:
uart[0] = busio.UART(board.IO6, board.IO7, baudrate=921600, stop=1, timeout=1, receiver_buffer_size=65535)
uart[1] = busio.UART(board.IO16, board.IO17, baudrate=921600, stop=1, timeout=1, receiver_buffer_size=65535)
uart[2] = busio.UART(board.IO10, board.IO11, baudrate=921600, stop=1, timeout=1, receiver_buffer_size=65535)
The code doe...
@anecdata
Thank you for sharing your observations and thank you for mentioning reset_input_buffer() !
I did not have this in my test-code and I can say, that calling reset_input_buffer() certainly changes the behavior of the UARTs.
This code:
`uart1 = busio.UART(board.TX, board.RX, timeout=0.01)
uart2 = busio.UART(board.D13, board.D12, timeout=0.01)
uart3 = busio.UART(board.D11, board.D10, timeout=0.01)
uart1.reset_input_buffer()
uart2.reset_input_buffer()
uart3.reset_input_bu...
@KurtE It seems to me that you should look at the ESP32-S3 transmitter side and not the receiver side.
Current lint results:
npx awesome-lint https://github.com/adafruit/awesome-circuitpython
✖ Linting
README.md:223:1
✖ 1:1 Missing main list heading remark-lint:awesome-heading
✖ 1:1 License was not detected by GitHub remark-lint:awesome-github
✖ 26:1 ToC item "In the news" does not match corresponding heading "News" remark-lint:awesome-t...
@ThomasAtBBTF and @anecdata thanks for the inputs. I am not sure how much farther I will take this.
I personally don't really use ESP32s. I was mainly trying them out to see how they behave. In particular I was debugging some stuff with the Teensy 4.x ports to CircuitPython. So I tried out some test sketches on a few different processor chips to compare, including the RP2040 and then ESP32-S3.
I reported the issue on the S3, but it was mentioned that CircuitPython on Teensy and...
This potentially Closes #35. However, all the outstanding issues should be resolved before merging this PR, so that we don't add CI only to see it be red all the time.
@KurtE It seems to me that you should look at the ESP32-S3 transmitter side and not the receiver side.
You are right that the TX is screwed up...
Sketch:
import time
import board
import busio
import supervisor
uarts = []
board.UART().deinit()
uarts.append( busio.UART(board.IO6, board.IO7, baudrate=115200, stop=1, timeout=1, receiver_buffer_size=255))
uarts.append(busio.UART(board.IO16, board.IO17, baudrate=115200, stop=1, timeout=1, receiver_buffer_size=255))
uarts.appe...
Corrected all the bugs that were making the bootloop.
Do you not want to make the Grove connector be board.I2C() ?

Do you not want to make the Grove connector be
board.I2C()?
would be nice, but I had such an hard time making the board work. I'll plan for a future dev.
Hi there,
I can't use I2C on the Waveshare. The board should be able to use several sets of GPIOs as I2C pins, but I can't get any of them to work:

...and I don't see any of them defined as such in pins.c.
@rcarmo this sounds more like a support issue. What is not working? You should be able to do
i2c = busio.I2C(board.GP1, board.GP0)
etc. for any pair of I2C pins (I2C0 or I2C1 pair).
Maybe this is a message for danh (no tag as this is low priority and a day off),
I would like to use keypad to simultaneously scan a KeyMatrix, and an independent Key on a GPIO. (this is the case for C64 keyboard that have a 8x8 matrix plus the RESTORE key, this is also the case for the BBQ20KBD and the to right button that is wired outside the matrix)
The idea would be for those to share an Event queue so that event stay in order and I don't need to merge two queue in userland.
I have checked those two documentations, but I don't see the way to do what I want:
- https://docs.circuitpython.org/en/latest/shared-bindings/keypad/index.html
- https://learn.adafruit.com/key-pad-matrix-scanning-in-circuitpython/overview
The kind of API I expect is to be able to add arbitrary number of matrix, GPIO and shift register, and have CP scan that and collect the event. Where should I publish that as an issue?
PS: For Kattni, maybe you could hint about the existance of keypad build-in in this guide: https://learn.adafruit.com/matrix-keypad maybe that learnguide is outdated and use old technique to scan keys?
<@&356864093652516868> Just a reminder that our meeting is in just over 24 hours due to a US holiday. Talk with you tomorrow!
You can add an issue to circuitpython. Events now have time stamps, which might help somewhat in what you want
I would do that with a python library, the events have a timestamp so having a next_event() that gets the next event of each queue, returns the oldest and caches the other should be simple enough
I'm starting to get errors on my own libraries using Sphinx that language = None isn't good with Sphinx 5.0.0, and my guess is it'll be an issue for the libraries too. @idle owl, just a heads up that may need to be a patch that will need to be applied for the documentation to be published properly to RTD.
The good news is spent the week developing my patch tools so if we want to move to Sphinx 5.0.0 I can fix it pretty quickly. Or pin back to Sphinx 4.0.0
Ok, that's an option. Right now I erronously added that GPIO to the matrix as a row(?) and a press trigger one event for each column(?) so I can just filter out and not use n-1 of them. But I felt that something was missing. I did not check KMK yet, not sure if they handle that.
The fix is easy, just changing to language = "en" in docs/conf.py
Yeah, I re-ran the CI on a library that previously had no issues, and it popped out there as well :/
I guess this is a problem for everywhere where Sphinx is pinned as sphinx>=4.0.0 and language is explicitly equal to None so heads up y'all!
The instant I issue that call I get
RuntimeError: No pull up found on SDA or SCL; check your wiring
Regardless of pin, circuit, device, anything. This leads me to believe the I2C initialization is broken.
@rcarmo Please open a thread in https://forums.adafruit.com or on discord: https://adafru.it/discord. Include your code and a photo of your wiring, and which version of CircuitPython you are using. Are you using breakouts with pullups?
There are other RP2040 boards very similar to this that work fine (e.g., QT Py), and I don't see anything unusual about this board definition.
Okay, fix is easy for the libraries via Adabot patching, so here's the PR for the fix! I can have this done today as well. https://github.com/adafruit/adabot/pull/266
@proven garnet Thank you so much for catching this and the super quick fix!
No problem! Always easy when it's a holiday 
Patched! Took longer because my laptop decided to go wonky during the patch so it was harder to find failures, but I managed to get a script to do it. Between adabot and manual patching problem should be settled!
Hello, @cold wharf and I just joined the server and wanted to introduce ourselves. Alex and I make cat-shaped educational boards with a focus on learning cybersecurity and ethical hacking as HakCat.com.
We’ve been creating CircuitPython labs that run on our ESP32s2 based Nugget boards with tutorial videos on the Hak5 YouTube channel. I’ve had some great conversations with CircuitPython developers, and I was encouraged to join this server while I work on new labs. If anyone mentions one of our boards, we’re happy to answer questions. I hope we can contribute here!
Hey welcome! Quiet in here today cause of the holiday. I'll make a point to check out your boards later!
A few of the libraries seem to have new issues probably resulting from the upgrade to Sphinx 5.0.0, looking into those now
Heyo! Im Alex, the main Nugget developer. We look forward to sharing our contributions with this community!
This is still broken in Sphinx 5.0.0.
CircuitPython version
Adafruit CircuitPython 7.3.0 on 2022-05-23; FeatherS2 with ESP32S2
Board ID:unexpectedmaker_feathers2
Code/REPL
import adafruit_requests
import ssl
import socketpool
import wifi
import dualbank
from secrets import secrets
print('connecting to wifi')
wifi.radio.connect(secrets["ssid"], secrets["password"])
print('wifi connected')
pool = socketpool.SocketPool(wifi.radio)
requests = adafruit_requests.Session(pool, ssl.creat...
Is this user error?
I'd be willing to put together a guide or working example for this if someone can get me going.
@onyx hinge thanks for the astroid fix! I wonder why it does not seem to be actively maintained.
Yeah the last release was some time ago!
This applies the equivalent of https://github.com/readthedocs/sphinx-autoapi/pull/340/files by "monkey" patching, that is, using the dynamic nature of Python to replace the buggy function _format_args with the fixed version.

Besides working on that sphinx bug today I also toured Königstein near Dresden Germany. Hope y'all are well.
What a view
Thanks for this fix!
It appears that we might be able to stop using autoapi in the long run: https://stackoverflow.com/a/62613202/142996, but I don't understand the whole sphinx ecosystem well enough to know that for sure.
<@&356864093652516868> Weekly meeting is today at 2pm Eastern / 11am Pacific / 1800 UTC. See the pinned messages for a link to the notes doc. See you then if you can make it!
@tulip sleet it would be nice if some of this stuff were better signposted!
@tulip sleet would you please add me to the "circuitpythonistas"
done
Thanks for diving in to this!
Using this test code on a
Adafruit CircuitPython 8.0.0-alpha.0-22-g297aa91f2 on 2022-05-27; Adafruit QT Py ESP32S2 with ESP32S2
to set up the static parameters:
print(f"Setting IPv4...")
wifi.radio.set_ipv4_address(ipaddress.ip_address("192.168.6.252"),
ipaddress.ip_address("192.168.4.1"),
ipaddress.ip_address("255.255.252.0"))
print(f"IPv4 {wifi.radio.ipv4_address}") # None
print(f"Gat...
The second I bring the LED display (via adafruit_matrixportal Matrix) into the picture, alongside fetching data online, the system will inevitably hang within couple hours.
Just to clarify, is just import adafruit_matrixportal enough to cause trouble, or are you displaying things?
It freezes when I am instantiating a Matrix object and using it to display
data derived from requests. I've noticed the import alone doesn't cause the
glitch.
On Tue, May 31, 2022 at 1:03 PM Dan Halbert @.***>
wrote:
The second I bring the LED display (via adafruit_matrixportal Matrix) into
the picture, alongside fetching data online, the system will inevitably
hang within couple hours.Just to clarify, is just import adafruit_matrixportal enough to cause
trouble, or are y...
Sorry, skipping the meeting, no notes, not even listening LIVE. I have not done much anyway, despite an extra day.
I don't have access to main for neopixel so if anyone who does has a minute, please take a look at the PR patch I submitted for it. It's the same one the rest got yesterday, for what it's worth, nothing fancy.
I'll get to it today.
We had to lock it down after a broken PR got merged. So we limit who can touch it.
Since it's such a widely used library.
<@&356864093652516868> Weekly meeting starting now in CircuitPython audio channel
Yes, please send interesting tidbits
About this week's guest
Engineer and Maker Anne Barela is currently a consultant for Adafruit Industries, LLC. She retired in 2018 as a senior Foreign Service Officer and Security Engineering Officer for the U.S. Department of State. Anne is a graduate of Whitman College (mathematics/physics) and the California Institute of Technology (elec...
Naomi Ceder earned a Ph.D in Classics several decades ago, but switched from ancient human languages to computer languages sometime in the last century. Since 2001, she has been learning, teaching, writing about, and using Python.
She has attended every PyCon since the first one in 2003 and was one of the originators of the Poster Session, the ...
A Time of Gifts
Delivered as the closing keynote of PyCon 2022, Salt Lake City, Utah, 2022-05-01
I don't usually post the text of talks I've given, but I thought I'd make an exception for this one. Th
Sign up for newsletter https://www.adafruitdaily.com
@dhalbert @ThomasAtBBTF @futari-media - From the hints from the last few posts, I think I may have found something that is making it work better, but not sure what to do with it. Also would need more testing.
And then there is what to do to make it work, versus someone to properly do it.
Theory: the hardware FIFO queues were not properly setup and working right, especially after soft reboot...
So what I did that appears to resolve the issue with TX being screwed up and guessin...
He fixed the linter on the awesome list, too!
Thanks Melissa!!
🎉
Hi all - just wanted to pop in and say hi and thanks all!!
Thanks!
Has this been fixed? It looks like the CODE OF CONDUCT now links to an online page (HTML) instead of 404'ing. Or am I misunderstanding?
tekktrik appears to be right. I tested both the original link and the only other Markdown I could file, and both pages load the HTML page and no longer 404:
- https://docs.circuitpython.org/en/latest/docs/common_hal.html (common_hal.md)
Unless I'm misunderstanding too, this can be marked fixed and closed.
--Paul
Thanks all! Have a great week!
@proven garnet Nice work, almost every documentation issue I look at, you're already on it. 🙂
Hi @pree-T - are you still working on this? I'm happy to help if you want or need it.
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/1KXxPd9X8w8UI8Cg-YgWBTlw8rMMlCBpzM2-osVtJDrg/edit?usp=sharing
Hi, @calcut, the bin fetched from circuipython.org, starts at address 0x0 and includes various partitions that can't be updated using dualbank, the actual firmware is at 0x10000 in the bin (checkout the following partition table).
https://github.com/adafruit/circuitpython/blob/ebe442cd9dac31204f3d4f74ec615040ed21fe2a/ports/espressif/esp-idf-config/partitions-16MB.csv#L1-L10
I recommend fetching the firmware from [CircuitPython's S3 Bucket](https://adafr...
@errant grail Did your NAU module that you added to the bundle end up on PyPI?
Not that I know of.
Appears to work on S3 and S2, although still found it good to reset the input buffer.
Here is current sketch on S3:
import time
import board
import busio
import supervisor
from digitalio import DigitalInOut, Direction, Pull
uarts = []
board.UART().deinit()
uarts.append( busio.UART(board.IO6, board.IO7, baudrate=115200, stop=1, timeout=1, receiver_buffer_size=255))
uarts.append(busio.UART(board.IO16, board.IO17, baudrate=115200, stop=1, timeout=1, receiver_buffer_size=2...
@errant grail Would you be willing to post it to PyPI?
Thanks! Happened to notice on my own stuff because I basically copy paste all my documentation infrastructure from the libraries because work smarter not harder 😂
It's also about all I can currently contribute to the core haha
me too! that's why I was looking at docs. 🙂
Not inclined to. Navigating the community bundle submission process was too far out of my wheelhouse. However, in a discussion with Ladyada, I gave her permission to use the driver code as needed without attribution.
Thank you for submitting it! That's entirely fair. She requested that I ask you. I'll see what she wants to do.
Super! I’d love to remove it from the bundle at some point so that I can declutter my personal repo.
Can't say that will happen anytime soon. If you're really keen on us taking it over, I can talk to her and see if she wants to take it on "officially". Also, no worries on the PyPI thing.
Yes, I’m keen on it. Thanks.
Probably the proper fix would be to change: void common_hal_busio_uart_construct(busio_uart_obj_t *self,
to not call all of the individual setup functions within the idf, but instead call:
This sounds right to me. Thanks for digging into this!
//| def stop_dhcp(self) -> None:
//| def start_dhcp(self) -> None:
Thanks for adding this! I can't think of any changes but did see two minor doc issues.
Two minor nitpicks. Thanks for adding this! Group would be cool to do too.
//| """Returns True if first two values in touch_tuple represent an x,y coordinate
//| inside the tilegrid rectangle bounds."""
//|
Nitpick. They baked "boolean zen" into us at uni.
return x >= self->x && x <= right_edge &&
y >= self->y && y <= bottom_edge;
I was working on issue #4664 but I found a few other small issues and instead of opening issues for each I hoped it would be ok if I just submitted one pull request that addressed them all. I tested these changes with a dht22, an ir remote and an rcwl-1601 and all work as expected. Below is a list of changes.
Fixes #4664
Addresses #4946 since just dropping short pulses isn't a valid way to filter out short pulses
Fixes a buffer start index reset bug on [line 160](https://github.com/adafr...
CircuitPython version
Adafruit CircuitPython 7.3.0 on 2022-05-23; Adafruit ItsyBitsy nRF52840 Express with nRF52840
Code/REPL
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
import time
import adafruit_ble
from adafruit_ble_adafruit.adafruit_service import AdafruitServerAdvertisement
from adafruit_ble_adafruit.temperature_service import TemperatureService
# PyLint can't find BLERadio for some reason ...
+1 vote for wanting a circuitpython stepper library
I don't know if this is helpful but https://www.airspayce.com/mikem/arduino/AccelStepper/ and https://github.com/luni64/TeensyStep are two libraries that I have used in the past that work well for Arduino.
@stuck elbow I'm thinking about CP's built in font
what do you think about one that is 6x12 and then we could add 12x12 emojis
I can design anything as long as it's at least 3x5 (not counting the spacing)
I want to make the blinka in the corner a snake emoji
6x12 seems huge to me
its 6x14 now
ya, that's the problem if I add emoji support
it'll be harder to have different font sizes
Interesting PIO stepper links:
https://forums.raspberrypi.com/viewtopic.php?t=300874
https://www.youtube.com/watch?v=UJ4JjeCLuaI
https://vanhunteradams.com/Pico/Steppers/Lorenz.html
https://github.com/DasenB/PicoStepper
http://people.ece.cornell.edu/land/courses/ece4760/RP2040/index_rp2040_C.html
https://forum.micropython.org/viewtopic.php?t=10199&p=56656
I think I'm not in the target audience for that feature
ya, we could have the top status bar without the snake emoji
by the way, I've been meaning to ask, are the escape sequences for the terminalio documented anywhere?
I wanted to make a menu in text mode
I tried a couple vt100 commands and they didn't work
here is my status bar test
I was going to implement what I need there
commands are implemented here: https://github.com/adafruit/circuitpython/blob/main/shared-module/terminalio/Terminal.c
I looked at it, but it's a bit convoluted
ya, it is
so you will need an escape code for setting the scroll area now?
yup
and saving and restoring cursor location
a status bar seems like the best way to show wifi, ble, usb and usb host status
if you used a separate terminal tilegrid, you could use different fonts for them
ya, at a flash cost though
even different text orientation
I assume this is for boards like the esp32 ones that have plenty of flash
I really don't see a status bar on a 128x64 display
especially if it's 12 pixels high
with the 4x6 font it just fits most exceptions in the 64 pixels
if the screen is high res then it'd be hard to read though
we could just drop the 12x12 emoji if the font is smaller
blinka is 16x16 atm
I think I had smaller blinkas somewhere
the storage for emojis is also going to eat flash
I assume they won't be stored in the font?
ya, I'd only store the snake blinka on small builds
I think they'd need to be separate to be more colors
if you want a custom font, you could have it use more colors too. In Stage I use a 4-color font, so I get to anti-alias the letters
you would then just need custom palette for the emoji
custom font could work for english but then other languages would be left out
why, you can have diacritics in a custom font
it's just a lot to add
mostly copy-paste
ya, true
I can't imagine a 4x6 font on this esp display
6x12 is pretty small already
right, I don't think one font will work for everything
also, 4 colors means it's 2x bigger in the memory
I would say we need a small font, possibly without emojis, for small screens like the OLEDs, and a big font for the larger displays
could we antialias a 6x12 font down?
scaling down doesn't work at those sizes very well, at the very least you would need pixel hinting, most fonts require manual touch up
do we need cirillics and greek too?
or just latin with diacritics?
if you want to generate a font, best take a ttf font with good hinting and use that
I'll keep using terminus
just realized I was making it 6x14 due to a misunderstanding of offset
@tulip sleet could you pull the language download stats when you have a chance?
sure, do you want for all time or since 7.0.0 or something?
something recent-ish
SELECT language, count(*) FROM "default"."adafruit_circuit_python_downloads_details" where board <> '' and language <> '' and version like ('7.%')group by language order by count(*) desc
I am not sure about the en_us (as opposed to en_US) ones
maybe it's just that case gets ignored on fetches
do we have terminal enabled for ja?
SELECT lower(language), count(*) FROM "default"."adafruit_circuit_python_downloads_details" where board <> '' and language <> '' and version like ('7.%')group by lower(language) order by count(*) desc
looking...
This is only in the atmel-samde Makefile:
# We don't have room for the fonts for terminalio for ja and ko
# so turn off terminalio, and if it's off and displayio is on,
# force a clean build.
# Note that we cannot test $(CIRCUITPY_DISPLAYIO) directly with an
# ifeq, because it's not set yet.
ifeq ($(TRANSLATION), ja)
CIRCUITPY_TERMINALIO = 0
RELEASE_NEEDS_CLEAN_BUILD = $(CIRCUITPY_DISPLAYIO)
endif
ifeq ($(TRANSLATION), ko)
CIRCUITPY_TERMINALIO = 0
RELEASE_NEEDS_CLEAN_BUILD = $(CIRCUITPY_DISPLAYIO)
endif
and only off for samd21
i would like to understand why the ru build is so big. Sure, the UTF-8 chars are mostly double-wide, but they are on the same code page, so the first byte would be the same. So why doesn't the huffman handle this succinctly, with the code page encoding being very narrow?
the ru translation is only 20-25% done, or maybe even less
ja does have terminal but the ja chars are ignored
so nothing in the font?
yup
maybe ko was/is in the font??
I don't know why I would have written that. I think it was me that wrote that comment.
ya, maybe ko is
can you see what the most popular boards for ja are?
rp2040 is my guess
let me do better than that
SELECT lower(language), board, count(*) FROM "default"."adafruit_circuit_python_downloads_details" where board <> '' and language <> '' and version like ('7.%')group by lower(language), board order by lower(language), count(*) desc, board
my font bitmap data is 3552 uint32_t long now
14kB, includes ja and ko?, or just ja?
you mean now after shrinking, or this is before any work on it?
thats just switching to ja unifont and running the regular gen display resources
I'm thinking about supporting double wide characters so that blinka can be an emoji
can the kerning be set so that blinka is made of two half images?
In CJK (Chinese, Japanese and Korean) computing, graphic characters are traditionally classed into fullwidth (in Taiwan and Hong Kong: 全形; in CJK: 全角) and halfwidth (in Taiwan and Hong Kong: 半形; in CJK: 半角) characters. Unlike monospaced fonts, a halfwidth character occupies half the width of a fullwidth character, hence the name.
Halfwidth and F...
if blinka is the only one,
that's the concept I'd need
fullwidth is the concept you'd need? I was thinking of blinka-left and blinka-right
but doing the half/fullwidth would make ja more readable
well, ideally I'd have one character for the snake unicode codepoint
then it works in your serial terminal too 🙂
i was just thinking of hacking it as two characters
ya, I think thats how I'd do it in terminalio/tilegrids
when a characters is full width it takes two spots with indices n and n+1
right, so monospace can still handle full and half width
Ok, @dhalbert. This finally built. There is a lot of diff noise due to the header move. Let me know if you want me to clean it up. I considered folding the translate.h include into py/runtime.h but the include-what-you-use philosophy would have you list it I think.
@slender iron I was thinking you were going to conditionalize translate.c vs .h:
This isn't as good as the current setup with LTO though. Trinket M0
loses <1k with this setup.
baby time. bye!
Good call on hyperspecifying the Sphinx targets, @tulip sleet!
glad it worked!
Wordy, but it seems to work in the local docs I built
you may be able to avoid the :py:meth: part, and just do ~module.Class.method
we already do that a bunch of places
or maybe you did that already
Honestly, it was worth it just to learn what the ~ does, I was looking for that bit of information for a while now haha
Hey there pythoners. I'm looking to get adafruit-circuitpython-dht installed, but piwheels, the wheel provider, has an expected outage for the next 10 hours. Does anyone know if there are mirrors available?
This is great work! One formatting oddity, and one change to improve the compile times.
CFLAGS += -DCIRCUITPY_LTO=1 -flto -flto-partition=$(CIRCUITPY_LTO)
The build times for your PR runs seemed kind of long (2 hours instead of the 1 hour I was seeing after my recent PR). I did some sample builds with and without specifying a value for -flto:
| Build | free bytes | make -j12 in secs |
|---|---|---|
Trinket M0: this PR with -flto=NPROC |
2928 | 23 |
Trinket M0: this PR but with -flto |
2908 | 16 |
Trinket M0: tip of main |
2596 ... |
This file was reindented, but there's something non-standard about it. Notice the lines above are flush with the left margin.
Can you use PyPI?
I don't think so; raspbian os has the default of piwheels for pip installations, its probably where the arm whl files actually reside. IDK the configuration change to make pypi work correctly on raspbian.
But maybe
You could also download the source code and run pip install . in that directory
Assuming no dependencies.
As long as you have Blinka already you should be good, DHT doesn't seem to have any others.
Install running, but its on a raspberry pi 3, so it has one core cranked to 100%, but it is churning along.
requirements file might be missing packaging and/or pyparsing for the builds, had to manually install those to get it to build on my pi.
Seems to have installed though, so lets see what happens
yay worked, now i have actual python errors.
thanks
No worries, glad it worked!
Whelp, now I'm working on the DHT11, seems to work fine mostly, but about 20% of the time I get this: ```Traceback (most recent call last):
File "./src/temp.py", line 28, in <module>
print("Temperature: {:-3.1f} C".format(device.temperature))
File "/home/pi/gardenpi2/venv/lib/python3.7/site-packages/adafruit_dht.py", line 274, in temperature
self.measure()
File "/home/pi/gardenpi2/venv/lib/python3.7/site-packages/adafruit_dht.py", line 230, in measure
raise RuntimeError("A full buffer was not returned. Try again.")
RuntimeError: A full buffer was not returned. Try again.
I can just average on this and run retries so I can always get data.
I have a 6-second-delay between reads.
Might be time to move to the #help-with-circuitpython channel, I'll do that
OK, looks like it is in fact an old CircuitPython issue: https://github.com/adafruit/Adafruit_CircuitPython_DHT/issues/33
Maybe you have seen this already? https://learn.adafruit.com/modern-replacements-for-dht11-dht22-sensors The DHT's are ... kind of terrible
Seems weird that the digital message is imprecise, since other digital protocols like I2C work just fine. However I have a dozen DHT11s laying about so I'll just put these into a retry loop and do some averaging to get healthy data.
But thanks for the help folks, even if I did invade the wrong channel.
the timings are critical, and it's hard to do precise timings on an RPi. I2C is more robust in that regard
Yes I assume the full buffer not returned refers to a timing error getting the bits off the wire, and the related checksum mismatch error is the same issue with double-reading bits / missing bits.
It's late so no need to respond now but before I forget, @lone axle, I realized while fixing my own libraries that the CircuitPython_Org libraries need the Sphinx fix. Let me know if you want me to patch that directly to main on those.
It's not able to
pingLAN or WAN numeric IPv4 addresses for some reason (result always isNone) - I may be missing a step or it could be a local network issue.
Ping is working for me, so not sure what could be wrong there?
Without DHCP, there is no DNS address. I don't think we have a way to set DNS address(es). So there is no name resolution. But, Requests to an mDNS host does still work, and the mDNS host reflects the static IP :-)
Well that won't do! I added a set method ...
Ah you're right, the DHT11s stink out loud. They give consistent information, but when I pointed a fan at them, even though the /usr/bin/vcgencmd measure_temp dropped 10 degrees, they reported the same temp as before. They're only like 2 inches apart from each other. They're junk.
Have you got this yet? I've seen this in WebUSB but not in traditional desktop python before and I have to import both usb and serial (tried pygame.midi as well, the Feather didn't show up)
This just creates a mini network bus of directly attached Adafruit Devices - which removes some of the thinking behind sending messages to certain ones when USB connects/disconnects etc...
The device in question can respond only if the message contains a CUID (constant unique identifier) pre-assigned by the code.py and never changed where possible (but this demo doesn't do that)
By far pi picos would be the most common circuitpython-capable board you'd find in Japan in terms of sales as well. That number of downloads list is relatively accurate in terms of order but for sales everything past the top 3 entries is an order of magnitude lower at least.
Based on what I see in akihabara shops.
I don't understand why the Maker Pi RP2040 is so popular here, except for the fact that its a well made board at a cheap price.
A function like reset_output_buffer() would be also an option, because we already have the same for input.
Probably the proper fix would be to change: void common_hal_busio_uart_construct(busio_uart_obj_t *self,
to not call all of the individual setup functions within the idf, but instead call:This sounds right to me. Thanks for digging into this!
You are welcome, If I get a chance and no one beats me to this, I may take a quick cut at updating that main setup
function to use the method which sets up everything including clearing both hardware queues. But will probably be
lo...
A style thing I was thinking about was whether to split this into CIRCUITPY_LTO being 0 or 1 and then adding CIRCUITPY_LTO_PARTITION for the setting of the -flto-partition value (with a default of balance). Or if not, document this more thoroughly here.
using:
Adafruit CircuitPython 7.3.0 on 2022-05-23; S2Mini with ESP32S2-S2FN4R2
Board ID:lolin_s2_mini
I can also confirm this bug and the workaround of @jdimpson .
my project use the neopixel a lot but only rarely get info from the web. In the end, I completely shut down the wifi (wifi.enabled=False) between uses to get the flickering stop. This is still not an ideal solution as the whole reconnect, takes some time that is noticeable.
Want to add DNS as optional here too? Fine to leave the property as it is now too.
@DavePutz Would you like to review this?
The original poster is using ESP32SPI, not a native ESP build.
The LTO builds are taking about the same amount of time, but the non-LTO builds are now much longer, and each translate build takes about 3x the time of before. Basically the non-LTO builds are now catching up to the LTO builds in slowness. But it does save a lot of space.
So the entire latest PR build was about 132 minutes, compared with about 75 minutes before.
atmel-samd (LTO), before and after:
<img src="https://user-images.githubusercontent.com/2847802/171497881-5c6d0d2a-e5b6-4a...
User reports that long-running programs hang after about 12 days (maybe 2^30 seconds):
https://forums.adafruit.com/viewtopic.php?f=60&t=191597.
The problem: I am using an Adafruit Feather RP2040 with Circuitpython 7.2.x to constantly readout multiple sensors, e.g., a Bosch BME680, and save the data to a SD card. After roughly 12 days and a bit, no further data is saved and the microcontroller seems to stop working (neither properly exiting the code nor throwing an exception).
I suspe...
Yeah, that would be awesome. Thank you.
I am thinking about two ways around the long build times:
- On a PR, do only representative builds: English, and a few large builds, like de, ja, ru or even fewer. So kind of like the windows-builds. Do the complete set only on merge.
- More radical: give up on using real strings in
translate(), and use message ids, e.g.translate(MSG_INVALID_Q_PIN)or whatever. I don't me qstr symbol nameparsing, they would be too long, but a central message table file. It could still be compiled per...
I think the simplest thing would be to have the TRANSLATE_OBJECT version on by default and only do the header thing when we need the space (like small S3 builds.)
Use this function instead of several individual configuration functions
to configure such things as Baud rate, transfer size, stop bits,
parity...
This function also resets both the RX and TX Hardware Fifo
reset functions are called to setup the hardware.
This is a First attempt at what was mentioned in issue.
If it works:
resolves #6254
My initial tests are working,
Would be good if others tried this and see if other configurations of UARTS work with this change.
I'm currently in Alaska, but will review after returning on Sunday.
This is a clever and straightforward solution. Let's do it. After thinking about the Windows development issues, I believe it will be OK. Thanks!
This also happens on
Adafruit CircuitPython 7.3.0 on 2022-05-23; Adafruit Grand Central M4 Express with samd51p20
UF2 Bootloader v3.14.0 SFHWRO
Model: Grand Central M4 Express
Board-ID: SAMD51P20A-GrandCentral-v0
example: https://youtu.be/QqLHkpqCbhw
Hi,
I see and understand what you are changing.
But do we know the root cause of the problem?
I would feel better if we could point to the code where the problem is and not just do it differently.
Btw: can you provide a UF2 for your build? I am happy to test. (I have nearly every ESP32-S3 board model and also some ESP32-S2)
I followed this guide to set up CircuitPython. https://learn.adafruit.com/adafruit-grand-central/circuitpython But I encountered the problem shown in the picture above. So I tried to update the bootloader and reset for a few times, but it still shows the same problem.
Hi, I wanted to ask about the "Status of the USB-Host support and best hardware to play with that". So recently Anne was saying on Pi Cast https://www.youtube.com/watch?v=OGb55VXAp4I that it was there, and maybe @slender iron was saying in the chat "well not really". So I was wondering if there was hardware on witch it is already kind of working? Is it the RP2040 with that PIO trick and you have to solder yourself a USB-A female connector? I also saw on Show and Tell https://www.youtube.com/watch?v=cTCHe8Y8yhk that Scott use that great USB-OTG from Espressif that I have been hesitating to get (also I don't know who contributed that to the supported board): https://circuitpython.org/board/espressif_esp32s3_usb_otg_n8/ . My "usecase" or area of interest is USB-HID translation/man-in-the-middle/retro-gaming. I want to read from old joystick and convert the input to something else. Maybe similar to what @tough flax need for more useful purpose. It's OK to take a more costly hardware initially for development, if later there is a more affordable Adafruit product that does not require soldering and that I can recommend. Thanks.
Right now use use a qtpy running cp on the device side and a trinket m0 running Arduino on the host side. They communicate over UART.
I think the best hardware for usb host right now is the teensy 4
But that’s currently Arduino only
TinyUSB Does have usb-pio integrated at this point. So I’d you’re willing to use the C API for the rp2040 that’s an option
My ideal platform is an rp2040 running CP over TinyUSB with usb host on PIO. In a perfect world the usb host would run on the second core (or we can just run the host task in the main loop but that leaves the host timing at the mercy of the device side)
@thorny jay I will tell you that our biggest tip on this is to have the host side read his inputs and update its own state (which keys are pressed, how far the mouse has moved, which cells on the intellikeys are pressed). Then the device side polls and gets the full state and sends its own HID events that show the changes. Just sending through the HID events with modifications looks simple but it leaves open the possibility of keys getting stuck down etc
Thanks, yes sometimes I get CTRL stuck on my physical keyboard, and the computer start to act funny until you understand!
I have seen your use of two board back to back with serial in between. Maybe that is the best option right now?
@ThomasAtBBTF and all,
Hi,
I see and understand what you are changing.
But do we know the root cause of the problem?
I would feel better if we could point to the code where the problem is and not just do it differently.
Btw: can you provide a UF2 for your build? I am happy to test. (I have nearly every ESP32-S3 board model and also some ESP32-S2)
From the best I can tell from the debugging, the main issue is that the hardware FIFO queues are not properly setup. It app...
The zip file has an S3 and an S2 image:
The S3 - espressif_esp32s3_devkitc_1_n8r8
The S2 - unexpectedmaker_feathers2
esp32_firmware.zip
The Product page for the new adafruit feather esp32s3 - 4MB Flash/2Mbyte PSRAM https://www.adafruit.com/product/5477 says it is supported by CP but I don't see it in the espressif/boards or on the Download page at circuitpyhton.org. Am I missing it or if it is just not "quite" ready yet. Not a problem, just curious.
well it came out yesterday !
it's not in the CP repo yet, I guess it was a surprise release
🎁
I will make a build for it soon.
@thorny jay I was working on the Teensy 4 / iMX RT for the original USB host work. It doesn't actually read and write to the device yet though. I stopped when I took leave and haven't circled back to it yet. I'm working on web workflow instead
@tulip sleet I think I may be able to speed up the translation builds by externing the compressed string structs
that would be great!
Thanks @DavePutz! Sorry for bugging you while you are away.
Sorry, one more thing. Generally when a function takes multiple arguments of the same type, it's best to force them to be keyword arguments. That way they are labeled. So, here you'd do:
//| def set_ipv4_address(self, *, ipv4: ipaddress.IPv4Address, netmask: ipaddress.IPv4Address, gateway: ipaddress.IPv4Address, ipv4_dns: Optional[ipaddress.IPv4Address]) -> None:
Sorry, I thought of one more thing. Thank you for your patience.
{ MP_QSTR_ipv4, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ, },
{ MP_QSTR_netmask, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ, },
{ MP_QSTR_gateway, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ, },
{ MP_QSTR_ipv4_dns, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
- Adds _blinka board md page
- Adds pictures of Radxa Zero
Awesome. Thanks for adding.
... Btw: can you provide a UF2 for your build? I am happy to test. (I have nearly every ESP32-S3 board model and also some ESP32-S2)
@tannewt @ladyada - Was wondering with your pre-build checks, It looks like it builds all of the boards...
Question I wondered about, was are those saved? That is if someone like @ThomasAtBBTF wishes to test out a change such as this one, without having to setup to build everything, what is the best way to do this?
I did upload zip file which conta...
@lone axle I need a favor. I figure you could probably put this together in less than 2 minutes, whereas I can not. I need a quick piece of code for the MagTag that clears the display. That's all I need it to do. Right now, it's showing the REPL because it's the default "Hello World!" that comes with CircuitPython, but I need a GIF of that board, and I need a blank display for it. Let me know if you can help!
board.DISPLAY.show(displayio.Group()) ?
I can do that, but it will be a few minutes before I could start.
maybe refresh()
I do think something like that would work
No worries there at all. I'm in the middle of another thing.
yeah refresh after setting it to the new empty group
ok, @tulip sleet I pushed a new version. we'll see how fast it is now
generating the huffman tree is a little slow
could probably speed things up a little by parallelizing it
not sure, maybe on local but on github the CPU parallelism available is only 2...
@idle owl I just confirmed that this will blank the display on magtag:
import board
from displayio import Group
board.DISPLAY.show(Group())
board.DISPLAY.refresh()
while True:
pass
Oh nice! Ok, thank you so much!
@lone axle did you clone the FONA library to CircuitPythonOrg? Or did I accidentally do that?
13512328 1.549 0.000 2.023 0.000 makeqstrdata.py:354(<genexpr>)
1 1.404 1.404 8.936 8.936 makeqstrdata.py:319(compute_huffman_coding)
1752508 0.991 0.000 3.014 0.000 {built-in method builtins.sum}
1752508 0.713 0.000 5.014 0.000 makeqstrdata.py:382(est_net_savings)
```looks like finding a better way to `est_net_savings` would be beneficial
or to call est_net_savings less
- ((s, -est_net_savings(s, occ)) for (s, occ) in counter.items()), key=lambda x: x[1]
+ ((s, -est_net_savings(s, occ)) for (s, occ) in counter.items() if occ > 3), key=lambda x: x[1]
)
``` for instance this reduces the number of `est_net_savings` calls to just 132240 (7% as many) by only checking whether it's better to allocate a 'word' to a character sequence that occurs at least 3 times across all messages, and cuts the time about in half. it slightly changes the results of compression, too, not sure yet if it's an improvement or a regression
> 1 is almost as good in time and should make no difference in compression
Profiling shows that est_net_savings is one of the highest costs of the whole process. Approximately, you can save storage only if a word appears more than once, and doing this greatly reduces the number of est_net_savings calls (this isn't exactly true, because a 'word' could be made only of very infrequent code points, but let's ignore it). In a local build, it reduces the time for this specific build step by 50% on ports/unix VARIANT=coverage build, without affecting the size of the ge...
that's not quite true. say for some reason you had just one occurrence of 'xyzzy' and no where else do x, y, or z occur; the huffman encoding of each letter x, y, and z would likely be >8 bits so making it a 'word' (even though it occurs just once) could still save overall space, because when it's stored as a word it's stored in code points (or maybe utf8s, I've lost track) rather than as huffman-coded.
@tulip sleet re: using something other than try/except for typing imports: Is using sys.implementation.name sufficient? Is that "concrete" enough that it could be used for optimization?
Or does it not meet the criteria of a constant?
And I guess is that module present in all builds?
to circuitpython/micropython a "constant" is pretty much only something of the form name = const(literal integer). Anything resulting from an import cannot be a const, anything that is a string, tuple, float, can't be.
Thanks for explaining, I meant to ask that when this came up before.
take a look at tests/micropython/const*.py for what is tested about constants
and it's late here so gn! 😴
currently in Germany 🙂
Thanks for the walkthrough! Gute Nacht!
I think I will have a working build-VM on a server by next week.
I already had this once for Version 5 and the ItsyBitsy M4
But this is outdated and needs a clean reinstall.
What certainly would be helpful would be an image of such a VM somewhere in the cloud.
I'm getting a RuntimeError: Refresh too soon error. Added a time.sleep() but it did not help. 😕
NM. A longer time.sleep() worked.
Wait....
No. It worked for a minute, reloaded, and failed with the error.
@lone axle So, not nevermind. It worked for a moment, auto-reloaded, and failed after that with the same error.
I find it's most convenient to put time.sleep(4) or similar at the begining of the any magtag scripts to it will always wait long enough to refresh.
you could also catch the runtime error and then do a time sleep in the except and try one more time after that.
Hmm also good idea. Thanks!
OK, adding the try/except seems to have made it work. It tried to fail even with sleep(4), so now there's another 4 second sleep in the except, and that appears to be working.
That I would not have thought of. Thanks so much for your help!
I do that sometimes: time.sleep(board.DISPLAY.time_to_refresh + 0.1)
I think that works 🤔
Not using the MagTag lib. I wanted it to be barebones.
Because I'm doing this so a GIF doesn't have CircuitPython on the display.
Not because I need to do more code with it.
there !
oh interesting.
but yeah, you don't need that to make a gif, I was just thinking out loud 😉
Fair enough! I appreciate it. I was unaware of that being a thing, so I learned something new today. 🙂
A mix of adafruit_feather_esp32s3_tft and adafruit_feather_esp32s3_nopsram, with name and USB PID changes.
artifacts are built for all PRs through actions CI - go to the CI run summary and scroll down to find the zip for your board :)
e.g. for the run above
https://github.com/adafruit/circuitpython/actions/runs/2425263098
So just to clarify asyncio is not currently supported on Circuit Playground Express? I have been trying to work this out as I would like to utilize cooperative multitasking.
artifacts are built for all PRs through actions CI - go to the CI run summary and scroll down to find the zip for your board :) e.g. for the run above https://github.com/adafruit/circuitpython/actions/runs/2425263098
Thanks, I figured there may be something already setup :D
@rosstie That's right, there just isn't room for it in the firmware space we have (256kB, which includes several frozen libraries).

