#circuitpython-dev

1 messages · Page 421 of 1

slender iron
#

only mac and linux

warm flame
#

ok

#

pre-commit failed... that's bad right

slender iron
#

ya, but usually simple to fix. got a link to the error?

slender iron
#

its being picky about white space

warm flame
#

lol

slender iron
#

mpconfigboard.h has an extra line at the end and the pins.c has some white space on the start of the line

#

you probably setup pre-commit in vscode and it'll autofix it

#

generally it's easiest to auto-run pre-commit before committing

warm flame
#

will try

manic glacierBOT
#

@rycwo I don't believe TinyUSB has support in its main branch yet. It's waiting on https://github.com/sekigon-gonnoc/Pico-PIO-USB/pull/22

So, progress is being made but isn't there yet. Once it is, we'll also need to connect the actual reading and writing of packets to the new TinyUSB API for it. You could start this on iMX for now if you are eager. We're happy to help ramp folks up to contributing to CircuitPython. Chatting with us on Discord is a good place to start: https:/adafru.it/dis...

slender iron
#

no need to close the PR, just push a new commit to the same branch

warm flame
#

ok. I am not used to github

slender iron
#

np

manic glacierBOT
warm flame
#

I'm really not good at it

#

LOL

manic glacierBOT
ornate breach
#

@slender iron paternity leave? congrats 🙂

slender iron
#

yup! thank you!

ornate breach
#

I missed that in taking my own paternity leave haha

slender iron
#

you'll need the empty board.c file in the folder too

#

(there may be other files as well)

warm flame
#

I'll check that later then

slender iron
#

and by empty, I mean it has functions that don't have contents

#

you should be able to copy it from another board

warm flame
#

yup

#

got to go for now. Exam time

slender iron
#

good luck!

manic glacierBOT
manic glacierBOT
#

To really put the processor in a low power mode you have to turn off the peripherials

I think we should be a bit more specific and differentiate between the processor core and the system on a chip (soc) which includes peripherals.

Light sleep and time.sleep() should stop the clock to the core to save power. It shouldn't have power disabled because that would reset the core. It should also maintain any active peripherals. In other words, the core is in a low power state but the s...

manic glacierBOT
#

This sounds like a Teensy bootloader quirk more than an issue with our linker script. (Maybe the size detection code just assumes continuous ranges.) However, I wouldn't mind changing the linker script to take up continuous ranges if it means it preserves the filesystem.

I think you just need to modify the LENGTH parameters here for the first few ranges: https://github.com/adafruit/circuitpython/blob/main/ports/mimxrt10xx/linking/common.ld#L20=

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.2.5 on 2022-04-06; Raspberry Pi Pico with rp2040

Code/REPL

import os
import time
import board
import storage
import busio as io
from adafruit_sdcard import SDCard
from digitalio import DigitalInOut


SD_PATH = "/sd"

spi = io.SPI(board.GP2, board.GP3, board.GP0)
cs = DigitalInOut(board.GP1)
sdcard = SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, SD_PATH)

# list out all the dir...
#

I want to drive two 1.28 inch displays on a RPi Pico. The controllers are GCA901 so I need to run two SPI devices with, presumably, device selection using Chip Select. How do I configure disaplyio to work with two displays on a common bus? I see a reference to the configuration definition CIRCUITPY_DISPLAY_LIMIT - what is the current default value?

I believe the default setting on almost all devices is 1. I think the only device with limit of 2 is the Monster M4sk https://github.com/...

#

The current limit is 1 display. I have been told you can re-compile it and
change the value to 2, but because circuitpython is basically running a
virtual machine it doesn't work so great ( atleast that's how I understand
it, I might not be explaining it correctly). You can use multiple displays
using rgb565. I dunno if the particular display driver you mentioned
supports it.

On Mon, May 9, 2022, 8:53 PM David Goadby @.***> wrote:

I want to drive two 1.28 inch displays on a RPi Pico...

manic glacierBOT
manic glacierBOT
#

There are 160 files and 5 directories on the card. One of the directories is empty and the largest one includes 120 files. On average, 20 files.

The file system of the card is FAT32

Actually, it's mostly not slow while listdir on directories. But on files, listdir takes longer to raise an exception.

Checking os.stat[6] is a little bit quicker, but I'd like to know how can I tell the difference between empty files and directories for both of them returns a 0 on os.stat[6] ...

manic glacierBOT
#

I use this to test if a path is a directory:

import os

IS_DIR = 0x4000
IS_FILE = 0x8000

def is_dir(file):
    return os.stat(file)[0] & IS_DIR != 0

I don't know if there is some unavoidable overhead, but you can try speeding up the bus speed.
The default speed in the library is 1.32MHz, this sets it to 10MHz:

sdcard = SDCard(spi, cs, baudrate=10_000_000)
orchid basinBOT
manic glacierBOT
orchid basinBOT
warm flame
#

is there a good tutorial to setup the workflow to add a board with VSCode ? I can't pass the pre-commit test

onyx hinge
#

@warm flame For the core, the documentation we have is https://github.com/adafruit/circuitpython/blob/main/BUILDING.md#code-quality-checks -- You didn't mention what OS you're using but Linux, Windows using WSL, or Mac should work as long as you follow the instructions in BUILDING.md. I am not aware of any vscode-specific instructions and I strongly suspect that Windows-without-WSL is going to have additional challenges. I always use the terminal on Debian Linux to do things like run pre-commit.

GitHub

CircuitPython - a Python implementation for teaching coding with microcontrollers - circuitpython/BUILDING.md at main · adafruit/circuitpython

warm flame
#

even on windows ?

orchid basinBOT
#

For the features: portion of the board information, please only use the values listed in the template:

# Features are tags; they should be limited to the items in this list and spelled exactly the same.
# Include only the features your board supports, and remove these comment lines before committing.
# Breadboard-Friendly is a parallel pin layout with minimal non-critical perpendicular pins
features:
  - Speaker
  - Solder-Free Alligator Clip
  - Feather-Compatible
  - Battery ...
warm flame
#

going to install a linux vm

#

what distro should I use ?

orchid basinBOT
#

Before this, people were requested to follow a set list of features, but we had no automated check for it. Do this as a step of the CI, or a step that can be run locally.

I found several boards that had non-standard features listed; I corrected or deleted them as I saw appropriate.

There are also a number of boards without any features: blocks. I did not attempt to fix this. However, if this were fixed we could add an additional check in this script for future boards. However, this assu...

onyx hinge
#

@warm flame I use debian, the CI uses ubuntu.

warm flame
#

as it will be a Virtual machine, is there a debian fork that is more oriented toward DEV

orchid basinBOT
#

Here's an example of the check failing when a nonstandard feature is specified:

jepler@rat:~/src/circuitpython-org$ git diff
diff --git a/_board/feather_m4_express.md b/_board/feather_m4_express.md
index cdde3923..b8948476 100644
--- a/_board/feather_m4_express.md
+++ b/_board/feather_m4_express.md
@@ -10,6 +10,7 @@ date_added: 2019-3-8
 family: atmel-samd
 bootloader_id: feather_m4
 features:
+  - OSHWA Certified
   - Feather-Compatible
   - Battery Charging
   - Breadboard...
warm flame
onyx hinge
#

I have not personally used it.

warm flame
#

ok

#

I'll start with Debian then

manic glacierBOT
#

I think this probably isn't super-important, and whether to use typecodes or 1/2/4 integers feels like an open question. I used typecodes partially because they felt natural (I was replacing a function call with a parameter of 'L' anyway!) but also because of ease of implementation. I shouldn't have favored ease of implementation so strongly. Anyhow, let's not do this right now.

manic glacierBOT
tulip sleet
warm flame
onyx hinge
#

I use xfce, but that doesn't mean I necessarily recommend it. Gnome is probably a better suggestion for those new to Linux, it's more polished.

tulip sleet
#

I use cinnamon (with Ubuntu 22.04, but could be installed with Debian, I think).

#

Gnome takes up more space. I have a short taskbar at the bottom with lotsa icons

warm flame
#

Gnome is like Win8 lol

#

huge and slow

slender iron
#

@tulip sleet kk, I think I’ll try to get through all my email first. I made good progress on it yesterday

slender iron
#

(On my phone now while holding the baby)

tulip sleet
#

your arm muscles will get stronger (speaking from experience)

#

i am not big into themes, etc. My desktop background is solid black 🙂

warm flame
#

@slender iron enjoy those moments, they are too short.

#

and nostalgia kicks in hard when they are 13 and are being Hades Bum Hole

ornate breach
warm flame
tulip sleet
#

pay no attention to these guys 😉

warm flame
#

lol

#

what editor do you use in debian ?

onyx hinge
#

vim but again this is not a recommendation. vscode is available for linux, so if you're comfortable with it choose it.

warm flame
#

vim is "dos" like right

orchid basinBOT
tulip sleet
# warm flame vim is "dos" like right

keyboard commands: it's a modal editor (command vs insert mode). I use emacs. If you are used to IDE's, atom, vscode, or PyCharm may be more up your alley

warm flame
#

pycharm is not only for python ?

gilded cradle
onyx hinge
#

@gilded cradle you're welcome! after I found the 'frontmatter' pypi library it was not hard to write it

#

first I failed to find a way to do it in jekyll but that's not important since we can run other things in CI

gilded cradle
#

Yeah, I was thinking we had to do some pure actions thing. Writing a python script is much better.

orchid basinBOT
tulip sleet
idle owl
#

It doesn't do syntax highlighting on the ones it can't handle, if I remember correctly. But it does open them.

warm flame
#

thanks

idle owl
#

@lone axle Do you have a moment to review this? I'm blocked on it for a task I'm doing. I tested it thoroughly, so I don't feel like it needs testing. Plus, I'm not sure how many folks have more than one of these anyway. (Though I'm pretty sure no one tested the original and it didn't work.) https://github.com/adafruit/Adafruit_CircuitPython_VL53L1X/pull/6

idle owl
#

Thanks so much! I just pushed another change, but it should pass as well.

lone axle
idle owl
#

Thank you so much!

idle owl
#

@gilded cradle Is there some issue with platform detect? Getting the following error trying to build sphinx docs locally: Traceback (most recent call last): File "/Users/kattni/.virtualenvs/pylint/lib/python3.10/site-packages/sphinx/ext/autodoc/importer.py", line 70, in import_module return importlib.import_module(modname) File "/Users/kattni/.pyenv/versions/3.10.0/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/Users/kattni/repos/Adafruit_CircuitPython_Simple_Text_Display/adafruit_simple_text_display.py", line 26, in <module> import board File "/Users/kattni/.virtualenvs/pylint/lib/python3.10/site-packages/board.py", line 166, in <module> elif board_id == ap_board.KHADAS_VIM3: AttributeError: module 'adafruit_platformdetect.constants.boards' has no attribute 'KHADAS_VIM3'

#

Or is that maybe a red herring.

#

Force reinstalled it and it fixed that error. Nevermind, apologies for the ping.

#

Ugh, ok, Sphinx issue. Docs are building properly locally, including the API page. Remotely, they're passing when they build, but the API page is blank. I have no idea where to start with this.

gilded cradle
idle owl
gilded cradle
idle owl
#

Nothing changed.

gilded cradle
#

Hmm. Same version of sphinx as you have locally?

idle owl
#

Hmm, I didn't verify that. Checking.

gilded cradle
#

ok

idle owl
#

Looks like I was behind. Building again now locally.

#

Still building properly locally with the latest Sphinx. 😦

gilded cradle
idle owl
#

Thanks. Appreciate the help.

manic glacierBOT
#

The errno messages for EPERM and ENODEV were wrong. In particular the ENODEV message was confusingly wrong.

This grows builds slightly due to a new string, and alter the errors we see in some circumstances, but I think it's better to have the correct messages. If the mesages are mentioned in any guides, they'll need to be changed, but I think the mentions may only be in issues. I'll do a learn.adafruit.com site search after this is merged.

slender iron
#

@tulip sleet all of my reload changes broke the ble reload. think I should PR a fix into 7.2?

manic glacierBOT
#

I did get initial functionality working with external oscillator (bypass crystal mode) by modifying one line in this file
hpl_osc32kctrl_config.h

One issue is this description I do not feel is correct. This is for enabling the external clock source, instead assuming crystal. MPLABs also has ad descriptions but when comparing changes between external clock and external crystal this is all that changes.

// <q> Crystal connected to XIN32/XOUT32 Enable
// <i> Indicates whether the ...
slender iron
#

what do others think? should we fix ble reload in 7.2?

stuck elbow
#

@slender iron I know you are still catching up, but you did say yesterday to ping you if there is something we wait on. I'd love to be able to get the PewPew LCD merged before 7.3 is out, so if you have time, could you take a look at https://github.com/pidcodes/pidcodes.github.com/pull/733 ?

slender iron
#

ya, I can do a pid.codes pass now

manic glacierBOT
idle owl
#

@tulip sleet Can you get me a build for Circuit Playground Bluefruit from that 7.2.x PR so I don't have to wait on CI to build it?

slender iron
#

I can

idle owl
#

Thanks!

slender iron
#

the app doesn't work quite right with it though

idle owl
#

Oh hmm.

#

That's what I was going to test it with.

slender iron
#

the transfer works but then the download button stops working

tulip sleet
idle owl
#

I'll test it with the latest version

slender iron
#

well, its download after it is run it

slender iron
#

I'll merge 7.2.x into main after the PR is in

#

and we can decide what to actually release later

idle owl
#

@slender iron It works great with PyLeap! Fixed the issue with needing to click reset to get the code to run.

manic glacierBOT
slender iron
#

🎉

#

it was a pretty simple bug

tulip sleet
#

hurrah - thanks!

idle owl
#

Oh there's the new issue you reported.

slender iron
#

there had been a lot of churn with the reload code

idle owl
#

Where it "stops" during downloading. Even though it downloaded and ran the first program I tried

slender iron
#

yup

idle owl
#

I can't download any of the other ones now.

#

ok

#

So is this a PyLeap bug now?

slender iron
#

if you close and reopen the app it works

#

so ya, I think pyleap issue

idle owl
#

Ok. I'll file the bug there, and close the bug related to the reload

slender iron
#

thank you

#

the cp issue will be closed with a merge into main

idle owl
#

OK, so restarting the app made the button work again, but now it isn't loading anything new.

idle owl
slender iron
#

ah, I don't think it will be

idle owl
#

So basically, it only works on the first try, then never again.

#

@onyx hinge Your PR failed on the same issue again?

onyx hinge
#

@idle owl I'll look

#

I failed to update the PR like I thought I did

idle owl
#

Heh fair enough.

#

@onyx hinge Merged!

#

@slender iron @tulip sleet So this will be a 7.2.6 release?

tulip sleet
#

we might not do a 7.2.6, because I think we will do 7.3.0 final pretty soon. And there are not a lot of people using PyLeap

idle owl
#

Oh ok.

#

I'll explain that in the PyLeap issue I'm filing.

tulip sleet
#

I could easily do a 7.2.6, though. I want to test a change I made in the release process anyway. I mean, is it true the audience for this is very small?

idle owl
#

I believe so, yes. But Trevor doesn't venture into beta builds, and at the moment, the other testers aren't either. So he's concerned about putting a warning into the app about hitting reset to get the code to run.

tulip sleet
#

then I can do a 7.2.6, if you think it would help that process.

idle owl
#

But this CP update causes a bunch of issues in PyLeap anyway, and Trev will need to experience them to fix them.

#

I think it might, yeah.

slender iron
#

trev should use the absolute latest

idle owl
#

I'll talk to him about it then. But if this is in 7.2.x, it won't be in latest, will it?

#

Also, if he doesn't use stable, then when PyLeap gets released, we'd have to ask users to use absolute latest as well.

tulip sleet
#

how imminent is PyLeap release?

#

I think 7.3.0 will get released within a week or two

slender iron
#

not that imminent

#

I'll merge the change into main once it's in 7.2.x

idle owl
#

Ok.

tulip sleet
#

let's try to get Trev to use 7.3.0-beta.2 and absolute newest

idle owl
#

Ok I'll chat with him.

tulip sleet
#

it has to get tested anyway against PyLeap to make sure they work together

slender iron
#

@stuck elbow one nitpick is the hardware repo should link to the software branch

stuck elbow
slender iron
#

the pewpew-lcd repo should link to CP

stuck elbow
#

the library gets compiled in

slender iron
#

or your fork

stuck elbow
#

I link to circuitpython.org, but I guess I should link to the code directly, or even to the pull request?

slender iron
#

PR is fine

proven garnet
#

One thing I realized when I got a PR to my community bundle library is that it had not received the update to .pre-commit-config.yaml updating the black rev. I was able to fix it since I knew what the problem and fix was, but is there a way to do something like make updates available to libraries? Like something you could connect to via git and pull infrastructure changes like that from?

#

I could see it being particularly aggravating for someone that didn't realize what had happened with a repo that had been cloned from cookiecutter before the fix.

manic glacierBOT
idle owl
manic glacierBOT
idle owl
#

@slender iron Can you let me know when that fix goes into main, so I can let Trev know? He's got the beta running on one CPB, I'm having him run latest on a second one, and test both.

stuck elbow
slender iron
#

@idle owl will do. probably tomorrow in another PR

idle owl
#

Ok, sounds good.

proven garnet
idle owl
#

@tulip sleet Do you have a few minutes to maybe help me parse some guide feedback? I think it's an Arduino problem, but I'm uncertain. Has to do with PWM on QT Py SAMD21. Jeff helped me a bit, but we thought you might know better.

idle owl
#

Vid might be fastest.

idle owl
#

What is the exhaustive list of things that mpy-cross removes when a library is converted to a .mpy? I know essentially what it does, but I don't think I've ever asked for a canonical list in one question. That I can find anyway.

stuck elbow
#

comments, docstrings and type hints, I think

idle owl
#

Whitespace?

stuck elbow
#

no whitespace in bytecode

idle owl
#

Ok

stuck elbow
#

also any globals that begin with _ and have value set using an integer expression wrapped in const()

idle owl
#

Hmm

stuck elbow
#

they get replaced with the value of that expression

idle owl
#

Oof. Ok. Trying to explain what happens to a .py file when you run mpy-cross on it for a guide page.

stuck elbow
#

it gets compiled to bytecode, which is similar to machine code that normal program binaries use

idle owl
stuck elbow
#

it's not like it removes those things, more like they don't get translated to the bytecode

idle owl
#

Ahhh. Ok

stuck elbow
#

there is no bytecode for a comment or for whitespace

#

the docstrings are removed, though

#

there is an option to not remove them, iirc

idle owl
#

Fair enough.

stuck elbow
#

the consts are simply replaced with their value, but only if they are "private" -- when they start with _

idle owl
#

Yeah ok

stuck elbow
#

if they are not private, they are left in there, because something might want to import them

idle owl
#

Ah ok, that makes sense.

stuck elbow
#

it's a bit like assembly

idle owl
#

The first one didn't seem all that helpful, so another more detailed one might help.

#

I only know Python. Heh.

#

I mean I can find my way around Arduino, and I've submitted to the CP core...

#

But I usually need help.

#

This link is much better.

stuck elbow
#

right, arduino compiles to machine code, which is a binary that can run directly on the microcontroller

idle owl
#

Ah ok

#

I don't think I knew that.

#

I knew it compiled, but not to what.

stuck elbow
#

mpy-cross compiles to bytecode, which is a binary that can run directly on the python virtual machine

idle owl
#

And CP has the same concept of a virtual machine? I've heard Scott reference it a number of times, so I guess yes.

stuck elbow
#

python virtual machine is like an abstract computer that is the same no matter if you run python on an intel or arm or, say, risc-v

idle owl
#

Neat ok

stuck elbow
#

cp has a different virtual machine and slightly different bytecode than regular python

#

when you have to match the .mpy to the python version, that is because the virtual machine has changed and expects different bytecode

#

like, for example, new commands have been added

idle owl
#

Ohhh right.

#

I never really knew why we needed to change mpy version, I only knew that we needed to.

#

So would you say the result is a file that is smaller and more optimised? And it takes up less.... RAM and flash? or only flash.

stuck elbow
#

it's smaller, but that's not the reason why it uses less memory

idle owl
#

Oh

stuck elbow
#

the thing is, to execute the python code, the python interpreter has to compile it to bytecode anyways, always

idle owl
#

I saw that in the link you sent

stuck elbow
#

what runs on the vm is always bytecode

#

so if you give it a python file, it has to compile it, and keep the compiled bytecode in memory while it is being executed

#

but if you give it an mpy file, it can just read it directly from the flash and execute it, without using additional memory, and without having to compile it

idle owl
#

Ohhhh

stuck elbow
#

so there are two things that use that extra memory: the compilation process itself, which needs to keep some extra variables while it's compiling, and the resulting bytecode, which needs to be stored in memory during and after the compilation

idle owl
#

This is clearing up a lot of things I've always kind of glossed over.

stuck elbow
#

this is why mpy files can have much more code in them

#

they are also slightly faster to start, since there is no compilation step, but usually you can't really tell the difference, with all the other delays that CP has on startup

idle owl
#

Right.

#

Thank you so much for all this help. I think I have to run for dinner now.

stuck elbow
#

enjoy

onyx hinge
#

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/1fc8UvMSBTq0x2Sh94_R6pSRm1v81sZCWA4L7TwsFzfg/edit?usp=sharing

manic glacierBOT
slender iron
#

mpy byte code is loaded into RAM to run. It isn't run from flash. So, it saves memory usually used in the compile step but not after. (Almost, the mpy process may do a little optimization (const) which could save a little RAM.)

#

@idle owl don't give too many specifics about mpy because it does change from time to time

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
late cradle
#

@slender iron hey 👋 wasn't sure which channel to use (let me know if we should switch) but I'm coming from issue #5986 -- not sure what you meant by "iMX", but if you point me to the right direction I'm happy to start tinkering when I find free time!

late cradle
#

ah right thanks, I'll dig around a bit to try to get a better understanding of all the pieces involved

jaunty juniper
#

(Adafruit's M7 boards and development have been postponed because of chip shortage)

manic glacierBOT
#

If there's a reason not to roll this step into ci_fetch_deps can you let us know what it is? Superficially, it looks like frozen should just be added to the list in that file:

 elif target == "docs":
-    submodules = ["extmod/ulab/"]
+    submodules = ["extmod/ulab/", "frozen"]
 elif target == "mpy-cross-mac":

and if the data is needed during create_website_pr.yml it would need an added call to ci_fetch_deps.py. If it re-uses the same docs key that's fine, or yo...

orchid basinBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
onyx hinge
#

github doesn't seem to have a way to note yourself as 'on vacation', either to reduce notifications or to let others know you won't be available to respond on issues/pull requests/review requests .. am I missing something?

#

I guess I can "set status", where is that shown...?

#

oh yes I can set myself 'busy'. yay.

blissful pollen
onyx hinge
#
#ifndef MP_WARN_CAT
#define MP_WARN_CAT(x) #x
#endif
```oh good, micropython can warn the cat
#

I think this lets you write MP_WARN_CAT(stay off the table) though it may have no effect at runtime

manic glacierBOT
#

Pushed an update:

  • separating the frozen modules as suggested
  • changed the top paragraph a little bit, with a link to the glossary
  • adding the frozen directory to ci_fetch_deps.py in the "docs" and "website" categories

It is required for the website too, in order to list the modules accurately in build_board_info.py and not the frozen directories (for files.json). See https://github.com/ad...

orchid basinBOT
jaunty juniper
#

oh interesting quirk of documentation:

_MCP23017_ADDRESS = const(0x20)
...
class MCP23017(MCP230XX):
...
    def __init__(
        self, i2c: I2C, address: int = _MCP23017_ADDRESS, reset: bool = True
    ) -> None:

leads to the docs:

class adafruit_mcp230xx.mcp23017.MCP23017(i2c: busio.I2C, address: int = micropython.const, reset: bool = True)

So the default address is "micropython.const"...
Worth not using a const for just that one for clearer documentation ?

tulip sleet
stuck elbow
#

or just put the value in there directly, it's not like it's used anywhere else

jaunty juniper
#

it is missing :param:(s) in the docstring

tulip sleet
#

it would be good to add :param:s anyway, and @stuck elbow 's point is good too

#

I think there are a number of libraries like this

jaunty juniper
#

I think it does that for micropython.const only, not just a normal UPPERCASE variable

tulip sleet
#

if you remove the underscore, does it change the signature?

manic glacierBOT
stuck elbow
#

I wonder if the const could inherit from int in the stubs...

manic glacierBOT
stuck elbow
#

the docs compilation, I mean

#

I wonder if we could just set __repr__ on the const in the stub, to make it display the value passed

tulip sleet
#

because it's declared as int? That's an easy fix

jaunty juniper
#

a behaviour I fail to reproduce in the MCP23017

idle owl
tulip sleet
#

also no underscore. It doesn't have to be const(), except to make the variable not be in the compiled dictionary

slender iron
#

I do know mpy will change with MP 1.19

tulip sleet
idle owl
slender iron
#

np

#

the bytecode thing will remain the same

idle owl
#

Ok. What would change then? I'm not entirely sure what changed specific to the versions when we had to switch to a new version previous to this.

slender iron
#

the mpy version number has to do with the file structure largely. in the past it changed so that mpy could hold native code and more efficiently load strings

#

the next change is largely so that mpy code can be run directly from flash (with the huge caveat of having a specific filesystem to store it)

jaunty juniper
#

I REMOVED micropython from autodoc_mock_imports

#

and poof it worked

#

(the AHT library didn't have it mocked)

#

no other modification was required

idle owl
slender iron
#

I don't think we will soon at least

jaunty juniper
#

oh that's a bummer

stuck elbow
#

as soon as Apple supports MTP

slender iron
#

the new format needs a filesystem that stores the file linearly

#

because it uses XIP to run the code

stuck elbow
#

right, but mtp would free us to use any filesystem we like

jaunty juniper
#

Eventually it will be possible to store such .mpy files in a linear, read-only, memory-mappable filesystem so they can be executed from flash/ROM.
oh they don't have one yet then ?

idle owl
#

Ok fair enough.

stuck elbow
#

@idle owl then I suppose I lied to you when I said mpy are executed from flash -- sorry

#

the frozen modules are, though

#

right?

jaunty juniper
#

yep

idle owl
slender iron
#

@tulip sleet let me know when you are around for a chat. I've got another issue to fix with ble reload

proven garnet
idle owl
idle owl
#

@tulip sleet Guide feedback saying that my explanation of the flash usage for CircuitPython is incorrect on ESP32-S3... 8MB of flash, how much is used for firmware, and how much for CIRCUITPY? I checked the S2, and it's 1MBish for CIRCUITPY, which is what I said in the guide. Am I missing something?

jaunty juniper
idle owl
#

Oof I just noticed that.

#

I probably copied that from S2.

jaunty juniper
#

yup

onyx hinge
#

@idle owl which board specifically? It looks like maybe any part with 8MB flash gets 2048KiB for firmware and 3776KiB for CIRCUITPY.

idle owl
#

Feather ESP32-S3

#

Ah ha!

jaunty juniper
#

yup that's the 8MB partition scheme in tinyuf2

idle owl
#

Plugged in an S3. CIRCUITPY is 3.8MB.

#

Good catch. Thanks!

#

So this is now accurate? The 8 MB of flash is inside the module and is used for both program firmware and filesystem storage. For example, in CircuitPython, we have 4 MB set aside for program firmware (this includes two OTA option spots as well) and an approximately 3.8MB section for CircuitPython scripts and files.

#

I had finished all my guide feedback, refreshed and there was a new one. Had to squash it! Must reach 0! 😄

jaunty juniper
#

the original poster on the forum who mentioned the other issue with the Feather S3 page also noticed that the schematics uses a bloc for the S3 that has two "DAC" pins, it's a really minor thing, but if Limor feels like updating it 🤷

idle owl
#

Probably not, heh.

#

But fair enough.

jaunty juniper
#

it's deep in the schematic, I don't think anyone is gonna be confused by it

tulip sleet
tulip sleet
idle owl
#

Still fighting (as I do other things) with this Sphinx issue. Docs passing and building locally and remotely. However, the API page is blank remotely, and shows up locally. No changes were made, the docs build under the GitHub Actions for the latest change to the remote repo shows exactly the same Sphinx build output as my local setup does. Tried rebuilding through RTD, no change remotely. So I have no explanation or idea where to start on this one. No errors to work with, no obvious direction. https://github.com/adafruit/Adafruit_CircuitPython_Simple_Text_Display

onyx hinge
#

@idle owl by viewing the raw log something interesting becomes visible but I'm not sure what it means yet. ```
WARNING: autodoc: failed to import module 'adafruit_simple_text_display'; the following exception was raised:
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/adafruit-circuitpython-simple-text-display/envs/latest/lib/python3.10/site-packages/sphinx/ext/autodoc/importer.py", line 62, in import_module
return importlib.import_module(modname)
File "/home/docs/.asdf/installs/python/3.10.0/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/docs/checkouts/readthedocs.org/user_builds/adafruit-circuitpython-simple-text-display/checkouts/latest/adafruit_simple_text_display.py", line 28, in <module>
import terminalio
File "/home/docs/checkouts/readthedocs.org/user_builds/adafruit-circuitpython-simple-text-display/envs/latest/lib/python3.10/site-packages/terminalio.py", line 26, in <module>
FONT = fontio.BuiltinFont()
File "/home/docs/checkouts/readthedocs.org/user_builds/adafruit-circuitpython-simple-text-display/envs/latest/lib/python3.10/site-packages/fontio.py", line 31, in init
self._font = ImageFont.load_default()
File "/home/docs/checkouts/readthedocs.org/user_builds/adafruit-circuitpython-simple-text-display/envs/latest/lib/python3.10/site-packages/PIL/ImageFont.py", line 361, in load_default
f._load_pilfont_data(
File "/home/docs/checkouts/readthedocs.org/user_builds/adafruit-circuitpython-simple-text-display/envs/latest/lib/python3.10/site-packages/PIL/ImageFont.py", line 107, in _load_pilfont_data
image.load()
File "/home/docs/checkouts/readthedocs.org/user_builds/adafruit-circuitpython-simple-text-display/envs/latest/lib/python3.10/site-packages/PIL/ImageFile.py", line 241, in load
n, err_code = decoder.decode(b)
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

looking for now-outdated files... none found

idle owl
#

hmm.

#

I have an idea.

onyx hinge
#

I'd also just consider asking readthedocs, they may either know an answer or view it as something they need to fix

idle owl
#

I don't see where to switch the version of Python used. I know it's a thing, because we dealt with it recently, but I'm not sure where it is.

#

I'm wondering if it was something on Sphinx's end.

#

I guess I can ask RTD.

onyx hinge
#

.readthedocs.yaml

idle owl
#

oh

#

obviously.

#

Can't believe I missed that.

#

Anyway, trying it.

onyx hinge
#

/home/docs/checkouts/readthedocs.org/user_builds/adafruit-circuitpython-simple-text-display/envs/latest/bin/python -m pip install --upgrade --no-cache-dir mock==1.0.1 pillow==5.4.1 alabaster>=0.7,<0.8,!=0.7.5 commonmark==0.8.1 recommonmark==0.5.0 sphinx sphinx-rtd-theme readthedocs-sphinx-ext<2.2
it's installing a specific version of pillow. This problem was fixed in pillow 6.0.0.

idle owl
#

uff.

#

um.

onyx hinge
#

so maybe figure out where that particular pillow version request is coming from

idle owl
#

Yeah ok

onyx hinge
idle owl
#

Oops, habit there, sorry.

#

Deleted the embed.

#

Trying something here.

onyx hinge
#

np

idle owl
#

Merging and will revert if it doesn't fix it.

#

No change.

#

in the Pillow version.

onyx hinge
#

what did you try?

idle owl
#

Looking deeper.

#

Tried setting pillow version in the docs/requirements.txt.

#

Which it does install from after grabbing pillow-5.x

#

but apparently that does nothing

onyx hinge
#

maybe there are two problems, because the specific error I saw earlier isn't in the output now .. but it still made no difference to having the API page appear

#

you're just looking in the sidebar for it right?

idle owl
#

I clicked "simpletest" and then clicked "next" on the bottom of that page

#

which should go to API

#

goes to "no title" now.

onyx hinge
idle owl
#

oh!

#

Hard refresh and it's there for me too!

#

Hurrah. I guess it did install a later version of Pillow.

onyx hinge
#

it probably installed one and then the other

idle owl
#

I reverted the change to the version of Python used

#

so it's only me adding a specific version of pillow.

onyx hinge
#
  Attempting uninstall: pillow
    Found existing installation: Pillow 5.4.1
    Uninstalling Pillow-5.4.1:
      Successfully uninstalled Pillow-5.4.1
Successfully installed pillow-9.1.0
#

yeah it installs the one then replaces it with the other.

idle owl
#

Whee, I win.

#

Thank you for all the sleuthing!

onyx hinge
#

@gilded cradle WDYT of adding a >= 6.0.0 requirement to pillow here, would it negatively affect platforms we want to support or would they have the necessary version available?

#

We may be able to write 'any pillow version, but at least 6 if python 3.10 is installed', I'd have to check how requirements.txt deals with a situation like this pillow pillow >= 6.0.0; python_version>=3.10 (any version of pillow, unless python 3.10 or above is installed, in which case at least version 6.. is the intent)

idle owl
#

hmm.

#

If that's necessary, I suppose yes.

onyx hinge
#

raspbian oldstable has 5.4 (and python 3.7)

gilded cradle
onyx hinge
#

sorry I was unclear on that point (where I wanted to add it)

gilded cradle
#

Sure, we can change that to >= 6.0.0.

onyx hinge
#

my syntax for applying it based on Python version is wrong

#

pillow>=6.0.0; python_version>'3.9'

#

I'm uneasy because that LOOKS like a string comparison but maybe it's not

gilded cradle
#

I'm not sure what the pip syntax is

onyx hinge
#

so I just tested this in docker python:3.9 and docker python:3.10: ```pip install 'pillow==5.4.1'; pip install 'pillow' "pillow>=6.0.0; python_version>'3.9'"

#

the install of pillow==5.4.1 first is to copy what RTD is doing, that causes us problems.

#

so I feel like this is relatively safe

gilded cradle
#

It should probably be updated in setup.py as well

onyx hinge
#

oh yes, I guess so!

proven garnet
#

Oh, good I just came here to talk/ask about this 😅

idle owl
#

There are others that aren't rendering properly. No idea if it's the same issue.

onyx hinge
#

now you can look in the raw log for that error though!

#

I'd hold off fixing any more if melissa is going to change blinka displayio though

#

I mean, fixing them by changing the python version

idle owl
#

Ok, so.... a .py file vs a .mpy file. A .py file on a smaller micro will result in memory allocation failures? As well as taking up more flash, but that's typically not the issue. I understand why .py requires more memory, but I want to make sure I'm explaining this properly.

#

Or "can" result in anyway.

jaunty juniper
#

a .py file requires more memory when imported, so if there's not much memory remaining the import is more likely to fail

idle owl
#

Oh right.

#

Yeah ok

jaunty juniper
#

because the process of turning the py text into the internal representation (bytecode) uses memory

stuck elbow
#

an mpy just needs to be loaded into memory, a py needs to also share that memory with the running compiler

#

this is why sometimes the order of importing files matters

#

you want to import the big ones that require more memory during compilation first, while there is still memory free

idle owl
#

Yeah I had a few sentences on why .py requires more memory from yesterday. But I was struggling to connect "what is a .py file" with "uses extra memory". These things are the connection.

jaunty juniper
#

oh @idle owl, I believe there was a conversation about a font repository a while ago. I mentioned this to @lone axle during a stream recently, I think it would be really interesting to mention U8g2 as a repository of fonts, (under some type of open license), in the fonts guide.
there's a bunch: https://github.com/olikraus/u8g2/wiki/fntgrp
https://github.com/olikraus/u8g2/tree/master/tools/font/bdf
Maybe even somebody would have the courage to go through them and pick a few at different sizes that look good and can be showcased for people to select.

idle owl
#

Hmm. How often is it updated? The issue with linking to other folks' repos is if it gets deleted etc in the future. If it's not updated that often, we could fork it, and link our fork... But it might be fine? If @lone axle is up for it, I think that might be a good idea. Is that the repo you always link when asked that question?

#

Need to jet for dinner. Be back in a bit.

#

I would like to know where the sys.path() for libs is defined when I get back through. 🙂

jaunty juniper
#

I only discovered it recently, it seems active, it's a "monochrome graphics library for embedded devices", the fonts are only part of it, some under MIT, others under creative commons, etc. We could totally mirror them as long as that's ok with the license

idle owl
#

@tulip sleet Where is sys.path() in terms of the library file order? As in where is the code telling CP where to look? I thought I knew, but apparently I don't.

tulip sleet
idle owl
#

Ohhhhhh. Right.

tulip sleet
#

if nothing is frozen, .frozen is not in the path

idle owl
#

Oh!

#

Good to know!

#

Thanks

tulip sleet
#
>>> sys.path
['', '/', '/lib']
idle owl
#

Nifty.

tulip sleet
#

e.g. on Qt Py M0

idle owl
#

Ah ok

tulip sleet
#

i only know that because I happened to try it on the board I currently had plugged in

idle owl
#

Hahaha. Nice

stuck elbow
#

nobody knows how this works anymore, we are doomed

idle owl
#

It has become sentient.

jaunty juniper
#

by the way there's like 25 occurences of "micropython" being in "autodoc_mock_imports" in the bundle (excluding comments)

idle owl
#

@tulip sleet What is the first '' in the sys.path? I thought it started in root /, then checked .frozen if it's there, and then /lib... So what is the ''?

tulip sleet
#

current directory, I think

#

https://docs.python.org/3/library/sys.html#sys.path
As initialized upon program startup, the first item of this list, path[0], is the directory containing the script that was used to invoke the Python interpreter. If the script directory is not available (e.g. if the interpreter is invoked interactively or if the script is read from standard input), ***path[0] is the empty string, which directs Python to search modules in the current directory first. ***Notice that the script directory is inserted before the entries inserted as a result of PYTHONPATH.

idle owl
#

Hmm. So '' for us is CIRCUITPY as well?

tulip sleet
idle owl
#

Ok got it. Thanks!

manic glacierBOT
orchid basinBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.3.0-beta.2-31-g72807bb6c on 2022-05-11; Adafruit Feather ESP32S2 with ESP32S2

Code/REPL

# Issue occurs in REPL before any code is run

Behavior

As soon as the board boots to the REPL prompt >>>, the board LED is turn faintly on and all the GPIO pins go to 3.3V.

I'm not sure if it's related but I've also noticed that when I2C data is sent over the STEMMA QT connection the charging LED blinks and t...

manic glacierBOT
#

This adds the new suggested method for downloading submodules into the make help command.

Rationale

After returning to (the internals of) CircuitPython, I forgot the newer command for initing the submodules. It looks like the documentation is only in the circuitpython build guide.

Changes and Concerns

See the changes [here](https://github.com/TG-Techie/circuitpython/blob/cb2bf41be6bec85f655fcff9c73b8a...

orchid basinBOT
manic glacierBOT
#

Thanks for the suggestion. I've fixed the second problem you noted, and offered a pull request to add the new 'feature', though I don't know whether Adafruit will choose to accept it.

If you have further issues or enhancements specifically about the circuitpython.org website, you can file them over on that repo: https://github.com/adafruit/circuitpython-org/ -- though it's no trouble that you filed this issue here.

Thanks again!

#

I noticed an odd message from the pre-commit run in our github ci:

[@octokit/rest] const Octokit = require("@octokit/rest") is deprecated. Use const { Octokit } = require("@octokit/rest") instead

While pursuing this, I found that the action we use (pre-commit/action) is deprecated. Pre-commit instead proposes you use their CI service, https://pre-commit.ci/

On the other hand, transitioning from the current action to a two-step shell command `pip install pre-commit; pre-commit run...

manic glacierBOT
#

I read about this. For open-source repos, it is free, including for an organization. It will automatically fix things that can be fixed, which is good, but requires users to know to pull the automatic changes back when submitting a PR. It will be faster than doing pip install pre-commit, but that is not a big timesink in the scheme of things. The automatic fixing would save a lot of tiny commits for people who forget to install pre-commit locally.

warm flame
#

building my debian workframe... virtualbox is being a Hades Pit with me

orchid basinBOT
manic glacierBOT
onyx hinge
#

I tried out pre-commit.ci on two of my personal projects .. https://results.pre-commit.ci/run/github/77753953/1652368838.qvt34fwsRSiYze0oigbXMQ https://results.pre-commit.ci/repo/github/293359557

It's too bad their URLs are opaque. It does run fast, but in one of the two cases I ran into trouble where pre-commit behaved different than locally OR on github actions.

Here's an example of it pushing to a pull request: https://github.com/jepler/wwvbpy/pull/31 https://results.pre-commit.ci/run/github/77753953/1652369245._qJ40VmDTM2jffJpA_bWNQ

manic glacierBOT
#

I tried out pre-commit.ci on two of my personal projects .. https://results.pre-commit.ci/run/github/77753953/1652368838.qvt34fwsRSiYze0oigbXMQ https://results.pre-commit.ci/repo/github/293359557

It's too bad their URLs are opaque. It does run fast, but in one of the two cases I ran into trouble where pre-commit behaved different than locally OR on github actions.

Here's an example of it pushing to a pull request: https://github.com/jepler/wwvbpy/pull/31 https://results.pre-commit.ci/ru...

warm flame
#

I hope it will be accepted this time

jaunty juniper
warm flame
#

dunno

#

or forgot

#

ADHD

jaunty juniper
#

well now you know !

stuck elbow
#

for a moment ;-)

warm flame
#

lol

#

pre-commit failed again

#

but in vscode it told me all was ok in my pre-commit

#

go figure

jaunty juniper
#

I can do suggestions in the PR that you can then accept in the github UI

#

that would then fix it

warm flame
#

you spoke to me in Proto-Elven ?

stuck elbow
#

a leftover tab

manic glacierBOT
jaunty juniper
#

there should be a button to "accept changes" or something like that in the github UI

warm flame
#

ok

tulip sleet
warm flame
#

ok

#

I'm really not used to this way of working

jaunty juniper
#

what software did you use to create the PR ?

warm flame
#

github directly

jaunty juniper
#

ah, if you use the github app for example you can modify your code and push more changes to the PR to fix pre-commit issues and stuff

warm flame
#

cool cool

idle owl
#

@tulip sleet For sys.path, is it weird to do print(sys.path) in the REPL? vs simply sys.path which does the same thing. I'm asking because in the guide I suggested that you could run the two lines of code in code.py or the REPL, but in code.py it would need to be print(sys.path). So I figured include the REPL example, but use print() so it would work in code as well.

warm flame
#

My prog workflow is dating from before 2005 and the other one I know is for PLC (automation) which is also outdated

tulip sleet
idle owl
jaunty juniper
#

there's a small difference between print(x) and x in the REPL, relative to the automatic use of repr() for strings, but that's fine I think

idle owl
#

oh hmm.

#

ok

jaunty juniper
#
>>> "1234"
'1234'
>>> print("1234")
1234
>>> None
>>> print(None)
None
idle owl
#

So basically for this example, it's fine, but don't assume it is always that way?

jaunty juniper
#

for a list, there would be no difference

idle owl
#

Ok thanks

manic glacierBOT
#

I support this proposal; it would be really useful to be able to use e.g. the M4 CPU power to do FFT, digital filters etc. in a background process from CircuitPython without needing to go back to lower-level programming environments.

For example, people are doing Software-defined Radio (SDR) stuff on ATmega328Ps (see here). So being able to at least do filtering of audio frequencies (low-pass, band-pass, high-pass), amplitude modification, amplitude...

warm flame
#

I'm actually nervous about that pull request

warm flame
idle owl
#

We all started somewhere, and we all had our first PRs, and our first complicated PRs.

#

We're all here to help out with it to make sure you're able to contribute.

#

I understand being nervous, I was too. But there's no need. We understand.

warm flame
#

I also have general anxiety disorder ...

idle owl
#

That I also understand.

warm flame
#

so yeah pretimuch anything makes me nervous

jaunty juniper
#

it passed pre-commit, it's building

warm flame
#

yeah, stills make me nervous

#

Achievements are hard to accept for me

idle owl
#

Well, once this is sorted, we can be excited for you. 🙂

warm flame
#

---> Cannot find file ../ports/espressif/build-Lilygo-T-oi-Plus-ESP32C3/firmware.uf2

#

this is making me pannic

#

lol

onyx hinge
#

I can empathize with nervousness about waiting for the computer to say "no". It does it without a hint of empathy. But it's not capable of any. We are, though, or aspire to be.

manic glacierBOT
#

It would make CircuitPython a real killer environment for commercial solutions if there was some kind of support for modern software security features in the uCs.

I could imagine several routes for achieving this:

  1. Be able to compile a custom CircuitPython binary (uf2 image?) that bundles your application code and the CPy environment and then be able to set the security bits.

  2. Implement a code-encryption mechanism so that the upload uses a public device key for encrypting the so...

idle owl
warm flame
#

Yes

#

I am

idle owl
#

The build hasn't failed yet. Sometimes things that look like failure warnings are standard parts of the process.

warm flame
#

it spawn succes on build. But loop

#

but well, this is my first time

warm flame
#

got a build error

#

back to edit

onyx hinge
#

@warm flame so you're right that the line about not finding .uf2 is important

#

esp32-c3 can't use uf2 (as far as I know), so it is necessary to add the board to a list of exceptions

jaunty juniper
#

it would be nice to have defaults per variant or whatever it's called

onyx hinge
#

look in tools/build_board_info.py and find the lines like ```python
# esp32c3
"adafruit_qtpy_esp32c3": BIN,

#

And yeah it would be better if this were more automatic like neradoc suggests! but as of now it's not

#

that's around line 72 in my copy

warm flame
#

ok

idle owl
#

Hey. @tulip sleet ... I just realised I was running sys.path on the Circuit Playground Bluefruit, and still got this: ```Adafruit CircuitPython 7.2.5-1-g8d7390992 on 2022-05-10; Adafruit Circuit Playground Bluefruit with nRF52840

import sys
print(sys.path)
['', '/', '.frozen', '/lib']```

#

I don't see any frozen libraries in that build.

#

Also, where is .frozen anyway? It's not a visible directory, so I should probably explain the concept...

tulip sleet
#

it's a fake directory; the frozen stuff is not really in the filesystem. I'm trying to remember which board didn't show frozen stuff at all.

idle owl
#

QT Py I think

#

I think that's what you had

jaunty juniper
#

you can't os.listdir(".frozen") for example

idle owl
#

right

jaunty juniper
#

the pico has no .frozen, is it a RP2040 thing ?

idle owl
#

I read up on sys.path and for the first time, wondered how it actually worked with .frozen. It simply made sense before, .frozen means the frozen modules.

#

But now knowing what sys.path does, I questioned it for the first time.

tulip sleet
#

I was looking on a QT Py SAMD21, hmm

idle owl
#

That's what I thought.

tulip sleet
#

the "original" QT Py

idle owl
#

Yeah.

#

Do you have a Trinket or GEMMA handy?

#

Maybe it's a lack-of-flash thing?

#

Stretching here.

tulip sleet
#

yes, I'm going to check that

onyx hinge
#

I think that in 7.2.5 it is listed on all boards, but in 7.3.0 it's only listed if used

#

@tulip sleet @idle owl

idle owl
#

Ohhhhhh.

#

Hmph.

#

I guess I'll pretend folks are using 7.3.0 and ignore any feedback between now and then about the page being wrong.

tulip sleet
#

i have no memory of such a PR, hmm

onyx hinge
#

It came with a micropython merge is my guess

tulip sleet
#

sounds right - they revamped the mechanism, and we took parts of it

#

thanks!!

tulip sleet
idle owl
#

I guess at least I'm not completely off?

tulip sleet
#

there is definitely a problem on S3, it's obscure, I can't make it happen when using the Arduino library. It is clock-stretching-related, it appears

idle owl
#

It's always clock stuff.

tulip sleet
#

hmm, you actually reproduced on S2 with bitbangio

idle owl
#

Yeah.

tulip sleet
#

so anyway I am going to concentrate on S3 with regular busio

idle owl
#

Consistently.

#

Yeah that makes sense.

tulip sleet
#

i am amazed this sensor works at all. The datasheet implies it's hard to wake up, and that it may prevent other I2C devices from working when it's asleep. But that does not happen

idle owl
#

Hah! No I haven't run into any of that nonsense.

tulip sleet
#

I may push this past 7.3.0, this may be another job for Espressif to fix, but I have to come up with a non-CIrcuitPython failure. And the fellow who fixed the previous I2C bug is stuck at home Shanghai so his supply of I2C devices is very limited

#

anyway, just FYI

idle owl
#

Oi. Ok thanks for letting me know.

tulip sleet
#

o-marshmallow: Omar

idle owl
#

Oh that's where the username came from. That's pretty funny.

warm flame
#

how do I add file to a pullrequest

manic glacierBOT
#

I am going to ignore the S2 bitbangio issue for now. The LC709203F does clock stretching for several ms at a time, which seems to be an issue for the S3. I cannot reproduce the problem using https://github.com/adafruit/Adafruit_LC709203F/tree/master/examples/LC709203F_demo and removing the delay in loop(). I see clock stretches in that case, but they are handled properly. So there's something different about CircuitPython, perhaps again the multiple tasks we are running.

tulip sleet
idle owl
#

I'm not sure how to do that through GitHub. I have run into this previously and usually end up switching to working on it locally on my machine. I would google whether there's a way to do it through the GitHub UI though.

tulip sleet
#

@warm flame in your branch in GitHub, use this:

idle owl
#

Oh nice!

warm flame
#

did it.

#

I forgot a space between ":" and "BIN" failed pre-commit

#

lol

#

should be ok now

idle owl
#

This guide page is a massive wall of text. I have no idea what to use as images. Have to come up with something.

#

Probably screenshots of CIRCUITPY with various libraries or some such. Kind of boring, but better than nothing.

warm flame
#

build worked

idle owl
warm flame
#

what are the 2 yellow check ?

idle owl
#

Yellow dots? They're queued up, or haven't finished running yet.

#

Some CI things require other things to complete before they show up and run.

#

So sometimes, you'll think it finished because one of them completed successfully, but then another one shows up.

warm flame
#

so it takes a lot of time ?

idle owl
#

Oh yes. Much less than it used to, but still can be quite a bit.

manic glacierBOT
jaunty juniper
#

it's gonna build every board because of the change to build_board_info.py, so it takes a long time

warm flame
#

ohhhhhhhhh

jaunty juniper
#

nothing we can do about it for now

warm flame
#

it should pass then

#

because I didn't touch to anything more than the ESP32-C3 board

#

and it already passed

#

wth

#

my build failed

#

again : Cannot find file ../ports/espressif/build-Lilygo-T-oi-Plus-ESP32C3/firmware.uf2

#

"lilygo_ttgo_t-oi_plus": BIN,

jaunty juniper
#

yeah you need to use the exact directory name "Lilygo-T-oi-Plus-ESP32C3" it's the board identifier

#

also I would prefer personally that it uses all lower case

warm flame
#

ok will change that then

jaunty juniper
#

that's just me I guess, but I think we should have a rule about that

#

I'm just bothered by Seeed_XIAO_nRF52840_Sense and the inconsistency with other xiao boards

tulip sleet
#

in general we use underscores in the directory names

#

and I agree, they should be all lowercase

warm flame
#

changed it

#

to exactly the "lilygo_ttgo_t-oi_plus": BIN, code line

manic glacierBOT
warm flame
#

anyways be back later

proven garnet
#

@idle owl am I still good to run the patch tomorrow for the pre-commit file?

idle owl
proven garnet
#

Sweeto! Will do!

proven garnet
#

Whoops, I meant Saturday, but same same!

manic glacierBOT
idle owl
proven garnet
#

The core adafruit_bus_device module is only present when frozen in, right? I'm gonna mention that and link to the external one repo in the core docs but wanted to check

idle owl
#

And if it doesn't fit in a given build, you have to load it into the lib folder manually.

manic glacierBOT
idle owl
#

Turns out NeoPixel is a great library to show the difference in memory usage between mpy, py, and frozen imports (on CPX). Tried CircuitPlayground library first, but I knew what the result would be when I got to .py file, failed. I got screenshots anyway, might have a place somewhere on this page.

marble hornet
#

Hi all!
Cookiecutter is still the preferred way to make new libraries?
(A quick glance at the learn guide says yes but thought it'd be worth a doublecheck)

idle owl
#

Also, good to see you! It's been ages 🙂

marble hornet
idle owl
#

Quite a bit!

marble hornet
#

And you too! It's good to be back 😊

idle owl
#

The README should be up to date with what prompts mean what, and I think the guide is also up to date, but I'm not certain.

marble hornet
#

So far it looks like it is both update date and mirrored

idle owl
#

Excellent

marble hornet
#

Could a run a specific to this question by please?
I've been working on a thing and am not sure which if any bundle it would be best for.

idle owl
#

Sure! I might have an answer. If I don't, someone will, I'm sure.

marble hornet
#

Thanks, I ask b/c I'm guessing you will 🤷‍♂️😄 (or pass it to the weekly meeting)
(typing...)

manic glacierBOT
marble hornet
#

A) Would there be interest in a minimal typing library? (with ~one alteration to the Core)
B) Would it be something that should be on the adafruit, circuitpy org, or community track?
C) Has there been previous discussion of this? I did some searching around but didn't find PRs or other documents (I have not checked recording)

My bad, It's three. Maybe this should be a issue or PR

Optional explanation:
I've made a branch of CP that supports __class_getitem__ after making a typed codebase and struggling to hack it into working on stock CP. In short, i think the only things needed to make it "hack-less" is bing able to do SomeType[...] and a typing module with TYPE_CHECKING, Generic, Protocol, TypeVar, and

marble hornet
idle owl
#

No worries, thanks for tagging me, I was off elsewhere.

#

Reading now.

#

We have a typing library?... hold on

#

@marble hornet How close is this to what you mean?

warm flame
#

didn't work

marble hornet
#

Oh i mean the opposite. Bringing some cpython typing to CP.

warm flame
#

didn't name the directory right

marble hornet
idle owl
marble hornet
idle owl
#

I'd say so yeah, for sure. No idea what will come of it, but it's definitely worth bringing up.

blissful pollen
jaunty juniper
#

I would think the frozen python module would take more space than the native implementation ?

idle owl
#

If I'm comparing import memory free between frozen, mpy and py, what's the best comparison to use? Difference between frozen and py, and py and mpy? Or difference between frozen and both py and mpy, or difference between baseline and frozen, mpy, and py? Now that I'm thinking about it, probably baseline.

#

Otherwise it's not really a good comparison.

blissful pollen
#

Baseline may make it easy to see, rather then relative

idle owl
#

Yeah that's what I realised after typing it. Basically, once I had it in front of me typed out, it was obvious.

warm flame
#

/dance

#

The green cat giraffe !!!!

warm flame
#

38 boards to check left

manic glacierBOT
warm flame
#

@jaunty juniper What's the next step ?

jaunty juniper
proven garnet
jaunty juniper
#

it's CIRCUITPY_BUSDEVICE, which is on by default in full builds

#

full builds (CIRCUITPY_FULL_BUILD) is turned off on some small boards, typically M0

#

that's more than I expected

#

but I guess it's all M0s

warm flame
#

and I never used ruby

#

too many new stuff

blissful pollen
manic glacierBOT
manic glacierBOT
proven garnet
manic glacierBOT
#

If this is about enabling the use of these expressions for typing, consider just making sure there's no need to evaluate the typing definitions. I think the best we've found (in terms of effect on mpy size or RAM size) is

from __future__ import annotations

try:
    from typing import TYPE_CHECKING
except ImportError:
    TYPE_CHECKING = const(false)

if TYPE_CHECKING:
    optional_str = str | None
    str_int_dict = dict[str, int]

...
def f() -> optional_str: ...
tulip sleet
onyx hinge
#

@tulip sleet Unless someone thinks there are >1 bit SH1107 displays then we either want to ignore the positional argument, or give an error. Ignoring it had the lower flash size cost.

#

giving an error would be better, but I didn't want to add messages to the core

tulip sleet
#

Scott was interested in an error. I will see if there's a message we can reuse, or maybe use the range checking arg checker

#

I will take it over

onyx hinge
#

thank you, feel free.

tulip sleet
#

are you quitting work early today? You will have a marvelous trip, bon voyage!

onyx hinge
#

if we were taking my 'solution' then at a minimum a note in the docs should be added that the flag is ignored unless it's a 1bpp display

#

thank you! I will be 'around' today but I am not necessarily 'working'.

jaunty juniper
#

say, I'm not sure what that implies by the way:

typing.TYPE_CHECKING

A special constant that is assumed to be True by 3rd party static type checkers. It is False at runtime.
onyx hinge
#

and then tomorrow is travel day, sunday is the first day in paris

tulip sleet
#

the actual module defines it as False

jaunty juniper
#

but what does it to test it then ? wouldn't it cause a runtime error when annotating with the types guarded by it?

onyx hinge
#

not when used in conjunction with from __future__ import annotations

#

or using string-annotations

#
from __future__ import annotations
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from typing import Optional
    
def f() -> Optional[str]: pass
```so for instance this is acceptable to Python3 even though 'at runtime' `Optional` isn't actually imported
#

as is this variant, which uses a string annotation: ```python
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from typing import Optional

def f() -> "Optional[str]": pass

#

and in CircuitPython, python try: from typing import TYPE_CHECKING except ImportError: TYPE_CHECKING = const(0) # can't be const(False) means everything in the if TYPE_CHECKING: block is not even placed in the mpy file, which is pretty keen

tulip sleet
#

could do?

try:
    from typing import TYPE_CHECKING
    # put conditional stuff here
    from typing import Optional
    optional_str = str | None
    #etc.
jaunty juniper
#

so it's telling the static analyzer where to look for types that are otherwise hidden from the runtime

onyx hinge
tulip sleet
#

you're right about the dead-code, yes, I forgot that

onyx hinge
#

actually adding typing to jepler_udecimal enough for it to pass mypy --strict is feeling like a challenge!

manic glacierBOT
#

Another day, another documentation PR! Resolves #6381, and works towards #6326:

  • Adds additional exceptions to builtins

Adds links to guides/libraries for:

  • qrio
  • fontio
  • terminalio (really just a note additional that it doesn't give REPL access with link to REPL guide page)
  • microcontroller (actually just a touchup, no linking)
  • audiomp3
  • rp2pio
  • alarm
  • bitmaptools

Also makes additions from #6353 prettier.

manic glacierBOT
onyx hinge
#

Found 436 errors in 3 files (checked 3 source files)
Yup, typing jepler_udecimal is a slog.

manic glacierBOT
idle owl
#

Seriously arbitrary style question: If I'm referring to a ".mpy file", should I expect people to read the . as "dot", meaning I put "a" before it, or should I expect people to skip over the . and read only "mpy", in which case it should be "an" before it?

manic glacierBOT
proven garnet
idle owl
#

I keep going back and forth, I've been leaning towards "an" but haven't been consistent, and I need to be.

proven garnet
#

Looking at it too long, I almost feel it works the other way - I'll read it differently depending on whether you use "a" or "an" haha

idle owl
#

Hah!

#

I CAN MANIPULATE YOUR BRAIN.

proven garnet
manic glacierBOT
idle owl
#

@proven garnet I was thinking. Equally as important as the pre-commit-config patch, is getting cookiecutter in line with the current updates. Otherwise, new libraries are being created that aren't up to date and we end up missing things. Is that something you could also work on this weekend? I left one suggestion here: https://github.com/adafruit/Adafruit_CircuitPython_TSC2007/pull/2 but if that's everything, please add these changes to cookiecutter if you have the cycles.

manic glacierBOT
#

I am (again) looking at consolidating error messages that are almost identical, and using common validation routines like the mp_arg_validate... routines when possible. The last time I tried this, it didn't save that much, but it does reduce the number of messages that need to be translated. I won't submit a final PR until after 7.3.x is branched, but I did a bunch already, and I have an older branch with similar work I need to look at again.

proven garnet
#

Yeah, I can definitely do that. Is everything ready to go? If so I can shipit shipit ship_it_parrot

idle owl
proven garnet
#

Sweeto! Yeah, I can get it done over the weekend, possibly today

idle owl
#

Perfect, thank you. I can't help folks who started a library 2 months ago, but I can help folks creating libraries moving forward. 🙂

proven garnet
#

I'm playing around with automatically building a template library with cookiecutter and seeing if hooking it up as an upstream in git has any success

idle owl
proven garnet
#

So every cookiecutter change would build a library, but I'm not sure how having a repository setup like that will behave since it isn't really an upstream (I think?)

idle owl
#

Not even sure I'm following 😄

proven garnet
#

It's a python script that could run via CI that would submit a pull request to a library (say, "CircuitPython_AutoBuild") with infrastructure changes, and anyone with that as an upstream could easily pull changes from it. Or that's the hope anyway.

idle owl
#

Oh oof. I'd be totally lost as to how to do that. But I now understand what you mean.

proven garnet
#

cookiecutter has a pretty sleek Python interface it seems, so I'm starting there

idle owl
#

Nice

proven garnet
#

But it can't catch everything, if for some reason we need to modify __version__ in library files or something then womp womp

#

but maybe at least the other stuff

idle owl
#

@proven garnet Bonus points if you do a pass on .pylintrc to up min-similarity-lines= to 12 while you're at it. 😆 This is not as high a priority though. So don't feel obligated. I think Adabot might be able to do that, but then again, I think that regularly and am regularly incorrect. So...

slender iron
#

is jerry out of town?

deft jay
#

Is there any hope for support for XMP (not NEC) IR protocol within the adafruit_irremote library? Is it already there and I just don't know how to read a help manual?
guptaxpn — Today at 2:28 PM
https://github.com/crankyoldgit/IRremoteESP8266/issues/1414 << It would appear that it's been done elsewhere, but I just can't figure out how to port this.

GitHub

Hi thanks for creating this library! Is there any chance we could get support for the XMP protocol? This is a protocol used commonly by Comcast/Xfinity remotes. For this specific protocol, here are...

#

Probably better suited for this channel.

slender iron
#

@deft jay I don't think it should go in irremote but could be in a new library

#

I don't know why we'd add support for it though

deft jay
#

Comcast remotes specifically utilize XMP

slender iron
#

is making a non-blocking function blocking an api break?

deft jay
#

which services a huge portion of the US

slender iron
#

(separate question)

#

I don't think anyone from adafruit will create an xmp library

idle owl
#

Tannewt is asking whether you changing a non-blocking function into a blocking function is considered breaking the API. The wording was a bit odd.

deft jay
#

Would adafruit accept pull requests?

idle owl
#

Well, there's two options here. If it's a separate library, which it sounds like it sort of needs to be, you could submit it to the Community Bundle. If it were to be included in the existing library, then yes, you would make a PR to the lib. However, IRRemote is one of those libs we can't really extend too much because it's included in CircuitPython builds for memory-constrained microcontroller boards. So we have to be careful in considering what to add.

#

Basically, you would create a library under your own GitHub, submit it to the Community Bundle, and then it's available within the Community bundle for download on circuitpython.org/libraries.

deft jay
#

Aah

#

so that's why it's NEC only

#

an odd omission considering the arduino ones are so big

#

but I guess they also get cut back at compile time

idle owl
#

I think we implemented NEC, and that was enough for most things, so we went with it for CircuitPython, and then when we ended up needing it in memory-constrained situations, we decided to keep it as such.

proven garnet
deft jay
#

@idle owl was there inspiration from this project in the dev for the adafruit library? : https://github.com/cyborg5/IRLibC ?

It looks several years since last commit, I wonder if there's a way to pull some stuff around

idle owl
proven garnet
#

Got it, I'll add that in for the infrastructure patch then

#

Is that also ready to roll out?

idle owl
idle owl
proven garnet
deft jay
#

He's the reason I felt like I could take this project on. Or at least his personal remote project.

#

I'm thinking his library might actually work, I think GICABLE might be comcast?

idle owl
proven garnet
idle owl
#

Probably better to do in pieces anyway.

manic glacierBOT
idle owl
#

The .pylintrc change from 4 to 12 came out of the Sprints. The reason it's no rush, is it hasn't come up in other libs yet, but it almost certainly will.

#

So I'm getting ahead of things.

#

For once 😄

proven garnet
#

No worries! I'll add it to that "PR" I just mentioned and after this round of patches start working on something for those. Unless Adabot is able to do them, but otherwise I'm happy to

idle owl
#

Well, we can try Adabot in teaching you how to do it, to find out if you can.

proven garnet
#

Oh yeah, I 'member

idle owl
#

The more complicated the patch, the more likely it is to fail across more libraries.

#

So it might be worth doing multiple patches for that one.

#

I say might be, I mean is.

proven garnet
#

Sounds good! If next week is good, I can make myself available from 12-1 any day!

#

Or another week, no rush for me

#

Wednesdays are a little dicey since I have a 1pm, but doable!

idle owl
#

Mondays are always busy with meetings. Tuesday is typically free. We can start then and move it into further days if necessary.

proven garnet
#

Sounds good!

idle owl
#

I added it to my calendar. Hopefully you're better at remembering things than I am.

#

Feel free to ping me before that so it's on my radar, heh.

idle owl
#

Hah 😄 Well, maybe between the two of us, lol.

idle owl
#

Hmph. CircuitPlayground library was missing from /frozen for some reason. I was on main branch. Obviously pull and make fetch-submodules fixed it. But I'm still curious how it wasn't there to begin with. 🤷🏻‍♀️

manic glacierBOT
#

Hey @dhalbert, this is ready functionality-wise at this point; it does look like I pushed some builds over the edge though (~50 bytes too much for most failures). There are some that seem a bit odd though, for example trinket_m0_haxpress at 732 bytes over?

As you mentioned above, this probably means that this feature should go behind a feature flag?

manic glacierBOT
manic glacierBOT
devout jolt
#

Just curious, does anyone know of any reason why compiling with#define CIRCUITPY_DISPLAY_LIMIT 4 and creating four displayio.I2CDisplay objects would cause a HardFault?
I don't see anything obvious in "shared-module/displayio/init.c" (I'm trying to use four SSD1306 I2C OLEDs on a ESP32s3. Any three work)

tulip sleet
devout jolt
warm flame
#

@tulip sleet yeah T-01 and T-oi are confusing!!!

tulip sleet
#

quote: _T-OI As the name suggests, T is still our T series. TOI is from the right to the left, meaning IOT products. _

devout jolt
#

lol

jaunty juniper
#

! tcefreP

manic glacierBOT
manic glacierBOT
#

Both the atmel-samd and the nrf ports wait until the UART peripheral is no longer busy to return. I think, but am not sure, that mean that the last byte has been transmitted out of the FIFO. If the i.MX port is not doing that, then it should, and we would welcome that fix.

There is an issue I found about this for atmel-samd: https://github.com/adafruit/circuitpython/issues/1770

#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.5-716-gd2d08fc94-dirty on 2022-05-13; Adafruit QT Py RP2040 with rp2040

Code/REPL

import time, gc
import board, busio, displayio

displayio.release_displays()

for i in range(5):
    print("waiting for USB", 5-i)
    time.sleep(1) # wait for USB to connect

i2cA = busio.I2C(scl=board.SCL, sda=board.SDA)
i2cB = busio.I2C(scl=board.SCL1, sda=board.SDA1)
#i2cB = busio.I2C(scl=board.TX, sda=boa...
manic glacierBOT
#

Hi, I came here looking for a solution to a problem, where RP2040 communicates with LTE/WiFi to send data. At this time pretty much any library is using time.sleep. Meaning while I am sending data over UART the code is blocking. The device does not react to buttons, etc. My understanding is if a thread would be used for offloading data another thread could be used to keep the device "operational". I am happy to be educated on different approach to resolve this scenario.
Thank you

tulip sleet
#

@jaunty juniper so RTD broke even though there were no errors in the CI build?

jaunty juniper
#

yup, it runs its own thing from .readthedocs.yml which does not use the same rules as the CI

#

but apart from this file, I don't know what makes it do what where why

#

I wonder if RTD offers a way to test build the docs with their system in the CI so it's run with the actual configuration file it uses (and fails if the configuration causes an error)

tulip sleet
jaunty juniper
#

I kind of want to add a comment in ci_fetch_deps.py:

elif target == "docs":
    # NOTE: must match .readthedocs.yml as this script is not run by readthedocs
    submodules = ["extmod/ulab/", "frozen/"]
tulip sleet
#

feel free, push a new commit in the fixup PR

#

it will restart (it hasn't started yet anyway)

onyx hinge
#

I've experimentally enabled this setting on circuitpython

#

(just now)

tulip sleet
#

You could also set up your own readthedocs site just for testing (maybe you can hide it from search engines), and do it on your own pushes, or trigger the webhook manually only

manic glacierBOT
#

This saves 124 bytes on trinket m0, though at some performance cost (I didn't measure). On "full build"s it saves 24 bytes, the rest is only saved on small builds.

Taking just the extra memset() removal part of the patch saves 24 bytes of flash, removing the int-at-a-time optimization from string0 saves 100.

It's lightly tested on a pygamer with the de-optimization manually enabled (it wouldn't be enabled on a pygamer by default).

onyx hinge
#

why yes, it's my travel day and here I am making CP patches

tulip sleet
#

@onyx hinge I am going to defer that until after 7.3.0 🙂

#

are you packed?

onyx hinge
#

yes

#

plants/garden are what's left, and that's not my province.

tulip sleet
#

well, if it's a distraction from impatience or worry, sounds fine

onyx hinge
#

impatience, mostly

manic glacierBOT
onyx hinge
#

you couldn't make all of these in CP, but you could make some (and think about what core changes would enable some of the other ones at a minimum of fuss) .. https://blinry.org/50-tic80-carts/

Ever since I read about the Make 50 of Something technique in Vi Hart's blog post about Fifty Fizzbuzzes, I wanted to try it for myself! Creating 50 of, well, anything, in quick succession seemed like a fun challenge!

tulip sleet
manic glacierBOT