#circuitpython-dev

1 messages ยท Page 364 of 1

gilded cradle
marble hornet
#

When looking at the mpy-cross pre-compiler I've been unable to find a way to select the native emitter.
Q: is it possible to invoke the emitter option while pre-compiling it on the pc?

#

This is the help message but adding emit=native either before or after the file parameter raises the error at the bottom

Implementation specific options:
  emit={bytecode,native,viper} -- set the default code emitter
  heapsize=<n> -- set the heap size for the GC (default 2097152)
```error:
`multiple input files`
crimson ferry
jaunty juniper
marble hornet
#

thank you

#

just worked

manic glacierBOT
#

Oh man Iโ€™m pretty sure this is a bad plan and there is so much to respond to ๐Ÿ˜…

How do circuitpython library developers make reliable libraries if random unrelated exceptions may be thrown at any point in circuitpython code? Are you going to ask every python library that exists to disable interrupt exceptions โ€œjust in caseโ€ for critical sections of code?

Okay, forget library developers for a second, how on earth do you teach users what is safe to put inside of a `with button.raise_on_pr...

thorny jay
manic glacierBOT
manic glacierBOT
#

You need to install some new prerequisites and bring in a new submodule or two to build. Ask on discord or in the forums for interactive help for this. The Building CircuitPython Learn Guide has been updated. See both the Linux setup part and also on the Build page, a new requirement of doing pip3 install -r requirements-dev.txt.

I followed the build steps...so not sure I see your point. I installed the recommended compiler. I sync and initialized the submodules. If this is true it is ...

jaunty juniper
manic glacierBOT
#

@WarriorOfWire I think you make a good case it is in general a bad idea, and too dangerous. :smile: This was an early-morning thought bubble that does not survive sunlight.

I was thinking of a rather specific case where the operation being terminated abruptly is safe to do so, because it is idempotent or similar. NeoPixel animations are a perfect example. They keep some internal state that can be discarded, and can be stopped at any time (at a Python call boundary, which is what this does....

analog bridge
#

@tulip sleet can't we have interrupts the same way they are done in micropython?

tulip sleet
#

yes, we can, but the restrictions as described in the MicroPython doc we have felt are onerous to explain to users; that is, it is a support nightmare

#

so we have always been looking for something safer and easier

misty garnet
#

any good prospects on the horizon?

jaunty juniper
#

I would settle for a feature like gamepad/countio integrated into digitalio

analog bridge
tulip sleet
#

that's why I opened the other issue asking for use cases. I would like to provide something more constrained than "execute arbitrary Python code when this asynchronous event happens", so settings flags, putting an event on a queue, etc. are all safer, simpler alternatives

#

there is a lot of discussion in the python world, for instance, about asyncio and how it's difficult to use, and several alternatives. I think part of the problem is that the language itself does not have primitives that lend themselves to easy handling of asynchronicity and concurrency. I'm not sure I know of a language that does, though

#

@jaunty juniper so yes, please add your use cases to that issue

#

@low sentinel 'a comments led to think about something like:

with alarm.monitor(alarm.pin.PinAlarm(board.D0))
 as stop:
    run_animation_once(stop)

You would call stop.value inside the animation at safe places to return early.

jaunty juniper
#

well, I saw the question come by in #help-with-circuitpython from people thinking in terms of interrupts to get button presses during otherwise complex animations/computations

#

we orient them towards a loop with gamepad basically

tulip sleet
#

so when the button press happens, do they want a flag to get set, what are they thinking? The problem is that interrupts is a low-level mechanism. It reminds me of the issues around threads and memory sharing. Threads is low-level; how do you make it safer to use? The usual answers are "share-none", message-passing, etc.

manic glacierBOT
#

1.) A trigger on a pin-level change from a Hall or other type of limit switch during position feedback control.

2.) The faster the response, the more accurate the positioning, regulated by actuator velocity of course

  1. Stop the positioning

Both the digital input and the motor pwm is over I2C communication, so super-fast polling will interfere with other I2C communication activities.

analog bridge
#

is such an implementation possible where state is saved during interrupt and code then resumes once the interrupt is handled?

tulip sleet
#

I often see that people don't think of writing a routine like should_i_stop() and calling it multiple times in, say, an amination. They don't think of writing routines at all, actually. Getting people to think in terms of abstractions is really difficult, and is one of the basic ideas of coding that some people don't quite ever learn, yet needs to be taught early.

tulip sleet
#

it needs to be safe and simple

jaunty juniper
#

yeah, that's my solution, a function "check the buttons" peppered every now and then

analog bridge
#

I am thinking this from the perspective of say a program is running and an i2c sensor interrupts to say that data is available to read

crimson ferry
#

@jaunty juniper can you elaborate on what you want vs. what gamepad (and the other pulse modules) provide?

tulip sleet
#

right, so how fast do you need to respond to that? Do you need to structure the program as an explicit event loop? Apparently yes. There is no implicit concurrency or event-looping in python. So we come up with all these mechanisms to provide it which are hard to explain

crimson ferry
#

my main issue is on the output side... output actions that are needed faster than code loops can happen

tulip sleet
#

even in C I you would probably not want to read an I2C sensor in an ISR, since it could take too long. You want to defer it to a safer time. Specifying when that is, is hard

#

it requires a style of programming that is foreign to the ordinary straight-line code people are taught.

#

It is interesting that the basic structure of an Arduino program is loop() !

#

in MakeCode, you can have multiple groups of program blocks: they run concurrently. There is implicit parallelism. Unfortunately there is no safe mechanism for passing info between the grioups; you just set variables, so it's basically threads and shared memory

blissful pollen
#

I like gathering use cases for it. Now that I've dived more into CP both in python and the core I think trying to collect what people want to do vs the how they have in their head is important.

misty garnet
#

the RP2040 PIO has some possibilities, especially once CP implements the JMP on GPIO capability, not super simple to program though

blissful pollen
#

I'm thinking say for a button press to abort a long animation - well how does that long animation get aborted if it doesn't still have "if this flag from an INT was set" peppered through-out, or does the developer want it to just stop that routine? like there is a part missing

analog bridge
tulip sleet
#

what we are trying to get past is that people say they want interrupts, which is a low-level mechanism, but we really want to know what they want to accomplish with interrupts. Like, do you need pointer arithmetic or do you need subscripts? One is higher-level than the other

#

@analog bridge, exactly, so instead of providing a raw interrupt mechanism, what can we do that provides the functionality you want and still be safe. My "interrupts as exceptions" proposal was very unsafe, and was rightly called out

blissful pollen
#

In theory I think countio could be used for a button press. Set that up, and then just check the count. If it goes up the button was pressed. But then you still need to now check that count

tulip sleet
#

countio is a manifestation of a particular use case of interrupts

misty garnet
#

btw, why doesn't it work on the SAMD21?

#

or just not included by default?

blissful pollen
misty garnet
#

ah

analog bridge
tulip sleet
#

yes, the origin of the idea was "I want to ctrl-C the running of a NeoPixel animation programatically".

blissful pollen
tulip sleet
#

it was "move on to the next animation". We have a lot of projects like that. E.g. Kattni's Christmas tree, you can cycle through the animations. The code seems more complicated than it should be due to having to be able to interrupt the animations

#

you could wait until an animation cycle is done, but it might be many seconds

blissful pollen
#

hmm yeah and without somehow maybe marking a function as interruptible how do you determine what to abort from and what to do then

tulip sleet
#

Yes, WarriorOfWire's point is that it's very hard to know when it's safe to interrupt, and hard to protect the unsafe places

#

the neopixel case is very safe; the animation routines have no external state except the neopixels, so you can just stop them, but in many cases it's not safe

analog bridge
#

just having an api which can check for if an interrupt has happened and how many time it has happened since the last check should solve many problems...
maybe we can expand countio to accept touch interrupts... a combination of countio and alarm api perhaps...?

blissful pollen
analog bridge
tulip sleet
#

i originally wanted to name alarm to be event, and had some ideas about having alarms put themselves on a queue. This kind of discussion is what I was trying to provoke in the interrupt-use-case issue. One thing you want to do is set a flag, another is to count, another is to enqueue

#

yes, it's an interesting q of where to put the functionality: is it on DigitalInOut, or countio, or alarm? alarm could have been implemented with functional additions to time, DigitalInOut, and TouchIn

jaunty juniper
#

reminds me I was thinking interruptible time.sleep would be nice, though it's doable with a loop

tulip sleet
#

it is not set in stone that we have to keep the current alarm API style. We do redo the API's on major versions if we think they could need revisions

misty garnet
#

any possibility of attaching a payload as well? Identify specifics of the event without additional polling (which key, which pin, etc...)

analog bridge
tulip sleet
#

Scott has talked about async versions of I2C transactions, etc. I can't remember the overall details at the moment

#

on even the smallest boards we could use some simple interrupt scheme, for stuff like button pushes to handle animation changes

#

the SAMD21 was really a stop-gap choice; its small RAM and flash are very constraining, and in the long run its feature set may need to be frozen. We keep finding space, but we are going to run out eventually

misty garnet
#

I wish it were easier to customize the builds, a web interface that you ticked which modules you wanted to include/exclude and then push go, would be pretty awesome

blissful pollen
#

I wonder for some of the current cases presented in the issue, is a new API that can do a quick callback worthwhile?
Like I define onIntCallback and pass that function and a pin to callbackio or some new API. Then that function can do the simple items like stop a servo when my distance interrupt triggered, do a quick measurement, set a flag, etc.

analog bridge
misty garnet
#

yeah

tulip sleet
#

if interrupt callbacks are done in a "soft" way (not during the actual ISR), that is fine. Some people have said callbacks are too hard to understand; I am not sure about that, but it needs to be taught to people. I don't think we need a separate module, it could be added to alarm, etc.

misty garnet
#

I would love callbacks

blissful pollen
tulip sleet
#

for things that need short latency, we p[rovide them in C. We feel there's too much variability in Python timing to do what MicroPython provides in a way that doesn't require a lot of support to the beginner

low sentinel
#

Interruptible time.sleep (I called it park_for_interrupts) would be a nice addition as it enables higher level library abstractions.
But the right thing to do here Iโ€™m pretty sure is the api that tells you how many times an interrupt has been triggered since the last time you asked about it.

#

Very easy to reason about in circuitpython and those 2 building blocks let people build whatever higher order things

tulip sleet
low sentinel
#

Oh wow yeah, pre-empting long running events is a good idea. So a limited, bounded feature would be useful (if quite advanced to use)

tulip sleet
#

alarm did initially have wait_for_alarms which did neither a light or deep sleep. light_sleep_until_alarms() really subsumes it, because the semantics is the same as interruptible time.sleep(). In fact, time.sleep() does a light sleep if it can (WFI)

jaunty juniper
#

@tulip sleet what is the desired granularity of the alarm module ? can it be implemented for light sleep without having deep sleep implemented on a port, which is a much more complex thing ?

low sentinel
#

Like, hey this library blocks for a super long time sometimes and I gotta make it timeout

tulip sleet
#

we see that in the networking code, so we have to pass in timeout values

low sentinel
#

In general thatโ€™s the right way to timeout

tulip sleet
low sentinel
#

So this would be a kind of kludgy bolt on to make libraries without timeouts more usable... Hmm. Back to being unsure. Iโ€™ll read the issue now.

tulip sleet
blissful pollen
#

I'll add some thoughts to the issue later. I'm going to hard interrupt myself and go for a walk ๐Ÿ™‚

low sentinel
#

Oh yeah that issue got out of hand ๐Ÿ™‚

tulip sleet
#

@low sentinel You're perfectly right the original concept of "interrupts as exceptions" was very unsafe. In a language in which we knew that some operation was safe, that kind of semantics is fine, but we don't have that language. At the same time the idea of forcing an early return seems to keep coming up, and it's addressed in an ad hoc way with timeouts and state checking. Maybe there's no avoiding that without knowing if a piece of code is purely functional or not. Maybe you can do all this in Haskell ๐Ÿ™‚

low sentinel
#

The C has no idea what python is doing. Itโ€™s kind of like interrupting a different thread in Java. The interrupted thread has no idea it was interrupted until it reaches certain boundaries- like Thread.sleep

tulip sleet
#

so the C just leaves a message under a rock for the Python

low sentinel
#

Making C able to set an interrupted state and then raise TimeoutException or something on the next sleep would be good imo

#

Yes basically. Would also need the means to clear it of course

tulip sleet
#

so I think you're saying that the Python code can be littered with "interrupt me here" or "open a window for this exception to come through". Maybe overloading exceptions is still not a good idea for this, I'm not sure

#

it's not always sleep where we might want to allow it, but it often is

#

if an interrupt exception happened, then the called routine would catch it and clean up in the finally. If it didn't catch it, then maybe it should never be delivered. It's kind of like saying "this routine is willing to handle these interrupts, else discard them" ??

#

i'm not sure if that's a lot different than just checking a flag, though you're right, you still need an interruptible sleep

manic glacierBOT
low sentinel
#

Think Iโ€™m saying something close to that if I understand it - but Iโ€™m talking about 2 different things.

  • general interrupts should be polled. A bonus sleep_until_any_interrupt() would be nice.
  • very specific kinds of alerts that raise specific exceptions are worthwhile to consider - setting a timed_out bit in c via a timer that will then raise TimeoutException when the python does time.sleep is one place that makes sense to have an exception (on the line that calls time.sleep())
analog bridge
misty garnet
#

awesome, thanks

tulip sleet
#

CPython time.sleep() will exit early if a signal is caught after the signal handler is executed. It's very POSIX-y but we might look at how that's used. Not sure it's a great model.

#

ooh, not quite:

Changed in version 3.5: The function now sleeps at least secs even if the sleep is interrupted by a signal, except if the signal handler raises an exception (see PEP 475 for the rationale).

manic glacierBOT
low sentinel
#

Yeah haha time.sleep should always sleep for however long you ask it to unless itโ€™s raising an exception.

itโ€™d be pretty hard to use in circuitpython if sleep was raising non-sleep-related button press exceptions all the time by default. A timeout (or just an interrupted sleep) is a reasonable thing for sleep() to raise. But a general โ€œsomething happened somewhere on this boardโ€ exception will quickly make projects have to choose between interrupts and library support

tulip sleet
#

thanks for joining in on this; i have to be afk for a while but this is the kind of discussion i am trying to generate by asking issue questions and presenting bad ideas ๐Ÿ˜†

opaque panther
#

Hello, I have a couple of questions.
Iโ€™ve got my first rotary encoder and trying rotaryio. It gives me this error that I donโ€™t understand where it originates: "ValueError: pull masks conflict with direction masks". I could make the click button work though.
Iโ€™m on M1 Big Sur, and wonder if adafruit_hid mouse and gamepad are supported (at least I tested the former on Win and Mac, and it works on Windows). If not, how likely will they be supported in the future?

#

Forgot to mention the first question is when I initiate the encoder like this: enc = rotaryio.IncrementalEncoder(board.GP14,board.GP15)

analog bridge
#

@opaque panther you can get more help in #help-with-circuitpython channel... this channel is primarily used for circuitpython development work. ๐Ÿ™‚

opaque panther
#

Thanks! And sorry

onyx hinge
#

@opaque panther seems like a bug. if you use github please file an issue

manic glacierBOT
manic glacierBOT
#

I just re-tested on High Sierra 10.13.6 and Big Sur 11.2.2. In neither case did the mouse work in the stock build

Tested on Catalina and Big Sur with a QT PY M0, with a code that jiggles the mouse for a sec on boot.

The mouse works in Circuitpython 6.2.0-beta2, but not any subsequent version available on S3. Intermediaries are missing due to cleanup, so maybe I'm gonna try to learn to use git bisect. Or lookup when tinyUSB was updated ?

#

The mouse works in Circuitpython 6.2.0-beta2, but not any subsequent version available on S3. Intermediaries are missing due to cleanup, so maybe I'm gonna try to learn to use git bisect. Or lookup when tinyUSB was updated ?

This was not what I expected when testing this; I thought it was only dependent on the HID descriptors, so I did not bother to test earlier verions. If you want to learn to bisect, go ahead, but I can track this down too.

#

Firmware

Adafruit CircuitPython 6.2.0-rc.0-60-g27d883286-dirty on 2021-04-04; Adafruit Feather RP2040 with rp2040

Code

Run the following code:

import board, array, rp2pio
rp2pio.StateMachine(
            array.array('H', (0,)),
            160_000,
            first_in_pin=board.NEOPIXEL,
            in_pin_count=2,
            pull_in_pin_up=0b11,
        ).deinit()

then exit the REPL

Behavior

After exiting the REPL, the neopixel flash...

manic glacierBOT
#

User "Tosche" reported on Discord that their chosen pins for IncrementalEncoder didn't work, but it should have worked:

import microcontroller
import rotaryio
enc = rotaryio.IncrementalEncoder(board.GP14,board.GP15)

StateMachine.c's internal routine mask_and_rotate may be dealing incorrectly with NULL pins & zero bit_counts. However, while trying to diagnose this I ran into #4555 and don't have a fix I'm confident of. Here's what I tried:

 static uint32_t mask_...
onyx hinge
#

TFW you sit down to solve a simple bug, but discover 3 more ๐Ÿ˜ญ

manic glacierBOT
onyx hinge
#

silly macos ๐Ÿ™‚

tulip sleet
#

i am guessing a bit about gamepad before mouse, it could be something worse, but it makes sense. In any case, moving it up works

#

@onyx hinge I think maybe we will have an rc.1

#

unless we just fix these and call it final

#

do you think the rotaryio-related bugs should be fixed in 6.2.0?

onyx hinge
#

Fixing the mouse problem would be very good. I'm not sure what else is that important.

tulip sleet
#

I am still getting an email every time somebody does something or other with their fork, due to being mentioned in a commit:

#

i am a bit baffled why github thinks I care

manic glacierBOT
#

I'm looking at using an I2C pwm breakout to drive the motor ESCs, and and I2C digital breakout to read the Hall sensor switches. Why? Because we need to MUX a lot of these, and I wanted to keep wire count down on the main MCU board, in addition to providing easier forward compatibility to changing the MCU (just have to worry about the I2C instead of matching all of the PWM/DIO pins). You are certainly right to be cautious that this has a lot of communications overhead, but I our time scales s...

jaunty juniper
#

same, just got one for that:

thorny jay
tulip sleet
thorny jay
thorny jay
manic glacierBOT
#

I think that is fine. The whole light-sleep/deep-sleep terminology was based on using some terms from the ESP32-S2 IDF (SDK). And it turned out that we couldn't use their light sleep anyway because it shut down too many things. We haven't really found many chips where there is a meaningful light sleep that we cannot already implement by doing a WFI instruction, for instance. I would like to rethink this a bit and perhaps change the terminology incompatibly in 7.0.0, but we do not have to do t...

jaunty juniper
#

apparently they forked in November according to the activity page, but the repo page says it's up to date with adafruit, so I wonder if they pulled from adafruit/circuitpython and pushed to their fork's main and there's a bug that thinks the commit is new ?

#

I don't push to my main when I PR, and it's not the usual method for working on forks, so that would make it rare

tulip sleet
#

i did a little googling and I don't see complaints about this, but I need to do more research. It does seem like something to ask about.

manic glacierBOT
manic glacierBOT
#

without glitching when there is a request or other long atomic operation.

Requests consist of (set_up, send, wait for a tremendous amount of cpu time, receive). If that waiting is undesirable, the right way to keep the application responsive is via an async/await request api. If you know how long you have until your next colon flash (and if you only have a blocking requests.get), you should just pass in that timeout value to the requests.get invocation right? This is one way that async/a...

solar whale
#

@tulip sleet I started seeing those recently as well (githhub emails from forks) Seems new. Yesterday was the first I noticed it.

#

or it might be something unique to @onyx hinge -- mine was from his fork as well...

jaunty juniper
#

I got one 2 days ago and today, from the same january commit too

solar whale
#

ah -- not his fork -- but from an old commit

obsidian dome
#

I'm trying to get started with MQTT on a PyPortal. The tutorial at https://learn.adafruit.com/mqtt-in-circuitpython/circuitpython-wifi-usage talks about importing a "wifi" package I can't find in the circuitpython 6 libraries. If I do import adafruit_minimqtt.adafruit_minimqtt as MQTT it complains that ssl_context isn't set. A clue would be most welcome

Adafruit Learning System

Learn how to connect your CircuitPython devices to the internet with this lightweight publish/subscribe protocol.

manic glacierBOT
slender iron
slender iron
slender iron
#

@obsidian dome that's the ESP32-S2 code

#

you want the airlift version

onyx hinge
#

I looked in github settings and couldn't find one for notifications for mentions in commit messages ๐Ÿ˜•

#

@slender iron then when DO you get to use CP for hobby projects?

slender iron
#

when I'm willing to ignore bugs

jaunty juniper
#

oh I should have tested that โฌ†๏ธ (now I have, it works, thanks Dan)

indigo compass
#

Last time I looked at MicroPython/CircuitPython, several years, go there was still the outstanding issue of memory fragmentation and its impact on the reliability of long running programs. So, is that still an issue with today's modern boards? If so are people just using them for 'fun' projects or are people using them for long running important tasks?

tulip sleet
#

We have gone to some effort in CircuitPython to provide native and library APIs that allow one to pass in a reusable buffer to write into, rather than always returning a fresh buffer that will be discarded.

onyx hinge
#

As a practical matter, I have some CircuitPython devices that continue running for weeks without encountering a MemoryError; and careful use of try/except where the except clause restarts the board should allow automatic recovery if a MemoryError or other problem is encountered.

manic glacierBOT
#

Nit-pick for RP2040

new &= 0x3;
int x = new ^ self->last_state;
if (!(self->last_state ^ ~self->last_state))
	self->last_state = ~self->last_state;
switch (self->last_state & 0x3) {
	case 1:
		self->quarter_count -= 1;
		break;
	case 2:
		self->quarter_count += 1;
		break;
}
self->last_state = new;
/*
0000 = 0 = 0 = 0 = 0
0001 = 1 = 1 = 1 = -1
0010 = 2 = 2 = 2 = +1
0011 = 3 = 3 = 3 = 0
0100 = 1 = -2 = 2 = +1
0101 = 0 = -1 = 3 = 0
0110 = 3 = -4 = 0 = 0
01...
valid bison
#

Is it possible to play an animation on an oled display while the board is doing something else?

lone axle
idle owl
#

@lone axle Typically you would send it to Anne, exactly the same way you send full guides to Anne. As she's out for a bit, you'll want to send it directly to Limor before making it live. If Carter wants to take a look first, that would also be excellent. But Anne>Limor>live is the standard process. (Since you can't put a page "into moderation", you simply send Anne, or for now, Limor, the link.)

lone axle
#

Thank you

manic glacierBOT
spring jolt
#

Many thanks to Tannewt for help getting CircuitPython building. (I had a python module that was not updated.) I'm using the Seeeduino Wio Terminal, and because of the need for high speed i/o, having access to inline assembly is crucial. All I needed to do was include CIRCUITPY_ENABLE_MPY_NATIVE = 1
in /ports/atmel-samd/board/seeedui...terminal/mpconfigboard.mk and it worked. This is circuitpython 6.2.0-rc.0-15-.... Stock, it uses 458,468 bytes in flash (41,244 free); with viper/etc enabled, it uses 478,892 (20,820 free). Is there a reason why this option can't be enabled by default for the Wio Terminal? It costs 20K bytes, but otherwise would go unnoticed by folks who don't need it, and for folks who do need it, it's just there--no need to set up a build environment and go through all that. And then there's the broader question of enabling it for a wider variety of devices. Right now I think it is only enabled for about 4 boards.

slender iron
#

@spring jolt my feeling is that 20k is a lot for a feature few people will use

manic glacierBOT
#

ESP-01 header renamed to AUX, and expanded to 12 pins from 8
pins. Pins 1-8 still accommodate the ESP-01, with expansion to full
SERCOM 4-pad support to allow for SPI and I2C on that expansion port
with additional GPIO control.

Update pins.c with additional signals provided AUX_1-8, along with
UART, SPI, I2C name usage as aliases to appropriate AUX_1-8
signals. Additionally, add several alternate names specific to several
expansion modules - the ESP-01, and the ATW-01 using the WINC_...

manic glacierBOT
#

This will be more involved than you realize.

This is kind of crazy to me. I have play around with some crazy ideas involving using MPUs as MCUs, Linux, Python, etc. I know there are a few ways to make something like this work, but to be honest I am not seeing it here. Usually something like productivity, cost, etc. helps you net ahead of what you give up.

Please elaborate. How would it "not work"? How would it be "more involved"?

tidal kiln
#

@lone axle what kattni said, in terms of the mod process. for the guide itslef, my 2cents: not sure the ascii art example is needed? or maybe move to a separate "examples" page? so the main page can focus on just what's needed to load and use a font file. can also mention the load_glyph, etc. there.

crimson ferry
lone axle
#

I will add some info about the load_glypyhs usage as well, good idea. Thanks for taking a look

tidal kiln
#

ah, yah, it is the simpletest....hmm. looks like it would work on a native CP board also? so it's not really just a "PC or Raspberry Pi" example?

#

oh..it uses args

lone axle
#

Yep, I'm not sure about the sys.path stuff on CircuitPython as well. If that stuff does work. It could be refactored to have hardcoded variables instead of arguments. and then it may work

tidal kiln
#

if all that were replaced with a hardwired font file name, i think it would then work?

lone axle
#

I will give it a try later tonight. If it does work out I'll PR to change the example over so it can work on microcontrollers as well.

tidal kiln
#

ok. and use one of the fonts that's in the examples/fonts folder.

lone axle
#

Yep. Do you think I should go ahead and rename it to something like ascii_example and use the label one as the "main" simpletest? or just leave them as-is once this script is fixed up to run on the devices?

tidal kiln
#

i think having the simpletest just use print is a good idea

#

sort of an odd library to come up with a simpletest for

#

since it's not really something you'd use standalone

manic glacierBOT
manic glacierBOT
#

Hello,

this issue can be closed. As mentioned in the previous post, I managed to
get the things working but only as fixed and compiled code.

--
Best regards,
Dusan

On Wed, Mar 31, 2021 at 5:20 PM Dan Halbert @.***>
wrote:

@Embedinno https://github.com/Embedinno How are you doing on this?
Would you like to leave this issue open?

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/adafruit/circuitpyt...

idle wharf
#

May I be added to CircuitPythonistas I'll be joining the weekly today

thorny jay
#

Wait, this is not a non working day in the USA?

#

Ok, I'll be lurking... my notes are in a poor state. I have not done much, and not documented much from what I did... or it is not CP minded.

manic glacierBOT
#

This should be the last update requiring PCB updates and pin shuffling to accommodate changes (famous last words), so I think it is at the point where it should be stabilized. Updates were based on early customer feedback and also some future modules we want to add taking advantage of the AUX port. It is at the point now where it does everything we want and satisfies all customer feedback. Photo on the web site is a bit dated - hopefully will be getting that updated RSN. Layout is virtually i...

idle wharf
#

๐Ÿคทโ€โ™‚๏ธ I don't have kids (so I don't see school schedules) and i'm not religious so I tend to loose track of many of these holidays. But if the stock markets are open. It is not a US Federal holiday. States have their own holiday calendars which may or may not affect some businesses.

lone axle
thorny jay
#

I don't know why this Monday is OFF for me, and Thursday and Friday were also OFF (that seems even less usual in my country, so it might be something special from the place I work). And Kids will start two weeks of vacations, but they had an additional 1 week without schooling before for Corona reason. I am just happy to still know this is a Monday... Also Friday it was 23 ยฐC and today we have little snow, so near 0 ยฐC.

idle wharf
onyx hinge
solar whale
#

@onyx hinge I'm "lurking" today -- nothing to report.

manic glacierBOT
fossil gorge
#

April 5th

still zephyr
#

Text only for me

lone axle
solar whale
#

CubeOrb

fossil gorge
manic glacierBOT
#

@daveythacher There is an implementation in the nrf port that is reminiscent of what you posted above:
https://github.com/adafruit/circuitpython/blob/a1562430f62e04ed6aa08ac7851f2eed0aea0fa2/ports/nrf/common-hal/rotaryio/IncrementalEncoder.c#L37-L66

My post before had a slight error, so I deleted it. I think I figured out a fix for it. However I did not repost since it was not directly referenced in the pull request.

Basically it attempted to use XOR and jump tables to remove look ...

slender iron
#

welcome!

fossil gorge
#

macOS issues - they're not always strictly macOS issues

slender iron
idle wharf
#

Is there a StarTrek UI template for CP? Can I wish one into existence? ๐Ÿ˜‰

slender iron
#

๐ŸŽ‰ ๐Ÿ’‰

fossil gorge
idle owl
manic glacierBOT
#

Using microcontroller.reset() or exit_and_deep_sleep() intermittently triggers a "Crash into the HardFault_Handler" and reload into safe mode on the MagTag using CircuitPython 6.1.0.

I encountered this issue while making a simplified derivative of the MagTag cat fed clock project, in which I used exit_and_deep_sleep() to sleep the MagTag in-between minute refreshes. With exit_and_deep_sleep(), the MagTag would hard crash after a...

modern wing
still zephyr
#

Could you do morse code with lights? I have worked on that

gilded cradle
#

Random number seeds?

idle wharf
#

@slender iron That animation idea is very cool !

fossil gorge
#

Using the MCU's ID as a base seed or value could help make it reproducible

#

or MAC/HW ID

mental nexus
still zephyr
slender iron
mental nexus
idle wharf
#

I see I'm doing this differently.
Should links in the notes be "raw" links or is OK to use the formatted google doc links?

still zephyr
#

@gilded cradle Let me know if I can help in the Blinka library, just point me in the right direction.

lone axle
#

Go ahead and read mine, seems my mic is messed up

gilded cradle
still zephyr
#

I will take a look this week. Thanks

gilded cradle
#

Thank you

idle owl
gilded cradle
#

Let me know if you have any other questions

low sentinel
#

(joined in case people want to talk interrupts in the weeds; I do not have content and am lurking otherwise)

still zephyr
idle owl
#

I really think we would all benefit from that being a Learn guide though.

mental nexus
manic glacierBOT
#

Is the expectation the position will always be a difference to their counter? Is there a need to make direction reversible on the fly? Is there a need to see a roll over point internally? Is there a need to add scaling for revolutions? Can someone implement a new class based on this?

I know jepler's solution had better performance than the solution I was recommending. However there could be different use cases, which I had not considered before. I guess my question is what is the expectati...

lone axle
#

fwiw I'm willing to help folks get up to speed on the learn system. I'm definitely not up to the mastery level of Anne, but feel like I have the fundamentals down enough to help others.

fossil gorge
#

Not trying too sound too ridiculous/smart-alec-y, would a learn guide on using the learn guide be of value?

idle owl
#

There is one internally ๐Ÿ™‚

lone axle
#

There are a few with great info in them.

idle owl
#

But it still helps to have assistance.

thorny jay
#

I would like to use circup on my Raspberry Pi Zero for CP library that I need there... is that possible?

lone axle
thorny jay
#

Yeah, I know I need to use pip... it is just that it is "different".

#

Can we get the "example" and "simpletest" with a circup command? Because this is what I will go for just after downloading the library.

#

What about build in library? How does circup know if it is frozen or not?

idle wharf
manic glacierBOT
#

Here it is, just in case it works or is useful. Below is truth table which shows how it is supposed to work through the different steps. This is probably no better than the nrf solution. Assembly wise they are probably close. The look up table is little easier to understand, and maybe the compiler could figure this out. However this and the nrf avoid the table in ROM/RAM.

new &= 0x3;
int x = new ^ self->last_state;
switch (self->last_state) {
	case 1:
	case 2:
		x = ~x;
		break...
idle wharf
#

I have to drop off for a work meeting. Thank you everyone. @thorny jay I see your question and I'll circle back later to chat if someone else doesn't discuss it with you and sort it out.

idle owl
#

@mental nexus Approved! I will be helping get you spun up, along with one of our Learn folks. I'll DM you to get some contact info.

lone axle
#

Gotta run to another meeting. Will catch the video later on. Thanks all, have a good day!

idle owl
thorny jay
#

For me interrupt could just be a "checkbox issue" when someone compare MP and CP. So maybe you just want interrupt for that reason. And avoid someone to switching to MP if he does not have to: https://www.recantha.co.uk/blog/?page_id=20924

#

And we need to reach that 2500(?) guides!

slender iron
#

@thorny jay chasing "checkbox issue"s can waste a ton of time

#

it's ok if people switch

mental nexus
#

Thanks all!

thorny jay
#

Thanks.

tulip sleet
#

when we invent a new feature that can substitute for raw interrupt handlers, we can use the word "interrupt" in the doc so a search will show it up

still zephyr
#

Thanks

fossil gorge
#

Have a safe and wonderful week everyone!

modern wing
#

Thanks everyone ๐Ÿ™‚

onyx hinge
manic glacierBOT
thorny jay
still zephyr
#

@lone axle @mental nexus for the new libraries related to displayio, is the name Adafruit_CircuitPython_DisplayIO_XXX, ok, for example for the equalizer would be Adafruit_CircuitPython_DisplayIO_Equalizer. Let me know. thanks

thorny jay
tulip sleet
onyx hinge
#

Here is the notes document for 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/1N52qeTToB6s5QCgMq1IjLdMgkWoKfJZV_BiDkTCKQvg/edit?usp=sharing

manic glacierBOT
lone axle
#

If I understood correctly that is how Scott mentioned doing it. Though I did miss part of the conversation so I could have misinterpreted.

still zephyr
#

Not sure, if we put all the widgets together, we would have the same problem, he commented in all the PRs to make a separate library for each one

#

So that was my assumption, but not sure now, @slender iron , guidance?

#

@lone axle Either way, do you want me to work in the cookiecutter to make either Widgets or the other ones?

slender iron
#

my suggestion was for one repo per widget

#

though I think it'd be fine to have variants of one widget in one repo

still zephyr
#

Good, thanks for the clarification.

lone axle
#

We could leave it in DisplayIO_Layout but then all of the widget repos would have a requirement to have that library as well.

still zephyr
#

Gotcha

lone axle
#

I don't think we want to have copies of that in every individual library though, some centralized place is best so that changes to those super classes can be made in one spot.

still zephyr
#

Interesting, question....

#

What if we left widget in and control in Layout?

#

I will work on the new libraries this week ๐Ÿ‘

lone axle
#

Sounds good. Thank you. I do think leaving it there for now is probably best.

still zephyr
#

Thanks foamyguy

idle owl
#

@tulip sleet So highlight the current release of CircuitPython, and we'll highlight final release next week? (Basically checking whether you're doing a final release in the next 6 hours.)

tulip sleet
#

i may release; just have to ask limor one q

idle owl
#

Ok I'll hold up then.

tulip sleet
#

ok, I do plan to release

idle owl
#

Right on.

#

@tulip sleet How long will that take? I'll want to link to something. (Not trying to rush you, simply want to know a timeline so I have an expectation to set.)

tulip sleet
#

on the phone, it'll be a few hours. I'd just link to circuitpython.org. I can get you a blog link later

idle owl
#

Ok no worries. Thanks.

manic glacierBOT
#

Regarding Rev - this is actually rev 010 (10) - silkscreened on the board, but not differentiated otherwise. We will continue to support customers that have earlier Revs with a custom build or replace their boards for them so they don't have to worry about it.

Please don't maintain a custom build because it'll fall behind. Instead, create a second board def for this rev and the newer versions.

#
[adafruit/circuitpython] New tag created: 6\.2\.0
gloomy shuttle
#

I am not sure what channel I should put this in, but I have an extra ticket (no cost) to the Open Hardware Summit on Friday. Please DM if you are interested and I can update the ticket information.

manic glacierBOT
#

I think the confusion here is that there are two different deep sleeps. One is "pretending" to deep sleep in order to iterate on deep sleep code when connected over USB. The other is real deep sleep when not connected to USB where everything does actually shutdown. These two modes look the same from the Python code but internally pretend deep sleep looks a lot like light sleep. So, I think deep sleep and light sleep are different and appropriate. Light sleep is pretty similar to `time.sleep...

orchid basinBOT
manic glacierBOT
idle owl
#

@slender iron Keyboard nerd question: is macropad one word or two? Google isn't helping.

#

Text editor doesn't like it as one word. Google has both equally available for purchase and so on.

cobalt grail
idle owl
#

Thanks!

idle owl
jaunty juniper
#

looking at the weekly stats, I felt that maths were wrong in: 8 PR merged and 9 authors, but I assume it's 9 authors of new PRs, not the authors of the merged PRs

idle owl
jaunty juniper
#

ah that works too

#

how is the list of authors pulled from github ?

idle owl
#

Adabot queries things and generates the report. I don't recall of the top of my head exactly how the queries work though. You might be able to make sense of the code.

tulip sleet
jaunty juniper
#

that's a big plate of spaghetti !

idle owl
manic glacierBOT
thorny jay
#

@mental nexus Just to make sure, about those memory-saving thing, I not an expert at all. ๐Ÿ™‚ I am actually counting on you to learn stuff. And I guess the real expert will cross check and tell us what is right/wrong, relevant or not. I know my share of stack vs heap stuff from long ago, but Python, MicroPython, bytecode and VM, C stack vs Python Stack, heap usage, garbage collector and optimised way to store certain type as Damien did in MicroPython... I may have read/watch about it, but I don't have all the piece of the puzzle to but super reliable. I can only repeat what I was told and what I have infered from those information.

slender iron
manic glacierBOT
#
[adafruit/circuitpython] New branch created: tannewt\-patch\-1
mental nexus
# thorny jay <@!366059101203202052> Just to make sure, about those memory-saving thing, I not...

No worries. I am learning this stuff too so sometimes I just try and put something down and rely on the folks that know deeper to help correct things. I want to let you know I appreciate your ideas and questions because it makes me explore further and try to understand this better. And if we hold back questions they will certainly never get answered. Thanks for being open and raising possibilities, who knows where these ideas will lead us!

manic glacierBOT
jaunty juniper
#

ok so the github API to get issues (PRs are issues in the API) has a "per_page" parameter, which seems to default to 30 when not given, so the adabot stats actually only look at the last 30 issues per repository, and counts those that are merged PRs

#

changing to a loop that gets all the pages, 100 at a time, according to the API there's 150 issues updated in the last week (35 merged Pull Requests) so we are missing a lot ๐Ÿ˜‰

slender iron
#

whoa!

jaunty juniper
#

Core

  • 35 pull requests merged
    • 18 authors - Neradoc, wtuemura, lesamouraipourpre, hathach, sabas1080, tyomitch, ZodiusInfuser, m-byte, dhalbert, weblate, jposada202020, bergdahl, tannewt, hugodahl, microDev1, t-ikegami, jepler, UnexpectedMaker
    • 7 reviewers - gamblor21, dhalbert, jepler, tannewt, microDev1, hierophect, ladyada
#

so 8 seemed really low to me (also I didn't see my name in the list but shhhh that's not my primary motivation ๐Ÿ˜‰ )

manic glacierBOT
#

As long as we're code-golfing, here's what I came up with:

#define quadrature_const (0x3443c11cu)
int8_t quadrature_fast(uint8_t a, uint8_t b) {
    int idx = (a << 3) | (b << 1);
    return (int)(quadrature_const3 << idx) >> 30;
}

This compiles to 6 thumb instructions and 1 out-of-line constant, for a total of 16 bytes. It works by extracting 2 consecutive bits from the constant, then sign-extending to give -1, +1, or 0. However, it mak...

#

I have the evk and attached a BNO055 sensor to it, wondering whether bitbangio was a workaround for #3763 (it's not)

Devices should be [26,40] but software bitbangio says ...

>>> i2c = bitbangio.I2C(sda=board.SDA, scl=board.SCL)
>>> i2c.try_lock()
True
>>> i2c.scan()
[26, 40, 41, 42, 43, 44, 45]
>>> i2c.scan()
[26, 40, 41]
>>> i2c.scan()
[26, 40, 41]
>>> i2c.scan()
[26, 40, 41]

Underlying cause could be similar to #3845 but not sure yet.

#

@daveythacher If you're interested in working on this, maybe addressing it in a fresh PR intended to unify encoder handling and close #3875 would be the way to go.

Please also see https://github.com/adafruit/circuitpython/issues/3875#issuecomment-812675213, where I mention another very simple algorithm I found that only uses one interrupt. It misses a count when reversing, which was the original motivation for #3875 and its corresponding PR.

solar whale
#

when I pull the tip of main and build, it shows as 6.2.0-rc.0 -- should it now be 6.2.0 or 7.0.0-alpha? -- and how do I get it to update?

tulip sleet
#

it should build as 7.0.0-alpha.0; I pushed a tag to main. do a git log and see if you see that tag.

solar whale
#

I do not

tulip sleet
#

it's there; this is a git thing; maybe git pull --tags ?

solar whale
#

I see the tag if I list the tags git tag

tulip sleet
#

i might have tagged the wrong commit. I'll take a look.

solar whale
#

I did git fetch --tags now tried git pull --tags it says it is up to date -- rebuilding to see if it changes. -- same 6.2.0-rc.0

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 7\.0\.0\-alpha\.0
#
[adafruit/circuitpython] New tag created: 7\.0\.0\-alpha\.1
tulip sleet
#

@solar whale ok, do it again; I have deleted the 7.0.0-alpha.0 tag, because it was at the branch point or was on the 6.2.x branch. We will just discard that. pull or fetch again, and you should see 7.0.0-alpha.1 on the most recent commit (for consistency)

solar whale
#

building now... I see the new tag

#

All better! 7.0.0-alpha.1 --- Thanks!

#

I get confused easily...

tulip sleet
#

you found a tagging bug, no problem!

solar whale
#

@tulip sleet are there any differences now in a 7.0.0-alpha.1 build and a 6.2.0 build? I have run into an issue under 7.0.0 that works under 6.2.0 -- ah -- I see a few commits, but none seem relevant

still zephyr
#

Sorry to get this message in the middle of your conversation, have any deal with this kind of error when building the docs TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases. If you happend to know the answer please ping me. ๐Ÿ™‚ Thanks

tulip sleet
solar whale
#

OK -- it pertains to a funky issue on the stmpe610 -- just got funkier....

tulip sleet
#

maybe try pip3 install --upgrade -r requirements-dev.txt

solar whale
#

I've done enough damage for tonight -- Good night all!

manic glacierBOT
#

7 instructions & no constant (so 2 bytes smaller & no worry about undefined behavior under C)

int8_t quadrature_fast3(uint8_t a, uint8_t b) {
    int x = (1 + ((a ^ (a >> 1)) - (b ^ (b >> 1)))) & 3;
    return x - 1; 
}

x ^ (x>>1) converts a 2-bit gray-coded number to binary. The arithmetic (1+p-q) & 3 gives +1, 0, -1 as +2, +1, 0; then subtracting 1 in signed fashion gives the correct answer. Again, exhaustive verification is feasible.

HOWEVER the caveat with this ve...

tulip sleet
#

ah,ok, this is just a python issue on the new code; are Widget and Control unrelated classes?

still zephyr
#

they are related, but methods are different

#

I

#

from adafruit_displayio_layout.widgets.widget import Widget
from adafruit_displayio_layout.widgets.control import Control

class ColorPicker(Widget, Control):

#

When the the module color_picker.ColorPicker was in the same module, DisplayIO_layout.widgets, the CI did not complain, as it was in the same repo, now we are trying to get out the widget, in this case ColorPicker out of the displayio_layout to use it as an individual library

mental nexus
still zephyr
#

๐Ÿ™‚

tulip sleet
#

i googled it, and there are some things to look for, but I am somewhat mystified. For Python 3.7 or before, it says this can happen if you do class C(ThisIsNotAClass)

#

you are not using metaclasses explicitly, is that right?

still zephyr
#

No I am not

#

But in the stackoverflow answer they said that that workaround is for python 2.7

tulip sleet
still zephyr
#

Cool I am trying now the last answer and then I will try that one

tulip sleet
#

The CI uses Python 3.6, so that's why I'm thinking somehow it thinks something is a plain module instead of a class.

still zephyr
#

mmm I see your point

tulip sleet
#

in other words I think this is some kind importing or definition error; I think the error is misleading

mental nexus
#

I think the error is actually different, maybe it can't find an import?

Warning, treated as error:
19
autodoc: failed to import module 'color_picker' from module 'adafruit_displayio_color_picker'; the following exception was raised:
20
Traceback (most recent call last):
21
  File "/opt/hostedtoolcache/Python/3.6.13/x64/lib/python3.6/site-packages/sphinx/ext/autodoc/importer.py", line 71, in import_module
22
    return importlib.import_module(modname)
23
  File "/opt/hostedtoolcache/Python/3.6.13/x64/lib/python3.6/importlib/__init__.py", line 126, in import_module
24
    return _bootstrap._gcd_import(name[level:], package, level)
25
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
26
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
27
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
28
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
29
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
30
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
31
  File "/home/runner/work/Adafruit_CircuitPython_DisplayIO_Color_Picker/Adafruit_CircuitPython_DisplayIO_Color_Picker/adafruit_displayio_color_picker/color_picker.py", line 49, in <module>
32
    class ColorPicker(Widget, Control):
33
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
#

It builds fine on my local machine.

still zephyr
#

Ohhhhh๐Ÿ˜ณ

tulip sleet
#

is it referencing something that is not yet pushed to pypi?

#

i think you figured out something ๐Ÿ™‚

still zephyr
#

yes ๐Ÿ™‚

#

let me test, but if this is the problem.... ๐Ÿ˜ฌ

onyx hinge
#

autodoc is mocking some class, leading to this problem, right?

still zephyr
#

yes

onyx hinge
#

so all you need to do is .. rubs crystal ball implement Adafruit_Blinka_Vectorio

#

can you install blinka displayio and mock vectorio?

#

goodnight, don't stay up too late

still zephyr
#

Thanks jeff

still zephyr
idle wharf
thorny jay
manic glacierBOT
idle wharf
lone sandalBOT
onyx hinge
#

@still zephyr your (?) commits come through as "Author: Adafruit Adabot jq....20@gmail.com" when I look at the commits locally. Maybe your git is misconfigured? Or the commits are happening in some other unusual way.

misty garnet
#

is there a preferred way for a master MCU to communicate with worker MCUs in CP? Like an M4 handing out jobs and reading data from a bunch of little M0 worker bees?

#

maybe a different answer based on proximity, but let's assume close by for now

jaunty juniper
#

hmmm SPI is used with the ESP32 airlift things, I2C is used with seesaw, both using custom firmwares on the peripheral side, not Circuitpython

tulip sleet
#

UART is probably the most straightforward

still zephyr
#

@onyx hinge Thanks for the PR, we have two solutions instead of just one ๐Ÿ™‚

jaunty juniper
#

what does git config user.name say ?

still zephyr
#

ah that is right, I changed that when was working in ADABOT. Thanks @jaunty juniper

#

Solved thanks @jaunty juniper ๐Ÿ™‚

onyx hinge
#

@still zephyr I missed there being a first solution

#

you can just close mine up if it's fixed already

still zephyr
#

@onyx hinge I include the following line in conf.py

#
suppress_warnings = ["autodoc.import_object"]
#

No I already merged you solution Thnkas for that ๐Ÿ™‚

onyx hinge
#

does it affect the documentation quality?

still zephyr
#

Yes, probably, not sure, I will only your solution

#

The strange thing, is I build the docs locally and it works it was just in the CI failing,

onyx hinge
#

yes I saw that as well (system python is python3.7)

still zephyr
#

Ok, thanks for confirming, assure me that I was not making a rookie mistake

onyx hinge
#

It's a minor tragedy of github actions that it is next to impossible to recreate its conditions on your own computer

#

but instead have to run it on their computer time after time

still zephyr
#

Thanks for all the help

onyx hinge
#

Of course you are welcome ๐Ÿ™‚

tulip sleet
#

@slender iron @onyx hinge I submitted a GitHub ticket about the spurious notifications, with email examples.

onyx hinge
#

@tulip sleet oh the encoder counting bug is only on nrf, which doesn't use the table method, but does something else. (just about any method that doesn't look at EVERY edge (A and B, rising and falling) and have an internal state transition will be wrong under some sequence of inputs.)

idle owl
#

@jaunty juniper Please file an issue on the Adabot repo with your findings.

#

If you have not already.

tulip sleet
jaunty juniper
tulip sleet
#

I think maybe the interrupt routines are missing a few transitions, and they could be smarter about noticing that one is in detent position, and change the count only in that position.

idle owl
tulip sleet
#

If you want to stop working on this, that's fine. We can just merge your current fix for now. It is as good as the current impl. If you find interesting, feel free to keep working on it, but getting the current PR in would be good.

jaunty juniper
#

yes, please test it well

idle owl
#

Adabot can be finicky so I don't like merging until it's tested. ๐Ÿ™‚

jaunty juniper
#

I think it will also reduce the risk of hitting the public rate limit due to moving some calls from unauthenticated to authenticated (I had the issue while testing)

idle owl
#

That is a big concern.

#

It borks the reports all over the place when it hits the limit.

#

Could be why we had it limited in the first place.

#

But we'll see.

#

Also I misread what you wrote. That's excellent if it reduces the risk.

jaunty juniper
#

currently it just adds one call because the last week issues take 2 pages, but retrieving all open issues (for stats per tag and all) was done in public for all pages after the first one (so if there are 500 issues, you hit the public rate 4 times)

#

now they will be authenticated too

idle owl
#

Great

jaunty juniper
#

still hit the auth 5000/h limit during testing but that's what you get when you tweak debug prints while retrieving 300 repos every time !

idle owl
#

That would do it ๐Ÿ˜„

idle owl
manic glacierBOT
#

It would be nice to figure out a "right" heuristic. I have some doodles but they've never become mergeable.

The general idea is:

  • build an initial huffman table without dictionary entries
  • now we can count the original # of bits of any word candidate
  • and we can estimate the number of bits of the new dictionary symbol by finding where it would fall in the dictionary
  • of course we know the number of uses of the word

The true bit cost is `(dictionary symbol overhead) + uses *...

onyx hinge
#

ugh, why does imxrt place memory starting at address 0x0 !? A literal NULL pointer dereference DOES seem to cause a hardfault, but not *(int*)8

#
                0x0000000000000000        0xc build-imxrt1010_evk/py/qstr.o
                0x0000000000000000                qstr_hash
```in fact a function is literally at 0x0!
manic glacierBOT
slender iron
#

that's ITCM memory space

manic glacierBOT
#

@tannewt , just to make sure I'm clear - you are asking to abandon (or modify) this pull request, then add a new board with a different name to differentiate it from earlier versions? Something like bdmicro_vina_d51_xxx where xxx is some designator indicating it is not binary/UF2 compatible with bdmicro_vina_d51?

If so, would it be ok instead to submit a PR that renames the current bdmicro_vina_d51 to something like _prelim, and then the current Rev remain attribute-less?

I ask because ...

ionic elk
#

@tulip sleet are we ready to start merging power stuff? If we get the API PR in I can start adding changes to the NRF port

#

Or would you like to wait? I can work on the RP2040 stuff in the meantime

tulip sleet
onyx hinge
#

interestingly, but tangentially, the RNG peripheral appears to be undocumented, though the source code in the SDK's fsl_trng.c isn't obfuscated or anything. Maybe I'm just not looking in the right document, but it's the one that's otherwise full of register map descriptions

misty garnet
#

@tulip sleet Yup pretty much what I was considering, wasn't sure about the overhead of having the master MCU open up and listening to a bunch of separate point-to-point UART connections.

slender iron
#

CAN is a good option if you have distance to cover

misty garnet
#

yeah, been playing around with that too and works great for long distance. seems a bit overkill for nearby communications with the extra hardware and stack. Does SPI work at all in this situation?

cobalt grail
#

I thought it may be interesting for you, as there are 5962 MaterialDesign icons to choose from, and my script is really easy to modify for other image formats as it uses PIL for image manipulation.

#

I would also be very thankful if some Python guru can explain to me how the following line works, as I am not familiar with that syntax.
rgba[rgba[...,-1] == 0] = [0,0,0,0]

#

I know what it does, I just don't understand the syntax.

jaunty juniper
#

so I printed the number of calls to github.requests in the bot, and I get 1204 authenticated (oof), and somehow 3 not authenticated at the start - meaning they return a X-RateLimit-Remaining bellow 60, despite going through the function that should be adding the auth token, which I don't understand, so I'm looking into that

#

ah the search API has a different rate limit (30 requests per minute, so it's fine)

tulip sleet
#

(and nowadays it's also used for stub files)

#
Python 3.8.5 (default, Jan 27 2021, 15:41:15) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> ...
Ellipsis
manic glacierBOT
manic glacierBOT
#

@tannewt , just to make sure I'm clear - you are asking to abandon (or modify) this pull request, then add a new board with a different name to differentiate it from earlier versions? Something like bdmicro_vina_d51_xxx where xxx is some designator indicating it is not binary/UF2 compatible with bdmicro_vina_d51?

If so, would it be ok instead to submit a PR that renames the current bdmicro_vina_d51 to something like _prelim, and then the current Rev remain attribute-less?

No need ...

ionic elk
#

@slender iron one thing I'm thinking about is how the RP2040 doesn't actually lose RAM state after being put in Dormant mode - even the lowest power state where all ram is in the "power down" mode, it doesn't lose any data. Should I force a reset after it wakes from deep sleep? Or just fold it into the existing fake deep sleep handler?

jaunty juniper
idle owl
#

@jaunty juniper I'll post to it. I think I know what needs to happen.

jaunty juniper
#

thanks ๐Ÿ‘

idle owl
tulip sleet
mental nexus
#

Can someone point me to the GitHub repo with Adafruit graphics assets? I seem to remember one with lots of images of Blinka and the other characters.

idle owl
#

@mental nexus Not sure it's on GitHub. We have an internal dropbox with assets. I don't think it's public though.

analog bridge
idle owl
mental nexus
#

Thank you! Thatโ€™s what I was remembering. Iโ€™ll see if that will work or if I need something else.

slender iron
#

looks for "art pack" and it's a link to dropbox

slender iron
#

since all clocks will stop

meager fog
#

hey

#

hey you

#

we have some RP2040 QT Py in stock

#

@tough flax ^ has the "bill b jumper"

tough flax
#

Love it.

#

Ordering now

jaunty juniper
#

(already placed my order too ๐Ÿ˜‰ )

meager fog
#

bill b jumper โ„ข๏ธ

misty garnet
#

been waiting for that bad boy! Thx.

ornate breach
#

Kind of fun because I just got these PCB today

#

Though I need one more run because my goofiness used the wrong crystal footprint ๐Ÿคฆ๐Ÿปโ€โ™‚๏ธ

#

Thankfully I can still test without the crystal

alpine nimbus
#

I was thinking of using an old btle board that I have laying around but I just realized that its not supported in circuit python. I guess that's what @slender iron is working on now. Do you plan to support that board too? The breakout is discontinued but maybe it will still work if you support Nordic? https://www.adafruit.com/product/1697

slender iron
#

@alpine nimbus don't get your hopes up. those old chips are very limited

alpine nimbus
#

Ok, I figured

tidal kiln
#

supervisor.reload() doesn't seem to do anything from REPL, which may be expected? just use <CTR><D> instead?

#

@idle owl do you know if the various programmatic reset options are covered in learn somewhere?

tidal kiln
#

like supervisor.reload() and microcontroller.reset()

idle owl
#

No, not that I'm aware of. Maybe on the Troubleshooting page, but if so, only the microcontroller one.

tough flax
tidal kiln
#

ok, for some reason, been seeing various "how to reset" questions lately, and all sort of flavors - like "how to reset to bootloader" etc.

idle owl
tidal kiln
#

maybe essentials guide?

#

might be worth a dedicated page? i think there are a fair amount of options

idle owl
tidal kiln
#

totes agree

#

and this it not at all something needed when just starting

idle owl
tidal kiln
#

templated? is it going away?

idle owl
#

No, we'll never delete it. But there is a new feature in the Learn backend called Templates, and you can create a template with "Template areas" that you can change, and the rest of it is immutable once added to a guide. So I can write, for example, a page on doing Blink, and have most of it already fleshed out, but the diagram showing where the LED is will be tailored to the specific-board.

#

So instead of a single page with 10 wiring diagrams on it, each board gets its own.

tidal kiln
#

neat. ok, yah, see how that would work for that guide in particular.

#

but it happens at the page level? not the guide level?

idle owl
#

And, it also means, that the boards that have very specific uses, will only get the parts of the essentials guide that apply. So Neo Trinkey will get a page that is a NeoPixel blink example because no D13 LED.

#

Correct. Each template is a page that's added and then modified.

#

I create the template first, then it's available to add to a guide.

#

But the point is that we won't be mirroring the Essentials guide into board guides anymore, and we'll slowly work backwards through the existing guides until all of them have their own tailored experience. That is a loooooong term thing though.

#

Moving forward though, templates for sure.

tidal kiln
#

would it be a waste of effort if i created new normal page in the essentials guide, to cover reset?

idle owl
#

No. Because I feel like that is board-agnostic.

#

These templates are because each board is different.

#

But the reset is the same for all boards, isn't it?

tidal kiln
#

AFAIK ๐Ÿ™‚

idle owl
#

I can't picture needing to tailor anything to a specific board on a page about reset.

#

So, I think it's fine to create a new page.

#

The guide will never go away because it's linked so deeply in Learn. We never delete guides/pages - we only deprecate them. If it turns out we decide to deprecate that entire guide (which I kind of doubt will happen), then we can move that page into its own guide or to another home. And "deprecating" a guide means putting warnings on all the pages. It doesn't change access to it.

tidal kiln
#

cool. thanks.

#

will work one up

idle owl
tidal kiln
#

excellent!

jaunty juniper
idle owl
#

Ah! I did not see it. Thank you for linking it.

still zephyr
#

@stiff pelican Thank you for the reviews ๐Ÿ™‚

pulsar bloom
#

Is there a specific python version required to build circuitpython?

tulip sleet
manic glacierBOT
tulip sleet
#

@pulsar bloom what is your building computer OS and version?

manic glacierBOT
pulsar bloom
#

@tulip sleet Win10, Ubantu under WSL2. About to throw my hands in the air and dual boot.

tulip sleet
#

did you install ubuntu 20.04? What are the errors you are getting, and what chip are you building for?

pulsar bloom
#

@tulip sleet 20.04 is installed.

tulip sleet
#

i am using native 20.04; we should be able to get it to work

#

you can use the stock python. don't install another python

#

did you do pip3 install -r requirements-dev.txt after cloning the repo? There are a number of new pip3-installed requirements for recent builds.

pulsar bloom
#

@tulip sleet compilling for circuitplayground_express:

manic glacierBOT
tulip sleet
#

@pulsar bloom what are the errors you are seeing?

still zephyr
#

@lone axle Could I merge the two PRs in the Display_text library and make the release? let me know thanks.

pulsar bloom
#

@tulip sleet carter@speedy:~/bin/circuitpython/ports/atmel-samd$ make BOARD=circuitplayground_express V=2
GEN build-circuitplayground_express/genhdr/mpversion.h
python3 ../../py/makeversionhdr.py build-circuitplayground_express/genhdr/mpversion.h
GEN build-circuitplayground_express/genhdr/qstrdefs.collected.h
python3 ../../py/makeqstrdefs.py cat - build-circuitplayground_express/genhdr/qstr build-circuitplayground_express/genhdr/qstrdefs.collected.h
QSTR not updated
GEN build-circuitplayground_express/genhdr/devices.h
install -d build-circuitplayground_express/genhdr
python3 ../../tools/gen_nvm_devices.py ../../supervisor/shared/external_flash/devices.h.jinja build-circuitplayground_express/genhdr/devices.h
Traceback (most recent call last):
File "../../tools/gen_nvm_devices.py", line 23, in <module>
typer.run(main)
File "/home/carter/.local/lib/python3.8/site-packages/typer/main.py", line 859, in run
app()
File "/home/carter/.local/lib/python3.8/site-packages/typer/main.py", line 214, in call
return get_command(self)(*args, **kwargs)
File "/home/carter/.local/lib/python3.8/site-packages/typer/main.py", line 239, in get_command
click_command = get_command_from_info(typer_instance.registered_commands[0])
File "/home/carter/.local/lib/python3.8/site-packages/typer/main.py", line 425, in get_command_from_info
command = cls( # type: ignore
TypeError: init() got an unexpected keyword argument 'no_args_is_help'
make: *** [../../supervisor/supervisor.mk:55: build-circuitplayground_express/genhdr/devices.h] Error 1

#

@tulip sleet sorry having problems navigating the forum

tulip sleet
#

you need to update click: pip3 install --upgrade click

pulsar bloom
#

@tulip sleet Thanks worked like a champ ๐Ÿ˜ƒ

tulip sleet
#

i think this points out the need to add some version checking in requirements-dev.txt. Thanks for being a guinea pig on this.

meager fog
#

๐Ÿ”ฅ ๐Ÿ”ฅ ๐Ÿ”ฅ we do have some qt's still but they're disappearing fast https://www.adafruit.com/product/4900

cedar moth
#

Got my two on order... thanks for announcing!

manic glacierBOT
misty garnet
#

is there a recommended UNIX distro for Windows WSL that works well for building CP?

blissful pollen
tulip sleet
#

ubuntu 20.04 is what i use

mental nexus
#
Select default_branch:
1 - master
2 - main
Choose from 1, 2 [1]: 2
Traceback (most recent call last):
  File "/var/folders/2y/v5rvm0w51gn_1xbkp6tnyspc0000gr/T/tmpZsp2bH.py", line 8, in <module>
    import pathlib
ImportError: No module named pathlib
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)

I got this error when running the cookiecutter library creating script. I did a pip3 install pathlib but still no luck. Any suggestions?

tulip sleet
#

the Learn Guide is written assuming ubuntu

misty garnet
#

good to know, thanls

blissful pollen
misty garnet
#

CP build instructions are pretty good, managed to strip out a bunch of stuff and add I2Cperipheral to my qtpy build

lone axle
manic glacierBOT
lone axle
#

If you have write access and the PRs have been approved by a CircuitPython Librarian you can merge them and make the release. I'm not sure how to check if other people have write access though. Do you know if you saw the merge button on the page? I think that would indicate it. We can check on the next one when it comes up to figure out for certain.

misty garnet
#

is there any advantage to including a FROZEN directory in the build compared to just copying over an .mpy file into the /lib directory?

manic glacierBOT
#

The generated regex code is limited in the range of jumps and counts, and this commit checks all cases which can overflow given the right kind of input regex, and returns an error in such a case.

This change assumes that the results that overflow an int8_t do not overflow a platform int.

Closes: #4500

See https://github.com/micropython/micropython/issues/7078 and https://github.com/micropython/micropython/pull/7080 for additional background and discussion. Cherry-picked back from Mi...

still zephyr
lone axle
lone axle
still zephyr
#

I made one for one of my libraries for the community bundle, and I saw you made one in the stream

lone axle
still zephyr
tulip sleet
misty garnet
#

good tips, I assume we can freeze any of our own custom /lib code in the same fashion

tulip sleet
#

yes, a few people have done that; just follow the same directory structure. You can also freeze individual files by using FROZEN_MPY_FILES instead of FROZEN_MPY_DIRS.

lone axle
#

I see, Thanks Dan!

blissful pollen
tulip sleet
#

given the size of some libraries, yes, that might help a lot. Also make sure that you are import .mpy's, since .py imports could fragment the memory (though we have ameliorated that partly through long-lived objects)

misty garnet
tulip sleet
#

@misty garnet no, but you can always import whatever as the sole thing in code.py, and whatever.mpy is fine in that case.

misty garnet
#

ah yeah, makes sense, thx

onyx hinge
ionic elk
#

@tulip sleet just saw the API merge - I have an ortho appointment tomorrow that will take up most of the day (long drive), but I'll try and still get NRF port patched. If not I'll take care of it on Thursday

tough flax
#

Hmmmm just thinking about the RP2040 QT Py... in CircuitPython, can a UART be defined on the STEMMA QT pins? Is that something that can be configured?

jaunty juniper
#

depends of the capabilities of the pins, I don't know if they are hooked to sda/scl or sda1/scl1, I assume the former, so that's GPIO 24/25 which have UART1 TX/RX

#

but sda1/scl1 are 22/23 which don't ?

#

well that didn't help

tough flax
#

yeah... my own diagram for the Feather 2040 shows SDA/SCL on pins GP02 and GP03 which are RTS/CTS not RX/TX. So, I guess you'd have to bit-bang it?

jaunty juniper
#

I'm not sure, since SDA/SCL are on the silkscreen it seems likely that the stemma is on SDA1/SCL1 which are RTS/CTS

#

oh it does say "I2C1" next to it

tough flax
#

I just looked in the pins.c

jaunty juniper
#

yeah, the stemma QT and the board pins are on different pins

#

so you get 2 I2C buses

#

I don't see which is which in pins.c

#

actually I do, SDA is D4 so definitely on the board, so the stemma is:

    { MP_ROM_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_GPIO22) },
    { MP_ROM_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_GPIO23) },
tough flax
#

I just saw these { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO24) },
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO24) },

{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO25) },
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO25) },
#

Good point we still don't know which is connected to the STEMMA without a schematic - it's ok - it can wait ๐Ÿ™‚

misty garnet
#

in the specs it says 2 i2c ports, one on the qt connector and one on the pads

manic glacierBOT
#

@dhalbert

Yes, the need to close the sockets certainly should be documented.
As this "solves" my problem 2.

(Anyway, without that, I suppose there is a chance to "leak memory".)

But my observation that send often does not "send everything" remains. (Problem 1)
Here my "send_line" code:

def send_line(self, l, byte_line):
    need_bytes = len(byte_line)
    sum_bytes = 0
    retries = 0
    while True:
        try:
            line_bytes = sel...
orchid basinBOT
thorny jay
# misty garnet CP build instructions are pretty good, managed to strip out a bunch of stuff and...

Cc: @tulip sleet Wouldn't that be a good candidate library to add for QT Py Haxpress? Except for Serpente, I don't see a lot of M0 with i2cperipheral. Soldering to Haxpress a QT Py seems more accessible than having to compile a custom version of CircuitPython... some time ago I wanted to do QT Py to QT Py communication, and there were two options: (1) Hack a StemmaQT cable to put RX on TX (port capable of I2C can also do UART) (2) use a standard StemmaQT cable and do I2C, but one require to be i2cperipheral. @misty garnet I am very much interested in any demo of mcu to mcu communication in I2C, if ever you have a project to share.

manic glacierBOT
misty garnet
#

@thorny jay i2c mcu to mcu is something I plan to look into soon, so I'll share my experiences

tulip sleet
misty garnet
#

Yeah, I carved out a lot of room ditching the USB HID/MIDI for my build

manic glacierBOT
onyx hinge
orchid basinBOT
tough flax
#

Add lots of maybes to that statement ๐Ÿ˜‰

onyx hinge
#

CircuitPython doesn't have USB OTG yet so I'm not sure about the idea of a USB filter

tulip sleet
#

Bill is using Arduino for one side of the filter, I think.

onyx hinge
#

(schematic)

#

@tulip sleet oh, that tracks

onyx hinge
#

@idle owl okay, done

idle owl
manic glacierBOT
manic glacierBOT
onyx hinge
#

@slender iron in mimxrt10xx do you know if we have an "uncached data ram" segment defined yet?

#

if we do it's not named like the sdk wants, I don't think. #define AT_NONCACHEABLE_SECTION(var) __attribute__((section("NonCacheable"), zero_init)) var

slender iron
#

@onyx hinge I don't believe we do

onyx hinge
#

@slender iron what's "ocram"?

slender iron
#

it's the flexram made available to the dma axi bus

#

the MPU settings say it isn't cached

onyx hinge
#

ok, so the context of my question is that this example ensures that the DMA descriptor and DMA data are not cached ... sai_edma_record_playback.c:AT_NONCACHEABLE_SECTION_ALIGN(static uint8_t Buffer[BUFFER_NUMBER * BUFFER_SIZE], 4);

#

so .. how would you recommend accomplishing this in CP?

slender iron
#

add the section name into the OCRAM definition

#

in .bss

onyx hinge
#

okay, that's a much shorter path to the goal than I was worried about

#

@slender iron thanks!

slender iron
#

๐Ÿ‘

#

looks like it's not cacheable so usb will work

misty garnet
#

hmm, pwmio is supposed to be a core module for the QTPY, but when I did my custom build I had to specifically enable the flag, is this right?

tulip sleet
#

qtpy 2040?

misty garnet
#

nope, M0

tulip sleet
#

looking...

#

yes, it should be on automatically. I'll look at a stock build

#

it is on in the stock build

misty garnet
#

let me take out out of my mpconfig and see if it still works

#

yup, no PWMIO module

#

here's my mpconfig:
CIRCUITPY_PULSEIO = 0
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_USB_HID = 0
CIRCUITPY_USB_MIDI = 0

CIRCUITPY_COUNTIO = 1
CIRCUITPY_I2CPERIPHERAL = 1

CIRCUITPY_SDCARDIO = 1

FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice

#

I need to explicitly stick in PWMIO, maybe one of the other flags messes with it?

tulip sleet
#

@misty garnet pulseio and pwmio are connected in the conditional

#

you are turning off pwmio by turning off pulseio

misty garnet
#

ah, that would do it then, thx

tulip sleet
#

we are removing PWMOut from pulseio in 7.0.0

#

it will only be in pwmio

mental nexus
orchid basinBOT
#

Not sure this is the right place... but on the support matrix ( https://circuitpython.readthedocs.io/en/latest/shared-bindings/support_matrix.html ) I noticed that QTPy has no space between QT and Py in the new RP2040 version:
"Adafruit QT Py M0" and "Adafruit QT Py M0 Haxpress" vs "Adafruit QTPy RP2040"

Yeah... some of these boards use the names interchangeably like MatrixPortal vs Matrix Portal, which has both printed on the same board.

slender iron
manic glacierBOT
analog bridge
idle owl
#

I want us to consider freezing adafruit_pypixelbuf into boards that need it. Because the dynamic bundler has no way of knowing a piece of code is being used on a particular board, and would therefore have no way of knowing whether that lib is needed or not. So either it's included every time neopixel or dotstar is used, or we have to include a separate section about downloading it separately. Or we freeze it in and it's a non-issue.

onyx hinge
#

@idle owl any idea if there's enough room? I think that's likely to be the trouble

#

how big's the mpy file?

idle owl
#

Pretty small afaik. Hold on.

#

Hmm. 6k on disk. That's not as small as I thought.

tulip sleet
#

if it's always in lib, but _pypixelbuf is native, I think import _pypixelbuf will import the native version.

#

so it can be in the custom bundle but not be used

#

i think

#

I have to check that

idle owl
#

I think NeoPixel and DotStar look for the native version first

#

But they fail to run if the native version isn't found

onyx hinge
#

trinket_m0's fullest translation has about 1700 bytes free at the moment

idle owl
#

๐Ÿ˜• Sigh.

#

I thought it was a lot smaller.

tulip sleet
#

but if they failover to adafruit_pypixelbuf, I thought.

#

not fail

idle owl
#

Yes, but if it's not present, obviously it won't work.

#

Right now, if I were to include a piece of code that used NeoPixel, with the intention of using it on QT Py, and download the dynamic bundle for it, it would include only NeoPIxel.

tulip sleet
#

right, so I'm saying if you always include it in the custom bundle, then you're safe; it will just be unused on boards with native _pypixelbuf. Is that ok?

idle owl
#

Oh. Ok I see.

#

Yeah that would be fine.

#

So we set it as a requirement for NeoPixel?

#

As long as we're certain it checks for the native version first anyway.

tulip sleet
#

yah, it's a requirement that isn't used sometimes

idle owl
#

Yes it uses native first.

#
    import adafruit_pypixelbuf as _pixelbuf
else:
    try:
        import _pixelbuf
    except ImportError:
        import adafruit_pypixelbuf as _pixelbuf```
#

wait.

#

No it doesn't.

onyx hinge
#

first let's remove that top block

tulip sleet
#

i mistakenly thought that we named adafruit_pypixelbuf to be _pixelbuf anyway

slender iron
#

@analog bridge changing countio is different from what the issue says. generally, I don't think a count of interrupts will be enough. I suspect folks will want more of an event queue that has timing info about the events too

idle owl
#

@onyx hinge That top bit is if we were still supporting v5 right?

onyx hinge
#

yes I think so (though adafruit blinka is probably using that top block)

idle owl
#

ah.

onyx hinge
#
Python 3.7.3 (default, Jan 22 2021, 20:04:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.implementation.version[0]
3
#

er does this lib work with blinka?

idle owl
#

That's from NeoPixel, so I certainly hope so

tulip sleet
#

if we have

    try:
        import _pixelbuf
    except ImportError:
        import adafruit_pypixelbuf as _pixelbuf
#

I don't think we need the if statement, because the first import will fail in the right circumstances

idle owl
#

Right, that's what I thought

tulip sleet
#

i'm not sure why we thought we needed the if statement at all

#

it is redundant, it seems to me

onyx hinge
#

it doesn't seem to fit, fwiw

#
7.0.0-alpha.1-28-g0539b88a6
trinket_m0 de_DE 

vanilla
1364 bytes free

w/ _pypixelbuf
region `FLASH_FIRMWARE' overflowed by 1720 bytes

w/ frozen adafruit_pypixelbuf
region `FLASH_FIRMWARE' overflowed by 2644 bytes
idle owl
#

Ok. Good to know.

onyx hinge
#

and _pixelbuf is smaller overall

#

is the custom bundler or circup not installing adafruit_pixelbuf?

idle owl
#

Custom bundler. Hadn't tried circup yet.

#

Actually, I have no way to test.

#

The only one I could think of, I directly import adafruit_pypixelbuf for colorwheel. So that one downloads it properly.

onyx hinge
#

the metadata says it should install it afaict ```$ < bundle.json jq '.neopixel.dependencies'
[
"adafruit_pypixelbuf"
]

idle owl
#

oh hmm.

onyx hinge
#

this is from that new bundle json file

idle owl
#

Maybe I'm wrong then.

onyx hinge
idle owl
#

You might be right and I just sent us down some nonsense for no reason.

#

Wait...

#

I can test it. Hold on. Let me find some NeoPixel code.

onyx hinge
idle owl
#

OK, yeah.

#

I'm sorry.

#

Need to check DotStar.

#

But I should have researched better before raising the flag.

#

Apologies.

onyx hinge
#
[
  "adafruit_bus_device",
  "adafruit_pypixelbuf"
]
idle owl
#

DotStar does it too.

#

My bad.

#

Thanks for looking into it.

onyx hinge
#

Thanks for bringing the issue forward

idle owl
#

I guess we could still update the block at the top of NeoPixel.

onyx hinge
#

save a few bytes of mpy file ๐Ÿ™‚

idle owl
#

same in DotStar.

onyx hinge
#

we could also consider whether we want to rename _pixelbuf to adafruit_pixelbuf, like we did for adafruit_bus_device

#

I think that has worked out. I'm sure for historical reasons we just weren't ready to do it that way then

idle owl
#

What would that do?

onyx hinge
#

it would let a bundle that supported 7.x only eliminate the try/except ImportError

#

because the first import would get the one in the core, if it's there

idle owl
#

The mpy version is pypixelbuf. So it's still not a drop-in replacement.

#

Right?

onyx hinge
#

OK, I mis-spoke, I wanted to make the names exactly the same

idle owl
#

There is code that imports _pixelbuf for colorwheel which is neither here nor there, we'd need to update it, But worth noting.

#

Ah ok

#

That's what confused me.

#

I guess renaming the internal version makes more sense as it's ostensibly not meant to be used publicly as it is now. So there's little to break by renaming it.

#

@onyx hinge @tulip sleet PRs in for NeoPIxel and DotStar. Tagged you both for reviews. No rush.

#

Limor got them.

#

Done and released.

idle wharf
#

What triggers the creation of a new cp version specific bundle (in this case CP7 bundles) ?
And because I've not been around long enough to know this, what is the approach for supporting 6 and 7 assuming 7 had a breaking change for a library.

idle owl
#

We continue to support the latest and the most recent before that. So once 7 is released, we'll support 6.2.0 and 7. For now, we support 6 basically because 6.2.0 stable went out.

#

And we tell Adabot to create a new version of the bundle.

#

And to stop making old versions.

idle wharf
#

OK, so circup should always fallback to "latest" (highest semver) and not fail when it can't match the version. In this case it fails on CP7 daily builds because there is no cp7 bundle.

OR a cp7 bundle could be created.

idle owl
#

We don't have an actual 7 release yet.

#

Unless I'm missing something. Only the tag.

idle wharf
#

Hasn't main been incremented to 7.x ? for daily builds and actions, etc..

idle owl
#

There's an alpha.1 tag, but there's not a release on GitHub.

#

I'm not sure what the nuance is here.

idle wharf
idle owl
#

As in I'm not sure what a tag vs a release specifically means for other things.

onyx hinge
#

the tag exists so that the builds from main branch won't report as 6.2.mumble. A release will probably not be made until "later", which depends on many factors but mostly feelings

idle owl
#

Hmm alright. I guess it's time to tell Adabot to be building a 7 bundle then.

onyx hinge
#

yes the latest builds are identifying them as "7.mumble" now

idle wharf
#

7.mumble ๐Ÿ™‚

idle owl
#

Unless Adabot needs a release to work from.

#

Checking.

ember fjord
#

Has anyone written code that incorporates both the adafruit_hid library and the Adafruit_CircuitPython_MatrixKeypad-master library or can point me in the right direction?

idle owl
#

@ember fjord Please avoid cross-posting questions. #help-with-circuitpython is a better channel for that question. You've already asked it there. Please be patient as most folks are community members who help out when they're around.

ember fjord
#

is my question even written in a way that makes sense that somebody would even be willing to help @idle owl

idle owl
#

Yes I think it makes sense.

ember fjord
#

even the "beginner" chats seem far beyond my skill sets at this point

idle owl
#

It takes time to learn. This channel is more for development discussions. The help-with channel is better for questions like yours.

onyx hinge
#

is that enough to do it?

idle owl
#

Then we need to update circuitpython-org to have it when we're ready. But it should build the bundles.

#

Yes.

#

Apparently.

onyx hinge
#

keen!

#

what's a ".idea/*"?

idle owl
#

PyCharm nonsense.

onyx hinge
#

ah

idle owl
#

I opened a PyCharm project in the repo directory and it creates that directory.

#

So it's delete it or .gitignore it. I usually choose the latter.

onyx hinge
#

there's a way to set up a personal, but system-wide ignore list

idle owl
#

oh hmm, I guess I should do that.

onyx hinge
#

One time per computer/account, git config --global core.excludesFile $HOME/.gitignore then add lines to your $HOME/.gitignore file to have them applied in all git repos

idle owl
#

Also, circuitpython-build-tools appears to still be using Travis. We should probably fix that.

idle owl
#

Will that work on Mac as well?

onyx hinge
#

I think it's really handy .. on the other hand, adding ignores in our own repos for packages we recommend users to use doesn't hurt and may help

#

it should, but if you want me to check you'll need to buy me an MacBook Pro M1 and I'll get back to you

idle owl
#

I'll get on that.

onyx hinge
#

thank you!! heart_bi

idle owl
#

May have broken PyCharm trying to open a project in my home directory.

onyx hinge
#

uh oh

idle owl
#

Hah.

onyx hinge
#

bet you wish you'd bought me that machine for testing now.

idle owl
#

๐Ÿ˜„ PERHAPS.

#

Ok I think I did the thing.

manic glacierBOT
idle owl
#

Ok, @idle wharf in theory there will be a 7 bundle on next build.

idle wharf
misty garnet
#

@tulip sleet I did a WSL2 Ubuntu fresh install twice (2 different machines) to build CP, and had to manually update click both times even following the build instructions

tulip sleet
valid bison
#

Hi. Is it possible to have a hardware switch to select if the usb storage is mounted or not?

misty garnet
#

@tulip sleet yup, can confirm that in my CLI history

tulip sleet
#

I created a fresh virtualenv and did that pip3 install and it installed click 7.1.2

#

so I'm mystified. I may try a clean ubuntu in a VM

misty garnet
#

I'm pulling the Ubuntu from the Microsoft store if that makes a difference

tulip sleet
#

@Magic not yet, but I am working on it for the next release

tulip sleet
valid bison
#

@tulip sleet wow thx.

tulip sleet
tulip sleet
valid bison
#

Ah intresting. So the "bootsel" storage will always work if the button is pressed?

tulip sleet
#

i'm confused by your question. RP2-RPI (or is it RPI-RP2? ๐Ÿ™‚ ) is separate from CIRCUITPY. I'm talking about enabling/disabling CIRCUITPY.

#

I mean you can use the stock CircuitPython .uf2, or build a custom one with CRICUITPY visibility turned off

valid bison
#

ok, but if it is turned off at all, how can i put the main.py onto it?

tulip sleet
#

you have to use the stock one to put main.py on, then you load the custom one. Loading a new .uf2 does not erase CIRCUITPY. I have an HID volume control I use which does exactly this.

#

so if you need to change the code, you have to reload the CircuitPython .uf2

valid bison
#

ah thx. didn't know that.

misty garnet
#

@tulip sleet yeah, not sure where the glitch is, here's a bit of the output from the pip3 requirements:

Collecting typer
  Downloading typer-0.3.2-py3-none-any.whl (21 kB)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from -r requirements-dev.txt (line 9)) (2.22.0)
Collecting sh
  Downloading sh-1.14.1-py2.py3-none-any.whl (40 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 40 kB 2.8 MB/s
Requirement already satisfied: click in /usr/lib/python3/dist-packages (from -r requirements-dev.txt (line 11)) (7.0)
#

downloads typer, but seems to be happy with click 7.0

tulip sleet
#

@slender iron ^^

#

maybe it's the version of pip you are using

misty garnet
#

sudo apt install python3-pip

#

is what I used

tulip sleet
#

but then you can do pip3 install --upgrade pip and get an even newer version

#

i have

halbert@tuna:~$ pip3 --version
pip 21.0.1 from /home/halbert/.local/lib/python3.8/site-packages/pip (python 3.8)
misty garnet
#

maybe that's it:
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

tulip sleet
#

I'm not saying it's a good thing it's wrong; that's not good. That would explain why it worked for me with a fresh virtualenv. I will try to downgrade the pip in the virtualenv and see what happens

misty garnet
#

that's also the pip from the main filesystem rather than my local installation, so I need to export a PATH

tulip sleet
#

do you have /home/kevint/.local/... something in your $PATH?

misty garnet
#

no I didn't

tulip sleet
#

hmm... we may need to add directions about that. I remember something about this adding .local automatically to PATH, but I can't remember who does that

idle owl
#

@gilded cradle Thanks for releasing circuitpython-build-tools. I missed that step with the update I submitted. Would have assumed I did something wrong when it didn't do anything new tomorrow. ๐Ÿ˜„

gilded cradle
#

No worries. I worked on it recently enough that I happened to remember.

idle owl
#

@tulip sleet tuna? Is that name a variation on a theme, or singular?

#

As in are they all fish, or food.....

tulip sleet
misty garnet
#

heh, curious

tulip sleet
idle owl
#

Hah!

tulip sleet
#

I think there were some other ones too.

#

my previous dev machine was salmon. oh, also char

#

they were vaguely related by physical size of machine and physical size of the fish

idle owl
#

I named one Robocrepe and haven't let it go since. My windows machine is BLACKBOX because the case is sort of a black monolith.

gilded cradle
#

Isn't a crab technically a crustacean?

tulip sleet
#

well, sea creatures, I was getting desperate. We don't have an aquarium, so fish you keep as pets did not come naturally to me ๐Ÿ™‚

gilded cradle
#

๐Ÿ˜„

idle owl
#

Call the next one oscar!

tulip sleet
#

also i have a chinook windows machine. I have far too many computers

idle owl
#

You do have many, indeed.

tulip sleet
#

like about a dozen

#

they are not all turned on

idle owl
#

Now I'm coming up with a bunch of sea creature names for you ๐Ÿ˜†

tulip sleet
#

i would be grateful ๐ŸŸ

gilded cradle
#

trout

idle owl
#

@tulip sleet Seriously, ping me next time you need one. I got you.

gilded cradle
#

carp

#

๐Ÿ˜„

idle owl
#

stingray!

gilded cradle
#

Nice one!

tulip sleet
#

i have a trout already

idle owl
#

I had one for a bit. Little one, relatively speaking.

#

@gilded cradle Oh! Thanks for testing my update! Just saw the GitHub message.

gilded cradle
#

No worries, I kind of had to do it to test my change ๐Ÿ™‚

idle owl
#

Whatever it takes ๐Ÿ˜„

#

Glad it worked. circup and Patrick will be pleased.