#circuitpython-dev

1 messages · Page 16 of 1

proven garnet
#

Okie dokie, added

proven garnet
#

Ah, sadly the rules say drafted PRs can't be accepted ( @ruby atlas )

onyx hinge
#

feel free to move it out of 'draft', I did that.

#

@ruby atlas @proven garnet ^

#

I marked it ready for review again, sorry for causing trouble

#

and re-marked as accepted

#

thanks rose!

proven garnet
#

🥳

idle owl
#

No, we're evidently leaving it unarchived, but we're not supporting it any further. I will have to ask Limor whether she wants to accept PRs to it, or whether she's ready to archive it to make it read only. This question has come up a few times previously, and the answer was always don't archive. But who knows now.

idle owl
mystic flume
#

I think I've found a bug (and a fix), but not sure where to file it/ do a PR etc

#

Anyone got any pointers?

tulip sleet
mystic flume
#

Thanks, will do

#

I think we can probably use the Streams class with UARTs, usb cdc serial ports and ble uarts as well

onyx hinge
#

@tulip sleet now that our tests use our asyncio module I think we can do that.

#

@mystic flume there are rough edges so come back and help us solve the problems when you run into them 🙂

tulip sleet
#

it would be good to track changes to that code, but we can do that in the merges

manic glacierBOT
mystic flume
#

@tulip sleet I've found several issues in asyncio/stream.py - where is the best place to report these. I have solutions for some but not all of them . Should it be done as multiple issues on github, or discuss here?

manic glacierBOT
manic glacierBOT
#

If you flash the plain Pi Pico 8.0.0-beta.4, does it also show up reliably? You mentioned the plain Pico 7.3.3 above.

It could still possibly be a hardware problem, but related to the Wifi coprocessor. Another test would be to load MicroPython for Pico W and see how reliable that is. But that does not present a disk drive, so you'd just want to see if the serial connection appears.

@jepler is there any startup thing for the CYW43 that might get stuck?

quasi veldt
#

Is there any plan for USB debugging? Would love to be able to have breakpoints in python and debug interactively instead of with print statements.

Used to that with Atmel studio (and also for web dev or desktop python)

tulip sleet
#

search for other pdb stuff in the MicroPython issues as well

quasi veldt
tulip sleet
#

well, I think just Python + DeBug

#

gdb is Gnu DeBugger

#

print statements to the rescue

quasi veldt
#

I guess you can inject a line to print local vars

#

Set trace to stop on a line. At that line use repl? Or locals still won't be available

tulip sleet
#

still won't be available, I think

manic glacierBOT
lavish saffron
#

Sanity check please!

I've been reading through the code for the DNS server in Adafruit-CircuitPython-wiznet5k, and I think there is a bug. In _build_dns_question() the line self._pkt_buf += host[i] appears to concatenate a str onto a bytearray which should raise a TypeError exception.

Code snippet below (my thoughts added as # > Blah blah

Can someone please confirm that the code runs or have a read and see if you agree?

Thx!

adafruit_wiznet5k/adafruit_wiznet5k_dns.py

class DNS:
    """W5K DNS implementation."""
    def __init__(
        self,
        iface: WIZNET5K,
        dns_address: Union[str, Tuple[int, int, int, int]],
        debug: bool = False,
    ) -> None:
        
        ...
        # > self._pkt_buf is bytearray
        self._pkt_buf = bytearray()

        ...
        
    def _build_dns_question(self) -> None:
        """Build a DNS query."""
        # > self._pkt_buf is bytearray
        # >   (not touched after __init__)
        # > self._host is bytes
        # > host is str
        host = self._host.decode("utf-8")
        host = host.split(".")
        # write out each section of host
        for i, _ in enumerate(host):
            # append the sz of the section
            self._pkt_buf.append(len(host[i]))
            # append the section data
            # > concatenate bytearray and string should raise TypeError
            self._pkt_buf += host[i]
            # >  **** ^ ****
        # end of the name
        self._pkt_buf.append(0x00)
        # Type A record
        self._pkt_buf.append(htons(TYPE_A) & 0xFF)
        self._pkt_buf.append(htons(TYPE_A) >> 8)
        # Class IN
        self._pkt_buf.append(htons(CLASS_IN) & 0xFF)
        self._pkt_buf.append(htons(CLASS_IN) >> 8)
jaunty juniper
#

so you're right, it's a bug

#

a silent one in CP, but it should be fixed to be correct C python

lavish saffron
#

I'll open an issue and submit a pull request with self._pkt_buf += bytes(host[i], "utf-8). Thanks for a quick response!

manic glacierBOT
#

I think the bootloader may be working but CircuitPython startup is not. @ok1rig if you put it in boot mode, does that always work?

  • Boot mode (when boot button is pressed) works always correctly. And if I flashed UF2 v8-beta and then there is automatic reset, it always worked fine too.

You mentioned the plain Pico 7.3.3 above.

  • I was desperate so I tried v7 on Pico W and flash drive worked always as expected (of course I had not wifi functionality, it was just test)

  • With ...

manic glacierBOT
manic glacierBOT
ancient hemlock
#

I know (at least I thought I knew...) in C there isn't really a way to make arguments optional. But I see in countio pull argument is optional - how does that work? Or is this a better question for the forums?

manic glacierBOT
#

I'm wondering whether init of cyw43 should be moved later, and even whether it should not be done in safe mode. but especially since it seemingly can't be re-initialized it can't go in any of the "reset" functions. I could put a "maybe init cyw43" in a few strategic places so that it happens well after startup instead of happening super super early. I'm open to ideas.

did your testing include finding out whether your device worked with the "non-W" circuitpython firmware? I guess one of yo...

onyx hinge
#

@ancient hemlock I'll try to answer .. but let me check how the code is working in this specific case.

#

the code you're talking about is in the source file shared-bindings/countio/Counter.c and the function is countio_counter_make_new

onyx hinge
#

there's a structure that describes what is required from Python arguments. An argument can have the REQUIRED flag or not. The pull argument doesn't have the REQUIRED flag: ``` static const mp_arg_t allowed_args[] = {
{ MP_QSTR_pin, MP_ARG_REQUIRED | MP_ARG_OBJ },
{ MP_QSTR_edge, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_FROM_PTR(&edge_FALL_obj) } },
{ MP_QSTR_pull, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
};

#

if it's not specified, then the default is the Python None value

ancient hemlock
#

yes, looking for something to model after.

onyx hinge
#

so later on when args[ARG_pull].u_obj is used, it'll be the default value instead of a user-provided value

ancient hemlock
#

okay so when you give that to your construct method it will be the none

onyx hinge
#

and the function validate_pull is prepared to accept the UP object, the DOWN object or the None object, and turn it into the corresponding value in C code: const digitalio_pull_t pull = validate_pull(args[ARG_pull].u_obj, MP_QSTR_pull);

#

so basically.. you need a special value (good choices might be 0, -1, or None, depending on the situation) that is used as a default if no value is specified in the Python code. Then, in C, you just check for the special value.

ancient hemlock
#

I think the none object is my missing link. Thank you.

#

I am modifying pulseio to allow for 32bit long pauses between events to use a hall sensor for slow to fast rotations

onyx hinge
#

cool, happy if this gets you un-stuck. btw I think asking questions about the core C code is more appropriate here than in help-with-circuitpython, because it is at a far different level than most questions are.

ancient hemlock
#

I would like to have the default behavior be the original max pulse limit, and be able to specify longer gaps. Thanks for the redirect to the right place also!

jaunty juniper
#

if you are compiling or writing C, questions go here 😉

onyx hinge
#

The reason for 16 bit values is probably a combination of wanting to save RAM size and maybe even a limitation of the counter peripheral on some microcontroller like the samd series

#

but I bet if you're using something like rp2040 you can have a bigger limit easily

ancient hemlock
#

I have a pi pico that I'm playing with now - exactly

onyx hinge
#

you might also just code it in pure Python using the rp2pio module and bypass countio / changing core code entirely

ancient hemlock
#

as in, use my own PIO to read the pulses instead of pulseio?

onyx hinge
#

but learning to work on the core is 👍 with me

#

yeah

ancient hemlock
#

I think I'm in that position of being very new, where I grabbed on to something that looks familiar-ish

onyx hinge
#

I guess countio on rp2040 is using the pwm peripheral, I kinda didn't expect that

ancient hemlock
#

I started with countio, moved to pulseio for the exact pulse times then started to work down at the lower end of the range realizing the counter for pulseio was maxing/rolling over

onyx hinge
#

pulsein is using the pio peripheral, so it shouldn't (knock on wood) have a 16-bit limitation

ancient hemlock
#

I have it working now so it will count to 32bit. Not being very familiar with the PIO I'm not very confident how it works exactly

onyx hinge
#

but the countio design needs the IRQ, you'd need a different design of pio program if it was going to work as pure python .. no interrupts from python code

#

OK, yeah, I think working based on improving pulsein within the core is the way to go!

ancient hemlock
#

other than it seems like it looks for a transition and then counts the cycles and reports them as microseconds

#

Not sure if this is something that you (collectively) would want in the main or not but I will play with it some more. I wonder if it was 16bit to be consistent across architectures...

manic glacierBOT
#

Can we reopen this? I have a program which writes to a SSD1306-oled, goes to sleep for 10 seconds and then updates the display. This works sometimes for 1 cycle, sometimes for something like 10 cycles. But then it seems the display is not released properly and the screen is garbled by the REPL. This is independent of true or fake deep-sleep,

Sorry to hear you are having this problem. I would suggest you to open a new issue with all the relevant info to your setup.
This issue has been fi...

ancient hemlock
#

going back to pulseio and countio I see now how the arguments work...I just missed the pattern before
`static const mp_arg_t allowed_args[] = {
{ MP_QSTR_pin, MP_ARG_REQUIRED | MP_ARG_OBJ },
{ MP_QSTR_maxlen, MP_ARG_INT, {.u_int = 2} },
{ MP_QSTR_idle_state, MP_ARG_BOOL, {.u_bool = false} },
{ MP_QSTR_max_period, MP_ARG_INT, {.u_int = 65536} },
};
the

#

there is a default value as the last value of each argument object.

#

thanks again

vague thicket
lone sandalBOT
manic glacierBOT
#

This pull request isn't building because espressif boards each need an "sdkconfig" file. The specific contents of the sdkconfig file depend on the espressif chip / module used.

Not all sdkconfig settings have to be in this file, but these do:

  • the size and speed of spiram
  • psram pinout information, in some cases

For example, this is the sdkconfig file for the kaluga devkit: https://github.com/adafruit/circuitpython/blob/main/ports/espressif/boards/espressif_kaluga_1.3/sdkconfig

...

orchid basinBOT
lone sandalBOT
manic glacierBOT
#

Python 3.11 started to roll out to github actions, and .. it doesn't work. This MAY affect just the espressif build, but I'm pinning it back at 3.10 for all builds.

Typical failure, during "Run $IDF_PATH/tools/idf_tools.py --non-interactive install required" shows a lot of failures building gevent:

...
Collecting gevent=1.2.2
  Downloading gevent-1.5.0.tar.gz (5.3 MB)
...
  Building wheel for gevent (pyproject.toml): finished with status 'error'
...
      src/gevent/_greenlet_p...
proven garnet
#

@onyx hinge that looks not great, is that Python thing gonna be an issue for libraries too?

#

It looks like it was for building the wheel

onyx hinge
#

some stuff may come up, but this particular thing is probably unique to esp-idf's requirements.txt

proven garnet
#

Gotchya, okay thanks. I still want to address issues with those actions so just trying to keep up with that

manic glacierBOT
#

I tried flash reset with flash_nuke.uf2, but no magic happened. Symptom is the same.

did your testing include finding out whether your device worked with the "non-W" circuitpython firmware? I guess one of your tests involved blinking the built-in LED, which of course will not be possible without the cyw43 co-processor running.

I did not concentrate on non-W testing. I just tried ~10 times disconnect/connect to PC with v7 and check if in windows the flash drive appear. It always did...

proven garnet
#

I thiiiink Python 3.11 is breaking pylint for library CI 😬

#

@idle owl I can go ahead and move all the libraries over to that new composite action if you want me to just push directly to mains, I can handle that tonight

#

Looks like wrapt hasn't been updated to stop using removed (previously depreciated) methods yet.

manic glacierBOT
#

Outside of running both AP and STA modes at the same time. The AP is working really nice. I have made a few tweaks outside of what @bill88t has done here.

  1. Added wifi channel selection when starting the AP. The interesting thing with this is that the channel can only be set on the first run after cold boot. If you do a warm reset, the radio will not change to a different channel.
  2. Enabled dhcpserver for the AP. This is a compile time option.

I have the changes that I've made her...

manic glacierBOT
orchid basinBOT
manic glacierBOT
proven garnet
mystic flume
proven garnet
#

Ahh, a preferable solution I think, thanks!

#

Is there any reason the core and lib need to (or should) use the same Python version?

#

I know @onyx hinge had the PR to pin the core's to 3.10

mystic flume
#

I think this is just the python version used to check code before commits. I think either way works tbh

#

Shouldn't actually make much difference as CircuitPython is (I think) based on 3.4 (with features from 3.5 to 3.7)

idle owl
#

@proven garnet Using a newer Pylint might mean another sweep of fixes to the libraries. Be aware of that. Eva can be involved if it turns out to be necessary.

idle owl
proven garnet
#

I'll let you know, I also am likely to have a list of libraries that need other work too, if they aren't using the standard CI

#

I'll get that list prior

idle owl
#

@proven garnet I also think I want a change to the download stats page. And I have no idea how complicated it would be. Out of my immediate wheelhouse anyway, but it might be super simple to you.

#

Couple changes, maybe, now that I look at it rendered.

proven garnet
#

Sounds good, I'll take a look if you made them to the PR

idle owl
#

I'll try to explain in the PR review, but we can chat if what I suggest doesn't make sense.

#

I don't know how to make the biggest change. So I'll try to explain it instead.

proven garnet
#

It's worth mentioning the I put the Blinka stats in there not primarily for reference, but because I need it for the report, and so need to write it them to parse later.

#

It is a good comparison value, I think, but not the primary reason

idle owl
proven garnet
#

I take it that last one is the complicated one? I think all the libraries have the "same" PyPI name as repo name besides capitalization and dashes/underscores (my code and existing code relies on it even)

idle owl
#

I assumed you could, at worst, parse the package names and use that, but that doesn't do camelcase for the lib name necessarily.

proven garnet
#

Totally doable 😄

idle owl
#

Thanks!

proven garnet
#

I'll update both PRs accordingly

#

Also the stats failed last night 🙃 will fix

idle owl
#

Hah ok

proven garnet
#

Guess who forgot to actually pass the environment variables into the cron

idle owl
#

Two thumbs!

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Did Thonny used to be able to upload larger files in beta.1 or beta.2?

No. My whole experience with all of this has been terrible. Even when it works, it does nothing reliable. I have had the other Xiao boards and no issues. Its not just Thonny either.

It appears to be something related to pyserial from the error. \serialwin32.py", line 325, in write
raise SerialTimeoutException('Write timeout')

I suspect something with this is causing issues with everything but the flas...

proven garnet
#

Working on moving things over to the composite actions!

proven garnet
#

Libraries now utilize the composite actions! Those need a couple updates so the libraries show as failing but that's expected right now. Sorry if someone just got 300 emails about it like I did!

#

In hindsight I should have done that first linkFacepalm

proven garnet
#

There's a lot to fix, but it all seems to be valid fixes need and not anything bogus from what I can tell

#

When the website updates library infrastructure issues, that should be the correct list.

#

Most issues seem to stem from two things:

#
  1. no-member raised as a result of CPython inconsistencies like os.uname
#
  1. Names not conforming to the standard, often caused specifically the variable cs which is in a bunch of driver libraries for the chip select.
manic glacierBOT
proven garnet
#

Latest pylint (2.15.5) seems better and fixes most of those werid errors

#

Yeah, much better, I'll move it to that and finish up this patch - the rest can be cleaned up

manic glacierBOT
#

yes, it's fine. The one that appears first will be used when printing the pin, so just keep that in mind when writing the pin definition. For instance, on pygamer, LED and D13 are the same, and both print as board.LED:

>>> board.D13
board.LED

this is due to the order in the pins file:

    { MP_OBJ_NEW_QSTR(MP_QSTR_LED),  MP_ROM_PTR(&pin_PA23) },
    { MP_OBJ_NEW_QSTR(MP_QSTR_D13),  MP_ROM_PTR(&pin_PA23) },
manic glacierBOT
#

Seed studio has two XIAO (QT-Py format) nRF52840 board.

One is the Seeed_XIAO_nRF52840_Sense (see https://circuitpython.org/board/Seeed_XIAO_nRF52840_Sense/) that is supported in CP. The other one is/seems identical but without the microphone and without the 6 DoF IMU:

I have both (don't ask) and they are delivered from factory wit...

turbid radish
#

@lone axle do you have your newsletter update in?

lone axle
turbid radish
#

Thanks!

idle owl
#

@lone axle @onyx hinge Is it one of you I need to talk to if there's an issue with the simulated-CIRCUITPY dynamic screenshot generator? I keep starting with Justin, and keep being reminded I'm asking the wrong person.

lone axle
# idle owl <@382939733107408897> <@426200547024961539> Is it one of you I need to talk to i...

I believe I made the initial version of it that screenshotted the learn guide projects. I think Jeff adapted it to the library / product guide ones and hooked up the automagic actions running, but I've done one or two tweaks on that side as well iirc.

I will leave it open to Jeff also, but maybe best to start with me and if I hit a snag or something I can't figure out or work through I'll reach out for here for help.

idle owl
lone axle
#

Ah, I think there is an allow-list of file extensions that it will include. I'll poke into it this evening and see if I can add CSV to the list

idle owl
#

Ah ok, nice.

#

Sounds like it might be an easy fix, which is always good.

lone axle
#

I'll look into whether it makes sense to use a deny-list instead of allow as well. Thinking about it now it seems to me there would be a rather short list of files that we wouldn't want to include. .license files being the only that come to mind immediately. Perhaps there were others that came up when it was originally coded. But also possible it was just a consequence of using a dictionary to map extensions to the mock icon images for the different types.

idle owl
#

Fair enough. I'm happy with whatever you decide is the best route. We can always iterate on it over time as well.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.4 on 2022-10-30; Adafruit Feather ESP32 V2 with ESP32

Code/REPL

not code related

Behavior

'''Unable to connect. The device [local IP address] was not found. Be sure it is plugged in and set up properly.'''

Description

I changed the default port (CIRCUITPY_WEB_API_PORT) to 8080 and the /code/ interface gives the error about

Additional information

No response

manic glacierBOT
lone axle
#

@idle owl if you are around still (no worries if not) do you know off hand a learn guide project, or library repo / example that has a CSV in it? I think I've got the change but need to test it.

If not I'll add one temporarily to a project locally and run it there to try it out without committing any changes to the project.

idle owl
#

@lone axle I don't. Please add one temporarily to test it. Eva's latest has one, but I have no idea what it's called.

lone axle
#

Will do, Thank you. CGrover searched some up for me as well to try out just now

idle owl
#

Excellent!

manic glacierBOT
proven garnet
#

Also, we're now fully (for real this time) using composite actions for the CI! Feel free to tag or ping me if something seems weird - about ~50 libraries have issues that need to be addressed since we upgraded pylint versions.

#

I'm trying to make sure PRs that have been run since that fail on them try to get fixes sooner

proven garnet
#

Catching up on the stream, @lone axle do you want to use the latest Python, or keep it pinned to 3.10? I noticed you got the cryptic formatargspec error - I managed to solve it for Python 3.11 with some upgrades to pylint. If you'd rather the latest Python I'm happy to submit those changes as a PR.

#

Looks like you got it running on 3.10 which is good.

lone axle
#

Have you seen the Black / Click issue that I ran into before? that one was new to me.

proven garnet
#

Yeah, I have - if I remember correctly that was that click implemented a change where they removed that library and black still referenced it. So it was basically a mismatch between the two.

#

Basically no version of click was pinned, so their upgrade broke things across anything using black

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#
  1. The internal definition of ticks in moduasyncio was still wrong, in a way that deceptively seemed to work sometimes
  2. select() was not interruptable with ctrl-c
  3. socket objects are now selectable -- implementation tested on rp2040 only at this point -- needs further changes in asyncio module itself

Here's my test program, which connects to a netcat -l 5153 already running on my laptop bert. When I type something into netcat and hit enter, it's received and echoed back, with...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I've just written a library for the community bundle for the XIAO nrf52840 (PR pending: adafruit/CircuitPython_Community_Bundle#121)

Great news, I feel it is a sensible thing to do, I guess I should try that.

My question was maybe more about the trade-off between, on one side:

  • sharing one firmware for multiple hardware
  • reducing the CICD computation
  • reducing S3 storage
    and on the other side:
  • make it eas...
orchid basinBOT
manic glacierBOT
#

Just a note that I'm seeing this intermittently too, on a CPX when calling cpx.play_file(). I haven't prepared a minimal repro case or bootloader/version info yet, I'm crunching to get https://github.com/usefulsensors/person_sensor_tv_remote/blob/main/code.py done unfortunately and it's not a blocker for me, but I wanted to at least mention that it comes up outside of the original context.

manic glacierBOT
#

I have found one of the big issues I was having with the XIAO esp32c3. You have to have the antenna attached for it to work with the webserial. It also seems to have an affect on every other means of interacting with it. I am not sure why this is, but was able to get MU Editor to work pretty consistently. The adafruit webserial works now and is pretty reliable. Thonny is still not working with this.

manic glacierBOT
wispy badger
#

Hello there, I discovered something strange while doing some testing with CircuitPython today.

#

This script calculates the Pi using an approximation algorithm.

#

I ported the code in C to run on an Arduino Nano and I noticed something strange.

#

The execution time of the script was linear depending on how many iterations of the algorithm I was doing.

#

On CircutPython on the other hand the execution time grew exponentially

#

and the memory usage grew on each iteration

#

That's the code of the algorithm:

#

def calculate_pi(n):
"""
Calculate the value of pi using the Bailey–Borwein–Plouffe formula.
"""
pi = 0
k = 0
while k < n:
pi += (1 / (16 ** k)) * ((4 / (8 * k + 1)) - (2 / (8 * k + 4)) - (1 / (8 * k + 5)) - (1 / (8 * k + 6)))
k += 1
return pi

#

After a lot of testing I found out the culprit. It is this experession: 16 ** k

#

I replaced it with math.pow(16,k)

#

and I now have linear performance and no memory increase at all. Also the speed diference is huge.

#

For 1500 iterations the scipt needed 6.8sec with the ** expression and only 0.2 sec with math.pow function.

#

I don't know if it is a bug, I just wanted to let you know.

stuck elbow
#

might be a good idea to report it as an issue on github

wispy badger
#

Thanks for the feedback. Report it on the main CircuitPython repository or somewhere else?

stuck elbow
#

I think the main repository is best

manic glacierBOT
#

CircuitPython version

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

Code/REPL

import math, time

def calculate_pi(n):
    """
    Calculate the value of pi using the Bailey–Borwein–Plouffe formula.
    """
    pi = 0
    k = 0
    while k < n:
        pi += (1 / (16 ** k)) * ((4 / (8 * k + 1)) - (2 / (8 * k + 4)) - (1 / (8 * k + 5)) - (1 / (8 * k + 6)))
        k += 1
    return pi

def calculate_pi_pow(n):
 ...
wispy badger
#

@stuck elbow Thanks, I just submitted a report.

onyx hinge
#

you can also write 16.**k so that the power operation is done as a floating point calculation rather than an integer calculation

manic glacierBOT
#

The information in this thread might prove useful ...
https://forums.raspberrypi.com/viewtopic.php?t=339994

I added code to unblock the use of GPIO29 for AnalogIn and as expected it disrupted the use of the pin as GPIO:

>>> import microcontroller
>>> a = analogio.AnalogIn(microcontroller.pin.GPIO29)
>>> a.value
31799
>>> import wifi
[CYW43] cyw43_kso_set(1): failed
F2 not ready

At this point the module required a reset before it would work again.

#

The types of the expressions are different. Python and CircuitPython represent ints (integers) exactly, but the memory storage and computation time increases according to the length of the number; floats always use a constant amount of storage but don't represent values exactly:

>>> type(16**k)
<class 'int'>
>>> type(pow(16, k))
<class 'float'>

you can also write 16.**k so that the power operation is done as a floating point calculation rather than an integer calculation.

onyx hinge
#

<@&356864093652516868> hey all! Our weekly meeting is coming up in a few hours (3ish) but remember to double check your local time, as most of the US switched to winter (standard) time over this past weekend. It's a good time to add your notes to the document! See you a little later today. https://docs.google.com/document/d/1BtwVBaXLXcFHM52SGlMX0-7K0m3r_e-T6l6MLfux5KI/edit?usp=sharing

random junco
#

Thanks jepler!

manic glacierBOT
onyx hinge
#

hey @random junco, @turbid radish says that the newsletter is ready to crib from for the meeting notes!

random junco
#

great, thank you!

wispy badger
#

Very interesting, didn't know this difference\

onyx hinge
random junco
#

@tulip sleet: Would you be willing to speak to the core in the weekly meeting?

tulip sleet
onyx hinge
#

sure!

random junco
#

great, thank you!

onyx hinge
#

as though I know what is going on...

manic glacierBOT
midnight ember
#

2pm or 3pm?

random junco
#

Now

onyx hinge
#

We're a few minutes away from starting the meeting

#

adafruit folks are wrapping up our internal meeting but no reason for paul not to get started 🙂

random junco
#

no hurry. 🙂

idle owl
#

Ah Jeff beat me to it. We'll be there soon!

midnight ember
#

come on ya scallywags

lone axle
onyx hinge
#

(swoon emoji)

lone axle
random junco
#

I've lost sound

onyx hinge
#

🤯 * 206300 PyPI downloads over 322 libraries

gilded cradle
#

Is Paul still using a browser?

idle owl
#

@random junco Everyone else's sound is working. Are you not hearing us?

onyx hinge
#

@random junco do you need someone to take over the meeting?

random junco
#

It's me, I don't know what's happened

#

I'm so sorry

midnight ember
#

@lone axle 🎉

#

good job

#

no worries Paul, apple's got plenty of issues lately.

gilded cradle
#

It's all good @random junco. We've all lost audio at some point.

idle owl
#

No worries, @random junco! It's happened to all of us. Seriously.

lone axle
#

it sounds similar to how my sound cut out the last few meetings at points. I was using the browser to record discord and speak. I've changed over to using the app today🤞

midnight ember
#

yeah that dev setup stream was awesome

#

been enthralled with all the great stuff happening at supercon this weekend. really great stuff.

onyx hinge
#

belated hug report for everyone who joined in during hactoberfest

#

(cgrover, you seem professional enough to me)

errant grail
midnight ember
idle owl
#

Thanks, foamyguy! 🎉

lone axle
#

I'm not familiar with the MCP2307 chip, so can't be sure. But the Debouncer library I'm pretty sure has ability to interface with arbitrary functions which should make it possible to use for even non-standard digitalio type stuff.

midnight ember
#

I'll take another look into the library. Figured it would require access directly to GPIO pins like the keypad library code does.

onyx hinge
#

@midnight ember do you need to set each of the chips to a separate address by soldering at least one of those address pads?

midnight ember
#

They're on 2 separate busses so I can get away with using the same address. Didn't know I could chain them if I really needed to. Since designing the PCB figured out I can get 8 chips per bus if needed. Right now have 1 chip per bus and still have 10 unused GPIO... god i love expander chips.

onyx hinge
#

aha ..

midnight ember
#

whew Kattni's been busy

ember iris
#

That's a full plate for sure

idle owl
idle owl
onyx hinge
#

it was early christmas in the internal meeting, in terms of work assigned 🙂

lone axle
idle owl
#

Oh and I will also finally be taking the time to update the Contributing to CircuitPython using Git and Github guide!

midnight ember
#

I saw that example but decided to go a different route with enumeration which ended up being a dead end. Will give that a shot thank you.

onyx hinge
#

excellent work on the composite actions, belated hug report @proven garnet

candid sun
#

i realized after the meeting began that i neglected to add notes, but just wanted to say group hug to all.

onyx hinge
#

Thanks Paul!

midnight ember
#

Thank you Paul for hosting.

idle owl
#

So greatly appreciated! Thanks so much, Paul!

gilded cradle
#

Thanks Paul

errant grail
#

Thanks Paul!

lone axle
#

Thanks for hosting Paul. Have a nice day everyone! 🎉

candid sun
#

thanks paul!

errant grail
#

@random junco , I have many stories that would easily eclipse your experiences. It's all part of the game.

manic glacierBOT
#

Doc build error (I think it just changed out from under us:

terminalio/__init__.pyi:46: error: Incompatible default for argument "status_bar" (default has type "None", argument has type "TileGrid")  [assignment]
terminalio/__init__.pyi:46: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
terminalio/__init__.pyi:46: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
ember iris
#

Thanks all! Have a great week everyone!

onyx hinge
#

😅

random junco
#

thanks all for the support. It's appreciated. 🙂

midnight ember
#

Kattni doing an entire session with only her voice sounds like it takes the cake. big oof. lol. these things happen.

#

this is why we have people here who record backups, these things happen, kind of regularly, just part of internet life.

idle owl
#

I could hear everything, OBS was acting like it could, but only my side came through. 🤷🏻‍♀️

errant grail
#

I performed a music gig as a duo with new in-ear monitors. Forgot to turn on the PA for the audience for the first two songs.

midnight ember
#

in OBS when others are talking you want to see that VU meter going back and forth 😉

idle owl
#

@errant grail Don't forget to disconnect from the voice chat to avoid surprises.

errant grail
#

Yes, and that's just one of many similar experiences.

midnight ember
#

as a DJ who wore headphones, imagine sliding into the next track that is muted. sounds fine in the headphones... also why i'm deaf in 1 ear now.

proven garnet
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/1_pM6rZNwdHXKLP69lmqDRBxVVnlMj-TsIRuRjjSCyEU/edit?usp=sharing

random junco
random junco
#

awesome, thank you

trim elm
#

@proven garnet Hihi. I heard we are working on fixing the pylint stuff and was told to ask you for more info on what specifically the problem is

manic glacierBOT
#

CircuitPython version

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

Code/REPL

import usb_hid
import board
import digitalio
from adafruit_hid.mouse import Mouse

mouse = Mouse(usb_hid.devices)
time.sleep(5) ## 5 sec delay
mouse.move(y=20)
time.sleep(5)
move.mouse(y=20)

Behavior

whenever the Pico board is attached to the iphone using the usb adapter, the initial location of the pointe...

minor plume
#

My apologies for missing the meeting today, all. Despite having a block on my work calendar for that time, I was scheduled for TWO conflicting work meetings during that time. 😕

jaunty juniper
onyx hinge
# manic glacier

@tulip sleet do you know if we have a USB HID descriptor for an absolute pointing device (custom descriptor etc)? (I ask due to the above issue)

proven garnet
proven garnet
thorny jay
onyx hinge
manic glacierBOT
#

The HID mouse that CircuitPython uses by default can only send relative motions. It's up to each device where the mouse pointer is placed when the device is first plugged in.

The first workaround that comes to mind is that you could begin by sending a series of large moves so that no matter where the mouse pointer started, it ends up in a known corner of the display, and moving from there by known increments. This should be possible just with changes to how Mouse is used.

A more advance...

jaunty juniper
#

not ready for bundle but with an example including the boot.py and code.py

#

@onyx hinge 👆 (and @thorny jay )

thorny jay
onyx hinge
#

thank both! I went ahead and put those links in

manic glacierBOT
#

And I used that in this piece of code from the gist here:
https://github.com/dglaude/CircuitPython_udraw_Absolute_Mouse

The difficulty is that not all devices do accept and understand "absolute mouse" as that was the case for my Nintendo Switch. So to deal with that I just did what @jepler describe by translating into CircuitPython an Arduino library: https://github.com/dglaude/AGTD_CircuitPython/blob/main/mouseto.py
So the trick is to move the mouse in a corner, on the 0,0 side, and the...

thorny jay
onyx hinge
# manic glacier

I keep meaning to look at the macros and figure out why my mistake want a compile error

manic glacierBOT
#

Use the py/argcheck.c mp_arg_validate...() routines here instead, if possible. This allows reuse of existing error message, saving space, and saving work for the translators. Look at some other uses of mp_arg_validate* in ports/*/common-hal/.

If there is no existing routine you can use, at least try to reuse an existing error message. Use the %q (for QSTR) designator in the error message, so you can pass in an MP_QSTR_... arg name.

amber sundial
#

Yesterday I successfully followed this guide for Building CircuitPython using Windows 10 (21H2 Build 19044.2130) and Windows Subsystem for Linux (WSL) running Ubuntu. Hooray!! It went pretty smoothly and the guide is excellent. https://learn.adafruit.com/building-circuitpython/build-circuitpython

Some of the steps were slightly different for me though:

https://learn.adafruit.com/building-circuitpython/windows-subsystem-for-linux

Some added comfort:

  • WSL 2 is now default with a new install, it didn't need to be seperately enabled
  • Moving Files to Windows has become much easier: you can call explorer.exe . from WSL and copy the files via the GUI
  • There easy to setup intergration with VSCode following these instructions https://learn.microsoft.com/en-us/windows/wsl/setup/environment

Rust needed to be installed

  • in order to install requirements-dev.txt and requirements-doc.txt, I needed to install Rust first (didn't come with Ubuntu):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh```

You can verify the installation by running:

```source $HOME/.cargo/env #Import the environment config for rust
rustc --version```

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

**Some unzip weirdness**
- in WSL2, this only worked without errors using sudo: `sudo tar xvf <name of the .bz2 or .xz file you downloaded>`

**.profile and .bashrc**
- .bash_profile is just .profile in WSL2
- path format needed to be `export PATH="$HOME/bin/gcc-arm-none-eabi-10.3-2021.10/bin:$PATH"`
- in order for the paths to work I had to restart WSL2 Ubuntu

I ended up adding these three lines to .profile and .bashrc:
```. "$HOME/.cargo/env"
export PATH="$HOME/bin/gcc-arm-none-eabi-10.3-2021.10/bin:$PATH"
export SETUPTOOLS_USE_DISTUTILS=stdlib```

Maybe one or two of these things might be worth adding to the guide. Other than that, the build process went smoothly and the .uf2 work on the boards I had. 🍩 🍩  🐘
manic glacierBOT
#

Hi, I love circuit python, you are doing a great work
working on display independent terminal aps which can use "print" command to show
data in terminal style on LCD display
Unfortunately on 0.96" 80x160 display I kill half of display with blinka logo
I found command
supervisor.status_bar.console = False
it disable text but logo remaining and half of display is death
I read somewhere that is compilation option but I prefer mainstream distribution for Raspberry PICO instead custom bui...

tulip sleet
tulip sleet
#

that seems like you were in a non-user directory when you tried to un-tar? Could you go to your home directory and tar xvf without sudo? Or maybe you downloaded with different permissions?

amber sundial
tulip sleet
#

/usr/bin ?

amber sundial
#

yes

tulip sleet
#

or ~/bin ?

amber sundial
tulip sleet
#

ah yes, you shouldn't try to unpack there, it's for sudo apt-installed stuff. Instead you can create ~/bin, say, and then add that to your PATH. I'll make this clearer: I was assuming the user was more famliar with Linux directory layout

#

regular users should not write in /usr/bin or /bin, etc

amber sundial
#

ah I just put the .tar.bz2 there because that's where I wanted the files to end up

#

FWIW it worked even if unorthodox

tulip sleet
#

it did work, but the danger is accidentally overwriting an existing system file, so I'll make clear to put it in a directory under your home directory

amber sundial
#

OK that makes sense

tulip sleet
#

analogy is that you don't want to put stuff in the C:\WINDOWS folder

#

again, thanks for the feedback, it is very helpful, because I make unknowing assumptions.

amber sundial
#

that's why I had to set the path to PATH="$HOME/bin/gcc-arm-none-eabi-10.3-2021.10/bin:$PATH"

#

I'm just discovering the various bin directories

#

fun 😀

#

learning has occurred

manic glacierBOT
#

To download CircuitPython binaries, go to https://circuitpython.org/downloads and select your board. On the right hand side are links to the downloads for that board, including stable (7.3.3), unstable (8.0.0-beta.4), "absolute newest", and "past releases".

Note that if a board was added subsequent to the 7.3.3 release, it may only have an unstable or absolute newest release.

Source code can be downloaded from github by using the git command-line program. Each release is "tagged", so on...

manic glacierBOT
#

"Feather S3" is a bit ambiguous.

Unexpected Maker FeatherS3 download page has links to 7.3.3: https://circuitpython.org/board/unexpectedmaker_feathers3/

Adafruit Feather ESP32-S3 No PSRAM has links to 7.3.3: https://circuitpython.org/board/adafruit_feather_esp32s3_nopsram/

Adafruit's other Feather boards with S3 do not have links to 7.3.3, because they were added after 7.3.3:
[Feather ESP32-S3 4MB Flash 2MB PSRAM](https://circuitpython.org/board/adafruit_feather_esp32s3_4mbflash_2m...

lone sandalBOT
proven garnet
#

@jaunty juniper I think I fixed the installation instructions for the cav module and confirmed using circup.

#

Thanks again!

manic glacierBOT
#

Because this must be treated like an in-use pin for all other purposes, unfortunately a special case must be added in shared-bindings.

Multiple AnalogIn objects for VOLTAGE_MONITOR can be created (because in use tracking isn't working) but this causes no harm.

Testing performed: Read the monitor, then imported wifi. When the pin state was insufficiently restored, the second step would fail with debug messages about do_ioctl timeout.

import analogio, board
a = analogio.AnalogIn(...
onyx hinge
#

aha the voltage still seems a bit low because it's one diode below VUSB, albeit with the very low forward voltage MBR120VLSF. So 4.8 is plausible.

manic glacierBOT
#

I can look into the changes you suggested, thanks for the pointer. I'd much prefer to use an established pattern than something ad hoc.

Just for some background, most of the error messages were present in the nrf port, so the translations appear to be reused - the translation file now has 2 file references for the same translation text that already existed. This should mean reduced work for the translators. I can look into quick wins to reduce this further.

manic glacierBOT
#

The status bar is updated by sending out a "OSC" Xterm escape sequence. This can just be done with print(), though we should probably document how to do this, or add a helper routine. This gets sent directly to the connected terminal (if any), and is intercepted by the REPL display and interpreted.

Suppressing the icon is a separate thing we could allow the user to enable/disable.

midnight ember
#

any idea who does the graphics for pretty pins for the boards in product pages? i'd like one made for the MCP23017 learn guide.

idle owl
midnight ember
#

i mean for the bare chip because adafruit does sell that and the way the library uses it is different than most pinout diagrams you find on it

idle owl
#

Right, I'm saying we don't do PrettyPins for chips, we do them for microcontroller boards.

#

It's not designed to work with chips as it is.

midnight ember
#

ok can i recommend a graphic for the MCP23017 learn guide because the pinouts are very confusing to use the first time. they start on the right side of the chip.

onyx hinge
midnight ember
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.4 on 2022-10-30; Seeed Studio XIAO ESP32C3 with ESP32-C3FN4

Code/REPL

from adafruit_ble_radio import Radio
radio = Radio(channel=1)
radio.send('test')

Behavior

Traceback (most recent call last):
  File "", line 1, in 
  File "adafruit_ble_radio.py", line 134, in send
  File "adafruit_ble_radio.py", line 151, in send_bytes
  File "adafruit_ble/__init__.py", line 215, in start...
#

On second thought, I don't think we can do BLE workflow given #7170

This is about half done. The two remaining large pieces are adding GATT server support and bonding support. Unfortunately GATT server support probably needs NimBLE modifications to allow for adding servers, characteristics and descriptors after things are running. The SoftDevice can do this so we've assumed it in our APIs ability to just `S...

#

Two big ones:

  • eliminating a bunch of incorrect, never-used QSTRs
  • Fixing a problem where the French translation was using Unicode code points above 255 again; this almost certainly pops French out of being the largest translation again

We should add a check for langauges that we expect all the chars to fit in uint8_t actually do, otherwise firmware grows by up to 500+ bytes...

manic glacierBOT
manic glacierBOT
#

I agree that it's useful to be able to use the whole screen for terminal on smaller screen sizes.

Neradoc posted this in the Discord, but it's really not obvious.
#help-with-circuitpython message

display.root_group[0].hidden = False
display.root_group[1].hidden = True # logo
display.root_group[2].hidden = True # status bar
supervisor.reset_terminal(display.width, display.height * 2)
display.root_group[0].y = 0
manic glacierBOT
manic glacierBOT
#

I also had to respell an œ as oe, and made changes in a few other translations as well.

we could look into a different way of storing the data (such as utf-8) but last time I looked there was a real inconvenience to storing values[] in a way that can't simply be indexed

I also noticed that some other languages, like ru, use just a small number of codes well outside the 0-255 range. A much less complicated rule could remap the 160..255 values to those code points and potentially save s...

orchid basinBOT
manic glacierBOT
#

CircuitPython version

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

Code/REPL

import time
print("Hello World!")

while True:
    print("foobar" * 50)
    time.sleep(1)

Behavior

Code runs and prints messages once per second as expected.

  • open the Mu Editor
  • set it to CircuitPython Mode
  • open the Serial panel
  • wait a few seconds for a few messages to appear
  • click around betwe...
manic glacierBOT
manic glacierBOT
manic glacierBOT
tulip sleet
#

@onyx hinge could I have an audio chat with you about translations and the compression mechanism?

onyx hinge
#

OK I'm ready @tulip sleet

#

make BOARD=adafruit_proxlight_trinkey_m0 TRANSLATION=fr

tulip sleet
#

Plus d’un tiers

onyx hinge
#

The apostrophe (' or ’) is a punctuation mark, and sometimes a diacritical mark, in languages that use the Latin alphabet and some other alphabets. In English, the apostrophe is used for two basic purposes:

The marking of the omission of one or more letters, e.g. the contraction of "do not" to "don't".
The marking of possessive case of nouns (a...

#

Although ubiquitous in typeset material, the typographic apostrophe ( ’ ) is rather difficult to enter on a computer, since it does not have its own key on a standard keyboard. Outside the world of professional typesetting and graphic design, many people do not know how to enter this character and instead use the typewriter apostrophe ( ' ). The typewriter apostrophe has always been considered tolerable on Web pages because of the egalitarian nature of Web publishing, the low resolution of computer monitors in comparison to print, and legacy limitations provided by ASCII.

tulip sleet
#

0000000 P l u s d 342 200 231 u n t i e r 0000020 s \n 0000022

jaunty juniper
#

yeah, nobody uses it

tulip sleet
#

but you don't type it on the keyboard, you are saying, so when does lemonde fancy it up

jaunty juniper
#

oe is also good enough for œ, likewise it's annoying to type on a keyboard

tulip sleet
#

does the Academie still care?

jaunty juniper
#

there's setups in software like Word, and web CMS to convert automatically

#

(and for example putting a non-breaking space before : as is required by the typographical rules)

tulip sleet
#

is there a provision in weblate for remapping certain character sequences?

onyx hinge
#

En français, l’utilisation de la ligature œ n’est pas esthétique mais linguistique, contrairement à d’autres ligatures (par exemple, fi) : œ et oe ne se lisent pas de la même manière, la deuxième forme notant un hiatus (cœlacanthe ≠ coefficient).

#

french wikipedia says that the ligature is "not aesthetic but linguistic"

tulip sleet
#

i was giving @onyx hinge the example of ligatures being important in at least some languages, and offensive if not used, like in English, w could be vv but everybody would say that's weird

jaunty juniper
#

I don't think we should aim at the typographical quality of prestigious newspapers

#

also it's mis en œuvre for implemented when implémenté is used somewhere else

onyx hinge
#

I'm sure the consistency of the translations could be better!

jaunty juniper
#

(borrowed from the english, it has entered the French language)

onyx hinge
#

which is .. better ?

tulip sleet
#

feel free to modify the french translation if you have ideas about that

onyx hinge
#

or do a corsican translation 🙂

jaunty juniper
#

yeah

#

by the way, things not to do:

mp_raise_msg_varg(&mp_type_RuntimeError, translate("%q is %q"), MP_QSTR_storage, MP_QSTR_extended);
tulip sleet
#

worth noting that in an issue, say

jaunty juniper
#

yeah I'm going through untranslated strings and taking notes

#

there's Expected a %q in many places and one Expected an %q in alarm 🤔

tulip sleet
#

could be Expected %q

onyx hinge
#
locale/circuitpython.pot:msgid "Expected a %q or %q"
locale/circuitpython.pot:msgid "Expected an %q"
#

those may be convertible to mp_obj_t mp_arg_validate_type(mp_obj_t obj, const mp_obj_type_t *type, qstr arg_name)

#

which will say mp_raise_TypeError_varg(translate("%q must be of type %q"), arg_name, type->name);

#

I can put back the oe with the single offset block now

jaunty juniper
#

why not, but I'm removing the one occurence from the translation anyway 😉

onyx hinge
#

good, thank you

jaunty juniper
#

I might be increasing the translation size by adding translated strings and fixing some stuff 🤫

orchid basinBOT
jaunty juniper
#

and I logged in with my github account to discover that I already made a weblate account, and to associate the old one with my github I delete the other one, so now the first changes I made today are credited to "deleted" 😛

onyx hinge
#

thanks @ deleted for your first contribution to circuitpython!

manic glacierBOT
#

I had a good chat with @jepler about why there are knees in the compressed-message table sizes. Look at genhdr/compression.generated.h for the tables mentioned below.

If a two-byte character is present in a message, it will cause mchar_t to go from uint8_t to uint16_t, doubling the size of the values[] and words[] tables.

Ideas about how to avoid this:

  • Just avoid those characters in the translations. @jepler has done this for some translations in #7181. Examples are the n...
jaunty juniper
#

does that need a translate ?

for (size_t i = 0; i < COMMON_HAL_MCU_PROCESSOR_UID_LENGTH; i++) {
     mp_cprintf(&mp_plat_print, translate("%02X"), raw_id[i]);
}
#

(is there an advantage, like compressing ?)

onyx hinge
#

@tulip sleet am I wrong to expect a subclass of aesio.AES to work does subclassing built in types work generally? ```import aesio

b = bytearray(16)

a = aesio.AES(b'1' * 16)
print(a.mode)
a.encrypt_into(b'a' * 16, b)
print(bytes(b))

print()

class A(aesio.AES): pass
a = A(b'1'*16)
print(a.mode)
a.encrypt_into(b'a' * 16, b)
print(bytes(b))
I started by removing the "I thought it was unneeded" type check at the top of several of the methods, but then the encryption is just .. not even performed and the mode is not set...
1
b'\xc6\xb9\xd1\x02\xdd\xea\xb1i\xf3$\xcb\xdb\xe73\xf0\n'

0
b'aaaaaaaaaaaaaaaa'

onyx hinge
tulip sleet
#

it is really weird that it made a difference; I think it may have to do with how the surrounding code was compiled and optimized

gilded cradle
tulip sleet
jaunty juniper
#

as far as I know subclassing builtin types is complicated because you can't call their dunder functions like __setitem__ since they are not exposed as properties of the class, and other side effects like that

onyx hinge
#

@gilded cradle looking .. does it matter that _LIBRE_COMPUTER_IDS is just a string, but you're using 'in' on it? It might give an unexpected result, say if self.id was a short string like C?

gilded cradle
#

Let me check...

onyx hinge
#
-_LIBRE_COMPUTER_IDS = AML_S905X_CC   
+_LIBRE_COMPUTER_IDS = (AML_S905X_CC,)
```maybe you want/need something like this.
gilded cradle
#

Yeah, I agree with that

#

It should be a tuple

onyx hinge
#

the removed function property wasn't considered part of a public API?

gilded cradle
#

No, I already changed it in Blinka

onyx hinge
#

ok

#

I'll give a formal review once you fixed the tuple

gilded cradle
#

Perfect, thanks

cedar veldt
#

Sorting the GitHub issues by "Recently updated" seems to be giving strange results recently? There are quite a lot of issues near the top where I can't see anything having been updated.

random junco
#

Maybe because the hacktoberfest label was removed?

gilded cradle
#

I think recently updated means any update such as a comment, label change, or whatever.

cedar veldt
gilded cradle
#

Which repo?

gilded cradle
#

It looks like the top issues were added to a specific milestone.

cedar veldt
#

Hmm, adding to a milestone was also shown in the update history before. But maybe GitHub isn't showing that any more.

gilded cradle
#

Ok, good example. I'm not sure why it's showing updated 12 hours ago.

#

Possibly a comment was added then removed

cedar veldt
#

There's about 15 of them at the moment

tulip sleet
#

the most recently updated ones all have a Hacktoberfest label, so seems related to that

#

except for 3 actual new ones

cedar veldt
#

Maybe the Hacktoberfest label itself was edited?

tulip sleet
#

yes, maybe that was it, though I don't know what it would have been. I think it was already capitalized. Maybe the description was changed.

cedar veldt
#

Could be the description. I think the same thing happened a week or two ago.

tulip sleet
#

I'm looking in the audit log for the organization, but don't see anything immediately. However, it has tons of stuff in it

#

i think I will give up for now

manic glacierBOT
manic glacierBOT
#

I have reproduced this, and am working on some changes to the https://github.com/adafruit/Adafruit_CircuitPython_LC709203F library to do retries and delays in various places to minimize the throwing of errors. It was interesting that the Arduino library seemed to work OK, but upon further inspection, it appears that is due to the Arduino library and example program largely ignoring many errors that occur intermittently (!). Those errors cause intermittent bad data values but the Arduino code ...

manic glacierBOT
manic glacierBOT
onyx hinge
tulip sleet
#

In this case, if this is a badge for a conference or whatever, frozen might be appropriate.

onyx hinge
#

they are having enough trouble with github that I'd have to step in and do all the submodule stuff 😕

#

which I guess is fine, I shouldn't grump about it

tulip sleet
#

if you're willing to do it, OK, but first maybe ask about whether they really want the frozen modules. Let me find another discussion of that.

manic glacierBOT
#

The build is failing for the following reason:

make: *** No rule to make target '../../frozen/Adafruit_CircuitPython_UC8151D', needed by 'build-maker_badge/frozen_mpy'.  Stop.

Additional steps are needed to properly add a new frozen module that has never been included before in any board. We have a guide on doing this via git on your local computer: https://learn.adafruit.com/building-circuitpython/adding-frozen-modules -- as far as I know you can't add a new submodule merely by...

tulip sleet
glass kite
#

Hello everyone 👋 ! I just joined the server so hopefully this is the right place to ask my question

stuck elbow
#

you won't know until you ask it

glass kite
#

I have a good few hundred neopixel LEDs and I was wondering if I could write the code for my project on my PC and control GPIO pins on the raspberry pi that's on my local network.

#

@stuck elbow sorry man took me a while to write it 🤣

stuck elbow
glass kite
#

aight, will ask it there, thanks!

stuck elbow
#

since you don't necessarily have to use circuitpython for that

glass kite
#

yeah I mean I wouldn't mind switching to arduino at all, as long as it works

#

it's actually quite funny because the library is called adafruit-circuitpython-neopixel, so... yeah, I'm sure I'm not the only one who's a bit confused 🤣

stuck elbow
#

no problem at all, it's just that you are likely to get better answers there

glass kite
#

👍

#

thanks a lot ❤️

cedar veldt
# manic glacier

I was wondering about that. The CircuitPython repo has a custom system for getting submodules, but it still works to add more using git submodule add as in the guide?

manic glacierBOT
#

print("hello battgauge")
import sys
import time
import board
import bitbangio
import supervisor
from adafruit_lc709203f import LC709203F

i2c = bitbangio.I2C(board.SCL, board.SDA)

i2c = board.I2C()
if not i2c:
print("init I2C went wrong!")
else:
print("init I2C ok")
while not i2c.try_lock():
pass
print("I2C locked!")
# Find the first I2C device available.
devices = i2c.scan()
i2c.unlock()
print("I2C unlocked!")
for devic...

manic glacierBOT
proven garnet
#

Is there a list or place I can find all the different bootloader mode names for boards (like QTPYBOOT)? Looking to write a program that helps with loading firmware but need to know what to look for.

spiral elk
#

You'd find most of them in the tinyuf2 repo, but some boards have a hardware uf2 or other bootloader and wouldn't be found there.

jaunty juniper
#

and tinyuf2 is only for ESP and STM, there are other repos for atmel and NRF

#

or you can use discotool 😉

jaunty juniper
#

you can identify a BOOT drive by the presence of INFO_UF2.TXT in it, which will also contain basic information about the board ID, but of course on RP2040 there is no way to find the board from that

spiral elk
#

I don't think there'd be any way at all at the bootloader level to distinguish between rp2040 boards

jaunty juniper
#

yep

#

discotool tries to provide an identifier for the USB port that the board is connected to, so that you can have a Circuitpython board, make it reset in UF2 mode and find it again by the port it's connected to

#

but that assumes you already had CP on it

proven garnet
spiral elk
#

with rp2040 you could read out the contents of flash and try and make some sense of it somehow.

proven garnet
spiral elk
#

since the rp2040 bootloader allows you to extract a uf2 image off of the device.

jaunty juniper
#

discotool doesn't care about the name CIRCUITPY, if finds drives connected to microcontrollers, which are defined as: USB devices with a serial port OR USB devices with a VID in the list of known VIDs

#

there is:

❯ picotool info
Program Information
 name:      CircuitPython
 version:   8.0.0-beta.2-9-g5192082e6
 web site:  https://circuitpython.org
 features:  double reset -> BOOTSEL
#

that's not good enough 😦

spiral elk
#

You could relatively easily use picotool to read the non-CIRCUITPY flash contents and compare hashes with a list of official releases, but that would only work for official builds.

proven garnet
#

Ahhh, discotool is likely what I want, thanks for the tip!

jaunty juniper
manic glacierBOT
proven garnet
manic glacierBOT
oblique iron
# manic glacier

Just shouting out that I am the one that submitted this, in case it comes up for discussion on what might need to change.

manic glacierBOT
#

Thanks very much, It is crazy, looks like there is many secret features.

not understand why
supervisor.reset_terminal(display.width, display.height * 2)

etc for 80x160 display works only
supervisor.reset_terminal(display.width,95)

and for 320x240 is best value
supervisor.reset_terminal(display.width, 260)

but now that I think about it, the status bar (without logo) is a great feature, but I would like to be able to write in it via
print()

and also need bigger font

manic glacierBOT
manic glacierBOT
manic glacierBOT
tulip sleet
oblique iron
manic glacierBOT
manic glacierBOT
#

Not sure if you or anyone has some advice about the country code commit. I know we are initializing the wifi chip early, so that the digital pins are available for general use. That appears to be the only time we can set the country code. The default wifi country is a global wifi policy.

Perhaps before wifi init we should use getenv to look at see if the user has a valid country code defined in the .env file?

brazen hatch
#

is there any way for me to build circuitpython with debug symbols and actually do meaningful debugging on picow?
The pins are there, I have a pi400, I can debug it with native gpio.

#

I have used gdb like 2 times in my life, but I really need to extract data if i'm going to implement the picow-ap

#

I have openocd configured and ready
I have tested it with a pico, and I can halt/reset it
but I don't know how to actually debug circuitpy with it

tulip sleet
onyx hinge
#

No, I haven't used gdb debugging with pico / pico w lately. I mostly do printf debugging

brazen hatch
#

Alright, thanks, I will stick to printf spam!

onyx hinge
#

You have several sub problems:

  • getting gdb to talk to your hardware
  • learning the restrictions (such as small number of breakpoints) of the debugger implementation
  • getting useful debug information into firmware.elf

For the former, you should be able to follow instructions from raspberry pi and learn about any caveats from them.

For the latter, we never strip circuitpython by default so you should have function-level information. you can make DEBUG=1 to include additional debug information such as line-level information (equivalent to gcc -g3); you must make clean and then consistently specify make DEBUG=1 or things get messed.

#

but yeah it's not how I work so I can't give you 'in the trenches' info

#

Verifying that debug info is present in firmware.elf: $ arm-none-eabi-gdb ports/raspberrypi/build-raspberry_pi_pico_w/firmware.elf GNU gdb (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.1.90.20201028-git … (gdb) list *main 0x10026f3c is in main (../../main.c:916). 911 return exit_code; 912 } 913 914 int __attribute__((used)) main(void) { …

brazen hatch
#

doesn't sound ver complicated tho, I will try it, and if it ends up working well, I will do a writeup

#

I have openocd working already with rp2040

brazen hatch
#

those picow debug pins were such a pain to solder

#

and its gonna be an even bigger pain to clean

tulip sleet
#

no real reason to clean if it's just flux

brazen hatch
#

cleaning

brazen hatch
onyx hinge
#

oof, I'd discontinue using that flux!

orchid basinBOT
tulip sleet
brazen hatch
tulip sleet
#

I am using leaded rosin-core solder for non-SMD work still

#

that kind of flux is for soldering pipes and stuff

brazen hatch
#

???
uhh what?

tulip sleet
#

don't use it on electronics. It's acidic and will eat away at your connections

#

did you buy it at the hw store?

brazen hatch
#

literally at my microcontroller retailer

tulip sleet
#

DON'T USE IT. do a search for zinc chloride flux

brazen hatch
tulip sleet
#

clean them really well but if there's flux inside the connections, you may have trouble later

#

use rosin core flux or other flux marked for electronics soldering, and tell your store not to sell that stuff

#

it's for plumbing, jewelry, stained glass, etc, NOT for electronics

brazen hatch
#

Alright, thanks a lot man! I would have never known..

tulip sleet
#

shame on that store

brazen hatch
#

This explains as to why its also conductive..

tulip sleet
#

oh man, glad we caught this early

tulip sleet
brazen hatch
#

dis, its a simple lead-free I got from the same store

tulip sleet
#

can you find a link for that?

brazen hatch
#

the leaded stuff smell nasty

tulip sleet
#

you should buy solder that's specifically marked for electronics

#

no part number on that pic; is there another label?

brazen hatch
#

oh sorry, here

#

bringing the link now

tulip sleet
#

that company sells a lot of odifferent kinds of solder

brazen hatch
#

maybe we should go to a different channel as to not pollute the dev channel

tulip sleet
#

go to hw design yah

thorny jay
tulip sleet
#

these fluxes should be labeled "NOT FOR ELECTRONIC USE". sad that they are not

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.4 on 2022-08-29; Adafruit Feather ESP32S2 with ESP32S2
Board ID:adafruit_feather_esp32s2

Code/REPL

# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
# SPDX-License-Identifier: MIT
"""CircuitPython status NeoPixel red, green, blue example."""
import time
import board
import neopixel

pixel = neopixel.NeoPixel(board.NEOPIXEL, 1)

pixel.brightness = 0.3

while True:
    pix...
brazen hatch
#

Well I mean mission success

#

alright someone left broken debug code in picow radio

#

it doesnt compile with DEBUG=1

#

more fixing to do.. I will continue tomorrow

onyx hinge
#

It was probably me. feel free to submit a fix. copypaste code from lwip seems to use the DEBUG macros as well, and the debug messages are just broken

brazen hatch
#

it's prolly a missing include

#

will fix it tomorrow (hopefully)

manic glacierBOT
manic glacierBOT
#

Using a QT PY ESP32-S2, an SSD1322 OLED display and CircuitPython 8. Currently I just have a simple clock displayed although the program has other features. I'm using the built-in RTC along with NTP. Everything works except that after a few days of just sitting untouched as a clock, random pixels start appearing along the top left of the display. If you draw over the pixels, they go away. The program isn't crashing or throwing errors.
![SSD1322 Clock](https://user-images.githubuserconte...

lone sandalBOT
manic glacierBOT
#

LED Animation Library has a class called PixelMap.

This is inspired by PixelMap, a little different, but close! With https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation/pull/103 it can support the following tested animations:

  • Comet
  • RainbowComet
  • Chase
  • RainbowChase
  • Blink
  • RainbowSparkle
  • SparklePulse
  • Solid

Not yet working:

  • plain Sparkle (unimplemented getitem)

This will probably blow out a bunch of boards which indicates it'll need to be ...

midnight ember
#

don't feel bad @brazen hatch I did the same thing when I first started. Was using plumber flux for soldering copper pipes commonly found in hardware stores. Started noticing all the joints on my boards looked like they were dissolving in acid after 3 months, because they were. Joints looked like they were 30 years old not 3 months old. Got some chip-qwik flux and everything good since. Still need to clean with alcohol though after use.

manic glacierBOT
brazen hatch
midnight ember
#

it's very possible at the time I wasn't cleaning the flux off. :/

brazen hatch
#

Lol, for me the boards were dying

#

Hence the cleaning

midnight ember
#

oof

brazen hatch
#

Though all were revived after cleaning

#

some were powering off after like 40s
some did random reboots
some reset

midnight ember
#

kinda same, i was having all kinds of weird issues. posted on the forums and someone helped me learn the error of my ways.

brazen hatch
#

and stayed with reset.

#

Anyways, now I have one morbiliion boards cuz of this

#

All were fixed with like 3€ worth of sprays and a toothbrush

midnight ember
#

if you're not getting oxidation on your joints then probably nothing to worry about it. the amount of scale buildup was visible and obvious.

#

i'll have to look into deoxit stuff. i have some but have been using 99% IPA, probably does about the same thing.

brazen hatch
#

You are free to see for yourself
They look prestine

#

the breakout is my design

lone sandalBOT
manic glacierBOT
brazen hatch
#

All yours

manic glacierBOT
#

The build failed for the following reason:

subprocess.CalledProcessError: Command 'git describe --tags --exact-match' returned non-zero exit status 128.

as a policy, each frozen submodule must point exactly at a tag (release), not at another ref. There's a script for updating all libraries. I ran it and updated your branch, so maybe this time it will build successfully.

#

Late during a build you can get a failure like

subprocess.CalledProcessError: Command 'git describe --tags --exact-match' returned non-zero exit status 128.

let's add a check early (before any board builds are started) that all frozen modules are pointing at a tag, so that hundreds of board builds can be avoided when this kind of problem exists. Prompted by problems encountered by a contributor in https://github.com/adafruit/circuitpython/pull/7135

blissful pollen
#

@onyx hinge For the NeoPxl8 was it designed (or testing done) on less then 8 strands? Noticed the PIO program always defaults to 8 despite what you set num_strands to. Looking at using it (for the PIO) revamping a project I have but not going to (yet) resolder things to multiple pins

onyx hinge
#

@blissful pollen yeah I bet it is only exactly 8 strands right now, pull request welcome 🙂

#

I was noticing that a qtpy rp2040 has 5 consecutive pins available so .. it'd be nice if that worked!

blissful pollen
onyx hinge
#

NeoBFF5

blissful pollen
#

That would be cool.

#

One other quick question is the pixel order still strand0.0,1,2,3... stand1.0,1,2,3... or stand0.0, strand1.0, strand0.1, strand1.1, etc. (if that makes sense)

onyx hinge
#

pixels[1] is strand 1 pixel 0

#

and pixels[8] (if you have 8 strands) is strand 0 pixel 1

#

in the one example you can see how to construct pixel maps that give you back the individual strands

blissful pollen
#

okay cool thanks. And I just loaded that example up

#

My past project used adafruit_pixel_framebuf and I think should just be able to take advantage of NeoPxl8 with the map

onyx hinge
#

that would be very cool!

#

speaking of which, I'm supposed to do a small text scroller for the neopixel bff (5x5) -- did you have font code that might help me out?

manic glacierBOT
#

@jepler Many thanks for your help! I tried to fix it yesterday at my local build, but without success. Do you have more info about that script to fix this issue? I saw this information at page, which you linked earlier, but I did not figure out how to make it work.

image

It would be good to mention that script in the learn guide, so peple will not strugle to fix same issue.

blissful pollen
#

Yes I do, let me see if its on Github

manic glacierBOT
blissful pollen
onyx hinge
#

yeah this is strictly 5x5 so it'll display about one letter at a time

#

I was joking about the "neobff5" (hypothetical product for 5 LED strips in bff form factor) but the 5x5 "neopixel bff" product is real

blissful pollen
#

Yeah I did basically realize that (though not really familiar with the 5x5).

manic glacierBOT
blissful pollen
#

I am curious the speed diff for 300 pixels if it is say 1 vs even 2 data lines.

onyx hinge
#

❤️ @tulip sleet thank you for making that quick improvement on the guide!

tulip sleet
#

Some folks here mentioned they seemed to need rust to install minify_html, which is listed in requirements-dev.txt. But it's a Python-only package, as far as I can tell. I don't have rust installed and I am able to use the package.

#

under what circumstances does it need rust, or am i misunderstanding?

onyx hinge
#

@tulip sleet it probably depends whether there is a wheel available for your system. The description on github says "A Rust HTML minifier meticulously optimised for speed and effectiveness, with bindings for other languages."

#

so it's probably affecting m1 mac folks for instance, but not linux folks?

tulip sleet
#

ah must be, my system is too vanilla.

#

tnx!

onyx hinge
tulip sleet
#

the user in q needed it for WSL2, which is a bit strange

onyx hinge
#

they have wheels for 3.8 through 3.11 manylinux x86_64 which should cover wsl2 unless it's a very old or very new python

#

part of me thinks we could investigate other minifiers that don't depend on native modules, but .. for most users it's OK. I've never tried to install rust on my own system fwiw

#

I thought the first report came from a mac person but maybe I jumped to a conclusion or maybe there are multiple people hitting trouble

tulip sleet
#

its main virtue is that it's faster, not sure it matters given how little we have

#

anyway I am documenting the rust thing for now

onyx hinge
#

I think you can also end up with a python/pip setup that's not capable of downloading wheels even if they're available? "Support is offered in pip >= 1.4 and setuptools >= 0.8." .. but those are both super old versions now, setuptools is over 60 and pip is over 20 in versions now

onyx hinge
jaunty juniper
jaunty juniper
#
  • in order to install requirements-dev.txt and requirements-doc.txt, I needed to install Rust first (didn't come with Ubuntu):
manic glacierBOT
onyx hinge
#

@blissful pollen did you specifically have a 5 pixel tall font or did you use a bigger font via the optional 3x scaling?

blissful pollen
blissful pollen
blissful pollen
onyx hinge
#

cool, thanks for the links

manic glacierBOT
manic glacierBOT
#

Fixes #7081

Ignore pin alarm changes before deep sleep has started. Previously, the pin could change, triggering the interrupt handler, and clearing the alarm setup, preventing detecting pin change during deep sleep. Now the interrupt routine ignores changes until the last possible moment. There is a tiny sliver of a race condition, but it is very, very narrow.

@billedluh Could you test this? IThanks. tested on a Feather RP2040, grounding a jumper many times before sleep. I was able t...

#

That routine sets a single boolean, so it's very tiny, and probably done inline, then the reset happens. Since the reset doesn't mess with the interrupts, even if I guarded alarm_pin_pinalarm_entering_deep_sleep();, there would be a time immediately after it, and before the reset_cpu();, when an interrupt might happen. So I'm not sure it would help any. But maybe I'm thinking about it wrong.

manic glacierBOT
cedar veldt
#

Hi, I was wondering about drive strength on RP2040. Not found anything about it in the source code yet.

#

Datasheet says "The GPIOs on RP2040 have four different output drive strengths, which are nominally called 2, 4, 8 and 12mA modes"

tulip sleet
cedar veldt
#

What about PulseOut and PIO?

tulip sleet
#

it is not set in those

#

digital/DigitalInOut.c line 107 and busio/UART.c line 135

#

If you'd like to make a PR, that would be great

cedar veldt
#

Do you mean it should be 12mA for everything?

tulip sleet
#

I'm looking up some PR's

tulip sleet
cedar veldt
#

I see the default is 4 mA

#

I have some IR things on PulseOut and PIO where 12mA would be plenty but 4 is perhaps not quite doing it

#

And a visible LED with PWM that might be dimmer than expected?

tulip sleet
#

yes, if there's no API to change it, it should be the max. There is a bit of an exception on the nRF chips, where high drive strength on pins near the radio can cause interference, so they don't recommend it.

#

but we know about that

last forum
#

Hey, there’s a really interesting confluence going on right now. The graphical, sound-focused programming language plugata just gained the ability to compile into Python. That puts it in sniffing distance of working on any CircuitPython board, which means that DIY synth builders can build on embedded platforms and, probably most excitingly, it’s an editor that can reach a whole new kind of brain for any digital, embedded project.

#

(Sorry to interrupt. I’m really excited.)

cedar veldt
last forum
#

Also, I didn’t know you could switch current supplies on pins and that’s really cool.

cedar veldt
#

Higher drive strength than needed isn't normally a problem as long as your circuit is OK, while lower than needed can mean that stuff doesn't work.

last forum
#

plugdata x CircuitPython

mystic flume
#

Hi all, I'm currently looking atulab: (https://github.com/v923z/micropython-ulab); it's got a bunch of extra functions in python files in the snippets directory. These aren't automatically imported when circuitpython is built, but I think they could be really useful. I've tried setting FROZEN_MPY_DIRS to the snippets directory, but I just get errors with relative imports, however, the bin file is about 18k bigger, which sounds about right. ere to

#

I've tried also creating a separate frozen dir and creating a separate ulab dir there with it's own __init__.py, but that doesn't seem to import at all well

#

Any suggestions?

#

When I say the second attempt didn't import I mean that I couldn't see any of the snippets I was hoping would be included

mystic flume
last forum
#

@mystic flume RIGHT?

#

It’s got 20 years of codebase, but Timothy’s work on it from just the last two years turning into his fork is monumental. It’s like he’s made a whole new thing in two years with all the benefits of people collaboring on it since 1992 or something.

#

Holy crap 1992 is 30 years ago, not 20. I keep forgetting.

mystic flume
jaunty juniper
#

so I bought 2 pybstick boards, one is RP2040 with 1MB of flash and the other is a ESP32C3 with 2MB of flash, dunno if I should bother trying to add them to CP with those limitations...

last forum
#

I just checked: it was first released in 1996, so at least that’s only 26 years ago.

mystic flume
#

comes in at 719kb flash usage for circuitpython

#

so you've got about 300k-ish of space for the flash drive etc - enough to play with

jaunty juniper
#

yeah that's what it has in MP

cedar veldt
jaunty juniper
#

(they ship with MP)

mystic flume
#

Dunno about ESP32 - I presume needs more space for bluetooth/TCP/IP stack?

last forum
jaunty juniper
#

ah no I think the C3 is 4 MB, I misread, that's more standard at least

cedar veldt
#

Including rules about "total current drawn from all GPIOs"

#

Limiting the current for your circuit by using the drive strength doesn't seem like a good idea, since it's not that well-defined

mystic flume
#

Here's some info from broadcom about the raspi:

#
Two reasons:
1. The raspberry-Pi 3V3 supply was designed with a maximum current of ~3mA per
GPIO pin. If you load each pin with 16mA the total current is 272mA. The 3V3
supply will collapse under that!
2. Big current spikes will happen especially if you have a capacitive load. That will
"bounce" around all the other pins near it. It is likely to cause interference with the
SD-card or even the SDRAM behaviour.
What is a safe current?
All the electronics of the pads are designed for 16mA. That is a safe value under which you
will not damage the device. Even if you set the drive strength to 2mA and then load it so
16mA comes out that will not damage the device. Other than that there is no guaranteed
maximum safe current.```
#

Unfortunately seems like a lot of data sheets don't seem to state max current source/sink per pin these days

#

I'm looking particularly at the nordic chips here Grrr

cedar veldt
#

So it is about interference. Not totally straightforward then.

manic glacierBOT
#

Custom font compilation works with brutalist-6.bdf
My font Pavlova16s.bdf give this errors:
`make BOARD=armachat
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
mkdir -p build-armachat/genhdr
GEN build-armachat/genhdr/moduledefs.h
QSTR updated
Traceback (most recent call last):
File "/home/bobor/Desktop/circuitpython/ports/raspberrypi/../../tools/gen_display_resources.py", line 94, in <module>
b[overall_bit // 8] |= 1 << (7...

#

This allows vectorio shapes to be hidden with a property on the objects. Previously the only way to hide them was by putting them into a Group and then hiding the Group. With these changes they can be hidden directly without a parent group.

I used this code for testing the new functionality:

import displayio
import vectorio
import board
from adafruit_display_shapes.circle import Circle
import time

display = board.DISPLAY
main_group = displayio.Group()

palette = displayio...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Without reading the datasheet, I was imagining that you could disable interrupts, set up the wake interrupt sources, and then reset without ever enabling interrupts, a la:

disable_interrupt()
enable_pinalarm()
// (no enable_interrupt() here
reset()

this would make it so that there's no window before reset where interrupts are enabled. But it depends on the post-"reset" CPU state not caring that interrupts were disabled pre-"reset". This is analogous how __WFI for entering light...

onyx hinge
#

well that's weird. I tried reactivating WFI in port_idle_until_interrupt on rp2040. My picow starts and resets just fine but either timekeeping or sleep() time are messed until I do something like write to CIRCUITPY! my main loop looks like this: while True: pop.frame() pixels.show() time.sleep(.10) i += 1 t1 = adafruit_ticks.ticks_ms() diff = adafruit_ticks.ticks_diff(t1, t0) if diff > 1000: print(f"{i * 1000 / diff:.0f}fps") t0 = t1 i = 0 and before any change it consistently prints 10fps. This makes sense because the sleep of .10 seconds is huge compared to the computation time. But right after the change, it prints 7FPS! until I write to CIRCUITPY, and then it prints 10FPS! ```diff
diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile
index 5095c4c1f8..7f9a3a09fe 100644
--- a/ports/raspberrypi/Makefile
+++ b/ports/raspberrypi/Makefile
@@ -127,6 +127,7 @@ INC +=
-I../shared/timeutils
-Iboards/$(BOARD)
-Iboards/ \

  • -isystem ./../../lib/cmsis/inc
    -isystem sdk/
    -isystem sdk/src/common/pico_base/include/
    -isystem sdk/src/common/pico_binary_info/include/
    diff --git a/ports/raspberrypi/supervisor/port.c b/ports/raspberrypi/supervisor/port.c
    index 781d2b11d2..7a5ed9ccb4 100644
    --- a/ports/raspberrypi/supervisor/port.c
    +++ b/ports/raspberrypi/supervisor/port.c
    @@ -72,6 +72,9 @@

#include "supervisor/serial.h"

+#include "tusb.h"
+#include <cmsis_compiler.h>
+
extern volatile bool mp_msc_enabled;

STATIC void _tick_callback(uint alarm_num);
@@ -269,10 +272,9 @@ void port_interrupt_after_ticks(uint32_t ticks) {

void port_idle_until_interrupt(void) {
common_hal_mcu_disable_interrupts();

  • if (!background_callback_pending()) {
  •    // TODO: Does not work when board is power-cycled.
    
  •    // asm volatile ("dsb 0xF" ::: "memory");
    
  •    // __wfi();
    
  • if (!background_callback_pending() && !tud_task_event_ready()) {
  •    __DSB();
    
  •    __WFI();
    
    }
    common_hal_mcu_enable_interrupts();
    }
tulip sleet
#

@onyx hinge given that reset_cpu() is not really a reset, I don't see a way to prevent a single instruction window that would lose an interrupt. Maybe a restructuring of when the alarm pin interrupts are actually set up would help, but it's kind of a major change. The PR is still much better than the previous situation.

onyx hinge
#

this is with the serial repl open

manic glacierBOT
onyx hinge
manic glacierBOT
#

This needs thorough testing before it's merged, as we tried and reverted this once before (#5341 and #5356).

I think that besides checking for tinyusb having "something to do", the fact that port_interrupt_after_ticks and port_disable_tick weren't implemented that was causing a secondary problem.

I've tested this on a pico w over reboot-cycles and ctrl-c-cycles, with and without drive automounting, with and without serial repl open, and on a power-only connection.

I didn't notice...

manic glacierBOT
lone sandalBOT
manic glacierBOT
#

CircuitPython version

CircuitPython 8.0.0-beta.4-17-g9e94d7e75 on QT PY ESP32-S2

Every time you change the text on a label it consumes around 6.4K of free memory.

Code/REPL

from adafruit_display_text import label
from adafruit_ssd1322 import SSD1322
from board import D9, D17, D18, SPI
import displayio
import gc
import terminalio

displayio.release_displays()

display_bus = displayio.FourWire(SPI(), command=D9, chip_select=D18, reset=D17, baudrat...
manic glacierBOT
#

Hi, that's not a memory leak, Circuitpython uses a garbage collector.
As the program runs memory is allocated and mem_free() goes down until it can no longer allocate, which triggers the garbage collector, which you can call in your loop with gc.collect() and see if the mem_free stabilizes, as it should, more or less. If it doesn't, then we can look into a memory leak.

Assigning a new text to a label means discarding the previous image representation of the label and creating a new one,...

manic glacierBOT
#

Ported some of this project from the UM Feather S3 + TFT featherwing to an Adafruit Feather S3 4mb/2mb + RGBmatrix panel + RGB matrix featherwing. It's also crashing into the hard fault handler. Reliably. Only experimented with it for a couple hours last night. Initial impression is the timing related bug is still present on 8.0.0 beta 4. Fault handler crashes to safe mode which requires a hard reset. It only crashes when wifi is added to the code, was trying pull API data from an online so...

manic glacierBOT
#

Unfortunately, the garbage collection doesn't occur until the program is almost out of memory. With the loop above, the 2 MB of memory is depleted in under 30 seconds. I only noticed the usage because it is part of a much larger program that was experiencing weird memory crashes.

I will try the bitmap_label tonight. I did insert a gc.collect() when I noticed but it just seemed like bad practice.

Are there any other Display IO text objects optimized for fields whose text changes eve...

manic glacierBOT
#

Unfortunately, the garbage collection doesn't occur until the program is almost out of memory.

That is how it works. Garbage collection triggers when the code tries to allocate memory and there is no space left in the "free" memory. It does not mean that the board is out of memory, it just means that it's time to clean up. Calling it manually is a form of memory optimization that can be efficient in reducing memory fragmentation typically, if called in strategic places.

I only notic...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

My project is also audio synthesis. Timing is critical, and I'm trying to find a way to do it with the PIO, but the FIFO is extremely small for buffering audio, and with CircuitPython I don't have the option of triggering an interrupt to run the generation code as needed. I haven't written any code yet, so I'm not sure exactly how limited I'm going to be yet, but the ideal situation would be to be able to use the second core to generate the audio and the first to handle user input and the...

manic glacierBOT
#
[adafruit/circuitpython] New branch created: crcibernetica\-ideaboard
analog bridge
manic glacierBOT
#
[adafruit/circuitpython] New branch created: pull/7198/head
manic glacierBOT
orchid basinBOT
lone sandalBOT
manic glacierBOT
manic glacierBOT
#

bitmap_label use 4K as opposed to 6.4K per loop.

from adafruit_display_text import bitmap_label
from adafruit_ssd1322 import SSD1322
from board import D9, D17, D18, SPI
import displayio
import gc
import terminalio

displayio.release_displays()

display_bus = displayio.FourWire(SPI(), command=D9, chip_select=D18, reset=D17, baudrate=10000000)
display = SSD1322(display_bus, width=256, height=64, colstart=112)

mem_label = bitmap_label.Label(terminalio.FONT,
                ...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

We talked about it on the Discord a few days ago but I thought I should raise it here too.

  • The datasheet says "The GPIOs on RP2040 have four different output drive strengths, which are nominally called 2, 4, 8 and 12mA modes", and the default is 4mA.
  • CircuitPython currently sets it to 12mA in DigitalInOut and UART, and doesn't set it for PulseOut, PWMOut or PIO.
  • CircuitPython policy is normally to use max drive strength except where there's a particular reason not to?
  • There coul...
manic glacierBOT
orchid basinBOT
#

I noticed this stacktrace in one of the actions task for the scheduled jobs:
https://github.com/adafruit/circuitpython-org/actions/runs/3460106060/jobs/5776269092

it's inside of `adabot.update_cp_org_libraries step

Running circuitpython.org/libraries updater...
Run Date: 14 November 2022, 09:24AM
 - Report output will be saved to: /home/runner/work/circuitpython-org/circuitpython-org/bin/adabot/libraries.v2.json
Unhandled exception list index out of range
Traceback (most recent ...
manic glacierBOT
orchid basinBOT
#

Yeah that should be the step that gathers all the information needed for generating that page. If it fails, I assume it uses the existing (previous day's) information when regenerating the website since that file never gets overwritten.

That's also my code from adabot that's causing it to fail so I can wrap it in a try/except - looks like it trips up checking the CI status if the CI has never run, so I can patch that.

manic glacierBOT
manic glacierBOT
orchid basinBOT
#

If we do this, I'd prefer to also redirect /board/board-name to /boards/board-name. The redirect to all the boards would then go from /downloads to /boards. This would make more sense if we ever created a circuitpython.org json REST api as well. https://circuitpython.org/boards/raspberry_pi_pico_w.json, etc.

In hindsight, this what the endpoints probably should have been when the site was first built, but we went with a more traditional /downloads endpoint that kind of stuck.

If we do t...

manic glacierBOT
manic glacierBOT
#

Removed source files are a class of problem not detected by the build system, that is, if "foo.o" has been created and "foo.c" is subsequently removed, the build system does not signal a problem, it just re-uses "foo.o".

According to this test, the file is used

jjepler@bert:~/src/circuitpython/ports/raspberrypi$ echo '#error check if unused' > lwip_src/ping.c 
jepler@bert:~/src/circuitpython/ports/raspberrypi$ make
I: Building for raspberry_pi_pico_w 0 
Use make V=1, make V=2 or s...
digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

7

Members

35906

Roles

36

manic glacierBOT
#

yes, lib/lwip is used

lwip_src exists specifically so that files from lwip that unavoidably had to be modified didn't require us to change the submodule. It's nice if we can reduce this to 0.

Git does not track directories per se, so if after an update there are no tracked files in the directory, and no untracked files in the directory, I think git removes the empty directory. Likewise in a fresh clone it will not create the directory in the first place.

#

I tested this successfully on a NeoTrellis M4 using this modified version of the pixelmap example from the led_animation repo:

import board
import neopixel
from adafruit_led_animation.animation.comet import Comet
from adafruit_led_animation.animation.rainbowcomet import RainbowComet
from adafruit_led_animation.animation.rainbowchase import RainbowChase
from adafruit_led_animation.animation.chase import Chase
from adafruit_led_animation.animation.rainbow import Rainbow
from adaf...