#circuitpython-dev

1 messages ยท Page 390 of 1

tidal kiln
#

and i think we even have older 2.x style % formatting examples floating around

idle owl
#

Yeah that is true, and those need to go.

#

But that's another story.

#

I'll put Dylan on it.

#

Thank you for catching this.

#

For future reference, my suggestion would be to merge a failing PR, and notify me about the issue so we can make a decision without desyncing library config files.

#

You should have the ability to merge a failing PR.

tidal kiln
#

yep. i considered that.

blissful pollen
#

I noticed that I could merge the PR even with the failure but wasn't sure if that was a good idea or not.

idle owl
#

In this particular case, where something remote has changed and it's nothing to do with us or your PR, I'm ok with merging and then dealing with the problem. But this is a rare case.

tidal kiln
#

@blissful pollen yah. maybe you could do that with the PR you're dealing with? otherwise you're just repeating my no-no. ๐Ÿ™‚

idle owl
#

@blissful pollen @tidal kiln Repeat the no-no this time. Because we're about to do it globally.

#

And Adabot knows how to skip things.

blissful pollen
#

The author did change it already - just haven't merged it yet they have to (last I looked still fix the examples) and the change to this PR has to sync with the equivalent busdevice core change

tidal kiln
#

okei doke. thanks. @idle owl for future ref - OK to ping you for any CI thing? or is it just a subset?

idle owl
#

So ping me.

tidal kiln
#

excellent. thanks!

idle owl
#

Thank you for catching it!

idle owl
#

Just mistyped "origin" as "origina" and now I want an Orangina.

ornate breach
#

๐Ÿ˜†

#

Iโ€™ve often typed Organ

manic glacierBOT
mental nexus
#

@onyx hinge looked through ParallelBus code and looks good to me with what I can see by a quick look at the code. With no hardware handy right now, I did not test. Since I didnโ€™t do testing, I was hesitant to โ€œapproveโ€ but let me know if you want me to.

onyx hinge
#

@mental nexus appreciatae you taking the time!

blissful pollen
onyx hinge
blissful pollen
#

okay thanks i'll try to take a look at it later today or tomorrow

manic glacierBOT
idle owl
#

Any CircuitPython Librarians up for approving a few PRs? I have four outstanding ones I'd like to get merged. I can link if anyone is up for it.

#

Thank you @tulip sleet!

rugged blaze
#

It would be useful to have a few sentences, and/or a link to more details for each bullet point on CircuitPython release announcements.
I do not have any idea what some of these features are/do (some of the feature names use jargon, and I don't frequent this Discord).
I'd like to have a brief explanation right there in the announcement text that would inform me as to whether I should investigate a new or updated feature further.

idle owl
rugged blaze
#

Yep, I get that it's a lot of work, and I'm grateful. Of course it's not just me that probably would benefit from this suggestion, but rather your entire target audience.

idle owl
#

The PR usually has some kind of details. Since... we need to know what we're merging, etc.

#

We'll consider what we can do. Thank you for the suggestion!

idle owl
#

@lone axle Thank you so much for the git help yesterday. It worked perfectly. Though I realised as I was typing this, I did not do the other search I needed to do. So I only half completed the job. Oops, I guess it's another opportunity to get the commands into my head.

#

I searched for wheel(), I did not search for instances of _pixelbuf imports. Fingers crossed I didn't add any, but I bet I did.

lone axle
#

Hooray, you're welcome. I still don't have it fully commited to memory yet. Pycharm saves terminal histories seperately and I know I've run that in the bundle repo before so I go there and up arrow through my history to find it ๐Ÿ˜…

idle owl
#

Yeah, I use iTerm and have some bash magic going on where I can type the beginning of something and up arrow and it goes through all the commands that start with what I typed.

#

SO convenient.

#

I'd be lost without it.

#

Or hitting a lot of up arrows to go through everything. ๐Ÿ˜„

#

I didn't know that about PyCharm though.

lone axle
#

as a heads up the ; true part of that command may not be necessary with all commands. It's needed because git grep returns an error code if it doesn't find anythign which prevents the foreach loop from continuing. So commands that don't behave that way shouldn't need it. Though I don't think there would be any harm in having it even when not strictly neccessary.

ember iris
#

history | grep 'git' is a good "what was that command again?" trick too

idle owl
#

Oh good to know.

#

Thanks.

#

Man, populating the bundle takes ages.

#

I delete it every time so I'm not having it all sitting there.

lone axle
idle owl
#

Oof, yep, I did miss some.

#

Luckily not any of the same libs I already did. That would have been embarrassing. ๐Ÿ˜†

ember iris
lone axle
#

I'm not sure if there is some setting for it. I've never changed anything that I can recall but the terminals inside of PyCharm all remember things that I've run inside of each project and terminal instance specifically and don't "up arrow" through commands that were run elsewhere.

#

ah, running history | grep whatever inside those does seem limited to only stuff that I've run inside of it as well. I must have run that foreach inside of a "normal" terminal at some point because I found it when I first ran that after you mentioned it.

ember iris
#

Ok, that makes a lot of sense. I was really confused at how much shared history there was, but I don't run terminals in IDEs so it's a major grey area to me

lone axle
#

Thank goodness for working primarily on a laptop. electricity_unplugged just flickered but came back super fast and battery kept everything in place.

ember iris
#

oof that's fortunate that the power is back and the battery kept things for disappearing. Time for a round of "Save save save" sprints

idle owl
#

It's been raining here for 48 hours straight. Had power flickers last night.

#

Wind died down today which was likely the cause.

blissful pollen
#

I need to get some trees down a couple years ago after an early ice storm my lights kept dimming and I could see branches banging into my power lines

idle owl
#

Yeah we have a giant tree in the back yard we keep an eye on. We wouldn't take the whole thing down if it came to it, unless it died. In which case it's a hazard to the house as well as the power lines.

#

Turns out you have to push if you want your changes to show up on GitHub ๐Ÿคฆ๐Ÿปโ€โ™€๏ธ

blissful pollen
#

i have a couple trees that died as result of some sort of insects I think. Some tree service is going to make a nice amount

blissful pollen
#

Oops I didn't notice it but the checks failed on the LED animation

idle owl
#

Ah have some things to fix on that one.

#

Yeah I just saw that.

#

No worries.

#

Sphinx biting me.

blissful pollen
#

My git knowledge is lacking for PR #5383 it now has to be merged after microdevs change for the ESP IDF key. Does anything have to be done to do that? I tried to re-run the workflow and it still failed

tulip sleet
#

the PR is set to the commit that existed when you did the PR, until you do another commit on the PR

blissful pollen
#

Okay thanks I'll let the author know

manic glacierBOT
tulip sleet
#

I thought it needed re-testing, but it's fine except for the bad builds, right?

blissful pollen
#

Yup I hadn't given it an approval yet waiting on that, and it has to go alongside the python busdevice library too. Both do look good now

tulip sleet
#

I don't know what you mean about the "alongside"

#

there's a library PR too?

blissful pollen
#

It's a change to the adafruit_busdevice module. So it is being changed both in the core and in the library that is used for the smaller builds

tulip sleet
#

did you cancel the bad build?

blissful pollen
#

Yes I did

tulip sleet
#

I see a bunch of cancelled jobs

#

ok, I will merge now anyway

blissful pollen
#

Thanks!

tulip sleet
manic glacierBOT
manic glacierBOT
tulip sleet
#

@blissful pollen Merge actions almost done. Looks fine. The espressif builds were all fine.

blissful pollen
tulip sleet
#

np

manic glacierBOT
#

Still playing around with heavily-modified example code that does management frames only, single-channel or channel-hopping, parses frame headers, and does a coarse parse and dump of the fixed and variable components of the frame body. The test environment has a relatively limited set of devices in range. Let it run a few hours last night, and do get interspersed errors from the callback:

  • Not enough memory for promiscuous packet (esp-idf heap stats when this occurs is typically something...
manic glacierBOT
manic glacierBOT
mortal mica
#

Is there anything specific to do to get my board into the 7.0.0 release? I expected to see to the PyKey60 download page to have 7.0.0 available. Did the merge just missed the release by a couple of hours or is there something else I am missing?

analog bridge
#

Is REPL over hardware UART possible?

tulip sleet
analog bridge
#

I saw this in microbit_v2

tulip sleet
#

yes, I thought there was something else, but I looked and I can't find it.

tulip sleet
analog bridge
#

@tulip sleet I can't get REPL over UART with those defines on espressif.

tulip sleet
#

I added a CIRCUITPY_CONSOLE_UART but it doesn't do anything.

#

The name of that maybe should be changed, or the name of CIRCUITPY_SERIAL_BLE should be changed. I don't remember now.

analog bridge
#

thanks dan, I'll take a look at how CIRCUITPY_SERIAL_BLE is implemented, I need the repl over uart thing for esp32c3

tulip sleet
#

Scott may have a mental plan about this

lone sandalBOT
crimson ferry
#

Does esp32s2 common-hal code need to feed the WDT, or yield in some way sooner than some interval?

analog bridge
#

@slender iron if I request 0x6d44_4333 id... then will the following be the entries in the board config?

CIRCUITPY_CREATOR_ID = 0x6d44
CIRCUITPY_CREATION_ID = 0x4333
jaunty juniper
#

I believe both creator and creation are 4 bytes long, if you request the creator ID 0x1337_BEEF, you use that as the creator ID, and whatever 32 bit value as the creation ID

slender iron
#

yup, what neradoc said. you just need to request the creator ID and then decide on your own creation id

analog bridge
#

okay so...

CIRCUITPY_CREATOR_ID = 0x6d444333
CIRCUITPY_CREATION_ID = any random 32 bit value
onyx hinge
tidal kiln
#

@onyx hinge yah. stuff is happening for that. kattni would know current state of progress though.

idle owl
#

Might make more sense to simply merge it failing before we run the script, really.

onyx hinge
#

it was marked as being a new contributor PR so I would probably not ask for it

idle owl
#

Is it ready to merge now?

tidal kiln
#

if enabled, could push changes to their pr

idle owl
#

The script will be run today.

#

That's why I'm saying we can merge it now failing.

#

Or it may have conflicts once the script is run.

onyx hinge
#

I don't know enough about GPS, I think it's a safe-ish change though

idle owl
#

Limor approved it.

#

I'll merge it now.

tidal kiln
#

ah. got it. don't even worry about the change. it'll happen automagically later.

onyx hinge
#

that's fine then

idle owl
#

@tidal kiln @onyx hinge The script has been run, so all the libraries should have that update now.

onyx hinge
#

y'all are great, thanks!

tidal kiln
#

cool. thanks. the CI dragons have been put back to sleep...for now.

idle owl
#

For now, indeed.

tidal kiln
#

and on a friday ๐Ÿ™‚

idle owl
#

Welp. ๐Ÿคท๐Ÿปโ€โ™€๏ธ It needed to be done.

idle owl
#

@gilded cradle Did the 2.9" Eink Displays guide get updated or is it new? The info on the bottom of the guide is inconsistent.

gilded cradle
#

@idle owl kind of in between. It's a new guide that drew from existing pages. Which info are you referring to?

idle owl
#

@gilded cradle The "This guide was first published on $date" and then the "This guide was last edited on $date" - the published date as 22 September, the last edited date was 16 September ๐Ÿคท๐Ÿปโ€โ™€๏ธ

#

@onyx hinge As long as you're up for helping, I have code that mostly does what I need, except for one thing, and the only way I know how to deal with that is a simple state machine, and I think it's a terrible kludge that I keep perpetuating when I shouldn't be.

#

I need it to only send spacebar once, and not again until you've backed off and gotten closer again.

#

Right now, it repeatedly sends spacebar as if you're holding it down, which will make you fail the game.

gilded cradle
#

Oh yeah @idle owl, not sure why. Maybe because I used the copy feature from another guide.

onyx hinge
#

@idle owl always losing at the game isn't great ๐Ÿ˜›

idle owl
#

I'll have to send another PR to the newsletter to get it in there, I thought it was old. Thanks @gilded cradle

#

@onyx hinge Ok, that's fixed. So... how to only send it once.

#

Without using my "debounce" state machine code.

#

Here is what I'm referring to, written for the Circuit Playground library: py button_a_pressed = False while True: if cpb.button_a and not button_a_pressed: # If button A pressed... print("Button A pressed.") [...] # The code you want to execute on the button pressed event. button_a_pressed = True # Set to True. time.sleep(0.05) # Debounce. if not cpb.button_a and button_a_pressed: # On button release... button_a_pressed = False # Set to False. time.sleep(0.05) # Debounce.

#

Kludgy. ๐Ÿ˜•

#

Or is that acceptable?

#

I tried both press and send.

#

Neither one only sends once.

onyx hinge
#

it's probably fine?

idle owl
#

Hmm fair enough

onyx hinge
#

I'm surprised press sends again, or rather, that press again does the equivalent of release+press

#

(it's not what the source says to me, but if you tested it then anything I thought I knew is suspect)

idle owl
#

Hmm.

#

I'll try again.

#

It might be my code.

#

Making it keep sending.

#

Do you want to see the code? It's probably my code being wrong.

onyx hinge
#

if you want to share it in its current state

idle owl
#

"Want" is a strong word. ๐Ÿ˜‰

#
initial_proximity = apds.proximity
while True:
    print(apds.proximity)
    current_proximity = apds.proximity
    if current_proximity > initial_proximity and current_proximity > 127:
        pixels.fill((255, 0, 0))
        keyboard.press(Keycode.SPACE)
        initial_proximity = current_proximity
    elif current_proximity < initial_proximity and current_proximity < 127:
        pixels.fill(0)
        keyboard.release_all()
        initial_proximity = current_proximity
    time.sleep(0.2)```
#

That doesn't include setup obvs.

#

That if is true more than it should be, I think.

onyx hinge
#

so your pixels are filled like you want, but the virtual keyboard isn't doing what you want?

idle owl
#

Well, the pixels aren't a good example because if they keep "filling", I wouldn't notice.

#

Because they're already on

onyx hinge
#

but it's red when the hand is close and unlit when the hand is removed

jaunty juniper
#

it doesn't look like it would release unprompted, so it should hold the space bar down

idle owl
#

They do turn on appropriately, but the space is initially sent appropriately too

idle owl
#

Should it release inside the if ?

jaunty juniper
#

it should hold the space bar until you back away

idle owl
#

That's what it's doing. That's not what I want it to do.

#

So you're correct on what it's currently doing

onyx hinge
#

do you want it to act like it taps space just once when you first move your hand down?

idle owl
#

I think so?

#

If you hold space down playing this game, you die quickly ๐Ÿ˜„

#

So you need to only send it once when you want to

onyx hinge
#

then yes you'll need to use a state machine

#

or debounce or whatever you like to call it

jaunty juniper
#

and use send

onyx hinge
#

yes and use send

idle owl
#

Ah ok. I guess I always thought I was doing it wrong because I wrote that code really early on in my learning process.

#

And a lot of that code I wrote early on is... not great.

onyx hinge
#

there are a million different ways to phrase it but yours works

#
was_pressed = False

while True:
    pressed = read sensor or whatever to get a True or False value
    if pressed and not was_pressed:
        do the actions for newly pressing a key
        
    was_pressed = pressed
#

I tend to write something like that, personally

idle owl
#

Problem here is, the proximity sensor is not a True/False situation.

#

I guess I need to make it one.

onyx hinge
#

maybe pressed = current_proximity > initial_proximity and current_proximity > 127 ?

#

(I think there's something weird about the double comparison but that's a separate thing)

idle owl
#

OH!

jaunty juniper
#

it looks like you used current_proximity > initial_proximity as a way to do the debouncing, but it wouldn't work since it would still trigger when moving away (or in)

idle owl
#

Yes that.

#

I just figured that out.

#

I was trying to use that to make sure it only triggered when you were moving the right direction.

#

Maybe it doesn't matter.

jaunty juniper
#

I would remove that comparison

idle owl
#

Still sending repeated spaces. sigh.

jaunty juniper
#

(since it will always be true when the other condition becomes true, but also some other times)

#

or is the direction you move important for the game ?

idle owl
#

No, space bar is important for the game.

#

Nothing else matters, as far as I can tell.

analog bridge
#
Adafruit CircuitPython 7.0.0-78-gb8aa2b9cc-dirty on 2021-09-25; MicroDev microC3 with ESP32C3
Board ID:microdev_micro_c3

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Hello World!

Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.
#

finally REPL on esp32c3 ๐Ÿฅณ

idle owl
#

Congrats! Nicely done!

analog bridge
#

@tulip sleet follow-up from our previous conversation... REPL over hardware UART not working was espressif specific... common_hal_uart_never_reset() wasn't implemented properly.
I'll PR with a fix soon.

tulip sleet
onyx hinge
#

@idle owl I don't have a prox trinkey so I can't exactly follow along with you ... so instead I wrote a program using the encoder button of the macropad. ```python
import time
from adafruit_macropad import *

macropad = MacroPad()

old_pressed = False
while True:
pressed = macropad.encoder_switch
if pressed and not old_pressed:
macropad.keyboard_layout.write(' ')
old_pressed = pressed

time.sleep(.001) # I found that .2 was too long
jaunty juniper
#

what is the game btw ?

onyx hinge
#

@idle owl my goal is to try to separate the logic about "when to send a space" given a nice clear button press from "how to turn the distance sensor into a nice clear button press" and figure out which one is the problem

#

@jaunty juniper chrome://dino/ in google chrome / chromium browser

#

just enter that in the address bar to start the game

jaunty juniper
#

oh that's what the hiibot came pre-installed with

idle owl
#

I figured it out.

#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

onyx hinge
#

yay!

idle owl
#

It's not saving properly

#

I had it right

onyx hinge
#

it is a cause for rejoicing!

idle owl
#

But it's not saving and reloading

#

I had to manually reload within the serial console to get it to update

onyx hinge
#

wait that's weird

idle owl
#

So it saves, but it does not reload

#

I KNOW

#

Ergo, tableflip. Sigh.

onyx hinge
#

does it do it still now that it knows you're watching?

idle owl
#

Yes.

#

Still doing it.

#

Make a change, save, it doesn't reload.

onyx hinge
#

are you on 7.0.0?

idle owl
#

I have to manually reload.

#

Yes 7.0.0

onyx hinge
#

does it persist after you use the reset button?

idle owl
#

Don't know, haven't tried yet

onyx hinge
#

we're getting v. close to "you get to file an issue now" ๐Ÿ™‚

idle owl
#

I only just figured it out

#

Resetting.

onyx hinge
#

understood

idle owl
#

Now it's reloading.

#

Sigh.

#

Not worth filing an issue, imo. But wow that was annoying.

#

I'm not sure I've ever run into that before.

tulip sleet
#

i thought I saw something like this yesterday, and was really confused. But I could not reproduce it.

#

I think I was getting a USB error really early.

idle owl
#

I'm not great at this game, but I am worse with this input method. ๐Ÿ˜„

#

I need to ๐ŸŒฎ . BBIAB.

onyx hinge
#

@idle owl do try decreasing the sleep time, 1/5 of a second is an eternity in this game

idle owl
#

I took it out.

#

Completely.

jaunty juniper
#

by the way you can use a predicate with adafruit_debouncer, I think it would work:

distance = Debouncer(lambda: apds.proximity > 127)
while True:
  distance.update()
  if distance.rose:
    keyboard.send(Keycode.SPACE)
    pixels.fill((255, 0, 0))
  if distance.fell:
    pixels.fill(0)
idle owl
#

Hmm. Fair enough.

#

This is easier for me to explain ๐Ÿ˜„

#

And actually, not sure debouncer would fit.

#

This one is tight.

jaunty juniper
#

oh right trinkey

idle owl
#

ya

jaunty juniper
#

too bad, I liked the idea of rose/fell having a double meaning ๐Ÿ˜‰

idle owl
#

Agreed! And it would have worked! Except for me explaining lambda ๐Ÿ˜„

#

It's destined for a guide, as is probably obvious.

manic glacierBOT
#

up-vote for native code on the second processor, I have a project that requires 4 rotary-encoders and presents a HID interface.

  • in my experience, reading encoders is helped by a little physics (momentum) modeling. A bit too complicated for PIO, but C code is working great on the second processor.
  • for HID handling, circuitpython shines there, contrasted with getting HID to work via the C-sdk, not easy.

Possibly this is an example of an app that needs dual-cores: circuitpython on Pr...

idle owl
#

Plot twist - you have to duck in the game as well.

#

Which is down arrow.

manic glacierBOT
gilded cradle
# idle owl Ah ok.

I realized what happened. I wrote that page on the 16th, but because I had to write drivers for the UC8151D eInk display, it didn't go live for almost a week and so the dates are correct.

idle owl
gilded cradle
#

Awesome

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

WiFi and BLE both seek to discover a relatively fixed list of devices in range, and those devices are explicitly sending frequent beacons and advertisements in order to be discovered within a fixed length of time. Advertisements from a connected BLE device are conceptually infinite, but I believe the typical use case makes occasional scanning for new data a practical approach.

WiFi monitor mode, on the other hand, is conceptually an infinite process with no clear end point. Occasional scan...

onyx hinge
#

@tulip sleet report_ids = (0,) doesn't seem to be accepted

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0 on 2021-09-20; Seeeduino XIAO with samd21g18

Code/REPL

import displayio
from digitalio import DigitalInOut, Direction
import board
import time
import adafruit_displayio_ssd1306
import busio

led = DigitalInOut(board.D13)
led.direction = Direction.OUTPUT

displayio.release_displays()

spi = busio.SPI(board.SCL, board.SDA)
tft_cs = board.D2
tft_dc = board.D1
tft_reset = board.D0

display_bus ...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

For a personal project I'm working on, I'd like to use CircuitPython as Python is much easier to program in (and I'm much more familiar with CP as well - it worked phenomenally when I upgraded a previous project to use CP!). However, my specific board for this project, the TinyZero, doesn't show CircuitPython support on the website. I would prefer to use this board as it's smaller than a U.S. Quarter, which enables it to fit inside a mini custom enclosure! I believe it's specs are indeed suff...

orchid basinBOT
manic glacierBOT
manic glacierBOT
ornate breach
#

@analog bridge how stable is your ESP32-C3 port? Iโ€™ve got one of the Engineering samples from early this year and kind of want to try it out.

analog bridge
ornate breach
#

Iโ€™m not sure which revision mine is

#

Looks like 1.6

analog bridge
#

It appears when you interact with the chip using esptool.

ornate breach
#

I figured as much. Thanks for the work youโ€™re doing in the C3 port

#

Iโ€™ve wanted to do more with the C3 but Iโ€™ve been waiting for the BLE port ๐Ÿ˜…

analog bridge
#

๐Ÿ™‚ ... ble is the hardest part.

ornate breach
#

yeah

#

looks like I have Rev 2

analog bridge
#

I think following in board's sdkconfig should do

# CONFIG_ESP32C3_REV_MIN_0 is not set
# CONFIG_ESP32C3_REV_MIN_1 is not set
CONFIG_ESP32C3_REV_MIN_2=y
# CONFIG_ESP32C3_REV_MIN_3 is not set
CONFIG_ESP32C3_REV_MIN=2
ornate breach
#

cool, i'll pull down your repo and build it and try it out

analog bridge
ornate breach
#

will i flash it the same way i would the bin for say an s2 using esptool?

analog bridge
#

yes, its the same... there were some changes with esptool config flags, they have been taken care of in the Makefile

ornate breach
#

okay, so just sh esptool.py --port /dev/cu.usbxxx --after=no_reset write_flash 0x0 firmware.bin

analog bridge
#

or you can use make BOARD=... flash

ornate breach
#

oh didn't know you could do that lol

analog bridge
#

I prefer the make one as it takes care of all the flags.

ornate breach
#

doing that, do i need to specify the com port target?

analog bridge
#

oh yeah, I forgot that... make BOARD=... PORT=... flash

ornate breach
#

ah perfect

analog bridge
#

the default is /dev/tty.SLAB_USBtoUART

ornate breach
#

okay

#

need to install riscv toolchain

manic glacierBOT
#

CircuitPython version

CircuitPython 6.3 but also observed in version 7.0

Code/REPL

import board
import time

#LEDs-----
import digitalio
redLED = digitalio.DigitalInOut(board.RED_LED)
blueLED = digitalio.DigitalInOut(board.BLUE_LED)
redLED.direction = digitalio.Direction.OUTPUT
blueLED.direction = digitalio.Direction.OUTPUT
blueLED.value = True      #LED is turned on
redLED.value = True       #LED is turned on
time.sleep(2)             #to give m...
manic glacierBOT
manic glacierBOT
ornate breach
#

dang... crosstool-ng no longer supports macOS

solar whale
#

That post is 3 years old ๐Ÿ˜‰

manic glacierBOT
#

Thanks for the swift answer. I'll try with yield or asynccp and see if I
can sort it out.

On Sun, 26 Sep 2021, 21:28 Dan Halbert, @.***> wrote:

@ErlendFj https://github.com/ErlendFj asyncio is not yet available,
though we are looking at event and concurrency support in more depth for
8.0.0. However, async/await is turned on for most boards, and there are
several libraries already available. See this forum post:
https://forums.adafruit.com/viewtopic.php?f=60&t=183355

โ€”
...

ornate breach
#

I keep running into issues building

manic glacierBOT
#

Ok I am WAY LATE to the party here, sorry @maholli, but here is a summary of the existing ways the different ports handle fake sleep. Hopefully some of this will be helpful - I'm still not totally grokking the way the ASF4 is handling these interrupts.

  • STM32: These chips are pretty straightforward, because the RTC alarm feature, which compares the current RTC time to a calendar date by default, will generate interrupts successfully regardless of whether the MCU is in "run" or "sleep"...
#

@maholli your current method seems fine, tbh, close to the STM32 implementation. Fake deep sleep needs sleep performance the least out of any mode, because the assumption is that you'll only ever use it when debugging and connected to a PC. But if we want to do light sleep (where RAM isn't dropped), it would be good to figure out how to get that CMP to work.

Are you currently able to detect, after waking from true deep sleep, whether it woke up from sleep or just started for the first time...

solar whale
ornate breach
#

Iโ€™m trying to test out the ESP32-C3 stuff microDev is working on but I need to add the riscv tool chain and Iโ€™m following the esp idf instructions for mac install but Iโ€™m just running into build issues with crosstool-ng

solar whale
#

Hmm.. Iโ€™ve not had issues recently esp32s2 on my Mac. Itโ€™s be a few weeks since I tried it and wonโ€™t be able to check until tomorrow morning. Iโ€™ll try it then. I have not tried the C3 at all, but can you build the S2?

ornate breach
#

Yeah, as far as I can tell

analog bridge
#

@ornate breach I can provide you with .bin for REV-2.

solar whale
#

@ornate breach I see that the C3 may need a different set of tools from the S2 -- I can build the S2 OK on my Mac, but have not tried C3.

#

But if I run ./install.sh esp32c3 in the esp-idf folder, it does not complain.....I tried downloading pr 5394, but I don't see a C3 board in the boards folder to try building. I I must have missed something and since I don't have the hardware I think I'll leave this to you to sort out. Sorry I could not be of more help.

analog bridge
#

This is for esp32c3-rev-2.

analog bridge
solar whale
# analog bridge <@!343570430042308609> use this branch instead of the PR one... I have got board...

hmm -- that seemed to be building OK on my Mac, but failed near the end with /Users/jerryneedell/.espressif/tools/riscv32-esp-elf/esp-2021r1-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: build-microdev_micro_c3/supervisor/shared/serial.o: in function `serial_early_init': /Users/jerryneedell/projects/circuitpython_microdev/ports/espressif/../../supervisor/shared/serial.c:72: undefined reference to `common_hal_busio_uart_never_reset' collect2: error: ld returned 1 exit status make: *** [build-microdev_micro_c3/firmware.elf] Error 1

analog bridge
solar whale
#

how do I do that?

analog bridge
#

have you cloned my fork?

solar whale
#

I cloned your fork and checkout the microdev-micro-c3 branch

analog bridge
#

okay then following should do

git remote add adafruit https://github.com/adafruit/circuitpython.git
git fetch adafruit
git pull adafruit main
solar whale
#

yay! that worked ```
1280672 bytes used, 161120 bytes free in flash firmware space out of 1441792 bytes (1408.0kB).
0 bytes used, 8192 bytes free in 'RTC Fast Memory' out of 8192 bytes (8.0kB).
16 bytes used, 8176 bytes free in 'RTC Slow Memory' out of 8192 bytes (8.0kB).
0 bytes used, 32768 bytes free in 'Internal SRAM 0' out of 32768 bytes (32.0kB).
0 bytes used, 294912 bytes free in 'Internal SRAM 1' out of 294912 bytes (288.0kB).

#

So it does appear to be possible on a Mac!

ornate breach
#

Might be a linking issue, not sure ๐Ÿคทโ€โ™‚๏ธ

solar whale
#

no idea -- mine did not complain....

manic glacierBOT
#

This PR adds DisplayIO bringup to the Pimoroni PicoSystem.

This is raised as a draft with a line in mpconfigboard stubbed out (so checks will hopefully pass), pending the addition of a PicoSystem "stage" and "ugame" to https://github.com/python-ugame/circuitpython-stage/ and a bump to the submodule.

Looks like circuitpython-stage submodule is currently tracking master, so there shouldn't be any implications in bumping it?

manic glacierBOT
lone axle
#

@idle owl I think the scripts to make issues for missing types across all libraries are all set and ready to go any time. Wanted to give a heads up here because whenever I run it there will be a big wave of them created and they @mention both of us now.

manic glacierBOT
manic glacierBOT
#

Try disabling serial as well. Add these lines to your boot.py:

import usb_cdc

usb_cdc.disable()

Our Windows Drivers installer does not yet support the Pi Pico, and that may have something to do with this.

Also try Uwe Seiber's USB Device Cleanup tool, which may remove some bad state: https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#device-errors-or-problems-on-windows-3094694-15

idle owl
#

Or did you do that already?

lone axle
idle owl
lone axle
#

I'll try it out and if it starts looking too crazy I'll skip it.

idle owl
#

Perfect.

#

@tulip sleet You around for a question regarding guide feedback I received? It's regarding the Windows 7 CP drivers.

#

I think the answer is delete and move on, but I wanted to give it a fair go.

tulip sleet
#

AFK at the moment but will get back to you

idle owl
#

Ok thanks!

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Channel Categories

8

Text Channels

59

Voice Channels

6

Members

31015

Roles

35

ornate breach
#

31k ๐ŸŽ‰

idle owl
#

CircuitPython Weekly meeting happening in about 1 hour 45 minutes. Everyone is welcome to attend! If you're interested in participating either by attending or providing updates, please add your Hug Reports and Status Updates to the notes document before the meeting. Hope to chat with everyone soon! https://docs.google.com/document/d/1rS5p7xF_UUpumitnW2mV-B3IL7vB6e7V2HIAkk7Zo9E/edit# <@&356864093652516868>

tulip sleet
#

@idle owl Point me to the guide feedback and I'll take a look.

idle owl
#

DM'd.

#

Like I said, pretty sure it's a delete and move on, but I figured I would at least check with you.

lone axle
#

Alright, I ran it on 4 libraries, one package and one single file module for each of helpers and drivers type libraries. Looking over the issues it created now. As long as everything looks good with them I'll run it on the rest of the list.

#

@idle owl the 4 that it created look good to me. I'm going to try to figure out if there is a relevant rate limit for creating the issues and maybe add some delays to the process if so. But should be running it on the larger list starting shortly.

idle owl
#

I'll ignore email for a bit here ๐Ÿ˜„

lone axle
#

okay, it's running now. If I'm understanding the rate limit endpoint correctly it's showing 0 used of all types so it seems maybe creating issues with the gh CLI tool does not use anything that is limited. It's taking about 3 seconds per library, and stops for manual intervention on ones where the adafruit repo was forked from a different user to ask me which user it should use. I'm keeping an eye on it and doing that as needed. Should be done in 5-10 minutes I think if the pace holds.

lone axle
#

Ah, nope it started failing with GraphQL error: was submitted too quickly

idle owl
#

Heh

#

Delay time!

lone axle
#

I will save the output from what it's done so far and start up the remaining ones in a little while.

solar whale
#

Yikes -- maybe I should do a "reply-all" to each of those e-mails from @lone axle ๐Ÿ˜‰

manic glacierBOT
lone axle
idle owl
#

Thanks. I'll take a look.

#

@lone axle Fixed. The CPLibians team wasn't there.

#

The team is there now.

#

Oi. Wonder how long that's been the case - Adabot doesn't work without that.

lone axle
#

I'll circle back and run it on that one at the end.

idle owl
#

Thank you!

manic glacierBOT
lone axle
idle owl
#

That's a recent one. Need to remember to mention it to Dylan too.

lone axle
lone axle
#

Alright. We've made it through the whole list now. There are a few that it skipped or didn't render properly. I'll go through and get them all squared away later on this afternoon after the meeting.

idle owl
#

Internal meeting just ended. BRB!

turbid radish
#

Lurkin' here

#

Much to do

idle owl
#

Hmm. Audio not right.

onyx hinge
#

uh oh

lone axle
lone axle
#

@onyx hinge Yep. The main benefit that I use to checkout a PR branch:

gh pr checkout [PR #]

But I've also learned recently that you can leave reviews as well

gh pr review --approve -b "Tested successfully on PyPortal. Looks good to me"

It finds the active branch to know which PR to make it on.

onyx hinge
#

wow neat!

slender iron
#

I won't fight you for it ๐Ÿ™‚

lone axle
#

As I understand it, the difference is the community bundle is meant for libraries supported by individual's whereas the circuitpython org bundle is for libraries supported by multiple folks.

jaunty juniper
#

the name is confusing because of "org" vs ".org"

lone axle
#

One thing we do still need in the CircuitPython organization bundle is to get adabot (or some other tool) making the automated releases whenever one of the submodules has a new version. Right now the releases for CircuitPython organisation bundle are manual.

onyx hinge
#

@idle owl I wonder if Jerry should go before Melissa since the topics are related

#

but we need the intro first so everyone's on the same page

#

okay

#

@gilded cradle do you have a link to show the sorts of issues you're concerned about? what do the errors look like, etc.

gilded cradle
#

Let me check... It was a little while ago

heady island
#

(I'm just a user, is there a link to when these "calls" happen? It's very interesting)

ornate breach
#

You need to be part of the <@&356864093652516868> I believe to join

#

Sorry for the ping ๐Ÿ˜…

cobalt grail
#

Ping.

slender iron
#

they are mondays at 11am pacific 2 pm eastern

onyx hinge
#

@heady island we meet most mondays at 2PM Eastern (US) time, you can ask to join @ circuitpythonistas to get notifications or to speak in the meeting, or check out our online calendar https://github.com/adafruit/adafruit-circuitpython-weekly-meeting

GitHub

Notes from the weekly circuitpython meetings on Discord - GitHub - adafruit/adafruit-circuitpython-weekly-meeting: Notes from the weekly circuitpython meetings on Discord

#

@solar whale it adds about 30 bytes to an mpy file

slender iron
onyx hinge
#

irrespective of the quantity of type annotations, those are removed

cunning crypt
heady island
#

thanks ๐Ÿ™‚

onyx hinge
#

If a function says def f() -> int: ... the -> int part is just ignored by circuitpython, so if it refers to typing.List then it doesn't matter that this doesn't exist

gilded cradle
#

@onyx hinge it was back and April and it looks like the GitHub Actions results have been discarded since then.

onyx hinge
#

jerryn said "if you add a comment, you need to run the regression test" ๐Ÿคฃ

solar whale
#

"should" ๐Ÿ˜‰

onyx hinge
#

we'll give you a "should"er to cry on

lone axle
#

When I complete the annotations for a library this week I'll test on Blinka and microcontroller various scenarios to see if I can find out what if any possible issues may arise.

heady island
#

as a new user - a few blogs pointing me to this discord mentioned the PIO channel

#

If there was a msg to go to "new channel" it would be fine

slender iron
#

@heady island would you like me to add you to circuitpythonistas?

gilded cradle
#

Thanks

heady island
#

@slender iron sure! ty

lone axle
#

Thanks all, hope everyone has a nice week! ๐Ÿ‘‹

idle owl
#

@slender iron The audio is borked on the video. My audio is fine, everyone else is consistently intermittent. Sigh. OBS did not indicate there were any problems.

onyx hinge
#

argh

idle owl
#

@slender iron Do I post it with messed up audio (it's pretty bad to listen to), or do we skip this week?

idle wharf
#

@idle owl I'll still listen to it ... but happy to test it and tell you if its unlistenable

slender iron
#

I think post it still with the first sentence of the description acknowledging the problem

idle wharf
#

They can at least listen to Kattni's excellent intro audio and bail out when the others start talking.

#

The others are inaudible \ unable to be understood.

idle owl
#

Fair enough. I'll make it public and submit another PR to the newsletter.

lone axle
#

It turns out that SimpleMath and ProgressBar libraries both already have type information for everything in them. So those are our first two completed libraries ๐ŸŽ‰ . I'll do some testing on Blinka and a Microcontroller this week with these two in addition to another library that I'll fill in the types for, maybe a display driver to validate Blinka_Displayio environment.

idle owl
timber pivot
#

Not sure if this is the right channel but you all know the audio on CircuitPython Weekly for September 27th, 2021 video on YouTube is messed up, right?

lone axle
timber pivot
#

Thanks

lone axle
#

I will try to start making backup recordings again starting with next weeks. I was recording them for a little while but I got tripped up one week by having an extra discord window open and fell out of the habit after that.

idle owl
tidal kiln
idle owl
#

I never got one, looks like.

tidal kiln
#

is opening an issue in bundle repo still how to request?

idle owl
#

Um.... hmm. I thought it was opening an issue on the core. Let me take a look. Hold on.

#

@tidal kiln Open an issue on the core and label it "library".

#

That's where we have other driver requests.

tidal kiln
#

ok. thanks. will do.

#

good to have to at least document, even if decide not to write

#

i'm not seeing any old issues requesting it?

#

core or bundle

manic glacierBOT
#

Thanks for your insight @hierophect! Yes, I'm able to detect whether wake-up is from POR, BACKUP, etc...

I've continued to wrestle with getting CMP to fire an interrupt, but have been unsuccessful. I'm convinced there's some micropython/circuitpython interrupt handler I can't find that's quietly clearing the flag.

@tannewt are there any interrupt handlers or MP/CP things I could be missing that'd impact an RTC interrupt during fake sleep like this? Below is a print-out of relevant RTC r...

orchid basinBOT
#

Bumps nokogiri from 1.11.5 to 1.12.5.

Release notes
Sourced from nokogiri's releases.

1.12.5 / 2021-09-27
Security
[JRuby] Address CVE-2021-41098 (GHSA-2rr5-8q37-2w7h).
In Nokogiri v1.12.4 and earlier, on JRuby only, the SAX parsers resolve external entities (XXE) by default. This fix turns off entity-resolution-by-default in the JRuby SAX parsers to match the CRuby SAX parsers' behavior.
CRuby users are not affected by this CVE.
Fixed

[CRuby] D...

manic glacierBOT
#

CircuitPython version

Well, im doing what im told:
I run CP 7.0.0
all libraries are up to date
the content of my CP (Matrix portal M4)
Found device at /Volumes/CIRCUITPY, running CircuitPython 7.0.0.
adafruit_fakerequests==None
neopixel==None
adafruit_requests==None
adafruit_bitmap_font==1.5.1
adafruit_display_shapes==2.3.0
adafruit_display_text==2.21.0
adafruit_esp32spi==3.5.11
adafruit_io==5.5.0
adafruit_matrixportal==3.0.1
adafruit_portalbase==1.9.2

note tha...
lone axle
#

In situations where types come from existing modules within circuitpython but those modules are not used for anything other than typing would it make sense to do imports like this:

try:
    from typing import List
    import digitalio
    import busio
except ImportError:
    pass

presumably digitalio and busio would not raise an error. But importing them could take up memory right? So doing the typing import first and catching the exception will prevent digitalio and busio from being imported when the program runs on a microcontroller?

tulip sleet
lone axle
#

Thank you

manic glacierBOT
manic glacierBOT
#

This branch adds support for the STM32L4 family, specifically the STM32L4R5-based Swan board. The board found at ports/stm/boards/swan_r5

The changes are almost entirely compile time conditional and so should have minimal impact on other STM boards in the port.

I made an attempt at implementing WebUSB by factoring in the tinyUSB examples and working the Vendor class descriptor into the dynamic set of USB descriptors. It's not presently working as far as I can see, but also does no ha...

analog bridge
#

Is there any way to prevent lookup for a uf2 firmware file in CI for non-uf2 mcu's like esp32c3? Currently CI fails with the following error:

Cannot find file ../ports/espressif/build-microdev_micro_c3/firmware.uf2
Error: Process completed with exit code 1.
analog bridge
#

I added the board in extension_by_board... doing a test now.

analog bridge
#

That worked! Thanks @jaunty juniper.

manic glacierBOT
crimson ferry
#

I seem to have forgotten (or broken) something... after having an esp-idf binary on an esp32s2, I'm unable to flash CircuitPython. Anything I try just gets the BOOT drive back on reset. Is there a canonical set of esptool parameters in use these days?

solar whale
#

You may want to try erasing the flash before loading CP

crimson ferry
#

yes, thanks, that did it

solar whale
#

Great -- I've run into that a few times.

crimson ferry
#

I'm guessing it would have also worked if I had installed TinyUF2

manic glacierBOT
crimson ferry
#

does anyone know what's up with current main esp32s2 build errors related to undefined reference to 'port_i2s_reset_instance'? ...something to do with paralleldisplay

supple gale
#

hmm, not here. just did a compile with no errors .

crimson ferry
#

maybe due to CIRCUITPY_AUDIOBUSIO_I2SOUT ?= 0 to make space for DEBUG=1? I'll try a new scheme for space

supple gale
#

yes, that makes sense

crimson ferry
#

when there's a module dependency like that, is it typical for turning off a module to cause build errors, or is it more manual to keep track of those things? (I don't see a new flag for parallel display)

#

hm, re-enabling CIRCUITPY_AUDIOBUSIO_I2SOUT didn't do it, I'll just comment out the three lines of relevant calls for now

supple gale
#

I think it needs CIRCUITPY_AUDIOBUSIO

crimson ferry
#

ah, there they are, thanks!

supple gale
#

but not sure it should be called in any case. i leave that to someone who better understands what they have done with I2S

crimson ferry
#

I don't think they are called, but build gets unhappy

supple gale
#

its called in the deinit i think.

crimson ferry
#

oh, like from a hard reset?

#

ugh, so I infer that it's manual to know which modules depend on others when turning off modules (for space)

supple gale
#

i guess, freeing up the i2s instance that was created for parallelbus.

crimson ferry
#

thanks for your help, back in business ๐Ÿ™‚

supple gale
#

๐Ÿ‘

manic glacierBOT
manic glacierBOT
#

There's a very rough and rudimentary POC here, basically the Espressif sniffer example, shoehorned into CP and tweaked to parse the more interesting RX_CTRL header and frame header fields and split up the frame body into its fixed and variable (Information Element) components, just enough to extract an SSID if available. Management frame type only at the moment, any subtype. Channel changes after each frame. CircuitPython code just s...

lone axle
#

is it possible to see the resulting html files from the sphinx docs build from a PR branch before the PR is merged? or is that only visible once it gets merged and is then shown on the readthedocs pages?

jaunty juniper
#

๐Ÿค” I would build them locally

lone axle
# jaunty juniper ๐Ÿค” I would build them locally

The thing is, I think I'm seeing different results locally compared to what is getting generated by actions. I'm trying to determine specifically what the ones generated by actions will look like because I suspect that mine locally are different and not correct.

#

Now I'm seeing different results than I was getting the other day even though I don't believe anything int he environment or code should be different ๐Ÿ™ƒ

jaunty juniper
#

oof

onyx hinge
#

@lone axle I don't think the doc artifacts from github builds go anywhere, but that doesn't really matter as what is shown on readthedocs doesn't come from there either

#

.. it comes from readthedocs own process

lone axle
#

I was having this strange difference between Sphinx running in actions vs. running locally. Actions completed successfully, but locally failed.

#

The user that made that PR also saw the same error locally that I was seeing.

#

But actions completed successfully. And now if I go back and run the build on the same code locally it's succeeding. I don't know what could have changed ๐Ÿ˜–

onyx hinge
lone axle
onyx hinge
#

the fake version of a module provided in this way works in some respects, but not all. So for the error you linked to,

"/home/timc/repos/circuitpython/Adafruit_CircuitPython_BLE_Radio/adafruit_ble_radio.py", line 51, in _RadioAdvertisement
    match_prefixes = (struct.pack("<BH", 0xFF, _ADAFRUIT_COMPANY_ID),)

I am guessing that _ADAFRUIT_COMPANY_ID is a mocked object, and that simply can't stand in for the kind of object that struct.pack requires.

lone axle
onyx hinge
#

from micropython import const ... _ADAFRUIT_COMPANY_ID = const(0x0822)

#

so if from micropython import const fails, then const is a mocked function, and its return value is a mocked object. That mocked object, whatever it is, doesn't work with struct.pack. from micropython import const should come from adafruit blinka, I suppose?

lone axle
#

it did seem related to const() to me. I noticed that when I was getting that error locally if I removed the const() call wrapping the value that it was not having the error any more.

onyx hinge
#

requirements.txt lists Adafruit-Blinka so from micropython import const seems like it should work

lone axle
#

I do think blinka contains a placeholder for that. I believe that my local environment had the same version of Blinka installed as the actions did though. But I'm also not getting the error now when I run it on the same library

#

hmm maybe I was wrong about it being installed at the time I guess. If I uninstall it now I can force the same errors to appear

#

okay. It specifically needs to have adafruit-blinka installed and not to have microcontroller in the mock list

onyx hinge
#

what's odd to me is, conf.py doesn't specify to mock the micropython module, so it should have made the import an error instead. Or maybe a mocked module is mocked as a first resort instead of a last resort.

#

the docs are not super clear on this point

lone axle
#

Maybe I started without blinka installed, added microcontroller to the mock list. Then installed blinka but at that point still ended up with argument is not an integer I needed to go back and remove microcontroller from the mock list.

#

It's probably an entirely different issue. But this is the other thing that came up tonight that made me believe that the actions sphinx run can result in different outcomes / files than the local one. For this display driver the current file in readthedocs shows the correct arguments for the class:

#

But when I run the sphinx build locally against main I end up without the bus argument:

#

Maybe the deal is that readthedocs process differs slightly from Sphinx.

onyx hinge
#

do you have adafruit-blinka-displayio installed?

#

I ask because the only thing that "smells like a mock" is the fact that ILI9341 subclasses displayio.Display

lone axle
#

I do

#

I'm not sure if I'm understanding the documentation for that correctly, but I see something are listing a specific version like 3.5 or 3.7

#

maybe it installs python3 and ends up with whichever version happens to be marked as stable inside of it's VM which I guess would depend on the specific OS it's using.

#

Anyway I appreciate you taking a look and offering up some ideas. With your help I think I've understood what happened to me the other day with the BLE_Radio library, which was definitely more concerning to me since it was error vs. no error. This difference is relatively minor in comparison.

onyx hinge
#

Locally, I have to remove displayio from autodoc_mock_imports to get the correct signature.

lone axle
#

Ah! nice find. same here.

#

but in actions it would fail since it wouldn't have adafruit-blinka-displayio maybe

onyx hinge
#

it's listed in requirements.txt so it should

lone axle
#

oh, actually that is in requirements, yep

#

It makes me wonder how the copy that is currently in readthedocs came out correctly. But I can probably put that curiosity out of mind. I have a PR for typing open in that driver, I'll try removing the mock for displayio from conf and see if it remains happy.

onyx hinge
#

readthedocs says projects created a long time ago use an old sphinx version

#
  Downloading Sphinx-1.8.5-py2.py3-none-any.whl (3.1 MB)``` and in fact
#

which could easily make its behavior different than what you see locally.

lone axle
#

Oh wow, I don't know what their release pace is like but that does seem quite old. That is very likely it

onyx hinge
#

Release 1.8.5 (released Mar 10, 2019)

#

Release 2.0.0 (released Mar 29, 2019)

lone axle
#

I wonder if projects created before that can specify to use a newer one.

onyx hinge
#

and we're currently at 4.2.0

#

I have to assume so, but I don't seem to have the privileges to look or change it for this particular repo

lone axle
#

You have solved so many mysteries for me, I have suspected differences on a few other occasions but never chased down the specifics this far. Thank you so much for taking the time! I really appreciate it.

onyx hinge
#

I have a RTD project registered in 2017 but I don't see a setting for sphinx version in the admin pages

#

okay, goodnight

#

it sounds like you should be able to put an explicit sphinx requrement and have it honored, yeah

manic glacierBOT
analog bridge
#

@teal condor you can get more help in #help-with-circuitpython channel... this channel is primarily used for circuitpython development work. ๐Ÿ™‚

teal condor
#

Thanks! I'll ask my question there itself, won't clutter here ๐Ÿ™‚

manic glacierBOT
manic glacierBOT
#

Hi
I am really loving my Raspberry pi pico, but currently i need to switch to the US keyboard(or other languages, US is just my default when i do this), so when i want to show scripts to my friends they need to change the keyboard language on their pc, which just really ruins the "magic" of it.
I would be more than happy to make the new setting, but i have never tried to do it before, so i dont really know how to, never the less i will try.
-Sรธren

manic glacierBOT
manic glacierBOT
#

Thx so much for the help, i wouldnโ€™t have been able to find this if it werenโ€™t for you, again thx

Fra: @.>
Sendt: 29. september 2021 14:24
Til: @.
>
Cc: @.>; @.>
Emne: Re: [adafruit/circuitpython] Danish Keyboard (#5406)

I believe what you want is to look here for international layouts:
https://github.com/Neradoc/Circuitpython_Keyboard_Layouts

โ€”
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https:...

manic glacierBOT
#

PS: If you could also help me resolve the _bleio.BluetoothError: Unknown system firmware error: 0009, that would be great! I tried sending a blank string payload, it worked, but it is not working if I send any other string. What should I do?

The data you're trying to send is an ill-formed advertisement. An advertisement contains chunks of data in a specific format, with type and length bytes, etc. If you use the https://github.com/adafruit/Adafruit_CircuitPython_BLE library, it will he...

manic glacierBOT
#

@dhalbert
Yes, the encoder is vanilla "aliexpress-type" one. I am just starting with CircuitPython and Pico and tried examples from https://learn.adafruit.com/rotary-encoder/circuitpython
In both examples the encoder behaves the same. In the HID one, it took me 4-5 full rotations to go from zero volume to full volume.
Serial debug shows the same. I rotate the encoder very slowly and it increments every 3-4 dents.
I am pretty sure the decoder is OK as I just recently used it in another Ar...

manic glacierBOT
#

Native method implementations that use mp_arg_parse_all() should be able to accept positional args that are labeled with keywords, but they are not.

Here is an example showing the issue with busio.SPI.
Constructor signature:

busio.SPI(clock: microcontroller.Pin, MOSI: Optional[microcontroller.Pin] = None, MISO: Optional[microcontroller.Pin] = None)

Method signature:

write(self, buffer: _typing.ReadableBuffer, *, start: int = 0, end: Optional[int] = None) โ†’ None
...
manic glacierBOT
tulip sleet
#

@idle owl I wrote a library https://github.com/adafruit/Adafruit_CircuitPython_Radial_Controller which I expect to use in a Learn Guide, showing the code. But maybe I should just put the code in the Learn repor? Do we have guides that point to code in libraries, not just in the Learn repo? I have a sample boot.py and a sample code.py to show, but they are in examples/ in the library (and are named differently.

lone axle
# tulip sleet <@!330227457296957440> I wrote a library <https://github.com/adafruit/Adafruit_C...

There are guides that point to library repos instead of specifically the Learn System repo. Most of the "Primary Guides" for specific hardware devices that I've run across embed example code from the driver library repo instead of the Learn System repo. For example, this page: https://learn.adafruit.com/adafruit-128x64-oled-featherwing/circuitpython embeds from: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1107/blob/main/examples/displayio_sh1107_simpletest.py

tulip sleet
onyx hinge
#

I think it happens each time the bundle is released

tulip sleet
#

Yes, thanks!

idle owl
#

Great.

orchid basinBOT
manic glacierBOT
#

TimeAlarm and PinAlarm are now both working on https://github.com/maholli/circuitpython/commit/d536be7228eac78b95e0b838110997434bcdad7a.

But there are caveats!

idle owl
#

Here is the notes document for 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/1_ZwlimMfNiDPSwWszVzGFMKQzGXSjmb5TzzhQ97kiOY/edit

idle owl
#

@tulip sleet Are you going to submit your lib to the bundle?

tulip sleet
#

yes, i'm just trying to get readthedocs set up. it's not showing up as a subproject to add yet

idle owl
tulip sleet
#

not yet, but I was looking at the HID library as an example, and it doesn't have adabot as a maintainer either, which is weird

idle owl
#

Yes it does?

idle owl
#

No, on Read the Docs itself.

#

Is where you add maintainers to docs.

#

Did you set up your lib on RTD?

#

(brb)

tulip sleet
#

oh, yes, I was looking in Subprojects by mistake

idle owl
#

Back.

tulip sleet
#

ok, i added the project, added the webhook, and added it as a subproject

idle owl
#

Excellent. Did you add adabot as a maintainer on RTD?

tulip sleet
#

I'm logged in as adabot, not me, I always do that

idle owl
#

Ah ok.

#

That also works. That's what I do.

tulip sleet
#

it's one less step

idle owl
#

Yep.

tulip sleet
#

do i need a discord webhook too?

idle owl
#

No.

tulip sleet
#

I think I'm all set then, I'll make a PR to add it to the bundle. A little weird the code is not reviewed, but that's always true when I create a new lib

idle owl
tulip sleet
#

yeah ๐Ÿ˜‰

idle owl
#

Complaint driven development.

tulip sleet
#

lol

idle owl
#

@tulip sleet Merged your bundle PR. Thanks for submitting it!

tulip sleet
#

thanks! onward

tidal kiln
#

anyone know if it's possible to restart a CI run that's like 15 months old and the logs are gone?

tulip sleet
#

it will still run against the old commit it's trying to merge to, you'd have to push a new commit to get it try against the latest

idle owl
#

Yeah that would work. Push an empty commit should force it.

tidal kiln
#

not my pr though. don't worry about this if not quick/easy answer. it's not a CP thing.

#

would like to see all the output from the CI run on their last commit

tulip sleet
#

if they allow maintainer pushes, you could clone their repo and still push an empty commit. or just edit in GitHub and add a period to the end of sentence or something like that

tidal kiln
#

oh yah. that trick. i'll try that. thanks.

idle owl
tidal kiln
#

dan's trick worked. thanks!

#

yah, looked all around for a "restart" option. did not find.

idle owl
#

Same.

tidal kiln
#

thanks for looking!

idle owl
#

You're welcome!

idle owl
#

Sigh. I have a Feather M4 that isn't showing CIRCUITPY.

#

Unplug and replug fixed it. Ugh.

idle owl
#

@tidal kiln OK, I'm tagging you in. How do I pull a GPIO pin low in CircuitPython? e.g. simulate it being tied to gnd. (This is for that encoder again.)

#

I think I did it right. But the encoder isn't being read.

#

The buttons work, but the rotary encoder is doing nothing.

#

Double checked the pins.

#

Similar code worked for JP. Except he tied the pins to GND directly.

#

And my center button is intermittent which is even weirder to me.

#

Maybe this hack isn't possible on CP. Arduino sets the pins to output, pulled low. Can't do output and low in CP.

#

I'll check in again in the morning.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 5.4.0  LoC BeR M4 base board with samd51g19

Code/REPL

import time
time.monotonic()
# in code and the command line, the fraction of seconds was always .0

Behavior

I did observe this behavior last night on a device that was running for many days.
Note: that also after breaking the code with ctrl-c and importing time
and entering time.monotonic() in the command line, the fraction of seconds was always...

tidal kiln
#

@idle owl guessing its something else, and probably something simple? should be doable. just your basic

pin.direction = digitalio.Direction.OUTPUT
pin.value = False
#

@tulip sleet hey. there was a "CIRCUITPY not showing up on win 10" thing in #help-with-circuitpython last night. i think maybe it ended up being a known scenario? looks like they got it working eventually.

manic glacierBOT
#

This is a known problem with time.monotonic(), because of the low precision of floats (5-6 digits). We recommend you use time.monotonic_ns(), if you board supports it (must have longints). Or, if it works for you, you can use supervisor.ticks_ms(), which wrap but keep their precision.

See https://github.com/adafruit/circuitpython/issues/342#issuecomment-337228427 for some background on the precision issue.

#

Ok, thank you taking a look at this so quickly and for the explanation.
It would be helpful if is this information would be available at:
https://circuitpython.readthedocs.io/en/latest/shared-bindings/time/

Also a possibility to programmatically reset to time.monotonic "0" would be helpful, as this situation can be detected quite easily, now that I know how,

tulip sleet
tidal kiln
#

yah. probably the latter.

manic glacierBOT
manic glacierBOT
manic glacierBOT
tidal kiln
tulip sleet
tidal kiln
#

oh. yah. safe mode.

#

for the other approach, if there isn't a UF2 eraser for target board, then what?

#

im 0 for 10 trying to get into safemode

stuck elbow
#

I usually only get there by mistake

tulip sleet
#

The other way is to build one of my CIRCUITPY-ERASER-DANGER uf2's, which involves changing one boolean. I can make you one or tell you how.

tidal kiln
#

if they are starting with an older firmware version, could they update ok? they still won't get CIRCUITPY, but firmware will update to 7? (to make getting into safe mode easier)

#

board is qt py m0

tulip sleet
#

sure

tidal kiln
#
Running in safe mode! Not running saved code.

You are in safe mode because:
You pressed the reset button during boot. Press again to exit safe mode.

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit QT Py M0 with samd21e18
>>> 
#

ok, yah, that was easier with 7

tulip sleet
#

we lengthened it from 700ms to 1sec

#

To create a CircuitPython that reformats the filesystem every time it starts, in circuitpython/main.c, change the false to true and rebuild:

    // Create a new filesystem only if we're not in a safe mode.
    // A power brownout here could make it appear as if there's
    // no SPI flash filesystem, and we might erase the existing one.
    filesystem_init(safe_mode == NO_SAFE_MODE, false);
tidal kiln
#

any chance that could get added to the ci so one gets built for all boards?

tulip sleet
jaunty juniper
#

make clean doesn't delete "index.rst" files, does it ? is there a way to remove them after a make html ?

lime trellis
#

@tulip sleet I'm hitting the HardFault_Handler when developing samd fake deep sleep. But only on some boards. What's the easiest way to debug this? Do I need to dust off GDB?

tulip sleet
tulip sleet
jaunty juniper
#

yep, specifically /shared-bindings/*/**/*.rst is ignored

tulip sleet
#

@onyx hinge The generated screenshot images for project bundles: where are they committed? I see the form of the github.io URL, but I can't actually find where they are pushed to, despite reading images.yml in the Bundle repo.

onyx hinge
tulip sleet
#

OH, a separate branch

onyx hinge
#

if git commit -m"update images"; then git push -f origin HEAD:folder-images; fi the name of the branch is hidden in this git command where nobody will ever find it

tulip sleet
#

yes, I never found it ๐Ÿ™‚

onyx hinge
#

github pages likes to serve everything from a particular branch of a repo, usually not the main one

tulip sleet
#

Maybe I will add that to the README, not sure it's documented anywhere

onyx hinge
#

agreed, it needs to be documented. and maybe rolled out to the other bundles.

tulip sleet
#

thanks!

onyx hinge
#

you're welcome

manic glacierBOT
#

Hi there @dhalbert! We have not yet done thorough testing, but I have seen the device accessible from the browser - I plan to circle back on this over the coming days.

Because it is conditional code, I thought it would be ok including it so others can build on what is done here, but I'm happy to remove those changes if they are blocking approval of the PR. They are not needed for this board at present.

blissful pollen
#

Has anyone had any trouble looping an MP3 in 7.0? I pulled out an old project (HallowWing M4) and even with loop=True it stops playing after one loop

tulip sleet
blissful pollen
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit Hallowing M4 Express with samd51j19

Code/REPL

import board
import digitalio
from audiomp3 import MP3Decoder
from audioio import AudioOut

speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE)
speaker_enable.direction = digitalio.Direction.OUTPUT
speaker_enable.value = True

audio = AudioOut(board.SPEAKER)
mp3 = open("laugh.mp3", "rb")
decoder = MP3Decoder(mp3)

a...
idle owl
#

Now to figure out how to make the pixel move with the encoder.......

tidal kiln
#

cool. np.

#

ping me if you want if you run into other oddness

#

is that the only wiring connection you plan to show in the guide?

idle owl
#

That was the plan yeah. Limor said it was fine when I checked in to verify.

#

I guess I could show it "wired up" typically as well. But I'll have to test it. <grump>

tidal kiln
#

i'd suggest mentioning the general nature of the hack, like "doing this just so it can be plopped down on a bread board next to a feather"

idle owl
#

Oh yeah for sure.

#

That's the plan.

tidal kiln
#

otherwise it will be interpreted as the required way to wire it up

idle owl
#

Valid point.

tidal kiln
#

put in the text. put it in a call out box. make it bold. make it blink. make it scroll.

idle owl
#

Call show().

#

@tidal kiln Don't suppose you want to help me with the pixel code? I'm trying to port an Arduino sketch and I'm not quite getting it. I have it lighting up a pixel as it moves around, but either it's not turning off the other pixels after it lights them up, or it turns them off but only flashes the pixel as it moves.

tidal kiln
#

sure. same ard code from yesterday?

idle owl
#

Yes.

#

Here's what I have in CP so far: py while True: position = encoder.position if last_position is None or position != last_position: print("Position: {}".format(position)) last_position = position pixels[position % len(pixels)] = (0, 150, 0) pixels.show()

#

This lights them up but does not turn them off behind it.

#

If I add an else: pixels.fill(0) after that, it only flashes it as it moves.

#

(with show())

tidal kiln
#

is position generally working? like if you just print that value and spin dial - changes as expected?

idle owl
#

Yep, it is now, thank you for help with that.

manic glacierBOT
tidal kiln
#

ah. just add a pixels.fill(0) in there.

#
        pixels.fill(0)
        pixels[position % len(pixels)] = (0, 150, 0)
        pixels.show()
idle owl
#

Now nothing lights up.

#

Oh

#

hold on

#

Magic!

#

I was so close!

#

Thank you ๐Ÿ™‚

#

I think I can figure out the rest. I'll ping you if I run into another wall.

tidal kiln
#

that's the equiv of the pixels.clear(); line in the ard sketch

idle owl
#

Ohhhhhh

manic glacierBOT
idle owl
#

Tricksy

manic glacierBOT
tidal kiln
#

and the arduino sketch is only using that conditional for the serial prints

manic glacierBOT
tidal kiln
#
  if (curr_rotary != last_rotary) {
    Serial.print("Encoder value: ");
    Serial.print(curr_rotary);
    Serial.print(" direction: ");
    Serial.println((int)direction);
  }
#

everything else happens outside the conditional in the loop

idle owl
#

I'm not sure I know what you mean by conditional.

tidal kiln
#

your check here if last_position is None or position != last_position:

#

the pixel updating can be outside that

idle owl
#

Oh hmm.

#

Ok.

#

So it can!

idle owl
#

Not sure I need auto_write=False to begin with.

#

Which would clean up the show()s.

#

I took it out for the encoder pixel, and it seems to be working ok?

tidal kiln
#
get position and button info
clear all the pixels
set pixel(s) based on position/buttons
show
repeat
idle owl
#

Do you think the show() is necessary?

#

Obviously if I change auto_write.

tidal kiln
#

i would. i'd turn auto_write off and call show at the end.

manic glacierBOT
idle owl
#

Wait, what?

tidal kiln
#

you do several pixels sets - for the dial and then for each button?

idle owl
#

Yeah. But the button code is different. Because I created them in a list.

#
    for i in range(len(buttons)):
        if not buttons[i].value:
            if i == 0:
                print("enter")
                pixels.fill((100, 100, 100))
                # pixels.show()
            if i == 1:
                print("up")
                pixels[0] = (150, 0, 0)
                # pixels.show()
            if i == 2:
                print("left")
            if i == 3:
                print("down")
            if i == 4:
                print("right")
            else:
                pixels.fill(0)```
#

Haven't set them all yet

#

And was trying with show() at the end

#

it does not function as expected.

#

With that code, with a show() after it at the same indent as the for, it simply turns off the LEDs when I press a button.

tidal kiln
#

did you enable pull ups on the inputs?

idle owl
#

Yep

#
button_pins = (SW1, SW2, SW3, SW4, SW5)
buttons = []
for button_pin in button_pins:
    pin = digitalio.DigitalInOut(button_pin)
    pin.switch_to_input(digitalio.Pull.UP)
    buttons.append(pin)```
#

They work. It prints the right thing when I press a button.

lime trellis
tidal kiln
idle owl
#

Sure. Or we could move to a thread. Up to you.

manic glacierBOT
#

We should probably add a support note about the C3 to the README too.

Sure, I'll add it in a separate PR.

Are you actively working on adding BLE workflow support?

Yup! I have started working on it and have got the basic stuff ported to esp from nRF implementation.
I started with the smaller things like UUID, Descriptor, Service etc. and am incrementally moving to the larger things.

tidal kiln
#

hmm. let's try thread. need more experience using those.

idle owl
#

Oh!

#

OK

tulip sleet
# lime trellis So I crash into `HardFault_Handler` on a pycubed board on builds WITHOUT `DEBUG=...

Oh, sure, many times ๐Ÿ™‚ . There are two common reasons I've encountered for DEBUG/no-DEBUG crash differences. One is that the bug is a second-order bug: something was smashed a long time ago, so reordering code, storage, etc., changes the bug. The other is that something that should be volatile is not volatile in the no-DEBUG build, but is accidentally volatile in the DEBUG build due to optimization differences.
You could try doing a -ggdb3 build with the regular optimization; it may already be set to do that. Can you get a backtrace? You can get a less-informative backtrace without debug symbols in the no-DEBUG case.

manic glacierBOT
lime trellis
tulip sleet
#

i have no idea how to do it in AS7. I always use gdb.

#

Maybe you can still set a breakpoint.

lime trellis
tulip sleet
#

it may be optimized out

#

by inlining

manic glacierBOT
manic glacierBOT
idle owl
#

@tidal kiln Bold and info-y enough?

tidal kiln
#

yah. hopefully.

#

maybe slightly different text

#

the more "normal" way would be tie COMA/B to GND

idle owl
#

oh right.

#

I mentioned that on pinouts page.

#

but not here.

tidal kiln
#

the hack is creating quasi-GNDs by setting outputs low

#

ah. ok.

idle owl
#

Updated.

tidal kiln
#

The wiring shown here ties COMA/B to digital outputs set LOW instead of GND to allow for the direct-to-Feather connection.

#

?

idle owl
#

Hmm yeah.

stuck elbow
#

I wonder if it would be good to add a warning that this trick is not good for devices that take more power, because the gpio pins can only sink so much current.

idle owl
#

I don't follow. What devices that take more power?

onyx hinge
#

like, you couldn't use this trick for the GND of a neopixel strip

idle owl
#

I mean, it's going in a guide for this specific device.

#

We show wiring diagrams in guides for other devices.

#

So I don't think it's necessary to extrapolate here.

#

I guess if it comes up, we deal with it. But I think it's fine here.

stuck elbow
#

I think it would still be nice to explain when it's safe to repeat such technique, people are going to pick up this trick and try to use it in their own devices

#

I think this is actually a nice learning opportunity here, since there is a neopixel strip being used in the same project, so it could be mentioned that its gnd has to go to true gnd

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0 on 2021-09-20; Raspberry Pi Pico with rp2040

Code/REPL

import time
from math import sin
import board
import displayio
import rgbmatrix
import framebufferio
import adafruit_imageload
import terminalio
from adafruit_display_text.label import Label

displayio.release_displays()
matrix = rgbmatrix.RGBMatrix(
    width=64, bit_depth=6,
    rgb_pins=[board.D6, board.D5, board.D9, board.D11, board.D10...
idle owl
#

Hmm fair enough.

idle owl
#

@tidal kiln Do you know how long it takes for updates to that file to propagate? Is it instant because it pulls from the latest version? Or is there latency on that. (Submitting code to Learn soon that will need this update.)

tidal kiln
#

unless it's cached, i'd expect instant

idle owl
#

OK that's what I was thinking too.

manic glacierBOT
manic glacierBOT
crimson ferry
#

the ring buffer is hurting my brain... each element is limited to two bytes?

tulip sleet
#

yes, and the two-byte is hacked on. We got it from MicroPython

#

it could use a rework, but it's small

crimson ferry
#

do we have a queue-like structure that can handle arbitrary number of elements and types?

#

or is that an exercise left for the reader ๐Ÿ˜‰

#

I'm wrestling with either queueing up blobs of bytes that Python can dissect, or queueing up distinct fields that can be directly accessed

analog bridge
crimson ferry
#

the event queue (like keypad) is ideal conceptually, but my events have relatively large amounts of data

#

unless maybe the queue contains mini-pointers to pointers to chunks of memory with the data

analog bridge
#

I am thinking of something like these formatting settings wifi.Packet.RAW, wifi.Packet.SSID, wifi.Packet.RSSI.

crimson ferry
#

haha, implementing anything like that is many levels above my current (not much) skill ๐Ÿ˜‰

analog bridge
#

I'll take a look at your implementation today and see if I can help out with something. ๐Ÿ™‚

crimson ferry
#

thanks, but I haven't pushed the current work. The existing stuff is really raw and naive (nothing passed up, just serial dump)... what I've been doing today is trying to adapt keypad into a separate module, which was going OK until I got to the ringbuf

analog bridge
#

That's okay... I will be looking mostly at the forward api.

crimson ferry
#

i'll push what I have, it's a separate branch 'monitor_queue`

#

I may also look at how BLE or wifi do scanning, but I've come to think that will give results that are too "chunky"

#

(bursts of frames followed by intervals of missed frames)

analog bridge
crimson ferry
#

(if you look, I just put a couple of fields in to see if it could work and how that would ripple through the code, but that would get unwieldy with a bunch of fields)

#

I did shared-bindings first, should have started in common-hal

misty storm
#

Was following the learning guide https://learn.adafruit.com/building-circuitpython/build-circuitpython

But encounter the following error:
$ make V=2 BOARD=circuitplayground_express
GEN build-circuitplayground_express/genhdr/mpversion.h
python3 ../../py/makeversionhdr.py build-circuitplayground_express/genhdr/mpversion.h
make: *** No rule to make target 'freetouch/adafruit_ptc.c', needed by 'build-circuitplayground_express/genhdr/qstr.split'. Stop.

Any advice ?

Adafruit Learning System

How to build CircuitPython yourself on different platforms

stuck elbow
#

@misty storm forgot to do the git submodule update --init?

misty storm
#

Checked and confirm I have done that. I was able to make mpy-cross.

misty storm
#

invoke make with the -d flag reveals more hints as below:

            Trying implicit prerequisite 'freetouch/SCCS/s.adafruit_ptc.w'.
             Trying pattern rule with stem 'adafruit_ptc'.
             Rejecting impossible implicit prerequisite 'freetouch/adafruit_ptc.w'.
             No implicit rule found for 'freetouch/adafruit_ptc.c'.
             Finished prerequisites of target file 'freetouch/adafruit_ptc.c'.
            Must remake target 'freetouch/adafruit_ptc.c'.

make: *** No rule to make target 'freetouch/adafruit_ptc.c', needed by 'build-circuitplayground_express/genhdr/qstr.split'. Stop.

So it is saying it needs to create this file adafruit_ptc.c in folder freetouch, which consists of only one file .git

manic glacierBOT
misty storm
# stuck elbow <@!515023619118858250> forgot to do the git submodule update --init?

Thanks for the hint. I did carry out this step but always encounter error when trying to clone the esp-idf sub folder. I think this may cause the repo clone to be incomplete and hence the build error.

But then my question is how to tackle this GnuTLS recv error (-24) ?

Cloning into '/mnt/c/Users/kevin/Documents/mcb2/circuitpython/ports/espressif/esp-idf'...
error: RPC failed; curl 56 GnuTLS recv error (-24): Decryption has failed.
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
fatal: clone of 'https://github.com/espressif/esp-idf.git' into submodule path '/mnt/c/Users/kevin/Documents/mcb2/circuitpython/ports/espressif/esp-idf' failed
Failed to clone 'ports/espressif/esp-idf' a second time, aborting

tulip sleet
#

@misty storm I use this alias:
alias gitsubupdate='git submodule sync --quiet --recursive && git submodule update --init'

#

so you are using WSL? It looks like you are trying to share storage with your Windows filesystem.

#

You may also have symbolic-link issues if you try to use /mnt/c

#

@crimson ferry ports/nrf/common-hal/nrf/_bleio/PacketBuffer.* uses a length header when storing variable-length stuff using ringbuf.

#

you could also consider using Python lists if you are storing python bojects

stuck elbow
#

@misty storm I think I've seen someone complaining recently about a certificate error with esp-idf somewhere

tulip sleet
#

what is the overall thing you are trying to implement?

stuck elbow
#

looks like one of their certs expired

#

one possible workaround would be to temporarily disable ssl verification with git config --global http.sslVerify false โ€” just remember to switch it back to true afterwards

crimson ferry
#

@tulip sleet thanks, Iโ€™ll look at that. Iโ€™m trying to get wifi frames up to pythonโ€ฆ variable-length bytes if raw, and/or a collection of various types of data if parsed in common-hal

tulip sleet
#

suppose you create a bytes with the data and then just push it on a list

crimson ferry
#

itโ€™s a continuous process, so the queue is essential

tulip sleet
#

๐Ÿ‘ the first one is, but the "collection of various types of data", that's broken up into objects, is it?

crimson ferry
#

yes, either way, itโ€™s a continuous firehouse of frames

tulip sleet
#

that is kind of what PacketBuffer is doing

crimson ferry
#

iโ€™ll dig into _bleio, thanks

onyx hinge
#

@crimson ferry you could also consider leveraging the code for collections.deque. This would let you work with fully-formed CircuitPython objects rather than low-level C structures. There's not actually a C API for deque objects but we could either (A) expose one internally or (B) your code can go via mp_call_function family functions to call the methods

#

(I didn't read the full discussion so please forgive if this is irrelevant advice given the full context)

crimson ferry
#

Thanks, that may well be helpful though most of the stuff between python and simple things in common-hal is still pretty murky to me, so I don't know what a good design looks like. keypad looked really nice to handle continuous events, maybe _bleio.PacketBuffer is a way to extend that to larger / more complex data. There's already a queue at the common-hal level, triggered by an event-handler, but the goal is to get those queued elements containing many bytes (and / or mixed-type data parsed from those bytes) up to Python in a dynamic, more continuous fashion (not like ble or wifi scanning, with a fixed iterable).

tulip sleet
#

I was thinking of using collections.Deque for keypad events, but it's not included in any builds right now, and I needed to make the code as small as possible, so I went with ringbuf (which is not the greatest piece of code).

#

I might have also used plain lists, but I needed to make some list operations be public that were static, and I would have had to convert back and forth between Python integers and C integers.

manic glacierBOT
#

Hi,
I am trying out the asynccp sheduler, but I cannot figure out how to exchange values with the running tasks. I would be grateful for any hints.
`
#=================================================================

Asynccp functions

#=================================================================

class App:
def init(self):
self.text_ID = '' #result from task
self.now_audio = 'Hei.wav' #input to task How to make these 'global'
...

onyx hinge
#

it looks like cascadetoml and circup don't have a fight anymore, when you install them both. yay!

#

the new typer came out a month ago but it's the first I noticed.

tulip sleet
#

hooray!

idle wharf
#

@lone axle Maybe I missed this, but I was curious if you had a topic planned for your Deep Dive guest host appearance today

lone axle
#

Depending on how long that takes (never wired one up before) I may get into some RasPi BlinkaDisplayio testing afterward.

idle wharf
#

@lone axle Awesome! I'm very curious to see the type annotations, I have not used that much\at all.

lone axle
#

That is an excellent emoji ๐Ÿ˜„

supple gale
#

Same. And I will work on my code as I watch/listen.

lone axle
#

I'm still very new to typing in python as well

idle wharf
#

My friend worked on Microsoft Mixer and when they shut it down, he setup his own discord with all the art from theirs ๐Ÿ˜‰

#

(Where the emoji came from)

manic glacierBOT
lime trellis
#

@tulip sleet I've been unsuccessful troubleshooting my fake-sleep HardFault_Handler crashes via GDB. It has something to do with GCC optimization but I can't find it even stepping through the entire stack.

what can I try/add to HardFault_Handler to figure out what's causing the issue??

tulip sleet
#

could you set a breakpoint at all on reset_into_safe_mode or on HardFault_Handler

lime trellis
#

(PS it always happens on the 4th iteration of a fake-sleep routine... doesn't occur if I supervisor.reset() that many times, though... and isn't related to the duration of fake sleep)

tulip sleet
#

you should still be able to set a breakpoint even without DEBUG=1, I think. It still knows the name of global routines.

lime trellis
tulip sleet
#

you want to make it not inline-able

#

put an MP_NOINLINE in front of the definition

#

that is a MicroPython macro that has the magic words to make it non-inline

lime trellis
#

@tulip sleet I'm working with a feather m4 (D51). Should I be setting up this "micro trace buffer"?

tulip sleet
#

I think that's only SAMD21

lime trellis
#

@tulip sleet finally got it to break on reset_into_safe_mode. What sort of things can I query to determine my issue?

tulip sleet
#

jsut do a bt (backtrace) to see what was happening when it hit that

lime trellis
#

This is all I get. Should I investigate mp_load_method_maybe?

(gdb) bt
#0  0x00044cde in reset_into_safe_mode ()
#1  0x000053c4 in HardFault_Handler ()
#2  <signal handler called>
#3  0x0002c92a in mp_load_method_maybe ()
#4  0x2001e0e0 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
tulip sleet
#

ugh, could be better

#

so damaged stack already. you could populate the code around where you think things are going bad with mp_printf(&mp_plat_print, ..)s and do some divide and conquering to narrow where it might be going wrong

#

setting a breakpoint on mp_load_method_maybe() is not going to help because it's called too often

lime trellis
# tulip sleet so damaged stack already. you could populate the code around where you think thi...

I've been using printf to hunt for things but at this point I'm all out of stuff I can try.
I do know it's always the 4th fake-sleep cycle during a call to alarm.exit_and_deep_sleep_until_alarms(time_alarm). My Gut is that it's something to do with this portion of main.c

#if CIRCUITPY_ALARM
if (result.return_code & PYEXEC_DEEP_SLEEP) {
    // Make sure we have been awake long enough for USB to connect (enumeration delay).
    int64_t connecting_delay_ticks = CIRCUITPY_USB_CONNECTED_SLEEP_DELAY * 1024 - port_get_raw_ticks(NULL);
    // Until it's safe to decide whether we're real/fake sleeping
    if (fake_sleeping) {
        // This waits until a pretend deep sleep alarm occurs. They are set
        // during common_hal_alarm_set_deep_sleep_alarms. On some platforms
        // it may also return due to another interrupt, that's why we check
        // for deep sleep alarms above. If it wasn't a deep sleep alarm,
        // then we'll idle here again.
        common_hal_alarm_pretending_deep_sleep();
    } else if
tulip sleet
#

so if you just print something before every statement there and see when one doesn't show up?

lime trellis
lime trellis
tulip sleet
#

it's probably worth checking the code to make sure that any objects you have stashed away are being marked in gc. If you made a static that contains an object, it will need to be made part of gc.

atomic summit
#

Hey, was @lone axle streaming today?

lone axle
tulip sleet
lime trellis
#

Where is this list of special gc objects? I'm combing through /py/gc.h now

tulip sleet
lime trellis
manic glacierBOT
#

I'd suggest you should separate your app data from your app actions. Something like this:

class AppState:
    def __init__(self):
        self.now_audio = 'Hei.wav'
        self.now_colour = BLACK

async def scan_NFC():
  # This is an unfortunate expression. Is there not a start_read_passive_target() and is_read_passive_target_done()? Because then you could actually read from this and not block for up to 100 milliseconds like you're doing here.
  uid = pn532.read_passive_...
misty storm
# tulip sleet <@515023619118858250> I use this alias: `alias gitsubupdate='git submodule sync ...

Thank you. I moved to build on another Ubuntu (not Ubuntu on WSL) and the build completes successfully!

I try to test the firmware but found that the "version" as printed on the REPL is "2025d0c", which happens to be the beginning digits of the commit as reported on the circuitpython github (the commit number ??)
https://github.com/adafruit/circuitpython/commit/2025d0c0605c4c0b21f58e1337e35546e011668b

Now when I try to update the libraries with circup, it seems confused by this "version" number and comes back with a "there was a problem". How can one controls the version as I should have put it as 7.0 ?

misty storm
#

skip the cicrup and move the libs manually. I still bump into this

Adafruit CircuitPython 2025d0c on 2021-10-02; MakerDiary nRF52840 MDK USB Dongle with nRF52840

from adafruit_ble import BLERadio
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adafruit_ble/init.py", line 17, in <module>
ImportError: This release is not compatible with CircuitPython 4.x; use library release 1.x.x

Any advice ?

manic glacierBOT
tulip sleet
tulip sleet
manic glacierBOT
#

@jepler, @WarriorOfWire, thanks for your help. I shall go to discord, but since asynccp is not part of basic circuitpython I thought i'd risk a question here. I struggle to get my head around class/objects - in this instance I don't understand how the state variables work. I have got the code up and running through, and the different functions 'communicate' with each other by means og global variables. I'm sure that is the bad way to do it, but so far as I do not understand better, that is th...

misty storm
tulip sleet
#

if you type git status, what does it say?

misty storm