#circuitpython-dev

1 messages ยท Page 19 of 1

slender iron
#

but folks can request their own creator id if they want

manic glacierBOT
tulip sleet
#

@onyx hinge in #help-with-audio, user asks about playing MP3's from a buffer instead of a file: #help-with-audio message. I'm not sure there's a way to do that, even if MP3Decoder takes a BinaryIO. Or is there a way to implement a stream.

Another idea would be to implement a RAM filesystem. I see that in several places in the MicroPython test directories. But it's a bit roundabout.

tulip sleet
#

I am getting build failures on GitHub Actions. It looks like a set of their servers is down: E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/universe/m/mingw-w64/mingw-w64-common_7.0.0-2_all.deb Unable to connect to azure.archive.ubuntu.com:http: [IP: 52.147.219.192 80] etc

#

Interestingly http://azure.archive.ubuntu.com/ubuntu works but further down does not. This is internal to them. From outside it works, and has a different IP address.

manic glacierBOT
#

Same behaviour if omitting the light sleep...

# Delete objects before powering down
#del i2c
#del bme680
#del bh1750
#del vl53
#del display
#del battery_monitor
# garbage collector
#gc.collect()
# Powering down TFT-display and sensors
p.value = False 

# Create a an alarm that will trigger 10 seconds from now.
#time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 4)
# Do a light sleep until the alarm wakes us.
#print ("4 Sekunden im leichtem Schlaf")
#...
onyx hinge
tulip sleet
#

@slender iron I looked at the generated ninja file vs our Makefile, and found quite a few differences. Here are some hand-pruned link options, sorted alphabetically. Some things are different but mean the same thing, like the libxt_hal.a and libphy/-lphy references. But there are quite a few more -us in the ninja version. I don't know what it wraps all that stuff with --wrap.

slender iron
#

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

#

I don't know what to do with all of that

tulip sleet
#

well, I can add the missing -us. Do you understand the motivation for wrapping functions?

#

just meld the two files for interest

slender iron
#

I don't know the purpose of the wraps

#

may be from older versions

tulip sleet
#

you use rom.newlib-nano. they don't . They have rom.newlib-time, we don't

#

I will look at the missing -us and see if they are WEAK

onyx hinge
#
void pthread_include_pthread_rwlock_impl(void)
{
}
```hum that's not going to work so good with -flto or -ffunction-sections but I guess we don't use those.  Anyway, "include..._impl" seems to force including that source file's functions, but it's not clear why you'd need it. those functions should otherwise end up used
#

components/cxx/component.mk:WRAP_FUNCTIONS most of the WRAP_FUNCTIONS have to do with the case where cxx is enabled, but I don't know if that applies. CP isn't using C++ but maybe other components are.

tulip sleet
manic glacierBOT
slender iron
#

@jaunty juniper @crimson ferry are you both on mac?

crimson ferry
#

I am

#

but Raspberry Pi Chromium also needs the dash-extension to access the URL

slender iron
#

ya, it'd need that if the device had already mangled its hostname

#

but I'm not sure why it is mangling it in the first place

#

I have three devices going and have curled them from both linux and mac

#

and just see ```
Press enter to exit...

+++ Service Adafruit QT Py ESP32S2._circuitpython._tcp.local. added
cpy-f57ce8.local.
+++ Service Adafruit QT Py ESP32S2-3._circuitpython._tcp.local. added
cpy-1f4534.local.
+++ Service Adafruit QT Py ESP32S2-2._circuitpython._tcp.local. added
cpy-d97ebc.local.

crimson ferry
#

that is weird, some network multicast echo causing confusion in some environments??

slender iron
#

ya, that seems likely to me

#

I could try adding some debugging to the binary for you

#

(or you can)

crimson ferry
#

happy to try out any uf2 or bin, I'm not in a good position to build again yet

#

Neradoc might be better set up

slender iron
#

kk, have time now?

crimson ferry
#

sure

slender iron
#

k, let me make one

#

for qtpy s2?

crimson ferry
#

that works

slender iron
#

do you have access to the debug uart output?

crimson ferry
#

I should go to the Post Office to get my new QT Pys ๐Ÿ˜‰ (but I can re-purpose one easily)

#

oh, on a QT Py? are thjose pins exposed?

slender iron
#

I have it output on the tx pin

crimson ferry
#

I can set that up, or how about an S2 DevKit C N4R2 or N8R8 build?

slender iron
#

I can build for whatever is easiest for you

crimson ferry
#

DevKits are the most expedient ready right away

slender iron
#

๐Ÿ‘

#

found my n4r2

crimson ferry
#

on it

#

invalid header: 0x3c0cbd8d trying a few other things

#

got it

slender iron
#

I'll have a more verbose version shortly

crimson ferry
#

OK, so far I haven't seen that device mangle its hostname

#

poking at it from browser (other mDNS CP devices), and from a device running CP mDNS finder code

manic glacierBOT
slender iron
manic glacierBOT
slender iron
#

@crimson ferry want a qtpy s2 build too?

crimson ferry
#

shouldn't matter, it's easiest with the devkits since they already have both USB

slender iron
#

ok, just thought you could replicate it there

crimson ferry
#

I've got a bunch of QT Pys that I'm rebooting after the DevKit (per Neradoc's comment on the issue)

slender iron
#

๐Ÿ‘

#

I'm hoping it'll tell us where the packet that caused the name mangling comes from

crimson ferry
#

wow, I'mm seeing ALL mDNS packets

slender iron
#

haha, ya

#

there is a log when a mangle happens that should be orange

#

warning level

crimson ferry
#

none of the devices are mangling hostnames right now, trying to think of network conditions or timing that would trigger it

manic glacierBOT
crimson ferry
#
RX[0][0]: From: 192.168.6.194:5353, To: 224.0.0.251, Packet[1052140]: AUTHORITATIVE
    A: circuitpython.local. A IN FLUSH 120 [4] 192.168.6.194
D (1053880) esp_netif_lwip: esp_netif_get_ip_info esp_netif:0x3ffe88f4
D (1053880) esp_netif_lwip: esp_netif_get_ip_info esp_netif:0
W (1053890) MDNS: A record Probe failed. Mangling name
W (1053890) MDNS: Name mangled from cpy-96a0ca to cpy-96a0ca-2
I (1053900) MDNS: Queueing service probe
slender iron
#

do you know that devices ip?

#

(is it the same as from?)

crimson ferry
#

DevKit is 192.168.6.144

slender iron
#

ah, the record is for circuitpython.local

crimson ferry
#

macos seems to cache circuitpython.local for 2 minutes, then gets a new IP

slender iron
#

so its mangling the good hostname even though the collision is on something else

crimson ferry
#

apparently so

slender iron
#

ok, thanks!

#

time for lunch but I'll poke at it later

manic glacierBOT
#

I reloaded CircuitPython 8.0.0-beta.4 from CircuitPython.com and ran the following code:

from board import TX, RX
from busio import UART
uart = UART(TX, RX, baudrate=115200)
print('UART ready')

while True:
    if uart.in_waiting:
        data = uart.readline()
        data_string = ''.join([chr(b) for b in data])
        print(data_string, end="")
        uart.write(data)

I then connected using Tio on the Pi with the same wiring pictured above and typed a test:

`...

elfin moon
#

Hi there. I've been puttering adding wpa-enterprise wifi support (peap only at the moment) into circuitpython, and I have working versions for esp32s2/esp32s3 (I think also C3 but I don't remember, I have so many of these boards now since I started this hobby project). I added a couple of functions into the shared-bindings/wifi/Radio.c for accessors to be able to set flags to use enterprise mode when connecting, and passing in username/password authentication (used by wpa-peap, I don't have to worry about certificates... yet).
I got my hands on a raspberry pi pico w today to test because sure enough the stuff I add to shared-bindings to access functions in ports/espressif/common-hal/wifi breaks the build for pico-w (and likely everything other than esp32).
What's the right way to approach this? Are there conditionals I can use in shared-bindings for esp32-only builds? I could provide dummy functions into the pico-w tree but that would mean I should provide dummies into all the ports that use the wifi shared-bindings.

tulip sleet
#

that is generally how we do it. The shared-bindings code accepts the full API, and the common-hal complains if it can't do it.

#

The common-hal could raise not-implemented or it could pass back an error code and have the shared-bindings code raise it

#

There can be a "LImitations:" setting in the in-line documentation in shared-bindings that describes what works. Checkout out shared-bindings/busio/UART.c, for example.

elfin moon
slender iron
#

@tulip sleet was there any discussion I missed about what branch we were using for adafruit/esp-idf in cp?

#

its set to circuitpython8 (which I set it at iirc) but it looks like the commit is release/v4.4-circuitpython

#

(set in .gitmodules)

tulip sleet
#

I think I wrote some commit messages and/or PR messages about why I did what I did.

slender iron
#

k, I can update it when I update it to get the mdns fix

tulip sleet
#

some of the fixes in circuitpython8 were fixed in upstream

#

slightly differently, maybe

slender iron
#

@crimson ferry I can give you a (hopefully) fixed version

#

why not just move the branch then?

tulip sleet
#

forcibly move the branch? I thought that might be dangerous, I think. I also wanted to make it clearer it was based on release/v4.4

#

looking at my commit msgs...

slender iron
#

I was more concerned about making it clear what branch of esp-idf we're using in what version of cp

manic glacierBOT
tulip sleet
#

@slender iron https://github.com/adafruit/circuitpython/pull/7023 is what I wrote up for the reason. circuitpython8 was out of date and had superfluous commits, and I didn't want to move the branch to a new commit. But it sounds like that would have been OK with you.

slender iron
#

that would be my preference

#

updating .gitmodules with it is most important though

tulip sleet
#

thanks for noticing that

#

not everything runs smoothly when you are gone ๐Ÿ™‚

slender iron
#

I figured we would have an idf branch for each cp major version

#

it ran just fine ๐Ÿ™‚

crimson ferry
slender iron
#

Looks like it did happen here too: ```
+++ Service Adafruit QT Py ESP32S2-2._circuitpython._tcp.local. added
cpy-d97ebc-3.local.

manic glacierBOT
#

I've traced the location of the crash into esp_tls_conn_destroy during gc_deinit, when finalisers of all objects are run. The underlying socket object has previously been closed, but that shouldn't matter.

void common_hal_ssl_sslsocket_close(ssl_sslsocket_obj_t *self) {
    common_hal_socketpool_socket_close(self->sock);
    esp_tls_conn_destroy(self->tls); // <-- inside this call, didn't trace further yet
    self->tls = NULL;
}

The pointers are ...

sslsocket cl...
manic glacierBOT
serene token
#

When committing to my CircuitPython fork, it's failing the formatting step. How do I find out what the specific error is, so I can fix it?

blissful pollen
serene token
#

This is all I'm getting:

Check Yaml...........................................(no files to check)Skipped
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
Translations.............................................................Passed
Formatting...............................................................Failed
- hook id: formatting
- files were modified by this hook
#

I tried to use exactly the same formatting/style already used in the files, so I think I'm just missing something subtle.

#

Ok, I think I found it, but I would still like to know. I accidentally used a tab for indentation in a .h file. Fixing that and redoing the adds made the commit successful. I'm sure I'm going to run into things like this again in the future though, and I would really like to know how to get it to tell me the problem.

blissful pollen
#

I've found that before myself. You can run the pre-commit tools by hand. Normally when it says the "files were modified by this hook" it fixed it for you and you just have to recommit the file

serene token
#

Yeah, I tried that (recommiting), and it didn't work. I actually tried running "uncrustify" on the files manually, but it complains that it needs a config file, and I don't know where that is for the circuitpython repo.

#

Anyhow, thanks! The tutorial for this is a bit outdated, so I'm having to work some things out as I go, but I'll figure it out eventually. I know exactly how to do what I'm trying to do, but working within the constraints of a pre-commit I'm not used to is...interesting.

lone axle
#

@serene token If you run pre-commit locally it will fail the first time, but also make the required changes to the file, so subsequent runs will pass.

serene token
#

For some reason it didn't make the required changes. I had to fix it manually. I did try to commit a second time, because I thought it was supposed to try to fix it, but it had the same error. (I knew it was probably an indentation error, because I use tabs exclusively in my own code, and remembering to do spaces instead was a challenge.)

slender iron
#

@tulip sleet should I switch the .gitmodules branch or force push to circuitpython8?

tulip sleet
#

Whatever you want. If you do that, I just want circuitpython8 to be the same (+ your latest change) as release/v4.4-circuitpython, so that it's cleaner than the old one, which had a lot of churn and was not up to date.. Could you document this in the PR, and also ping MicroDev about it specifically, since he has a strong interest in it.

#

I think maybe one motivation for release/v4.4-circuitpython is that while you were way, it looked like MicroDev might succeed at getting ESP-IDF v5 going, so I wanted a branch name that made clear what we were using

#

I don't remember that well why I chose that, but I think it was to make it clear the branch was meant to track v4.4

slender iron
#

we could add a circuitpython9 branch for 5.0

tulip sleet
#

we are not there yet, but yes, 5.0 looked more promising initially

#

but there were some mysterious build problems. Also some things I hoped were fixed in 5.0 were not, so there is less motivation

slender iron
#

๐Ÿ‘

#

I'll just switch the module

manic glacierBOT
#

Using that delay startup seems to fix the issue.

Very interesting! @jepler This was a crude attempt at narrowing down the problem. A one second delay is long and could probably be reproduced. It may simply be a power-up race condition. You probably have a better idea of what to do here. I wish we had at least one board sample that shows this problem, but neither you nor I see to have one.

#

A crash would occur if an SSL socket was not shut down before gc_deinit().

I do not fully understand the root cause, but some object deinitialization / deallocation prior to gc_deinit leaves the SSL object in an inconsistent state.

Rather than resolve the root cause, instead ensure that the closing of the user socket also closes the SSL socket.

Testing performed: on Feather ESP32S3 TFT run the reproducer script >10 times. Before, it crashed after 1 time. However, running 10 times...

#

The conversion of characters like _space_ in qstrs is a bit ad-hoc. Because _not_ stands for the logical negation character ยฌ the recently added message was displayed incorrectly:

>>> socket.getaddrinfo('does.not.exist', 0)
Traceback (most recent call last):
  File "", line 1, in 
gaierror: (-2, 'Name or service_spaceยฌspace_known')

I had noticed this, but evidently failed to include the fix in the problem in #7269.

#

#7280 added a single -u ... value to Espressif links to force the correct routine to be linked in, instead of a WEAK version.

I looked over the output of ninja.build and found several more things that potentially should be added to the links. I've added this in the Espressif Makefile. I tested with the usual "Internet test" that's in the Learn Guides on an ESP32-S2 and S3, and it works. ; one of the added -u symbols is relevant to I2C, so I also tried ESp-32S3 I2C with a problematic...

#
  • read() is now readinto() and takes the buffer to write into.
  • readinto() returns the number of valid samples.
  • readinto() can be interrupted by ctrl-c.
  • readinto() API doesn't support signed numbers because it never did.
  • sample_rate is now required in the constructor because supported values will vary per-port.
  • 16 bit values are full range. 12 bit samples from RP2040 are stretched in the same way they are for AnalogIn.

Fixes #7226

serene token
#

@slender iron I would like some advice:

I'm working on a RawSample style audio object but for streams. I could use a pair of buffers and rotate between them. When the user calls a function to add audio to the buffer, it adds it to whichever isn't currently playing (copying it into the buffer), and it keeps track of how much has been added.

Alternatively, I could just directly use the buffers provided on write and not have static buffers at all. When the user writes, if nothing is playing, the buffer they provide is put in the "buffer" pointer and played. If a buffer is already playing, the new buffer is put into a "next_buffer" pointer and seamlessly played next (moving it into the "buffer" pointer and setting the "next_buffer" pointer to NULL). I think this way will require less bookkeeping, and it will avoid the need to explicitly copy buffers passed by the user. (That is, if the line mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_WRITE); in shared-bindings/audiocore/WaveFile.c (line 90) isn't doing exactly that... Not sure what all of the Micropython functions for managing arguments are doing behind the scenes.)

Anyhow, I'm leaning toward just using the user-provided buffers for the sake of simplicity, but I'm not sure there isn't some reason I missing not to do it that way. Do you have any thoughts on this?

tulip sleet
# serene token <@252717193496756235> I would like some advice: I'm working on a RawSample styl...

(That is, if the line mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_WRITE); in shared-bindings/audiocore/WaveFile.c (line 90) isn't doing exactly that... Not sure what all of the Micropython functions for managing arguments are doing behind the scenes.)

This call is confirming the arg is a buffer, specifying R or W, and fetching the details (ptr and length) into bufinfo. If it's not a buffer, an exception is raised.

serene token
tulip sleet
#

yes, exactly

serene token
#

Awesome. That helps a lot!

tulip sleet
#

some buffers are naturally read-only, like a bytes, so it's checking for that kind of thing

serene token
#

Oh, I see. That makes sense. And since WaveFile can take a buffer, it's important to check that it's writable for that reason. What I'm doing can take a bytes, but I don't need to write. Thanks for helping me understand this! The whole separation of module and bindings has been a bit of a hurdle for me to begin with. I understand the point, but the bindings code has a lot of stuff I'm not familiar with, and this is really helping.

analog bridge
#

@tulip sleet @slender iron With esp-idf v5.0, I hope that we will be able to make a PR out of our fork and upstream the changes and maintain this for subsequent changes as well.

slender iron
#

@analog bridge yup. I filed an issue there today

spiral elk
#

Luatos Core-ESP32C3 board bringup done, PR to follow once I clean it up.

manic glacierBOT
manic glacierBOT
#

#7069 implemented chained exceptions (thank you @jepler). However, https://docs.circuitpython.org/en/latest/shared-bindings/traceback/index.html still says:

chain (bool) โ€“ If True then chained exceptions will be printed (note: not yet implemented).

The "not yet implemented" should be chained, and can this actually be set to False to not format or print the chain?

manic glacierBOT
#

Status: in my work in progress branch, a bunch of test cases pass. However, the internal interface has changed and so the shared-modules that used dotenv directly need to be updated.

# comment
string = "hello world"
number = 7
 cstring = "hello comment" # comment
  cnumber = 0x7f # comment
string1= "\n"
string2 ="\u00c1x"
string3 = "\U000000c1x"
string4 = "\f\"\\"
string5 = "\t\r\b"

My work is pushed to a branch, but I'll be waiting on creating a PR until it's closer to...

manic glacierBOT
#

The TinyPICO V2 is currently my only ESP32-D4 board.

I don't actually know if there is another D4 board that supports circuitpython. I have run this same code on ESP32, ESP32-S2, ESP32-S3 and ESP32C3 boards running CP without this issue occurring.

I believe the QTPY ESP32-Pico uses a similar microprocessor that I haven't tested yet, I'll go ahead and order one of those. If anyone knows of another D4 board, let me know :)

manic glacierBOT
#

We retrieve espidf's own idea of the amount of psram present, ultimately via esp_spiram_get_size(), but through multiple layers of code. It may be that our version of esp-idf is improperly detecting the PSRAM (the early boot messages from esp-idf would be helpful here) or there's something wrong with how the data is passed among the layers. For instance, the way that ESP32 (only) starts at SOC_EXTRAM_DATA_LOW, and others end at SOC_EXTRAM_DATA_HIGH, seems weird, but it matched what I saw in...

midnight ember
#

I contacted a handful of people today to see if anyone is interested in a TR-Cowbell sequencer. Free. If I didn't contact you and you are interested in one feel free to contact me. I have a limited supply (each board requires 16 step switches and they're not cheap in that amount). It's first come first serve as there are a limited amount but I will make sure to eventually get one to everyone interested even if I run out of parts for the first free batch.

manic glacierBOT
#

I do not understand the flow all that well, but this seems a bit fishy to me:
https://github.com/adafruit/circuitpython/blob/9e104c04aec3178b45ba70a302ad5800afad752f/ports/espressif/common-hal/socketpool/Socket.c#L609-L616
Under what circumstances is the passed in socket not a Socket object. Could it be an SSLSocket? If so then fields in it are set willy-nilly. Also the SSLSocket is not shut down. And if it's a plain Socket, it's kind of being rendered unfunctional, but the underl...

#

This is the first things that come through on the Thonny console:

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:12756
ho 0 tail 12 room 4
load:0x40080400,len:3024
entry 0x400805dc
Serial console setup

Device is busy or does not respond. Your options:

  • wait until it ...
#

Interesting side note, when I started customizing the sdkconfig file the CP flash filesystem was initialized so I recopied my code down to it. Before getting the boot messages I posted in the previous comment, I restored the Adafruit build from circuitpython.org and the flash filesystem was also restored to the same state it was in prior to my loading the custom images. That probably makes perfect sense to someone that understands how the flash is handled but just in case I thought I'd mentio...

hidden rain
#

Afternoon! I see there are changes being made to analogbufio. I have no issue with API or signature changes. Do any of these inherently delay or slow the CPy function call on read (readinto)?

manic glacierBOT
digital ibex
#

Would it be possible to "bundle" code.py with the UF2 at compile time, so when flashed it places the code on the device's SPI flash chip? (RP2040-based)

jaunty juniper
digital ibex
blissful pollen
jaunty juniper
#
  • it it possible to dump the current content of the flash (including CIRCUITPY) into a UF2 that you can then use to flash a new board, effectively cloning your reference board
  • it is possible to make a build with a frozen library that you want to be always available even if the board is erased, and import it from code.py
  • it is possible to change the code that creates code.py, which it does in C write() calls, not from a existing python file
#

I would say you want number 1

#
picotool save --all my_full_board.uf2
digital ibex
#

Wow I was just going to explain my reasoning for wanting #1, but you're way ahead of me! Thanks a million!

jaunty juniper
#

I wonder, does C have a preprocessor thingy to include the content of a file as a string ?

digital ibex
#

Idk, but I know people store 3D printer startup logos in C header files and there's generators for that code. Something similar might work for encoded text, but I'm no expert.

blissful pollen
#

picotool probably works best. CP core does have code to set up the filesystem in the designated area of flash. So that could be modified to store more files. (I think it does create the default code.py)

slender iron
hidden rain
slender iron
#

no problem!

manic glacierBOT
#

I tested on a Feather RP2040, connecting A0 and A1 to ground and 3.3V. I tested both 8 and 16-bit reads. The values I read are in the range I expect, but are surprisingly noisy, which is weird. I tried samples rates of 1000-664000. But plain old AnalogIn also seems to be noisy. So I think the module is working fine, but we might want to look at whether we are setting up the ADC properly in general.

In any case, thanks for the API improvements!

hidden rain
#

@tulip sleet: Can you indicate the percent of noise as related to the signal in? It might be "normal" noise.

#

I mean I normally see 1%

tulip sleet
#
>>> abi = analogbufio.BufferedIn(board.A0, sample_rate = 32000)
>>> abi.readinto(b16)
100
>>> b16
array('H', [4785, 5265, 6145, 6417, 7217, 7409, 7937, 8177, 8354, 8834, 8834, 9346, 9266, 9730, 9746, 9954, 10146, 10050, 10418, 10274, 10578, 10498, 10626, 10770, 10626, 10946, 10658, 10978, 10850, 10978, 11058, 10930, 11186, 10930, 11138, 11138, 11074, 11218, 11026, 11282, 11090, 11138, 11218, 11106, 11282, 11106, 11218, 11154, 10962, 11154, 10930, 11106, 11074, 10978, 11138, 10978, 11106, 11138, 11026, 11250, 10978, 11058, 11170, 11026, 11218, 11026, 11138, 11106, 10882, 11250, 10850, 10962, 11010, 10754, 11154, 10706, 11010, 11106, 10786, 11202, 10818, 10978, 11026, 10770, 11170, 10786, 10930, 10978, 10770, 10930, 10786, 10754, 10962, 10802, 10850, 10946, 10770, 11010, 10962, 10914])
>>> a2
<AnalogIn>
>>> a2.value
10274
>>> a2.value
2192
>>> a2.value
176
>>> a2.value
16
>>> a2.value
7393
>>> a2.value
288
>>> a2.value
10498
>>> a2.value
4417
>>> a2.value
6913
>>> a2.value
9602
>>> a2.value
6817
>>> a2.value
400
>>> a2.value
9458
>>> a2.value
1616
>>> a2.value
11954
>>> a2.value
9794
>>> a2.value
1424
#

way more than 1%

#

did you test on a Feather RP2040?

#

I am just jumpering with a short jumper between 3.3V, GND, and the various analog pins

hidden rain
#

My testing was only on the Pico RP2040.

tulip sleet
#

I will try that in a bit, but I'm running out of time for today. Thanks for the feedback.

hidden rain
#

ok.. will tune in later. Thanks!

idle owl
#

Uff. Trying to build for Feather RP2040 with a change to pins.c. This is the result I'm getting. mkdir -p build-adafruit_feather_rp2040/genhdr {'sku': ['GD25Q64C', 'W25Q64JVxQ']} {'sku': ['GD25Q64C', 'W25Q64JVxQ']} text data bss dec hex filename 244 0 0 244 f4 build-adafruit_feather_rp2040/boot2.elf GEN build-adafruit_feather_rp2040/genhdr/moduledefs.h QSTR updated File "<fstring>", line 1 (offstart=) ^ SyntaxError: invalid syntax make: *** [../../py/py.mk:274: build-adafruit_feather_rp2040/genhdr/compression.generated.h] Error 1 make: *** Waiting for unfinished jobs....

#

Although, thinking about it, I don't know how we want to handle that there's now a user-controlled button available, because obviously folks are going to have the previous version without the button available as well.

#

I did a pull and a make fetch-submodules before starting any of this, it seemed successful.

#

Feh. I'll deal with this next week. I guess I'm done for the night.

blissful pollen
#

did you try make clean for it to start?

#

and I get the deal with it next week, how I felt by the end of my work day ๐Ÿ™‚

idle owl
#

A few times. After every different iteration of the board build command I tried, or to see if it was a glitch the first time.

#

Even remembered to before running it the first time.

blissful pollen
#

Good luck next week! I'm not thinking clearly enough to really know beyond that what it could be ๐Ÿ˜

wraith crow
#

When I have build errors at the end like that, I usually find that there's another error much earlier in the make process that I have to scroll back and find.

manic glacierBOT
manic glacierBOT
#

Sorry folks, been AWOL with production line issues for the last few weeks :(

I'll have another look over my TinyPICO board settings compared to MicroPython. Maybe I missed something, or set something wrong, though I'm pretty sure I checked them before doing the PR.

I'll also look into how MP includes the Flash/PSRAM cache issue IDF fixes, as they need to be included to have both Flash and PSRAM working together, and PSRAM to work properly.

I'll get onto this as soon as I can @Retired...

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.4-57-ge82a8bf8b on 2022-11-30; Adafruit Feather ESP32-S3 TFT with ESP32S3

Code/REPL

# Powering down TFT-display and sensors
p.value = False 

# Create a an alarm that will trigger 120 seconds from now.
time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 120)
# Exit the program, and then deep sleep until the alarm wakes us.
print ("120 seconds in deep sleep")
alarm.exit_and_deep_s...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I had the same symptoms when building in Debian:
make BOARD=raspberry_pi_pico_w

Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity. make: cmake: No such file or directory make: *** [Makefile:95: build-raspberry_pi_pico_w/pioasm/pioasm/pioasm] Error 127

I have run:
sudo apt install cmake

cmake version 3.18.4

and now I'm able to build it.

manic glacierBOT
#

I got a brand new QT PY ESP32-S2. I loaded your DEBUG=1 firmware above. I got a CP210x USB to serial dongle and connected it to the QT PY (TX to RX and RX to TX). I connected to the serial port using Putty at 115200 from a Windows computer. Unfortunately, I did not receive any communication from the QT PY. I tried rebooting the QT PY and nothing came through. I reversed RX and TX but still nothing.

I hooked up the CP210x dongle to my scope with serial decoding enabled and was able to...

amber sundial
#

I have small suggestion re the tone examples in the docs e.g. here:
https://docs.circuitpython.org/en/latest/shared-bindings/audiocore/index.html

If one were to up the sample frequency, it would be easier to distinguish between quality problems in audio due to low samplerate as opposed to problems in ones hardware:

import audioio
import board
import array
import time
import math

# Generate one period of sine wav.
length = 44100 // 440
sine_wave = array.array("h", [0] * length)
for i in range(length):
    sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15))

dac = audioio.AudioOut(board.SPEAKER)
sine_wave = audiocore.RawSample(sine_wave, sample_rate=44100)
dac.play(sine_wave, loop=True)
time.sleep(1)
dac.stop()```
#

I'm mentioning it because it's quite widely adopted throughout the learn examples as well

manic glacierBOT
serene token
#

@slender iron Do you know what happens in audioio if a ...get_buffer() returns a NULL buffer (and len 0) and GET_BUFFER_DONE?

The problem is, it can't know if there is going to be more data available until the actual call, so it can't really determine if it is done playing until the actual ...get_buffer() call where it discovers there's nothing left. If a NULL buffer (and zero length) won't break the audio playback system, then I should be able to just return those with GET_BUFFER_DONE.

Or maybe I should have it continue to just stream empty sound when the buffers are empty and only terminate when the user instructs it to? Otherwise, if it empties because the audio isn't being generated fast enough, it has to be restarted... Is there a memory location that always returns zeroes when its read and is at least 265 bytes long? (Maybe an unmapped section of memory? But then, wouldn't this be hardware dependent?)

Either way, it would be nice to know if the audio system can handle a NULL buffer being returned without crashing.

amber sundial
#

@tulip sleet were you last looking into the plops when starting and stopping PWMAudio?

#

we are scoping some things on a rp2040 board and the problem could be twofold:

  • RawSamples seem to be offset, so at the play of each RawSample theres a jump by half the amplitude; the hardware HP filter filters the DC offset out so that results in a big plop at the beginning and end
  • WaveFiles behave like they should, but in the first 8 milliseconds the read is scrambled and the sign gets flipped for a short stretch, so there are plops when that happens; there is no offset though
amber sundial
#

okay we tried with a sample that has 4ms silence at the beginning, and the the first 4 ms of wave playback just have some signal inserted

#

strange

#

like there is some data in the buffer that just gets written before the actual data is being played

#

this is dependent on the buffersize

#

and the results are consistent for each buffersize

manic glacierBOT
#

We have been looking at the output from PWMAudio with a scope, and it seems that PWMAudioOut is adding a blip of audio unrelated to the actual sample into the first 4ms of the playback.

The blip is consistent when using the default buffer size and a buffer of bytearray(512), and changes to something different but consistent with other buffer sizes.

Here are some scope pictures where you can see what's happening:

The waveform in Audacity. The sample is mono, 44.1khz, 16 bit.

<img w...

amber sundial
#

here's how the wave looks

#

and this is what we get on the scope

#

more images in the github topic

onyx hinge
manic glacierBOT
serene token
#

On the topic of issues with audio:

I've noticed that when I'm not actively playing audio, I get audible white noise and sometimes quiet whistling from the speaker. I'm currently using a mixer, and if I play a "silence" buffer that is just zeroes on loop, I get very quiet white noise (only audible very close to the speaker) similar to a speaker with no input signal, but if I don't do that when I'm not playing something, there's a lot of static, whistling, and audible white noise. I suspect when nothing is playing the PWM is just being shut off completely, but it doesn't make sense to do this. If the pin (I tried several) is setup with a PWMAudioOut object, it should be assumed a speaker is connected whether it is actively playing or not, and the queiscent level should probably be played when nothing else is. Note that I'm using an RP2040. It's possible pin levels are more stable with the PWM off on other chips.

Also worth noting: When the device automatically resets when the filesystem is written, I get a ton of noise on all of the pins I've tried for audio. I've observed this on at least A0-A2 on the RP2040. It doesn't happen when the reset button is pressed or when it is plugged into a USB battery. It also only clicks slightly when first plugged into a computer. When it automatically resets though, the crunchy, kind of loud noise that comes from the speaker is pretty jarring. I have not tried programmatically resetting or waking from sleep (light or deep) to see if the same thing happens there.

I can open issues on Github for these later, if they aren't already there and if it seems like a good idea.

manic glacierBOT
tulip sleet
manic glacierBOT
blissful pollen
serene token
#

Yeah, I kind of figured that was the case. If the PWM was shut down first, that would help. Actually, I wish there was some kind of reset hook, where you could basically make it run a callback when it resets, before the actual shutdown and reset stuff happens. At least that way, I could add code to shut down the PWM myself before it resets.

That said, I'm just very thankful that it only happens during software resets triggering by file writes. I don't know if I'm ever going to try to do a commercial product with this, but I do want to make several copies of my current project to send to family members, and it would be nice if it worked smoothly for them. A very slight click when powering by computer isn't a problem, and of course, battery power not having artifacts at all is even better for that.

manic glacierBOT
manic glacierBOT
#

CircuitPython version

CircuitPython 7.3.3 on 2022-08-29; Adafruit Feather ESP32-S2 TFT with ESP32S2

Code/REPL

import board
import busio
import digitalio
import adafruit_requests as requests
from adafruit_wiznet5k.adafruit_wiznet5k import WIZNET5K
import adafruit_wiznet5k.adafruit_wiznet5k_socket as socket

print("Wiznet5k WebClient Test")

TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"
JSON_URL = "http://api.coindesk.com/v1/bpi/curr...
manic glacierBOT
jaunty juniper
#

speaking of support questions, it would be interesting to mention in the board guide how to use SPI on the TFT feathers. I doesn't seem to be mentioned anywhere.
I don't remember encountering that situation before, but it might be the only boards with external SPI pins that are shared with the display pins.

spiral elk
#

Dan, you around?

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.4 on 2022-10-30; Raspberry Pi Pico with rp2040

Code/REPL

import board
import pwmio

class PWMOutExtend(pwmio.PWMOut):
    def __init__(self, pin, frequency=1000, slew_rate=1000):
        super().__init__(pin, frequency=frequency)
        self.foo_bar_baz = 0
        self.duty_cycle = 0

led = PWMOutExtend(board.GP25, frequency=1000)

print('before')
led.foo_bar_baz = 0
print('after')

...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

If Thonny is trying to write the file by executing REPL commands, which it does no boards with no mass-storage USB connection, then you will see that message because the filesystem is read-only to the CircuitPython side. It is read-write to the the host computer, which has a regular USB-drive connection.

I just tried to write a file with an ESP32-S2 board, which presents CIRCUITPY as a USB drive. Thonny is able to write. I think Thonny tries to figure out that CIRCUITPY is present and writ...

proven garnet
#

Oops, noticed the daily report shaved off a couple digits of the total PyPI downloads

#

Whoever is hosting (or preparing the document) please tag me when I can edit it please!

random junco
random junco
#

No problem. @idle owl - fyi, in case you're wondering where it came from. ๐Ÿ™‚ ๐Ÿ‘†

manic glacierBOT
digital shoreBOT
manic glacierBOT
slender iron
#

I'm not sure about the NULL buffer support. It may depend on what code is getting the buffer

amber sundial
# slender iron Take a look at `atexit` I believe we support it now

in terms of PWMAudio, I think the PWM always has to be on quiescent_value even when the sample is not playing - because if you have the DC filter circuit, and the pin just goes low, you get a massive pop at 1/2 max volume, filtered at the cutoff frequency of the HP filter

#

that's what's happening here

#

it happens consistently on RP2040 with every PWM WAV audio play, so there's a good chance it's just a bug somewhere

#

maybe the buffer is completely 0 for one cycle before it gets filled or something like that

#

other than that the wav playback is really cool

#

(the swoop behind the glitch is possibly the DC filter trying to do its thing ..)

jaunty juniper
#

@proven garnet have you looked into adding version dependencies to pypi in the libraries, or is it already done in some way ?
Somebody was having an error caused by an old version of circuitpython typing, because the adafruit_register library uses circuitpython_typing.device_drivers.
Forcing the update or reinstall via requirements.txt would not update typing since it's not a direct dependency. Is there a better way to force updating a secondary dependency like that ?

#

like, can something like dependabot know that using circuitpython_typing.device_drivers requires a certain version and then add that requirement to adafruit_register ?

proven garnet
jaunty juniper
#

ah ok

#

so that's just missing from adafruit_resgister then

proven garnet
#

Yeah, it sounds like it. The requirement for Blinka is kept open so it doesn't conflict (and it only needs base anyway)

#

I can add it now

jaunty juniper
#

thanks ๐Ÿ‘

proven garnet
#

Oh, it was me who added type annotations so whoopsies ๐Ÿ˜…

#

Oh weird, I did pin it to adafruit-circuitpython-typing~=1.3

#

So it is a direct dependency but didn't update?

#

Can you link me to the issue/post? Curious if there's more information.

idle owl
jaunty juniper
proven garnet
#

Thanks! I'll check this out in a little bit when I get a little bit of time on my end!

brazen hatch
#

yo

#

this is getting out of hand

manic glacierBOT
idle owl
#

Can someone jump into the voice channel so I can test my audio?

#

@slender iron Do you want to read the core?

slender iron
#

sure!

lone axle
#

Hanukkah Lightsaber!
Toward the Jewish month Kislev, the month of light, I built Hanukkah Lightsaber prop based on a makers project of the Adafruit company. Beside building the hardware, I made the necessary adjustments for the Hanukkah holiday. 30 colored RGB Neopixel LEDs are connected to Adafruit's CircuitPlayGround board, responsible for pr...

candid sun
#

๐Ÿ’œ ๐Ÿ’œ

lone axle
#

blinka ๐ŸŽ‰ ๐Ÿ’ฏ

random junco
#

@errant grail I feel you on the snow, that was me too last week

blissful pollen
#

+1 on the snow here too

onyx hinge
#

@errant grail ooh palette rotation effects in circuitpython displayio? Would be neat to see as a core PR, if that's your jam.

errant grail
slender iron
#

we got a dusting of snow last week too

#

but a literal dusting

errant grail
onyx hinge
#

it'll feel very 90s, in a good way

#

now that I'm thikning of the 90s I wonder if it's feasible to port fractint (very old, originated on DOS, fractal generator) to a microcontroller

errant grail
onyx hinge
#

I missed the 60s the first time

errant grail
random junco
#

@lone axle if you need any help testing Wiznet, let me know, happy to help

lone axle
#

Thank you!

errant grail
onyx hinge
#

@minor plume so glad you are safe! Having a tire problem while travelling at speed is no laughing matter.

errant grail
#

@slender iron I have an opening in the workshop for a logic analyzer FeatherWing. Excellent.

crimson ferry
#

new RP2040 Feather v2 board def?

#

I guess I'm suggesting two separate boards

errant grail
#

Would be very useful for automated board testing if it could process / recognize waveform patterns.

lone axle
#

Thanks for the overview Jeff. Appreciate all the work and discussion going in and you summarizing for us.

wraith crow
#

Can't believe it's been a year already ๐Ÿ™‚

turbid radish
#

It works well

blissful pollen
onyx hinge
#

@lone axle You're welcome, I hope I gave a good overview of the situation. For my part I've appreciated all the good brainstorming and finding a good solution

#

I love reading everyone's ideas, 2023 will be another good year

#

next meeting is the 12th

blissful pollen
#

I just went back to look at what I wrote last year

turbid radish
#

Thanks all

gilded cradle
#

Thanks everyone

errant grail
#

Thanks!

ember iris
#

Open source project from purely your own mind? That's pretty great multithreaded imagination

turbid radish
#

Thanks Kattni

ember iris
#

Cheers all! Have a great one!

idle owl
#

Sneak preview of two Blinka with a heart emojis. I'll get them added soon.

manic glacierBOT
serene token
# slender iron Take a look at `atexit` I believe we support it now

Thanks, I'll take a look! (I was kind of hoping someone would know of such a hook and correct me!)

I guess I can always just try returning a NULL buffer and see what happens. (It's possible that with len=0 it won't attempt to read, even if it doesn't explicitly check for NULL.) I might be able to figure out where it is called from by grepping the entire code base, but I'm not sure how the polymorphism is handled in C, so I'm not 100% sure what to grep... I can guess and just try things though I suppose...

slender iron
#

in C it ends up as a function pointer

#

audiosample_get_buffer wraps it

idle owl
#

@slender iron Do you want me to request graphics for CircuitPython 2023?

slender iron
#

yes please! I hadn't thought of that

serene token
manic glacierBOT
#

I'm not seeing this behavior on an ESP32-S3 USB OTG board. Here is my bootloader output showing repeated 2 minute deep sleeps:

[00:02:06.793] ESP-ROM:esp32s3-20210327
[00:00:00.006] Build:Mar 27 2021
[00:00:00.000] rst:0x5 (DSLEEP),boot:0x8 (SPI_FAST_FLASH_BOOT)
[00:00:00.005] pro cpu reset by JTAG
[00:00:00.000] SPIWP:0xee
[00:00:00.000] mode:DIO, clock div:1
[00:00:00.000] load:0x3fce3808,len:0x68
[00:00:00.005] load:0x403c9700,len:0x980
[00:00:00.000] load:0x403cc700,len:0x...
manic glacierBOT
idle owl
#

@slender iron Requested. I'll let you know when I have it. I also requested a web-banner sized version of it, and I'll have Justin add it to circuitpython.org like we did for CircuitPython Day. (The infrastructure is already there, adding a new image is trivial.) We can leave it up until we're done with the call.

slender iron
#

Thanks!

idle owl
#

Who was talking about trying to combine MatrixPortal or PortalBase examples in today's Weekly meeting? Was it foamyguy?

manic glacierBOT
idle owl
#

Thanks!

lone axle
#

Indeed it was. I did manage to combine the weather and clock examples to switch back and forth with button press, and automatically with a timeout. I want to brainstorm a bit and tinker with a few of the other examples to try to come up with some more general advice and documentation that would be helpful for people looking to combine multiples of them.

There are a few ways it could work with different trade offs though.

manic glacierBOT
#

Erasing the board and then flashing my firmware.bin with https://adafruit.github.io/Adafruit_WebSerial_ESPTool/ did the trick. Thanks!
Both Putty on Windows using a dongle, and Tio on the Raspberry Pi using GPIO pins works.
I was also able to redirect the debug UART to pins 40 and 41 so I can run the debug serial cable out the side of my project enclosure.

Unfortunately, my program gets stuck right after I2S configured:

self._audio = audiobusio.I2SOut(bit_clock=TX, word_select=RX...
manic glacierBOT
slender iron
#

and a generic memorymap one

proven garnet
#

So perhaps I pinned it wrong, but it looks correct per the release notes

jaunty juniper
#

Requirement already satisfied: adafruit-circuitpython-typing in /usr/local/lib/python3.7/dist-packages (from Adafruit-Blinka->-r requirements.txt (line 6)) (1.3.0)

#

or at least I think so ? it's hard to know on github what version a commit is in

proven garnet
#

Found the issue!

jaunty juniper
#

if it's in 1.3.0 how come there is a missing thing error ?

proven garnet
#

Faulty import within circuitpython_typing:

#

from adafruit_bus_device import I2CDevice

jaunty juniper
#

oooooh

proven garnet
#

Should be from adafruit_bus_device.i2c_device import I2CDevice

jaunty juniper
#

but it's fixed so the version requirement should be bumped to a version where it's fixed, right ?

#

which would be 1.3.1

proven garnet
#

Yup, updating the pinned min to 1.3.1 will fix it

#

I'll handle that now

jaunty juniper
#

yeah I wrongly interpreted the error, I didn't think there could be other reasons why the import failed

proven garnet
#

It's tricky, it's one of the challenges of using the blanket ImportError catch honestly, that we lose the history of where exactly it failed during the import.

#

The only way I found it was by editing that to just raise the error.

manic glacierBOT
#

Running in safe mode! Not running saved code.

You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Crash into the HardFault_Handler.
Please file an issue with the contents of your CIRCUITPY drive at
https://github.com/adafruit/circuitpython/issues

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

boot_out.txt
[code.txt](https://github.com/adafruit/circuitpython/files/10163085/co...

manic glacierBOT
manic glacierBOT
serene token
# slender iron Take a look at `atexit` I believe we support it now

Not getting the results I wanted. I've got an atexit registered function that stops the only mixer voice I currently have, and then it deinits the Mixer object and the PWMAudioOut object (I tried it in both orders). I've got a print statement at the end to make sure it runs, and it's outputting the print to the serial monitor, so it's definitely running. I'm still getting the loud, crunchy audio when it soft resets on file save.

It seems like atexit maybe isn't running before the soft reboot code, or maybe the PWM isn't being fully shut down on deinit? This isn't a huge deal for me, as it won't matter for the finished project, so I don't have time to try to debug it. I do have a few more things I can try, and I'll continue to post results here, so that if someone else wants to dig into this, they have a good starting place. I do think I'll try setting up the pin as a digital output in the function I've registered with atexit. If the PWM isn't being fully shut down on deinit, setting it up as something completely different might do the trick.

#

Doesn't make any difference if I set the pin to DigitalInOut after deiniting the audio stuff. Also makes no difference if I set to INPUT (with pullup, pulldown, or whatever is default (neither?)), or OUTPUT.

#

(I'm using pin A0 on the QT Py RP2040. I've also tried putting the audio output in pin A1, and it does the same thing, but I didn't test the atexit function that deinits stuff. The speaker is soldered to A0 now, so I have no intent to try anything else on other pins anymore, at least, unless someone can verify that some other pin does not do this and will still support audiopwmio output.)

manic glacierBOT
manic glacierBOT
slender iron
#

@serene token you could try modifying the CP reset code itself. We are likely floating the pin now and that could cause issues

manic glacierBOT
timber mango
#

Hi everyone. My first message here.

Is there any plans, or is anyone working to get ANT+ on CircuitPython, specifically for the NRF52840 boards?
I am asking because I am very interested to have it, as I use it for implementing ANT+LEV EBike standard as also GPS cycling display Garmin Edge page change. The code is in C, similar to Nordic SDK code, if anyone is interested: https://github.com/OpenSourceEBike/EV_Display_Bluetooth_Ant/tree/main/firmware/display/antplus_lev

GitHub

Contribute to OpenSourceEBike/EV_Display_Bluetooth_Ant development by creating an account on GitHub.

slender iron
#

@timber mango I don't know of anyone working on it. We're happy to help folks contribute though!

timber mango
slender iron
slender iron
#

tio's timestamp diff print is super handy for "why is there 20 seconds between those prints?"

manic glacierBOT
#

Version tested 12/6/2022 2:20 pm est
Adafruit CircuitPython 8.0.0-beta.4-77-g5cb867e85 on 2022-12-06; Adafruit Feather ESP32S3 No PSRAM with ESP32S3

This code does not even go into light sleep much less deep sleep

import alarm
import time
import board
import digitalio

board.DISPLAY.brightness = 1

led = digitalio.DigitalInOut(board.LED)
led.switch_to_output(True)
time.sleep(2)
led.value = False

Create a an alarm that will trigger 120 seconds from now.

time_alarm = al...

#

Latest uf2-File installed - no change in behaviour: First time: 120 seconds sleep, from then on starts immediately

#Adafruit` CircuitPython 8.0.0-beta.4-77-g5cb867e85 on 2022-12-06; Adafruit Feather ESP32-S3 TFT with ESP32S3
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

# Adafruit esp32-s3 TFT feather Board
# mit drei Sensoren:
# - Distanz vl53l4cd
# - Helligkeit bh1750
# - Luftqualitรคt, Luftdruck, Temperatur, Feuchtigkeit, ...
random junco
#

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

manic glacierBOT
slender iron
#

@tulip sleet #7309 above would be good to have in the beta

manic glacierBOT
#

The program still freezes with the same debug output right after intializing the audiobusio.I2SOut. I changed the debug level and ran make clean before running make again. I erased and programmed the QT PY using ESPTool with the firmare.bin. Are my edits correct?
Debug3
I did notice the following line in the debug output:
`E (2648) I2S: i2s_driver_uninstall(2047): I2S port 0 has not i...

manic glacierBOT
tulip sleet
jaunty juniper
#

what became of the "board and port specific limitations" page ?

tulip sleet
jaunty juniper
#

ah ok

tulip sleet
# jaunty juniper ah ok

and some stuff about limitations of various Espressif thing (like limited BLE) (if I remember right) is in all the relevant board guides (if something is missing, I can add it)

manic glacierBOT
serene token
spiral elk
#

Kattni: Thanks for talking about the Feather RP2040 new rev in the meeting yesterday. Was trying to figure out what to do about the Lolin C3 Mini rev 2.1 board, which added a neopixel to the design but is otherwise essentially the same. The issues are almost identical.

manic glacierBOT
#

Not sure why but the program can't maintain a stable Adafruit IO connection with DEBUG=1 and also using I2S. My version without I2S ran for a day without dropping a connection. However, the 2 boards I just set up with I2S have been online for only an hour and have dropped 3 times with very unreliable service.

Here's the REPL view:

WiFi Hostname: QTPY19871
Connecting to Adafruit IO...
Adafruit IO connected.  Client ID: QTPY19871
Subscribed to rdagger/feeds/test at QOS level 1
Fr...
slender iron
manic glacierBOT
timber mango
serene token
serene token
manic glacierBOT
manic glacierBOT
#

Fixes #7254.

The sdkconfig for the ESP32 Box Lite was different than the Box. Making it the same as the Box fixes the issue.

(also made the mpconfigport.mk the same, to be consistent)

Tested and now does not crash.

Adafruit CircuitPython 8.0.0-beta.4-68-g6e40949f6-dirty on 2022-12-06; ESP32-S3-Box-Lite with ESP32S3
>>> import wifi
>>> wifi.radio.start_ap("esp32", "12341234")
>>> 
``

@sean-palmer-coding This seems to fix your problem in #7254.
manic glacierBOT
#

@dhalbert I assume you are referring to this PR?

While this sounds like an improvement - the "unexpected behaviour" for users still is not fixed - until everybody learns about this new break control signal and all terminals implement it.

What would happen if the input buffer gets flushed, or discards just enough data to at least receive one Ctrl-C signal / 0x03 character from the user? Do we have such fine-grained control over the b...

tulip sleet
onyx hinge
manic glacierBOT
manic glacierBOT
#

It's not the only possible way (there are other serial control lines we could have chosen) but it's what we've chosen to implement. This implementation doesn't have to be the only solution, and having a conversation to arrive at a better solution would be welcome. Dan accurately identifies why we want a solution that is not an in-band character value as the only way to generate a KeyboardInterrupt, and why we don't want to implement a solution that will lose characters.

#

My vote when I reported the issue the first time was for Mu to stop spamming the serial port with cursor movements, that would remove 99% of the cases encountered in the wild IMO. I can reopen that Mu issue with suggestions.

On a side node, considering this:

Even a soft-reload via auto-reload on USB file saving does not fix the input problem: it does reload and restart executing, but Ctrl-C is still not recognized.

We could reset the buffer on reloads maybe ? Or are there situations ...

#

I considered, but did not implement

  • discard pending data when usb cdc disconnects
  • discard pending data when soft-reload is triggered
    I did not know if either of these scenarios would help mu. However, at least the first alternative might also help users, because re-starting the terminal program could be a natural impulse in the case that the buffer was filled. I'm not aware of how to do this in the TinyUSB interface but could investigate it.
#

CircuitPython version

adafruit-circuitpython-teensy41-en_US-8.0.0-beta.1.hex 
and all newer builds

Code/REPL

Not a Code issue

Behavior

After flashing CircuitPython and rebooting the board, no serial port is available and no USB drive is mounted.

Description

I've tried compiling a DEBUG=1 build and creating a UART debug console to see if there are any boot loop messages being displayed by changing mpconfigboard.h as follows

// #defi...
serene token
#

@slender iron Ok, so I think I've implemented all of the functionality needed in shared-module/audiocore/RawStream.c (aside from some things that will need to be tested that require moving forward first). (I'm calling the new class "RawStream".) I'm not sure what does and does not need to go in shared-module/audiocore/RawStream.h, as RawSample does not even include all of its functions in the .h file. The big hurdle though, is going to be shared-bindings. I have added two new functions that need to be accessible as methods within Python. One checks if the object is ready for another buffer, and the other writes another buffer to it (or returns "false" if there isn't room). Basically, I'm a bit lost on the shared-bindings stuff. Are there some resources for this? Or maybe it's time to put in a pull request and ask questions there?

Also, does the function signature need to be identical to that of RawSample? Is this part of the prototype/wrapper stuff, or can I drop the buffer argument in the constructor?

lone axle
slender iron
#

@serene token the C functions that are put into the "protocol" struct need to be the same signature and the compiler should error if they aren't

#

the constructor should be able to be different

#

we'll want to move it to a new module to

#

I like the name RawStream

#

@onyx hinge got time to talk ULP programs?

onyx hinge
#

@slender iron sure -- voice/video or text?

slender iron
#

thinking video

onyx hinge
#

OK give me 5 minutes to switch stations then

slender iron
#

๐Ÿ‘

manic glacierBOT
#

One of the QT PY's core crashed last night at 2AM. Here is the last REPL message:

MQTTException: PINGRESP not returned from broker.
[tio 02:27:18] Disconnected
[tio 02:27:25] Connected
Auto-reload is off.
Running in safe mode! Not running saved code.
You are in safe mode because:
Internal watchdog timer expired.

Unfortunately, I didn't notice until this morning and my terminal only had 1000 lines of scrollback. The debug console keeps outputting the following lines (about ...

manic glacierBOT
tulip sleet
#

@slender iron I am looking at https://github.com/adafruit/circuitpython/issues/7284. I think you actually already diagnosed this, based on the comments. Is it something like supervisor_bluetooth_background() should not advertise if the user program is running , or just if workflow_state is not WORKFLOW_ENABLED?

#

if you understand this better than me, do you know the fix? Maybe I should not have assigned it to myself?

slender iron
#

I wouldn't say I've diagnosed it

#

I haven't confirm it is disconnected and then reconnected

#

rereading it, it sounds like they may want to wipe the bonding info

tulip sleet
#

is the precursor condition that the workflow was enabled at one time and there is a bonded device that will try to connect? I.e., if you disconnect the background task will just reconnect again?

slender iron
#

if no device is connected and we have bonding info for one, then we should try to connect

#
  • advertise
tulip sleet
#

so the premise that they want to disconnect all the connected devices is actually not right

slender iron
#

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

tulip sleet
#

ok, I will try to reproduce ๐Ÿ™‚

slender iron
#

@tulip sleet it may be worth asking if they just want to delete the bonding info

tulip sleet
manic glacierBOT
slender iron
#

ya, I think so

tulip sleet
#

so that is a case where we don't want automatic connection to a bonded device, I would think, we want it initiated by the program

slender iron
#

they could disable the workflow then

tulip sleet
#

I will just check that they have never used PyLeap or File Glider

#

But I think they never enabled it. It looks like the background task will automatically advertise maybe even if the workflow is not on

slender iron
#

I thought there was a disable setting

tulip sleet
#

I thought it had to be specifically enabled in .env. I was looking for a write-up

#

supervisor_bluetooth_background() is always called in bleio_reset()

#

even if workflow is not enabled

#

in any case, I will ask some q's and ask for the program

manic glacierBOT
#

@xorbit The BLE workflow is a way of editing files and talking to the REPL over BLE. You use the File Glider or PyLeap iOS apps to use the workflow.

I just want to narrow this down. Thanks.

  1. Did you ever user either of those apps?
  2. Do you have an .env file on your nRF board? If so, what's in it (minus private info)?
  3. If you "forget" the CPB board on the host device (e.g. a phone), do you have this problem?
  4. If available, could you point me to the entire code for your program?
manic glacierBOT
#

Is this the correct code to modify:
https://github.com/adafruit/circuitpython/blob/main/supervisor/shared/safe_mode.c#:~:text=allow for reset.-,%23if CIRCUITPY_STATUS_LED,%23endif,-if (boot_in_safe_mode) {

Specifically comment out the following lines in supervisor/shared/safe_mode.c as shown:

/*
#if CIRCUITPY_STATUS_LED
status_led_init();
#endif
*/
...
...
/*
#ifdef CIRCUITPY_STATUS_LED
// Blink on for 100, off for 100
bool led_on = (diff % 250) < 125;
if (led...
onyx hinge
#

I'll do it without the safe-mode messing around

tulip sleet
#

so you are testing by plugging in, not by resetting?

#

and you tested your previously unused W's?

onyx hinge
#

yes and yes

tulip sleet
#

i will try mine with a stock build, just to make sure I don't have a susceptible one

#

mine is fine

onyx hinge
#

let me go back to beta.4 instead of main and re-test

#

and use the s3 build not my own build

#

First board is 0622 in "7-segment" font and 4.8 below it in sans serif. Fine 10/10 re-plugs, CIRCUITPY appears promptly.

tulip sleet
#

i repeated mine a bunch of times, using a hub and not

onyx hinge
#

next is 0622 3.9. I wonder if 3.9 is the position on a panel? Anyway, it's also OK on 10 trials. I'm consistently using the same USB port on my laptop, should I try an un-powered hub? would low quality (low voltage?) VUSB affect 3v3 rise time?

#

final one is also an 0622 1.14

#

i notice they all have different, possibly lasered? 2d barcodes. not a type my phone recognizes

tulip sleet
#

I tried two layers of unpowered usb2 hubs, still fine

#

you could put a big cap across the 3.3V line to ground to slow its rise time

onyx hinge
#

mine are also all fine with my one unpowered hub

tulip sleet
#

have you got some high-value caps with leads?

#

like 100uF

#

i do

onyx hinge
#

I would have to search

tulip sleet
#

i have more ready access... back in a bit

onyx hinge
#

I also wondered if ppk could be used to "undervolt" the usb bus

tulip sleet
#

470uF cap is fine.

#

You could try turning off some of the start-up delays to see if that provokes it. And are there delays in the library code or pico-sdk code for the CYW that you could reduce or remove?

#

once again i wish the Picos had silk pin markings on top

onyx hinge
#

yes there's the delay of 10ms with the "enable" off and then the delay of 250ms with the enable on.

#

I think those were the numbers

#

I should print out those pages of pico w schematic, looking on screen is a drag

tulip sleet
onyx hinge
#

@tulip sleet I removed the delay I know about, or, reduced it to 1ms .. and the pico example is still fine for me. ```diff --git a/src/rp2_common/cyw43_driver/cyw43_bus_pio_spi.c b/src/rp2_common/cyw43_driver/cyw43_bus_pio_spi.c
index 0fd17f4..cdb77d8 100644
--- a/src/rp2_common/cyw43_driver/cyw43_bus_pio_spi.c
+++ b/src/rp2_common/cyw43_driver/cyw43_bus_pio_spi.c
@@ -351,9 +351,9 @@ void cyw43_spi_gpio_setup(void) {
// Reset wifi chip
void cyw43_spi_reset(void) {
gpio_put(WL_REG_ON, false); // off

  • sleep_ms(20);
  • sleep_ms(1); // was 20
    gpio_put(WL_REG_ON, true); // on
  • sleep_ms(250);
  • sleep_ms(1); // was 250

    // Setup IRQ (24) - also used for DO, DI
    gpio_init(IRQ_PIN);

#

but CP is not! so maybe I do have something to debug. hum.

tulip sleet
#

is calling cyw43_spi_reset() your first interaction with the CYW, or maybe you are doing some reset stuff? (like pin reset??)

onyx hinge
#

it's the 2nd delay (after turning reg on) that makes CP have problems.

slender iron
onyx hinge
#

so that seems like it's not the same problem

tulip sleet
#

yesbut why is CP having trouble but the simple pico-sdk example is not?

onyx hinge
#

I don't know.

#

I notice the next action is to set up the IRQ. Maybe a difference in whether the interrupt occurs before the program is ready for it.

#

That 2nd delay isn't what your added delay affects so I'm not super inclined to dive into it right now

tulip sleet
#

before CP is ready? ... I wonder why the pin is set up after turning on WL_REG_ON

onyx hinge
#

The pin is shared among IRQ, and the single SPI data pin so it has to be enabled as a GPIO to do the "poll for predefined pattern" that's the next step of startup.

tulip sleet
#

ah

#

anyway I think you are actually on the track of something

onyx hinge
#

the line that was not in the diff context was to configure the pin as an input

manic glacierBOT
#

This zip has a uf2 file I builtfrom the official pico-examples. git describe --tags of pico-examples shows sdk-1.4.0-7-g8be18f2. pico-sdk used was 1.4.0. It was configured with cmake -DPICO_STDIO_USB=ON -DPICO_BOARD=pico_w -DPICO_SDK_FETCH_FROM_GIT=1.

picow_wifi_scan_poll.zip

If you have an affected device, please try copying this example to your RPI-RP2. When you plug the device in, it should...

onyx hinge
# manic glacier

@tulip sleet as I don't really have any good new understanding, I went ahead and added the additional 1s of enforced delay that you found worked. And I asked folks with affected boards to try the pico-sdk example that I feel like should also trigger the same problem.

#

I'll update that other PR soon after I test the manually closing the socket before the ssl wrapper scenario

#

it works fine after the fix, but that's expected. It's whether it fails before the fix that is interesting

#

hum, darn, it also works before the fix

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.4-68-g2326b49b24-dirty on 2022-12-07; Adafruit Feather ESP32-S3 Reverse TFT with ESP32S3

Code/REPL

import wifi, socketpool, ssl, time
wifi.radio.connect()
import socketpool
socket = socketpool.SocketPool(wifi.radio)
ctx = ssl.create_default_context()

for i in range(3):
    log(i)
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect(('example.com', 443))
    sss = ctx.wrap_...
onyx hinge
#

@tulip sleet both my PRs are ready for your (re)review, sorry it's coming at the end of the day

manic glacierBOT
#

The program I tried:

import wifi, socketpool, ssl, time, gc
wifi.radio.connect('<omitted>')
import socketpool
socket = socketpool.SocketPool(wifi.radio)
ctx = ssl.create_default_context()

b = bytearray(24)
for i in range(8):
    print(i)
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sss = ctx.wrap_socket(s)
    sss.connect(('finance.yahoo.com', 443))
    print(sss.send(b"GET /quote/%5EIXIC HTTP/1.0\r\nHost: finance.yahoo.com\r\n\r\n"))
    print(sss.recv_in...
#

The Teensy 4.1 board apparently has a FLASHing indicator LED. It lights up when you put the board in program mode and while you're flashing but that's the only time I've seen it lit.

When I have one of the faulty CP builds installed, I've noticed a sequence of (I believe) 7 quick flashes of this LED. Sometimes the sequence happens immediately following the Flash program operation but not always. I've also seen it occur at seemingly random times.

slender iron
#

@onyx hinge ```python
import struct
import memorymap
import espulp

class StructMemory:
def init(self, address, typecode):
self.address = address
self.typecode = typecode
self.buf = bytearray(struct.calcsize(typecode))
self.end = address + len(self.buf)

def __get__(
    self,
    obj,
    objtype = None,
):
    self.buf = obj.memory_map[self.address:self.end]
    return struct.unpack_from(self.typecode, self.buf)[0]

def __set__(self, obj, value) -> None:
    struct.pack_into(self.typecode, self.buf, 0, value)
    obj.memory_map[self.address:self.end] = self.buf

class Foo:
settingv1: int = StructMemory(0x000000ec, "I")
"""The delay between toggles a second line of comment

A second paragraph"""
def init(self,
pin_number: int = 15
) -> None:
self.ulp = espulp.ULP()
self.program = bytearray(234)
self.program[0:230] = (
b"\x6f\x00\x60\x00\x82\x80\x37\x01\x00\x08\x97\x00\x00\x00\xe7\x80" # 00000000
b"\x80\x00\x01\x11\x06\xce\x22\xcc\x00\x10\x01\x45\x23\x2a\xa4\xfe" # 00000010
b"\x05\x45\xa3\x09\xa4\xfe\xb7\x05\x00\x80\x23\x22\xb0\x10\x37\x06" # 00000020
b"\x00\x00\x83\x25\x86\x0e\x93\x96\x45\x00\xa9\x65\x13\x87\x05\x61" # 00000030
b"\x36\x97\xb7\x06\x08\x00\x14\xc3\x03\x26\x86\x0e\x33\x15\xc5\x00" # 00000040
b"\x23\xa0\xa5\x44\x6f\x00\x40\x00\x03\x45\x34\xff\x05\x89\x81\x45" # 00000050
b"\x63\x00\xb5\x02\x6f\x00\x40\x00\x37\x05\x00\x00\x83\x25\x85\x0e" # 00000060
b"\x05\x45\x33\x15\xb5\x00\xa9\x65\x23\xa8\xa5\x40\x6f\x00\xc0\x01" # 00000070
b"\x37\x05\x00\x00\x83\x25\x85\x0e\x05\x45\x33\x15\xb5\x00\xa9\x65" # 00000080
b"\x23\xa0\xa5\x42\x6f\x00\x40\x00\x73\x25\x00\xc0\x23\x26\xa4\xfe" # 00000090
b"\x03\x25\xc4\xfe\x23\x24\xa4\xfe\x6f\x00\x40\x00\x03\x25\x84\xfe" # 000000a0
b"\x83\x25\xc4\xfe\xb3\x05\xb5\x40\x37\xb5\x02\x00\x13\x05\x75\xb9" # 000000b0
b"\x63\x6a\xb5\x00\x6f\x00\x40\x00\x73\x25\x00\xc0\x23\x24\xa4\xfe" # 000000c0
b"\x6f\xf0\xdf\xfd\x03\x05\x34\xff\x13\x45\xf5\xff\x05\x89\xa3\x09" # 000000d0
b"\xa4\xfe\x6f\xf0\x7f\xf7" # 000000e0
)
self.program[232:236] = (
b"\x0f\x00\x00\x00" # 000000e8
)
struct.pack_into("I", self.program, 0x000000e8, pin_number)
self.memory_map = memorymap.AddressWindow(0x60000000, 0x8000)
self.ulp.run(self.program)

#

(needs to be run through black)

onyx hinge
#

Looks good!

slender iron
#

I haven't tested it yet either

#

๐Ÿ™‚

#

but is autogenerated from c source

#

including the comments

#

using clang ast output

onyx hinge
#

neat! so far circuitpython doesn't depend on clang but if it's the easiest path from here to there .. you get to make a call whether it's a good trade-off.

slender iron
#

clang would be needed to build the ulp library, not circuitpython

onyx hinge
#

is clang ast stable or does it tie us to a particular clang version?

slender iron
#

not sure

onyx hinge
#

at least dwarf debug information is a stable format intended to work between software even if it might be harder to work with

slender iron
#

it is way harder to get type info from though

#

and can't do comments afaik

manic glacierBOT
#

Under what circumstances is the passed in socket not a Socket object? Could it be an SSLSocket? If so then fields in it are set willy-nilly. Also the SSLSocket would not be shut down. And if it's a plain Socket, it's kind of being rendered unfunctional, but the underlying lwip socket isn't decommissioned in any way.

Scott answered this in a voice chat. The routine is actually initializing a socket object for use by the web workflow. The name is not very self-documenting, so...

serene token
serene token
# slender iron <@396145689333071872> the C functions that are put into the "protocol" struct ne...

Ok, that helps. I thought that might be the case, but I wasn't sure.

Does it need to be in a new module? It seems to me like it's similar enough in purpose to RawSample and WaveFile that it belongs with them. I'm not opposed to putting it in a new module, if you think that's the best way to do it though. Maybe we should have an "audiostream" module that could also contain things like "MP3Stream" and "WaveStream" in the future? (Just for the record, I'm not planning to make either of those myself, but I have seen people here asking about streaming MP3, so it's something I can see a need for.)

I don't know how to make a new module, though I guess I could take the same approach and copy an existing one and work from there. I'll start by reading through that document foamyguy provided, and I'll go from there. Thanks again for the help.

slender iron
#

new modules are best in case it can't fit in small builds

serene token
#

@slender iron Alright. It's not big, but I know something small can push it over the edge. I'll figure out how to make an "audiostream" module (if you aren't opposed to the name), and I'll go from there.

#

@lone axle That document really helps! I had figured out maybe 50% of that on my own, and this covers the other 50% in very easy to understand terms. Just having gone over the first page, I feel much more in my element! Thanks again!

manic glacierBOT
#

@SirHormigo @lonesoac0 I tried to reproduce your problems on a Metro M4 AirLift Lite, with 7.3.3 and 8.0.0, and do not see these failures. The on-board airlift is running firmware 1.7.4. Here is my test program. Could you describe your hardware in more detail? It may be a pin choice problem.

import board

from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.services.nordic import UARTService

from adafru...
lone axle
serene token
# lone axle Hooray ๐ŸŽ‰ happy it was helpful

If you happen to have anything on making new modules (specifically the __init__.c and __init__.h parts), I wouldn't mind that. It looks like I'm going to have to deal with that stuff too, and last time I looked, in was even more intimidating...

lone axle
serene token
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 8\.0\.0\-beta\.5
manic glacierBOT
#

This zip has a uf2 file I builtfrom the official pico-examples. git describe --tags of pico-examples shows sdk-1.4.0-7-g8be18f2. pico-sdk used was 1.4.0. It was configured with cmake -DPICO_STDIO_USB=ON -DPICO_BOARD=pico_w -DPICO_SDK_FETCH_FROM_GIT=1.

picow_wifi_scan_poll.zip

If you have an affected device, please try copying this example to your RPI-RP2. When you plug the device in,...

manic glacierBOT
tulip sleet
manic glacierBOT
#

I haven't had a chance to implement the changes above, but the other QT PY crashed about 2 hours ago and didn't go into safe mode. Instead, it just locked up. Here's the debug output:

Guru Meditation Error: Core  0 panic'ed (StoreProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x4009361b  PS      : 0x00060630  A0      : 0x3ffdfc80  A1      : 0x3ffdfc60  
A2      : 0xffffffff  A3      : 0x00000001  A4      : 0xffffffff  A5      : 0x3ffd7e54  
A6      : 0x3f...
manic glacierBOT
#

CircuitPython version

7.3.3

Code/REPL

n/a

Behavior

n/a

Description

When connecting a Tiny 2040 with circuitpython installed to a Raspberry PI 2 Zero W I'm seeing issues depending on whether I boot to desktop or boot to console.

If I boot to desktop with autologin then my circuitpython drive mounts successfully and the code on it runs, but if I set the pi to boot to console (either with or without autologin) the CIRCUITPY drive mounts wit...

manic glacierBOT
#

Previously the only other way of determining whether the Vfs has been mounted read-write or read-only appears to be to attempt a write operation and detect a possible OSError:

def is_readonly():
    try:
        with open('/.rw-test', 'w'):
            return False
    except OSError:
        return True

This is not only a bit clumsy but also requires extra attention to properly clean up the potentially created files/changes, changed timestamps, etc.

It's not pos...

manic glacierBOT
#

When using wifi.radio.start_scanning_networks(), I see many duplicates. I have two AP's with the same SSID, plus, another different one. For example (SSID's obfuscated):

Available WiFi networks:
	MyHome		RSSI: -77	Channel: 6
	MyHome		RSSI: -37	Channel: 6
	Neighbor		RSSI: -88	Channel: 8
	MyHome		RSSI: -79	Channel: 6
	MyHome		RSSI: -39	Channel: 6
	MyHome		RSSI: -37	Channel: 6
	MyHome		RSSI: -42	Channel: 6
	MyHome		RSSI: -81	Channel: 6
	MyHome		RSSI: -41	Channel: 6
	MyHomeOther...
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-beta.0 on 2021-08-24; Fomu with VexRiscv

Code/REPL

every code

Behavior

Flashing every firmware after 7.0.0-beta.0 (from 7.0.0-rc.0) using dfu-util will cause circuitpython failed to work properly. A drive named CIRCUITPY won't appeared. Though there is a serial port appeared in the Device Manager, every attempt to connect to the board (for example, using Thonny) through this port will end up in a...

onyx hinge
#
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: Cannot remount '/' when visible via USB.
```Isn't this supposed to succeed (at the risk of allowing filesystem corruption), rather than raising the error?
stuck elbow
manic glacierBOT
onyx hinge
#

@tulip sleet none of your efforts to make "removable storage" work panned out for all 3 major OSes did they?

onyx hinge
#

@slender iron I was thinking about ccache and similar techniques. QSTR numbering is another big reason that every board build is likely to be different. In neokey trinkey, for example, 236 of 335 files include py/qstr.h directly or indirectly (70%). Percentage is similar for pico w (66%).

manic glacierBOT
#

No, Seeed hasn't (to my knowledge) released a schematic for this version.
I've been able to work around it by sending a dummy ble_radio message on
startup, then if the error occurs resetting via microcontroller.reset(),
which allows it to run without further errors. Not sure if that helps track
down the issue.

On Thu, Dec 8, 2022, 7:28 AM Dan Halbert @.***> wrote:

The sdkconfig files between the QT Py and the XIAO have no interesting
setting differences: they are tiny and just spe...

manic glacierBOT
proven garnet
#

PyPI stats are finally auto updating in the bundle!

slender iron
manic glacierBOT
manic glacierBOT
#

The BLE workflow is on by default. Only wifi needs .env. You can disable ble workflow with supervisor.runtime.ble_workflow = False iirc.

I believe HID does require pairing and bonding so you'll be have data saved on both ends of the connection. After you disconnect, do you expect to reconnect to that device again without pairing? If not, you could call _bleio.adapter.erase_bonding(). This is what CP does when the reset button is pressed during the fast blink on startup.

slender iron
#

re: interrupts on the ulp

manic glacierBOT
#

The BLE workflow looks for a paired/bonded device and connects to it on startup. It is true the HID also requires pairing/bonding, for security reasons, so it sounds like in this case the BLE workflow code can't tell the difference. So, as @tannewt mentions, doing supervisor.runtime.ble_workflow = False early in your code (possibly in boot.py will turn off the BLE workflow, and then your disconnect should work properly.

From https://docs.circuitpython.org/en/latest/shared-bindings/supe...

manic glacierBOT
manic glacierBOT
#

This PR replaces the dotenv module and the .env file with the _environ module and the settings.toml file.

Testing performed:

  • on pico w, set up wifi workflow with alternate port number
  • ran environ_test in build and on pico w

Would appreciate test reports of scenarios I didn't test, like

  • [ ] ble workflow
  • [ ] espressif wifi workflow

closes #7274

manic glacierBOT
slender iron
#

@analog bridge were you testing ulp on s3 or s2?

atomic summit
#

Now that deepsleep is fixed for the S3 in beta 5 (thanks @slender iron ) - I'm thinking of shipping beta5 on my S3 boards now. Do we think it's stable enough for that?

onyx hinge
# manic glacier

@tulip sleet That was my original plan. However, the tail is wagging the dog. I use _environ to test within the unix port. Which I think is valuable, but ...

#

also it looks like I used up all that extra space I found us, and then some ๐Ÿ˜ฆ

tulip sleet
#

because os.getenv() is different on the unix port?

slender iron
#

@atomic summit that's your call. ๐Ÿ™‚

tulip sleet
#

you could enable _environ only on the Unix port

jaunty juniper
#

I haven't posted in the issue yet as I'd like to do more tests, but I was unable to use true deep sleep on my feather ESP32S3 TFT

onyx hinge
#

Multiple reasons.

  1. To test with non-parsable files I need to select different files
  2. os is not the shared-bindings os on the unix port
jaunty juniper
#

meaning it just resets when I expect a 20s sleep (which works in fake deep sleep)

slender iron
jaunty juniper
#

I wanted to maybe hook a serial friend to a DEBUG build, but I can just report and do that later

slender iron
#

I can only get the ulp to run once on startup...

onyx hinge
#

I also had various problems with ulp reset

atomic summit
onyx hinge
#

@tulip sleet apprecate your thoughtful review as always

#

I apologize that there are "oh geez" problems in there like debug prints, and appreciate that you can just offer kind correction when you see it.

#

less sure what to do about the _environ module. Guard it by a separate #if so it's only in the unix port?

tulip sleet
onyx hinge
#

or otherwise put it in a place the unix build sees but other stuff doesn't

tulip sleet
#

if you guard it so it's only in the Unix port, then maybe you get back a bunch of space.

onyx hinge
#

some space at least

#

does making it NOT be the "_environ" module mean I should move/rename the code again? If so, to where?

tulip sleet
#

I have been looking at other toml, ini, and settings libs but haven't found a get_key style example yet

onyx hinge
#

no, nobody does it that way

tulip sleet
onyx hinge
#

so far I was going to turn it off 'case by case' but maybe I should

tulip sleet
#

if it is only for unix, then it could be _settings_test, and be only a front for the actual implementation, which would be in the os module, or wherever get_key was actually implemented

#

I mean, is it useful enough that we should enable it in samd21, or will it not fit. What is true of .env right now? Where is it enabled?

onyx hinge
#

I could just put the single Python function implementation in ports/unix/coverage.c

#

dotenv was enabled for all FULL_BUILD with no extra spots where it was turned off.

manic glacierBOT
#

In my tests with beta 5, it never goes to deep sleep but just resets, like before I think.
Feather ESP32-S3 TFT

Adafruit CircuitPython 8.0.0-beta.5 on 2022-12-08; Adafruit Feather ESP32-S3 TFT with ESP32S3

Running that code.

import alarm
import time
time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 20)
alarm.exit_and_deep_sleep_until_alarms(time_alarm)

Does not go to deep sleep but resets immediately instead when on power only (USB power adapter...

tulip sleet
onyx hinge
#

OK, I think we're in agreement. So where in terms of path & filename should the toml-parsing code currently in shared-modules/_environ in the PR go?

#

shared-modules/os ?

tulip sleet
#

that makes sense, then os.get_key() /common_hal_os_get_key() can be the way to access it either internal or externally. I think?

onyx hinge
#

OK, I'll rip it apart and put it back together again

jaunty juniper
#

so I have a Xiao NRF52 sense, but I don't know how I could test the charge rate pin, I don't have a power analyzer or anything, I don't think I can just put a multimeter on the battery pins ?

tulip sleet
#

I looked at the datasheet for the charge controller -- it's programmed by resistor vlaues, so they set up a divider to choose to currents at high and low (or at least that was what I saw at a quick glance)

dusk mist
# atomic summit Hahah, sure, I was just wondering if folks thought it was stable enough... it pa...

Can confirm it works with my TinyS3 now, which I'm using to power an e-ink display (light sleep during minute intervals, deep sleep on hour intervals during low light so it's central to its operation). Before it actually did light/deep sleep worse than the Adafruit Feather ESP32-S3 since it would crash even on light sleep, forcing me to just use sleep/sleep-->reset. Now it seems perfect but I'll see if it does anything funky.

atomic summit
#

Can you explain in more detail what was different?

dusk mist
#

Yeah. It was definitely weird because I didn't change anything except the pin references but I didn't mind since the workaround pretty much did the same thing.

So in the Feather light sleep would just work, so I assumed it would work just the same on the TinyS3 but somehow it would get unstable and crash mid-hour (which is where I put light sleep). No idea why but given that I was using the latest releases at the time, it could be that.

atomic summit
tulip sleet
#

@atomic summit in an upcoming beta, we are going to make an incompatible change to the .env web workflow stuff. It will become settings.toml with a slightly different syntax, using a limited subset of toml.

#

so if you ship beta.5 it will need to be updated by the users at some point

#

but is it better than shipping 7.3.3? Probably.

manic glacierBOT
tulip sleet
#

i think we are seeing the light at the end of the 8.0.0 tunnel

jaunty juniper
#

with Adafruit CircuitPython 8.0.0-beta.5 on 2022-12-08; FeatherS3 with ESP32S3
and:

import alarm
import time

from digitalio import *
import board
led = DigitalInOut(board.LED)
led.switch_to_output(True)
for i in range(5):
    led.value = not led.value
    time.sleep(0.1)

time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 20)
alarm.exit_and_deep_sleep_until_alarms(time_alarm)

I get an instant reboot instead of sleep (I blink the LED to see the reboot happen)

atomic summit
#

Is the plan for folks to use .env and the new settings.toml for anything non web workflow? Like, just for storing wifi credentials etc?

manic glacierBOT
tulip sleet
#

they can use it for whatever they want. os.getenv() will fetch the values

#

but there are certain keys that will be read on startup

dusk mist
#

Before it would just crash whenever the program exits, regardless of whether it's sleep-related or not.

jaunty juniper
#

fake deep sleep allows testing without losing USB

dusk mist
#

Yeah, though I assume it's a form of sleep that was close to deep sleep since it would exit the program and crash before.

#

To note, it does work as expected when connected to the computer, just not the true deep sleep functionality that happens without USB.

stuck elbow
#

or at least rename "uasyncio" to "asyncio" everywhere?

#

Some people got really confused

tulip sleet
stuck elbow
#

can't see an issue, I will create one

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.4-78-g4418f268b on 2022-12-06; Raspberry Pi Pico with rp2040

Code/REPL

# audio_click_i2c.py -- demonstrate audio clicking when update I2C display
import time, random
import board, busio
import audiocore, audiomixer, audiobusio, audiopwmio
import displayio, terminalio
from adafruit_display_text import label
import adafruit_displayio_ssd1306

displayio.release_displays()

dw,dh = 128,64
# Pico...
manic glacierBOT
#

I tested this again, with the following simpler program, on a MagTag, with CircuitPython 8.0.0-beta.4. I sent serial output to the D10 jack to monitor what was happening. when on battery power. I am seeing that alarm.wake_alarm now is a PinAlarm or a TimeAlarm, as appropriate, after a light sleep.

There have been various PinAlarm fixes, such as #7154, since this bug was filed. @raymond-li Please reopen or open a new issue if you are still having trouble with 8.0.0-beta.4 or later. Th...

#

Ok, I've spent a good chunk of time on this in https://github.com/tannewt/circuitpython/tree/rework_coproc_api. I've tried getting the ULP working on ESP32-S3 and have only managed to get it working after reset. It stops working after reloads. Furthermore, I've traced some S3 sleep issues to having the coprocessor enabled (but not used by CP) due to the ulp [falsely triggering on fault](https://github.com/espressif/esp-idf/blob/454aeb3a48ac2b92cfa9d8b6a01d1b53179ec50a/components/ulp/ulp_riscv...

slender iron
#

@jaunty juniper looks like the ulp is waking cp up early

#

โ˜๏ธ

manic glacierBOT
manic glacierBOT
#

@Neradoc Your mu issue appears to be https://github.com/mu-editor/mu/issues/1505. I think it would be good to re-open that and point out that a running program that is not receiving input may have far too much input piled up. I also do not even see the point of the cursor movements, since the Serial window in Mu should be a stream, not an editor window. Do you understand the use case for Mu to generate those cursor movements.

manic glacierBOT
#

I also do not even see the point of the cursor movements, since the Serial window in Mu should be a stream, not an editor window. Do you understand the use case for Mu to generate those cursor movements.

It only makes sense when in the REPL typing a command, it lets you click to move the insertion point inside your command, and there is even code to select and delete the selection. It doesn't seem super useful to me, but I'll admit to being used to moving the cursor with arrows.

manic glacierBOT
onyx hinge
#
! Package inputenc Error: Unicode character ๐Ÿ‘จ (U+1F468)
(inputenc)                not set up for use with LaTeX.``` this is why we can't have nice things
onyx hinge
#

pdflatex: Command for 'pdflatex' gave return code 0.01171875 I'm running into some .. interesting .. problems building the docs locally as well. Who new there were fractional return codes in UNIX

tulip sleet
#

JOSS and FOCAL had fixed point line numbers with decimal parts n.dd. Lynx Basic (I did not use that) had floating point line numbers

hollow gazelle
slender iron
#

@hollow gazelle I did think about doing esp-idf examples but I didn't see one that fully shut it down and then restarted. definitely a good next step

#

it just feels very immature

analog bridge
manic glacierBOT
manic glacierBOT
#

reset_port() calls reset_all_pins() which appears to reset any pin that hasn't been set in never_reset_pins but board_init() is the routine that seems to set the never_reset_pins array.

Perhaps we need to separate out the pin configuration from other board_init functions, maybe create a new function in board.c called something like pin_config which could be called prior to reset_port and allow the display initialization functions in board_init to happen after reset_port?

slender iron
brazen hatch
orchid basinBOT
analog bridge
slender iron
#

(I followed up on the coproc issue about it yesterday)

analog bridge
#

Just glanced over the ULP section in S2/S3 technical reference manual and there seems to be slight difference in the ULP init sequence between the two

slender iron
#

@analog bridge ya, I tried to change it to match the latest version of the idf

manic glacierBOT
analog bridge
#

It is stated that on S3, RTC_CNTL_COCPU_CLK_FO needs to be cleared after being set. This is correct in v5.0 but v4.4 routine is incorrect

manic glacierBOT
slender iron
#

I was changing my copy of the idf to match 5.0

analog bridge
#

What is your ULP test program?

slender iron
#

let me make a repo to push it to

#

thats the built file

#
import adafruit_ulp_blink
import time
import memorymap
import struct

def print_regs():
    print("COCPU_INT_ST", hex(struct.unpack("I", rtc_ctl[0x0F0:0x0F4])[0]))
    print("TIMER_REG", hex(struct.unpack("I", rtc_ctl[0x0FC:0x100])[0]))
    print("CP_CTRL", hex(struct.unpack("I", rtc_ctl[0x100:0x104])[0]))
    print("COCPU_CTRL", hex(struct.unpack("I", rtc_ctl[0x104:0x108])[0]))

print("sleeping")
time.sleep(5)
print("awake")
rtc_ctl = memorymap.AddressRange(start=0x60008000, length=0x400)
print_regs()

b = adafruit_ulp_blink.Blink()
for i in range(10):
    time.sleep(1)
    print(b.count)
    print_regs()

b.ulp.halt()
print_regs()
#

idf changes: ```diff
diff --git a/components/ulp/ulp_riscv.c b/components/ulp/ulp_riscv.c
index 2c56ca119e..1cfc9c94a1 100644
--- a/components/ulp/ulp_riscv.c
+++ b/components/ulp/ulp_riscv.c
@@ -27,6 +27,10 @@
#include "ulp_private.h"
#include "esp_rom_sys.h"

+#include "esp_log.h"
+
+static const char* TAG = "esp ulp rv";
+
esp_err_t ulp_riscv_run(void)
{
#if CONFIG_IDF_TARGET_ESP32S2
@@ -56,12 +60,12 @@ esp_err_t ulp_riscv_run(void)
return ESP_OK;
#elif CONFIG_IDF_TARGET_ESP32S3
/* Reset COCPU when power on. */

  • SET_PERI_REG_MASK(RTC_CNTL_COCPU_CTRL_REG, RTC_CNTL_COCPU_CLK_FO);
    SET_PERI_REG_MASK(RTC_CNTL_COCPU_CTRL_REG, RTC_CNTL_COCPU_SHUT_RESET_EN);
    esp_rom_delay_us(20);
  • CLEAR_PERI_REG_MASK(RTC_CNTL_COCPU_CTRL_REG, RTC_CNTL_COCPU_CLK_FO);
    CLEAR_PERI_REG_MASK(RTC_CNTL_COCPU_CTRL_REG, RTC_CNTL_COCPU_SHUT_RESET_EN);
  • SET_PERI_REG_MASK(RTC_CNTL_COCPU_CTRL_REG, RTC_CNTL_COCPU_CLK_FO);

  • /* Disable ULP timer /
    CLEAR_PERI_REG_MASK(RTC_CNTL_ULP_CP_TIMER_REG, RTC_CNTL_ULP_CP_SLP_TIMER_EN);
    /
    wait for at least 1 RTC_SLOW_CLK cycle */
    @@ -94,6 +98,8 @@ esp_err_t ulp_riscv_run(void)
    esp_rom_delay_us(20);
    REG_WRITE(RTC_CNTL_INT_CLR_REG, RTC_CNTL_COCPU_INT_CLR | RTC_CNTL_COCPU_TRAP_INT_CLR | RTC_CNTL_ULP_CP_INT_CLR);

  • ESP_LOGI(TAG, "started ULP");

  • return ESP_OK;
    #endif
    }
    @@ -113,5 +119,7 @@ esp_err_t ulp_riscv_load_binary(const uint8_t* program_binary, size_t program_si
    memset(base, 0, ULP_RESERVE_MEM);
    memcpy(base, program_binary, program_size_bytes);

  • ESP_LOGI(TAG, "program loaded");

  • return ESP_OK;
    }

#

was testing on s3 usb otg

manic glacierBOT
manic glacierBOT
#

Not sure if it's a coincidence but all 4 boards made it through the night without crashing since I gave them unique hostnames. I also tried rebooting my access point and running deauth attacks against the QT PY's. So far, they haven't crashed. I added a fifth board and I'll let them all run for a few days. Afterwards, if there are no crashes, I'll put the hostnames back to espressif and see if the problem recurs.

analog bridge
#

@slender iron can you test this on S3 with 8.0.0-beta.5, it has led on pin 15

import time
import atexit
import coproc
import supervisor

shared_mem = coproc.CoprocMemory(address=0x500007f0, length=1024)

with open("ulp_main.bin", "rb") as f:
    program = coproc.Coproc(buffer=f.read(), memory=shared_mem)

coproc.run(program)

atexit.register(coproc.halt, program)

while coproc.memory(program)[0] <= 50:
    print(coproc.memory(program)[0])
    time.sleep(5)
    coproc.memory(program)[0]+=10

supervisor.reload()

slender iron
#

@analog bridge yup, let me try

#

(will be gone again when the baby wakes from his nap)

#

45 minutes or so ๐Ÿคž

#

@analog bridge looks like it works!

#

can you send me the elf too?

#

I'm curious to look at the assembly

analog bridge
#

Comparing your ld:
https://github.com/adafruit/Adafruit_CircuitPython_ULP_Blink/blob/main/link.ld
with the one in esp-idf:

/*
 * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
 *
 * SPDX-License-Identifier: Apache-2.0
 */
#include "sdkconfig.h"

ENTRY(reset_vector)

MEMORY
{
    ram(RW) : ORIGIN = 0, LENGTH = CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM
}

SECTIONS
{
    . = ORIGIN(ram);
    .text :
    {
        *start.S.obj(.text.vectors) /* Default reset vector must link to offset 0x0 */
        *(.text)
        *(.text*)
    } >ram

    .rodata ALIGN(4):
    {
        *(.rodata)
        *(.rodata*)
    } > ram

    .data ALIGN(4):
    {
        *(.data)
        *(.data*)
        *(.sdata)
        *(.sdata*)
    } > ram

    .bss ALIGN(4) :
    {
        *(.bss)
        *(.bss*)
        *(.sbss)
        *(.sbss*)
    } >ram

    __stack_top = ORIGIN(ram) + LENGTH(ram);
}

and the start.S file:

    .section .text.vectors
    .global irq_vector
    .global reset_vector

/* The reset vector, jumps to startup code */
reset_vector:
    j __start

/* Interrupt handler */
.balign 16
irq_vector:
    ret

    .section .text

__start:
    /* setup the stack pointer */
    la sp, __stack_top
    call ulp_riscv_rescue_from_monitor
    call main
    call ulp_riscv_shutdown
loop:
    j loop

#

take a look at build configuration in esp-idf/components/ulp

slender iron
#

I looked at it a bunch. what are you seeing?

slender iron
#

baby time. thanks for the test code!

analog bridge
#

call ulp_riscv_rescue_from_monitor is blanked out in your start?

manic glacierBOT
slender iron
manic glacierBOT
#

Okay I feel like a total dummy for forgetting that audiomixer.Mixer() had buffer_size argument.

You are correct: setting buffer_size=32768 allows even the slowest 100kHz full-screen OLED update to occur without glitching. At 400kHz, only an 8kB buffer is needed. This is for for 22kHz mono 16-bit samples.

Adding the larger buffer also solves one of my most headache-inducing problems that still exists even after #6005 was closed: audio glitches caused by USB enumeration on reset.
...

#

I feel like I can close this issue, but is there somewhere official the tip of "if you get audio glitches, increase buffer size" can be documented?

There is no general audio Learn Guide, though there could be. This kind of info could also be in the FAQ in the Welcome guide.

Have you heard playback glitches when not using Mixer? I wonder if other default buffer sizes might be increased, at least on large-ram builds. Or we could provide optional parameters.

manic glacierBOT
manic glacierBOT
onyx hinge
#

hum I wanted to commit a file with the ".toml" extension but no trailing newline .. but the newline fixer wants to fix it. hum.

#

I can call the file .toml.bin

#

no that doesn't work

idle owl
#

Uff.

tulip sleet
onyx hinge
#

@tulip sleet it can be customized in pre_commit_config.yaml, I found belatedly.

manic glacierBOT
crimson ferry
#

Is there a way to turn off mDNS without reset? There's no '__exit__' for context manager, and can't deinit() after a reload.

manic glacierBOT
manic glacierBOT
#

I am also seeing this problem with I2S audio and an I2C screen.

Adafruit CircuitPython 7.3.3 on 2022-08-29; Raspberry Pi Pico with rp2040
Board ID:raspberry_pi_pico

import adafruit_displayio_ssd1306

Increasing the buffer_size in audiomixer.Mixer() seems to eliminate the audio glitches, but it introduces a significant amount of latency that interferes with real time operation.
Up to about 350ms of latency for buffer_size=32768 and sample_rate=44100 compared to about 15ms w...

serene token
#

Alright, new commit error: Translations failed.

I have added two places where exceptions are raised. They are ValueError exceptions. Referencing existing code, I wrapped the text in "translate" calls (macros?). If I understand the error correctly, the translations are supposed to reference some file that contains translations for different languages, but it was unable to find the referenced strings, because I have not added them to that file. It suggests running "make translate", which I did and which did not resolve the problem.

I believe I've found the file where the messages need to be added (py/circuitpython.pot, is this correct?), however I would like to know what is expected here. Should I just add the messages, using the same format used for other messages in the file? Should I first look for other messages that convey the same idea? (The errors occur when the RawStream audio class I'm creating is given a sample to play that has different signedness or byte width than it was initialized with.)

#

Or perhaps did the pre-commit or the make translate automatically update locale/circuitpython.pot, and I merely need to add that to the commit?

manic glacierBOT
#

I had an idea for simpler testing in the unix port. Instead of adding a special coverage/unix-only method to specify the filename, I think the test program(s) could simply rewrite settings.toml over and over again, since each time os.getenv() is called it reads the file fresh:

# write settings.toml test values
# do os.getenv() tests
# write settings.toml again with different values
# do more os.getenv() tests
# ...

An alternative is to add an extra optional argument to...

lavish saffron
#

Hi, I'm working through the how to build CircuitPython instructions, and mpy-cross fails to build.
macOS Monterey 12.6.1, M1 Mac.

gmake: Entering directory '/Volumes/CircuitPython-Builds/circuitpython/mpy-cross'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
  File "<fstring>", line 1
    (offstart=)
             ^
SyntaxError: invalid syntax
gmake: *** [../py/py.mk:274: build/genhdr/compression.generated.h] Error 1
gmake: Leaving directory '/Volumes/CircuitPython-Builds/circuitpython/mpy-cross'

Any help greatly appreciated!

tulip sleet
tulip sleet
#

btw, set V=2 (uppercase)

manic glacierBOT
lavish saffron
# tulip sleet <@330227457296957440> had this same trouble on macOS a few days ago. I don't see...

Thanks for your prompt reply. V=2, good catch. gmake clean hasn't helped. The verbose output follows. I'm getting ready for some new boards but I doubt I'll get to them until February, so this isn't urgent for me. I'll poke around and educate myself ๐Ÿคช

GEN build/genhdr/mpversion.h
python3 ../py/makeversionhdr.py build/genhdr/mpversion.h
GEN build/genhdr/compression.generated.h
mkdir -p build/py
python3 ../py/maketranslationdata.py --compression_filename build/genhdr/compression.generated.h --translation build/genhdr/en_US.mo --translation_filename build/py/translations-en_US.c build/genhdr/qstrdefs.preprocessed.h
  File "<fstring>", line 1
    (offstart=)
             ^
SyntaxError: invalid syntax
gmake: *** [../py/py.mk:274: build/genhdr/compression.generated.h] Error 1
gmake: Leaving directory '/Volumes/CircuitPython-Builds/circuitpython/mpy-cross'
manic glacierBOT
#

Update: using playback via the AudioMixer ( mixer.voice[0].play() ) is a workaround for now, as it only pops once when mixer.play is called and then all the consecutive plays do not pop.

So when using PWM Audio,
audio_out1.play(mixer) -> pops once at the beginning, but then mixer.voice[0].play doesn't pop
audio_out1.play pops everytime it's called

It's possible that the audio_dma_setup_playback called from common_hal_audiopwmio_pwmaudioout_play blocks the pwm being written lon...

manic glacierBOT
#

I'm pretty disappointed that I can't use the Adafruit I2S MEMS Microphone Breakout in circuit python, I guess I should have picked up the PDM microphone. I assumed that since circuit python supported I2S out it would have supported I2S in, this would be good to make clear on the product page that there is no support in circuit python and no planned support.

crimson ferry
manic glacierBOT
crimson ferry
#

which is a problem: m = mdns.Server(wifi.radio) gets a RuntimeError even after reset if web workflow is enabled (rp2 only)

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.5 on 2022-12-08; Raspberry Pi Pico W with rp2040

Code/REPL

# mDNS finder

import time
import wifi
import mdns
import microcontroller
from secrets import secrets

MDNSFINDTIMEOUT = 5

def connect():
    # to connect if no web workflow, or to reconnect if disconnexted
    if not wifi.radio.ipv4_address:
        print (f"Connecting to wifi AP..", end="")
        while True:
            try:...
tulip sleet
#

@onyx hinge i hope the toml testing idea was not too disruptive. It does seem to have reduced complexity. So is it true that a test can't actually write a file in the regular filesystem that the Unix port can read? Your use of a RAM filesystem is clever.

manic glacierBOT
onyx hinge
#

@tulip sleet because the path is hard-coded as "/settings.toml" with leading "/" you can't write it

#
Run # "Calculating the previous and current SHA..."
changed-files-diff-sha
  Verifying git version...
  Valid git version found: (2.38.1)
  Running on a pull request event...
  Fetching remote refs...
  remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
  From https://github.com/adafruit/circuitpython
   * [new branch]          main       -> origin/main
  branch 'main' set up to track 'origin/main'.
  Fetching 40 commits...
  fatal: error in object: unshallow 3940878695f2d7797fc1570d8b281ca9ffa454ff
  Error: Process completed with exit code 128.``` @tulip sleet I do not know what's going on here except that it has to do with one of the "build less stuff" optimizations. If you have a clue how to poke it please let me know.
serene token
# tulip sleet right, just run `make translate` when you add new messages with `translate()`. A...

That sounds good. I seriously doubt the message I need is already there, but I'll at least grep the .pot file to check. I'm already using one %q to reference the variable itself, and I would need a second to reference the class name, because the value errors are dependent on how the object was initialized.

Anyhow, thanks! I think I'm close to finished, so this was an annoying roadblock! I'm happy to have the help I've gotten here.

onyx hinge
#

I re-ran it to see if the outcome's any different

tulip sleet
serene token
#

Ok, new question: Do modules need to be explicitly compiled? Or does a reference need to be added somewhere to make them compile? I think my code is finished for a new module. Doing a general compile for the QT Py RP2040 completes with no errors, which I find unlikely given this is the first time I'm compiling after writing my new module. So how do I compile my new module?

tulip sleet
serene token
#

Alright, I'll do that. Thanks!

tulip sleet
onyx hinge
#

No, I didn't.

#

I can look at it more tomorrow or monday, I made the mistake of checking the status of that PR build even though I'm supposed to be getting ready for house guests

tulip sleet
#

i will take a look but there's no hurry on this at all, no need to stew about it. Enjoy your meal!

onyx hinge
#

thank you

serene token
#

Wait, I missed one of the all caps audiocore references! I've replicated that adjusted for my module, and now I'm finally getting a build error for my module! Now I can finally debug. Wish me luck.

#

Ok, anyone know where MP_OBJ_NEW_INT is defined? I need the version of this for bools, and the compiler says it's not MP_OBJ_NEW_BOOL.

jaunty juniper
#

it is mp_obj_new_bool like mp_obj_new_int

serene token
#

That's what I thought, but:

../../shared-bindings/audiostream/RawStream.c: In function 'audioio_rawstream_obj_is_ready':
../../shared-bindings/audiostream/RawStream.c:153:12: error: implicit declaration of function 'MP_OBJ_NEW_BOOL'; did you mean 'MP_OBJ_NEW_QSTR'? [-Werror=implicit-function-declaration]
  153 |     return MP_OBJ_NEW_BOOL(common_hal_audioio_rawstream_is_ready(self));
      |            ^~~~~~~~~~~~~~~
      |            MP_OBJ_NEW_QSTR
jaunty juniper
#

they are both lowercase

serene token
#

Not in the code I was referencing. I'll try it though!

jaunty juniper
#

can you point to it ?

serene token
#

Ah, it was MP_OBJ_NEW_SMALL_INT from shared-bindings/audiocore/RawSample.c. Maybe that's the only all cap one.

Thanks!

jaunty juniper
#

yeah that one would be a macro

#

they are in py/obj.h if I'm not mistaken

#

it's because small ints are optimized in a specific way I assume

serene token
#

Yeah, I guess my reference was the exception. Lousy luck, but thank you for correcting me! I'll look there if I come across something like this again. (Yeah, probably so.)

jaunty juniper
#

I use git grep or silversearcher (ag) to navigate the core source

serene token
#

Ok, so here's another one:

../../shared-bindings/audiostream/RawStream.c: In function 'audioio_rawstream_obj_is_ready':
../../shared-bindings/audiostream/RawStream.c:153:28: error: implicit declaration of function 'common_hal_audioio_rawstream_is_ready'; did you mean 'common_hal_audioio_rawstream_deinited'? [-Werror=implicit-function-declaration]
  153 |     return mp_obj_new_bool(common_hal_audioio_rawstream_is_ready(self));
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                            common_hal_audioio_rawstream_deinited

Where do I define the common_hal... bindings? Or do I not need to do it this way in this case?

(Yeah, I probably should have just grepped the whole repo to find the file...)

jaunty juniper
#

common_hal go in shared-modules/modulename and can be overridden by ports/*/common-hal/modulename (don't ask me how), you declare them as extern I think ?

serene token
#

Hmm, I didn't see any of that in audiocore, but maybe it's overridden. I'll dig around and see if I can find how audiocore is handling it then.

jaunty juniper
#

yeah I'm not clear on that

manic glacierBOT
serene token
#

Oh, it looks like in RawSample.c, the functions are just named that! I didn't realize that, because not all of them have that name. Only certain ones do.

serene token
#

๐ŸŽ‰ It compiles!

Now for runtime debugging. Thanks again!

manic glacierBOT
tulip sleet
tulip sleet
#

@analog bridge we're seeing build errors in the past couple of days on PRs, that appear to be related to the jt-actions/change-files action that is part of https://github.com/adafruit/circuitpython/pull/7132. Here's an example: https://github.com/adafruit/circuitpython/actions/runs/3666904634/jobs/6198998390 -- look in the failed "Get changes" section. I do not understand very much at all what might be causing this, but maybe it's due to the INPUT_FETCH_DEPTH: 40, which matches 40 in this error:

changed-files-diff-sha
  Verifying git version...
  Valid git version found: (2.38.1)
  Running on a pull request event...
  Fetching remote refs...
  remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
  From https://github.com/adafruit/circuitpython
   * [new branch]          main       -> origin/main
  branch 'main' set up to track 'origin/main'.
  Fetching 40 commits...
  fatal: error in object: unshallow 98002cf0abe5019cf3c57e6c1896c4c5dd226f24
  Error: Process completed with exit code 128.
#

I will turn this into an issue as well.

manic glacierBOT
#

In the past couple of days, PR's are failing due to errors that seem to be caused by tj-actions/changed-files.
#7132 introduced the use of that action.

Here is a typical failure, from https://github.com/adafruit/circuitpython/actions/runs/3666904634/jobs/6198998390, with the relevant log section extracted:

Run tj-actions/changed-files@v34
  with:
    json: true
    separator:  
    include_all_old_new_renamed_files: false
    old_new_separator: ,
    old_new_files_separator:...
serene token
tulip sleet
#

like what wouldn't be common?

tulip sleet
#

maybe a better example for you is shared-bindings/audiocore/RawSample.h, etc.

serene token
#

Common being deinit and such, that all objects should have?

I did end up figuring it based on that RawSample.h though.

brazen hatch
#

I was kinda busy the last few days, is the code for settings.toml out?
Does it need testing?

manic glacierBOT
analog bridge
tulip sleet
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.3.3: MakerDiary nrf52840 USB dongle

Code/REPL

import time
import random
from ble_json_service import SensorService
from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement


# Create BLE radio, custom service, and advertisement.
ble = BLERadio()
service = SensorService()
advertisement = ProvideServicesAdvertisement(service)

# Function to get some ...
manic glacierBOT
#

In order to support a new version of the board we have made some updates to the support package.

  • A new LDO that allows the user to cut power to the neopixel LED and external I2C port (Bi2C).
  • More flash variants are now supported
  • Added a couple of support functions for controlling the LDO control pin as well.
    The updates are fully compatible with the previous version of the board so no users are left out.
manic glacierBOT
#

There is one more use case for IR receiver. Thatโ€™s possible to detect IR codes on RPI Pico using CircuitPython but thatโ€™s impossible to do something more, see for example https://learn.adafruit.com/ir-sensor/circuitpython for IR receiver only (CircuitPython code) and https://learn.adafruit.com/remote-controlled-led-candelabra/code for IR receiver plus LEDs (C code). Even block code language for MicroBit allows to use IR receiver and neopixels together via interrupts but CircuitPython doesnโ€™t....

manic glacierBOT
onyx hinge
manic glacierBOT
#

We have a new failure now: (See: https://github.com/adafruit/circuitpython/actions/runs/3669965941/jobs/6204173152)

  Error: Similar commit hashes detected: previous sha: 66eca9c35e9da27232c67b9504b0bec6b6828dd0 is equivalent to the current sha: 66eca9c35e9da27232c67b9504b0bec6b6828dd0.
  Error: Please verify that both commits are valid, and increase the fetch_depth to a number higher than 40.
  Error: Process completed with exit code 1.
#

Here is the diff of tj-actions/changed-files logs in PR 7324 Good-CI and PR 7327 Bad-CI:

diff --git ci.log ci.log
index 46903bd36..5cf9191be 100644
--- ci.log
+++ ci.log
@@ -1,131 +1,69 @@
 Run tj-actions/changed-files@v34
   with:
     json: true
     separator:
     include_all_old_new_renamed_files: false
     old_new_separator: ,
     old_new_files_separator:
     files_separator:

     files_ignore_separator:

     path: .
     quotepath: true
     dir_...
manic glacierBOT
jaunty juniper
young frost
#

does anyone know how to patch CircuitPython 7 to enable 'uctypes' ?

manic glacierBOT
onyx hinge
#

you need to clean after changing Makefile or .mk files.

manic glacierBOT
lone axle
turbid radish
#

@lone axle The newsletter is ready to crib from for the 2pm meeting

lone axle
#

Thank you.

lone axle
#

However I'm not sure if that gets us any closer to understanding or having a fix. All of the properties have the same classes anyhow and only some of them are getting wrapped weird.

lone axle
#

<@&356864093652516868> The weekly meeting will take place here on discord at the regularly scheduled time of 2pm eastern. Which is a bit under 90 minutes from now. Fill in your notes to the document ahead of time if you have the opportunity. We look forward to meeting with everyone!

jaunty juniper
lone axle
#

I think I've experienced that as well on occasion. This library does seem to render the same for me locally as the RTD hosted one. I tried adding and removing a bunch stuff in the actual docstrings and found some interesting ways to influence how it renders, but never did get it to look right ๐Ÿ˜–

#

it feels to me like something within the hierarchy doesn't get "closed", or maybe gets closed too early. And it makes all the things that render after it have different behavior due to the predecessor still being open (or maybe closing to early?). I cannot find any actual evidence of that in the docstrings or rendered HTML though.

jaunty juniper
#

RTD uses a whole list of specific version numbers (that actually get contradicted by requirements.txt - at least the sphinx version) so I don't know what's going on

/home/docs/checkouts/readthedocs.org/user_builds/adafruit-circuitpython-adxl34x/envs/1.12.8/bin/python -m pip install --upgrade --no-cache-dir pillow mock==1.0.1 alabaster>=0.7,<0.8,!=0.7.5 commonmark==0.9.1 recommonmark==0.5.0 sphinx<2 sphinx-rtd-theme<0.5 readthedocs-sphinx-ext<2.3 jinja2<3.1.0
onyx hinge
#

@midnight ember is this something that actually happened? ```py
try:
pixels.fill((0, 0, 0))
except RuntimeError:
print("20***************************************************pixels.fill failed")

#

if something is failing that "should never fail" it might be a clue, or maybe it's a part that can be removed...

wraith crow
#

Could be the author wasn't seeing the neopixel turn off and added those statements in their effort to figure out why?

#

Although simple adding print statements seems like it would have done the job better....

#

and a runtime catch wouldn't make sense then.... nevermind ๐Ÿ™‚

onyx hinge
#

making better bug reports is something we can all improve at and it can really help maintainers. but it's also good to recognize that in our world, aside from being newer to reporting software issues, folks encountering problems might not be able to spare a whole device for testing, if they can find a workaround and get their project to "work".

crimson ferry
#

that's very true, there's a trade-off between investing some small time for a workaround vs. dedicating a device and more time to hunt down the root cause or isolate it with a small clean bit of code

onyx hinge
#

It looks like we need to find a different calendar viewer, the old one is gone. I think it was formerly on the heroku free tier which was recently removed.

#

if you know of a .ical viewer that operates as a web page, or an ical-to-html converter we could add to the meeting repo, let me know!

#

gotta make sure everyone sees that one

thorny jay
turbid radish
#

๐Ÿ˜Š

proven garnet
#

No problem!

tulip sleet
#

i marked the drafts by hand today, but look forward to tekktrik's automation!

proven garnet
#

Haha I was going to say this one wasn't me ๐Ÿ˜