#circuitpython-dev

1 messages · Page 370 of 1

manic glacierBOT
slender iron
#

from ports/unix

manic glacierBOT
crimson ferry
#

sys.print_exception() has disappeared from 7.0.0-* ?

analog bridge
#

that is the result of 1.12 merge

jaunty juniper
#

yep, disappeared in 1.12 merge, probably not intentionnally

#

we might want to move it from sys though since it's not C Python

#

(and 7.0s are for breaking changes)

slender iron
#

I think that's where it is in CPython

jaunty juniper
#

I believe it's not really in C Python, I guess the closest would be traceback.print_exc(), but nothing here just takes an exception, it's more convoluted

#

format_exc might be better, to get a string

hollow token
jaunty juniper
#

no it's not, this takes a bunch of things and does not provide the simple API of sys.print_exception

hollow token
#

In function its closer to print_exc()

#

but as the Python doc explains, print_exc() is only really a macro to print_exception(*sys.exc_info(), limit, file, chain)

#

sys.print_exception() was probably there because mpy or circpy didn't have traceback

jaunty juniper
#

I've seen sys.print_exception used to get the stack trace without halting the code, and to log the exceptions to a file basically, both useful on a microcontroller

hollow token
#

having traceback is actually pretty useful overall

#

you can still do that with traceback

jaunty juniper
#

I don't want to see it disappear in favor of a module that will take more space and in particular not fit on small boards

hollow token
#

even if you made utraceback as a version, you're still not going to take extra space than before

#

(aka, strip functions you don't care about (there is a LOT of format funcs in that lib) it isn't going to make builds bigger in memory than before)

manic glacierBOT
#

Firmware

Adafruit CircuitPython 6.2.0 on 2021-04-05; Raspberry Pi Pico with rp2040

Code/REPL

import board
import busio

from time import sleep

uart = busio.UART(tx=board.GP0, rx=board.GP1, baudrate=115200)

while True:
    print(uart.write('Hello, world\n'.encode()))  # 0, every time
    sleep(1)

Behavior

Unfortunately, nothing. The UART interface reports 0 bytes written, the computer attempting to receive the messag...

manic glacierBOT
manic glacierBOT
#

I am unable to replicate this issue. Can you try the following code.
Connect GP0 & GP1 together. The expected output is hello in REPL terminal.

import time
import board
import busio
import digitalio

led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

s = bytearray("hello\n\r".encode())
uart = busio.UART(board.GP0, board.GP1, baudrate=115200)

while True:
    uart.write(s)	
    data = uart.read(10)  # read up to a byte
    # ...
manic glacierBOT
manic glacierBOT
tulip sleet
#

@arctic hamlet In CircuitPython 7, we're adding some things that are overflowing your CS11. I am getting things to fit by turning off longints. Also note there is now a native sdcardio implementation that can substitute for the Python-based SD card library.

It appears you have discontinued the CS11 anyway?

#

do you have strong requirements for longints?

#

@paper sedge I sent you a message yesterday via contact form about removing some things from the CircuitBrains Basic build. I may be able to remove less than I thought. Removing async/await and re may do it.

#

@arctic hamlet similar q for CC03

paper sedge
#

Hi @tulip sleet. Thanks for the update. Sorry I hadn’t replied yet. Do you happen to know what Adafruit is going to do with their SAMD21 board definitions?

tulip sleet
#

we are going to make them fit :). CPX is a special case, but Feather M0, Metro M0, etc. will all be similar.

#

Current settings I am testing:

CIRCUITPY_AUDIOMIXER ?= 0
CIRCUITPY_BINASCII ?= 0
CIRCUITPY_AUDIOMP3 ?= 0
CIRCUITPY_BLEIO_HCI = 0
CIRCUITPY_BUILTINS_POW3 ?= 0
CIRCUITPY_COMPUTED_GOTO_SAVE_SPACE ?= 1
CIRCUITPY_COUNTIO ?= 0
# Not enough RAM for framebuffers
CIRCUITPY_FRAMEBUFFERIO ?= 0
CIRCUITPY_FREQUENCYIO ?= 0
CIRCUITPY_I2CPERIPHERAL ?= 0
CIRCUITPY_JSON ?= 0
CIRCUITPY_MSGPACK ?= 0
CIRCUITPY_RE ?= 0
CIRCUITPY_SDCARDIO ?= 0
CIRCUITPY_SYNTHIO ?= 0
CIRCUITPY_TOUCHIO_USE_NATIVE ?= 1
CIRCUITPY_ULAB = 0

MICROPY_PY_ASYNC_AWAIT = 0
#

for boards with external flash. displayio will be ON, but probably not vectorio (addition to displayio)

#

countio could go either way

#

the main addition for CircuitPython 7 in terms of space taken is dynamic USB descriptors so you can turn devices on and off and supply your own HID report descriptors (custom gamepads, etc.)

paper sedge
#

Thanks. I am pretty sure I am on my last run of these boards. They aren’t selling well anymore, likely due to market shifts like the RPI2040. I am good with whatever is decided for the Adafruit M0 line.

tulip sleet
#

got it; we can always tweak the definitions for you later; the RP2040 is a big (and ultimately good) disruption. We always felt the SAMD21 boards were a stepping stone due to limited RAM and flash, but are not planning to drop them or anything like that.

paper sedge
#

Totally agree of the 2040 being a good direction. My board is a bit of a different case because it’s more of an intermediate board that you typically would design a mounting PCB around. It’s a tough sell at the price point required for small volume production. The only thing constant in life is change. 😀

tulip sleet
#

if you can get RP2040's and build a tiny castellated board, it sounds like it would go over well

#

good luck with your product line!

paper sedge
#

Thank you!

idle owl
#

@tulip sleet Are you around for a question about the HID thread?

tulip sleet
#

yup

idle owl
#

Limor said "make a note on the Pico HID guides and the HID template", but I'm unclear on what I'm supposed to be making a note of? That multi-media keys are sent using ConsumerControl? Or.. am I missing something.

tulip sleet
#

I think, to make the point that certain keys on a regular keyboard are not necessarily sending regular keycode values, but might be sending consumer control values on a separate consumer control device.

In CircuitPython, this means sending Keycodes values via a Keyboard, and sending ConsumerControlCode values via a ConsumerControl.

So if you have a stock HID keyboard example, maybe it should also include ConsumerControl, instead of just Keybaord, to make people aware they may need to do both. E.g. include sending an "A", and also "mute", or something like that.

idle owl
#

Hmm ok.

tulip sleet
#

maybe an augmented example is not necessary, but just add some text that some keys on a keyboard that a person might want to emulate are not actually regular keyboard keys, but consumer control keys. The person in that issue was not aware of that. Or maybe just have a section about "Consumer Control", and how it's used for "multimedia keys", and they don't require focus. It's hard to explain, I agree. People think that the keys on their keyboard are just keys that send codes like any other key, but in fact something quite different is going on.

idle owl
#

I'm adding a paragraph or two to the only Pico HID guide I can find now.

tulip sleet
#

it's not Pico only at all, it's any use of HID.

#

it's just that everyone and their sibling is using Pico to build keyboards 🙂

idle owl
#

Right, which is why I was a little confused at the specificity of the request. But yeah.

#

I'll include the note in my HID template when I do it.

tulip sleet
#

sounds good

onyx hinge
#

@slender iron making good progress on test failures, will push something soon.

#

past the first set of tests, but there are more failures with "--emit native"

#

async and native don't mix

idle owl
#

@tulip sleet ```USB Keyboards versus CircuitPython HID Keyboards

Certain keys you might want to emulate from your standard existing keyboard, such as multi-media (volume, play/pause, etc.) keys, are not actually regular keyboard keys. They are consumer control keys. All keys on a standard USB keyboard are not necessarily sending regular keycode values, but instead may be sending consumer control values on a separate consumer control device. In CircuitPython this is the difference between sending Keycode values via a Keyboard, and sending ConsumerControlCode values via a ConsumerControl. Therefore, if, in CircuitPython, you intend to send, for example, a "mute" command in your HID example, you should use ConsumerControl instead of an equivalent keyboard key based on your standard existing keyboard.

Consumer control keys, such as multi-media keys, do not require "focus" to function. For example, sending a VOLUME_DECREMENT consumer control command will decrease the volume regardless of what application is currently focused.```

#

Eh?

#

Some of that is code formatted in Learn.

#

oops last part has grammar issues.

tulip sleet
#

Quite clear, I think/hope. Last sentence maybe "regardless of which window currently has keyboard focus"

idle owl
#

That's better

#

Thank you

tulip sleet
#

all this talk about "focus": I am not sure many people know the technical terms, but they just know "I have to click here before I type", but I'm not sure we can educate them on that right now

blissful pollen
#

The writeup makes sense to me and until 60 seconds ago I did not know anything about consumer control keys and how they work in USB

idle owl
#

Heh, thanks Mark.

tulip sleet
#

i was completely surprised by it too, when I was looking at the HID descriptors for a regular keyboard: "hey, what's all this extra stuff??"

#

There's "sys control" too, which is for power keys, etc., but no one seems interested in those

#

i think we could use a whole USB guide when dynamic descriptors go in, with more or several pages on HID devices

slender iron
jaunty juniper
slender iron
#

that's fine with me

jaunty juniper
#

I just fear another situation where "you can't do it on M0"

slender iron
#

but if it's not much more difficult I'd rather match CPython

jaunty juniper
#

and maybe it's not, I might not just understand the traceback module

analog bridge
#

I did a build implementing traceback.print_exception and its 80 bytes for S2

#

@slender iron want to see a PR?

slender iron
#

sure! thank you

idle owl
#

So, even though the button on a QT Py RP2040 is controllable in code with CircuitPython, I can't use it in boot.py to trigger storage.remount() because if I'm holding down the boot button on reset, it will go into the bootloader. Right? Sanity check on that please?

#

I can use the button on a CPX though, I think.

tulip sleet
idle owl
tulip sleet
#

wait 1-2 secs after reset and then check the button

#

more straightfoward

idle owl
#

Which is how we do it now.

#

Ok.

idle owl
jaunty juniper
#

will the QT PY 2040 be updated to light up the neopixel yellow for safe mode ?

slender iron
#

all of the LED flashing will be changing soon hopefully

#

it should apply to the RP2040 though

jaunty juniper
#

I don't think you intend to change wait_for_safe_mode_reset() as part of that ?

slender iron
#

nope. I think the startup LED colors will be the same

onyx hinge
#

@slender iron I think I have a good lead on the native+async problems

slender iron
#

nice!

manic glacierBOT
#

This may be expected, but REPL_RELOAD only arises with Control-D immediately after:
Press any key to enter the REPL. Use CTRL-D to reload.

Control-D from the >>> prompt gives:

>>> # Control-D
>>> 
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

code.py output:
supervisor.RunReason.SUPERVISOR_RELOAD

(same on PyPortal & MagTag)

Thanks for the testing @anecdata! @hierophect wa...

slender iron
#

@crimson ferry want to do anything else on your AP PR?

crimson ferry
#

@slender iron There's always more scope, but I think it's at a good place with core features.

slender iron
#

👍

#

agreed, we can always refine it

idle owl
#

How can I determine how much space is left for files on CIRCUITPY using command line? Using Finder is returning the same number no matter what, I don't think it's right.

tulip sleet
#

I don't think there's a way. did you empty the trash?

idle owl
#

Two different boards gave the same number.

#

Disk Utility is giving me a more accurate picture.

#

So now my original question: is 40KB very much space for a temperature logging file in CircuitPython, or would that fill up really fast?

tulip sleet
#

how much are you writing for each log entry?

#

and how often?

#

do you need to write a timestamp?

idle owl
#

This code doesn't timestamp it. Only records the temp, on one line, every second.

#

I'm looking at NeoTrinkey as the smallest example here. Basically I'm trying to decide whether it is possible to use the NeoPixel for the blink codes on boards without a little red LED, or if that would take up too much space.

tulip sleet
#

so 5-10 bytes per second. 300-600 bytes per minute 18k-36k bytes per hour

#

I wouldn't log every second

idle owl
#

Ok, so drop logging time.

#

So basically every second I add to logging time, adds an hour to how long it would last?

#

ish

#

wait no

#

I'm mathing wrong.

tulip sleet
#

if you sampled every 10 seconds, then 1.8-3.6kb per hour

idle owl
#

Ok so no I did the maths right.

#

Alrighty. So 10 seconds gets over 10 hours. I suppose that'll work.

#

Better than wiring up an external LED to make a data logger.

#

Which is what I'm trying to avoid here.

tulip sleet
#

depends on how many digits of accuracy you want. If just 3 digits, then more like 5 bytes per entry

idle owl
#

Make it solder and breadboard free.

#

Hmm, I could limit the digits.

tulip sleet
#

writing every second may wear out the flash also, so 10-30 seconds is a better example

idle owl
#

Duly noted.

#

So glad I wrote this code ever so long ago: while True: cpx.pixels[0] = (abs(cpx.pixels[0][0] - 255), 0, 0) time.sleep(0.5) It's the NeoPixel equivalent of led.value = not led.value.

#

If I remember correctly anyway.

onyx hinge
#

@slender iron okay, that PR's updated so that all the tests pass. the workflow doesn't run on github because I'm a first-time contributor to your repo...

manic glacierBOT
idle owl
#

Realising blinking an LED every 10 seconds in that fashion isn't really all that useful. On for 10 seconds, off for 10 seconds... hmph.

tulip sleet
#

blink for one second every ten seconds?

idle owl
#

Yeah that would be idea.

#

I am currently trying to wrap my brain around the logic necessary to do that.

#

I'm sure it's simple, but I'm missing something.

#

Need to write the file every 10 seconds, and blink the LED for 1 second, every 10. Need monotonic() maybe?

#

That's the only way I know how to do it is to use monotonic().

jaunty juniper
#

you can blink 1 second and sleep(9) but you'll drift due to overhead, not that monotonic won't anyway

idle owl
#

Be back in a few, prepping lunch.

onyx hinge
#

I didn't even know we built latex/pdf documentation -- that's where the actions in my repo failed.

#

/home/runner/work/circuitpython/circuitpython/CONTRIBUTING.md:8: WARNING: None:any reference target not found: CODE_OF_CONDUCT

idle owl
jaunty juniper
#

ah sorry, I might have misunderstood what you wanted to do

idle owl
#

No worries, I sort of thought it might work as well.

#

I'm trying to do two things in a loop. One thing every 10 seconds, and the other thing for 1 second, every 10 seconds.

jaunty juniper
#

not synchronous with each other ?

idle owl
#

So, let's say, print to the serial console once every 10 seconds, and blink the LED for 1 second every time I print.

#

Synchronous.

#

Not perfectly because print doesn't take 1 second, but you get the idea.

orchid basinBOT
tulip sleet
#

@idle owl, turn LED on, sleep 1 sec, turn LED off, sleep for 9 seconds, read and log temp, loop around

idle owl
#

Oh. I need to separate out the LED code. Ok. That makes more sense.

idle owl
tulip sleet
#

np 🙂

idle owl
#

Easier to explain than my fancy neopixel = not neopixel code anyway.

orchid basinBOT
tulip sleet
#

maybe blink 1 sec, read/log temp, sleep 9 seconds, so the logging is close to the blinking

idle owl
#

I wrote a simple print/blink thing and it seems to be pretty close. But yeah I'll reorder it.

#
    pixel.fill((255, 0, 0))
    time.sleep(1)
    pixel.fill((0, 0, 0))
    time.sleep(9)
    print("Test")```Puts them kind of together because end and beginning of loop...
#

This is better. while True: pixel.fill((255, 0, 0)) print("Test") time.sleep(1) pixel.fill((0, 0, 0)) time.sleep(9)

#

except might be a problem if the write takes longer then 1 second.

#

Can put write first.

manic glacierBOT
idle owl
#

Did this ever work? It gives the pin a Pull.UP but we say to connect it to ground.... Is that right? Because giving A0 on QT Py RP2040 a pull up, and connecting A0 to GND returns False and connecting it to 3.3V returns True.

#

Wait.

#

I think I just confused myself with the readonly thing 😆

#

OK, I confused myself because it wasn't really tied to ground, the wire apparently wasn't quite connecting. So I thought everything was backwards.

#

False alarm.

#

Oooh I almost wasted a ton of time troubleshooting that buggy pin definition on the Itsy RP2040 that I fixed. Apparently had only updated one of my two Itsy's. Oi.

#

Also destroyed my USB on that board reset. Had to unplug my hub from the wall and plug it back in to bring my keyboard back up.

jaunty juniper
#

sometimes with a rp2040 board on my Mac, after going to bootloader I have to switch USB port or the CIRCUITPY drive doesn't come up. It's very elusive and I have like 2 powered USB hubs in cascade, so who knows what's up with that...

crimson ferry
#

I have a dumb question... in the context of the dynamic USB descriptors, is CDC Data in CircuitPython the serial output, and that's distinct somehow from the REPL in USB?

tulip sleet
tulip sleet
jaunty juniper
#

it's Catalina

crimson ferry
#

that's all cdc console, right? is cdc data something in use in CircuitPython currently?

tulip sleet
#

cdc data was availaable in 6.2.0-beta.2 or 3 but then turned off afterwards because it confused Mu

#

it's coming back in 7.0.0 but will be turned off by default. Also now Mu knows how to identify a particular CDC as console/repl

crimson ferry
#

I had the impression (perhaps mistaken) that was a secondary console that was turned on then off, is data characteristically different than console?

idle owl
#

I'm having issues with more than one board on Catalina. Absolutely cannot get two to show up at the same time. I have to get to the files via command line.

#

In Finder, I mean.

#

If I want to use Finder to copy files, I have to unplug one board, and then reset the other board to get it to show up.

#

They both mount fine, and are accessible via command line.

tulip sleet
crimson ferry
#

sorry I'm being obtuse about this... so console is really a subset of data that we use in special ways?

#

@idle owl do you use column view? sometimes I won't see a volume in the left naviugation pane, but it will show up if I navigate the columns to find it

tulip sleet
#

they are both USB serial (CDC) devices. until 6.2.0-beta.3 or whatever there was only one, which was used for the REPL

tulip sleet
#

now we have an optional second one, which is in addition to the REPL

#

i'm not sure what you mean by subset

#

until usb_cdc existed, there was just text stream access to the REPL connection via input(), print() or sys.stdin and sys.stdout

jaunty juniper
#

oh, I make the removable drives show up on the desktop, I forgot that's an option

tulip sleet
#

now you can also access the same stream (as a binary stream, not text) using usb_hid.console.

idle owl
tulip sleet
#

if you enable usb_hid.data, then you have a separate bidirectional stream that you can use however you want, that shows up as a separate COMxx or /dev/tty...

ionic elk
#

Is there any case where we actually use exit_code != 0 to exit the for loop in main and hit mp_deinit? Or is that just legacy handling?

tulip sleet
#

I think you can do sys.exit(1), etc

ionic elk
#

is there a point to doing so, though?

crimson ferry
#

thanks for the deep dive, Dan!

tulip sleet
#

i'll probably write a guide 🙂

ionic elk
#

mp_deinit doesn't appear to do a lot, just MP_THREAD_GIL_EXIT, which is just some kinda mutex thing?

tulip sleet
jaunty juniper
#

@tulip sleet you can read console as binary, but receiving 0x03 will still ctrl-C the program right ?

tulip sleet
#

i mean, in regular python sys.exit() returns an integer to the shell. We don't have a shell to take that, but you could imagine somehow passing that error code back

ionic elk
#

it'll hit the end of main, right? Is that even defined the same for ARM vs XTENSA etc?

tulip sleet
tulip sleet
#

but right now, no, it's not interesting, but I wouldn't take it out; it's latent support for doing something.

ionic elk
#

Ok, good to know. Thanks!

#

was just curious whether something sneaky was happening there.

#

I do kind of wonder what happens with the return 0; from main though, I'd have to look at the C runtime

#

It could be defined differently between ports.

tulip sleet
ionic elk
#

or the xtensa one, in the ESP case, which might be different.

#

I could put in a comment saying the behavior is undefined, maybe?

onyx hinge
slender iron
#

@onyx hinge added you as a maintainer

idle owl
#

@lone axle Have you started on the CircuitPython Essentials storage page update yet?

slender iron
idle owl
#

@lone axle I'm asking because I started working on the Template, and you may want to check it out because I'm trying to include the bits that I wanted included in the current one. And if you started on it, I wanted to look at what you have. If you haven't, you can check out what I have as I work on it.

lone axle
idle owl
#

@lone axle Alright, remind me to send you a link to the template before you start working on it tonight then. We'll see how far I get. Templates are a little weird to look at, but you'll get the idea.

lone axle
#

Will do.

onyx hinge
#

@slender iron thanks, I was able to make sure actions was enabled in that repo (I think it was all along but if a PR has workflows but the main branch doesn't, github doesn't bother running them in the PR)

idle owl
#

Are microcontroller.cpu.temperature values affected by ambient temp? As in, could you track changes in ambient temperature by running a basic board-only temperature logger for a period of time, or do the temperatures of the MCUs stay pretty consistent regardless of ambient temperatures? I've never run one long enough to have any idea.

#

Trying to figure out whether it's worth telling folks "You can plug this in anywhere you have USB power and track the temperature" or whether there's no point because tracking CPU temp in random places isn't useful.

manic glacierBOT
blissful pollen
idle owl
#

Basically it's running the data logger code, and that's it. So if you set it and forget it until it fills up, it should be stable.

#

Thanks, Mark!

blissful pollen
#

Welcome!

idle owl
#

@blissful pollen The temperature is not the ambient temperature; it is the temperature inside the microcontroller, which will typically be higher than ambient temperature. However, running only this code, once the microcontroller temperature stabilises, it should at least be consistent, and therefore usable for tracking changes in ambient temperature. Changes is in italics.

#

Clear enough?

blissful pollen
#

reads clear to me

idle owl
#

Great, thank you.

slender iron
#

@onyx hinge I'm gonna merge in your fixes and keep going with it

#

I'm not going to amend that starting commit anymore

onyx hinge
#

@slender iron thanks, let me know if/when you have more for me to look at.

slender iron
#

👍

manic glacierBOT
idle owl
#

What is it called in Python when you get an error? Is CircuitPython "returning" the error? "Receiving" the error sounds wrong, but returning seems dubious as well.

#

"throwing" seems familiar?

#

But also seems more casual.

mental nexus
#

I think the Python term is “raise”

idle owl
#

Yes!

idle owl
jaunty juniper
#

throwing is used in other programming languages, python raises an exception

#

Swift throws an error

idle owl
#

That's what I meant. exception.

#

I'm explaining the content of an except block.

manic glacierBOT
#

I've fixed the REPL to correctly set the reload reason when it encounters a CTRL-D during the repl process, as opposed to the triggering character, as Scott suggested. Works for me in testing.

However, @anecdata I can't replicate your problem with the SAMD not returning STARTUP after hitting the reset or using microcontroller.reset(). My M0 and M4 express boards both return this value after restarting. I don't have a PyPortal, but there are exactly 2 places where AUTO_RELOAD can actua...

idle owl
#

Woah. I just erased my CIRCUITPY filesystem, and now it's NO_NAME. By hitting reset, and then hitting reset again in an attempt to get into safe mode.

#

I can still get to the serial console.

#

Hey I was able to reproduce it

tulip sleet
#

are you doing reset too fast or too slow?

#

for the "slow" double-click

idle owl
#

I think it's if I hit reset when the status LED is blue. Because it took a few tries this time.

#

It's currently called storage_boot.py. and doesn't have valid pin names in it.

tulip sleet
#

that is before boot.py runs, but maybe you caught the USB just trying to set up the MSC device

idle owl
#

Hmm.

#

Related question: how do I get into safe mode or is that not a thing you can manually trigger anymore?

tulip sleet
#

do you see it yellow for 700ms? It's during that time you can do it

idle owl
#

No, I don't see it yellow, that's when I thought I was suppose to do it.

tulip sleet
#

me too...

idle owl
#

ItsyBitsy RP2040, if that matters.

#

Running a build from today.

tulip sleet
#

there could be something different about the startup on RP2040

#

but I don't know off the bat. That may be a Scott q

idle owl
#

Being able to destroy your filesystem by hitting reset in the wrong rhythm seems worth dealing with.

#

storage.erase_filesystem() gets me CIRCUITPY back.

tulip sleet
#

i keep trying to think of a better way to indicate getting into safe mode, but we need yet another button, or maybe support for triple-click in the bootloader

manic glacierBOT
#

re: STARTUP, I'm not sure, could be a problem with the test method. I commented out the reload to remove that variable, and added in a time indicator:

import time
import supervisor

time.sleep(10)
print(time.monotonic(), end=" ")
print(supervisor.runtime.run_reason)
#supervisor.reload()

After a hard reset, I wait about 5 seconds until the volume appears, then start screen. Result:

14.928 supervisor.RunReason.AUTO_RELOAD

Code done running.
Auto-reload is on. Sim...
idle owl
#

Can't seem to do it again with no code running. Let me add a code.py with something more substantial than hello world in it.

#

Still not doing it. Was it somehow trying to run the code in storage_boot.py? Trying with that.

tulip sleet
idle owl
#

@tulip sleet Ok hmm, maybe I had a boot.py file the second time. Because I was able to reproduce it this time only with a boot.py file.

#

It's not a valid file, there's no pin names in it or whatever, it's a template file.

#

but it turns blue, I hit reset, and it blasts the board.

manic glacierBOT
jaunty juniper
#

ah I though I understood a thing but I misread >_>

idle owl
#

Ok now I can't keep a boot.py file on it. Was trying a blank one, and on reset, it erases the boot.py file.

jaunty juniper
#

oh the itsybitsy 2040 also has a NEOPIXEL_POWER pin

idle owl
#

@jaunty juniper Oh thanks.

jaunty juniper
#

does it have a 700ms delay on boot ?

idle owl
#

I have no way to measure that 😄

jaunty juniper
#

true

#

the difference might be visible if you light the neopixel in code.py, compared to the pico (which doesn't have the delay due to no status LED)

idle owl
tulip sleet
#

it shouldn't do that, but if you reset before boot.py was completely written, that might happen (though it's very rare on the Mac)

idle owl
#

I wait a while before resetting the first time.

tulip sleet
#

In Linux, you can run the sync command, which forces stuiff out. It might exist on MacOS too

jaunty juniper
#

any other file disappear ?

idle owl
#

I mean, it persists through a normal reset. But If I click reset again when the LED is blue, deletes boot.py.

manic glacierBOT
#

macOS, anything is possible in the interval before I get output... I'll try another method... I'm open to suggestions, but:

import time
import supervisor
import microcontroller

reas = str(supervisor.runtime.run_reason).encode()
microcontroller.nvm[0:len(reas)] = reas
time.sleep(10)
while True:
    print(microcontroller.nvm[0:len(reas)])
    print(time.monotonic(), end=" ")
    print(supervisor.runtime.run_reason)
    time.sleep(5)

after waiting about 20 sceonds to star...

idle owl
#

It also resets code.py to it's initial state.

#

I added a test print into code.py, and it's gone.

#

So basically, add some code and a boot.py file, click reset, NeoPixel turns blue, click reset again, CIRCUITPY is back to it's initial state.

manic glacierBOT
ionic elk
#

Anybody have a PyPortal who could give the run_reason PR a shot? We're having trouble pinning down a weird overwrite of the "STARTUP" with "AUTORELOAD" reason on that board.

crimson ferry
#

are the artifacts unavailable while it's re-building?

manic glacierBOT
lone axle
#

@idle owl I will be getting going on the storage clarifications shortly if you want to send me that page to take a look at.

idle owl
#

I'll DM you the link.

idle owl
manic glacierBOT
#

Latest artifacts:

Adafruit CircuitPython 7.0.0-alpha.1-1042-gb9843f15b on 2021-05-05; Adafruit Feather M4 Express with samd51j19
>>> import supervisor
>>> supervisor.runtime.run_reason
supervisor.RunReason.STARTUP
Adafruit CircuitPython 7.0.0-alpha.1-1042-gb9843f15b on 2021-05-05; Adafruit PyPortal with samd51j20
>>> import supervisor
>>> supervisor.runtime.run_reason
supervisor.RunReason.AUTO_RELOAD
idle owl
#

@lone axle Leave out the safe mode thing.

#

Not all boards have it.

lone axle
#

okie doke, TIL...

manic glacierBOT
idle owl
#

@lone axle Explains why I couldn't get to it on this board. Basically you'd be stuck listing all the boards it works for, etc. So, forget it. Means you could be able to get pretty much everything you need from the template.

#

Makes it easier!

manic glacierBOT
idle owl
#

@tulip sleet I am reproducing this weird deleting boot.py issue. Should I file an issue at this point? Is this a bug or is it me?

tulip sleet
#

sure, document the recipe to get it; it may ultimately be something else but it's good to write it down; i don't think it's necessarily you

manic glacierBOT
#

.. and also distinguish CircuitPython better in mpy-cross --version

In #4693, we allocated some flag bits differently than MicroPython (in order to fully distinguish async functions from generators). This makes our .mpy files incompatible with ones generated from any version of MP.

Change our first mpy signature byte to 'C' to distinguish us from MicroPython which uses 'M'.

Hopefully this will be the last bytecode incompatibility before 7.0. :stuck_out_tongue_winking_eye:

lone axle
#

I will get it worked into the hidden page and note which direction the switch is for each setting.

ionic elk
#

@slender iron do you want to review the run reason thing or should I go ahead and merge? Green light from Anecdata

slender iron
#

no need to wait for me

ionic elk
#

k

frozen flume
#

Does Circuitpython supports 32MB of flash? I know there is a 16MB csv file with the partition, but I'm wondering if I can modify that to support 32MB?

ionic elk
#

Also, is the "squash and merge" feature on Github new? That seems handy

#

We don't have it turned on though

slender iron
frozen flume
slender iron
ionic elk
#

Hmm, gotcha

tulip sleet
#

(welll, maybe that's not the only q, but it's the q i have)

#

if it doesn't work we will want to fix it

frozen flume
#

Is there a way I can test that out to see if it would handle it?

tulip sleet
#

you could just specify the new flash chip and then try a build. I think the CIRCUITPY size is just what's left over after everything else, though I'm not sure. I didn't do that part.

#

worst case is at first the size will need to be limited until any issue about it gets fixed

#

@slender iron can you think of any other gotchas?

frozen flume
#

Right now I'm running the board fine with 16MB out of the 32MB

#

but, i'm not taking full advantage of the extra space

tulip sleet
#

so are you pretending the chip is the 16MB part number, or did you just set a limit somewhere?

onyx hinge
#

@slender iron those test failures are weird. Python 3.8 prints these SyntaxWarnings, CP/MP never have. Python 3.7 and below didn't. So I get a pass locally since I have 3.7. But we aren't NEWLY using 3.8 for CI. If you look at a build of main in the CI, you can see that the SyntaxWarnings are shown as part of the output, not "what is being compared"... weird.

frozen flume
slender iron
slender iron
frozen flume
#

I would love to take advantage of the 32MB since I'm planning to ship it with CircuitPython

slender iron
#

(I can reply better after show and tell)

#

looks like it depends on the idf

#

only 10.5MB are supported through the memory mapped cache

#

but the datasheet says up to 1GB is supported

frozen flume
#

right

#

which is why we went with 32MB since that was the biggest chip we could fit in this board

slender iron
frozen flume
#

I also just noticed that CircuitPython doesn't have the partition I was referring to. I got confused with the arduino approach.

#

How can I verify if it's reading the memory size correctly? Sorry I'm not super savvy with this yet. 🙂

slender iron
#

the drive should be 28MB when working I think. 3MB are used for CP

#

you'll want to change CIRCUITPY_ESP_FLASH_SIZE=16MB and add a 32MB partitions.csv file into esp-idf-config

frozen flume
slender iron
#

the userfs size

frozen flume
#

Thanks, let me try that

slender iron
onyx hinge
#

@slender iron it could be that, maybe I just didn't see it in the diff

#

we could also add to the python3 commandline the flag to turn off all warnings if we knew what it was

#

-Wignore

slender iron
#

testing that now

#

yup, that fixed those two

frozen flume
# slender iron the userfs size

I was running the make script and got this error after updating to 32MB. esptool elf2image: error: argument --flash_size/-fs: 32MB is not a known flash size. Known sizes: 512KB, 256KB, 1MB, 2MB, 4MB, 2MB-c1, 4MB-c1, 8MB, 16MB

slender iron
#

that looks like an idf issue, not a CP one

onyx hinge
#

huh either feb 16 or mar 25 🙂

frozen flume
#

ah

#

thanks for sharing that Jeff

onyx hinge
#

https://github.com/adafruit/circuitpython/pull/4195 seems to be the latest place we've discussed updating esp-idf. It might be worth revisiting for main branch / 7.0 because the trade-offs are different than when we were trying to stabilize 6.2.0 for release.

GitHub

Starting the work for #4182

Updated the branch ESP-IDF to point to releases/v4.3
Fixed the include paths in Makefile
Fixed #includes which had incorrect full paths to use shorter paths

Open Ques...

frozen flume
#

I'm trying to use that branch from that PR for testing the new idf but I keep getting some errors when running the make script. fatal error: soc/gpio_periph.h: No such file or directory
#include "soc/gpio_periph.h"
^~~~~~~~~~~~~~~~~~~

#

wait, I forgot to run git submodule update.

#

Testing again, hopefully it works

#

@slender iron Ok, I'm almost there. Just got this new partition error. esp32s2/esp-idf-config/partitions-32MB.csv' occupy 4.3MB of flash (4549568 bytes) which does not fit in configured flash size 2MB. Change the flash size in menuconfig under the 'Serial Flasher Config' menu.

#

I gave the value of user_fs, data, fat, 0x450000, 27584, for 32MB

#

I semi guess that number of google conversion of MB to KB

slender iron
#

take a look at the other files in the board directory

#

theres is probably something else there

frozen flume
#

I haven't seen any 32MB version yet

manic glacierBOT
manic glacierBOT
#

I've tried to flash adafruit-circuitpython-espruino_pico-en_US-6.2.0.bin on the Espruino Pico following the advanced reflashing instructions on https://www.espruino.com/Pico#advanced-reflashing , but after what seemed a succesful flash the board didn't react in any way (nothing was logged in dmesg).

I have also tried 7.0.0-alpha.1 with the same result

On the same board I have successfully flashed micropython, following the same instructions.

I've also found this post on the forum htt...

lone axle
jaunty juniper
supple goblet
#

I'm cross-asking this here (already asked in the UnexpectedMaker Discord): I'm running the same code on a Feather S2 and Feather M4 Express but the M4 is a lot faster (RGB matrix, running at 7 FPS with the S2 vs 12 FPS with the M3). On paper, this shouldn't be the case and the S2 should outperform the M4 by being almost twice as fast.

Same results on Circuitpython 6.2 release and 7.0.0-alpha1.

mental nexus
#

On the S2 the RAM and flash are off board so are slower to access. Maybe that counteracts the processor speed.

supple goblet
#

Hmm that does makes sense. My application is very memory heavy and I'm doing a lot of matrix calculations. Unfortunately I have nothing as optimized as numpy 😄

supple goblet
#

There is no pre-built MP binary available yet as far as i know

serene briar
still zephyr
#

Sorry I was talking about the bumpy party you could use Ulab

serene briar
#

The cpu architecture can impact cpu performance as well

supple goblet
manic glacierBOT
supple goblet
#

Thanks!

still zephyr
#

No problem 🙂

still zephyr
serene briar
supple goblet
#

Already gained ~20% speed replacing pow() with **...

serene briar
#

Definitely give ulab a try, it’s not as good as fully cpython numpy but offers much better performance than plain circuitpython.

onyx hinge
supple goblet
#

On the M4 i was RAM constrained so i had to split up image sprites into single bitmaps. Might try to revert to sprites and use the additional RAM, vs. having to read a BMP file for every frame.

tulip sleet
jaunty juniper
#

@tulip sleet now that micropython 1.12 and #4713 are merged in, I believe the mpy format is stable for the time being ? Could then an alpha 2 release be made to upgrade the 7.x bundle to the latest mpy format going forward ?

tulip sleet
#

Let's double-check with @slender iron about the mpy format, but yes, I can make a release. The dynamic USB PR is close to done, so when that's in, I can make a release in the next few days.

solar whale
#

@onyx hinge just tried the new mpy-cross on a pirkey_m0 (converted adafruit_dotstar and adafruit_pypixelbuf) worked fine!

manic glacierBOT
manic glacierBOT
#

Sounds great 👍
Thanks a lot

في الخميس، 6 ماي 2021 13:56 Nicola @.***> كتب:

Hi, check my repo here
https://github.com/n-elia/MAX30102-MicroPython-driver. Feel free to
propose improvements.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/issues/2359#issuecomment-833499548,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARIAJJHRD5SP2YIHMV3RHP3TMKGWNANCNFSM4...

onyx hinge
#

@slender iron I tossed in a PR to fix what I think were the last two failing builds.

#

for some reason it's still requiring approval to run in your repo... huh.

idle owl
#

@lone axle Ok I made a couple of tiny changes, but overall it's good to go. Feel free to integrate it whenever you get a chance. Love the page name 😄

lone axle
#

😄 I'll work on moving it over tonight. Thank you.

manic glacierBOT
#

This is on an ItsyBitsy RP2040.

Currently running:

Adafruit CircuitPython 7.0.0-alpha.1-1025-g30c7aa8fc on 2021-05-05; Adafruit ItsyBitsy RP2040 with rp2040

** code.py and boot.py
It doesn't matter what you add to code.py - I added another line simply to verify the behavior.

code.py contains the following:

print("Hello World!")
print("Another line of code.")

boot.py is empty.

** Behavior

To reproduce:
Click the reset button. When th...

idle owl
#

@tulip sleet The ability to turn off the REPL and CIRCUITPY is already in main?

#

Want to know if I should include a warning in this section about using the REPL to recover a read-only fileysystem about how if you turned off the REPL, it won't work.

onyx hinge
#

@idle owl not yet

simple pulsar
idle owl
still zephyr
#

@slender iron it is possible to create a group of reviewers for the circuitpython.org? similar to the librarians in the libraries? thanks

idle owl
#

Hmm. Is there a way to differentiate between ValueErrors if they don't have an Errno? I'm trying to write a script that tells me what pins have touch capabilities, and ValueError is returned on invalid pins, and also on valid pins without a pulldown.

#

The PWM/SPI/UART/I2C scripts simply use ValueError to determine invalid pins. But that isn't working here.

#

Or is there some other way to know what pins work with touchio.

slender iron
slender iron
#

@tulip sleet for the mijia sensor did you find someone who determined how to change the display from C to F?

#

without the app

#

haha, got it

#

I'm such a "hacker"

#

sent 1 to the the Temperature uint characteristic

idle owl
#

🎉

#
Touch (no pulldown) on: D7
Touch (no pulldown) on: D9
No touch on: LED
Touch (no pulldown) on: MISO
Touch (no pulldown) on: MOSI
Touch (no pulldown) on: NEOPIXEL
No touch on: NEOPIXEL_POWER
No touch on: RX
Touch (no pulldown) on: SCK
Touch (no pulldown) on: SCL
Touch (no pulldown) on: SDA
No touch on: TX```
#

Script works. It's aware of the pulldown or not situation. code.py output: Touch on: A0 Touch on: A1 Touch (no pulldown) on: A2 Touch (no pulldown) on: A3 Touch (no pulldown) on: D0 Touch (no pulldown) on: D1 Touch (no pulldown) on: D10 Touch (no pulldown) on: D11 Touch (no pulldown) on: D12 Touch (no pulldown) on: D13 Touch (no pulldown) on: D24 Touch (no pulldown) on: D25 Touch (no pulldown) on: D4 Touch (no pulldown) on: D5 Touch (no pulldown) on: D6 Touch (no pulldown) on: D9 No touch on: LED

manic glacierBOT
manic glacierBOT
tulip sleet
idle owl
tulip sleet
#

on reflection, do you think if we just make one "SOS" build per board, it should be an eraser, or simply drop you into safe mode, where you can erase/reformat via the REPL or rename boot.py via CIRCUITPY

idle owl
#

I thought safe mode didn't work on everything.

#

Or is it the rest to safe mode that doesn't.

tulip sleet
#

i think it's reset to safe mode. I will just make sure I can make an "immediate safe mode" RP2040 build

idle owl
#

Ok I can test it.

#

Desk full of RP2040s over here.

#

I say "full", it's three boards. 🙄

tulip sleet
#

i know what you mean; I had to clean my desk over the weekend. It had about three layers of projects and other cruft

blissful pollen
#

I'm glad to hear having a pile of random circuit boards on my desk isn't unusual

crimson ferry
#

I just had to move my office, which unfortunately meant dismantling about three layers of long-term "experiments" 😦

idle owl
#

My desk is actually uncharacteristically clean at the moment. I mean, it's cluttered, but I can still see desk. Here anyway. My other desk is a mess.

manic glacierBOT
ionic elk
#

I feel like the Espruino Pico has the most misleading possible name for a devboard now. It's not an ESP32, it isn't from Arduino, and it's not a Pico.

#

or confusing, rather. It's not like it's their fault.

still zephyr
blissful pollen
still zephyr
#

Good, I want one 🙂

#

They seems nice and I like the color and the functionalities

blissful pollen
#

Remind me if I forget, I plan to check for a replacement chip soon but I'd send you one for sure

still zephyr
#

Thank you very much 🙂

manic glacierBOT
orchid basinBOT
slender iron
manic glacierBOT
tulip sleet
#

@idle owl (if you have time) do you have an M1 Mac? I couldn't remember if you mentioned that. I have one thing for you or someone to try

gloomy shuttle
slender iron
#

I think @tidal kiln would know @gloomy shuttle

tidal kiln
#

but the bigger task would be to update the u2if firmware with builds for those boards

#

this is all planned to be done eventually

#

for feather/itsy/qtpy 2040's

gloomy shuttle
# tidal kiln this is all planned to be done eventually

Thank you and that is good to know! That u2if on the pico really saved me a lot of hassle on a test project I am working on. It will be really nice with the adafruit rp2040 boards, stemma qt connector, and the new see saw rotary encoders.

tidal kiln
#

cool. yep. that's the hope. it'll be a bit of work, so no known timelines.

#

glad you found the blinka/pico-u2if combo useful

#

that u2if firmware is the real magic

tulip sleet
#

ok, np, tnx

slender iron
#

merge 1.14 has 46 unmerged files to start

#

1.13 had 200+

blissful pollen
#

Random thought: I know there has been questions about running items on the second RP2040 core, I wonder if the native MPY change being merged in would be a good way to target something like running code on the second core.

(cavet I haven't had a chance to look or examine the code related to the native MPYs yet)

ember iris
#

That's a nicer number

ionic elk
#

Does anyone have tips on how to load onto a RP2040 and restart it without the Jlink needing to be disconnected and reconnected? After I load, I always get ISR hardfaults, or a deadbeef report, or any number of things and always have to restart GDB or even hard power cycle

manic glacierBOT
#

For each board, this builds one special build that erases CIRCUITPY when loaded. The status LED starts at red and goes to blue when done. The build does nothing after erasing: no USB mounting, etc. So it's language-independent.

The GitHub Actions build will create a new CIRCUITPY_ERASE directory in S3 for each board, alongside the language directories.

Basically, this is a simple way of making per-board flash erasers without involving Arduino, etc.

manic glacierBOT
#

Thanks for making this. One alternative that I've used for scenarios that needed this is to instruct Circuitpython to enter the repl first, before executing any user code. Simply erasing without having the user do anything is conveniently fire-and-forget, but it's another option to consider - sitting in the REPL would let you access the filesystem and extract things you want from it before erasing via storage. This would be done by changing bool skip_repl = true; to false in `main()...

fossil gorge
idle owl
#

@fossil gorge Is it still limited to 1 external display?

fossil gorge
#

Not sure. I'll give it a go and find out

idle owl
#

I haven't looked recently. That was a dealbreaker for me.

#

Oh. That also works 😄

#

@fossil gorge The thing Dan wanted tested. He wants to know what prints out when you do the following: ```# unplug all CircuitPython boards

$ pip3 install adafruit-board-toolkit

$ python3

import adafruit_board_toolkit.circuitpython_serial
print(adafruit_board_toolkit.circuitpython_serial.comports())

now plug in a CircuitPython board and wait for CIRCUITPY to appear

print(adafruit_board_toolkit.circuitpython_serial.comports())

print(adafruit_board_toolkit.circuitpython_serial.repl_comports())```

onyx hinge
#

@slender iron I don't think I can "finish" it to the point where we're at zero diagnostcs right now (so much stuff to do!), so we can't enable -Werror=missing-prototypes. It might be better to vet the changes that are in that PR and if possible merge it as is, vs letting it languish.

slender iron
#

that's fine with me

fossil gorge
idle owl
fossil gorge
idle owl
#

There appear to be workarounds that require extra hardware to run more than one display. Apple supposedly said they'd include native support in a future Big Sur update. I apparently will still be waiting.

fossil gorge
#

Probably with something from DisplayLink. Works well in a pinch, but it's a lot of CPU work for the external display

fossil gorge
#

Sorry, meant to tag @tulip sleet about that question

idle owl
#

Oh I have no idea. Heh yeah, I was going to say. Ask Dan 😄

tulip sleet
#

hi, no it has nothing to do with CP7. Just try it with any old board 5.x or later, probably. I'm testing some CPython code that figures out the USB devices connected to the Mac.

fossil gorge
# tulip sleet hi, no it has nothing to do with CP7. Just try it with any old board 5.x or lat...
❯ python3
Python 3.8.9 (default, Apr  4 2021, 15:10:29)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import adafruit_board_toolkit.circuitpython_serial
>>> print(adafruit_board_toolkit.circuitpython_serial.comports())
()
>>> print(adafruit_board_toolkit.circuitpython_serial.comports())
()
>>> print(adafruit_board_toolkit.circuitpython_serial.repl_comports())
()
>>> ^D

This is the first try, with a USB-A to USB-C adapter on the computer side

#

Just realized I have a USB-C to USB-C, so will try that "natively"

#

Same result

#

Tried 2 different boards as well, just in case

tulip sleet
orchid basinBOT
tulip sleet
#

@fossil gorge could you also try this:

$ pip3 install --upgrade pyserial
$ python3
>>> import serial.tools.list_ports
>>> print(serial.tools.list_ports.comports())

without and with a CPy board plugged in

#

thanks!

#

this tries the original code from pyserial to see if it can list the ports

idle owl
#

@tulip sleet Editing a message to add a username only makes it highlighted, it doesn't tag the person.

tulip sleet
#

ekk, thanks

#

@fossil gorge ^^

manic glacierBOT
slender iron
fossil gorge
# tulip sleet <@!361158808501747735> could you also try this: ``` $ pip3 install --upgrade py...
❯ python3
Python 3.8.9 (default, Apr  4 2021, 15:10:29)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial.tools.list_ports
>>> print(serial.tools.list_ports.comports())
[<serial.tools.list_ports_common.ListPortInfo object at 0x102ede0a0>, <serial.tools.list_ports_common.ListPortInfo object at 0x1029f9610>, <serial.tools.list_ports_common.ListPortInfo object at 0x102faf340>, <serial.tools.list_ports_common.ListPortInfo object at 0x102efeee0>]
>>>
tulip sleet
#

is that with or without the board(s)?

#

the list should add one more port when a board is plugged in

fossil gorge
#

Without boards

tulip sleet
#

so now if you plug in a board, let's see if there are five ports

#

just repeat the same print()

#

@jaunty juniper I was going to ping you later about this

jaunty juniper
#

I don't have a M1 😕

fossil gorge
# tulip sleet just repeat the same print()
>>> print(serial.tools.list_ports.comports())
[<serial.tools.list_ports_common.ListPortInfo object at 0x102faf190>, <serial.tools.list_ports_common.ListPortInfo object at 0x102ec4fd0>, <serial.tools.list_ports_common.ListPortInfo object at 0x10298ee50>, <serial.tools.list_ports_common.ListPortInfo object at 0x10298e9a0>, <serial.tools.list_ports_common.ListPortInfo object at 0x10298ebb0>]
>>>
#

So 5 indeed

tulip sleet
#

ok, that's what I expect. I just tried it on Big Sur 11.3 on a non-M1 mac, and it's working. will upgrade to 11.3.1 in a bit

#

thankyouverymcuh

fossil gorge
#

Sure thing!

#

Just realized I was/am on 11.2.3, but 11.3.1 is anxiously awaiting my "ok" to upgrade

tulip sleet
#

if you could repeat the adafruit_board_toolkit testing after the upgrade, that would be great, thanks

fossil gorge
#

Sure thing

tulip sleet
#

@slender iron I am going through the 1.13 files

slender iron
#

ok, looks like Jeff is too

blissful pollen
#

If someone knows offhand what's the extmod directory for? (glancing at the 1.13 changes and see lots there)

tulip sleet
#

extmod is where micropython puts a lot of its native modules, what we have in shared-bindings and shared-module and common-hal

blissful pollen
#

ah okay that makes sense, thanks. So what is there can be brought in with an import just like something in shared-bindings

tulip sleet
#

they don't separate the Python API impl from the functional impl

onyx hinge
#

[fixes the one test failure I saw locally with the native emitter]

fossil gorge
# tulip sleet if you could repeat the adafruit_board_toolkit testing after the upgrade, that w...

Output after upgrading to macOS 11.3.1

❯ python3
Python 3.8.9 (default, Apr  4 2021, 15:10:29)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import adafruit_board_toolkit.circuitpython_serial
>>> print(adafruit_board_toolkit.circuitpython_serial.comports())
()
>>> print(adafruit_board_toolkit.circuitpython_serial.comports())
()
>>> print(adafruit_board_toolkit.circuitpython_serial.repl_comports())
()
>>> import serial.tools.list_ports
>>> print(serial.tools.list_ports.comports())
[<serial.tools.list_ports_common.ListPortInfo object at 0x104efee50>, <serial.tools.list_ports_common.ListPortInfo object at 0x104efe9a0>, <serial.tools.list_ports_common.ListPortInfo object at 0x10517cd00>, <serial.tools.list_ports_common.ListPortInfo object at 0x10517c670>, <serial.tools.list_ports_common.ListPortInfo object at 0x10517c610>]
>>>

# after unplugging board
>>> print(serial.tools.list_ports.comports())
[<serial.tools.list_ports_common.ListPortInfo object at 0x104efe9a0>, <serial.tools.list_ports_common.ListPortInfo object at 0x10517c5e0>, <serial.tools.list_ports_common.ListPortInfo object at 0x10517cd00>, <serial.tools.list_ports_common.ListPortInfo object at 0x10517c610>]
>>>
simple pulsar
#

Hi, is this aspect of f strings supposed to work ```>>> val = 1.2345

digits = 2
f"{val:.{digits}f}"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: digits

tulip sleet
#

@fossil gorge thanks; @jaunty juniper this is mysterious. The stock list_ports() is working.

jaunty juniper
#

and just on M1 ?

tulip sleet
#

yes

#

i just retested on 11.3.1 on non-M1 and it's fine

#

the weird difference is that your patch is an adaptation of what is in pyserial 3.5, which is what seems to be working above but not in adafruit_board_toolkit; i copied your PR into there

#

perhaps I made a mistake of some kind, though it works on non-M1

jaunty juniper
#

it just changes the interface property

tulip sleet
#

right, so I don't understand why it's not finding the ports at all

jaunty juniper
#

hey @hugo could you test this ?

pip3 install discotool-for-microcontrollers
discotool
tulip sleet
#

it must be because the interface names are not coming back, because I do filter on them:

    return tuple(
        port
        for port in ports
        if port.interface
        and port.interface.startswith(
            tuple((prefix + " CDC" for prefix in INTERFACE_PREFIXES))
        )
    )
jaunty juniper
#

ah right

tulip sleet
#

actually that is post 1.0.1, and hasn't been released yet. IT's even simpler:

#
    return tuple(
        port
        for port in ports
        if port.interface and port.interface.startswith("CircuitPython CDC")
    )
#

so my guess is that port.interface is not working

#

we should see whether list_tools is returning anything for interface, even if it's wrong

jaunty juniper
#
[(port.interface,port.device) for port in serial.tools.list_ports.comports()]
#

something like that

#

I'm curious what system_profiler -json SPUSBDataType gives too

tulip sleet
#

if @fossil gorge is willing to test further with @jaunty juniper , thanks! You know a lot more about this.

#

or if you have a nearby friend with an M1 Mac...

fossil gorge
jaunty juniper
#

with

fossil gorge
#

Just in case...

# Without device...

❯ discotool
No device found.

## Plugged in device

Projects/CircuitPython/Tests via 🐍 v3.8.9 (.venv)
❯ discotool
- Feather RP2040 ---------------------------------------------------------------------------------------------------------------
    Adafruit [SN:545473038350B304]
    /dev/cu.usbmodem1101 ()
jaunty juniper
#

thanks

manic glacierBOT
jaunty juniper
#

I think I'll need the output of ioreg -l on an M1 with a connected board to understand what I should be looking for

still zephyr
#

Danh and Neradoc Thanks for the help earlier, I was able to test the sensor and verify my PR.

jaunty juniper
#

I need to go to bed now, see ya

tulip sleet
#

good night, this will be a process, thanks

jaunty juniper
#

is that with a board connected ?

fossil gorge
#

One of each

#

I think that broke Gist

#

Those are the directly piped output, with each

#
❯ python3 pyserial_list_ports_osx.py
----------------------------------------------------------------------
/dev/cu.Bluetooth-Incoming-Port: n/a [n/a]
/dev/cu.HugoDahlsAirPods-Wirele: n/a [n/a]
/dev/cu.debug-console: n/a [n/a]
/dev/cu.usbmodem1101: Feather RP2040 [USB VID:PID=239A:80F2 SER=545473038350B304 LOCATION=1-1]
/dev/cu.wlan-debug: n/a [n/a]
#

I need to get to bed, but happy to help out more in the morning

jaunty juniper
#

yeah me too, good night

fossil gorge
#

G'night 🌜

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

The f string impementation from https://github.com/adafruit/circuitpython/pull/2690 does not appear to implement setting parameters with {} syntax. An example from 6.2.0 on a Feather nRF52840 Express:

>>> val = 1.2345
>>> digits = 2
>>> f"{val:.{digits}f}"
Traceback (most recent call last):
  File "", line 1, in 
KeyError: digits

I noticed this whilst trying to help out with [Adafruit Forums: How to display decimals on Bitcoin price?](https://forums.adafruit.com/viewt...

lone axle
onyx hinge
#

@slender iron curious if you have any insight into why we need to clear out more stack entries than micropython .. I think we've seen it twice now. ```python

  • [0, 1, 2, 3] # use up Python stack so f is really gone
#

you figured it out the first time, I just copied

#

FWIW I ran out of juice reviewing the changes in that merge PR

jaunty juniper
manic glacierBOT
jaunty juniper
fossil gorge
#

Sure thing. Will give it a go in just a sec

jaunty juniper
#

thank you very much

fossil gorge
#

I think you're right, @jaunty juniper!

❯ python3 pyserial_list_ports_osx.py
cu.Bluetooth-Incoming-Port
  name: None
  interface: None
  device: /dev/cu.Bluetooth-Incoming-Port
cu.HugoDahlsAirPods-Wirele
  name: None
  interface: None
  device: /dev/cu.HugoDahlsAirPods-Wirele
cu.debug-console
  name: None
  interface: None
  device: /dev/cu.debug-console
Feather RP2040 - CircuitPython CDC data
  name: Feather RP2040
  interface: CircuitPython CDC data
  device: /dev/cu.usbmodem1101
cu.wlan-debug
  name: None
  interface: None
  device: /dev/cu.wlan-debug
#

So not only not empty, but also has the "CircuitPython CDC data" present. though "Data" is actually lowercase "data".

jaunty juniper
#

ok that's good

#

thanks for the tests

fossil gorge
#

You're most welcome!

solar whale
#

HAs there been a basic change to using usb_hid? I'm getting USB Busy errors with code that worked before the recent updates.

idle owl
#

@tough flax Hey, Bill! I have a quick question. Is it alright with you if I use the STEMMA connector from your Feather RP2040 pinout for our own pinout diagrams? I need to modify it to match our pin labels, but I'd like to use the connector bit if it's ok with you.

slender iron
#

it's just a fragile test

manic glacierBOT
still zephyr
manic glacierBOT
#

I just built CP forom the tip of main for the neopixel_trinkey_m0
but not usb_hid is not working.
I had the same issue on the neopixel_trinkey_m0 and the pirkey_m0


Adafruit CircuitPython 7.0.0-alpha.1-1088-g2fe1df466 on 2021-05-07; Adafruit NeoPixel Trinkey M0 with samd21e18
>>> import usb_hid
>>> from adafruit_hid.keyboard import Keyboard
>>> keyboard = Keyboard(usb_hid.devices)
Traceback (most recent call last):
  File "", line 1, in 
  File "adafruit_hid/keyboard.py", l...
orchid basinBOT
tough flax
idle owl
manic glacierBOT
#

I really don't like this. It has nothing to do with CircuitPython. I'd much rather factor out the useful bits from CircuitPython so that they can be used for other cross-board software. I understand this is the more expedient option but I think the extra work put into splitting useful things out will be more useful than we think.

It also erases all of the filesystem when we just want to disable boot.py and code.py to recover from USB mis-settings. This is what safe-mode is for and if it'...

idle owl
still zephyr
#

There are two libraries included after the list was made, schedule and morse_code,

#

The list was created as a test that the code works but is not live

idle owl
#

Ah ok

#

Cheers

#

I'll stick with my method of searching for submodule in the .gitmodules file. It's worked for a long time. 😄

onyx hinge
#

@slender iron any more merge test failures for me to look at?

still zephyr
#

:), we could revisit once all the bundles and community repos are defined

slender iron
#

nope. I did 1.14 and 1.15 yesterday too. could use reviews for them though

onyx hinge
#

1.13 is still failing on esp32-s2 builds?

manic glacierBOT
#

It also erases all of the filesystem when we just want to disable boot.py and code.py to recover from USB mis-settings. This is what safe-mode is for and if it's broken on some boards, then we should fix it.

Is there a way to force entry to safe mode from the hardware? I've had to build versions of Circuitpython like this (or revert to old builds of Circuitpython that don't support what I'm working on) for peripheral-related bugs triggered by code.py that hang without crashing into safe ...

slender iron
onyx hinge
#

ah

#

and I didn't build the merged version locally so I didn't see it

slender iron
#

I thought I had but /shrug

#

that's what the CI is for

#

keep me honest

manic glacierBOT
still zephyr
#

@idle owl do you think there is any way, that we could make a note for first time contributors, when they submit a PR in Github?, There is a section in the readme.md in how to contribute. But this link points to the Creating and sharing a CircuitPython library learning Guide in , and is not until further in that reading that the Pylint and Black is mentioned. Also I think, that we should include the design guidelines somewhere as normally people include code to the library and not build a library. This is related to this PR. https://github.com/adafruit/Adafruit_CircuitPython_MCP4728/pull/10

still zephyr
#

See the Pylint and black Learning Guide, and the design guidelines in the circuitpython repo?

idle owl
#

And I don't think we can do a thing that is specific to first time contributors. I'd have to look into that. I think it's everyone or no one.

manic glacierBOT
still zephyr
idle owl
#

As far as I can tell.

still zephyr
#

I saw that we have that kind of template in the learning guides, I think would be good, but others opinion are welcome 🙂

idle owl
#

We have them on CircuitPython now as well. I kind of don't like them because you get folks who see text in the PR, and don't delete it or fill anything in because there's already something there. But I guess it' a matter of education.

I need to see whether enabling templates is something we can automate because 270 repos is a lot to manually do that on.

still zephyr
#

or maybe if we could have a template for reviewers that could help also and avoid the spam in the notes

#

that everyone uses and we just copy as a first note

idle owl
#

Looks like we can automate it.

still zephyr
#

oh nice 🙂

idle owl
#

It's simply a file in the .github directory. That's Adabot's jam.

onyx hinge
#

@slender iron should we consider transitioning from translate() to MP_ERROR_TEXT generally? or just in files that are shared with mp?

still zephyr
slender iron
#

I just did the shared ones. we use it for more than error text so I didn't want to overuse it

idle owl
misty garnet
#

I didn't think f-strings worked at all in CP

still zephyr
idle owl
misty garnet
#

a=2; print(f'{a}') gives me an invalid syntax error

idle owl
#

I could be conflating it with a discussion about adding support.

#

versus actually adding it.

misty garnet
#

ah

idle owl
#

Scott, Dan or Jeff might know.

still zephyr
#

they work

#

at least in the RP2040

idle owl
#

It shouldn't be port specific.

still zephyr
#

maybe...

onyx hinge
#

It is, unfortunately. It's turned on by .... checks

idle owl
#

Oh. Interesting.

still zephyr
#

oh no....

misty garnet
#

I'm on CP7 on QtPy M0, so maybe I don't have the right flag set

onyx hinge
#

It's turned on/off by MICROPY_CPYTHON_COMPAT which is turned off for small boards like most (all?) samd21

misty garnet
#

that would explain it

still zephyr
#

So we need to avoid them in the examples as they do not work all across the board jeff?

onyx hinge
#

Yeah you need to do other things like "...".format() for code that will work on all CP boards

idle owl
#

I would say that is correct. Unless you are explicitly clear that the example is meant for a specific board. Even then, it's not a good idea.

onyx hinge
#

The "m" in "mpy" stands for "coMpiled"

solar whale
#

somehow "f-strings" sounds like something you would get banned for using....

misty garnet
#

heh

onyx hinge
#

the "ſ" stands for subſtitution

solar whale
#

It's that "early-american" form - congreff

jaunty juniper
#

personally I'm conflicted on f-strings, people seem to think they are great, but how do you translate an f-string ? you can translate "Speed: {}" into "Vitesse: {}" and .format it but where and how do you translate f"Speed: {speed_value}" ?

onyx hinge
#

I agree, f-strings and localization don't seem to mix

#

perhaps some future version of Python will provide for a kind of extended literals that can permit both localization and formatting, so that e.g., f_"Speed: {speed_value}" does a gettext() call and then a format() call. C++ has added such user-defined string literals that can expand into magical things.

jaunty juniper
#

likewise I believe Swift has an approach that allows for localisation but I don't remember the details

onyx hinge
#

@lapis hemlock once 1.13 is merged in, I think ulab may be able to drop the workaround for cicuitpython not having rich comparisons!

manic glacierBOT
#

It also erases all of the filesystem when we just want to disable boot.py and code.py to recover from USB mis-settings. This is what safe-mode is for and if it's broken on some boards, then we should fix it.

Boards without a status LED are an issue. Plus the Raspberry pico doesn't even have a reset button, so you couldn't do anything without adding wires. The only "safe" state the user can achieve with a naked pico is bootloader.
There is the nuke UF2 of course, but...

Is it possible...

still zephyr
#

@idle owl or @onyx hinge I would include this note in the design guideline, please let me know if I need to rephrase it. thanks

#

When using print statements you should use the " ".format() format, as there are particular boards that are not capable to use f-strings.

onyx hinge
#

@still zephyr sounds good (missing an e of "are particular")

still zephyr
#

Thanks, I will correct that

manic glacierBOT
jaunty juniper
#

hey @fossil gorge are you ready to live on the edge ? Would you risk installing the latest on a board and enable the second serial, and run the serial test script on M1 ? https://gist.github.com/Neradoc/e718ee1db78549e510dfd03da2eed7d9 there's a bug if you don't disable hid (at least on QT PY), so you would put that in boot.py

import usb_hid
usb_hid.disable()
import usb_cdc
usb_cdc.enable(console=True, data=True)
fossil gorge
jaunty juniper
#

thank you 👍

manic glacierBOT
#

Running with the following boot.py on a QT PY Haxpress.

import usb_cdc
usb_cdc.enable(console=True, data=True)

Running the fixed version of serial/tools/list_ports_osx.py gives:

/dev/cu.usbmodem144443301: QT Py M0 Haxpress - CircuitPython CDC data [USB VID:PID=239A:00CC SER=6EC079803935545020312E321E200FFF LOCATION=20-4.4.4.3.3]
/dev/cu.usbmodem144443303: QT Py M0 Haxpress - Cir⅄ 䦸 [USB VID:PID=239A:00CC SER=6EC079803935545020312E321E200FFF LOCATION=20-4.4.4.3.3]

It ...

fossil gorge
#

Should I try with the boot.py file as well?

jaunty juniper
#

yes, but I think I'll want the output of ioreg -l like last time too

fossil gorge
#

Ok. I'll run those and let you know what comes up

jaunty juniper
#

cause there it's saying "usb_midi.ports[0]" and that is super weird

fossil gorge
#

Here's the pyserial_list_ports.py

❯ python3 pyserial_list_ports_osx.2.py
/dev/cu.Bluetooth-Incoming-Port: n/a [n/a]
/dev/cu.HugoDahlsAirPods-Wirele: n/a [n/a]
/dev/cu.debug-console: n/a [n/a]
/dev/cu.usbmodem1101: Feather RP2040 - CircuitPython CDC data [USB VID:PID=239A:80F2 SER=4545373038053B40 LOCATION=1-1]
/dev/cu.usbmodem1103: Feather RP2040 - CircuitPython CDC2 data [USB VID:PID=239A:80F2 SER=4545373038053B40 LOCATION=1-1]
/dev/cu.wlan-debug: n/a [n/a]
jaunty juniper
#

ah that's not a M1 issue

#

good to know

#

thanks, I believe that means my code works and I can PR for now, but there are more issues with 7.x

fossil gorge
#

Awesome! Good job getting it sorted out! 🙂

manic glacierBOT
manic glacierBOT
#

It also erases all of the filesystem when we just want to disable boot.py and code.py to recover from USB mis-settings. This is what safe-mode is for and if it's broken on some boards, then we should fix it.

Is there a way to force entry to safe mode from the hardware? I've had to build versions of Circuitpython like this (or revert to old builds of Circuitpython that don't support what I'm working on) for peripheral-related bugs triggered by code.py that hang without crashing into...

manic glacierBOT
#

Ah -- it's more than just that -- I put pulseio back in -- now get an IOError: USB Busy -- I'll look into that but it may be time to move on...

The removal of pulseio was unintentional; I will put it back. If you are getting USB errors, that is something else, and may reflect a larger problem. Try a Trinket M0 or similar; I did test, but not after I did a lot of the build rework.

manic glacierBOT
#

I did start to implement this as a separate small executable based on the circuitpython code base (filesystem_Init() and the status LED), but it was becoming painful, and I realized the infrastructure I needed was right there in the existing code and build system. It creates a version for each board with little trouble. Yes, it is expedient; we need something soon. It's not elegant, but it works.

This could easily be changed to just rename boot.py and code.py, and do nothing else (an...

manic glacierBOT
#

Booting into safe mode the board does not appear on USB anymore until reset into normal mode.
Tested on macOS Catalina, but I think it's either a crash of the board or USB being disabled in safe mode.
Tested with a QT PY M0, Feather M4 pressing reset-to-boot, and a pico using the following code:

>>> import microcontroller
>>> microcontroller.on_next_reset(microcontroller.RunMode.SAFE_MODE)
>>> microcontroller.reset()

Tested a few builds, it seems to happen starting with #468...

manic glacierBOT
#

Same with me using the RP Pico using mouse in the latest build (adafruit-circuitpython-raspberry_pi_pico-en_US-20210507-f761292.uf2)

Seems to fail in the same place but in mouse.py when initializing at the section below.

try:
self._send_no_move()
except OSError:
time.sleep(1)
self._send_no_move()

With the error:

Traceback (most recent call last):
File "<stdin>", line 7, in <module>
File "/lib/adafruit_hid/mouse.p...

manic glacierBOT
solar whale
#

So far -- post merge of MP1.13 my rp2040 pico and esp32s2 funhouse are still working !! Well done!

blissful pollen
solar whale
#

Yes - the onboard temps are way high due to heating of the board 😦 - I use an external I2C (STEMMA) temperature sensor

blissful pollen
#

okay thanks just wanted to make sure that was normal

manic glacierBOT
manic glacierBOT
pearl tapir
#

any idea with mocking hardware in **all **circuitpython libraryies that supports development of software/program and debugging outside the hardware..? (for ex: in ubuntu)

Example : adafruit_mcp4725 and adafruit_tca9548a in https://github.com/codenio/virtual-pi

GitHub

Virtual Pi Library for mocking Raspberry Pi. Contribute to codenio/virtual-pi development by creating an account on GitHub.

manic glacierBOT
#

This swaps pins D0 and D1 to correlate with GPIO0 and GPIO1, respectively; they were previously swapped so when I asked for D0 in the software I had to interface with D1 on the board (second pin down on the left instead of first).

This now matches the board schematic (via, see snipped image of the schematic below), and I also confirmed that all the other pins correctly match the board too...

still zephyr
manic glacierBOT
lone sandalBOT
manic glacierBOT
manic glacierBOT
#

fixes #4724 - tested on neopixel_trinkey_m0, qtpu_rp2040 and pirkey_m0 -- all work now.
There is an issue with the pirkey_m0. The current build is without pulseio. usb_hid works ok. However, if is restore pulseio then the pirkey_m0 will not boot - the neopixel just blinks and no USB device is mounted. Should I open anew issue for this once this is merged? Is pulseio working normally on other boards?

manic glacierBOT
#

One bit of information regarding the pirkey_m0 issue -- If I resotore pulseio and build from main without this PR, then the pricey_m0 boots ok -- but ISB_HID does not work, With this PR -- USB_HID is ok but it won't boot if I reset pulseio...

I tried adding pulseio into another "small build (rfm9x) and it works OK with this PR
I also versified that pulseio (using irremote) works as expected on a CPX -- with this PR

I don't know if you want to invest any time the pirkey_m0. I just wante...

pearl tapir
# still zephyr do not know, hey those DAC look familiar 😬

I had the following requirement :
I had to develeope an GUI that controls several DACs using Circuit Python libraries. As developement inside RPi becomes difficult (or if you dont have one yet) and ubuntu had no GPIO support, I started with Mocking GPIO and then Mocked all essential breakout boards (MCP4725 and TCA9548A). Post Developement in ubuntu it was a seamless switch. It uses virtual libraries when executed outside RPi and actual Hardware inside RPi.

Adding such mock/virtual hardware in respective circuit python libraries could accelerate software/program developement even in absence on actual hardware. It helps to decouple the hardware dependencies during developement and enhances debugging.

It resembles : Local developement and deployment in production

Thoughts and Comments..?

manic glacierBOT
thorny jay
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@dhalbert OK - I found the artifacts and I get the same results with your build (that is reassuring!)
here is what I see in dmesg when I copy over the .uf2

[Sun May  9 16:33:18 2021] usb 1-1.4.7: USB disconnect, device number 57
[Sun May  9 16:33:18 2021] FAT-fs (sda): unable to read boot sector to mark fs as dirty
[Sun May  9 16:33:19 2021] usb 1-1.4.7: new full-speed USB device number 58 using xhci_hcd
[Sun May  9 16:33:19 2021] usb 1-1.4.7: New USB device found, idVendor=239a, id...
manic glacierBOT
still zephyr
manic glacierBOT
#

BHB's definition assigns PA00 and PA01 to MICROPYTHON_PORT_A:

https://github.com/adafruit/circuitpython/blob/af6d97f67fd8e35f60119af332d5a2178d89dc50/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.h#L12

If you try to use one of those ports from user code, for example via the neopixel library, you'll get an error saying the pin is in use. However, in the current production design those pins are not connected and so should be available for hax. This change free...

manic glacierBOT
hearty forge
#

Is it possible to modify a uf2 (existing or by regenerating) so that a newly flashed CP device will have pre-packaged files on the CIRCUITPYTHON drive? e.g. I'd like to add a custom code.py, a back-up copy of this, and possibly one or two of the standard libraries. (I don't want to freeze them - want to include them as a concrete example of where the files should be copied to.)

hearty forge
#

@still zephyr thanks- but I think that's for connecting a notebook to a CP device and using Jupyter as a sort of REPL frontend. I was thinking more of a virtual CP that could eg be used with google colab, no CP hardware at all.

manic glacierBOT
hollow token
#

eg, create a device simulator or pseudo-device library, that simulated states to test code

still zephyr
hollow token
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@dhalbert This is very odd. You are correct that the issue is related to my code.py. If I remove my code.py, then the pirkey_m0 boots OK -- but with the code.py, it fails -- this happens on 2 different prirkey_m0s!
However, sorting is odd. if I name the file some thing other than code.py, I can execute it from the REPL - it only fails to boot if I try to run it as code.py....
I agree with moving on with this PR and I will explore the code.py issue on the pirkey_m0 further. I did try load...

manic glacierBOT
#

OK -- one more example.
On the CPX, I created a new code.py that just just uses the neopixels. It runs fine with this PR.
I also ran some more test on the pirkey_m0 and it appears that the issue only occurs when I try to use irremote in the code.py. This is consistent with the CPX example as well. Given that, perhaps it is OK to move ahead with merging this PR and focusing on a potential issue with irremote.

hollow token
#

Yay! I have a few MCP23S17 in my hands :)

manic glacierBOT
solar whale
#

@tulip sleet I am pretty well baffled by PR 4734 -- I added more to the comments -- I now have a trigger for the issue on a CPX or prikey_m0 -- No idea why, though... I have to go off for awhile and will resume troubleshooting later. I have no objection to merging pr 4734 and working on this as new issue. Whatever you think best.

solar whale
#

Perhaps this would be a good topic for "in the weeds" today.

solar whale
manic glacierBOT
#

OK -- one more example.
On the CPX, I created a new code.py that just just uses the neopixels. It runs fine with this PR.
I also ran some more test on the pirkey_m0 and it appears that the issue only occurs when I try to use irremote in the code.py. This is consistent with the CPX example as well. Given that, perhaps it is OK to move ahead with merging this PR and focusing on a potential issue with irremote.
Since the issue also occurs on the CPX, I will continue troubleshooting there to ...

daring ridge
#

Hi - I'm getting ready to make some updates to circuitpython-org repo and submit a PR - but want to test before submitting. Can anyone confirm that the instructions in the README.md are up to date with the software versions needed? Specifically, the section: To test your changes local: ... 6 short steps.

I did attempt to do so directly on my Mac using the software versions specified, but it failed to generate and launch the jekyll server to test with. So I'm setting up a Debian VM which the instructions indicate is used for this. The Debian Stretch system indicated and Ruby versions appear to be pretty old, though, so just wanted to verify.

manic glacierBOT
#

I'd say we could use one more of the following:

  1. CIRCUITPY eraser - the CircuitPython build system knows the board configurations so that's why I based this on CPy. A "board database" would be nice in the long run, but it's not holding up progress. This requires only one build per board because it is not translation-dependent.
  2. A safe-mode-only build. This requires doubling the number of artifacts, which will significantly increase CI time. I would rather not do that.
  3. A build that d...
manic glacierBOT
ionic elk
#

@tulip sleet when you're back in town: I think the best plan for sleep is
a) merge STM32 Alarms (do we need someone to help test this?)
b) I merge main into the API revisions and spruce up STM32 and NRF accordingly
c) merge API revisions in #4606
d) RP2040 Alarms PR can be submitted/reviewed, since it is built on #4606

prime flower
#

When adafruit makes a LTE fona breakout, that'll get an official Adafruit_CircuitPython_ library. No guarantees whether an updated breakout will use the same modem as Particle or not.

solar whale
#

@prime flower Thanks -- would you be able to comment in the Forum post -- to give an "official" Adfruit response.

prime flower
#

Yeah sec.

solar whale
#

Thanks!

fossil gorge
# daring ridge Hi - I'm getting ready to make some updates to circuitpython-org repo and submit...

Hey @daring ridge! I'm looking over the README now, and comparing it with the GitHub action that runs for deployment. It looks like they're fairly similar, with these variations or details

  • GitHub action is run on the "ubuntu-latest" image - probably 20.04 which is LTS
  • The specific version of Ruby used is 2.7, not 2.5. Don't know if it makes a differences
  • The commands run to install bundler and build are:
# Install bundler, and run
  gem install bundler:1.17.3
  bundle install --full-index
# Build site with jekyll
  bundle exec jekyll build -d build
manic glacierBOT
turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

58

Voice Channels

6

Members

28972

Roles

34

idle owl
#

@tough flax Limor and PhilB put together a semi-automated generator, here: https://github.com/adafruit/PrettyPins I nabbed the connector to include in a file that I can pull from as needed with lines that match the spread of the pin labels.

daring ridge
daring ridge
manic glacierBOT
daring ridge
#

@fossil gorge and @idle owl , I got it working directly on MacOS - thanks to both of you.

I still had to edit a couple of files to remove a non-US-ASCII character to get the generation to complete, but it shouldn't affect my update - this is extremely helpful. Thanks again to both of you!

idle owl
fossil gorge
daring ridge
# fossil gorge Glad you got it going! Out of curiosity, which characters did you have to remove...

These two:

circuitpython-org/vendor/bundle/ruby/2.7.0/gems/jekyll-theme-primer-0.5.4/_sass/primer-support/lib/mixins/typography.scss:43: Invalid US-ASCII character "\xE2" (Sass::SyntaxError)

and

circuitpython-org/vendor/bundle/ruby/2.7.0/gems/jekyll-sass-converter-1.5.2/lib/jekyll/converters/scss.rb:123:in `rescue in convert': Invalid US-ASCII character "\xE2" on line 5 (Jekyll::Converters::Scss::SyntaxError)

manic glacierBOT
fossil gorge
daring ridge
fossil gorge
#

Thanks for sharing that @daring ridge. Will be on the lookout for those. Was that in macOS, the Debian VM, or elsewhere?

daring ridge
fossil gorge
#

Peculiar. Seems like another rabbit hole to dive into and sidetrack other things soon! 🙂

#

Again, I appreciate you providing that information and level of detail! 🙂

jaunty juniper
idle owl
idle owl
jaunty juniper
#

if mentions the QT PY, D17 for the Clue and BLUE_LED for the itsybitsy nrf52, maybe a general warning saying if it doesn't blink to look at the specific board's guide pinout to check the LED pin would guide people to where to look

#

it's hard to know what will help people the most 🤷

idle owl
#

I took the time to narrow down the list to Adafruit boards, and I think I'll update them today or tomorrow. Alleviate the issue at the source.

#

There are 38 boards. Shouldn't be too bad. 🙄

jaunty juniper
#

it was someone who decided to read the whole "Welcome to CircuitPython" guide to familiarize themselves with it

idle owl
#

There are more of those folks than you'd think.

#

That's the problem with including troubleshooting and other things that may not apply to every board. Some folks try to do all of it.

#

We do what we can to make it clear when things won't work. And we adapt where necessary.

#

That's where the templates will be super helpful - they're tailored to each board, so there's no warning about QT Py on a Pico page, etc. Though Pico won't get them because it's not an Adafruit board.

pearl tapir
#

we could either modifiy VPi to make it more generic or We could start some virtualisation library from stracth. @still zephyr @thorny jay your thoughts..?

ivory yew
idle owl
#

This afternoon.

ivory yew
#

Thanks, @idle owl

#

& no rush, I've been pretty dormant for a while

manic glacierBOT
idle owl
ivory yew
#

Yeah it was weird - it said I had write access so I could approve it, but that I couldn't merge because the branch was protected. 🤷‍♀️

still zephyr
idle owl
#

<@&356864093652516868> Meeting in little over 30 minutes. If you're participating, please update the notes doc with your Hug Reports and Status updates. Thanks! https://docs.google.com/document/d/1R2Qq9dAKqrAh0wFuu1-X7r9HgPJf1bgLz45fklJHmfo/edit?usp=sharing

modern wing
#

Good afternoon all you wonderful people ☕

drowsy geyser
#

Howdy.

#

Lurk only today for me.

silver tapir
#

That's better than print() debugging 🙂

modern wing
#

That's the new hot item -- celebrities doing computer sound effects. Next up, Morgan Freeman doing the Windows XP logon sound.

onyx hinge
#
MicroPython 7.0.0-alpha.1-709-g256fcd6cc-dirty on 2021-05-10; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> from ulab import numpy as np
>>> np.arange(1, 24) > 7
array([False, False, False, ..., True, True, True], dtype=bool)
``` ooh the rich comparison stuff works in current circuitpython.  It didn't work earlier, because we needed update from micropython to enable it
errant grail
#

Just listening today.

onyx hinge
#

calendar links are in the notes document

errant grail
#

"lurking" is such a dark term

slender iron
#

hears jaws music

storm minnow
#

lurk lurk

jaunty juniper
#

it's a common term on live streams and forums

#

with no particular negative implication

old smelt
#

lurking

lone axle
modern wing
lone axle
onyx hinge
#

Since May 1, we have the following file and line modifications stats in circuitpython: 1129 files changed, 68239 insertions(+), 22170 deletions(-) -- big numbers, because they count all the micropython changes we've been bringing in.

solar whale
#

Is .mpy stable now through 1.15?

onyx hinge
#

@solar whale yes we think/hope so

jaunty juniper
#

I believe it is, there is nothing about it in the update notes for Micropython 13-14-15 that I could see

slender iron
#

yup, post the M -> C change

jaunty juniper
#

we'll need a new alpha release to get the 7.x bundle to compile the latest mpy version

onyx hinge
#

Yes, let's do that

slender iron
#

ya, we could do a tag

#

I wouldn't do a release per-se

solar whale
#

I've done a few quick conversions with no issues.

slender iron
#

same

lone axle
#

yep

jaunty juniper
#

that's a question by the way, should displayio.release_displays() release the board.DISPLAY ? And if so is there a way to reinit it from python code ?

slender iron
#

I think it should. you can reinit using the python driver but it's not simple

#

(one may want to change the init of the built in display)

manic glacierBOT
#

Looking at my old code, I think you have to float the old pins too (set as input). I've included some relevant parts below. Please try this and let me know if you still encounter an error. I can clean up what I have (was messily written during a hackathon) and just post the whole thing as a demo. I'd also suggest blowing on the sensor as a means to test it, I found it was the lowest effort method to produce a lot of apparent noise (turbulence).

from adafruit_pybadger import Py...
onyx hinge
#

I'm sad I missed the precision timing discussion. can someone give me a link back to the discussion for later?

slender iron
#

that was from @still zephyr's hug report

onyx hinge
#

I assume they had discussed it here on discord, I'd read back if I could find the messages

slender iron
#

I read through most of discord and didn't see it. may have been an issue

#

(I'm not through my email)

onyx hinge
#

OK, I archive most of my github email without reading it 😕

slender iron
#

I'll let you know if I come across it later