#circuitpython-dev

1 messages · Page 396 of 1

tulip sleet
#

@slender iron @onyx hinge: @ornate breach started on 7.1.0 beta.0 release notes, and I am completing that. I should be able to do a release soon, maybe even tonight. Anything else you want to get in?

#

I don't mind doing a beta release late in the week.

onyx hinge
#

but it's not a released board so maybe it's unimportant

tulip sleet
#

yah definitely, I just saw it. That's easy

#

Do you want #5551?

onyx hinge
#

no

tulip sleet
#

then I think this is easy. I will wait for #5570. Taking a walk now anyway, so it's not imminent.

onyx hinge
#

I'm not sure it's a good idea anyway, and it errors in the build (for uninteresting reasons) and whatever we do should be applied to wavefile as well

#

enjoy your walk

slender iron
#

I don’t think I have anything either

manic glacierBOT
solar whale
idle owl
#

wait...

#

Yes.

#

Woah, thought for a second I was looking at a different update we did recently. Too many updates 😄

dusk mauve
#

Spent a few hours figuring out power usage testing methods with a PPK2 and a MagTag. Generated some potentially useful data, figured I'd share it here:

https://github.com/fivesixzero/circuitpython-experiments/tree/main/magtag-esp32-s2/power-testing

Most interesting bit for me in this first test was a more-than-double increase in idle power usage (~29 mA to ~79 mA) after importing wifi but before doing a connect. After the connect idle was back to normal-ish, aside from spikes I'd expect from keep-alive activity, etc.

If anyone has any suggestions for improving my methods or code, or things that might be worth testing, let me know. I'll probably be tinkering with this a bit more this week. 🙂

crimson ferry
#

wow, it's incredible how many pages of compiler errors you can generate by leaving off a semicolon

manic glacierBOT
solar whale
idle owl
manic glacierBOT
manic glacierBOT
hoary moat
idle owl
manic glacierBOT
#

I took the library, put it in the Circuit Python/frozen folder, and did make, but the following error occurred.
Is there anything else I need to modify?

circuitpython/ports/raspberrypi$ make -j4 BOARD=raspberry_pi_pico
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
FREEZE ../../frozen/Adafruit_CircuitPython_BusDevice ../../frozen/RP2040-HAT-CircuitPython
fatal: no tag exactly matches '30049537445f72f555c8835b21f2bb07ba97...
#

In the latest main, this code:

import traceback
try:
	print(5/0)
except Exception as ex:
	traceback.print_exception(ex, ex, ex.__traceback__)

Results in:

code.py output:
Traceback (most recent call last):
  File "code.py", line 5, in 
TypeError: tb must be of type traceback

While this code:

import traceback
try:
	print(5/0)
except Exception as ex:
	print(ex.__traceback__)

Just hangs, forcing a reset.
Tested on Raspberry pico. Seems to come f...

lone sandalBOT
onyx hinge
crimson ferry
#

station is on/enabled (started) by default, not AP (though the netifs for both are init'ed)

#

you can disable wifi when not needed wifi.radio.enabled = False ...trade-off is how often you re-enable it, it takes a burst of power when re-connecting to do a new (implicit) scan, etc

#

ah, I see @dusk mauvedid that in Phase 7 🙂

onyx hinge
#

I didn't read it all but it seemed quite thorough.

crimson ferry
dusk mauve
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 7\.1\.0\-beta\.0
orchid basinBOT
#

Automated website update for release 7.1.0-beta.0 by Blinka.

New boards:

  • seeeduino_xiao_kb
  • pycubed_mram_v05
  • pycubed_v05
  • microdev_micro_c3
  • adafruit_feather_esp32s2
  • adafruit_feather_esp32s2_tft
  • ai_thinker_esp32-c3s
  • lolin_s2_pico
  • challenger_nb_rp2040_wifi
  • challenger_rp2040_lte
  • melopero_shake_rp2040
  • jpconstantineau_pykey60
  • odt_bread_2040
  • adafruit_kb2040
  • solderparty_rp2040_stamp
  • swan_r5
crimson ferry
#

@dusk mauve Just a small note on the code.py: wifi.radio.ap_info takes a moment sometimes to become valid after a connection. The definitive way to know that your station is connected to an AP is whether you have an wifi.radio.ipv4_address (that's how the common-hal code defines "connected")

dusk mauve
crimson ferry
#

I'm not sure, some of it is opaque (to me, at least) since it's deeper down still. And I'm pretty sure there are chunks of Espressif code that are not open source.

dusk mauve
manic glacierBOT
ornate breach
#

Yay for 7.1.0-beta.0! 🙂

#

I couldn’t write the whole release but I’m happy to have been able to have helped with it this week. 🙂

#

I need to get some more boards I’m working on added to Circuitpython. I realize I have a few coming up and they’re not yet added

tulip sleet
#

tnx @ornate breach

ornate breach
crimson ferry
#

@tulip sleet do you mind if I add my name on the beta notes, I'm co-author on the monitor pr? I'm usually pretty low-ego on this stuff, but I put in a lot of effort on that one... initial poc, api, testing

tulip sleet
#

do you have an order to suggest?

crimson ferry
#

microDev1 did the heavy lifting to write shared-bindings and merge it all together, they should be first

tulip sleet
#

is your github id also anecdata?

crimson ferry
#

yes

tulip sleet
#

changed three places (two of which aren't published yet)

#

i often update the notes for one reason for another, absolutely np

crimson ferry
#

cool, thank you, it seems petty I know, but now there's someone else to blame if someone doesn't like it 😉

tulip sleet
#

i have to wait for the build to finish before publishing everything

spiral elk
#

The website update seems to have created a number of "unknown board"s

ornate breach
#

Very interesting

tulip sleet
orchid basinBOT
manic glacierBOT
manic glacierBOT
tulip sleet
#

@onyx hinge anecdata submitted a PR which added some message strings. The feather_m0_adalogger de_DE build is too large, even though the strings are only used in the espressif port, and I assume would not be included in the feather_m0_adalogger build. Nevertheless, the string presence must have disturbed the Force in some way and caused the remaining strings to be compressed slightly less efficiently? Does that make sense?

onyx hinge
#

@tulip sleet that's interesting, I'll try to figure out what's going on.

tulip sleet
#

I rebased the PR against the tip of main locally, so I know it's not due to something before the tip (which is 7.1.0-beta.0 right now)

manic glacierBOT
onyx hinge
#

@tulip sleet the git describe --tags of the ref being built appears several times in the output (firmware.elf). Going from 7.1.0-beta.0 to 7.1.0-beta.0-5-g314deaf0e adds a minimum of 33 bytes, as the string appears 3 times. This seems to be rounded/padded to an increase of 40 bytes when I build locally.

#

(tested on trinket_m0 de_DE which does fit)

tulip sleet
#

aha, that makes sense; thanks for thinking of that; I think we will just turn off something on that build.

#

One of the builds I tried locally had exactly 0 bytes free (!)

onyx hinge
#

@tulip sleet we could eliminate the date from os_uname_info_version_obj. That gets back some bytes.

#

I tend to disfavor storing build date/time in binaries, because it makes builds not byte for byte reproducible

#

or we could do it just for samd21 in the name of saving space alone ```diff
--- a/ports/atmel-samd/common-hal/os/init.c
+++ b/ports/atmel-samd/common-hal/os/init.c
@@ -43,13 +43,14 @@ STATIC const qstr os_uname_info_fields[] = {
#ifdef SAMD21
STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "samd21");
STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "samd21");
+STATIC const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG);
#endif
#ifdef SAM_D5X_E5X
STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "samd51");
STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "samd51");
+STATIC const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE);
#endif
STATIC const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING);
-STATIC const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE);
STATIC const MP_DEFINE_STR_OBJ(os_uname_info_machine_obj, MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME);

tulip sleet
#

I can just turn off CIRCUITPY_ONEWIREIO, that will be more than enough

onyx hinge
#

that causes two strings to merge together and saved 16 bytes locally

#

okay

tulip sleet
#

I have already done that on other boards

onyx hinge
#

thanks!

#

and thanks for the release

tulip sleet
#

I think your idea is interesting anyway: I think there are arguments both directions re the date. The commit "dirty" is not very interesting, and harder to distinguish

proven garnet
#

Relatedly, the library referenced was typing things as usb_hid.device instead of I think the correct usb_hid.Device but I'm not as familiar. I'm preparing the PR to fix it if someone can confirm that.

tulip sleet
proven garnet
#

Awesome! PR submitted 🙂

#

Thanks for the quick response!

tulip sleet
#

will approve as soon as it passes

proven garnet
#

Still not sure why the other repo fails on building the docs, huh

tulip sleet
#

you may need to mock it; hold on

proven garnet
#

Oh awesome, thank you!!

#

Is there a way to tell ahead of time when that might be needed? Is it specific libraries only I assume?

#

I think another PR I have might need this fix but just want to know how I might know that.

onyx hinge
#

@proven garnet if it's something that can't be installed from pypi using requirements.txt then it'll need to be listed as an autodoc_mock_import, I think.

proven garnet
#

Got it thanks!

idle owl
# proven garnet Is there a way to tell ahead of time when that might be needed? Is it specific ...

If it's included in Blinka, or installable by PyPI, and Blinka and the PyPI-installable libs are in requirements.txt, you do not need to automock it. Sometimes you simply don't know until Sphinx fails what to put in automock. I suggest not guessing on adding things because you may end up adding things you don't need to. So if you're certain, toss it in the automock. If you're uncertain, let Sphinx run and fail.

proven garnet
#

Awesome, thanks everyone for the explanation!

idle owl
manic glacierBOT
#

This allows testing & debugging of bitmaptools routines like alphablend & dither on host computers. It shouldn't change anything about how displayio/bitmaptools work on microcontrollers.

$ ./micropython-coverage 
MicroPython 7.1.0-beta.0-3-gd55388a17 on 2021-11-12; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> import displayio, bitmaptools
>>> b = displayio.Bitmap(32, 32, 65536)
>>> bitmaptools.dither(b, b, displayio.Colorspace.RGB565)
midnight current
#

Hi Everyone! Is there a way to contribute to the translation of CircuitPython. I am a native Chinese Mandarin speaker. I found the PinYin version of CircuitPython clearly needs some improvement.

#

Sorry, I am new to "open source" so I am not sure where to start from.

slender iron
#

it will submit pull requests to the repo for you

midnight current
#

Thanks! I will look into that.

slender iron
#

thank you!

manic glacierBOT
#

Yes. There's a diagnostic flag that seems to be enabled on the unix build but not the others. Typical diagnostic text:

      |                                                                        ^~~~~~~~~~~~~~
../../shared-bindings/bitmaptools/__init__.c: In function ‘bitmaptools_dither’:
../../shared-bindings/bitmaptools/__init__.c:685:9: error: missing initializer for field ‘defval’ of ‘mp_arg_t’ {aka ‘const struct _mp_arg_t’} [-Werror=missing-field-initializers]
  685 |      ...
midnight current
#

Just curious. Is the reason for PinYin some encoding issue? What encoding is actually used? The only thing I know is that might not be ASCII.

stuck elbow
#

pinyin is ascii, that's the whole point

#

there wouldn't be enough memory to fit all the required Chinese characters

#

also, it might be hard to draw them in a 5x3 font

midnight current
#

Teach me, please. How you get that tones in ASCII

stuck elbow
#

líkê thìs — ok, this is extended ascii, but still way smaller than Chinese characters, and besides I have never seen a Chinese who actually writes down tones in pinyin — they just imply them

#

of course that is purely my own limited experience

midnight current
#

I see, but didn't see ǎ as part of Extended ascii.

stuck elbow
#

depends on which encoding you pick

#

CircuitPython automatically includes the characters that are used

#

looking at the translation file, it in fact includes the tones

midnight current
#

Yes I know, I am editing that. I am curious about how it was implemented. I betted that ǎ is not in ASCII so there must be some Unicode going on. Looks like i don't have enough understanding of how they are stored in the system.

stuck elbow
#

it's unicode internally, but it only picks the glyphs from the fonts that are actually used

#

the way the messages are stored is a bit complex, because they are compressed

#

I think using Huffman encoding

#

you can use Chinese characters in your program, by the way, they will just not display properly on the displays, because they are not included in the font — but they will print fine in the REPL

#

as long as you have the right fonts on your computer, of course

midnight current
#

I think I get it better now. Luckily. I know Huffman.

#

That makes a ton of sense.

#

My experience as a native speaker is that PinYin is never used as a written language, so my speed of reading PinYin is very slow. Tones are important if they are written down, otherwise, they will be even harder to read. There is not a popular input method for typing PinYin OUT. So if we have to we usually do things like zhe4 yang4 jiu4 ke3 yi3 kan4 dong3. But what you are doing is cool.

stuck elbow
#

I suppose all the pinyin I've seen was on signs and mostly for tourists

tulip sleet
stuck elbow
#

in Shanghai all the signs have pinyin text under the Chinese text

tulip sleet
#

@upbeat plover has been doing most of the Pinyin translations; you may want to communicate with them to see what kind of self-imposed guidelines they are using.

stuck elbow
#

not a very good photo, sorry

midnight current
stuck elbow
#

I see, makes sense

tulip sleet
#

maybe we should rename pinyin to latino?

stuck elbow
#

it does makes life a lot easier for bumpkins like me

midnight current
#

Currently the CircuitPython is PinYin.

tulip sleet
#

The official name is zh_Latn_pinyin

midnight current
#

That Latino I mentioned is only for names of places.

slender iron
#

anyone have a zero 2w and want to test for me?

tulip sleet
slender iron
#

flash that to an sd card with rpi-imager

#

usb isn't actually working atm

#

close 🙂

stuck elbow
#

@midnight current thanks, I learned something

tulip sleet
#

so i need to use a usb-serial?

slender iron
#

ya, for now

#

I'm trying to fix usb now

#

just figuring out the packaging approach

tulip sleet
#

ok, i'll need to solder headers first,so it will be a bit

midnight current
manic glacierBOT
tulip sleet
#

@slender iron

#

🎆 !

#

i used balena etcher, since I already had it installed

#

on a 16gb sandisk card

slender iron
#

nice! can you os.listdir() too?

#

does balena actually erase the whole card?

tulip sleet
#
>>> os.listdir()
['.fseventsd', '.metadata_never_index', '.Trashes', 'code.py', 'lib']
slender iron
#

imager will only do first and last MB for me

#

nice!

#

so sd is working

#

you could try plugging in usb but it'll probably hang

#

I have a timing-ish bug I can't figure out

#

and my loop doesn't have a timeout

tulip sleet
#

yeah, the serial REPL is no longer responsive

#

thanks for making the LED come on, that was gratifying (unless they added a power LED)

slender iron
#

I'm not sure that was intentional....

#

having a status led is on my todo list

tulip sleet
#

the LED did not come on if I powered up with no card, so something is turning it on

slender iron
#

I'm not sure 🙂

tulip sleet
#

hmm, now it's not working, after a power cycle

#

no serial USB, this is weird

slender iron
#

nothing on the uart?

#

I've had power issues with the cm4 some

tulip sleet
#

uart port went away, something else is wrong, I think. Maybe Linux got upset

slender iron
#

where I have to reapply

#

ya, the usb connection may have angered it

tulip sleet
#

put down that wand

#

ok, I plugged the USB-serial into another USB port.

#

Linux USB support is not robust

slender iron
tulip sleet
#

ha! are those in the RPi kernel code too, or is that in a binary blob?

slender iron
#

I'm not sure what you mean

tulip sleet
#

the delays you had to put in; was there guidance for those in some existing emmc code?

slender iron
#

no, and they aren't working on the zero2

#

in linux I did see something about rate limiting writes to the peripheral

#

I should probably have those loops timeout anyway

tulip sleet
#

i'm not sure what that code has to do with usb, or are you talking about another problem?

slender iron
#

usb mass storage triggers a read that fails and loops infinitely

#

and starves the usb connection

tulip sleet
#

ah, got it

#

if you made them much longer?

slender iron
#

I could try

#

but it feels like an issue that really needs a root cause

tulip sleet
#

i agree

slender iron
#

timeouts are always wise though

tulip sleet
#

is cmdinfo->data a register?

slender iron
#

no, its a memory buffer

tulip sleet
#

but you are checking READ_RDY and WRITE_RDY for each word in the buffer

#

cache flush??

slender iron
#

READ_RDY should be in the uncached region

#

since its on the peripheral

#

it works sometimes

#

USB does do multi-block reads

tulip sleet
#

i mean the buffer, maybe the buffer has not been flushed out of cache?

#

or does the USB peripheral access through the cache?

slender iron
#

so its a slightly different path from startup

#

I don't think there is actually memory shared with usb

#

I think it's a fifo register

tulip sleet
#

it is just weird that you need a delay before just writing or reading data to the buffer. there is no delay in the loop, which I might expect to be necessary even with the READ_RDY check.

#

but I know nothing

slender iron
#

ya, I have no idea why. I just noticed it worked with prints there and not without

#

the status register also has a read ready equivalent that is set

tulip sleet
#

ah, ok, it was empirical 🙂

slender iron
#

ok, time to exercise

manic glacierBOT
#

In #5575 I had to fix some diagnostics that occurred when enabling bitmaptools & displayio bitmaps in the Unix port, because this diagnostic is not enabled on our 'real' builds.

This can be done one architecture at a time, closing this Issue when all the architectures are done.

For code that comes from SDKs and submodules, it's reasonable to disable the diagnostic. See how this is done e.g., for the missing-prototypes diagnostic.

tulip sleet
#

would you need to wait for this? EMMC->INTERRUPT = EMMC_INTERRUPT_CMD_DONE_Msk

have fun

manic glacierBOT
manic glacierBOT
upbeat plover
#

@midnight current I have no guide lines... do as you please! I'm not a native speaker and I failed Chinese class in high school. I'm sure many mistakes have been made.
I'll give you an example of inconsistencies within the translations.

"Code done running."
I used to translate like this
"Dàimǎ yùnxíng wánbì"
but
switched to something like this
"dài mǎ yǐ yùn xíng"

some translations are like the first way but newer ones are like the second way

what are your thoughts on that?

midnight current
#

For the example given, the first is better.

#

I think the first thing I will do is to go over all translations and correct the obvious errors. Like what brought me here "zui4 hou4 yi2 ci4 da3 dian4 hua4".

#

And for the terminology, I will add English comments. That is because, in Chinese programming classes, we sometimes hesitate to translate the terms. For example, I bet nobody uses the Chinese translation of tuple. Even though there is one, but very few people use it. I will make it like yuan2 zu3 (tuple) zi4 fu2 (char). And make it consistent in all translations.

slender iron
#

@tulip sleet I realized I could split my multi block reads into single blocks

#

and avoid the whole issue

upbeat plover
# midnight current And for the terminology, I will add English comments. That is because, in Chines...

I myself don't know how to use the tone numbers. If native Chinese speakers normally do that then I feel like all of them should be converted to that. The main purpose I started this translations was to allow ciruitpython for Chinese users.
I found this to convert it back to what I had so people that don't have the tones memorized like me can still read it. http://huginn.net/foolsworkshop/ptou/index.html

tulip sleet
#

@midnight current are you substituting the non-ascii characters here for ascii for convenience, or do the tone numbers substitute for the diacritical marks?

#

or are they completely separate meaning?

#

e.g. yùn vs yun

midnight current
tulip sleet
#

no technical reason, the diacritics take more space internally when compressed, but we are assuming that. The German and Japanese translations are currently the largest.

#

are you saying that "zi4 fu2" is the translation for "char" above?

midnight current
tulip sleet
#

giving both the Pinyin and its translation will enlarge the translation significantly if we do it in every messge

#

the best choice for the tones is what is best for the user who is reading the message; I assume the diacritics are best

midnight current
#

Yes, zi4 fu2 is the translation of char. If that is going to take a large space. I personally prefer just keeping char and not mentioning zi4 fu2

#

Because you have to know what char is to write python.

#

But some Chinese translations are not widely used.

tulip sleet
#

yes, if you think that anyone reading it is going to know what "char" means, I would say that's fine. Giving both is wordy, and we don't tend to do that in other languages. But in most, I think the translators use the native term if it is available

#

but that is more about education and language style than anything else (e.g. French has made a big effort to come up with native words0

#

our audience is both professionals and non-professionals, even young students

midnight current
#

OK, 🤔, I will postpone this term thing and think about it more. I will need to read more documents to get a better conclusion.

tulip sleet
#

i think sometimes the message mentions a specific python keyword, and sometimes it is a generic term (e.g. "bytes" vs bytes). For instance, "file" would probably be translated, unless it's typical to use the english word

#

example in german:

#: py/objstr.c
#, c-format
msgid "%%c requires int or char"
msgstr "%%c erwartet int oder char"
#

vs

#
#: py/obj.c
msgid "%q indices must be integers, not %s"
msgstr "%q Indizes müssen Integer sein, nicht %s"
#

keywords in the former, translated word in the latter

upbeat plover
#

I left a few things untranslated, but I could have left more out.

midnight current
tulip sleet
#

if you are referencing the actual keyword for some reason, then it might not be translated, but if it is a generic word that people would know, then you could translate it. For instance, in the German (I don't speak German by the way; it's just a good example.):

#: shared-module/vectorio/Polygon.c
msgid "%q must be a tuple of length 2"
msgstr "%q muss ein Tupel der Länge 2 sein"
#

Tupel == tuple, it's a cognate. If "tuple" in Mandarin is a well-known word (e.g. from mathematics or general computer science), and you'd expect the reader to know it or be able to look it up easily, then you could use the Mandarin term.

#

really, it's a highly cultural/language decision, we don't have a rule or anything, whatever you think would be the clearest

#

in this case it's referring to a Python term, but the average German reader knows that Tupel refers to the Python datatype

#

we don't wish to dictate translation style

#

across all languages

midnight current
tulip sleet
#

thank you for the discussion! We really appreciate your working on this!

midnight current
# tulip sleet no technical reason, the diacritics take more space internally when compressed, ...

I just checked the Japanese version. I saw there are many kanjis (Chinese Characters). Maybe that is the reason why it is large. Maybe if it is all Hiragana/Katakana, it will save a lot space considering they are coded in Huffman. Or even “Romanization of Japanese“ might also work. Sorry, I only know maybe less than 10 Japanese words, but it looks like a similar idea to PinYin. Just my thoughts.

manic glacierBOT
#

Old bug was in wifi init: station was started manually using ESP API rather than using common_hal_wifi_radio_start_station, leaving self->sta_mode = 0; This was OK on most typical runs, but caused problems when going into and out of station mode later. The manual start station was an artifact from when common_hal_wifi_radio_start_station did more than just manage the wifi mode.

wifi.radio.mac_address behaves like wifi.radio.hostname, but not exactly. The Espressif docs are a li...

manic glacierBOT
#

The only storage you can format in CircuitPython is the built in flash, and we don't ship any devices which are so big that fat32 is required. So, save space by compiling it out by default. Seemed to save 508 bytes on Trinket M0, 512 bytes on Clue.

Testing performed: that storage.erase_filesystem() on a Clue created a fresh filesystem usable by Linux & CircuitPython.

Then I made it possible to test rainbowio and optimized it for size, saving about 88 bytes of flash storage without cha...

manic glacierBOT
blissful pollen
#

"Why does it seem like the LEDs have no gamma applied to them"
"Well you put a flag in to let the user turn gamma on and off and forgot to turn it on and its off by default"
🤦‍♂️

manic glacierBOT
dusk mauve
#

I'm tinkering with struct and I can't for the life of me remember what the right format string is for a simple 8-bit signed int. I thought it might be b but -1 ends up being 11111111 instead of 10000001 😓

slender iron
#

I think that's correct

dusk mauve
#

this is the field description in the datasheet. Using UnaryStruct for it works fine for a value up to 127

slender iron
#

ah, that isn't two's complement

#

(which is what struct will do)

dusk mauve
#

I'm a bit rusty on my int<->binary things so this is stretching my brain a bit

dusk mauve
slender iron
#

write the absolute value and then set the high bit if it's negative

dusk mauve
slender iron
#

you could make a new data descriptor for sign/magnitude

dusk mauve
#

but I could just do a RWBits for 0-7 and use a setter for the sign

slender iron
#

ya

dusk mauve
#

is this kind of structure common enough to bring into register or struct? or just one the zillions of random quirks of i2c/spi/uart bitfields that's best just handled in the library driver?

slender iron
#

I haven't seen it before but I wouldn't rule it out

manic glacierBOT
dusk mauve
midnight current
#

@upbeat plover Maybe you can help me with the translation. Does "All state machines in use
" means "All state machines are in use"? I see a lot of similar messages. Just to make sure..

#

Also, is there a channel dedicated to translations? I feel like this channel is mostly for tech issues. Is it proper to ask detailed translation questions here? like the one above?

manic glacierBOT
tulip sleet
#

It's fine to ask translation questions here, since the developers who wrote many of those messages are active here.

midnight current
#

@tulip sleet Cool thanks!

midnight current
tulip sleet
#

yeah, they are not complete sentences, and we are all taught in school to write in complete sentences in normal written communication. No one is taught to write in this style, but everyone knows the rules implicitly. Interesting that the auto-translate tools are really looking for complete sentences. I guess there are many fewer examples of this "telegraphic writing" style.

dusk mauve
#

While working on prospective I2C device driver improvements I’ve become curious about priorities. Many I2C drivers push a large amount of traffic on the I2C bus by repeatedly/continuously reading/writing registers for device state, requesting data, etc. But some seem to keep state semi-cached in class vars, only reaching out to the bus if there should be a change.

Coming from a world where “external calls” (ie REST) are usually expensive/retry-prone I’m used to carefully tracking/replicating/caching external state in my objects representing those things to avoid unnecessary traffic, retry delays, or bus contention.

So I guess my actual question is: What’s more important to optimize for in CircuitPython drivers? Memory/storage usage reduction (less class vars/constants and helper methods) or bus traffic reduction (less i2c traffic)? Or am I just overthinking/pre-optimizing this because I had my morning coffee to early?

tulip sleet
dusk mauve
tulip sleet
#

Storing a few dozen or hundred bytes is not consequential. In terms of what to emphasize, the trend has been to write drivers that were quite comprehensive, but they ended up being large and not fitting well on small boards. Using the Register library is very convenient and reduces errors, but can increase the size

dusk mauve
#

Constants in class vars, how many are too many, are another question

tulip sleet
#

I would include only those that are really needed. Also read about using const() with underscore names: that reduces the size of the library because they are substituted at compile time.

#

note that using an underscore with const() makes the name go away and not take up space at run-time

dusk mauve
#

In particular I’ve been looking at the APDS9960 lib. The device is super powerful but requires a lot of config to get each of its functions working well. So I’d like to expose a lot of its config registers and make it easier to work with. But the driver size on disk, in memory at import, and per-instance can grow a lot if more functionality is added.

So I started thinking about optimization. One thing I thought about was using optionally loaded classes for each function - prox, gesture, color/light - so that the user import or instantiate a stripped down version of the driver with kwargs maybe. The gesture function as it is know kinda does this, only instantiating a 129-byte array if it gets invoked, but it’s a bit wonky.

Not sure if there’s precedent/examples for this kind of “only features I need” operation, to provide a comprehensive driver while allowing users to shed dead weight they don’t need on import/instantiating?

dusk mauve
tulip sleet
dusk mauve
#

Thanks for the chat, @tulip sleet. 🙏

tulip sleet
#

BTW, to show when a const name really disappears:

from micropython import const

CONST_1 = 1
CONST_2 = const(2)
_CONST_3 = 3
_CONST_4 = const(4)

class C:
    CONST_11 = 11
    CONST_12 = const(12)
    _CONST_13 = 13
    _CONST_14 = const(14)

    def test():
        print(CONST_1, CONST_2, _CONST_3, _CONST_4, self.CONST_11, self.CONST_12, self._CONST_13, self._CONST_14)
$ mpy-cross ctest.py
$ strings ctest.mpy 
ctest.pyP$$d
CONST_1
CONST_2
_CONST_3T2
CONST_11
CONST_12
_CONST_132
testQc
_CONST_144

(Ignore the trailing digits: that's just noise.) You see that only the global name _CONST_4 truly disappears. Underscore doesn't help for class variables

#

@dusk mauve ^

dusk mauve
#

Great illustration 🙂 Thanks for that. Helps so much for readability to have register addresses, magic values, etc in those kinds constants. Good to see that doing it right doesn’t grow library size massively.

manic glacierBOT
tidal kiln
#

@tulip sleet ^^ that's a great const cheat sheet example! worthy of putting in a guide somewhere if not already 🙂

tulip sleet
#

I keep forgetting how it really works.

#

not a complete explanation, though

tulip sleet
tidal kiln
#

how about adding your two code block examples above to the design guide? no further discussion, or at least very limited. let the code and resulting output generally speak for itself. nice compact reference.

manic glacierBOT
#

Good question, the keyword is None by default, right?

I found this and it seems to be a common workaround for computed keyword arguments to use None and
calculate later.
https://stackoverflow.com/a/21804648/7919597

You could use the Optional type hint like

readinto(self, buffer: _typing.WriteableBuffer, *, start: int = 0, end: typing.Optional[int]=None, write_value: int = 0)

and

end (int) – end of buffer slice; if None use len(buffer)

manic glacierBOT
#

Good question, the keyword is None by default, right?

In this case and in similar methods, it's not None, it's actually what the signature says: sys.maxsize. We do use None sometimes, but not here. Here it's less code internally to use only an integer in the readinto() and similar cases. And here if you gave, say, 10000 as the arg, and the buffer is smaller than that, it would use len(buffer).

tulip sleet
lone axle
manic glacierBOT
#

Similar to the RGBMatrix (and also borrowing from I2CDisplay) this is a native driver for the IS31FL3741 chipset. I am releasing this is draft for others to take a look at but still requires some cleanup and I have some questions about the best way to implement some options. I have only tested this on the Adafruit Eyeglasses as they are the only IS31 board I have.

The main question I still have outstanding is how to pass in mapping from the display to actual LEDs. The glasses matrix is cur...

lone sandalBOT
lone sandalBOT
proven garnet
#

If I have a small fix for CircuitPython RTD documentation, should I submit a PR to main or is there a better branch? Just a tweak to a Sphinx formatting mistake.

#

(adafruit/circuitpython, to be clear haha)

proven garnet
#

Also, the library infrastructure issues page shows a bunch of libraries missing "readthedoc.yml" but the repos have ".readthedocs.yaml". Is that "check" looking for something different, or should it be pointing towards the latter?

dusk mauve
#

Had a friend stop by the lab for the first time in awhile (they needed some soldering help with a busted DC jack on their fish tank pump relay 🐟) and gave them an in-person demo of the PyLeap beta with a Circuit Playground Bluefruit.

I wish I could share the expression of joy on their face when they tapped the "Glide on over to rainbows" button and saw the neopixels light up!

"OMG its a rainbow! SO COOL! Did I do that?! Really?! NO WAY!"

Even in beta it's already bringing some rainbow happy vibes to humans. ❤️ 🌈 blinka

crimson ferry
#

@dusk mauve just for completeness, there's another variable, though I doubt it will affect ESP32-S2 power much: start_station() vs. stop_station() (but similar start/stop for _ap would affect power)

dusk mauve
manic glacierBOT
slender iron
proven garnet
manic glacierBOT
dusk mauve
manic glacierBOT
sour river
#

@slender iron been experimenting with the rpi branch this weekend. I still can't get working builds out so I couldn't test this, but gcc 10 was giving warnings about some out-of-bounds access on SD spec stuff, so maybe this will help with that instability you mentioned. fyi i'm not sure if the endianness is correct for that last one either

manic glacierBOT
#

Disappointed to learn that CircuitPython doesn't support interrupts. I'm working on curriculum to teach *Python on the Pico for a college class and interrupts are an important concept. I'll have to use MicroPython for that exercise.
Like this:

`import machine
import time

from machine import Pin

led = Pin(25,Pin.OUT) #pico on-bard LED
button = Pin(20,Pin.IN,Pin.PULL_UP) #button

def button_int_handler(pin):
led.toggle()

led.off()

#call the interrupt handle when the but...

manic glacierBOT
#

As a guy who is interested in electronics and programming, I'd like to participate in CircuitPython translation. I strongly believe that CircuitPython will be the next milestone in the Russian maker sphere.

With the appearance of rp2040 and raspberry pi pico on the market, AliExpress in particular (this is the primary place where we source our components from) and its' low price tag, I strongly believe that CircuitPython will be the revolution in the Russian maker community. As for now, p...

slender iron
sour river
#

EST so there should be a good three hours when I’m off work that won’t be a bother to you 👍

manic glacierBOT
#

I'm working on curriculum to teach *Python on the Pico for a college class and interrupts are an important concept. I'll have to use MicroPython for that exercise.

Note that MicroPython has strong restrictions on what you can do in a hard-interrupt handler: no storage allocation, etc. We are avoiding hard-interrupt handlers in CircuitPython to make it harder to make those kinds of mistakes. Functionality that needs hard interrupts we code as native modules. keypad does not actually use...

manic glacierBOT
#

Progress report on all this: we enabled async/await some time ago on most CircuitPython builds, and are now providing a preliminary port of MicroPython's asyncio implementation so you can do cooperative multi-tasking. This is in 7.1.0-beta.0 and later. A preliminary Learn Guide with examples will be available soon.

We chose asyncio because it's standard in CPython and MicroPython already has done a great job on the implementation. However, asyncio is not so easy to use or under...

jaunty juniper
#

@tulip sleet what is the policy on updating the frozen modules ? I'm waiting for the next stable CP to switch the layouts to using the base layout class added to adafruit_hid. (Hopefully it fits on all boards that have it frozen in).

tulip sleet
manic glacierBOT
jaunty juniper
#

I could try/except the import to make it backwards compatible and warn about updating or downloading the missing file

tulip sleet
#

Given the wide variation in experience level of people who use your library, I think catching these errors will save you support time 🙂

#

I can make a trial PR that updates the frozen libs now for beta.1 and we'll see what doesn't fit anymore

#

it is very easy to make that PR

#

does adafruit_hid 5.2.0 include everything you need now?

jaunty juniper
#

I kind of wish it was possible to have a code_out.txt, accessing the REPL is not the easiest thing to ask some people to do to diagnose issues 😉

jaunty juniper
#

yes, 5.2.0 is right

tulip sleet
#

we do want to train people to use the REPL, there are arguments both ways about making it easier vs making people think a bit

#

but we have to remove it if it exists at the beginning, etc. It may cause more issues than it helps

manic glacierBOT
jaunty juniper
tulip sleet
#

I have tried the sample web serial impl provided by Google and it does not work well; I'm not sure what's wrong.

jaunty juniper
#

I think they updated it since I tried it too, it looks to work better, though it's probably gonna stay Chrome only

analog bridge
#

@crimson ferry can you enable commit from contributor on your PR #5571.
The feather_m0_adalogger overflow issue was fixed in main, so I did a rebase and merge from main.

tulip sleet
crimson ferry
tulip sleet
analog bridge
#

I can't push to my fork either so I think its a problem on my end.

crimson ferry
#

my anecdata repository is set up as default, is it something there, like adding you as collaborator?

#

ah, ok

tulip sleet
#

that should not be necessary

#

but I can't edit one of the changed files either

#

I don't think there is a missing collaborator; we do this all the time with new folks who submit PR's

analog bridge
#

okay... I can push to my fork now but still can't access yours

tulip sleet
#

triple-checking, you see this on your PR in the lower right hand corner:

crimson ferry
#

it was checked when I mentioned it before, but just looked again and it wasn't. It is checked again now.

tulip sleet
#

now I am seeing I can edit a file; did you change something?

#

all's well that ends well

analog bridge
#

yes I can push now 👍

tulip sleet
#

It did not gain that much, so I thought I should work on it some more

#

i checked size changes after every significant change: lots of 1 step forward, 1 step back, occasionally two steps forward

tulip sleet
#

I still think it is worthwhile from a cleaner-code point of view

analog bridge
#

I'll merge your branch with mine at a later point... I am working on standardizing other types of error strings atm.

lone axle
#

@idle owl when you have a sec I'm interested to get input from you on this: https://github.com/adafruit/Adafruit_CircuitPython_FunHouse/pull/24/commits/2980950d7683e3a5a3a2e925871df9fa245a1448#diff-63a9c44a44acf85fea213a857769990937107cf072831e1a26808cfde9d096b9L27 If I understand correctly we recently gained the ability to use this duplicate-code disable in the pylint / pre-commit config. It appears it was applied to example code in the config file. Are we also wanting it to apply to library code as well?

jaunty juniper
#

oops boot_out.txt is not created if it does not exist

#

(like after erase_filesystem)

idle owl
# lone axle <@!330227457296957440> when you have a sec I'm interested to get input from you ...

Ok, so here's the deal with that. We do have the option to disable it. That said, what should really be happening, if at all possible, is a refactor into a base class and subclassing it from there. With regards to the latest Pylint update, the directive was to simply disable the duplicate code check for now. I specifically put it in the pre-commit config so it's in a more obvious place for us to find it later and consider refactoring the code. What I would have preferred, but this will still be easy to do, is to have an issue created on every library we disabled it on suggesting the library be refactored if possible. Tekktrik was instructed to include the duplicate-code disable in the event that they ran into it in one of the PRs where they were applying the updated Pylint. I was not clear that it shouldn't be done elsewhere, but I hope that was implied.

#

Basically, trying to include a full refactor in a library-wide Pylint update was not reasonable.

jaunty juniper
idle owl
#

@lone axle So in the case of this PR, it shouldn't be needed or it should already be in the library. Because that isn't a Pylint PR.

#

Does adding the type hints trigger the check?

#

Hmm. It appears to be related to an import section.

lone axle
# idle owl Does adding the type hints trigger the check?

the PR for the added type hints does run CI when it gets pushed to. Without the duplicate-code disabled it's currently failing the checks. I haven't looked into the specific lines it's tripping on yet though. I can try to see how large of an effort the refactor would be.

idle owl
#

It's set to ignore imports, but that try/except block is, I think, causing it to not see that it's an import block.

idle owl
idle owl
#

I think this is triggering it. try: from typing import Optional, Dict, Union, Callable, Sequence, List from adafruit_dotstar import DotStar except ImportError: pass

#

In fact, I'm certain of it.

#

That's annoying.

#

It's not exactly the same, but it's claiming it is. Only needs 4 lines to be the same to trigger it, so... Here is the exact block that's getting caught ``` from adafruit_dotstar import DotStar
except ImportError:
pass

version = "0.0.0-auto.0"
repo = "https://github.com/adafruit/Adafruit_CircuitPython_FunHouse.git"```

#

I'm unclear on why the dotstar import is in the try.

#

But I'm not sure that would stop the failure.

#

I don't think it would. Because it would still be four lines.

thorny jay
jaunty juniper
#

hmmm the dotstar is in the try because it's not used in the code, only in the type hints, and placing it after the others will make it ignored due to the exception being triggered

idle owl
#

@proven garnet @lone axle I'm trying something now. I'll get back to you in a minute here.

lone axle
# idle owl I'm unclear on why the `dotstar` import is in the try.

In the case that the import is used only for typing in that file we've been putting the imports inside of the try/except after the typing import. That way when it runs on a microcontroller it won't actually import the thing (dotstar in this case) to save a little RAM, since it's not actually used at run time.

idle owl
#

Ah ok

#

Wouldn't fix it anyway, so that's fine.

proven garnet
#

I'm catch up on this now

proven garnet
proven garnet
idle owl
#

@proven garnet @lone axle Ok, my idea doesn't work. I don't see a code way to get around this right now. Please include duplicate-code in the .pre-commit-config.yaml as you did previously for the Pylint PRs. Then, please file an issue on the library that includes the Pylint failure and suggest we should look into how to fix it. Here is the failure that should be included. ```************* Module adafruit_funhouse.peripherals
adafruit_funhouse/peripherals.py:1:0: R0801: Similar lines in 2 files
==adafruit_funhouse.init:[38:46]
==adafruit_funhouse.network:[37:44]
from adafruit_dotstar import DotStar
except ImportError:
pass

version = "0.0.0-auto.0"
repo = "https://github.com/adafruit/Adafruit_CircuitPython_FunHouse.git"

(duplicate-code)```

#

Thanks for your patience with this, @proven garnet!

proven garnet
lone axle
#

Thank you @idle owl .

slender iron
#

@tulip sleet need any help with the meeting today?

tulip sleet
slender iron
#

kk, I'm around

idle owl
#

As am I.

proven garnet
idle owl
#

@proven garnet Thanks so much! Exactly what I was looking for.

solar whale
#

hmmm -- just got a new adafruit_feather-ESP32S2 with bme280 --- the bme280_simpletest does this... ```Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 7.1.0-beta.0-18-g18b3e6c4f on 2021-11-15; Adafruit Feather ESP32S2 with ESP32S2

import bme280_simpletest

Temperature: 20.9 C
Humidity: 71.3 %
Pressure: 607.1 hPa
Altitude = 4116.94 meters
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 19] Unsupported operation

idle owl
proven garnet
#

If anyone has a PyBadge, I'd love some help testing a PR to remove gamepad from this library

crimson ferry
#

Espressif has new ESP32-S2 boards (ESP32-S2-DevKitC-1), same as Saola as far as I can tell except that they have both USB connectors and are narrower so fit in a breadboard with a row to spare on each side. I've been running them with Saola firmware. Question: is there any need to make new board files for these, it would just be naming, nothing functional.

solar whale
jaunty juniper
#

there are alias boards, like the pyportal and pyportal pynt, that use the same firmware (but only built once)

idle owl
jaunty juniper
crimson ferry
solar whale
# idle owl Good to know. Noted.

even stranger -- sometimes it fails after more then one pass.... ```Adafruit CircuitPython 7.1.0-beta.0-18-g18b3e6c4f on 2021-11-15; Adafruit Feather ESP32S2 with ESP32S2

import bme280_simpletest

Temperature: 20.9 C
Humidity: 71.3 %
Pressure: 607.1 hPa
Altitude = 4116.94 meters

Temperature: 20.9 C
Humidity: 71.3 %
Pressure: 607.1 hPa
Altitude = 4116.94 meters
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 19] Unsupported operation

jaunty juniper
#

(plus the whole adding a board to cp.org)

idle owl
tulip sleet
#

@idle owl could you join me in Valentina for a sec to check recording?

crimson ferry
idle owl
solar whale
#

agreed

tulip sleet
#

@idle owl it's working: I am in Windows instead of Linux, where it seems to work a bit better

crimson ferry
#

@jaunty juniper oh, I see, there are no board files, it seems to be a pure alias

solar whale
lone axle
idle owl
jaunty juniper
solar whale
#

at least it points me in a direction....

idle owl
#

For sure.

solar whale
#

I reflashed CP to the board and now it is working....

crimson ferry
#

@jaunty juniper oh, yikes, I take it back... a complication is that there seems to be a variation with more flash (though I don't see those at the distributors yet)

idle owl
#

Something intermittently outside sounds like a far away dragon. I keep waiting for it to get louder and the sky to darken. It is not happening as one might hope.

idle owl
solar whale
#

bad karma...

#

just an FYI -- the feather esp32s2 boards (with and without bme280) appear to be shipped with an Arduino sketch. I had to do an erase_flash then flash with CP to get them to boot CP.

#

the UF2 bootloader is not installed.

manic glacierBOT
idle owl
manic glacierBOT
proven garnet
idle owl
#

@proven garnet I sent you a direct message - I hope that's ok!

manic glacierBOT
orchid basinBOT
orchid basinBOT
idle owl
#

<@&356864093652516868> CP Weekly meeting in under 30 minutes. Looking forward to seeing folks there! Please remember, if you want to participate or have your updates read off during the meeting, please include your Hug Reports and Status Updates in the notes doc. Thanks! https://docs.google.com/document/d/1ROYIKjHd8lfuKZJEgcWpzsnfbV4AaZjyvmRipSjxKXs/edit#

thorny jay
#

Skipping the meeting without notes, but I might listen to the latest news on the Pi Zero port... strongly wondering if I should invest if 2GB micro SD card for that kind of usage.

proven garnet
idle owl
#

@solar whale I have a potential solution for you for the BME issue. There's an I2C_POWER pin (or something like that). It needs to be pulled opposite of what it is (we can't remember what it starts at, so high if it's low or vice versa). Pin 7 maybe?

#

Also, it should have shipped with the bootloader, but it's a pain to get into.

solar whale
#

ooh..- I try the I2C_POWER Pin. thanks -- I tried several rates of double taps...

idle owl
#

You have to click again during purple.

#

Or I guess it wouldn't yet until CP was flashed.

#

It comes with the Arduino core though, it turns out.

solar whale
#

not that I saw -- I have another board, I'll try it.

idle owl
#

Limor added that feature, so you can even update the bootloader by loading from Arduino. So that original sketch should have resulted in the bootloader being included.

solar whale
#

I don't seem to be able to trigger it

idle owl
#

@tulip sleet @slender iron I'm likely going to be late to the meeting. Don't wait up.

slender iron
#

kk

lone axle
#

I had another meeting come up today as a scheduling conflict, won't be able to attend. But I've left notes in the doc and will catch the recording later on.

idle owl
#

I am not, in fact, late, after all.

timber mango
#

i'm just here to the listen

#

awesome. thanks for the overview

tulip sleet
idle owl
#

@crimson ferry Are you text only?

slender iron
#

🐱

#

👋 @clear halo

clear halo
#

👋 Been meaning to listen in for aaaages but it's so early 😜

slender iron
#

less early now 🙂

clear halo
#

Yes, almost manageable 😉

solar whale
#

@gilded cradle I should have read your notes first!! -- I'll try the new pitft installer soon.

slender iron
#

6:30 is still too early for me

solar whale
#

whew -- not just me!

gilded cradle
#

@solar whale the camera still doesn't work. Waiting on them to make some updates.

idle owl
gilded cradle
idle owl
#

Like on FunHouse or MagTag

gilded cradle
idle owl
#

@solar whale That was meant for you.

gilded cradle
solar whale
#

got it 😉

#

I've given up on "done" for my projects...

errant grail
idle owl
# solar whale got it 😉

When you said you "erased the flash and loaded CircuitPython", what exactly do you mean? What process are you referring to?

crimson ferry
#

orbit.love: opt-in by each user?

solar whale
#

I am building CP locally so I did: esptool -p /dev/ttyACM0 erase_flash then make BOARD=adafruit_feather_esp32s2 flash PORT=/dev/ttyACM0

timber mango
#

what about tagging you commits with your discord name?

clear halo
#

Orbit.love was mentioned on Changelog 465: https://changelog.com/podcast/465

thorny jay
#

Social score...

slender iron
#

👍

ember iris
#

o/ thanks all

clear halo
#

Thanks folks, always good to hear what's going on in CircuitPython land!

#

I'll try and drop in more regularly 👍

idle owl
#

@solar whale Ok, so at Limor's suggestion, I tried to see if I could get a bootloader by loading an Arduino sketch, and it worked. So there may have been an issue on the tester-end of things. Because I now have a UF2 bootloader from loading an Arduino sketch.

solar whale
#

interesting -- I will try that.

idle owl
#

@solar whale I loaded the strandtest_wheel sketch, though I think the pin I put in for the NeoPixel is wrong because the NeoPixel did not rainbow, but I got a bootloader out of it.

#

From the NeoPixel library.

#

I even verified the pin. 😕

#

Also, it took three tries to get Arduino to play nice.

#

@blissful pollen I may ping you for a build for some random board to test the PR (unless the PR built assets already).

slender iron
blissful pollen
tulip sleet
#

recording is O K 😓 🙂

idle owl
solar whale
#

@idle owl I don't think I have esp32s2 BSP for Arduino yet so it will take some time to test.

idle owl
#

I had to update mine to have it include the Feather. It wasn't there at first.

idle owl
#

I still had it in clipboard 😄

#

Then search the board manager for "ESP32" and the one you want was the only one that came up for me. It did NOT list the Feather as included, but it was there once installed.

solar whale
#

ah -- are you using Arduino 2.0 ...

idle owl
#

1.8.16

#

is what I have

#

I guess I knew 2.0 was available, but I haven't used it.

solar whale
#

ok -- I'm not familiar with tthat .json file

#

i am using 1.8.16 as well

idle owl
#

(sorry if you already knew this)

solar whale
#

doh -- never-mind -- its been too long. Yes -- I do know how to do that !

idle owl
#

No worries 🙂 It's one of those things that once you do it, you have no reason to remember. Until you need it 😄

manic glacierBOT
solar whale
#

@idle owl Do you see the adafruit feather es32s2 in your arduino boards list? I cant find it.

solar whale
#

did you install the ESP32 BSP?

idle owl
#

Yeah.

solar whale
#

ah -- missed a step.

idle owl
#

@solar whale Looks like this.

#

Like I said, doesn't mention Feather, but it's in there.

solar whale
#

Now I understand what you meant 😉

#

I will try loading the "blink" sketch and see if that loads the uf2 bootloader...

idle owl
#

Keen.

solar whale
#

takes awhile to install...

idle owl
#

I used NeoPixel, it shouldn't matter.

#

Yeah it took a bit for me too

#

I learned the hard way, it takes a while.... I quit in the middle and borked the whole setup a while back.

#

I thought it had hung.

solar whale
#

I see the I2C POWER pin { MP_ROM_QSTR(MP_QSTR_I2C_POWER), MP_ROM_PTR(&pin_GPIO7) }, Should it be High when using I2C?

idle owl
solar whale
#

OK -- thanks 😉

slender iron
#

@atomic summit do you know the S3 support status in CP?

solar whale
idle owl
solar whale
#

No problem

atomic summit
#

I looked at continuing CP-S3 the other day and was unable to bring in all latest changes into my branch... so much has changed since I did the initial stuff 😦

slender iron
#

np, limor has some dev boards so it's higher on my list

#

@analog bridge probably knows too

atomic summit
#

tried for about 15 mins to fix conflicts and then just reverted the rebase

slender iron
#

yup, I know how that can go

#

we're on 4.3 so we'll want to switch to 4.4 I think

atomic summit
#

The work I did was pre @analog bridge moving to 4.3, and he re-implemented the "split mcu support" for C3 very differently to me, so there stacks of conflicts

#

maybe it's easier to start again... especially if you are moving to 4.4 anyway

slender iron
#

kk

atomic summit
#

I'm not sure if you are aware, but Espressif decided to remove the DAC peripherals in S3.... boo hoo... so that pretty much breaks compatibility with any DAC based shields/wings etc.

slender iron
#

huh. is that used for more than audio out?

atomic summit
#

sorry, for more? well, a DAC is useful for other things.

solar whale
atomic summit
#

but mainly for non I2S audio out uses - just something to be aware of.

#

You can still PWM those pins to get sound out of a buzzer... but no DAC means no wav/audio file playback etc

jaunty juniper
#

are there featherwings using DAC pins ?

solar whale
#

@idle owl Loading a blink sketch does indeed load the UF2 Bootloader!!! Thanks!

atomic summit
#

@jaunty juniper i think the propmakers are maybe some others

jaunty juniper
#

audio wings seem to have their own codec chip

atomic summit
#

anything that has a non I2S/decoder on it.

slender iron
#

I always have better luck with i2s

tulip sleet
#

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/1RgQT9ewtW6Cv9KzgOScNCrulTTyw6J9XdErM7ZnrsLU/edit

atomic summit
#

I know not all Feathers have DAC pins... but ESP32 always has had them... this will be a breaking change from what ESP32 users are used to.

jaunty juniper
#

design choices... 🤷

slender iron
#

@atomic summit would you mind posting an s3 mp build? do you have one handy?

atomic summit
#

I can make you one in a hour or so, if you can wait. Or you can make one - basic S3 support is already in MP, and I have a PR for PSRAM + SCcard and more waiting for approval.

slender iron
#

ya, no rush

atomic summit
#

Ok, I'll make you one for the S3-Devkit in about an our

slender iron
#

ty

atomic summit
#

Yeah, they don't have all boards being auto-built yet 😦

slender iron
#

that page is progress though

atomic summit
#

it is - needs a "non-engineer" UIX makeover though 😉

#

Actually... maybe I can remote into my work machine and build...

#

@slender iron do the boards Limor's got have SPIRAM on them?

slender iron
#

I don't think so

atomic summit
#

Want me to send here? or another way?

slender iron
#

here is fine

#

thanks

atomic summit
#

Here are both with and without, but with SPIRAM should ignore missing PSRAM if not found... but not tested.

slender iron
#

kk, thanks. you are ahead of me 🙂

meager fog
#

@atomic summit i get a COM port but nothing happens when i connect to it?

#

is that normal

#

esptool.py --chip esp32s3 -p COM11 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 4MB 0x0 firmware.bin

hidden oxide
#

Is it OK if I use the chat for communication, since I don't have a mic

languid whale
idle owl
atomic summit
#

Sorry @meager fog - I should have mentioned that bit. 😦

#

You should then be able to connect to it via rshell/screen/putty etc.

languid whale
thorny jay
#

What would be the recommended size for microSD card for Pi Zero 2W? I am shopping for small card, but maybe that mean slow too. Price are not really much cheaper, just that I know a 1GB or 2GB card will not be used for Pi OS and can be saved for booting into CP or data logging.

atomic summit
meager fog
#

oo

#

ok i think i got it working

atomic summit
idle owl
#

I'm asking because I would like to tag you on an issue if I end up filing one.

meager fog
#

thankfully the s3 mini seems to have the same pinout as s2

slender iron
#

@thorny jay I'd get the largest one that is cheap

#

no reason to restrict yourself to 1 or 2 gb

#

no reason to pay extra for speed though

idle owl
#

2GB SD cards are typically more expensive than larger ones lately.

slender iron
#

amazon here has 32G samsung card for $8 us

#

128 G is $19

atomic summit
#

Who'd ever need 128GB 😉 /ducks

slender iron
#

I do for $19

atomic summit
#

hahaha

#

That's crazy pricing. And how do they squeeze that much space into an sdcard!

slender iron
#

pretty amazing

spiral elk
#

You still need to have a 1gb/2gb or two lying around for hardware that can't handle larger though.

sour river
#

some larger cards might have >512 byte sectors, i think

slender iron
#

that's a good point

#

I've only tested with 8g and 32g

#

and not very thoroughly

manic glacierBOT
sour river
#

speaking of SD cards scott, how did that patch look? I'm going to hook my pi up to hdmi and uart and double check if my builds were working, and if not then maybe I'll be bugging you about that in a bit 😬

slender iron
#

@sour river the patch was only in the _mmc file that I don't think I'm using

#

since it is an sd card

sour river
#

ah, i was wondering if that was the case... gcc seemed to want it but that doesn't mean it was linked in

#

though i wasn't able to compile without it on gcc 10

slender iron
#

I'm on 10.3 aarch64-none-elf-gcc (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.3.1 20210621

#

that's the version string

#

lemme check in what I have now

sour river
#

yeah that's the same gcc as me

#

commit 07e1b9359e6881f0e915d452ba8c9355ef284a66 (HEAD -> rpi, origin/rpi) for circuitpython

slender iron
#

that's what I was on. just pushed: 522dd3f93

sour river
#

hmm but you don't get a bunch of out-of-bounds warnings when building for raspberrypi_zero2w?

slender iron
#

nope. when I run make -j 32 BOARD=raspberrypi_zero2w DEBUG=1

#

I'm on arch linux

#

make version 4.3

sour river
#

same

#

hmm

slender iron
#

the changes didn't look like an issue to me

sour river
#

interesting... was it the DEBUG=1? i just got a build with that

slender iron
#

ya

sour river
#

without DEBUG it fails because -Werror

#

though that's also there if DEBUG is true so.... idk haha

slender iron
#

¯_(ツ)_/¯

sour river
#

maybe with debug it optimizes that compile idk. anyway, good to know, now once i find a mini hdmi adapter and solder some headers i'll see what else is wrong with me

slender iron
#

ah, I see the errors you have when non-DEBUG

sour river
#

yep. the current version of that code that i could find was pretty different but looked like it was fixed

slender iron
#

oh, did you look at main idf? maybe I started with 4.3

sour river
#

main branch? i just pulled whatever was on rpi

slender iron
#

kk

#

the sd code comes from the esp-idf

#

and I reworked it

sour river
#

oh that main idf

#

yeah i'm making my comparison to that repo where they malloc a uint8_t array

slender iron
#

ah, right. I removed the mallocs

sour river
#

ah, gotcha

#

also i know i have mini hdmi adapters somewhere and i can't find them. infuriating. I curse every device ever that uses mini hdmi

slender iron
#

🙂

#

uart is the most helpful bit

sour river
#

yeah and i'm trying to convince myself to commit to headers on one side or another because it will help a lot, but then it's just not thin anymore

#

so i guess if i ever need a thin rpiz2w i'll just have to buy another... :P

slender iron
sour river
#

wow, i'm amazed! i'll have to think if i really have a project in mind haha. could be good for octoprint, for sure

slender iron
#

I ordered some as spares

sour river
#

always good practice. crazy that they're almost consumables at this point

#

i mean the original 0 was even more

#

did you ever try the NTC chip? sad that went away. I still have 3 and never really found a good place for them

#

ahead of their time, though

slender iron
#

no, not sure what you are referring to

sour river
slender iron
#

👍

sour river
#

I think it came out maybe... a month or two before the original Pi zero

slender iron
#

oh no. poor timing for them

sour river
#

still, it had wifi and battery input and a bunch of neat things like that, so it was worth it until the zero W came a couple years later

#

yeah

main furnace
#

I had one of those. Two actually.

sour river
#

only really made sense for embedded or really retro emulation since you needed a $15 adapter for hdmi

#

i had a pocketchip too. still do, and i'd like to make it my serial terminal for things like this

#

is it weird to think of it as 3-year-old retrotech? haha. it's like seeing an original pi model A

manic glacierBOT
manic glacierBOT
#

https://github.com/adafruit/circuitpython/pull/5565 notes that there is a design bug on v1.2 of this board: The MOSI and MISO pins to the external flash were switched. Also see https://github.com/sparkfun/MicroMod_Processor_Board-SAMD51/issues/2, which notes they hope to have fixed ones in stock. I'll open a new issue about fixing the pin mapping; let's close this one.

sour river
#

what's the baud rate for uart?

slender iron
#

115200

#

a mismatched config.txt can mess it up though

sour river
#

thanks. here goes...

manic glacierBOT
sour river
#

hmm nothing from uart on my image but no surprise

#

gonna try with your image from DD

#

sweet, that works. so my method to copy it is fine. even had my code from friday haha

#

i can compile with DEBUG=1

slender iron
#

I'm trying without debug and getting stuck in the mmu setup

#

-O3 is trying to use q0 so that may be the issue

#

bingo

sour river
#

nice!

#

just curious, how do you see it's getting stuck there? I'm not getting anything on uart with the no debug build

slender iron
#

openocd

#
-void setup_mmu_flat_map(void) {
+__attribute__((target("strict-align"))) void setup_mmu_flat_map(void) {
#

in peripherals

sour river
#

nice, that's the fix? lemme try it...

slender iron
#

ya, for non-debug

#

still breaks when usb is plugged in

sour river
#

nice, works for me now too

slender iron
#

great!

#

the cpu can't do unaligned access before the mmu is going

#

so the mmu init code needs to be aligned 🙂

sour river
#

i'll have to read up a bit to understand that better! but i'm glad you found it!

#

also USB works for me

slender iron
#

the drive appears?

sour river
#

oh, i didn't check mass storage

#

ok yeah no there's no USB storage, just the serial

slender iron
#

it might be disabled in your build

sour river
#

1

#

so i guess that means it's not working

slender iron
#

its weird to me that the cdc works still

#

right now everything stops for me when I plug in usb

sour river
#

oh, i'm using my patch btw

#

not likely that it would matter here though

slender iron
#

I copied those changes into mine too

sour river
#

hm, well when i power mine from the second usb port i can access ttyACM0 and it shows the same output as my UART terminal

slender iron
#

hrm

sour river
#

yay sway with screenshots

#

are you powering up and then plugging in USB or powering from the second USB right away?

slender iron
#

power and then usb

#

so two usb

sour river
#

that is different to me, then

#

maybe it works as long as USB is connected at boot idk

slender iron
#

¯_(ツ)_/¯

sour river
#

anyway, that's at least one mystery solved! pretty good for today

#

thanks for your help too. I'll see if I can keep up with this port when i have time 👍

slender iron
#

thanks! good to have someone confirming my work

sour river
#

yep 👍 also it's pretty freakin' cool to be running code on a pi bare metal! didn't think you'd get there so quickly so this is awesome

slender iron
#

😄 feels like it took a while

#

lots to learn

sour river
#

well, i guess from when i heard you mention it to now it was a few months, but i was busy in between and so it was kindof the next deep dive for me haha

slender iron
#

I wish it felt that way for me

#

I'm ready to have it in main

sour river
#

hah, i bet. well, if there are things I can test or experiment with that would help, i'd enjoy the challenge! I think i saw a github issue for it, not sure if that's current

#

I have some but not all Pi's, and a healthy assortment of SD cards and cables :P except those mini hdmi adapters wherever they are... but that's really only so i can mini-HDMI to mini-HDMI for my portable display. maybe it's an unhealthy assortment of cables

slender iron
#

things get easier once usb is relatively stable

sour river
#

that makes sense

#

though how many ports do you have video out to do, too?

slender iron
#

not enough 🙂

sour river
#

hahahaha

#

maybe you should get some NTC Chips of your own 😉 they would have been perfect for this...

slender iron
#

I'll be in microcontroller land after this

sour river
#

yeah? what's up next, if you know?

slender iron
#

esp s3 unless someone beats me to it

sour river
#

that's a pretty powerful looking chip, wow. do you do anything with the vectorization/AI stuff?

#

though i guess half a meg of sram puts it lower than a lot of other ones

slender iron
#

I don't do anything with it yet

manic glacierBOT
sour river
#

hmm not sure if this is the pi or my computer, but if i leave the serial connection unattented for a while, screen closes and I can't see neither the pi nor the other uart adapter until I reboot... 😬 so there might be some driver there that's crashing for me, or i just have a garbage laptop

analog bridge
#

@slender iron I created a branch post my C3 work, containing mine, yours and @atomic summit's S3 work but I haven't updated it since then so apart from the merge conflicts and code updates for a newer v4.4 commit... a PR can be made with S3 support and idf v4.4.

slender iron
#

@analog bridge thanks for the link. That’s good place for us to start

analog bridge
#

I am already working on it 🙂

manic glacierBOT
hidden oxide
#

Is there a notes doc for next Monday's meeting

#

?

#

Hey

#

Welcome to Discord!

bronze kernel
#

I guess I wanted to ask something here but i forgor 💀

#

My brain switched off

#

Sorry for off-topic btw

analog bridge
# hidden oxide Is there a notes doc for next Monday's meeting
#

It can be found in pinned messages.

manic glacierBOT
manic glacierBOT
manic glacierBOT
dusk mauve
#

I'm deep in the weeds working out gesture analysis on the popular APDS-9960 prox/gesture/color/light sensor as a combo learning exercise and (hopefully) contribution to improving the somewhat flaky gesture detection in the driver. Its been a fun adventure with a pretty cool sensor.

I'm a bit frazzled by trying to interpret gesture data though. It feels like a simplified 4-pixel computer-vision problem. That's a space I have almost no experience in, which makes it appealing. 😂

Basically, the FIFO provides batches of 4 reflective "proximity" type measurements in ~1.6 ms to ~155 ms increments (depending on config). The implementer has to ingest, process, and "decode" this data to determine what the sensor may or may not have seen.

Does anyone here have experience processing this kind of data? This kind of problem feels like the kind of thing that someone with domain experience would know exactly what to do with.

I found some very helpful examples in an Arduino library for the sensor, which has helped with producing a working proof-of-concept in CircuitPython. That code is probably way to heavy for a SAMD21 board but today (or this week) I'm hoping to whittle that down to something I can put in a PR. 🙂

Here are my (way-too-verbose) notes so far, in case anyone else is crazy enough to take a peek into this rabbit hole with me.

https://github.com/fivesixzero/circuitpython-experiments/tree/main/clue-nrf52/apds9960-testing

idle owl
dusk mauve
idle owl
dusk mauve
idle owl
dusk mauve
idle owl
manic glacierBOT
#

Like #5571, but for Access Point. Allow setting the AP mac_address. Also, when hostname is set, set it for AP as well as Station.

Test code, with results in the comments:

import time
import wifi
from secrets import secrets

# after init, wifi is started/enabled, wifi mode is station
# hostname is default, mac_addresses are default
print("# Defaults:")
print(wifi.radio.hostname)
print(f'{wifi.radio.mac_address[5]:02X}')
print(f'{wifi.radio.mac_address_ap[5]:02X}')

...
idle owl
#

FYI, there's been some indication that Mu doesn't work on Windows 11.

dusk mauve
tulip sleet
# idle owl FYI, there's been some indication that Mu doesn't work on Windows 11.

I just installed Mu 1.1.0-beta.6 on Windows 11, without there having been a previous install. It installed fine, and I was able to connect to a CircuitPython board and the REPL without difficulty. Someone had trouble starting beta.6 on Windows 10, and uninstalling the previous version first, uninstalling beta.6 and then reinstalling fixed the problem.

idle owl
tulip sleet
#

@idle owl let's put in a hint to uninstall previous versions before instalilng a new version. It even says on https://codewith.mu/download : Windows users: due to the nature of MSI installers, please remove old versions of Mu before installing the latest version.

idle owl
#

Ok

tulip sleet
#

i didn't know whether it would work or not, but glad that it is; one less support headache

crimson ferry
tulip sleet
crimson ferry
#

I won't have the board for another few hours, so can't verify, but a thread in #help-with-circuitpython seems to indicate it. No schematics posted yet.

tulip sleet
#

i can get a schematic

#

hold on

idle owl
#

@tulip sleet Note added to Welcome page. Copied the Mu text. Feel free to tweak it if you would rather it be something else.

tulip sleet
#

i think that's fine

tulip sleet
#

that's the basic, let me get the BME280 one

crimson ferry
#

that looks OK, but I was mistaken, it's the I2C power control that was reported inverted

#

I'm not sure how to interpret that one on the schematic

#

I think it turns off the BME

tulip sleet
#

i think it is inverted, we were talking about it internally yesterday

crimson ferry
#

open circuit, I would guess, on the non-BME version

#

I'm receiving only the non-BME version

solar whale
#

FYI -- I was playing with one of the BME280 feathers2's yesterday. I found that if I set I2C_POWER=False it seemed to work reliably but if I set it True, it became intermittent. works sometimes -- or gice an OSError (19) unsuported operation

crimson ferry
#

floating input / high-Z if not set to False, presumably

solar whale
#

seems so.

crimson ferry
#

sounds inverted to me

#

happy to submit a PR if we're confident though... duplicate the pin like MagTag, or change it wholesale and lose the old uninverted name?

solar whale
#

My testing was not exhaustive.

crimson ferry
#

ladyada mentions in the TFT PR that pins may change in RevB board

solar whale
#

The LC709203F did not seem to be impacted. Now I see from the schematic that i uses VBat, not VSENSOR so that makes sense.

manic glacierBOT
#

Thonny IDE allows testing local scripts without saving them to the device first -- when the user selects "Run" command, the code will be submitted to the raw (or paste mode) REPL.

Before this it tries to clear the environment (in order to not depend on the state from previous commands). With MicroPython device it simpl orders soft-reboot in the raw mode, which disables running main.py. With CircuitPython this can't be used, so it simply soft-reboots and tries to interrupt code.py as quickl...

tulip sleet
#

you could submit it that way and we can discuss it in the PR. Scott can weigh in

lone sandalBOT
orchid basinBOT
manic glacierBOT
#
[adafruit/circuitpython] New branch created: anecdata\-patch\-1
#

this is the code I am using to test -- I just change the ip.value from False to True but today , it does not seem to care.

# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

import time
import board
from adafruit_bme280 import basic as adafruit_bme280
import digitalio

ip = digitalio.DigitalInOut(board.I2C_POWER)
ip.switch_to_output()
ip.value = False
# Create sensor object, using the board's default I2C bus.
i2c = board.I2C()  #...
dusk mauve
#

@idle owl (carrying over from the help channel)

Has APDS-9960 gesture handling with the CircuitPython driver always been wonky? Or is it just me? Probably should've asked that before starting my epic (educational) journey. Issues page seems to point to "pretty much" but I'm still pretty new around here.

manic glacierBOT
dusk mauve
idle owl
#

I was super excited about the concept, and had a project in mind, and Limor was quick to temper my excitement with the reality of the actual gesture sensing.

#

"It has a steep learning curve, you have to be really close to it, and it's still finicky."

#

etc.

#

So.... Yeah it's always been iffy. It's not what we necessarily promote about the sensor, since it does a lot of things. Heh.

manic glacierBOT
dusk mauve
#

Definitely a case where async pin-interrupt callbacks would provide a much cleaner implementation. But could still useful in a single-use-case synchronous script, possibly, as long as it, you know, works reliably.

idle owl
#

Things have to be backwards compatible for now,. but... have at?

#

We were looking for something to try it out with. The LED Animation library was up first, but it turns out it was written so well that it doesn't really need asyncio. (It would still benefit from it, but it doesn't need it)

dusk mauve
#

Its been in the back of my mind, for sure. There are so many different ways to handle things that I'm not even sure async handling would be the best approach.

idle owl
#

Fair enough!

#

Well, it's there. Both in the core and in a Python wrapper/helper for it.

dusk mauve
#

Nice, thanks for pointing me in that direction. I did see the lines in the 7.1.0-beta release notes but haven't dug in too much yet. Soon(tm). 😄

#

Back to my favorite jupyter notebook... 😄 🗒️

idle owl
#

The jupyter notebook to melt your brain!

manic glacierBOT
slender iron
#

@tulip sleet do you have the settings to upload to s3 from cli?

#

I'm trying to upload the aarch64 compiler from the web console and it's failing

tulip sleet
slender iron
#

nah, I was able to login and attempt the upload

tulip sleet
#

i was off making popcorn 🙂

slender iron
#

np, I realize its late

#

I'm just getting the CI building the pi images

tulip sleet
#

I'm working on the asyncio learn guide

slender iron
#

pi4 is working ok. zero 2w is still unhappy

#

nice!