#circuitpython-dev

1 messages ยท Page 386 of 1

onyx hinge
#

os.confstr(os.confstr_names['_SC_CIRCUITPYTHON_BOARD']) -> 'adafruit_feather_rp2040' or whatever

tulip sleet
# onyx hinge https://docs.python.org/3.8/library/os.html#os.confstr we could implement unix-c...

This seems really specific and unusual:

>>> os.confstr_names
{'CS_GNU_LIBC_VERSION': 2, 'CS_GNU_LIBPTHREAD_VERSION': 3, 'CS_LFS64_CFLAGS': 1004, 'CS_LFS64_LDFLAGS': 1005, 'CS_LFS64_LIBS': 1006, 'CS_LFS64_LINTFLAGS': 1007, 'CS_LFS_CFLAGS': 1000, 'CS_LFS_LDFLAGS': 1001, 'CS_LFS_LIBS': 1002, 'CS_LFS_LINTFLAGS': 1003, 'CS_PATH': 0, 'CS_XBS5_ILP32_OFF32_CFLAGS': 1100, 'CS_XBS5_ILP32_OFF32_LDFLAGS': 1101, 'CS_XBS5_ILP32_OFF32_LIBS': 1102, 'CS_XBS5_ILP32_OFF32_LINTFLAGS': 1103, 'CS_XBS5_ILP32_OFFBIG_CFLAGS': 1104, 'CS_XBS5_ILP32_OFFBIG_LDFLAGS': 1105, 'CS_XBS5_ILP32_OFFBIG_LIBS': 1106, 'CS_XBS5_ILP32_OFFBIG_LINTFLAGS': 1107, 'CS_XBS5_LP64_OFF64_CFLAGS': 1108, 'CS_XBS5_LP64_OFF64_LDFLAGS': 1109, 'CS_XBS5_LP64_OFF64_LIBS': 1110, 'CS_XBS5_LP64_OFF64_LINTFLAGS': 1111, 'CS_XBS5_LPBIG_OFFBIG_CFLAGS': 1112, 'CS_XBS5_LPBIG_OFFBIG_LDFLAGS': 1113, 'CS_XBS5_LPBIG_OFFBIG_LIBS': 1114, 'CS_XBS5_LPBIG_OFFBIG_LINTFLAGS': 1115}
onyx hinge
#

and inconvenient

tulip sleet
#

and I don't see an analogue in the host computer world

#

how are you feeling about board.id?

onyx hinge
#

I think the main "problem" with board.id is requiring edits to all the board.c files.

#

I could try to automate it via awk

jaunty juniper
#

interestingly it's hardcoded in every port without using MICROPY_HW_MCU_NAME but it seems to have the same value

onyx hinge
#

I/somebody

tulip sleet
#

well, the PR has already done it, we just need a sed over it

jaunty juniper
#

I did automate it with python to begin with

onyx hinge
#

oh there's a PR? even better.

tulip sleet
#

i think a no-parse solution is the easiest for the libraries and code that need to check

jaunty juniper
#

why do some boards use board_global_dict_table and others board_module_globals_table ?

tulip sleet
#

I think there is no good reason, it was an historical accident

#

I like the latter better. That could be another global sed fix.

#

the name used in shared bindings for the module dicts is, for example, STATIC MP_DEFINE_CONST_DICT(busio_module_globals, busio_module_globals_table);

#

actaully it's not so consistent in modules either

#

well, dict_table is used in class dictionaries, but globals_table is used in module dictionaries, it looks like

#

since board is a module dict, globals_table follows that pattern

manic glacierBOT
onyx hinge
#

I wonder if we could have a macro at the top of the board globals_table that would expand to zero or more entries in the globals table .. it could reduce duplication, such as by automatically adding board.I2C / board.SPI, and of course this new board.id

manic glacierBOT
#

I misunderstood #5092 and was looking at how PWMOut calculates the frequency divisor and top value. It's not that accurate at low frequencies, but I'm not sure it's any worse than other PWMOut impls.

Using PWMOut to make musical notes is kind of an edge case anyway, since there are other ways to do it, and is a trade-off of frequency accuracy vs duty-cycle accuracy; the latter is what the current impl favors.

#

I think this bug extends to the Metro Express ESP32-S2 however I can no longer reproduce it.

Similarities:

  • Metro ESP32-S2 is was using network connections
  • As the gc.mem_free() ram ran out instead of freeing memory, the board would reset.

I was using the .bin nightly build from August 21st.

This morning I moved to the 7.0 beta .bin, and experienced the same issue. In an effort to find the minimum amount of code needed to reproduce the issue, I was using a large strin...

onyx hinge
#
 STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
+    CIRCUITPYTHON_BOARD_STANDARD_ITEMS
     { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) },
```something like that
jaunty juniper
#

I was thinking maybe replacing the whole board_module_globals_table and board_global_dict_table line with a macro

CIRCUITPYTHON_BOARD_START_PINSC
...
CIRCUITPYTHON_BOARD_END_PINSC
tulip sleet
#

there are boards that only have I2C, etc.

onyx hinge
#

hiding {} inside of macros doesn't make me thrilled ๐Ÿ˜•

#

@tulip sleet the STANDARD_ITEMS macro can be carefully assembled so that it works if there's no SPI, etc

tulip sleet
#

MicroPython generates the pin dict from a .csv file. I took that out because it was harder to read than the expanded C code

onyx hinge
#

but this is making work where none is really needed atm

tulip sleet
#

One reason to go back to a machine-readable list is to generate the IGNORE settings automatically (or turn them into INCLUDE settings). Scott and I discussed that briefly, I can't remember in what setting.

#

but the current list could be parsed in an ad hoc way too

jaunty juniper
#

how about a toml file, would that be more readable ?

tulip sleet
#

oh yeah, and it could have comments, which is the big thing I missed in the csv file

jaunty juniper
#
[pins]
TOUCH2 = pin_PA03
NEOPIXEL = pin_PA15
#

something like that

#

without even the [pins] section actually

tulip sleet
#

that info could also be used to make mpconfigboard.h, or at least part of it

#

i think we need a [default_devices] section.

#

Ultimately we want a board and its details to be described in toml, whatever those details are: name, id, pin names, crystal or not, etc.

#

modules to include, etc.

#

the q is how much easier would it be to do this than the current scheme, so how worth it is it?

#

we had several errors recently involing the IGNORE pins, so that's a slight motivation

#

Information about a board could also include info that would be in circuitpython-org, so more of that could be added automatically (though adding the pics is an issue)

manic glacierBOT
#

It must be some kind of object that is moved but can't be moved safely, making this change causes the crash to go away for me:

--- a/py/gc.c
+++ b/py/gc.c
@@ -780,6 +780,7 @@ bool gc_has_finaliser(const void *ptr) {
 }
 
 void *gc_make_long_lived(void *old_ptr) {
+    return old_ptr;
     // If its already in the long lived section then don't bother moving it.
     if (old_ptr >= MP_STATE_MEM(gc_lowest_long_lived_ptr)) {
         return old_ptr;
manic glacierBOT
lone axle
manic glacierBOT
manic glacierBOT
#

@tannewt This error is about supplying an optional buffer that's split into two for reading WaveFiles, but those buffers is not used for playing unless no conversion is done. Propagating the buffer sizes through is not so easy, and there are some assumptions about using 512-byte buffers. Given that audio is working better, I don't really see a use case for it right.

So what do you think about just dropping the buffer parameter from the WaveFile constructor? It is not used by any Lear...

manic glacierBOT
#

It shouldn't be an issue with current implementation of post_usb(), irq is disabled and reinstalled with cpython irq. The race condition is probably on other issue.

It is an issue for CircuitPython as-implemented because an IRQ occurs outside of CircuitPython and therefore we don't queue up a background task to handle the resulting events. A simple fix would be to queue up the usb background function after we switch to our own IRQ.

I'd still like to emphasize that IRQ settings are d...

#
  • Fixes #5167 by defining away the problem.

This error is about supplying an optional buffer that's split into two for reading WaveFiles, but those buffers is not used for playing unless no conversion is done. Propagating the buffer sizes through is not so easy, and there are some assumptions about using 512-byte buffers. Given that audio is working better, I don't really see a use case for it right now.

The buffer arg is not used by any Learn Guide or library examples.

In the long...

#

Does your simulator do a complete reset each time?

Yes. It first creates a fat file system with the user's code, writes it to the flash, and then starts the simulation.

I'd really appreciate any kind of solution / workaround that will let the user see the output from the very beginning. One workaround that comes to mind (which doesn't require any change in CP) would be to write code.py into _code.py (or similar), and then when the user starts the simulation, wait until we see the pro...

slender iron
#

@onyx hinge are you looking at the esp wdt crash?

manic glacierBOT
onyx hinge
#

@slender iron no just briefly earlier

slender iron
#

the long lived thing is a good lead

#

we must be handing a pointer to the idf that we move

manic glacierBOT
#

Please describe the new format somewhere. I'm not sure we want to co-opt the nvs space for something that doesn't use the IDF's standard format.

It does use the IDF's standard format (both the old and new code do), in the "CPY" namespace of the nvs.

Old code: Each byte is stored as a separate u8, with the key being the index into nvm. This spends almost all of the storage on metadata (way under 1000 entries of nvm could be assigned before the 20kB of nvm partition was used up) and has...

onyx hinge
#

@slender iron yeah I re-tested in the hopes that the one long-lived problem we'd fixed would fix that too, because it seemed like a really good lead and nothing I'd looked at last week. when that didn't work, I reasoned that I could pretty quickly determine if the long-lived moving process was still in the chain of events, and it looks like it is.

slender iron
#

I hadn't thought of that yet because the i2c display move is different from the long lived one. The display is moving out of the heap to supervisor allocated space

#

I just thought it might be the scanning structure but it's not...

manic glacierBOT
idle owl
#

@tulip sleet Are there any boards that do not have adafruit_bus_device natively?

#

The CP module version.

#

Oh it looks like a bunch don't.

#

Nevermind. I was going to see about having the Project Bundler ignore it, but that's not an option it looks like.

manic glacierBOT
#

I didn't go reading the source for how nvs works, but I just have the observation that when the nvs is full you cannot update an existing key. This made me jump to the conclusion that at least temporarily, for a given key, the old & new data are both stored within the nvs partition. This makes sense, because they want to allow an atomic update of all nvs content when calling the nvs_commit function in the esp-idf's API.

nvs doesn't allow updating a part of a blob, you can only repla...

idle owl
#

@gilded cradle Is zip file manipulation a native thing in Linux? Or specifically, on Raspberry Pi?

tidal kiln
#

like extracting a zip? if so, yes.

#

zip and unzip

idle owl
#

@tidal kiln Yeah, trying to figure out once and for all how to structure breakout guides with the Project Bundle.

#

Because it used to be "CP Install" "Python Install" "CP and Python usage"

#

but it doesn't really work that way anymore with the Bundler.

#

I think I'll leave it as I have it now, and assume that folks who are using this stuff on RPi etc know how to create a file and run it.

tidal kiln
#

since they'll end up with a .zip from the bundler?

idle owl
#

I'm not indicating Python folks should download the zip.

#

I thought I might for a minute there.

#

Then decided against it.

#

But maybe that's a better idea?

#

Yeah, that was why I asked in the first place though.

tidal kiln
#

yah, on a pi you wouldn't really need anything but the code, right?

idle owl
#

Right.

tidal kiln
#

since you'd pip install the libs

idle owl
#

Exactly.

#

So downloading the zip seems extraneous.

tidal kiln
#

so could be confusing...i downloaded the .zip and what do i do with all these files?

jaunty juniper
#

(and the libs in lib/ would not be seen anyway)

idle owl
#

I thought about including a paragraph stating something like "Save the following as code.py where it's convenient, and then navigate to it via command line and run python3 code.py"

#

Honestly, if we weren't supporting 6 and 7, I'd have them download the bundle.

#

Because the first level would contain code.py

jaunty juniper
#

what about projects that have images and support files ?

idle owl
#

but it doesn't, so it's more confusing.

#

Oh good point.

#

Ugh.

#

Most breakout guides don't have that though.

tidal kiln
#

this is for breakout guides?

idle owl
#

Like, this is a simpletest for a CO2 sensor.

jaunty juniper
#

ah breakouts

tidal kiln
#

i just wget it, but not sure how easy that'd be to guide-ify

idle owl
#

Oh hmm

#

yeah

tidal kiln
#

a bit clunky, but can use the "copy code" to get it into some text editor and save

idle owl
#

That was another thought

#

it's what I do ๐Ÿ˜„

idle owl
#

like "Library installation and Example download" or something

#

What we used to do was use the REPL for the example demonstration

#

but A. doesn't work with all examples and b. doesn't allow for Bundlefly downloads.

#

So it's not a great solution, and we haven't addressed how to handle the Python side of that.

#

Or add a separate Python Example Download section below the lib install section might work better.

tidal kiln
#

or go ahead and get bundle zip but only grab code.py from it?

idle owl
tidal kiln
#

it'd need to be the "raw" url

idle owl
#

For now.

tidal kiln
#

which is where everyone seems to go wrong and end up with HTTP instead of python code

idle owl
#

Hmph.

#

ok.

#

I guess Bundle explanation it is.

tidal kiln
#

wget the second one and you get http

idle owl
#

When I click "raw"

tidal kiln
#

yep. or that url.

idle owl
#

Ok.

#

@tidal kiln What do you feel would create less support issues? A section telling them to dig code.py out of the bundle, or a short section with the wget command listed?

tidal kiln
#

dig

idle owl
#

Ok. Will do.

tidal kiln
#

could give them an unzip snippet to just extract code.py

idle owl
tidal kiln
#

yah. thats probably ok.

#

there's a separate subfolder for CP versions, right? in the zip

idle owl
#

Mention it doesn't matter which version you choose?

tidal kiln
#

maybe add some text like "navigate to code.py in any/either subfolder"?

idle owl
#

Ok

tidal kiln
#

right. yah. just something that mentions it'll be buried, and doesn't matter which.

idle owl
#

Trying to figure out how to keep it agnostic because once 7 is stable, we don't need 6 support in the bundle.

#

I don't really want to go back and update every guide.

#

At least I think that is the plan.

#

"Extract the resulting zip file, and navigate to the code.py file. The CircuitPython version does not matter."

#

then if there's no version, shrug.

#

Not certain I like it. But it's a start.

tidal kiln
#

@idle owl unzip -o -j FooBundle.zip */*/code.py

idle owl
#

Woah what does that do

tidal kiln
#

-o to force overwriting existing file, -j to "junk" directory structure (no subfolders get created)

#

and then wildcards to go down to subfolder

idle owl
#

So that results in a local code.py file in the current directory?

tidal kiln
#

yep

idle owl
#

Dang. Nicely done.

tidal kiln
#

a bit hacky, it'll grab all versions

#

and overwrite as it goes

#

but should all be same, so doesn't matter

idle owl
#

Right, ok.

#

Excellent. Thanks!

tidal kiln
#
$ unzip -j -o Macropad_Hotkeys.zip */*/code.py
Archive:  Macropad_Hotkeys.zip
  inflating: code.py                 
  inflating: code.py  
idle owl
#

Oooh, even better, the library examples are always in a folder called examples.

#

I mean MacOS appends a number to them

#

but ideally it'll be what it is for folks on Linux.

tidal kiln
#

ok, can adapt the wildcard part as needed

#

that was from a guide bundle

idle owl
#

Fair enough

tidal kiln
#

let me actually verify that's all same on pi

idle owl
#

unzip -o -j examples.zip */*/code.py will still work though right?

#

Oh ok

#

Please do

tidal kiln
#

that was tested locally

jaunty juniper
#

I'm getting errors 500 downloading bundles

idle owl
#

@jaunty juniper Really?

tidal kiln
#

which guide? i just grabbed that macropad hotkeys bundle ok

idle owl
#

Oh.

#

I'm getting it too in a private window.

jaunty juniper
#

ah it came back

idle owl
#

I'm getting a 500 error here.

#

I'll let dev know regardless.

tidal kiln
#

@idle owl yah, looks same on pi

idle owl
jaunty juniper
#

wait it looks like every time it's the first time the link gives me 500

#

or it's random

idle owl
#

I chose the Rubber Ducky guide.

tidal kiln
#

just downloaded that touch deck bundle ok

idle owl
#

I was in a private browser window, not logged in.

timber mango
#

Does anyone know if the nRF52840 Feather CP port initialize busio.SPI differently when the device is running on battery, rather then on USB power?
I'm having a very strange problem with running a SPI device on it, when on battery power via JST connector, and i've narrowed it down to being a matter of what the nRF is running on when the busio.SPI class is instanced.

idle owl
#

@tidal kiln Anne thinks it might be confusing to microcontroller folks, having all the CPython instructions in the middle. I'm not sure how else to do it. I guess I'll run it by Limor and see if she wants it done some other way.

timber mango
# timber mango Does anyone know if the nRF52840 Feather CP port initialize busio.SPI differentl...

I actually just worked around the issue, by initializing a dummy SPI instance, and then another one, which is then used.
Looking at https://github.com/adafruit/circuitpython/blob/main/ports/nrf/common-hal/busio/SPI.c i can see that the code will prefer SPIM3 first, which is 32Mhz, and then SPIM2 which is 8Mhz. So guessing there is some issue with initializing SPIM3 when running on battery?

GitHub

CircuitPython - a Python implementation for teaching coding with microcontrollers - circuitpython/SPI.c at main ยท adafruit/circuitpython

#

Or maybe the frequency is being set incorrectly.. Unfortunately i don't have any equipment to verify this

gilded cradle
idle owl
solar whale
timber mango
solar whale
#

Very possibly -- I vaguely recall the issue and need to revisit it. Thanks for all your effor tracking this down

timber mango
#

Its all very weird how its related to running of a battery though

solar whale
#

Sure is...

#

I have been using batteries on M4 and esp32s2 boards regularly, guess I never tried an nRF52840

timber mango
#

Thanks for looking into it!

#

I was surprised how low the sleep power usage was on the nRF, so wanted to switch to this from RP2040 which is not great for low power sleep

#

its like 0.3ma in time.sleep on nRF

solar whale
#

I have been using an esp32s2 (unexpected maker feathers2) for sleep with the rfm9x -- it has been working well.I don't have the numbers ofhand.

#

I'll be interested to try the nRF as well now that you have prodded me ๐Ÿ˜‰

manic glacierBOT
slender iron
#

@tulip sleet do you want me to do a beta.1?

tulip sleet
#

do you want to wait for some more PR's before that? I would have time to do one on Friday.

manic glacierBOT
slender iron
#

@tulip sleet maybe? I was thinking the HID fix would be a bit urgent

tulip sleet
#

I put a note in the guide to use Absolute Newest on or after a certain commit.

#

also i well might have time to do a release starting tonight and finishing tomw morning

slender iron
manic glacierBOT
idle owl
#

@ember iris SCD-30 has been running on RPi for 57 hours or something. I'm going to stop it at this point. I clearly couldn't reproduce it.

ember iris
slender iron
#

what does purple blink on magtag mean?

onyx hinge
#

@slender iron I think it's from tinyuf2

#

ports/esp32s2/README.md:- PIN_BUTTON_UF2 is gnd when 2nd stage bootloader indicator is on e.g RGB led = Purple. Note: since most ESP32S2 board implement GPIO0 as button for 1st stage ROM bootloader, it can be used for dual-purpose button here as well. The difference is the pressing order:

slender iron
#

must be

#

the 4.3 merge for me just blinks purple...

#

and alpha.4

#

so I gave up

onyx hinge
#

that's weird

#

alpha.4 doesn't run at all?

slender iron
#

it blinked purple for me for some reason

#

loaded with uf2

manic glacierBOT
gloomy shuttle
manic glacierBOT
onyx hinge
#

@slender iron did you verify my finding that effectively disabling the "make long lived" machinery fixed it?

slender iron
#

I did

#

though I'm not sure its actually fixed vs just not breaking

onyx hinge
#

true

manic glacierBOT
#

Here is the minimum code that still caused the crash

from adafruit_portalbase.wifi_esp32s2 import WiFi
from secrets import secrets
import gc

wifi = WiFi()
wifi.connect(secrets["ssid"], secrets["password"])

print("wifi connected")

# crashes here
gc.collect()

print("gc.collect() finished")

However, this code doesn't crash

from secrets import secrets

import gc
import wifi
import ssl
import socketpool
import adafruit_requests

wifi.radio.connec...
onyx hinge
#

I wonder if @gloomy shuttle 's reduced test case will run on kaluga so we can get a debugger on it

#

looks like should

#

@slender iron the long-lived object is a copy so what if the object has a finaliser? will it run earlier than it should be permitted to?

#

.. when the original is gc'd

slender iron
#

ya, maybe! I hadn't thought about double running a finaliser

onyx hinge
#

that said I think one of the permutations I tried earlier was supposed to skip moving when a thing had a finaliser

#

none of the objects passed to gc_make_long_lived in the failing case seem to have a finaliser

manic glacierBOT
#
diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c
index bd6a2b44f..8389ca24a 100644
--- a/shared-bindings/socketpool/SocketPool.c
+++ b/shared-bindings/socketpool/SocketPool.c
@@ -47,7 +47,7 @@
 STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
     mp_arg_check_num(n_args, kw_args, 1, 1, false);
 
-    socketpool_socketpool_obj_t *s = m_new_obj_with_fina...
onyx hinge
#

that makes no sense, so goodnight

manic glacierBOT
#

It is an issue for CircuitPython as-implemented because an IRQ occurs outside of CircuitPython and therefore we don't queue up a background task to handle the resulting events. A simple fix would be to queue up the usb background function after we switch to our own IRQ.

I am well aware of the background task, and post_usb_init() did removed the installed ISR in the tud_init() and installed its own. There should be no issues for circuipython with current implementation.

manic glacierBOT
#

I added the buffer argument to be able to reuse the same pre-allocated buffer, and avoid memory errors stemming from repeated re-allocation of that buffer when playing different sounds repeatedly. I think it's a worthy thing, and rather than removing it, we should make everything use it instead. However, I can't work on this, so it's up to you to decide.

I'm using this in the Vacuum Invaders game, and it has solved a problem of memory fragmentation there, but I am not aware of any other ga...

manic glacierBOT
#

See this Forum thread for the details:
https://forums.adafruit.com/viewtopic.php?f=57&t=182604&p=887344#p887344
Summary:
with an RFM9x featherwing mounted on a nRF52840, all works normally when powered vis USB, but when powered via a LiPo battery, the rfm9x fails its version check.

The OP found a workaround:
create a dummy SPI instance before creating the real SPI instance that is fed to the rfm9x init.
This appears to force the nRF52840 to is an different SPIM and it works. It is not...

solar whale
manic glacierBOT
#
  • Fixes #5167

Validate that the optional WaveFile constructor buffer argument is 8-1024 bytes long. Larger than 1024 does not work and will not improve performance anyway. 8 was empirically determined to be the lowest usable bound for a MacroPad.

As part of this, I added a new argcheck.c arg validator, and removed an unused one. The new validator could be used a few other places, but I'll defer doing that now since we are working on more general arg validation schemes. I didn't se...

lone axle
tulip sleet
manic glacierBOT
manic glacierBOT
idle owl
onyx hinge
#

well this is a new one. it looks like you have to talk on an I2C bus to turn on the neopixel power

idle owl
#

On what

onyx hinge
#

at power on PERI_POWER_ON is floating. I don't know my mosfet symbols well enough to know if that will pass power through Q12 or block it

#

@idle owl this espressif "hmi devkit"

idle owl
#

Ah

onyx hinge
#

PERI_PWR_ON is on a TCA 9554 I/O expander

idle owl
#

Huh.

onyx hinge
#

@tulip sleet do you read schematics well enough to tell me if PER_VCC_3V3 is on if PERI_PWR_ON floats?

#

V_GS is 0v so I imagine that means it'll be off

tulip sleet
#

it is a P-channel, so it's on when the gate is grounded. This is pulled up, so ground to turn off

#

so it looks like it's normally off

#

floating is not great

#

CORRECTED!

onyx hinge
#

well, I mean, it's not floating because there's the pull

tulip sleet
onyx hinge
#

but the I/O expander is not driving it

#

thanks!

tulip sleet
#

wait a minute, I might be wrong

onyx hinge
#

when -VGS is zero, it is off, as -VGS gets bigger it conducts.

#

while N-channel work with +VGS

#

.. right?

tulip sleet
#

also need to consdier depletion vs enhancement

onyx hinge
#

oh, hm

#

this is enhancement type, from the symbol?

onyx hinge
#

it's starting to look like help-with-electronics in here ๐Ÿ™‚ thanks dan

tulip sleet
#

sorry, i have not used MOSFETs much and I have to look things up

idle owl
#

It was help-with-electronics in here the other day with the SPEAKER_ENABLE pin checks because I needed Dan's help ๐Ÿ˜„

onyx hinge
#

I propose that henceforth they have to put "this way up" stickers on each transistor

manic glacierBOT
#

board_id is fine, using lowercase helps separate it from the pin-related entries.

There was a discussion of possible changes to pins.c and the way it's handled that could impact this, like having a macro inserted as the first element in the globals table instead of the direct code, as a way to insert entries like this, and maybe automatically insert board.I2C and such when default pins are defined, to reduce the amount of manual entries in pins.c to add a board (and the ambiguity of when...

tulip sleet
#

@onyx hinge p-channel depletion are rare

manic glacierBOT
idle owl
#

Forgot how much I don't like working with Pico. This counting-the-pins-to-find-the-one-you-want-because-there's-no-labels thing gets old really quickly.

#

Makes me pick GP0 for everything I can.

#

"But the ground pins are square!" Yeah ok, I soldered headers on it, they all look like solder-blobs now, thank you.

#

@onyx hinge As soon as I get the code embedded into this page, I'll send it your way to take a look at it. It's the MP3 template filled in for Pico.

onyx hinge
#

hmmm the factory test app comes up scrambled on the hmi devkit, I wonder if the app is busted or the device

timber mango
onyx hinge
idle owl
#

For some reason, I consistently have about a 50% chance I will type "decoder" or "encoder" as "decode" or "encode". Writing guides for MP3 and rotary encoders gets frustrating. ๐Ÿ˜„

idle owl
#

Is everything enclosed? Or can you wiggle connections.

onyx hinge
#

it's all sandwiched together

idle owl
#

I thought as much. So much for that plan.

onyx hinge
#

I'll probably grab & build their default app for myself, I have experienced that often devices ship with software that isn't quite right

#

but I'll also open it up at some point, I have to if I want to install the battery

idle owl
#

Ah

onyx hinge
#

Adafruit CircuitPython 7.0.0-beta.0-44-gd8b3d5af0-dirty on 2021-08-26; HMI-DevKit-1.1 with ESP32S2 ok that's a good start ๐Ÿ™‚

idle owl
onyx hinge
#

should it say "following additional hardware"?

#

You'll need the following hardware to complete the examples on this page.

idle owl
#

yes.

#

Updated the guide and the template.

onyx hinge
#

should there be a spot to explain which pins can be used? for instance on rp2040 it can be any pin, but on samd51 it can be just one of 2 pins if I recall correctly...

#

or is giving an example of SOME usable pin good

idle owl
#

Hmm.

#

That's valid.

#

I can add something in about that.

#

I think it's worth including.

#

We do it for other concepts.

#

I2C, PWM, etc.

onyx hinge
#

the project zip is not including any mp3 files I think

idle owl
#

That would be because I forgot to include them ๐Ÿคฆ๐Ÿปโ€โ™€๏ธ

#

Thank you.

onyx hinge
#

this is wrapped weirdly for me in learn, 1920x monitor, default zoom level

idle owl
#

hmm. That's Learn wrapping it weird. But I'll fix it in the file.

onyx hinge
#

I think that concludes my feedback ๐Ÿ™‚ it's nice and clear overall but I found some nits to pick ๐Ÿ™‚

idle owl
#

This is why I asked you to take a look before asking for moderation on it. I appreciate it.

onyx hinge
#

you're welcome

idle owl
#

@onyx hinge How do you know what pins are valid? For I2C, I wrote a script that tries to create the I2C object on each pin, but MP3 isn't constructed like that.

onyx hinge
#

it'd be about the AudioPWMOut object in this case

#

any PWM pin, which is all of them

idle owl
#

Oh. SAMD51 is limited for AudioOut then?

onyx hinge
#

yeah I thiink only A0/A1

idle owl
#

So a script would work here as well, using the audio object

#

ok

ornate breach
#

What was that thing Ladyada did for generating board pin reference printouts?

idle owl
#

You mean PrettyPins?

ornate breach
#

I canโ€™t remember it for the life of me

#

Was that the one she covered on desk of Ladyada?

idle owl
#

Do you mean the graphical pinout diagrams?

ornate breach
#

It created like a pin reference for svg board images?

idle owl
#

I'm the one who does most of those ๐Ÿ˜„ But she and PaintYourDragon wrote the software to do it. We called it PrettyPins, and it stuck.

#

Yes, PrettyPins.

#

It can be finicky, and requires a CSV of possible pins for a particular microcontroller, and begins with a Fritzing object. (which is a zip of SVGs, really).

prime flower
#

Is there code anywhere which shows which folders/files are created on a default CIRCUITPY filesystem, after it's been flashed?

onyx hinge
#

@prime flower yeah let me find you a link

prime flower
#

thx, rewriting wippersnapper FS code rn and want to ensure I'm not missing anything

onyx hinge
#

look at filesystem_init in supervisor/shared/filesystem.h

prime flower
#

@onyx hinge filesystem.h doesn't exist on main?

onyx hinge
#

well this is a chicken-and-egg problem: The voltage bus called PER_VCC_3V3 is off unless an I2C expander is pulling a particular output LOW. PER_VCC_3V3 powers the I2C pull-up resistors. So, CircuitPython can't create the I2C bus to turn on the pull up

#

filesystem.c, oops

ornate breach
prime flower
#

@onyx hinge Perfect, this is exactly what I was looking for. Thank you!

idle owl
#

Do you have an EagleCAD .brd file for the intended board?

#

And a way to edit SVGs

prime flower
#

@onyx hinge (maybe @tulip sleet ) do you know why it creates metadata_never_index?

onyx hinge
prime flower
#

๐Ÿ‘

slender iron
#

@onyx hinge I'm at my desk now if you want to sync on this esp issue

onyx hinge
#

@slender iron I'll have lunch soon .. how's ....:30 (in about 40 minutes) for you?

slender iron
#

works for me. I'll get through my email

ornate breach
slender iron
#

remind me to exercise after ๐Ÿ™‚

manic glacierBOT
#

There was a discussion of possible changes to pins.c and the way it's handled that could impact this, like having a macro inserted as the first element in the globals table instead of the direct code, as a way to insert entries like this, and maybe automatically insert board.I2C and such when default pins are defined, to reduce the amount of manual entries in pins.c to add a board (and the ambiguity of when to include those or not).

I would say, in the interest of getting from beta to re...

ornate breach
#

And also yes on the svg part as well

manic glacierBOT
onyx hinge
#

If an I2C device address is written as 0'b 0100 000x do I want 0b100_000 or 0b100_0000 in Python (0x20 or 0x40)?

#

neither actually seems to work, mind you

slender iron
#

I just do a scan...

onyx hinge
#

scan hangs

#

so there's something else wrong

#

or else it's taking a very long time

#

what's "(NC)" mean on a schematic? is that like non-populated?

idle owl
idle owl
#

Or no connection.

#

In sensor datasheets anyway, that's what it means - don't connect anything to this.

#

I might be wrong about what it means on schematics though.

slender iron
#

I think you are right kattni

onyx hinge
#

OK, it scans now

slender iron
#

you should be able to find a spot on the pcb labeled that doesn't have the resistor

onyx hinge
#

OK so verified that this board has NO i2c pull-up resistors, not even the ones that it appeared would be powered when the PER_VCC_3V3 rail was powered.

idle owl
#

My script is not working like it should be.

manic glacierBOT
idle owl
#

And I don't understand why.

#

It's supposed to exclude certain pins, but it is no longer doing that.

manic glacierBOT
#

this is only tested to come up to the REPL & mount CIRCUITPY. Pin assignments should be right but were not double-checked. The screen is unsupported so far.

This board depends on the I/O pull ups for the I2C bus (verified by schematic) so this adds a compile time option that enables pull ups for ANY i2c bus on a board.

Sticking this in DRAFT state briefly while I apply for a PID from Espressif.

idle owl
slender iron
#

I'd not use the comprehension so I could add prints

idle owl
#

Limor wrote that part a while back. I'll try to tease it apart.

manic glacierBOT
#

There was a discussion of possible changes to pins.c and the way it's handled that could impact this, like having a macro inserted as the first element in the globals table instead of the direct code, as a way to insert entries like this, and maybe automatically insert board.I2C and such when default pins are defined, to reduce the amount of manual entries in pins.c to add a board (and the ambiguity of when to include those or not).

I would say, in the interest of getting from beta...

ember iris
idle owl
#

p should be a pin type. I think.

ember iris
#

are they strings or of a Pin class?

idle owl
#

not type, pin name.

#

Hold on.

#
['__class__', 'A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'APA102_MOSI', 'APA102_SCK', 'BLUE_LED', 'D0', 'D1', 'D10', 'D11', 'D12', 'D13', 'D2', 'D5', 'D7', 'D9', 'DOTSTAR_CLOCK', 'DOTSTAR_DATA', 'I2C', 'L', 'LED', 'MISO', 'MOSI', 'RX', 'SCK', 'SCL', 'SDA', 'SPI', 'SWITCH', 'TX', 'UART']
>>> 
ember iris
#

Does this, pins = [pin for pin in [getattr(board, p) for p in dir(board) if str(p) not in exclude] if isinstance(pin, Pin)] have any impact?

idle owl
#

I'll try it. What's perplexing, is it worked previously.

#

No impact.

jaunty juniper
#

hmmm it works though, check you are running the right file or something ?

#

what is the issue exactly ? could you be getting pins you don't want because they have alias names that are not in the exclude list ?

manic glacierBOT
ember iris
#

Well, ... time to drop the list comprehension then. For whatever reason p in dir(boarrd) is not able to compare against the exclude list.

pins = []
for p in dir(board):
    print('Checking ', p)
    if p not in exclude:
        p_attr = getattr(board, p)
        if isinstance(p_attr, Pin):
            print(p, ' is a pin and')
            pins.append(p_attr)
    else:
        print('Excluding pin', p)
            

I don't know if the pins are appending the correct thing there--but the prints should be clarifying

manic glacierBOT
idle owl
jaunty juniper
#

for example if I put "A1" in the exclude list it still gets returned because it is also "D1"

ember iris
idle owl
#

Um.

#

Oh.

#

Wait.

jaunty juniper
#

in which case you could make the exclude list a list of pins (with getattr to get the base name not the alias) instead of a list of names

idle owl
#

Ohhh.

#

I get it.

#

It was working. But we added new names for the APA pins

#

so they showed up

#

This makes a lot more sense.

#

thank you.

onyx hinge
#

@slender iron OK I'm done with ๐ŸŒฎ

ember iris
#

Huh, I wouldn't have thought of that, and would have gotten caught in that pitfall soon. Thanks for highlighting it!

slender iron
#

kk

tidal kiln
#

is CP's behavior for getting a NACK on a i2c write to throw an OSError? (it appears to be, but want to confirm)

jaunty juniper
#

something like: exclude = [getattr(board, p) for p in ["NEOPIXEL", "APA102_MOSI", "APA102_SCK", "L", "SWITCH", "BUTTON", "A1"] if p in dir(board)]

idle owl
#

Ahh ok

jaunty juniper
#

and then pins = [pin for pin in [getattr(board, p) for p in dir(board)] if isinstance(pin, Pin) and pin not in exclude]

#

oh I wanted to use a set() for uniqueness, but Pin is not hashable ๐Ÿ˜ฆ

idle owl
#

๐Ÿ˜• Yeah, there's some tweaky things that made this annoying to write.

jaunty juniper
#

makes you jump through hoops

idle owl
#

@lone axle Ugh, ok, so PyCharm stopped responding, so I force quit it, and when I restarted it, the project directory structure doesn't show up on the left anymore. And I can't find where to get it to come back. Any ideas?

lone axle
#

alt+1 is a keyboard shortcut for hide/show that pane as well.

idle owl
#

And I'm on Mac, even this windows keyboard doesn't seem to have alt anymore.

lone axle
#

if you don't see that along the side anymore check View -> Tool Windows and try to find 'Project' inside of there

#

Clicking on that in the menu should bring it back I think. Mine also shows the shortcut keys off to the ride side in that menu, maybe it'll list what you can use instead of alt.

idle owl
#

OK thanks I'll try that.

idle owl
#

Anyway thanks, now I know where to find the shortcuts for those things.

#

Also shows up in the list again.

#

So weird.

#

It's CMD+1, which I tried, and it didn't work.

lone axle
#

yep, you're welcome. I occasionally get similar issues where stuff is weird when I open up the app and restarting tends to get it back to normal.

idle owl
#

Huh. Ok. Good to know.

manic glacierBOT
manic glacierBOT
spare prawn
#

hii sorry for the dumb question. i (stupiidly) managed to get into a reset loop (microcontroller.reset()) in code.py. Is there any way i can break out of it without reflashing the entire device (nrfExpressbboard)

jaunty juniper
spare prawn
#

thx!

blissful pollen
manic glacierBOT
#

Why not do USB mass storage instead? If you have USB CDC already then it seems you are most of the way there already.

Thanks for the suggestion! This is an interesting direction, I'll take a look at what it takes to use the mass storage to write code.py after the USB CDC is ready. One thing I'm worried about is that it may slow down the start up time (which is already much slower in comparison with MP, I still have to investigate why), but the only way to find out will is to give it a go...

solar whale
idle owl
idle owl
#

Is there a phrase or word that means "not broken out" with regard to pins?

#

e.g. "This is not an exhaustive list of not broken out pins."

idle owl
#

Well they're connected to something, aren't they?

#

I mean pins you can't use on a microcontroller board because they aren't made available to you with a pin or through-hole.

#

Trying to comment this audio pin script I wrote in case someone wants to add more excluded pins later.

#

Other than me.

#

The pins I'm referring to are connected, they're simply not available to you to connect to directly (without a lot of effort and tiny soldering).

#

like NEOPIXEL and DOTSTAR_CLOCK/DATA.

#

etc.

tidal kiln
#

i think "not broken out" is fine

idle owl
#

Fair enough.

#
            # other pins that cannot be easily connected to.```
tidal kiln
#

"unexposed"? "unavailable"?

idle owl
#

unexposed.

#

I like it.

#

Thank you @tidal kiln

tidal kiln
#

"unbrokenout"?

manic glacierBOT
idle owl
#

I like unexposed. I think it works.

timber mango
#

My code which is running on an RP2040 will consistently crash into the hardfault handler when run on the nRF. I've tried removing bits of the code to see which part is causing it, but it seems to just happen at a different spot instead. Is there anything i can do to better troubleshoot crashes to the hardfault handler?

idle owl
timber mango
#

Yeah, the hardfault handler does mention filing an issue ๐Ÿ™‚ But rather then posting a big blob of my horrible code, i would like to try narrow down the problem if all possible, and save everyones time

idle owl
manic glacierBOT
ember iris
#

Oh that's a messy knot of a bug

onyx hinge
#

The most fun I've had in ages

#

I miss pair programming

ember iris
#

@onyx hinge can I ask a question regarding that bug? I think I hit that bug with my metro esp32-s2 as well, but once I hit a crash that knocked it into safemode, I haven't been able to trigger it (more than once) again. Could it actually have been related, or was I messing something up and just thinking it was related? It would only reset when the memory needed to be freed up

#

I have no idea why on earth safemode would have kicked it out of the issue

onyx hinge
#

It's possible

#

A crash should usually make you enter safe mode but something about the esp32s2 means this bug was almost always making us restart normally, not go to safe mode

#

I can't predict the future but Scott may talk about it on his next stream

ember iris
#

Huh. Well what an awesome wealth of stuff I get to learn about going forward

idle owl
#

@onyx hinge So in place of indicating which pins work for audio, because some boards have a TON, I'm including a script you can run to get a list for yourself. Like I did on the I2C/SPI/UART pages in the Essentials guide, and the I2C template. (The others aren't templatised yet.)

onyx hinge
#

@idle owl neat, is it working yet?

cunning crypt
idle owl
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-beta.0 on 2021-08-24; Adafruit Feather nRF52840 Express with nRF52840

Code/REPL

import board
import alarm
import countio

alarm_pin = alarm.pin.PinAlarm(pin=board.A2, value=False)
counter = countio.Counter(board.A3)

try:
    alarm.light_sleep_until_alarms(alarm_pin)
    0 / 0

except Exception as e:
    counter.deinit()
    import traceback
    traceback.print_exception(type(e),e,e.__tracebac...
#

@urish you may want to see how this works for you.

Thanks! Seems to do the trick. I'm testing with the following script:

import time
s = time.monotonic()
print("Hello, World!")
while True:
  print(time.monotonic() - s)

and getting output around 60ms into running main.py:

PS C:\P\rp2040js> npx ts-node demo/circuitpython-run.ts

RP2040 GDB Server ready! Listening on port 3333
0.0609999
0.0609999
0.0609999
0.0620003
0.0620003
0.0630002
0.0630002
...
idle owl
tulip sleet
ember iris
idle owl
tulip sleet
#

I thought he was cc'd on the email via a list, but I will check.

thorny jay
idle owl
idle owl
tidal kiln
#

coolio. thanks!

manic glacierBOT
slender iron
#

I'll definitely talk about this esp bug tomorrow

manic glacierBOT
slender iron
#

@timber mango attaching a debugger and getting a backtrace from the hardfault handler is usually my next step

slender iron
#

๐Ÿ‘

#

I was away longer than I expected because I harvested our corn. ๐ŸŒฝ

onyx hinge
#

you had corn to harvest?

slender iron
#

yup yup

ember iris
#

๐Ÿ˜…

slender iron
#

I think I got 6 ears before these

#

boiled them and cut them off the cob to freeze 'em

manic glacierBOT
ember iris
#

Prepping and freezing corn is awesome! I need to get some and freeze it myself. I've got a tiny freezer so I've skipped it the last few years, but while it's a chore the taste later on is worth it

slender iron
manic glacierBOT
#
def gc_layout(size_bytes, block_size=16, bits_per_byte=8):
    pool_blocks = size_bytes * bits_per_byte // (block_size * bits_per_byte + 3)
    print("max # blocks", pool_blocks)
    bits_per_block = block_size * bits_per_byte + 3
    atb_bytes = pool_blocks // 4 + 1
    ftb_bytes = (pool_blocks + 7) // 8
    allocation = atb_bytes + ftb_bytes + pool_blocks * block_size
    
    print("total allocation", allocation)
    if allocation > size_bytes: 
       pool_blocks -= 1...
onyx hinge
#

@ember iris hey, I'm in Nebraksa (Lincoln).

ember iris
onyx hinge
#

@ember iris if the circumstance arises I'd be happy to have a coffee or other tasty beverage with you. Likewise, we would usually get down to KC from time to time but it hasn't been happening lately.

ember iris
onyx hinge
#

Sure, we'll see where things are at in October vis a vis doing in person things. Fingers crossed.

ember iris
manic glacierBOT
onyx hinge
#

I have an awful idea. what if I create a keypad with 2 keys (A and B) with the keypad module, then use python code to "decode" them as quadrature. Is that fast enough for the rates that people manually spin encoder dials, or is it too slow?

#

since I'd get an event anytime either A or B changed, ...

jaunty juniper
#

is python fast enough not to overflow if you spin it ?

#

(the event queue)

manic glacierBOT
manic glacierBOT
#

Thanks for the mention on the adafruit blog (https://blog.adafruit.com/2021/08/23/tensorflow-lite-for-microcontrollers-in-micropython-tensorflow-micropython-esp32/).

I wonder if I can take the amazing micropython and tensorflow lite image from the article for my project?

I found out that the size of tensorflow lite micro is actually about 200-300 kb in terms of firmware size.

I turned off all 84 ops and it saved 200 kb on esp32. The other 100 kb is taken up with the base api an...

manic glacierBOT
manic glacierBOT
#
  • Fixes #4989.

Add back ctrl-C interruption of PIO reads and writes, but make it conditional on a new flag, user_interruptible, which can be set in the constructor. By default, Python-created PIO reads and writes are interruptible, but internal PIO use is not (neopixels, etc.)

The original ctrl-C interruption code can be seen here on the left side: https://github.com/adafruit/circuitpython/pull/4974/files

Minor change: reorder fields in StateMachine object to avoid gaps due to al...

tulip sleet
manic glacierBOT
#
  • Fixes #5150.

  • Explicitly stop the PIO StateMachine before deiniting it.

  • Also minor fix: Don't run the encoder_init PIO program twice.

PIO is new to me, so a few notes about this:

  • The IncrementalEncoder StateMachine is created with common_hal_rp2pio_statemachine_construct(), while the neopixel_write() one uses the more basic rp2pio_statemachine_construct(). I don't know if IncrementalEncoder should use the latter or not, so I left it alone.
  • The `Incrementa...
manic glacierBOT
manic glacierBOT
#

I re-tested this with 7.0.0-beta.0, and I can no longer reproduce the problem. I tried copying a 200k file several times, syncing, and then comparing, and it was not corrupted. I also copied the kmk directory tree several times, though it fills up the PCA10059 filesystem now before it completes. In addition, the slow writes I saw before are not appearing.

We have fixed a number of things about background tasks, USB, and time-keeping since this report, though I'm not sure which fix may ...

onyx hinge
manic glacierBOT
#

CircuitPython version

7.0 beta

Code/REPL

253         // Collect all the report buffers for this device.
254         for (size_t id_idx = 0; id_idx < hid_devices[device_idx].num_report_    ids; id_idx++) {
255             gc_collect_ptr(hid_devices[id_idx].in_report_buffers[id_idx]);
256             gc_collect_ptr(hid_devices[id_idx].out_report_buffers[id_idx]);
257         }

Behavior

Scott & I spotted this while working on #5021 -- We think t...

#

One thing I'm worried about is that it may slow down the start up time (which is already much slower in comparison with MP, I still have to investigate why), but the only way to find out will is to give it a go...

We delay for 1 second at power-on start up to give the user a chance to enter safe mode: https://github.com/adafruit/circuitpython/blob/main/supervisor/shared/safe_mode.c#L83 We're ok with that because start up usually only happens once. (It won't delay when waking from a deep ...

slender iron
#

@tulip sleet did you start fixing the countio issue?

tulip sleet
slender iron
#

kk, I may have time to get to it today

#

I think it's the last remaining issue

onyx hinge
#

github is trying to get me to install this .. I am pretty sure we don't want it.

slender iron
#

I'm not a huge fan of stale bots

#

though I could see it being useful for specific issues where we ask for a recheck and then give the reporter a week or two reply before auto-closing

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-beta.0 on 2021-08-24; Adafruit Feather RP2040 with rp2040

Code/REPL

import board
import countio

counter = countio.Counter(board.A1)

Behavior

Breaking out of the above code, and reloading will output following

soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
  File "code.py", line 4,...
timber mango
#

@onyx hinge Wasn't actually sure if it was intended, but at least it was not consistent across ports - sorry for not being more clear

solar whale
#

FYI -- I have implement a temporary workaround where I just check if the first two bytes in the image are 0xff. If so skip the first byte... crude but effective. Now I'll start looking for root case in the core, but I wanted to have a working version on the saola.

onyx hinge
#

@solar whale basically, if it has one byte that should have come from the previous frame .. but it's supposed to clear out any pending bytes when the frame-starting signal comes. did you file an issue about it yet?

#

i won't look at it for 2 weeks or more so I'm happy you're peering into the core and trying to find something out

slender iron
#

I'm looking at 5240 now

onyx hinge
#

I'm not really here, I'm on vacation ๐Ÿ™‚

manic glacierBOT
solar whale
#

@onyx hinge Enjoy your vacation!!! I'm happy to poke around. We'll revisit this when you get back.

manic glacierBOT
#

We delay for 1 second at power-on start up to give the user a chance to enter safe mode: https://github.com/adafruit/circuitpython/blob/main/supervisor/shared/safe_mode.c#L83 We're ok with that because start up usually only happens once. (It won't delay when waking from a deep sleep.)

So far, from what I can see, there's no way for the simulator to skip this wait unless:

  1. The simulator detects that the code is in a tight loop, e.g. repeatedly reading supervisor_ticks_ms64() - I as...
manic glacierBOT
#

@mrdalgaard If keypad had simple tick timestamps, I wonder if that would work for you. Or if countio kept some kind of simple timestamps (e.g. supervisor.tick_ms() values) of the previous n ticks, maybe that would be useful. But that wouldn't help your lower-power sleep quest.

Some simple external hardware with a counter that you poll often might work.

Any of those modules, with logging of simple timestamps would definitely work.
pulseio could also work, as it does log tim...

wild niche
#

what is the current state of multiprocessing in CircuitPython?

manic glacierBOT
#

If you are trying to do a faithful board simulation, I think there are times when the user will want the 1-second delay to be able to enter safe mode. Can someone click on the reset button on the simulated board? Right now, you create the filesystem each time, but if eventually you make it persist, the user may want to enter safe mode, to, say, avoid boot.py.

And right now do you do soft-restart when the user types ctrl-D? Then it would be same as a real board.

tulip sleet
wild niche
#

@tulip sleet thanks, I will check the links out. have a great weekend

manic glacierBOT
timber mango
#

I am able to get REPL on nRF to freeze, needing a hard reset to get it working, by pasting a bunch from Mu in paste mode. Doing the same on the RP2040 will not freeze.
It doesn't happen at the same spot, but it will happen eventually. Tried it by pasting ~3300 bytes over 5 lines, but it seems to happen with any amount of lines..
Should i make an issue for this? Or just stop pasting as much? ๐Ÿ™‚

jaunty juniper
timber mango
#

Ah, already an issue there

jaunty juniper
#

it's not the same issue, this one is not about a freeze

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-beta.0 on 2021-08-24; Adafruit Feather nRF52840 Express with nRF52840
library bundle: adafruit-circuitpython-bundle-7.x-mpy-20210827

Code/REPL

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

# CircuitPython NeoPixel Color Picker Example

import board
import neopixel

from adafruit_bluefruit_connect.packet import Packet
from adafruit_bluefruit_connect....
manic glacierBOT
manic glacierBOT
#

am trying to strobe several PWM GPIO and play a sound at the same time and get:
RuntimeError: All timers in use
if I use less then 10 GPIOs I can get the sound, more and the error occurs. If I can put the sound onto another process I think i can bypass the timer issue??? thoughts?

_Originally posted by @LarryPriest in https://github.com/adafruit/circuitpython/issues/4542#issuecomment-907488603_

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

I just tested this on my 4 encoder nRF52 board as I was testing PR #5253 which affected encoders too.
I can attest that the dead zone is still there for EC11 encoders.

Looking at the EC11 datasheet they appear to have 2 detents per pulse. This would make them appear to have a dead zone when they are reversed. In a nutshell, it's a "hardware issue", not a software one.

I have another board with a different e...

manic glacierBOT
#

It is however possible to initialize both pin_alarm and countio on the same pin if done in specific order

alarm_pin = alarm.pin.PinAlarm(pin=board.A2, value=False)
counter = countio.Counter(board.A2)

Will run, but alarm will not trigger on light sleep (it will on deep sleep)

counter = countio.Counter(board.A2)
alarm_pin = alarm.pin.PinAlarm(pin=board.A2, value=False)

Will error with:


Traceback (most recent call last):
  File "code.py", line 7, in <mo...
solar whale
#

FYI -- after updating to the current tip of main, I had followed my usual pull/update process git pull then git submodule sync --recursive git submodule update --init git submodule foreach --recursive 'git fetch --tags' I then also had to delete and re-install/update esp-idf since the folder was out of sync. I tried to build an esp32s2 (saola_wrover) and it failed as follows ```/home/jerryneedell/projects/circuitpython/ports/esp32s2/boards/espressif_saola_1_wrover/sdkconfig...
CMake Error at esp-idf/tools/cmake/component.cmake:305 (message):
Include directory
'/home/jerryneedell/projects/circuitpython/ports/esp32s2/esp-idf/components/mbedtls/mbedtls/include'
is not a directory.
Call Stack (most recent call first):
esp-idf/tools/cmake/component.cmake:477 (__component_add_include_dirs)
esp-idf/components/mbedtls/CMakeLists.txt:4 (idf_component_register)

-- Configuring incomplete, errors occurred!
See also "/home/jerryneedell/projects/circuitpython/ports/esp32s2/build-espressif_saola_1_wrover/esp-idf/CMakeFiles/CMakeOutput.log".
make: *** [Makefile:253: build-espressif_saola_1_wrover/esp-idf/config/sdkconfig.h] Error 1
make: *** Deleting file 'build-espressif_saola_1_wrover/esp-idf/config/sdkconfig.h'
ws ``` I then just recloned the entire circuitpython repository and re-updated everything and the build succeeded, I just wanted to pass along a warning to anyone updating...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-beta.0-106-g707e355a6 on 2021-08-28; Adafruit Feather nRF52840 Express with nRF52840

Code/REPL

import board
import alarm
import time

alarm_pin = alarm.pin.PinAlarm(pin=board.A2, value=False, pull=True)
x = 0

while True:
    alarm.light_sleep_until_alarms(alarm_pin)
    x += 1
    print(x)
    time.sleep(0.1)

Behavior

Code will sleep untill sending any keystrokes over USB serial conso...

manic glacierBOT
#

If you are trying to do a faithful board simulation, I think there are times when the user will want the 1-second delay to be able to enter safe mode. Can someone click on the reset button on the simulated board? Right now, you create the filesystem each time, but if eventually you make it persist, the user may want to enter safe mode, to, say, avoid boot.py.

For the online simulator, there's no way to click on the reset button at the moment. I envision most users will get a link to some...

manic glacierBOT
#

And right now do you do soft-restart when the user types ctrl-D? Then it would be same as a real board.

Yes, it works just like on the real board. Why?

I just mean that the "play" button could start from a hard reset, or it could just write code.py, as happens on physical hardware now.

The main reason now for using boot.py is to customize the presented USB. Is the simulator able to simulate HID devices, etc.?

manic glacierBOT
manic glacierBOT
#

CircuitPython version

dafruit CircuitPython 7.0.0-beta.0-110-gb90a16b67 on 2021-08-28; Saola 1 w/Wrover with ESP32S2

Code/REPL

This is a modified version of the ov2640 library example. The changes print out the first/lat 10 bytes of each image and if the extra byte is present, it is stripped when the image is encoded.

 board
import busio
import digitalio
import wifi
import socketpool
import adafruit_minimqtt.adafruit_minimqtt as MQTT
from adafruit_...
manic glacierBOT
#

You could play audio with audiobusio.I2SOut, but you'll need an I2S amplifier (we have those). You could try that as a substitute for AudioPWMOut now even if you can't hear what you and see if you run out of anything.

If you need lots of PWM's, you can get a breakout board that uses a PCM9685, which has up to 16 channels on some breakouts. You control it with I2C. See https://www.adafruit.com/product/815 and https://www.adafruit.com/product/2928, for example. There are others.

I wil...

manic glacierBOT
#

I was reading comments on a bug, and stumbled upon this comment:
https://github.com/adafruit/circuitpython/issues/5212#issuecomment-907307341

which explains why my keyboards are so slow to work when I'm switching between hosts with a KVM. I previously blamed the slow USB enumeration in general, and the KVM in particular, but this explains it.

I wonder if adding a compile-time option for skipping this wait (so that I could use it for my keyboards) would be accepted? In my case I don't p...

manic glacierBOT
#

I took a second stab at this, first implementing MP_ARG_FLOAT and then MP_ARG_FUNC, MP_ARG_TYPE and MP_ARG_ARRAY_OF. This is at https://github.com/adafruit/circuitpython/compare/main...jepler:arg-parse-2?expand=1

I found that

  • There weren't as many places as I thought to validate ranges
  • On non-express m0 boards, there weren't enough uses of MP_ARG_FLOAT to justify the code bloat
  • Even on express m0 boards (specifically circuitplayground_express) there weren't enough uses of MP_A...
manic glacierBOT
atomic summit
#

Hey folks - Can I please get some eyes on this pinout (for sanity reasons) to confirm I have made the Dx/Ax numbers compatible with the FeatherM4 ? After making my FeatherS2 pinout slightly different (making life hard for folks), I don't want to make the same mistake with my FeatherS2 Neo. Thanks!

onyx hinge
#

@atomic summit is there psram?

atomic summit
onyx hinge
#

@atomic summit looks like the pin you have labeled IO45/D2 is D4 on the Feather M4 express

atomic summit
onyx hinge
#

You're placing D0 where the Feather Specification states:

AREF - this is the Analog Reference if there is one for the chip. If there is not, keep this pin not-connected. We recommend Wings don't require this pin as not all chips have external ARef's.

If you're doing this knowingly, then do away. Note that Feather STM32F405 puts the BOOT pin where Feather M4 put "D4". That spot is

'Free' Pin - This is the pin to the right of TX. You can use it for an extra GPIO or if you have some onboard module that has a useful breakout. Sometimes we tie it to ground. Do whatever you like! FeatherWings should not require or use this pin unless there's some really good reason.

#

apparently nobody checked this pin list when they made the feather pico's pins go A0 A1 A2 A3 D24 D25 (i.e., they should have made it D18/D19 to match Feather M4), probably late to fix now.

#

Adafruit would rather your silk show the D-numbers but again that's something that you may be doing in this way knowingly

atomic summit
#

IO0 on that AREF pin is required. I do it on the FeatherS2 and I've never heard of any issues with having it there.

onyx hinge
#

(I mean, instead of the IO numbers. SCK/SDL etc get labeled with their function)

#

That's all I got in the way of commentary. I hope some of it was helpful!

atomic summit
#

D numbers is not a thing for ESP32s. IO number is. That's a deliberate thing by me. But having the right D numbers in the CPY firmware for compatibility is what I want to ensure so CPY code works.

#

I can also add them in Arduino as well in the board definition.

atomic summit
#

D2/D4 on IO0/45 positions was back to front... nice catch

onyx hinge
#

ah, a swap

atomic summit
#

Yup - updated image..

spiral elk
#

@atomic summit I'd like to say I wish my hands were half as steady as yours manually placing 0402s and 0603s...

atomic summit
spiral elk
#

Or maybe I just need to lay off the coffee

#

Is that an LED array in the extra space left over from the flash/psram being internal?

atomic summit
#

Yup, it's a 5x5 RGB Matrix onboard - with user controlled dedicated LDO for power.

spiral elk
#

I hadn't heard what you intended to do with it, just that you had plans for the space.

atomic summit
#

Initially my plans was to make a "cheaper FeatherS2" as the silicon shortage is making PSRAM & Flash super expensive and really hard to source... but adding 25x 1515 RGB LEDs ended up costing as much as the Flash & PSRAM - hahahaha

spiral elk
#

Well, at least you only have availability of the FN4R2 to worry about, but its all eggs in one basket.

atomic summit
#

And the FN4R2 is in short supply - been in a queue for 6 weeks for more reels, no ETA yet ๐Ÿ˜ฆ Lucky I also use it on my TinyS2 so have some stock here.

spiral elk
#

Lolin is probably buying up a ton of them.

manic glacierBOT
#

Is the simulator able to simulate HID devices, etc.?

Nope, at least until someone asks for it. Remounting the FS read/write could come up with some use cases (e.g. users who prototype a data logger and want to experiment with code that writes to the FS).

Writing code.py when you press on play could be a possible solution. What I'm still concerned about is the first-time experience: users who open a link to a simulation project will still have to wait for the safe boot detection code t...

onyx hinge
# onyx hinge

when re-flashed with upstream's sensor demo the screen is correct. Docs say it's a "Display interface: 16-bit, 20 MHz, 8080 parallel communication" so I suspect that talking to it is just a matter of extending the parallel-bus display to 16 bits

#

though the I/O pins are nonsequential, that's a wrinkle

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-beta.0-106-g707e355a6 on 2021-08-28; Adafruit Feather nRF52840 Express with nRF52840

Code/REPL

import microcontroller
import watchdog

w = microcontroller.watchdog
w.timeout = 20
w.mode = watchdog.WatchDogMode.RESET

Behavior

Code will immediately crash and return:

Auto-reload is off.
Running in safe mode! Not running saved code.

You are in safe mode because:
CircuitPython core c...
onyx hinge
manic glacierBOT
#

I'm still having this issue on Pico RP2040, using 7.0.0-beta.0. There is a difference in the crackling between beta.0 and alpha.6. On alpha.6 it was the same crackling for the entire length of play back. On beta.0 it cycles, kinda like:
_|ยฏ|_|ยฏ|_|ยฏ|______|ยฏ|_|ยฏ|_|ยฏ|______|ยฏ|_|ยฏ|_|ยฏ|_

Code I am using:
`import board
import audiocore
import audiomp3
import audiobusio
import digitalio
import time

f = open("/music/15-03.mp3", "rb")
mp3 = audiomp3.MP3Decoder(f)
a = audiobusio...

manic glacierBOT
manic glacierBOT
#

In CPython, 0x%p style is preferred for address, I think we should use it instead of %p for consistency.

They also have a check to ensure presence of leading 0x:

case 'p':
    sprintf(buffer, "%p", va_arg(vargs, void*));
    assert(strlen(buffer) < sizeof(buffer));
    /* %p is ill-defined:  ensure leading 0x. */
    if (buffer[1] == 'X')
        buffer[1] = 'x';
    else if (buffer[1] != 'x') {
        memmove(buffer+2, buffer, strlen(buffer)+1);
        buffer[0] = '...
manic glacierBOT
#

I'm still having this issue on Pico RP2040, using 7.0.0-beta.0. There is a difference in the crackling between beta.0 and alpha.6. On alpha.6 it was the same crackling for the entire length of play back. On beta.0 it cycles, kinda like:
_|ยฏ|_|ยฏ|_|ยฏ|______|ยฏ|_|ยฏ|_|ยฏ|______|ยฏ|_|ยฏ|_|ยฏ|_

Code I am using:

import board
import audiocore
import audiomp3
import audiobusio
import digitalio
import time


f = open("/music/15-03.mp3", "rb")
mp3 = audi...
manic glacierBOT
idle owl
#

@lone axle Divider lines!! โค๏ธ

#

I'll test it today or tomorrow.

mortal mica
#

Got to listen to one of Scott's deep dives while I was falling asleep last night and woke up to an important discussion between Limor and Scott regarding the supported qspi flash chips for the RP2040. Is there a list of supported/known working chips so that I dont get any surprise. Digikey only had the DTR version of the W25Q128JV. Will it work? Does it need a different config? I tried looking it in the docs or in the code but couldn't find much for an answer.

idle owl
#

<@&356864093652516868> CircuitPython Weekly meeting is in about 1.5 hours. Please remember, if you wish to participate, or want to have your notes read off during the meeting, you'll need to update your Hug Reports and Status Updates in the notes doc. Thanks! https://docs.google.com/document/d/1bO1IU2lth51Bl0pKTlVy9IYak9HuB7GFfyaRQhFISxs/edit

slender iron
#

@mortal mica I think all new winbond should be ok. worse case you need to add new config for it

#

generally you want something that can do quad spi

mortal mica
#

Thanks. I have parts coming from all over. Might be a while before I know for sure but it sounds like it's going to be ok... Where would a new config need to be added? ( So that I can compare with existing ones so that I know what I would need to get into)

slender iron
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-beta.0/Raspberry Pico

Code/REPL

import board
import audiocore
import audiomp3
import audiobusio
import digitalio
import time


f = open("/music/15-03.mp3", "rb")
mp3 = audiomp3.MP3Decoder(f)
a = audiobusio.I2SOut(board.GP27, board.GP28, board.GP26)

print("playing")
a.play(mp3)
while a.playing:
  time.sleep(.001)
print("stopped")

Behavior

I'm still having this issue on Pico RP2040...

#

This enables the _stage library and adds stage and ugame modules to the
frozen modules, so that all Stage games should work.

I had to do several hacks:

  • Since displayio.release_displays doesn't release the pins, I couldn't
    re-initialize the display inside the ugame module. Instead I changed
    the default display initialization for the board to match what Stage
    expects. (see https://github.com/adafruit/circuitpython/issues/3873)

  • Since there is no audioio module, but Stage g...

thorny jay
manic glacierBOT
#

This PR update tinyusb stack which has update to get nRF5x port passed the USB Compliance Verification (USBCV) test. Other ports still need a bit of tweak but will eventually pass as well hopefully. It does include a decent changes especially in MSC driver due to all corner case e.g MSC READ10 with direction bit set to output, or mis-matched in command wrapper and scsi operation etc ... Please test it out if you could, I only did a few simple test with circuitpython.

  • For USB Compliance V...
lone axle
pearl notch
#

How did it get the name Blinka?

#

Heh heh

#

Ah!

jaunty juniper
idle owl
#

@lone axle Thanks for keeping up with cookiecutter!

manic glacierBOT
idle owl
#

Pain indeed!

#

Nice! Thanks!

lone axle
#

same here with organizing pain, I have a good bit of it that still needs to be done as well

idle owl
#

This is kind of what I was expecting as a response from most folks ๐Ÿ˜„

gilded cradle
#

So I have most boards grouped into Feathers, Raspberry Pi Boards, Metro/Grand Central Style, and CPX/Misc

idle owl
gilded cradle
#

Also have a breakouts category for add-on boards.

idle owl
#

I have a lot of everything, so any choice will have enough to fill a bin.

gilded cradle
#

I think form factor sorting works quite well.

idle owl
#

Fair enough. I might give that a try.

gilded cradle
#

The only time I have a hard time finding a board is when I forget to put it back in the right place.

idle owl
#

Breakouts, I'm trying out doing them by concept, e.g. air quality/gas, temp/humidity, etc. So all of the air quality/gas sensors go in one container, and so on.

gilded cradle
#

That's how I do it

idle owl
#

Might need to combine a couple because I don't know if I have enough of every type to fill an entire container, but motion/IMU/accel/gyro and temp/humidity will both definitely have enough ๐Ÿ˜„

#

OK, thanks for the suggestions. I think I'll give this a try.

gilded cradle
#

Yeah, voltage regulators and level shifters are good categories too

#

oh and FRAM chips

idle owl
#

My previous breakout organisation was alphabetical by part name. Turns out there's a lot of maybe four letters of the alphabet, and hardly any of any other. It works as a concept, but I think by feature is a better way to go. I'll find out eventually!

gilded cradle
#

Yeah, easy enough to locate a small pile and look through them

ember iris
#

Thanks all!

solar whale
#

Have a good week all ๐Ÿ‘‹

slender iron
#

Here is the notes document for Tuesday's CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord (just 24 hours later). 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/1Dag1KnCTNh50q5fc_ghaMdmUjNiBp5KsdF4FbKKnIEk/edit?usp=sharing

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Channel Categories

8

Text Channels

59

Voice Channels

6

Members

30677

Roles

35

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-beta.0-123-g89fc1890a-dirty on 2021-08-30; MEOWBIT with STM32F401xE

Code/REPL

>>> import board
>>> import digitalio
>>> digitalio.DigitalInOut(board.MENU)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: MENU in use

Behavior

Traceback (most recent call last):
  File "", line 1, in 
ValueError: MENU in use

Description

No response

Additional inform...

mortal mica
slender iron
#

๐Ÿ™‚

manic glacierBOT
#

I envision most users will get a link to some project, the click the "play" button, see how it works, and start playing around with the code.

What if you don't have the play button and just start the simulator immediately? That way it'd be like plugging in a CP board. Are you able to blink the on board LED? That'd make it clearer that something is happening.

Can this simulator be run headless? I'd love to use it for library CI to track memory use.

manic glacierBOT
#

I was experiencing this exact problem. Some HTTPS websites worked fine and others issued a traceback originating in _get_socket. After going to Arduino's IO Cloud website (create.arduino.cc/iot) and updating the firmware for the u-blox the error went away. The device came with NINA firmware version 1.4.5. The upgraded version is 1.4.8.

Intersting @ngdrascal ... when I get a chance I will have to check that out. Have you been able to recreate both the HTTPS and MQTTS code examples from ...

ember iris
#

*frantically adjusts pull request* ๐Ÿ˜„

idle owl
#

๐Ÿ˜„ No worries!

ornate breach
#

frantic programmer noises

idle owl
#

That smacks of a terrible subtitle provided for some video.

ornate breach
#

Itโ€™s true

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Intersting @ngdrascal ... when I get a chance I will have to check that out. Have you been able to recreate both the HTTPS and MQTTS code examples from above using or adafruit example codes since updating the ublox firmware?

@dedSyn4ps3 The Adafruit example from https://learn.adafruit.com/circuitpython-on-the-arduino-nano-rp2040-connect/wifi actually worked fine before I upgraded the ublox firmware. I wasn't experiencing the issue with all websites, just some. For example posting to ht...

manic glacierBOT
#

Fixes a crash from trying to raise an exception when trying to
deinit a RESET wdt by not raising an exception.

Fixes a crash when raise a wdt exception in the REPL when waiting
for input. We now catch and print any exceptions raised.

Fixes #5261 (USB after a watchdog still doesn't work.)

Adafruit CircuitPython 7.0.0-beta.0-133-g8fbb3e6d2-dirty on 2021-08-30; Adafruit Feather nRF52840 Express with nRF52840
>>> import microcontroller
>>> import watchdog
>>> w = microcontrolle...
manic glacierBOT
#

Will the current patch from tinyusb still be streamed into 7.0.0?

Rainer Paskiewicz

On Mon, Aug 30, 2021 at 9:32 PM Scott Shawcroft @.***>
wrote:

Moving this to post-7.0.0. @DynamoBen https://github.com/DynamoBen we'd
like your feedback on #4190 (comment)
https://github.com/adafruit/circuitpython/issues/4190#issuecomment-898844231

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

manic glacierBOT
manic glacierBOT
#

Intersting @ngdrascal ... when I get a chance I will have to check that out. Have you been able to recreate both the HTTPS and MQTTS code examples from above using or adafruit example codes since updating the ublox firmware?

@dedSyn4ps3 The Adafruit example from https://learn.adafruit.com/circuitpython-on-the-arduino-nano-rp2040-connect/wifi actually worked fine before I upgraded the ublox firmware. I wasn't experiencing the issue with all websites, just some. For example posting t...

atomic summit
#

I know we are super close to a 7.0 release and 6.3.0 is stable and not being worked on anymore, but is there a way to get my FeatherS2 Neo added to 6.3.0? If I do a PR against the 6.3.0 tag?

manic glacierBOT
manic glacierBOT
#

@tannewt , I think we've just about got this bug squashed...I'll double check the CP version of querying my initial state dashboard to see if it goes through after the ublox update.

If it doesn't, I have not found anywhere in the docs of a way to include a root cert or .pem file into CP code like can be done through arduino. Any way to do that if there still is an issue with some endpoints?

manic glacierBOT
#

@ngdrascal gotcha. The reason why I uploaded the certs was due to a 403 Forbidden when first attempting to make the API request for Initial State.

After uploading the root cert and double checking my request query everything went through just fine. ๐Ÿค˜๐Ÿ‘Œ

@ngdrascal @ladyada , I re-loaded CP onto the board and TLS queries to the Initial State API are now functional as well...great success!

I don't know if the ublox update alone would have fixed this, since the arduino request generated a...

tulip sleet
manic glacierBOT
#

Currently, passing in a value for --extra_characters results in a crash

> python gen_display_resources.py --font fonts/ter-u12n.bdf --extra_characters ABCDEF --output_c_file ../test-output.c
Traceback (most recent call last):
  File "/home/user/prtesting/circuitpython/tools/gen_display_resources.py", line 57, in 
    all_characters.extend(args.extra_characters)
AttributeError: 'str' object has no attribute 'extend'

This fixes that crash by converting the `all_character...

idle owl
# atomic summit I know we are super close to a 7.0 release and 6.3.0 is stable and not being wor...

PRing to the tag doesn't automatically add it to the version. It would involve doing another release, which isn't planned because 7 is so close to stable at this point. As well, 7 includes many bug fixes and important features. We're supporting 6 at this point because it's the last stable release, but we don't have any intention of backporting anything. As Dan mentioned, we haven't even included new Adafruit boards.

slender iron
#

my goal is to do a 7.0.0 release candidate this week and if nothing major comes up then we can make it stable next week

idle owl
#

I thought as much, but didn't want to speak to that without verification from you.

stuck elbow
#

phew, I got the keypad changes just in time then, I have been putting them off for months

manic glacierBOT
#

@tannewt , I think we've just about got this bug squashed...I'll double check the CP version of querying my initial state dashboard to see if it goes through after the ublox update.

Great! Will close it now.

If it doesn't, I have not found anywhere in the docs of a way to include a root cert or .pem file into CP code like can be done through arduino. Any way to do that if there still is an issue with some endpoints?

I don't know of one. I suspect we'd need to add the cert loading...

ember iris
#

So I'm reviewing a pull request, and because one of the other sensors it uses as an example has changed, the example has become out of date. But it's not because the pull request is wrong. So should I request a change or raise an issue, then fix the sensor in the example with a separate pull request?

tidal kiln
#

@ember iris can you link to pr

ember iris
#

The import for the bme280 needs to be changed from:
import adafruit_bme280
to
from adafruit_bme280 import basic as adafruit_bme280

tidal kiln
#

oh. in the readme?

idle owl
tidal kiln
#

^^ yah. agree.

idle owl
#

This looks like a PR in which the original author could make the changes comfortably.

#

Basically, if a new person contributes, and it's something little that you think should be changed, but what they submitted was already a huge deal to them, you can approve it and make the change afterwards.

#

Or something big you think should be changed. Either way.

ember iris
idle owl
#

You can also, always ask!

#

I've asked folks when I'm unsure in the PR "Do you feel comfortable making this change?" and sometimes they say no. So I'll do it either in that PR or at a later time with a new PR.

#

Other times, they're new, and they're totally into it, and want to make the change. And they'll stick with you as you ask for all sorts of stuff, or fight with the CI with them, and so on.

#

But you don't want to frighten off new folks with an onslaught of change requests without feeling it out first.

ember iris
#

Sweet! I just completely didn't think of it from that point of view. I was focused on the, "should a PR's scope be small or larger" perspective

idle owl
#

That's a valid perspective as well though!

#

Adding the change you're suggesting doesn't bloat the scope too much. But if it's something unrelated, or much bigger, you could consider a separate PR in that case regardless of how the original author is feeling about it.

#

Or, again, ask the author if they are willing to submit another PR with the scope-enbiggening change to avoid one PR being too big.

ember iris
#

Ok.
In a similar vein, I have one more question regarding the sgp40--it reads a raw value, then you pass that value to the algorithm which spits out a voc index. Storing that raw value adds a small memory footprint (the size of an int plus the class overhead for it). I'm probably like one of 5 people who would be interested in that value. Is it worth adjusting the class to save the raw value, or should I just make my own fork that has that adjustment?

tidal kiln
#

can voc index call raw? why pass it?

idle owl
#

How about figuring out the actual memory footprint it creates so we have numbers to work with and then we can decide based on actual data.

ember iris
# tidal kiln can voc index call raw? why pass it?

Boy we're stretching my knowledge of how these variables and functions work: To the best of my knowledge in this case raw is a property that calls the i2c bus with a stored command_buffer bytes array, and it just returns the value in read_value[0]. Measure_raw adjusts the command buffer for the temp and humidity, and returns the raw property, which is evaluated on the return. measure_index calls measure_raw and stores the returned read_value locally in that function. I'm weak when it comes to understanding name space scopes, but I think that means that I can't access that the raw value from the sensor once that measure_index function returns.

tidal kiln
#

if you want raw, use measure_raw?

#

are you wanting both voc index and raw to be returned by a single function?

ember iris
#

namespaces confuse me ๐Ÿ˜›

tidal kiln
#

it looks like it's basically:

vox_index = some_voc_algorithm(raw)

?

#

it terms of just what is going on internally

ember iris
#

Yeah, assuming some_voc_algorithm is a class attached to the sgp40 class so it's internal states are preserved

tidal kiln
#

totally a different approach, but looks like maybe these could be kept separate? that is, don't try and make it a part of the SGP40 class.

#

you could import that algorithm class separately in your user code

ember iris
#

That would work, but it would change the behavior pretty dramatically from the c implementation, and the sgp40 documentation. Functionally it's identical, but from an api standpoint it would deviate

tidal kiln
#
import board
import adafruit_sgp40
import adafruit_sgp40.voc_algorithm

sgp40 = adafruit_sgp40.SGP40(board.I2C())

voc_algo = adafruit_sgp40.voc_algorithm.VOCAlgorithm()

raw = sgp40.raw
vox_index = voc_algo.vocalgorithm_process(raw)
#

yah, it'd be different

ember iris
tidal kiln
#

sry. i'm probably not helping here. i don't really know anything about that algorithm. looks like it's more than just math(raw).

manic glacierBOT
ember iris
# tidal kiln sry. i'm probably not helping here. i don't really know anything about that algo...

No worries, I was going to redo this algorithm with floating point instead of fixed point math, but the pull request was made with the fixed point implementation solving the open issue.

The only reason I caught the time issue is because I was trying to understand the distributions and estimators and there's a 2 hour switch. I'll dig in more and see if I'm missing something or if this breaks if the sgp40 is sampled at a rate other than 1 once a second

manic glacierBOT
mortal mica
#

Been looking at sleeping on the nrf52 and was wondering why it was decided to use GPIOTE instead of PIN Sense for the wake up mechanism (especially for deep sleep). Considering the limited number of GPIOTE channels and the "unlimited" number of PIN Sense "channels" and the fact that a transition on a PIN when in SYSTEM_OFF mode will wake up the chip (from datasheet: POWER Peripheral uses the DETECT signal to exit from System OFF mode). I understand if I want to wake up on a time basis. Perhaps we need a "hibernate" mode where external input is needed to wake up. (I am deciding if this something worth looking into and contributing. Would it be taken in and where/how?)

onyx hinge
#

@mortal mica it's entirely possible we picked a less than ideal way to implement the sleep mode on that MCU, I don't know enough to say .. if there's a different implementation that can implement the python API but it's better in some way like lower power or additional flexibility I think we'd love to see a pull request

mortal mica
#

Great. I wonder about additional flexibility. Thinking more like different flexibility... Is the python API what's in the docs? or something else... For example, I don't think there is "Hibernate" anywhere already defined.

#

As for power, its lower but going from 180uA down to 60uA is something but I am more worried about when it's running (see http://pykey.jpconstantineau.com/docs/testing_hardware/sleep/). However being able to awake from more pins is the thought here. (would link to a keyboard matrix, energize it, set up the sense pins and go hibernate..)

slender iron
#

I think I found 1k bytes for samd21 builds at the expense of slower startup

#

(by computing the qstr attr table on startup)

#

props to tyomitch for the idea

#

tests it

ember iris
#

So does that shunt the qstr attr table into a different type of memory?

slender iron
#

yup, from rodata to bss

#

hrm, so that would cut into the heap

atomic summit
#

Morning @tulip sleet & @idle owl - Yup, that all makes sense and is totally fine. I just wan't sure if the board would just get picked up by "a build system" or not, hence me asking.

I'm shipping with my own 6.3.0 build as I've been building stock for a little while, and when I started, 7 still had that code.py reload issue on ESP32S2, but folks can upgrade them to 7 if/when they like.

manic glacierBOT
#

The QSTR pool is a bunch of 32-bit pointers. We could store them as 16 bit offsets from a base pointer for the whole pool instead.

Doing this for the const pool built into the firmware would save ~1300 bytes of flash but require a post-processing step after the link. The linker places all of strings so it can't be done earlier. I tried to subtract the start of rodata in the initializer list but the compiler complained. Post processing it would require placing the pool as the last thing...

idle owl
#

The only amp breakout I have is the PAM8302, and I don't think they're meant to be used together.

ember iris
#

I believe you can, it's just going to be somewhat quiet (wait until you know it's quiet before leaning your ear close to it though--learned that one the hard way)

#

Though I've only ever done that with 8 ohm speakers + a 3.5mm plug.. I think it should work none the less

idle owl
ember iris
#

yeah--give me like five minutes and I'll have a picture too. Speakers ground should go to the 3.5 ground, and speakers positive should go to one of the other 3.5mm pins, it'll play the left or the right side of the audio accordingly

idle owl
#

Oh those are the same pins. Obviously. ๐Ÿคฆ๐Ÿปโ€โ™€๏ธ

#

I'm thinking, I can't wire it to the 3.5mm, I don't have the hardware.

#

But you're saying the breakout pins are the same pins.

ember iris
#

yeah the rout or lout should work I think--they're the right and left channel respectively, so if you wire the red of the speaker to either one of those it should work with the other wire connected to ground AND if anyone has experience to overwrite this let me know. I'm not an audio person

#

Now I'm magic blue smoke second guessing it..