#circuitpython-dev

1 messages ยท Page 8 of 1

small cypress
#

How much space would, let's just throw out a number, 30 errors having "http://adafru.it/aUa" for example, added to them, take?

tame creek
#

i mean if i felt really inspired i could write something like "argonblue's guide to annoying things about CircuitPython that i had to learn the hard way and are too difficult to search for", but maybe it would only be helpful to me

small cypress
#

Tbh this is probably the kind of stuff where I actually might be able to help out with CP. Aside from usually being reasonably good at writing clear explanatory things, I think I'm enough of a noob that it's not hard for me to imagine what might throw people, but also have just about enough knowledge to be able to possibly explain some of it.

tame creek
#

i'm also a CircuitPython n00b, but one with a couple of decades of software development experience, so i've Seen Some Thingsโ€ฆ

small cypress
ornate breach
manic glacierBOT
#

So, I agree that this should be more than ADC and also include DAC for other platforms. You also had suggested bufferedanalogio. I took a poll and it seems it reads better and is preferred over analogbufferedio. So I will be renaming the module to bufferedanalogio with BufferedIn with read() and BufferedOut with write(). Hope that agrees with most.

#

Did change the interface from readmultiple() to read(). I agree. if no arguments, then fill the buffer using buffer length. Otherwise use the argument checking to make sure the unsigned integer is no greater than buffer length. This should not affect speed or operations in most cases. Buffer initialization WILL BE left to user for max speed and flexibility.

jaunty juniper
#

by the way did you find the answer to that ? BLE is partially supported on ESP, but you can't create a service, which makes the most common uses (HID, UART, etc.) impossible, but it's possible to connect to an existing service, for example I connected a C3 to a Xiao sense, where the Xiao was a UART passthrough to the computer (for multiple other BLE boards) - it was a test, not a long lasting installation so I can't speak for stability. I also have tested today adafruit_ble_radio to broadcast messages between a Xiao, a QTPY C3 and a Feather S3.

small cypress
#

They were pretty disappointed, kinda think the product pages for S3 boards could do with noting this and the deep sleep bug

hidden rain
#

Build Doc: Build and Valudate Stubs failed. Filename but no line number. Is there a way to resolve this?

manic glacierBOT
manic glacierBOT
orchid basinBOT
onyx hinge
#

Good morning sleeping Circuitpythonistas! Remember, there's no meeting today -- it's a US holiday. We'll see you tomorrow at the usual time.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.0-30-g14498f793 on 2022-09-04; Waveshare ESP32-S2-Pico with ESP32S2

It's a build from adafruit-circuit-python.s3.amazonaws.com

Code/REPL

import wifi
a = wifi.radio.start_scanning_networks()
for i in a: print(str(i.ssid))
wifi.radio.stop_scanning_networks()
del wifi

Behavior

On first boot:

![image](https://user-images.githubusercontent.com/21365918/188457440-e832af7b-004b-46b8-836a-...

manic glacierBOT
onyx hinge
#

analogbuffalo

stuck elbow
#

the vampire slayer

hidden rain
#

Funny. Engineers are horrible at naming things, but I appreciate all the attempts (cause i'm horrible too).

orchid basinBOT
digital shoreBOT
hidden rain
#

@tulip sleet: I have made all the suggested changes to #6757 and renamed the module, re-tested, and pushed. Just FYI.

tulip sleet
hidden rain
#

Thanks.. I still have some work flow issues anyway

manic glacierBOT
#

Can you test with 8.0.0-beta.0 to rule out some quirk in that daily build?

With Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; Adafruit QT Py ESP32S2 with ESP32S2, this code.py runs continously with good, full AP results:

import time
import supervisor
import wifi

def scan_wifi():
    for network in wifi.radio.start_scanning_networks():
        print("{0:02X}:{1:02X}:{2:02X}:{3:02X}:{4:02X}:{5:02X}".format(*network.bssid), end=" ")
        print("{:>2d}".format(net...
manic glacierBOT
#

For some Espressif Feather boards, reduce power during rel deep sleep by disabling NeoPixel and/or I2C power pins with a pull-down instead of a pull-up. This reduces deep sleep consumption from about 480 uA to about 75 uA.

More could be done on TFT boards, which don't have this. I think maybe we need to pass a deep_sleep boolean to board_deinit() for these boards so we don't disable the display during fake deep sleep.

manic glacierBOT
manic glacierBOT
#

Lack of .env, or of any valid Station or AP, should not be a problem. Scanning is independent of Station and AP. I wonder if the box material is attenuating wifi signals, but it's still hard to explain why it would only receive on the first try. Can you test it outside of the box, and also closer to some other APs? Do you have another (perhaps different) device you can try inside the box?

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Hi! This is probably memory fragmentation. Try following this advice, from https://learn.adafruit.com/circuitpython-essentials/circuitpython-mp3-audio:

Because creating an MP3Decoder object takes a lot of memory, it's best to do this just once when your program starts, and then update the .file property of the MP3Decoder when you want to play a different file. Otherwise, you may encounter the dreaded MemoryError.

#

.. and from the same guide page here's the "official" way to play multiple MP3 files sequentially. as far as I know, this can play dozens and dozens of files without encountering MemoryError (I've left it playing an album on repeat overnight):

# You have to specify some mp3 file when creating the decoder
mp3 = open(mp3files[0], "rb")
decoder = MP3Decoder(mp3)
audio = AudioOut(board.A0)

while True:
    for filename in mp3files:
        # Updating the .file property of the e...
crimson ferry
#

web workflow: URLs like curl -v -L http://circuitpython.local/cp/devices.json redirects to the hostname, but because of the added integer that is often appended by [something in] the network: Could not resolve host. Is it possible for the CP device itself determine its actual network hostname and fix the redirect URL? Other deices do get the full network mDNS hostname with server.find.

tulip sleet
crimson ferry
#

I will write one

manic glacierBOT
manic glacierBOT
#

Oh nice. Yeah, I may take a look at the code. I was looking at the f_rename() function last week, but with trying to add a fix, I was starting to feel a bit out of my depth, so I put it aside.

However, I think I'm familiar enough and comfortable enough with the current Web Workflow code that I could probably see if changing to fat_vfs_rename() would just work or if it would with minor modifications and make those modification.

#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; Adafruit QT Py ESP32S2 with ESP32S2

Code/REPL

# From another device on the network, augmented names are found:
m = mdns.Server(wifi.radio)
for service in m.find(service_type="_circuitpython", protocol="_tcp", timeout=5):
    print(f"{all_the_things}")

"""
Adafruit QT Py ESP32S2-5
cpy-f66961-281.local
192.168.6.180:80
"""

# This does not work:
# curl -v -L http://cpy-f6696...
jaunty juniper
crimson ferry
#

Espressif?

jaunty juniper
#

plus I think that internally it only recognizes the base name, so the "origin" test will fail anyway

crimson ferry
#

it seems awfully similar to the age-old iPhone (3) or MacBookPro (2) issue.

#

what is the "origin test"?

jaunty juniper
#

it tests the request's origin to allow or not

crimson ferry
#

by IP address works, so the links and redirects could use that

jaunty juniper
#

yeah I use the IP in the app and completely ignore the name, but redirections don't do that

onyx hinge
#

<@&356864093652516868> Hey! I know it's Tuesday but I'm hosting the weekly meeting in Discord today in the Circuitpython voice channel and the #circuitpython-dev text channel at the usual time of 2PM ET / 11PM PT. Please add your note to the document, and also let me know if you need me to read them out for you: https://docs.google.com/document/d/1PUjxzPDp0X9ACzeeiRug8NznRZA8ku0l5pPHi69UP7U/edit?usp=sharing

We're happy to have any and all join us! If you want to start by just listening in, that's great. When you decide you'd like to give your own status updates or hug reports, ask to be added to the <@&356864093652516868> role so that you can speak in the voice channel.

hidden rain
#

I am getting a "Build-Doc: Failed to parse Python stub" in my C-code. But no indication of which line is troublesome. Is there a method to find out?

idle owl
#

I imagine it's not a line-specific issue, that there's something that needs to be done before building the docs, or it's a hiccup. I don't know, however, so someone more familiar will need to reply.

manic glacierBOT
blissful pollen
tulip sleet
hidden rain
#

just did. its the same as in the report. it seems to complain about something never touched...(at least I dont thinkso)

tulip sleet
#

can you paste the error msgs here including the reference file?

#

or I can look in the PR build, I realized, hold on

hidden rain
#

circuitpython-stubs/alarm/init.pyi
[ERROR] Failed to parse a Python stub from shared-bindings/analogbufio/BufferedIn.c
Traceback (most recent call last):
File "/home/latkinso42/research/circuitpython/tools/extract_pyi.py", line 189, in convert_folder
tree = ast.parse(fragment)
File "/usr/lib/python3.10/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "<unknown>", line 34
...
^
IndentationError: unindent does not match any outer indentation level

tulip sleet
# hidden rain circuitpython-stubs/alarm/__init__.pyi [ERROR] Failed to parse a Python stub fro...
//| class BufferedIn:
//|     """Capture multiple analog voltage levels to the supplied buffer"""
//|
//|     def __init__(self, pin: microcontroller.Pin, buffer: WriteableBuffer, *, sample_rate: int = 500000) -> None:
//|       ...
//|
//|     def deinit(self) -> None:
//|         """Shut down the `BufferedIn` and release the pin for other use."""
//|         ...
//|
//|     def __exit__(self) -> None:
//|         ...
//|     
//|     def read(self) -> None:
//|         """Fills the provided buffer with ADC voltage values."""
//|
#

There is a missing ... for read(self). Also the indentation for the ... for __init__() does not match the others. (That's probably not an error but it should be consistent.

hidden rain
#

gotcha. never had to debug documentation before. Learning something new here...

#

Thanks.

tulip sleet
#

test with make html before you push to save time. Also note there was a pre-commit error in the PR (C indentation, it looks like)

hidden rain
#

yeah.I uninstalled pre-commit due to env issues. Guess I will have to resolve them ..eventually.

idle owl
#

I remember thinking of this at the end of last week, and it popped into my head again. Limor had me do a microcontroller.reset() in both places in my code that have error catching. I had used sleep_memory to increment an "error count". Does sleep_memory persist through microcontroller.reset()? Or is the error tracking now superfluous.

#

I know it persists through sleep, which was the plan for it initially.

crimson ferry
#

@idle owl sleep_memory does not persist through a reset (microcontroller.reset() or reset button) or power cycle

idle owl
#

Thanks! I need to update my code. ๐Ÿ˜„

crimson ferry
#

you can try supervisor.reload()... sleep_memory will persist, but reload may not recover from more severe issues

idle owl
#

It's not severe issues.... it's WiFi or Adafruit IO not connecting errors. try/except to keep the code running, but instead of hoping the try/except is enough, include a reset.

#

supervisor.reload() might be enough there?

crimson ferry
#

maybe, I usually try reload before reset

idle owl
#

Ok. I haven't managed to hit either in a long time.

crimson ferry
#

(I keep a reload count, then if it doesn't recover after so many reloads, then I reset)

manic glacierBOT
#

fixes #6870 by sending an empty second frame if write_color_ram_command is specified but no highlight_color or grayscale is given.

Demonstration: https://twitter.com/pepijndevos/status/1567198891887529986

FYI an actual driver for PervasiveDisplays panels lives here, feel free to adapt if you ever want to support these displays in some Adafruit product.

https://github.com/pepijndevos/mapseflaps/blob/d9c1d9ff485b7df8da765d193d6b1c99783c8e95/render_displayio.py#L26-L59

idle owl
#

Ohhhhhhh.

#

Neat.

#

How do you get the reload count?

crimson ferry
#

just a variable in sleep_memory

idle owl
#

Nice ok

crimson ferry
#

a byte valiue

idle owl
#

Oh. Hmm.

#

I'd need help with that.

blissful pollen
idle owl
#

It's still using sleep memory.

#

To keep track of metadata basically.

#

wake count, send count and error count.

crimson ferry
#

something like```py
alarm.sleep_memory[2] += 1
print(f"reload #{alarm.sleep_memory[2]}")
if alarm.sleep_memory[2] > 5:
print("โš ๏ธ Too many reloads: resetting... โš ๏ธ")
# reset will clear alarm.sleep_memory
microcontroller.reset()

idle owl
#

Oh! Ok. That's not bad.

#

You said "byte" and I assumed gnarly. ๐Ÿ˜„

crimson ferry
#

there may be a more pretty way, but I just keep a few values in there to track things across the boot.py-to-code.py divide (w/o having to write to boot_out.txt) and across reloads

modern wing
#

Happily lurking for today's meeting ๐Ÿ•ต๏ธ

thorny jay
gilded cradle
idle owl
random junco
#

jepler: Martha Wells shared she finished a new Murderbot novella, thought of you. ๐ŸŽ‰

gilded cradle
idle owl
#

Good enough ๐Ÿ™‚

crimson ferry
#

different sizes of nvm, but not an issue for just a byte or three

gilded cradle
#

right

idle owl
#

Nice

blissful pollen
#

Probably missing all of todayโ€™s meeting. No real notes to add that I can think of, group hug to all

idle owl
#

That's what I have written down.

onyx hinge
#

@tulip sleet joining us soon?

tulip sleet
#

@onyx hinge sure I will do core

random junco
#

I even waited to paste that 2nd one!

idle owl
#

Sorry about that.

random junco
#

It's ok, there's a good reason

proven garnet
#

Thank ye kindly

#

๐Ÿ˜

modern wing
#

๐Ÿ”จ ๐Ÿชš ๐Ÿš๏ธ ๐Ÿšง

idle owl
#

๐ŸŽ‰ Congrats, @gilded cradle

gilded cradle
idle owl
#

@random junco The voice channel has been created - please let me know if you run into permissions issues. It looks right!

modern wing
#

Thanks!

gilded cradle
#

Thank you everyone

proven garnet
#

Thanks!

errant grail
#

Thanks!

idle owl
# random junco Thanks!

As in, maybe make time with someone to test it during the week, to make sure you can do voice and video, etc. So I can fix things if they're not right. ๐Ÿ˜„

manic glacierBOT
#

PervasiveDisplay panels support a fast update mode, which requires that the first frame contains the old display data, and the second frame contains the new display data: https://docs.pervasivedisplays.com/epd-usage/epd-driving-sequence/small-epds/fast-update/ssf-upload-image-data/dtm1-and-dtm2-registers

I'm not sure if this is an easy change or a major overhaul. It'd basically require to double-buffer the whole display I think?

If the 128 u32 buffer fitted the entire screen, it'd b...

idle owl
manic glacierBOT
crimson ferry
#

@idle owl I didn't show the part where that block is inside some code that detects that the current run was a reload (e.g., using supervisor.runtime.run_reason is not supervisor.RunReason.STARTUP)

idle owl
#

Ohhhh

#

That makes more sense.

#

I think.

minor plume
#

Apologies, everyone, for missing the weekly meeting today. I got caught up in a work emergency. Never fun when something blows up after a holiday weekend. ๐Ÿ˜ฆ

crimson ferry
#

probably at the top: detect that this is a reload and not a reset, increment the reload count, then if it's too high (not fixing the issue presumably), then reset

idle owl
idle owl
#

Thanks!

minor plume
minor plume
# idle owl Good step then!

I do want to slap the person who decided that 430pm on the Friday of a holiday weekend was a good time to push an untested code update to production (bypassing our QA environment), but thatโ€™s a whole other rant. ๐Ÿคช๐Ÿคฆโ€โ™€๏ธ

idle owl
#

@crimson ferry I got it to work! It wasn't at first but then I realised I was already using alarm.sleep_memory[2] for something else. Changed it to [3] and now it's working as expected. Thank you!

idle owl
#

@crimson ferry OK, the code seems to work. Can you take a look at the snippet and tell me if I commented it correctly? e.g. Do I actually understand what's going on... Because I have to explain it in the guide.

crimson ferry
#

sure... where's the snippet?

idle owl
#

Oof I copied something else since that. Hold on.

#
# If the reason the board started up is not the standard CircuitPython start up...
if supervisor.runtime.run_reason is not supervisor.RunReason.STARTUP:
    alarm.sleep_memory[3] += 1  # Increment reload number by 1.
    print(f"Reload number {alarm.sleep_memory[3]}")  # Print current reload number.
    if alarm.sleep_memory[3] > 5:  # If reload number exceeds 5...
        # Print the following...
        print("Reload not resolving the issue. \nBoard will hard reset in 20 seconds. ")
        time.sleep(20)  # ...wait 20 seconds...
        microcontroller.reset()  # ...and hard reset the board. This will clear alarm.sleep_memory.```
crimson ferry
#

yup, that describes it, maybe specifically mention "standard CircuitPython start up" is a reset (rather than reload)

idle owl
#

Ah ok. Yep.

crimson ferry
#

it seems to me that reset vs. reload are terms beginners need to grok

idle owl
#

Agreed, at this point. I'll try to include mention in the guide that can be pointed to later.

#

Or we should add it to the Welcome guide somewhere.

#

FAQ probably.

#

Added reset-type after CircuitPython in that first comment.

#

And will clarify in the guide.

crimson ferry
#

sounds good, it's a little bit of complexity to have a two-tier reload then reset, but: it allows sleep_memory use on a higher frequency than someone may want to use on nvm; it probably cures many many ills not needing a full reset (ejecting and breaking off serial console, etc.)

idle owl
#

Thanks again for your help!

hidden rain
#

Fighting with pre-commit. It expects version 3.10.4.final.0 for some reason. danh worked on this with suggestions, but i've tried many things now and it still presents. My current python is Python 3.10.4 .. the final.0 part isn't part of the install.

#

FIting==Fighting

proven garnet
#

If anyone has a moment, this PR fixes a botched PyPI release due to a faulty pyproject.toml - the upload on PyPI is currently not working. Not sure how extensively it's used so just wanted to bring it up:

#

I guess my script thought it should have been packages - I think I got the rest correct during the transition, but I guess something to keep in mind if there are other reports of dud installations.

idle owl
#

TFW you forget to run Pylint, but it passes in the PR anyway. ๐Ÿ˜…

idle owl
#

@crimson ferry Oof, another question. When my code stops running, and the board is "reloaded", the serial console shows "soft reboot". Is "reboot" synonymous with "reload"? Should that serial message be changed to "soft reload"? Or is a "soft reboot" something different from both a reload and a reset? (Working on quickly explaining the difference in this guide, and realised it was using a different term.)

#

Will probably want someone to proof this explanation in the guide before I ship it.

crimson ferry
idle owl
#

Ok... checking those links now.

#

Hmm, ok, fair enough

#

So reboot/reload in terms of "soft reboot" are probably synonymous then? Seems like it.

#

I won't get into the gritty of it, but I'll include that the "soft reboot" in the serial console is like a reload.

#

Anyone who knows, please let me know if this is a valid explanation. ```You may have noticed that the actions "reload" and "reset" are both mentioned above. It's important to understand the difference.

A reload is what happens when you hit CTRL+D from the REPL, as well as when the board reloads and the serial console shows a "soft reboot" before beginning to run your code again. It is also what happens when you call supervisor.reload() in your code, as shown above. Data stored in alarm.sleep_memory will persist through a reload.

A reset is what happens when you press the reset button on your board. It can also happen automatically for a variety of reasons, including a low voltage brown out or a watchdog timer. It is what happens when you call microcontroller.reset() in your code, as shown above. Data stored in alarm.sleep_memory will not persist through a reset.```

#

(TFW you're staring at the screen waiting for a response, and realise you never sent the message. ๐Ÿคฆ๐Ÿปโ€โ™€๏ธ )

blissful pollen
#

It reads okay to me. I'm assuming you really want to concentrate about the status of sleep memory, as there are a few other things that could differ.

idle owl
#

We can do a more thorough explanation in the Welcome guide FAQ eventually.

blissful pollen
#

I wonder if its worth bolding the last line in each paragraph, or something to just really emphasize that point. But the wording reads fine to me

idle owl
#

I like that. I bolded "will" and "not", but the whole sentence is probably better. I'll italics those two words.

#

It had formatting, but it wouldn't have shown up here anyway, so I used code formatting.

blissful pollen
#

Yup figured as much. Hopefully that helps at least really call attention to it. I still fall back to the "I dunno what is going on so pull the power" reset sometimes

idle owl
#

That's what I had originally

#

but it made my error tracking useless.

#

Because they were tracked in sleep_memory

#

So I made the code more complicated to keep my data ๐Ÿ˜„

blissful pollen
#

haha also works. I had a "reset reason" adafruit io feed for a long time to try to track down reasons things were not working

proven garnet
idle owl
#

Wait, no. Not for this. It wouldn't have been obvious enough.

blissful pollen
idle owl
#

Hah! Aww. Good call on nice to have. I feel like it's not needed here though. Might have been too much.

#

Mostly because it doesn't make it clear what happened in the code, necessarily.

#

Which is what I'm trying to do I guess.

#

Hmph. Could have tracked Adafruit IO and WiFi errors on separate feeds. That would have been ultra clear.

blissful pollen
#

The only issue is when you have wifi issues and you cannot log an error with adafruit io

idle owl
#

Oh riiiiight.

#

Good call.

#

I'll stop tweaking this and call it done. ๐Ÿ˜„

dusk gull
#

I am looking at some use cases for OTA type of updates where the UF2 file is transferred into fileystem and then update on a reset or bootloader call.

#

I am having trouble finding a method that does not still require the UF2 to be moved on to the mounted drive preventing the self update processes when it is firmware and not just application software.

proven garnet
#

Oh hey, dependabot might fix that compatibility release issue!

dusk gull
#

It seems the ability to pass a file reference when saying on next reset use the bootloader mode. Similar to MBOOT with Micropython

jaunty juniper
#

or do you just want to update Circuitpython ?

dusk gull
jaunty juniper
#

unless you write some python code to translate the UF2

#

which wouldn't be too hard I assume, it has a spec and it's made for that

dusk gull
jaunty juniper
#

the UF2 bootloader is a firmware that simulates a USB drive and reads the UF2 file dropped on it, which contains instructions on what and where to write things. As fas I know, it doesn't write to the other bank since it's run when connected to the PC and doesn't need to be able to recover

#

like the Circuitpython UF2 is just telling it to write the CP binary to the OTA0 partition

#

I don't know what you mean by sharing filesystems

#

what you want is just read the bin and use the dualbank module

dusk gull
#

Thanks @jaunty juniper this is really helpful.
My meaning is that lets say in Micropython there is a singular filesystem. But Circuitpython at least makes it appear like there is one user filesystem, and the bootloader fileystem. But it sounds like it is a simulated

jaunty juniper
#

no as I said there is no filesystem in tinyuf2

#

it's just receiving the file dropped as if it were a serial communication sending data

#

my understanding is that since USB MSC works at the block level, the UF2 file format is made so that each 512B block contains binary data and instructions on where to write it, so that it works even if sent in a random order

dusk gull
#

Makes sense, but at first glance it felt like two. Sorry for the misunderstanding. So typical usage is the OTA0 partition when using UF2 based updates, and if I utilize the dualbank module I can manually pick which bank, and use a bin file to update on or the other...

jaunty juniper
#

I think the module will only write to the other bank, the one you are not running on

#

and in theory if you write something non-CP while in CP, then switch, and you switch back from the other without writing anything you would get back to CP

#

or write another version of CP and then decide to reboot back to the previous one

dusk gull
#

Thanks, based on reading that is what I would assume as well

jaunty juniper
#

that's actually funny, considering sometimes people ask if we can run Arduino and CP at the same time, technically you could write some Arduino code on the other bank and reboot between them

#

(maybe not, I don't know the intricacies)

dusk gull
#

One of the developers I am working with was asking about switching between C and CP so I totally understand, so it is funny timing because that was before I realize dualbank was implemented in circuipython

#

@jaunty juniper This is super helpful, I was not aware of the module and was busy chasing bootloader modes and how to manage that. This appears to fit my use-case well

jaunty juniper
#

it eats up quite a lot of flash, so believe me it is implemented ๐Ÿ˜‰

manic glacierBOT
hidden rain
#

Any one using Python 3.10.6 instead of 3.10.4 for builds?

onyx hinge
#

@hidden rain I just ran a test in docker similar to #circuitpython-dev message in ubuntu:kinetic which has python 3.10.6 as the official ubuntu python3.10 package and it also succeeded. ```python3.10 --version
Python 3.10.6

On all my systems I simply run the python that is shipped with the operating system (I prefer to use debian stable while I think dan uses ubuntu lts). You mentioned using a "deadsnakes" ppa back on 8/27. If you haven't resolved this and gone back to the standard operating system package of python, I think it's probably still the root of your problems; or at least, it's a very clear difference between the systems that work (mine, dan's, our CI system and my docker-based tests) and your system.
#

If you have the ability to try out a fresh virtual system without installing a non-standard python or any ppas I suggest you give that a whirl; it's unfortunate if you have a broken linux installation but sometimes it's just par for the course and on the balance it may be rational to discard it and use a fresh system instead.

hidden rain
onyx hinge
#

OK, what steps do you use on ubuntu 22.04 with python 3.10.4 to see that there's a "broken virtualenv"?

#

(and what message do you get)

hidden rain
#

Well, when I ran pre-commit it complained about it not being 3.10.4.final.0. I looked the issue up on pre-commit github and the main developer kept refering to links having a solution.. but I got lost

onyx hinge
#

(I should make an addendum to what I stated above about our CI system; it does NOT use OS python packages so it is not a good test)

hidden rain
#

Oh I did have to use python-is-python3

onyx hinge
#

that's an operating system package so it "should be fine"

hidden rain
#

otherwise I used what came with Ubuntu 22.04

#

SHould I try Python 3.10.6?

onyx hinge
#

No.

hidden rain
#

ok... just re-install pre-commit from the top the in the repo

#

???

onyx hinge
#

I don't necessarily know what you should do. I'm trying to gather information about what commands you are running and what output you're observing, so I can try to reproduce and understand your problem

hidden rain
#

ah...

#

search back on this thread earlier today...

hidden rain
#

File "/home/latkinso42/.local/lib/python3.10/site-packages/pre_commit/repository.py", line 84, in _hook_install
raise AssertionError(
AssertionError: BUG: expected environment for python to be healthy immediately after install, please open an issue describing your environment

more info:

virtualenv python version did not match created version:

  • actual version: <<error retrieving version from /home/latkinso42/.cache/pre-commit/repogpa7707b/py_env-python3/bin/python>>
  • expected version: 3.10.4.final.0
onyx hinge
#

Try "pre-commit clean" then "pre-commit run" again.

hidden rain
#

yes.. I did that... no luck ๐Ÿ˜ฆ

onyx hinge
#

OK, let's see if virtualenv itself is happy when not used via pre-commit. virtualenv .venv; .venv/bin/python3.10 --version

#

When you created your fresh system did you copy any files (e.g., in your home directory) from another system?

#

my system happens to give me a different virtualenv path but it works when I directly run the python executable inside: ```~/.cache/pre-commit/repo1wj1vf0l/py_env-python3/bin/python --version
Python 3.10.4

#

how did you install pip and virtualenv? I installed from apt with `apt install python3-pip and python3-virtualenv, but I'm aware the internet gives different advice about this.

hidden rain
#

.venv/bin/python3.10 --version no such file....

#

no copy of files from other systems

onyx hinge
#

OK, then I agree your "virtualenv" command is broken.

hidden rain
#

no idea how to fix... it came this way

onyx hinge
#

how did you install pip and virtualenv? I installed from apt with `apt install python3-pip and python3-virtualenv, but I'm aware the internet gives different advice about this.

#

and what's virtualenv --version say?

hidden rain
#

20.16.3

onyx hinge
#

I have success with both the one from python3-virtualenv (which reports virtualenv 20.13.0+ds from /usr/lib/python3/dist-packages/virtualenv/__init__.py) and the one from pip install virtualenv (which says virtualenv 20.16.4 from /home/jepler/.local/lib/python3.10/site-packages/virtualenv/__init__.py)

jaunty juniper
#

is virtualenv the same as python -m venv ?

onyx hinge
#

well, OK, maybe it's a bit joke but no they're different

hidden rain
#

let me look at my history

#

ok.. not in my history as explicite. must have been a side effect or it came with Ubuntu 22.04

jaunty juniper
#

@onyx hinge so there's a bug reporting the wrong error with format that is fixed in latest MP, is it worth opening an issue on our side ?

onyx hinge
#

@jaunty juniper If you think it'd be important to fix in 8.x.x; otherwise, as part of 9 we anticipate getting all fixes from MP by merging a future release.

#

@hidden rain can you please show the full output of virtualenv --version?

hidden rain
#

virtualenv 20.16.3 from /home/latkinso42/.local/lib/python3.10/site-packages/virtualenv/init.py

onyx hinge
#

OK this time I have reproduced the problem

#
vvirtualenv 20.16.3 from /home/jepler/.local/lib/python3.9/site-packages/virtualenv/__init__.py
ijepler@bert:~/src/circuitpython$ virtualenv --clear .venv; .venv/bin/python3.10--version
created virtual environment CPython3.9.2.final.0-64 in 213ms
  creator CPython3Posix(dest=/home/jepler/src/circuitpython/.venv, clear=True, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/jepler/.local/share/virtualenv)
    added seed packages: pip==22.2.2, setuptools==63.4.1, wheel==0.37.1
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
bash: .venv/bin/python3.10: No such file or directory
hidden rain
#

well..at least I dont feel so alone...

onyx hinge
#

er no, I haven't. I went back to my desktop system, not my docker, which has 3.9. headdesk

hidden rain
#

Sigh

onyx hinge
#

no, the slightly lower version is not the cause. Back in the right environment, ```jepler@92e02290abdb:~$ virtualenv --version
virtualenv 20.16.3 from /home/jepler/.local/lib/python3.10/site-packages/virtualenv/init.py
jepler@92e02290abdb:~$ virtualenv --clear .venv; .venv/bin/python --version
created virtual environment CPython3.10.4.final.0-64 in 111ms
creator CPython3Posix(dest=/home/jepler/.venv, clear=True, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/jepler/.local/share/virtualenv)
added seed packages: pip==22.2.2, setuptools==63.4.1, wheel==0.37.1
activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
Python 3.10.4

#

OK how about the full output of virtualenv -vv --clear .venv

hidden rain
#

wow..its rather large

onyx hinge
#

save to a .txt and attach then

#

the output is long enough that discord rejects it, I guess. It used to offer to auto-convert to a .txt attachment but I guess not anymore

jaunty juniper
#

ah forget it, it was already reported (I even commented on it...) and you fixed it in MP ๐Ÿ˜„

hidden rain
onyx hinge
#

"executable": "/home/latkinso42/research/circuitpython/.venv/local/bin/python", OK so as others have seen in related issues on the internet, virtualenv is improperly placing the Python executable within the environment, but it still doesn't answer why

#

Please show the full output of export | grep local

hidden rain
#

export | grep local
declare -x PATH="/home/latkinso42/.local/bin:/home/latkinso42/Installs/gcc-arm-none-eabi-10-2020-q4-major/bin:/home/latkinso42/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin"
declare -x SESSION_MANAGER="local/MST-Ubuntu64:@/tmp/.ICE-unix/1002,unix/MST-Ubuntu64:/tmp/.ICE-unix/1002"
declare -x XDG_DATA_DIRS="/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop"

onyx hinge
#

OK maybe this time I really reproduced it

#

When I did this, my virtualenv test started failing: pip install -U setuptools

hidden rain
#

??.. you would like me to execute that last part?

onyx hinge
#

no

hidden rain
#

oh.. its what tipped you off that things were failing

#

ok

onyx hinge
#

OK, I want you to try removing setuptools installed via pip: pip uninstall setuptools and then ensuring it's installed via apt: apt install python3-setuptools

#
setuptools   59.6.0
```You should end up with version 59.6.0
hidden rain
#

should i use sudo, its locked

onyx hinge
#

yes for apt command you would need to use sudo

hidden rain
#

pip list | grep setuptools
setuptools 59.6.0
setuptools-scm 7.0.5

onyx hinge
#

OK then back up and try virtualenv -vv --clear .venv; .venv/bin/python3.10 --version

#

I mean, try it next

#

it's just a command you ran before

#

It's late o'clock here, so I'm going to head out.

hidden rain
#

Thanks for all your help...I will resume Tomorrow

onyx hinge
#

looks like it might be "fixed", I'd try pre-commit clear / pre-commit run again

proven garnet
#

Looking at cleaning up the typing for adafruit_requests and it looks like it should just be updated to remove CircuitPython 6.0 features. Along those lines, it looks like set_socket() was depreciated in favor of instancing a Session, and while that could be removed, plenty of examples (and probably Learn Guides use that method. Is it worth removing set_socket() and doing clean up, or keeping it in. For reference, a GitHub search under adafruit org had 85 hits for set_socket usages in the Code category.

#

Happy to take that on, but not sure if it's worth it. I don't think it needs to be removed for any reason, just that it could (ignoring breaking legacy code).

#

I guess it then also means changing the handful of other libraries that work with it (e.g. - adafruit_esp32spi)

manic glacierBOT
crimson ferry
#

@proven garnet my understanding is that Requests supports two incompatible workflows: esp32spi and espressif native. It may be quite complex to consolidate them without side effects in tons of user code. The NINA firmware code exposed by esp32spi is based on Arduino wifi code, and isn't typical socket code like we see in CPython, WIZnet, or espressif port of CircuitPython.

tulip sleet
#

@proven garnet @crimson ferry I started some branches to update and remove things in adafruit_requests (partly as part of adding async support) and improving the error exceptions, but did not finish it yet.
https://github.com/adafruit/Adafruit_CircuitPython_Requests/compare/main...dhalbert:Adafruit_CircuitPython_Requests:async
https://github.com/adafruit/Adafruit_CircuitPython_Requests/compare/main...dhalbert:Adafruit_CircuitPython_Requests:change-exceptions (I think some of this was done already in another PR)
Also in ESP32SPI:
https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/pull/167 (This is on hold because a change breaks some examples)

small cypress
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.3.1 on 2022-06-22; Adafruit Feather ESP32S2 with ESP32S2

Code/REPL

import time, wifi, ipaddress
from secrets import secrets

ssid = secrets["ssid"]
password = secrets["password"]

wifi.radio.connect(ssid, password)
timer_A=0
ping_addr = ipaddress.ip_address('8.8.8.8')

while True:

    ping = wifi.radio.ping(ping_addr, timeout=1)
    print(f'{ping=}')
    time.sleep(0.2)

Behavior

p...
manic glacierBOT
proven garnet
proven garnet
#

I think I'll hold off on working on type annotation clean up for those for a bit - the main issue is that it's a bunch of Protocols intricately arranged, and I suspect once requests and other libraries potentially change those will simplify a lot. Part of the typing is just handling 6.0.0 things.

hidden rain
#

ALL: Still getting miscellaneous build issues after a push; Is there a way to test out on my local system first? I understand than make translate, make html and pre-commit should cover most issues. Are there other actions that might show failures locally? Also I am confused by some of these weird build actions that do not seem relevant to anything I coded. Otherwise very close! Advice?

onyx hinge
#

@tulip sleet I don't know if you read the scrollback last night but I think I got to the root of lee's problems running pre-commit. current setuptools is incompatible with debian's python, and everybody's been finger-pointing about it for months. There are two workarounds, to set an environment variable or to uninstall setuptools updates and use the debian/ubuntu package version. https://github.com/pypa/virtualenv/issues/2350 https://github.com/pypa/setuptools/issues/3278

tulip sleet
tulip sleet
onyx hinge
#
setuptools   65.3.0
```If this is above 60, and you're on an ubuntu/debian system, then I think pre-commit won't work
#

The command to run locally would probably be pre-commit run --all so that it checks all files. By default it only checks modified files that are not yet committed.

#

also I would nix the extra emphasis punctuation in this message: ``` +msgid "%q must be a bytearray or array of type 'h', 'H', 'b' or 'B'"

hidden rain
hidden rain
onyx hinge
#

pre-commit run --all.

onyx hinge
hidden rain
#

ok.. it failed; had to perform a 'make translate'; then it passed! Yeah!

#

I suppose I need to make an inert change, make html, make translate, pre-commit run --all, then commit, then a push. Will that flush out all the gremlins?

onyx hinge
#

I can't promise all gremlins will be flushed

#

but yes you need to run pre-commit --all, which will tell you about problems and auto-correct some of them. Once it reports no problems, and other checks you know how to make (make html, make translate) work without error, you can commit and push.

#

if you "pre-commit install" then it will automatically run on the files being committed, just a reminder since before now you haven't been able to run pre-commit at all and probably have it disabled and may have forgotten about it

manic glacierBOT
#

Is it possible to create an HTTPS webserver on the ESP32 with this implementation? It looks like the ESP32 is capable of this. Here is the example provided : https://github.com/espressif/esp-idf/blob/36f49f361c001b49c538364056bc5d2d04c6f321/examples/protocols/https_server/simple/main/main.c

There is this reference to SSL Certifications + WSGI server but this isn't exactly the same : http://eventlet.net/doc/modules/wsgi.html#ssl

tulip sleet
#

@onyx hinge which do you think is the easier to do/explain for the pre-commit fix: the env variable or use apt instead of pip setuptools?

onyx hinge
#

I'm not sure! For the env variable you have to explain putting it in bashrc, for the apt setuptools it could be wrecked at any moment by pip installing something that requires a newer setuptools

#

and besides that I think that long term setuptools doesn't plan to support the scheme that the environment variable enables, it's a legacy thing they want to remove as far as I understand it

tulip sleet
#

which tool is ultimately responsible for the actual fix for this: is it that Python needs to get repackaged, or setuptools, or something else?

onyx hinge
#

ideally virtualenv would change so that it creates .venv/bin/python and .venv/bin/activate regardless, because other tooling as well as humans expect that

tulip sleet
#

pre-commit says it doesn't want to use venv instead of virtualenv because venv is not avail everywhere

onyx hinge
tulip sleet
#

yes, that was my impression too -- nobody seems to be moving toward a solution

onyx hinge
#

virtualenv seems like it could make a small and pragmatic change and get a LOT of people back on track by doing so

#

OR they need to clearly document the proper method for finding the python executable within the venv and that ".venv/bin/python" isn't it. (apparently Windows is .venv/Scripts/python or something, so it's already not exactly the contract they have with consumers)

tulip sleet
#

so I think I will document the .bashrc / .bash_aliases fix, as it seems to be the simplest. I could look back but do you have the setting at your fingertips? I saw it in some issue thread.

#

(I put everything in .bash_aliases so I don't have to modify .bashrc)

onyx hinge
#

let me find it again

#

export SETUPTOOLS_USE_DISTUTILS=stdlib

#

huh I didn't know about .bash_aliases

tulip sleet
#

This is in the default .bashrc near the end:

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi
onyx hinge
#
======================

Setuptools and the PyPA have a `stated goal <https://github.com/pypa/packaging-problems/issues/127>`_ to make Setuptools the reference API for distutils.

Since the 60.0.0 release, Setuptools includes a local, vendored copy of distutils (from late copies of CPython) that is enabled by default. To disable the use of this copy of distutils when invoking setuptools, set the environment variable:

    SETUPTOOLS_USE_DISTUTILS=stdlib
```It's considered deprecated to do this per setuptools docs
tulip sleet
#

does SETUPTOOLS_USE_DISTUTILS need to be set when you install pre-commit or just when you use it?

#

sounds like the former??

onyx hinge
#

It has to be set when the virtualenv is created

#

I think that'd be the first time you "pre-commit run"

tulip sleet
#

so when doing pre-commit install

#

ah, ok, maybe not much happens for pre-commit install

tidal kiln
tulip sleet
tidal kiln
#

ok. asked for code.

tulip sleet
manic glacierBOT
#

When entering deep sleep, the user may want to set certain pins to be in a particular state. For example the I2C-power pin on a Feather ESP32-S2 might beenabled to, say, allow an external sensor to run during deep sleep, or disabled to minimize sleep power.

Discussion with @ladyada yielded the idea of passing a list of DigitalInOut's to alarm.exit_and_deep_sleep(). The state of those pins would be preserved.

Subject to refinement as implementation progresses.

manic glacierBOT
onyx hinge
#

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

manic glacierBOT
hidden rain
proven garnet
#

@idle owl I figured out the adabot issue with the Library Infrastructures page, unsurprisingly it was me

#

I submitted a PR for it, just a heads up! 7th time's the charm!

hidden rain
#

Does on normally pressed the "Resolve Conversation" button on every sub-issue?

tulip sleet
hidden rain
#

Gotcha

onyx hinge
idle owl
onyx hinge
#

if you're not writing bad code, you're not writing much code

stuck elbow
#

as little code as possible

#

code is liability

blissful pollen
#

100% of my bugs I wrote have been in code

stuck elbow
#

also, always make changes on production server and commit form there, this way git blame just shows "root" and you can deny eveything

onyx hinge
#

I wanted to have a t-shirt made that said "Write code. Not too much. Mostly C". (well, forgive me for the "C" part, I was suggesting it in a C++ shop..), making reference to Michael Pollan's advice to "Eat food. Not too much. Mostly plants."

manic glacierBOT
stuck elbow
#

I believe in kondomari code management strategy

#

delete all code that doesn't spark joy

onyx hinge
#

@proven garnet @idle owl I noticed that part of the libraries section doesn't usually paste into the weekly meeting ".md version" properly .. I wonder if it could be fixed in adabot

manic glacierBOT
proven garnet
#

Happy to look into it! If you make an issue, feel free to tag and assign it to me! Otherwise I will in a little bit.

hidden rain
#

When a push initiates a work flow that fails, I typically try to resolve then push again. At this point the workflow shows several failed instances followed by successful instances. Do the old one eventually disappear or is there another action required on my part?

blissful pollen
hidden rain
#

For some reason, its not showing up

blissful pollen
hidden rain
#

I guess I could touch a few files and re-commit/push

blissful pollen
#

You could double check it did push or yeah touch a file and re-push

#

On your GH repo the last commit I see is 23 hours ago

hidden rain
#

ok..that push worked..we'l see if everything goes smoothly

idle owl
#

@onyx hinge So.... at this point should I write an "enter deep sleep" function since it will be used in two separate situations in this code? I'm genuinely a bit fuzzy on how this is going to work. Two separate alarms waking the board up for different purposes. Are you interested in helping me work through this tomorrow?

onyx hinge
#

gut guess, if you use the function 2 times but differently each time, probably not worth it being a function

idle owl
#

Ok fair enough.

proven garnet
#

And that the list should be "under" those bolded items missing newlines?

#

Actually, to be honest, how is it copy/pasted? I know the output from adabot, but where (or I guess what file?) is it actually being copied from?

onyx hinge
#

and yes my fix was adding some newlines

#

the flow is that whatever's in the doc is exported from google as .txt, then pasted into github with a ".md" extension

proven garnet
#

Got it, thanks! I'll get on that ๐Ÿ˜„

lone sandalBOT
hidden rain
#

Yeah!!! My push passed.

#

Did I actually say that?

blissful pollen
manic glacierBOT
#

Most ports/*/boards/*/board.c files contain identical do-nothing versions of board_init(), board_requests_safe_mode(), reset_board(), and board_deinit(). These can be replaced by default MP_WEAK versions of these routines. There was a limited attempt to do this in the past for some ports, but this does it for all boards.

The advantage of using the default MP_WEAK versions consistently makes it less work to change the signatures of any these routines (which I am contemplating ...

manic glacierBOT
tulip sleet
manic glacierBOT
manic glacierBOT
#

Tested with Thonny. I'm still getting the PROBLEM IN THONNY'S BACK-END error after rebooting the board. Tried it with/without boot.py, with/without .env, and with the same code as Dan used. I can consistently get the error when restarting the board or restarting the Thonny app. If I click the STOP button to restart the Thonny back-end, Thonny begins working smoothly again (including with the status bar enabled and a code error introduced, so much of this issue is resolved in the PR's curren...

hidden rain
#

@tulip sleet: I re-requested review of #6757. I "believe" I have addressed all concerns, wishes, and comments. Perhaps we could narrow down any remaining concerns. Thanks -Lee

tulip sleet
hidden rain
manic glacierBOT
proven garnet
#

What's the largest int the SAMD21 can hold again?

jaunty juniper
#

builds without big ints are limited to 0x3FFFFFFF

#

(31 bits signed int actually)

manic glacierBOT
#

It's works fine for me, no need to use while True to blocking script:

  • commenting supervisor_start_terminal function in circuitpython/shared-module/displayio/Display.c and circuitpython/shared-module/displayio/display_core.c
  • commenting root_group = &circuitpython_splash; in circuitpython/shared-module/displayio/display_core.c

dockerfile / linux command:

WORKDIR /root/circuitpython/shared-module/displayio
RUN sed -i 's/supervisor_start_terminal/\/\/ sup...
proven garnet
#

Thanks! Also, I submitted a PR to make the MQTT library keyword only for MQTT.init() which is technically API breaking, though I couldn't find any learn guide or libraries that did it positionally. There's just a lot of arguments so this might help keep people from mixing them up. Thoughts? Happy to close it if it might introduce unforeseen issues though.

orchid basinBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
#

@DavePutz I'll go back and verify, but I believe I tested this with web workflow on and off. I may be misunderstanding something, but there is no mDNS server other than the mdns.Server(wifi.radio) which is used to do the network queries. I have a number of other devices with web workflow running (and I had one with manual pre-web-workflow mDNS running), and they should all, in theory, show up in the .find listing (and often do, until it the .find starts coming back empty.

Other behav...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.0-22-g3ba385ff5-dirty on 2022-09-08; Raspberry Pi Zero 2W with bcm2837

Code/REPL

None

Behavior

The DEBUG section of the Broadcom learning guide indicates that DEBUG UART is enabled by default on the default RX and TX pins, however 8.0.0 doesn't have the console enabled on the RX/TX pins. The CIRCUITPY_CONSOLE_UART_TX/RX parameters are set in mpconfigport.h

Description

7.3.3 builds ...

manic glacierBOT
orchid basinBOT
#

This is really more of a support question, more suited for the forums (https://forums.adafruti.com) or discord (https://adafru.it/discord)

This may be due to a corrupted filesystem. Do this in the REPL:

>>> import storage
>>> storage.erase_filesystem()

That will erase and reformat CIRCUITPY.

If that does not work:

  1. Which version of CircuitPython?
  2. Is this is a regular Pi Pico?
  3. Are you using Thonny, or are you using the CIRCUITPY drive with an regular text editor...
manic glacierBOT
#

Wonderful Mark!
I wasn't aware of how many RP2040 variants exist.
I ultimately hope to duplicate this functionality to SAMD51.
Also perhaps experiment with BufferedOut perhaps using a DAC.
In the short term, I did it to be able to read ADC data at 5 microseconds
or less.
Yet I hope it will help many others too!
Thanks for your testing, review and assistance in this project.
-Lee

On Thu, Sep 8, 2022 at 6:30 PM Mark @.***> wrote:

@.**** commented on this pull request.

Tested...

manic glacierBOT
idle owl
#

Apropos of nothing, turns out you can set up a PinAlarm and a TimeAlarm in the same code with no issues. Not sure we've really tried that before, so I figured I would mention, it works smoothly.

manic glacierBOT
idle owl
#

Actually I may have spoken too soon.

#

@tulip sleet Jeff was helping me yesterday, but it appears he it not around at the moment. I can show you my code, but the concept is that I have a TimeAlarm and a PinAlarm set up, and the final line of the code is alarm.exit_and_deep_sleep_until_alarms(pin_alarm, time_alarm). The time alarm works great. However, now that I set it back to a higher value as it should be, it's become clear the pin alarm is no longer functioning. Or not consistently anyway. I got it to wake up on PinAlarm a moment ago, but otherwise it has ignored it entirely the rest of the time.

tulip sleet
idle owl
#

Correct, but not clearly to me. I would never have figured that out without Jeff telling me.

#

An example of what that line can look like with two alarms + would be helpful.

tulip sleet
#

i am editing that doc for other reason now and can make it clearer

idle owl
#

Oh ok, that works. I have it on my list to file an issue. I will not file that one.

#

Any suggestions for the issue I'm now having with this hardware?

#

I think I thought it was still working because the time alarm was so short, it looked like it was responding to the switch. It was not.

#

Now it works again once.

tulip sleet
#

does it work at all if you just remove the time alarm?

idle owl
#

Trying that.

idle owl
tulip sleet
#

it worked several times in a row?

idle owl
#

Yep.

#

Takes a minute to sleep once it starts sending data, but that's normal because of the delay. But it wakes up immediately when I move the magnet.

tulip sleet
#

ok, if you can reproduce and file an issue, that's good. Try a long time alarm and try the pin alarm triggering several times in a row.

idle owl
#

Ok,. pin alarm works with a longer time alarm. Waiting for the time alarm to trigger now.

proven garnet
#

How would I go about forking a library into the adafruit org? I wrote a library for BLE iBeacons per library request issue.

#

Happy to take this offline if it makes more sense

idle owl
#

We don't typically add forked libraries into our ecosystem.

proven garnet
#

Got it

idle owl
#

That is presuming you wrote it for Adafruit ultimately.

proven garnet
#

Yup!

idle owl
# proven garnet Yup!

Then yeah. Transfer ownership. If you can't transfer directly to Adafruit, transfer to me, and I'll do it.

#

@tulip sleet Ok, with a longer time alarm, everything works. My initial code was a 20 second time alarm to verify it was working. Which made pin alarm unhappy.

tulip sleet
#

so if the time alarm went off before the pin alarm, there was a problem? If you can show a simple example, that would be great

idle owl
#

@crimson ferry I found one issue with tracking "reload" instances.... When you're iterating on code on an ESP32 in, say, Thonny, where you have to enter the REPL to update your code, every time you CTRL+D to run the code again, it tracks a reload, which means after 5 iterations, it jumps into the hard reset code block. Obviously once everything is working properly, there's less iteration, but I feel like this has a chance to be a problem.

idle owl
tulip sleet
#

I rewrote the doc example to be this. Maybe you can adapt it to show the issue (this is not printing the wakeup reason, for example):

         import alarm
         import time
         import board

         print("Waking up")

         # Create an alarm for 60 seconds from now, and also a pin alarm.
         time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 60)
         pin_alarm = alarm.pin.PinAlarm(board.D7, False)

         # Deep sleep until one of the alarm goes off. Then restart the program.
         alarm.exit_and_deep_sleep_until_alarms(time_alarm, pin_alarm)
idle owl
#

Ok, yeah mine prints what woke it up.

#

Let me make sure I have this backed up and try your example.

#

@proven garnet I see it

proven garnet
#

Sweeeeet

idle owl
#

@tulip sleet Of course now it works fine with the shorty example, even with the timer at 20 seconds. ๐Ÿคท๐Ÿปโ€โ™€๏ธ

#

I won't file an issue and assume it's a me-problem. This project will not run into it anyway.

#

Ufff, I can't get it to enter the REPL with this code.

#

Sigh.

#

FINALLY. Had to quit Thonny, connect using tio, and then spam CTRL+D while moving the magnet back and forth, and it finally found its way into the right place.

#

Now to look up how to rename a file.

#

Blergh. Is it os.rename()?

tulip sleet
#

yah

random junco
#

@tulip sleet Sorry to bother you, but I think you might use a CPX as a timestamper for the weekly meeting, and if so, is the code available? (If you don't mind) I'm thinking I'd rather use my CPX than my Macropad because I'm lazy

idle owl
random junco
#

oooh! Sorry!

#

thank you both

tulip sleet
random junco
#

thanks!

tulip sleet
#

press reset when you start recording to start it from 0:00

random junco
#

will do

idle owl
#

This isn't workiing.

#

Ok, maybe it worked this time?

#

Appears to have. Oof.

#

Pro tip: Do not run that code with a super short timer. You will be stuck in it.

tulip sleet
#

I wonder if the timer had already expired by the time you got to it

crimson ferry
# idle owl <@360465312518504448> I found one issue with tracking "reload" instances.... Whe...

oh yeah, good point, I forgot about that since I disable autoreload in all my boot.py - the code could check for reload reason to distinguish. Another thing I think I thought of in a dream last night (o_O) was to track the rate of reloads instead... so like 5 in 5 minutes is bad, but 5 in 6 months is probably not so bad. But these are nuances. that anyone can embellish with later to their own liking ๐Ÿ™‚

idle owl
#

Oooh an error at the perfect time!

crimson ferry
#

hooray fior serendipity

idle owl
#

OK, I have the two different reasons. It does distinguish between REPL_RELOAD and SUPERVISOR_RELOAD.

#

I can use that pretty easily, I think.

#

Does this work like I want it to? py if supervisor.runtime.run_reason is not supervisor.RunReason.STARTUP or supervisor.RunReason.REPL_RELOAD:

#

I get confused with this stuff sometimes.

#

And end up iterating in circles.

#

or should I do is not in (supervisor...STARTUP, supervisor....REPL_RELOAD):

tame creek
#

i think not in (...) is more likely to do what you want. the first might not have the precedence you want (you might be doing a logical or of the is not with REPL_RELOAD; i'd have to check the language reference to be sure)

idle owl
#

That's what I was thinking. Which is why I asked. Felt like it wouldn't work.

crimson ferry
#

I always have to check too, or add defensive parentheses

#

I think you're really just trying to see if the code has triggered a lot of reloads before resetting, so is supervisor.RunReason.SUPERVISOR_RELOAD maybe

idle owl
#

Oh.

#

Good call. lol.

#

๐Ÿคฆ๐Ÿปโ€โ™€๏ธ Obviously.

idle owl
#

Ok that seems to be working. REPL reload no longer increments Reload number:

manic glacierBOT
idle owl
#

@tulip sleet How do I explain in words the final value in this line of code? voltage = ((voltage_pin.value * 2) * 3.3) / 65536

#

I know what the 2 and 3.3 are.

#

I know what the 65536 is, but I'm not sure how to explain it in words.

tulip sleet
#

voltage_pin.value varies between 0-65535 (65535 is 2**16-1), a full-scale value for an analog input. So the /65536 (consider it as a being done first), converts the value to a value between 0.0 and 1.0. Then the 2 and 3.3 scale it to the actual voltage.

idle owl
#

Ahhhhhhh.

#

That's much better than what I have.

tulip sleet
#

algebraically, this is the same, and maybe is a little clerear:
(voltage_pin.value / 65536) * 2 * 3.3

idle owl
#

Yeah, I think it might be clearer.

#

Yet another PR. Uff.

tulip sleet
#

so the full scale is 3.3/2 ??

idle owl
#

3.3 is the reference voltage, 2 compensates for the voltage divider.

tame creek
#

you might want the division at the end to avoid loss of precision, though, but i'd have to think about it some more to be sure

idle owl
#

I am genuinely surprised I remembered that much.

#

I can pretty easily explain it out of order if keeping it that way makes sense.

tulip sleet
#

the div is floating point anyway, so I don't think it matters much in this case

tidal kiln
#

the 65535 value relates to the bit depth of the ADC, which can vary. CP scales everything to 16 bit (design choice to make things less confusing). Arduino does similar, but 10 bit.

idle owl
#

Right, I actually took this from Arduino code, and had to get help with why I was getting garbage voltage values in CircuitPython.

tame creek
idle owl
#

So.... good as is and explain out of order? Or PR it to what Dan did and make it clearer?

tidal kiln
#

i like dan's wording for use as general description

#

the whole ADC bit depth thing can be a confusing topic

idle owl
#

Agreed

#

on both counts.

#

I was mostly asking what I should do with the code.

#

It would be cleaner to explain in order, but not that much.

tame creek
#

yeah, i think Dan's rewrite of the expression doesn't lose precision because division is floating point, so changing the code should be harmless. i'd suggest asking someone else who's familiar with floating point issues to review it just in case

idle owl
#

Ok, submitting a PR. @tulip sleet I realise none of the parens are necessary, but should I include unnecessary parens around the * 2 code anyway? Or is this clear enough.

tidal kiln
#

are u shooting for more readable code? or concise code?

idle owl
tidal kiln
#

could split to multiple lines?

idle owl
#

This one line is fine to explain.

#

Putting it in the right order will make it easier.

tidal kiln
#

like one line to compute voltage at pin

#

second line to compensate for voltage divider

idle owl
#

I understand what you mean, the Arduino code does it that way.

#

I think this is ok as it is. This code is already kind of chonky though, so adding a bit more chonk probably won't hurt things.

tidal kiln
#
VOLTAGE_AT_PIN = ADC_COUNTS * MAX_ADC_VOLTAGE / MAX_ADC_COUNTS
VOLTAGE_OF_INTEREST = some math based on VOLTAGE_AT_PIN
idle owl
#

That is genuinely confusing to me. ๐Ÿ˜„

#

Arduino did each line of math separately with its own comment. I thought that's what you were getting at.

#

Verified Dan's math works the same. (I knew it should, but always test code.)

#

I'll sit on this PR until I get through the rest of the code walkthrough so I stop bogging down our CI for small changes.

manic glacierBOT
#

Ok, this sounds like it's not yet properly handling mDNS Hostname conflict naming. While in theory, every device should have a unique name because of using the MAC address, this isn't always the case such as with an improperly setup network where multiple mDNS resolvers keep trying to resolve the same host.

This is good info because there may need to be some updates to code.circuitpython.org to deal with this there too.

idle owl
#

Uff I just realised this helper function isn't really necessary here. It turns one line of code into one line of code, and both are the same length and require the same data to work.

#

Unless I'm missing something obvious, it seems superfluous.

#

@tidal kiln Am I right that this seems kind of pointless? ```py
def send_io_data(feed, value):
"""
Send data to Adafruit IO.

Provide an Adafruit IO feed name, and the value you wish to send.
"""
return io.send_data(feed["key"], value)```
#

Or am I missing something obvious.

#

As in does io.send_data need something more complicated? I don't think it can, because the it would use the exact thing provided by the function.

tidal kiln
#

got more context? where'd that come from?

idle owl
#

My code, hold on.

#

I don't think it's saving any space or complication later in the code.

blissful pollen
#

It doesn't look like it really is simplifying anything that much to me

tidal kiln
#

makes things a little cleaner maybe

#

so you don't have to add ["key"] in each place

idle owl
#

That's what I was asking.....

#

Do I have to add key for the basic code to work?

#

I wasn't sure there.

#

I can't drop in io.send_data where send_io_data is located? I have to change what's provided to it at that point?

manic glacierBOT
idle owl
#

I'm going to test this and see what happens.

tidal kiln
#

don't need to add a key, but send_data wants the key for the feed

#

why the call to io.create_and_get_feed() each time?

idle owl
#

Ah. Failed to send to Adafruit IO. Error: can't convert 'dict' object to str implicitly

idle owl
tidal kiln
#

ok, yah, doesn't really seem to help much

#

could just:

send_io_data(io.create_and_get_feed("battery-voltage")["key"], f"{voltage:.2f}V")
#

wait, not that

tame creek
#

i think that starts stacking up too many bits of syntax on the same subexpression, which makes it less readable

tidal kiln
#
io.send_data(io.create_and_get_feed("battery-voltage")["key"], f"{voltage:.2f}V")
idle owl
#

I didn't realise I had to specify ["key"] without the function. I'm happy to keep it in there.

#

Not using the create_and_get_feed means adding the code to create each of the feeds, and then checks to determine if the feeds have been created, and if they have, do not create them again. This code isn't a setup/while True: loop situation because of the alarms and so on. So it reruns the entire program every time the alarms are triggered. Which, if not written right, would be attempting the feeds every time anyway.

#

That's why I used it so folks didn't have to create the feeds manually, and it doesn't hurt it to try every time apparently.

#

Significantly less code when there's a lot of feeds to deal with.

orchid basinBOT
tame creek
#

one thing that might help is changing send_io_data() so it takes the feed name as a parameter, and calls io.create_and_get_feed() on it. that way there's less repetition where you call send_io_data()

tidal kiln
#

ok, sounds like spamming the calls to create is benign, so guess makes sense in that context

tidal kiln
#

so seems like just a code readability thing

idle owl
idle owl
tidal kiln
#

could be one liner:

io.send_data(io.create_and_get_feed("battery-voltage")["key"], f"{voltage:.2f}V")
#

or two liner:

feed = io.create_and_get_feed("battery-voltage")
io.send_data(feed["key"], f"{voltage:.2f}V")
#

or other

idle owl
#

owait, would I return io.send_data(io.create_and_get_feed(feed)["key"], value)

tame creek
idle owl
#

Ah yes.

#

@tame creek Any reason why what I typed out wouldn't work? e.g. is there a specific reason to make it two lines in the function?

tidal kiln
#

ha! i was just writing that exact thing ๐Ÿ™‚

#

even used feed_name !

tame creek
tidal kiln
#
def send_io_data(feed_name, value):
    return io.send_data(io.create_and_get_feed(feed_name)["key"], value)
#

one line version

#

i like the two line version better

idle owl
#

Ok rad, thanks.

#

@tame creek This is such an excellent change. Really goes with my explanation of why there's a function to begin with (repeated code can sometimes be factored into a function). In theory, though there's not really two-way communication about guides, I wouldn't have been able to justify the repeated create_and_get_feed usage. ๐Ÿ˜„

#

Thank you so much!

manic glacierBOT
#

Fixes #6812.

Tested on Feather ESP32-S3 TFT using Web Workflow offline file manager:

  • Tested that attempting to move a folder into itself fails
  • Tested that attempting to move folder into another folder that doesn't exist fails
  • Tested that moving a folder into another folder that does exist still works
  • Tested that moving a file into a folder that exists still works
  • Tested that renaming a folder still works
  • Tested that renaming a file still works
  • Tested renaming and movi...
idle wharf
#

This feels like something that in the todo list for the learn guides but wanted to check....

When in the WebUI
"USB is using the storage. Only allowing reads. See the CircuitPython Essentials: Storage guide for details."

And the link:
https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage

But nothing on that page explains how to handle the webui not having write access to the filesystem. (that I saw)

jaunty juniper
idle owl
idle wharf
#

Will do.. and good idea @jaunty juniper I'll also open a CP bug to change the URL

jaunty juniper
idle wharf
#

Learn guide section links never work right for me ...

jaunty juniper
#

there's something mysterious about them sometimes

manic glacierBOT
jaunty juniper
#

I wonder if we could define shortened links on circuitpython.org instead of adafruit.it, so we could create them directly from the Circuitpython repo, like in a .mk file that would be parsed and sent to the cp.org repo with releases

#

I don't know if there is an adafru.it equivalent (adding a number to adafruit.it redirects to the product of that number)

manic glacierBOT
idle wharf
#

and now 900,000 builds will run... ๐Ÿ˜‰

#

Good find @jaunty juniper !

jaunty juniper
#

Also I did suggest a change without commenting on it to call it "CIRCUITPY drive" rather than "Circuitpython drive".

manic glacierBOT
jaunty juniper
#

it's not like we are doing the 9001 builds ourselves ๐Ÿ˜… ๐Ÿซค

idle wharf
#

True...

idle owl
#

Community Help Desk

spiral elk
#

What's the correct repo to open up a functionality issue with web workflow editor?

#

There's no way to open up the editor on additional devices on the network. when you click on a device from the other devices popup you then go through the normal chain of popups, which ultimately results in a link back to the circuitpython.local device, not the other device.

spiral elk
#

ta

manic glacierBOT
ember iris
manic glacierBOT
manic glacierBOT
#

Running @anecdata's demo code on an Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; Adafruit Metro ESP32S2 with ESP32S2 and I can replicate the bug.

On a hard reset, the first attempt to use the wifi works, it can scan nearby networks and connect to one with it's ssid/password. It can then do standard networking, get and post data, etc.

Softresets thereafter fail to find any wifi network on the scan.

To do an extra test I erased the flash, reloaded the binary and tried the...

manic glacierBOT
#

That brings up another point about the RSSI data actually being flawed. In my test I have 2 AP's sitting right next to each other which usually provide near identical signal according to my wifi manager app on my tablet and phone... but scanning with that code within esp32-s2 showed an unusual amount of deviation between my AP's to the point it gives me reason to question the accuracy.

idle owl
#

@jaunty juniper I have a question. Is there a CircuitPython equivalent to the Arduino while !serial or whatever it is? Which is to say, I would like my example not to run until the serial connection is established, because it involves interactive prompts.

manic glacierBOT
jaunty juniper
idle owl
#

Ooooh. Ok

jaunty juniper
#

though there might be a slight race condition on connect, so maybe add a small sleep after that

#

if you see the first print being missed

idle owl
#

Ok got it

#

Thank you!

jaunty juniper
#

I don't know how that works with non-native USB boards

#

I assume it works too

idle owl
#

Worked on this S2. I'll try it on the ESP32 in a bit here.

jaunty juniper
#

there's also usb_cdc.console.connected and usb_cdc.data.connected if you need to look at the data channel, both would only work on USB boards

idle owl
idle owl
jaunty juniper
#

@tulip sleet that might be far fetched, but do you think it would be possible to use ota_1 to extend the file system ? It would require both the CP fat code and tinyusb MSC to support some form of address translation because the ota1 and fat partitions are not contiguous, but I believe that tinyuf2 never writes to ota1 (at least CP) so it would make it possible to reclaim the space without changing the partition scheme.
And having an option to erase_filesystem() to switch between modes (with the extended mode making the dualbank module return an informative error).
Most people (if any) don't use dualbank, and that would more than double the space on 4MB boards, without requiring doubling the number of tinyuf2 builds for ESP boards, or making it much harder to enable dualbank for those who want it.

mortal iris
# orchid basin

I am sctv [I know, just starting to realise it's a bit confusing]

#

It's amazing to get circuitpython onto the esp32, currently using a AI Thinker / Wroom32 with the Huzzah firmware.

manic glacierBOT
manic glacierBOT
#

After a little poking around and trial and error testing I found what seems like a reasonable way to set these parameters without commenting out the logic in circuitpy_mpconfig.h.

If I move the two UART definition lines from ports/broadcom/mpconfigport.h to ports/broadcom/boards/raspberrypi_zero2w/mpconfigboard.h the console uart pins are enable and function properly.

I have no idea if this is the optimal solution, but if it's a least a reasonable short term option, I'll be ...

manic glacierBOT
#

I grabbed the nightly from Adafruit CircuitPython 8.0.0-beta.0-41-g33a100611 on 2022-09-10; Adafruit Metro ESP32S2 with ESP32S2 this morning to check if the bug had been fixed and it hadn't.

I left the code running while I went about my day and came back to

soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
  File "code.py", line 7, in <module>
MemoryError: Failed to alloca...
manic glacierBOT
manic glacierBOT
teal dune
#

@midnight ember thanks for your help... it's still not booting when I plug it in, but at least I can mess with some of the configuration to try and fix that now.

midnight ember
#

ha love the name! ๐Ÿฆฅ

teal dune
#

It's a low profile Choc switch keyboard :-). Grumpy Sloth is the overall brand.

jaunty juniper
#

FYI nvm.toml is a git submodule

teal dune
#

Cheers

jaunty juniper
#

it's pulled when you make fetch-submodules

#

and you can navigate to it from the CP github repo as it's linked

midnight ember
#

yeah i think that's for adafruit uses only to support new chips, you can submit a pr to have any chips you need supported, just make sure the configuration is right and that usually involves diving into datasheets.

teal dune
#

I'm wondering if the board not connecting / booting when I plug in the USB is something to do with these values:

USB_PID = 0x801F```
teal dune
jaunty juniper
#

what do you mean by not connecting and not booting ? you seem to be able to access the REPL ?

teal dune
#

Yeah.. only the first time I flash the board

midnight ember
#

nice Ronny, you're doing soooo much better than my first time. you're knocking it out of the park so far.

teal dune
#

As soon as I disconnect the USB and plug it back in, I can see the power status LED is on, but it's like my PC can't see the device at all.

jaunty juniper
#

if the flash is correctly configured, it might be an issue with the crystal and timing, I seem to remember something like that

#

look for PICO_XOSC_STARTUP_DELAY_MULTIPLIER

midnight ember
#

don't know where that section is for requesting a usb descriptor.

#

it's not in the board guide?

jaunty juniper
#

(like if you git grep PICO_XOSC_STARTUP_DELAY_MULTIPLIER you'll find uses of it)

jaunty juniper
#

you do need a unique vid/pid to submit to the CP repo

#

if not, you wanna request a PID from Raspberry Pi

manic glacierBOT
teal dune
#

It's connecting now and the CIRCUITPY drive appears each time. But the KMK firmware doesn't appear to be working. EDIT... nope it's working fine. I'm just being a muppet.

#

Time for bed I think. Thanks for the help @jaunty juniper

manic glacierBOT
manic glacierBOT
tulip sleet
manic glacierBOT
manic glacierBOT
#

You can now disable the status bar: #6847. For example, in boot.py:

import supervisor
supervisor.status_bar.console = False

This means that at some point during the boot proccess, circuitpython decided to send the title-set, but sent it incompletely..

I don't think it is being sent incompletely, but the sending starts before the USB connection is fully up. This should be fixed.

idle owl
#

Oof. What did I do to get here? ```OK
soft reboot
raw REPL; CTRL-B to exit

#

CTRL+B got it back to the regular REPL. So it's not an issue. But I have no idea what sequence of events got me to the raw REPL.

tame creek
jaunty juniper
#

yeah that's usually thonny or ampy, there's a ctrl-* shortcut too

tame creek
idle owl
#

I quit Thonny, and connected using tio. Hit enter a couple of times to get anything to show up in tio and ended up there.

#

Because I can't scale the shell in Thonny that I know of, and I needed a guide-readable screenshot of the output of this program

jaunty juniper
#

yup thonny left it in that state then

idle owl
#

Ah fair enough.

#

Good to know.

#

So Thonny pretends to be in the REPL, and is secretly using the raw REPL to do things? I mean the REPL works as expected in the Thonny shell.

jaunty juniper
#

it goes into the raw repl to do its stuff, reading files list, getting board information, etc

idle owl
#

Hmm ok

#

I now have a script to identify what's-what on a reed switch. ๐Ÿ˜„

#

Multimeter works as well.

#

But you can do it with CircuitPython if you want!

jaunty juniper
#

I don't know in what circumstances it would leave it in that state exactly

tame creek
#

i would hope that Thonny would consistently exit raw REPL mode when it exits, but maybe it sometimes doesn't?

idle owl
#

If it's possible to mess things up, I'm almost always able to do it.

#

Thanks folks! Good to know there's a likely reason for it.

calm aspen
#

is there a supported method of bundling your own code.py and libraries into a firmware compile?

I've got to flash a bunch of boards with CP and I was hoping there's a slick way to package all the things into a single uf2 and move that one file over.

brazen hatch
#

Not that I know of, but you can just pack them in and disable usb access unless some pins are bridged

# in boot.py
from storage import disable_usb_drive
disable_usb_drive()
calm aspen
#

thank you. I'm not concerned about access after

#

@jaunty juniper I was afraid you'd ask. it's a custom board with rp2040. -- I'm afraid because the answer is to use picotool but I'm not sure how to prevent it from pulling all 98m of flash

#

not 98. 8m

jaunty juniper
#

you can then use that to flash any new board as an exact copy of the one you saved

#

(provided they are the same, because that will contain firmware, flash config, etc)

calm aspen
#

for whatever reason I can't get the range command to work the way I hope. flashing 8M when I only have 2M just takes longer than I'd hoped

jaunty juniper
#

well you want the drive to be formatted though

brazen hatch
#

If it is a matter of flashing many boards fast, you can try creating a bash script that flashes many at the same time
usb cables are cheap.

jaunty juniper
#

a "detect the presence of a new RPI-RP2 and copy file" script

calm aspen
#

that's why I was wondering about compile time. Picotool works great by dumping all contents to uf2 and then I have the 1 file. It' just a bit long to wait per board.

my alternative isn't terrible. I can write a script to monitor serial -- flash CP, wait for boot. Copy contents

#

I have a few hundred to do so I'm trying to cut as many corners as I could ahead of time ๐Ÿ™‚

brazen hatch
#

Best of luck.

calm aspen
#

thanks for the quick responses to you both

idle owl
#

I'm getting mixed answers on how to split up an f-string. It's in a print statement. I can't find a single common answer. I hit enter halfway through the line in PyCharm, and it did a thing, but Thonny is complaining about a syntax error when actually running it.

#

Here's what I have right now: ```py
print(f"Terminal pin assignments:\nTerminal 1 = {TERMINAL_ONE}\n"
f"Terminal 2 = {TERMINAL_TWO}\nTerminal 3 = {TERMINAL_THREE}\n")

tame creek
#

i think this is one of those places where MicroPython/CircuitPython is missing functionality

idle owl
#

Oh hmm.

#

Will two print() statements do the same thing?

idle owl
#

e.g. separating the second line into its own print()

idle owl
tame creek
#

it might result in two I/O operations where a single print() call would result in one, in case that matters

jaunty juniper
#

just add +

idle owl
#

At the end of the first line?

#

Outside " or inside?

jaunty juniper
#

between the strings

idle owl
#

Ok trying that.

jaunty juniper
#

2 prints will also do the same but with one more "\n"

idle owl
#

Hooray!

#

Thank you!

#

lol. Apparently it's consistent.

jaunty juniper
#

what if you ctrl-D in Thonny before you quit ?

idle owl
#

Not sure, working on a guide at the moment, so I don't really have time to troubleshoot it.

manic glacierBOT
#

CircuitPython version

Initially:
Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; ESP32-S3-Box-2.5 with ESP32S3
Board ID:espressif_esp32s3_box
UID:C7FD1A1E7C45

After lots of 'internal watchdog timer expired' errors I downgraded CPY to:
Adafruit CircuitPython 7.3.3 on 2022-08-29; ESP32-S3-Box-2.5 with ESP32S3
Board ID:espressif_esp32s3_box

Code/REPL

# SPDX-FileCopyrightText: Copyright (c) 2022 Tim Cocks for Adafruit Industries
#
# SPDX-License-Id...
manic glacierBOT
#

Fix for CircuitPython v8.0.0-beta.2: display_shapes.polygon color fill is rendering very slowly

#6734 removed support for auto brightness left a call in displayio_display_background to set the brightness to a 1.0f fixed value. In the previous code another function call checked that auto-brightness was set to True and skipped any work if it was not true and limited to how often the brightness was set.

With t...

analog bridge
#

Can we update to esp-idf-v5.0 now or post CP-8?

tulip sleet
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
blissful pollen
#

@tulip sleet I have a strong suspicion where that brightness bug is but dealing with some stuff at work so cannot look at it. Not sure how priority it is but can probably take a look later today if needed.

manic glacierBOT
tulip sleet
#

you can give me a hint ๐Ÿ™‚

blissful pollen
#

The constructor seemed seems to call set-brightness (so it should set it properly) so I'm guessing the bug is in set brightness itself. Also in my stand alone test (just used my own screen) I could not set the brightness (but it defaulted on full)

tulip sleet
#

i will take a look; ttyl!

manic glacierBOT
#

Iโ€™m beginning to suspect that since disabling auto refresh restores the ability to control brightness, the SAMD51 TCC timer used for the display backlight PWM is shared with the display auto refresh timing somehow.

I think this is not the case, given observations by @gamblor21 in adafruit/Adafruit_CircuitPython_Display_Shapes#57 that creating an independent PWM object does not cause the same delays. I think it's more likely that unconditionally updating the PWM object on each displayio...

deft jay
#

deleted this out of circuitpython-help as this is more of a dev question: I'm looking to source chips for a design I'm likely going to use a CircuitPython capable MCU to power. While searching, I discovered something called SMBus? Does anyone know if SMBus based devices are suitable for use with circuitpython devices? Or should I stick to SPI/i2c chips?

tame creek
#

SMBus is kind of a subset of I2C, but with stricter timing and voltage specifications (among other things). a chip that supports SMBus but not I2C might have trouble talking to a number of I2C sensors otherwise supported by CircuitPython

tulip sleet
#

are you talking about SMBus-capable microcontrollers or sensors?

deft jay
#

@tulip sleet I was looking at capacitive touch sensors

#

like, the actual chips on digikey.

tulip sleet
#

can you give an example?

deft jay
#

facepalm๐Ÿคฆ๐Ÿพโ€โ™‚๏ธ

#

no, no I can't because everything on digikey that is normally stocking is currently either i2c, i2c/smbus, or spi....I saw a few "SMBUS" items and freaked and it's literally not even an option for my needs.

#

I do have another question about captouch sensors, I know there was a chip shortage special or some kind of youtube video of ladyada searching digikey related to the mpr121 going away and her searching for such chips. Is there a recommended replacement for mpr121 designs in the adafruit catalog? It looked like there was going to be a replacement design coming out, and then I saw an updated mpr121 design with "stemma" ports, and idk what to think of the current state of captouch chips in the adafruit ecosystem, but I'd very much so like to align my design with future adafruit products because I love circuitpython. Is there something coming or did something come out?

onyx hinge
#

@tulip sleet @hidden rain this may be fixed in an upcoming virtualenv release

manic glacierBOT
manic glacierBOT
random junco
#

@midnight ember The host goes first, than alphabetical

#

So you're in the right spot. ๐Ÿ™‚

midnight ember
#

same for status updates, under you?

random junco
#

And if you want to read off your updates, a mod will need to add you to the CircuitPythonistas role. You also have the option of lurking and the host will read it off

manic glacierBOT
midnight ember
#

yes please, pretty sure i'll be present for this one. requesting CircuitPythonistas role.

random junco
random junco
proven garnet
proven garnet
#

Thanks!

tame creek
#

because it's come up before and might again: i'm not sure of the best place to record this information for future use, but to help with attributions, username tlyu on GitHub is me

idle owl
idle owl
#

Email's taking 100 years to load. Guess it's a good thing I don't really need it right now. ๐Ÿ™„

gilded cradle
#

I might be a few minutes late...

idle owl
lone axle
idle owl
tulip sleet
idle owl
#

Reed switches. ๐Ÿ˜–

#

@midnight ember ๐Ÿ˜Š Caveat: this guide is a WiFi Mailbox Notifier project. The LoRa version is destined for an upcoming guide.

austere acorn
#

Thank you, @lone axle ! ๐Ÿ˜Š

midnight ember
#

yes, then i'll wait for the destined version ๐Ÿ™‚

gilded cradle
#

I'm sorry, I need to step out (family emergency)

idle owl
#

The LoRa guide is waiting on some it's-not-out-yet-don't-ask new hardware. ๐Ÿ˜

lone axle
idle owl
#

That's how you create boards!

midnight ember
gilded cradle
#

Ok, back. it's all good.

midnight ember
#

๐ŸŽ‰ for the titano fix!

blissful pollen
idle owl
#

@minor plume You can copy from command line and avoid those files with a specific tag in the command, so I imagine circup could use that somehow? I have no idea how circup works though.

minor plume
jaunty juniper
#

circup uses python's shutil copytree

proven garnet
#

Sounds good, I can keep up with it then

midnight ember
#

PaintYourDragon's ears are turning red and his mouth starts frothing anytime someone says Halloween.

blissful pollen
#

Another item to keep in mind for reviewers is if an issue is not labeled for Hacktoberfest we need to tag it so the submitter gets credit

minor plume
proven garnet
#

Feel free to let me know if you want to divvy things up or delegate @idle owl

#

If that applies

midnight ember
#

I've only participated twice in a community event, circuit python day and community help desk, had a great time both times so I'm all for more.

jaunty juniper
#

but also I don't get extended attributes when I use circup, fancy opening an issue to talk about it ?

lone axle
#

I'm happy to help out as well. Definitely also like the idea of coordinating an october help desk to coincide with it so we can offer help to folks interested in contributing during hacktoberfest.

ember iris
#

I'll jump back in and do more reviews again, I've been trying to get my office setup for it and am just about back online

gilded cradle
#

Thanks

idle owl
minor plume
digital ibex
#

๐Ÿ‘‹

errant grail
#

Thanks!

candid sun
#

great job @random junco !

blissful pollen
#

Great job @random junco

random junco
#

thanks all

ember iris
#

Thanks! Great Job @random junco!

lone axle
#

Thanks everyone. Great job hosting and thanks again for joining the lineup Paul!

minor plume
#

Iโ€™m planning to help out with Hacktoberfest PR reviews too. Been trying to get all my devices and sensors and stuff in one place so can manage them easier.

#

@random junco thanks for hosting today!

idle owl
#

That's great, Tammy! For the most part, I don't think coordination is needed for that part, it's more of a dive in and help situation. And since Adabot handles the labeling, there's really not much to do but sit back and wait for PRs. ๐Ÿ™‚

minor plume
idle owl
minor plume
jaunty juniper
minor plume
jaunty juniper
manic glacierBOT
minor plume
#

@jaunty juniper So it looks like the bundle zip files downloaded by circup on Saturday (and the extracted files from them) all have the โ€œcom.apple.provenanceโ€ extended attribute. I wonder if the right solution is to make circup remove that attribute from the zip files before extracting them on a Mac.

jaunty juniper
#

yeah that should not be difficult

minor plume
#

Iโ€™ll look at the code for circup and see about adding that. Should be an easy fix.

#

I feel like the last version of macOS used a different attribute for quarantined files. Maybe it should just clear all extended attributes from the downloaded zip files before doing anything with them.

jaunty juniper
#

yeah it seems to be part of new Ventura security features

minor plume
#

Fun fun. Fortunately, I just looked at the code for circup, and it seems to be an easy enough fix.

midnight ember
#

Didnโ€™t even notice till just now. I have a purple tag. ๐Ÿ˜

random junco
#

if anything is wrong in the PR, please let me know