#circuitpython-dev

1 messages · Page 57 of 1

devout jolt
#

numbers.do_weird = False I think

idle owl
#

Also, I don't see a refresh time in the ACeP7In lib, but I also don't know how to read... bytearrays I think they are?

#

@slender iron I see you moved epaperdisplay to its own thing 😄

#

In shared-module

#

Does that change anything in the board files? Or can I incorporate that as-is?

slender iron
#

it should work as-is for now

#

in 10 then you'll need to use the new module

manic glacierBOT
idle owl
#

@slender iron I went back to main, dumped the board files in from the PR, and was met with a boatload of build errors. I managed to fix all of them and build successfully! 🤯 Now to see if it actually works. 😄

#

It's using the new module now though, I think.

manic glacierBOT
lone axle
#

In the docs for terminalio.Terminal it makes reference to a cursor and moving that cursor's position.

Is there any more information about that anywhere? Is that meant to be a cursor that can be visible on the display as a reverse colored character or something similar to indicate a position or highlighted text?

manic glacierBOT
idle owl
#

Woof. Why does the REPL tell me I have CP 6.2.0-beta.1-somestuff when building from a modified version of main?

slender iron
#

We could add it though

slender iron
#

goes for a short walk

idle owl
#

Ah thanks.

#

Blergh. Updating what appears to be the rotation value is changing nothing. It started as 180, which was upside down, so I changed it to 0, which did nothing, so I thought maybe it was something else that changed with the use of the new module, so I put it back to 180. Still same. Hmm.

idle owl
#

This is like waiting for an image to download in the early '90s. 😂

#

Ok, verified, updating rotation doesn't change anything. I tried 90 even. Not sure how to go about resolving this.

manic glacierBOT
onyx hinge
#

@lone axle for editor.py in particular, it always tracks where it thinks the cursor is, so you could try relying on that (def move on class Screen).

lone axle
# slender iron We could add it though

Do you have thoughts on what might be the path of least resistence to adding the ability to see the cursor?

I had a look in terminalio.Terminal core code and can see that it has cursor_x and cursor_y variables internally. If those were added to shared-bindings to be available from python then with them and some pixel multiplication it could place something over the top as a rudimentary way to indicate a location.

Is it possible to access the terminalio.Terminal instance that is visible by default that mimics the serial console? I know there is displayio.CIRCUITPYHON_TERMINAL which is a Group that contains the TileGrid(s) that the Terminal is using, but I don't know of a way to access the Terminal instance itself in order to access any properties it may have.

slender iron
lone axle
# onyx hinge <@382939733107408897> for editor.py in particular, it always tracks where it thi...

Thank you! I was just tracing through that code. ( I never imagined how tricky print debugging could be in an app whose main output is the same stream where prints go 😅)

I think I could use the locations tracked in there to translate to a location on the display in pixels.

I'm not very experienced with the sys.stdin / stdout concepts that this seems to be using (though hope to learn from studying this code more).

Is there somewhere in here that would make it easyish to access which character is currently at the position of the Cursor? Or to access as a String what is currently visible on the display?

#

ah, I think I just found the answer to that last question. buffer is the list of strings for the current "screen" it looks like.

onyx hinge
#

yes I think that's true. Though, I was thinking you'd just access the terminal's TileGrid to find it out, that may work better

#

I think buffer is only (part of) the edited file, so for instance the status line wouldn't be there

#

i could be wrong, I haven't looked at this file in months

lone axle
#

Thank you. I'll keep poking at it. I missed this when you created it, very neat project! I never knew the default serial console in circuitpython was capable of this sort of nano-like control

onyx hinge
#

you'll need to get ahold of the terminal's tilegrid anyway to find the true width/height of the display

slender iron
#

@onyx hinge remember that idea to separate keys from values in dict tables?

onyx hinge
#

@slender iron yeah?

slender iron
#

I wonder if that'd help us for samd21 instead of error messages

onyx hinge
#

it's no easy undertaking

slender iron
#

board on arduino zero alone is 264 bytes

#

and the savings would be 1/4 of the bytes

#

so 66

#

builtins is 784 with a savings of 196

manic glacierBOT
#

I understand that this doesn't really makes sense for boards without sdcardio/sdioio, however those boards do get plugged into carrier boards with SD cards, and sdcard breakouts can also be added on to boards without native sdcard support.

I'm only bringing this up for consideration, I'm really not sure what the answer is but, is the possible confusion from having debatably, two different mounting methods for boards that have native SD card support and those that don't going to be more pro...

midnight ember
#

Does this mean a physical sd directory in boards now or will it be a placeholder for a virtual /sd?

onyx hinge
#

@midnight ember 9 now requires the "mount point" (technical term) of an SD card [or other more exotic thing] to exist within CIRCUITPY as a directory. To make it easier on folks, the idea is to create a directory named "/sd" when the filesystem is created. If there's enough flash space, additional code to create an explanatory "/sd/placeholder.txt" file is included too.

manic glacierBOT
midnight ember
#

Will the directory be writeable while the filesystem is in read-only? I would love that. If it's for virtual mounts only then the use of virtual /sd not creating files in the physical /sd directory might be more confusing for beginners.

candid sun
#

@onyx hinge assuming example code will need to be updated similar to how we went thru and updated display.show() to display.root_group=

onyx hinge
#

I think it's more a matter of instructions -- because CIRCUITPY will be read only to Python code [without using boot.py or other methods] the user will have to create CIRCUITPY/sd manually from their host computer.

midnight ember
#

Since I'm not really using 9.0 in my main projects yet will just wait for the roll out and cross that bridge when the time comes.

#

All the new changes and amazing projects every week is brain candy. It's a wonderful thing.

manic glacierBOT
#

I installed 9.0.0-beta.0
It is better, BUT: On a hard reboot - unplug 5 volt - seems to run OK. If
I restart the code, I get runtimeError: AP could not be started line 24.
If I comment out this line, it runs OK on subsequent runs. I tried
stopping the AP at the end of the program, but this didn't change anything.

Here is the current code:

I had a lot of trouble coding the access point.

The code runs fine, but when it stops, it crashes the PicoW

AND SOMETIMES WIPES OUT T...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

How's this:

//|         :param int debounce_threshold: Emit events for state changes only after a key has been
//|           in the respective state for ``debounce_threshold`` scans on average. Successive
//|           measurements are spaced apart by `interval` seconds.
//|           The default is 1, which resolve immediately. The maximum is 127.

I think replacing the original term of "scans" by "intervals" made it a little confusing in different way, by implying that at leas...

manic glacierBOT
empty salmon
#

I’ve been thinking about how CircuitPython might support dual-core cpus.
Support for the end user has lots of complications.

[spitballing] Might there be a solution where the board developer can specify what might run on each core? It would logically be things which take a lot of cycles, run continuously, and/or use buffering so things can be “loaded up” and left to run.

stuck elbow
#

would there be any reason to not run on the second core something that could run there?

#

things like wifi, sound, display, etc.

empty salmon
#

That is my thinking. For boards with WiFi and two cores, it’s a logical choice. Sound is another great subsystem to consider.
It would require a buffering solution to handle data from CircuitPython in one core to/from the subsystem running on the other core. But an “under the covers” solution could be easier to implement and little/no change for the CircuitPython user.

stuck elbow
#

we already have sounds playing in the background using buffers

#

the main problem I see is that it would all still need to work the same way on boards with a single core, so the implementation might be tricky

#

a good architecture would help

empty salmon
#

Background execution on “the other core” is the goal. The most popular microcontrollers (by far) now are dual core.

manic glacierBOT
mortal kernel
manic glacierBOT
solar whale
#

for the OV5640 camera with auto focus https://www.adafruit.com/product/5840 the product page says Note that to use the auto-focusing capability, you need to load a new firmware binary over I2C Does anyone know where to get the new firmware and how to load it? I have not been able to find any instructions.

spare jacinth
#

after some digging, seems to be on adafruit_pycamera

#

and (trying?) using the bin is the default option in the initializer (it ends up causing autofocus_init() a couple of nested functions later)

crimson ferry
#

@mortal kernel I'm still getting AP could not be started with 9.0.0-beta.0-5-ged345f4ea2 on 2024-01-30

#

(adafruit-circuitpython-raspberry_pi_pico_w-en_US-20240130-main-PR8861-ed345f4.uf2)

manic glacierBOT
#

Thanks for following up. I tried 9.0.0-beta.0-5-ged345f4ea2 , but the
same result. If I add a microcontroller.reset() to the end of the program,
everything restarts and works just like a power reboot.

Without the reset, the code only runs correctly once.
= > ÷
Rob Coe
@.***

On Tue, Jan 30, 2024 at 7:11 AM eightycc @.***> wrote:

Build artifacts for 9.0.0-beta.0 with fix for #8718
https://github.com/adafruit/circuitpython/issues/8718 are here:
https...

solar whale
slender iron
mortal kernel
empty salmon
#

@slender iron - nice! Where can a development learn how to do this?
Specificly, on an RP2040,which is not implementing USB host, how can the developer move “something” to the second core?

slender iron
#

it is easier with esp-idf stuff because it uses freertos

#

but all of CP runs in one task currently

manic glacierBOT
slender iron
#

what if we used python stubs to generate the locals dict tables?

#

that way we don't have the requirement to list key next to value

manic glacierBOT
#

I am still getting an identical error when trying a basic request (getting time from adafruit IO) on 9.0 beta.0 on an ESP32-S2.
Same code worked before on 8.2.9, still works on an S3 right now.

I think this is the same issue, so seems like it's not fixed.

code.py output:
Traceback (most recent call last):
File "adafruit_requests.py", line 515, in _get_socket
espidf.MemoryError:

The above exception was the direct cause of the following exception:

Traceback (most recent call ...

#

Half a kb for holding placeholder text is not really ideal.
May I instead suggest something along the lines of:

# Settings in this file can be retrieved via os.getenv()
# Certain settings starting with CIRCUITPY_ are also used by CircuitPython.
# For more information, visit docs.circuitpython.org/../settings-toml-tutorial

Excluding the url that would be only 163 bytes and being presented a nice webpage explaining the options is much more functional in my opinion.

Additionall...

#

I am still getting an identical error when trying a basic request (getting time from adafruit IO) on 9.0 beta.0 on an ESP32-S2. Same code worked before on 8.2.9, still works on an S3 right now.

I think this is the same issue, so seems like it's not fixed.

code.py output: Traceback (most recent call last): File "adafruit_requests.py", line 515, in _get_socket espidf.MemoryError:

The above exception was the direct cause of the following exception:

Traceback (most r...

mortal kernel
slender iron
crimson ferry
#

@mortal kernel testing now, looks good blinka_heart_circle

mortal kernel
slender iron
#

that's good to set too so that it's clear where it is coming from

mortal kernel
#

Phew, back to the water heater.

keen eagle
#

I have a PR that adds a couple of methods to wifi.Radio for discovering connected stations in AP mode. What's the best way for y'all to figure out the specifics of the calls that would feel right to you? Currently it returns a list of dicts for the stations but I can see the wisdom in defining a wifi.Station class and returning those instead. Would you prefer discussing it in the PR or here or something else?

GitHub

Addressing issue 8790. I did this for fun and to learn more about CP internals, hope I'm not stepping on anyone's toes and am fine ignoring this if you'd prefer.
Added a new property ma...

manic glacierBOT
#

Its a Feather S2 reverse, article 5345, 2 MB PSRAM. I could test with the same thing in S3, if you think that may be relevant.

The espidf commands immediately before the requests.get() read:

code.py output:
espidf.get_total_psram()=2097152
espidf.heap_caps_get_total_size()=2271279
espidf.heap_caps_get_free_size()=1975079
espidf.heap_caps_get_largest_free_block()=1867776
Traceback (most recent call last):
File "adafruit_requests.py", line 515, in _get_socket
espidf.MemoryError:

slender iron
manic glacierBOT
manic glacierBOT
#

Here is a reduced example which triggers the error:

import os
import espidf
import ssl
import wifi
import socketpool
import adafruit_requests

pool = socketpool.SocketPool(wifi.radio)
requests = adafruit_requests.Session(pool, ssl.create_default_context())

aio_username = os.getenv("ADAFRUIT_IO_USERNAME")
aio_key = os.getenv("ADAFRUIT_IO_KEY")

#ntp = adafruit_ntp.NTP(pool, tz_offset=1, server="ntp.metas.ch")
#rtc.RTC().datetime = ntp.datetime
#print(time.localtime())
locat...

empty salmon
#

how to get latest ?
Today I sync’d my fork of CircuitPython with that from Adafruit. I then checked out main, did a pull, checked out my board branch. Did a merge. And sync’d to my fork.
Everything seemed right.
When I build and install, boot_out.txt still shows 9.0.0-alpha.5-50

Is there instructions I can review to do this correctly so I have the latest (currently beta.0)?

stuck elbow
#

git pull --tags

#

I usually just do git remote update or how it was

#

by default git doesn't pull tag information, because Linus doesn't like it

empty salmon
#

Where is the version info within the repository so I can verify I have it without going thru the build and deploy every time?

idle owl
#

Hello, all. I'm working on trying to get the Inky Frame 7.3" working with CircuitPython. It's definitely on its way, with a few hiccups. One of them is the display is rotated 180 degrees. I changed the rotation value in board.c but it has no effect. I tried 90 even, simply to verify. I have no idea where to go with this.

#

The other issue is that the buttons are on a shift register, and they're reading fine with the keypad module, but they show up as number 3-7. There are 5 buttons total. I also don't know where to look into that.

empty salmon
#

@slender iron - OK. That still shows “alpha” so I am missing a step somewhere.

#

When I look at my fork on GitHub it said the main branch is up-to-date

#

I pull from my fork to my build machine. It still shows “alpha”

slender iron
#

tags aren't technically part of a branch. so it may only be updating the branch

manic glacierBOT
empty salmon
#

Sorry to be a pain. … from my local machine, what is the full command to get tags from aidsfruit?

slender iron
#

what remotes do you have? (git remote -v)

onyx hinge
#

@empty salmon in the top directory, make fetch-tags

empty salmon
#

I get an error “does not appear to be a git repository” if I use “upstream”

onyx hinge
#

(which should work regardless of your git remote settings)

empty salmon
#

Thanks! Worked.

onyx hinge
#

good

iron fractal
#

Is there an up to date guide on building C extensions for CircuitPython? Or just a good example somewhere on GitHub? The Adafruit guide dates back a few years.

slender iron
manic glacierBOT
iron fractal
#

Is it still the case that a new C extension requires recompiling all of CircuitPython, there's no dynamic linking?

stuck elbow
#

yes

empty salmon
#

Did something change?

  • my board has an integrated ePaper display.
  • 2 or 3 months ago, if there was an error that dumped to REPL, the error would show on the display. (I didn’t like it).
  • Now, it seems errors don’t show on the ePaper display.
    I’m happy but confused.
manic glacierBOT
#

This looks like it works!!
Thank you eightycc and anecdata.
= > ÷
Rob Coe
@.***

On Tue, Jan 30, 2024 at 10:24 AM eightycc @.***> wrote:

@rpcoe https://github.com/rpcoe This build artifact picks up the
correct cyw43-driver submodule branch:
https://github.com/adafruit/circuitpython/actions/runs/7715586486/artifacts/1206479517
.


Reply to this email directly, view it on GitHub
<https://github.com/adafruit/circuitpython/issues/8858#issuecomment...

manic glacierBOT
slender iron
empty salmon
#

@slender iron - hmmmm …. I will do more testing. I tried a few things and could never get an error on the ePaper display.

Addendum: I want to reiterate, I like that errors don’t appear on the ePaper display. I just know we rode this merry go round a couple months ago and at that time the consensus was that errors should appear on ePaper. 😉

lone axle
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.9 on 2023-12-06; BLING! with ESP32S3

Code/REPL

# SPDX-FileCopyrightText: 2023 Kattni Rembor for Adafruit Industries
# SPDX-License-Identifier: MIT
"""
CircuitPython I2S Tone playback example.
"""
import time
import array
import math
import audiocore
import board
import audiobusio
import neopixel
import microcontroller


BLING = neopixel.NeoPixel(board.MATRIX_DATA,320,brightness=0.05,auto_write=...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
onyx hinge
lone sandalBOT
onyx hinge
#

@slender iron did you want the whole "uvc" module renamed "usb_uvc", or just the #define ? I asked on the PR last night but asking again so I can get working on it now.

#

@random junco hey, what's a good permalink for circuitpython show podcasts? awesome-circuitpython has an outdated domain that doesn't work (hxxps://circuitpythonshow.com)

manic glacierBOT
onyx hinge
#

@tulip sleet I'm talking to Kattni about the Inky Frame. One of the problems is that the buttons share a shift register with "other stuff" including the e-ink busy signal .. and those bits get shifted out first. What do you think about adding a "skip # bits at start" for ShiftRegisterKeys to accomodate this 'feature'?

#

D7 gets shifted out first so "key 0" is "inky busy", and physical buttons E...A are mapped onto keys 3..7 in that order, if I understand right what's happening

#

otherwise we can probably work through some code to discard events that don't matter

lone sandalBOT
onyx hinge
#

[belatedly remembers dan's out this week, sorry for the ping]

onyx hinge
slender iron
#

or maybe usb_video

#

uvc doesn't mean much

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.6-37-g7af75178ed-dirty on 2024-01-31; BLING! with ESP32S3

Adafruit CircuitPython 9.0.0-beta.0-7-g96be941d83 on 2024-01-31; BLING! with ESP32S3

(Both built for UM BLING by myself locally)

Code/REPL

"""
CircuitPython Wav files
"""
import time
import audiocore
import board
import audiobusio
import microcontroller

audio = audiobusio.I2SOut(microcontroller.pin.GPIO2, microcontroller.pin.GPIO1, micr...
tulip sleet
manic glacierBOT
#

Problem still happens in the final macOS 14.3 release and in macOS 14.4 beta1. Reported through Feedback Assistant, I name dropped Adafruit this time and filed it under Finder with a screenshot but made it clear where the issue is and that it affects command line utilities as well.

Current list of feedback IDs is FB13554680 FB13547720 FB13528351 FB13513401 FB13469123 FB13468526 FB13269327 FB13428357 FB13416096 FB13226668 FB13306896

#

@dhalbert how does this sound?

wifi.Radio.stations_ap returns a list of associated wifi.Station objects or throws an exception if not in AP mode (read-only)
wifi.Radio.max_stations_ap returns the maximum number of stations that can be associated in AP mode (read-only)

wifi.Station can't be created by users, has these properties:

  • mac_address - byte array MAC address of the associated station (read-only)
  • rssi - current RSSI of associated station (read-only, None on Pico W)
  • ipv4_...
#

The only types defined in the UVC standard are YUYV and other chroma style formats. A note on microsoft.com says that only YUYV and NV12 are required to be supported. However, I did find some info in Linux source code about GUIDs for RGB565_SWAPPED format, so we could look at it as a possibility.

I don't think that the RGB->YUYV conversion is taking much compute resource or causing much artifacting.

[I wrote a longer comment about this but apparently lost it rather than submitting it]

#

@dhalbert how does this sound?

wifi.Radio.stations_ap returns a list of associated wifi.Station objects or throws an exception if not in AP mode (read-only) wifi.Radio.max_stations_ap returns the maximum number of stations that can be associated in AP mode (read-only)

wifi.Station can't be created by users, has these properties:

* mac_address - byte array MAC address of the associated station (read-only)

* rssi - current RSSI of associated station (read-o...
#

I tried this now to check and make sure (I've tried so many variations of things to try and narrow this down I'll probably mix them up in my head). If I comment out all neopixel stuff, but let it make beeping sounds it willl also bomb with Hard fault: memory access or instruction error. I provoked it a little harder by copying a little directory of small .wav files instead of doing a lot of just touches while the program was running.

# SPDX-FileCopyrightText: 2023 Kattni Re...
slender iron
#

@limber tinsel I'm not sure whether we've tried building silabs on mac

slender iron
#

seems like you got almost to the end of the build

limber tinsel
#

OK, time for me to learn how those make files work 😆

slender iron
#

you can do make V="steps commands" to see what it is running

limber tinsel
#

Thanks for the help, I'll see if I can edit the file to get to the correct place.

slender iron
#

👍 I'm in pacific time so I'll be around for five or so more hours

#

I did manage to build it on linux

limber tinsel
#

ok cool, thanks, I am in PT as well.

manic glacierBOT
manic glacierBOT
atomic summit
#

Any improvements in the latest macOS beta with the FAT issues?

limber tinsel
#

ok cool, thanks, I am in PT as well.

slender iron
atomic summit
#

I'm still running Ventura on my main work Mac as I was hoping this would get sorted before I upgraded it... but I'm going to have to move soon.

#

Oh, lots of updates in that issue - I've not been getting email notifications, weird.

manic glacierBOT
#

-Os is a gcc option that tell the compiler to "optimize for size". In general it's not wrong to omit it, but it'll help compiled software occupy less RAM. In theory any program should behave identically whether you use it or not, but we all know how that goes...

I think this is set in the 9.0.0 builds though and not 8.2.9 and if I'm reading the issue right the problem is happening in 8.2.9, so this probably isn't the issue.

-Os enables all -O2 optimizations except
       thos...
slender iron
#

@atomic summit can all of your boards do quad spi for flash and ram at 80mhz?

atomic summit
slender iron
#

I think your boards I did. I'm searching and replacing for the rest...

atomic summit
#

Ahh, ok.

slender iron
#

it won't change octal ones. just dio

manic glacierBOT
#

We inherited a bunch of DIO from 8.x which used it for ROM flash settings. Pretty much everything should be able to do QIO.

S2, S3 and ESP32 all support 80mhz as well and ESP modules tend to work at that speed too. Only on ESP32 do we leave PSRAM at 40mhz because the 80/80 mode uses an extra SPI resource that we don't want to use.

Fixes #8612

Smoke tested on Adafruit Feather S2 with 4MB flash and 2MB ram. No other boards tested. We can back out these changes if boards have trouble wi...

manic glacierBOT
#

I will occasionally mount SD cards to alternate folders so the placeholder message was bothering me a bit. It also took me a couple reads before I understood what the second sentence was trying to say. It's probably just me but what do you think about this as an alternate wording?

"SD cards mounted at /sd will hide this file from Python."
" SD cards are not visible via USB CIRCUITPY.\n"

manic glacierBOT
#

I believe I've reproduced the crash with a Matrix Portal S3, so it's not BLING-specific

Ran the same code as originally posted, just changing the neopixel pin

Copying around 25 Python source files from a project to CIRCUITPY while it was running it hard crashed into the boot loader. MATRXS3BOOT came up. Reset got me back to CircuitPython and the system was able to mount CIRCUITPY. I'm on Sonoma but I'd manually done the remount workaround. I seem to be able to crash it around 50-75% of ...

idle owl
#

The Inky Frame is working with the latest CircuitPython changes. There are two sections towards the beginning of pins.c that handle making user-facing names for the buttons (because they are otherwise handled by a shift register, and return bit numbers). However, they also include the RTC alarm, ext trigger, and the display busy pin. This means that if use keypad.ShiftRegisterKeys and print the key_number, every time the busy pin is triggered, it shows that key_number 0 pressed. I wonder whether there's a way to separate out the three extra items, and still make them available in board, but not have them being picked up by keypad.

#

Anyway, that's my latest update. I'm heading out.

orchid basinBOT
manic glacierBOT
#

So far, since I built and started trying Adafruit CircuitPython 9.0.0-beta.0-7-g96be941d83 on 2024-01-31; BLING! with ESP32S3 and working around the IDFerror stuff I haven't had a hard fault. Some quick testing with the code above wouldn't crash it (not extensive, just a few minutes testing), and I spent time coding my regular program which would bomb it every few saves in vscode and that didn't crash it.

willow totem
#

@slender iron apologies for the ping, got a last minute #circuitpython-2024 wish... I would love to be able to use long range wifi on the esp, it gets about 500m... no LoRa license fees or extra hardware required (but benefits from external aerial of course)... <#help-with-wippersnapper-and-adafruitio message>

#

I should have waited five minutes, they just gave the email address for it 🤦

midnight ember
#

That would be nice. Might negate the need for RFM with my mailbox project.

main furnace
#
from adafruit_featherwing.tft_featherwing_35 import TFTFeatherWing35
wing = TFTFeatherWing35()

Adafruit CircuitPython 9.0.0-beta.0 on 2024-01-27; Adafruit Feather RP2040 USB Host with rp2040

Traceback (most recent call last):
  File "code.py", line 2, in <module>
  File "adafruit_featherwing/tft_featherwing_35.py", line 49, in __init__
  File "adafruit_featherwing/tft_featherwing.py", line 81, in __init__
RuntimeError: Mount point directory missing

Fix: Create /sd on CIRCUITPY.

slender iron
lone axle
# slender iron This looks great! We should add it natively

I can give it a try to add in the core, but It's probably beyond my means to get it working in time to use for the editor project for next week.

The current implementation of this relies on code in Jeffs adafruit_editor library which holds strings representing what is currently visible within it's terminal window.

I only had a quick look, but I didn't see anything inside of terminalio.Terminal that keeps that data as a string, or provides a way to read it back out of the Terminal after it's been written.

#

Right now the cursor is a 1 character Label that gets updated with the character currently at the X,Y location of the cursor each time it updates. So being able to get the string representation is necessary at least how it works now.

#

If there were a way to invert, or manipulate the palette used by a single tile within a TileGrid that might offer an even easier way to achieve a very similar visual.

idle owl
#

Anyone have any idea how to install an older version of uncrustify on MacOS? Their own GitHub repo only has the two latest versions, which do not appear to be compatible with CircuitPython pre-commit.

slender iron
slender iron
lone axle
#

do you know if there is a way to get from a tile index to the character that it represents within a font? get_glyph_index() goes the other way from character to tile index. If we could reverse that then we could read characters from the TileGrid.

slender iron
#

I think you'd need to build a reverse table lookup

#

the tilegrid only knows what is on screen though

lone axle
#

Maybe it could copy the bitmap data for 1 tile into a new bitmap to put on top. Then it won't really need to know the character, just be able to copy from the source region and flip the colors.

slender iron
mortal kernel
idle owl
#

I reinstalled uncrustify, and now it works. 🤷🏻‍♀️

#

Thanks @mortal kernel!

#

Inconsistent behavior. My favorite. 🙄

mortal kernel
#

Quick question: What is the best way to measure elapsed wall clock time inside CP core code? Looking for something with millisecond accuracy suitable for use in a polling loop.

#

I'm thinking that supervisor_ticks_msxx() is the way to go.

amber sundial
#

I was wondering if you have something for the nv3052 .. there's something for the nv3022 here

gilded cradle
# amber sundial <@478616919721771019> I was wondering, on your journey to make the display ports...

@onyx hinge (who is off for the next couple weeks or so) originally wrote them and wrote up some technical information in a guide. I took that and reformatted a lot of it into a regular guide, did a lot of testing, figured out init settings if they were missing or not quite right, and wrote the qualia library as well as adding some Arduino stuff. I don't believe they were written specifically for the ESP IDF, but I could be wrong.

amber sundial
gilded cradle
amber sundial
lone axle
lone axle
#

is something like this getting close?

common_hal_usb_cdc_serial_write(usb_cdc_data_obj, "hi", 2, 0);
stuck elbow
#

not sure if the size should include the terminating \0 for example...

slender iron
#

I think that's right

#

are you trying to print debug messages out to the console?

lone axle
slender iron
#

good point!

#

you could also hook it up to printf

lone axle
#

I'm not sure what that entails or how to do it.

slender iron
#

makes a console_uart_printf() that only goes out the UART

#

you could make something similar for usb_data

lone axle
#

Interesting, I could use UART as output as well if that one is hooked up already.

I tried a build with this code:

char myMessage[] = "hi";
common_hal_usb_cdc_serial_write(usb_cdc_data_obj, (uint8_t *)myMessage, 2, 0);

but it gets this error

../../shared-module/terminalio/Terminal.c:67:37: error: incompatible type for argument 1 of 'common_hal_usb_cdc_serial_write'
   67 |     common_hal_usb_cdc_serial_write(usb_cdc_data_obj, (uint8_t *)myMessage, 2, 0);
      |                                     ^~~~~~~~~~~~~~~~
      |                                     |
      |                                     usb_cdc_serial_obj_t
In file included from ../../shared-module/usb_cdc/__init__.c:33,
                 from ../../shared-module/terminalio/Terminal.c:33:
../../shared-bindings/usb_cdc/Serial.h:35:69: note: expected 'usb_cdc_serial_obj_t *' but argument is of type 'usb_cdc_serial_obj_t'
   35 | extern size_t common_hal_usb_cdc_serial_write(usb_cdc_serial_obj_t *self, const uint8_t *data, size_t len, int *errcode);
      |                                               ~~~~~~~~~~~~~~~~~~~~~~^~~~
make: *** [../../py/mkrules.mk:85: build-pyportal_titano/shared-module/terminalio/Terminal.o] Error 1

My guess was that I have pointer vs. referenc eof the cdc_data_obj wrong, but I'm not sure how to do it properly (I really should try to take a step back and learn more C fundamentals).

I did also try:

common_hal_usb_cdc_serial_write(&usb_cdc_data_obj, (uint8_t *)myMessage, 2, 0);

and it seems to get further in the build process but does still result in other errors.

slender iron
lone axle
# slender iron the & addition is right. what are the other errors?
GEN build-pyportal_titano/frozen_content.c
/home/timc/repos/circuitpython/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: build-pyportal_titano/shared-module/terminalio/Terminal.o (symbol from plugin): in function `usb_cdc_console_enabled':
(.text+0x0): multiple definition of `usb_cdc_console_enabled'; build-pyportal_titano/shared-module/usb_cdc/__init__.o (symbol from plugin):(.text+0x0): first defined here
/home/timc/repos/circuitpython/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: build-pyportal_titano/shared-module/terminalio/Terminal.o (symbol from plugin): in function `usb_cdc_console_enabled':
(.text+0x0): multiple definition of `usb_cdc_data_enabled'; build-pyportal_titano/shared-module/usb_cdc/__init__.o (symbol from plugin):(.text+0x0): first defined here
/home/timc/repos/circuitpython/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: build-pyportal_titano/shared-module/terminalio/Terminal.o (symbol from plugin): in function `usb_cdc_console_enabled':
(.text+0x0): multiple definition of `usb_cdc_descriptor_length'; build-pyportal_titano/shared-module/usb_cdc/__init__.o (symbol from plugin):(.text+0x0): first defined here
/home/timc/repos/circuitpython/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: build-pyportal_titano/shared-module/terminalio/Terminal.o (symbol from plugin): in function `usb_cdc_console_enabled':
(.text+0x0): multiple definition of `usb_cdc_add_descriptor'; build-pyportal_titano/shared-module/usb_cdc/__init__.o (symbol from plugin):(.text+0x0): first defined here
/home/timc/repos/circuitpython/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: build-pyportal_titano/shared-module/terminalio/Terminal.o (symbol from plugin): in function `usb_cdc_console_enabled':
(.text+0x0): multiple definition of `common_hal_usb_cdc_enable'; build-pyportal_titano/shared-module/usb_cdc/__init__.o (symbol from plugin):(.text+0x0): first defined here
/home/timc/repos/circuitpython/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: build-pyportal_titano/shared-module/terminalio/Terminal.o (symbol from plugin): in function `usb_cdc_console_enabled':
(.text+0x0): multiple definition of `usb_cdc_set_defaults'; build-pyportal_titano/shared-module/usb_cdc/__init__.o (symbol from plugin):(.text+0x0): first defined here
/home/timc/repos/circuitpython/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: build-pyportal_titano/shared-module/terminalio/Terminal.o (symbol from plugin): in function `usb_cdc_console_enabled':
(.text+0x0): multiple definition of `common_hal_usb_cdc_disable'; build-pyportal_titano/shared-module/usb_cdc/__init__.o (symbol from plugin):(.text+0x0): first defined here
Memory region         Used Size  Region Size  %age Used
FLASH_BOOTLOADER:          0 GB        16 KB      0.00%
  FLASH_FIRMWARE:      578204 B      1000 KB     56.47%
FLASH_FILESYSTEM:          0 GB         0 GB
    FLASH_CONFIG:          0 GB         0 GB
       FLASH_NVM:          0 GB         8 KB      0.00%
             RAM:       10936 B       256 KB      4.17%
collect2: error: ld returned 1 exit status
make: *** [Makefile:382: build-pyportal_titano/firmware.elf] Error 1
#

perhaps the way I did the include is incorrect?

#include "shared-module/usb_cdc/__init__.c"
slender iron
#

ya, include the .h instead

#

may be in shared-bindings instead

lone axle
#

with either of these:

#include "shared-bindings/usb_cdc/__init__.h"
// or 
#include "shared-module/usb_cdc/__init__.h"

it gets this same undeclared error:

../../shared-module/terminalio/Terminal.c: In function 'common_hal_terminalio_terminal_construct':
../../shared-module/terminalio/Terminal.c:67:5: error: implicit declaration of function 'common_hal_usb_cdc_serial_write' [-Werror=implicit-function-declaration]
   67 |     common_hal_usb_cdc_serial_write(&usb_cdc_data_obj, (uint8_t *)myMessage, 2, 0);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../shared-module/terminalio/Terminal.c:67:5: error: nested extern declaration of 'common_hal_usb_cdc_serial_write' [-Werror=nested-externs]
../../shared-module/terminalio/Terminal.c:67:38: error: 'usb_cdc_data_obj' undeclared (first use in this function); did you mean 'usb_cdc_data_enabled'?
   67 |     common_hal_usb_cdc_serial_write(&usb_cdc_data_obj, (uint8_t *)myMessage, 2, 0);
      |                                      ^~~~~~~~~~~~~~~~
      |                                      usb_cdc_data_enabled
../../shared-module/terminalio/Terminal.c:67:38: note: each undeclared identifier is reported only once for each function it appears in
cc1: all warnings being treated as errors
make: *** [../../py/mkrules.mk:85: build-pyportal_titano/shared-module/terminalio/Terminal.o] Error 1

slender iron
#

where in the file are you including it?

#

try shared-bindings/usb_cdc/Serial.h

#
rg common_hal_usb_cdc_serial_write ../..
../../shared-module/usb_cdc/Serial.c
81:size_t common_hal_usb_cdc_serial_write(usb_cdc_serial_obj_t *self, const uint8_t *data, size_t len, int *errcode) {

../../shared-bindings/usb_cdc/Serial.c
109:    return common_hal_usb_cdc_serial_write(self, buf, size, errcode);

../../shared-bindings/usb_cdc/Serial.h
35:extern size_t common_hal_usb_cdc_serial_write(usb_cdc_serial_obj_t *self, const uint8_t *data, size_t len, int *errcode);
lone axle
#

The include statement itself is at the top of the file with the other pre-existing includes. I've put it inside of shared-module/terminalio/Terminal.c and the line trying to actually use it is down inside of common_hal_terminalio_terminal_construct() where I just stuck it as a test to see if I could get it building.

#

with #include "shared-bindings/usb_cdc/Serial.h" it gets undeclared error:

../../shared-module/terminalio/Terminal.c: In function 'common_hal_terminalio_terminal_construct':
../../shared-module/terminalio/Terminal.c:68:38: error: 'usb_cdc_data_obj' undeclared (first use in this function); did you mean 'usb_cdc_serial_obj_t'?
   68 |     common_hal_usb_cdc_serial_write(&usb_cdc_data_obj, (uint8_t *)myMessage, 2, 0);
      |                                      ^~~~~~~~~~~~~~~~
      |                                      usb_cdc_serial_obj_t
../../shared-module/terminalio/Terminal.c:68:38: note: each undeclared identifier is reported only once for each function it appears in
make: *** [../../py/mkrules.mk:85: build-pyportal_titano/shared-module/terminalio/Terminal.o] Error 1
slender iron
#
../../shared-module/usb_cdc/__init__.c
162:static usb_cdc_serial_obj_t usb_cdc_data_obj = {
258:    usb_cdc_set_data(data ? MP_OBJ_FROM_PTR(&usb_cdc_data_obj) : mp_const_none);
260:        usb_cdc_data_obj.idx = idx;
#

You'll need to remove the static and put an extern in the corresponding header

keen eagle
#

It's stored as data in usb_cdc_module's .globals, would it make sense to fetch it from there rather than exposing the underlying C struct's name as a global? Not that I know how to get a value from a module's dict in C.

manic glacierBOT
#

Ooof. Thanx for the update, John.

While I"m normally a C++ dev, this week I've tried to use Matrix S3 with
Circuit Python 9 that insists that doing a reboot every time you save your
Python source is a sane thing and this bug makes developing on that device
just miserable since most unmounts will fail and/or corrupt the drive.
Writing and debugging code isn't hard enough - let's do it on a device that
literally self destructs some substantial percentage of the time you press
"save" in...

#

@robertlipe - is it a reboot - CIRCUITPY ejects and then re-connects and the serial terminal disconnects and re-connects - or is it the REPL reloading and re-running code.py? If it's the latter, it's expected behavior and you can disable that with

import supervisor

supervisor.runtime.autoreload = False

in boot.py or code.py

if it really is a reboot, CircuitPython 9 has just moved to beta and I'm sure the devs would like to hear about any code that can cause a reproduci...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.0 on 2024-01-27; Raspberry Pi Pico W with rp2040

Code/REPL

import board
import busio
import sdcardio
import storage

spi = busio.SPI(clock=board.GP18, MOSI=board.GP19, MISO=board.GP16)
cs = board.GP17

sd = sdcardio.SDCard(spi, cs)

vfs = storage.VfsFat(sd)
storage.mount(vfs, '/sd')

with open("/sd/pico.txt", "w") as file:
    file.write("1. Hello, world!\r\n")

Behavior

Tr...
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.0 on 2024-01-27; Adafruit Feather RP2040 USB Host with rp2040

Code/REPL

"crash.py"
"""Adafruit CircuitPython 9.0.0-beta.0 on 2024-01-27;
Adafruit Feather RP2040 USB Host with rp2040
TFT FeatherWing 3.5in"""
import displayio
from adafruit_featherwing.tft_featherwing_35 import TFTFeatherWing35
wing = TFTFeatherWing35()
display = wing.display
group = displayio.Group()
display.root_group.append(gr...
solar whale
#

I just tried building from a clean install on MAC OS sonoma -- I am trying an espressif build for adafruit_esp32s3_camera but it fails with ```The following Python requirements are not satisfied:
Requirement 'pyelftools<=0.29' was not met. Installed version: 0.30
To install the missing packages, please run "install.sh"
Diagnostic information:
IDF_PYTHON_ENV_PATH: /Users/jerryneedell/.espressif/python_env/idf5.1_py3.11_env
Python interpreter used: /Users/jerryneedell/.espressif/python_env/idf5.1_py3.11_env/bin/python
Constraint file: /Users/jerryneedell/.espressif/espidf.constraints.v5.1.txt
Requirement files:

  • /Volumes/CircuitPythonBuild/circuitpython/ports/espressif/esp-idf/tools/requirements/requirements.core.txt
    Python being checked: /Users/jerryneedell/.espressif/python_env/idf5.1_py3.11_env/bin/python
    CMake Error at esp-idf/tools/cmake/build.cmake:366 (message):
    Failed to run Python dependency check. Python: python, Error: 255
    Call Stack (most recent call first):
    esp-idf/tools/cmake/build.cmake:498 (__build_check_python)
    esp-idf/tools/cmake/project.cmake:547 (idf_build_process)
    CMakeLists.txt:12 (project)

-- Configuring incomplete, errors occurred!
gmake: *** [Makefile:420: build-adafruit_esp32s3_camera/esp-idf/config/sdkconfig.h] Error 1
jerryneedell@Mac-mini espressif %

#

When runnig the install.sh I see ```Installing collected packages: pyelftools, cryptography
Attempting uninstall: pyelftools
Found existing installation: pyelftools 0.30
Uninstalling pyelftools-0.30:
Successfully uninstalled pyelftools-0.30
Attempting uninstall: cryptography
Found existing installation: cryptography 36.0.2
Uninstalling cryptography-36.0.2:
Successfully uninstalled cryptography-36.0.2
Successfully installed cryptography-39.0.2 pyelftools-0.29
All done! You can now run:

. esp-idf/export.sh

lone axle
lone axle
solar whale
lone axle
#

the output in your second copy/pasted chunk looks like it did successfully uninstall 0.30 and then install 0.29, so from that output it seems like it suceeded in getting the version it wants to have as far as I can tell.

solar whale
#

hmmm -- okay -- it is happier now -- confusing, but happier...

#

It seems like it took a few tries to get it right, but it is working now...

manic glacierBOT
#

Hello. I did a circuitpython 8.2.x build with DEBUG=1 Adafruit CircuitPython 8.2.6-37-g7af75178ed-dirty on 2024-02-02; BLING! with ESP32S3 and man in DEBUG=1 it is just eager to crash. With the same test program above with the flashing neopixels and the audio beeping it will die without even copying files in a minute or two. Copying a single file about 50k to the CIRCUITPY will bomb it.

If I comment out all the audio lines (leaving flashing neopixels) it seems to run fine withou...

manic glacierBOT
lost wing
#

Good morning! I was trying to create a USB MIDI host using a Lolin S2 Mini (equipped with an ESP32-S2, so supposedly should have support for USB host). But... I found out that usb.core is not supported on that board. Why is that? Is there any workaround for this?

stuck elbow
#

a far as I know usb host is still very much work in progress

random junco
#

I thought USB host was iMX and rp2040 based on the release notes

lost wing
#

I understand it's released for several boards, isn't it?

stuck elbow
#

it usually requires special hardware to be added to the board

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.0 on 2024-01-27; Adafruit MatrixPortal S3 with ESP32S3

Code/REPL

# SPDX-FileCopyrightText: 2023 Liz Clark for Adafruit Industries
#
# SPDX-License-Identifier: MIT

import os
import gc
import ssl
import time
import wifi
import socketpool
import adafruit_requests
import adafruit_display_text.label
import board
import terminalio
import displayio
import framebufferio
import rgbmatrix
impor...
lost wing
#

@stuck elbow I understand. But ESP32-S2 supposedly has built in host capabilities. I've been trying to make it work in Arduino framework to no success. I was hoping I was more lucky with Circuitpython...

stuck elbow
manic glacierBOT
#

Starting with CP 9.x, a folder has to be created to be used as a mount point before the SD card can be mounted. The quick fix is to add

import os

if not '/sd' in os.listdir('/'):
    os.mkdir('/sd')

sometime before the storage.mount command.

Although I believe PR #8860 will resolve this by creating the mount point file for most boards (they need to have the sdcardio or sdioio modules enabled on the build, which I believe is the default).

lost wing
orchid basinBOT
stuck elbow
lost wing
digital shoreBOT
slender iron
slender iron
#

(So usb_host isn't implemented on ESP)

#

we also want to support an external host chip from circuitpython but we haven't added that yet

lost wing
slender iron
#

we do want to support OTG eventually

#

but the external host chip is more of a priority

manic glacierBOT
keen eagle
manic glacierBOT
slender iron
#

looks

#

mp_map_lookup

keen eagle
#

if you don't know it off the top of your head I feel better about failing to figure it out 😉

slender iron
#

It is a little tricky because map underlies dict

manic glacierBOT
main furnace
#

Unpopular work-around for Sonoma: Disable CIRCUITPY, use ampy to write files to the device.

manic glacierBOT
mortal kernel
#

My knowledge of CP memory management wouldn't fill a teacup, so before I resort to the code I'm wondering if there's a write-up somewhere?

#

(I'm making some assumptions about what gets GC'ed that might be bad)

stuck elbow
#

it starts with the root pointers, scans the memory they point to, and follows anything that looks like a pointer in there, marking all that as used, then it frees everything that's left

manic glacierBOT
#

You need write access to CIRCUITPY '/' to create the '/sd' folder. Maybe print instructions for doing that?

I suspect most folks would create the folder through the CIRCUITPY drive, so it's probably not worth adding instruction text on changing the storage.remount flag in the CircuitPython core.

I personally liked the idea of adding the os.listdir check from the snippet above because it doesn't hide any error messages like "read-only file system" as a Try/Except block would. Getting t...

mortal kernel
stuck elbow
#

the trick is that it doesn't know for sure if it's a pointer or just a part of some string or something, so sometimes it will keep pieces of memory that are not actually being pointed to

#

this is why it can't move things around - it can't go back and update the pointer, because it's not sure that it's a pointer and not just some random data

mortal kernel
slender iron
#

One thing we could do to save code size is remove the context manager of the core classes. I don't think I've ever seen someone use that

#

BusDevice uses it for transactions but not the core classes

mortal kernel
# slender iron Yes

I would love to take a deep dive into CP memory management. Maybe after I've got _bleio buttoned up.

slender iron
#

note that you can only use m_malloc when the vm is running

#

(and ble runs outside the vm sometimes)

mortal kernel
slender iron
#

the ble workflow runs ble outside the vm

mortal kernel
slender iron
#

they used to be static only

#

but you can use port_malloc in 9.0 to allocate outside the vm

#

no GC though

mortal kernel
#

Thank you! All good to know.

manic glacierBOT
#

CircuitPython version

CP 9.0 beta.0

The code runs OK under CP 9.0 alpha.6

Code/REPL

I am trying to run the MartixPortal_S3 SMS Messge Board code https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/main/Matrix_Portal_S3_SMS_Scroller

Behavior

Adafruit CircuitPython 9.0.0-beta.0 on 2024-01-27; Adafruit MatrixPortal S3 with ESP32S3
>>> 
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to ...
manic glacierBOT
manic glacierBOT
#

I have the same issue, but some additional info:

  1. If I enter the IP address only into the browser, the main page for workflow loads correctly
  2. If I click on the link for "file browser", the file browser page loads, but the following message appears near the top of the page:
    ℹ️ USB is using the storage. Only allowing reads. Try ejecting the CIRCUITPY drive. See Getting Started with Web Workflow for detail...
#

This has to do with the changes to validation of arguments to bitmaptools.blit.

The bitmap is created with a size of 0x0 pixels initially:

        self._buffer = displayio.Bitmap(0, 0, 65535)

this is rather dubious,but in the past it worked.

Now, it appears the changed ("improved") argument validation rejects this, because the pixel (0,0) is not actually in the image. There are no valid X coordinates in the image, because the valid coordinates are from 0 to (width - 1), or f...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.0 on 2024-01-27; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3
Board ID:adafruit_feather_esp32s3_4mbflash_2mbpsram

Code/REPL

# SPDX-FileCopyrightText: 2023 Frederick M Meyer
#
# SPDX-License-Identifier: MIT

import ipaddress
import ssl
import wifi
import socketpool
import adafruit_requests
import random
import os
import time
import rtc
import adafruit_ntp
import adafruit_date...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I tried simply changing

        self._buffer = displayio.Bitmap(0, 0, 65535)

to

        self._buffer = displayio.Bitmap(1, 1, 65535)
```  in the two places I found  it in message.py . It still works with alpha.6 but now fails in the display_text library under beta.0
It does  get further along and displays a message briefly before failing so this was  progress

Traceback (most recent call last):
File "code.py", line 142, in <module>
File "/lib/messageboard/mess...

manic glacierBOT
#

Yes, that PR is directed towards RP, for a product id (PID) from their vendor id (VID, 0x2E8A). For a proper CircuitPython port we need to have a unique VID:PID for every board that exposes USB.

Is that really true? Why do you need to have a unique VID:PID? Why can't you instead have a standard VID:PID for a particular piece of silicon and identify the board through the Product ID?

#

From the conversation here it looks like we may have landed on deciding that 0 width or height blit should be allowed: https://github.com/adafruit/circuitpython/pull/7867

although it doesn't state specifically 0 height and width it would follow that both should work if either is allowed IMO. Nor does it say that a Bitmap with 0 width or height is allowable, just the blit action. But perhaps we should aim for consistency. If blit allows 0 sized actions because it makes certain image proce...

manic glacierBOT
#

Is that really true? Why do you need to have a unique VID:PID? Why can't you instead have a standard VID:PID for a particular piece of silicon and identify the board through the Product ID?

I'm not sure what you're suggesting here. The "Product ID" is the "PID". The RP2040 chip itself presents a single VID:PID because it has a built-in bootloader in ROM. But when the board is running Arduino or CircuitPython, it presents an Arduino-specific VID:PID or a CircuitPython-specific VID:PID f...

manic glacierBOT
#

I'd be happy to get a stack trace or even do a bit of debugging once I get a RP2040 board with accessible SWD pins, which I don't currently have. It might be a while before I get around to obtaining one.

If you have a spare Pico or even better, a Feather RP2040 with SWD header that you can send my way, that would be great. Otherwise, I probably won't get one until the next time I have an Adafruit order to add on to.

manic glacierBOT
#

Additional observation: running this loop on a M2 MacBook Air will succeed for a long time (several minutes before I stopped it), but will tend to cause the crash once interrupted with Ctrl-C:

while :; do stty -a < /dev/cu.usbmodem1101; done

In the past, when tracing USB CDC traffic on a different device with a Beagle, I noticed that macOS will sometimes abort a CDC-related control transfer partway through, and I wonder if that's related.

#

I'm gone for a week, so I recommend that if someone decides how to fix this in the meantime that they add tests. Creation of bitmaps and use of bitmaptools (&bitmapfilter) functions can be tested at build time by adding files under tests/circuitpython: a .py file and a .py.exp file containing the expected output.

I do somewhat understand the purpose of allowing the creation of a 0x0 bitmap, and I can see that it's probably then also necessary to allow to blit from a 0x0 bitmap, whi...

manic glacierBOT
warm stump
#

Had another look at MKRVidor4000 as a FeatherM0Basic
mainly because I found a Dallas DS18B20 that I got ages ago and realised it might have some EEPROM inside it
...which originated from a search to find 1 floating gate memory cell as a through hole component...
CircuitPython is able to drive pins ~3, ~4, ~5 as D0, MOSI, SCK on a board it has no idea it's running on!...
The procedures outlined might be a bit experimental and latest versions should be used if possible
but I have included a quick port of the OWI/OWB driver from the webpage rewritten as def DS18B20_<Method>(Port, Data, etc):

manic glacierBOT
#

This is one potential solution for #8876.

The crux of the 0,0 size was that max was ending up less than min in the range check which causes it to fail range validation automatically.

With this build I am able to run the SMS scroller code successfully on a Matrix Portal S3. It's only scrolling the default text, I have not set up anything wtih adafruit.io or SMS for it. But I did successfully replicate the exception mentioned in the issue with that default text and confirmed this version ...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Was this ever implemented in Circuit Python? I am seeing a stuck bus issue with I2C using:
Adafruit CircuitPython 8.2.8 on 2023-11-16; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3

In a very specific situation, the clock line gets stuck low. In my case, I am trying to initialize an SHT40 sensor, but no sensor is present on the bus.

try:
    sht = adafruit_sht4x.SHT4x(i2c)
except:
    print("No SHT40 device detected")

This causes the code to crash next time I a...

manic glacierBOT
manic glacierBOT
#

Two problems are solved. I had already flashed another CircuitPython image to this board prior to trying this new build here. The old image was compiled for 8MB and I think the partition scheme was carried over and not overwritten. After now erasing the flash first and then flash the firmware.bin with the esptool it appeared right away as CIRCUITPY USB flash drive in Windows with a capacity of 13.6 MByte.

Don't know yet how to get into the UF2 boot mode where I could just...

#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.0 on 2024-01-27; uGame22 with rp2040

Code/REPL

>>> import bug
>>> bug.__file__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'module' object has no attribute '__file__'

Behavior

Make a directory bug and create a file __init__.py inside. When you import it, the imported module will have no __file__ defined.

Description

This is a regression. Previous...

manic glacierBOT
manic glacierBOT
short tendon
#

Interesting Note: on the ESP32S3 TFT, running 8.2.9 I got 3 open sockets before it raised an exception. On 9.0.0-beta.0 I got 4 (SSL to be specific)

manic glacierBOT
#

Adafruit: would be great to add a notice about this to the pages for affected boards! Took a lot of looking around to find the answer

We put warnings here: https://learn.adafruit.com/adafruit-feather-rp2040-pico/creating-and-editing-code (same page is mirrored to almost all the board guides, and there is more detail here: https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#macos-sonoma-14-dot-x-disk-errors-writing-to-circuitpy-3160304.

One trouble is that there are mul...

manic glacierBOT
celest marsh
#

Sending thanks to you all for having the majority of the conversations you all have be so open and available, I know that it must be slower to do it that way but it sure makes for a good community.

midnight ember
#

Is Liz hosting tomorrow? Unsure if Scott is hosting where to put my status update above or below in the doc.

#

Usually I'm the first one during the week to write in the doc so I don't have this dilemma. 😅

manic glacierBOT
#

This adds optional device specific stubs for the board module. This is built upon the work of @justmobilize from this stub generator script: https://gist.github.com/justmobilize/1a29481069a7dcf121d0fcc0d91a3121

They get generated by make stubs and included inside of the stubs under a new directory board_definitions/

Nothing changes by default so users who just pip install circuitpython-stubs and don't do anything else will see the exact same things they see today in IDE Hints an...

tame creek
#

so eventually i'll probably try to track down the RP2040 hard fault with a debugger, possibly with Pico SDK (because it's starting to look like the bug is there, or in the TinyUSB driver). still need an RP2040 board with accessible SWD lines. let me see if there's anything else i'm likely to want to order at the moment to piggyback on

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.0 on 2024-01-27; ESP32-S3-EYE with ESP32S3

Code/REPL

import board
import espcamera


cam = espcamera.Camera(
    data_pins=board.CAMERA_DATA,
    external_clock_pin=board.CAMERA_XCLK,
    pixel_clock_pin=board.CAMERA_PCLK,
    vsync_pin=board.CAMERA_VSYNC,
    href_pin=board.CAMERA_HREF,
    pixel_format=espcamera.PixelFormat.JPEG,
    frame_size=espcamera.FrameSize.SVGA,
    i2c=board.I2C(...
manic glacierBOT
manic glacierBOT
#

With the Pico SDK, using a blink example modified to enable CDC for stdio, though not outputting anything to it, connecting and disconnecting from the CDC serial port a few times using tio freezes the program and makes CDC unresponsive.

This is very interesting. Pinging @hathach on this: this problem appears specific to macOS. This could be an issued opened either on https://github.com/hathach or https://github.com/raspberrypi/pico-sdk. @hathach would you prefer one repo or the other.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

The 8 parallel lines connecting to the display really speed up the graphic output. A simple 1000x "Hello world" gets around 5x faster:

import board, displayio, time
board.DISPLAY.root_group = displayio.CIRCUITPYTHON_TERMINAL
start = time.monotonic()
for i in range(1000):
    print("Hello world!", end=" ")
print(f"\nThis took {time.monotonic() - start} seconds.")

New 1.89 seconds versus 10.3 seconds. Without rendering to the build-in display (serial) its 1.27 seconds. L...

manic glacierBOT
manic glacierBOT
#

I'm not sure what's up with the pre-commit failure. It passes for me locally on this branch. In the actions log it looks like it found a handful of formatting changes it wants to make, but none of them appear to be in files that this PR touches as far as I can tell.

I re-tested this version on the Matrix portal s3. I also ran the test code (with uncommented section for display) on a Feather TFT S3.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.0 on 2024-01-27; ESP32-S3-DevKitC-1-N8R8 with ESP32S3

Code/REPL

# Crashes:
import board, busio
serial = busio.UART(board.IO15, board.IO18, baudrate=115200)
serial.write(b'1234567890')

# Works:
import board, busio
serial = busio.UART(board.IO15, board.IO18, baudrate=115200)
serial.write(b'1234567890')

Behavior

>>> import board, busio
>>> serial = busio.UART(board.IO15, board.IO...
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.0 on 2024-01-27; Adafruit Feather RP2040 USB Host with rp2040

Code/REPL

https://github.com/adafruit/circuitpython/blob/main/tests/circuitpython-manual/usb/basic_keyboard.py

import array
import usb.core
import sys

# This is a WASD Code Keyboard with a generic controller in it.
USB_VID = 0x258a
USB_PID = 0x1
# This is ordered by bit position.
MODIFIERS = []

device = usb.core.find(idVendor=...
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.0 on 2024-01-27; Adafruit Feather RP2040 USB Host with rp2040

Code/REPL

print("hello")

Behavior

I've tested various states of powering on the microcontroller with and without the USB Keyboard plugged in to the host port and found that if the microcontroller powers up with the keyboard plugged in, the keyboard will not work until it has been unplugged and re-plugged.

I tested the following...

manic glacierBOT
candid sun
slender iron
lone axle
ember iris
#

the use of the with statement does help a lot of traditional python programmers transitioning into circuit python. It has helped me explain a few concepts of what a micro can and can't do, but that's a different group

crimson ferry
#

probably worth an audit, hard to know how much extrnal code will break ; definitely need context managers on files, sockets, and other core-core stuff

ember iris
#

that sounds prudent 👍

short tendon
#

@slender iron if you let me know the branch for SSL changes, I can try to build and see if it's any different

solar whale
#

Things like uart would still allow it?

lone axle
#

Thanks for hosting Liz! Hope everyone has a great week 🎉

ember iris
#

Thanks all! Have a great week!

slender iron
solar whale
#

ah -- I can adapt 😉

#

It's only software!

short tendon
ember iris
#

I do really like the context manager because it's design pattern is something that's native to python, so I've found it helpful when explaining how to manage resources on a micro--if someone see's it in a with statement, it makes sense that the statement handles opening and closing of the resource. That said, the demographic I normally engage with is python programmers who have little to no electronics experience, and I can see that making up a fraction of a fraction of the userbase

lone axle
# short tendon <@252717193496756235> if you let me know the branch for SSL changes, I can try t...

fwiw on PRs there are also "artifacts" that get built and uploaded to github. You have to navigate the actions section to find them as their a bit buried. But they can be downloaded and used from there without needing to build if you're specifically trying to build a PR branch. For that PR they're here: https://github.com/adafruit/circuitpython/actions/runs/7732060051 if you scroll down on the right half of the page to the artifacts section then find the device you want in the list.

short tendon
#

I think having it on large resourses (responses) and things you spicifically want to close after (sockets) makes the most sense if you want to limit it

lone axle
#

(note that the thing at the top of the right column prevents normal mouse scrolling because it's some kind of canvas drag n drop thing. But once you scroll past it by moving mouse outside then the page scrolls like normal.)

short tendon
#

Nice! I'll still try to build it, but will test with that one!

#

Still just got 4. Might try out a few other boards to do some comparisons

manic glacierBOT
#

Is that really true? Why do you need to have a unique VID:PID? Why can't you instead have a standard VID:PID for a particular piece of silicon and identify the board through the Product ID?

Host OSes (like Windows) may cache the USB information based on the VID:PID combination. For Adafruit boards we usually do one PID per board x software combination to ensure that caching isn't triggered.

manic glacierBOT
#

Don't know yet how to get into the UF2 boot mode where I could just drop a new firmware.uf2 in to uf2-drive and get an updated firmware, but this might be an ESP32-S3 specific problem. It always worked with rp2040 boards and generally everything offered by Adafruit .

On ESP you need to install UF2 separately. The RP2040 has it in ROM and adafruit boards usually have it factory installed.

The other T-Display boards with ESP32 and rp2040 also have two buttons, and we agreed on a...

candid sun
#

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/1vjpP9hQ4GBs0NdMWnkvaJG_9DMT7LGeDYivrRXcfbl4/edit

manic glacierBOT
short tendon
#

Question for the ConnectionManager.

I know you all have a ton to do, and for me when I have too many places to look it's hard to prioritize.

Would you taking ownership of the repo so it's in the Adafruit domain make it easier to see? I can easily fork and recreate the pull requests.

slender iron
short tendon
#

Nope

manic glacierBOT
slender iron
short tendon
#

Hmmmm. I get You don’t have the permission to create public repositories on adafruit, is there a different way?

#

You could also just cookie-cutter it since that's all there is on main and then I can fork from there...

slender iron
slender iron
#

got it

short tendon
#

Yay!

manic glacierBOT
#

I have been working on an iterable version of the MP/CP deque for my own application and in researching this, it looks like the lack of iteration has come up numerous times over the years. I believe this Issue in the MP repo covers it the best: https://github.com/micropython/micropython/issues/4776.

Long story short(er), the MP folks seem to have punted on a performant native C implementation of deque that is iterable and are suggesting folks that need/want deque iteration can use an i...

manic glacierBOT
#

I have also encounter issue with ESP32S3 streaming with Arduino, somehow host does not issue any IN token to the bulk streaming endpoint. The example https://github.com/adafruit/Adafruit_TinyUSB_Arduino/tree/master/examples/Video/video_capture work with other ports (samd/nrf/rp2040).

However the stock video_capture example from tinyusb repo does work with esp32s3 https://github.com/hathach/tinyusb/tree/master/examples/device/video_capture . Hopefully it is probably some configuration/setup...

manic glacierBOT
slender iron
#

I’ll be off and on today

short tendon
#

@slender iron for whenever you are around: should I fork ConnectionManager and redo the PR (and close the other one)?

manic glacierBOT
main furnace
#

Hugs for jepler for adding "repl.py". It rocks!

short tendon
#

@candid sun since you mentioned interest in my TimeHelper class, I threw together a quick GIST of my class I'm using. Would love any thoughts if you take time to look.

candid sun
lone sandalBOT
manic glacierBOT
manic glacierBOT
#

Yes, it looks like these are supposed to be inclusive lower-bound, exclusive upper bound "like python slices":

//|     :param int x1: The left corner of the area to blit into (inclusive)    
//|     :param int y1: The top corner of the area to blit into (inclusive)  
//|     :param int x2: The right of the area to blit into (exclusive)   
//|     :param int y2: The bottom corner of the area to blit into (exclusive)

which even more makes the [0:0] blit make sense, it's an empty ...

#

Just for completeness, using GPIO15 does seem to operate fine too:

<details>
<summary>code</summary>

import time, board, busio

serial1 = busio.UART(board.IO15, board.IO18, baudrate=921600)
serial2 = busio.UART(board.IO16, board.IO17, baudrate=921600)
while True:
    serial1.write(b'1234567890')
    print(f'serial 2 read: {serial2.read(10)}')
    serial2.write(b'1234567890')
    print(f'serial 1 read: {serial1.read(10)}')
    time.sleep(1)

</details>

<details>
...

slender iron
#

you can fork for further changes

manic glacierBOT
short tendon
#

so fork and make changes to the branch that has an open PR?

#

It will also only take 30 seconds to re-open it

slender iron
manic glacierBOT
short tendon
manic glacierBOT
#

@tannewt, if I am successful in creating an iterable C implementation of deque (based on the existing MP deque code), I was originally planning on offering it for incorporation into CP. In light of your statement above that you are trying to get the CP copy of the VM to match MP, would your preference be for me to try getting it added to MP instead?

Please make a PR to MP with it first. If they don't respond quickly, then we can do it to CP directly. We can also merge it into CP after MP...

manic glacierBOT
manic glacierBOT
#

CircuitPython version

master

Code/REPL

import wifi
wifi.radio.connect("wpa2wifiname")

Behavior

Traceback (most recent call last):
File "", line 1, in
ConnectionError: Unknown failure 15

Description

Network is WPA2, code is trying to connect to it as if it's an open network.

Additional information

This is just a visual issue. A value must just be mapped to that error, saying that authmode is wrong.

manic glacierBOT
#

Tested:
Adafruit CircuitPython 8.2.8 on 2023-11-16; Adafruit Feather RP2040 with rp2040
with

serial = busio.UART(board.TX, board.RX, baudrate=921600)

connected to:

Adafruit CircuitPython 9.0.0-beta.0 on 2024-01-27; ESP32-S3-DevKitC-1-N8R8 with ESP32S3
with

serial = busio.UART(board.IO15, board.IO18, baudrate=921600)

Each transmitting then receiving. All bytes arrive in order on both sides.

short tendon
#

@lone axle so excited to see the stubs in there! Can't wait for the next beta release

manic glacierBOT
manic glacierBOT
manic glacierBOT
short tendon
manic glacierBOT
#

Everything works as it should using a different board (completely different design), but still using a S3 N16R8.

Works OK:
Adafruit CircuitPython 8.2.9 on 2023-12-06; VCC-GND YD-ESP32-S3 (N16R8) with ESP32S3

Works OK:
Adafruit CircuitPython 9.0.0-beta.0 on 2024-01-27; VCC-GND YD-ESP32-S3 (N16R8) with ESP32S3

Removing the RS485 transceiver from the original board - so there is nothing externally connected to IO15, it still does not work - the only thing I can think of is that ther...

manic glacierBOT
hollow gazelle
#

hopefully a quick question -
I clicked on https://circuitpython.org/board/feather_m7_1011/
and it has a picture of some Feather boards, but the product link goes to a different shaped board

maybe there is a new feather M7 product in the works - but it is confusing to have a link go to another product

The NXP iMX RT1011 microcontroller powers this board with a 500 MHz ARM Cortex M7 processor. There’s 4 MB of execute-in-place QSPI for firmware and disk storage plus 128 KB of SRAM in-chip.Technical details NXP iMX RT1011 processor - ARM Cortex M7 processor running at 500 MHz, with 128 KB SRAM a...

slender iron
manic glacierBOT
#

Monday, January 22, 2024. 1h38 PM GMT

Board: Adafruit Feather ESP32-S2 TFT Flashed with: Adafruit CircuitPython 9.0.0-alpha.6-29-g5f318c37bb on 2024-01-19; Adafruit Feather ESP32-S2 TFT with ESP32S2

IDE: Mu 1.2.0

The REPL output below shows that the board, connected to the in house WiFi, receives the UPD multicast data packets that X-Plane 12 was set for to transmit.

a) REPL output of manual test to see which attributes socketpool.SocketPool has now (with the lat...

plucky tulip
#

EDIT: Already merged

May I ask any of the CircuitPython developers to take a look at latest adafruit_httpserver PR, current release has a serious flaw which prevents usage.
The faster the fix is merged the fewer people will download the non-working version.
https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer/pull/80

GitHub

Continuation of #79
🪛Fixes:

Server.start() raised AttributeError on CircuitPython (#79 (comment))

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I am so sorry, yes the repo was labled private. I don't understand it because I use Github for Desktop (MS Windows 11) PC, created the repo and clicked to publicize it.
Try again please

Enviado do Outlookhttp://aka.ms/weboutlook


De: Zenz @.>
Enviado: 7 de fevereiro de 2024 13:24
Para: adafruit/circuitpython @.
>
Cc: Paulus H.J. Schulinck @.>; Mention @.>
Assunto: Re: [adafruit/circuitpython] CPY core module ...

manic glacierBOT
manic glacierBOT
#

I'm trying this out:

<details>
<summary>code.py</summary>

import os
import asyncio
import traceback
import wifi
import socketpool
import time
import traceback

# choose your own multicast group adventure
GROUPS = (("239.255.255.250", 1900), ("224.0.0.251", 5353), ("239.255.1.1", 138))
MAXBUF = 256
TIMEOUT = 0  # non-blocking

async def udpserver(group):
    with pool.socket(pool.AF_INET, pool.SOCK_DGRAM, pool.IP_MULTICAST_TTL) as s:
        s.bind((group[0], group...
#

Years ago when I started the project, it used MULTICAST_GROUP and MULTICAST PORT. Then my SBC (Raspberry Pi or equivalent) and later microcontrollers, wered connected to the desktop PC running X-Plane (10 it was) via USB-cable and a USB-to-Serial converter. Now, XPlane-12 offers this transmission to an IP-address. I use this now because the ESP32-S2 TFT can now run the application using WiFi and only be powered from a battery.

candid sun
manic glacierBOT
#

Thanks for your efforts.
I tested the current build after the commit and can confirm that the test code above works.
Unfortunately, my full code with display and all still crashes on the S2, and works fine on the S3 (alpha5). When running the first time it gets as far as the MQTT connection and fails to connect. After a soft reset it crashes in the same place as before, during the first get request (espidf.MemoryError).

manic glacierBOT
#

Sure,...

<details>
<summary>ESP32-S3</summary>

import time, board, busio

serial = busio.UART(board.IO15, board.IO18, baudrate=9600)
while True:
    print(f'serial wrote: {serial.write(b'1234567890')} bytes')
    time.sleep(1)
    print(f'serial read:  {serial.read(10)}')
    time.sleep(1)

</details>

<details>
<summary>RP2040</summary>

import time, board, busio

serial = busio.UART(board.TX, board.RX, baudrate=9600)
while True:
    print(f'serial w...
devout jolt
#

Would it be reasonable to let fourwire.Fourwire allow for optional cs_pin?
Many times when using little TFT displays, I don't need or want to run a CS line. I'm devoting the SPI to the display, I tie the CS line to ground at the display, yet I need to use a cs_pin (I'll sometimes just stick it into an onboard LED if I'm not using that)

manic glacierBOT
#

Rediagnosis of #8887:

When a busio.UART() device is first created on an ESP32-S3, a stray byte of some number of consecutive 1's may be read put into the input buffer. I saw this on both 8.2.9 and 9.0.0-beta.0, so it's not ESP-IDF version-dependent.

Adafruit CircuitPython 9.0.0-beta.0 on 2024-01-27; Adafruit QT Py ESP32-S3 no psram with ESP32S3
>>> import board
>>> board.UART().read()
b'\xc0'

The byte read may be b\x80 (seen at 9600 baud), or c0 or e0.

I see th...

slender iron
#

@tulip sleet I'm digging into why test-stubs.sh is only failing once when the message says it should fail twice. It looks like the two string type names in WriteableBuffer are preventing the test from erroring when passing in a bytes object

tulip sleet
#

I don't really know anything about mypy

#

so if you comment them out, it works?

slender iron
#

I agree. I don't know why it breaks. I just removed them and they work

#

there aren't any warnings about them

tulip sleet
#

but then that will break some library typechecking maybe

slender iron
#
circuitpython_typing/http.py:16: error: Skipping analyzing "adafruit_requests": module is installed, but missing library stubs or py.typed marker  [import-untyped]
circuitpython_typing/device_drivers.py:12: error: Skipping analyzing "adafruit_bus_device.i2c_device": module is installed, but missing library stubs or py.typed marker  [import-untyped]
circuitpython_typing/device_drivers.py:12: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
circuitpython_typing/__init__.py:39: error: Name "rgbmatrix" is not defined  [name-defined]
circuitpython_typing/__init__.py:40: error: Name "ulab" is not defined  [name-defined]
circuitpython_typing/__init__.py:48: error: Name "rgbmatrix" is not defined  [name-defined]
circuitpython_typing/__init__.py:49: error: Name "ulab" is not defined  [name-defined]
circuitpython_typing/__init__.py:131: error: Name "audiocore" is not defined  [name-defined]
circuitpython_typing/__init__.py:132: error: Name "audiocore" is not defined  [name-defined]
circuitpython_typing/__init__.py:133: error: Name "audiomixer" is not defined  [name-defined]
circuitpython_typing/__init__.py:134: error: Name "audiomp3" is not defined  [name-defined]
circuitpython_typing/__init__.py:135: error: Name "synthio" is not defined  [name-defined]
circuitpython_typing/__init__.py:141: error: Name "rgbmatrix" is not defined  [name-defined]
circuitpython_typing/__init__.py:144: error: Name "alarm" is not defined  [name-defined]
circuitpython_typing/socket.py:129: error: Name "_FakeSSLContext" is not defined  [name-defined]
Found 14 errors in 4 files (checked 8 source files)```
slender iron
#

maybe @short tendon understands python typing

manic glacierBOT
#

mypy -c 'import busio; b: busio.I2C; b.readfrom_into(0x30, b"")'

Is supposed to fail because readfrom_into() needs to write into the buffer but is given a byte string. However, it doesn't. WriteableBuffer includes two string types that break the whole thing. If you remove them, then the test will fail.

Running mypy on the typing module gives a clue in how it fails:

mypy circuitpython_typing
circuitpython_typing/http.py:16: error: Skipping analyzing "adafruit_requests": module...
short tendon
slender iron
#

it has been around a while I think

short tendon
#

Okay. I'm happy to take a peek tomorrow

slender iron
manic glacierBOT
manic glacierBOT
#

@tannewt,

I was able to get this to pass by:

  1. Adding the following imports to circuitpython_typing/__init__.py:
import alarm
import audiocore
import audiomixer
import audiomp3
import rgbmatrix
import synthio
import ulab
from alarm.pin import PinAlarm
from alarm.time import TimeAlarm
from ulab.numpy import ndarray
  1. Adding the following imports to circuitpython_typing/socket.py:
from adafruit_requests import _FakeSSLContext

or

cla...
tulip sleet
#

@slender iron I have some "which modules on/off" for ESP32-S3 to discuss when you have time. User in forums noticed gifio was not on for ESP32-S3 TFT boards. There are some odd linkages between modules.

#

is off for space reasons

slender iron
#

Ok I’ll ping once I’m at my desk. Have a dermatology appointment this morning

#

Generally 4mb flash boards have less

tulip sleet
#

yup, i am seeing some better tradeffs, though, maybe

manic glacierBOT
#

Doesn't busio.SPI() require the clock, mosi and miso arguments? So this should be something like:
sd = sdcardio.SDCARD(busio.SPI(board.SCK,board.MOSI,board.MISO), board.SD_CS)

I tested this version of the code using a board that had board.SPI() defined and it gave a "ValueError: IO40 in use" (IO40 is the clock pin).

Perhaps both the busio and board lines should included in the example code with one of them commented out:

sd = sdcardio.SDCard(board.SPI(), board.SD_CS)
# ...
mortal kernel
#

Bluetooth LE question for Pico W: When setting an address of type BD_ADDR_TYPE_LE_RANDOM I am allowing the caller to set a random address or have a random address generated automatically. The cases are differentiated by the low-order 2 bits of the high-order byte of the caller provided address. If the bits indicate the address is locally administered/individual (L=1, G=0) the user provided address is used; otherwise, a random address that is locally administered/individual is generated and used.
This "feels" right, although I cannot locate a passage in the BT specs that says it is. Any opinions?

tulip sleet
#

i thought the differentiation would be between a user-supplied address and a generated random address. Does the nRF _bleio handle this?

#

a user supplied address is not "random", I would think

mortal kernel
#
if (local_address[0] & 0x02) {
    // Set adapter to the caller-provided random address.
    gap_random_address_set_mode(GAP_RANDOM_ADDRESS_TYPE_STATIC);
    gap_random_address_set(local_address);
} else {
    // Set adapter to a randomly generated address.
    btstack_crypto_random_t request;
    volatile bool crypto_done = false;
    btstack_crypto_random_generate(&request, local_address,       NUM_BLEIO_ADDRESS_BYTES, &random_addr_ready, (void *)&crypto_done);
    // Synchronize with random address generation completion.
    while (!crypto_done) {
        RUN_BACKGROUND_TASKS;
    }
    // Set the L bit and clear the G bit (locally administered, individual address)
    local_address[0] = (local_address[0] | 0x02) & 0xFE;
    gap_random_address_set_mode(GAP_RANDOM_ADDRESS_TYPE_STATIC);
    gap_random_address_set(local_address);
}
tulip sleet
#

that's your code or current nrf code?

mortal kernel
#

I don't think random means what you're thinking in this context.

#

My code.

tulip sleet
#

random means "not fixed", i guess

#

it's been a few years since I wrote that code

mortal kernel
#

Right, arbitrary. It looks like the SD does the work for nRF, common_hal_bleio_adapter_set_address() , all CP does is pass the user provided type and address to sd_ble_gap_addr_set().

#

What happens from there is opaque and not documented.

tulip sleet
#

yes, just looking at that

#

but I don't remember anything about fiddling with those bits to get it to do something else

#

Are you adding a capability that the nRF impl doesn't have?

mortal kernel
#

Yes. I'm concerned about presenting a valid address given its type.

tulip sleet
#

does the CYW43 generate a random address on demand?

#

a non-fixed random address

mortal kernel
#

Not really. It's crypto unit can generate random bytes.

#

In this case I ask it for six bytes.

#

The Nordic doc is interesting. Are there rules coming from the BT spec or are they Nordic's own?

tulip sleet
#

I would say that you don't need to do this. It's up to the user. In the nRF world, you can use sd_ble_gap_privacy_set(), which will use a dynamic random address that is refreshed at a specified internval

#

is there something like that in the CYW API?

mortal kernel
#

No. The Nordic SD seems to be half a driver on top of the hardware.

tulip sleet
#

ok, looked more ... we have an anonymous flag in start_advertising(), that will turn on privacy to use a changing really random address. If CYW doesn't have something like sd_ble_gap_privacy_set(), then that needs to be coded explicitly. But I'd check whether there's a CYW advertising parameter that does that, maybe

#

don't make Adapter.set_address() do something tricky. If you want to reject an address with the wrong bits set, that's fine. CYW may do that. I don't know whether nRF SD checks the validity of those bits .... I'll look

mortal kernel
#

BTW, your CP code for nRF code looks really good.

tulip sleet
#

sd_ble_gap_set_addr() checks the top two bits and will complain with BLE_ERROR_GAP_INVALID_BLE_ADDR

#

thanks, it was inspired by our earlier Arduino BLE code, which was done by some real BLE experts. It took me a long time to wrap my head around BLE, which I feel is not great at clean layering of abstractions

mortal kernel
#

Good, I'll enforce nRF rules for the high-order address byte.

tulip sleet
#

the CYW equivalent of set-address may do that check too?

mortal kernel
#

So, to summarize: Enforce nRF rules for high-order address byte in common_hal_bleio_adapter_set_address. Also, prohibit setting private address here, private addresses may only be set in start_advertising.

tulip sleet
mortal kernel
#

Still, I remain mystified by the high-order address byte.

tulip sleet
#

it points to somewhere in the BT spec (probably obsolete chapter number, etc.)

mortal kernel
#

Yes! That is the reference I've been seeking. Huzzah!

short tendon
#

@slender iron 2 things:

  1. have some branches up and comments for the typing test bug
  2. also have a question on the ConnectionManager PR about some code that really isn't right (pulled from requests) and trying to see what should be done
mortal kernel
#

(I'd been extrapolating from IEEE 802-2001, which is how I wound up where I was.)

tulip sleet
#

i did see that mentioned in a less useful search result

mortal kernel
#

As always, our chat has been informative and helpful. Thank you, Dan!

tulip sleet
manic glacierBOT
tidal kiln
#

is there anyway to skip the 1 second safe mode blinks?

On start up, the LED will blink YELLOW multiple times for 1 second.

for faster boot

stuck elbow
#

yes, there is a compile time option

tidal kiln
#

anything more for end users? like something in boot.py?

stuck elbow
#

nope

slender iron
slender iron
tulip sleet
tidal kiln
manic glacierBOT
slender iron
#

that's how the double tap works

tidal kiln
#

yep, but PWMing in CP is much easier. so if there had been any way to reduce that delay, could've been useful for them.

onyx hinge
#

"posix" port advances. All "basics" tests now pass locally. ```jepler@bert:~/src/circuitpython/ports/posix$ make test TEST_ARGS="-d basics"
[...]
523 tests performed (16408 individual testcases)
523 tests passed
17 tests skipped: array_micropython builtin_next_arg2 builtin_range_binop class_delattr_setattr class_inplace_op2 class_notimpl fun_globals fun_name generator_name io_buffered_writer io_iobase memoryview_itemsize memoryview_slice_size namedtuple_asdict nanbox_smallint sys_getsizeof sys_tracebacklimit

#

overall 72 tests failed, 181 tests skipped.

empty salmon
#

Something has definitely changed WRT CircuitPython and integrated, on-board, ePaper displays - e.g. board.DISPLAY.
I have run several tests and I no longer get runtime error output on the display.
I assume this new behavior is intentional (and if so, thanks 😉)

manic glacierBOT
tulip sleet
#

@slender iron ok, free now, if you are

slender iron
idle owl
#

Is there a place to put a demo that is specific to a particular board, but not a particular library?

onyx hinge
#

@idle owl good question. I don't think we have anywhere. There's the git repo for learn, of course, when it's related to a learn guide but I assume that's not at all your goal.

It's easy to share random files as github gists or create a repo under your own git user. I kinda like gists because of how they can be embedded on a blog entry with just a couple lines of javascript.

#

embedding code: <script src="https://gist.github.com/jepler/ff55a475e9c90c8b1b7f00707799565c.js"></script>

idle owl
orchid basinBOT
#

The reason that is happening is because if you type feather tft, it will search for the exact string in board names, manufacturers, titles, and keywords. The keywords section was added as a way to combat this problem, but it's not thorough. The only reason the reverse one was showing up was because it had some alternate spellings in the keywords sections.

There's a couple of possible fixes:

  1. Somebody would need to go through about 500 board files and add variations they think might wo...
short tendon
onyx hinge
#

@short tendon not asking you to change that PR -- you're clearly making a minimum change relative to what was previously there -- but just for your awareness: https://docs.python.org/3/library/importlib.resources.html#importlib.resources.files might be a less finicky way to access .pyi files that are bundled as part of a package. It's in 3.9 and newer (which is in debian oldstable stable and ubuntu LTS 22.04, so even the chronically slow updaters are well covered)

In the unlikely event support for python 3.8 is desired (EOL not until this october) there's https://docs.python.org/3/library/importlib.resources.html#importlib.resources.read_binary but this has been deprecated in 3.11.

short tendon
short tendon
#

yeah that makes sense. What version would you support? Since this is for the common circuit python developer, I could see them having a pretty old verion of Python installed...

mortal kernel
#

A thought to file away: The Pico W's CYW43439 has a cryptographic unit that may be useful for other CP purposes like TLS handshake.

orchid basinBOT
#

This turns the search function into more of a 'fuzzy search': The search is expected to be a series of space-separated terms, but the terms can appear in any order, can be just part of a word (e.g., "uefr" would match "bluefruit") and with other terms between them.

So for instance after this change both "tft feather" or "feather tft" will show the Feather ESP32-S3 TFT PSRAM (as well as 3 other feather boards)

Closes #1321

short tendon
#

@onyx hinge I like that much better:

from importlib import resources
import os
import sys
import shutil


def set_board():
    if len(sys.argv) != 2:
        print(f"Incorrect args. Please call with: 'circuitpython_setboard chosen_board'")
    return
    
    chosen_board = sys.argv[1]
    print(f"setting board: {chosen_board}")
    
    board_stubs_file = resources.files('board-stubs').joinpath("__init__.pyi")
    board_definitions_path = resources.files('board_definitions').joinpath(chosen_board)
    board_definitions_file = board_definitions_path.joinpath("__init__.pyi")
    
    if not board_definitions_file.is_file():
        print(f"Board: '{chosen_board}' was not found")
        return

    shutil.copyfile(board_definitions_file, board_stubs_file)

Would you recommend this method or supporting 3.8?

onyx hinge
short tendon
#

Does that look good to you?

#

If so I'll update the PR

orchid basinBOT
onyx hinge
short tendon
#

It's working for me. And I know FoamyGuy knows how to test

manic glacierBOT
manic glacierBOT
#

I'd prefer to keep this example simpler by using board.SPI() or busio.SPI() but not both. The simplest change would be to remove the busio import and only rely on board.SPI().

True, it's indeed a bit messy to have both. I'm okay with reverting back to the original documentation, but how will we notify users that they could need busio.SPI() instead? The reason I put up this PR in the first place is because one of my students ran the example code from the docs and got an error the `b...

#

@SiboVG, no need to apologize :grin:

If we want to keep the example as simple as possible, I agree that it's more likely someone would be wanting an SD mount example for a board with a built in SD card and the board.SPI is probably the best choice.

I think you could take the view that embedded example code like this should be considered a starting point or hint at what's needed and hopefully gives you enough information to figure out (via google, discord, forums, etc) a solution for you...

manic glacierBOT
short tendon
#

@slender iron do you have enough info to know of the 4 exceptions currently tracked in the get_socket in requests, which should be retryable? I assume the memory error is, after we release any no longer used sockets. But what of the other 3?

slender iron
#

I don't know. I'd go based on what minimqtt does

short tendon
#

K. Will dig in

slender iron
short tendon
slender iron
#

I suspect it is brent

short tendon
#

Ah, that would make sense, since he pinged me on my last change in requests...

slender iron
#

I'd suggest checking the minimqtt commit history

short tendon
#

Most of the top commiters aren't Adafruit...

#

But brentru created it.

slender iron
#

I usually look at the earliest commits

#

there is a lot of automated tooling and updating that happens as well

short tendon
#

Is brentru on GitHub the same Brent you were thinking?

manic glacierBOT
#

@tannewt, 2 questions:

1. Where would you like `_FakeSSLContext` imported from in `circuitpython_typing/socket.py`? We can either:
   
   * Do `adafruit_requests` now and if/when `adafruit_connection_manager` is merged, update it (before we remove it from requests)
   * Wait for `adafruit_connection_manager`

2. Looking at the change for [synthio](https://github.com/adafruit/circuitpython/compare/main...justmobilize:circuitpython:typing-fixes?expand...
desert gust
#

how functional is the usb_host for CircuitPython 9.0.0-beta.0 on the Feather RP2040 with USB Type A Host? and can the usb host be able to send serial commands to a marlen 3d printer usb controll port?

slender iron
#

I don't think we have a host cdc library yet

desert gust
#

because there is usb_cdc for both CircuitPython 8.2.9 and CircuitPython 9.0.0-beta.0 built-in to the circuitPython uf2 installer

short tendon
manic glacierBOT
#

I'm trying this out:

code.py

import os
import asyncio
import traceback
import wifi
import socketpool
import time
import traceback

# choose your own multicast group adventure
GROUPS = (("239.255.255.250", 1900), ("224.0.0.251", 5353), ("239.255.1.1", 138))
MAXBUF = 256
TIMEOUT = 0  # non-blocking

async def udpserver(group):
    with pool.socket(pool.AF_INET, pool.SOCK_DGRAM, pool.IP_MULTICAST_TTL) as s:
        s.bind((gro...
tulip sleet
#

CDC is USB serial (like COM ports, /dev/ttyACM0, etc)

desert gust
tulip sleet
#

if it uses USB serial, yes, but, again, we don't have USB CDC host code yet

desert gust
#

than what is this?

manic glacierBOT
tulip sleet
# desert gust than what is this?

That is for acting as a USB device, not a USB host. If your printer is a USB device, then those don't help to talk to it. e.g. usb_cdc is for plugging a CircuitPython device into a host computer (Windows, Mac, Linux, etc.) and talking to the host over its serial ports.

desert gust
#

dose cdc sand for "com device connetion"?

slender iron
# desert gust what is cdc

cdc is how serial is done over usb. (it's an old modem protocol.) usb_cdc is for device mode. not host

slender iron
manic glacierBOT
manic glacierBOT
short tendon
#

Hello @prime flower, I had a quick question on MiniMQTT I was hoping you could answer.

In ._get_connect_socket during sock.connect if it raises a OSError, it sets backoff = True and then delays the next try.

Do you know why? I'm working on the new ConnectionManager and trying to make a unified method for getting sockets and between Requests and MiniMQTT this is the outlier...

desert gust
#

@slender iron but dose cdc sand for "com device connection"?

prime flower
short tendon
#

And another question, what reason does socket.connect((host, port)) raise an OSError?

prime flower
short tendon
prime flower
short tendon
manic glacierBOT
manic glacierBOT
#

@tannewt OMG. Realizing that circuitpython_typing/socket.py exists, means that we don't need that defined in ConnectionManager code at all. And that kills a whole kb of the mpy. Technically we could also remove it from Requests now...

If we actually add a _FakeSSLContext definition in circuitpython_typing/socket.py, we can fix this bug now and remove all that typing code from ConnectionManager

#

Sorry I wasn't being clear, the iProduct field in the device descriptor defines the product string descriptor. You could use a single VID/PID descriptor for a particular device, then use the product string descriptor to identify the specific board.

This is the way the ARM CMSIS-DAP works, it just needs "CMSIS-DAP" in the product string descriptor and OpenOCD will automatically detect the device.

short tendon
tulip sleet
short tendon
#

And no, it's only for type checking your development work...

prime flower
tulip sleet
short tendon
tulip sleet
#

we need to suppress building the .mpy's at all

short tendon
tulip sleet
#

i'm looking

stoic swallow
#

Is it possible to get adafruit_board_toolkit.circuitpython_serial.data_comports()[0].product (in this case, M4 express running CP 8 with data serial enabled) to return a custom string?

tulip sleet
stoic swallow
#

None

#

And my ignorant attempt at setting it in boot.py didn't work.

#

I'm not wedded to product but would like to otherwise identical uCs connected and having a programmatic way of telling them apart.

tulip sleet
#

if you don't enable the data comport it will not be there.

#

look at .interface instead

stoic swallow
#

Yes, and the adafruit_board_toolkit is getting me 90% of the way there. I have a modular robot project where each module is controlled by a uC. I would like a user-friendly way for the host to know what modules are connected.

manic glacierBOT
tulip sleet
#

the fact that data_comports returns a non-empty tuple at all means it's a CircuitPython device, because it's looking for "CircuitPython CDC2 ..."

#

in the .interface name

stoic swallow
#

Right, and if I have 2 M4 express uCs, both with data enabled, connected to host, I should get 2 entries in that tuple. Right now, the only way I can differentiate them is if I have a host-side database that ties something like .serial_number to the function of the device.

tulip sleet
#

aha, ok I thought this was CPy vs non-CPy boards

tulip sleet
stoic swallow
#

Thanks for the refs.

tulip sleet
stoic swallow
#

Definitely wasn't intending to make more work for you 🙂

tulip sleet
#

@short tendon I'm still looking at the workflow stuff too 🙂

short tendon
#

Thanks!

tulip sleet
short tendon
tulip sleet
#

oh sure!

short tendon
manic glacierBOT
ornate breach
#

I noticed that MicroPython has a zephyr port for zephyr compatible boards. Would that be a reasonable template to try circuitpython with zephyr?

slender iron
ornate breach
#

Something simple like an nRF52840

manic glacierBOT
#

Silicon Labs - Issues rebuilding the .bin file for the dev_kit_xg25_brd2601b. Followed the Adafruit guide and the SiLabs READ.md. Trying to build with Ubuntu Linux 22.04.2 (x86_64 emulation) on a Mac with the Parallels VM version 19.2.1. This is the entire build output from the ‘make BOARD=devkit_xg24_brd2601b’ cli command.

The guides have been followed exactly with a new clean VM.

The Adafruit guide has the 'make BOARD=circuitplayground_express' at the end of their documentation which ...

tulip sleet
ornate breach
ornate breach
#

Just a quick glance I understand that it’s going to be specific to zephyr supported boards, likely at this point being ones that fit the cross section of circuitpython and zephyr

ornate breach
meager fog
#

@lone axle hihi

#

let me know when yr around

lone axle
meager fog
#

@lone axle ok plz log into adafruit account, get cart with anything you want ready, adn go to the memtno page

#

ill relase one of our sekret stash

lone axle
meager fog
#

@lone axle GO GO GO

lone axle
meager fog
#

@lone axle ok i restashed 🙂

lone axle
#

checkout finished. Thank you!

meager fog
#

ok i tagged ya on github with the idea

manic glacierBOT
#

I was originally thinking that this was something to blanket change. However, after looking at examples, I see that the behavior as-is is useful if you are trying to sample a PWM signal that varies pulse length. You can set maxlen=2 and read pulse 0 continuously to see how it is varying.

So, you are right that this should be a new kwarg (maybe called pause_on_overflow) that adds in the auto-pause.

#

I am testing this on a MEMENTO board, and getting a slightly different error: espidf.IDFError: Requested resource not found which may be from a rework of error messages. Oddly, when I use the adafruit_pycamera library, it works, but the set-up appears similar. The library does a power-cycle and reset of the camera, but adding that to the test code above does not fix the problem. Still testing.

short tendon
#

@slender iron thank you for pinging me on that type issue with test-stubs.sh. That lead me down quite a handful of rabbit holes, but also helped me discover some other parts of the infra, which let me kill 933 bytes out of ConnectionManager AND remove all the types from the docs.

manic glacierBOT
#

espidf.IDFError: Requested resource not found is incorrect configuration. I think it's the i2c check that raises that.
Prolly an incorrect pin or something.

For me:

espcamera.Camera(
    data_pins=board.D,
    pixel_clock_pin=board.PCLK,
    vsync_pin=board.VSYNC,
    href_pin=board.HREF,
    i2c=board.SSCB_I2C(),
    external_clock_pin=board.XCLK,
    external_clock_frequency=20_000_000,
    powerdown_pin=None,
    reset_pin=board.RESET,
    pixel_format=vr("px"),
  ...
manic glacierBOT
#

Thank you for taking the torch as it were, I'm glad to have helped with a start.

Things that I got "stuck" on were:

  • Trying to get the "nonstandard" eink busy pin to work (required polling a shift register IIRC).
  • Trying to figure out PSRAM. Using this out of the box in CPY left almost no memory to do anything. Other libraries manually mapped the display to psram, and I wanted to take the time to come up with an "elegant" solution. perfect is always the enemy of good.
#

@jerryneedell If I power-cycle and reset the camera (I had a mistake in my testing script at first), first, then your example works on the MEMENTO:

import board
from digitalio import DigitalInOut
import time
import espcamera

cam_reset = DigitalInOut(board.CAMERA_RESET)
cam_pwdn = DigitalInOut(board.CAMERA_PWDN)
cam_reset.switch_to_output(False)
cam_pwdn.switch_to_output(True)
time.sleep(0.01)
cam_pwdn.switch_to_output(False)
time.sleep(0.01)
cam_reset.switch_to_output(Tru...
manic glacierBOT
short tendon
slender iron
short tendon
#

Quite welcome. In the end it was net positive for me.

#

I also feel I have a path forward on ConnetionManager for retries. Will be similar as I work through some PRs in other places first

modern star
#

Hello i just recently got a adafurit rp2040 for using it for my macros like opening up google and discord and ect.. but i am having trouble putting the code on there. There isnt good vids or guide to help do that i am using Mu to edit my code

manic glacierBOT
#

While not specifically related to esp32spi I was having difficulty getting sdcardio to share a bus. Came across this issue via google search. @jepler code did help. Was able to share SCK, MOSI, MISO with sdcardio and a SPI TFT. Each peripheral has its own CS pin. So can at least confirm the issue isn't the fault of sdcardio.

import sdcardio
import storage
from adafruit_display_text import label
from circuitpython_st7796s import ST7796S

displayio.release_displays()
# 4.0" ST...
manic glacierBOT
#

hmmm -- I tried your code on the EYE

10.0.0.16 | REPL | 9.0.0-beta.0-22-g58b1ce46f1 reload.
Adafruit CircuitPython 9.0.0-beta.0-22-g58b1ce46f1 on 2024-02-09; ESP32-S3-EYE with ESP32S3
>>> 
>>> import code_test
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "code_test.py", line 6, in <module>
AttributeError: 'module' object has no attribute 'CAMERA_RESET'
>>> 
mortal kernel
#

@danh or @slender iron Similar to cyw43-driver, I need an Adafruit fork of BTstack that I can use for patches awaiting incorporation upstream. The specific case I have with BTstack is a pair of missing function prototypes that prevent extended advertising from building.

willow totem
#

@prime flower / all - finally tracked down the page on pin config in UF2 files, that I saw in some MakeCode article, called Binary Bootloader-embedded Config (CF2):
https://github.com/Microsoft/uf2/blob/master/cf2.md
Basically adjust pin numbering/peripherals if same mcu without adjusting main code, just patch the uf2 CF2 section.
Also online patcher / example config https://microsoft.github.io/uf2/patcher/

GitHub

UF2 file format specification. Contribute to microsoft/uf2 development by creating an account on GitHub.

tulip sleet
lone sandalBOT
mortal kernel
lone sandalBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.0-23-g8af780c7fa-dirty on 2024-02-10; Adafruit Feather ESP32-S3 TFT with ESP32S3

(built from main with `CIRCUITPY_JPEGIO = 1`)

Code/REPL

from jpegio import JpegDecoder
from displayio import Bitmap

decoder = JpegDecoder()
width, height = decoder.open("/sd/example.jpg")
bitmap = Bitmap(width, height)
decoder.decode(bitmap)
# .. do something with bitmap

Behavior

This code is in the d...

tulip sleet
# mortal kernel `bluekitchen/btstack`

The licensing of btstack is a bit tricky. Raspberry Pi got a supplemental license for Pico W: https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/pico_btstack/LICENSE.RP. I It may be OK. But I think I will check with management about our forking of it before we do that. As I understand you are just getting around some compiler warnings or lack of protoype declarations? Could you add those by hand somewhere or turn off some warnings for certain source files?

manic glacierBOT
mortal kernel
# tulip sleet The licensing of btstack is a bit tricky. Raspberry Pi got a supplemental licens...

I'll see what I can do. Jamming the prototypes into my btstack_config.h will be the easiest. The affected module hci.c is several thousand lines of code, so I hesitate to disable warnings. The functions in question should be static, the prototypes are only needed since they're not. The licensing of BTstack has worried me, too. Perhaps we should think about finding an alternative protocol stack?

#

Also, I'll likely find more breakage in BTstack as I progress.

manic glacierBOT
#

Just a brief update. I created a custom build of the adafruit_feather_esp32s3_4mbflash_2mbpsram to add esp camera. I used the same mpconfigboard.mk settings as the memento

USB_VID = 0x239A
USB_PID = 0x811C
USB_PRODUCT = "Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM"
USB_MANUFACTURER = "Adafruit"

IDF_TARGET = esp32s3

CIRCUITPY_ESP_FLASH_SIZE = 4MB
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 80m

CIRCUITPY_ESP_PSRAM_SIZE = 2MB
CIRCUITPY_ESP_PSRAM_MODE = qio
...
manic glacierBOT
#

Uhh on Firebeetle 2 ESP32-S3 I have an OV2640.

>>> import board
>>> from AXP313A import *
>>> i2c = board.I2C()
>>> a = AXP313A(i2c)
>>> enable_camera(a, camera_voltages.OV2640)
True
>>> import espcamera
>>> b = espcamera.Camera(data_pins=board.CAM_DATA, pixel_clock_pin=board.CAM_PCLK, vsync_pin=board.CAM_VSYNC, href_pin=board.CAM_HREF, external_clock_pin=board.CAM_XCLK, external_clock_frequency=20_000_000,
... powerdown_pin=None, reset_pin=None, i2c=i2c, pixel_format=espc...
#

I tried the Testing self-signed certificates and load_verify_locations instructions on an ESP32 S2 mini clone (identified as an ESP32 S2 feather chip) running adafruit-circuitpython-adafruit_feather_esp32s2-sv-8.2.9.uf2 and it works.

To use it with your own host name, replace the host name with your own when you retrieve the certificate file:
openssl s_client -servername <your host name here> -connect <your host name here again>:443 < /dev/null | openssl x509 > self-signed.pem

Just a...

mortal kernel
#
// The following prototypes work around missing prototypes in btstack/src/hci.c:
#include <stdint.h>
uint8_t hci_le_extended_advertising_operation_for_chunk(uint16_t pos, uint16_t len);
void le_handle_extended_advertisement_report(uint8_t *packet, uint16_t size);
manic glacierBOT
#

While working on some experimental code ("posix port") I found some bugs & build problems.

The added includes are to get structure definitions and/or function prototypes for things that are included indirectly only when certain other features are enabled, which is why the problems weren't seen before.

The removed includes are for stuff not yet implemented on the POSIX port, where the include was apparently copied as boilerplate and is not actually needed.

manic glacierBOT
manic glacierBOT
#

AHA!! -- OV2640 support is not enabled for the esp32s3_eye!
adding it

#
# Espressif IoT Development Framework Configuration
#
#
# Component config
#
#
# LWIP
#
CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3-eye"
CONFIG_OV2640_SUPPORT=y
# end of LWIP

# end of Component config

# end of Espressif IoT Development Framework Configuration

and I can now use the camera!!!
Now to figure out the AIO issues adafruit_requests is running out of retries but the camera is hap...

#

@jerryneedell would you like to submit a PR for this? If the other camera is turned on by default, it could be turned off
What do yo mean by "other camera"?
It's been along tine since did a "core" PR, but it will be a good exercise! First I should to try some other code to make sure the camera is fully functional. I'm still not sure why my example using AIO is not working on this board so I also want to delve into that.

#

Possible 🎉!

macOS Sonoma 14.4 Beta 2 (23E5191e) was released a few days ago

Cautiously optimistic. I updated overnight, logged back in this morning and so far I'm able to write to CIRCUITPY on a Matrix Portal S3 via Finder and command line without triggering the issues that we've been seeing.

Copying files is very slow but seems to work. I've also removed files and installed libraries with circup.

I want to test a few other things (other boards, updating CircuitPython from th...

manic glacierBOT
#

the cameras are easily swappable, if we support camera modules, we should support 'all' the types

There are quite a few models supported: see https://github.com/adafruit/esp32-camera/blob/8f3f2cc8cfb2e4371870b0c5a974d40468114a9e/Kconfig. Each one has its own driver .c file which is of noticeable size. So maybe all the OVxxxx ones?

OK -- I'll see how it does with flash if I enable more. The only board this applies to is the esp32s3_eye, correct. Earlier I tried setting up a cam...

#

but... I am confused....
the sdkconfig for the memento is

#
# Espressif IoT Development Framework Configuration
#
#
# Component config
#
#
# LWIP
#
CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3"
# end of LWIP

#
# Camera configuration
#
# CONFIG_OV7725_SUPPORT is not set
# CONFIG_OV3660_SUPPORT is not set
# end of Camera configuration

# end of Component config

# end of Espressif IoT Development Framework Configuration

so no specific support is enabled

...

#

Sacrificial HDs in my life are more plentiful than sacrificial Macs.

I have a non-sacrificial 14.3.1 MBP that I may try it on. (I know this
isn't an Apple support group. I'm just whining/posting a warning/looking
for commiseration amongst the other seven C/C++ Mac native+multi-embedded
devs these days. :-) ) I try to not run betas and I didn't see exactly when
it happens (everything upgrades by itself so often these days...) but I've
spent a couple of hours (including removal and re...

#

This is really confusing. In https://github.com/adafruit/esp32-camera/blob/8f3f2cc8cfb2e4371870b0c5a974d40468114a9e/Kconfig, most of the cameras have default y entries. If I build espressif_esp32_eye without your change, in build-espressif_esp32_eye/esp-idf/sdkconfig (the computed sdkconfig made during the build) many are turned on:

# Camera configuration
#
CONFIG_OV7670_SUPPORT=y
CONFIG_OV7725_SUPPORT=y
CONFIG_NT99141_SUPPORT=y
CONFIG_OV2640_SUPPORT=y
CONFIG_OV3660_SUPPORT...
manic glacierBOT
#

I'm unclear whether it is possible or not to support @micropython.native (and native .mpy modules) on the RP2040. #2271 allowed boards to "enable the decorator by adding CIRCUITPY_ENABLE_MPY_NATIVE to mkboardconfig.mk."

For ports/raspberrypi/mkboardconfig.mk, adding CIRCUITPY_ENABLE_MPY_NATIVE = 1 is not sufficient. There are a handful of build errors:

GEN build-raspberry_pi_pico/genhdr/qstrdefs.generated.h
../../py/compile.c: In function 'compile_built_in_decorator':
....
solar whale
#

Just a heads up -- I don't have time to file an issue now, but since CP9 beta.0 something has broken adafruit requests. With recent builds call to get an AIO feed reult in ans "Out of Retries" error in adafruit_requests lin 696. I'll create a proper issue later or more likely tomorrow but I was wondering if anyone ese was seeing issues in the last few days.

short tendon
solar whale
#

On latest CP9

#

Works fine with Beta.0…

short tendon
#

The one hidden behind the max retries

solar whale
#

I’ll post more details later. Tied up now.

orchid basinBOT
manic glacierBOT
#

@dearmash You did great! My original plan was to clean up your PR. However, there was a huge refactor of displayio requiring some significant changes to board.c and my rebase skills are nowhere near up to the task of bringing your PR inline with the latest situation. Thank you for putting together something to start with. I picked up one of these boards, not realising until after purchase that it hadn't been added to CircuitPython. I would have been able to put together a basic set of b...

#

CircuitPython version

9.0.0 beta.0 (current main)

Code/REPL

from jpegio import JpegDecoder
from displayio import Bitmap

decoder = JpegDecoder()
width, height = decoder.open("/sd/example.jpg")
bitmap = Bitmap(width, height)
decoder.decode(bitmap)
# .. do something with bitmap

Behavior

The docs and this sample code indicate that the tuple returned by decoder.open() is (width, height).

But in testing with a sample jpeg image I've fou...

manic glacierBOT
manic glacierBOT
#

@dhalbert The release notes do seem typically vague. I also suspect this is a "minor bug fix" from Apple's perspective.

Full web install of CircuitPython to a QT Py S2 worked, that would have failed before. I was able to copy files to CIRCUITPY via both Finder and command line. After erasing and using the web installer to install just the boot loader, I also was able to manually install CircuitPython by copying adafruit-circuitpython-adafruit_qtpy_esp32s2-en_US-8.2.9.uf2 to QTPYS2BOOT.

...

manic glacierBOT
manic glacierBOT
tulip sleet
solar whale
# tulip sleet If you roll back to the last alpha does it work with the same version of the lib...

I started going back from the latest and it was failing but I ran out of time. It works with Beta.0 -- not usre when after taht it quit -- I will investigate it tomorrow. Here is the full traceback ```Adafruit CircuitPython 9.0.0-beta.0-23-g8af780c7fa-dirty on 2024-02-11; ESP32-S3-EYE with ESP32S3

import aio
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "aio.py", line 29, in <module>
File "adafruit_io/adafruit_io.py", line 748, in get_feed
File "adafruit_io/adafruit_io.py", line 578, in _get
File "adafruit_requests.py", line 732, in get
File "adafruit_requests.py", line 696, in request
OutOfRetries: Repeated socket failures