#circuitpython-dev

1 messages Β· Page 47 of 1

tulip sleet
#

rightk, SPI seemed more critical

onyx hinge
#

the fact that there aren't RUN_BACKGROUND_TASKS calls in most port i2c writes makes me think that long, non-preemptible i2c transactions haven't been perceived as a problem before now. but it's true that taking away locking would complicate making them pre-emptible (by background tasks) later.

orchid basinBOT
manic glacierBOT
slender iron
#

You can't do slow, fast, slow on i2c because everything on the bus needs to read the address. I think the locks were mainly for future-proofing against concurrency.

#

Better to have code written with it then not.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-alpha.1-40-g17ced21e04 on 2023-09-14; M5Stack Timer Camera X with ESP32

Code/REPL

# mount a vfs under /something
import os
os.listdir()
os.listdir("./")

Behavior

>>> listdir()
['ramdisk', 'LjinuxRoot', 'code.py', 'lib', 'boot_out.txt', 'ftp_serv.py', 'boot.py', 'repl.py', 'settings.toml']
>>> listdir("./")
['LjinuxRoot', 'code.py', 'lib', 'boot_out.txt', 'ftp_serv.py', 'boot.py', 'repl...
brazen hatch
# manic glacier

At this point I think I am cursed to find every tiny issue there is.

manic glacierBOT
idle owl
#

@slender iron You have a lot of background noise coming through intermittently.

slender iron
#

will turn the fan off once the meeting starts

tulip sleet
#

i also have some tree trimming going on 😦

idle owl
#

It happens. πŸ™‚

digital ibex
#

I've got a lot of intermittent background noise. I'm hoping it'll be gone by the time I give my status update, but I might be text only if it's still there.

idle owl
#

Text only is also completely ok!

modern wing
#

Discord has some really excellent noise cancelling algorithms -- it stops most coughs, sneezes, jets, trains, and trucks rolling down the road for me.

manic glacierBOT
turbid radish
#

yes

modern wing
#

loud and clear

#

[more than once I've been caught talking to myself with a muted setting....]

lone axle
onyx hinge
lone axle
#

Writing libraries to support our favorite microcontrollers is a big task, but what if ChatGPT could lend a hand? Adafruit's own Limor "Ladyada" Fried has tasked ChatGPT to write Arduino drivers in her own style, creating a "mini-Limor" bot to handle the task.

We sat down with Fried to talk about how AI can help Adafruit and the wider communit...

β–Ά Play video
midnight ember
#

I've only tested 8.2.6 with the github stars test on an ESP32-S3 and works np.

turbid radish
#

πŸ™‚

midnight ember
#

@turbid radish always has the coolest stuff in the newsletter πŸ‘

turbid radish
#

Aww, thanks - you all make (or find) the best content - be sure to send anything you see to cpnews@adafruit.com

manic glacierBOT
#

For the same reason that a MIDI note value to frequency conversion method is included in the core. SPN is a fairly common notation that has more intrinsic value to musicians than note values. No need to memorize MIDI notes or have frequency tables at-hand.

My typical approach is to use a library method for both so I'm not personally hung up on it being in the core. Having it in a library also makes it easy to change the tuning from A=440 to A=432 ("nature" tuning) or A=441 (harmonica tunin...

#

FWIW I'd say that midi note numbering is supported just as a sort of historical accident: the original synthio was a midi player and couldn't play notes with arbitrary frequency in Hz.

Another reason to use something outside of the core for conversion from musical notation to frequency is to support different kinds of Musical Temperament, rather than the equal temperament that is the one that you get with MIDI note numbers. we wouldn't w...

turbid radish
#

blinka_heart_circle Kattni blinka_heart_circle

idle owl
#

😊 Thank you!

digital ibex
#

Kattni's moving on? 😦 We will miss you, good luck with your future endeavors!

idle owl
#

@tidal kiln thankyou.show()

#

@errant grail 😊

manic glacierBOT
onyx hinge
#

[cgrover writes some of the most detailed hug reports I've ever read]

#

[kattni's upcoming one notwithstanding]

manic glacierBOT
idle owl
#

@midnight ember πŸ˜‚ and ❀️

#

@lone axle 😊

#

@onyx hinge ❀️

tulip sleet
#

πŸ‘
code + community = CircuitPython

slender iron
#

❀️

turbid radish
#

Aww, yes thank you Kattni!

modern wing
#

πŸ‘ thanks for seeing me good with words πŸ˜‰

ember iris
#

@idle owl Thank you so much for all of your work stewarding this community forward over the years. You’ve hand a huge hand in helping this community grow into the welcoming center is is, and the code of conduct you shaped is something I get a special sense of awe inβ€”guiding a community is not small or easy feat, and that is something truly special

modern wing
#

You're awesome Kattni, and thank you for all you've done to make our jobs easier.

midnight ember
#

Thank you @idle owl 🫑

idle owl
#

@wide drum ❀️

#

@slender iron 😊

#

@blissful pollen ❀️

onyx hinge
midnight ember
#

woot woot, love seeing your e-fidget spinners 2231puppy

brazen hatch
#

Who's gonna be the one to make the first borb on android?

midnight ember
onyx hinge
#

"they have played us for fools. LEDs should be easy to hook up". the meme writes itself.

midnight ember
digital ibex
onyx hinge
#

run the patch! no concerns from this quarter.

brazen hatch
#

compiling the idf5 branch already

#

nvm my subvolumes failed already

brazen hatch
#

still espcamera seems to fail to clone..
I wonder why..
I did clean my submodules

#
fatal: transport 'file' not allowed
fatal: Fetched in submodule path 'esp-camera', but it did not contain 75035312ed9427557acfee1cd32af2b8e1f13f72. Direct fetching of that commit failed.
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
fatal: transport 'file' not allowed
fatal: Fetched in submodule path 'esp-camera', but it did not contain 75035312ed9427557acfee1cd32af2b8e1f13f72. Direct fetching of that commit failed.
ERROR: fetch-submodules.sh FAILED
manic glacierBOT
brazen hatch
#

every day a new submodules fail

slender iron
#

I found a git bug that causes it for me

midnight ember
#

πŸ–οΈ have a good time on your vacation!

slender iron
#

git uses the wrong remote name

brazen hatch
slender iron
#

it uses the remote name of the outer repo for the inner submodule

#

I'm on arch latest too

brazen hatch
#

oh it uses origin? what a bummer

#

well, 2nd clone time

slender iron
#

submodules use origin but the outer one may not

#

(mine usually don't)

#

so you can change .git/config to set remote to origin while you update

midnight ember
#

better code completion like PyCharm has would be a very very welcome thing for Mu.

brazen hatch
slender iron
#

(under [branch "<foo>"])

onyx hinge
crimson ferry
#

some folks prefer not to have editor and serial in the same app (like me), so free to use any editor / IDE, and any serial program

digital ibex
#

I'll see if there's something I can make

midnight ember
#

pycharm with windows doesn't work well with terminal, same with vscode. mu "just works"

onyx hinge
#

I wouldn't generalize my preferences to anyone else πŸ™‚ vi & terminals for everyone πŸ™‚

brazen hatch
#

I am amazed nobody went "bloooat" when vscode was mentioned.

digital ibex
idle owl
#

Everyone has their reasons for using different editors. None of them are bad or wrong. You should always use the tool that's right for you. πŸ™‚

stuck elbow
#

we still need i2c locking because there are i2c-based displays that are being used in the background

brazen hatch
#

s(2/3)tft

digital ibex
stuck elbow
#

there are also some people wanting to add an i2c-based keypad support

slender iron
digital ibex
gilded cradle
#

Maybe it's a feature that can be enabled or disabled?

midnight ember
#

same, I'm of the same opinion as Micha. Mu is too basic but it works wonderfully with Circuit Python in a way that PyCharm or VSCode doesn't... at least in Windows. If I was using Linux then PyCharm would be my go to. PyCharm has issues in Windows.

stuck elbow
#

"big python" relies on the operating system doing the locking when they open a device file

midnight ember
#

If Mu had the helper functions like PyCharm or VSCode stubs has that would make me very happy. That's honestly really all I'm looking for with the IDE. The way Mu works is excellent but it doesn't have helper functions.

stuck elbow
#

you can't treat the expander pins the same as normal gpio pins in keypad interrupt anyways

#

it takes too long to interact with them, and you can't do this in an interrupt

#

this is in fact a reason for having locking

#

I think that from the point of view of usability and transparency, treating pins on expanders as regular GPIO pins is a huge can of worms that will lead to people trying all sort of crazy things and being confused why they don't work or why they are so slow

slender iron
#

a true in the weeds section πŸ™‚

onyx hinge
#

thank you all for sitting through that πŸ™‚

midnight ember
#

did someone say bug hunt? Hacktoberfest is getting close. πŸŽƒ

onyx hinge
#

oof it is! I hadn't heard any reminders about it

#

@lone axle are you someone who knows about making sure our bugs are tagged for hacktoberfest?

plucky tulip
#

also the HTTPServer is a big lib even now

digital ibex
midnight ember
#

i would love to see a learn guide revised for the new iteration of HTTPServer and the template engine. HTTPServer was honestly like the 2nd thing I tried to use the first time I ever used Circuit Python. As a front end dev it's extremely appealing to go straight to.

plucky tulip
#

I can help with that

midnight ember
#

at that time it was just an f-string, the entire HTTPServer was just one string, so I started doing other electronicy things.

plucky tulip
#

Thank you πŸ™‚

slender iron
#

it could go in the circuitpython org on github

modern wing
#

Thanks everyone!

digital ibex
#

Bye all!

slender iron
#

but adafruit is best if we have learn guides that use it

midnight ember
#

lots of discussions today, today was a special day. @idle owl Wish you well, hope you stick around as much as possible.

errant grail
#

Thank you!

lone axle
#

Thanks for hosting Dan. Have a great week everyone!

midnight ember
#

Thank you for hosting @tulip sleet what a meeting!

brazen hatch
#

bb thanks for the cool meeting everyone!

tulip sleet
#

thanks everybody! Thanks again to Kattni!

ember iris
#

Thanks all, thanks again and good luck on the next chapter @idle owl, Looking forward to seeing it!

mortal kernel
#

Please add me to circuitpythonistas. Thanks!

idle owl
#

Thank you so much!

midnight ember
idle owl
midnight ember
#

7 days isn't much time... better get on it. 🏎️ just a friendly reminder. πŸ™‚

manic glacierBOT
midnight ember
#

the lead up to Hacktoberfest last year I think started in like August, it was in the blog regularly. this year it's like oh it's next week.

#

I honestly forgot about it too until someone said the magic words "bug hunt" in the meeting.

onyx hinge
#

I might not reach my goal, since I'll be on the road for most of the month. oh well! more rewards for someone else.

lone axle
#

I'll try to remember to bring it up next week during the meeting, and I'll do some brainstorming on it as well. I'm curious if anyone else has thoughts or ideas for things that we could direct people towards for hacktoberfest this year? On the library side our number of existing 'good first issues' is much lower this year with many of the typing ones being completed and some additional cleanup recently.

In the past we've added the label for all issues whether they are 'good first' or not which we can do again, but I think it'd be great if we can dream up a few things that we could direct people to work on if they come looking to help but don't know know specifically what they want to work on.

midnight ember
#

Part of last year I think was a live event that kattni and jepler were at... PyCon? They were knocking out a lot of the typing good first issues. I take it there will not be a similar event this year?

lone axle
#

I think that was a different time of year, but we did have a big influx of folks from it as well.

midnight ember
#

We did have some online sprints in discord which were a lot of fun.

idle owl
#

PyCon is April/May.

midnight ember
#

so i was close...

lone axle
idle owl
#

Yep! It was a separate thing.

midnight ember
#

my memory is horrible, this is why i have a computer

idle owl
#

Someone could host some "sprints" if they're up for it. But that's only if someone has cycles, and folks think it's a good time,

lone axle
idle owl
#

Ok merged.

lone axle
#

Thank you!

midnight ember
manic glacierBOT
#

This is a request for the keypad.EventQueue class to offer an asyncio-friendly awaitable alternative to the polling-based .get() method.

This would allow asyncio-based programs to follow a true event-driven programming pattern, and steer away from polling-based logic (which does not encourage good programming habits).

Such an alternative, possibly called keypad.EventQueue.aget(self, timeout=None), would:

  • block its calling task until/unless a key event happens
  • have an inte...
lone axle
#

A couple of weeks back a seed was planted "in the weeds" about having simpletest scripts for boards checked into the core repo inside the board directory. That might be a good opportunity to get hacktoberfest participants involved in. Maybe we can get one or two of these in before october to iron out any technical details and then we could encourage people to make them for whichever devices they have access to.

manic glacierBOT
lone axle
#

For the RTD fix patch, I'll need to do some troubleshooting. The --dry-run completed mostly successfully. But when I tried to run it for real it seems every library reported this:

>> Repo: Adafruit_CircuitPython_74HC595 Patch: 11SEP2023_fix_rtd_theme.patch
   Error: b'Patch format detection failed.\n'
#

this might be because of difference between am and apply it looks like there is --use-apply flag for handling that.

lone axle
#

Yep, that was it. It appears to be working now adabot πŸŽ‰

lone axle
#

a handful of them reported this error:

>> Repo: Adafruit_CircuitPython_ImageLoad       Patch: 11SEP2023_fix_rtd_theme.patch
   Error: b"remote: error: GH006: Protected branch update failed for refs/heads/main.        \nremote: error: Changes must be made through a pull request.        \nTo https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad.git\n ! [remote rejected] main -> main (protected branch hook declined)\nerror: failed to push some refs to 'https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad.git'\n"

Perhaps there are additional protections at the branch or repo level in some cases. I'll make PRs for these ones.

The vast majority seem to have commit successfully. I'll check in on the actions run, and docs build after it's had some time to work.

manic glacierBOT
#

CircuitPython version

CircuitPython 8.2.6

Code/REPL

circuitpython/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk

USB_VID = 0x239A
USB_PID = 0x8048
USB_PRODUCT = "Monster M4SK"
USB_MANUFACTURER = "Adafruit Industries LLC"

CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51

QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ"
LONGINT_IMPL = MPZ
CIRCUITPY_SYNTHIO = 0

Behavior

The Circuit Python .UF2 file downloa...

manic glacierBOT
manic glacierBOT
#
  • Fixes #8413.

  • MONSTER M4SK had its CPU as SAMD51J19, instead of SAMD51G19. Note that the silk on the board incorrectly says "J".

  • CPU was wrong for CP32-M4 board.

  • A primary difference between '51G and '51J is the that J doesn't have I2S. So automatically turn off audiobusio on '51G boards. This means the explicit CIRCUITPY_AUDIOBUSIO = 0 in mpconfigboard.mk on those boards is no longer necessary. (I left that setting explicit in some boards that are turning off a large number...

mortal kernel
#

@danh Can you point me to documentation for usb_hid in Blinka?

main furnace
#

What would it take to use the UART on the ATtiny817 seesaw-breakout?

onyx hinge
#

@tulip sleet I'm around until lunchtime but not available in the afternoon. give me a ping when you want to work on pair merging.

tulip sleet
onyx hinge
#

@tulip sleet give me 5, then I'll join you

manic glacierBOT
#

Hi,

I am attempting to implement half duplex uart for a feature on the upcoming Pimoroni Yukon board, and am in need of doing sub millisecond time delays. Micropython has sleep_us on their RP2040 build but CircuitPython does not, and although the regular sleep function accepts any floating point value, it is quantised to milliseconds.

Here is my analyser output from running time.sleep() with any microsecond value:
![image](https://github.com/adafruit/circuitpython/assets/7437269/...

manic glacierBOT
#

I'm not sure why time.sleep can't call the microsecond sleep function, though, similar to (untested)

STATIC mp_obj_t time_sleep(mp_obj_t seconds_o) {
    mp_float_t seconds = mp_obj_get_float(seconds_o);
    if (seconds < 0) {
        mp_raise_ValueError(translate("sleep length must be non-negative"));
    }
    if (seconds < MICROPY_FLOAT_CONST(.001)) {
        mp_float_t usecs = MICROPY_FLOAT_CONST(1e-6) * seconds + MICROPY_FLOAT_CONST(0.5);
        common_hal_time_delay_us(us...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.6 on 2023-09-12; TinyS3 with ESP32S3

Code/REPL

import digitalio
import time
import board

time.sleep(5) # give us some time to update code via USB when we are stuck in a crash loop.
tmp = digitalio.DigitalInOut(board.D34)
tmp.direction = digitalio.Direction.OUTPUT

Behavior

Board crashes and hard resets

Description

When I try to set D34 pin as output using the digitalio module the board ...

main furnace
# slender iron use it for what?

I'm anxious about soldering the headers on my Feather TFT ESP32-S, so I thought I would connect the seesaw breakout and use it to connect to a third board. A bit crazy I guess. Anyway, looking at adafruit_seesaw/seesaw.py there is a function uart_set_baud() but nothing for uart_read() or uart_write().

slender iron
#

ah, so you could have solder-free UART?

main furnace
#

right

slender iron
#

what are you connecting the UART to?

main furnace
#

A three-node cluster of raspberry pi picos.

slender iron
#

soldering is a good skill but definitely daunting before you get used to it

main furnace
#

Not much room for error when the TFT is right next to the header poins.

#

Maybe I should use the raspberry pi zero instead.

slender iron
#

you can put kapton tape to protect the screen

main furnace
#

Hmm, I didn't think of that.

#

Thanks.

slender iron
#

np

cedar veldt
# manic glacier

Is there a way to read a sub-millisecond time now? In this sort of context, trying to do precise timing with sleep is going to accumulate the delays, and waiting for a specific time tends to be more useful.

#

I remember monotonic_ns having millisecond precision on RP2040 ages ago.

stuck elbow
#

read no, wait yes

slender iron
#

we generally track 1/1024 of a second internally because the RTC does

#

you really shouldn't assume a bunch of precision as python code runs

#

that's what native apis are for

manic glacierBOT
#

This may be because the FAT16 CIRCUITPY presented by the larger flash chip still only has one FAT (File Allocation Table). Most FAT16 filesystems have two.

Well, Android is very picky. It would stand to reason it expects it.

lib/oofatfs/ff.c:5424 -> const UINT n_fats = 1; /* Number of FATs for FAT/FAT32 volume (1 or 2) */

It's an optional feature for fat16, and an unsupported feature of fat12 as far as googling gets me.

Just changing this, neither board is read by and...

tulip sleet
#

@onyx hinge I updated all the type definitions I could find with new style and pushed that. Haven't tried to compile anything yet, that will be tomw.

brazen hatch
#

So many mistakes in the board definition conversions..

#

Cooking up a mega review.

analog bridge
manic glacierBOT
#

Circuit Python is Adafruit’s fork of Micro Python. Micro Python does in fact allow concurrent execution of both cores.

Cicuit Python’s goal is ease of use and providing library functions for all of adafruit’s hardware. But if your goal is performance, Micro Path is dramatically faster and not just because it can use multiple cores.

That said, many projects don’t need β€œperformance” and ease of use is more important.

I think (?) removing the GIL is on CPyton’s roadmap. But Python,...

manic glacierBOT
manic glacierBOT
#

Micro[Python] is dramatically faster and not just because it can use multiple cores

I would not take this as fact. We use essentially the same core interpreter. Some recent benchmarking we did show them roughly comparable. Our library code uses properties a lot more than MicroPython libraries do, which slows things up a bit.

This is not the issue to discuss performance. If you have some benchmarks that show dramatically different performance, we'd be interested in those, and please op...

onyx hinge
#

1.20 merge

manic glacierBOT
#

No need for benchmarks just try this in Circuit Pythonand see if it works

@micropython.native or,
@micropython.viper or,
try to use two cores at the same time

Yes they are roughly comparable in performance only as long as you do not use the features present only n Micro Python

As said, each has a different target audience

On Sep 20, 2023, at 7:30 AM, Dan Halbert @.***> wrote:

Micro[Python] is dramatically faster and not just because it can use multiple cor...

manic glacierBOT
#

While it is true that the MP port of RP2 doesn't implement the GIL, I wouldn't be so quick to see this as an advantage. Except for the use case where the spawned thread (the port supports just one of them) can guarantee that it isn't going to touch anything directly or indirectly that will cause both processors to enter multiprocessor unsafe code in core, bad things will happen. Look at the MP ESP32 implementation for a safer and more complete implementation of threads. Yes, it uses the GIL.

slender iron
slender iron
#

should we just close and lock 4106? The original request was for python on the second core and I don't think we'll do that anytime soon

gilded cradle
#

Or rather, what is the effect?

slender iron
#

it swaps the bytes

gilded cradle
#

I mean how would using __builtin_bswap32 be different?

slender iron
#

bswap16 only swaps the low two bytes I assume

#

rather than all four

gilded cradle
#

Oh, hmm. Ok

slender iron
#

AB -> BA instead of ABCD -> DCBA

gilded cradle
#

So ABCD -> ABDC?

slender iron
#

yup

gilded cradle
#

Thank you

mortal kernel
slender iron
#

at that point in the code it's a 16bit value anyway

gilded cradle
#

Yeah, just adding some code to handle the colors and it wasn't clear.

slender iron
tulip sleet
slender iron
gilded cradle
#

Yeah, I wasn't sure about the swapped color expected byte orders

mortal kernel
slender iron
#

I don't really want to do _thread

#

and end up supporting it

mortal kernel
slender iron
#

when that happens, we'll need a solution that allows c code inside CP to use it too

#

a number of folks on that thread have attitudes that make me not want to do it and then have to support them

tulip sleet
slender iron
#

and we already have the ability to use the second core for internal C code. so any solution to merge needs to have some locking to manage who is using the second core

#

(circuitpython supports the multicore broadcom chips on raspberry pi SBCs if you want a place to test 4 cores)

lone axle
#

Here is the notes document for next Monday’s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1rA4Zb-rPvZ2IDEfw417YdOcJAgLuj8zJIBPn_7P6vYI/edit?usp=sharing

tulip sleet
manic glacierBOT
lone axle
#

Oh my, I did both covid and flu shots at the same time once and it knocked me down pretty hard. I swore off of doing more than one at once.

tulip sleet
#

it wasn't terrible but my arms (2 in one, 1 in another) got really sore, and I was just really tired

#

ok by 30 hours later or so

lone axle
#

I wanted to get a hug report that came to mind written in so I don't forget and noticed.

manic glacierBOT
#

I can't reproduce`:

Adafruit CircuitPython 8.2.6 on 2023-09-12; TinyS3 with ESP32S3
>>> import digitalio
>>> import board
>>> 
>>> tmp = digitalio.DigitalInOut(board.D34)
>>> tmp.direction = digitalio.Direction.OUTPUT
>>> tmp.value = True
>>> tmp.value = False
>>> 
>>> tmp.switch_to_input()
>>> tmp.value
False
>>> 
>>> tmp.switch_to_output(False)
>>> tmp.value = True
>>> tmp.value = False
>>> 
slender iron
low sentinel
manic glacierBOT
#

Reloads do now reconnect as long as creds are set.
Wifi is reenabled too if it was disabled.

Exact steps:

  1. Install a settings.toml with wifi credentials and api password.
  2. Reboot the board.
  3. Ensure web-workflow is up.
  4. From repl: import wifi; wifi.radio.enabled=0
  5. Reload with Ctrl+D.
  6. Profit. Hardfault.

In any case, the fix is not simple (if it was, I would have done it already). This should be done in a seperate pr.

brazen hatch
slender iron
manic glacierBOT
#

Ah and I should probably let you know why it's not an easy fix.

Do keep in mind however, I may very well have misjudged some stuff (due to my lack of understanding of mdns), so do take the following with a grain of salt.

If any network change occurs (even a reconnection to the same network), the mdns object effectively breaks and needs to be recreated before it can be used, or a hardfault occurs when it's used.

On top of that, simply adding:

if (reload && !common_hal_mdns_serv...
slender iron
#

@brazen hatch I'm working on a fix along those lines

brazen hatch
#

I can prolly do the status "reset" in wifi if you want me too.

#

The rest I am really not confident about.

slender iron
#

it's not too difficult. I think I can handle it

#

testing now

#

is there an existing issue filed for it?

brazen hatch
#

nope, there isn't

#

I kinda was trying to fix, so I was like, "why make an issue when you can make a pr".

#

But I wasn't able to and forgor.

slender iron
#

ya totally. I do that too

#

the repro info was helpful

#

it still fails after the free...

brazen hatch
#

c3 would be good right now, since you can test the variable value from gdb to make sure

manic glacierBOT
#

I tried this approach in my setup:

Adafruit CircuitPython 8.2.6 on 2023-09-12; Raspberry Pi Pico W with rp2040
Board ID:raspberry_pi_pico_w

Sadly, the asyncio task silently terminates when it attempts to await the AsyncEventQueue context (just the instance in this case).

I even tried catching BaseException, but there's no exception - the task simply just disappears.

    async def run(self):
        """                                                                   ...
brazen hatch
#

but I guess you can just print the variable directly before every free

slender iron
#

I think it's an IDF issue

brazen hatch
slender iron
#

it frees the list of hostnames but doesn't set the root pointer back to null

#

not fixed in idf5 either

brazen hatch
#

imma go check idf issues brb

slender iron
#

vendor sdks don't usually test stopping and restarting things very well

#

we're weird

brazen hatch
#

you're telling me nobody uses esp mdns and accounts for when the wifi conn is lost?

slender iron
#

apparently?

#

the mdns code isn't super solid. I found issues with it

brazen hatch
#

So.. What do we do? (Other than make an upstream issue?)

#

Can we workaround this by setting this stuff directly? (I have no idea what the code looks like for idf mem)

#

yea there is no upstream issue

slender iron
#

we have our own branch of the idf where we can fix it

brazen hatch
#

Ah it was a oneliner, of course.

slender iron
#

there is a cp bit too

#

but this fixes the idf side of things

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.6 on 2023-09-12; Raspberry Pi Pico with rp2040

Code/REPL

import usb_cdc

usb_cdc.data.timeout = 1

def send_data(data):
    data = bytes(data, 'utf-8')
    usb_cdc.data.write(data)

while True:
    if usb_cdc.data.in_waiting > 0:
        data = usb_cdc.data.read(usb_cdc.data.in_waiting)
        print(data)
        usb_cdc.data.write(bytes("test\n", 'utf-8'))

Behavior

When attempting to ...

slender iron
#

@brazen hatch ☝️

#

draft because it needs the idf fix first

brazen hatch
#

Maybe?

bool common_hal_wifi_radio_get_connected(wifi_radio_obj_t *self) {
    bool result = self->sta_mode && esp_netif_is_netif_up(self->netif);
    #if CIRCUITPY_MDNS
    if (!result){
        mdns_server_deinit_singleton();
    }
    #endif
    return result;
}
#

@slender iron

#

to account for disconnections from range?

manic glacierBOT
slender iron
#

I'm not sure that the loss of the network is actually the issue though

#

the free in set_enabled seemed problematic

manic glacierBOT
brazen hatch
hidden rain
#

I just ran into a situation where I attempted nested try/except clauses (mere general errors, non specific). I hadn't stop to think which clause would handle things the inner or outer, or even if the behavior is determined. Any advice here?

brazen hatch
brazen hatch
tulip sleet
slender iron
manic glacierBOT
hidden rain
tulip sleet
#

can you reduce it to a simple example? Just raise the exception that it not being caught inside the inner

hidden rain
tulip sleet
#

make sure that the inner is really catching the exception or a superclass of it

brazen hatch
slender iron
#

I'm hoping the idf mdns code will work over disconnect if you don't free it

brazen hatch
manic glacierBOT
onyx hinge
#

@slender iron It's the esp_lcd_panel_disp_on_off call that is new

The LCD panel initialization flow is slightly changed. Now the esp_lcd_panel_init() will not turn on the display automatically. User needs to call esp_lcd_panel_disp_on_off() to manually turn on the display. Note, this is different from turning on backlight. With this breaking change, user can flash a predefined pattern to the screen before turning on the screen. This can help avoid random noise on the screen after a power on reset.

#

and make sure refresh_on_demand is false, but it should have been (they renamed it I guess)

manic glacierBOT
#

@dhalbert I just now tried the 'simpler code', and it does work.

    async def run(self):
        """
        Continually poll all the buttons and invoke callbacks on push and release
        :return:
        """
        self.log("run: monitoring buttons")
        self.is_running = True
        self.keysObj = keypad.Keys(self.pins, value_when_pressed=False, pull=True)

        #while self.is_running:
        #    await self.poll()

        event_queue = self.keysObj.events
...
onyx hinge
#

@slender iron yes it appears settings.toml requires DOUBLE QUTOED strings like foo = "BAR". the toml specification supports strings with single-quotes '...' but we do not support it.

manic glacierBOT
#

As a side note, my project is a MIDI pedal controller board, being used in live music looping, so pedal pushes need to be detected and actioned as instantly as possible, to avoid loop mis-alignments.

It has helped a lot to switch from round-robin pin polling (in my earlier prototype) to now feeding off keypad events, but I'd still like to be able to eliminate all polling from Python code.

manic glacierBOT
crimson ferry
#

#6736:

socketpool.Socket, if it doesn't already work with asyncio
...does it? (I have no concept of how to determine or test)

manic glacierBOT
manic glacierBOT
#

I just tried the following complete code on Adafruit CircuitPython 8.2.6 on 2023-09-12; Adafruit PyGamer with samd51j19:

import asyncio
import board
import keypad
import digitalio
import gc

async def blink(pin, interval, count):  # Don't forget the async!
    with digitalio.DigitalInOut(pin) as led:
        led.switch_to_output(value=False)
        for _ in range(count):
            led.value = True
            await asyncio.sleep(interval)  # Don't forget the await!
...
#

It boots ljinux just fine. So pretty much the whole core works.

I will throughtly test everything.

First thing I found:

>>> wifi.radio.connect("Rock4CPlus", "REDACTED")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ConnectionError: No network with that ssid

This is an irrelevant issue I just found that also is in current main.

manic glacierBOT
#

CircuitPython version

Latest master, current commit e39fbf1b26b4fd3b66313e51ccc3db0eba7bd58a
Discovered on s3 while testing idf5, also exhibited on regular esp32.

Code/REPL

import wifi
a = wifi.radio.start_scanning_networks()
for i in a:
    print(i.ssid)
    print(i.authmode)
a = wifi.radio.stop_scanning_networks()

Behavior

Something is wrong with authmodes, and it's consistent.

main:

WIND_2.4G_422DEA
[wifi.AuthMode.WPA2, wifi.Au...
manic glacierBOT
manic glacierBOT
#

We've put a lot of work into BLE on the nRF52840 and recommend folks using it. Supporting the Pico W isn't a high priority for us (but we're happy to guide and review if someone else wants to take it on.)

This is honestly really disappointing but I'd be happy to take a look at what's still needed to do to implement and give it a try. It's been fully supported in MicroPython since June, I think? Is there a particular stumbling block?

manic glacierBOT
manic glacierBOT
manic glacierBOT
orchid basinBOT
tulip sleet
#

maybe with an ending message "we hear you, we don't have time to work on it now; if you're interested in working on it we'd love your help; contact us in discord"

manic glacierBOT
#

Your only real response to my offer to help was to change the language from BLE "coming soon" to "not currently supported"?

The PR was to address https://github.com/adafruit/circuitpython/issues/7693#issuecomment-1729728523, not your offer to help.

You should close this issue, too. It's clearly resolved.

No it's not, and please don't be snarky. Take us at our word. We are not giving an evasive answer. We are flat out on a bunch of other things for 9.0.0 right now.

If you'd lik...

manic glacierBOT
#

You're right, that was snark, and I apologize.

I'm also frustrated and was piqued that your initial responses to my offer of help was to refer me to other boards and to remove coming soon from the Pico W page.

But I do apologize for the snark. I'm sure you're busy as hell and snark isn't helpful or appreciated.

The firmware/memory thing could well be a problem just for my use case but I'll take a look. I already have another firmware blob in the mix.

And thank you for the disco...

slender iron
#

I don't think MP BLE has bonding support yet

manic glacierBOT
mortal kernel
#

I'd like to help with #7693.

slender iron
#

great!

#

it'll hopefully be mostly "implement the _bleio functions in common-hal"

#

it is not a small project

mortal kernel
# slender iron great!

I like big difficult projects. Give me a day or two to get my bearings. In the meantime please add me to collaborators so I can leave notes in the issue.

slender iron
#

I unlocked it, so please post that you are looking into it

#

I can assign it to you then

manic glacierBOT
slender iron
#

actually, I won't assign

#

I don't think it'll give you access if I lock it again

#

so I'll leave it unlocked unless it goes south again

mortal kernel
slender iron
#

I don't want to get you overcommitted by assigning too

mortal kernel
#

That's fine. Just a place to leave notes is what I need.

slender iron
#

πŸ‘ issue is fine for that

#

maybe someone will offer to help or test for you

manic glacierBOT
tulip sleet
#

@mortal kernel we can hide a bunch of the +1 and other comments to make it easier to follow

mortal kernel
slender iron
lone axle
#

Does adabot have any utility to make releases for libraries that were changed by a patch sweep?

slender iron
#

Β―_(ツ)_/Β―

tulip sleet
#

kattni might know

lone axle
proven garnet
idle owl
#

Scripted.

#

There was a repo with a lot of her scripts in it.....

#

I can't remember where that was. Adabot in a directory maybe?

lone axle
#

I took a look back at the scripts I used to create the "missing type" issues for libraries, I think that it's possible to re-purpose that into something for releases. I'll do some testing in my own repos and see if it's going to work how I'm imagining. If it does work out I can submit it to add somewhere.

#

I'll poke around adabot repo files as well and see if I can find anything in there.

proven garnet
#

Definitely a very useful tool! I think the adabot tools folder would be a good home for it based on what else is there.

lone axle
tulip sleet
#

re-run failed again

lone axle
tulip sleet
#

aha, so it's innocuous, no associated issue?

#

but it should just exit quietly in that case

lone axle
#

well a bit further up it sets issue as

const issue = workflow_run.pull_requests[0];

which makes me think maybe it's actually a PR but being called an issue in that context.

As far as I understand it the bot only posts on PRs since that is where the failed workflow run that triggered it would have happened.

#

agree'd I don't think it's innocuous because it's only a failure of the bot that posts the comment as far as I understand it (whatever the PR is addressing is seperate and unrelated to the failure I believe). It would be good to make it exit quietly, presumably the JS could check for undefined and handle it more gracefully. It is kind of odd that it would be undefined as well though since the PR does exist, that might point to a seperate root cause.

tulip sleet
#

hmm, that is odd

tulip sleet
#

thanks for posting that

cobalt grail
#

πŸ‡ΈπŸ‡ͺ πŸ‘‹

tulip sleet
cobalt grail
#

Not today. πŸ™‚

tulip sleet
#

it is equinox

manic glacierBOT
#

Thanks so much @jepler for your deep-dive on this. TBH the use of yield within an __await__ method did seem interesting.

Changing yield to await inside the helper class got it working.

Now, given that keypad.Keys follows a streaming paradigm, it felt appropriate to rework the helper into an async generator pattern. So I've updated the above to:

class KeysGen:
    """
    Helper class which moves the polling burden from Python code to underlying C code
    Reference: h...
manic glacierBOT
manic glacierBOT
#

@jepler I can't strongly enough recommend learning more asyncio stuff.

The implementation of asyncio in CircuitPython is fairly minimal at the moment. But it works amazingly well. Many of the more familiar CPython facilities like asyncio.Queue are not difficult to implement.

With CircuitPython's strategic decision to exclude interrupts, for anything but the most basic programs, asyncio is the only line of defence against sloppy inefficient poll cycles. It facilitates writing of effici...

trim elm
#

Cc @lone axle ^

tulip sleet
#

@lone axle I think i t would sense to fork Eva's repo as adafruit, or copy scripts into adafruit/adabot, etc.

tulip sleet
#

@slender iron I am reviewing the idf 5 PR

crimson ferry
#

Adafruit Metro ESP32-S3 with 16 MB Flash 8 MB PSRAM PID: 5500 appears to have an SD reader, but it's not in the product title or description

#

(contrast with Adafruit Metro M7 with microSD - Featuring NXP iMX RT1011 PID: 5600)

lone axle
# crimson ferry Adafruit Metro ESP32-S3 with 16 MB Flash 8 MB PSRAM PID: 5500 appears to have an...

I think maybe there will be a new hardware revision. I think I recall mention during a meeting of an issue pertaining to the SDCard slot on that device. I have one of the ones that did ship already and it doesn't run SDCard sample code correctly, I didn't chase it or troubleshoot very much though either, and I may have misunderstood the mention in the meeting. I don't know the specifics of what is up with it. But if it doesn't work on the existing revision perhaps it was removed until the new ones start shipping.

crimson ferry
#

yeah I think the product is in hiatus until the revision comes out, hopefully there's a way to get the SD Card working

#

I don't recall from the stream what the fix was going to be

#

SD Card is a big plus, but I pointed that out mainly b/c if it will have SD Card, it's a good marketing point to include

#

and consistent product titles make it easier to find (and compare) stuff

slender iron
#

they'll be smaller

manic glacierBOT
slender iron
#

@tulip sleet any objections to merging? thanks for the review!

tulip sleet
slender iron
#

follow up PRs will be much easier to follow

#

merging means I can rebase my 5.1 changes and get them out πŸ™‚

tulip sleet
#

so should there be a reminder issue about rgbmatrix or is that in your queue

slender iron
#

I'll make one

tulip sleet
#

i just got an email about cryptography <39.0.1 being a serious security issue

#

you got it too, i'm sure

manic glacierBOT
slender iron
#

I don't see it yet

mortal kernel
#

@slender iron @tulip sleet Wondering if you see a problem with BTStack licensing?

tulip sleet
#

we were worrying about it, there is some kind of exception for RP2040, but q is whether it's enough

mortal kernel
#

Yeah, I saw that. The way I read it is that the exception is for the Pico W and WH only.

slender iron
#

basically anyone with a pico w or wh can use it

#

ya, we won't use it elsewhere

tulip sleet
#

key is:

Raspberry Pi grants to the Customer a non-exclusive, non-transferable, non-sublicensable, irrevocable, perpetual
and worldwide licence to use, copy, store, develop, modify, and transmit BTstack in order to use BTstack with or
integrate BTstack into Products or Customer Products, and distribute BTstack as part of these Products or
Customer Products or their related documentation or SDKs.

#

so commercial products using CPy on Pico W/WH are OK

slender iron
#

or products that integrate the two

mortal kernel
#

β€œProduct” shall refer to Raspberry Pi hardware products Raspberry Pi Pico W or Raspberry Pi Pico WH.

tulip sleet
#

I believe RPi would have been quite careful about this, because they don't want to restrict the user of their products in any way.

#

And we have no desire/intention/ability to get the radio module and build a Pico-W-ish thing

mortal kernel
#

Looking through the code I found some 3rd party boards that do have the CYW43 or at least include its driver in their stacks.

tulip sleet
#

they would have licensed it themselves, I assume

mortal kernel
#

For my work it comes down to a choice between making BTStack a part of all existing boards that include CYW43 or fencing it off to just the Pico W/WH.

manic glacierBOT
slender iron
#

I don't know of any that have the cyw separately from the RP2040

#

I know damien uses it on some of his stm boards

#

that's why his license is for rp2040 only

mortal kernel
#

It all sounds good to me. You've put my worries to rest. Thanks!

slender iron
#

@onyx hinge any chance you have test code for the qualia + round display?

onyx hinge
#

@slender iron yes, I'll get it to you after lunch

slender iron
#

thank you

cedar veldt
#

I'd got the impression that the RMT API was completely changed in ESP-IDF v5, but pulseio hasn't changed, so I guess that means the old API is still there?

slender iron
#

ya, they guard it behind warnings

onyx hinge
slender iron
#

@onyx hinge I found that but wasn't sure what board it was for. Hoping it was for the newer expander helper. I'll convert it after I eat lunch

onyx hinge
#

rev B board

thorny jay
manic glacierBOT
manic glacierBOT
slender iron
#

we can follow up with libm if we want to change it

#

time for weekend

manic glacierBOT
#

Hello, I was the original person who posted this issue in the Adafruit forums. I apologize for the delay. My mother has some scary medical conditions happening right now that I have been tending to. Just FYI on my setup. I am the using the Titanto with NINA-FW version 1.7.5 upgraded as well. First thing I did was upgrade it. Per @caternuson I ran an older release, 7.3 and the issue went away (same SD card no change). I have no upgraded to 8.x and I ignored the portions of the "how-to-guide" ...

manic glacierBOT
#

So I found another tool, that let me test several gigs of random IO, still averaging slightly higher numbers than my last post 50's for write and 90's for read. This matched up with the Mac's built in system monitor I watched the IO on there as well. Suffice to say the numbers are not dropping anywhere near the danger zone. Now I have to let my microSD card cool off its toasty hot! :) Cheers.

manic glacierBOT
#

CircuitPython version

Version: Adafruit CircuitPython 9.0.0-alpha.1-37-g4563c35908 on 2023-09-12; EK68Custom with rp2040

Code/REPL

Here are two minimal examples:
This code works with no crash:

    import time
    from kmk.kmk_keyboard import KMKKeyboard
    from kmk.modules.layers import Layers
    from kmk.keys import KC
    keyboard = KMKKeyboard()
    FN = KC.MO(1)
    layers = Layers()
    while True:
        print("Waiting")
        time.s...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.6 on 2023-09-12; Adafruit Feather M4 Express with samd51j19

Supplying 65536 as the value_count argument to a displayio.Bitmap constructor yields
an error that value must be 1..65535:

>>> import displayio
>>> bitmap = displayio.Bitmap(160, 120, 65536)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: value_count must be 1-65535
>>>

But in a colorspace like RGB565, all 65536 16-bit values are vali...
manic glacierBOT
#

soory for my newb question.

Is there a way to rename the usb_midi device name?
by default it named CircuitPython usb_midi.ports[x]

i tried to modifing the .uf2 file with an hex editor, but does not work.
i tried with a different length name and the uf2 is not working (no boot)
i tried a second time with the same number of char (13), the uf2 seems to work but the device has the same name CircuitPython....

i tried supervisor.set_usb_identification("Herve Bi", "Herve Bi") but no mo...

manic glacierBOT
#

I have the debug build.

(It was exciting to make it because the build dependencies had a mismatch:

manic glacierBOT
thorny dove
manic glacierBOT
#
Adafruit CircuitPython 8.2.6 on 2023-09-12; Adafruit PyGamer with samd51j19
>>> import microcontroller
>>> microcontroller.watchdog.mode is None
True

In 8.2.x, None is the value of the mode property before it is set to something else. After this PR, it is WatchDogMode.NONE.

I see this as an incompatibility. It may be minor enough that we just go ahead and do it. @tannewt @dhalbert I would appreciate your opinion on how closely we require backward compatibility.

I w...

manic glacierBOT
#

@dhalbert
i build a small box with 2 rotatives pot on it and a rp2040 to send midi datas.
I use the pot to have a physical interface to manupulate things in Processing.org
in my sketch the device listed is CircuitPython usb_midi.ports[0]

Available MIDI Devices:

----------Input----------  
[0] "Real Time Sequencer"  
[1] "CircuitPython usb_midi.ports[0]"  
----------Output----------   
[0] "Gervill"  
[1] "Real Time Sequencer"  
[2] "CircuitPython usb_midi.ports[0]"

...

manic glacierBOT
crimson ferry
#

@thorny dove AuthMode is basically an enum, espressif connect doesn't use it directly (the espressif or raspberrypi common-hal functions handle it). It's more directly used to interpret scans, and for creating an access point. Not sure if a default makes sense since folks may use any supported AuthMode. I wonder if including that line was coincidental in fixing the issue. Error 2 is WIFI_RADIO_ERROR_AUTH_EXPIRE

manic glacierBOT
manic glacierBOT
#

trying this code with the latest qualia board:

import busio
import microcontroller
import board
import time
import displayio
import dotclockframebuffer
from framebufferio import FramebufferDisplay

displayio.release_displays()
TFT_PINS = dict(board.TFT)
print(TFT_PINS)
TFT_TIMINGS = {
    "frequency": 6_500_000, # should be 18_000_000,
    "width": 480,
    "height": 480,
    "hsync_pulse_width": 13,
    "hsync_front_porch": 40,
    "hsync_back_porch": 20,
    "vsync...
manic glacierBOT
#

CircuitPython version

From S3 builds:
adafruit-circuitpython-m5stack_timer_camera_x-en_US-20230923-1c0155c <-- Doesn't boot idf5.1
adafruit-circuitpython-m5stack_timer_camera_x-en_US-20230922-d6b284e <-- Boots just fine idf5.0

Code/REPL

N/A
But wifi auto-connect is enabled without web-workflow.

Behavior

Stuck at:

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_...
hidden rain
#

My pico is connected to a through UART Serial (115,200/8/1/None) Cellular modem. Most of the time it works fine, but occasionally appears to drop byte. It could be the cellular modem, but it could be the pico. How do I figure this out and what can be done?

stuck elbow
hidden rain
stuck elbow
#

looking at what is getting transmitted might help to pin-point the issue

#

you can also use another pico as a logic analyzer

hidden rain
#

Most things work well. I am performing a GET and then a READ of the result. POSTMAN works fine, so cloud appears fine. But my setup is receiveing b'{"sta": true, "ult":"23949379384759"}' when the fist two keys should be "status" and "result".

stuck elbow
#

record the transmissions with your logic analyzer, and look at what is actually transmitted

hidden rain
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
onyx hinge
#

is there a circuitpython equivalent to micropython.heap_lock() ? (which incidentally is documented in circuitpython but not available)

#

There's gc.disable() which isn't a great diagnostic tool but it did help me find the allocations & eliminate them.

slender iron
#

@onyx hinge I added a class memorymonitor to find allocations

#

you need to enable it though

manic glacierBOT
#
  • Fix releasing dot clock framebuffers at soft reset (a possible cause of "ValueError: GPIO2 in use")
  • add support for a reset pin on the IO expander
  • re-order the arguments & add board.TFT_IO_EXPANDER to ease calling ioexpander_send_init_sequence

Closes #8428 @ladyada
I noticed that the dot clock can be increased to 16MHz without causing screen tearing in my demo :tada: @tannewt

The Espressif LCD EV needs to be updated with board.TFT_IO_EXPANDER, which is why I'm creating th...

candid sun
#

<@&356864093652516868> We'll have our weekly meeting in about 80 minutes from now in this text channel and in the circuitpython voice channel. Please take the time to add your notes in advance to the document: https://docs.google.com/document/d/1rA4Zb-rPvZ2IDEfw417YdOcJAgLuj8zJIBPn_7P6vYI/edit -- I look forward to everyone's updates!

mortal kernel
#

I'm unclear about the environment variables CIRCUITPY_BLEIO and CIRCUITPY_BLEIO_HCI. How are they intended to be used? Are /device/ble_hci and a port with common-hal/_bleio mutually exclusive?

tulip sleet
#

HCI is how you talk to co-processors (it's the protocol name)

mortal kernel
slender iron
#

ya, I think you just want BLEIO

rancid pilot
#

Hey. Is there a better way to debug an ESP32 S3 board? Like with an attached debugger somehow? The build with DEBUG=1 doesn't really help. The cause of the crash is not printed I think.

#

I'm thinking like: building the circuitpython for the board in Eclipse or other IDE, then hitting a debug icon then it loads the code on the chip and when it crashes I can see the call stack or something similar.

lone axle
rancid pilot
#

I am hooked up to the BOARD.TX pin and reading the messages from a uart to usb chip:

lone axle
#

The pin that is labeled TX on the silkscreen? Which specific microcontroller are you using? is it an Adafruit board?

rancid pilot
#

Unexpected maker TinyS3

#

8.2.6 branch, special build with DEBUG=1 flag set

lone axle
#

I see, sorry I don't have any expereince with that device, I'm not sure which pin is the debug pin on that device. On the Adafruit ones that I have more hands on experience with, there is a pin labeled DBG which you can hook up to a USB serial converter to read the messages from crashes in DEBUG=1 builds.

rancid pilot
#

so there should be another pin, oke

#

thats something i can do some research on

lone axle
#

possibly, I can't say for certain that it isn't TX either though on that device, I just don't know for it.

#

typically for espressif devices when DEBUG is on it will output an encoded string of hex data, that can be run through a script to return a human readable stack trace.

rancid pilot
#

I think i am already on that DBG pin

#

but i could add extra debug message entries to the code

idle owl
#

Hey, folks. Can I please be added to the circuitpythonistas role? Cheers!

tulip sleet
#

i can do that

onyx hinge
#

@idle owl done!

idle owl
#

Thank you!

slender iron
#

multiple folks doing it at once πŸ™‚

lone axle
onyx hinge
lone axle
rancid pilot
#

Is there a guide on how to use J-Link with GDB to debug circuitpython on esp32 boards?

slender iron
#

I've never done it. I suspect you may not have a code error because your start reason is POWERON

#

it could be related to anything connected to GPIO37

rancid pilot
#

maybe oh

#

let me unplug the board and test

slender iron
#

I only do printf debugging on esp

rancid pilot
#

u were right

#

pulling a gpio low probably causes a short somewhere

#

and that causes a hard reset

#

thank you

onyx hinge
#

I apparently wrote that page but don't remember anything not written there πŸ˜‰

manic glacierBOT
idle owl
#

Or not! Read for me.

#

Says I'm still "suppressed". πŸ˜‚

onyx hinge
#

[I think right after being added to a role you have to leave and re-join the voice channel before you can talk]

idle owl
#

Reload worked.

#

Hooray!

#

@midnight ember πŸ’œ

mortal kernel
idle owl
#

I read that as "Unicorn Micro M" keyboard. I'm a little disappointed to be wrong.

onyx hinge
idle owl
#

Thank you!

onyx hinge
#

can't wait for more info. I'll have to increase my sponsorship on github too

idle owl
#

I'll be refreshing everything there really soon too. So wait on that! πŸ˜„

gilded cradle
#

Will do @slender iron

onyx hinge
#

Yeah I see what you mean. I think the "monthly mention on Twitter" is not a valuable sponsorship level for me. 😬

idle owl
#

Oof I forgot that's still there. I'm not even there anymore.

onyx hinge
#

I know

thorny jay
#

Hi, so Anne suggested I explain why using the web interface of GitHub is important for me. πŸ™‚

#

It is just that I frequently do mini change by editing comments or readme and such.

#

Without having to use git and a copy of the repo.

onyx hinge
#

A big technical problem is that changing a location on github means changing the links in the guide. Right now I don't think there's a bulk link change in learn.

thorny jay
#

Maybe a new 2023 folder for new guide?

#

Or a way to split that is predictable?

onyx hinge
thorny jay
#

Learn access is OK.

gilded cradle
#

I like foamyguy's suggestion about a generated list. It could maybe be put in the readme.

lone axle
#

It's weird to me that Github just truncates it and doesn't offer pagination. If they had pages then it would at least make everything accessible.

thorny jay
#

Thanks.

slender iron
#

Thanks everyone!

gilded cradle
#

Thanks everyone

idle owl
#

Thanks all!

midnight ember
#

missed the meeting, will catch it on youtube. this is why it's a good idea to put text only way ahead of time just in case.

lone axle
#

Thanks for hosting Liz. have a good week everyone πŸŽ‰

ember iris
#

Thanks everyone, have a great week!

thorny jay
#

Most of the Monday I am not at home during meeting time, I sometimes listen from the car, but nowdays I am mostly watching on YouTube or listening on Spotify.
And then for timezone reason, I watch most of Adafruit video the next day (especially Show and Tell, Ask an Eng. and Desk of Lady Ada. πŸ™‚

mortal kernel
# tulip sleet i can do that

I'm happy with it in the RP2040 port. It's kinda joined at the hip with CYW43 Wifi and the Pico SDK, so leaving it in RP2040 until there's a non-RP2040 board with a CYW43 makes sense to me.

tulip sleet
candid sun
#

Here is the notes document for next Monday’s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868>
https://docs.google.com/document/d/12JEwXvIK4qXQrW0834d0OvcB_UJrkzvz7ZYyqQ8iLmg/edit

manic glacierBOT
#

CircuitPython version

n/a

Code/REPL

Just the docs here: https://docs.circuitpython.org/en/latest/shared-bindings/ulab/numpy/linalg/index.html#ulab.numpy.linalg.eig

Behavior

image

It says it returns (eigenvectors, eigenvalues) while it actually returns (eigenvalues, eigenvectors).

Actual behavior is inline with numpy.

Description

_No ...

#

I found the problem. The Espressif SDK only finds hidden APs using channels between 1 and 11. My AP was using the channel 13.

Something like wifi.radio.connect("myssid", "mypass", bssid=b'\x124Vx\x90\xab') will connect to the hidden AP. I can ping external servers from the board and ping the board from the network.

Here is the code:

import wifi
import ipaddress
import binascii
ipv4 = ipaddress.IPv4Address("192.168.1.100")
netmask = ipaddress.IPv4Address("255.255.255.0"...
lone axle
#

Does anyone know what might be the cause of this error from the gh_release action that runs when libraries are released?

Error: Error: unexpected status code: 403
{"message":"Resource not accessible by integration"}

The 403 makes me think it's something related to permissions of the default token used inside of actions. Maybe there could be some different configuration for this repo vs. the others that could cause it? https://github.com/adafruit/Adafruit_CircuitPython_Wii_Classic/actions/runs/6301808822/job/17107662157

lone axle
#

Similar, but on the PyPi release action for this one: it got 403 attempting to upload to pypi:

ERROR    HTTPError: 403 Forbidden from https://upload.pypi.org/legacy/          
         Invalid or non-existent authentication information. See                
         https://pypi.org/help/#invalid-auth for more information.

https://github.com/adafruit/Adafruit_CircuitPython_BusDevice/actions/runs/6301838308/job/17116177855

I don't really understand how that could be failing for this library though, there are successful pypi release action runs in the past so unless the token or it's permissions were changed in the interim, it should behave the same as it did for prior releases.

manic glacierBOT
manic glacierBOT
#

circuitpython doesn't restrict channel tighter than 1-13 due to its international audience, but if the espressif SDK limits connect() to 1-11, perhaps we should too. Not sure what raspberrypi SDK supports offhand.

I'm pretty sure APs can be created on 1-13, and wifi Monitor can receive 1-13. I see (U.S.) quite a few devices using channel 12, little to none on channel 13. Channels 12 and 13 have use limitations in the U.S.

onyx hinge
#

@slender iron I think I need to change an esp-idf kconfig setting. do you have a minute to walk me through doing it? LCD_RGB_RESTART_IN_VSYNC

#

I need it to be =Y everywhere it exists, or at least on all S3

slender iron
#

@onyx hinge yup! I have time

onyx hinge
#

do you want to do voice/video or text?

slender iron
#

either way

onyx hinge
#

let me get ready to do video.

lone axle
#

This is another weird actions error https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_FlipClock/actions/runs/6301847922/job/17107796188, but perhaps this one is insignificant. Actions reports that this failed the gh-upload-release-assets due to Error: Input required and not supplied: upload_url but on the actual release page it does have all of the assets attached successfully as far as I can tell. It seems like it thinks it failed, but actually suceeded. I'm not sure why it would think it's failed that way either honestly. The workflow does set the upload-url thusly: upload-url: ${{ github.event.release.upload_url }} which is the same for other repos and it seems to work fine for most libraries, but this one has shown failures on the last 2 releases with the same error (in both cases the actual release page does have the assets showing on it it correctly)

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.6 on 2023-09-12; Raspberry Pi Pico with rp2040

Code/REPL

""" Demonstrates a couple of issues in CircuitPython audio: 8-bit WAV
    playing fails with RuntimeError, and RawSample playback does not
    clear .playing flag at end.
    Test system is RP2040 Pico. Occurs with both audiopwmio and
    audiobusio.I2S; example shows just audiopwmio for simplicity.
"""

import array
import time
import board
i...
tulip sleet
#

@lone axle your build problems are interesting, but I am too tired to look πŸ™‚ I'll take a look tomw

rancid pilot
#

Is it normal that bitbangio.I2C contructor pins are swapped on S3 boards (compared to busio constructor, and the api doc)?:

#

had to take my logic analyser out to realise this discrepency.

#

had to swap scl and sda in the protocol analyser config and everything made sense

rancid pilot
#

looking at the shared-module code at https://github.com/adafruit/circuitpython/blob/main/shared-module/bitbangio/I2C.c i don't see or undesrand why it is swapped. Double checked IC datasheets, eagle library pinout mapping, soldered wires and hooked up to logic analyser. I am 99% sure the swap is not in my hardware.

GitHub

CircuitPython - a Python implementation for teaching coding with microcontrollers - adafruit/circuitpython

manic glacierBOT
jaunty juniper
rancid pilot
#

Unexpected maker Nano S3

#

I'll do the test now

#

super odd, now i get pull up resistor error message

#

it has pullup resistors

#

bitbangio does work

#

I feel like I am a bug magnet 😦

jaunty juniper
#

I usually try a power cycle first in that case

rancid pilot
#

bitbangio beats busio πŸ™‚

#

works with that

jaunty juniper
#

and what if you swap the pins ?

rancid pilot
#

power cycle doesnt help

#

swap doesnt help

#

it is a custom board

jaunty juniper
#

does bitbangio even check for pull ups ? πŸ€”

rancid pilot
jaunty juniper
#

busio pulls the pin down, and tests if it goes back up fast enough for the target frequency

rancid pilot
#

pullup is there in resistor array i can measure, all connected

#

bus length is in centimeters

#

So i want to use 3 I2C buses, the default one, another one with busio (the hardware supports 2) and a third with bitbangio. All 3 (2*3=6) pullup resistors are there in those resistor array black boxes. Vcc is 3.3V, pullup value is 3300 ohm for each.

rancid pilot
#

I can make a more proper setup on a breadboard, take measurements, do scrrenshots and make a github issue ticket if u like.

jaunty juniper
#

yeah I don't know what's going on there

rancid pilot
#

oke, will make proper setup with a breadboard, maybe I am doing smtg wrong on those tiny little boards of mine.

manic glacierBOT
manic glacierBOT
mortal kernel
#

@danh Wondering if you've approached TLV (tag length value store) in any of the other ble ports? If so, could you point me to one?

slender iron
#

are you to the point where you want to get bonding working?

mortal kernel
slender iron
#

can you disable it to start?

mortal kernel
#

BTstack has a btstack_tlv_none.c, but the SDK has nothing similar.

slender iron
#

nvm is the closest you'll find in circuitpython probably

#

how do you specify the flash region for the sdk?

mortal kernel
#

It's in btstack_flash_bank.h which specifies a size and offset.

#

By default it chooses two sectors at the top of flash.

slender iron
#

I'd put it at the top of the code region in flash

#

(assuming it all fits)

#

so just below the filesystem

mortal kernel
#

All indications are that it will fit!

slender iron
#

πŸ‘

mortal kernel
#

FYI, with the necessary firmware blobs and most of the BTstack, flash goes from 1344448(85.7%) to 1386304 (88.37%) and static RAM from 105220(40.14%) to 117120(44.68%)

slender iron
#

that's not too full πŸ™‚

mortal kernel
#

Thanks @slender iron that keeps me rolling along...

slender iron
#

I'm happy to help keep you unblocked. I appreciate you looking into it

mortal kernel
#

So far I'm enjoying the ride. The journey's the reward as SJ used to say whenever someone asked him for a raise!

slender iron
#

πŸ„

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Fix for first half of issue #8432, the "buffer too small" exception. Also a minor change to the 8- to 16-bit scaling math that previously would cause a slight DC offset.

I can see where the second half of the aforementioned issue (.playing always True w/RawSample) is happening. Don’t have a fix for that yet, but if I can sort that out, and if before this is merged, will add it to this PR.

manic glacierBOT
manic glacierBOT
tulip sleet
#

@onyx hinge i have a few new-style typedefs left to do that have namedtuples inside. I seem to remember you did that for one of them already, and would follow how you did it. Or am I misremembering? I could not find a commit message that mentioned that.

manic glacierBOT
#

PR #8436 fixes the first bug (8-bit WAV playback on RP2040).

The second bug is a bit beyond me but I can see where it’s happening in ports/raspberrypi/audio_dma.c, in audio_dma_load_next_block(). RawSample audio playback is single-buffered, it just plays straight from the array in one pass. Double-buffered audio makes multiple calls through audiosample_get_buffer() and audio_dma_convert_samples() to determine when there’s no more data to read and to play back; a combination of GET_BUFFER_D...

manic glacierBOT
manic glacierBOT
lone axle
#

I believe these are the only remaining Library Releases that had trouble that I was unable to figure out:

https://github.com/adafruit/Adafruit_CircuitPython_Wave/actions/runs/6301919145/job/17108014971
403 error on the Github Release assets upload

https://github.com/adafruit/Adafruit_CircuitPython_BusDevice/actions/runs/6301838308
403 error on the PyPi upload

https://github.com/adafruit/Adafruit_CircuitPython_Wii_Classic/actions/runs/6301808822
403 error on the Github Release assets upload


https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_FlipClock/actions/runs/6301847922/job/17107796188
error on Github Release asset upload
Error: Input required and not supplied: upload_url
(but assets do show up on the release page successfully)

The first 3 are similar in nature, 403 errors when trying to upload release assets to either PyPi or Github. The 4th is different, but also potentially less significant because in spite of reporting an error the release page does appear to have the appropriate assets listed.

My best guess on the first 3 are something weird with the token(s) or permission(s) within the repo settings or the systems they are interacting with. I could not really find any rhyme or reason about why they might have failed in anything that is visible to me. It's likely we'll need someone with access to the settings page of the repo, or those other systems to take a look for further troubleshooting.

manic glacierBOT
#

mooooon clock demo:

import displayio
displayio.release_displays()

import time
import busio
import board
import digitalio
import os
import ipaddress
import ssl
import wifi
import microcontroller
import socketpool
import adafruit_requests
import adafruit_imageload
import dotclockframebuffer
from framebufferio import FramebufferDisplay
from microcontroller import pin

init_sequence_tl021wvc02 = bytes((
    0xff, 0x05, 0x77, 0x01, 0x00, 0x00, 0x10,
    0xc0, 0x02, 0x...
onyx hinge
#

@slender iron what's my next step when esp32-s3 gives me a safe mode with "internal watchdog timer expired"? This is coming up when I set 90 degree rotation on this unusual 320x960 pixel dot clock display. It might be some "real problem" or it might just be that it takes a long time to fill the display. It is working fine in normal mode (rotation 0 or 180) but not in 90 or 270-rotated mode.

rst:0x8 (TG1WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)

slender iron
#

I usually add prints to figure out where it is

onyx hinge
#

what routine needs to be called to stop TG1WDT from biting?

slender iron
#

that's the interrupt watchdog so it shouldn't be easy to break

#

I've seen it due to memory corruption

onyx hinge
#

"merely" running for a long time without calling background tasks shouldn't do it?

slender iron
#

or resetting the ram/flash pins

#

I don't think it should

#

you could try doing the port yield

onyx hinge
#

I think I see something on the stack that might be getting exceeded

#

yup, there's some confusion about the size of the "dirty rows" array in displayio. this might also affect rotated rgbmatrix & sharp memory displays.

#

I think "dirty rows" probably just needs to track the first/last rows updated but 🀷

onyx hinge
#

it's refreshing slowly because a rotated OnDiskBitmap is very inefficient .. it fills in irregularly because of the CPU's data cache. The last thing when a draw finishes is to flush the entire CPU cache so the display can fetch the latest data from psram.

slender iron
#

neat!

#

@onyx hinge I'm changing framebuffer display's refresh to match the main display one

#

it's much saner

onyx hinge
#

Fine by me! it may conflict with the PR I'm about to put in, but we can work it out

slender iron
#

yup, np

onyx hinge
#

I am fine having my code improved, every time I look back it's easy to see there were things I didn't understand. Same for after someone who DOES understand goes over my code and helps me. so thanks!

slender iron
#

I think its a copy of the older version that I did πŸ™‚

manic glacierBOT
#

Also needs https://raw.githubusercontent.com/adafruit/display-ruler/main/display-ruler-720p.bmp on CIRCUITPY

<details>
<summary>Full program for "hd458" display</summary>

from displayio import release_displays
release_displays()

import displayio
import time
import busio
import board
import digitalio
import microcontroller
import dotclockframebuffer
from framebufferio import FramebufferDisplay
from microcontroller import pin

init_sequence_hd458 = bytes((
    b'\xf...
manic glacierBOT
manic glacierBOT
slender iron
#

@onyx hinge I think I'm running down a bug you saw with #8056

#

when you added matrix portal s3

#

the supervisor memory alloc and free only work if it isn't moved

onyx hinge
#

that's so far out of my brain right now that I'll take your word for it.

tulip sleet
slender iron
tulip sleet
#

btw, I see no usages of CIRCUITPY_PARALLEL_DISPLAY except that it's included by default in larger builds

#

but no boards specifically turn it on

slender iron
#

πŸ‘

manic glacierBOT
#

CircuitPython version

origin/main

Code/REPL

$ python3 tools/ci_set_matrix.py supervisor/shared/web_workflow/web_workflow.c supervisor/shared/web_workflow/web_workflow.c
Using files list on commandline
Using jobs list in LAST_FAILED_JOBS
::group::Log: changed_files
{'supervisor/shared/web_workflow/web_workflow.c'}
::endgroup::
::group::Log: last_failed_jobs
{}
::endgroup::
Running: conditionally
Building docs: False
Would set GitHub actions output...
#

I think I've been chasing this bug. The short reasoning is that RGBMatrix uses the supervisor to allocate some memory. When it does, it doesn't hold onto the outer allocation object. Instead, when freeing a pointer, it looks up the allocation object again. This only works if the memory isn't moved by the supervisor (which it does.) This leaks supervisor allocations and the crash occurs when out of allocation objects.

I'm working on a fix now.

manic glacierBOT
manic glacierBOT
lone sandalBOT
orchid basinBOT
#

This just takes the board files and exposes them as an api endpoint. This would allow folks to pull this data down easier. A specific use case is for the Adafruit shop to figure out what boards work with circuitpython easily. If there are other/better endpoints that already exist, we could use those instead. This could work for anyone that needs the board file details though (which don't exist in the files.json or bootloaders.json file).

Endpoint:
circuitpython.org/api/boards.json

Exam...

manic glacierBOT
brazen hatch
midnight ember
# onyx hinge interesting refresh pattern

I had a similar issue adding a new display that was refreshing portrait mode even while rotated in landscape mode. The init sequence also holds the key to refresh direction., at least with the display I was using. I used openai to read the data sheet and write the init sequence to refresh in landscape mode. Worth a shot?

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-alpha.1-50-gaa0d7aad83 on 2023-09-28; M5Stack Timer Camera X with ESP32

Code/REPL

https://github.com/bill88t/CircuitPython_FTP_Server, current master 53224fdd20302d4005054011b51a45591f3ac0fd loaded onto the board

code.py:

import wifi
from socketpool import SocketPool
from ftp_server import ftp
from supervisor import reload

if not wifi.radio.connected:
    print("No wifi")
    reload()

pool ...
manic glacierBOT
#

I'd rather not change this file. The CYW bits are a hack I'd rather not propagate further. Instead, let's model it more like the existing Python IO expander code. Here is an example. It has two main classes, one for the chip overall and one "DigitalInOut" to act like one via the IO expander. The tca9555 module would have these two classes.

Then board can reference the DIO objects. I don't want t...

#

Thank you for the reorganization. I think it'll help the changes going forwards.

Overall, I don't want to mimic the CYW implementation and pretend to be a microcontroller pin. It isn't. It is much more limited. Ultimately, that'll confuse folks and riddle the core common-hal implementations with special cases.

Instead, I want to mimic the Python-level IO expander libraries that have a chip class and then *-like classes for the pin functionality. Then, any native code you want to use i...

slender iron
#

@tulip sleet @onyx hinge should I change how CYW led pin works in 9? I don't think it should pretend to be a mcu pin. ☝️

tulip sleet
onyx hinge
#

@slender iron a key reason I decided do to the terrible thing I did is so that examples would work

tulip sleet
#

what is the alternative way to toggle that pin, say?

onyx hinge
#

another idea I had was whether "construct a DigitalIO for a pin" could be made into a method of the pin object, so then it becomes natural for different kinds of pins to be constructed "in a consistent way". board.LED.to_digitalio()

slender iron
#

Ya, I know. I'm worried about the long term effect of papering over a weird board design decision

onyx hinge
#

I assume the object will still behave like a DigitalInOut instance with value, direction, etc..

manic glacierBOT
#

Tested articfact Adafruit CircuitPython 9.0.0-alpha.1-52-g034caf701d on 2023-09-28; Raspberry Pi Pico W with rp2040...

Confirmed no regression with web workflow / auto-connect enabled:
β€’ after reload or soft reset, station is connected to wifi.

With web workflow / auto-connect not enabled:
β€’ connected station is disconnected after reload or soft reset
β€’ AP is not active after reload or soft reset
β€’ connected station is disconnected and AP is not active after `wifi.radio.enabled = ...

slender iron
#

the IO expander class I linked to has a get_pin(#)

#

maybe we need board.LED()

#

like board.I2C()

tulip sleet
#

maybe just board.CWY43_LED() or board.CYW43_LED. I would not like to have to introduce this rather odd thing just for boards like this.

slender iron
#

ya, that's where I'm at too

tulip sleet
#

basically the CYW43 is an IO expander in this case.

onyx hinge
#

yes that's exactly right

#

I do like the idea of moving towards "you call a function to get a thing that implements the digital I/O interface" rather than passing the pin to a DigitalInOut constructor.

slender iron
#

the normal blink is ```python
import board
import digitalio
import time

led = digitalio.DigitalInOut(board.LED)
led.switch_to_output()
while True:
led.value = True
time.sleep(0.1)
led.value = False
time.sleep(0.1)

onyx hinge
#

It's also worth thinking over how an incompatible change in this area might help with some frequently requested things like more pad control

#

drive strength, pulls, inversions via a pad object, not via a DigitalInOut object, so that they still work with special functions such as spi, pio, etc

slender iron
#

with cyw you could do ```python
import board
import digitalio
import time

led = board.LED
led.switch_to_output()
while True:
led.value = True
time.sleep(0.1)
led.value = False
time.sleep(0.1)

tulip sleet
#

Yes, I was just thinking about this pin vs pad thing

slender iron
#

I think you could add functionality for pad settings to microcontroller.Pin objects

tulip sleet
#

just going to look at MicroPython

onyx hinge
#

another Q is how this generalizes to a bus that has more than one line. spi = board.SCK.to_spi(miso=board.MISO, mosi=board.MOSI) ? 🀣 😭

tulip sleet
#

machine.Pin is basically a "Pad".

slender iron
#

I don't think I'd do the callable thing if I could avoid it

tulip sleet
#

the so they are NOT singletons

#

I mean, they are not pre-created

onyx hinge
#

if board.LED becomes a DigitalInOut object, how would you PWM the built-in LED on boards that were NOT cyw43-based?

tulip sleet
#

I guess they could be

slender iron
#

(I'd rather not change everything)

#

I'd rather just have a different blink for pico w

onyx hinge
#

If it behaves that differently it probably should not be called board.LED, that invites confusion.

slender iron
#

thats ok with me

tulip sleet
#

so then board.CYW43_LED

#

etc

onyx hinge
#

having it be under any other name means you can make it work how you want

slender iron
#

I think it can be left up to board designers how they label it

tulip sleet
#

it's interesting, we could have singleton objects for each pin, but have them have state (pulls, etc.)

slender iron
#

but agree that .LED is "reserved"

slender iron
#

they just have their object struct in rom and no functions

onyx hinge
#

what's missing when you just have pin singletons, or can set output values via pads, is that you can't track WHO thinks they're using the resource

#

like, you have two coroutines that both try to blink the same LED

#

I'm not saying this is a killer problem, but that is a thing that was NICE about the explicitness of constructing a digitalio object

#

and I thought it was kind of a key distinction of the CP & MP ways

slender iron
#

I don't think forcing the output value of the pad is common

#

it does need to be muxed to a gpio peripheral usually I think

onyx hinge
#

I just mean two chunks of code both doing board.CYW43_LED.value = ..., and I'm (over-)generalizing from that to a new "no distinction between digitalio &pin anymore" world that nobody actually proposed

slender iron
#

ah right. that's the danger of a singleton

tulip sleet
#

so we would have microcontroller.Pin.pull = Pull.HIGH, etc. I am off in left field from what you are talking about.

onyx hinge
#

board.CYW43_LED.as_digitalio() at least keeps an explicit step that reads a lot like constructing a digitalio, and could work in the same way as far as actually marking the pin in use

slender iron
tulip sleet
#

well, people want to set pulls in circumstances we haven't though of, like some people want a pull on an SPI pin, or something

slender iron
slender iron
onyx hinge
#

setting drive strength without adding things to every peripheral object I think is the actual good use of pads

tulip sleet
#

yes, that's a better example

#

or why don't we have board.LED.value = True already?

slender iron
tulip sleet
#

when a pin was claimed by SPI then that would be prohibited

slender iron
#

that's an argument for board.LED() I think

tulip sleet
#

setting the output value or the direction would be prohibited, but setting pull or drive strength would not

slender iron
#

it could raise an error if D13 is in use then

onyx hinge
#

I do feel like having at most one digitalio object for a pin is a good feature, it helps when I fat-finger pin names in my code that uses digitalio.

tulip sleet
#

could you get away with not having DigitalInOut's at all?

onyx hinge
#
  def __call__(self): return digitalio.DigitalInOut(self)``` basically?
#
while True: led.value = not led.value```
tulip sleet
#

not even that, direct pin opeations

#

led = board.LED

#

pin output is claimed by a functional thing, or it is not

#

that makes GPIO different than other periphals

#

but that is kind of the way most chips are

slender iron
tulip sleet
#

someioexpander.D1.pull =

#

digitialio goes away. everything is on Pin

#

Pin.Pull, Pin.DriveStrength, Pin.Direction

slender iron
#

no, I wouldn't do that

tulip sleet
#

this is all long term, but I think making the CYW43 LED be a special thing with a special name is OK

slender iron
#

you can't set value when another peripheral's signal is muxed

tulip sleet
#

enforcing what the hw won't let you do

onyx hinge
#

DigitalInOut also protects against two parts of the code using the same pin accidentally in a way I feel like this wouldn't.

#

maybe it doesn't matter. removing digitalio would save bytes, too

tulip sleet
#

we have some API's that take dio's and some that take pins

slender iron
#

right, because some need native connections internally

onyx hinge
#

yeah I was bothered by that inconsistency when working on my io expander stuff

#

even things in the core are inconsistent

#

mostly in the core it's Pin objects though

tulip sleet
#

like in the sleep code, preserve_dios, because it is really preserving the current state

onyx hinge
#
shared-bindings/_bleio/Adapter.c:    digitalio_digitalinout_obj_t *cts = mp_arg_validate_type(args[ARG_cts].u_obj, &digitalio_digitalinout_type, MP_QSTR_cts);
shared-bindings/_pew/PewPew.c:        digitalio_digitalinout_obj_t *pin = mp_arg_validate_type(rows[i], &digitalio_digitalinout_type, MP_QSTR_rows);
shared-bindings/_pew/PewPew.c:        digitalio_digitalinout_obj_t *pin = mp_arg_validate_type(cols[i], &digitalio_digitalinout_type, MP_QSTR_cols);
shared-bindings/_pew/PewPew.c:    digitalio_digitalinout_obj_t *buttons = mp_arg_validate_type(args[ARG_buttons].u_obj, &digitalio_digitalinout_type, MP_QSTR_buttons);
shared-bindings/adafruit_bus_device/spi_device/SPIDevice.c:    mp_arg_validate_type_or_none(args[ARG_chip_select].u_obj, &digitalio_digitalinout_type, MP_QSTR_chip_select);
shared-bindings/alarm/__init__.c:        dios_array[i] = mp_arg_validate_type(dio, &digitalio_digitalinout_type, MP_QSTR_alarm);
shared-bindings/neopixel_write/__init__.c:        mp_arg_validate_type(digitalinout_obj, &digitalio_digitalinout_type, MP_QSTR_digitalinout);
```adafruit_bus_device is because it had to follow the existing code style. the rest of these, less sure why.
slender iron
#

do you want to preserve more than gpio state?

tulip sleet
#

it's preserving pulls and output state and direction

slender iron
#

neopixel_write is just a function so it takes digitalio to have longer term pin claiming