#circuitpython-dev

1 messages · Page 59 of 1

tulip sleet
#

do you have some 4MB ESP32-S3 board (S2 is probably OK too)?

mortal kernel
#

Let me look...

tulip sleet
#

The MEMENTO has an unusual tinyuf2 load, which has one large "OTA" partition, 2.8MB, instead of two 1.4MB partitions. The user filesystem is 960kB, same as usual.

mortal kernel
#

I've got Metro Rev B with ESP32-S3 N16R8

tulip sleet
#

you could probably load the MEMENTO bootloader on that board. Or do you have a Feather ESP32-S3 TFT or 4/2 plain Feather ESP32-S3?

#

the bootloader might not have a status LED (due to pin differences), but I think it would still work

ornate fulcrum
#

quick question, I'm getting a syntax error. Are you able to use else with try except blocks for when no error happens in circuit python?

tulip sleet
#

at least I think so

ornate fulcrum
#

ahh didn't see, new to server and there are a lot of of channels

#

thank you

mortal kernel
#

Let me pull your code and I'll see if I can spot something without resorting to testing.

tulip sleet
#

my first q is whether the 1024's in statvfs are actually right. I see the same thing on a Pico, for instance

#

Trinket has 512's. CPX has 1024's.

#
Adafruit CircuitPython 7.3.3 on 2022-08-29; Adafruit CircuitPlayground Express with samd21g18
>>> 
>>> import os
>>> os.statvfs('/')
(1024, 1024, 2024, 2020, 2020, 0, 0, 0, 0, 255)
mortal kernel
tulip sleet
#

2020 is right

wraith crow
#

I put the camera boot loader and the Camera CP uf2 on an ESP32-S3 TFT and the file system does seem to have issues (reporting 3.7M)

tulip sleet
#

@mortal kernel on Metro ESP32-S3, df -h says 13984 1k-blocks, and statvfs says 2048-byte clusters and 6992 f_blocks. So that's right. So this may be limited to the unusual partition scheme on the MEMENTO. Metro has ota_0 and ota_1 each 2048kB, and user_fs 11968K, so it is going to extend CIRCUITPY into ota_1 to make 11968+2048, about, which seems right

tulip sleet
onyx hinge
#

@tulip sleet you tried with CIRCUITPY_STORAGE_EXTEND disabled and it didn't fix anything?

#

(and you formatted the filesystem hopefully)

wraith crow
tulip sleet
#

EXTEND is turned off because DUALBANK is turned off. I even verified that with a print statement somewhere. It did fix the hard crash, but then the new "gets remounted as read-only" problem shows up. I think there are two bugs here. one is that DUALBANK should not be on if there's not an ota1 partition. The second is that the size is being reported wrong in statvfs

tulip sleet
onyx hinge
#

OK

#

I notice that esp_ota_get_next_update_partition will return ota0 if it's the only one

#
        if (default_ota == NULL) {
            /* Default to first OTA partition we find,
               will be used if nothing else matches */
            default_ota = p;
        }
tulip sleet
#

that's not so great, but I thought it was not being called

#

i can instrument that

#

Loading the .bin:

dafruit CircuitPython 9.0.0-beta.1-1-g3871899860-dirty on 2024-02-18; Adafruit Camera with ESP32S3
>>> 
>>> import os
>>> os.statvfs('/')
(0, 0, 0, 0, 0, 0, 0, 0, 0, 96)
>>> os.listdir()
[]
#

hahah

#

i did do an erase_filesystem() after the first time I saw that

#

@mortal kernel I'm beginning to think there is no oofatfs or low-level issue, so feel free not to spend time on this. It's some peculiarity of the partition stuff on ESP, I think

#

i was mostly surprised by the two-sector clusters

#

going ice-skating ⛸️

mortal kernel
#

I'm having an intermittent problem running make fetch-port-submodules. Here's a small sample:

tulip sleet
#

what is your git version?

mortal kernel
#
Cloning into '/home/rabeles/Development/circuitpython-issue-7693/circuitpython-memento/lib/mbedtls'...
error: 41 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
fatal: clone of 'https://github.com/ARMmbed/mbedtls.git' into submodule path '/home/rabeles/Development/circuitpython-issue-7693/circuitpython-memento/lib/mbedtls' failed
Failed to clone 'lib/mbedtls'. Retry scheduled
#

git version 2.43.2

tulip sleet
#

do a make remove-all-submodules and see if that helps

mortal kernel
mortal kernel
#

@danh Poking around while waiting for github to settle down, I chased the path from f_mkfs that returns the raw filesystem size. Here's the code from ports\espressif\supervisor\internal_flash.c that does the heavy lifting:

uint32_t supervisor_flash_get_block_count(void) {
    #if CIRCUITPY_STORAGE_EXTEND
    return ((storage_extended) ? (_partition[0]->size + _partition[1]->size) : _partition[0]->size) / FILESYSTEM_BLOCK_SIZE;
    #else
    return _partition[0]->size / FILESYSTEM_BLOCK_SIZE;
    #endif
}

Shouldn't the expression (_partition[0]->size + _partition[1]->size) be (_partition[0]->size + _partition[1]->size) / FILESYSTEM_BLOCK_SIZE?

spare jacinth
#

it's confusing to read, but it looks correct due to parenthesis: return (extended ? (size_0 + size_1) : size_0) / block_size

tulip sleet
manic glacierBOT
#

I have been working more on this, and have leads on what is really going on. Once DUALBANK is turned off and the proper partition files are set up, that exercises some bug that causes nothing to be written to the filesystem. So even reformatting the filesystem doesn't work, though it appears to, and what I'm seeing is the old leftover larger filesystem. I'll say more tomorrow.

lone sandalBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
onyx hinge
#

@tulip sleet I just noticed ... ```c
#if CIRCUITPY_STORAGE_EXTEND
multi_partition_rw(_cache, sector_offset, SECTOR_SIZE, OP_WRITE);
#else
single_partition_rw(_partition[0], _cache, sector_offset, SECTOR_SIZE, OP_READ);
#endif

#

I bet that's the part that made the partition read only when !EXTEND

tulip sleet
# onyx hinge I bet that's the part that made the partition read only when !EXTEND

I am writing this up right now. Yes, that looks like a problem -- good catch. The host also only notices that it's read-only when it tries to do a write. And storage.erase_filesystem() when !EXTEND doesn't actually create the filesystem. You can see that if you erase all of flash, and then install one of my later builds with !EXTEND. It keeps going into safe mode saying it can't find (or, really, create) CIRCUITPY

#

I see several directions to go now to fix this:

  1. Turn off DUALBANK and EXTEND in beta.2 and tell everyone to do storage.erase_filesystem() when they install it,
onyx hinge
#

also I asked chatgpt to analyze that function to find the error. It noticed this was hinky:

            supervisor_flash_read_blocks(_cache, sector_offset / FILESYSTEM_BLOCK_SIZE, blocks_per_sector);
            _cache_lba = sector_offset;
        }
```_cache_lba is compared to block_address but assigned sector_offset
tulip sleet
#
  1. Redo the bootloader to remove the non-OTA-ness. The current firmware fits fine in a 1.4MB partition. That allows a larger CIRCUITPY for images, etc.
#

But then people have to install a new bootloader AND beta.2, which is a lot of support for all the Adaboxes already out htere

onyx hinge
#

#2 does seem more disruptive

tulip sleet
#

let's discuss at 1pm

manic glacierBOT
#

Here's what I think is going on:

The MEMENTO *aka adafruit_esp32s3_camerawas set up using an unusual partition scheme. There is a single 2.8MB 2816kB) firmware partition, instead of two 1.4MB firmware partitions (one for OTA update of firmware). The user filesystem partition is 960KB like other boards. The TinyUF2 bootloader combined.bin sets up this partition scheme.

There was an incorrect FLASH_SDKCONFIG setting in the mpconfigboard.mk for the MEMENTO. That config name is obsole...

onyx hinge
#

we should make sure !EXTEND case works right though.

#

<@&356864093652516868> a quick note, there's no meeting today (monday), as Adafruit observes the Presidents' Day holiday. We'll meet tomorrow, 24 hours after the usual time! You can add your notes to the doc anytime, of course, check the pinned messages for a link.

tulip sleet
#

@onyx hinge the behavior was really confusing because it was two bugs, and fixing the first revealed the second, especially the persistence of the 3.7MB CIRCUITPY even after turning off DUALBANK/EXTEND

onyx hinge
#

we can check if the "next ota partition" is the "running partition": ``` #if CIRCUITPY_STORAGE_EXTEND
_partition[1] = esp_ota_get_next_update_partition(NULL);
if (_partition[1] == esp_ota_get_running_partition()) {
_partition[1]->size = 0;
}

#

but this would prevent it from extending into the single OTA partition

manic glacierBOT
tulip sleet
#

it would have to go into safe mode. Maybe that's a good idea: it would tell people to reformat.

onyx hinge
#

I didn't test, but my gut told me that if I did a safe mode reset inside supervisor_flash_init I'd end up with a nasty reset loop

tulip sleet
#

we have recursion prevention for some other safe mode, I think. It might be in main.c

#

if we prevent such a build from ever happening, that fixes the problem in the long run. It just doesn't make it obvious it needs to be fixed for current board owners. This is the kind of thing to discuss at 1pm

#

i was going to ask to chat with you about this earlier but it took a while to do other things and write this up

onyx hinge
#

I was scratching my head over it all last night

#

I wonder how many board configs are affected by this problem. esp32s3-camera is the only "1ota" partition table user I see

tulip sleet
#

I figured out the reason for the behavior just before i (tried to) go to sleep

#

There are 2MB boards with DUALBANK turned off. I wonder if they work at all

onyx hinge
#

I think they might not be able to write/format CIRCUITPY

wraith crow
tulip sleet
#

maybe yes, we will ask "management" about the best way forward. @onyx hinge would you say that 1.4MB is enough, given that it fits now, and is a larger CIRCUITPY desirable as well for the camera? That means it can have some limited use without an SD card, I think.

lone sandalBOT
onyx hinge
#

@tulip sleet is this similar to the size you see? ```1285200 bytes used, 156592 bytes free in flash firmware space out of 1441792 bytes (1408.0kB).

tulip sleet
#

yes, that's what I see

#

even the big languages should be OK, that's a lot of free space.

#

turning BLE back on someday will reduce the free space a lot, but I think it may still fit. I wonder why it didn't fit before, maybe -O2??

#

now it's -Os

crimson ferry
#

This may be a dumb question, or a question with a hard-to-implement answer, but... now that (I think) we have TLS as a shared resource across ports, is it feasible to have TLS over (WIZnet) Ethernet?

#

maybe it's convoluted to have a library-accessed socket passed back into circuitpython core

tulip sleet
#

yes, not sure that would work out

crimson ferry
#

we do something like that in asyncio??

onyx hinge
#

@crimson ferry shared-module/ssl "does things" by making C function calls into socketpool routines, e.g., ```c
STATIC int _mbedtls_ssl_send(void *ctx, const byte *buf, size_t len) {
mp_obj_t sock = *(mp_obj_t *)ctx;

// mp_uint_t out_sz = sock_stream->write(sock, buf, len, &err);
mp_int_t out_sz = socketpool_socket_send(sock, buf, len); …```

These would all have to be replaced with "something else" that would adapt to different kinds of underlying socket objects

#

(not sure why there's a commented out line there, probably me being untidy)

#

there are probably around 8 to a dozen places that would have to be modified to call back to Python code instead of making a C function call

crimson ferry
#

so TLS for ethernet is more sensible as a Python library if that possible?

blissful pollen
#

I could be wrong but I think TLS is usually port specific because it can be computationally heavy

onyx hinge
#

I don't think you'd want to code TLS in Python, and I don't think we'd want 2 TLS implementations in the core (one for wiznet, one for wifi) so I'd tend to look at how to make the ssl module work with any object that obeys the socket "protocol" (in the python sense of a protocol or abstract bsae class). but that's just a gut reaction from me.

#
        dest[2] = MP_OBJ_NEW_SMALL_INT(self->device_address);                                
        dest[3] = write_buffer;                                                              
        mp_call_method_n_kw(2, 0, dest);                                                     
```instead of a basic C function call you end up writing something like this, example from adafruit_bus_device which is designed to work with true core i2c, C bitbangio i2c, or python-coded bitbang i2c
vagrant wind
#

@tulip sleet M5 Stack cardputer has a matrix keyboard with a 74HC138 decoder on the rows. Current keypad module don't support this case. I would like to try to write the module. What do you think about this?

tulip sleet
#

I don't know that we would turn it on in general, maybe just for this board. It will take up space on smaller boards.

onyx hinge
#

m5 stack keyboard could be an interesting case for an ULP program. I have a retro keyboard with both row & column muxes and always meant to write its scanning code in the riscv ulp.

#

I don't think the use of a multiplexer affects rollover; this retro keyboard (atari something) doesn't have diodes, so it's limited to 2kro (+ some keys are specially placed on the matrix so nothing ghosts with them, iirc)

#

(but quite possibly ulp support isn't working at the moment so it'd be some uphill work to do)

short tendon
onyx hinge
#

@short tendon just based on a little grepping, I see 8 call sites but imagine I missed something: ```SSLSocket.c: mp_int_t out_sz = socketpool_socket_send(sock, buf, len);
SSLSocket.c: mp_int_t out_sz = socketpool_socket_recv_into(sock, buf, len);
SSLSocket.c: return common_hal_socketpool_socket_bind(self->sock, host, hostlen, port);
SSLSocket.c: common_hal_socketpool_socket_close(self->sock);
SSLSocket.c: common_hal_socketpool_socket_connect(self->sock, host, hostlen, port);
SSLSocket.c: return common_hal_socketpool_socket_listen(self->sock, backlog);
SSLSocket.c: socketpool_socket_obj_t *sock = common_hal_socketpool_socket_accept(self->sock, ip, port);
SSLSocket.c: common_hal_socketpool_socket_settimeout(self->sock, timeout_ms);

#

I'd probably start by factoring those out to intermediate functions, then make the intermediate functions operate via mp_call_method*. once that's working, if the performance is detectable reduced on native objects add an "is native object" flag to skip the object layers and do direct function calls.

(well, first I'd factor it so that mp_load_method is called just once for each method, not once for each call; it's probably the most expensive part of overhead that is easily eliminated and then check if the overhead's still important)

manic glacierBOT
#

Sorry for taking so long with this, been busy with other stuff.

  • stations_ap now returns None if not in AP mode
  • stations_ap now returns a list of NamedTuples with mac_address, rssi and ipv4_address elements
  • ipv4_address will now be None rather than 0.0.0.0 if none has been assigned

This is solid with Espressif but I see erratic results from the Pi Pico's cyw43 SDK. You can see them in the screen cap - it sometimes reports 1 station connected despite 2 or 3 (confir...

short tendon
tulip sleet
#

@onyx hinge, I can submit my current MEMENTO things as a draft PR, if you think that makes sense. I'd probably stop the jobs from running at first, since it's still wrong.

onyx hinge
#

@tulip sleet or you can just point me at your branch, either way

tulip sleet
#

or I can take the changes you're suggesting, or you can cherry pick from me.

onyx hinge
#

I am trying to figure out the best way to trigger safe mode if there's no OTA1 but EXPAND is enabled.

tulip sleet
#

do you want to keep working on the fixes yourself?

#

sounds like yes

tulip sleet
onyx hinge
#

do you have ideas about how to do that? If so 💯

tulip sleet
#

mpconfigport.mk can look at the chosen .csv and analyze the partition table with a short python script or even a shell command line. If the partition .csv's are uniform, can complain if EXTEND is on but ota_1 is not in the .csv. That's a simple grep or similar

#

i can work on that if you would be willing to test the single partition write fixes

#

do you think chatgpt was right about its conclusion?

onyx hinge
#

If "ota_1" is not found in the csv, and DUALBANK is enabled, error

tulip sleet
#

exactly

#

and also test EXTEND in that case

onyx hinge
#

I agree with chatgpt that there's something funky about how the cached block is tracked

tulip sleet
#

in case someone tries to test it separately. Or just test extend

#

as i mentioned somewhere I also stumbled upon some obsolete references to *SUPERVISOR_ALLOCATION that I removed, while looking through those files anyway

onyx hinge
#

@tulip sleet let me work on the checking sdkconfig vs EXTEND/DUALBANK

tulip sleet
onyx hinge
#

then we can look together at the flash cache bit

tulip sleet
# onyx hinge <@329766224093249548> let me work on the checking sdkconfig vs EXTEND/DUALBANK

right now the naming scheme (after I renamed that one .csv file in my branch) is consistent that *no-ota*.csv are the ones without an ota_1 partition. sdkconfig itself doesn't have info about partititions, it is just in the filename setting

CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-4MB-no-ota.csv"
CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-4MB-no-ota.csv"
#

and do $(error ...)

onyx hinge
#

@tulip sleet "FLASH_SDKCONFIG = esp-idf-config/sdkconfig-4MB-1ota.defaults" is this line just totally wrong? the variable never seems to be referenced

#

or am I missing how it gets used

#

I ended up with the "1ota" name because tinyuf2 used it: ```$ find | grep 1ota
./ports/espressif/partitions-8MB-1ota.csv
./ports/espressif/partitions-4MB-1ota.csv
./ports/espressif/partitions-16MB-1ota.csv

tulip sleet
#

yes, i fixed that in my branch. I think it nay have been FLASH_SDKCONFIG in the past and got changed

#

well make them all one way or the other. All the others are no-ota in esp-idf-config

onyx hinge
#

how many tiny little weird things have converged here? I'm losing count.

tulip sleet
#

I like no-ota better, because it's a functional desription instead of a "name of the partition" description.

onyx hinge
#

I am fine with it how you like it.

#
```I have the checking script working
tulip sleet
onyx hinge
#

and if using "git am" is something you're familiar with

tulip sleet
#

@onyx hinge

            _cache_lba = sector_offset;
```
was also present before EXTEND was added: <https://github.com/adafruit/circuitpython/pull/7000/files>
#

i have used git patch, not git am

#

The OP_READ bug looks like copy pasta

onyx hinge
tulip sleet
#

oh, it is something like "apply mail" or something, right? They email around patches. Linux kernel workflow looks like a nightmare to me

#

The fact that I make homonymic mistakes while typing says something about my mental processing...

onyx hinge
#

you're not the only one who does that.

tulip sleet
#

i think i subvocalize what I type, at least some of the time

#

i made some comments; I'll change your script a bit

stuck elbow
tulip sleet
#

@onyx hinge why did you skip duplicate definitions:

            v = sdk_config.get(k, v)
onyx hinge
#

@tulip sleet that's explained poorly by the line above, and is not needed anyway. Some defines expand into other defines and that line tries to handle it: ```

  •        # ad-hoc handle lines like '#define CONFIG_TCP_MSL CONFIG_LWIP_TCP_MSL'
    
  •        v = sdk_config.get(k, v)```
    
#

but you can delete the line & comment, it's not needed for the defines we care about

tulip sleet
#

i can leave that in. I made an int_or_string() function

onyx hinge
#

OK

manic glacierBOT
#

Thanks for diving into this, it will be quite handy.

I tried to track it down, but I'm not sure where ESP_WIFI_MAX_CONN_NUM comes from. From your tests, it appears to be 15 for some Espressif boards, 10 for others. I thought 10 used to be the max, but seems to be 15 now. However, the following seems to indicate that 10 is esp-idf default (and it trades off with number of ESP-NOW encrypted pairs):
https://docs.espressif.com/projects/esp-idf/en/release-v5.1/esp32s3/api-guides/wifi.html#ap...

tulip sleet
#

@onyx hinge out for a walk, need more testing. I am still confused about the caching: sectors vs blocks

#

was cleaning up some other things and got distracted

onyx hinge
#

me too

#

I'm due to go out for walk as well, hopefully I'll come back less distractable

tulip sleet
#

i switched your script to click

onyx hinge
#

Does someone know about circup, if the output of "circup freeze" can be used to install a specific version later? I thought circup would only install from the latest bundle. https://github.com/ide/circuitpython-https-server/pull/2#issuecomment-1951412172

GitHub

Together with adafruit/circuitpython#8932 this https server is verified to work on Adafruit MatrixPortal S3 with ESP32S3 running 9.0.0-beta.0-38-g0c3b62fac2-dirty on 2024-02-16.

novel cairn
#

Is it frowned upon to try to add a board to CirPy that relies on community libs and a modified official lib in order to function?

stuck elbow
#

do the libraries have to be added to the repo?

crimson ferry
#

does it not function at all without those libraries (I suspect not)?

novel cairn
#

For reference, I'm working on the files for this board, ESP32-2424S012. It's an ESP32C3-Mini with a screen and touch module. Right now it needs the gc9a01 from the community bundle and adafruit_cst8xx with _CHIP_ID_CST826 edited

crimson ferry
#

is there a sensible PR to adafruit_cst8xx to have it handle the superset?

novel cairn
#

Without those it'll technically work like a plain ESP32C3, but no screen

tulip sleet
novel cairn
#

And I'm not sure, I do see inside the cst8xx lib some comments about subclassing it to allow more IDs to be accessed

stuck elbow
#

you want to copy the init sequence from the driver and add it to board.c, look at the other boards with screens for an example

#

then it won't need that driver

novel cairn
#

Ah ok, that's neat. I had seen something about that when looking at projects for other screens but didn't realize that's what it was for

stuck elbow
#

it will then start with the screen already working

novel cairn
#

Would I do that for both drivers, for the board and the touch chip? Because it's the touch driver that needs the ID edited

stuck elbow
#

the touch is done in python only, so no built-in thing

novel cairn
#

Ok in that case it would be nice to have the ability with adafruit_cst8xx to include the chip ID as an argument, which is easy enough to find because it prints the current chip ID in the terminal on init already

#

Actually question, does the chip ID matching actually matter? I just tried disabling the check and it works when it doesn't force an error

#

I assume there's some edge cases where a different enough chip just wouldn't work at all, hence the enforcement?

crimson ferry
#

or there could be subtle variations in algorithms... may need to look at datasheets

#

"works" as in doesn't get an exception, vs. "works" as in functions 100% correctly

novel cairn
#

Makes sense. Either way, I'll go poke with the init sequence thingie and be back when I've figured that out since I'll have no doubt bodged it up

manic glacierBOT
#
  • Fixes #8944

  • Fix supervisor_flash_write_blocks() to write instead of read when handling a single firmware partition (thanks @jepler).
  • Fix adafruit_esp32s3_camera/mpconfigboard.mk (MEMENTO)to use proper setting name for partition file.
  • Rename partition files to have consistent names: no-ota` if only one firmware partition.
  • Forbid CIRCUITPY_DUALBANK = 1 and CIRCUITPY_STORAGE_EXTEND = 1 if there is only one firmware partition. Thanks @jepler for initial version of v...
tulip sleet
#

@onyx hinge afk for about 1.5 hours now

manic glacierBOT
#

I tested a build from this branch successfully on the device. With this version the drive size reported to OS makes it so it will warn me that the file is too large to fit when I try pasting it if there is already other things on the drive.

I also have been able to successfully use this build with a modified version of the basic camera example from learn and been able to take a few photos successfully with it.

novel cairn
#

Is there a functional difference between

#define CIRCUITPY_BOARD_I2C_PIN     {{.scl = &pin_GPIO5, .sda = &pin_GPIO4}}```
and 
```#define DEFAULT_I2C_BUS_SCL             (&pin_GPIO4)
#define DEFAULT_I2C_BUS_SDA             (&pin_GPIO5)

Aside from the first method letting you use board.I2C when the second doesn't (I think)

onyx hinge
#

@novel cairn I think the first style you showed is newer in circuitpython and is preferred.

novel cairn
#

Ok, wanted to verify since the second is what's in the new board guide

onyx hinge
#

it probably was never updated, that happens more than we'd like.

manic glacierBOT
#

I appreciate ESP-IDF's move to extremely modular components but sometimes things are scattered to the winds :)

I'd thought of get_max_stations_ap() as the upper limit of stations the firmware was configured to support, but I see the argument that it shouldn't report more than max_connections. I'd missed the part about sharing keys with ESP-NOW, good catch.

I don't think anybody asked for get_max_stations_ap(). I included it because it was easy and I thought it might help one or tw...

tulip sleet
#

@onyx hinge I think I will go ahead and make a beta.2 now -- make sense to you?

onyx hinge
#

@tulip sleet yes, or tomorrow would probably be fine

manic glacierBOT
#

Agreed on the 17.

I can't actually find the 7 (ESP-Now) anywhere, perhaps it's in the esp-idf component and we just don't have it defined differently in our config files. I've never tested more than 2 encrypted pairs.

I don't have a strong opinion about get_max_stations_ap() either. Since there is an out of bounds exception in the espressif port for max-connections, maybe it's superfluous. raspberry afaik is fixed at 10.

#
[adafruit/circuitpython] New tag created: 9.0.0-beta.2
orchid basinBOT
midnight ember
#

Sounds like beta 2 will be an almost mandatory update for Memento owners. Would enjoy hearing in the meeting how someone figured out it thought it had more space than it actually did. Neat bug.

tulip sleet
#

https://blog.adafruit.com/2024/02/19/circuitpython-9-0-0-beta-2-released/
This release contains an important fix for Adafruit MEMENTO Camera Boards. See the release notes for details.
Incompatible changes with 8.x.x are also spelled out more clearly in these latest release notes.

Adafruit Industries - Makers, hackers, artists, designers and engineers!

From the GitHub release page: This is CircuitPython 9.0.0-beta.2, a beta release for 9.0.0, and is a new unstable release. This release has known bugs that will be addressed before 9.0.0 final. Not…

native sandal
#

I'm trying to build CP for Feather S3. Following the steps here (https://learn.adafruit.com/building-circuitpython/build-circuitpython), and using the 8.2.x branch, I get these errors:

cd ports/espressif
make BOARD=unexpectedmaker_feathers3
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
make: *** No rule to make target `lib/tinyusb/src/portable/espressif/esp32sx/dcd_esp32sx.c', needed by `build-unexpectedmaker_feathers3/genhdr/qstr.split'.  Stop.
native sandal
#

yep!

tulip sleet
#

and you did . esp-idf/export.sh or the equivalent?

native sandal
#

nope

#

Where is that documented?

tulip sleet
#

listed in left sidebar

native sandal
#

Thank you

#

Well, my circuitpython/ports/espressif/esp-idf/ is empty (no install.sh as called for in those docs)

#

There is one in esp32s2 but not in esspresif

CircuitPython/circuitpython/ % find . -name install.sh
./ports/esp32s2/esp-idf/install.sh
#

I just now tried make fetch-port-submodules , which did a ton of work, including:

Entering 'esp-idf'
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (1/1), 808 bytes | 808.00 KiB/s, done.
remote: Enumerating objects: 16528, done.
remote: Counting objects: 100% (13912/13912), done.
remote: Compressing objects: 100% (6317/6317), done.
remote: Total 8770 (delta 4400), reused 4902 (delta 1746), pack-reused 0
Receiving objects: 100% (8770/8770), 1.28 MiB | 4.68 MiB/s, done.
Resolving deltas: 100% (4400/4400), completed with 760 local objects.

But there’s still nothing in that directory.

atomic summit
#

I also pointed you to the "Espressif Builds" section on that guide as well.

native sandal
#

Yeah it complained about not being able to delete a few folders because they weren't empty, but that shouldn't preven this from working. I did update from git.

#

but okay, I'll start over

#

make remove-all-submodules might work too

atomic summit
#

It's not just a submodule issue - the main directory structure is wrong, and git was unable to update the repo properly.

native sandal
#

ok

#

make BOARD=unexpectedmaker_feathers3 is finally doing work. Yet more submodule cloning lol

#

All of this is for me to try to port PDMIn.c to esp32s3. Is that something on-topic for this channel?

#

I'm trying to use the Adafruit PDM mic with the Feather S3

wraith crow
# native sandal All of this is for me to try to port PDMIn.c to esp32s3. Is that something on-to...

I believe that is on topic here, I haven't looked at the audiobusio core routines myself, but I suspect you'll find answers to your questions here. Coincidentally PDMin just came up in a PR for the M5 Cardputer (https://github.com/adafruit/circuitpython/pull/8816). The PR author has an initial non-working attempt on github at (https://github.com/jamesjnadeau/circuitpython/blob/esp32-I2s-PDMIn/ports/espressif/common-hal/audiobusio/PDMIn.c). Maybe a chance to collaborate?

GitHub

GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.

native sandal
manic glacierBOT
manic glacierBOT
solar whale
#

From the CP 9.0 beta.2 release notes. Incompatible change: Require explicit socket port reuse. Use socket.setsockopt(pool.SOL_SOCKET, pool.SO_REUSEADDR, 1), as in CPython. Where are we likely to have to make a change to deal with this. I don't see it in adafrutit_requests.py . I'm just curious where it has an impact and if what libraries might have been updated to deal with this.

manic glacierBOT
tulip sleet
onyx hinge
#

Can someone remind me why not have a method or property on the Radio object to return its socketpool singleton. I feel like I raised this in the past and there was a reason. pool = wifi.radio.pool or pool = wifi.radio.pool() vs pool = socketpool.Pool()

tulip sleet
manic glacierBOT
#

@MHVUT I'm wondering, which version of Java are you using? I have

$ java --version
openjdk 11.0.21 2023-10-17
OpenJDK Runtime Environment (build 11.0.21+9-post-Ubuntu-0ubuntu122.04)
OpenJDK 64-Bit Server VM (build 11.0.21+9-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)

Sorry for the late reply. I was just wrapping up the Lunar New Year holiday.
I think this issue due to wrong java version. Code generation tool are using java 11.

manic glacierBOT
#

Thanks guys for the support.

The SiLabs UG520 app note states in section 2.1 for requirements…


I actually had installed this version based on the UG520 app note of requiring version 17 or higher...

openjdk 21.0.2 2024-01-16 LTS
OpenJDK Runtime Environment Temurin-21.0.2+13 (build 21.0.2+13-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.2+13 (build 21.0.2+13-LTS, mixed mode, sharing)

Per the comments I used sdkman to install and set the following version as the default…

No...

manic glacierBOT
#

I am using default-jdk of ubuntu 22.04
openjdk version "11.0.21" 2023-10-17
OpenJDK Runtime Environment (build 11.0.21+9-post-Ubuntu-0ubuntu122.04)
OpenJDK 64-Bit Server VM (build 11.0.21+9-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)

Could you help to run below cmd in your side:
cd /port/silabs/
make BOARD=devkit_xg24_brd2601b clean
make BOARD=devkit_xg24_brd2601b slc-generate

onyx hinge
#

I am probably overlooking something silly in my change, can someone spot the problem with my attempt to add the type property to socket objects? s.get_type() (nonstandard) works, but s.type doesn't.

my change: https://gist.github.com/jepler/219145b531657e957d59b980b3b437ed

Adafruit CircuitPython 9.0.0-beta.2-2-g3a06f87e31-dirty on 2024-02-20; Adafruit Camera with ESP32S3
>>> import socketpool, wifi
>>> socket = socketpool.SocketPool(wifi.radio)
>>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> s.type
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Socket' object has no attribute 'type'
>>> s.get_type()
get type
1
stuck elbow
onyx hinge
#

ah! I bet that's it

#

MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS

#

thank you @stuck elbow !

#

yep that was exactly it.

manic glacierBOT
#

@anecdata pointed out that moving ssl to shared-module might pave the way to using ssl with wiznet.

I mentioned that for this to be possible, ssl would have to make Python calls for various methods (connect, send, recv, etc) instead of calling the common_hal socket routines.

I went ahead and implemented this. I very lightly tested it: it can do the standard socket test and fetch from https pages like https://www.adafruit.com/api/quotes.php on an esp32s3 device. I didn't test servi...

lone axle
#

<@&356864093652516868> Due to yesterday's holiday the weekly meeting is occuring today (Tuesday) starting about 90 minutes from now here on discord. Feel free to fill in hug reports, status updates, or in the weeds topics to the shared document prior to the beginning of the meeting if you'd like. Look forward to speaking with everyone then! https://docs.google.com/document/d/1x3O7daDGGkd0NgEyHz0p9OKz8tCtKB4gli7iCisYtmI/edit?usp=sharing

keen eagle
#

I'm seeing "Hard fault: memory access or instruction error." with 8.2.10 on a Matrix Portal S3.

It's running a long running large complicated application that's obviously using the LED matrix but also has a lot of network activity (MQTT) and writes every so often to flash. Didn't see this with 8.2.9.

It'll be difficult to isolate the problem. I've moved it to 9.0.0-beta2 (which took exactly zero changes to the application, very nice :)).

Is it even worth filing an issue on the 8.2.10 crash at this point? If I see it with 9 I'll file it against that and see if I can come up with a small program that reproduces the problem.

manic glacierBOT
#

I've removed get_max_stations_ap(). Might as well save the bytes and potential confusion until someone actually asks for it. It's probably better suited to documentation anyway. Thanks for catching the max_connections stuff!

I'm still using ESP_WIFI_MAX_CONN_NUM internally as an upper bound for temporary storage while querying about connected stations, but that should be a safe use.

tulip sleet
#

@onyx hinge mind approving #8955? I don't think Scott needs to review.

manic glacierBOT
#

I confirmed cHemingway's findings for the CLUE Morse Code Chat example.
BL 0.8.0 and 0.8.2
CP 8.x and CP 9.x beta
CP Lib 8.x and CP 9.x beta
Morse Code Example Bundle 8.x and 9.x

The only way to get this example to work is to modify the scan_and_connect function to perform scanning if the
CLUE is to be the central and to perform advertising if the CLUE is to be the peripheral.

`MY_NAME = "CENTRAL"
FRIENDS_NAME = "PERIPHERAL"

#MY_NAME = "PERIPHERAL"
#FRIENDS_NAME = "CENTRAL"
...

onyx hinge
tulip sleet
#

i did think that 🙂

manic glacierBOT
#
#

I was just bisecting when you posted @jepler ...

Adafruit CircuitPython 9.0.0-beta.0-51-gd0fec0c8b6 on 2024-02-17; Adafruit QT Py ESP32-S3 4MB Flash 2MB PSRAM with ESP32S3
works as HTTPS server,

Adafruit CircuitPython 9.0.0-beta.0-52-g6c1e34e957 on 2024-02-17; Adafruit QT Py ESP32-S3 4MB Flash 2MB PSRAM with ESP32S3 fails on server.start:

Traceback (most recent call last):
  File "code.py", line 56, in <module>
  File "adafruit_httpserver/server.py", line 226, in start
...
slender iron
manic glacierBOT
slender iron
manic glacierBOT
#

CircuitPython version

9.0.0-beta

Code/REPL

>>> s = pool.socket() # or socket.socket
>>> b = bytearray(b'0.0.0.0')
>>> s.connect((b, 443))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: can't convert 'bytearray' object to str implicitly

Behavior

In standard Python, the bytearray is accepted (and the connection fails, because there's no listener):

Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
...
#

hmm, should the library only be calling

        self._sock.setsockopt(
            self._socket_source.SOL_SOCKET, self._socket_source.SO_REUSEADDR, 1
        )

when not CircuitPython?

        if implementation.name != "circuitpython":
            self._set_socket_level_to_reuse_address()

But calling it always yields:
AttributeError: 'SSLSocket' object has no attribute 'setsockopt'
so maybe the custom TLSServerSocketPool class needs extending?

tulip sleet
#

@gilded cradle it was michalpokusa, not me, who did the search performance improvement on circuitpython.org. I edited your hug report

gilded cradle
#

Thanks @tulip sleet

midnight ember
#

Oh that sounds neat, I'd like to see that.

#

sql json flat file sounds cool. lots of progress for http server stuff lately.

#

That's awesome CGrover. Maybe people will start collecting wave tables like they used to.

plucky tulip
errant grail
midnight ember
#

The Sonoma fix went backwards? :/

crimson ferry
#

jepler: you're welcome for side-tracking you 😉 , and thank you 🙂

midnight ember
#

Nice to have you back Jepler. Hope you had a nice vacation.

mortal kernel
#

Sideways. It went sideways.

#

Is there a 9.0.0 issue that I could look at?

slender iron
#

or generally?

mortal kernel
#

Just in general. I'd like a break from _bleio for a day or two.

manic glacierBOT
lone axle
midnight ember
#

ah this is the issue with reset and deinit() you found while streaming. you didn't seem to keen on all the work that would be involved with switching everything to deinit instead of using a blanket reset.

onyx hinge
#

that makes a lot of sense

midnight ember
#

pulsein>pulseout>pwm>rabbithole

slender iron
midnight ember
#

Thank you Devs for looking into the low level hard stuff so others like me can focus on making pretty graphics.

errant grail
#

@lone axle Thanks for hosting!

onyx hinge
#

thanks @lone axle !

gilded cradle
#

Thanks everyone

midnight ember
#

Thank you for hosting @lone axle

short tendon
#

Thanks!

manic glacierBOT
crimson ferry
#

@plucky tulip is there an issue yet (or are you already working on one) for the PicoW HTTPS server regression? if not I'd be happy to bisect and make an issue

plucky tulip
plucky tulip
#

Oh, I see. I didn't create a separate issue about MemoryError, as right now it is not what pops up when running the HTTPS server, so it is hard to reproduce. Now the problems is that there is a "Failure to bind" which seems to be more general problems as it applies to all ESP boards (maybe to PicoW too, I didn't test), where a MemoryError only happened on ESP32-S2 and Pico, or at least it seems so.

crimson ferry
#

yes I got espidf MemoryError on S2 also... I'll do some testing

plucky tulip
crimson ferry
#

presumably the PicoW and ESp32-S3 'bind' issue is the same, and you're right it's masking the memory issue, so we may be stuck for now, but I'll play around some more to confirm

lone axle
#

Here is the notes document for next Monday’s CircuitPython Weekly Meeting. It is at the normal time of 11am Pacific / 2pm US Eastern here on Discord. Add your hug reports and status updates to the document before the meeting. If you are unable to attend but would still like to contribute, feel free to add your notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1fKV2aLWrm9ooTyiFA41vlT5zMu4KBs1E2QbcvIaBK5Y/edit?usp=sharing

solar whale
#

@onyx hinge Is there an example of using the OV5640 autofocus with espcamera, that is, not via pycamera. I am curious about using it with the OV5640 breakout on an esp32s3 (metro or feather) If nothing exists, I'll be happy to see if I can adapt pycamera to a more generic "mycamera" for use with the breakout. I just did not want to re-invent the wheel if somthing existed already and I was just not seeing it.

#

Not trying to make any work you you -- I was just curious if I had missed something and there was already a library out there. I'll look into adapting pycamara to my own use.

onyx hinge
solar whale
manic glacierBOT
#

While investigating #8726 I realized the crash was due to a conflict between "bulk" reset such as "pulsein_reset()" and "deinit()" based reset that is triggered by deiniting the heap. With early ports, we relied heavily on "bulk" reset so that we knew exactly the state of peripherals at the start of every run. However, we also implemented deinit() so that user code can deinit peripherals at a precise time. (del and finalizers are called at collect time or vm end.) If deinit() wasn't cal...

slender iron
orchid basinBOT
manic glacierBOT
manic glacierBOT
#

I think the real question is whether there is a bug causing the problems with espcamera on the esp32s2 or if esp32s2 simply can’t handle espcamera. If that is the case, do we just document that and move on or is it worth trying to revert to something lime imagecapture. There does not appear to have been a great demand for it so I expect there are more important issues to resolve at this time.

I'm not super interested in getting things going on the S2 if we don't have a project that uses ...

#

It would be cool if the support for the T-Deck keyboard was present in the terminal. It would add the ability to use the T-Deck as a standalone python device.

How is the keyboard connected? You'd need a C implementation of scanning the keyboard and then connect it up to serial_read(). See https://github.com/adafruit/circuitpython/blob/main/supervisor/shared/serial.c#L241 for how USB host keyboard is connected in.

This isn't an Adafruit-funded priority because it isn't an Adafruit bo...

modest hazel
#

I'm about to use Homebrew to re-install the ARM toolchain on my M1 mac. Ideally I'd like to build the 8.x latest version for now. Can I use 13.2.rel1, or will that only work with CP 9.x ?

slender iron
modest hazel
#

Sweet, thanks!

slender iron
#

8.2.x dev should be only for bad bugs

#

@tulip sleet #8820 is ready for your rereview too.

manic glacierBOT
manic glacierBOT
#

See output log for ‘clean’ and ’slc-generate’ commands as requested. I have posted the full output log here in case it provides more information that may be useful to understand the problem.

@.***:~/circuitpython/ports/silabs$ make BOARD=devkit_xg24_brd2601b clean

  • Verbosity options: any combination of "steps commands rules", as make V=... or env var BUILD_VERBOSE
    rm -rf build-devkit_xg24_brd2601b
    @.***:~/circuitpython/ports/silabs$ make BOARD=devkit_xg24_brd2601b slc-ge...
manic glacierBOT
#

iirc S2 has 320KB SRAM, and S3 has ~540KB~ 512KB SRAM, with various claims to that memory from esp-idf/rtos/etc, and maybe some things from CP core too. I don't fully understand the new CP 9 memory model.

CP will try to allocate to PSRAM first now in beta.1+. (Not exactly sure when I changed it.) The IDF can allocate to PSRAM now too by default but needs to request it explicitly. Without an explicit request, then internal memory will be used first.

manic glacierBOT
#

In https://github.com/adafruit/circuitpython/pull/8952#issue-2143285908 it was pointed out that this code looked funny:
https://github.com/adafruit/circuitpython/blob/499cc0158b65fe8c483ff179d99510c3f7d46812/ports/espressif/supervisor/internal_flash.c#L154-L157

Specifically the value _cache_lba is set to sector_offset doesn't match the comparison value block_address. This likely causes excess sector reads when writing to the file system. I think the data written is still write. The ...

#

@tannewt can you take a look? I didn't immediately spot how your change introduced this problem, maybe you'll see it though.

Yup. My brain went straight to "hey, I removed that error message". Looks like ssl socket is implicitly converting the new error number returned to a bool and then throwing the error message. Will fix today or tomorrow. It should be identical to the non-ssl socket change.

slender iron
#

@tulip sleet release notes should also call out removal of show()

slender iron
#

next time is fine too

#

mostly want us to have a central place for "things that may be in your code and need to change"

tulip sleet
#

I use the previous notes as the starting point for the next notes, so done locally. Also I2CPeripheral is now I2CTarget.

manic glacierBOT
vital matrix
#

[low priority] @lone axle - thx for reviewing https://github.com/adafruit/Adafruit_CircuitPython_IterTools/pull/20 - one question for your thoughts: I found it helpful to locally add a tests/ directory where I could both confirm library behavior at least in cpython + run mypy to ensure concrete types in the tests passed muster. I however removed it from the PR as it wasn't directly related to type annotations. Do you think it (i.e., a tests/ set of basic checks) be something that makes sense to include in one of the upcoming PRs regardless?

short tendon
#

@lone axle or @slender iron does ConnectionManager need to be added to the bundle before a release to pypi can be made?

short tendon
#

Can we do a release?

lone axle
#

pypi release happens when the library repo is released as long as the actions succeed. It's seperate from the bundle.

#

Yes, I'll make an initial release.

short tendon
#

Actually it looks like I can release... Not sure if I should be able to

#

But since I know nothing about that, I won't

#

and found the docs for adding to the bundle

lone axle
#

PyPi release succeeded: https://pypi.org/project/adafruit-circuitpython-connectionmanager/. The Github release actions which run mpy-cross and upload the results to the GH release page failed with a 403 error: https://github.com/adafruit/Adafruit_CircuitPython_ConnectionManager/actions/runs/7982007459/job/21794769235. I think this means that the repo does not have proper permissions set up in it's settings, but I do not have access for this repo and I don't recall the exact setting that resolves it.

#

Maybe write access under Actions -> General

manic glacierBOT
short tendon
#

okay, I don't have access to the settings either

tulip sleet
#

I fixed: Librarians had Read access

short tendon
#

Also, what pushes it to docs.circuitpython.org? So I can make sure the URL is right?

tulip sleet
#

re-running job

#

someone has to add the library on readthedocs, hold on

lone axle
#

I started I re-run already sorry. Thank you for fixing the permissions.

#

It still shows a similar 403 on the GH actions release.

#

This error feels very familiar from a different library I set up recently. I think this was the setting I ended up having to change.

short tendon
#

Also is there a way to re-run tests? I pushed a commit to Requests before I should of (changing the requirements.txt)

lone axle
#

it was new to me when I did it though. I don't know when github added that as a necessary step or if there is some way to do it at a higher level in the org for the repos.

lone axle
short tendon
tulip sleet
#

i need to add you as a collaborator

short tendon
#

Ahhh, I can also just push some other changes

tulip sleet
#

you already are a collaborator, so just ask us for re-runs, etc. I can do it with my org privs

short tendon
tulip sleet
#

@lone axle re-run did not work by either you or me, hmm

tulip sleet
lone axle
tulip sleet
#

yes, it was read-only, running again. Mysteriously this project is not showin up in the readthedocs subprojects list of projects we can add. I have to remember how to add it or refresh that list

lone axle
#

I wonder if there is some way to apply that setting at a higher level so it happens automatically at the repo level. I think it will pop up for each new library from now on.

manic glacierBOT
short tendon
#

@tulip sleet no rush, but if/when you get CM on RTD let me know

tulip sleet
#

still looking at that

short tendon
#

^^ this is me seeing if any builds fail adding ConnectionManager

tulip sleet
#

also I got the alias case wrong. Originally was ConnectionManager, should have been connectionmanager

manic glacierBOT
#

Rather than depend on esp_sta_list.num being limited to no more than ESP_WIFI_MAX_CONN_NUM, you can use a dynamic stack array:

mp_obj_t common_hal_wifi_radio_get_stations_ap(wifi_radio_obj_t *self) {
    wifi_sta_list_t esp_sta_list;
    esp_err_t result;

    result = esp_wifi_ap_get_sta_list(&esp_sta_list);
    if (result != ESP_OK) {
        return mp_const_none;
    }
    
    esp_netif_pair_mac_ip_t mac_ip_pair[esp_sta_list.num];
    for (int i = 0; i < esp_st...
#

just select different color constants, like 0x7f7f7f or (127,127,127) instead of 0xffffff or WHITE or (255,255,255)

FYI, this approach doesn't seem to work on the MatrixPortal S3 with CircuitPython. The actual brightness of 0x7f7f7f is exactly the same as 0xffffff. :-(.

I was hoping this would be a solution, but no dice. I'm getting complaints about the LED being so bright it's hurting people's eyes, so I'm hoping a workaround will show up somehow.

manic glacierBOT
#

I haven’t used the S3 version of the MatrixPortal yet, but suspect that the default color bit depth is set to two bits, just four levels of color brightness, limiting the granularity of intensity.
When instantiating the display in CircuitPython, the bit depth can be set to 6-bits which increases the brightness granularity — at a price of needing more memory to hold the display buffer.
If you are using CircuitPython displayio objects, you could apply something like PaletteFader to help. http...

short tendon
#

never mind. I made a stupid mistake

#

oh wait, no, I'm still stuck

tulip sleet
#

now that ConnectionManager has a release, use that commit

short tendon
#

oh, then how can we test, since the Request one won't have a version?

tulip sleet
#

the only way to test would be to make branch with a tag and check out that commit for Requests

#

the q is what are we testing: just that it fits, or that it works?

short tendon
#

Both technically, but that it fits

tulip sleet
#

I'm not too worried about testing that it works, since if it works non-frozen it should work frozen

#

is Requests bigger when it uses ConnectionManager?

short tendon
#

No, it's smaller but together it's a little bigger

tulip sleet
#

so just use the old incompatible release of Requests to test whether it fits. It won't work, but it will tell us if it fits. Keep it a draft PR. Then when we release a Requests that uses CM, you can update the PR

short tendon
#

Ahh, that makes sense

#

When doing the add to the bundle, does it need to be a version?

tulip sleet
#

generally, yes, but ConnectionManager has a version now

#

maybe always yes, not sure we considered otherwise

#

the bundle updates itself when new versions are released. There is a nightly run that updates to the latest released version of everything

#

if there are no new versions, then it doesn't build a new bundle that night

short tendon
#

Okay, will try in a bit

manic glacierBOT
#

So, I have a RGBMatrix brightness workaround... you can even use a brightness control to adjust the brightness values of all text/vectorio shapes and displayed BMP images. I'm defining all color values in HLS instead of Hex, which makes it super simple to change the brightness without changing the color value (just adjust L/level). For BMPs, feed the pixel_shader into a function that converts the integer colors to HSL, then adjusts their level and inserts the new value back into the pixel...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Is there a technical reason for selecting exactly these SPI-pins? Waveshare claims that this board is useful for the Pico oecosphere, but the SPI-pins don't map:

ESP32-S3   Pico   Function
GPIO36 ->  GP11   TX (MOSI)
GPIO35 ->  GP10   SCK
GPIO37 ->  GP12   RX (MISO)

So swapping GPIO36 and GPIO35 would align functions and make it possible to swap the Waveshare for the Pico in existing designs.

manic glacierBOT
#

Yes, I explicitly bought that board to replace the Pico with the more powerful ESP32-S3-Pico. I do know how to build my own version with a different pin mapping, but I thought other users would also profit if swapping these two pins is possible. BTW: the I2C pins map perfectly to I2C1 on GP6/GP7.

manic glacierBOT
manic glacierBOT
#

I haven’t used the S3 version of the MatrixPortal yet, but suspect that the default color bit depth is set to two bits, just four levels of color brightness, limiting the granularity of intensity. When instantiating the display in CircuitPython, the bit depth can be set to 6-bits which increases the brightness granularity — at a price of needing more memory to hold the display buffer. If you are using CircuitPython displayio objects, you could apply something like PaletteFader to help. http...

manic glacierBOT
manic glacierBOT
#

OK I think I have docker build setup. I am way out of my comfort zone here 8-)). I am new to Linux just because that appears to be the only way to build Circuit Python. So not really sure what I am going at this stage.

Please send the docker environment and I’ll try to use it.

Thanks,

On Feb 21, 2024, at 7:01 AM, Nguyen Van Chat @.***> wrote:

I am not sure about your build environment.
Can you setup and build with docker ubuntu:22.04?
I will try build a docke...

short tendon
#

@slender iron do we want to keep this section in requests?

This was originally what set_socket used, but that's gone. I changed it to be create_default_session, which then you could do:

import adafruit_requests as requests
requests.get(...)

In another file, but not sure if that's worth it, vs just creating a new adafruit_requests .Session (since it's now all tracked anyways).

Personally this feels harder to troubleshoot if we keep it

https://github.com/adafruit/Adafruit_CircuitPython_Requests/blob/c533f184d7e1af70a8aac281055f38f555c93641/adafruit_requests.py#L619C1-L680C57

slender iron
midnight ember
#

Will both methods be allowed until 10.x so there's a 9.x transition like with some displayio methods?

#

Might not be possible to have both and I'm ok with that if there's going to be a hard cutoff in 9.x. For the sake of consistency across libraries I think it's a good thing either way.

slender iron
#

requests changes won't be tied to a CP version. it'll be versioned by the library

midnight ember
#

ohh interesting 👍

short tendon
slender iron
#

ya, I know there's this weird difference

manic glacierBOT
#

I also have no idea how this is implemented on dual core CPUs. Is it possible that the portENTER_CRITICAL function is not working as intended?

Running CP on the second core should insulate it from this.

My understanding is that onewire's bits are timing sensitive but not the inter-bit timing. Is that true? It is possible a Python garbage collect is causing a delay between bits.

Definitely try on the latest 9.x builds as well. A lot has changed under the hood for ESP.

short tendon
# slender iron ya, I know there's this weird difference

I've typically been creating requests and connecting to WiFi in a connections.py and then importing that requests in other files. Again happy to leave it, but anyone using set_socket will already need to change code and getting everyone to use the same thing fells like a support win

#

Also, do you want CM in the bundle when requests is merged, or now?

#

^^ also responded on GH for that one

manic glacierBOT
#

So I decided to try something completely different rather than trying to fix the current Ubuntu 22.04.2 (x86_64 emulation) with Parallels on my Mac. I started a completely new VM but this time using Ubuntu 22.04.2 ARM64 to see if that makes any difference.

I followed the Adafruit notes as defined here…

https://learn.adafruit.com/building-circuitpython/linux
Building CircuitPython
learn.adafruit.com

and here…

https://docs.circuitpython.org/en/latest/ports/silabs/README.html#prer...

manic glacierBOT
slender iron
gilded cradle
slender iron
#

Thanks! I figure we can change the default value to match

#

I don't have that touch setup

gilded cradle
#

@slender iron I used CIRCUITPY_HEAP_START_SIZE=2048000

slender iron
#

that's all the PSRAM I think...

gilded cradle
#

That's on CircuitPython 9.0.0-alpha.5

slender iron
#

do you have it setup?

gilded cradle
#

yes

slender iron
#

I was thinking more like 128k or 512k

gilded cradle
#

That may have been the multiplier issue version

#

So it may have actually used 1/8 of that

#

or 1/4. I can't remember.

#

I can try beta 2 and see how that performs

#

@slender iron 512000 seems to work fine. I also tried 128000 and 256000 and both still showed the issue.

manic glacierBOT
gilded cradle
#

The larger number may have been when I was figuring out where the issue popped up and was testing on alpha 4, but can't remember for certain.

slender iron
gilded cradle
slender iron
#

It may be more that there are too many garbage collections early

gilded cradle
#

It did seem to start instantly with 512k, though the delay was noticeable with the 2M setting.

slender iron
#

Thanks for retesting

gilded cradle
#

No worries. I already had everything hooked up, so it was easy.

manic glacierBOT
tulip sleet
#

@onyx hinge The PyCamera library is currently at version 0.0.9. Is there a reason not to make it a 1.0.0 release? I am about to release with the filesystem check.

onyx hinge
#

@tulip sleet go for it!

tulip sleet
#

emoji pun

short tendon
#

State of ConnectionManager for anyone that's curious:

  • v1 code is merged into Adafruit_CircuitPython_ConnectionManager, on pypi and RTD
  • v1 code has been frozen to the 13 boards that also have Adafruit_CircuitPython_Requests
  • PR open to add it to the bundle
  • Adafruit_CircuitPython_Requests PR updated to use the released CM and updated all examples to use adafruit_requests.Session and os.getenv
  • Have one last question if we want to keep the methods like get that are directly on adafruit_requests (the ones that worked based on the old set_socket
slender iron
#

is the PR to the bundle non-draft?

short tendon
#

Yup. Fixed it earlier

slender iron
#

kk, I'm not sure I get an email when one is moved out of draft

short tendon
#

Probably not. I fight with that at work and our automation all the time...

manic glacierBOT
tidal kiln
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

So, I think the addition of USB host in 9.x is the main cause of this regression (not the split heap stuff). It takes ~12k extra static RAM. At least 5k of that is code that needs to run even when the flash is being accessed.

CIRCUITPY_USB_HOST=0:
RAM: 91956 B 256 KB 35.08%

CIRCUITPY_USB_HOST=1:
RAM: 104392 B 256 KB 39.82%

LWIP and picodvi also have large RAM footprints even when they aren't in use as well.

I think that using mpy ...

slender iron
manic glacierBOT
onyx hinge
#
  File "code.py", line 123, in <module>
  File "adafruit_httpserver/server.py", line 186, in serve_forever
  File "adafruit_httpserver/server.py", line 226, in start
OSError: [Errno 112] EADDRINUSE
```I got this today with newly installed adafruit_httpserver via circup. I guess the SO_REUSEADDR change is not released yet?
#

I see #83 / #84 in that repo are still in progress. OK.

slender iron
mortal kernel
tame creek
#

yeah sorry, haven’t gotten around to obtaining a RP2040 board with exposed SWD yet

mortal kernel
#

NP. It's a call to panic() in __tusb_irq_path_func.

tame creek
#

that suggests that my hypothesis about back-to-back control transfers, some of which are aborted, might be part of it

mortal kernel
#

Could be. It's calling panic because of an attempt to set USB_BUF_CTRL_AVAIL when it's already set in the endpoint's buffer_control. Now for SWD and a backtrace.

manic glacierBOT
tulip sleet
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.2 on 2024-02-20; Waveshare ESP32-S2-Pico with ESP32S2

Code/REPL

### Starting the Server

mdns_server = mdns.Server(wifi.radio)
mdns_server.hostname = MDNS_HOSTNAME
mdns_server.advertise_service(service_type="_http", protocol="_tcp", port=80)

pool = socketpool.SocketPool(wifi.radio)
server = HTTPServer(pool, "/static", debug=True)

@server.route("/")
def base(request: Request):
    return Re...
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.9 on 2023-12-06; VCC-GND YD-ESP32-S3 (N16R8) with ESP32S3

Code/REPL

import synthio
import board
import audiobusio
import usb_midi
import adafruit_midi
from adafruit_midi.control_change import ControlChange
from adafruit_midi.note_on import NoteOn
from adafruit_midi.note_off import NoteOff
import audiomixer
import ulab.numpy as np
import time
import asyncio
import analogio
import keypad

### Ini...
manic glacierBOT
manic glacierBOT
short tendon
manic glacierBOT
tulip sleet
tulip sleet
mortal kernel
#

I'm building CP with

make BOARD=raspberry_pi_pico_w CIRCUITPY_DEBUG_TINYUSB=3 V=commands DEBUG=1 -j16

but I'm not getting any USB debug messages on my UART. I've defined CIRCUITPY_CONSOLE_UART_RX and CIRCUITPY_CONSOLE_UART_TX and I am getting REPL on the UART.

tulip sleet
#

that could be fixed

mortal kernel
tulip sleet
#

probably would save another person some time later :). But you can keep it in your pocket for some PR

short tendon
slender iron
#

@tidal kiln do you know who is planning on doing the INA228 library?

tidal kiln
#

(you must have read same forum post...i was also double checking for it this morning)

crimson ferry
#

@short tendon for WIZnet Ethernet (and I think ESP32SPI too), it should be valid (for now) to have None for context instead of FakeSSLContext?

manic glacierBOT
#

You can try with docker environment with below guide:

Extract

dev-machine:~$  unzip build_cp.zip
dev-machine:~$  cd build_cp

Build docker image

dev-machine:~/build_cp$  docker build -t docker_cp .

Run docker image & build

dev-machine:~/build_cp$  docker run -it -v $PWD:/build docker_cp

root@docker:/#  cd ./build/
root@docker:/build/#  git clone https://github.com/adafruit/circuitpython.git
root@docker:/build/#  cd ./circuitpython
root@docker:/...
tidal kiln
tulip sleet
onyx hinge
#

@tulip sleet I don't know why not

tulip sleet
#

i will make a new release with the renamed ipcam too, then

slender iron
tidal kiln
#

the changes would be along the lines of PR2378 with minor mods. i've tested that PR and it needs some tweaks.

tulip sleet
#

If rock/paper/scissors works for, say, CPy 6, we could add a note to the guide. I can move the issue to 9.x.x

slender iron
#

I'm trying to remember why I stopped it from working

tulip sleet
#

i didn't realize it was deliberate

tidal kiln
#

it sounds like this issue is going to be deferred. i'll work on updating the code/guide.

slender iron
#

Only one device identity list can be used at a time and the list is shared between the BLE roles. The device identity list cannot be set if a BLE role is using the list.

#

maybe not

#

maybe it was a resource thing

mortal kernel
#

Apropos #8824: I'm unable to attach MacOS USB with CIRCUITPY_DEBUG_TINYUSB set to 3. With Linux, USB attaches normally with exact same build. Any clues appreciated. ❤️
Here's the trace:

Version: 7.95.49 (2271bb6 CY) CRC: b7a28ef3 Date: Mon 2021-11-29 22:50:27 PST Ucode Ver: 1043.2162 FWID 01-c51d9400
cyw43 loaded ok, mac 28:cd:c1:00:d3:a5
Adafruit CircuitPython 9.0.0-beta.2-6-g89437cf031-dirty on 2024-02-22; Raspberry Pi Pico W with rp2040
Board ID:raspberry_pi_pico_w
UID:E6614C775B4D5335
MAC:28:CD:C1:00:D3:A5
USBD init on controller 0
sizeof(usbd_device_t) = 83
sizeof(tu_fifo_t) = 20
sizeof(tu_edpt_stream_t) = 40
CDC init
MSC init
HID init
VIDEO init
MIDI init
sizeof(hw_endpoint_t) = 32
0;🐍Wi-Fi: off | Done | 9.0.0-beta.2-6-g89437cf031-dirty
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
0;🐍Wi-Fi: off | code.py | 9.0.0-beta.2-6-g89437cf031-dirtyHello World!
0;🐍Wi-Fi: off | Done | 9.0.0-beta.2-6-g89437cf031-dirty
Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.
BUS RESET
USBD Bus Reset : Full Speed

USBD Setup Received 00 05 01 00 00 00 00 00 
  Set Address
  Prepare BufCtrl: [0] = 0xf400  [1] = 0x0000
buf_status = 0x00000001
  Sync BufCtrl: [0] = 0x6000  [1] = 0x0000
  Short packet on buffer 0 with 0 bytes
Completed transfer of 0 bytes on ep 0 in
USBD Xfer Complete on EP 80 with 0 bytes
BUS RESET
USBD Bus Reset : Full Speed
BUS RESET
USBD Bus Reset : Full Speed
[repeats a few times, then:]
USBD Setup Received 00 05 01 00 00 00 00 00 
  Set Address
  Prepare BufCtrl: [0] = 0xf400  [1] = 0x0000
buf_status = 0x00000001
  Sync BufCtrl: [0] = 0x6000  [1] = 0x0000
  Short packet on buffer 0 with 0 bytes
Completed transfer of 0 bytes on ep 0 in
USBD Xfer Complete on EP 80 with 0 bytes
tulip sleet
#

he is in Vietnam, so expect him to be online around 9pm PT

mortal kernel
tidal kiln
#

@slender iron i can just re-work code. this seems like a non-trivial fix for the core.

slender iron
#

it was done deliberately for 7

mortal kernel
#

I think I'm seeing a timing problem, i.e., debug messages are slowing things down enough to induce it.

tidal kiln
#

yah. the code is much older. one other question - did terminalio.FONT change at some point?

tidal kiln
#

size, shape, etc. - it's not lining up in the UI as it used to - for the CLUE morse thing

#

easily fixable by tweaking positioning

slender iron
#

maybe....

tidal kiln
#

i guess it could be a change in the display_text library also...some minor change in positioning

slender iron
#

I feel like there was some padding fix

tidal kiln
#

yah. it's like that. padding changed or something.

slender iron
#

nothing recently though

tidal kiln
#

code isn't recent 🙂

#

meh. no worries. will fix at same time as updating for the BLE connect stuff.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.9 on 2023-12-06; Adafruit QT Py RP2040 with rp2040
Board ID:adafruit_qtpy_rp2040 UID:DF611CF78F5F3D32
I got this message:
Hard fault: memory access of instuction error.
Please file and issue with your program here (github.com etc.)
Press reset to exit safe mode.
I have a SSD1306 display and a 24lc32 eeprom over stemma i2c

Code/REPL

""
This is code to write and read from an eeprom
"""
import gc
impor...
short tendon
#

Which may cause issues if other code depends on that

#

If you use get_radio_socketpool, it creates the fake context, and just stores it

manic glacierBOT
#

Thanks for the docker file and instructions. Looks to be exactly the same problem that I posted about yesterday when trying a clean new Ubuntu VM.

@.***:/build/circuitpython/ports/silabs# make BOARD=devkit_xg24_brd2601b V=2 clean
rm -rf build-devkit_xg24_brd2601b

@.***:/build/circuitpython/ports/silabs# make BOARD=devkit_xg24_brd2601b V=2
SLC generates project
Traceback (most recent call last):
File "/build/circuitpython/ports/silabs/tools/slc_cli_linux/slc", line 23,...

crimson ferry
short tendon
#

That's one of the things set_socket did (tied the radio and pool together)

#

One of the next additions I am hoping to get is passing the radio to things like requests and minimqtt. And that way the pool and context can be grabbed there

crimson ferry
#

so if, for example, we had a device with ESP 32 SPI and Wiz net… Sessions encapsulates that and we could run both at the same time?

short tendon
#

And if you are doing something specific, you can still pass them in

#

You would need to manually create 2 ConnectionManagers, but yes

crimson ferry
#

How does socket allocation happen when there’s more than one connection manager?

short tendon
#

My goal: simple for those that just need it to work, and options for those that are doing something extra

#

They would both track sockets separately. At that point it would fully be limited by device memory

crimson ferry
#

makes sense, the socket sources are different, so there’s not really any contention other than overall memory

#

one pool per radio,, one connection manager per pool, one or more socket-using applications per connection manager

short tendon
#

Yup. That's what I'm working towards

#

My UM S3 can have 7 native sockets open. Going to work with adding an esp32spi and wiznet5k and see what happens

crimson ferry
#

cool, that will be a fun one

slender iron
#

there is probably optimizations you can do to make more than 7 fit

short tendon
#

Oh really, what??

slender iron
#

tuning RAM memory use

#

or maybe there is a hard cap somewhere

short tendon
#

Are their docs on how to do that? Would be curious to play with it

solar whale
slender iron
#

to determine if it is a hard limit setting vs ram unavailable

manic glacierBOT
manic glacierBOT
#

GPIO48 is used for the RGB LED input and is also SPICLK_N (not clear how that is used). If you set a pin other than GPIO48 here, does it crash? Does it crash if creating a keypad with GPIO48 in a simple program that doesn't use synthio at all?

I tried other pins, like 21, same situation. Plus, as mentionned in the comments, using sensors or using any prepheral on top of synthio was causing crashes.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@noqman, The purchase link from the circuitpython.org site goes to the Cytron Maker UNO. I can find a Cytron Maker PI RP2040 on Cytron's web site, but I can't find a Cytron Maker UNO RP2040.

Is this board name correct or should it be "Cytron Maker UNO"?

Hi, I'm very sorry I missed your question, and I apologize for the late reply. Actually, we planned to launch this product at the end of this month, which is why you can't find the product on our website. The product page is curren...

manic glacierBOT
manic glacierBOT
#

I have now got everything working, display and eeprom code together and displaying eeprom data to display.
I do get a bunch of FutureWarning messages at start, see below.
FutureWarning: Display moved from displayio to busdisplay
FutureWarning: Display renamed BusDisplay
FutureWarning: EPaperDisplay moved from displayio to epaperdisplay
FutureWarning: FourWire moved from displayio to fourwire
FutureWarning: I2CDisplay moved from displayio to i2cdisplaybus
FutureWarning: I2CDisplay ren...

manic glacierBOT
#

It would be nice if effects could be added to the voices on the audio mixer. For example: pitch (playback rate and/or time-stretch), reverb and EQ maybe?

This can't be done near-realtime in Python, so it is better suited to a compiled library. Most effects would require buffering but should be achievable on something like a Pico.

manic glacierBOT
#

How much space does an alias add to the M0 build? I like the generic RFM_* names used on the RP2040 and I think it is unlikely that multiple modules will be present on the same board. Even if they were, then that would warrant some alternative naming for that case. Using RFM_* would make it a lot easier to migrate between boards and to write guides and examples for multiple boards. It is more like the way displays are handled with TFT_*. Changing the M0 names will break a lot of existin...

short tendon
#

Good morning @slender iron realized that Adafruit_CircuitPython_PortalBase also uses requests and that there is a call to set_socket in there we need to update before we merge in requests. I looked in GitHub and need to make a similar change in both adafruit_esp32spi_wifimanager and adafruit_espatcontrol_wifimanager. I see 2 options:

  1. in adafruit_portalbase/wifi_coprocessor.py
import adafruit_connection_manager
...
pool = adafruit_connection_manager.get_radio_socketpool(esp)
ssl_context = adafruit_connection_manager.get_radio_ssl_context(esp)
requests = adafruit_requests.Session(pool, ssl_context)
import adafruit_connection_manager
import adafruit_esp32spi.adafruit_esp32spi_socket as pool
...
ssl_context = adafruit_connection_manager.create_fake_ssl_context(pool, esp)
requests = adafruit_requests.Session(pool, ssl_context)

Do you have a preference? I'd make the same changes in the other ones. Personally I like the adafruit_connection_manager.get_radio_* methods and it moves in a way to minimize imports and standardize user code.

onyx hinge
#

@short tendon I did a little full text searching and found that library code in drivers/esp-atcontrol drivers/esp32spi and helpers/azure also use requests.set_socket. There are also 33 requests.set_socket calls in examples (+ more MQTT.set_socket(), not sure of the status of that)

I like alternative #1 fwiw.

short tendon
onyx hinge
#
libraries/drivers/esp-atcontrol/adafruit_espatcontrol/adafruit_espatcontrol_wifimanager.py:56:9:        requests.set_socket(socket, esp)
libraries/drivers/esp-atcontrol/adafruit_espatcontrol/adafruit_espatcontrol_wifimanager.py:123:9:        requests.set_socket(socket, self._esp)
libraries/drivers/esp-atcontrol/adafruit_espatcontrol/adafruit_espatcontrol_wifimanager.py:148:9:        requests.set_socket(socket, self._esp)
libraries/drivers/esp-atcontrol/adafruit_espatcontrol/adafruit_espatcontrol_wifimanager.py:170:9:        requests.set_socket(socket, self._esp)
libraries/drivers/esp-atcontrol/adafruit_espatcontrol/adafruit_espatcontrol_wifimanager.py:191:9:        requests.set_socket(socket, self._esp)
libraries/drivers/esp-atcontrol/adafruit_espatcontrol/adafruit_espatcontrol_wifimanager.py:212:9:        requests.set_socket(socket, self._esp)
libraries/drivers/esp32spi/adafruit_esp32spi/adafruit_esp32spi_wifimanager.py:64:9:        requests.set_socket(socket, esp)
libraries/drivers/wiznet5k/README.rst:83:5:    requests.set_socket(socket, eth)
```these are the non-example locations I see within the adafruit bundle
short tendon
#

Okay, those are the same ones I found. Where is the azure one?

short tendon
solar whale
#

@onyx hinge Other than wasting some time, is there any "down-side" to executing the Autofocus code on an OV5640 camera that does not have the AF motor. It is not clear that there is any way to tell if it is supported or not and it seems to "do no harm". It goes through the motions and seems happy to "try" to focus it. I was just curious if I was missing something and needed to worry about executing it on a board with no motor.

onyx hinge
#

@solar whale honestly no idea, sorry

#

I too suspect it's OK

solar whale
short tendon
#

@onyx hinge didn't want this to get lost. Where is the azure one?

onyx hinge
#

@short tendon my mistake, the azure ones are MQTT.set_socket

#
libraries/helpers/azure/adafruit_azureiot/iot_mqtt.py:123:13:        MQTT.set_socket(self._socket, self._iface)
short tendon
#

Just need to get Scott's opinion on the alternatives

manic glacierBOT
slender iron
short tendon
slender iron
#

I do

manic glacierBOT
slender iron
#

done

short tendon
slender iron
#

I was thinking they'd get released next time foamyguy does a sweep

short tendon
#

👍

short tendon
#

@slender iron Requests PR updated. Got test coverage up to 85%

#

After that's in, I'll finish attacking MiniMQTT

slender iron
#

I think we should wait until next week to merge it

#

just to ensure no one hits an issue over the weekend

short tendon
#

Totally agree with you there. But if you have time to review I can work to fix anything else up before then

slender iron
#

I'm already through my reviews for the day. debugging usb now

short tendon
#

Sounds good. Enjoy your weekend

slender iron
#

thanks! you too

short tendon
#

Is there an Adafruit owner for Adafruit_CircuitPython_AzureIoT? It's totally broken for wiznet5k and esp32spi because it directly imports ssl and uses ssl.create_default_context(). And also uses MQTT.set_socket which also creates a fake ssl context. This change was over 2 years ago...

I see 2 paths forwards:

  1. fully remove support for anything without on-board/native wifi
  2. add support for esp32spi and update docs to state that the wiznet5k is not supported (it doesn't say that it is, just being specific)
#

it does state:

Board Compatibility: The following built-in modules must be available: gc, json, ssl, time
But then does list ESP32 AirLift Networking right under that

slender iron
#

I think it was done by someone at microsoft. and they just annouced it is going away I think

short tendon
#

So that sounds like I should do #1? Otherwise it will break when we merge in the MiniMQTT changes...

manic glacierBOT
#

Adding the RFM aliases takes 84 bytes extra on Feather M0 RFM69. We recently gained a lot of space by switching to shorter error messages on these smallest builds.

    { MP_ROM_QSTR(MP_QSTR_RFM_D0), MP_ROM_PTR(&pin_PA09) },
    { MP_ROM_QSTR(MP_QSTR_RFM69_D0), MP_ROM_PTR(&pin_PA09) },
    { MP_ROM_QSTR(MP_QSTR_RFM_RST), MP_ROM_PTR(&pin_PA08) },
    { MP_ROM_QSTR(MP_QSTR_RFM69_RST), MP_ROM_PTR(&pin_PA08) },
    { MP_ROM_QSTR(MP_QSTR_RFM_CS), MP_ROM_PTR(&pin_PA06) },
manic glacierBOT
#

I suppose the other way to look at this is to say that leaving it as is only means adding a few lines to be commented in/out of any examples. Perhaps that is the better way to go to avoid the inevitable issues with running out of space for every change to 9.x.x builds. 84 bytes is not trivial....
As noted, going forward standardized names should be used but it may not be worth losing back at the M0 boards.

Regarding the examples, we still will likely include examples of how to use them wi...

#

The older names would be dropped in 10.0.0. But we'd need to change several guides and examples.

Another change I see is to name the I/O pins DI0, DIO1, etc. uniformly. Those are the names used on both the SXnnn datasheets and the RFMnn module datasheets. Then they don't get confused with the regular D0, etc. pins.

For any future boards, I'll try to make sure the names are consistent with the guidelines described so far:

  • RFM_*
  • RFM_DIO*

Also the Arduino pin names ...

slender iron
manic glacierBOT
manic glacierBOT
manic glacierBOT
short tendon
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.9 on 2023-12-06; Swan R5 with STM32L4R5ZIY6

Code/REPL

def work():
  led.value = 1
  time.sleep(LED_TIME)
  led.value = 0

while True:
  # do some work
  work()

  # sleep
  if MODE == SPIN:
    next = time.monotonic() + INT_TIME
    while time.monotonic() < next:
      continue
  elif MODE == SLEEP:
    print(f"(normal) sleep for {INT_TIME}s")
    time.sleep(INT_TIME)
  elif MODE == LIGHT_SLE...
manic glacierBOT
#

@hathach How do we initialize the USB host stuff so that we can see devices that are already attached? Do we need to toggle power or is there a TinyUSB bug here?

when initializing usb host, it should reset controller, any current attached device should go to enumeration process as newly plugged. Otherwise, it is a bug with controller, in this case is the pio-usb controller. Let me try to reproduc this first, @FoamyGuy do you have any quick code.py to test with.

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.0-24-g6022b94cf6-dirty on 2024-02-11; Seeed XIAO nRF52840 Sense with nRF52840

Code/REPL

import time
import gc
MEM_CUTOFF = 16000
time.sleep(4)
a = []
print("Eating memory:...")
while True:
    gc.collect()
    mem_free = gc.mem_free()
    if mem_free < MEM_CUTOFF:
        print(f"mem_free: {mem_free}")
        print("opening file")
        time.sleep(0.5)
        f = open("mem_test.txt", "...
manic glacierBOT
#

This is starting to look like a possible hardware erratum where the device controller doesn't clear USB_BUF_CTRL_AVAIL on EP0 when a SETUP packet arrives before the OUT packet from a preceding control write. In the first case, there's a panic because TinyUSB finds the flag already set. In the second case, TinyUSB gets a completion interrupt from the OUT packet arriving before it configures EP0 to receive the data stage, because the device controller accepts the OUT DATA due to the flag alre...

manic glacierBOT
mortal kernel
#

@tame creek I'm getting the backtraces you asked for now. @danh suggested that I try reproducing this with blink as you'd mentioned earlier in the issue. Could you give me the descriptors that you used for the ACM endpoint?

tame creek
# mortal kernel <@824013908490059826> I'm getting the backtraces you asked for now. @danh sugges...

i just changed this in pico-examples; no special ACM descriptors

diff --git a/blink/CMakeLists.txt b/blink/CMakeLists.txt
index 63ffbd3..d953b9f 100644
--- a/blink/CMakeLists.txt
+++ b/blink/CMakeLists.txt
@@ -5,6 +5,10 @@ add_executable(blink
 # pull in common dependencies
 target_link_libraries(blink pico_stdlib)
 
+# enable usb output, disable uart output
+pico_enable_stdio_usb(blink 1)
+pico_enable_stdio_uart(blink 0)
+
 # create map/bin/hex file etc.
 pico_add_extra_outputs(blink)
 
diff --git a/blink/blink.c b/blink/blink.c
index d478d78..8fa2f49 100644
--- a/blink/blink.c
+++ b/blink/blink.c
@@ -13,6 +13,7 @@ int main() {
     const uint LED_PIN = PICO_DEFAULT_LED_PIN;
     gpio_init(LED_PIN);
     gpio_set_dir(LED_PIN, GPIO_OUT);
+    stdio_init_all();
     while (true) {
         gpio_put(LED_PIN, 1);
         sleep_ms(250);
tame creek
mortal kernel
tame creek
midnight ember
manic glacierBOT
#

Here is a backtrace from a breakpoint at panic():

Thread 1 hit Breakpoint 1, panic (fmt=0x0) at sdk/src/rp2_common/pico_runtime/runtime.c:307
307	void __attribute__((noreturn)) __printflike(1, 0) panic(const char *fmt, ...) {
(gdb) bt
#0  panic (fmt=0x0) at sdk/src/rp2_common/pico_runtime/runtime.c:307
#1  0x20000ba2 in _hw_endpoint_buffer_control_update32 (ep=ep@entry=0x2000d0cc <hw_endpoints+32>, and_mask=and_mask@entry=0, 
    or_mask=or_mask@entry=54272) at ../../lib/tinyus...
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.2 on 2024-02-20; Adafruit Camera with ESP32S3

Code/REPL

import os
import storage

storage.remount("/", readonly=False)

try:
    os.mkdir("/sd")
except OSError:
    pass  # It's probably 'file exists', OK to ignore

storage.remount("/", readonly=True)

Behavior

Above Code is in boot.py. When going to http://cpy-da7e84.local/fs/#/sd/, I get the following error in the console:

V...
mortal kernel
#

@tame creek I've also captured a USB trace with a Beagle. I can send you a CSV if you'd like.

manic glacierBOT
#

@eightycc thanks! That is helpful, even if the trace is missing the control request details. It looks like in this instance, there are back-to-back control writes with no data, so they're answered with a ZLP IN transaction (control status stage). The one that panics is because the AVAILABLE flag set by the previous status stage wasn't cleared by the device controller hardware when the transfer was aborted with a new SETUP packet.

tame creek
mortal kernel
#

Not the same event. I'll re-run it to get you traces of the same event with the Data Center capture file.

tame creek
mortal kernel
#

You bet. Give me a few minutes...

manic glacierBOT
#

@tlyu Here are the traces of single failure event. The Control Center capture is the zip file at the end.

Thread 1 hit Breakpoint 1, panic (fmt=0x0) at sdk/src/rp2_common/pico_runtime/runtime.c:307
307	void __attribute__((noreturn)) __printflike(1, 0) panic(const char *fmt, ...) {
(gdb) bt
#0  panic (fmt=0x0) at sdk/src/rp2_common/pico_runtime/runtime.c:307
#1  0x20000ba2 in _hw_endpoint_buffer_control_update32 (ep=ep@entry=0x2000d0cc <hw_endpoints+32>, and_mask=and_mask@entry=0, ...
manic glacierBOT
#

@eightycc thanks so much for the coordinated traces! The Beagle trace confirms what I've seen before in a previous context: some CDC control requests sent by macOS are aborted. It also confirms that my suspicions are likely correct, that the RP2040 hardware doesn't clear some state for a SETUP packet that it probably should.

There are 4 OUT control transfers of length 7, which are CDC Set Line Coding, followed by 3 no-data control transfers, which are CDC Set Control Line State.

The fir...

manic glacierBOT
manic glacierBOT
manic glacierBOT
vital matrix
#

So I was adding some unit tests with a fake i2c device for adafruit_bitbangio - and saw something that I couldn't understand how it's working 🙂 : https://github.com/adafruit/Adafruit_CircuitPython_BitbangIO/blob/2410e85a2faaa0c408aa6bb91b5817617cf23540/adafruit_bitbangio.py#L404-L408

E.g.: with spi mode 1 (polarity=0, phase=1) wikipedia thinks data should be written on the rising clock edge. https://en.wikipedia.org/wiki/Serial_Peripheral_Interface#:~:text=the original specification.-,Mode numbers,-[edit]

But the code is updating mosi value on the falling clock - e.g. when polarity = 0, it's getting set here when the clock is also going from 1->0

I was initially thinking that maybe the read code got copy-pasted without flipping the logic for the write, but second-guessed myself as I'd imagine this would have caused issues before. (Maybe because the mosi value is getting set right before the clock, there's just enough time for the values to update by the time the peripheral reads the data on the falling edge? Not sure..)

I dumped some of the net values from the simulation here: https://ibb.co/7CLJ4xm - the decoder is still able to get the right bits (for mode=1) but it also seems like it's because the data is getting pushed out just before the falling edge.

manic glacierBOT
manic glacierBOT
#

Hi Guys,

Just want to give an update on progress rebuilding the CircuitPython .bin file for the SiLabs EFR32MG24 Dev Kit. I finally got it to work. Here’s how…

I have an old Intel i5 based Mac on which I re-installed the mac OS, specifically Big Sur 11.7.10, so it was completely clean. Then I installed the Parallels VM tools, then used the Parallels tools to install Ubuntu 22.04. Following that I installed the Docker build tools, and then followed the instructions for building and runni...

orchid basinBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#
Thread 1 hit Breakpoint 1, panic (fmt=0x0) at sdk/src/rp2_common/pico_runtime/runtime.c:307
307	void __attribute__((noreturn)) __printflike(1, 0) panic(const char *fmt, ...) {
(gdb) bt
#0  panic (fmt=0x0) at sdk/src/rp2_common/pico_runtime/runtime.c:307
#1  0x20000bc6 in _hw_endpoint_buffer_control_update32 (ep=ep@entry=0x2000d0ec <hw_endpoints+32>, and_mask=and_mask@entry=0, 
    or_mask=or_mask@entry=54272) at ../../lib/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.c:115
#2 ...
mortal kernel
#

@argonblue Looks like progress and I think you are on the right track. Let me know if there's anything I can do to help.

manic glacierBOT
#

@eightycc thanks! Which RP2040 board are you using, and what is its CPU clock speed? I guess it could also be down to a host-side timing issue as to why I'm not longer seeing failures and you are.

There's some TinyUSB-side state that I needed to reset as well, which explains the "already active ep 0". There's also a delay missing from the buffer control setting, which might be necessary to ensure that the AVAILABLE flag is already clear before proceeding with the rest of the request handling.

manic glacierBOT
tame creek
#

@mortal kernel if you put the parens around the bitwise-and, and it went back to 10/10 failures, that's kind of odd. it definitely fixes the failures for me on the macropad, even with circuitpython

#

i wonder if the Pico W is running on both cores due to the WiFi support, and maybe that's running into race conditions between the cores?

mortal kernel
#

I can test with a plain Pico if you'd like.

tame creek
#

@mortal kernel how are you getting the REPL and the TinyUSB trace in the same window? is the REPL outputting to UART? or are you sending TinyUSB traces to CDC?

mortal kernel
mortal kernel
short tendon
#

I just got my Video Game Module for Flipper Zero which is a RP2040. Thought I might try my hand at adding a port. Would it be worth it to add this one?

stuck elbow
short tendon
#

No, I don't. It has some interesting things (video out, and 6-dof), but that isn't really my project style for what I use CP for

mortal kernel
#

@tame creek Sorry for the delay. Got a bad (my first) Pico. Let me solder up another...

tame creek
mortal kernel
tame creek
mortal kernel
tame creek
# mortal kernel Me too, at level 3.

log level 2 at 230400 bps enumerates, but panics on tio disconnect, even with my patch, so there's definitely a race condition in my workaround and almost certainly a hardware erratum

mortal kernel
tame creek
tame creek
#

to confirm, you're using commit dc8cb27048240fe91015b01480eea77f707aa784 or a cherry pick of it?

mortal kernel
tame creek
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.2-10-g54e78c89fc on 2024-02-22; Seeeduino Wio Terminal with samd51p19

Code/REPL

import displayio
displayio.*tab*

Behavior

>>> displayio.FutureWarning: Display moved from displayio to busdisplay
FutureWarning: Display renamed BusDisplay
FutureWarning: EPaperDisplay moved from displayio to epaperdisplay
FutureWarning: FourWire moved from displayio to fourwire
FutureWarning: I2CDisp...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I have been doing a lot of testing between CP8 and CP9. When I do similar testing in CPython, I have different virtual envs that I activate to test code on. Since CircuitPython has a lib path order, it would be awesome to make it (for CP9):

  • current dir
  • root
  • frozen
  • lib9
  • lib

This way when 10 comes out, lib9 would become lib10 and when you switched versions back and forth, back and forth you wouldn't need to re-copy files (or download source, which is why I am doing curre...

midnight ember
#

I will likely be missing the meeting today. Added a picture in the notes for the TFT BFF.

manic glacierBOT
manic glacierBOT
manic glacierBOT
lone axle
#

Does anyone happen to know more specifically what "Mismatched versions in .pre-commit-config.yaml " on the circuitpython.org library infrastructure issues page means?

Or alternatively if it's possible / how to run this report locally so I can try to add some print statements to the code to understand what specific versions it's believing are problematic.

I noticed ConnectionManager is in that list, which was very recently cookie cutter'd I believe. If there is something mismatched in there it's perhaps an indication that an update to the cookie cutter templates are in order.

tulip sleet
short tendon
lone axle
#

I don't personally have much of a preference on the specific versions we use. But I think it should be consistent across all libraries so we don't end up with inconsistencies, and I'd still like to understand if there is some way to glean more info from the report or the libraries it identified issues with.

manic glacierBOT
short tendon
#

And not sure if I can have access to the report, to see if I can help get more information

lone axle
short tendon
#

I can get that done tonight when I'm at my desk. I'll ping you here so you can release and see if it fixes it (on your schedule)

#

Have you all talked about isort before?

manic glacierBOT
lone axle
#

I've seen the name pop-up before, I'm not sure if it was in a disscussion here on discord or just usage in some place. I'm not really sure what it does tbh. I don't think there have been any substantial discussion around it.

short tendon
#

It sorts imports, so it just helps keep code clean

mortal kernel
#

@summer boughnblue Good morning! I'll be setting up and testing your latest patch once I've had my coffee. A couple of quick questions: Why does your pull set USB_BUF_CTRL_DATA1_PID? What is the race condition you're correcting?

tame creek
candid sun
proven garnet
manic glacierBOT
#

You can modify sys.path yourself to do the same thing. I don't think we want to make the lib dir version dependent, because it would require a lot of new explanation. But the other day I thought we might suggest to MicroPython that .mpy files encode the mpy version in the filename: .mpy8, etc. The .mpy version does not correspond to the CircuitPython or MicroPython major version number, so that's a bit confusing. MicroPython has not adopted a semver style of version numbering, either.

proven garnet
#

Mismatched versions is an adabot-generated flag for repos whose pre-commit revisions don't match the pre-commit-config file in the cookiecutter

#

BUT based on how it works, it'll also trigger if the hooks don't match up as well (e.g. new hooks not in the cookiecutter)

manic glacierBOT
proven garnet
#

@lone axle you should be able to run it via adabot locally with the --validator validate_contents flag but you may not need that now that I'm catching up

manic glacierBOT
#

Thanks. I have not used Ozone Segger and I will need to learn how to use those tools as well. Before going down that route I would like your comments on what I have tried. I will also check what options are available to build a simple Tx/Rx interface with EUSART0.

• With the EFR32MG24 Dev Kit I can…

  1. Use SS5 to build and load the BGAPI bootloader and use the bare metal ‘Blinky’ to flash the blue LED on the Dev Kit. No issues.

  2. Use Simplicity Commander to load and run the official...

#

@tlyu I've done some testing with your PR and find that it works with B2 but B1 still has problems.

I believe that the root cause is the race condition in hw_endpoint_start_next_buffer() noted earlier. Saving the interrupt state and disabling interrupts at the start of hw_endpoint_start_next_buffer() and then restoring interrupt state at its exit resolves the problem for both B1 and B2. I am able to build with -Og and TinyUSB level-3 tracing with no difficulties.

manic glacierBOT
manic glacierBOT
#

@eightycc thanks for the additional testing! I think you might be right about the user/interrupt context race condition being a component, and that fixing that race can mitigate the problem on B1. I think that without the endpoint aborts, an incorrect transaction can still get dispatched under a different scenario.

In the particular instance we're seeing with macOS and closing of CDC serial devices, the transactions queued for the aborted CDC control transfer are still valid for the duplic...

lone axle
slender iron
#

I may just integrate into an existing library repo

gilded cradle
#

Thanks everyone

lone axle
#

Thanks for hosting Liz. Hope everyone has a nice week!

wraith crow
#

Thanks Liz/All 😄

mortal kernel
#

Thank you all!

candid sun
#

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

short tendon
#

Hey @lone axle, do you think for the .pre-commit-config.yaml that it's the whole file that needs to match? I also added some pylint things in the test files like invalid-name that almost every test needs since then have long names.

lone axle
#

In general though I would say I am in favor of .pre-commit-config.yaml being the identical in all libraries to whatever extent is possible, and ideally keep cookiecutter matching whatever that is.

#

The more that common infrastructure files like that diverge across the libraries it makes it harder to use the patching mechanism in some cases I believe. Keeping those files in sync accross the libraries makes maintenence easier.

short tendon
#

Fair and don't disagree. How hard is it to update the pylint rules and patch them everywhere? Happy to update and add all the ignores, just seems like they would be good changes

lone axle
short tendon
#

@lone axle what would you like me to do:

  1. Revert all the changes in that pre-commit file (and fix any linting issues)
  2. Wait a day or so to see if people want to merge in the isort change (made a comment) since it seemed like it was good and just needed 1 fix (if they are good with it I'd try to get my other ones in too)
lone axle
#

you can wait and see about the change

onyx hinge
#

just a random note: I had trouble with HUSB238 and QT Py ESP32-S3 PSRAM in 8.2.10. It seemed to communicate properly but read impossible data. With 9.0.0-beta, it was perfect.

manic glacierBOT
#

@makermelissa, the message just started to appear on CP9. I have been using web workflow for quite some time using the same procedures on CP8. This is new, and as I pointed out, the USB on the device is not connected to anything other than a power supply. The circuitpy drive does not appear because there is no USB connection. Am I missing something?

Please file a new issue and let us know what board you are using.

willow totem
#

I imagine it makes less sense to restrict frequency, as other countries have very different restrictions. The other thing is you can often use other frequency bands with less power (like FM radio), especially if you have a Ham radio license (more power allowed). Presumably the libraries could default to a US frequency? Having to do it by country is a pain (we can't see channels 12 + 13 based 2.4ghz WiFi networks in the UK unless we select GB on some devices/toolchains, and routers auto-select channel)
I dont think we have amazon sidewalk here, but that's really interesting to know

tulip sleet
crimson ferry
midnight ember
#

will do and will delete the comment here so it's not crossposted. didn't know there was something open for it already. will do.

manic glacierBOT
#

Thanks for the message, I’ll take a look at the GBD debugging notes.

My custom board has a single RGB LED just like the SiLabs EFR32MG24 Dev Kit. That RGB LED doesn’t blink during CP start up on either the Dev Kit or the custom board, even with the official 8.2.10 release. CP works fine on the SiLabs Dev kit.

While I was trying to get the CP build environment working over the past month I also tried out non-CP code, mostly using the examples in SiLabs Simplicity Studio. One issue that I...

midnight ember
#

moved my posts to the issue, further discussion can be done there. Thank you for the link @tulip sleet

manic glacierBOT
slender iron
#

Adafruit Requests 3.0.0 released thanks to @short tendon for Connection Manager. I did the release notes and version myself to note the changes. I also poked RTD to get the docs build updated.

manic glacierBOT
short tendon
lone axle
manic glacierBOT
short tendon
#

@slender iron do you think it's worth posting something on #help-with-circuitpython about the change with Requests (that for onboard WiFi, no changes are needed except for the inclusion of CM, and for others they will need to make code changes) and pin it for ease of use? Or does this happen regularly enough that most people will figure it out?

manic glacierBOT
#

i tried again tonight. i erased the flash and installed 9.0beta 2. it has not been erasing chunks of code but it has been going into safe mode inconsistently (not a very helpful data point). it's happened 2/5 times on saving and then randomly while running the code. i'll be connected to the serial monitor on web workflow and it stops, doesn't show disconnect and i see the neopixel flashing yellow 3x. might be time for the debug build?

midnight ember
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.2 on 2024-02-20; Adafruit Camera with ESP32S3

Code/REPL

import pycamera
pycam = adafruit_pycamera.PyCamera()
pycam.tone(440, 0.1)

Behavior

File "adafruit_pycamera/__init__.py", line 807, in tone 
RuntimeError: Internal resource(s) in use

Description

No response

Additional information

No response

#

For precedence, maybe have it try to connect to the outside network first, and if that fails make AP mode the fallback? For my uses, that would be ideal. When I'm at home, it could just connect to my home network, and when I'm out it would go to AP mode, making it so that I don't have to change settings.toml to get the correct behavior wherever I am. (Also, this would give anyone using these devices an easy to way to get in and change settings.toml if they suddenly can no longer use the wi...

manic glacierBOT
#

Don't want to rush this, but I'm wondering if there's anything I can do as a workaround to get bluetooth working on my esp32-s3 in any capacity. I'm an esp32 and circuitpython noob, so if I'm missing something obvious or if it cannot currently be done with circuitpython please let me know. Ideally, I want to set up my esp32 to act as a BLE peripheral, but can't seem to get that working due to this missing bleio library.

manic glacierBOT
proven garnet
#

I can help run a patch if needed. This one should be a good fit for adabot to apply if almost all of the libraries currently match.

manic glacierBOT
short tendon
solar whale
#

@short tendon I just ran a few quick tests on existing code. Updating requests and adding connection_manager worked fine.

solar whale
#

I do expect you will be seeing a lot of questions....

midnight ember
manic glacierBOT
#

I think the real question is whether there is a bug causing the problems with espcamera on the esp32s2 or if esp32s2 simply can’t handle espcamera. If that is the case, do we just document that and move on or is it worth trying to revert to something lime imagecapture. There does not appear to have been a great demand for it so I expect there are more important issues to resolve at this time.

I'm not super interested in getting things going on the S2 if we don't have a project ...

short tendon
short tendon
#

@tulip sleet I saw some more commits to 8x. Are you doing another release? And if so, should we add CM to frozen?

tulip sleet
short tendon
#

I figured I'd wait the week with the new requests in the bundle, and then open a PR to update frozen on main. Sound good? Do you have plans for another beta soon?

tulip sleet
#

I update all of frozen before each release. Don't bother with a separate PR. As long as the versions are all in the bundle in a consistent way, it will get updated. Not sure when we will have a beta or even RC, but not too long.

short tendon
#

When working through updating MiniMQTT, I noticed that in esp32spi the ESPSPI_WiFiManager takes in secrets.
To remove that, would it be better to:

  1. Pass in ssid and password instead
  2. Remove the param and have it pull from os.getenv
crimson ferry
#

Is this expected in web workflow (9.0.0-beta.2) if connected to a USB power bank, but not to a host:

ℹ️ USB is using the storage. Only allowing reads. Try ejecting the CIRCUITPY drive.

tulip sleet
crimson ferry
#

yes, it's writable... the power bank is doing something unexpected?

#

I'll see if I can try it again later with a board I can put a LiPo on

manic glacierBOT
#

I loaded 9.0.0-beta.2 on both the SiLabs EFR32MG24 Dev Kit and my custom board, and the RGB LED does indeed flash periodically on both. Which is great, it means my custom board is running CP. I was also able to successfully rebuild 9.0.0-beta.2 as well and verified it works the same on my custom board. Again, all good.

But Thonny won’t connect. Connecting a serial terminal to the VCOM Tx/Rx signals there are text strings transmitted out from CP at boot, but all the characters are scrambled...

tulip sleet
crimson ferry
#

more likely a board issue... I'll start with a clean board next time

tulip sleet
#

if you double-click on a UF2 board like atmel-samd, do you get a fast pulse or slow pulse. Slow indicates the UF2 bootloader thinks it is connected to a host

#

try an AC adapter instead of the power bank

crimson ferry
#

fast pulse with a Feather M4 on the power bank, but it's the board... same on an AC adapter, I had even wiped the filesystem and reloaded the UF2 (QT Py S3 nopsram)

tulip sleet
crimson ferry
#

beta.2, yes ...tried it with a Feather S3 TFT, read-only on LiPo, AC adapter, and power bank. I'll try an older CP

#

(no errors or warnings in the browser console; same read-only in various browsers

#

8.2.10 is OK....writable when not on host

manic glacierBOT
#

@VPTechOps I was not able to reproduce this however I did notice that the default behavior of CircuitPython is for WebWorkflow to be read-only.

In order to use WebWorkflow without getting the message you are indicating you must create/edit a boot.py file on the device that contains the following:

import storage
storage.remount("/",False)

That is obviously a problem if you don't have the device connected to a computer.

crimson ferry
#

oh, there's an issue for this already

manic glacierBOT
wraith crow
# short tendon When working through updating `MiniMQTT`, I noticed that in `esp32spi` the `ESPS...

Passing secrets was left in for backward compatibility, it may be time to take that out but you might want to look this over https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/pull/182

GitHub

I decided to take a stab at reworking the examples in this library to work with settings.toml and didn't notice the existing pr #179.
I took a slightly different approach as I didn't actual...

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.2 on 2024-02-20; Adafruit MatrixPortal S3 with ESP32S3 # also on beta.1

Code/REPL

# SPDX-FileCopyrightText: 2023 Liz Clark for Adafruit Industries
#
# SPDX-License-Identifier: MIT

import os
import gc
import ssl
import time
import wifi
import socketpool
import adafruit_requests
import adafruit_display_text.label
import board
import terminalio
import displayio
import framebufferio
import...
manic glacierBOT
manic glacierBOT
#

It took a while to track this down, but it appears that the reason for the leak is that CharacteristicBuffer.deinit() is not being called when the CharacteristicBuffer used for one direction of the UARTService is no longer in use. I have a fix for this in the adafruit_ble library.

It's possible we may be able to detect in _bleio when to call deinit(), but I am not at all sure. If we could, we might not need that exposed routine.

I'll discuss this with @tannewt, and maybe mov...

manic glacierBOT
modest star
#

Can we please get a board configuration to compile Circuitpython for the Waveshare RP2040-One? Or rather, is there a documentation about how to write one?

modest star
#

Nice! Thanks. There are now so many Circuitpython guides, that it's sometimes hard to find the right one.

short tendon
#

Is there an easy way to guarantee a timeout on a socket call? Seeing some strange things and trying to find a way to reproduce

short tendon
#

@candid sun sorry for the direct ping. When you tested my Azure PR, what board and CP version were you using?

candid sun
short tendon
#

and did you get timeouts (which should be expected on the loops)?
On 9.0.beta.0 I got valid errors of [Errno 116] ETIMEDOUT which is 116
to 9.0.beta.2 and timeouts errors of -116 which causes MiniMQTT to raise

tulip sleet
#

The negative errno rings a bell about a recent change. Could you file an issue?

short tendon
#

I can. Not sure what to put in the steps, because all I have is the Azure test code. I was able to pin it to a merge on the 16th

tulip sleet
#

just give the two error messages, I think that will be enough context. And list the merge

short tendon
#

👍

tulip sleet
#

@slender iron When you're available, got two things to discuss with you:

  1. deinit()-ing Characteristic Buffers to prevent leaks
  2. Finalizers not running (also present in 1, but maybe not interesting for that).
#

thanks

manic glacierBOT
#

CircuitPython version

works: adafruit-circuitpython-unexpectedmaker_feathers3-en_US-20240215-no-branch-8291467.uf2
_note there are a few merges between these two_
doesn't work: adafruit-circuitpython-unexpectedmaker_feathers3-en_US-20240216-main-PR8935-696aa83.uf2

Code/REPL

# Found the issue re-testing my code for this PR: https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/pull/63

Behavior

Updated adafruit_minimqtt to tring the error...

slender iron
tulip sleet
manic glacierBOT
#

By default on Windows HID device is seen as CircuitPython HID, see also #5445

This PR adds new method usb_hid.set_interface_name that provides means to change the name of USB HID interface.

Example:

usb_hid.set_interface_name("My HID device")
$ sudo lsusb -vd 239A:80F4 | grep iInterface
      iInterface              4 CircuitPython CDC control
      iInterface              5 CircuitPython CDC data
      iInterface              6 CircuitPython Mass Sto...
short tendon
tulip sleet
#

there might be some in the community bundle; I don't know

#

grepping through the bundle repo is a great way to check what's going on in all the libraries

short tendon
#

I can do that. I'll also check MiniMQTT, since that PR is open too

manic glacierBOT
#

Instead of reserving 128 bytes of RAM all the time for this, use the technique used in supervisor.set_usb_identification(), https://github.com/adafruit/circuitpython/blob/54e78c89fc9e0d2b31544dfd03c30a159e8540a4/shared-bindings/supervisor/__init__.c#L297-L298. It allocates space for the user-set string(s) only if they are specified. It uses port_malloc(), which allocates outside the Python heap (so no gc issues). port_malloc() is new in 9.0.0.

short tendon
tulip sleet
#

that's a README bug too 🙂

#

you can just open an issue if you don't want to make a bunch of PR's

short tendon
#

looks like 13 libraries. I'm happy to work through them all