#circuitpython-dev

1 messages ยท Page 365 of 1

gilded cradle
#

Yeah

idle owl
#

Who has a Neo Trinkey? Do all four pixels on it act as status LEDs? Like CPX etc?

#

Mine's not here yet.

gilded cradle
#

I have one, but haven't tried

idle owl
#

I'll find out soon enough, but figured I'd ask in case anyone's played with them yet.

gilded cradle
#

Well, all 4 turn red when entering bootloader mode

idle owl
#

Ok, that's a start. Can you make a CircuitPython error to see if they do error codes or not? I feel like no. CPX doesn't.

gilded cradle
#

sure

idle owl
#

Thanks!

gilded cradle
#

@idle owl, just one lights up (the one by the word trinkey)

idle owl
#

Ooh! Ok. Excellent.

gilded cradle
#

np

slender iron
#

@tulip sleet I think the issue may be if click 7 is already installed

#

the pip -r won't update for some reason

tulip sleet
slender iron
#

ยฏ_(ใƒ„)_/ยฏ

limpid cloak
#

For the new Neo Trinkey - Hello, anyone has CircuitPython examples that can be edited for a head start? I just got a Neo Trinkey and don't know where to start. So far the only thing I figured out was to press the reset button 2 times really quick after plunging in to the PC, and changing to USB storage mode (all LEDs turn green). Apologies if was already answered, but I couldn't find any documentation so far.

tulip sleet
#

just drag the .UF2 to the BOOT drive. Then connect to the REPL via Mu or screen or Tera Term or some other terminal program. You can try NeoPixel examples from the CPX or similar board

limpid cloak
tulip sleet
#

neopixel.mpy and adafruit_hid are already on the board, so you don't even need to load those librarires

#
import board,neopixel
np = neopixel.NeoPixel(board.NEOPIXEL, 4)
np[0] = (10,0,0)   # turn the first neopixel red
limpid cloak
tulip sleet
#

enjoy!

manic glacierBOT
#

Firmware

Adafruit CircuitPython 6.2 and earlier on 2021-04-07; Teensy 4.0/4.1

Code/REPL

"
import rtc
import time

r = rtc.RTC()
r.datetime = time.struct_time((2019, 5, 29, 15, 14, 15, 0, -1, -1))
"

Behavior

Traceback (most recent call last):
  File "", line 1, in 
TimeoutError: Clock stretch too long

Description

  • Error while using i2c...
  • Only happens when...
  • might be related...
limpid cloak
manic glacierBOT
toxic temple
#

TTGO T8 ESP32-S2 ST7789 is missing the board.LCD_MISO - using CircuitPython 6.2.0

#

TTGO T8 ESP32-S2 ST7789 is missing the board.LCD-MISO definition

jaunty juniper
#

apparently it's because it doesn't have one

manic glacierBOT
misty garnet
#

do the individual core modules take up the same amount of room for each port and/or board?

crimson ferry
#

I wouldn't expect huge differences, but compiled machine code would vary between architectures, e.g., ARM vs. non-ARM

manic glacierBOT
#

code.py.txt

Firmware

Adafruit CircuitPython 6.2.0 "adafruit-circuitpython-feather_m4_express-en_GB-6.2.0.uf2"; Feather M4 Express

Code/REPL


import rtc
import time
import supervisor

my_real_time_clock = rtc.RTC() #Uses Internal ADC on AtSAMD51

#To set the time one has to run this script with the following line uncommented.
#With the Lipoly battery connected to ...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

As it is possible to config USB devices on a custom build, any hints where to start when trying to implement this?
https://learn.adafruit.com/building-circuitpython/customizing-usb-devices

I've read some docs about the requirement.

  • A boot keyboard only does 6kro. But this is already the case in the current implementation
  • The interface descripter field bInterfaceSubClass should be set to 0x01 (Boot_Protocol)
  • A boot protocol keyboard must support GET_REPORT, GET_IDLE, SET_IDLE, GET...
manic glacierBOT
#

I am starting to implement dynamic control over USB and USB HID descriptors right now. I may not get to boot keyboard immediately, but it will be possible. So I would say not to start on it yourself right now, because the underlying code is going to change a lot in the near future.

All that we really need is a separate USB descriptor (separate endpoint) with an appropriate USB HID descriptor. Almost any commercial keyboard does this and we can vet our choices against the descriptors from s...

cobalt grail
#

Hey @lone axle - What's your live stream schedule?

lone axle
cobalt grail
#

Perfect. Will try to catch it then!

bleak heath
#

Hi guys! I've noticed in the module support matrix that i2cperipheral is not listed for Qt Py M0. That means that it doesn't work at all or that it's not included by default?

stuck elbow
#

it's not included in the firmware, it may work if you compile your own custom firmware with it enabled

bleak heath
#

I tried searching for the precompiled library but didn't find it

stuck elbow
#

it's not an external library, it has to be compiled in the firmware

bleak heath
#

do you know the sketch from Malcom in the middle with the broken lightbulb?

#

I think this is pretty familiar for most of us.
To everyone who watches this: please check out this youtube creator called nartharie . He has created some of the must absurd and funniest videos I've ever seen, but he's still at 280 subs at the time of writing. So please discover this before all your friends or acquaintances or whatever do and be...

โ–ถ Play video
#

now I need to learn how to compile circuitpython...

bleak heath
#

Do you know why i2cperipheral was not included by default on Qt Py? I don't want to compile everything and find out it doesn't work on on SAMD21 because reasons

jaunty juniper
#

it is enabled on some M0 boards and works, but sacrifices have to be done in order to make Circuitpython fit on really small boards

#

to enable it you would have to disable other modules

bleak heath
#

do you know for sure it's a size constraint and not another reason?

jaunty juniper
#

yup, the M0 boards keep hitting that wall, it's a real issue

bleak heath
#

allright, let me see how it goes

#

thanks ๐Ÿ™‚

jaunty juniper
bleak heath
#

installing python requirements now

#

it's going slow on a rpi3

jaunty juniper
#

oh yeah that's gonna be slow

bleak heath
#

your image seems to be starting

#

let me test i2cperipheral now

#

if it fits, maybe can be left on by default

#

ah, and I just noticed that both the board and rpi are missing the i2c pullups

jaunty juniper
#

that's not a module that has much demand I believe, and it gets complicated because some other languages take more space, which makes it a support nightmare when different localizations don't have the same modules, it's difficult calls

#

by it fits I mean: 436 bytes free in flash firmware space

bleak heath
#

indeed

#

I would much sooner remove the midi module

#

but that's because I'm not a musician ๐Ÿ˜„

jaunty juniper
bleak heath
#

I would make the midi module a library and include i2cperipherals by default keeping in mind that the board has a stemma qt connector

#

or at least make i2cperipherals a library so I don't have to create the universe before eating an apple ๐Ÿ˜„

#

haxpress just means the board has the flash soldered on, right?

jaunty juniper
#

yes

manic glacierBOT
bleak heath
#

@jaunty juniper your image works, I can see the device with i2cdetect

#

however my compile crashed

#

does it need a special version of arm-none-eabi-gcc?

#

I remember that being the case when I build the bootloader

slender iron
#

@bleak heath do a clean whenever you see a QSTR error

#

the deps for the QSTR code aren't sufficient

#

@lone axle @still zephyr @mental nexus what to you think about having a separate org and bundle for the circuitpython widget libraries and such? I'm not sure we as Adafruit want to signal that long term support is from us. We could actually put them under the circuitpython org

bleak heath
bleak heath
# jaunty juniper yes

I looked in every file in boards but I can't find a list of libraries to compile per board. Where did you enable it when you compiled?

slender iron
#

we could move the community bundle to the circuitpython org too

analog bridge
#

@bleak heath its in mpconfigboard.mk or mpconfigport.mk

lone axle
# slender iron <@!382939733107408897> <@!607375730610798634> <@!366059101203202052> what to you...

I would be okay with whatever you think is best. I would love to see them in the main bundle because I think it makes them easier to find and thus more likely to get used. But I can understand that does imply longer term support which may not be something Adafruit would want to do on some of them. Some of them have been used in Learn Guide projects already. The IconWidget is the one that comes to mind it was used (and made for) the Touch Deck project, if any were going to get long term support from Adafruit I would think that may be one.

lone axle
#

oh, maybe I misunderstood. You meant the org on github. not circuitpython.org the web page

slender iron
#

right, the circuitpython github org

#

I think I can make a public librarians team there

lone axle
#

if they do move to a new org, if possible I'd love to get at least one of us to have access to create repos. Especially in the near term there are going to be a few that need to get created in order to split up what's currently in the displayio_layout library.

still zephyr
slender iron
#

@lone axle exactly. I think that'd be awesome

#

kk, we'll need to think through moving the community bundle

bleak heath
still zephyr
#

Also, I think is a good point that Foamyguy is making

lone axle
#

We are thinking of ways to help folks discover the displayio widgets, one idea that came up was a learn guide that illustrates their usage. Do you think it would still be appropriate to make something like that if those were outside of the main bundle (assuming of course ladyada is interested in having that guide made)

slender iron
#

want me to make a widget or graphics team?

#

@lone axle ya, I think that'd be fine still

still zephyr
#

graphics

lone axle
#

graphics would be good I think. or even displayio if you want to make it more specific

still zephyr
#

agreed

#

@mental nexus has the animation stuff that I would not call widget

#

displayio or graphics is fine by me

jaunty juniper
still zephyr
#

@slender iron now I understand why you were asking to change the ADABOT ๐Ÿ˜† parse bundle

#

it is ready, i just burn my API limit ๐Ÿ™‚

slender iron
#

@still zephyr it didn't hit me until a few minutes ago that we should use the circuitpython org for community libraries

bleak heath
jaunty juniper
lone axle
bleak heath
slender iron
#

I think layout is fine because it's what uses those APIs for layout

lone axle
#

okay, cool. Thank you.

slender iron
#

you should have a circuitpython invite waiting

lone axle
#

got it. Joined, thank you.

slender iron
#

np, this should work out well

still zephyr
#

Join also, thanks

slender iron
#

๐Ÿ‘

#

we can move the community bundle once we think the tooling will be ok

#

I added an in the weeds topic to discuss it

still zephyr
#

@idle wharf will be happy

slender iron
#

ah, should I add him to the graphics team too?

still zephyr
#

that I do not know, I was talking about the community bundle

slender iron
#

kk

manic glacierBOT
ionic elk
#

@tulip sleet I'm getting swamped with email and github notifications from that one commit I was mentioned in, I think it sends me one for every merge onto main. Any news from Github about that?

#

Is there any way we could retroactively go in and delete the message for it?

tulip sleet
ionic elk
#

@tulip sleet nice to know you got a response, but I can't tell if they understand that these notifications are persisting past the point that a PR is merged - I'm getting them constantly for a PR that was merged a week ago. Like, this is clearly a bug - there is no circumstance in which these notifications would be useful to anyone.

tulip sleet
#

i know, it was not a great reply. Feel free to add to that thread.

ionic elk
#

We don't need extra resolution to remove these notifications, they should not be created at all

tulip sleet
#

_it does appear that any time that commit is pushed to a new branch, we are sending you a notification for the @mention in that commit message. _

#

so even though it's merged, when that commit is referenced in a push (even in a fork), we now get the notifications.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

API-related comments, originally from #4447:

The synthesiser can implement the AudioSample protocol, but in addition to that, we'd like to be able not to pass it a buffer upfront, but to call a write method instead that queues data up. That way we'd be able to pipe MIDI from BLE or USB directly into this object.

OTOH,

  • that would make looping (or even passing the same AudioSample to play() repeatedly) impossible;
  • the protocol for audiosample_reset_buffer_fun has no way to ...
misty garnet
#

anyone have the GPIO pinout for the QtPy RP2040?

#

nvm, found the listing in pins.c. Btw, there seems to be an error:

    { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO28) },
    { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO28) },

    { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO27) },
    { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO27) },

    { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO26) },
    { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO27) },
#

MP_QSTR_D3 should probably be GPIO26

manic glacierBOT
#

.. and use the same one in samd, nrf, and raspberrypi.

nrf used a different one which may be the cause of #3875 (but I didn't actually test so I don't know if it's fixed)

If we want to substitute a smaller implementation (like one without a table, as discussed in #4559) now we can do it just once instead of 3+ times.

esp32s2 wasn't touched, as it is using a hardware quadrature decoder module.

mental nexus
# slender iron we could move the community bundle to the circuitpython org too

To me there's no significant difference on what name the files are stored under, it's reasonable to include it in the community bundle. Of course the decision on long-term support is really Adafruit's to make.

My git/github game is pretty weak, so I can't offer much assistance on a transfer. But if you define a place for new things, I will follow y'all's lead.

slender iron
#

I like the idea of using these libraries to build up the circuitpython org

mental nexus
slender iron
#

the circuitpython github org

#

not the website

tulip sleet
still zephyr
toxic temple
misty garnet
#

@tulip sleet yeah, I only caught it because I ported over some Pico state machine code and used the D3 tags. It was complaining that a pin was in use and I couldn't figure it out.

#

also, the GPIO going in reverse direction compared to D0, D1, ... messed me up a bit too (matters when using sequential pins for the state machine)

mental nexus
manic glacierBOT
#
[adafruit/circuitpython] New branch created: qt\-py\-rp2040\-d3
misty garnet
#

i2cperipheral isn't an option for RP2040?

tulip sleet
manic glacierBOT
#

@dhalbert

Johnson-Davies' algorithm inherently drops one count on direction change, which is unfortunately the problem you were trying to solve. However, it is very good in many other ways.

Interesting to only interrupt on one signal (not both). Sure that would reduce noise by half and use half the resources. I suspect that the reverse direction drop bug could be fixed . It is an interesting approach of awaking onChange for only one pin, lets try it. I don't understand why the wiki a...

manic glacierBOT
#

I tested this on a Feather Sense (nrf) and a QT Py M0. On both I got no position changes: .position was always 0.

I did not test with an RP2040 board.

Reloading both boards with 6.2.0 showed both could work. However, I noticed that the nrf and the atmel-samd implementations run in opposite directions! One goes up, and one goes down, when turned in the same direction.

Test program:

import board,rotaryio,time
r = rotaryio.IncrementalEncoder(board.A0, board.A1)
while Tru...
manic glacierBOT
tough flax
#

I know @slender iron and @tulip sleet have been doing a ton of of work on the BLE stack recently (with more to come)... does anyone know if there is or will be a way to connect a single NRF52840 (ideally running CP) to multiple centrals? The use case (from an AT perspective) is that users want to use iOS switch control (which is basically switch scanning for disabled users - from a code perspective it is just acting as an HID Keyboard) with both their phone and their tablet and switch between the two.
So, I guess the questions are:

  1. Does BLE let the peripheral do this? disconnect and reconnect between centrals?
  2. Does CP expose it?
  3. Are there other use cases that put this on the roadmap?

Thanks

thorny jay
# tough flax I know <@!252717193496756235> and <@!329766224093249548> have been doing a ton o...

At one point I wanted one CP device to act as a mouse for two computer. It is not really the kind of usecase you will find in "simpletest" example and that was trial and error. Also I cannot garantee from time to time I did not have to help one of the PC to connect. I manadged to do it (I need to dig the code) but both PC were receiving exactly the same mouse movement (but it was also the goal as this was a multi-PC mouse jiggler). There might be missing piece of functionality to have fine tune control on the behaviour. The trick that made it work for me (but I recently discussed that here or in meeting) was to re-advertise yourself once the first PC would connect, because by default or in sample code, it stop advertising, blocking the next device to connect.

tough flax
thorny jay
#

Yeah, I fully understand the usecase.

#

From memory, when you advertise, you can specify the "name" you use. And actually there was a bit of a mess there, because I played so much with Bluetooth binding, mostly with the same board, that it was hard to have a clean config on the PC side to experiment. But the idea could be to advertise under different name. And when you want to switch, to disconnect and advertise under the other name. So only one "personality" would be visible at a time.

#

I have physical Bluetooth (no BLE) keyboard that do have multi host, and a button to switch from connecting to one device or the other. But I don't know if it is pure software trick, or if there are separate MAC address or some hardware need for that functionallity.

tough flax
#

Gotcha - Actually, I kind of like that approach - if the BLE device could advertise "Phone Switch Control" and "Tablet Switch Control" the devices could bond/pair to the name and then internally do the connection switching...

thorny jay
#

Keep us (me) posted, it is very interesting. I remember one of the issue I had with my code, my code would be stuck on waiting for the first PC before it could advertise with the name known by the other PC. So it would only work when both PC (or at least PC number 1) was present. But I guess I could make the code work better. The idea at the time was the wireless mouse jiggler to keep the PC from going to sleep, and if my CP board was on, I wanted all the PC to stay up. Since I both use my personal and the corporate PC for teleworking... Nowdays I just plug a different CP board on each PC and do that in USB, it solve my problem too.

thorny jay
manic glacierBOT
bleak heath
#

Hi guys! I'm trying to use regex on a Qt Py M0 but seems the "ure" library is not compiled in. I can't find it as an external library anywhere or the option to compile it in the firmware. Any hints?

tulip sleet
#

@tough flax @thorny jay You can advertise multiple times and then have multiple connections, theoretically. This case has not been well tested, but I think someone tried it before. Since the connections are identified, you can choose which one to send to.

tough flax
#

Cool - I'll setup a Circuit Playground BLE and get the basics around sending to one central working today and see if I can add a second device. Do you know if there's a limit on the # of connections?

manic glacierBOT
tulip sleet
tough flax
#

4 would be awesome

#

Phone/PC/Tablet/speech device

manic glacierBOT
smoky zenith
#

unrelated, I recall raspberry pi being limited to 7

manic glacierBOT
#

Can you share the scripts to generate the graphs?

import os, re
for fn in os.listdir():
  if os.path.isfile(fn) and ("build-arm " in fn or "build-riscv " in fn):
    board = re.split('[()]', fn)[1]
    if board in ("spresense", "teensy40", "teensy41", "feather_m7_1011", "feather_mimxrt1011", "feather_mimxrt1062",
                 "imxrt1010_evk", "imxrt1020_evk", "imxrt1060_evk", "metro_m7_1011"):
       continue
    with open(fn, "r") as f:
       head = "Build " + board + ...
jaunty juniper
# bleak heath Hi guys! I'm trying to use regex on a Qt Py M0 but seems the "ure" library is no...

this one is enabled with CIRCUITPY_RE, but you'll need to disable stuff you don't need, I managed by setting CIRCUITPY_USB_HID and CIRCUITPY_USB_MIDI to 0.
I'd say the simplest way to see what is in a build is the support matrix https://circuitpython.readthedocs.io/en/latest/shared-bindings/support_matrix.html
And the available compile flags are in https://github.com/adafruit/circuitpython/blob/main/py/circuitpy_mpconfig.mk

bleak heath
jaunty juniper
#

yep, it's just re like the C python one

tulip sleet
#

MicroPython put u at the front so they would have the freedom to deviate from the CPython API. Our policy has instead been to say that our modules that have the name name as the CPython API implement subsets only of those API's

bleak heath
tulip sleet
#

that is a doc bug; we need to fix the index ahd heading terms

jaunty juniper
#

google results are often not pointing to the latest readthedocs, that's frustrating too

bleak heath
#

actually it points to the 6.0 version, I clicked on "View the latest version"

tulip sleet
#

i just activated 6.2.x in readthedocs. We also have a robots.txt to update. Sometimes we miss these when doing a release. Thanks for pointing this out.

manic glacierBOT
#
[adafruit/circuitpython] New branch created: revert\-3291\-robots\.txt
#

Reverts adafruit/circuitpython#3291, which added our own robots.txt. I discovered that readthedocs will automatically generate an appropriate robots.txt based on which versions are activated and/or hidden. We can manage the visible versions from readthedocs.

The robots.txt file is at https://circuitpython.readthedocs.io/en/robots.txt.

See https://docs.readthedocs.io/en/stable/versions.html#states:

! Note
Active versions that are hidden will be listed as Disallow: /path/to/v...

manic glacierBOT
onyx hinge
#

@tulip sleet what problem are you still seeing with that rotaryio PR?

#

oh weird, I totally missed the 'swapped' field of encoders. haw.

#

does not using bitfields save code space?

manic glacierBOT
#

OK, I pushed several changes:

  • Changed 4-bit struct fields to whole bytes. The amount of RAM saved is minimal, at the cost of larger code size, which is an issue on some boards.
  • Fixed nrf ISR for rotaryio: it was not setting the values properly.
  • Made the direction of rotation be the same across the three ports. Used the atmel-samd direction as the default, since there are more boards out there. This necessitated remembering the pin swap on raspberrypi, and it needs to start out ...
tulip sleet
#

@onyx hinge my commit started out as just fixing the nrf ISR (nrf was still not working), but it expanded

#

I would like to work on the algorihtm more later, like notice the initial state. Your unification PR makes that work much easier - thanks!

onyx hinge
#

@tulip sleet I'm not against changing rp2040 to use the equivalent of pin-change interrupts, fwiw

tulip sleet
#

we should check the direction on STM

#

i don't have the immediate RP2040 chops to change it to regular interrupts

onyx hinge
#

I shouldn't take the time right now and I couldn't do it without reading the datasheet anyway

tulip sleet
#

same here

onyx hinge
#

oh oh it was the new state ^ ..., now I see it

tulip sleet
#

yeah, that was not congruent with the atmel-samd

manic glacierBOT
onyx hinge
#

@tulip sleet maybe it should be part of my CP2022 laundry list, but I often find myself feeling that there's the opportunity for more code sharing among the ports than we've achived. I even sometimes notice it when working on a fresh implementation, but don't necessarily I have the time available to work on that. btw thanks for the testing and bug fixing on this PR!

#

and maybe I personally work on it by making sure I do take the time

manic glacierBOT
#

I am also attempting to create an AP using CP on a FeatherS2 as well and tried this approach based on the example code in esp32spi_simpletest.py and adafruit_esp32spi.ESP_SPIcontrol.

https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/blob/2870f72c54e8e9086c0f73cf83f6204eb0427f0f/adafruit_esp32spi/adafruit_esp32spi.py

the message coming back is always RuntimeError: ESP32 timed out on SPI select - is this expected? is there a workaround?

I noticed that some of the exam...

manic glacierBOT
#

The pinout card does mention DAC0 (PA02) and DAC1 (PA05) on the raspberry-pi-type header.
https://files.seeedstudio.com/wiki/Wio-Terminal/img/WioT-Pinout.jpg

Some other pins on the header are not in pins.c
I noted:
GPCLK0, GPCLK1 and GPCLK2 (resp PB14, PB12 and PB13).
I2S_LRCLK (PA20), I2S_SDIN (PA21), I2S_SDOUT (PA22), I2S_BLCK (PB16).

Looking at the pinout card and the schematics, I was wondering if some pins could also get aliases: I2C1_, I2C0_, maybe even use the GPIOxx name...

ionic elk
#

@tulip sleet I'm trying to merge everything into the NRF port, but something is blocking my builds:

Traceback (most recent call last):
  File "../../tools/gen_nvm_devices.py", line 2, in <module>
    import cascadetoml
ModuleNotFoundError: No module named 'cascadetoml'
make: *** [build-feather_nrf52840_express/genhdr/devices.h] Error 1

I notice we now have the "data" folder in root, is there something I need to do beyond a simple submodule update?

tulip sleet
#
cd circuitpython #top level
pip3 install -r requirements-dev.txt
#

we now need a bunch of Python modules for the builds

#

cascadetoml is one that is installed

#

you may get a really strange python error after this, which is due to click not updating properly. if pip3 list does not show click as 7.1.2, do pip3 install --upgrade click

ionic elk
#

So I should be doing all builds in a virtual environment now? That's a lot of dependancies

tulip sleet
#

you don't have to, unless it would mess with your regular python environment. I just installed those things for me too in general

#

just don't sudo pip3 install

ionic elk
#

ok. I got a some warnings about sphinx but the build seems to work so whatever

#
ERROR: sphinx-rtd-theme 0.5.2 has requirement docutils<0.17, but you'll have docutils 0.17 which is incompatible.
ERROR: awscli 1.19.48 has requirement docutils<0.16,>=0.10, but you'll have docutils 0.17 which is incompatible.
tulip sleet
#

i think that might have just been released. I have 0.15.2

simple pulsar
#

Hi, I'm probably missing something obvious but I have failing checks (in Pre-commit hooks) for https://github.com/adafruit/Adafruit_CircuitPython_IRRemote/pull/46 and I've not yet found where to look for the error. AH, this is some surprise from black maybe but I thought I'd see a report of what was wrong...

tulip sleet
#

@ionic elk i just did pip3 install --upgrade -r requirements-dev.txt and it fixed some things and caused other complaints, which I fixed manually.

#

@simple pulsar black said it would reformat adafruit_irremote.py

#

did your local pre-commit not catch this?

simple pulsar
#

Doesn't it go ahead and just do the re-formatting?

tulip sleet
#

no, because that would require a new commit. You can run the pre-commit hooks locally:

pip3 install pre-commit
cd your-repo
pre-commit install   # just once for each repo
#

pre-commit was really meant to be used locally before you push (hence the name). we are using it in the CI as a double-check

manic glacierBOT
simple pulsar
#

Thanks, I'll have a look later

#

I hadn't followed the complete story on intro of black

solar whale
#

Strange behavior!!! If anyone want's to try reproducing.... On a Raspberry Pi4 -- with latests update/upgrades if I use the chromium browser to access the Adafruit Learn "new guides" page it locks up the Pi 4 console session (GUI) I can still ssh into it but I have to power cycle to get the console back -- even a reboot does not work.... This happen on both a 4Gbyte and 8Gbyte RPI 4.... very strange

still zephyr
solar whale
#

sorry -- not CP related

tulip sleet
#

what is the version of the browser?

solar whale
#

@still zephyr thanks

#

@tulip sleet 88.0.4324.187

#

It's OK with Chrome on my linux box and with Safari on Mac.

#

@tulip sleet have you played with a funhouse at all yet?

tulip sleet
#

no, but i have one on my desk

solar whale
#

It does not appear to have a UF2 boot loader -- and when I wanted to install CP-- I found I had do to an erase_chip before flashing or else it would not boot-- if/when you try it, I'll be curious of you find the same.

#

Also the board seems to heat to about 10 degrees above ambient ๐Ÿ˜ฆ both sensors agree. I was hoping for better thermal isoloation of the sensors.

tulip sleet
#

i will pass that on. I would not expect it to have a uf2 bootloader on it due to the testing cycle, but having to erase first is a nuisance. are you seeing the test program?

#

the sensor heating may be self heating, I don't know. they heated up awfully fast from being plugged in

solar whale
#

I saw the test program at first power -- worked fine. Now have CP installed

simple pulsar
#

@solar whale The physical design looks like it's intended to minimise conduction over the pcb to the temp stuff

solar whale
#

Yes -- seems like self heating -- same as pyportal and other. It looks like an attempt was made to thermally isolate them

tulip sleet
#

yes, that was the idea, but they are still pretty close to the regulator

#

i meant that the sensors themselves may be self-heating due to being queried all the time

simple pulsar
#

I've seen that on the CLUE's sensors but it's pretty small, like 0.1 or something

tulip sleet
#

sometimes humidity sensors have an internal heater, for instance

solar whale
#

I don't usually see that on breakouts.

#

I'm watching the aht20 slowly rise now -- with the simpletest under CP.

simple pulsar
#

Have you got it horizontal or vertical?

#

That house has no chimney, maybe that's the problem

solar whale
#

@simple pulsar I had it horizontal --- -- just went to vertical

#

interesting -- when vertical, the temperature is dropping.. slowly

tulip sleet
#

it is difficult to find a cool spot on the board. The ESP32-S2 module is a pretty hefty power draw, and the neopixels are also an issue, and so is the backlight

simple pulsar
solar whale
#

I was just curious what other's were seeing. It'll take some experimenting -- I was hoping the layout would help more.

#

My main reason for asking about the board was to see if others had to do the "pre erase" step. I think I had to do that on some other esp32s2 boards as well, but it should probably be noted in the guide...

#

@simple pulsar looks like it -- I'll have to see if I can turn the backlight off.

simple pulsar
#

Certainly worth comparing the two scenarios with other parameters constant.

solar whale
#

quick test -- the backlight clearly has an impact. Lots to explore....

manic glacierBOT
umbral dagger
#

Is there anythin special about installing on the FunHouse? Ifollowed the instructions for teh MagTag (using the appropriate bin of CP) and get nothing.

tulip sleet
#

i have one but have not tried anything yet!

solar whale
#

Now you can answer all the questions about it on the forum ๐Ÿ˜‰

umbral dagger
solar whale
#

FYI I found that the PIR fit better in the lower set of holes.

#

I could not get it to go in the upper set

umbral dagger
idle owl
#

Is that a cap meant to come off the back of that header on the back of the board, or is it something glued on?

#

It looks like the cap that comes on the mini SWD headers, but it didn't come off easily so I stopped messing with it.

umbral dagger
#

It's just a clip to cover the holes.

solar whale
#

Itโ€™s a 2x3 header

#

But you put the pir in from the other side

idle owl
#

Right, I get that much, but I meant there's something on the back of it, as dastels said, covering the holes.

solar whale
#

I think it is just not lined up well with the upper holes

tulip sleet
#

it works from either side, though I think it is a creative use of that connector

idle owl
#

OK so that bit does come off. Got it.

solar whale
#

Yes... but probably most useful on the front

idle owl
#

I suppose convenient if you wanted to mount it on the back, and point the thing into a room and have the display pointed the other way or something.... But yes, most likely useful on the front.

solar whale
#

Sorry for starting the โ€œobviousโ€ I misunderstood what you were asking.

idle owl
#

No worries! I appreciate the response!

#

The question wasn't that clear because it's not an obvious thing. It kind of blends into the connector if you're not looking for it.

solar whale
#

I think this board will be fun.

#

I'm curious about the cap touch slider -- have not tried that yet....

#

I am not familiar with using one. I assume there is no support for it ...yet other than as 5 pads or is there something out there for it?

slender iron
#

code doesn't work. /me puts print next to "this shouldn't happen comment", reruns and the print is printed ๐Ÿคฆ

manic glacierBOT
solar whale
#

Cool! The funhouse simpletest is very nice!

manic glacierBOT
meager fog
#

we have itsybitsy RP2040 in stock now for folks who want something with more pins than qt py!

tough flax
#

That is awesome at a great price!

#

Nevermind - I see it

#

I am super tired and might not be 100% - It just seemed to not be where I expected it

tulip sleet
#

@tough flax don't forget to take a break; you need to rest

tough flax
#

Yes yes - I know

manic glacierBOT
still zephyr
# solar whale <@!607375730610798634> thanks

Confirmed, same behavior. I tested first with chromium 86.0.4240.197 and it works without a problem, then I upgraded the system and under chromium 88.0.4324.187, the system just froze, I did not even get to new guides, just in learn. Same as you, I did not test SSH stuff (lazy me ๐Ÿ˜ณ )

solar whale
#

@still zephyr thanks! Glad to hear it is not just me!

tulip sleet
#

@solar whale @still zephyr I reproduced this as well, and did log in via ssh. I was running top via ssh. I opened chromium, went to https://learn.adafruit.com, saw multiple chromium-browse processes appear and then all but one disappeared, and the mouse and screen froze. doing an sudo reboot from ssh did not work; I had to power cycle, as you did. I think it's worth filing an RPi bug or bringing it up in the forum. I don't think we can blame learn.adafruit.com but it's an easy example of something going wrong.

#

the cpu was getting pretty hot; it clocks down when hot, right? I have a finned heatsink on mine.

still zephyr
#

@tulip sleet Thanks, for sure is in the RP side. Yes RP clocks down when hot

misty garnet
#

ugh, hitting the QtPy memory limits ๐Ÿ˜›

lone sandalBOT
orchid basinBOT
solar whale
tulip sleet
#

@solar whale I also saw this lockup just with https://learn.adafruit.com. The "latest" page has many animated images; the home page has fewer, but still many images.

#

I'll add something to your thread.

manic glacierBOT
#

@dhalbert @hierophect I am trying to implement soft reboot without reset_cpu(). But after git-merging the latest updates, I have a trouble around python memory allocation. When light sleep or deep sleep is executed and python VM is rebooted, I get a MemoryError in gc_collect() in parse_compile_execute(). I use m_new_obj() to allocate a new TimeAlarm object in _get_wake_alarm() to return an alarm object to user, when woken up from sleep. If I comment out the m_new_obj(), the Memo...

#
fossil gorge
jaunty juniper
#

I think it's a "dense array of floats", and I would translate "dense" as "dense" as in there is no holes in it (ulab arrays can be sparse)

fossil gorge
#

Dense meaning that there's a value in each element? Such as [1.1,2.2,3.3,4.4] as opposed to [1.1, nil, 2.2, 3.3, nil, 4.4, nil]?

jaunty juniper
#

in numpy/ulab arrays/matrices can be sparse to spare memory space, meaning they are not coded as a continuous list of values, but with skipped blocks and such

#

I'm not completely sure of the details, but I think ulab users who know what they are doing will understand the french term dense in this context (or look it up)

fossil gorge
#

Gotcha. Thanks @jaunty juniper! ๐Ÿ™‚

jovial wasp
#

Just getting into Raspberry Pi and Arduino after a career in software development. Testing is a big part of my process. How is most testing done? Are there automated tools to help testing?

stuck elbow
#

no testing in Arduino, on rasperry pi you usually use python, so you have all the usual testing tools available โ€” just mock the hardware parts

fossil gorge
onyx hinge
#

@fossil gorge I saw those messages too. I wanted to just remove "MicroPython" entirely

#

to me the messages read fine still

#

e.g., "MicroPython fatal error." becomes just "Fatal error"

fossil gorge
#

They do indeed, but it would seem that to a newcomer or someone not quite aware of the CircuitPython/MicroPython history, might be thrown for a loop.

#

Good point. Already mentions "CircuitPython" in the entry/header message

jovial wasp
#

Thanks for feedback
I was thinking of a system to mock components by a second Raspberry Pi. It would drive a Raspbery Pi or Arduino with test input. It would respond ot output too.
Woudl there be any interest in such a tool?

fossil gorge
#

Should I create an issue to remove the extra/double references to the platform @onyx hinge? Or something to maybe discuss at Monday's meeting?

onyx hinge
#

I'd recommend creating a Pull Request if you're comfortable, it seems straightforward enough to me.

#

there may need to be discusion but it can be concrete with a PR to refer to

fossil gorge
onyx hinge
#

appreciate it!

fossil gorge
#

Thanks!

manic glacierBOT
manic glacierBOT
#

its as follows in a clean case sensitive APFS case sensitive sparse image :

`pixel@Andrews-Mac-mini circuitpython % make -C mpy-cross
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
../py/persistentcode.c:419:2: error: mp_raw_code_save_file not implemented for this platform
#error mp_raw_code_save_file not implemented for this platform
^
1 error generated.
Command '['clang', '-E', '-DNO_QSTR', '-Ibuild/tmp', '-I.', '-I..', '-Ibu...

manic glacierBOT
#

Battle.net crashes when a CircuitPython device is connected

Devices and Versions

Some examples from devices on my desk:

  • Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Trellis M4 Express with samd51g19
  • Adafruit CircuitPython 6.1.0 on 2021-01-21; Adafruit Feather M4 Express with samd51j19
  • Adafruit CircuitPython 5.0.0-alpha.0-6-g31e459169-dirty on 2019-07-24; Adafruit CircuitPlayground Express with samd21g18

Behavior

The presence of a CircuitPython boar...

ruby atlas
#

(Oh what fun HID is)

manic glacierBOT
#

ah - now at this :
`pixel@Andrews-Mac-mini atmel-samd % make BOARD=circuitplayground_express
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
../../py/gc.c: In function 'gc_sweep':
../../py/gc.c:298:68: error: 'MP_QSTR___del__' undeclared (first use in this function)
298 | mp_load_method_maybe(MP_OBJ_FROM_PTR(obj), MP_QSTR___del__, dest);
| ...

onyx hinge
#

today I'm using a fuzzer on the micropython regular expression library (same one as used in circuitpython). wow, no problems (crashes or assetion errors) found! The fuzzer has tried such interesting regular expressions as a|xยชy+|(b[-------------------------------------------------------(b-------------------------c-d]) whatever that means ๐Ÿ˜œ

fossil gorge
onyx hinge
#

I think moderators may be exempt from the filter

manic glacierBOT
manic glacierBOT
#

Remove mentions of 'MicroPython' in error messages as they could lead to confusion in lesser-experienced users

This change comes as [a brief discussion on Discord](#circuitpython-dev message) with @jepler with regards to translations and references to "MicroPython" changed to "CircuitPython" being done in weblate.

Rather than updating translations to convert "MicroPython" to "CircuitPython", I inquired about making the change in...

manic glacierBOT
manic glacierBOT
solar whale
#

@tulip sleet @still zephyr From the Raspberry Pi forum -- a workaround, not a solution. Turning off hardware acceleration seems to stop it from freezing. I turned it off in Chromium Advanced Settings.

manic glacierBOT
#

@dhalbert @hierophect The MemoryError problem is solved. I found that common_hal_alarm_gc_collect() under ports/nrf/common-hal/alarm/ causes it, and porting esp32s2 implementation into nrf has solved the problem.

Now I have another question.
True deep sleep is implemented in common_hal_alarm_enter_deep_sleep(), and it is now declared with NORETURN. It means processor is reset when woken up from deep sleep. Current esp32s2 port implementation is NORETURN.
If we change true deep sleep...

ornate breach
#

so it doesn't look like we'll get circuitpython on the ESP32-C6

#

it has USB-Serial/JTAG but not USB-OTG

#

more reason to get the BLE loader working

crimson ferry
#

I wonder how much of a leap it would then be to support the original ESP32? That would add a huge installed base to CircuitPython-capable boards.

grim trail
crimson ferry
#

There's been discussion of using BLE as an alternate mechanism to native USB

#

Q: anyone aware of a reason why SAMD os.stat atime/ctime/mtime are correct for an SD card, but not ESP32-S2 (FeatherS2)? Using sdcardio.

onyx hinge
#

don't know, but sdcardio doesn't matter for the purposes of the question.

manic glacierBOT
manic glacierBOT
marble hornet
#

the MICROPY_COMP_CONST define flag is the toggle for the micropython const() syntax right?

#

I've yet find a comment confirming so concretely...

#

or maybe not?? For anyone else interested I'm looking in /py/parse.c

manic glacierBOT
#

Firmware

Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Feather M4 CAN with same51j19a

Code/REPL

import rgbmatrrix

Behavior

code.py output:
Traceback (most recent call last):
File "code.py", line 7, in
ImportError: no module named 'rgbmatrix'```

Description

I have a Feather M4 CAN that I was trying to connect to a Featherwing RGB Matrix. It appears the "rgbmatrix" module is included in the 6.2.0 release for Feather M4 Express,...

marble hornet
#

AH! found it

#
py/parse.c:711: // code to assign dynamic constants: id = const(value)
manic glacierBOT
tulip sleet
tulip sleet
manic glacierBOT
manic glacierBOT
#

The datasheet:
https://cdn-shop.adafruit.com/product-files/3006/MAX98357A-MAX98357B.pdf

It is possible due to wiring and ground noise for there to be a some disruption in sound quality. There are filters on the output per the datasheet for long speaker wires. There are some bank capacitors also per datasheet. The IC is designed to support low noise production and has measures on board to limit noise from making it to the output. However some of these are automatic and work in certain plac...

idle owl
#

I see there are two examples, but they're both using the Bluefruit LE Connect app. There are guides in Learn that cover communicating between two CPBs.

cyan turtle
#

Hi, does anyone know if its possible to behave like multiple usb devices at one time? like a keyboard and a mouse? or in my case a keyboard and a midi controller? I cannot see anything specifically saying its possible or not, but I have not found any examples either

#

I saw one reference about recompiling circuitpython to change the usb defines in some way but it was a bit over my head

tulip sleet
cyan turtle
#

oh ok, so i have this KMK powered keyboard... can i just start using the midi functions if i fiddle with the KMK main loop you think?

#

kmk is a keyboard firmware

tulip sleet
#

yes, but depending on the timing of things, you may have to wait for something to finish before doing something else

cyan turtle
#

..not the midi variety ... i wish typing and musical keyboards had different names when you are also talking about midi!

tulip sleet
#

we know about kmk ๐Ÿ™‚

cyan turtle
#

thats great, thanks @tulip sleet

#

i 3d printed a mechanical keyboard and it wanted a teensy but all i had was a pico which id never done anything with, but here i am typing on it

#

works great

#

i want to see if i can switch to a kmk layer and for all the keys to become midi buttons

#

buttons/notes

onyx hinge
#

@cyan turtle that sounds like a neat project!

marble hornet
#

If a shared-module function will call nlr_raise on some problem should it bother returning an error code or success bool?

tulip sleet
#

there are cases where we use common-hal or shared-module code outside of a python context, and there raising for an error doesn't work.

bleak latch
#

Hello, i have a board samd21 and im trying to learn curcitpython/micropython. I googled some keywords and the first thing was adafruit's page. I tried to install it on my board from the guide but had no success. Is there anyone who has the time to help me?

tulip sleet
bleak latch
#

alright thanks!

marble hornet
#

thank you. still getting used to writing c like c and not c like python ๐Ÿ˜…

manic glacierBOT
onyx hinge
#

<@&356864093652516868> coming up in about 70 minutes, we'll have our weekly meeting. See you in the voice chat. Please fill out the notes document if you have notes for hug reports, status updates, or in the weeds! https://docs.google.com/document/d/1N52qeTToB6s5QCgMq1IjLdMgkWoKfJZV_BiDkTCKQvg/edit?usp=sharing

modern wing
#

Good afternoon all you wonderful people adabot

idle owl
#

We're finishing up our internal meeting. We'll be there soon!

#

@lone axle Did you stream last week? This newsletter is pretty chonky, so if you still plan to add a stream, please save it for next week ๐Ÿ˜„

lone axle
idle owl
#

Cheers!

#

I do love that I wrote up the instructions, and we've all sort of shunted that info out of our brains in favor of using the writeup instead. ๐Ÿ˜„

thorny jay
#

So the pre meeting are not recorded?

#

Noone will know it was not done.

sterile bronze
#

just lurking

solar whale
#

Watch it!

blissful pollen
#

Watch it every year christmas eve with friends

fossil gorge
thorny jay
#

It's always Xmas in Heaven...

marble hornet
solar whale
#

I was warning about the grandparents reference ๐Ÿ˜‰

#

๐Ÿ‘

lone axle
marble hornet
#

Heck yeah!

modern wing
#

+1 praise for @jaunty juniper --- thank you ๐ŸŽ‰

fossil gorge
#

Great job on that find @jaunty juniper !

#

Making sure that everyone in the community gets the recognition for their help! ๐Ÿ™‚

jaunty juniper
#

๐Ÿ˜Š

glass silo
#

@tulip sleet So I tried using device cleaner and it didn't work, still doesn't recognize the feather

cobalt grail
#

I'd like to extend a hug to @fossil gorge for being the second member of the weblate gang to make a PR!

tulip sleet
glass silo
#

ok

fossil gorge
#

With so many folks working on BLE file transfer, hopefully something general enough can come out of the larger community

gilded cradle
#

You're welcome

fossil gorge
#

Worth putting a link to OurCade in the meeting doc?

slender iron
#

sure!

lone axle
#

I'll grab a link and drop it in my section, thanks for the idea!

fossil gorge
#

@slender iron - Your idea reminds me of the demo Google Wave had on writing and framing the U.S. constitution. Text, language, who provided what & when

solar whale
#

Go for the whole US.Code ๐Ÿ˜‰

slender iron
#

๐Ÿ™‚

#

gotta start somewhere

fossil gorge
slender iron
#

I'm looking at gitlab so I can create fake accounts for people ๐Ÿ™‚

#

and bills will be pull requests

solar whale
#

I'd live to see PR's from Congress

modern wing
#

Heads up -- some laws & codes are actually protected. You can't redistribute them or make them easily accessible. Absolutely 100% baffling, but it's an intentional effort to gatekeep.

thorny jay
#

"code is law" by LAWrence Lessig

slender iron
#

washington has a pending broadband bill that I want it for

#

but I'm deep in the history of the state code now

fossil gorge
#

Hurray 6.2.0!!!
๐Ÿฅณ blinkacomputer

thorny jay
#

USA constitution must have been full of bugs... I understand you can only do patching and never a new release. (not an expert)

slender iron
#

ya, we have amendments. the framers never thought they'd get it perfect to start

thorny jay
#

bread first... this must be a COVID trend.

slender iron
#

(foamyguy meant breadth first vs depth first)

lone axle
#

That is correct, though bread first sounds way more tasty. I dropped a link to the video I worked from if anyone is interested learning searching algorithms in JavaScript

thorny jay
#

HugoPython

slender iron
stuck elbow
#

pythons love to hug

#

almost as much as the boa constrictor

cobalt grail
#

(Btw @fossil gorge - Got my Keychron today)

stuck elbow
#

@cobalt grail k3?

cobalt grail
#

K4

fossil gorge
idle owl
#

I approve!

slender iron
#

@fossil gorge invited you to collab

#

(so I can assign it to you)

still zephyr
thorny jay
#

Protocol fuzzer can be used for BLE protocol, like the file transfert.

#

I believe someone used it for testing the UART of the PM2.5 sensor I worked on some time ago.

cobalt grail
onyx hinge
fossil gorge
#

๐Ÿ“ฐ ๐ŸŽ‰

blissful pollen
#

have to drop off for another meeting

thorny jay
#

Same, birthday party here.

modern wing
#

๐Ÿ‘‹ be safe y'all

jaunty juniper
#

happy birthday ๐Ÿ˜‰

slender iron
mental nexus
idle owl
#

Belated hug report to Melissa for adding all those boards to cp.org!

gilded cradle
#

๐Ÿ˜Š

manic glacierBOT
onyx hinge
#

@slender iron I'm happy to transfer (and potentially rename) jepler_udecimal into the circuitpython org, but nobody is collaborating with me on it.

still zephyr
#

How is going to work? could you explain the mechanics?

fossil gorge
marble hornet
#

ah

lone axle
#

Is there a preference on naming prefixes for libraries under this CircuitPython_[Something] or something else as a prefix?

fossil gorge
still zephyr
#

So we come as a group and decide what we support and if not we leave it in our repos?

lone axle
#

I do think we can make some tweaks in cookiecutter to help with creating the libraries meant for this.

still zephyr
#

Is adabot going to build these add bundles? and the lists?

fossil gorge
#

I'm excited, and sounds really good. I think we're all talking through potential "gotchas" or questions that might rear their heads later

marble hornet
#

to paraphrase: "no plan survives contact with implementation"

still zephyr
fossil gorge
#

Until #circuitpython-libraries becomes needed ๐Ÿ˜‰

still zephyr
#

cool

mental nexus
#

๐Ÿ‘

ionic elk
#

I feel like this channel could be #circuitpython-dev given how often people get confused about its purpose

modern wing
#

I'll second that too

marble hornet
#

Even if there isn't a separate cp-library channel It would be clearer

onyx hinge
idle owl
#

Updated. Open to suggestions/feedback on the channel description.

modern wing
#

a thought -- add on a link to the help channel after the .org link...."For general help with CircuitPython, please visit the #help-with-circuitpython channel."

idle owl
#

Sounds good.

fossil gorge
modern wing
#

I'll admit, it's a mouthful. Even on a 1920x1200 monitor, it'll be too wide.

idle owl
#

is shorter.

fossil gorge
idle owl
#

Made it even shorter.

fossil gorge
#

Kattni ftw on the wordsmithing ๐Ÿ™‚

idle owl
#

It should be clear enough that we mean "with CircuitPython". If not, we redirect folks in the help-with channel if they post general questions.

onyx hinge
modern wing
#

thanks @idle owl

fossil gorge
#

Need to drop off. Thanks everyone, and have yourselves a wonderful week!
blinkacomputer

onyx hinge
#

"All happy families are alike; each unhappy family is unhappy in its own way." -- there's something similar to this in software. All complicated software is complicated in its own way.

mental nexus
#

Thanks all!

modern wing
#

Thanks everyone ๐Ÿ™‚

onyx hinge
#

thanks everyone! thanks scott!

still zephyr
#

Thanks

marble hornet
#

Thank you everybody

cobalt grail
#

Stream on Friday, @slender iron ?

modern wing
#

50/50 here, which is acceptable for a single person using it

idle owl
modern wing
#

@slender iron After a week or two of using those Aide-Tek SMD parts cases, are you still ๐Ÿ‘ with them?

slender iron
#

100% I've been using them for longer than that

#

I just brought it up when I finally got around to putting a bunch of my stuff into them

modern wing
#

Gotcha -- I'll probably be getting some shortly, directly from the manufacturer. Same pricing (or cheaper), free shipping if you pay via PayPal, and cuts Amazon out of the equation. Thanks for showing them off the other week, I appreciate it.

slender iron
#

ooh! email support with the direct info

#

I bet limor would carry them

lone axle
#

I got one of those and loaded it up with many little sensors and breakouts. I'm totally happy with them as well.

modern wing
#

I'm thinking of getting a 2pack of their 96-count containers -- it's a variety of small, medium, and large all in one. I don't do that much with SMD, so that'll last me a long while. [famous last words, right?]

idle owl
modern wing
#

I've gotten to the point where I double up the count/capacity of what I think I'll need....and hopefully I'm not that far under-estimate.

idle owl
#

Good catch on OHS. I'll get it out of the template as well.

slender iron
#

I can look at removing it

idle owl
#

I mean we want it once we have an unstable release, but in the meantime, it's confusing.

slender iron
#

yup yup

#

I bet the update script can check to see if the new stable is a prefix of the pre-release

jaunty juniper
#

I believe it does

slender iron
#

it does already?

jaunty juniper
#

which is why I'm surprised

#
        for version in info["versions"]:
            previous_releases.add(version["version"])
            previous_languages.update(version["languages"])
            if version["stable"] == new_stable or (
                new_stable and version["version"].startswith(this_version)
            ):
                info["versions"].remove(version)
#

that part should do that (maybe)

slender iron
#

ah!

#

ya, that looks right

marble hornet
#

I do not see a define for checking if an object is None like #define MP_OBJ_IS_NONE. is none the NULL pointer?

slender iron
#

no, there is a static instance for None I think

marble hornet
#

How do you check if a passed mp_obj_t is the single instance? (idiomatically)

#

(probably what i should have asked instead of is it NULL ๐Ÿ˜…)

slender iron
#

mp_const_none

marble hornet
#

Thank you!

idle owl
#

@slender iron I think it's worth changing the description in the #help-with-circuitpython channel at this point. We highlight Codecademy every other newsletter, I think having something more applicable to the channel at this point is worth it.

#

I'll do it tomorrow.

slender iron
#

๐Ÿ‘ works for me

idle owl
#

But wanted to mention it while I was thinking about it

jaunty juniper
#

oh that's actually a bad loop: for x in list: list.remove[x] gets items to be skipped

slender iron
#

ah!

#

that'd do it

jaunty juniper
#

so when there's a new stable, we remove the old stable, which gets the unstable to be skipped in the loop, and therefore not removed

slender iron
#

right

#

sounds like you are working on a fix ๐Ÿ™‚

#

thanks in advance

jaunty juniper
#

yup ๐Ÿ™‚

manic glacierBOT
manic glacierBOT
jaunty juniper
#

the current files.json on circuitpython-org still needs to be cleaned by hand if we don't want to wait for the next unstable release

idle owl
#

@jaunty juniper Let me know when the PR is merged, and I'll mention it to Justin.

jaunty juniper
#

we could also change the test to compare < version numbers instead of version["version"].startswith(this_version) but that's only for edge cases, like if we do a 6.2.1 right now, I believe the RC would stay, since it doesn't start with 6.2.1

idle owl
#

@slender iron To pop the stack with the discussion from the meeting earlier - if _pixelbuf is smaller than adafruit_pypixelbuf (which I agree it is), why is _pixelbuf turned off for the smallest boards? Wouldn't it make more sense to have it turned on if it's smaller? Or I am misunderstanding something here.

#

Like QT Py M0 requires adafruit_pypixelbuf to use NeoPixel.

manic glacierBOT
slender iron
#

@idle owl we can't turn it on if we don't have space. the py version allows us to load it as-needed

idle owl
#

@slender iron Hmm fair enough.

slender iron
#

pypixelbuf should never be frozen in though

#

_pixelbuf should be used in that case

idle owl
#

It's too big anyway, so it's a non-issue.

#

But, understood.

manic glacierBOT
marble hornet
#

Okay, I know this isn't a question but I got a thing working!

Adafruit CircuitPython 6.1.0-rc.0-1351-g390295dd2-dirty on 2021-04-12; Adafruit Feather nRF52840 Express with nRF52840
>>> import capsuleio
>>> print(capsuleio.read())
None
>>> capsuleio.load("can you see me?")
>>> print(capsuleio.read())
can you see me?
>>> 
soft reboot
$(I hit ctrl-c then ctrl-d)
Adafruit CircuitPython 6.1.0-rc.0-1351-g390295dd2-dirty on 2021-04-12; Adafruit Feather nRF52840 Express with nRF52840
>>> import capsuleio
>>> print(capsuleio.read())
can you see me?
>>> 
#

And just realized it i did it on the wrong branch

tulip sleet
manic glacierBOT
jaunty juniper
#

I looked at packaging.version.parse, same thing

manic glacierBOT
slender iron
tulip sleet
#

I thought of a possible case, let me see if I can remember it. Maybe not... I guess unstable releases will always have a suffix.

#

I think it was like 6.2.1 and 6.2.11, where the prefix is not always before a '-'

#

we are already using semver anyway, so it seemed easy

jaunty juniper
#

like right now if we released a 6.2.1 without making a beta first, 6.2.0-rc.0 would not be removed (then again it should not be there in the first place)

#

but semver would take care of that

jaunty juniper
#

@idle owl it's merged

idle owl
#

@jaunty juniper Cheers. I'll mention it tomorrow.

thorny jay
#

How much of the BUNDLE FLY is what I described "in the weed" on February 10th, 2020: https://www.youtube.com/watch?v=UUogvZhp7tI&t=3810s
My description was limited to board bundle, but the use case describe going in the learn guide and downloading everything what you need in a single zip. ๐Ÿ˜‰

slender iron
manic glacierBOT
#

fireware: 6.2.0 release(any version after 6.0.1)
hardware: any esp32-s2 board
Test code:
import time
import board
import touchio
Atouch4 = touchio.TouchIn(board.IO4 )
touch5 = touchio.TouchIn(board.IO5 )
touch6 = touchio.TouchIn(board.IO6 )
touch7 = touchio.TouchIn(board.IO7 )
while True:
if touch4.value:
print("touch4 Touched!")
if touch5.value:
print("touch5 Touched!")
if touch6.value:
print("touch6 Touched!")
if touch7.value
...

manic glacierBOT
#

I noticed that the example code there uses

raw_data = json.loads(magtag.fetch(auto_refresh=False))

I added stream protocol support to json.load a while back to support memory-efficient large json document loads. Does magtag.fetch or some peer api return an object that implements circuitpython stream protocol?

usable like
raw_data = json.load(magtag.fetch_stream(auto_refresh=False)) if it does. This would prevent a round trip through a string allocation saving 328+KB of con...

marble hornet
#

@tulip sleet Is it generally okay to use mp_obj_t in the shared-module?

#

Or is that a "tell me your use case" kind of judgement?

tulip sleet
#

sure, if you need to, there's a lot of casting there back and forth. Try to find a routine that's like what you want to do.

#

you use mp_obj_t when you have an object whose type is not exactly known.

#

Use grep -r or ag to search a typical module implementation for mp_obj_t uses.

marble hornet
#

๐Ÿ‘

manic glacierBOT
#

First off, this Pr is not done and will need to change before it is ready.

Since this is my first significant change to the core, I'm not fully aware of what needs to change; I thought a pr would be the best forum to discuss modifications.

Goal

Add a module to the circuitpython core that allows a limited length string(1) to survive between supervisor reloads.

The proposed name for this is capsuleio. It can store some data in a "time capsule" that can be dug up between supervis...

manic glacierBOT
#

I do not think think this is a reasonable thing to do. Have you considered such boards as the QT PY? This will take 1/32 of its total memory. Probably many folks are running those right on the edge and 1kb would push them over the edge and unable to update.

What does the data sheet say on typical circuitpython boards w.r.t. program/erase cycles on the embedded flash, and whatโ€™s the typical cycle count on express board flash? I imagine if you take into account whatever load leveling is ther...

manic glacierBOT
manic glacierBOT
#

alarm.sleep_memory and microcontroller.nvm both provide persistent storage with a simple bytearray-style of storage. Rather than pass a string, arbitrary bytes is more flexible, though a bit less convenient. Anything can be converted to bytes. The API of those modules would be what to follow. This would be called supervisor.persistent_memory or something like that. (We need to think of a good name.)

@WarriorOfWire I have seen use cases of needing persistent storage and restarting som...

manic glacierBOT
#

I didn't touch 5,6,7but it return value is touched
If I changed the init order to 4,6,7,5,then 4,6,7 will return touched. so. only the lastouchpad can work.

ๅ‘ไปถไบบ๏ผš"Dan Halbert" @.>
ๅ‘้€ๆ—ฅๆœŸ๏ผš2021-04-13 20:50:08
ๆ”ถไปถไบบ๏ผš"adafruit/circuitpython" @.
>
ๆŠ„้€ไบบ๏ผšfredqian @.>,Author @.>
ไธป ้ข˜๏ผšRe: [adafruit/circuitpython] toupad doesn't work in esp-s2 (#4596)

I'm not sure what you're saying? Are you saying board.IO7 isn't working as a TouchIn, or something else? Are you tou...

#

Firmware

Adafruit CircuitPython 7.0.0-alpha.1-78-g37887c42a-dirty on 2021-04-13; Saola 1 w/Wrover with ESP32S2

Code/REPL

 import wifi

Behavior

Nothing appears in the REPL shell anymore.

However, it is still listening, as pressing CTRL+D makes the on-board LED go back from from white back to "flashing" green.

And Putty keeps the connection open and can reconnect to it perfectly fine, even if the REPL doesn't come back sti...

onyx hinge
#

yay! It's alive again. yesterday during the meeting I inattentively shorted GND, 3v3 and 5v together by mis-inserting an arduino shield 1 pin off (yeowch). I successfully found the small power supply filter inductor that bravely acted as a fuse, and bypassed it. sparky

#

(I also had a spare but this is good)

manic glacierBOT
#

There is a calibration problem. They are all reading some value, but some think they are being touched. Try this sample, and you'll see that the raw values change:

import time
import board
import touchio
touch4 = touchio.TouchIn(board.IO4 )
touch5 = touchio.TouchIn(board.IO5 )
touch6 = touchio.TouchIn(board.IO6 )
touch7 = touchio.TouchIn(board.IO7 )
while True:
    print("touch4", touch4.value, touch4.raw_value)
    print("touch5", touch5.value, touch5.raw_value)
    print("...
idle owl
#

When there's no SPI flash chip (e.g. non-Express board), does CircuitPython live in the same space as the lib and code files?

tulip sleet
#

they are all in internal flash, which is divided up between the CircuitPython firmware and the CIRCUITPY drive

idle owl
#

Ok, so that means, the more modules enabled in CP, the less space there is for CIRCUITPY? In this specific situation.

#

I asked yesterday why _pixelbuf wasn't enabled on small builds when it's smaller than the otherwise necessary pypixelbuf, and was told that we can't turn on _pixelbuf due to space restrictions. And after thinking about that answer, became confused.

tulip sleet
#

it's not a dynamic choice: on non-Express boards we allocate a fixed amount of space for CIRCUITPY. On SAMD21 boards it's 192kB for CPy and 64kB for CIRCUITPY. so everything, including _pixelbuf has to fit in the 192kB.

idle owl
#

Oh. Preallocated space.

#

Ok. I am not confused anymore.

#

It makes sense now.

tulip sleet
#

yah, if it were dynamic, then every time you loaded a new build of circuitpython, if CIRCUITPY changed in size, we'd have to erase it and reformat it, which would be a bad experience

idle owl
#

Ah.

#

Fair enough.

#

Another, tangentially related, question. How do I erase Neo Trinkey if there's no storage module.

#

Because apparently LED Animations is supposed to fit, and it's certainly not doing so for me. So I wanted to try again. (If the answer is something that takes more than 5 minutes to do, then skip it for now, as I was told to move on from this. I'm figuring this will come up though and wanted an answer.)

tulip sleet
idle owl
#

Oh good. Ok

#

Um...

tulip sleet
#

but it's not in 6.2

idle owl
#

Can we do a release? ๐Ÿ˜„

#

Yeah that.

tulip sleet
#

you can get absolute newst and it will be in there

idle owl
#

I'll grab whatever off of S3 for now.

#

Yeah that, lol.

#

It is not there. ๐Ÿ˜•

#
>>> import storage
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: no module named 'storage'```
#

Also related, is there a way to make it turn off the NeoPixels when you enter the REPL? Neo Trinkey has one status pixel, but four NeoPixels. So if you have code that turns on the LEDs red, for example, and then enter the REPL, one LED turns white out of four, the other three remain red. It was confusing me for quite a while. I imagine it would confuse others.

jaunty juniper
#

ah storage was added to the other trinkey boards

idle owl
#

Ah.

idle owl
#

Indeed. Ok.

#

It is perhaps by design. I wonder if the Trinket M0 erase file will work. I will test it.

#

It appears to work.

#

Still doesn't fit. Ok, actually moving on then. ๐Ÿคทโ€โ™€๏ธ

jaunty juniper
#

adafruit_led_animation ?

idle owl
#

Yes.

#

It's a bit big.

jaunty juniper
#

that's huge, it's like 47kB

idle owl
#

There are optimisations to be had, but we did not write it with that intention. And haven't had time to go back and do so.

jaunty juniper
#

the trinket has a 48kB drive

idle owl
#

Right, so in theory it should fit.

#

With nothing else ๐Ÿ˜„

deep saffron
#

Hello circuitpython folks! I am wondering how to get involved in circup development? I've found the github page, and am reading through the code and issues.
Are there other resources or meetings around this, aside from the github?

tulip sleet
#

@idle owl ok, my review was bad, i asked her to add it and thought she did

#

I once made a trimmed-down version of the animations library, removing some I didn't need

jaunty juniper
#

maybe remove some of the animations that don't make sense with only 4 pixels ?

idle owl
#

We don't want to support two versions of it.

#

Is the issue there.

jaunty juniper
#

yeah

idle owl
#

I can do it for myself, but it's not a good experience for a guide.

#

I'm able to copy some of them out myself, but I see that being a support nightmare if we suggest it to users in a guide.

#

Unless we can figure out a way to dynamically bundle individual parts of libraries. heh

jaunty juniper
#

that is what people often have to do to support adafruit_hid on trinket, removing the devices they don't use

idle owl
idle owl
#

If you find an issue you'd like to work on, comment on it, and then you can begin a discussion.

jaunty juniper
#

or if you have new code that doesn't match an issue you can make a PR and discuss it there

idle owl
#

Or file a new issue if you're not ready to PR!

manic glacierBOT
idle owl
#

@tidal kiln Ping me when you're around, I have a question about how you feel about whether something would turn into a major support issue or whether it's reasonable. No Canadian rock band. Thanks!

tulip sleet
#

@idle owl is _pypixel on in trinkey?

idle owl
#

Yes. As far as I know. Only NeoPixel is frozen in, and using the NeoPixels works without adding any libs.

idle owl
#

_pixelbuf is on, adafruit_pypixelbuf is not frozen in. To be clear.

tidal kiln
#

@idle owl hey. what's up?

idle owl
# tidal kiln <@!330227457296957440> hey. what's up?

Ok. So the Adafruit LED Animation library is large. But there are obvious use cases for it being used on smaller boards. We all have personally simply copied over the animations we wanted to use, and used them as such. But we've never suggested that to users anywhere official, e.g. Learn. Is it going to be a support nightmare to tell folks "Hey, just copy PART of this library over, only the parts you want to use, and then you can use it on any board."? I feel like you'd have a better feel for how this would play out support-wise than I do.

#

I mean, I guess it would mean documenting each part of the lib, saying "this is what this piece does" and then tell folks to pick and choose based on what they want to do with the animations, maybe? I personally see it turning into an issue where folks never copy over what they need, or they copy over parts of it, and try to run code that uses all of it. And the code will fail.

tidal kiln
#

"animations" = the code in the library's animation folder?

idle owl
#

Yeah, but also the stuff in the main adafruit_led_animation folder, not all of it is always needed.

#

So one could cherrypick from any of the available files.

tidal kiln
#

i think that would be worth a new page in the guide

#

"Using on small boards" or some such

idle owl
#

Right, I agree. But do you think it's even reasonable?

tidal kiln
#

with a guide page, probably. that's about the best that could be done.

idle owl
#

Ok

tulip sleet
#

i could conceive of adding a feature to the project bundler to specify individual files

tidal kiln
#

other than a magic refactor that doesn't require any shenanigans

idle owl
blissful pollen
#

You could also label that section of a guide as "Advanced" or something. Not sure if that will help with reducing support or not

idle owl
#

Which is to say, I don't think they've been used internally.

tulip sleet
idle owl
idle owl
#

I should have.

blissful pollen
#

Maybe two libraries? Core animations with ones like Solid/Blink and then dunno what to call it but another with the fancier ones?

tidal kiln
#

LEDs are the bestest most funnest!

idle owl
blissful pollen
tulip sleet
#

we have a similar problem with some very complete sensor libraries, which provide many features that often people don't need. they are big

manic glacierBOT
#

I just noticed this on 6.2.0 on a CPX with fresh (20210413) libraries, mic.record() hangs in a reproducible way under some circumstances. I tried a few things based on my first discovery of this. It looks like playing a wav file to the speaker does it.

Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit CircuitPlayground Express with samd21g18
>>>
>>> import board
>>> import audiobusio
>>> import array
>>> mic = audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DAT...
idle owl
tulip sleet
idle owl
#

Ok. I think we have multiple solutions here for the animations situation.

manic glacierBOT
manic glacierBOT
#

As it is, with the Neo Trinkey specifically, the non-status NeoPixels remain lit up if they were lit up from code in code.py when you enter the REPL. The status LED changes to indicate that you have entered the REPL. So, for example, if you had all four LEDs turned red in your code, and then entered the REPL, three would remain red, and one would turn white. This confused me as I moved onto something else and forgot I had entered the REPL - I figured out what was going on when I came back to ...

idle owl
#

Filed and pinged Limor.

manic glacierBOT
fossil gorge
#

Sounds like there may need to be some tree-shaking going on in circup or the new one (brain keeps yelling 'SUPA-FLY'), so shed any modules that aren't referenced from a library

#

Not now, but down the road somewhere

manic glacierBOT
#

API

alarm.sleep_memory and microcontroller.nvm both provide persistent storage with a simple bytearray-style of storage

@dhalbert That sounds like a much better interface, especially since that mirrors the literal, physical underlying hardware. I really like your suggestion of putting it with the supervisor namespace as the "time capsule"* should share the same lifetime.

<br>

@WarriorOfWire: Agreed 1k is not a reasonable amount of memory for non-full builds of cp. The .....

deep saffron
#

Re: circuitpython library slimming.
I've come across a related issue in specifying what resources get installed on which server. There are two approaches that might be helpful:

  1. Top-down specification of library resource groups or
  2. Bottom-up scanning of resource groups from libraries

With 1, someone would specify a collection of labels--tags that are over/around the library. A label has a definition, and corresponds to resources you can install. This might be just a subset of the library's files, or there could be some processing of the library itself. Labels can also have their own configuration/schema, and take in parameters that are processed to add more flexibility.

With 2, a scanning program can look at a library, and build a dependency graph from how different modules import and relate to each other. This gives you separable chunks, each associated with a module entry point.

Some combination of these two might let you say things like: "I want the library that is a subset of this library, created by starting with this file, and ignoring these other files or this function definition," or something like "What is the API/docs for the super-slim animation library?"

These interfaces can also be pulled up into a UI with labels/checkboxes. This is definitely an area where there's been lots of work, because compilers and resource bundlers cut out extra code and stuff to slim things down.

idle owl
#

All excellent ideas!

manic glacierBOT
#

@makermelissa If I remember correctly a bytes will work but doesnโ€™t avoid the large response allocation. Would want to push it all the way back to an object with a read(n) that gets the data from the network buffer e.g., some response.body type of thing. In that way you could deserialize the json as the bytes arrive, keeping your response buffer trim and a more polite memory footprint with small objects.

idle owl
#

@deep saffron Can you file an issue with that suggestion? Either on CircuitPython and I'll label it libraries, or maybe circup is a good place for it. Basically I don't want it to get lost on Discord.

#

I don't know where is best to put it, but we do have a Libraries label on the CircuitPython repo.

manic glacierBOT
#

I'm eager to have i2cperipheral supported on the Teensy 4.X with CircuitPython, so I can use two Teensy 4.1 units as I2C Responders on a very short I2C bus. I'd like to know more about how I and my organization can increase the priority or this issue and/or support someone working on it.

Just for background I'd also like to understand if it's not currently supported only because it's low priority or if it's because of issues with I2C in general on the Teensy 4.X.

deep saffron
manic glacierBOT
idle owl
#

@jaunty juniper If you're around, I have a question about what would need to happen to fix the circuitpython.org/downloads pages from having 6.2.0rc still showing up.

jaunty juniper
#

ummmm

jaunty juniper
idle owl
#

Oh hmm. Ok.

#

There's a link to rerun it.

#

For me ๐Ÿ™‚

#

But sometimes Actions likes to cling to old configs. ๐Ÿ˜•

#

I guess it can't hurt anything rerunning it?

jaunty juniper
#

I don't quite know

idle owl
#

Only one way to find out, I suppose. ๐Ÿ˜„

#

Rerunning.

jaunty juniper
#

knocking on wood

idle owl
#

It completed, but did not resolve the issue.

#

ยฏ_(ใƒ„)_/ยฏ

#

Was worth a try.

jaunty juniper
#

hmmm it didn't like it

idle owl
#

Said something about a missing log.

jaunty juniper
#

unable to post new file {"message":"_data/files.json does not match 1995bcdc1e8da34492446eb1008665e2dd0e213c","documentation_url":"https://docs.github.com/rest/reference/repos#create-or-update-file-contents"}

idle owl
#

Oh hmm.

jaunty juniper
#

whatever that means

#

maybe that I put a bug in the script ๐Ÿ˜ฌ

idle owl
#

Hmm. Seems more likely that it doesn't like rebuilding without a new release or something.

#

I'll be back in a bit, need to eat.

jaunty juniper
#

you can get the file by running RELEASE_TAG=6.2.0 DEBUG=1 python3 build_board_info.py > files.json on a checkout of the 6.2.0 tag (warning: there's 2 debug messages at the top of the file that need to be removed first)

#

and then manually edit it on the circuitpython-org repo

manic glacierBOT
#

Could you elaborate, please? What is the advantage of copying in and out of the safe place vs storing directly to the safe place?

It doesn't have to be pre-allocated and use up precious space in RAM if not used.

I have a somewhat better API idea:

Don't provide a fixed-size area but to instead just do something like supervisor.persisted_bytes = some bytearray or bytes. So it could be as large or small as you want. When the VM exits, the bytes are either left where they are (as des...

simple pulsar
#

Hi, did any of the pulseio code change for CPX between 5.x and 6.x? I've just noticed one of my IR sending programs doesn't function on 6.0.0 and 6.2.0 but does on 5.3.1

idle owl
jaunty juniper
#

I can do a PR with the updated files.json

idle owl
#

Oh!

#

That would be amazing!

jaunty juniper
#

oh and what I said wouldn't work actually, 6.2.0 doesn't have the latest version of build_board_info.py

idle owl
#

Good to know.

idle owl
#

Or perhaps a different way to ask the same thing is, are we still doing HID this way, or is there some newer way we'd rather do it.

#

I'll start with the simpler version and see where it gets me.

jaunty juniper
#

I'm doing some diff juggling to keep the download counts

idle owl
#

Ah nice. Thanks so much!

idle owl
#

Ok now I kind of get why it's so complicated on Learn. It's waiting for the release so it doesn't spam.

#

Which I now need to add.

#

@slender iron We need a notes doc for next week.

slender iron
#

ah! sorry

idle owl
#

No worries! I have a weekly reminder for it and it popped up, so I figured I'd share.

slender iron
#

thanks

#

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/10lckbM5mFHKpZLjH7k8IeSUo5t8Sa1rkoPA30iuOKDc/edit?usp=sharing

manic glacierBOT
#

As @neradoc pointed alarm.sleep_memory has the same functionality.
The main differences appear to be:

  1. It is port dependent and seems to only be supported on esp32s2 (stably that is)
  2. It is grouped with the alarm module meaning implementing it is paired to the alarm module
  3. It is fixed length where this could be dynamic length

Possible Solution

merge alarm.sleep_memory and capsule as a supervisor.saved_memory* singleton with a max length that is included in only fu...

jaunty juniper
#

ok, I have squinted long enough at diffs

orchid basinBOT
jaunty juniper
#

@idle owl ๐Ÿ‘†

idle owl
#

Thank you!

fossil gorge
orchid basinBOT
manic glacierBOT
#
  • Why limit the max length?
  • Why take ram away from devices whether they use the feature or not?
  • If you prefer, the previous 2 can be summed up as โ€œwhy does this use static allocation?โ€
  • supervisor.persisted_bytes was proposed as a name to use. I +1 that name.

@WarriorOfWire: Agreed 1k is not a reasonable amount of memory for non-full builds of cp.

This is not what I attempted to communicate - I intended to represent that statically allocating a buffer that will be rarely use...

#

I noticed my CPX was still on 5.3.1. When I upgraded it to 6.2.0 the IR sending stopped working, I could still see the IR flashing with the aid of a camera. Checked 6.0.0 and that's also broken.

I tried to pick up the signal at the IR diode with my (digital) SQ25 analyser but a few things conspired against me there. I duplicated the sending code and sent pulses to A2 too. That shows timing of the pulses is good on 5.3.1 and is all over the place on 6.2.0.

Good 5.3.1

2...

simple pulsar
# simple pulsar Hi, did any of the `pulseio` code change for CPX between 5.x and 6.x? I've just ...

I had a look with logic analyser on dupe code sending to A2 pad on CPX and the timing is way-off: https://github.com/adafruit/circuitpython/issues/4602

GitHub

I noticed my CPX was still on 5.3.1. When I upgraded it to 6.2.0 the IR sending stopped working, I could still see the IR flashing with the aid of a camera. Checked 6.0.0 and that's also br...

manic glacierBOT
manic glacierBOT
#

Would it be reasonable to merge that with the alarm sleep memory ?

  • implement this the way alarm.sleep_memory is implemented where alarm is available.
  • remove alarm.sleep_memory, and use this instead.
    The use case is similar: remember data when exiting and reentering code.py, without using the flash, reset on power cycle / hard reset.

The use case is similar, but the implementation may not be. In the deep sleep case, we go almost all the way to a reset. On some chips...

idle owl
#

@jaunty juniper ๐ŸŽ‰

#

@tulip sleet You around for a question? I have some code that works with two options and I'm not sure which one is better.

tulip sleet
idle owl
#

Ok, here is the code snippet, with both of the two options, one in the first section, one in the second section ```python
while True:
if touch1.value: # If touch pad 1 is touched...
while touch1.value: # Wait for release...
pass
keyboard.send(Keycode.SHIFT, Keycode.A) # Then send key press.

if touch2.value:  # If touch pad 2 is touched...
    while touch2.value:  # Wait for release...
        time.sleep(0.1)
    keyboard_layout.write("Hello World!\n")  # Then send string.
#

@tulip sleet Is it better to use pass or time.sleep() for waiting for the touch pad to be released?

#

Both work, seemingly the same.

tulip sleet
#

doing time.sleep will debounce

idle owl
#

Alright. That's what I had at first, but that's not what another example had, so I started to second guess.

tulip sleet
#

you may be lucking out that the bounce time is shorter than going around the outside loop, but I have had switches that bounce for up to 100msecs

idle owl
#

Ahhhh.

#

Ok.

#

So it's coincidence they work the same. Figures.

#

Alright, thank you!

tulip sleet
#

yeah, is this on a SAMD21?

idle owl
#

Yes.

#

Neo Trinkey

tulip sleet
#

yeah, you may see worse behavior on a faster board

idle owl
#

Ah ok.

tulip sleet
#

anyway, all set!

idle owl
#

So better to future proof my example by using time.

#

Thanks!

manic glacierBOT
idle owl
#

Could Arduino take any longer to update the board manager? Oi. Last time it took this long, I thought it was frozen and force quit it and borked the whole IDE. At least I know better this time, but gah.

#

Trying to figure out why an Arduino example works in a way that my CircuitPython supposed equivalent isn't. I mean I get why the CP version isn't working right, but I'm wondering how the Arduino example manages it. LED rainbows and taking touch input while running them.

manic glacierBOT
#

Thank you for re-framing your point and elaborating on Dan's. I now see how I miss interpreted both of your statements and guidance.
I hear you regarding statically allocating and how having the persisted data be any size tailors any cost involved not to the board or build but rather to the specific use case/call (?). That went right over my head for a bit: thank you for explaining.

I have a few questions to make sure I head in the right direction:

  • Would it make sense for the message s...
ionic elk
#

@tulip sleet what exactly does gc_collect_ptr actually do?

#

in the case of gc_collect_ptr(shared_alarm_get_wake_alarm()) say

tulip sleet
#

it marks that object and any objects it points to as not being garbage. It gets called indirectly from gc_collect() in main.c

manic glacierBOT
tulip sleet
#

when gc_collect() is done marking everything that is not garbage, it goes through the heap and finds the unmarked objects and says they are garbage and their storage can be reused.

crimson ferry
#

Where's the best place for an overall Learn Guide request, like can we put the I2C address in every primary learn guide on an I2C breakout and/or keep the I2C Addresses guide updated?

#

I can put feedback on each guide page as I discover it. I typically check the product page, the primary guide, then the I2C Addresses, and finally the library (maybe should just go straight to the library)

idle owl
crimson ferry
#

that would be awesome, thanks!

idle owl
#

Feedback on each guide is probably the best option. I'm not sure what happened to updating the I2C guide, but I will work on remembering to include it on new guides I write. (Please provide feedback on those guides if I forget! I see that feedback and try to deal with it weekly... except right now because newsletter. But that's an easy one I can fix even with the newsletter.)

crimson ferry
#

OK, I'll leave feedback on product guides, and the I2C Addresses guide when I find one

idle owl
#

I typically only put it in there if it's written on the silk, or included in the product page copy. But that's a bit lazy and I will work on being better about it.

#

Thanks!

crimson ferry
#

ah, the silk, of course :headdesk: I think it is usually there

idle owl
#

Not always!

#

It's often on the bottom, so by the time you're looking for it, it's already facing a breadboard.

crimson ferry
#

I'll focus on the I2C Addresses page, and go through everything on my desk that's not already there

#

that page is really useful for identifying conflicts (in advance)

#

my code tries to detect what kind of device based on I2C address

manic glacierBOT
#

We would store .persistent_bytes in the supervisor module dictionary, which we would make mutable. We would treat it similarly to the .wake_alarm attribute in alarm, whose module dictionary is also mutable. gc_collect_ptr() is called specially on the .wake_alarm object, for instance.
https://github.com/adafruit/circuitpython/blob/9a3f04a1b838988264a68c5d3c0e083a0c5c3163/shared-bindings/alarm/__init__.c#L204
I do not remember if anything is done with the heap when the VM is stopp...

jaunty juniper
#

that's the real genius of stemma QT breakouts: you don't put them on a breadboard, so you can read the address ! They thought of everything !

crimson ferry
#

I love the Stemma QT breakouts, I always forget to order enough 50mm cables though

manic glacierBOT
idle owl
idle owl
manic glacierBOT
#

I think others are better informed about the lifecycle of the Circuitpython init/teardown than me, though I do need an excuse to use this Segger. Iโ€™d love to see what Dan has to say there โค๏ธ
Also to be clear, I donโ€™t particularly care whether itโ€™s a copy or marked objects. My care is that users should only โ€œpay for what they useโ€ as far as ram goes and just about any dynamic allocation strategy will accomplish that.

ionic elk
#

@tulip sleet I remember seeing a discussion from you about your preferred terminology for when an alarm "goes off" vs "triggered", but I can't remember which was better

#

is alarm_time_timealarm_find_triggered_alarm an ok function name?

manic glacierBOT
manic glacierBOT
tulip sleet
manic glacierBOT
#

Yet another way of passing data to a program that has started would be via sys.argv, which is non-CircuitPython-specific.

That does remind me! I would like to have os.environ it's very often used for passwords and other secrets. https://github.com/adafruit/circuitpython/issues/4212

Does all of alarm need to be implemented at once? can just alarm.sleep_memory be implemented depending on the port?

No. The expectation is that individual alarm types may or may not be available on...

manic glacierBOT
manic glacierBOT
#

This PR suggests some changes to the internal structure of the Alarm module to fix some bugs with light sleep and hopefully make the sleep program flow easier to follow. Starting as draft so it isn't accidentally merged.

  • Changed shared_alarm_save_wake_alarm to take an alarm parameter. This means it can be called directly in Light Sleep to set the current alarm without an intermediary static variable, and it doesn't impact deep sleep in main.c since common_hal_alarm_get_wake_alarm/`...
ionic elk
#

@tulip sleet new draft PR is just for structural ideas I'd like to discuss before submitting the RP 2040 and Atmel alarm modules. It shouldn't hold up the existing NRF and STM32 modules, I can just merge them in.

manic glacierBOT
#

That does remind me! I would like to have os.environ it's very often used for passwords and other secrets. #4212

I presume os.environ would not persist between reloads ๐Ÿ˜‰?

I am more than willing to contribute (to the best of my ability) a "data past reload" functionality if it would be helpful.
Both persisted_bytes or sleep_memory sound good to me though keeping to one API sounds much better.
It looks like sleep_memory fits the same use cases as this so it doesn't sound like this i...

lone sandalBOT
manic glacierBOT
#

So need to pass stream=True in the requests.get invocation here https://gist.github.com/todbot/3d7b393e1b23095498d854fecfa901af#file-json_memtest-py-L22

and for that to actually work weโ€™d need to update the adafruit_requests library to do something with it (e.g., not receiving the whole response from the socket in the method) here https://github.com/adafruit/Adafruit_CircuitPython_Requests/blob/c55425e17842cce3ec0b34489133436c3e1a3898/adafruit_requests.py#L529
The stream parameter is pl...

manic glacierBOT
#

Since the original discussion goes back nearly a year, I wanted to confirm what we're expecting.
From what I understand, we want to replace at least the following instances of "CircuitPython" and "Adafruit CircuitPython" with "Python for microcontrollers":

  • [ ] REPL welcome line
  • [ ] The banner line of the help() command
  • [ ] The text written to "boot_out.txt"
  • [ ] Error or notification messages, such as the print_safe_mode_message() method in [safe_mode.c](https://github.com/a...
manic glacierBOT
#

@tannewt I'm not familiar enough with the internal structure of CircuitPython to help with that, but I could try to re-compile the firmware with the DEBUG=1 argument if that could help you or someone else.

<br>

I have also done a couple more tests and this issue seems to be also present on the official 6.2.0 release.
However, it seems like it is intermittent.

For the new tests, I tried reflashing the official firmware provided on circuitpython.org, and the REPL also froze when the...