#circuitpython-dev

1 messages ยท Page 376 of 1

tulip sleet
#

@idle owl we are all set with RTD now

idle owl
#

Excellent.

#

Best work is the work I don't have to do.

manic glacierBOT
manic glacierBOT
onyx hinge
#

oops that was on the wrong pull!

onyx hinge
lapis hemlock
manic glacierBOT
ornate breach
#

Is there a way to make it so the default download for my CP Sapling Revb is the 6.3.0 release and now the 7.0 Alpha?

#

I may have did something wrong on my copy for the revb

tulip sleet
ornate breach
#

ah, okay that makes sense

solar whale
#

@onyx hinge to run your parallel capture on the kaluga with an ov7670 -- did you add pullups to the ov7670? Your note i the code says it was unmodified. Or did you just add pullups to the SCL/SDA pins externlly.

onyx hinge
solar whale
#

I got it working with pullups

#

having some issue with the display

#

the image is split and does not use the whole screen - I wonder if I have a different version of the display board.

#

Are you using the one that came with the Kaluga?

manic glacierBOT
onyx hinge
#

The pull ups are on the audio board which is originally between the main board and the LCD board so if you remove that from the stack you will have to add your own

#

There are at least two versions of the LCD screen, probably you have the other

#

Though I may also have messed up the init code while preparing the example in the pr, I originally had it in a separate file

solar whale
#

ah - good to know about the audio board -- I'll put it back in. My display seem to have a different screen size -- I'm looking for some docs...

#

Still -- off to a great start!

#

Thanks for getting this going.

onyx hinge
#

Thank you for testing, it can be so helpful

solar whale
#

My pleasure -- I learn a lot from doing this.

#

Cool! it does work with the audio board and no pullups!

onyx hinge
#

Good to know

manic glacierBOT
ionic elk
#

@slender iron @tulip sleet who's the best person to talk to about the set-next-file stuff? I've finished reading all the context and I'm merging the PR with all the changes from main, but I have some questions/comments about how it's going to interact with deep sleep and what's acceptable in terms of non-volatile data storage

tulip sleet
#

since Scott is out for a while, you can talk to me. I have thought about it a little.

ionic elk
#

The particular thing I'm mulling over is the storage of stuff in sleep memory, because that's a feature that actually involves per-port hardware and is not always easy to implement - for instance, the RP2040 does not have sleep memory at the moment and I really don't know how I'm going to go about implementing it

#

Even in the case where we do use sleep memory, it becomes a case where Circuitpython starts absorbing resources that are normally user accessible. I could treat the storage of critical variables like next-file and exception-reason as a sort of mini-heap, that extends from the end of the sleep memory and reduces the available size?

#

But if a port doesn't have sleep memory implemented, or doesn't have sleep at all, is next-file a feature that could afford to have port-level not-implemented errors?

#

or do we really want to stress that it's universal, and make sure it's available at least through the heap methods no matter what?

tulip sleet
#

you can use the "storage_allocation" mechanism to reserve blocks of memory before the heap is allocated. It can reposition this memory in some cases, if that's necessary. I don't think it's a good idea to write to flash. You might look at the mechanism I used for boot.py to allow some variable-sized storage to live between VM instantiations. I save space on the stack, copy from the first VM up to stack array, and then back down to the next VM

#

I think sleep stuff is orthogonal to run-next. There are uses for it that have nothing to do with sleep, such as just switching between several main programs. E.g. start a menu program, choose what to run, and restart.

ionic elk
#

Thinking about it, I think my primary worry here is mostly just the RP2040, which should probably just get reworked to not actually reset on deep_sleep. It's causing a lot of problems and I think the justifications for it is fuzzy

idle owl
#

Is this something that can be turned into a list comprehension somehow? py for p in ports: if p.pid is not None: print("Port:", p.device, "-", hex(p.pid), end="\t") if p.pid == 0x8101: rotary_trinkey_port = p print("Found rotary trinkey!") break else: print()

tulip sleet
idle owl
#

Thanks.

tulip sleet
#

you could just do if p.pid: without checking for None explicitly, but for a beginner, maybe that check is better

ionic elk
#

@tulip sleet I would not be using flash regardless, the ESP32 and STM32 sleep memory is just low power ram that doesn't get erased by sleeping. But the relevance of sleep is that when a "sub-program" wakes up from deep sleep, you probably don't want it to return to the menu - you'd want it to restart the same program. But that can't be done with deep sleep unless set-next is stored either in nvm or the sleep memory sector.

ionic elk
#

Having programs that deep sleep force a return to a menu strikes me as possibly being a really big inconvenience to people - it basically would mean that sub-programs can't autonomously deep sleep at all.

tulip sleet
#

@idle owl also you are doing a break once you find the thing, so a comprehension is not a good choice, since you can't break out of a comprehension.

idle owl
tulip sleet
#

if you could store 32-64 bytes for the filename, that's good enough (maybe less)

ionic elk
#

I don't think I can guarantee 64 bytes of scratch register access across ports.

tulip sleet
#

the user might need to use some different mechanism them, like managing the restart themselves. So they do restart to the main program, and choose the menu item based on one byte in sleep memory, and then restart that immediately.

ionic elk
#

One option I haven't seen discussed is whether a set-next file could simply be stored as an index

tulip sleet
#

it could be some kind of index into the filesystem, but if the filesystem changes out from under you, bad things will happen. It would have to be cleared on any write

ionic elk
#

Is there a reason it needs to be stored as a string? Can't we just search the directory, sort it in a reliable way, and store the index of the file? Same with exceptions, just store an enum

tulip sleet
#

it could be anywhere in a tree of directories, not just at the top level. It's a pathname, not a filename

ionic elk
#

point taken. That could be a lot of repeated searches.

#

if you do it every time the fs is updated

tulip sleet
#

more likely, you could store some filesystem internal index into the directory metadata

#

you could just give up if the filesystem changes.

#

maybe you can just say that you can't use run-next across deep sleep, though i guess that might have been a strong motivation for this

ionic elk
#

But that still assumes storing it on the filesystem. The index approach would be to try and get the next-file to fit in a scratch register bank

tulip sleet
#

no, i mean like look in directory block nnn, and then look at an offset in there. It requires understanding the FAT structure

ionic elk
#

It's sort of the other way, you're saying that you can't use deep sleep in run-next programs, which doesn't sound great to me

manic glacierBOT
#

Going back to the 320x240 (as opposed to 240x320) but adding a 90 degree rotation to the displayio init gives me a full screen. I guess it is just something about this display.

Adafruit CircuitPython 7.0.0-alpha.3-55-g2cbdd18a2 on 2021-06-10; Kaluga 1 with ESP32S2
>>> 
>>> 
>>> import ov7670_test
320 240 320 240
fps 2.50424

full screen picture
![All Photos - 1 of 1 (3)](https://user-images.githubusercontent.com/15856834/121594601-4cfc8280-ca0b-11eb-8247-85f4b90c1eae.jpe...

ionic elk
#

It sets the precedent that programs called by run-next actually lose functionality

tulip sleet
#

so which chips don't actually support a meaningful amount of deep-sleep sleep memory now?

#

i.e., which ones can't preserve a small chunk of RAM?

#

special RAM or regular

ionic elk
#

STM32 and RP2040. STM32 just because I didn't get to it, but it should be easy. RP2040 because we decided to reset the chip with the watchdog after deep sleep, and it doesn't have a protected ram section for deep sleep because it expects all ram to be protected in deep sleep and we're deliberately sidestepping that.

#

Reminder that the the RP2040 deep sleep decision was because allowing the RAM to persist across deep sleep would require the enter_deep_sleep function to return, which is an API change with possible compilation consequences.

tulip sleet
#

RP2040 had lousy power consumption anyway on deep sleep?

ionic elk
#

No, it's pretty good?

#

Timealarm isn't great, like 5mA. But PinAlarms are 1.4mA of draw with the Pico, and maybe lower with a power-optimized PCB

ionic elk
#

I say "pretty good" in that it reduces power from the runtime state pretty well compared to NRF, which isn't performing very well in my tests.

thorny dove
ionic elk
#

@tulip sleet based on datasheet power it should end up around 180uA when using PinAlarm in dormant mode

tulip sleet
#

does it maintain RAM in that case?

ionic elk
#

It always maintains ram, there's no RAM off option at all

tulip sleet
#

and does a reset really clear RAM?

ionic elk
#

there is an even lower ram power state, which I don't use at the moment, and this reminds me I have to go back and do that

#

@tulip sleet yes

#

a watchdog reset fully resets the ram

idle owl
#

Ok, anyone have any idea where to begin troubleshooting this? It's CPython, but still. I feel like I'm missing something obvious. ```Traceback (most recent call last):
File "/Users/kattni/.virtualenvs/slidertrinkey/lib/python3.9/site-packages/serial/serialposix.py", line 322, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
FileNotFoundError: [Errno 2] No such file or directory: 'cu.usbmodem14241401'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/kattni/AdafruitDev/Slider Trinkey Code/ST_huebrightness.py", line 23, in <module>
trinkey = serial.Serial(p.name)
File "/Users/kattni/.virtualenvs/slidertrinkey/lib/python3.9/site-packages/serial/serialutil.py", line 244, in init
self.open()
File "/Users/kattni/.virtualenvs/slidertrinkey/lib/python3.9/site-packages/serial/serialposix.py", line 325, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port cu.usbmodem14241401: [Errno 2] No such file or directory: 'cu.usbmodem14241401'```

#

It's code that uses pyserial to talk to a Slider Trinkey. Should there be code running on the Trinkey or something? I wasn't given any associated code.py.

ionic elk
#

along with everything else on the chip except the scratch registers, and maybe even those because I still can't seem to get them to relay the wakeup cause properly

tulip sleet
#

@idle owl no /dev/ as a prefix to tty name?

idle owl
#

@solar whale Wrong channel.

idle owl
onyx hinge
#

@solar whale [responding to your message from another channel, probably there by mistake]

@Jeff E. (he/they) In Monday's meeting it sounded like you were all set to abandon the OV7670. Has it been given a new lease o life or is this just a temporary revival?
I was having trouble with the OV2640 so getting the OV7670 back out was a way to remove an unknown variable

idle owl
#

This is printed immediately before it @tulip sleet Port: /dev/cu.usbmodem14241401 - 0x8102 Found rotary trinkey!

onyx hinge
#

I was simultaneously trying to get the OV2640 register configuration AND the esp32-s2 parallel capture going

idle owl
#

And I can screen to that address and it works.

solar whale
#

@onyx hinge thanks -- sorry about the channel confusion

tulip sleet
#

isntead of p.name, there is another attribute you can use that's the complete pathname

#

hold on a minute, i'll look it up in a minute

idle owl
#

@tulip sleet p.device.

#

It worked!

ionic elk
#

I wish Discord had a bookmark function for stuff you want to remember

idle owl
#

That's what it's printing earlier, so I tried it.

#

Now onto another failure ๐Ÿ˜„

#

Thanks Dan!

ionic elk
#

so I could pin tech suggestions

onyx hinge
#

@solar whale getting back to configuring the OV2640 is probably next

lone sandalBOT
tulip sleet
#

@ionic elk the reason for a full reset is to get everything in a known state, is that right? Could we do that "manually"?

#

i'm not so worried about the NORETURN thing. That could be conditional compilation or something. I think we could figure that out.

ionic elk
#

@tulip sleet Yeah, I guess so. I don't know why it would be that urgent for deep sleep to get things into more of a "known state" than a regular reload or even fake deep sleep would do

tulip sleet
#

i think mostly reset pins and peripherals

ionic elk
#

that's done anyway, though, by the usual functions on reload

#

When you fake deep sleep, it still runs port_reset() and all that stuff

tulip sleet
#

yeah, so it's the NORETURN thing. I have to be afk for a while, but I think rethinking that issue is where to go

idle owl
#

It's the point of NORETURN.

ionic elk
#

All good you've been very helpful in thinking this through, I appreciate it

idle owl
#

Well it made me laugh. ๐Ÿ˜„

tulip sleet
#

you win discord for today ๐Ÿ™‚

idle owl
#

Achievement unlocked then.

#

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

tulip sleet
#

it is a perfect interjection

idle owl
#

Now can someone please go hit the button on my Hue bridge? It has to be pressed within 30 seconds of running the code, and unless I inherited something from Flash Gordon, there's literally no way for me to make it back from the basement in 30 seconds.

onyx hinge
#

can your cats help out?

idle owl
#

Hilariously, when you register it in the app, it shows a cat paw pressing the button in the app.

#

But no, they are not interested.

#

Brian will be home eventually. I'm being impatient.

ionic elk
#

program a Circuitpython to poke it

idle owl
#

lol. Overengineering 101.

onyx hinge
#

do you have a laptop you could take down to the basement instead?

ionic elk
#

Honestly having a generic thing-booper around the house would probably be handy

onyx hinge
#

๐ŸฅŠ

#

yeah take this

ionic elk
#

give it a little enclosure, have some offsets that could put it at angles, pair with a ziplock of Command strips...

onyx hinge
#

or can you temporarily move the hub to the area where you're working?

idle owl
#

Hmm not sure if it's portbound. We have a.... fancy setup.

idle owl
#

I guess I could de-couple the laptop from its life support system. I feel like that's more annoying than waiting though. So I guess waiting wins out.

onyx hinge
#

maybe if you put the thing inside this, and modify the claw to be the thing-poker?

idle owl
#

Home-claw-game for when you want to waste time not getting the thing you want in your own home.

ionic elk
#

I'm imagining a ESP32-S2 thing booper product now, give it a little silicon finger, WiFi access, rechargeable battery, time or trigger options...

onyx hinge
#

and paperclip attachment for those hard-to-poke buttons

idle owl
#

It being a finger seems a little uncanny valley, except in a dismembered sort of way.

#

But it's absolutely getting called the Thing Booper though.

onyx hinge
#

https://www.adafruit.com/product/3529 I wonder if these kinds of arms are rigid enough plus one of these https://www.adafruit.com/product/2776

idle owl
#

You can buy the material used in those arms separately. There were folks DIYing that setup.

onyx hinge
#

yeah under names like "loc-line" I think

idle owl
# onyx hinge yeah under names like "loc-line" I think

This is the same concept and would handle a solenoid bounce. https://www.quadhands.com/collections/all/products/quadhands-magnetic-arm-200

#

(I have a quadhands setup at all my workstations)

onyx hinge
#

ooh

solar whale
#

@onyx hinge thanks for all the work on the kaluga! Mine has sat on my shelf until now. Iโ€™m looking forward to using it. I did the sdk demos when I got it, but was not very excited about it. Using it with CP will be fun!

onyx hinge
#

@solar whale you should figure out how to upload the camera photos as a bmp over the wifi

#

to make a ... combination photo booth & doorbell?

idle owl
candid sun
idle owl
manic glacierBOT
#

I fully understand the problem of [not] having callback to save "event" taking place while the user code is doing something.

In the following PR #4877 you talk about gamepad that remember the event:

gamepad is different. It works in the background and remembers all the buttons that were ever pressed.

So maybe similar mechanism can be put in place to store what occurred and store reports (at least a few) for later processing.

Would that answer @ATMakersBill usecase and bypass the a...

idle owl
#

To everyone who contributes to the Community Bundle, there is a PR into cookiecutter to add a CircuitPython Community Code of Conduct. Please take a look at https://github.com/adafruit/cookiecutter-adafruit-circuitpython/pull/144 and provide any feedback as to what you would like to see. It is currently a barely-modified version of the Adafruit Community CoC, and will need some changes to work as a Community CoC, and I would appreciate any input you might have. Thanks!

candid sun
idle owl
#

Thank you for the feedback! Appreciate it.

#

Nobody's tested it yet but me, so thanks!

manic glacierBOT
#

@tannewt @ladyada ,

I have been emailing back and forth with Arduino about the TLS issues experienced between both languages. The issue seems to somewhat be corrected as of right now. The WifiSSLClient sketch that I run is now able to connect and retrieve the site data for a google search query over HTTPS. The oddity is that in the process of getting the code to work, I switched the access point I was using which no longer used '8.8.8.8' and '8.8.4.4' as it's DNS servers, and started h...

lone sandalBOT
manic glacierBOT
#

@jepler On my display, I found that if I uses the "standard" ILI9341 Init sequence then I get the full display filling the screen similar to what I get with the 90 degree rotation with your init sequence.
In your modification to in the init sequence, you are changing the MV and ML bits of the Memory Access control register from the defaults. Was that just trial and error for your display?

Also, why is the color depth in your example set to 65535 and not 65536? Just curious. It does not s...

onyx hinge
#

@solar whale I was trying to avoid using a displayio rotation, which is why I modified the MADCTL register, but evidently it doesn't work everywhere or my copypaste version of the script messed up. 65535 is just my mistake, I guess.

#

it might prevent "the whitest white" from showing properly

onyx hinge
#

(avoiding displayio rotation is PROBABLY superstition, except when using OnDiskBitmaps where it can affect performance extremely negatively)

manic glacierBOT
manic glacierBOT
#

Description

I was looking for ways to optimize some of my programs. It turns out that function calls and list comprehensions are pretty costly. Is there any syntax to do some inlining maybe?

Firmware

Adafruit CircuitPython 6.3.0 on 2021-06-01; Raspberry Pi Pico with rp2040

Code/REPL
Let's start with this, which runs at 41 Hz:

import time

def mul(x, p):
    return x*x*p

def vect(x):
    return [mul(x, p) for p in [2,3,5]]

che...
idle owl
#

Anyone have a Slider Trinkey and a Windows machine, want to test a script for me? I'm on a Mac and apparently it's not supported by the Python library this script uses. It's designed to use the Slider Trinkey to change your monitor brightness. Involves both CircuitPython and Python.

manic glacierBOT
#

When the code in the function is small, the overhead of the call becomes significant. Also you are avoiding storage allocation: you are no longer creating lists in your last example.

Try using monotonic_ns() instead of monotonic(), to avoid software floating point.

Python has never been particularly fast. If you try the same thing in CPython, you may get similar relative differences.

I'm going to remove the bug label because this is not a bug.

idle owl
#

Because the value the Trinkey is returning is 0-100 already.

#

This is going to be annoying to troubleshoot if it fails for you. It failed in my VM.

#

But I have 0 knowledge of the state of the Python situation in that VM. pip worked and so did python so there's something. But the code fails on import.

tulip sleet
#

i have to install python on my laptop ๐Ÿ™‚

idle owl
#

Ah fair enough.

tulip sleet
#

@idle owl it works! of course had to do:
pip3 install screen-brightness-control pyserial first

idle owl
#

Right ok

#

Good call, I forgot to include that in the Hue brightness example page

tulip sleet
#

I am using the python.org python installer, not the MS store installer. If I remember right, one installs as python3 and the other as python. Not sure about pip vs pip3

idle owl
#

I pip installed screen-brightness-control and it installed pyserial in my VM. But I won't trust that to work.

#

Ok

#

I usually say "pip, or maybe you need pip3"

#

or some such.

tulip sleet
idle owl
#

Right. Thanks!

tulip sleet
#

anyway it works fine once all the pre-reqs are there. screen-brightness-installer did not bring in pyserial when i installed it

idle owl
#

Oh ok good to know

#

Thanks, Dan. Really appreciate the assistance.

tulip sleet
#

you're welcome!

#

glad I did this on a really clean system

idle owl
#

Heh, yeah

still zephyr
#

Looking for suggestions to replace the word master for I2C, is Controller ok?

tulip sleet
#

we have been using "main"

#

main and peripheral

still zephyr
#

Thanks Danh, is to correct another learning guide (y)

manic glacierBOT
manic glacierBOT
crude blaze
#

I'm back trying to start a port for bcm2711, I thought the mpy port would be a good start but quickly realized that CPY differs hugely in terms of api and how the ports are setup. So I'm now trying to build a makefile from scratch to get the bare minimum working. The cpy makefiles seem to call a bunch of python scripts and I'm currently getting the following error, feeling like some variable might not be set correctly but not sure how to debug this.
make: *** No rule to make target '=', needed by 'build-PI4/genhdr/qstr.split'. Stop.
Full log: https://pastebin.com/j0rC0FNJ

onyx hinge
#

py/mkrules.mk:$(HEADER_BUILD)/qstr.split: $(SRC_QSTR) $(SRC_QSTR_PREPROCESSOR) $(QSTR_GLOBAL_DEPENDENCIES) | $(HEADER_BUILD)/mpversion.h $(PY_SRC)/genlast.py you have an incorrect value in one of these variables that qstr.split depends on. If you've added this in your Makefile, you can make print-SRC_QSTR to see the value in the SRC_QSTR variable, for instance: ```make

Print out the value of a make variable.

https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile

print-%:
@echo $* = $($*)

#

from there you can hopefully trace what is going on. If I had to make a totally random guess, you have multiline variables like ```make
A =
B
C
X =
Y
Z

#

(you can either leave the \ off the last line, or you can insert a blank line. Some favor having the blank line so that every line in a multiline variable assignment consistently has a backslash at the end, and when MODIFYING makefiles to add something to the end you don't need to also add the backslash to the previous line. This is a matter of preference, but if there's a prevailing style in CircuitPython we'd appreciate if you tried to follow it)

#

@crude blaze ^

crude blaze
#

thanks!

#

knowing where that comes from helps a lot already

onyx hinge
#

There are other ways it could occur but that's my best guess

crude blaze
#

looking at my makefile it seems to be all ok regarding multiline statements, both a blank line and no \ at the end of the last line in all cases

#

given that it is looking for a target named "=" that sounds like something doesn't get passed to that makefile maybe

#

anyway to find out what variable that could be that tells mkrules.mk to build target "="?
my knowledge with cmake is pretty basic unfortunately

#

like what is the command that is actually calling this makefile, the higher verbosity output is not really giving any clue about that. I'm guessing it must be somewhere in makemoduledefs.py?

#

all the variables used in the qstr.split target at least not empty, which is somewhat weird

onyx hinge
#

@crude blaze pastebin the full output of make -n -p and I'll look to see what I can see.

crude blaze
#

oh thats useful, was not aware you could do that ๐Ÿ™‚

onyx hinge
#

SRC_C += = $(wildcard *.c)

#

oh it's the extra "=" here

crude blaze
#

UGH, yes, thank you! ๐Ÿ˜„

onyx hinge
#

I'll leave all the hard parts to you ๐Ÿ™‚ you're welcome!

#

it's a fun project you've taken on

crude blaze
#

definitely! I hope

#

I will find enough time to see it through

#

at the very least I will learn a lot more about the cpy core

crude blaze
#

now I have the issue that it doesn't seem to link correctly against my cross compile toolchain. Complaining about standard headers like <stdint.h>. In this case being included in ../../py/mpstate.h so can't be an issue with code from the port.
Have I maybe missed something in the toolchain setup? I don't think I ever told it to look there for includes, the only thing being defined is the location of the toolchains bin/ directory set in path and the prefix for the compiler binaries

onyx hinge
#

I don't know.

crude blaze
#

ah yea no, this is from CPY not code related to the bcm2711

manic glacierBOT
manic glacierBOT
#

Firmware

All CircuitPython versions after :

Adafruit CircuitPython 6.0.1 on 2020-12-28; MakerDiary nRF52840 MDK USB Dongle with nRF52840

are installing and running fine on the nRF52840 Micro Dev Kit USB Dongle.
This is observed by checking boot_out.txt in the root of the CIRCUITPY drive.

However

Starting with version 6.1.0-beta 3 up to version 7.0.0-alpha.3 the comport for the REPL is not working anymore.
Trying to connect ...

manic glacierBOT
#

I just loaded 6.3.0

uto-reload is on. Simply save files over USB to run them or enter REPL to disable.

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

Adafruit CircuitPython 6.3.0 on 2021-06-01; MakerDiary nRF52840 MDK USB Dongle with nRF52840
>>> 
>>> 

7,0 alpha.3

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

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

Adafruit CircuitPython 7.0.0-alpha.3 on 2021-06-03;...
#

Thank you!
Great that this is not a common problem but most likely a configuration / code problem on my board.
Strange is only that the REPL-COM-PORT stopped working in CircuitPython after 6.0.1.

@jerryneedell How did you get the bootloader version 0.3.2 onto your board?
Did you update it yourself or was the board delivered to you like this?
Can you point me to a download link?

manic glacierBOT
#

Since your SD is already s140-6.1.1 you may be able to just use the update .uf2 https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/download/0.5.1/update-mdk_nrf52840_dongle_bootloader-0.5.1_nosd.uf2

I built the bootloader locally -- I cloned the repository https://github.com/adafruit/Adafruit_nRF52_Bootloader
I just updated it to the latest version 0.5.1-2

UF2 Bootloader 0.5.1-2-g881dac1 lib/nrfx (v2.0.0) lib/tinyusb (0.9.0-22-g7cdeed54) lib/uf2 (heads/master)
Model: ...
manic glacierBOT
manic glacierBOT
#

Just copying the different UF2 files didnot help and did not change anything.

Trying this:

C:\Users\frieh\AppData\Roaming\Python\Python37\Scripts>adafruit-nrfutil --verbose dfu serial --package mdk_nrf52840_dongle_bootloader-0.5.1_s140_6.1.1.zip -p COM26 -b 115200 --singlebank --touch 1200
Upgrading target on COM26 with DFU package C:\Users\frieh\AppData\Roaming\Python\Python37\Scripts\mdk_nrf52840_dongle_bootloader-0.5.1_s140_6.1.1.zip. Flow control is disabled, Single bank, Tou...
hearty tapir
#

Hi @analog bridge, I hope youโ€˜re doing great! I saw your enhancements on the Wi-Fi authmodes, but as per my understanding those also removed the ability to detect if a SSID has WPA-Enterprise or WPA3. Why would it be an enhancement to remove this detection capability?

manic glacierBOT
manic glacierBOT
analog bridge
scenic jetty
#

is there a porting guide or template port directory for adding a new architecture/board?

#

I am working on a port for the FPGA implementation of PyFive

#

I saw the litex port but was wondering if there is a base port template

scenic jetty
#

lemme see

#

well it is close but makes the assumption that your board is based on the samd series of processors

#

my target risc-v based and is closest to the litex port so I guess I can extrapolate

ember iris
scenic jetty
#

yeah micropython has a minimal port which is a good starting point

#

pretty sure that was the starting point for the lofive implementation of micropython

hearty tapir
crude blaze
manic glacierBOT
turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

58

Voice Channels

6

Members

29522

Roles

35

manic glacierBOT
scenic jetty
#

Thanks @crude blaze

idle owl
#

@tulip sleet Can Bluetooth 4.0 talk to CircuitPython? There's a thermometer I am thinking of getting that doesn't say BLE, but it says Bluetooth 4.0, which the internet indicates includes BLE, but I don't know how that works.

tulip sleet
#

we don't speak "Classic" Bluetooth. Could you give a link and maybe I could interpret the specs?

idle owl
#

Yeah give me a minute and I'll link you.

tulip sleet
#

4.0 includes both, yes, it's not a very useful name

tulip sleet
#

I have corresponded with Thermoworks about their thermometers. They require exchanging proprietary keys with their Bluetooth-enabled devices. It is BLE but we don't have access to it without signing an NDA.

idle owl
#

Ahhh. Bummer.

#

Ok.

tulip sleet
#

when I was looking for devices we could talk to they were on the list, but we had to give up because of that

idle owl
#

Yeah I sort of remembered that and wasn't sure why you didn't follow through.

#

Makes sense.

#

Now I want to go sign an NDA just so I can talk to it ๐Ÿ˜„

tulip sleet
#

they were more worried about cloning than about their own app. With an NDA they were happy to have you write an app, etc.

idle owl
#

Hmm. Wait, cloning what?

tulip sleet
#

that their thermometers would be counterfeited

idle owl
#

Oh!

#

Ok.

#

That makes sense.

#

Hardware related, not so much Bluetooth related.

tulip sleet
#

yeah, they already had a lot of trouble with unauthorized resellers, and maybe some counterfeting, I can't remember. They don't authorize sales through Amazon, for instance.

idle owl
#

Yeah I think I knew that. At least their shipping is quite quick though directly.

solar whale
#

hmmm -- just stumbled across an issue -- CircuitPythons print function does not recognize the argument flush. This causes some errors in the Fingerprint library example -- easy to fix and I've opened an issue, but should flush be accepted. I ran into this on a CLUE (nRF52840) have not tried other builds. yet...

onyx hinge
#

weird, it looks like it should work (in 7.0 at least) @solar whale

#
MicroPython 7.0.0-alpha.2-563-g35ee4add6-dirty on 2021-05-13; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> print("hi", flush=True)
hi
solar whale
#

mine is on 7.0.0 alpha-2

#
>>> print("hi",flush=True)
hi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument
>>> 
#

I can try latest

onyx hinge
#

hmmmm!

#

yeah file an issue

#

I assumed the problem was print() not knowing flush=, but it DOES, only the extra action it tries to perform doesn't work

manic glacierBOT
onyx hinge
#

@solar whale yeah by coincidence I had a clue in front of me as well .. so it's only SOME but we don't know the pattern yet. interesting

solar whale
#

nRF52840 is essentially an M4, no?

#

also failed on an STM32F405

#

and ESP32S2

tough flax
#

Is there a weekly meeting today? If so when?

tulip sleet
#

2pm et

tough flax
#

Thanks

idle owl
#

Hello, all! CircuitPython Weekly meeting is in ~1.5 hours - 11amPT/2pmET. If you'd like to participate, please remember to add your hug reports and status updates to the notes document (linked). Hope to see everyone there! <@&356864093652516868> https://docs.google.com/document/d/10z3OQ1_Pc-cmG-CodmMsbFaebYaV81JSUGb8Tl-ql5o/edit#

idle owl
manic glacierBOT
idle owl
#

@onyx hinge Do you have time to test my setup?

onyx hinge
#

sure I can jump in the voice channel @idle owl

errant grail
#

Thanks!

idle owl
old smelt
#

Lurking

modern wing
#

Lurking as well ๐Ÿ™‚

tough flax
#

Listening - no need to talk

turbid radish
#

Welcome Bill!

tough flax
#

Thanks @turbid radish - will be listening while driving shortly - just want to catch up... Unofficial Hugs to @tulip sleet for all the USB work he's doing!

thorny jay
#

listening...

lone axle
#

#circuitpythonparsec
Here's a quick demo on how fast and easy it is to get CircuitPython up and running on a board with drag-and-drop .UF2 bootloader firmware. Plus, the Project Bundle in the Learn Guide will get you the code, libraries, and assets you need in one single download.

*Please note: "The parsec is a unit of length used to measure th...

โ–ถ Play video
thorny jay
#

๐Ÿ•›

onyx hinge
solar whale
#

๐Ÿคฆ

#

Good luck @idle owl

#

50 -- that's not old....

errant grail
# solar whale 50 -- that's not old....

The clock traveled the globe as the family moved. The last move it was damaged to the point that only the whistles and gong were salvageable. It's had a difficult 50-year life.

solar whale
#

Sounds like a labor of love -- good luck!

errant grail
#

Thanks! It's been working for about a year now, but the whistle bellows are beginning to leak.

lone axle
errant grail
onyx hinge
#

there are at least 2 or 3 different displays that they ship with the kaluga. there

#

's no clear way to tell the difference without trying different init code

#

I've seen intermittent read errors on stm32 with sdioio but pretended I didn't notice it.

solar whale
#

Good to know -- they're back....

idle owl
still zephyr
#

Updated last thursday

#

Ok sounds good to me

onyx hinge
#

update-learn and breaking-change sound good to me

still zephyr
#

will do

thorny jay
#

Previous topic and the list of PR: "Adafruit_CircuitPython_HID" is there a "standard" way to replace the US Keyboard by something else. I think there are two tentative, one German and one French, but this will never catchup if there is no "infrastructure" or "indication" on the acceptable way to do that.

solar whale
#

We need a flag for "unintended consequences" ๐Ÿ˜‰

modern wing
#

Thanks everyone! Another meeting in the bag ๐Ÿ™‚

thorny jay
#

Looking forward for the video... to find the timestamp of my demo. ๐Ÿ™‚

onyx hinge
#

@thorny jay we can't add all the world keyboards to the single adafruit_hid package, because it would be too large. I think it would be possible for other keymaps to live in the community bundle, so that they were separately installable according to need. There is sure to have been previous discussion of this, so if I'm contradicting something previously said then I am wrong ๐Ÿ™‚

gilded cradle
#

Thanks

still zephyr
#

Thanks

thorny jay
#

Great!

thorny jay
onyx hinge
#

@thorny jay I see where you are coming from with that statement, but probably the US keyboard will remain where it is.

thorny jay
#

Well, the US keyboard take space too, if you are not using it. ๐Ÿ™‚ except if one can inherit from it to make another mapping more "light". Or I don't know, Adafruit could create the EN_UK keyboard and say: "This is how we believe internationalisation should be done..." and other can just copy cat and adjust the keys in separate library.

tulip sleet
#

the keycode names are chauvinistic in the USB spec and are based on the names of the keys on a US keyboard. that was part of my original motivation for including KeyboardLayoutUS in HID.

thorny jay
#

(I don't know how many difference there are between US and UK QWERTY keyboard.)

turbid radish
#

About a pound

thorny jay
# turbid radish About a pound

Sound like a joke, but I feel it is maybe right. (thinking about it, I wonder if they ever included the โ‚ฌ symbole... now it might be too late).

tulip sleet
#

we could factor out KeyboardLayout... and put it in a separate library. That's fine with me, but we need to think then about what to do about having a layout frozen in (or not) on the boards that do freeze an HID library

thorny jay
#

Well today, I switched to English keyboard for my code to work, because it does : emoji_code :

onyx hinge
#

keyboards are weird, sometimes you want to think of them as reporting the location of the keyswitches that are pressed (for instance, so that those particular 4 keys under your left hand move your character within a game -- americans call those keys WASD after their legends, but what's written on the keys is unimportant) and other times by the effect they should have in "standard programs" (such as inserting the letter written on the keycap itself if the key has "W" written on it)...

#

there's a related fallacy that maybe there are just a small number of different sets of legends that are ever written on the keys, and you might make a list of all of them as a short-hand

#

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/1YXO2yPKADI2fiEFZTl9ZOgK5pbE890KLIKCZVHq6GIc/edit?usp=sharing

idle owl
#

@tulip sleet I don't have time to try to figure this out on my own. Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity. FREEZE ../../frozen/Adafruit_CircuitPython_SimpleMath ../../frozen/Adafruit_CircuitPython_NeoPixel ../../frozen/Adafruit_CircuitPython_HID QSTR updated Traceback (most recent call last): File "/Volumes/circuitpython.git/circuitpython/ports/atmel-samd/../../tools/mpy-tool.py", line 1037, in <module> main() File "/Volumes/circuitpython.git/circuitpython/ports/atmel-samd/../../tools/mpy-tool.py", line 1022, in main raw_codes = [read_mpy(file) for file in args.files] File "/Volumes/circuitpython.git/circuitpython/ports/atmel-samd/../../tools/mpy-tool.py", line 1022, in <listcomp> raw_codes = [read_mpy(file) for file in args.files] File "/Volumes/circuitpython.git/circuitpython/ports/atmel-samd/../../tools/mpy-tool.py", line 776, in read_mpy raise Exception("not a valid CircuitPython .mpy file") Exception: not a valid CircuitPython .mpy file make: *** [build-adafruit_slide_trinkey_m0/frozen_mpy.c] Error 1 make: *** Deleting file `build-adafruit_slide_trinkey_m0/frozen_mpy.c'

#

Can you please help?

#

Was I supposed to update make or something?

#

Or mpy-cross?

tulip sleet
#

rebuild mpy-cross

#

it doesn't get rebuilt automatically

#

cd ..../mpy-cross; make clean;make

idle owl
#

Oh I didn't do make clean first just now.

tulip sleet
#

make clean may not be necessary, but sounds like it is

idle owl
#

@tulip sleet It worked without the clean. ๐Ÿคทโ€โ™€๏ธ

manic glacierBOT
tulip sleet
#

@idle owl I can fix up the formatting if you are too busy

idle owl
#

@tulip sleet I pushed it already?

tulip sleet
#

i was expecting a message here, for some reason, never mind

idle owl
#

I should have commented, apologies.

#

It doesn't show commits here.

tulip sleet
#

yeah, just my fuzzy headedness, np

ember iris
#

mind if I ask why you requested newlines between the aliased pins? Style guide adherence?

idle owl
#

Clarity.

#

Makes single aliased pins more obvious.

tulip sleet
#

that style is in my head

idle owl
#

Some boards have a bunch of aliases, etc. This board is a simple example, where, yeah there's only 4 things in there, so it's not bad. But to match what we do elsewhere, it should be the same.

tulip sleet
#

it's easier to double-check that aliased pins are truly the same

ember iris
#

I completely missed the file the edit was on, that makes a lot of sense now, thank you!

tulip sleet
#

i have made dozens of board pin defs, and have to triple-check them against the schematic. Anything that helps to catch copy/paste errors is good.

idle owl
#

You're welcome! Thank you for asking.

blissful pollen
#

Does someone offhand remember the function to sleep a few microseconds? Trying to debug something and want to introduce a delay on purpose

#

Ah its okay I found it (common_hal_mcu_delay_us(1)) for anyone else ever looking

steel granite
#

Hi everyone, I am porting circuitpython to SAML21, but I am problem with clock configuration and USB, apparently the clocks work but I can't get the USB to work, anyone have any experience with this?, thanks

tulip sleet
steel granite
fluid moss
fluid moss
#

Thanks ๐Ÿ™‚

blissful pollen
#

Funny I just ran into that error too! But didn't have a chance to look into why

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

a patch for folks who don't want to wait, latest builds fix bitbangio and you can read/write the SD card with SPI!

import os
import busio
import digitalio
import board
import storage
import adafruit_sdcard
import bitbangio

# Connect to the card and mount the filesystem.
spi = bitbangio.SPI(board.CLK, board.CMD, board.DAT0)
cs = digitalio.DigitalInOut(board.DAT3)
sdcard = adafruit_sdcard.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storag...
onyx hinge
manic glacierBOT
#

keypad module with Keys, KeyMatrix, and Event classes. The scanning is done in the background. Key transition events (pressed or released) are put on an event queue. Direct query of a key state, bypassing the queue, is also possible. Debouncing is done by scanning once every 20 msecs.

Also added a simple atomic locking mechanism that I needed, in supervisor/shared/lock.{h,c}.

Sample code scanning key-per-pin using a NeoKey FeatherWing and RP2040 Feather (D5 and D6 are the defa...

#

<div class="section" id="module-keypad">
<span id="keypad"></span><h1><a class="reference internal" href="#module-keypad" title="keypad"><code class="xref py py-mod docutils literal notranslate"><span class="pre">keypad</span></code></a> โ€“ Support for scanning keys and key matrices<a class="headerlink" href="#module-keypad" title="Permalink to this headline">ยถ</a></h1>
<p>The <a class="reference internal" href="#module-keypad" title="keypad"><code class="xref any py py-mod docutils litera...

#

I wonder if it would make sense to make those classes follow the iterator protocol

I thought about that, and would be willing to entertain it. But there might be use cases for not using an iterator. I was also thinking about future additions, including things such as:

  • next_pressed_event() -- skips released events
  • wait_for_event() -- does not return None;blocks waiting for a real event
  • next_pressed_key_num() -- skips creating an Event altogether, and just returns an...
#

Maybe it would also make sense to have a was_pressed method, like the Miro:bit has on its buttons: https://microbit-micropython.readthedocs.io/en/v1.0.1/button.html#Button.was_pressed

Or like gamepad, which latches. I think this is subsumed by the events, which are history. And the question is if was_pressed() clears the history, as it does in gamepad, what happens to the corresponding events, and does it clear history just for that key?

#

Or like gamepad, which latches. I think this is subsumed by the events, which are history. And the question is if was_pressed() clears the history, as it does in gamepad, what happens to the corresponding events, and does it clear history just for that key?

Right, initially there was only is_pressed, but then people would try to use it in their interactive applications and get annoyed that they missed key presses. The thing is, when the method is there for you to use, it makes it more ...

#

I thought about that, and would be willing to entertain it. But there might be use cases for not using an iterator. I was also thinking about future additions, including things such as:

  • next_pressed_event() -- skips released events
  • wait_for_event() -- does not return None;blocks waiting for a real event
  • next_pressed_key_num() -- skips creating an Event altogether, and just returns an int key_num. Maybe it's blocking.

These could be intermixed with fet...

steel granite
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
hollow token
#

@tulip sleet iirc, there is a standard absolute pointer tablet device that VM stacks have been using for yonks

#

supported natively by everything

#

as in KVM, VirtualBox, ESXI, etc have been using forever

manic glacierBOT
manic glacierBOT
manic glacierBOT
tulip sleet
#

@solar whale Your MICROPY_PY_IO comment is well taken; I think you deleted it but I'm not sure why. Yes, it is all a micropythonism, which until now I did not bother to figure out. It provides the io module, whose code also seems to provide extra functionality for stdin/stdout (maybe...)

manic glacierBOT
solar whale
#

@tulip sleet thanks. I deleted it because I realized I was still confused about the connection to UJSON vs JSON and wanted to understand it better.

tulip sleet
#

I think it's just that the json module depends on the functionality provided. I should have mentioned the reason for io in my own comment. So feel free to put it back.

solar whale
#

Will do.

manic glacierBOT
hollow token
#

wait, that one was a little too high up

#

I've also edited the comment

main furnace
#

I used cookiecutter to bootstrap my new widget for displayio-layout. Trying to merge an update but the CI fails:

Collecting Adafruit-Blinka
Downloading Adafruit-Blinka-6.10.2.tar.gz (136 kB)
ERROR: Could not find a version that satisfies the requirement adafruit-displayio-layout (from versions: none)
ERROR: No matching distribution found for adafruit-displayio-layout

https://github.com/rsbohn/Dexter_CircuitPython_Slider/pull/1/checks?check_run_id=2839218046

Do I need to change something in the CI configuration?

main furnace
#

(Guess I should run pre-commit locally first.)

tulip sleet
#

yes, do pre-commit install in your repo to have it run automatically

manic glacierBOT
main furnace
#

Had an error in my requirements.txt -- fixed it and passed all the CI checks. (Should have been "adafruit-circuitpython-displayio-layout").

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Hello makers,
Maybe I missed it but I couldn't find any way to use an ESP32-S2 board as a webserver with CircuiPython.
There is a library for the ESP32 throught SPI (adafruit_esp32spi_wsgiserver), I would very much like to have something comparable for the ESP32-S2, maybe in the wifi module of the ESP32-S2 port or via a dedicated library?
Thanks for your great job on CircuitPython and microcontroller support in general!

manic glacierBOT
idle owl
#

@tulip sleet Am I understanding how supervisor.reload() works in that there is no chance of it causing filesystem corruption if it's called in your code.py because it's happening at the CircuitPython level, not the microcontroller level?

tulip sleet
#

that should be ok. Interestingly I hadn't thought about this at all as a way to restart code.py -- maybe I forgot it existed.

#

(I saw the discussion in the other channel)

idle owl
#

Ok, thanks.

#

Right on.

onyx hinge
#

ah ... pylint gives different results locally than on github, because I have python3.9.

#

is there any convenient way to get older python versions on debian?

tulip sleet
#

one person says it's fine, the other says it's not ๐Ÿ™‚

jaunty juniper
#

I think pyenv was simple enough, once setup with the versions you want, you can pyenv local <version> in the directory to setup with that version

manic glacierBOT
#

Revised API:

  • EventQueue is factored out from Keys and KeyMatrix. If other scanners are added, they would use the same EventQueue.
  • The queue is not implemented as an iterator, because I anticipate possible future variations on next(), as mentioned above. next() is convenient enough.

Internally, the latest commits include some bug fixes, and simplify maintaining the list of active scanners.

</div>
<div role="main" class="document" itemscope="itemscope" itemty...

#

New combined example showing both key-per-pin and a telephone-style matrix:

import keypad
import board

km = keypad.KeyMatrix(
    row_pins=(board.A0, board.A1, board.A2, board.A3),
    col_pins=(board.D0, board.D1, board.D2))

k = keypad.Keys((board.D8, board.D9), value_when_pressed=False, pull=True)

STOP_EVENT = keypad.Event(1, True)

while True:
    km_event = km.events.next()
    if km_event:
        print(len(km.events), "events queued")
        print("matrix", km...
manic glacierBOT
idle owl
#

I'm also using Python 3.9.

manic glacierBOT
#

I suppose you can also disable gamepad once there is keypad?

That is the idea, so it would be good to know if the games you have written could be redone with keypad.Keys.

This is not a problem. The ugame.py has this abstracted away, so it's just a question of freezing the right code with the correct version. The only thing that I might worry about is if the code required is substantially bigger, and some game is on the edge of available resources, it might stop working โ€” but...

idle owl
#

@tulip sleet I know this has been asked and answered many times, but I'm asking it again (sorry). How are we referring to I2C parts in CircuitPython? I think one is peripheral, but I'm not remembering the other (can only think of central being associated, but I think that's specific to Bluetooth).

idle owl
tulip sleet
idle owl
# tulip sleet If you look in the Learn Guides, you see "I2C Main" and "Secondary", but I like ...

Hmm ok. I'm doing up the I2C template. So I can kinda call it what I want here and it'll end up in all the board guides eventually. I don't know why we didn't go with controller and peripheral. It makes way more sense than main and secondary. I get that main and secondary maintain the first letters, but it's not necessary like it was for MOSI and MISO. No one says "I2CM" and "I2CS" so those letters aren't really crucial.

tulip sleet
#

the guides that have Main and Secondary are older Tony guides and maybe they were changed very early in all this

#

I like Controller and Peripheral too. Sounds like a 6pm mtg q

idle owl
#

Good call. I was going to make an executive decision, but I suppose it's worth discussing.

#

Looks like Zephyr never came to a conclusion either.

manic glacierBOT
onyx hinge
#

@idle owl in my particular case, it was time.monotonic_ns being recognized locally but not in CI.

idle owl
#

Learn passed it, local did not.

onyx hinge
#

yeah the ways that pylint runs are subtly different --- library, library example, and learn all are a bit different, mostly on purpose

#

like the way we deal with the duplicate code check in examples .. which I'm a bit surprised hasn't affected learn?

idle owl
#

Yeah....

#

I think we pinned it on Learn.

#

Or we disabled it.

#

Pinned Pylint I mean.

#

And disabled the dupe check.

onyx hinge
#

okay

idle owl
#

Not sure though.

#

But that would make sense.

#

Because I have personally duplicated a ton of code. So I know other folks have as well.

#

@onyx hinge pylint==1.9.2. Oi. Yeah we pinned it.

#

duplicate-code is in the disable in .pylintrc as well though.

#

Which I can't remember if that ever worked like that. But eh.

onyx hinge
#

we've tried pinning it and not pinning it and they both make us unhappy.

#

so in libraries we do both !? -- repo: https://github.com/pycqa/pylint is pinned at 2.7.1, while the repo: local one uses whatever you have, or (in CI) what was installed by pip install --force-reinstall pylint Sphinx sphinx-rtd-theme pre-commit

manic glacierBOT
tulip sleet
hollow token
manic glacierBOT
manic glacierBOT
#

I kinda wish I could get a consistent snapshot of the state of all keys, e.g., as a bytearray. any chance of adding it?

It is stored internally as a vector of bools. I could just copy that out to a supplied MutableSequence. I'd probably ask you to supply it to avoid generating a lot of garbage.

What is the use case? events and pressed() are designed to avoid your having to write Python code to scan a vector.

manic glacierBOT
#

Maybe my thinking is fuzzy, but imagine I have a keyboard with characters & modifiers. When I see that "B" is pressed down, I need to find out if Shift was pressed at that same time or not, to see whether to transmit "B" or "b".

If I have a snapshot that is consistent from one point in time (or as close as you can get, given that maybe it takes a few ms to scan the matrix), then I can figure out which to do. I like the way that pressed() potentially frees me from tracking the state of Sh...

manic glacierBOT
#

Events would tell you that the shift key was pressed before or simultaneously with the letter key, which is what you want to know. If it were pressed afterwards, then the letter is not shifted. Yes, you will need to maintain a modifier state.

I see no problem adding another simple way to retrieve state.

The advantage of the events is that you don't have to maintain "is this still down?" information yourself. That use case is more like handling buttons on CPX, etc.

manic glacierBOT
#

The epoch has changed from 1970 to 2000 with the Micropython updates. Technically this is not a bug I guess, since the epoch in python is port dependent. It causes issues with existing libraries, like when they try to update the time from a unix epoch online.

It can be changed back in Circuitpython with MICROPY_EPOCH_IS_1970.
It can be tested in libraries by looking at time.mktime((2000, 1, 1, 0, 0, 0, 0, 0, 0)).
The time difference is NTP_TO_UNIX_EPOCH = 2_208_988_800.

manic glacierBOT
manic glacierBOT
#

Unix timestamps based on 1/1/1970 need to have 30 years removed from them (the exact number of seconds above, taking leap years and such into accounts). For example this code from a clock demo converting the NTP 1900-based given time into the 1970 epoch representation before calling localtime has to be updated:

def get_ntp_time(pool):
    packet = bytearray(48)
    packet[0] = 0b00100011

    for i in range(1, len(packet)):
        packet[i] = 0

    with pool.socket(pool.AF_...
manic glacierBOT
#

After filing issue #4886 where I finally bricked my board. I got two ItsyBitsy NRF52840 Express boards from a vendor in Berlin / Germany.

And to my surprise I can report exactly the same findings as with the nRF52840 Micro Dev Kit USB Dongle !

My INFO_USB.TXT looks like the following:

UF2 Bootloader 0.2.13 lib/nrfx (v1.1.0-1-g096e770) lib/tinyusb (legacy-755-g55874813) s140 6.1.1
Model: Adafruit ItsyBitsy nRF52840 Express
Board-ID: nRF52840-ItsyBitsy-revA
Date: Sep 25 201...
manic glacierBOT
manic glacierBOT
#

New routines added to Keys and KeyMatrix:

<dl class="py attribute">
<dt id="keypad.KeyMatrix.num_keys">
<code class="sig-name descname"><span class="pre">num_keys</span></code><em class="property"> <span class="pre">:int</span></em><a class="headerlink" href="#keypad.KeyMatrix.num_keys" title="Permalink to this definition">ยถ</a></dt>
<dd><p>The number of keys that are being scanned. (read-only)</p>
</dd></dl>

<dl class="py method">
<dt id="keypad.KeyMatrix.store_states">
<code...

solar whale
#

@tulip sleet FYI regarding Issue 4894, when it was originally reported as 4886, I was unable to reproduce it. All versions worked for me.

#

They got hung up trying to update the bootloader bu tI had no issues with any of the version of CP they reported.

tulip sleet
solar whale
#

I did have a newer bootloader than the as-shipped boards and I updated mine to the current release. Not that the issue should be related to tthe bootloader anyway...

tulip sleet
#

i don't think so, but ... I will put this on the 7.0.0 list

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Do you know how to do a bisect? That would narrow down what the issue is, if it does not also work with 7.0.0-alpha.3.

Yes, I do know bisect and the O-Notation effort of O(log N). But with low n-sample count log-n is nearly equivalent to O(n)

Anyways: I started with the current version 6.3 and when I realized that I got the same results as with the other boards.
Then I found that 5.x was working and then I tried 6.0.1 which worked for me before.

#

@ThomasAtBBTF Do you have a Raspberry Pi or some other non-Windows computer to try it on to try to further narrow the problem?

Sure I have a Raspberry PI but it is running OctoPrint for a 3D-Printer.

But I have s stable of FriendlyArm NanoPi Neo Air's running different Ubuntu versions.
Also I can revive a old MacBook to check if Versions of after CP 6.0,1 are working with for example MiniTerm....

But this does not answer the question what is different between version CP 6.0.1 and...

#

you dont need to update the bootloader, but you should be using the latest releases. did you try 7.0.0 alpha?

I will try 7.0.0 alpha next. But as I wrote in issue #4886 this version exhibited the same behaviour on the MicroDev board using version 7.0.0 alpha.

I don't want to put unnecessary work on you.

But I think you should investigate what changed after version 6.0.1 for the REPL-Com port.

#

you dont need to update the bootloader, but you should be using the latest releases. did you try 7.0.0 alpha?

image

I copied adafruit-circuitpython-itsybitsy_nrf52840_express-en_US-7.0.0-alpha.3.uf2
to my ItsyBitsy NRF52840 Express and got the same result as with any other version above CP 6.0.1

Sorry for my German "device manager output" but I think you can see what ...

#

@Red-M I will think about it, but the key numbers are already linearized when I store the states internally and pass them to the EventQueue, so I would have to do the reverse mapping anyway. I am trying to make the EventQueue applicable to any scanner, so it uses linear key numbers, not implementation dependent coordinates. The time to do the arithmetic is very small compared with everything else that is going on.

ember iris
# manic glacier

@tulip sleet This is an odd shot in the dark, and since it's more likely to be misleading than helpful I figured I'd ask here: Was circuit python 6.1 around the time that the german translation was having a lot of trouble fitting on some boards? Would there be a similar cause here?

tulip sleet
#

but that is the kind of good thinking that is helpful when debugging: "what is different here?", so I appreciate your thoughts

ember iris
#

Good to know, thank you!

tulip sleet
#

this shows you are good at debugging ๐Ÿ™‚

ember iris
#

Haha the compression of the translations and error strings is the way I want to try to contribute to the core code, so it was a forward thought in my mind

manic glacierBOT
#

@dhalbert If you don't have the indexes of the pins, that's fine then, I thought I would ask as I wasn't sure if you were able to just provide that data as it might be used during scans.

@deshipu
That's purely a human readable only solution and doesn't allow for easily checking if a map makes sense or other errors that might exist (map too short, map too long, missing rows or columns AKA allows injection of bad input data from a user (who might want to change the map, which then creates ...

#

Firmware

- Adafruit CircuitPython 7.0.0-alpha.3 on 2021-06-03; Adafruit QT Py M0 Haxpress with samd21e18
- Adafruit CircuitPython 7.0.0-alpha.3 on 2021-06-03; Raspberry Pi Pico with rp2040

Code/REPL

import time, usb_midi, adafruit_midi
from adafruit_midi.note_on import NoteOn
from adafruit_midi.note_off import NoteOff
midi = adafruit_midi.MIDI( midi_in=usb_midi.ports[0], midi_out=usb_midi.ports[1] )
while True:
    midi.send(NoteOn("A4",10))
  ...
#

And here the content of the boot_out.txt after the update:
Adafruit CircuitPython 7.0.0-alpha.3 on 2021-06-03; Adafruit ItsyBitsy nRF52840 Express with nRF52840

I also tried CP 6.0.1 and CP 7.0.0-alpha.3 on the computer of my wife with a fresh installed PUTTY.
The results were the same as on my "old" Windows machine.

What I noticed between CP 6.0.1 and CP 7.0.0-alpha.3 that the COM port changed on the computer # of my wife.
So there must be a difference after CP 6.0.1 on the i...

manic glacierBOT
manic glacierBOT
manic glacierBOT
hollow token
#

@tulip sleet Loving that keypad lib for 7.0!

#

Much hype

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

hmm, I think it is related to # 4440, it probably got too long and not responding. I am trying to troubleshoot it again to see if I could figure out something. Please be patient

No problem, I will be patient.

Good news, after tons of trying, I seems to found a fix,it is indeed race condition within nRF5x USB DMA. The issue depends on the timing of usb command sequence from host, and it is coincidence that it only happens with windows driver (not Linux). I will need to do a prope...

manic glacierBOT
#

Wow, this was fast and required very little patience on my side!
The firmware.uf2 in the above zip-file works for fine for me on my windows machine.

Thank you very much for sharing your test-build.

Great, thanks for testing, please continue to use that for awhile to see if there is any side-effect, I will wrap up the fix with PR. It could take a day or so. It would be great if you could give more feedback after a few days of usage :)

onyx hinge
#

huh we use the sdk libm on nrf, not the micropython libm. not sure it matters, but the micropython libm is probably smaller

tulip sleet
manic glacierBOT
manic glacierBOT
#

A typical read-only property object in shared-bindings looks like this:

const mp_obj_property_t keypad_keys_num_keys_obj = {
    .base.type = &mp_type_property,
    .proxy = {(mp_obj_t)&keypad_keys_get_num_keys_obj,    // getter
              MP_ROM_NONE,                                // setter
              MP_ROM_NONE},                               // deleter
};

There are a lot of these kinds of properties in the native modules, several hundred right now, so about 1200...

manic glacierBOT
manic glacierBOT
#

@hathach is there anything in recent TinyUSB changes that might have caused this? I will also look at the USB descriptors, which may have changed inadvertently when I did the dynamic USB descriptors in 7.0.0. Thanks.

There has been too many changes to tinyusb, I did fix an MIDI buffer overflow recently, maybe there is other buffer issue with MIDI as well. I will test this out

manic glacierBOT
onyx hinge
#

I was just noticing that the CI builds PDF documentation. Do we use PDF documentation for CircuitPython?

#

OK, merge 1.16 got through the "test" build this time, yays.

manic glacierBOT
manic glacierBOT
#

I saw #4899 and took a stab at implementing it.

This concentrates on some specific properties that are probably in the most constrained builds. (OK, about half the files were not on trinket m0 builds...) However, it's not enough yet to give a net savings.

Building trinket_m0, here is the change in code size so far:

Baseline: 3760 bytes free in flash
New code: 3516 bytes free in flash (+244 vs baseline)
Using it: 3580 bytes free in flash (+176 vs baseline) (-64 vs new code)

...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@jepler tried this in #4901, without a net gain on small builds. My original suggestion above was to create new property types corresponding to the contents of the .proxy array. Each type takes about 60 bytes, I think, and then the code has to check for these.

The point of the multiple types is to encode what slots are in the proxy array. I thought of some other ways to do this that might take less code space. These ways do not require creating new property types.Unfortunately there are ...

manic glacierBOT
manic glacierBOT
#

The latest commits separate out the pypi upload the mpy-cross s3 upload and use setuptools_scm to generate the version string which is the same utility used by circuit python libraries.

I have successfully tested both dev and stable uploads using this branch: https://github.com/FoamyGuy/circuitpython/tree/foamyguy_test_stubs which had a modified package name that included my username.

I think once pypi credentials are added to this repo these actions should begin working to upload the s...

manic glacierBOT
#

The principle is that the "less frequently used" fields of a type object are placed in a flexible array member; this flexible array either has 0 (hopefully the usual case) or 1 member. The new flag indicates whether the flexible portion of the structure exists.

Fields that reside there (plus 2 that I decided NOT to move after starting) are now hidden behind accessors in most cases; where the verification had already been performed somewhere else (you could tell because there was no NULL-p...

manic glacierBOT
#

Here's how I estimated which fields were used most. The sed takes the ranges of lines within an mp_obj_type_t definition, and the awk prints the first field of each. sort | uniq -c counts unique instances of each one, then sort -n puts them in numeric order.

Here I've manually removed the lines which are just noise, so your local results will differ.

$ git grep -l 'mp_obj_type_t .*= {'  | xargs sed -n '/mp_obj_type_t.* = {/,/;/p' | awk '{print $1}' | sort | uniq -c | sort -n
...
manic glacierBOT
#

OK, here's one way to work towards compatibility:

  • Change the declaration of an extended slot to look like
     const mp_obj_type_t mp_type_bytes = {
         { &mp_type_type },
         .flags = MP_TYPE_FLAG_FULL,
         .name = MP_QSTR_bytes,
         .print = str_print,
         .make_new = bytes_make_new,
         .locals_dict = (mp_obj_dict_t *)&str8_locals_dict,
         .ext[0].binary_op = mp_obj_str_binary_op,
         .ext[0].subscr = bytes_subscr,
         .ext[0].get...
manic glacierBOT
#

FYI, I've got about half of an i2c library now:

Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Feather nRF52840 Express with nRF52840
>>>
>>> import board
>>> import adafruit_sps30.sps30_i2c
>>> i2c = board.I2C()
>>> spsi2c = adafruit_sps30.sps30_i2c.SPS30_I2C(i2c)
>>> spsi2c.fw_version
(2, 2)
>>> spsi2c.read()
{'particles 40um': 51, 'particles 10um': 49, 'pm10 standard': 6, 'pm100 standard': 9, 'pm25 standard': 8, 'particles 25um': 50, 'particles 100um': 51, 'particles...
manic glacierBOT
manic glacierBOT
#

I've brought this up to date with the Main branch and removed the use of goto. Tested on a Feather M4 Express, works as expected. There are a couple of remaining questions I have before it gets merged:

  1. Are we trying to reduce this API before merging, to avoid having to reduce it later and cut functionality? If so, what elements are in question?
  2. Related to the above, scanning the discussion, I don't see a clear consensus on why someone would want RELOAD_ON_ERROR to be true. This ...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I know @dhalbert has suggested a change like this, but I couldn't find the issue to tie it to. Credit goes to him for the concept.

@tannewt has been talking for years about shrinking these type objects. I'm not sure I actually ever mentioned the technique you are using. In days of old I saw complicated union-like types when passing arguments with varying parameters, but not the split technique with pointers you have adopted.

onyx hinge
# manic glacier

@tulip sleet so much for my recollection, maybe it was Scott..

tulip sleet
#

I remember saying something about using flag bits to indicate what follows. But I don't remember either of us suggesting the pointers to separate blocks thing.

#

I think you may have come up with that yourself, or it seemed obvious to you when we were discussing it

onyx hinge
#

It's still all one block, the "flexible array member" is present in memory right after the initial fields of the object

tulip sleet
#

oh, I thought it was a pointer, due to the double curly-braces. I didn't look closely

#

it is a pointer?

#

i need to read the code ๐Ÿ™‚

onyx hinge
#

struct _mp_obj_type_ext ext[]; The "ext" field is a flexible array. A short type has no items in ext[], while a full type gets 1

tulip sleet
#

i thought there were multiple such things, because,say, parts A,B,C, were all optional, so you might have just A, A and C, B and C, etc. But it is just there or not? In that case, I did suggest that, sort of

onyx hinge
#

Yeah there are just two kinds of type structure with my change, the full and the short; the short becomes the default, because it was a great way to make sure everything that needed to be changed became a compile error.

tulip sleet
#

the stuff I had seen in the past was exactly that. There was a flag of what was optional, and then it was all mashed together, and unpacked sequentially. This was when PDP-10's had 256k words of RAM, so we were always thinking about saving space

#

ok, then, I claim a little credit ๐Ÿ˜†

onyx hinge
#

anyway, it works, but I think we (I) need to find the best syntax and one that accomodates implementations that prefer NOT to split the type objects .. and then we should probably at least get upstream to say they're interested in taking something like this before we dive in and do it ourselves.

#

having two type structs with matching initial fields may be better than the optional fields; it would make the changes for namedtuples (which follow the type object with their own additional fields) a little less unnatural.

tulip sleet
#

i agree, maybe it's just a (slightly horrible) macro

onyx hinge
#

I had fun on a saturday and that's what counts. ๐Ÿ˜œ

tulip sleet
#

i notice you did not try the awful "pointer masquerading as an integer" thing

onyx hinge
#

I'm not sure how it would have applied here

#

if you're being serious you should tell me more

tulip sleet
#

i was awake at 3am Sat morning thinking about this, so I just write it down, and then the bug gets transferred to your ear from mine

#

my thing was only about how to encode variable-length proxies, nothing about variable-length type objects

onyx hinge
#

properties?

tulip sleet
#

the .proxy object: getter/setter/deleter

onyx hinge
#

ok yeah we're talking about the same thing then

tulip sleet
#

that was unrelated to the split type objects

onyx hinge
#

I'll let you do that one .. hmm .. The property type did end up being a small type, interestingly enough

#

saving about 32 bytes for each of those two new types

tulip sleet
#

so the +244 or whatever for the original multiple property types was not all code; the new types were a significant chunk of that

onyx hinge
#

yes if I said code I probably meant flash

tulip sleet
#

anyway what i said is way less general that what you did, and is more pervasive and better. you just said firmware size

onyx hinge
#

having just one property/proxy type would be very nice also because it speeds up the "check if it is a property" path which is probably a hot path

tulip sleet
#

yes, I was thinking of that too. I could just try 1. from the comment above and see what savings there are on small builds (which is where it's critical). 2. would be twice that minus some extra code

#

anyway my reason for all this was to try to get the keypad code back in at least some of the SAMD21 builds

onyx hinge
#

it's like going through the couch hoping to find enough change that you can see a movie

#

(which is probably a thing that does not occur anymore)

#

probably you shold introduce a macro for producing these objects, so it is easier to try out alternatives

stuck elbow
#

you might find an old bitcoin wallet...

#

in your backups

onyx hinge
#

the raw number of declarations you have to tangle with is pretty small when your "target" is trinket_m0 (say)

#

I actually did own some crypto but I 100% divested back in April. I'm confident I don't own any now.

#

it's not how I support my lavish lifestyle ๐Ÿคฃ

stuck elbow
#

I just thought that was the equivalent of the couch search these days

#

sooner or later the samd21 will have to be left behind

tulip sleet
#

yes, limor says that

#

not that it's not useful, but that it simply cannot have the functionality we would like it to have

stuck elbow
#

I wonder if it would make sense to drop the translations for it at some point

onyx hinge
#

or even use the new no-error-messages build setting

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

58

Voice Channels

6

Members

29623

Roles

35

ornate breach
#

Ohh getting close to 30k ๐Ÿ™‚

timber mango
#

Hi I'm using an UM feather S2 togehter with a Adafruit RFM95W LoRa Radio Transceiver Breakout - 868 or 915 MHz - RadioFruit for my lora project and deep sleep (with circuitpython) because I'm using lipo batteries. This works fine. My preferred solution would be to use circuitpython/deepsleep with my Adafruit Feather M0 with RFM95 LoRa Radio - 900MHz - RadioFruit feathers. Is there a technical reason, why this feathers doesn't support circuitpython deepsleep? Using C as to my knowledge here deepsleep is supported, but my whole solution GW etc. is bsed on python, so I don't want to change all this stuff to C.

stuck elbow
#

The reason is that this hasn't been finished yet.

timber mango
#

So I think in the near future the feathers will support it. This is important for me, because I have a bunch of this feathers and using it, I would be able to reduce the form factor of my sensors. Any ideas when it is supported?

tulip sleet
#

Someone is actively working on sleep on ports other than ESP32S2. But we don't do schedule promises, because too many things can go wrong.

One other important thing is that the SAMD21 ("M0") ports are very space constrained, particularly the non-Express boards like the Feather RFM boards. So it's quite possible sleep will NOT be supported on those boards for space reasons.

#

The nrf and ESP32S2 board have the best sleep implementations right now

manic glacierBOT
timber mango
#

mmh ok I understand, my thx

tulip sleet
#

doing anything of size on the integrated RFM board is unfortunately a very tight squeeze, as you may have discovered already

timber mango
#

ok so I think I will go on with my UM feathersS2 ๐Ÿ™‚

tulip sleet
#

@ionic elk thanks for that draft sleep power consumption page. We can talk about whether to wait for further work on the RP2040 (changing the reset behavior) before doing sleep. If we release something that doesn't really save power, I think we will get a a lot of support blowback, so my inclination is to wait.

manic glacierBOT
#

@dhalbert the only effect of the change on the RP2040 would be to enable Sleep Memory. The global change would be to remove "NORETURN" keyword from the API, which I think might be better tracked separately. Using PinAlarm on the Pico improves life on a 1000mAh battery from a day and a half (27mA) to about a month (1.4mA) on a board that isn't optimized for power, so I'm not sure why we'd want to toss the work on this PR.

tulip sleet
#

ah, I see the comment above. I thought it was not really sleeping at all

ionic elk
#

@tulip sleet it reduces power from 27mA to 1.4

#

Oh, no, I guess I got that across wrong. Basically the RP2040 is annoying because it enters low power modes but has special RAM that doesn't lose power even when in the uA range

#

Even when you "power down" the RAM, which I'm not even presently doing, it still doesn't lose data

tulip sleet
#

so what we -really- need is a new board with an external RTC clock, then you could really get it down to uA

ionic elk
#

yes

#

I'd have to put a board-level preprocessor flag to activate it, ofc

tulip sleet
#

is that pin even exposed on any boards now?

#

or can it be any pin?

ionic elk
#

I think it can actually be any pin.

#

or maybe any RTC pin?

#

might be a subset

tulip sleet
#

I wonder if an RTC featherwing would provide the signal we need

#

how slow can it be?

#

1 sec?

ionic elk
#

1Hz

#

yeah

#

I wasn't sure if we wanted to put in a weird API thing to support it though

tulip sleet
#

if we have to, we have to. It could be an optional arg or some chip-specific addition to alarm

ionic elk
#

Yeah I have a bunch of those laying around. I could try it

tulip sleet
#

we can mention it in 1pm mtg

#

if you are attending

ionic elk
#

When you use TimeAlarm as it's implemented now, it's 5mA

#

which is real good for light sleep, but pretty mediocre for deep sleep

tulip sleet
#

maybe ExternalTimeAlarm ๐Ÿ™‚

#

though that sounds like PinAlarm

#

i think maybe an extra required pin arg or something

ionic elk
#

I mean if you're using the DS3231 you might as well just program it with an alarm and use PinAlarm

#

that's what I do for my alarm clock

manic glacierBOT
#

Firmware

Adafruit CircuitPython 7.0.0-alpha.3-57-g683304fd3-dirty on 2021-06-19; Adafruit ItsyBitsy nRF52840 Express with nRF52840

Code/REPL

From the ble_keyboard example, I copied this code to my tester and created BRAILLE_HID_DESCRIPTOR based on code that works for OSX over USB.


hid = HIDService(hid_descriptor=BRAILLE_HID_DESCRIPTOR)

Behavior

Traceback (most recent call last):
  File "code.py", line 46, in 
...
idle owl
#

<@&356864093652516868> Meeting in ~15 minutes! Please include notes in the notes doc if you plan to participate, or want to include notes if you're not making the meeting. See everyone there! https://docs.google.com/document/d/1YXO2yPKADI2fiEFZTl9ZOgK5pbE890KLIKCZVHq6GIc/edit

blissful pollen
#

lurking (2nd shot day +1, no major symptoms but didn't get to updating the doc)

idle owl
modern wing
#

Congrats on the shot, the finish line for being fully vaccinated and maxinated is just a short distance away ๐Ÿ™‚

old smelt
#

Lurking.

fossil gorge
#

Lurking and listening in, enjoying the company while trying to get sqrt(-1) things done

slender iron
manic glacierBOT
supple gale
#

Listening. ๐Ÿ‘ˆ

fossil gorge
#

Pretty sure that means Kattni's now the Git Rebase de facto expert! ๐Ÿ˜‰

manic glacierBOT
thorny jay
#

Problem with rebase... is that even if you succeed once, you are not sure you will succeed again (at least that is the case for me). ๐Ÿ‘

fossil gorge
#

Congrats on the PyOhio talk!

idle owl
#

Thanks!

#

@trim elm Add your name to your In the Weeds topic, if that was you. That way we can turn it over to you when we get to it.

trim elm
idle owl
#

@errant grail I'm now picturing you having decade-themed sections in your house.

ionic elk
#

@slender iron API for your review: sleep_memory_reserve_for_system will grab memory starting from the end of the sleep memory block. It will shrink the size of the memory reported by get_length. If this conflicts with user reserved memory, a runtime error will be reported. If the user later attempts to reserve system memory, a different runtime error will be reported, which notes the system reserved some extra memory. Also would add set, get, and free routines for this "system block".

fossil gorge
#

And thanks to that comment, I can't get the image of a new-wave neon blacklight decorated bathroom out of my head. ๐Ÿ˜จ

errant grail
trim elm
#

Ooh that's really cool

slender iron
idle owl
#

CircuitPython Day 8/6/2021!

fossil gorge
#

2021/08/06

thorny jay
#

What about the calendar from Digikey?

#

It was wrong!

ionic elk
#

@slender iron We could, but that means we have to set an actual limit on the amount of memory to reserve. If it's dynamic, we can support next file strings of any length.

thorny jay
#

Maybe we can celebrate twice!!!

idle owl
#

You're always welcome to celebrate CircuitPython!

fossil gorge
#

How do you send a PR to a calendar?

ionic elk
#

Not that next file strings are probably going to be that long, so it's not a big deal if we do it statically. But we'd need to decide on how long they should be.

slender iron
#

I wonder if you code store a file number instead of name

#

does FAT have a consistent file number?

#

I guess that'd be tough to make stable

ionic elk
#

@slender iron I pitched that, but the issue with indexes is that the sub-programs could be nested

silver tapir
#

Not sure if I'll be able to organize the latinamerican version of blinka -day because of the house thing, but I'll try to find someone who can and help as much as I can.

ionic elk
#

@tulip sleet had comments to the effect that it would be pretty dangerous

slender iron
#

kk. I think 64 or 128 characters would be plenty

silver tapir
slender iron
#

I'd bias towards over reserving the space in case we want to use it for something else

ionic elk
#

@slender iron I think that's fine, at least on STM32 the sleep memory is like 4k so 128 of that is not a really big impact

idle owl
modern wing
#

Another meeting in the bag! Thanks y'all!

silver tapir
slender iron
#

I may do 512b then

thorny jay
#

Is the the shortest meeting since a long time?

slender iron
#

ya, probably. I think our meetings get shorter during the summer when folks are gone

ionic elk
#

@slender iron at that point it does feel like it's cutting into user memory quite a bit for a feature that could be kind of rare...

slender iron
#

using sleep memory is rare too

ionic elk
#

Yeah it's hard for me to judge that

gilded cradle
#

Thanks

errant grail
#

Thanks!

thorny jay
#

So far I have used 1 byte of sleep memory...

#

And there is a guide that does that for the MagTag.

onyx hinge
#
   4096 bytes used,    4096 bytes free in 'RTC Slow Memory' out of 8192 bytes (8.0kB).
thorny jay
#

alarm.sleep_memory[0] = selected # ... so the first byte

onyx hinge
#

"You aren't gonna need it"[1][2] (YAGNI)[3] is a principle of extreme programming (XP) that states a programmer should not add functionality until deemed necessary.[4] XP co-founder Ron Jeffries has written: "Always implement things when you actually need them, never when you just foresee that you need them."[5] Other forms of the phrase include "You aren't going to need it"[6][7] and "You ain't gonna need it".[8]

#

I'm going to sign off and get the meeting video uploaded & stuff. ๐Ÿ‘‹

thorny jay
#

Is this "in the weed"?

onyx hinge
#

This is post-meeting

thorny jay
#

Maybe it is deep dive?

#

Sorry, soccer time here. ๐Ÿ™‚

onyx hinge
#

ah a good time of year

#

last week I saw BEL do very well in a game against RUS, but I haven't followed since then...

#

was that last week? anyhow, last time I was watching soccer that was the game

idle owl
#

@onyx hinge I deleted the transcoding section - we've all been skipping that and it's been fine. Thanks for thinking about the notes.

blissful pollen
onyx hinge
#

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/16nG56rv4MQlL4aoAd1B1IGLTNUuWtWuGYIobBSX9Vag/edit?usp=sharing

#

@idle owl I also added a step to say to make the old notes document view-only, which I've been trying to do. there was a concern that bots would come by and vandalize them all someday, otherwise ..

idle owl
#

@silver tapir I disconnected you from the voice channel to avoid any surprises.

manic glacierBOT
idle owl
#

@still zephyr We can find a time this week to discuss PRs if that works for you. I'm considering who else to involve, so I don't want to set an exact time yet, but I wanted to check in.

still zephyr
#

Yes let me know I will be available @idle owl

ionic elk
#

@tulip sleet @slender iron should I put the new sleep and next file related stuff I'm working on into the existing PRs we have, or make new ones/one big new one? If I put sleep memory API changes into the existing RP2040 alarm PR and next file PR, it'll scatter them around... maybe it'd be better to have all the "next file deep sleep compatibility" stuff in a single, new PR?

#

And just merge the current RP2040 alarm and next-file PRs as they are, since they both work, they just ignore this particular feature combination.

#

Or I could append it all to the current next-file PR, and just put off merging the RP2040 until next-file is finished and merged.

#

The todo list is the sleep memory API changes + integration, STM32 sleep memory, and RP2040 sleep memory.

slender iron
#

@ionic elk I think another PR is the better option

manic glacierBOT
manic glacierBOT
#

Thanks for taking on this merge!

Please delete ports/zephyr, ports/rp2, ports/esp32 and ports/esp8266. We have our own ports and the extra folders confuse folks.

I delete tests/multi_{net,bluetooth} too since we don't use it.

We may want to delete tools/mpremote as well. I don't think it'll work with CircuitPython and I doubt we want to support it.

#

looks like we got 403 from PyPi:

Uploading circuitpython-stubs-7.0.0a4.dev82.tar.gz

  0%|          | 0.00/8.94M [00:00<?, ?B/s]
  0%|          | 8.00k/8.94M [00:00<03:14, 48.2kB/s]
  3%|โ–Ž         | 264k/8.94M [00:00<00:08, 1.14MB/s] 
 17%|โ–ˆโ–‹        | 1.55M/8.94M [00:00<00:01, 5.50MB/s]
 79%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‰  | 7.06M/8.94M [00:00<00:00, 21.2MB/s]
100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 8.94M/8.94M [00:00<00:00, 9.60MB/s]
NOTE: Try --verbose to see response content.
HTTPError: 403 Forbidden from https://uploa...
#

Yeah, nice! I had this idea for a long time as well, and is part of the reason for adding the .flags member to mp_obj_type_t.

I wanted to do a full analysis of how frequently certain slots were used, and then write some code to search for the optimal separation into "standard" and "full" types. I also thought about having multiple flags, or even a count, to say how many extended slots there were. Eg sort the slots on how frequently they are used and then the count says how many are ...

slender iron
#

through email. only 45 tabs todo

#

gets a snack

manic glacierBOT
#

When it runs it does print a bunch of other unrelated files, many things that are in the circuitpython repo, but not stubs specifically.

If you unfold the stubs step here: https://github.com/adafruit/circuitpython/runs/2879766210?check_suite_focus=true

it seems to take a second to load. For me it's a giant blank section for a while but eventually gets filled in if I scroll around a bit.

It does list many files that are unrelated to stubs:

...
creating circuitpython-stubs-7.0....
#

Thanks for taking up work on this! Iโ€™m embarrassed about dropping the ball. Iโ€™m busy right now but Iโ€™ll try to at least take a look at your changes.

No problem! We know folks don't always have time to contribute. We're happy to pick it up. You got it very far!

1. Are we trying to reduce this API before merging, to avoid having to reduce it later and cut functionality? If so, what elements are in question?

No, I don't think so. It's an advanced API so it can have all of the op...

fluid moss
#

Hey @slender iron I saw you just merged this one: https://github.com/adafruit/Adafruit_CircuitPython_ST7735R/pull/22
I looked into it further and I don't think my proposed (and merged) fix is correct.
The default init seq is in bgr mode, and the bgr argument was previously setting "not bgr mode".
But by me changing it to set bgr mode, as the argument name suggests, now there is no way to unset bgr mode (ie. rgb mode)
I think the proper fix is to rename the arg to rgb, and put the value back as it was.
By default you get bgr, and if you pass in rgb=true, you get rgb mode.

slender iron
#

@fluid moss ah, feel free to make another PR. does anyone use the existing bgr arg?

fluid moss
#

I think I should. I have a few different TFTs to dust off and test with. Both newer IPS and older active matrix (white plastic shell).
None of the Adafruit branded ones though.
I'll make a PR, and add some more tests and photos

slender iron
#

๐Ÿ‘ thanks! we can also revert that one if you like

manic glacierBOT
manic glacierBOT
manic glacierBOT
lone axle
#

looks like the pypi upload of stubs succeeded in an actions run this morning! We can now install the stubs much easier than before ๐ŸŽ‰

pip install circuitpython-stubs --pre

Once the next release is made the --pre won't be needed unless you want dev builds.

It's working great with PyCharm. If any VSCode users have a chance to give it a try I'm interested to know if it's working in that app as well.

manic glacierBOT
onyx hinge
#

@lone axle that is great news! I may have some refinements, I'll tag you to look at them if I get it ready.

manic glacierBOT
#

@tannewt I understand that. If someone could, however, just make a solution for the stm32f405 feather to change at boot.py, that would allow for your products (feather gps + feather stm32) to be compatible. I view that as different from working on changing all of the boards' capabilities just for the feature. I realize there's a lot going on and that still may not be a priority though.

I know next to no C, but if I manage to solve anything on my own, I'll submit a PR.

#
  • so that excess files are not included in sdist, perform build down in circuitpython-stubs
  • This means we need to
    • Remove the need-pypi check
    • Copy a setup.py, README, and MANIFEST.in into the stubs build location
    • Revamp how the overall mypy --strict check lists its inputs
  • Add a new test that actually installing the stubs lets us do type checking (tools/test-stubs.sh)
  • Add a missing return type to a __init__ function (why was this not an error under `mypy --str...
manic glacierBOT
#

@brentru I sent an email to arduino last week in regards to adding the root cert, but have not heard back. I'm not sure if this is because they closed the issue ticket that I originally filed for the https issue...I may have to reopen a new ticket, not sure.

I know that from prior experience using the Seeed Wio Terminal in the Arduino IDE, I would have to manually add the root cert in my sketch for proper HTTPS comms to whatever site I was trying to communicate with. I have not had the...

still zephyr
manic glacierBOT
manic glacierBOT
idle owl
#

@lone axle Where do you install the stubs? I run everything through virtual environments, but I'm not sure I want to have to start PyCharm out of a venv every time. Do you simply install them on your system?

lone axle
#

Thus far all of my testing has been inside of a virtual environment. But for longer term usuage I will likely install it into my main python instance.

idle owl
#

But to use it with a virtualenv you would have to start PyCharm out of that virtualenv, right?

#

Or how does that even work

lone axle
#

Inside of pycharm you can select your python interpreter on a per-project basis. and I believe it saves the selection inside of the .idea folder so that it can load the same way next time.

idle owl
#

Ohhhh.

#

That makes more sense.

#

Thanks! I'm eager to test this out, but don't want to bork my system etc.

#

But it sounds like we've got it in a state where I could add it globally and be ok

lone axle
#

inside File -> Settings and then select your project on the left. Then into Python Interpreter:

idle owl
#

Right, got it.

lone axle
#

I do think it should work fine globally. The only possible gotcha that I know of is that circuitpython uses lots of different names (one for each of the modules that exist). I don't know whether there are any conflicts with existing python libraries but if so it may not like having both installed at once.

idle owl
#

Ahhh. Yeah.

#

Fair enough.

lone axle
#

like if there were a different unrelated library named digitalio or something.

idle owl
#

Right. I understand.

#

I can see that.

onyx hinge
#

@lone axle @idle owl related to that, we avoid shipping stubs for modules that are also in desktop python (like time) so if you get hints about time.monotonic it is about the "standard" time module rather than the CircuitPython one.

idle owl
#

Oh. Nice.

onyx hinge
#

I think users are going to love this, but also will notice places where it is not 100%. For instance, it does not know what board.D1 is...

#

(because there's just one set of stubs, but whether or not there's a board.D1 is specific to each board)

#

(I guess we could publish 200 circuitpython-stubs-<boardname> packages on pypi ... blinkakeyboard )

lone axle
# onyx hinge I think users are going to love this, but also will notice places where it is no...

I was thinking about the stubs for board a bit as well actually. I wonder if it would be possible / make sense to try to include all possible pin names inside the stubs for board It wouldn't get any data associated with those pins so it wouldn't know anything about them other than that they exist. I think that would be nice though because it would allow the IDE to realize that it does exist.

#

perhaps other things that get attached to board as well like board.DISPLAY

onyx hinge
#

You may also be able to write an "I know what I'm doing" type annotation in your code, d1 : microcontroller.Pin = board.D1 to guide it

#

and yeah it's true we could have a "superset of all boards" board/__init__.pyi. Right now it gets SPI(), I2C() and UART()

slender iron
slender iron
manic glacierBOT