#circuitpython-dev

1 messages · Page 426 of 1

idle owl
#

Blergh.

onyx hinge
#
From https://github.com/raspberrypi/pico-sdk
 ! [rejected]        1.3.0      -> 1.3.0  (would clobber existing tag)
jepler@bert:~/src/circuitpython/ports/raspberrypi/sdk$ git tag -d 1.3.0
Deleted tag '1.3.0' (was ebc601f)
jepler@bert:~/src/circuitpython/ports/raspberrypi/sdk$ git fetch origin --tags
From https://github.com/raspberrypi/pico-sdk
 * [new tag]         1.3.0      -> 1.3.0
``` for me, this fixed it
#

(manually deleting the tag that they replaced/changed/updated)

idle owl
#

huh. Ok.

#

I'll try that.

onyx hinge
#

good luck!

idle owl
#

Also, git status is showing all the submodules updates. Now I have this: modified: ports/broadcom/firmware (untracked content) modified: ports/stm/st_driver/CMSIS_5 (untracked content) modified: tools/Tecate-bitmap-fonts (untracked content) modified: tools/adabot (untracked content) modified: tools/huffman (untracked content) modified: tools/uf2 (untracked content)

onyx hinge
#

I almost always ignore 'untracked content' messages

idle owl
#

Hm ok. I always use git add . so I usually don't ignore them, heh. Probably spend less time adding specific files than I do going through all of those directories and figuring out what changes to delete, simply so I can do git add ..

#

But half the time I do the longer process.

#

Ok, more than half.

native sandal
#

Hey @lone axle , thanks for getting back to me. Yes, mypy --disallow-untyped-defs produced those warnings, that's how I approached finding what needed annotation. The problem I'm having is that I can't seem to properly import WIZNET5K so that it's known to mypy as a type name. Anything I try results in

Name "WIZNET5K" is not defined

I even tried adding from adafruit_wiznet5k import WIZNET5K but I get Module "adafruit_wiznet5k" has no attribute "WIZNET5K".

onyx hinge
#

I try to always use git-gui and select things one by one

idle owl
#

I've never heard of that.

#

I'll look into it eventually. Thank you for your help!

idle owl
lone axle
native sandal
#

Lemme know if that's not what you meant

native sandal
# lone axle it's on the annotations like this one https://github.com/JetForMe/Adafruit_Circu...

As far as trying to annotate that specific type, yes. But there are other errors related to import, too (note that the line numbers are off here a bit because I've been experimenting):

$ mypy adafruit_wiznet5k/adafruit_wiznet5k_socket.py --disallow-untyped-defs
adafruit_wiznet5k/adafruit_wiznet5k_socket.py:19: error: Module "adafruit_wiznet5k" has no attribute "WIZNET5K"
adafruit_wiznet5k/adafruit_wiznet5k_socket.py:30: error: Name "wiznet5k.WIZNET5K" is not defined
adafruit_wiznet5k/adafruit_wiznet5k_socket.py:123: error: Function is missing a type annotation
adafruit_wiznet5k/adafruit_wiznet5k_socket.py:153: error: Module has no attribute "adafruit_wiznet5k"
adafruit_wiznet5k/adafruit_wiznet5k_socket.py:159: error: Module has no attribute "adafruit_wiznet5k"
adafruit_wiznet5k/adafruit_wiznet5k_socket.py:160: error: Module has no attribute "adafruit_wiznet5k"
adafruit_wiznet5k/adafruit_wiznet5k_socket.py:161: error: Module has no attribute "adafruit_wiznet5k"
adafruit_wiznet5k/adafruit_wiznet5k_socket.py:162: error: Module has no attribute "adafruit_wiznet5k"
adafruit_wiznet5k/adafruit_wiznet5k_socket.py:164: error: Module has no attribute "adafruit_wiznet5k"
adafruit_wiznet5k/adafruit_wiznet5k_socket.py:198: error: Module has no attribute "adafruit_wiznet5k"
adafruit_wiznet5k/adafruit_wiznet5k_socket.py:219: error: Module has no attribute "adafruit_wiznet5k"
adafruit_wiznet5k/adafruit_wiznet5k_socket.py:220: error: Module has no attribute "adafruit_wiznet5k"
adafruit_wiznet5k/adafruit_wiznet5k_socket.py:224: error: Module has no attribute "adafruit_wiznet5k"
adafruit_wiznet5k/adafruit_wiznet5k_socket.py:236: error: Module has no attribute "adafruit_wiznet5k"
adafruit_wiznet5k/adafruit_wiznet5k_socket.py:252: error: Incompatible types in assignment (expression has type "Tuple[int, ...]", variable has type "Optional[str]")
adafruit_wiznet5k/adafruit_wiznet5k_socket.py:252: error: Item "None" of "Optional[str]" has no attribute "split"
adafruit_wiznet5k/adafruit_wiznet5k_socket.py:291: error: Module has no attribute "adafruit_wiznet5k"
#

Most of those error messages are caused by mypy suddenly not liking the imports when type annotation is applied to the containing method. If you remove the type annotations, then those "Module has no attribute" errors go away

#

(A couple of those errors are because I don't have the annotation quite right)

#

Can anyone explain why the original file has import adafruit_wiznet5k as wiznet5k but then references all symbols in that module as wiznet5k.adafruit_wiznet5k.<whatever>?

lone axle
#

@native sandal I was able to get it to recognize the class by doing the import like this:

from .adafruit_wiznet5k import WIZNET5K
#

then the annotations like this:

native sandal
#

Huh. What does the leading . do?

lone axle
#

I am probably not the best suited to answer accurately... My understanding is it tells it to look "in this directory" for the thing trying to be imported

#

similar concept to ./ in a terminal.

native sandal
#

Makes sense

#

I'm still uncomfortable with the other import

#

import adafruit_wiznet5k as wiznet5k

lone axle
#

I don't really get why it would be needed specifically in this case because it seems like wiznet5k.WIZNET5K should have existed to me.

native sandal
#

Agreed

lone axle
#

I don't have any insight into the way the import is done in the original code either unfortunately.

idle owl
#

@lone axle So, wait. Will it continue to follow the same actions run as long as it's running? Or on the next loop does it consider it already_shown and not do anything with it?

lone axle
#

@native sandal if you are interested in doing so you could refactor a bit to change how constants are imported and other tweaks while you're working on typing. Totally cool if you'd rather not tackle it all at once, or at all as well though.

lone axle
idle owl
#

Ahhhh ok

#

I was confused momentarily.

native sandal
#

Well, now that we've got the class importing, I'm running into new issues. I have to make _the_interface type Optional[WIZNET5K], and then I get a ton of:

adafruit_wiznet5k/adafruit_wiznet5k_socket.py:77: error: Item "None" of "Optional[WIZNET5K]" has no attribute "get_host_by_name"
lone axle
#

When we get the bulk of the libraries taken care of on the first pass then at some point we'll enable mypy checks in the actions, and at that time choose the right configuration that will affect which things it flags.

#

bot deleted it. I can see though

native sandal
#

Why did it get deleted? I just thought I had a stroke

lone axle
#

My guess is the inclusion of "hell". But not sure.

native sandal
#

Well, I guess I can make it this: _the_interface: Any = None

idle owl
#

Yes, that was the issue.

native sandal
#

Any idea what the types should be on these parameters?

    def __exit__(self, exc_type, exc_val, exc_tb):
        if self._sock_type == SOCK_STREAM:
            self.disconnect()
            stamp = time.monotonic()
            while self.status == wiznet5k.adafruit_wiznet5k.SNSR_SOCK_FIN_WAIT:
                if time.monotonic() - stamp > 1000:
                    raise RuntimeError("Failed to disconnect socket")
        self.close()
        stamp = time.monotonic()
        while self.status != wiznet5k.adafruit_wiznet5k.SNSR_SOCK_CLOSED:
            if time.monotonic() - stamp > 1000:
                raise RuntimeError("Failed to close socket")
lone axle
#

It may end up being the case that some libraries may need more refactoring in some situations in order to appease all of the mypy checks. Some may end up being ignored or configured less strictly.

#

I'm not familiar with __exit__ but I would guess that CPython has something similar and our arg types should probably match.

jaunty juniper
#

type is ignored, exc_val would be an Exception instance, exc_tb is the traceback, obtainable with ex.__traceback__

native sandal
jaunty juniper
#

at least I think, it matches the arguments of traceback.print_exception

#

(well you don't need to, annotations are optional)

native sandal
#

Of course, but for completeness…

jaunty juniper
#

it's the type of the exception, so Type[BaseException] apparently

native sandal
#

Ugh, the code plays fast and loose with types internally (e.g. host can be a str or bytes and it branches based on type. Makes annotation hard, even with Union

lone axle
#

it's okay if you end up sticking to more generic types for the variables that are like that. First pass has exposed one or two other libraries with similar things. Not needing to have it solved 100% now though. We're aiming to get the bulk of the straight up missing annotations filled in before we get into the specifics in some of the more convoluted cases.

proven garnet
#

Oops I just got home but I'm free now

#

Or tomorrow

idle owl
#

Tomorrow and Wednesday likely don't work for me. Figuring out what sushi we want for dinner, once that's ordered, I should be able to chat. Does that work?

proven garnet
#

Sounds good, and I'm definitely referring to sushi as well 🍣 chefskiss

idle owl
#

😄 Nice

jaunty juniper
#

I always take the M6

blissful pollen
#

Just order all the sushi

idle owl
#

This place has a LOT of options. That would be... inadvisable.

blissful pollen
#

Not ordering too much sushi is a skill in itself

idle owl
#

Indeed.

idle owl
proven garnet
#

Yup yup!

idle owl
#

Ok, let's vid.

idle owl
#

@lone axle It occurred to me we could use blinking to differentiate queued and running. Limor liked it. I think I can do that, looking at the code, so I'll try that first, and ping you if I can't get it going. I won't get to it until tomorrow anyway.

manic glacierBOT
manic glacierBOT
#

oh wait, <light dawns> you were asking if the decoded output was backwards.... well I think normally I read the last line of a trace to find the last executed statements. It appears that the output from decode_backtrace is the other way around. That's not really a problem as long as you know which way to read it.

The port.c:294 code looks to me like it's just dumping the backtrace, the referenced code segments prior to that one are:

===============================================
main....

manic glacierBOT
#

I was thinking that the reason I wasn't seeing the assertion message was that the USB interface was crashing so I rebuilt with debug uart enable and connected a terminal via RX/TX.

When connecting via an RX/TX terminal, the board doesn't crash. I should have made this connection earlier but that reminded me of a Micropython wifi crash issue https://github.com/micropython/micropython/issues/8635. It looks like the Micropython issue was resolved by moving to a newer ESP IDF.

manic glacierBOT
#

After some more testing.... it turns out that when connected via an RX/TX connection rather than over UART, the wifi connect usually didn't crash the board, however if I ran the wifi connect repeatedly, it did eventually crash the board.

The comment in /home/pi/circuitpython/ports/espressif/common-hal/microcontroller/init.c concerned me so I threw a return in the if block:

if (nesting_count == 0) {
    // Maybe log here because it's very bad.
    return;
}

This...

timber mango
#

Hello, I 'm designing a sampler with a Pipico and a neotrellis. As the memory is not big enough on the pico, I plugged an SD card with a SPI BUS, but my pico crashes often when I play samples from the SD card. Should I copy the samples to the internal memory of the pico first? If yes, do you know how? I don't understand how to copy the files with the OScircuit python library. Thanks

stuck elbow
#

well, there is no command to copy a file, you just open the source file for reading, open the target file for writing, and then in a loop read all bytes from the former and write them to the latter

manic glacierBOT
wraith crow
#

@timber mango In case it helps, here are the instructions I use to copy files. Copying in binary mode is probably overkill for your application but it won't hurt.

    fOrig = open("/sd/filename")
    fCopy = open("/filename", "wb")
    line = fOrig.readline()
    while line != "":
        fCopy.write(bytearray(line))
        line = fOrig.readline()
    fOrig.close()
    fCopy.close()
manic glacierBOT
onyx hinge
#

@tulip sleet do you remember if we investigated gcc 11.2 (arm's toolchain binary released in February)?

manic glacierBOT
#

I was just going to write to you. I fixed it in a different way, which I think will work too. It is not the same fix as what I gave you. See #6498 and adafruit/samd-peripherals#42. Try the build artifacts: https://github.com/adafruit/circuitpython/actions/runs/2516315728. Scroll down to see the artifacts. Unzip the file for your board and get the .uf2 you need.

I used the latest version of the uf2 file and the newest library and s...

manic glacierBOT
#

Hi Marc,

I get that too still. It's a separate issue that I think needs to be
explored. My workaround is to write a try except block for that error and
use esp.reset() and esp.connect to reconnect to internet in the except
block. That has been working for me well.

On Tue, Jun 28, 2022, 12:42 PM gadjodilo83 @.***> wrote:

I was just going to write to you. I fixed it in a different way, which I
think will work too. It is not the same fix as what I gave you. See #6498
<https://gith...

manic glacierBOT
manic glacierBOT
slender iron
manic glacierBOT
slender iron
#

@tulip sleet have you updated the IDF in your work already?

tulip sleet
slender iron
#

newer 4.4

tulip sleet
#

no, was waiting for 4.4.2. I could try 4.4-dev, because it may have an I2C fix for S3 (which did not work for me when manually applied)

#

is 4.4.2 released? It was not the last time I looked

slender iron
#

ya 4.4.1 is from april

#

nope

#

lots of activity on the branch though

#

there is an IPC fix that may fix deep sleep on the S3

tulip sleet
#

At one point I tried master, but it had many different API changes

slender iron
#

ya, I'm not ready for 5.0

tulip sleet
#

we could try 4.4-dev for sure

slender iron
#

kk, I'll update it

tulip sleet
#

since this is alpha, we can keep moving it up

slender iron
#

yup yup

#

I don't see the same I2C fix in the 4.4 branch

#

will keep on our own patched version

#

should I rebase it?

timber mango
#

Does anyone knows how to change that

stuck elbow
#

does it say "read-only filesystem"?

tulip sleet
slender iron
#

ok, so we aren't using our branch now?

tulip sleet
#

right, I brought ours up to date (and used a different branch name)

stuck elbow
tulip sleet
#

i'll check the PR's

slender iron
#

.gitmodules has us using espressif directly

#

but its set to the commit from our branch

tulip sleet
#

I think that may be a commit from upstream.

tulip sleet
#

I don't understand where that commit could come from if .gitmodules is upstream, hmm

slender iron
#

it must be able to get it anyway

#

so should we keep that I2C fix?

#

I can make them match

tulip sleet
#

the fix is from o-marshmallow, so maybe it is in 4.4-dev

slender iron
#

I looked for the change but didn't see it

tulip sleet
#

yeah, it would be past 4.4.1

#

I'm looking at the 4.4 dev branch now

slender iron
#

release/v4.4 is the active branch I thought

manic glacierBOT
#

this is my code:
`import usb
import usb_host
import board
import digitalio
import microcontroller
import time
import array

#TEST LED
p7 = digitalio.DigitalInOut(board.LED)
p7.direction = digitalio.Direction.OUTPUT
p7.value=True

#INIT USB_HOST WITH POSITIVE AND NEGATIVE PINS
usb_dp = microcontroller.pin.USB_OTG2_DP
usb_dm = microcontroller.pin.USB_OTG2_DN
usb_port = usb_host.Port(usb_dp, usb_dm)

#GIVE POWER TO USB DEVICE
usb_power_on = digitalio.DigitalInOut(board.USB_...

tulip sleet
#

and you can correct the .gitmodules

slender iron
#

you don't want to keep the patch? I was thinking I'd make a new circuitpython8 idf branch

tulip sleet
#

?

#

there is no other source of the patch now, apparently

manic glacierBOT
slender iron
#

@tulip sleet kk, I'll keep it

timber mango
manic glacierBOT
#

Hi Marc, I get that too still. It's a separate issue that I think needs to be explored. My workaround is to write a try except block for that error and use esp.reset() and esp.connect to reconnect to internet in the except block. That has been working for me well. except RuntimeError: esp.reset() esp.connect_AP(config["wifi_ssid"], config["wifi_password"])

On Tue, Jun 28, 2022, 12:42 PM gadjodilo83 @.***> wrote: I was just going to write to you. I fixed it in a different ...

wraith crow
#

@timber mango The instructions @stuck elbow provided should work fine for the Pi Pico, to change the read-only mode you'll need to access the Pi Pico from your computer using the mounted CIRCUITPY drive, but once you have the Pi Pico connected to your computer there's probably no need to run the python commands to copy the file, just copy the file you want from the SD card to the CIRCUITPY drive on your computer.

minor plume
#

@tulip sleet FYI, I just submitted an issue (https://github.com/adafruit/Adafruit_CircuitPython_asyncio/issues/23) for an error I'm getting on importing asyncio on a MatrixPortal M4 with 7.3.1. I'm intending to dive deeper and see if I can narrow down what's going on here, but I'm calling it out in case it's a more widespread problem than just that hardware, since I may not have time to work on it before the end of the week.

slender iron
#

and this version of the idf doesn't start up....

manic glacierBOT
#

I'm getting an exception trying to import asyncio on my device. I've stripped this down to a minimal test case, which is as follows:

Device: Adafruit Matrix Portal M4, running CircuitPython 7.3.1

I wiped the lib directory clean on my device and then installed a bare minimum subset of libraries with the command:

circup install adafruit_matrixportal asyncio

I loaded a minimal code.py file onto the device as follows:

import asyncio

print("Hello from asy...
manic glacierBOT
slender iron
#

@tulip sleet how is esp32 going?

tulip sleet
#

I have it starting up, and it's now failing when doing something in the heap, I think. Your backtrace tool is extremely helpful. It was boot-looping because there were more pins that should not have been reset than the obvious SPI flash and PSRAM ones. I now have the full list: I just printed out each pin before resetting it, and found the ones that caused crashes.
I was out until mid afternoon due to a long appt

slender iron
#

nice! glad it was useful

#

I'm in the IDF weeds because the latest 4.4 doesn't start up

tulip sleet
#

oy!

slender iron
#

I think they made a change that assumes the main task is on the PRO CPU

tulip sleet
#

good sleuthing!

slender iron
#

👍

#

will try a revert to fix

slender iron
#

yup, works after a revert

manic glacierBOT
manic glacierBOT
lone sandalBOT
manic glacierBOT
manic glacierBOT
#

@askpatrickw those are good notes, thanks for including links to the supporting documentation as well. The way Espressif handles this is convoluted, to say the least.

I haven't done the research or testing to verify this, but is it possible the CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER variable doesn't come into play until you try to set a value over the limit? Put another way, is that variable only for setting the maximum wi-fi transmit power?

It looks like the MP workaround sets the actu...

#

I ran the following steps from Linux:

  1. git clone https://github.com/adafruit/circuitpython.git
  2. git fetch origin pull/6531/head:TESTRW
  3. git checkout TESTRW
  4. make fetch-submodules

And then built as I usually do. During the fetech-submodules phase it looked to me like the IDF updated to 4.4.1 but I don't know how to verify if I'm on the correct IDF version and unfortunatly, I'm still getting a crash on the wifi connect when connected via USB.

lone sandalBOT
manic glacierBOT
manic glacierBOT
#

update- much more happiness this time, although not victory just yet.

Here's what I figured out about my problem with the pullup resistors: If I
start up our customized peripheral first (which seems sensible), then the
host will report missing pullup resistors no matter whether they're there
or not. However, if I start up the host first (and it has some sort of
retry loop that keeps looking for a peripheral), then it correctly detects
whether pullups are there or not. So presumably th...

timber mango
timber mango
#

Hello, I' m making a drummachine with a picopi and a neotrellis. The drummachine works with samples (.wave files). As the memory on the pico is very short I decided to plug an SDcard to store sample, but when I play a sample I often got OSError: [Errno 5] Erreur d'entrée/sortie.
Do you think, playing sample from an SD card is a good idea (stable way) ?
Do you think the problem is with my SD card reader ?

manic glacierBOT
jaunty juniper
manic glacierBOT
manic glacierBOT
#

There are multiple instances of a cache conflict going on in the first set of builds:

Run carlosperate/arm-none-eabi-gcc-action@v1
  with:
    release: 10-2020-q4
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.10.5/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.5/x64/lib
Cache miss, downloading GCC 10-2020-q4 from https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 ; MD5 8312c4c91799885f222...
manic glacierBOT
#

There are multiple instances of a cache conflict going on in the first set of builds:

Run carlosperate/arm-none-eabi-gcc-action@v1
  with:
    release: 10-2020-q4
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.10.5/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.5/x64/lib
Cache miss, downloading GCC 10-2020-q4 from https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 ; M...
edgy flax
#

@idle owl @lone axle looking to get involved in the community as a give-back. See a bunch of first issues that are just annotation fixes. Git i've worked though, but stalled at the walk-through at https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO/issues/79 (sorry). Any guidance or ability to get me started?

GitHub

There are missing type annotations for some functions in this library. The typing module does not exist on CircuitPython devices so the import needs to be wrapped in try/except to catch the error f...

lone axle
edgy flax
#

thanks!

lone axle
#

AdafruitIO is one of the larger libraries. If you're interested there are probably some smaller ones that you could attempt first. Although if you have experience with the library that can help in figuring out the types so if you're already familiar with AdafruitIO library and want to jump in on it that is cool as well.

idle owl
# lone axle AdafruitIO is one of the larger libraries. If you're interested there are probab...

@edgy flax I agree with this entirely. I hosted development sprints at PyCon 2022, and everyone who picked up a type annotation issue managed to pick a super difficult one. They persevered, but it was a lot of work for a first submission. I would consider starting with a simpler one to get your feet wet, and once you're comfortable with the process, return to a more difficult library. 🙂

edgy flax
#

also thanks for that heads up. I noticed that the line numbers given in the incidents also don't really line up anymore (but only one or two off, so no biggie). Perhaps i'll look for a smaller one to get going on.....

idle owl
#

If something changed in the library, then yes, things won't match up. We made those issues last year sometime, so things have almost certainly changed in many of the libraries.

proven garnet
#

Is it worth removing the label from some of the more difficult ones? Looking at you, adafruit_ble.

idle owl
proven garnet
#

The ones that come to mind are Adafruit_BLE, Adafruit_IO, Adafruit_GPS (I recall it being wonky). Should I just do all the BLE libraries?

unique python
#

I recently contributed with a couple of type annotation issues, and it was fun. But yeah, there are some difficult ones. It makes sense to first scan the code a bit to see how it looks like, before jumping in 🙂

idle owl
manic glacierBOT
#

I don't know much about ESP-IDF truthfully, but I am used to grepping around such codebases.
Two things that I would try:

  1. In the ports/espressif/esp-idf-config/sdkconfig.defaults there are two defines that seem relevant:
CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20
CONFIG_ESP_PHY_MAX_TX_POWER=20

Maybe try setting both in the board sdkconfig?

  1. Because these are #defines , I would be sure to make clean before each bu...
idle owl
#

@lone axle Does this code only check main, or what's the deal there? I pushed a branch, and it doesn't seem to be picking up the branch run.

#

To my fork, and I updated the URL to be my account.

#

This is what I came up with for testing purposes. Push/PR within my own fork.

#

Well, what Jeff suggested anyway.

lone axle
#

The code bases what it checks on the URL variable near the top.

idle owl
#

Right

#

I changed adafruit to kattni.

lone axle
idle owl
#

Thank you!

lone axle
#

Hmm, I'm not sure about the branches honestly. I did all of my testing on the main circuitpython repo.

idle owl
#

Ok

lone axle
#

one moment. We can pull the same data in the browser and get an idea of what the script will see

idle owl
#

I looked at that JSON file from the API link, and it doesn't show my branch push.

lone axle
#

yeah, it does show this one is main branch

idle owl
#

Current ID is 2584666641

#

I didn't see it in the file.

#

Or is it better to only show main? That would handle PRs which is I guess what matters.....

#

But maybe not for everyone?

#

Bleh.

lone axle
#

Oh, well one thing I think is it's looking specifically for the build.yml workflow. It doesn't seem like your push triggered that workflow to run

idle owl
#

Right... where even is that? I may have deleted it when purging workflows for testing. Which would explain why it didn't run.

#

NM, I did.

#

I'll add that back and try again.

lone axle
#

the specific workflow is specified toward the end of the URL as well. If you wanted to use it for pre-commit.yml instead of build should be able to use this URL:

https://api.github.com/repos/kattni/circuitpython/actions/workflows/pre-commit.yml/runs
idle owl
#

Oh fair enough.

#

Maybe that's enough for testing. Though I wanted to show the GitHub end of things failing next to the light telling you it failed, so..... hmm.

#

I'm already creating an artificial environment here. Not sure how artificial I want to take it.

#

Hmm. Changed it to pre-commit.yml and it shows this in serial console: Fetching workflow run status. completed - failure adding 2584666641 to shown IDs
But the light does nothing.

#

Ok, now it's finding build.yml (I added it back)

#

The light is misbehaving though. We can discuss it when we meet up in 25 minutes.

manic glacierBOT
#

Sure, I want to try to add it. But can you give me brief insight into right direction, please?

Yup! Happy to. Join us on discord if you haven't yet too. There is a #circuitpython-dev channel where we can help you get over any bumps. https://adafru.it/discord

Do I need build new circuitpython for my teensy, or I can just add TinyUSB library to my project and write some glue?
Yes, you'll need to build your own CircuitPython. I thin...

idle owl
#

@lone axle Ok, ready when you are. Good to vid?

manic glacierBOT
#

I'm tied up for a few hours how, but I have been trying various tweaks without any success but as one last thing I decided to do a DEBUG=1 build to see if the backtrace is much different and in the debug build the connect command is not crashing.

I've got most of the build disabled so that the DEBUG build would fit. perhaps the current conflict is coming from one of the modules I've disabled. Unless you come up with another breakthrough, this evening maybe I'll try adding back in a module ...

edgy flax
#

windows. Pre-commit run in a command line or git-bash? Pip says it's installed but it's not running from a command line......'pre-commit' is not recognized as an internal or external command,
operable program or batch file.

devout jolt
#

Hi! I just did a fresh checkout of the circuitpython repo, set everything up and did my standard QTPyM0 build to test and got this:

% cd ports/atmel-samd && make BOARD=qtpy_m0
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
during GIMPLE pass: evrp
../../py/gc.c: In function 'gc_mark_subtree':
../../py/gc.c:1178:1: internal compiler error: Illegal instruction: 4
 1178 | }
      | ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.linaro.org/> for instructions.
make: *** [../../py/mkrules.mk:62: build-qtpy_m0/py/gc.o] Error 1

Am I forgetting something?

manic glacierBOT
#

I figured it out! It's a multicore issue. With the auto-wifi stuff I added a call to supervisor_workflow_request_background() in event_handler in common-hal/wifi/__init__.c. This handler runs on the PRO CPU and CP is on the APP CPU. So, we need to do the schedule on the APP CPU. (We could do proper locking but that's more work.) Fix coming shortly. Thanks for helping investigate this!

slender iron
#

@devout jolt did you try a clean?

#

what compiler version do you have?

devout jolt
#

looking on how to backrev in homebrew

slender iron
#

I think the CI is on GCC 10 still

#

I'm on 12 though and I think its ok

#

are you on an arm mac?

slender iron
#

I use the package from Arch Linux

devout jolt
#

yes Arm Mac but never had a problem before on this box

slender iron
#

I think gcc 11 is broken iirc

#

@idle owl would know

idle owl
#

Checking

devout jolt
#

yeah weird, arm-none-eabi-gcc 9.2.1 works

#

(that's the one packaged with Adafruit Arduino)

#

Thanks ARM for vending out a bad compiler. I don't even see a way of getting at alternate versions from their site

idle owl
#

I think I'm running 10 something.

#

But I'm struggling to figure out which specifically.

slender iron
#

they relatively recently switched where to download it from

idle owl
#

I'm using a brew cask.

devout jolt
#

me too

slender iron
#

you should be able to do arm-none-eabi-gcc --version

idle owl
#

I did that. Oh I typoed it. 🙄

slender iron
#

(I may have typoed it too)

idle owl
#

@devout jolt arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.2.1 20201103 (release)

devout jolt
manic glacierBOT
idle owl
#

gcc-arm-embedded. Maybe I pinned it somehow? Or have managed to avoid Homebrew updating it?

devout jolt
#

interesting. okay thanks. problem solved for now, in that it's not my problem nor CirPy's problem. 🙂 For now I'll just lamprey on my Arduino install for its Arm compiler

manic glacierBOT
idle owl
#

Sounds good 🙂

edgy flax
#

updated the path and at least pylint and black run...

idle owl
#

@lone axle Remembered one of the things I wanted to ask. Does the .env.sh file need to be in the same directory as the .py file?

lone axle
idle owl
#

Right

#

Ok, thanks

lone axle
#

so if it were in a different directory you'd have to cd after activating to wherever the script is

idle owl
#

Ohhhh

idle owl
#

That makes sense. So it's a convenience thing.

lone axle
#

yep

idle owl
#

Got it. Thank you!

manic glacierBOT
idle owl
#

@lone axle Dumb question, mostly verifying something I'm second guessing now... Numbers beginning with 0x are hex right?

idle owl
#

Thanks!

#

With f-strings.... I know they take variables, but can you also add text inside the "" around the variables, and have it print the text with the parsed variables as well?

#

There are only variables in this f-string, so I'm not sure.

#

@lone axle For this comment: ```py

if program is running from CLI

if name == 'main':```
Where else would the code be running from?

jaunty juniper
#

an import

#

it's way to run code when you call python the_script.py but not when you import it

idle owl
#

Ohhhhhh.

#

Interesting. So this code will do nothing if you run it other than CLI.

jaunty juniper
#

typically you write a library and have that code be run to test it by calling the main functions with the default parameters

idle owl
#

Hmm

jaunty juniper
#

but it does not interfere with using the library from another file

idle owl
#

Fair enough

jaunty juniper
#

or the other way round, you write a command line tool where everything is in functions, and the __name__ clause starts the whole thing, while reserving the possibility to call each part independently from another script, for unit tests for example

proven garnet
#

If I understand your question correctly:

my_name = "Tekktrik"
sentence = f"Hello! My name is {my_name}!"

print(sentence)
# Prints:
# Hello! My name is Tekktrik!
#

@idle owl this

devout jolt
idle owl
#

I guess, further, what difference does it make? Why do you want to prevent it from happening?

devout jolt
jaunty juniper
#

mostly making a library that can be quickly run as a command line tool, or for testing purposes

idle owl
#

So...... is it not needed here?

jaunty juniper
#

where is here ?

idle owl
jaunty juniper
#

in Circuitpython the code would only be run if the file is renamed code.py

idle owl
#

This is desktop Python

#

It runs directly from my computer.

#

I'm concerned about trying to explain it in the guide. Because I'm struggling to understand that line.

#

Foamyguy is going to give this page a look after I add what I can, so in theory he can fix my terrible explanation of it, but still.

devout jolt
#

Yes, I think it's not needed. But may be considered "good Python"? I dunno 🙂 but if you wrapped up all your code into a class and the only part of the file that actually got run was something like status_watcher = StatusWatcher(); status_watcher.run(). Then you could put that line being the if-main clause

idle owl
#

Hmm alright

slender iron
#

generally a library only defines classes and functions instead of "running code"

#

the __name__ == "__main__" bit allows you to store some code to run in what would normally be a library

devout jolt
#

agreed. but I've seen a lot of Perl/Python/Java code that embeds the __main__ stuff to let you play without needing to create a second file

idle owl
#

I was heading in the right direction for a bit there, but I'm getting lost again now.

devout jolt
idle owl
#

So in this case, this code, as-is, would not work with import but only python ...

devout jolt
#

the code you linked? Yes, it's just a program, not a library-that-can-also-be-a-program. (surely there's a name for that)

idle owl
#

Wait, so that means I should leave it in there? Because it's not the second thing?

#

Or do I not care in this case?

#

That's what I'm trying to understand at this point, I think.

devout jolt
#

in this case you do not care, because (I think) no one is going to be doing import github_actions_status_watcher

idle owl
#

Ok, yeah, that's what I figured too.

tulip sleet
#

@slender iron is there a .env flag that says "don't connect on startup", so that we can use .env instead of secrets.py, but not have wifi start up immediately? I wonder if maybe that should be the default...

slender iron
#

not currently

#

I'm open to other flags though

tulip sleet
#

I'm just thinking that for many circumstances web workflow is not needed, but .env is very convenient

slender iron
#

totally

#

I'm assuming we'll iterate on it all 🙂

manic glacierBOT
proven garnet
#

@idle owl the scripts I wrote for adabot to check the CI status (before I decided to make them purely command line operable) were designed to be imported into other scripts (so parts of it could be used to build more complex tools) as well as standalone (you could just run the run the python file via python ci_status.py and it would check the CI actions. But I would want to be doing a check on all the libraries for the first case, so I hid the actual "doing" when being run via python ci_status.py behind if __name__ == "__main__": so it ONLY is run when it's NOT being imported. That way imports grab the functions, classes, etc. and move on, whereas the other way also grabs them and then runs that code where it actually does a check.

idle owl
#

Hmm.

idle owl
#

It's alright. I know what I need to know for this guide. Which is good enough for today. 🙂

#

Food time! BBIAB.

manic glacierBOT
#

As long as we don't care about adding an unnecessary ~6s to the 'test job' whether it's needed or not ...

I think that what @hathach is trying to say is, while the message looks troubling due to its unfamiliarity it doesn't indicate a problem; and once the PR has been run on main once and the cache is populated, the message shouldn't occur anymore anyway. Until we cleared the cache or selected a different gcc version that would use a different cache key.

manic glacierBOT
#

I'm not thinking the message indicates an error, but it's an inefficiency. The first 60 or so jobs are not benefiting from the cache, it would appear.

This is a specialized action, which downloads specific files from specific places. Is there a more generalized action or mechanism we could use to download particular files (in the test job or some other precursor job), that would allow us to clear the cache or change the key if necesary? I haven't yet tried to understand what the espressif ...

manic glacierBOT
idle owl
#

@lone axle I won't be able to finish this walkthrough in time for tonight. I verified that you looking at it tomorrow evening worked for Limor, she said it's fine. So I'll get it finished up tomorrow and you can take a look at it then.

lone axle
#

Sounds good

manic glacierBOT
#

@ladyada said I should open a ticket here. I'd like to work on TLS support for Ethernet (e.g. Wiznet 5500). I have a great deal of general software development experience, but not a ton of Python, and very little knowledge of the micropython/CircuitPython networking stack internals.

If I could get some guidance from someone with more knowledge of the network stack, I could make significant progress.

Ideally, we should be able to make things like TSL/SSL support common to both WiFi and E...

manic glacierBOT
manic glacierBOT
#

That said, googling about the message led me to concerning problems that DO show this message and where the suggested remedy is to change the cache key: actions/cache#485 (comment) -- problem being, while we can and have done that with esp-idf in the past, there's no provision that I saw to make this action use a different key. hm.

I would approve this but still a bit worried about getting stuck due to this.

#

CircuitPython version

Adafruit CircuitPython 8.0.0-alpha.0-27-g5c46f2a5a-dirty on 2022-06-12; Adafruit Feather RP2040 with rp2040

Code/REPL

import board
import displayio
displayio.release_displays()
tft_cs = board.D9
tft_dc = board.D10
display_bus = displayio.FourWire(board.SPI(), command=tft_dc, chip_select=tft_cs)
display = displayio.Display(display_bus,"",width=320,height=240)
print(dir(display))

Behavior

Traceback (most rece...
manic glacierBOT
thorny jay
#

Pico W

warm stump
#

none of the deep sleep functions I've ever used actually work, always had to wait for event manually and only transmit when the timer runs out.
for when it does, you need alarma. 🦙 or sleepio, either one
Macropad: 0.095A with cyan lights on, 0.040A with no lights on, 0.040A in a crashed VM state under deep sleep (in safe mode)

lone sandalBOT
slender iron
#

@warm stump the best deep sleep support is on esp

#

Rp2040 isn’t really designed for low power

manic glacierBOT
onyx hinge
warm stump
manic glacierBOT
#

This is great!

I tried giving an incorrect password again. When connected to the REPL, I see a long delay before the REPL produces output, and even after producing output, I cannot type at the REPL for 10-15 seconds after "Press any key" shows up.

If I have two boards web-capable boards, at least on Linux, and unplug one, and plug in the other, the avahi caching will resolve circuitpython.local to the old board's IP address for some time (minutes, it appears). I don't know how well it...

slender iron
#

I wouldn't expect a matrix to continue during deep sleep

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.3.1 on 2022-06-22; Teensy 4.1 with IMXRT1062DVJ6A
Board ID:teensy41

Code/REPL

import time
import board
import busio
import adafruit_midi

from adafruit_midi.control_change import ControlChange
from adafruit_midi.note_off import NoteOff
from adafruit_midi.note_on import NoteOn
from adafruit_midi.pitch_bend import PitchBend

uart = busio.UART(board.TX2, board.RX2, baudrate=31250, timeout=0.001)  # init...
slender iron
#

thanks @tender marsh! ☝️

tender marsh
manic glacierBOT
slender iron
#

@tulip sleet I'm mixed about that. user code could have a different variable for SSID and password

#

everything with the CIRCUITPY_ prefix should be for internal use

tulip sleet
#

CIRCUITPY_WEB_API_SSID vs plain SSID ?

slender iron
#

whatever they want to call it

#

we should only use CIRCUITPY_ for internal stuff though

#

it'd be interesting to sort all of the library repos by stars

#

and to track the sum

edgy flax
lone axle
manic glacierBOT
lone axle
#

If you find a usage of the function and it passes in something like board.D2 or similar those are microcontroller.Pin type objects I believe.

manic glacierBOT
#

I think the PIO StateMachine code is letting me get away with WAIT-ing on a pin I haven't declared I'm using. It's been very handy, but still wrong.
https://github.com/adafruit/circuitpython/blob/c3a149c14a1fe2e98280b42273d3d0717501deab/ports/raspberrypi/common-hal/rp2pio/StateMachine.c#L439
I think that should be a >= because wait_index is 0 based but in_pin_count is a count so 0 isn't a valid input. I'm able to wait 1 pin 1 when in_pin_count=1, effectively reading the pin after the o...

idle owl
#

@lone axle Ok, so here's the situation. I made some changes to the code, and I need to get it into the Learn repo so I can get it embedded in the guide. This is obviously happening before you have a chance to look at my changes and the walkthrough. So! Here's my thought. I'll submit it as-is, the walkthrough applies to my version of the code. Then, if you want to make code changes, you'll put in a PR to the Learn repo, and update the walkthrough page to match when you get to it this evening. And if Anne doesn't beat me to it, I'll get it merged tomorrow so the guide is matchy. Does that work?

lone axle
#

okay, yep. Sounds good

idle owl
#

Thank you!

manic glacierBOT
#

Adding SSL support would be great! You are using the Python Wiznet driver now right?

The MicroPython and CircuitPython network approaches are a bit different now. The CP APIs were designed to support Python-only drivers but MP took a more CPython approach where the OS manages it.

One place to start is the ssl module from Python. It is used to wrap sockets. We have a subset of the API here: https://github.com/adafruit/circuitpython/tree/main/shared-bindings/ssl I think we can continue ...

idle owl
#

Oof. @lone axle The URL line is getting flagged too long by Pylint. Should I split the string, make it less readable, or disable Pylint for that line? Not sure either of those options is great.

lone axle
#

Personally I would lean toward a pylint ignore for the length of it. That way the URL can be copy/pasted from the browser which is very helpful for verifying the raw data that the script is seeing.

idle owl
#

OK, you're entirely right there.

#

I'll do a disable.

lone axle
#

If it does get split up it could be like github_username as one var, repo_name as one var, and workflow_name as one var. Then concatenate them all to make the full URL. Which would still be clear code I think, but less convenient to copy/paste.

idle owl
#

Using with ti open a file in Python, this documentation seems to indicate it closes automatically? Does that mean I don't need to call f.close()?

idle owl
lone axle
#

That is correct as far as I understand. When you use with to open the file. It'll get automatically closed whenever the block inside the with ends.

idle owl
#

Ok.

#

Thanks!

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I tried giving an incorrect password again. When connected to the REPL, I see a long delay before the REPL produces output, and even after producing output, I cannot type at the REPL for 10-15 seconds after "Press any key" shows up.

This should be the same as before. I didn't change anything with the auto-connect.

If I have two boards web-capable boards, at least on Linux, and unplug one, and plug in the other, the avahi caching will resolve circuitpython.local to the old board's ...

#

I'm thinking about a CIRCUITPY_WEB_API_ENABLE in .env. By default it would be off, so that you have set it to enable the web workflow to have it be on. This allows .env to store SSID and password as an eventual replacement for secrets.py. I can open this up as a separate issue later.

I'm open to doing this though I'd prefer it default on when using the auto-wifi. Folks can use other env variables if they want to control it themselves (maybe HOME_WIFI and HOME_WIFI_PASSWORD or...

manic glacierBOT
manic glacierBOT
#

I was also confused by no function decls in ports/espressif/common-hal/wifi/Radio.h. I think the rationale is that shared-bindings contains the C API headers and the individual ports' headers contain only platform-specific stuff. So, the Radio.h in shared-bindings is the header for every implementation of wifi.radio.

And apologies for stepping on your work on this! And thanks for the extra set of eyes. I'm always nervous about touching this repo publicly. :)

warm stump
#

ESP32-S original with the factory firmware update tool, reliable serial from the 16u2 on an Uno (would probably also work with a Metro or Mini) without having to remove the AVR
this is where SoftwareSerial will fail and the discontinued PL2303 products also have failed. Tried uploading the ESP32-S2 CircuitPython to it, it froze while reading the stub for a while
probably knowing it's an incompatible board, but it looks like there is still some life in it. Would require the USB on e.g. SAMD21 or 51 to bring it up to par with the latest boards
the one in the image is DM, the one I have is Espressif

manic glacierBOT
fluid needle
#

is there a circuitpython uf2 for the Pico W?

stuck elbow
#

no

fluid needle
#

ahh would have been too good ^^ I guess we'll have to wait a bit

stuck elbow
#

possibly quite a while, especially if you want the wifi support too

fluid needle
#

oh yeh, would love to do some HID stuff over wifi with adafruit_hid lib

stuck elbow
#

hid over wifi? how does that work?

#

or did you mean bluetooth?

fluid needle
#

ah no i mean HID via USB but control it via wifi

slender iron
#

the ESP32-S2 or S3 can do that already

slender iron
proven garnet
#

@idle owl I wrote the script for parsing all the requirements for the Bundle libraries and ran it. I've got a list of requirements for each library ready to go for the next step of creating pyproject.toml files! Also resolved any disagreements between setup.py and requirements.txt while doing so.

#

It's worth talking about whether we want to use optional dependencies for some libraries with extra functionality not immediately enabled, like using pillow for specific image related functionality, or for when example files use something but the actually library does not (one example I saw of this was pyserial for an example). There's merit to splitting things up into what's needed at the minimum, but I also see hiccups when people are confused why things like examples won't run.

#

In that case it may just be worth defining everything as a regular dependency

deft jay
#

Question: Are all CircuitPython boards supposed to show up as USB Flash Drives? I'm reading up on the ESP32-C3 board, excited about RISCV, very cool. Not sure what it means that it doesn't show up as a disk drive though. I thought all Circuitpython ports/boards were supposed to show up as drives as a term of their inclusion into the project. How did ESP32-C3 be made an exception for this rule? I don't have one on hand to play with, so I haven't confirmed that it doesn't show up as a disk drive. Just curious about the project development decisions. Not so much a technical question as much as a project question.

slender iron
warm stump
# slender iron I think the chip on this is an ESP32 (no S)

it seems to revert to 2016 so that seems about right. boards like this with USB to UART adapters might not show up as USB Drives, it ideally needs a dedicated USB device peripheral like the RP2040 has. would be ideal for a pico with no Infineon WiFi on-board

slender iron
#

Right. Dan is working on ESP32 support now actually. Since we're adding the web workflow

deft jay
#

very very cool!

slender iron
#

yuuuup. I'm excited about it

deft jay
#

I'll have to read up more on the web workflows. Is that a way to update scripts without touching the boards? That could be very useful.

slender iron
#

yup! it is a REST API

#

you can just do a PUT to circuitpython.local/fs/code.py to update

deft jay
#

Link for the lazy on where to read up on that? Also is pico W support anticipated soon?

slender iron
#

soon no. eventually yes

#

gotta get it all going on ESP first

#

(and I'm out for 12 more weeks of paternity leave in 6 weeks or so)

deft jay
#

jealous. I just had my first. I went back after a week. Zero paternity leave at my company. I have no vacation left. Enjoy it and congrats!

slender iron
#

oh no! thats a bummer. how old are they now? mine is just over 3 months

#

(the last 6 of mine are unpaid)

fluid needle
#

gz to the Human Pico 😄

deft jay
#

She's 10 weeks old. I've worked for 8 of them 😦

#

So, I'm curious, is esp32-c3 web workflow functional right now?

jaunty juniper
#

I don't think I got it to work on a QT PY C3 with a previous commit, but with the REPL issues on the QT PY it's already hard to even create the .env file...

onyx hinge
#

does wifi workflow do repl over wifi yet (once configured)? or is repl still over serial?

manic glacierBOT
jaunty juniper
#

should we have a quick 7.3.2 for the matrixportal traceback module ?

tulip sleet
tulip sleet
jaunty juniper
#

except board.LED is not valid on the pico W

#

(the LED goes through the wifi module)

tulip sleet
onyx hinge
#

nice!

tulip sleet
#

@slender iron would an ESP32SPI-style CircuitPython library be possible with the Pico W?

tidal kiln
#

@tulip sleet do you know if there are any HTTPServer guides in work? (for the CP lib)

tulip sleet
tidal kiln
#

oh. it worked for me 🙂

#

was curious about it, so tried this last nite

import wifi
import socketpool
from adafruit_httpserver import HTTPServer, HTTPResponse

print("Starting access point.")
wifi.radio.start_ap("QTPY_ESP32S2")

print(f"Listening on http://{wifi.radio.ipv4_address_ap}:80")

pool = socketpool.SocketPool(wifi.radio)
server = HTTPServer(pool)

@server.route("/")
def base(request):
    print("GET base")
    return HTTPResponse(filename="/index.html")

@server.route("/button1")
def button1(request):
    print("Button 1")
    return HTTPResponse()

@server.route("/button2")
def button2(request):
    print("Button 2")
    return HTTPResponse()

@server.route("/button3")
def button3(request):
    print("Button 3")
    return HTTPResponse()

@server.route("/button4")
def button4(request):
    print("Button 4")
    return HTTPResponse()

server.serve_forever(str(wifi.radio.ipv4_address_ap))
#

serve up some basic buttons and can connect and control via a smartphone

tulip sleet
#

see the issues for some quirks. It definitely works! I was just thinking there could be more features to add, possibly with API changes. If you are interested in doing a tutorial or project guide, I won't object 🙂

tidal kiln
#

it can wait. was just something i was toying with.

#

but seems like it could make for cool guide at some point.

#

very generic framework that could be used for anything

#
<html>
<head>
<script type="text/javascript">
function postIt(route) {
  var xmlreq = new XMLHttpRequest();
  xmlreq.open("GET", "http://" + location.host + "/" + route)
  xmlreq.send();
}
</script>
</head>
<body>
<center>
<button onclick=postIt("button1")>BUTTON1</button><br/>
<button onclick=postIt("button2")>BUTTON2</button><br/>
<button onclick=postIt("button3")>BUTTON3</button><br/>
<button onclick=postIt("button4")>BUTTON4</button><br/>
</center>
</body>
</html>
#

there's the basic html that went with it

warm stump
tulip sleet
#

i like the AJAX thing you are doing

#

the routing could be better, no explicit arg passing right now

tidal kiln
#

still amazing how simple it was to get it working

#

could control LEDs, motors, whatever

wraith crow
#

I've built the latest bits for an UM FeatherS2 and have been trying to connect via the web workflow, so far I'm just getting timeout errors. I am able to ping the IP address. I've got the .env file with CIRCUITPY_WIFI_SSID, CIRCUITPY_WIFI_PASSWORD AND CIRCUITPY_WEB_API_PASSWORD installed and the board does get an IP address on it's own when it powers up. At one point during testing I did get the API password prompt when attempting to reach the /fs/ page but after entering the password it never continued and I haven't been able to get that far again.

Any chance I'm missing something basic? Is there a way I can get any debugging info out of the workflow?

tidal kiln
#

@tulip sleet can come back to it later when ur happy with the library. was just a quick fun demo thing for now 🙂

deft jay
#

the guide seems to be written for esp32-S

slender iron
slender iron
tulip sleet
#

the protocol is NDA?! oy

slender iron
slender iron
wraith crow
slender iron
#

usb serial shouldn't interfere

tulip sleet
#

i have reworked the REPL connection to be a "console" UART, rather than "debug" only

#

as part of the ESP32 port

wraith crow
#

I did have a code.py, but just to be sure I moved it out of the way. Do I need a code.py to start something? I'll be embarrassed if I missed that, was very excited to try it out and didn't do as much reading as I should have 🙂

warm stump
wraith crow
#

I'm thinking I didn't pay enough attention to this line:

The web server will allow requests from cpy-XXXXXX.local, 127.0.0.1, the device's IP and code.circuitpython.org. (circuitpython.local requests will be redirected to cpy-XXXXXX.local.)

Does that mean I need to give a cpy-XXXXXX.local alias to the machine I'm trying to reach the microcontroller from?

tulip sleet
#

cpy-XXXXXX.local is the board itself. you can make requests from any host computer. Maybe that should be rephrased

#

^ @slender iron

slender iron
slender iron
wraith crow
#

Ok, I've updated my host file and tried the example curl connect:

C:\Users\Desktop\curl-7.84.0_3-win64-mingw\bin>curl -v -X OPTIONS -L --location-trusted http://circuitpython.local/

  • Trying 10.0.0.187:80...
  • Connected to circuitpython.local (10.0.0.187) port 80 (#0)

OPTIONS / HTTP/1.1
Host: circuitpython.local
User-Agent: curl/7.84.0
Accept: /

And then it just sits.....

I've got to run some errands but when I get back I'll try building on an S3 and then try a debug build.

slender iron
#

is the IP correct?

#

OPTIONS should be /fs/

#

or GET /

#

I may not handle OPTIONS /

wraith crow
#

Yea, I can ping the 10.0.0.187 and that's what shows on the console title bar

slender iron
#

try curl -v http://circuitpython.local/

wraith crow
#

C:\Users\Desktop\curl-7.84.0_3-win64-mingw\bin>curl -v http://circuitpython.local/

  • Trying 10.0.0.187:80...
  • Connected to circuitpython.local (10.0.0.187) port 80 (#0)

GET / HTTP/1.1
Host: circuitpython.local
User-Agent: curl/7.84.0
Accept: /

slender iron
#

hrm

wraith crow
#

Are you using the second core for the web workflow?

slender iron
#

no, it should be the same core as the rest of circuitpython

#

try resetting the board and doing the GET / again

wraith crow
#

@slender iron same result

slender iron
#

hrm, ya. A debug build and its output would be helpful to see

#

does the serial connection respond still?

wraith crow
#

Okay, I'll pick it up later this afternoon

#

Yes, the serial USB connection stays functional throughout

slender iron
#

so its not too fatal of an issue 🙂

manic glacierBOT
#

I was also confused by no function decls in ports/espressif/common-hal/wifi/Radio.h. I think the rationale is that shared-bindings contains the C API headers and the individual ports' headers contain only platform-specific stuff. So, the Radio.h in shared-bindings is the header for every implementation of wifi.radio.

This is exactly right. Another way to think about it is that the shared-bindings header declares all of the functions used by the shared-bindings implementation.

#

@dhalbert @tannewt I still have problems doing any coding on an RP2040 that plays audio because of this issue. Iteration is difficult because any time I want to save code.py to have it restart and test changes I need to carefully time pressing reset button on board, getting into REPL and hitting ctrl-c first before code starts running, then save my code and hit ctrl-d.

manic glacierBOT
obsidian jasper
#

Hi, all!
Especially, Scott)
I want to ask - do you have source files with working implementation of usb host(imxrt) with new tinyusb lib? I'm asking because I saw that you have done with working usb keyboard...

fluid needle
#

Neradoc aren't you the guy who supplies us with CP hid keyboard layouts? kinglove

jaunty juniper
# slender iron Possible yes. Its hard to write any library for it since details are behind an N...

oh yeah I flinched when I read that in the release news post:

For C developers, today’s release of the Pico SDK includes wireless networking support. The network stack is built around lwIP, and uses libcyw43 from Damien George (of MicroPython fame) to communicate with the wireless chip. By default, libcyw43 is licensed for non-commercial use, but Pico W users, and anyone else who builds their product around RP2040 and CYW43439, benefit from a free commercial-use license.

#

is that a library we can include in CP on the board ?

slender iron
#

ya, we can include it and use it for RP2040 builds

slender iron
#

I know damien put a lot of work into it. so its his call

fluid needle
proven garnet
jaunty juniper
#

@slender iron I'm looking at adding setting up the default BLE name of a board using dotenv, what do you think ?

daring pumice
#

Question about building CP for a custom board: My design is heavily based on the Feather Sense, but has some notable changes to GPIO assignments (namely the primary LED and Reset pins).

So far I've tried to make changes to the makefile and pins.c in /ports/nrf/feather_bluefruit_sense - is that the right place?

jaunty juniper
#

yep, you have to look at mpconfigboard.h for the pins of the default busses (board.I2C, etc.) and other setup like the NEOPIXEL and LED pins

daring pumice
#

Cheers!

To make sure I'm changing things correctly, if I want to change the primary LED (for example) to GPIO P1.15, I would need to change these lines:

    { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P1_09) },
    { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P1_09) },
    { MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_P1_09) },

to

    { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P1_15) },
    { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P1_15) },
    { MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_P1_15) },

Correct?

jaunty juniper
#

yep, you can ditch the L name, it's just for backwards compatibility on that board, and RED_LED too if you only have one (and it's not red)

#

you want to make the same change to MICROPY_HW_LED_STATUS in mpconfigboard.h too

daring pumice
#

I also need to define the reset pin

daring pumice
#

I'm not seeing that in either mpconfigboard.h or pins.c

#

Maybe I'm looking for the wrong name?

jaunty juniper
#

the reset pin is usually hardware, it's not a thing you define in software, is it ?

daring pumice
#

I need to soft reset (I think) so I can signal a "double click" of the reset pin.

#

Not sure if I'm being clear...

#

sry

tulip sleet
#

just to be clear, the reset button is the real hw reset line. THere's no soft reset pin

daring pumice
#

Awesome.

#

I won't worry about that 🙂

#

Gonna build this and report back 😉

#

Thanks so much @jaunty juniper and @tulip sleet

daring pumice
#

Ok. I've set the pins inside the appropriate header files, but I'm not seeing the primary LED light.

Could I be missing something?

slender iron
#

it is MICROPY_HW_LED_STATUS in mpconfigboard

daring pumice
#

That's pointing at the same pin

#

P1.15

#

#define MICROPY_HW_LED_STATUS (&pin_P1_15)

wraith crow
#

Web workflow testing

manic glacierBOT
manic glacierBOT
lone axle
#

how does the welcome_html variable used here: https://github.com/adafruit/circuitpython/blob/8814ee03f1c716e7b7ee812799c83893b9e5d436/supervisor/shared/web_workflow/web_workflow.c#L990 come to exist so that it can be passed to _REPLY_STATIC() ? I found this section earlier in the code that seems related: https://github.com/adafruit/circuitpython/blob/8814ee03f1c716e7b7ee812799c83893b9e5d436/supervisor/shared/web_workflow/web_workflow.c#L827

I tried creating a new one of those though edit_html and I'm unable to get a build to complete, having errors about undefined reference to 'edit_html'

I haven't been able to find any other set up that is occuring for welcome_html and the other static files. But I feel like I must be missing some from somewhere.

slender iron
lone axle
#

I did create a line similar to those:

STATIC_FILE(directory_html);
STATIC_FILE(directory_js);
STATIC_FILE(welcome_html);
STATIC_FILE(edit_html); // <- added this one
STATIC_FILE(welcome_js);
STATIC_FILE(blinka_16x16_ico);
jaunty juniper
#

what is the size limit of the BLE device name ? I believe the total limit is 31 bytes for the scan response, but it contains additional stuff in it, and according to some googling the practical limit would be around 21 or something ? Or is it automatically cut anyway by the underlying BLE stack so I don't need to bother too much ?

orchid basinBOT
manic glacierBOT
slender iron
orchid basinBOT
tiny token
#

I was trying to look at others or even roll my own, but haven't gotten very far.

tulip sleet
tiny token
#

Any idea why there is the HTTPServer and also the WSGI server? seem to be trying to implement similar things.

tulip sleet
#

I think someone mentioned ampule too. Not sure if that is in the issues.

jaunty juniper
#

ampule looks quite nice

tiny token
#

I was looking at ampule last night. Seems very similar to HTTPServer provides some better routing with args

tulip sleet
#

The WSGI server didn’t serve files natively. That was my primary goal for HTPPServer

jaunty juniper
#

I'd like to look at the differences with the wsgi library and merge them into the HTTPServer library, if there's anything worth it but I'm not gonna be able to make time for that

tulip sleet
#

HTTPServer is very new and has no legacy of use. I’m happy to completely change it or replace it with something else

#

and then archive it

#

I am not familiar with the libraries in this space, so if we can base a new library on something more known, that's fine

tiny token
#

do you know if the WSGI standard provides for native files? it'd be nice to create something that is standards based if possible

jaunty juniper
#

it needs a polling version that allows running other things in the loop, or from asyncio

tiny token
tiny token
tulip sleet
#

I think the assumption might be that wsgi is fronted by nginx or some other server that serves the static files and passes on dynamic requests to wsgi

#

that is the impression I get from websearching on the topic

jaunty juniper
tulip sleet
#

I have a partial draft of a version of adafruit_requests with some async API, but I haven't had time to work on it further recently

#

your contributions to this would be most welcome

tiny token
#

splitting out parts of the current code in serve_forever would provide for a start and a poll function.

tulip sleet
#

earlier today @tidal kiln (who works for Adafruit) was talking about doing AJAX calls with the current HTTPServer; maybe you saw that already: about 7.5 hours ago

#

I said pretty much the same thing then -- no problem changing the current API

jaunty juniper
slender iron
#

have a great long weekend everyone!

#

(non-US folks can take monday off because you all are awesome)

#

😛

tiny token
#

integrity should still be there for the existing method so it doesn't break any existing code using it.

#

eventually it'd be nice to merge the WSGI code and this code into a more robust web server, but that's something for another day. Cheers!

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-alpha.1 on 2022-06-09; Adafruit Feather RP2040 with rp2040
and Adafruit AirLift FeatherWing - ESP32 WiFi Co-Processor

Code/REPL

import socketpool
import mdns

Behavior

Module missing

Description

No response

Additional information

Dear package mainters

It would be very usefull to also include these modules for the board Adafruit Feather RP2040 because when you add a WiFi these mo...

tiny token
#

My pull request keeps failing CI with this "reformatted" error, but I don't understand what it's telling me. Any words of wisdom?

blissful pollen
tiny token
blissful pollen
#

That should fix it

tiny token
#

that'll fix it just by running it, or it'll point me to the issue?

blissful pollen
#

once you run the pre-commit hooks (you probably have to run it manually since you already committed) black should reformat your files and you can commit them

tiny token
#

I see the change, it reformatted a line.,

#

thanks for the assist!

blissful pollen
#

No problem, it still catches me sometimes

tiny token
#

There it is the lovely ✅

jaunty juniper
#

I'm getting "thing is deprecated" errors from uncrustify when I build CP

#

ok fixed it

rough folio
#

I think this is more suited for here- but blinka installed in a venv and then run through a jupyter kernel fails to start because board can't identify the platform

#

(on windows)

jaunty juniper
#

what platform should it identify ?

rough folio
#

I have no idea but it precludes the notebook from starting entirely which is pretty undesirable

#

because ipython will try to load modules

jaunty juniper
#

it tries to load modules that are not in use ?

rough folio
#

same dir

#

I think anyway

#

let me take another look at this error

#

yeah it seems to try and load modules in the same directory

#

I can put it in a subfolder I suppose

#

see if that does anything

#

yep it does I guess that isn't really an issue

#

I was kind of under the impression it was trying to index the venv or something and not just the modules in the same folder

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-alpha.1-27-g187f156ac-dirty on 2022-07-01; ESP32-S3-DevKitC-1-N8R2 with ESP32S3

Code/REPL

No user code is run on the microcontroller before the behavior occurs.

Behavior

After initiating a GET via curl (and leaving it apparently waiting for a response) I then accessed the CIRCUITPY drive and renamed a file. When the new filename was saved, CURL picked up the following:

 C:\Users\Desktop\cu...
manic glacierBOT
ornate breach
#

Is the P19A variant of the SAMD51 supported in circuitpython?

#

I imagine so since it’s in the uf2-samdx1 library

stuck elbow
#

aloriumtech_evo_m51 and seeeduino_wio_terminal

ornate breach
#

Oh perfect

manic glacierBOT
#

See #2206 and #1764 for why this is hard.

A newer comment in #2206 says:

This is not an issue with endpoint count. USB MSC can have multiple drives over the same endpoints by using a logical unit (LUN) index.

Is implementing this the hard part? If so, could you please add the option to show the SD card instead of the usual CIRCUITPY filesystem?

For example, boot.py could mount the SD card a...

manic glacierBOT
manic glacierBOT
#

Hi all, and thanks for the tag @hathach!

The action will first try to get GCC from the cache, and if that fails (which would be expected the first time it runs), it will download it from the Arm servers, set it up, and only then try to save it to the cache.
The avaiable cache size is limited, so rather than have a cache entry for each individual job, there is a cache entry per each version/platform of GCC used.

In this case as several of the parallel jobs are attempting to save to the ...

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

34848

Roles

35

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-alpha.1-31-gc1b00442a on 2022-07-02; stm32f411ce-blackpill with STM32F411CE

Code/REPL

import board, digitalio
digitalio.DigitalInOut(board.C14)

Behavior

ValueError: C14 in use

Description

No response

Additional information

If I comment out the calls to never_reset_pin_number() [here](https://github.com/adafruit/circuitpython/blob/main/ports/stm/peripherals/stm32f4/stm32f411xe/g...

slender iron
#

<@&356864093652516868> Just a reminder that the meeting is in just over 24 hours. It is a holiday here in the us today. Talk with you tomorrow!

manic glacierBOT
#

This PR exposes up to 4 LUNs for MSC, for additional fatfs such as SDCard. Mostly based on @dhalbert https://github.com/dhalbert/circuitpython/tree/multiple-luns branch combined with following changes

  • response to SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL as unsupported request in all msc examples. This is required for macos to send TEST_UNIT_READY regularly for "SDCard reader" application. Response OK to this request for non-removal device such as ram/flash disk can be beneficial since macos w...
manic glacierBOT
jaunty juniper
#

weird error in circup's CI during pip install:
https://github.com/adafruit/circup/runs/7188851151?check_suite_focus=true

Collecting circuitpython-build-tools
  Downloading circuitpython-build-tools-1.10.1.tar.gz (11 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  error: subprocess-exited-with-error
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
proven garnet
jaunty juniper
#

ah some part of the setup tools that doesn't manage its dependencies well maybe

#

how would I fix the circup PR then ?

proven garnet
#

I submitted a PR to update it; it looks like just re-pinning that requirement should be good.

#

It doesn't look like change from an API perspective for importlib_metadata.version() (the only thing we use from it, it seems) from v0.20 to v4.12!

jaunty juniper
#

oh wow that is a jump !

#

(you changed the - with a _, pip doesn't care, but the - is usually used I think)

proven garnet
#

Oh, good catch, I'll update that - if nothing else it's my own pet peeve as well haha

#

Yeah I guess something changed for setuptools since the last time the Build CI ran - It cleared successfully last time when it used setuptools==47.1.0 but not this time when it was using setuptools==63.1.0. Also a wild jump!

jaunty juniper
#

dependabot ! you failed us !

#

oh and thanks @proven garnet 👍 😉

main furnace
#

Is async support for UART on the roadmap? I want to use the NeoKey1x4 and UART together.

stuck elbow
#

what do you need exactly?

main furnace
#

I've set up latching on the NeoKey1x4 keys. Right now I'm doing:

while True:
    latch_update() #update the state of the NeoKey1x4
    buffer = uart.read(12)

With this code you have to wait for the uart.read to return or time out before the keyboard update runs. Rather than just tapping the key to toggle it you have press and hold it.

#

Maybe I should check the uart for bytes available before I commit to reading it...

blissful pollen
proven garnet
main furnace
stuck elbow
#

it's really tacked on, both in cpython and other pythons

proven garnet
#

@idle owl let me know if today is still a good day to meet, I can do the usual noon or post-5pm, no preference!

blissful pollen
tulip sleet
thorny jay
#

Sorry no notes from me for today's meeting. Despite the extra day, I did not find the time to work on my project... and very soon a PicoW will arrive (and also an ESP32-S3 TFT Feather 4/2).

manic glacierBOT
idle owl
idle owl
#

<@&356864093652516868> CircuitPython Weekly happens in just under 2 hours! Please add your Hug Reports and Status Updates to the notes doc. Note "not in meeting" if you're not able to attend, or "text only" if you're not able to speak during the meeting. Looking forward to chatting with you soon!

proven garnet
idle owl
proven garnet
#

Sweeto!

daring pumice
#

Having an issue getting the LED to work with a custom PCB based on the Adafruit Feather (nrf52840).

When building and pushing the bootloader (https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/tag/0.6.4) to my board, I'm able to properly adjust the primary LED in the makefile. Because of a flaw in the design (which is being fixed in a future revision) I can't actually use the bootloader to access the board, but the status update from the LED is useful.

However, when I build and push a full version of CP to the board (using the Feather-Bluefruit-Sense port, adjusting the GPIOs to reflect my layout), the primary LED isn't getting used.

Anyone else encounter an issue like this, or have any guidance here?

GitHub

What's Changed

Add mikoto board by @mrninhvn in #230
nRF52833 updates to UF2/memory map for nRF52833 boards by @jpconstantineau in #251
add 833 support for v7 Softdevice (while not including n...

slender iron
#

@daring pumice can you break on circuitpython main to confirm it was loaded correctly?

slender iron
#

yes, with a debugger

daring pumice
#

I don't get a REPL, but I can halt the code using JLink Commander

#

when I read out the registers I get No Faults.

#

Unfortunately, I can't see any symbols when using GDB

slender iron
#

what is the backtrace when you halt?

daring pumice
#

Good question, I'll take a look now

jaunty juniper
#

oh weird I get a MemoryError after code.py ends, by creating a logging.FileHandler to an SD Card

daring pumice
daring pumice
slender iron
#

on main 🙂

daring pumice
#

so

#

break main?

slender iron
#

yup

daring pumice
#

Same issue as above: no symbol table :/

daring pumice
jaunty juniper
#

no no not at all

daring pumice
#

kk 👍

slender iron
#

@daring pumice use a DEBUG=1 build

daring pumice
#

Sounds good. Will rebuild and get back. Much appreciated!

jaunty juniper
#

@proven garnet adafruit_logging.getLogger() defaults to a None handler, but that is not how C python does it, it defaults to prints (another issue is streamHandler does not end lines with "\r\n", like fileHandler does) I'll look into fixing it later unless you want to ?

daring pumice
#

nm, was loading the .hex, not the .elf

#

I now have symbols

#

Ok. I'm now getting proper breakpoints.

manic glacierBOT
#

On the stm32f411ce-blackpill board, pins C14 and C15 are connected to the low-frequency crystal oscillator. However, how does CircuitPython know about that, even though https://github.com/adafruit/circuitpython/blob/main/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h#L37 says #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) (which as far as I understand means that CircuitPython will assume that there is no low-speed crystal)?

And since #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) doesn't...

daring pumice
#

@slender iron Here's the backtrace:

reset_into_safe_mode (reason=reason@entry=MICROPY_FATAL_ERROR) at ../../supervisor/shared/safe_mode.c:126
126             }
(gdb) backtrace
#0  reset_into_safe_mode (reason=reason@entry=MICROPY_FATAL_ERROR) at ../../supervisor/shared/safe_mode.c:126
#1  0x00073f80 in __fatal_error (msg=msg@entry=0x9f0f8 "Assertion failed") at ../../main.c:994
#2  0x0002a858 in __assert_func (file=file@entry=0xa1378 "nrfx/drivers/src/nrfx_qspi.c", line=line@entry=192,
    func=func@entry=0xa1430 <__FUNCTION__.5> "nrfx_qspi_cinstr_xfer", expr=expr@entry=0xa13c4 "p_config->wipwait")
    at ../../main.c:1001
#3  0x0005c820 in nrfx_qspi_cinstr_xfer (p_config=p_config@entry=0x2003fcf8, p_tx_buffer=p_tx_buffer@entry=0x0,
    p_rx_buffer=p_rx_buffer@entry=0x2003fd1c) at nrfx/drivers/src/nrfx_qspi.c:192
#4  0x00068690 in spi_flash_read_command (command=command@entry=159 'Y',
    response=response@entry=0x2003fd1c "ÿÿÿ£4y\003 \215ì\a", length=length@entry=3) at supervisor/qspi_flash.c:115
#5  0x0006aaa2 in supervisor_flash_init () at ../../supervisor/shared/external_flash/external_flash.c:224
#6  0x0007ec8c in flash_ioctl (cmd=<optimized out>, out_value=out_value@entry=0x2003fd34)
    at ../../supervisor/shared/flash.c:168
#7  0x0008d350 in supervisor_flash_obj_ioctl (self=<optimized out>, cmd_in=<optimized out>, arg_in=<optimized out>)
    at ../../supervisor/shared/flash.c:191
#8  0x000484fe in fun_builtin_3_call (self_in=0x9f214 <supervisor_flash_obj_ioctl_obj>, n_args=<optimized out>,
    n_kw=<optimized out>, args=0x20012258 <_internal_vfs+56>) at ../../py/objfun.c:109
#9  0x0004ed96 in mp_call_function_n_kw (fun_in=0x9f214 <supervisor_flash_obj_ioctl_obj>, n_args=3,
    n_kw=n_kw@entry=0, args=0x20012258 <_internal_vfs+56>) at ../../py/runtime.c:665
#
#10 0x00081234 in mp_call_method_n_kw (n_args=n_args@entry=2, n_kw=n_kw@entry=0,
    args=args@entry=0x20012254 <_internal_vfs+52>) at ../../py/runtime.c:680
#11 0x00083506 in mp_vfs_blockdev_ioctl (self=self@entry=0x20012224 <_internal_vfs+4>, cmd=<optimized out>,
    arg=arg@entry=0) at ../../extmod/vfs_blockdev.c:118
#12 0x00041ffc in disk_ioctl (pdrv=<optimized out>, cmd=cmd@entry=5 '\005', buff=buff@entry=0x2003fd8f)
    at ../../extmod/vfs_fat_diskio.c:97
#13 0x00046fb6 in find_volume (fs=fs@entry=0x20012264 <_internal_vfs+68>, mode=mode@entry=0 '\000')
    at ../../lib/oofatfs/ff.c:3142
#14 0x0007db8a in f_mount (fs=fs@entry=0x20012264 <_internal_vfs+68>) at ../../lib/oofatfs/ff.c:3395
#15 0x00046b8e in filesystem_init (create_allowed=create_allowed@entry=false, force_create=force_create@entry=false)
    at ../../supervisor/shared/filesystem.c:96
#

I've run the code 3 times and get the same issue each time

onyx hinge
#
    if (qspi_ready_wait() == NRFX_ERROR_TIMEOUT)
    {
        // This timeout should never occur when WIPWAIT is not active, since in this
        // case the QSPI peripheral should send the command immediately, without any
        // waiting for previous write to complete.
        NRFX_ASSERT(p_config->wipwait);

        return NRFX_ERROR_TIMEOUT;
    }
daring pumice
onyx hinge
#

It's also possible that this is a red herring; asserts are not checked except during a debug build. so your normal build might be getting past this

daring pumice
#

If there were no other issues, I mean?

onyx hinge
#

I don't know where in the start up procedure that would happen

daring pumice
#

Me either 🤷‍♂️

#

Does the bluefruit sense use an external flash?

modern wing
#

Good afternoon everyone -- happily lurking today.

tulip sleet
daring pumice
#

Its looking for a device that doesn't exist

#

?

#

My board doesn't have external flash

tulip sleet
#

what are you using for CIRCUITPY?

daring pumice
#

Good question

main furnace
#

:smiles: :waves:

tulip sleet
#

it's possible to use part of the internal flash for CIRCUITPY, but you may need the space for a larger one

proven garnet
#

Does it still? I thought I patched that, but maybe I didn't. Happy to review the patch when you get to it! Also good catch on StreamHandler, I didn't realize it was CRLF.

daring pumice
#

Our needs are really modest (only need i2c and BLE, really)

#

When I inspect the chip memory, CP takes up about 50% of the available space

idle owl
#

No worries!

#

Yes

modern wing
#

Loud and clear

#

[we've all had the fun experience of talking into a muted mic]

manic glacierBOT
tulip sleet
#

it's more likely he would ask you that q, and you would spec it

#

pca10059 and raytac_mdbt50q-rx builds are examples of builds that use INTERNAL_FLASH_FILESYSTEM = 1. There are others as well.

onyx hinge
#

swoons

daring pumice
tulip sleet
#

pick one of the no-external-flash builds instead

daring pumice
#

And if so, do I need to include INTERNAL_FLASH_FILESYSTEM = 1

tulip sleet
#

definitely

daring pumice
#

Just don't know enough yet

tulip sleet
#

the raytac module one is pretty simple. You could look at the boards at circuitpython.org and see which one is closest to yours

daring pumice
#

the rx is a dongle?

tulip sleet
#

yes

#

it contains the raytac module

daring pumice
#

Ok. Better fit? The db will have buttons I don't have

tulip sleet
#
boards/ADM_B_NRF52840_1/mpconfigboard.mk
boards/arduino_nano_33_ble/mpconfigboard.mk
boards/bless_dev_board_multi_sensor/mpconfigboard.mk
boards/bluemicro833/mpconfigboard.mk
boards/bluemicro840/mpconfigboard.mk
boards/electronut_labs_blip/mpconfigboard.mk
boards/electronut_labs_papyr/mpconfigboard.mk
boards/ikigaisense_vita/mpconfigboard.mk
boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk
boards/microbit_v2/mpconfigboard.mk
boards/nice_nano/mpconfigboard.mk
boards/pca10059/mpconfigboard.mk
boards/pca10100/mpconfigboard.mk
boards/raytac_mdbt50q-db-40/mpconfigboard.mk
boards/raytac_mdbt50q-rx/mpconfigboard.mk
boards/simmel/mpconfigboard.mk
boards/sparkfun_nrf52840_mini/mpconfigboard.mk
boards/ssci_isp1807_dev_board/mpconfigboard.mk
boards/ssci_isp1807_micro_board/mpconfigboard.mk
boards/teknikio_bluebird/mpconfigboard.mk
boards/warmbit_bluepixel/mpconfigboard.mk

have INTERNAL_FLASH_FILESYSTEM = 1. Some of these are nRF52833 builds, so need to take those out. Then I'd just pick the ones that are the closest. You will certainly need to change some pin defns.

#

eliminate microbit_v2, pa10100, bluemicro833, arduino_nano_33_ble off the bat

daring pumice
#

Much appreciated.

slender iron
#

I don't think there is a way to measure refresh rate

#

displayio will cap the refreshes though

#

but if a lot changes, it won't keep up

mental nexus
#

I didn’t see a built in way, but thought I might be missing something. I’ve never had much luck with changing the displayio refresh rate and observing any differences (by eye).

slender iron
#

its been a while since I've been in that code

mental nexus
#

Sounds like I may need to add a custom hook to count refreshes.

idle owl
#

@jaunty juniper 🐈‍⬛ !!

onyx hinge
#

[I can't idly type on that keypad if it's plugged in]

idle owl
onyx hinge
#

@idle owl maybe you can PR that to qmk in your free time this week.

idle owl
modern wing
#

Thanks everyone!

mental nexus
#

Thanks everyone!👋

onyx hinge
#

👋

slender iron
#

thanks!

gilded cradle
#

thanks

proven garnet
#

Thanks!

lone axle
#

👋 Thanks everyone

minor plume
#

Thanks, everyone! 👋

modern wing
#

What is the date for CP day again, @idle owl

idle owl
#

August 19, 2022!

modern wing
#

thanks 🙂

onyx hinge
#

@tulip sleet @slender iron want to re-convene at the top of the hour?

idle owl
#

You're welcome!

onyx hinge
#

I could use a moment to stretch my legs & get a beverage refill

idle owl
onyx hinge
#

oh okay nevermind then

#

I may have had divided attention during the internal meeting due to the sense of being behind

idle owl
#

I did as well, trying to get an Actions run to be in progress. 😄

slender iron
#

limor can do after 4 eastern if we want to meet today

tulip sleet
#

i am fine with >4 ET

#

i thought you were off before then, but you are available, fine by me

slender iron
#

nope, I gotta get lunch soon but then I'm around until 5 pacific

#

I just mentioned I wouldn't be watching the baby later

tulip sleet
#

ok, let's ask her in slack

slender iron
#

(becca is back from her appt)

lone axle
#

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

hidden oxide
#

👍🏼

manic glacierBOT
proven garnet
#

In some of the release CI workflows, right before building the distributions, there this:

#
for file in $(find -not -path "./.*" -not -path "./docs*" -name "*.py"); do
    sed -i -e "s/0.0.0-auto.0/${{github.event.release.tag_name}}/" $file;
done;

I think that's how __version__ is populated right? So should all workflows have this? python setup.py sdist is becoming python -m build in order to build the wheels/source distributions, but I take it we still want that step in beforehand either way, correct?

#

Trying to figure out if that needs to be patched into all libraries, or removed from ones that have it.

jaunty juniper
#

speaking of that, is there a standard way for a module to provide a version that can be autofilled when installing with pip or is it always a separate process like this ?

jaunty juniper
#

I don't think we provide module.__version__ in every library at present time, some are packages with an empty __init__.py (circup finds it in the other files, but it can't be relied on from python code)

proven garnet
#

That's why if you have changes from the tag when you install it, it shows up as dirty

#

Oh you mean from the code itself though?

jaunty juniper
#

oh yeah I used that in discotool:

setuptools.setup(
    ...
    use_scm_version={
        'write_to': 'discotool/_version.py'
    },
#

that results in something like that when not on a tag:

# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
version = '0.3.2.dev4+ga5d477a.d20220125'
version_tuple = (0, 3, 2, 'dev4+ga5d477a', 'd20220125')
manic glacierBOT
jaunty juniper
#

but that's a different question, I think the point is that modules on pypi don't use or need or care about __version__ but we could make it more consistent accross the CP libraries

tulip sleet
#

I would be in favor of that. I would like to be able to ask someone what the__version__ of a library is if they import it in the REPL, for any library.

#

as a support mechanism

jaunty juniper
#

yeah absolutely

proven garnet
#

Sounds like it should get patched then, and all libraries should have __version__ defined in them or their __init__.py right?

#

I just confirmed that currently BME680 library shows __version__ as 0.0.0-auto.0 so looks like it should be patched in then. That patch to release.yml would support what you're saying, @jaunty juniper and @tulip sleet

#

In a future library patch

#

We could just add __version__ == "0.0.0-auto.0" in the appropriate place and voila, I think

jaunty juniper
#

yeah sounds right

manic glacierBOT
#

CircuitPython version

The [Wemos docs say to use 8.5db](https://www.wemos.cc/en/latest/c3/c3_mini.html#about-wifi) to work around the WIFI connect issue.

## Workaround

If you use 8 or 9 you can still connect.

Code/REPL

>>> import wifi
>>> wifi.radio.tx_power = 8.5
Traceback (most recent call last):
  File "", line 1, in 
TypeError: can't convert float to int
>>> wifi.radio.tx_power = 8
>>> wifi.radio.connect(SSID, PASSWD)
>>> wifi.radio.ipv4_ad...
proven garnet
idle owl
orchid basinBOT
slender iron
#

@gilded cradle it looks like we'll need a new build for the lite s3

gilded cradle
#

ok

slender iron
#

actually maybe not

#

looks like backlight is inverted

#

which would explain why you can only see it when the display ram isn't inited

#

@gilded cradle have time to test now? what file extension do you need?

slender iron
#

k, I'm done at 5

gilded cradle
slender iron
#

kk

gilded cradle
#

I can test in a little bit and I'll let you know if it works

slender iron
#

👍

proven garnet
#

I think I asked this before but didn't understand the answer: What's the difference between the firmware adafruit_bus_device (written in C) and the Python library adafruit_bus_device? Is the latter only needed when the former isn't available? Because it doesn't look like the Python library references any code from the C code.

jaunty juniper
#

yes

#

the builtin one is a C port of the python one

proven garnet
#

Ohhhhhh got it

#

Thanks!

slender iron
gilded cradle
gilded cradle
slender iron
#

hrm

#

maybe that doesn't have the bootloader 🙂

gilded cradle
#

I'll try that

gilded cradle
slender iron
#

👍

#

tries to remember how to invert

#

gah, changed the wrong file

gilded cradle
#

Trying now

gilded cradle
slender iron
#

did the orientation change?

gilded cradle
#

No

#

We can continue tomorrow since it's 5

slender iron
#

I'll give you one more build...

gilded cradle
#

ok

slender iron
#

I'm just flipping MADCTL bits

gilded cradle
#

I think width and height may need swapping too

slender iron
#

the dimensions are the same... I think it'll be ok if I get rotation right

gilded cradle
#

ok

slender iron
#

and I'm out

#

night!

gilded cradle
orchid basinBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Hi,

I am opening this PR to solve #6419. This is what I am trying to do:

  1. Allow the method to still receive 3 parameters, since signed parameter support still needs to be implemented.
  2. Add support to accept the signed keyword parameter; I did not implement signed parameter support though, but added a NotImplementedError if signed=True is passed.
  3. Added a validation for the byteorder parameter. Not sure if this is was necessary. I added MP_QSTR_big here, but I am not sure...
bleak matrix
#

Hi all 👋 . I may have unwillingly discovered an incompatibility between the UF2 images built for STM32F405 boards and TinyUF2. Images produced both locally and downloaded from http://circuitpython.org won't flash! This appears to be due to the family ID contained within the UF2 images being different from TinyUF2's expectation. C.P. builds use a value of 0x6d0922fa (STM32F407) whilst TinyUF2 is expecting 0x57755A57 (STM32F4). I would be grateful for any prior knowledge / advice / suggestions as where to go from here. Cheers.

jaunty juniper
#

oh I remember noticing that tinyuf2 doesn't flash CP when looking at adding the UF2 to the builds of the STM32 feather. Unfortunately I don't know anything about that family ID business...

bleak matrix
#

Thanks @Neradoc.

jaunty juniper
#

I didn't look into it back then, just made a note to get back to it some day. I would open an issue in the CP repo to have eyes on it

bleak matrix
#

I'll take that suggestion and raise it soon. Thanks for the reply 🙂

daring pumice
#

If anyone's up, wondering if there's a list for Flashing LED Statuses.

I only have a single-coloured LED (not a multi-coloured RGB LED) and am getting a repeating pattern of 6 flashes after the initial bootup sequence.

manic glacierBOT
#

CircuitPython version

8.0.0-alpha.1

Code/REPL

N/A

Behavior

N/A

Description

I believe I have unwillingly discovered an incompatibility between the UF2 images built for STM32F405 boards and TinyUF2. Images produced both locally and downloaded from http://circuitpython.org cannot be flashed using TinyUF2.

This appears to be due to the family ID contained within the UF2 images being different from TinyUF2's expectation. Circuit Python buil...

manic glacierBOT
#

Thanks for the fix! I have made some suggestions (which are not tested!).

Added a validation for the byteorder parameter. Not sure if this is was necessary. I added MP_QSTR_big here, but I am not sure how to the qstrdefs.enum.h file.

The qstr will get added automatically; you don't need to do anything. The sources are scanned to generate the qstr's when a build is done. Make sure to do make clean if you change or add any qstr's, though.

I don't know whether you changed `circuitpy...

tiny token
#

What are the benefits of creating an .mpy file for a library, other than potentially smaller footprint? If your library project has multiple .py files can you combine them into one .mpy file to simplify its installation/use? I come from a c#/dll background so I can see benefits of a 'compiled' library but not sure if .mpy is anything close to a .dll.

stuck elbow
#

no, it's just the smaller memory use

#

and marginally faster importing

tiny token
#

can you put multiple .py files into a single .mpy or is it a one-to-one? my end goal is to simplify the library install and related import statements required to use it. I'm not a fan of all classes/code for a library placed into a single .py file.

manic glacierBOT
manic glacierBOT
#

Hi @dhalbert ,

Thank you very much for the helpful feedback!!

Yes, I am testing with the Feather RP2040. This is the only one I have, unfortunately!

  • I wend ahead and made the changes (also tested with Feather RP2040).
  • Regarding the circuitpython.pot, I did not updated manually; the pre-commit did it. This time I did run make translate.
  • I also realized about the MO Express. I built CP for that board locally and it worked; so, I would like to see how it behaves with this chan...
onyx hinge
#

@tulip sleet @slender iron @idle owl maybe either between 1PM-3PM ET today, or else tomorrow for going through the 8.0 milestone list? I am hanging out with a friend from 4-6PM ET today.

gilded cradle
slender iron
#

@gilded cradle ok. I’ll ping you when I’m at my desk. Kiddo didn’t sleep well last night so I’m getting a slow start

proven garnet
#

notes

manic glacierBOT
#
  • This second commit failed. I think it was because of this line:
{ MP_QSTR_bytes, MP_ARG_REQUIRED | MP_ARG_OBJ },
{ MP_QSTR_byteorder, MP_ARG_REQUIRED | MP_ARG_OBJ },

I think this would fix it:

{ MP_QSTR_bytes, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
{ MP_QSTR_byteorder, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },

This is only because the unix port has set -Wextra. A cheaper way would be:

     ...
idle owl
gilded cradle
slender iron
idle owl
#

Dan appears to be idle at the moment.

slender iron
#

becca has an appointment this afternoon so my availability will depend on whether the kid is asleep

idle owl
#

@onyx hinge You still around?

onyx hinge
#

Yeah

#

I can get on a call in 5

idle owl
#

@slender iron @tulip sleet @onyx hinge We could meet now-ish.

#

5 minutes-ish.

tulip sleet
#

i can do it now. I have a service person here for the heating system so I may need to step away briefly.

#

at an unknown time

slender iron
#

kk, I can jump on too

#

want to meet here on discord?

idle owl
#

Yeah I think so. Somewhere we can vid and share screens. That worked last time.

slender iron
#

kk