#circuitpython-dev

1 messages Β· Page 62 of 1

midnight ember
#

Wowki only works well with the Pi Pico... I'm not sure if it has ESP support.

willow totem
#

ah wicked thanks @slender iron

solar whale
#

Not that I object to learning a new tool. Hopefully a new or updated guide will follow soon.

midnight ember
#

Ohh that's good to know. good info @willow totem

willow totem
#

Yep wokwi supports ESP32's, Pico+PicoW, arduinos, stm32. They have components (led/LCD/etc) and screenshot taking with lcd peripheral.
My test was for heap size (actually done by gregorik from espressif but needed fixing up)

orchid basinBOT
#

I'd just make a new board def. That will be clearest for folks. The boards are well labeled with the version.

Yes, that is true the underside of my board is labeled as "v1.1" and this is a genuine board I received directly from Espressif.

I am now of the opinion that there is some value in creating a new v1.1 board as there will surely be a v1.2 or v2.0 in the future, and being able to use board.NEOPIXEL code unchanged on both versions is also of value to users. Also, there is some v...

candid sun
#

ship it!

solar whale
#

πŸŽ‰

willow totem
#

Yay, live release on stream

midnight ember
#

Sold to 9.0!

turbid radish
#

πŸ›³οΈ

#

πŸ‘ @tulip sleet

thorny jay
#

I just hope cardputer keyboard will be in a 9.0.x or 9.x

midnight ember
#

Releases closer to October get the Hacktoberfest sprint bug hunt treatment. Something to consider for a major release in the fall.

slender iron
tulip sleet
slender iron
#

thanks all!

candid sun
#

thanks for hosting @onyx hinge !

lone axle
#

Thanks for hosting Jeff! Have a great week everyone!

short tendon
#

Thanks!

gilded cradle
#

Thanks everyone

willow totem
#

@midnight ember the pi's with vscode-insiders pointed at them using remote explorer / remote SSH extension

onyx hinge
#

@lone axle my recording seems good!

#

see y'all around!

midnight ember
#

The batch script at the end of this issue is a workaround/fix for "Github Desktop changes paths every version update". It works very well and can recommend.

#

Instead of pointing the path to the new Github Desktop .exe manually every version change just point it at the .bat and it will keep track of it every version change.

#

@tulip sleet Synergy was the virtual KVM I was thinking about. There's no mention of it being owned by Google at any time. I'm sure at one time there was a google branded fork of Synergy. https://en.wikipedia.org/wiki/Synergy_(software) It does still exist.

onyx hinge
#

Here is the notes document for next Monday’s CircuitPython Weekly Meeting. It is at the normal time of 11am Pacific / 2pm US Eastern here on Discord. Add your hug reports and status updates to the document before the meeting. If you are unable to attend but would still like to contribute, feel free to add your notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868>
https://docs.google.com/document/d/11hSXWvZY9pqH1RNT7wBU3gzwwDjjEJVO2yg_-E999D4/edit?usp=sharing

midnight ember
#

Thanks for hosting @onyx hinge!

short tendon
#

Many of the rules we are disabling, ruff doesn't care about in the first place. Would we want to remove all the # pylint: disable=xxxx?

midnight ember
#

That's a good point. There are a lot of pylint comments embedded everywhere, in everything.

lone axle
#

(which is perhaps everywhere)

short tendon
#

And as an FYI - added it to requests and only got one file changed

#

Also - it looks to match isort.

midnight ember
#

Are the spaces between imports really necessary? From my point of view I'll only ever import things that exist on the microcontroller. So I don't understand the need for sorting by 3 different types 2 of which mean nothing to me. Maybe it's more useful for Blinka users that have a Linux environment? If that's the case then I'm ok with the change otherwise I preferred the condensed chunk of imports. It helped make scripts smaller.

willow totem
#

Can I get the pythonistas role please, feel bad making others read my bits by always being text only

lone axle
willow totem
#

Much obliged

manic glacierBOT
fringe yarrow
#

I was wondering about debug builds.. I've done that but then I can't figure out how to see the debug output.. the serial console just puts out the normal stuff

lone axle
devout jolt
#

Hey @willow totem do you have tips on how you're using custom CircuitPython firmware on WokWi? I love using it for quick testing and teaching, but the CirPy UF2 images I've seen on Wokwi are pretty old

short tendon
lone axle
#

Would main be different from 9.0.0rc.1 right now? My assumption would have been that they were pretty much the same but I'm noticing some different behavior from a build of main vs. a downloaded rc.1 around USB Host stuff with the Feather USB Host device.

onyx hinge
#

@lone axle compared to 9.0.0-rc.1 there are two emrged PRS: #9020 and #9055

lone axle
#

Thank you. I think something must be wrong with my local environment

#

my builds of main are succeeding but USB Host doesn't seem to work at all with them. When I download builds from S3 (downloaded abosolute newest as of a few min ago) it does work albeit with the unplug / replug. Somehow my local builds aren't complete or something

onyx hinge
#

check if your submodules are up to date?

lone axle
#

I had forgotten that at first but have updated them now

onyx hinge
#

that's the only guess I have at the tip of my tongue

willow totem
#

But also vscode does similar, and I believe you can do the same online, but you need to click into the interface then press F1 (what a choice of key - if loads you forgot to click inside code not diagram), then a command pallete loads like vscode, and you search for upload

manic glacierBOT
#

I tried adding this at the end of this file: https://github.com/adafruit/circuitpython/blob/main/ports/raspberrypi/boards/adafruit_feather_rp2040_usb_host/mpconfigboard.h

#define CIRCUITPY_DEBUG_TINYUSB 1

I was able successfully make a build but as far as I can tell enabling the debugging did not work. When the device connects to the PC there is only 1 serial port and it's the standard serial output / REPL. If I enable the USB Console line with boot.py then it typically appear...

devout jolt
willow totem
#

yeah similar, but had a play with CI a few times, and vscode a load for attempting to do cpy/mpy things, c++ works fine, build times online are too long, but I've got access to long builds. I really want CI to work for me, but there will eventually be a cost so still scoping what works best.

#

I secretly hope some philanthropicly minded org goes and buys out the project / Urish for a few years, only so it's fully open sourced and equally worth his time. 70% is in github anyway

devout jolt
willow totem
#

pure luck, maybe the man told me when I asked how to do something, or maybe I spotted it on the wokwi discord or some random docs (he had vscode instructions in a google doc for a few months), but it was like a gotcha moment and remember feeling like they thought it was intuitive (but F1 🀦 )

#

Useful server to be honest, great for silly / crazy questions, example projects, bugs although get some helpers fending off initial bug reports sometimes, but Urish is fantastic and loves the simulator to match reality (where poss)

short tendon
lone axle
#

ruff doesn't seems to care about strings using " instead of ' like black does. Is that something we care about? I would assume without this check we will eventually diverge from the consistency of using " unless necessary that black has built for us. Personally I don't really mind either way, but I do know that in my own code I kind of switch it around somewhat randomly based on how I'm feeling in the moment so without some tool assistance I don't use them consistently.

#

oh, actually I did not read enough of the documentation before running I've just now noticed that running as a linter is different from running as a formatter

#

okay, yeah nevermind it does make them consistent when you run the formatter. Interesting that the commands are seperated. I assume that ultimately we'd integrate this with pre-commit though so it ends up still being a single command to run?

short tendon
#

I did, my setup has both enabled

lone axle
proven garnet
#

I have a setup similar to what it might look like that mostly copies the CircuitPython pre-commit config (pylint, but also pydocstyle, isort, and pyupgrade).

lone axle
short tendon
#

Scroll up 3 messages. I have a whole PR

lone axle
#

ahh, thank you

#

I guess they renamed their github account

#

https://github.com/charliermarsh/ruff-pre-commit automatically redirects to https://github.com/astral-sh/ruff-pre-commit

short tendon
#

The important changes are in:

.gitattributes
.pre-commit-config.yaml
pyproject.toml
#

Should totally be able to update cookiecutter with these

orchid basinBOT
short tendon
#

It will make the same changes as isort (and maybe a few others)

midnight ember
#

Do you have the 1MB version? I just received the 65MB Daisy Seed. It's much smaller than I expected, KB2040 size. I'll look into spinning up a new dedicated linux pc this week, have a feeling cmake builds are in my near future.

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 9.0.0
#
[adafruit/circuitpython] New branch created: 9.0.x
marble hornet
#

Yay! πŸŽ‰ Congrats and a big thanks

tulip sleet
orchid basinBOT
lone axle
#

I think got updated with a fetch-all-submodules. I'll try a fresh clone later on.

slender iron
#

git status will tell you

lone axle
#
❯ git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean
spare jacinth
#

(did you fetch first?)

#

you dont want to status versus out-of-date tree

slender iron
#

that looks good to me

fringe yarrow
slender iron
#

we tend to setup the default uart output for "debug" output

#

for DEBUG builds

fringe yarrow
#

hrm.. yeah, i built this DEBUG=1 but i get no more info from UART0 than before, just the normal code.py output.

slender iron
#

on c3?

fringe yarrow
#

no, ESP-WROOM-32..

#

Sorry, I've changed gears from that i2c pulldown thing until I get another one to ensure it's not just hardware ghosts.. this is that Sunton cheap yellow display that I'm trying to get going πŸ™‚

slender iron
#

DEBUG=1 should turn on the CONSOLE uart from the IDF

fringe yarrow
#

is there a log level or something else I have to change? because it shows nothing besides normal code.py output on UART0

slender iron
#

make sure you clean and rebuild

fringe yarrow
#

that's probably it..

slender iron
#

idf settings changes (which DEBUG=1 does) aren't smart enough to trigger an IDF rebuild

fringe yarrow
#

too little flash to make a debug build, apparently πŸ˜„ the fun never stops.

slender iron
#

ya, I have to disable stuff usually too

#

CIRCUITPY_ULAB is a big one

fringe yarrow
#

is there a list somewhere of mpconfigboard.mk parameters like that? I feel like I always have to hunt for things like that

#

and as i ask, i find the Documentation pdf

slender iron
#

generally it's CIRCUITPY_<modulename>. py/circuitpy_.mk has a full list

orchid basinBOT
fringe yarrow
#

doesn't seem like disabling ulab or any other module changes the size of the final image.

#

ugh.. i wasn't making clean again.. disregard..

onyx hinge
fringe yarrow
blissful pollen
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-rc.1 on 2024-03-14; Waveshare RP2040-Zero with rp2040

Code/REPL

import board 
import time
import neopixel
import usb_hid
import supervisor

from digitalio import DigitalInOut, Direction, Pull
from adafruit_debouncer import Debouncer

from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
 
keyboard = Keyboard(usb_hid.devices)

pixels = neopixel.NeoPixel(board.GP16,...
tulip sleet
#

blog post is at 9pm ET on 3/18. 3*3 = 9, 18/2 = 9.

solar whale
#

πŸŽ‰ 9.0.0 loaded on several boards -- "no anomalies to report"

tulip sleet
manic glacierBOT
manic glacierBOT
slender iron
#

you can do make BOARD= DEBUG= menuconfig

manic glacierBOT
vagrant wind
#

I found the problem. Once I run . esp-idf/export.sh in a terminal session the make html fails. I need to start another terminal sessione and then it works

manic glacierBOT
#

Renamed module keypaddemux in keypad_demux.

Usage example:

import board
import keypad
import keypad_demux

km = keypad_demux.DemuxKeyMatrix(
    row_addr_pins = (board.KB_A_0, board.KB_A_1, board.KB_A_2),
    column_pins = (board.KB_COL_0, board.KB_COL_1, board.KB_COL_2, board.KB_COL_3, board.KB_COL_4, board.KB_COL_5, board.KB_COL_6)
)

event = keypad.Event()

while True:
    if km.events.get_into(event):
        print(event)
manic glacierBOT
empty salmon
#

Am I missing something with the synthio documentation? It has the following:

  • attack_time: float - The time in seconds it takes to ramp from 0 volume to attack_volume
  • decay_time: float - The time in seconds it takes to ramp from attack_volume to sustain_volume
  • release_time: float - The time in seconds it takes to ramp from sustain_volume to release_volume.

I am guessing that attack_volume and sustain_volume should be attack_level to sustain_level. There is no release_volume.

manic glacierBOT
tulip sleet
manic glacierBOT
manic glacierBOT
#

I'm sorry, I led you astray.

It's possible to create Keyboard() before USB is connected. The adafruit_hid library will then wait for USB to connected before proceeding. By default it waits forever. I forgot the timeout was indefinite. See https://github.com/adafruit/Adafruit_CircuitPython_HID/blob/01610da60bcf4ac23304b6ee410b46b8bbb35cd7/adafruit_hid/keyboard.py#L41 for the documentation. (There is some stuff missing in the online ReadTheDocs documentation: I will fix that.)

You can...

tulip sleet
#

@slender iron opinion about whether to add keypad_demux to 9.0.x or just leave it on main and publish a 9.1 beta shortly? I have a small number of other things for a beta that are not necessarily consequential (e.g. renaming nrf -> nordic)

#

I guess cardputer keyboard support on a stable release would be nice

proven garnet
tulip sleet
onyx hinge
#

I guess we can release CircuitPython 13 at 1PM

empty salmon
#

So CP 10.0.0 on October 10 at 10 am ?

tulip sleet
#

only if it works out πŸ™‚

#

@lone axle et al: re library docs. Is it written down somewhere that we should document the constructor (__init__()) in the class docstring? I noticed some missing documentation in adafruit_hid, and it was because the info was in the __init__() docstring. Apparently the convention is not python-wide. There is a setting autoclass_content = 'both' in the sphinx config file, but we don't set that by default. https://blog.sandipb.net/2016/10/10/documenting-both-class-and-constructor-in-sphinx/

#

i wonder if there are other libraries with this issue. I worked on adafruit_hid years ago when this was all really early.

#

hmm, never mind, I think adafruit_hids conf.py is out of date

#

most libraries have autoclass_content = 'both'

lone axle
# tulip sleet <@382939733107408897> et al: re library docs. Is it written down somewhere that ...

I don't believe it is written anywhere. The two places that I know of that it might make sense would be the RTD page of "Sharing a Library" guide: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs, but currently this is focused on the actual RTD service integration, not the docstrings that the docs are built from. or maybe to a lesser extent this one about typing information: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/typing-information which does include a section about type hints in __init__ but not specifically anything about it's interoperation with sphinx docs.

tulip sleet
#

thanks!

lone axle
#

We can try to add a check for that with the ruff addition automation. I wonder how many others are inconsistent with the majority, it'll be nice to get them on the "same page"

short tendon
#

We can require those via pre-commit with either pydocstyle or ruff...

onyx hinge
#

someday we also need to modernize what we do in the learn github repo for python scripts, right now there's pylint (old version) + no black

#

(and not via pre-commit either)

slender iron
#

and leave 9.0.x for fixes only

#

It may be a good time to do the 1.22 MP merge and make upstream PRs

midnight ember
short tendon
#

You could checkout the branch and then re-update one of the newest and see what happens

#

You should get no lf errors

midnight ember
#

FoamyGuy brought up a question about the built-in binascii vs adafruit_binascii. Is binascii built-in for the majority of the boards or should I only use adafruit_binascii?

onyx hinge
#

@midnight ember for web-based stuff? All those boards are going to have builtin binascii, or at least I'd be rather surprised otherwise

midnight ember
#

makes sense

onyx hinge
#

someone needs to make "caniuse.com" but for micropython & circuitpython πŸ˜‰

#

alternate useful idea: a way to query "has wifi but not binascii"

midnight ember
#

is that the programming equivalent to LMGTFY? πŸ˜›

midnight ember
#

The list would probably be a mile long now. It would be a shorter list to know what board it's not included in.

manic glacierBOT
#

Rather than add a new routine, we could have time.sleep(0) run background tasks. There is sort of a precedent for this in CPython:

https://docs.python.org/3/library/time.html#time.sleep :

On Windows, if secs is zero, the thread relinquishes the remainder of its time slice to any other thread that is ready to run.

This could be done in common_hal_time_delay_ms() or even in shared-bindings/time.

Also there seem to be unnecessarily multiple implementations of `common_hal_time_del...

lone axle
#

It would be a shorter list to know what board it's not included in.

Got me thinking and it turns out this filter supports negation too! so you can search -binascii to find boards that do not support 🀯

midnight ember
#

396/477. now i'm interested in learning which 81 boards it's not on.

#

sweet!

short tendon
onyx hinge
midnight ember
#

looks like a lot of samd21's

#

so all M4, RP2040 and above have it.

lone axle
onyx hinge
lone axle
#

Nice!

onyx hinge
#

but of course there could be some Airlift-having device with no binascii

midnight ember
#

I highly doubt anyone with a circuit playground express is going to want to run base64 encoding. thank you. that'll do. going forward with using the built in.

#

hmm that could be a problem, i don't want to disclude airlifts.

midnight ember
onyx hinge
#

I did also literally give you the website's name, you could have looked at it too πŸ™‚

midnight ember
#

ask Dan, I'm bad at looking at things unless someone shoves it in my face a couple times.

#

too many projects, too easy to get sidetracked with rabbitholes

lone axle
# midnight ember hmm that could be a problem, i don't want to disclude airlifts.

the examples are already using the built-in wifi for wifi.radio which excludes airlift AFAIK. TBH I would be pretty surprised if any of the SAMD21s would be able to use airlift and make requests successfully anyway. If binascii is on M4s I'd just roll with that since I think it's overwhelmingly likely airlift based project will be using something "bigger" than SAMD21 anyhow.

#

I didn't realize until now that circuitpython does not have base64 module like CPYthon does. Is that excluded intentionally to save space or would there be some interest in having it added as core module? It might be nice to make code a bit more portable between circuitpython and cpython.

midnight ember
#

think i'm just going to delete the twitter example. it's broken, their new api is broken, it's not worth the hassle. the documentation is horrible. i got Mastodon up and running in about 15 minutes. i shouldn't have to spend more than 24 hours of research trying to figure out which twitter api documentation is current and what works. i'd rather go back to playing with the crypto chip.

#

does anyone have any objections to deleting the broken adafruit_circuitpython_requests Twitter API example?

lone axle
#

removing it sounds fine to me.

midnight ember
#

even if someone needs binascii that doesn't have it on their board (including airlifts) they can just import adafruit_binascii and change the code a little to use that.

#

i just want to avoid support problems if the change will cause some.

midnight ember
manic glacierBOT
cedar moth
#

Good morning all. I was wondering if there was any ballpark estimate or rule of thumb on when the next merge from upstream MicroPython might occur?

slender iron
#

I was just thinking about it. Are you interested in MP 1.22?

cedar moth
#

I need to check the exact MP version but an update to the deque implementation was recently merged into MP (two nights ago) and it would be very helpful for a project I am working on. Not a show stopper by any means, I have been building my own version of CP with the proposed changes, but if it could be integrated into CP that would be helpful.

slender iron
#

Ah, it'll be in the next MP release then

cedar moth
#

OK, then no hurry! πŸ™‚

slender iron
#

They try to release every two months but I'm not sure when they will

#

You can make a PR to CP with the changes that MP accepted

cedar moth
#

Oh, OK. I will do that, thanks tannewt!

slender iron
#

np

midnight ember
#
OSN_CREDENTIALS_B = binascii.b2a_base64(b"" + str(OSN_CREDENTIALS) + "")  # this works but appends \n
OSN_CREDENTIALS_B = binascii.b2a_base64(b"" + str(OSN_CREDENTIALS) + "", newline=False)  # this doesn't
``` fails with `TypeError: function doesn't take keyword arguments`
slender iron
tulip sleet
midnight ember
#

foamyguy got it to work in a pr we're having the discussion in https://github.com/adafruit/Adafruit_CircuitPython_Requests/pull/167 ```py

import binascii
dir(binascii)
['class', 'name', 'dict', 'a2b_base64', 'b2a_base64', 'crc32', 'hexlify', 'unhexlify']
binascii.b2a_base64(b"hello")
b'aGVsbG8=\n'
binascii.b2a_base64(b"hello", newline=False)
b'aGVsbG8='

tulip sleet
#
>>> import binascii
>>> binascii.b2a_base64(b'hello').strip()
b'aGVsbG8='
midnight ember
#

i was using slices BASE64_STRING[2:-3] which works about the same. just that foamyguy said there might be a way with the argument to not have it append the \n at all from the start.

tulip sleet
#

i think it comes from MicroPython, and the often leave off stuff like that when there's a workaround, to save space

midnight ember
#

that worked, thank you. think i'll use that.

manic glacierBOT
#

But I should mention that:

AttributeError: 'Runtime' object has no attribute 'usb_available'

Probably you meant:

if supervisor.runtime.usb_connected:
    pass

I was very close to this option, using it as an indication, but your explanation cleared things up. But it seemed to me that this option was not very stable and that you had to adjust the delay time. Perhaps the problem is with my cable.

#

Sorry for the typo. .usb_connected is what is used internally when you specify a timeout: https://github.com/adafruit/Adafruit_CircuitPython_HID/blob/01610da60bcf4ac23304b6ee410b46b8bbb35cd7/adafruit_hid/__init__.py.

The delay time depends on how fast USB enumeration happens with the host. So you need to allow the maximum possible time. We can't determine whether the host is slow or not there (well, maybe we could test whether enumeration is in progress, but that would be more complicate...

#

Here is a build for the rp2040 usb host feather. The debug statements are transmitted out the TX pin.

firmware.uf2.zip

Here is my debug output that shows the same issue. I've marked where I unplugged and replugged the device.

Serial console setup
USBH init on controller 1
sizeof(usbh_device_t) = 184
sizeof(hcd_event_t) = 12
sizeof(_ctrl_xfer) = 24
sizeof(tuh_xfer_t) = 24
sizeof(tu_fifo_t) = 20
si...
fringe yarrow
#

In the ongoing saga of this Parallel wired ST7789 ESP32 all in one board.. I've removed the display definitions in board.c, pins,c, etc, and made a circuitpy image with CIRCUITPY_PARALLELDISPLAYBUS enabled to let me try to get the display working from within code.py rather than recompiling the image after modifying board.c over and over.. and after providing the right pin info to the paralleldisplaybus.ParallelBus constructor, the screen turns on, but shows the same lines and garbage that it did as compiled in.. so.. at this point I think the problem lies somewhere within the differences of how CircuitPython paralleldisplaybus is handled vs how the equavlent bus is constructed in the Arduino sketch.. I think this is the point where I set this aside.. πŸ˜„

slender iron
fringe yarrow
midnight ember
#

actually that didn't help as much as i'd hoped ```py
OSN_CREDENTIALS = str(osnusername) + ":" + str(osnpassword)

OSN_CREDENTIALS_B = b"" + str(OSN_CREDENTIALS) + ""

OSN_CREDENTIALS_B = binascii.b2a_base64(b"" + str(OSN_CREDENTIALS)).strip() # strip removes \n
BASE64_STRING = str(OSN_CREDENTIALS_B) # bytearray
TRUNCATED_BASE64_STRING = BASE64_STRING[2:-1] # slice bytearray head/tail

BASE64_STRING : b'VXNlcm5hbWU6MDEyMzQ1Njc4OQ=='

TRUNCATED_BASE64_STRING: VXNlcm5hbWU6MDEyMzQ1Njc4OQ==

slender iron
midnight ember
#

@short tendon should i run black first or just try pre-commit?

fringe yarrow
#

That's the 28R which has a SPI screen.. I have one of those en-route, and if I'm honest, should be the one, if any, that get submitted for CircuitPy support.. it's by far more popular than the 22C, which I just happened to have the bad luck of getting

midnight ember
#

@short tendon ```
C:\Users\Devon\Documents\GitHub\Adafruit_CircuitPython_Requests\examples\wifi\expanded>pre-commit run --files requests_wifi_api_openskynetwork_private.py
[INFO] Initializing environment for https://github.com/charliermarsh/ruff-pre-commit.
[INFO] Installing environment for https://github.com/charliermarsh/ruff-pre-commit.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
check yaml...........................................(no files to check)Skipped
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed
ruff.....................................................................Passed
ruff-format..............................................................Passed
reuse....................................................................Passed

short tendon
#

Thanks for checking

manic glacierBOT
#

time.sleep(0) doesn't make any sense either

It would be the do {} while (); of pretty much of what exists already.
Light sleep is already looping backround tasks, so 0 would be a single tick.

Please file an issue that explains the issue

Alright, I will file an issue with details and repro instructions.

we may need to tweak the tinyusb task to run more often instead

I am not sure rising tinyusb task prio is a good idea.
It's not like usb isn't detected at all.. It just...

proven garnet
short tendon
#

Totally makes sense

short tendon
proven garnet
#

I think it will still report unresolvable errors on the newer lines though. I had an issue using pydocstyle rules where my CI was reporting older lines for this reason, which is why it's on my mind.

#

Unless I'm misunderstanding what you mean by import fix - I assume you mean isort

short tendon
#

I do

proven garnet
#

Interesting it's not in formatting though, though I guess isort really is technically? linting???

short tendon
#

Yeah, it is strange

proven garnet
#

For what it's worth, I think you'll still get the correct line numbers even after the reordering.

short tendon
#

Sounds good. I also assume, those will change less often

#

@proven garnet do you think we should run PL? The rules are different and not sure how we would find out what ones to disable globally. Strange ones in that PR are: ["PLR2004", "UP030", "UP031"]

fringe yarrow
manic glacierBOT
slender iron
proven garnet
short tendon
#

Yeah, although there would be fewer of them

fringe yarrow
proven garnet
#

I don't think there are many relevant global disables - the .pylintrc files has them and is pretty consistent between libraries.

slender iron
#

ya, perhaps. a logic analyzer will tell you

midnight ember
#
C:\Users\Devon\Documents\GitHub\Adafruit_CircuitPython_Requests\examples\wifi\expanded>pylint requests_wifi_api_openskynetwork_private.py
************* Module requests_wifi_api_openskynetwork_private
requests_wifi_api_openskynetwork_private.py:12:0: C0411: standard import "import binascii" should be placed before "import adafruit_connection_manager" (wrong-import-order)
``` local pylint told me to put binascii before connection manager. i did that and isort failed during the job run.
short tendon
#

Also, do you know how to set UP to use a certain pyupgrade version?

fringe yarrow
#

Any idea why, with the latest pull from the git repo, my builds still say "CircuitPython 9.0.0-rc.1-7" leading to reminders from circup that there's a newer version..

slender iron
#

make sure to fetch tags too

onyx hinge
#

if using isort it will be necessary to disable pylint's wrong-import-order, since as you see they disagree.

midnight ember
#

consider-using-f-string was more like "you must use f-string or i'll bug you to death about it"

short tendon
#

I updated my ruff branch to use PL (pylint) and UP (pyupgrade), just to see the changes

#

I only needed to re-add 2 noqa statements

midnight ember
#

like this function that i've used for about 2 years now it complained about ```py
def _format_date(datetime):
return "{:02}/{:02}/{:02}".format(
datetime.tm_year,
datetime.tm_mon,
datetime.tm_mday,
)

so i rewrote it with only f-strings, probably an improvement that needed to be done anyway.  now i have a nice f-string version added to my snippets.
```py
def _format_datetime(datetime):
    """ F-String formatted struct time conversion"""
    return (f"{datetime.tm_mon:02}/" +
            f"{datetime.tm_mday:02}/" +
            f"{datetime.tm_year:02} " +
            f"{datetime.tm_hour:02}:" +
            f"{datetime.tm_min:02}:" +
            f"{datetime.tm_sec:02}")
manic glacierBOT
#

I think this is clearer; it still takes a bit of head-scratching to understand the algorithm. A diagram would theoretically help, maybe, but let's not go there yet.

The current defaults are interval=0.020 and debounce_threshold=1. What values would you choose on a typical keyboard to make, say, the rhythm game you are talking about work better. Or what are you choosing for your own use now?

proven garnet
short tendon
#

The goal of linting and formatting is so code is safe (linting) and looks the same (formatting). It makes code reviews easier and takes peoples preferences to how it should look (there's like 5 ways to format a string) out of it. It would be up to the owners to determine what rules they want to enforce

stuck elbow
#

it makes code reviews harder, imo, because it removes important code smells

#

and most of the linting rules are completely useless

short tendon
#

Personally having different rules feels strange. Because then when you move example code into real code, it re-formats it.

proven garnet
#

Also @tulip sleet I can look at that fun pre-commit issue this evening, if you want to hand it off to me for a little bit.

tulip sleet
midnight ember
#

honestly i've learned most of my formatting from learn guides and repos from circuit python. i think black and pylint had a lot to do with that.

midnight ember
midnight ember
#

It's not lost on me. I know. I really liked the formatting without the line spaces. :/

stuck elbow
#

foolish consistency is the hobgoblin of the little minds

short tendon
#

@midnight ember also, just so you know (and haven't checked specifically in CP), f-strings are faster and more memory efficient than any other string formatting. It is sad that we still need to concatenate long strings, so lose some benifit there...

midnight ember
#

oh i use f-strings for everything now. i'm not complaining. in fact it was very useful to kind of be forced to update that one to f-strings. i didn't even realize all this time that it needed to be updated too until pylint said something.

wraith crow
manic glacierBOT
midnight ember
#

probably something like # pylint: disable=consider-using-f-string

#

Now I have to go rename my entire nrf examples directory.

short tendon
#

@wraith crow yes, we can ignore f-strings if we want (globally, or selectively)

midnight ember
#

i like the recommendation as i do want to move everything to f-strings. i don't think it should be mandatory just yet though.

slender iron
#

@tulip sleet I'm running into reset issues with the usb host featherwing code and I'm tempted to remove all of the never_reset and bulk reset stuff

tulip sleet
slender iron
#

I was debating doing it on main

#

it may not save me from this problem though

#

because the finalizers aren't run in a particular order

#

so I could still deinit the spi before the max

tulip sleet
#

I was thinking of #8991, that's just finishing off pwmout

#

but we still need reset_forbidden, I assume (never EVER reset)

#

oh, it's #8960, that's everything

slender iron
#

I may wait now that I know I'll still have this problem

#

I'll just guard against it

tulip sleet
#

ok, it's only in ESP-iDF 5.0.x, so not an issue for us

#

good for us for not supporting older ESP-iDF

slender iron
#

ya, jim sent me a link to it

#

I need to write up the noxip thing for clang folks

#

and finish my impl

stuck elbow
wraith crow
#

Maybe I mis-read but I thought Dan said all boards do now have f-strings enabled....

stuck elbow
#

oh? I'm sure they didn't work on my samd21, but I didn't try with cp 9

wraith crow
#

🀷 either way, there is still the option to disable the check I guess 😁

stuck elbow
#

there are also things you can't do with f-strings

short tendon
#

I'm pretty sure f strings are on any board. Didn't think you could turn that off. Many libraries use them...

tulip sleet
stuck elbow
tulip sleet
#

we got it to fit!

#

makes writing libraries easier

short tendon
#

I think question number 1 for linting/formatting is do we want to sort imports. If so, it will probably be easier to add isort first and then switch to ruff (if that's the thing we're doing). I'm 100% happy to script it out and open all the PRs (I do know you guys mentioned direct commits to main)

tulip sleet
#

Do ruff and isort produce potentially different orders?

short tendon
#

No. I'm pretty sure ruff implemented isort

#

There should be no changes

#

That's why it feels like a good first step

#

I am also happy (if people can decide on rules) to do the whole thing.

tulip sleet
#

if we have to change the same places to do isort+pylint+black as opposed to just ruff+ruff, then we may as well move to ruff without an intermediate step. It could be done in batches of libraries since there would be cleanup

short tendon
#

Fair. Please let me know how I can help. I can probably script about 90% if not more. I can also create diff files so you could commit to main

tulip sleet
#

could be scripted, ifthere is manual cleanup needed could be done with pre-commit locally. We might be removing a number of # pylint: ... comments, if I understand correctly.

short tendon
#

Yes, I would remove all of those and replace with the new ones (if we are using rust:pylint)

#

If we open them as PRs, then anything not caught by scripts would be easy to find since it would fail

tulip sleet
#

we could generate PR's to switch over with a script. Many PR's would fail and then they could be cleaned up by hand. If there are easy cleanups those could be automated.

short tendon
#

This would be my flow:

  1. Pick 5-10 repos of different sizes (like ticks, minimqtt, portal base) and create 3 (maybe 4) PRS:
    a. With sorting enabled
    b. With pyupgrade enabled
    c. With pylint enabled (different from the normal pylint)
    d. There is also one for docstrings, not sure that would be wanted...
  2. Create a Google doc that lists the PRs and allows for comments
  3. Either meet over the doc, or have someone review comments and make decisions
  4. Use said decisions to update all the repos, update cookiecutter and update docs to the rules and why (so someone doesn't come back in 6 months asking why we do x)
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0 on 2024-03-19; Raspberry Pi Pico W with rp2040

Code/REPL

import time
import board
import audiomixer
import synthio
import audiopwmio
import ulab.numpy as np

SAMPLE_RATE = 32_000
MIXER_BUFFER_SIZE = 2048

audio = audiopwmio.PWMAudioOut(board.GP18, right_channel=board.GP19)
mixer = audiomixer.Mixer(channel_count=1,
                         sample_rate=SAMPLE_RATE,
                         buffer...
strange ravine
#

Probably better fit for #help-with-linux-sbcs but, i wanted to know will there support for blinka on the orange pi zero 3?

proven garnet
#

@tulip sleet It seemed like all the dependencies were up to date, so I'm not sure what was causing the error. However, I got the CI to pass by installing pre-commit via pipx as opposed to pip so it has an isolated environment and that worked.

#

I wonder if something is competing with it, but whatever it is, it'd take more digging. Using pipx is a pretty good permanent solution anyway though I think the contributing guide would need to be updated if that's the way it should be done locally too.

proven garnet
#

No, I think it's good now. If you're interested in figuring out how its using an older virtualenv, that'd at least solve the mystery. But it really only seems to be on the runner, since I know I'm running 3.12 on my system and have no issues.

#

I've tried checking versions with pip freeze, seeing if updating the system packages helped, and all nothing. My vote is that it's somehow using the system virtualenv which would be at 3.10 for the runner, but that's wild speciulation a guess.

short tendon
proven garnet
tulip sleet
short tendon
#

I'm seeing this:

uses: actions/setup-python@v5
with:
  python-version: "3.x"

Which should specify the python version if there's one you want...

short tendon
#

Feel free to update that other PR and close this one, or merge it in first and fix the other

proven garnet
short tendon
proven garnet
# short tendon <@329766224093249548> and <@135415127879974912> resolved. PR proof: https://gith...

Setuptools handles it correctly in 3.12 by putting that line inside of an if hasatrr() block, but that's not what's being used here. Here's setuptools 69.2.0 (which is what the runner claims to use in the system, but clearly not the pre-commit venv: https://github.com/pypa/setuptools/blob/6ee23bf0579c52e1cbe7c97fc20fd085ff2a25c7/pkg_resources/__init__.py#L2198-L2199)

GitHub

Official project repository for the Setuptools build system - pypa/setuptools

#

It's currently pinned to 3.11 across all the repositories' CIs, including the libraries

tulip sleet
#

Right, I want to stop having to pin 3.11

#

It’s mysterious to me why it’s using the wrong setuptools, but maybe it’s the default one for Ubuntu 22.04. Maybe we have to pip or pipe install the right one, but I’m not sure where to put that requirement

short tendon
#

@tulip sleet and @proven garnet figured it out for real

#

Or you know we could switch to ruff.... 😜

#

πŸ°πŸ•³οΈ success!

manic glacierBOT
proven garnet
short tendon
proven garnet
#

I have a tool that can help locate and list any result CI failures

short tendon
#

Sounds good

#

Will leave it in your hands, and that was a fun 2 hours πŸ˜‰

proven garnet
#

But yeah, this also competes with the ruff change so it may be worth figuring that out

short tendon
#

Yeah, does seem not the best use of time to fix linting to fix it again...

proven garnet
#

Haha yeah, but it makes sense now that it's within the venv. I vaguely remember an issue like this when we switched to 3.11 though I don't think it was setuptools but some other package that failed since something was moved or removed.

short tendon
#

I think it's funny how long that method had been deprecated. 3.3 was a long time ago...

#

@proven garnet did you see my thoughts above on how to figure out if the switch to ruff is good?

tulip sleet
short tendon
#

I can't even see how that library uses pre-commit...

#

I did look at that library yesterday as I was trying to see what was installed where and if something was installing a different setuptools

tulip sleet
#

I am pretty confused by that repo. I wasn't aware it existed

short tendon
#

other then the install.sh which is used to install what the CP library needs

#

You all have build an impressive build system, but it's a little like a rollercoaster...

proven garnet
proven garnet
proven garnet
#

Tagging @lone axle who has been involved on that front.

#

This does remind me that this issue is why I wanted (and honestly should) create a repository for how these issues get solved - community libraries will break if we change the unified library action and downstream users (anyone who uses the cookiecutter) don't update their pre-commit config files.

short tendon
#

I would add to that doc, why the pre-commit linters,formaters,checkers,etc where chosen. Seems like a repo would be a good place to keep that history...

orchid basinBOT
manic glacierBOT
#

Another symptom is that os.rename('./sd','/newsd') effectively separates the physical mount point from the mounted file system. The contents of the sd card can then been seen by os.listdir('/sd') and the original placeholder file can be seen by os.listdir('/newsd'). Doing this also seems to hide the /sd folder (and SD card contents) from web workflow.

lone axle
#

And did you mean 3 or 4 PRs for like each of those letters a to c or d put into it's own individual PR?

short tendon
lone axle
#

Do you mean just for the first few to see what shakes out or for all of them even after the first few? I think I'd lean toward trying to collapse down to 1 PR per library if possible at least for when we do all of them. Even if the creation of those PRs can be scripted there are still manual steps for approve and then merge (unless there are more automation tools in adabot or somewhere that I don't know of). So at least for my process reviewing and merging 1 PR instead of 3 or 4 would result in substantially fewer clicks and keypresses through the process of all the libraries in the bundle.

Even in a single PR those discrete steps could be broken out for inspection by commiting them individually with the changes associated to each one. You can always view the branch at each of those commits within the same PR.

short tendon
#

oh yes. just for a few random ones to help make decisions

lone axle
#

What does pyupgrade do? I don't think I've heard of that

short tendon
#

And when doing the full thing, I would automate adding one at a time, running and committing

#

pyupgrade finds things that have changed and updates them. For example f-strings

lone axle
#

Is there one of these things select = ["I", "PL", "UP"] for formatting like the functionality that replaces Black? or is that set up some other way?

short tendon
#

no... it's strange. this:

[tool.ruff]
target-version = "py38"

[tool.ruff.lint]
select = ["I", "PL", "UP"]

tool.ruff == formatting
tool.ruff.lint.I == isort
tool.ruff.lint.PL == pylint
tool.ruff.lint.UP == pyupgrade

lone axle
#

Ahh, the pyupgrade one I have slight reservations on because micropython and thus circuitpython doesn't necessarily always support the brand newest of CPython syntax when it becomes available. Last I knew micropython was targeting 3.4 or 3.5 python syntax though with some newer features like f strings included at this point. I'm not sure if that has been moved forward perhaps though. We can see with testing on hardware when those inital PRs are in, but I worry that some day it's going to make an upgrade to some new syntax that isn't supported by circuitpython and then it will break the library on hardware but the linter / actions checks won't realize that.

short tendon
#

Totally don't need to add it. Just showing options

fringe yarrow
#

In one last ditch effort to determine why the lilygo tdisplay s3 works with the parallel display bus code while this cheap yellow display board does not, I determined that the only difference I could perceive in hardware, other than the resolution, was that the Lilygo device had a hardware reset pin while the CYD had tft_reset wired to the esp32 en pin. I went so far as to cut the trace to tft_rst and run it to a spare GPIO on the ESP32, tested continuity thoroughly to ensure the surgery was a success, change the code accordingly.. and it has made zero difference.. still lines and garbage.. I give up on this thing..

lone axle
#

I would say this plan sounds good to me. I do think 1 PR with separate commits would be fine instead of separate PRs, but for the smaller subset of libraries to check out I don't think it matters as much either way. I would add that part of the testing process on those first couple of libraries should include a trial on hardware both mpy'd and plaintext python. I recall some weird obscure issue in the past where mpy-crossed version of some syntax was causing trouble so I think it's worth doing that kind of testing especially on the pyupgrade changes.

And we can update the cookie-cutter repo with the specific configuration we land on once it's decided.

slender iron
#

@onyx hinge you know of a way to compute the length of an array in a type right? I feel like you added it somewhere. ESP removed a constant for how many endpoints chips have and hardcoded the array length

tulip sleet
slender iron
#

this is for tinyusb

tulip sleet
#

#define MP_ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))

#

do you mean they literally made it 5 or whatever?? oy

short tendon
tulip sleet
#

@slender iron I think I would open a complaining issue about that :forehead_slap:

slender iron
#

I can't figure out how they changed tinyusb to still work

onyx hinge
#

yeah MP_ARRAY_SIZE is the ticket @slender iron as long as it's really an array and not a pointer

slender iron
#

πŸ‘

onyx hinge
#

unfortunately that construct results in 0 or 1 for a pointer, rather than an error

tulip sleet
#

all the dcd stuff is gone

#

I'm mystified too

#

going afk

slender iron
#

that's their wrapper package

#

they have a fork of tinyusb too

tulip sleet
slender iron
#

but it uses the old macro still

tulip sleet
#

yeah USB_OUT_EP_NUM still mentioned

#

ok bye

slender iron
#

πŸ‘‹

proven garnet
#

I then have a tool that will check and record which recent CI builds failed as a result

#

(also contained within adabot)

#

The nice thing about the adabot route is that it saves having to submit PRs, and just works by doing a git format-patch application to all the repos

#

I do have another tool that works similarly in that it pushes to main without a PR but is a little bit more programmatic (it basically takes a repo and can work with it in Python for things like updating TOML files or similar things that might be harder for a git operation (i.e., the files are very different across repos)

#

I don't think that will be necessary here but it is an option if a patch fails heavily. We can dry-run and see how many would need to be fixed otherwise.

lone axle
proven garnet
#

I added it a couple years ago to help with looking for them for cases like this adabot

#

It utilizes the previous tool that iterates through the libraries via Python, I thought it was standalone but it isn't.

short tendon
#

@proven garnet can the patch also run commands? since it would also need to run pre-commit on the repo after the changes?

manic glacierBOT
#

It looks like there's a similar issue for newly created LFOs.

WAVEFORM_HALFLEN = 2048
lfo_test2 = synthio.LFO(rate=1, scale=WAVEFORM_HALFLEN * 15//16 // 2, offset=WAVEFORM_HALFLEN - WAVEFORM_HALFLEN * 15//16 // 2)

I'd expect that to start around 1024 but there are a load of (out of range) 0 values first before it gets going, see output below for printing the value in a loop doing some other stuff.

0
0
0
0
0
1114
1114
1114
1139
1139
1139
1139
1139
1139
1...
manic glacierBOT
#

This PR expands CP collections.deque functionality to be more congruent with the CPython implementation by adding iteration, subscription and initialization as well as pop(), appendleft() and extend(). Tests for the new functionality are also provided.

This code is a copy of MP PR #10724 that was recently merged into MP. I have built and tested versions of CP with this code for RP2040, ESP32S2 and atmel-samd M4 boards and everythin...

#

I took a quick look at this and I don't think there's an easy fix. This also applies to arithmetic blocks, and changing other inputs such as phase or offset.

Here's why: The values are lazily calculated during the generation of audio in the background. There's not even code to enable it to happen at other times (it's tied up with the idea that a LFO gets updated with a "tick").

In the short term it would be good to mention this in the documentation because I'm not surprised that you w...

onyx hinge
proven garnet
#

We could also do git submodule foreach on the bundle I think?

lone sandalBOT
tulip sleet
midnight ember
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-rc.0-7-g6a07412b07 on 2024-03-11; Adafruit Feather ESP32 V2 with ESP32

This also happens with CP 9.0.0 final release.

Code/REPL

see https://github.com/vladak/shield

Behavior

I have a simple setup with Feather ESP32 V2, running on battery power, periodically reading metrics from temperature/humidity sensors, publishing them to local MQTT broker and entering deep sleep. The Feather was running C...

manic glacierBOT
#

I can't see how it would have anything to do with your issue, but it looks like you're overwriting your IMPORT_EXCEPTION variable after the import attempt. You probably want to test that the variable wasn't already initialized before setting IMPORT_EXCEPTION to None. I'm sure there's a better way but something like:

try:
    a = IMPORT_EXCEPTION
except:
    IMPORT_EXCEPTION = None
short tendon
#

So @lone axle, @proven garnet and @tulip sleet would me picking 5-10 repos, creating a branch, adding ruff: format, sort, lint, pyupgrade each as their own commit be a helpful step in making decisions?

short tendon
#

Any you would like in that list?

lone axle
#

pyportal, portalbase, pycamera, neopixel, requests, and any random I2C based driver make sense as a good test set in my mind.

short tendon
#

Nice!

#

How about gps?

lone axle
#

sounds good to me, though I've never done any testing with it personally. I think I purchased the hardware for it at one point but I'll have to dig around in the parts room a bit to find it.

manic glacierBOT
#

Sorry, I unraveled an even bigger bug.

Adafruit CircuitPython 9.0.0-dirty on 2024-03-19; Seeeduino Wio Terminal with samd51p19
>>> import board, sdcardio, busio, storage
>>> spi = busio.SPI(board.SD_SCK, MOSI=board.SD_MOSI, MISO=board.SD_MISO)
>>> sdcard = sdcardio.SDCard(spi, board.SD_CS)
>>> vfs = storage.VfsFat(sdcard)
>>> import os
>>> os.listdir()
['.fseventsd', '.metadata_never_index', '.Trashes', '.Trash-1000', 'Beryllium', 'code.py', 'boot_out.txt', 'repl.py', 'boot.p...
proven garnet
proven garnet
fringe yarrow
#

Because I need a new project to beat my head against.. I've ordered a Lilygo T5-S3 v2.3. It's an ESP32S3 with TF slot, I2C RTC, and 4.7" ed047tc1 EPD. Doesn't look like there's TOO much for support ouside of experimental drivers out there for that panel. We'll see how that goes..

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0 on 2024-03-19; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3
Board ID:adafruit_feather_esp32s3_4mbflash_2mbpsram
UID:CD4557DDA3C4

Code/REPL

import alarm

# Full program here, everything else is working fine except for sleep below...

alarmA = alarm.pin.PinAlarm(pin=board.D12, value=True, pull=True)
alarm.exit_and_deep_sleep_until_alarms(alarmA)

Behavior

I have not included all ...

short tendon
midnight ember
midnight ember
manic glacierBOT
#

@jepler after the UVC hardfault fix (still waiting for review). It is better, but my arduino example still struggle to run on S3, but run great on other platform such samd51 and nrf52840.

At currently state, S3 does not work with webcamnnoid in Linux, but regconized by windows device mannager (no :warning: sign), and able to stream data if lucky enough. I guesss it is race con...

#

This adds support for Github-codespaces for CP 9.x.x.

It fixes #9029.

Another major change is that the devcontainer-alternatives are now on a per port basis (major speedup in codespace creation since the codespace only fetches submodules relevant to the selected port). Currently only ports using espressif and cortex-m are supported.

tulip sleet
lone axle
#

are RSS feeds meant to be chronological? Should the newest be always at the top or bottom? The order of boards in that feed seems all over the place.

#

maybe the client software is responsible for ordering them by pubDate

tulip sleet
lone axle
#

Ahhh, I hadn't caught on it was alphabetical, that makes sense

tulip sleet
#

the sort order on the boards web page is by popularity (download count)

#

which makes for some surprises

lone axle
#

I added the feed to an rss reader on my phone and it does seem to handle the chronological sorting automatically

#

it would be cool to make this data available as JSON so it could be consumed by circuitpython. Then you could have a magtag, or matrix portal etc.. showing the latest new devices supported all the time.

proven garnet
#

I can also try to make a small example guide in the Playground page if you think that would be helpful.

midnight ember
#

Didn't notice RSS was alphabetical. Yes they're usually in chronological order since... like always. This is the first feed I've seen that isn't chronological. How you even managed to do that is neat. I thought it was a latest boards feed in chronological order. The first board in the list is from May 2023 so if you're expecting RSS in chronological order it will appear as if it hasn't been updated since May 2023.

#

Having 2 feeds, 1 in alphabetical order and 1 in chronological order would be appreciated. I love RSS feeds but there's no sense in subscribing to a feed that's in alphabetical order as my feed reader will only pull the top 25 and never update. RSS feeds are expected to be in chronological order. As FoamyGuy said last publish date is how RSS feeds notify you of updates.

#

That's how Adafruit's Blog RSS works.

proven garnet
#

Thank you!

tulip sleet
midnight ember
#

Where should I open it? Circuit Python main?

lone axle
midnight ember
#

Didn't even know that was a repo. Will do.

lone axle
midnight ember
#

bookmarked, thank you.

manic glacierBOT
midnight ember
#

Helped with closing an issue that was 967 days old. 🀝

onyx hinge
#

yeah but back when the issue was opened you probably couldn't have calculated that it would be open for 967 days

manic glacierBOT
lone axle
manic glacierBOT
manic glacierBOT
tulip sleet
#

@lone axle do you see this?

manic glacierBOT
lone axle
#

oh

tulip sleet
#

are you looking at your fork or adafruit/circuitpython?

lone axle
#

now it's populated

tulip sleet
#

!!

manic glacierBOT
lone axle
#

okay, that saved but made way too many unrelated changes in the PR now. I'll start over on a new branch from 9.0.x

manic glacierBOT
orchid basinBOT
#

I think one way to change this is with the loop here: https://github.com/adafruit/circuitpython-org/blob/ec8c7044857e010c500eac3c9fd280fb25f4aeab/feed.html#L11

This jekyl template docs page shows an example of ording by a specified field: https://carpentries-incubator.github.io/jekyll-pages-novice/arrays/index.html unfortunately it doesn't seem to have anchors for direct linking and it's near the bottom of the page, here is an excerpt of the relevant code:

{% assign sorted_posts = ...
manic glacierBOT
proven garnet
#

@lone axle I should have gone through all the circup instruction fixes

midnight ember
#

glad to know the RSS issue wasn't just my perspective. thank you Melissa.

orchid basinBOT
#

resolves #1354

After this change there were two devices showing up at the top of the list (out of chronological order) It turns out the date parsing format is very specific, it needs 4 digit years and zero padded single digits, with those changes these devices now get put into the proper place of the order.

Worth considering breaking out the Blinka boards as a separate feed. Right now they effectively get rendered one after another in the same giant RSS feed. This means they won't ever...

midnight ember
#

How would you name the 2 feeds? Blinka RSS & Microcontroller RSS?

#

I like the idea of separate feeds. I would be far more interested in subscribing to a latest circuit python microcontroller latest boards feed since I don't use SBC's or micropython.

orchid basinBOT
manic glacierBOT
orchid basinBOT
#

This also reformats all front matter due to how the file is processed.

The transformation was done with

import datetime
import sys
import frontmatter

for i in sys.argv[1:]:
    post = frontmatter.load(i)
    date_added = post.get("date_added", "")

    if isinstance(date_added, str):
        try:
            date_added = datetime.datetime.strptime(date_added, "%Y-%m-%d").replace(hour=12)
        except ValueError as exc:
            print(f"Failed to parse date {date_a...
digital shoreBOT
#
adafruit
Owner

.adafruit

Members

38,953

Roles

38

Category Channels

8

Text Channels

64

Voice Channels

7

Threads

21

Boost Count

22 Boosts (Tier 3)

orchid basinBOT
tulip sleet
#

@slender iron i was going to start looking at the deepsleep bug (9067) unless you have a clear idea of what this is.

slender iron
#

not really though I didn't read it closely

#

I am tempted to get sleep going on the Cx series at the same time

tulip sleet
#

it's waking up immediately on a pin alarm

#

i have one C3 board I could see about. But I think I would fix that first standalone

slender iron
#

ya, and the apis may have changed with 5.2

manic glacierBOT
orchid basinBOT
slender iron
#

rebases

#

my git isn't fetching commits

#

hrm, I messed it up

manic glacierBOT
manic glacierBOT
#

PicoW + WIZnet W5100S hat gets MemoryError: in the context.wrap_socket() line, not sure how to debug or proceed from there. gc.mem_free() = 76064 after the exception.

this may simply not be a good combo, with wifi taking up extra RAM. I think SSL needs some large blocks of memory that may simply not be left after parsing in all the wiznet code. anyway, that's a total guess.

tidal kiln
#

is this related to something known?

Adafruit CircuitPython 9.0.0 on 2024-03-19; Adafruit-Qualia-S3-RGB666 with ESP32S3
>>> import cm_test
----------------------------------------
Fetching from http://wifitest.adafruit.com/testwifi/index.html
Traceback (most recent call last):
  File "adafruit_connection_manager.py", line 271, in get_socket
OSError: [Errno 113] ECONNABORTED

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

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "cm_test.py", line 32, in <module>
  File "adafruit_requests.py", line 597, in get
  File "adafruit_requests.py", line 535, in request
  File "adafruit_connection_manager.py", line 282, in get_socket
RuntimeError: Error connecting socket: [Errno 113] ECONNABORTED
>>> 

where cm_test is this example from the library:
https://github.com/adafruit/Adafruit_CircuitPython_ConnectionManager/blob/main/examples/connectionmanager_helpers.py

tulip sleet
tidal kiln
#

hmm. maybe. i just loaded the libs. but took them from a bundle zip from a guide example.

#

let me try a manual loading of the libs directly from the main bundle zip

tulip sleet
#

it could just be a bug in the cm test

tidal kiln
#

i originally hit it through the qualia support lib

#

but then recreated more directly as above

#

qualia.get_local_time() end up with same error

tulip sleet
#

is your settings.toml in good shape?

#

I'd try this with some other moregeneric ESP32-S3 board

manic glacierBOT
tidal kiln
#

@danh library updates seems to have fixed it

#
Adafruit CircuitPython 9.0.0 on 2024-03-19; Adafruit-Qualia-S3-RGB666 with ESP32S3
>>> import cm_test
----------------------------------------
Fetching from http://wifitest.adafruit.com/testwifi/index.html
Text Response This is a test of Adafruit WiFi!
If you can read this, its working :)
----------------------------------------
>>> 
tulip sleet
#

could you download the bundle again and see if there's a library difference?

tidal kiln
#

still got the zip...looking...

#

how do you diff .mpy's ?

#
$ diff lib1/adafruit_connection_manager.mpy lib2/adafruit_connection_manager.mpy 
$ diff lib1/adafruit_requests.mpy lib2/adafruit_requests.mpy 
#

no diff

manic glacierBOT
#

I can't see how it would have anything to do with your issue, but it looks like you're overwriting your IMPORT_EXCEPTION variable after the import attempt. You probably want to test that the variable wasn't already initialized before setting IMPORT_EXCEPTION to None. I'm sure there's a better way but something like:

try:
    a = IMPORT_EXCEPTION
except:
    IMPORT_EXCEPTION = None

Thanks. Maybe it would be sufficient to move the line with `IMPORT_EXCEP...

tulip sleet
tidal kiln
#

still same. let me see if i can recreate the issue.

#

still same = versions agree using strings

#

1.0.1 and 3.0.1

#

@tulip sleet nevermind. can't reproduce. something must have just been weird.

tulip sleet
#

🀷 that is odd, if it happens again ...

tidal kiln
#

@tulip sleet hmm...actually, still seeing some weirdness. qualia.get_local_time() not working again. and different error this time.

Adafruit CircuitPython 9.0.0 on 2024-03-19; Adafruit-Qualia-S3-RGB666 with ESP32S3
>>> from adafruit_qualia import Qualia
>>> from adafruit_qualia.graphics import Displays
>>> qualia = Qualia(Displays.ROUND28)
>>> qualia.get_local_time()
Connecting to AP peanuthamper
Getting time from IP address
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_portalbase/__init__.py", line 492, in get_local_time
  File "adafruit_portalbase/network.py", line 270, in get_local_time
  File "adafruit_portalbase/network.py", line 237, in get_strftime
  File "adafruit_requests.py", line 597, in get
  File "adafruit_requests.py", line 535, in request
  File "adafruit_connection_manager.py", line 236, in get_socket
gaierror: (-2, 'Name or service not known')
>>>
#

and after a soft reset:

Adafruit CircuitPython 9.0.0 on 2024-03-19; Adafruit-Qualia-S3-RGB666 with ESP32S3
>>> import cm_test
----------------------------------------
Fetching from http://wifitest.adafruit.com/testwifi/index.html
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "cm_test.py", line 32, in <module>
  File "adafruit_requests.py", line 597, in get
  File "adafruit_requests.py", line 535, in request
  File "adafruit_connection_manager.py", line 236, in get_socket
gaierror: (-2, 'Name or service not known')
>>> 
tulip sleet
#

that looks like this code:

        addr_info = self._socket_pool.getaddrinfo(
            host, port, 0, self._socket_pool.SOCK_STREAM
        )[0]
tidal kiln
#

somethings getting into a weird state

#

after a power cycle:

Adafruit CircuitPython 9.0.0 on 2024-03-19; Adafruit-Qualia-S3-RGB666 with ESP32S3
>>> import cm_test
----------------------------------------
Fetching from http://wifitest.adafruit.com/testwifi/index.html
Text Response This is a test of Adafruit WiFi!
If you can read this, its working :)
----------------------------------------
>>> 
tulip sleet
#

i think it is just doing a DNS lookup

#

try some other board, and try older versions of 9.0.0. But I am wondering a little bit about your local network. Could try phone hotspot as an alternative

tidal kiln
#

any specific 9x?

tulip sleet
#

beta 0, alpha 4, but that's just a rough guess.

tidal kiln
#
Adafruit CircuitPython 9.0.0-beta.0 on 2024-01-27; Adafruit-Qualia-S3-RGB666 with ESP32S3
>>> from adafruit_qualia import Qualia
>>> from adafruit_qualia.graphics import Displays
>>> qualia = Qualia(Displays.ROUND28)
>>> qualia.get_local_time()
Connecting to AP peanuthamper
Getting time from IP address
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_portalbase/__init__.py", line 492, in get_local_time
  File "adafruit_portalbase/network.py", line 270, in get_local_time
  File "adafruit_portalbase/network.py", line 237, in get_strftime
  File "adafruit_requests.py", line 597, in get
  File "adafruit_requests.py", line 535, in request
  File "adafruit_connection_manager.py", line 236, in get_socket
gaierror: (-2, 'Name or service not known')
>>> import cm_test
----------------------------------------
Fetching from http://wifitest.adafruit.com/testwifi/index.html
Text Response This is a test of Adafruit WiFi!
If you can read this, its working :)
----------------------------------------
>>> 
#

@gilded cradle hey, any ideas on above?

gilded cradle
#

Let me catch up...

tulip sleet
#

@tidal kiln I'll be afk for maybe an hour

gilded cradle
#

@tidal kiln I'm not familiar with connection manager. Name or service not known looks important, but it doesn't really give much info.

#

Also not familiar with gaierror

tidal kiln
#

am i being dumb in how im using the qualia lib?

gilded cradle
#

I'm going to look at the connection manager code and see if there's anything that stands out

#

@tidal kiln in adafruit_requests, line 535 is a comment on GitHub. Are you sure it's up to date?

slender iron
#

@tulip sleet I'm going to have to back out my i2c changes because the esp32-camera is using the old api still

tidal kiln
#

@gilded cradle hmm....well its from latest bundle. but latest bundle is:

gilded cradle
#

@tidal kiln yeah, there was a release of requests 3 days ago. Maybe bundles aren't building for some reason?

tidal kiln
#

yah. looks like. seriously doubt there have been no library updates since 3/7

gilded cradle
#

@tidal kiln maybe download some of the files manually from repos just to test your code and then we can fix the bundle releaser (not sure where it is or how it's done).

slender iron
#

I wonder why its broken

gilded cradle
#

Not sure, but I don't recall seeing a release in quite q while

slender iron
gilded cradle
slender iron
#

I clicked the enable button

#

they haven't run immediately

lone axle
#

I wonder if there is a way to disable the idle based disabling.

gilded cradle
#

Ah ha, cool

lone axle
#

it's a bit odd that we have to make changes to Adabot every 60 days in order to keep the bundle building

gilded cradle
#

I think the bundle is on a cron, so will likely only run starting later tonight

slender iron
#

I don't see one in the settings

lone axle
#

maybe if the action were moved from Adabot over to the Bundle repo it wouldn't be able to hit 60 days because any time it releases I assume it counts as "activity" so it will be resetting it's own timeout anytime any library changes.

#

it could still clone and use adabot code from inside of the action I think even if it were moved to the Bundle repo.

tidal kiln
#

.github/workflows/cron_keepalive.yml?

gilded cradle
#

That makes sense to me @lone axle

proven garnet
#

Catching up but I think the cron settings live in circuitpython-org for certain things, that runs adabot

slender iron
proven garnet
#

I think the bundle is one of them

lone axle
#

if that committed the current file when it runs (replacing the old one if we don't want 2 complete archives) it would mean there is activity every day.

#

Ah interesting, that one has a direct API to re-enable it.

proven garnet
#

Is the issue that adabot needs a daily update?

gilded cradle
#

Maybe not daily, but probably at least semi-regularly.

lone axle
proven garnet
#

Why is that? I don't see anything in the workflow regarding that. I assume I'm missing something.

tidal kiln
#

it was in screen shot above

proven garnet
#

Thanks! Also, wacky!

#

Could we tie it to the bundle repo itself?

gilded cradle
proven garnet
#

Gotchya, sorry about that, thanks!

manic glacierBOT
gilded cradle
tidal kiln
#

@gilded cradle i tried to manually grab latest libs, but still getting same weirdness. but could still be related to something in the libs. will wait till bundle release is fixed and try again.

gilded cradle
#

ok, I suspect it will work tonight.

tidal kiln
#

yep. it'll be next week until i can try this again. but its just initial steps for something non-urgent. so can wait.

#

thanks all for looking into this!

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0 on 2024-03-19; Raspberry Pi Pico W with rp2040

Code/REPL

import math
import time
import gc

import board
import audiomixer
import synthio
import audiopwmio
import ulab.numpy as np

SAMPLE_RATE = 32_000
MIXER_BUFFER_SIZE = 2048

audio = audiopwmio.PWMAudioOut(board.GP18, right_channel=board.GP19)
mixer = audiomixer.Mixer(channel_count=1,
                         sample_rate=SAMPLE_RATE,
     ...
short tendon
#

Do you all want to stick with the current line length? I personally like 120, but have no strong preference...

tulip sleet
manic glacierBOT
#

A "once" waveform cannot in general interpolate between the last and first entry. This would, for instance, make a sweep with waveform [0, 37678] be wrong: it would become a triangle waveform. So, something "had to give".

My choice was to change how a once_lfo=LFO(once=True) interpolates across its cycle, compared to a normal_lfo=LFO(once=False): Consider the case when phase is exactly .999: normal_lfo.value should be almost exactly waveform[0] (plus a tiny bit of waveform[3] in ...

manic glacierBOT
midnight ember
#

I've run into many gaierrors in the past with requests projects that are online 24/7. I think it's wifi or dns lookup related. Used to get them all the time with 8.2.5, updated my main project to 8.2.7 and haven't had any issues. I think a lot of it also might have to do with the way the socket is continually retried inside a while loop.

#
response = requests.get(DATA_SOURCE).json()
response.close() # this has issues closing sockets and can lead to gaierror if using an explicit response.close()
vs
response = requests.get(DATA_SOURCE)
json_response = response.json()  
response.close() # this is a little longer but plays much nicer with socket close
```  I haven't encountered a gaierror since about 8.2.5.  It has more to do with syntax and placement of additional requests within a while true loop.  it can allow it to iterate too many times if a failure occurs.  instead of gracefully failing a gaierror is a crash.  i think what i did to get around it just a general exception handler that will break or trigger microcontroller.reset.  i've literally never had to touch it since. it's probably been up and running flawlessly for more than a month now.
#

snippet to try ```py
while wifi.radio.ipv4_address:
try:
print("| | Attempting to GET Weather!")
if debug_OWM:
print("Full API GET URL: ", DATA_SOURCE)
print("\n===============================")
with requests.get(DATA_SOURCE) as owm_request:

                # uncomment the 2 lines below to see full json response
                # warning: returns ALL JSON data, could crash your board
                # dump_object = json.dumps(owm_request)
                # print("JSON Dump: ", dump_object)
                try:
                    owm_response = owm_request.json()
                    if owm_response["message"]:
                        print(f"| | ❌ OpenWeatherMap Error:  {owm_response['message']}")
                        owm_request.close()
                except (KeyError) as e:
                    splash_label.text = "Getting Weather..."
                    owm_response = owm_request.json()
                    print("| | Account within Request Limit", e)
                    print("| | βœ… Connected to OpenWeatherMap")
#

i will be updating it to 9.0 soon

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.1-52-g84e937f1c4 on 2024-03-20; Raspberry Pi Pico W with rp2040

Code/REPL

import board
import bitbangio
import digitalio
import time


def doit():
    with digitalio.DigitalInOut(board.GP13) as en:
        en.switch_to_output(value=True)
        time.sleep(1)
        with bitbangio.SPI(clock=board.GP15, MOSI=board.GP14) as spi:
            spi.try_lock()
            spi.configure(baudrate=1...
#

Fixes https://github.com/adafruit/circuitpython/issues/9074

Manually verified with this code before and after the change.

import board
import bitbangio
import digitalio
import time


def doit():
    with digitalio.DigitalInOut(board.GP13) as en:
        en.switch_to_output(value=True)
        time.sleep(1)
        with bitbangio.SPI(clock=board.GP15, MOSI=board.GP14) as spi:
            spi.try_lock()
            spi.configure(baudrate=10, polarity=1, phase=0, bits=8)
  ...
midnight ember
#

Figured out what is responsible for changing all the LF's to CRLF's. It's Github Desktop. Here's a file in Notepad++ with line endings specifically setup to do LF and save as Unix. As soon as I import into Git it changes them and notifies me about it with a yellow warning.

empty salmon
#

Is it possible to set the "board description string" during init vs at compile time?

Alternately, is there an informational string which can be set during init?

stuck elbow
#

anything you print in boot.py goes to boot_out.txt

#

not sure where exactly you want to have access to that string?

empty salmon
#

Let me try to clarify: I am talking from the firmware for the board.
Is there any text which can be set in the board_init() which is accessible to a user from their code.py?

stuck elbow
#

I mean you have access to everything in memory, you could just set some string in any module

onyx hinge
#

most everything "in a module" is designed to be read-only, so that it goes in flash. Module dictionaries are read only, and of course strings are all immutable. So, it'll be more than just putting something in board init, unless there's some facility that already exists and I'm just not thinking of it.

manic glacierBOT
onyx hinge
#

you could put a function in board module that returns the value in question, that might be easiest

#

board.submodel() or whatever your goal is

#

or you might be able to make the whole board module MP_DEFINE_MUTABLE_DICT but that also allows unlimited user modification (and I'm not sure that really works across soft resets)

empty salmon
#

I was not aware of board.submodule(). I will look for an example.
The issue is not a showstopper but it could be useful to the end user.

onyx hinge
#

oh, that is something I just made up

#

you can put about whatever you want in the board module, you could make your own function

orchid basinBOT
#

I tested this out locally and it does look like it's working successfully to me. The contents of the local RSS are now intermixed and represent reverse chronological order of release. This does feel like it's most correct to my mind, I would be in favor of merging this change.

With that being said, practically speaking inside of "FeedR" (Android RSS reader app) it doesn't seem to make a difference. Both the local feed from this branch, and the currently live feed on the real site are sorte...

onyx hinge
#

I'm back on an old idea: introducing a deinitialized TYPE. I believe that overall this can reduce code, but it entails a bunch of changes. This is only compile-tested on rp2040 macropad but it gives the idea: https://github.com/adafruit/circuitpython/compare/main...jepler:circuitpython:deinited-type2?expand=1

many "check for deinit" calls can be removed, because for instance once an I2C object has had its type changed to Deinitialized, you can't call the C function busio_i2c_scan from Python code with that object anymore.

This change decreases flash usage by 356 bytes(!) and for some reason even frees up 16 bytes of RAM. That's enough that I feel like I must have messed up my measurements. The bulk savings may come from properly marking raise_deinited_error() as NORETURN, not sure.

#

@slender iron @tulip sleet while I shouldn't go further down this tangent road right now your thoughts would be valuable.

orchid basinBOT
onyx hinge
#

addendum: 392 bytes saved on rp2040 macropad just by marking NORETURN but 0 bytes on trinket_m0. I think this is because with LTO, the compiler is able to effectively determine that raise_deinited_error() does not return. rp2040 doesn't use lto.

onyx hinge
#

@gilded cradle do you know why 12 hours was being added to all the times? <pubDate>{{ board.date_added | date: '%s' | plus: twelve_hours | date_to_rfc822 }}</pubDate>

gilded cradle
#

@onyx hinge probably to mitigate an issue with tiemzones or something

empty salmon
#

@onyx hinge - is there documentation or an example of a board with a custom function (or property) exposed to the end user?

onyx hinge
#

@empty salmon not that I see with a full text search

tulip sleet
# onyx hinge <@252717193496756235> <@329766224093249548> while I shouldn't go further down th...

This is an interesting idea. One question I have is how it would affect some singletons. Admittedly this could be pathological:

>>> import board
>>> i = board.I2C()
>>> i.deinited()
>>> i.unlock()   # a harmless operation: works
>>> i.deinit()
>>> i.unlock()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Object has been deinitialized and can no longer be used. Create a new object.
>>> i = board.I2C()
>>> i.unlock()   # works again
>>> 
#

I can imagine a use case where you deinit `board.I2C() to do something DigitalInOut'ish on its pins, like force an I2C bus reset. Then you create it again. Would your change prevent that?

#

@empty salmon what name it that you're computing in board.c that's going to vary? Can you explain the use case?

onyx hinge
#

@tulip sleet my proposal would make i.unlock() throw instead of being "harmless".

#

er the unlock-after-deinit already throws so that's fine, it would still throw

fringe yarrow
#

@slender iron In regards to that Parallel Display all in one board that's been keeping me up at night, at your suggestion, I've hooked D0-D7, WR,RD,DC,CS up to a logic analyzer and the results seem strange to me. I can clearly see the init sequence I have specified in the board.c, however, with commands sent without data parameters (ie 0x21, 0, i can see the 0x21 signal which lasts 10 milliseconds, however commands with data parameters only last for 7microseconds, with data parameters lasting 300 nanoseconds..

empty salmon
#

@tulip sleet - The use case is mostly theoretical at this point.

From my prior query, I have a board that will have a minor variance. Because of display availability, the board will ship with one of 2 displays. They are functionally so similar I would rather not end up with 2 firmware. Within board_init() I am able to detect which display it has and use the appropriate init code.

I was thinking it might be nice for the end user to be able to detect the variance from within their code.py.

It's not critical by any means.

tulip sleet
empty salmon
#

Thanks @tulip sleet !

tulip sleet
#

i wonder in the long run in we might just as well merge board.c and pins.c, since pins.c implements board πŸ™‚

slender iron
slender iron
#

@onyx hinge it crossed my mind to try and "move" management of memory from the VM to TLSF at the end of the VM's execution.

#

the memory would stay in the same place, it'd just change who manages it

empty salmon
#

@slender iron - that is my plan.
TBH: the value of having a board function is really for support in the event of an issue being reported.

slender iron
#

how are you detecting the difference? could you tell from a photo? that's one of the first things we usually ask for

onyx hinge
tulip sleet
#

so you don't have to depend on software to distinguish them

#

from a support point of view (suppose one display turns out to fail more often) I think that might be better

orchid basinBOT
#

.. leading zeros are required for frontmatter to treat them as dates
rather than strings, apparently per the YAML specification.

This was done by script:

import re
import datetime
import pathlib
import sys

import frontmatter

rx = re.compile(r'^(\s*)date_added:.*$', re.M)

for path_str in sys.argv[1:]:
    print(path_str)
    path = pathlib.Path(path_str)

    post = frontmatter.load(path)
    date_added = post.get("date_added", "")

    if isinstance(date_added...
empty salmon
#

I will add something to the silkscreen on the board to denote difference.
The other value to "being able to detect in code" is I typically develop a library of example code and if there was a reason to "do something different" then I could detect in code.
Again, "nice to have" vs "important to have".

tulip sleet
#

@slender iron ESP-IDF v5.1.3 broke pin wakeups that go high to wake up. I keep editing my post in the issue to add details. I have tracked down some IDF changes about this. I am going to see if this is a regression that was fixed later.

slender iron
tulip sleet
#

if it's working sure

slender iron
#

ya, I had to roll back the i2c changes but it boots and runs

#

the camera code stops working once I insert an SD card so I need to debug that

tulip sleet
#

i cloned your repo but the main branch seems to be way out of date. I'm confused. I know you forked from micropython, not circuitpython

slender iron
#

I never update main

tulip sleet
#

ha!

slender iron
#

I only have feature branches

tulip sleet
#

and you never delete branches either πŸ™‚

slender iron
#

git switch -c feature_branch adafruit/main

#

I never delete anything if I can help it πŸ™‚

#

I just buy bigger hard drives

#

bundle was released overnight!

tulip sleet
#

how did it get kicked to run again?

slender iron
#

I clicked the "Enable workflow" button

tulip sleet
#

so it gets unenabled every 60 days if something-something doesn't happen? I missed part of that discussion

slender iron
#

jim said 1.23 is a couple weeks out and has no mpy version changes

#

1.24 may not have mpy changes either

tulip sleet
#

sounds good; I could do the merge, and can also work on upstream PR's

slender iron
#

I think we did want to block the bulk reset removal on it

proven garnet
#

@tulip sleet I released the GPS library, thanks for the quick fix.

#

I assume that happened as a result of the release I did yesterday

tulip sleet
#

I decided it was too easy not to do immediately

tulip sleet
manic glacierBOT
#

@dtorres-sf I reproduced this problem, and started to track it down, as noted above. I think it may be a bug in ESP-IDF, not in our code. However, we are going to upgrade to ESP-IDF v5.2.1 in CircuitPython 9.1.0. When I test with ESP-IDF v5.2.1, the problem goes away.

So at this point, I don't think it is worth a temporary fix for this.

We should have a beta 9.1.0 fairly soon. In the meantime, could you stick with 8.x.x? Another alternative, if easy for you, is to make your pushbutton p...

manic glacierBOT
ornate breach
#

is there a trick to running pre-commit on M1 Macs?

tulip sleet
ornate breach
#

not sure the exact issue other than it appears to have issues with importing modules

#

it also happens on my intel mac so it doesn't appear to be related to the system architecture for me

#
          [end of output]```
#

likely an issue with my setup

orchid basinBOT
mortal kernel
ornate breach
#

yeah, I agree

#

getting back into these things after not doing them for a while

onyx hinge
#

@ornate breach it's a problem with very old pylint (still required in some of our repos). If you search the channel for "impimporter" you'll see other folks who've run into it. (including me) in github CI we've pinned python3.11 for running pre-commit for this reason. #circuitpython-dev message

#

old pylint + specific install method used by pre-commit + python 3.12 = broken

ornate breach
#

oh okay, that makes sense. somehow my intel mac is still on python 3.8 xD

#

my mac mini is on 3.12 though

onyx hinge
#

there's currently some interest in switching to ruff, which would replace pylint. which would be yay

manic glacierBOT
tulip sleet
#

@slender iron so 5.2 can't be in 9.1.0 because you need I2C updates for espcamera? I thought that both the old and new i2C APi was available, but maybe that was in 5.1.x.

slender iron
#

both are available in 5.2

orchid basinBOT
#

I noticed while testing the other RSS feed changes that the images weren't loading successfully (at least in the client app I tested which was FeedR on Android). They appeared as "broken image" icons.

Inspecting the code of the feed item within the app revealed that the image URLs were relative rather than absolute. When the page gets rendered in an HTML page that works fine because the client browser will know it's relative to the host of the page being viewed.

I don't know if RSS spe...

main furnace
#

I'm wondering what it would take to add displayio to the unix CircuitPython port. I would like to do unit tests for displayio. I've also uploaded the executable to ChatGPT and can have it write and run code for me.

manic glacierBOT
#

If you publish a lot more frequently to the local MQTT broker, does it fail faster?

We would be quite interested in a test program that is a minimal (fast) reproducible example. For instance, if you send fake data as opposed to actually reading the sensor, does it make any difference?

No, in fact is seems more stable. I have reduced the code to an endless loop that merely sends random data to the local broker:

    while True:                                            ...
fringe yarrow
#

Does anyone have a minute to walk me through the process of getting a valid CREATOR / CREATION ID to submit a new board? I believe I have something worth submitting in terms of popuarity, price point, and features. I think I get it, but want to make sure I do it right..

manic glacierBOT
fringe yarrow
#

or i guess there's no reason not to use the UUID mapper, given the lack of branding of the hardware

slender iron
#

you can make a creator ID for the board designer and then a separate file for the board ids

fringe yarrow
#

I'll give it a go..

tulip sleet
ornate breach
alpine rapids
#

~~Hi! I'm working on adding a new board to CircuitPython and I'm almost done. The board is an ESP32-S3, and for some reason, the only way I can get it to properly install is by flashing the tinyuf2 combined.bin bootloader to the board with esptool.py, then install the firmware.uf2 that I've compiled. I've tried just flashing the firmware.bin (and tried the circuitpython-firmware.bin) that I've compiled, but those don't seem to work. I've also found, in the build directory/esp-idf subdirectory, this flash_args file:

0x0 bootloader/bootloader.bin
0x410000 circuitpython.bin
0x8000 partition_table/partition-table.bin
0xe000 ota_data_initial.bin

I'm able to locate the bootloader.bin and partition-table.bin files, but the other 2 files aren't anywhere in the build directory. Is there something I'm missing about how .bin files get built for Espressif boards? Just to reiterate, the .uf2 file works fine~~

edit: sorry, this can be ignored, I think I just needed to do a make clean

ornate breach
manic glacierBOT
#

@h-milz This works for me, when #define ULAB_SUPPORTS_COMPLEX (1). You have to give the dtype explicitly.

Adafruit CircuitPython 9.0.0-1-gdc69c29dac-dirty on 2024-03-22; Adafruit Feather RP2040 with rp2040

import ulab.numpy as np
np.array([1,2,3])
array([1.0, 2.0, 3.0], dtype=float32)
np.array([1,2,3+0j])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
np.array([1,2,3+0j], dtype=np.complex)
array([1.0+0.0j, 2.0+0.0j, 3.0+0.0j], dtype=com...

ornate breach
manic glacierBOT
manic glacierBOT
#

@h-milz This works for me, when #define ULAB_SUPPORTS_COMPLEX (1). You have to give the dtype explicitly.

This is actually a good point. I should, perhaps, inspect the arguments of array, and depending on the results, decide on the dtype. But that raises a question about the design concept: array defaults to float, because float was the most-inclusive dtype at the beginning. We have added complex since, so, if we don't want to default to complex, then we can't really save the...

manic glacierBOT
manic glacierBOT
#

I should, perhaps, inspect the arguments of array, and depending on the results, decide on the dtype

@v923z That would make it work more like numpy, I suppose. You would know better if there are any traps introduced by such a change. It would require scanning all of the input values, since the user might have passed in, say, a mixed int/float list. I'm not sure if that counts as an expensive operation or not.

tulip sleet
manic glacierBOT
manic glacierBOT
#

I posted this issue up in the forum (https://forums.adafruit.com/viewtopic.php?t=209383), but have gotten no responses, so I figured I would post the issue here.

Currently running CircuitPythone 8.2.6 on Raspberry Pico W.
My code looks like the following snippet:

===================

import adafruit_sdcard
import storage
....

sdcard = adafruit_sdcard.SDCard(spi1, digitalio.DigitalInOut(sd_cs))

vfs = storage.VfsFat(sdcard)

//# The following line FAILS if there is NO Termina...

manic glacierBOT
#

I don't think this is a generic CP issue, I no longer have a keyboard feather wing but I'm pretty sure I used to mount SD cards on the keyboard feather wing with CP 7.x and 8.x using a Raspberry Pi Pico without a terminal connected. I do the same thing regularly using Espressif chips/boards using CP 9.x.

I have seen intermittent mount failures with some SD cards after soft board resets and have taken to ejecting and reinserting the card and/or power cycling the board if I encounter mount ...

short tendon
#

Does CP support yield from?

manic glacierBOT
tulip sleet
# short tendon Does CP support `yield from`?

it should. I was confused by the mpy-cross error you got in that library. This works, for instance:

>>> def g():
...     for i in range(3):
...         yield i
>>> list(g())
[0, 1, 2]
>>> def h():
...     yield from g()
>>> list (h())
[0, 1, 2]
short tendon
#

I ask, because I was working through the ruff library tests and got that in pycamera. I'll make the change and see if I can compile it

#

Would be curious if anyone thinks we shouldn't ignore any of those...

tulip sleet
#

PLR2004 I can understand suppressing, because a lot of the "magic" numbers are definitely fixed and don't need naming. Plus names take space and are slower.
UP028 if it works is good (yield-in-for-loop)
UPO31 (don't use consecutive {0} {1} etc.) is worth appying
UPO32 (f-strings) I would also fix because it's almost always better and smaller

short tendon
#

okay, yield from compiled fine...

tulip sleet
short tendon
#

does mpy-cross fail if it's an invalid f-string style?

tulip sleet
tulip sleet
#

I don't think it fails hard, it gets the wrong result

short tendon
#

So I would worry someone writes code, run lints, changes it to an invalid f-string and it isn't tested and caught...

tulip sleet
#

it just means the PR's that change code need review by humans

#

which should happen anyway

manic glacierBOT
#

I don't think so but the other two examples (Espressif:M5 Stack Cardputer/Raspberrypi:Cytron EDU Pico W) I spotted used a different construct in mpconfigboard.h

#define CIRCUITPY_BOARD_SPI (1)
#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO18, .mosi = &pin_GPIO19, .miso = &pin_GPIO16}}

I'm not sure that's necessary though, I suspect the existing DEFAULT_SPI_BUS statements will also work.

idle owl
#

Is there a way to speed up refresh rate on eink in CircuitPython? The refresh rate on the default program that came with this thing was super zippy, and in CP, it's significantly slower. I know there are things built in to keep it from refreshing too often, but I don't understand why the speed is affected. The default program had a menu chooser, and flipping between things was super fast and responsive. It was likely MicroPython.

#

I expected that part to remain the same, but displaying this rectangle is super slow.

#

I guess I'm not sure what refreshing text or refreshing based on button presses looks like, I haven't tried yet.

tulip sleet
#

displayio is not that fast; If it was MicroPython it was probably using framebuffer, which is simple and mostly in C

#

but doesn't have groups, etc.

idle owl
#

Ah fair enough.

#

Bummer.

#

I'll have to seriously rethink my plans for this board then.

#

I thought of everything based on the speed of the program it shipped with. πŸ€·πŸ»β€β™€οΈ

tulip sleet
#

which board?

idle owl
#

Pimoroni Badger2040W.

#

I was going to try to implement a game or two. Turn based, not live action or anything. But I'll have to keep the speed in mind now.

#

Make it a badge, have something interactive, and remote control the LEDs I added to it.

#

The latter has no cares about the display speed. So that's easy enough.

#

I think it'll be fine, it's mostly rearranging my expectations is all.

tulip sleet
#

you could have someone review your displayio code. There may be ways to speed it up. I ma not the greatest person for that though, I've never written a significant displayio program from scratch

manic glacierBOT
#

Looking at the schematic, it also looks like the board would support 4 bin SDIO connections. I don't have any experience with using that but I believe sdioio.SDCard should support it so you may want to at least add the SDIO D2 pin GPIO38

{ MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) },

It could be confusing to add six specific SDIO pin names since some of them overlap with the SD_SPI pins.

idle owl
#

Tim is going to be helping me with the whole thing, I'm sure he can help there as well.

#

Thanks for the suggestion!

#

There's almost nothing to it at the moment. I haven't done displayio stuff either, really. So I'm struggling to even get a rectangle to display. πŸ˜„

#

The screen is black, but only a third of it should be, so obviously I don't know what I'm doing.

#

Β―_(ツ)_/Β―

#

Fun little board, though. No RGB LEDs so I soldered a STEMMA QT cable to a NeoPixel stick, and tah-dah, RGB LEDs. I'll incorporate it into the 3D printed case we're designing.

#

Alright, lunch time here. Thanks for the info and suggestion, @tulip sleet! Appreciated as always.

short tendon
#

6 draft PRs for BME680, NeoPixel, PortalBase, PyCamera, PyPortal and Requests. All have commits in this order:

  1. Add ruff formatter
  2. Add ruff isort
  3. Add ruff lint
  4. Add ruff upgrade
  5. remove upgrade UP028
  6. remove upgrade UP031
  7. remove upgrade UP032
#

Happy to add to in-the-weeds if this would be a good use of time

tulip sleet
manic glacierBOT
manic glacierBOT
#
ure

Many thanks,

requested a pid over there ;')_

On Tue, Mar 19, 2024 at 2:14 PM Dan Halbert @.***>
wrote:

Note https://pid.codes, if your product is open source.

β€”
Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/pull/9060#issuecomment-2007147353,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJRTN25D6R7CHSTX5DG673YZA24PAVCNFSM6AAAAABE5FB6MWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBXGE2DOMZ...

manic glacierBOT
#

Not working yet.
I've changed your mpconfigboard.mk to include Adafruit_ESP32_Spi library as frozen module.

`
USB_VID = 0x2886
USB_PID = 0x80F4
USB_PRODUCT = "Seeeduino Wio RP2040"
USB_MANUFACTURER = "Seeed"

CHIP_VARIANT = RP2040
CHIP_FAMILY = rp2

EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ"

CIRCUITPY__EVE = 1
CIRCUITPY_PICODVI = 1

Include these Python libraries in firmware.

FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_ESP32SPI
FROZEN_MPY_DIRS += $(TOP)/frozen/Ad...

manic glacierBOT
manic glacierBOT
ornate breach
#

It’s a cute little game to catch cows in a field

#

Using displayio (with st7789 TFT though)

idle owl
#

@ornate breach Yeah this is an eink, so it has to be something pretty static, and definitely turn based so there's an obvious reason to pause while it refreshes. πŸ˜„

#

This is neat though!

ornate breach
#

Yeah, makes sense. πŸ™‚ I figured it would be a good reference either way. It took me a bit to figure it all out with displayio

idle owl
#

I get so mired in all of it. My brain starts to glaze over.

#

It's frustrating because I can write LED code with my eyes closed, but displayio is like a completely separate language.

#

But that is due to my history with coding, heh. I recognise that.

ornate breach
#

It’s still a fun journey with displayio currently. I made one game and am working on others but it definitely takes a bit of mental fortitude to push through.

idle owl
#

I'm lucky to have Tim excited to help me out with it. πŸ˜„

ornate breach
#

Tim is really great at that kind of stuff, it’s definitely awesome of him to lend his talent 😎

idle owl
#

He wrote Snake for my last badge. This time we're coming up with some ideas, some more complicated than others. We'll see what happens. I'll definitely share the final result. 😊

midnight ember
idle owl
#

I had an LED wall for over a year. Never put one up in my office here.

#

I can't even call show() anymore in displayio. EVERYTHING CHANGED. :lolsob:

#

(I legit learned that today.)

midnight ember
#

Syndrome proved we can chain up to 25 matrix panels on a Matrix Portal S3. Matrix panels are a far more effective (and expensive) way of having a wall full of pixels.

idle owl
#

Hah! Probably less work to mount as well.

midnight ember
#

aww. yes. there was transitional code for show from 8x to 9.x and would be deprecated in 9.x There are sooo many breaking changes in 9.x that it's kind of like learning circuit python all over again.

idle owl
midnight ember
#

It should be worth it though. 9.x has a ton of great improvements.

manic glacierBOT
#

I should, perhaps, inspect the arguments of array, and depending on the results, decide on the dtype

@v923z That would make it work more like numpy, I suppose. You would know better if there are any traps introduced by such a change. It would require scanning all of the input values, since the user might have passed in, say, a mixed int/float list. I'm not sure if that counts as an expensive operation or not.

It's not cheap. The float-int distinction wouldn't even cut it, be...

manic glacierBOT
lone sandalBOT
midnight ember
#

finally figured out the CRLF issue for windows users. Go to C:\Users\Username\.gitconfig and modify ```py
[core]
autocrlf = input

#

autocrlf = false will fail. autocrlf = true will fail. autocrlf = input works.

midnight ember
#

Looks like I missed 1 example. Updated Youtube API example.

manic glacierBOT
#

NTP returns time in UTC (i.e. UK-time). But most of us don't live in UK, and we want our devices to run with local time. So you need two things: the device must know it's timezone and it must have all the logic and data available to convert UK-time to local time. So it must know the offset, the exact dates for DST-switch and so on.

You can hard-code all of this for your specific location, but as soon as you share your code other users will have problems.

So it is much simpler to query ...

manic glacierBOT
#

Be able to set the connection timeout is crucial in asyncio environments.

That's actually a bummer as I'm porting the MiniMQTT lib to asyncio to get a fully non-blocking experience. So at least for the connection phase it won't be that "non-blocking" for now.

In my case I would set the connection timeout very small and build a asyncio based retry mechanism on top. That would give other tasks time to run during connection failures.

manic glacierBOT
manic glacierBOT
#

That is what you usually do on PCs/laptops. But how will you do this on a MCU with limited amount of memory? And I am talking about programs you can put on Github that others can download and just use, without tinkering with the adjustment logic. With CircuitPython, we don't have a complete datetime.datetime module or any of the datetime.tz* modules. Unless you use adafruit_datetime as an addon-package. But that library has a large memory footprint as stated in the Readme.

From the t...

manic glacierBOT
#

I hear your points, and not arguing for or against. It would be nice if you could turn it on or off, or pick a build that had it enabled. I'll have to do some footprint comparisons in my own time.

I understand the goal of copy/paste code. I use the following for simple apps, which I find works fine on MCUs

import time

OFFSET = -60 * 60 * 5 # currently in CDT

def get_local_time(offset=None):
  if offset is None:
    offset = OFFSET
  return time.localtime(time.mktime(tim...
tiny peak
#

general question: Has anyone considered the potential for implementing a VNC server in CircuitPython that could present itself to a host computer over USB ethernet? I'm thinking of how:

  1. macOS Finder has a built in VNC client, and I'm guessing VNC is also easy to do on Windows and Linux
  2. Potentially VNC over USB-Ethernet would avoid the problems of DNS and TLS certificates that make it difficult to do HTTP-only web GUIs unless your server is running on localhost
#

Context for the VNC over USB-Ethernet idea:

GitHub

This enables rudimentary UVC support. Tested on Adafruit MacroPad RP2040.

Configure boot.py for UVC:
import usb_video
usb_video.enable_framebuffer(128, 96)

reset for boot.py settings to take effe...

#

One of the main use cases for such a thing would be to let a small, cheap device present a big comfortable configuration GUI without having to add a large display to your BOM.

manic glacierBOT
#

CircuitPython version

9.0.0-stable

Code/REPL

# SPDX-FileCopyrightText: 2024 Tyeth Gundry
# SPDX-License-Identifier: MIT

# the dotstar should use SPI pins, they'll be natively better setup for it.
# Neopixel on A3, POT on A2, dotstar on gpio 35+36, tacho on MISO,  4PST on
# A0(GPIO18),A1(GPIO17),SDA (GPIO7),SCL, mosfet on TX (GPIO5)
#
# NeoPixel on A3 (GPIO8)
# Potentiometer on A2 (GPIO9)
# DotStar on SPI pins:
# Data on GPIO35 (SCK)
# Clock on G...
manic glacierBOT
#

I tried to reproduce this on a QT PY ESP32 Pico with the following code.py:

import analogio
import board
import time
potentiometer = analogio.AnalogIn(board.A2)
while True:
    print("Hellorld!",potentiometer.value)
    time.sleep(10)

I got the same error after a soft reboot:

soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
  File "code.py", line 6, in <module>
es...
#

That could explain something. I had it written initially for a QTPY S2, and
thought I'd seen valid values, but to be honest can't be sure. I did just
realise at the pub I'm probably using analogio or the pin incorrectly.

On Sun, 24 Mar 2024, 18:10 RetiredWizard, @.***> wrote:

I tried to reproduce this on a QT PY ESP32 Pico with the following code.py:

import analogioimport boardimport timepotentiometer = analogio.AnalogIn(board.A2)while True:
print("Hellorld!",pote...

manic glacierBOT
#

CircuitPython version

S3 Wifi vs Airlift WiFi initial negotiation timing.
I first noticed this issue around 8.2.3 to 8.2.5 where connecting to wifi (without web workflow env enabled) was taking 5-10 seconds vs almost instantly within milliseconds in prior versions.  ESP32SPI (airlift) in particular was much much faster to connect to wifi.  

Was told by Danh this was abnormal behavior and that both should be connecting at about the same instantaneous speed... at least to wif...
manic glacierBOT
manic glacierBOT
#

Ok, rebased on main and integrated the demux keypad.

I also spend a couple of hours testing almost every switch and button I had lying around; that includes multiple keyboard switches, through-hole and face-plate-mounted buttons, and a rubber dome pad. Surprisingly, almost all read consistently with interval=0.001 and debounce_threshold=3. The noisiest switches required debounce_threshold=5.
From a typing perspective, I can't tell the difference between threshold values 3 and 5 (a...

manic glacierBOT
#

Using CP 9.x I tried the wifi.radio.connect on an ESP32 Pico, ESP32-S2 and ESP32-S3 all of which executed instantly. I also tried connecting to WiFi using a Nano Connect RP2040 w/ESP32SPI and it did take a second or two to connect using a while loop.

while not esp.connect_AP(os.getenv('CIRCUITPY_WIFI_SSID'),os.getenv('CIRCUITPY_WIFI_PASSWORD')):
    pass

I also threw the code.py example above onto an ESP32-S2 board and the first three output lines all printed with no noticeable...

manic glacierBOT
manic glacierBOT
#

I don't have any ready-made performance tests, but a couple of notes...

Airlift isn't CircuitPython core, so any issues there should be filed in the ESP32SPI library or NINA repo. NINA uses a much older version of the ESP-IDF, so it wouldn't be surprising if the performance is different (also, there is a Python library and an SPI transaction before it gets to the actual wifi connect C code, but those shouldn't be noticeable).

I've always assumed that wifi connection can take up to a cou...

manic glacierBOT
#

CircuitPython version

dafruit CircuitPython 9.0.0 on 2024-03-19; Raspberry Pi Pico W with rp2040

Code/REPL

import socketpool
import wifi

from adafruit_httpserver import Server, Request, Response

ssid = "Unintended Consequences"
password = "xxxx"

print("Connecting to", ssid)
wifi.radio.connect(ssid, password)
print("Connected to", ssid)

pool = socketpool.SocketPool(wifi.radio)
server = Server(pool, "/static", debug=True)


@server.route("...
midnight ember
#

Im not seeing slower wifi connect times with web workflow enabled either. Must have been my imagination. Sorry about that. :/

manic glacierBOT
#

Yeah, keep the timing block as simple as possible.

If (web workflow) auto-connect is enabled ('CIRCUITPY_WIFI_SSID'), connection time in code.py should be virtually zero, since it's already connected. The core connection code checks for an existing connection and exits if it's already connected, so there is minimal code to run and the timing should be negligible.

For non-(web workflow)-autoconnect, a lot of things could be different over such a long span of time: RSSI, core code cha...

#

Ah ok. I had a fundamental misunderstanding of how web workflow launches then. It has to be just the way I was setting up prints back then. I've been using the same code snippets for wifi connection for a while. Perhaps the changes in connection speed prior to then was simply due to the way I used to do wifi connection prints.

We can go ahead and close this one unless anyone wants to look into it deeper? I'm not as confident this is a real issue anymore.

#

Either way, I get the same error when I get to "sock.setsockopt":

Traceback (most recent call last):
File "code.py", line 25, in <module>
File "/lib/adafruit_httpserver/server.py", line 186, in serve_forever
File "/lib/adafruit_httpserver/server.py", line 227, in start
File "/lib/adafruit_httpserver/server.py", line 205, in _set_socket_level_to_reuse_address
OSError: [Errno 95] EOPNOTSUPP

#

Same, tried the library you posted and getting the same error.

Adafruit CircuitPython 9.0.0 on 2024-03-19; Raspberry Pi Pico W with rp2040
Board ID:raspberry_pi_pico_w
Connecting to WiFi...
βœ… Wifi!
Traceback (most recent call last):
  File "code.py", line 28, in <module>
  File "/lib/adafruit_httpserver/server.py", line 186, in serve_forever
  File "/lib/adafruit_httpserver/server.py", line 227, in start
  File "/lib/adafruit_httpserver/server.py", line 205, in _se...
manic glacierBOT
#

Tried using Connection Manager just to see if the socket management might change something

import os

import adafruit_connection_manager
import wifi

from adafruit_httpserver import Server, Request, Response

# Get WiFi details, ensure these are setup in settings.toml
ssid = os.getenv("CIRCUITPY_WIFI_SSID")
password = os.getenv("CIRCUITPY_WIFI_PASSWORD")

print("Connecting to WiFi...")
wifi.radio.connect(ssid, password)
print("βœ… Wifi!")

# Initalize Wifi, Socket Pool, R...
midnight ember
#

httpserver_simpletest_auto.py fails as well with the same error.

#

After trying a couple more examples from the repo couldn't get any of them to work on the Pico W.

manic glacierBOT
#

Interesting update: Since my use case is actually making an AP, I tried this code.py:
`import socketpool
import wifi
from adafruit_httpserver import Server, Request, Response, SSEResponse, GET

wifi.radio.start_ap('MyAP')

pool = socketpool.SocketPool(wifi.radio)
server = Server(pool,debug=True)
print(wifi.radio.ap_active)

@server.route("/")
def base(request: Request):
"""
Serve a default static plain text message.
"""
return Response(request, "Hello from the ...

manic glacierBOT
#

I think the way its written in the library, the except only runs if the type of error is AttributeError. Since the type of error actually being thrown is OSError , the the error is just raised instead of handled.

As to knowing the actual cause of the error, I'm way out of my depth. I just wanted to display a lil' sensor reading, and I thought this would be faster than hooking up a display πŸ’€

re: non-existent variable- Try power cycling the pico, the wifi hardware might still be conn...

#

That makes sense, all of it. Thanks. Can always add AttibuteError as a separate exception. I'm not sure if that will have any negative effects but for now it is a workaround for this specific issue.

def _set_socket_level_to_reuse_address(self) -> None:
        """
        On systems that have SO_REUSEADDR, prevents "Address already in use"
        error when restarting the server.
        """
        try:
            self._sock.setsockopt(
                self._socket_sourc...
manic glacierBOT
manic glacierBOT
#

There have been problems with MQTT keepalive timeouts in the past. I find the MQTT keepalive semantics confusing. But you should not be hitting an internal watchdog in any case.

I see in your setup documentation that there is some kind of 15 minute timeout on the local MQTT server. But are there other (default) timeouts that might be shorter?

The 15m cache timeout is only used in the MQTT Exporter (I had original problem with data not getting through over the WiFi for some reason ...

main furnace
#

Trouble with UVC: When I enable UVC on my Raspberry Pi Pico the pico fails to boot. I can enter safe mode and remove boot.py and then it will boot.

# boot.py
import usb_video
usb_video.enable_framebuffer(32,32)

Adafruit CircuitPython 9.0.0-6-gac66da21fe on 2024-03-23; Raspberry Pi Pico with rp2040

I get the same result with Adafruit CircuitPython 9.0.0 on 2024-03-19.

manic glacierBOT
onyx hinge
#

@main furnace is any code.py necessary for this to occur?

manic glacierBOT
#

I appreciate your testing. Did you try with a longer interval, such as the 0.008 you suggested? I think I will leave the current defaults alone for now. The overhead of the interrupts is lower with 0.020, and for most people, the current defaults seem fine. I did some testing with tactile switches and keyswitches when I chose that value. Those who are using keypad for a performance keyboard can decrease the polling interval. It would be good to write this up somewhere once it's merged.

onyx hinge
# main furnace Trouble with UVC: When I enable UVC on my Raspberry Pi Pico the pico fails to bo...

I didn't immediately reproduce a problem on:

Board ID:adafruit_macropad_rp2040
UID:DF609C80673F1B26
boot.py output:
```with boot.py:```py
import usb_video
#usb_video.enable_framebuffer(128, 128)
usb_video.enable_framebuffer(32, 32)
```and no code.py. However with the framebuffer size set to 32x32 I don't get any video, either (I get an all-green frame, which may be just the behavior of qv4l2, the linux program I use to display usb video). At 128x128 it does work. I don't know why 32x32 would not work, though. I recommend filing an issue, especially since I didn't see quite the same behavior you did.
#

no board crashes though

lone axle
#

I'm going to learn guides doing updates that match a recently submitted PR in the learn repo and noticed this:

It seems like this warning should be removed to me, at this point it may cause more confusion than help since it references old versions that are no longer listed by default.

Should I remove that while I've got this guide open or just leave it?

lone axle
#

I think this may have been among the first of the displayio projects

tulip sleet
#

@onyx hinge We required SOREUSEADDR in 9.0.0, but it turns out that setsockopt in Pico W only implements one thing in common_hal_socketpool_socket_setsockopt(). Should it just call the lwip setsockopt routine instead? I was surprised.

onyx hinge
#

lwip_setsockopt isn't available, because it requires the fd-based layer and that cascades into a whole bunch of stuff

#

so we get to reimplement the bits we need πŸ˜•

tulip sleet
#

i will see what needs to be done to implement REUSEADDR, unless you think it's impossible. Should go into 9.0.x. I thought your refactoring of lwip would add this, but you're saying it's too much code?

#

also saw this:

// All socket options should be globally distinct,
// because we ignore option levels for efficiency.
#

but the common-hal does look at the option level

#

i don't know if that's you or something copied from MPy

onyx hinge
#

@tulip sleet in micropython it's lwip_socket_setsockopt in extmod/modlwip.c

tulip sleet
#

thanks, can just do what that does for SOREUSE

#

so that comment above is obsolete and will be more obsolete, I think

lone axle
#

Any Learn Editor ninja's in here? I'm trying to update these links to point to their new places in the docs:

So far the only one I changed is BusDisplay but I can't seem to get the bold to get re-applied

lone axle
#

In the edit view the text does show as bold:

tulip sleet
#

were you already working on this or did i provoke you πŸ™‚

lone axle
#

well I mean the bold dropdown and and switch are enabled, within the preview the text does not visually appear bold like the other pre-existing links that I haven't touched yet.

tulip sleet
#

i think we started at the same time, I didn't see the email

#

@onyx hinge could you base it on 9.0.x?

onyx hinge
#

@tulip sleet oh sure!

tulip sleet
lone axle
#

Weird, if I delete the text entirely make new text and make it bold it appears bold at first but as soon as I add the link it visually reverts back to not bold.

#

Ooh thank you

#

I never knew there was a way to access the plain HTML 🀯

tulip sleet
#

I have a lot of trouble with "contagious" formatting tags in Learn. Like, try to add a non-code-formatted period after a code-formatted word. Easiest thing to do is to hint enter to start a new paragraph, type the . and then delete the new paragraph newline

lone axle
#

Okay, I think I figured it out. Thanks again.

The front end places <strong> tags outside of <a> tag but visually that order doesn't seem to be respected by the rendering. <strong> needs to be inside of <a>.

tulip sleet
#

I think this is inherent in TinyMCE< which we use

onyx hinge
#

that was weird, something (probably a github browser extension) suggested an entirely wrong title for that PR

fringe yarrow
#

So I've just tried to set up a Parallel Display Bus ILI9341 on an entirely different ESP32 and entirely different screen, tested functioning with Arduino_GFX library in the arduino framework, but I get the same visual garbage that I was getting on the all in one unit I've been trying to make work for a few days.. Seems to me like, while the Parallel Display Bus functionality might work for the Lilygo TDisplay S3, it does not work for at least some other setups.

candid sun
lone axle
#

Good to know, thank you!

manic glacierBOT