#circuitpython-dev

1 messages Β· Page 379 of 1

idle owl
#

Ah ok.

#

This is working for me still.

tulip sleet
#

I will make a PR. I'd like to make an alpha.4 today, to include stuff like this.

idle owl
#

I didn't even have to be connected to serial, if I let it sit, it would start.

#

I'll approve it.

tulip sleet
#

really .... I didn't see that, I had to pound on ctrl-C. I did fix some other DMA problems in this PR, so maybe that's helping too.

#

anyway, I'll submit this

idle owl
manic glacierBOT
#

This fixes some but not all RP2040 audio issues, and fixes MacroPad display issues.

There are a several DMA cleanups. Ctrl-C interrupts of SPI and PIO transactions are also disallowed. SPI ctrl-C interrupts are not allowed on other ports. Allowing ctrl-C can cause bad data/commands to be sent things like displays.

Tested by @kattni on a MacroPad. Prevents display mess-ups that rendered the display unusable.

I know there is still some underlying DMA problem, and am continuing to work ...

idle owl
#

@tulip sleet Wait, should I also test audio for this build you sent me?

#

I have wav file playback in the macropad lib

#

it's a line of code to test it.

tulip sleet
#

wav playback is not fixed yet

idle owl
#

OK.

#

Approving PR πŸ™‚

tulip sleet
#

thanks πŸ™‚

tulip sleet
#

@slender iron I don't know if you want to review #4974. It is a partial fix for some problems while I continue working on some deeper RP2040 DMA issues. I would plan to merge it because it's a lot better even though it might not be the final fix. The current situation is unsatisfactory.

#

and we need to get macropad working better ofr now

idle owl
#

So glad I asked my partner to blur her background on Zoom ages ago because otherwise a meeting full of people I've never met would have seen me do a happy dance just now when Pylint passed.

manic glacierBOT
slender iron
#

@tulip sleet I can take a look. what are you thinking for the alpha release?

tulip sleet
#

i would expect to do an alpha.5 soon

#

but we have a backlog of necessary fixes

#

you don't have to review #4974, it has been pretty well tested

slender iron
#

I'd like to get something out even if it is unstable

#

its alpha anyway

tulip sleet
#

The release notes are all set to go. Then I will add #4974 assuming it builds and make a release within an hour or two.

slender iron
#

kk, thanks!

#

lots of good stuff in it

tulip sleet
#

every release is huge!

#

that's a good sign of how much work the community is doing

slender iron
#

yup! just gotta make sure to keep releasing as easy as possible

manic glacierBOT
manic glacierBOT
manic glacierBOT
idle owl
#

I did a thing!

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 7\.0\.0\-alpha\.4
tulip sleet
idle owl
simple pulsar
manic glacierBOT
orchid basinBOT
manic glacierBOT
#

The one failure is that some escornabot_makech builds were too big. That board is a robot with wheels, etc. Based on that, you could turn off MIDI and I think that would not crimp any uses.

In ports/atmel_samd/boards/escornabot_makech/mpconfigboard.mk, add CIRCUITPY_USB_MIDI = 0. An example of that is in adafruit_proxlight_trinkey_m0/mpconfigboard.mk (along with other things).

Once #4903 is merged, we won't be so close to the edge on many builds.

onyx hinge
#

Big thanks for 7.0.0-alpha.4, @tulip sleet !

#

and all contributors, naturally πŸ™‚

manic glacierBOT
#

The odd comment on Sparkfun site

Sensirion has written drivers for both the UART protocol and I2C. Unfortunately we've found the I2C is limited to only mass concentrations (not number concentrations) using the Arduino platform. So if you plan to use this sensor with an Arduino, use the UART interface. Both interfaces are described in their datasheet.

might be explained by this

https://github.com/Sensirion/arduino-sps/blob/df6346ab6485410963adf24164e955456383dd81/examples/sps30/sps3...

manic glacierBOT
manic glacierBOT
main furnace
#

Pylint complains that it can't import 'board' or 'neopixel'. I copied .pre-commit-config.yaml from a different project, but I didn't use cookiecutter. Should I just start over with cookiecutter?

manic glacierBOT
manic glacierBOT
manic glacierBOT
still zephyr
main furnace
#

It's more a 'guide to CircuitPython audio.' I want the code to look like library code.

#

Working better now that I have a valid '.pylintrc'.

cunning galleon
#

Any thoughts on "audioio for ESP32 S2" ? I was hoping to use it, but looks like it isn't in the ESP32 S2 port. Maybe there is a better alternative to DAC audio?

main furnace
#

I've had some good results with I2S on the FeatherS2.

manic glacierBOT
cunning galleon
#

Thanks for the info! I have to drive a speaker directly -- thus needing the DAC. The PWM works well for simple tones, but when I sweep the frequency it sounds terrible!

manic glacierBOT
#

If I understand right, PulseIn is streaming 1-bit samples from a PIO at 1MHz with a 128-bit buffer, so that has to be serviced at least every 128us or it will lose some. (And that's why disrupted measurements are always on the short side.)

Theoretically, would it be a good thing if the PIO did more of the work? Is the PIO program size a concern?

manic glacierBOT
idle owl
#

Hmph.

onyx hinge
#
MicroPython 7.0.0-alpha.4-10-g319135780-dirty on 2021-07-09; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> help()
Welcomeler/src/circuitpython/porAdafruit CircuitPython 7.0.0-alpha.4-10-g319135780-dirty!

Pleage/extmod/ulab/code/numpyvisit learn.adafruit.com/category/circuitpython/code/numpy/vector/vector project gu>>> 
``` well something's not right .. (I am messing with compression again)
slender iron
#

@cunning galleon I think @onyx hinge did some work on the DAC and it had lots of issues

manic glacierBOT
#

So I really like rainbowio but on the off chance we have to make a Python library version of colorwheel(), I should perhaps accept adafruit_rainbow so the name would be the same and all the code would work. It comes down to, what is the likelihood that we'll have to do a Python version? The only reason the Python version of Pixelbuf exists is that _pixelbuf was too big for tiny builds. rainbow built fine into all but one build, so I'm inclined to think we're not going to need a Pyth...

onyx hinge
#

@cunning galleon I investigated implementing analog AudioOut on the esp32-s2 but it was different than the esp32 and I didn't get it working before another task took precedence. Unfortunately, I don't recall the details anymore.

#

It had to do with how to get the DAC to be driven from memory data, like I couldn't find the necessary info or something

manic glacierBOT
#

I am OK with adding this to supervisor per the PR, and then writing a small Python library. It's most important on small boards that are tight on space already. @tannewt, what do you think?

Single function here + small python library sounds good. The reason to make a new module would be that we could make it available on some boards but not others then. That's also ok with me.

#

Try to accurately measure the costs of including a word in the dictionary vs the gains from using it in messages.

This saves about 160 bytes on trinket_m0 ja, the fullest translation for that board before and after this change. Other translations on the same board all have savings, ranging from 24 to 228 bytes. The list below sorted the fullest translations (before the change) to the top. The numbers shown are the "bytes free in flash firmware" reported during a local build.

Trans...
idle owl
#

@slender iron I guess I don't quite follow what's going on PyPI and why. There are packages for all the native modules..? Or Python versions of all of them or...? I don't quite get it.

slender iron
#

so we could put rainbowio there. I didn't want to use rainbow because there is already an existing pypi package (and module) with that name. its good to not duplicate names to reduce confusion

idle owl
#

Ok.

#

Thanks.

manic glacierBOT
idle owl
#

@candid sun Hey! Are you available to test something for me?

#

I don't have MIDI testing capabilities, and I have a library that wrappers MIDI, and I need it tested.

idle owl
#

Great! Let me get you a zip.

#

@candid sun This should have everything you need. But I don't know MIDI, so make sure that example is even doing anything to begin with, and feel free to test any of the other features or MIDI things I included. You're the first to work with this, so know that feedback is welcome!

#

That example is from I don't even remember where, and adapted to run with the library. So.... feel free to do something entirely different πŸ˜„

candid sun
idle owl
#

Oh hah, I should have asked that first.

#

Yes πŸ˜•

candid sun
idle owl
#

There's not an easy thing to mock up to make one either.

#

No worries!

#

Thanks for offering though!

candid sun
#

no problem!

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.3-501-g53c01176e on 2021-07-09; PewPew 10.2 with samd21e18

Code/REPL

.

Behavior

With CircuitPython 5.3.1 β€” the last version of CircuitPython that ran on the pewpew10 without issues β€” the display is very stable: https://youtu.be/_gLVneUf4yQ β€” the disappearing bricks are due to interplay between my camera's refresh rate and the PWM of the LED.

With CircuitPython 6.0.0 and later, there were...

solar whale
#

Does anyone know if the RP2040 "Nuke" .uf2 can be used on any RP2040 or only on the feather rp2040 -- I wonder if it would help here #help-with-circuitpython message

#

Never-mind -- I see now there is a similar file - may be the same file -- linked from the RP2040 connect page -- apparently it did not help.

manic glacierBOT
manic glacierBOT
#

@ladyada it's an 8x8 LED matrix driven from a timer interrupt. The code for the interrupt is here: https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/common-hal/_pew/__init__.c#L36-L89

This looks like something is disabling the timer interrupt periodically (or otherwise preventing it from firing on time), so that it is "late" and some of the lines get much more time than others, and so become brighter.

manic glacierBOT
manic glacierBOT
slender iron
manic glacierBOT
crimson ferry
#

haven't done a build in a while, anyone know what this issue is? build-espressif_saola_1_wrover/firmware.elf section `.dram0.bss' will not fit in region `dram0_0_seg'

teal heath
#

Hi, I posted this in a different channel and was told I should post here, but I'm following along with the "Building CircuitPython" tutorial on Adafruit.com, and I'm having an issue when It comes to building for the rp2040. I had success busing for the circuitplayground_express, as in the tutorial, and qtpy_m0. But when it comes to the rp2040 boards ( the raspberry_pi_pico, adadruit_feather_rp2040, and the adafruit_itsybitsy_rp2040 are the boards I've tried) I get the following error. Any help is appreciated

manic glacierBOT
#

Following the changes to OnDiskBitmap merged in https://github.com/adafruit/circuitpython/pull/4823 there are a number of libraries that need to be updated and tracked here:

Task list coming soon...

grep -r "pixel_shader=.*ColorConverter()" * | sort at the root of Adafruit_CiruitPython_Bundle gives

libraries/drivers/il0373/examples/il0373_1.54_color.py:    t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
libraries/drivers/il0373/examples/il0373_2.13_colo...
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.4-7-g58fdf9e94 on 2021-07-09; Raspberry Pi Pico with rp2040

Code/REPL

import array
import board
import time
import rp2pio

pinIn = board.GP1

program = array.array("H", [0x4001]) #in pins 1
sm = rp2pio.StateMachine(
	program,
	frequency=1_000_000,
	first_in_pin=pinIn,
	auto_push=True,
)
print("frequency", sm.frequency)
time.sleep(3)
buffer=array.array("L", [0] * 4)
zeroCount = 0
oneC...
manic glacierBOT
manic glacierBOT
ornate breach
#

Hey Dan, can i message you privately? I have a question but it isn't something i can ask in open forum

#

nevermind, i figured out what i had a question too

manic glacierBOT
onyx hinge
#

Anybody know how I would test if a HID descriptor works properly as a "boot keyboard"? Is there something to do besides trying to actually get into a PC BIOS screen via the device?

manic glacierBOT
#

After too many hours of fiddling I have discovered the issues with integer and floating-point data selection. The argument for data type in the SPS30 start command is only used by the sensor after power-up - the value is retained regardless of subsequent start commands while the device is powered. A stop then a start works to change data type, I'm going to change my code to do that.

onyx hinge
#

OK, well, I have a laptop where the boot screen operates with the traditional USB keyboard descriptor but not with a "bitmap-style" keyboard descriptor ... and it DOES work again with the magic "hybrid" descriptor. So, for compatible systems you get NKRO + boot compatibility with this descriptor and supporting code. https://gist.github.com/jepler/3f507711de499fa4f3cb756680bea927

#

this builds on the bitmap-style stuff I just blogged up https://emergent.unpythonic.net/01625944378 and the concept linked from https://blog.adafruit.com/2021/05/16/n-key-rollover-nkro-with-usb-keyboards/ of how to be compatible with both

Adafruit Industries - Makers, hackers, artists, designers and engineers!

You may read that USB keyboards support only 6-key rollover: that is, a maximum of 6 keys can be pressed at once, and further keypresses are not handled. That is true for USB keyboards operating in…

#

but I worry that testing on one dell laptop is not a great guarantee of working everywhere πŸ˜‰

stuck elbow
#

I'm going to steal this anyways

manic glacierBOT
manic glacierBOT
#

I grabbed the stats across all boards. Here are the savings for all the builds that were within 200 bytes of full before this PR:

Board Translation Before After Savings
sensebox_mcu ja 4 160 156
sensebox_mcu de_DE 100 232 132
arduino_nano_33_iot ja 112 268 156
feather_m0_rfm69 ja 144 324 180
blm_badge ja 168 280 112
blm_badge de_DE 172 272 100
arduino_mkr1300 ja 192 352 160

Some boards were a ...

manic glacierBOT
spiral elk
#

If I am going to build ports/stm32/boards/stm32f411ce_blackpill_with_flash to be flashable via tinyuf2, am I going to need to make changes to ports/stm/boards/STM32F411_nvm_nofs.ld to reflect a uf2 bootloader being present and the CP image being offset? At present official binaries for that board are just built as .bin starting at 0x80000000 and flashed with the regular stm tools (dfu or stlink).

#

No problem with doing the work myself but just seeking a little guidance if this is the right place to start or if its even needed at all.

manic glacierBOT
analog bridge
crimson ferry
#

yes, it’s a debug build, no firmware is generated

analog bridge
#

yes, fails at last step... would you like to create an issue?

crimson ferry
#

yes i’ll do that, thanks for chiming in

manic glacierBOT
#

CircuitPython version

current main

Code/REPL

make (no code)

Behavior

[658/658] Generating ld/esp32s2.project.ld
/Users/a/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: build-espressif_saola_1_wrover/firmware.elf section `.dram0.bss' will not fit in region `dram0_0_seg'
/Users/a/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-...
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.4 on 2021-07-08; Adafruit PyPortal with samd51j20

Code/REPL

# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

"""Simpletest example using Adafruit PyPortal. Uses the touchscreen to advance between examples."""
import board
import adafruit_touchscreen
from adafruit_pybadger import pybadger
import time

# pylint: disable=invalid-name

# These pins ...
lone sandalBOT
manic glacierBOT
#

Verified something similar still happens in latest build Adafruit CircuitPython 7.0.0-alpha.4-15-g22e8a5058 on 2021-07-11; Adafruit FunHouse with ESP32S2 with this code:

import time, board
import pwmio
while True:
    for f in (262, 294, 330, 349, 392, 440, 494, 523):
        with pwmio.PWMOut(board.SPEAKER, frequency=f, duty_cycle=2**15) as pwm:
            time.sleep(0.25)
    time.sleep(1)

The above will result in 3 tones being played and then the error:

Traceba...
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.4-15-g22e8a5058 on 2021-07-11; Adafruit FunHouse with ESP32S2

Code/REPL

# boot.py
import usb_midi
usb_midi.disable() 
print("disable MIDI")
import usb_hid
usb_hid.disable()
print("disable HID")
import usb_cdc
usb_cdc.enable(console=True, data=True)
print("enable CDC console & data")

Behavior

On reset or power up, board goes into boot loop. No way to escape it, without `esptool.py ...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I'm doing keyboard with display. On display showing total pressed keys, I'm need to write this in controller memory (I'm using pi pico), but all memory operations so long (beetwen 0.4 and 0.7 sec for write). If I press key while data writing, I miss this key (or show with really big delay). My controller has two cores, but now it impossible to use both of them or write data in async operation which no lock main cycle

manic glacierBOT
tacit briar
#

I’m looking for the Python/CircuitPython equivalent of a map in Java. The goal is to associate a color name as a key with its RGB tuple value. User gives a string of the color name and gets the tuple back.

slender iron
slender iron
slender iron
spiral elk
#

OK, at least I'm on the right track there. It seems that tinyuf2 isn't quite there yet on that board port so I've got a bit of time to figure out what I need to do.

slender iron
#

πŸ‘ thanks for looking into it!

spiral elk
#

I would like to see CP binaries moving to UF2 on STM32 if at all possible, since some of the boards are really tempremental on timing to get into DFU mode.

#

There might be some problem on STM32F4 with not efficiently being able to allocate the flash segments adding a second bootloader into the picture though, nvm might need to be rethought.

#

Since I think it occupies one of the precious 16k segments all to itself.

slender iron
#

that'd be nice! I'd love to have uf2 everywhere

tacit briar
#

thank you @slender iron . I knew the structure existed... i just didn't know what it was called, making a search difficult. Here is the function I worked up:

def setcolor(colorname):
global color
colors = {
"black":(0,0,0),
"red":(intensity,0,0),
"green":(0,intensity,0),
"blue":(0,0,intensity),
"yellow":(intensity,intensity,0),
"cyan":(0,intensity,intensity),
"magenta":(intensity,0,intensity),
"white":(intensity,intensity,intensity),
}
color = colors.get(colorname, (0,0,0)) #defualt to black (off)

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.4-18-g0c6dc6f0a on 2021-07-12; Raspberry Pi Pico with rp2040

Code/REPL

import array
import board
import time
import rp2pio
import adafruit_pioasm

asm = """
	pull
	mov isr osr
	push
"""
program = adafruit_pioasm.assemble(asm)

sm = rp2pio.StateMachine(
	program,
	frequency=1_000_000,
)

def readAnswers():
	answer = array.array("L", [0])
	time.sleep(0.001)
	while sm.in_waiting > 0:...
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.4-18-g0c6dc6f0a on 2021-07-12; Raspberry Pi Pico with rp2040

Code/REPL

import array
import time
import rp2pio
import adafruit_pioasm

asm = """
	pull
	mov isr osr
	push
"""
program = adafruit_pioasm.assemble(asm)

sm = rp2pio.StateMachine(
	program,
	frequency=1_000_000,
)

item = array.array("L", [0])

for i in range(10):
	time.sleep(2)
	print(i)
	sm.write(item)

Behavi...

#

Is there an intention to add a compile-time config macro for this feature, so that ports that have the space can opt out of this to improve performance?

In CircuitPython, I think we decided to always use this size savings. However, the preprocessor CAN disable this feature, with macros something like

#if !defined(MP_TYPE_FLAG_EXTENDED)
#define MP_TYPE_CALL call
#define mp_type_get_call_slot(t) t->call
#define MP_TYPE_FLAG_EXTENDED (0)
#define MP_TYPE_EXTENDED_FIELDS(...) __VA_...
#

The grep above shows it infrequently, but that excludes the types created by MP_DEFINE_EXCEPTION; we have 66 instances of MP_DEFINE_EXCEPTION in CircuitPython, putting this field at 73, about the same as print.

Due to the time required to move a field between the base and extended fields, I didn't specifically investigate this possibility or gather numbers about it.

manic glacierBOT
#

Here's a full summary for PYBV11 with some analysis (on Google Sheets)

https://docs.google.com/spreadsheets/d/1DQG7xZwCjo0DbFJbPwh92gtyjRfPiS-nJvG1kRSvG8k/edit?usp=sharing

The basic approach was:

  • Remove all STATIC from const mp_obj_type_t definitions.
  • grep for all definitions, get all possible type names in the repo
  • Python script to automate print <type>.<slot> in gdb on pybv11/firmware.elf
  • Generate CSV
manic glacierBOT
#

In MicroPython, on PYBV11 (see analysis sheet above), I get a predicted saving of 2504 bytes (this is just the memory used in the object definitions, not including extra code size added for accessing the fields).

Moving parent into extended reduces the saving to 1776 bytes. Note that MicroPython on PYBV11 only defines 23 exception types.

Note that 2504 is out of a possible 5216 bytes if a perfect system could be implemented with no metadata overheads. FWIW, the index table approach I...

manic glacierBOT
#

Here's my own stab at a script to analyze slot usage: https://gist.github.com/jepler/5cb392d43c16845645b49296c27e0850
.. it works on an elf file

The resulting spreadsheet for trinket_m0:
https://docs.google.com/spreadsheets/d/1zcEAkoOfHaMzsCcB9Z1x8MyClU_jt_xDHfFMPpE-rbs/edit?usp=sharing

A further iteration tried all the combinations and found that my split was best, again for trinket_m0:
https://gist.github.com/d480e10a509c0af8de69bdb247df9f4a

Furthermore, the data savings was est...

#

Using @jimmo 's spreadsheet I found a slightly better split (based on PYBv1.1) that puts the protocol slot in the base set. That saves an extra 92 bytes (on PYBv1.1 at least).

Using a 3-way split (base + ext1 + ext2) of the following form:

base = (print, make_new, attr, parent, locals_dict)
ext1 = (call, unary_op, getiter, iternext, protocol)
ext2 = (binary_op, subscr, buffer_p)

saves an extra 672 bytes compared to @jepler 's scheme (on PYBv1.1).

A 4-way split can do a li...

#
import array
import board
import time
import rp2pio
import adafruit_pioasm

pinIn = board.GP1

asm = """
	wait 0 pin 0
loop:
	in pins 1
	jmp loop
"""
program = adafruit_pioasm.assemble(asm)

sm = rp2pio.StateMachine(
	program,
	frequency=1_000_000,
	first_in_pin=pinIn,
	auto_push=True,
	pull_in_pin_up=1,
)

buffer=array.array("L", [0] * 4)

while True:
	time.sleep(1)
	sm.restart()
	sm.clear_rxfifo()
	while sm.in_waiting < 4:
		pass
	sm.readinto(buffe...
manic glacierBOT
#

I did some experiments on the generated code for the different approaches.

I have three branches that add an extra slot to mp_obj_type_t in three different ways:

They all add a `void m...

#

Using @jimmo 's spreadsheet I found a slightly better split (based on PYBv1.1) that puts the protocol slot in the base set. That saves an extra 92 bytes (on PYBv1.1 at least).

This is different than trinket_m0; I think we use protocols less heavily than you.

Is there a better way for "3 tier" to look than

STATIC const mp_obj_type_t uctypes_struct_type = {
    { &mp_type_type },
    .flags = MP_TYPE_FLAG_EXTENDED2 /* (implies EXTENDED1) */ ,
    .name = MP_QSTR_struct,
    ....
#

As long as there are at most 15 optional slots, can you use bitfields:4 instead of uint8_t for the slot indices?

I think so! I do wonder if you end up doing a lot more work to extract the bits out for a relatively small saving, but I will test it out.

Here's the disassembly for this approach (see code at https://github.com/jimmo/micropython/tree/obj-slots-index-bits)

0802c748 <mp_do_extra>:
 802c748:       b510            push    {r4, lr}
 802c74a:       4604          ...
#

Here's the corresponding disassembly for M0 (rp2040)

Baseline:

100178e4 <mp_do_extra>:
100178e4:       b510            push    {r4, lr}
100178e6:       f7f5 f99f       bl      1000cc28 <mp_obj_get_type>
100178ea:       6bc3            ldr     r3, [r0, #60]   ; 0x3c
100178ec:       2b00            cmp     r3, #0
100178ee:       d000            beq.n   100178f2 <mp_do_extra+0xe>
100178f0:       4798            blx     r3
100178f2:       bd10            pop     {r4, pc}

...

#

Hmm. It looks like this issue relates to the functionality of the SDK's pio_sm_restart() call. According to the Pico documentation, "This method clears the ISR, shift counters, clock divider counter pin write flags, delay counter, latched EXEC instruction,and IRQ wait condition." Notably, it does not reset the program counter. Thus it will not execute the "wait 0 pin 0" instruction from the example. We might need to decide whether following the SDK is the right thing to do, or if calling s...

manic glacierBOT
#

Trying to break it now, 0c6dc6f crashes at 5. I guess it should throw an exception at the actual limit.

import board
import digitalio
import pulseio
import time

#GP0..N chained together
numPulseIns = 5

print("start")
digitalOut = digitalio.DigitalInOut(board.GP0)
digitalOut.direction = digitalio.Direction.OUTPUT
time.sleep(7)

print("creating PulseIns")
pulseIns = []

for i in range(numPulseIns):
	pin = getattr(board, "GP%d" % (i+1))
	print(pin)
	pulseIn = p...
manic glacierBOT
#

Looking again at 3-tier, based on trinket_m0 types, I found the best saved 2152 bytes, or an additional 200 bytes compared to 1952 with the two-tier system.

My optimal 3-tier was:

tier fields
base (base flags name) print make_new attr parent
first getiter iternext protocol locals_dict
second call unary_op binary_op subscr buffer_p

code (runs for quite awhile) & output (just the few lines at top and bottom) in gist: https://gist.github.com/254a06c86...

onyx hinge
#

Hi <@&356864093652516868> -- the weekly Discord meeting is about 90 minutes from now. If you have notes for me to read, or plan to speak, please update the notes document accordingly: https://docs.google.com/document/d/17UaJ2NvMP61i1V6rIwAq5VecsdoTKfSQVTOHetINmQw/edit -- if you're just listening in, no need to do anything. We'll see you in the CircuitPython voice channel at around 2PM ET!

If it's your first time speaking, please make sure we have added you to the CircuitPythonistas role. This also gets you a small number of notifications through the week, mostly about the meeting itself.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 6.3.0 on 2021-06-01; Adafruit Feather M4 Express with samd51j19

Code/REPL

import board
from analogio import AnalogIn, AnalogOut

def case1(pin):
    '''Should not throw error if pin is released properly
    '''
    c = AnalogIn(pin)
    c.deinit()
    c = AnalogOut(pin)
    c.deinit()
    c = AnalogIn(pin)
    
def case2(p1, p2):
    '''Should always throw error since pin being changed was not releas...
idle owl
#

@onyx hinge What change did you make to OnDiskBitmap? I used it in the MacroPad library. Pretty sure I used the latest documentation, but now I'm wondering.

#

This is a snippet of the relevant code: py with open(file_name, "rb") as image_file: background = displayio.OnDiskBitmap(image_file) sprite = displayio.TileGrid( background, pixel_shader=background.pixel_shader, x=position[0], y=position[1], ) group.append(sprite) self.display.refresh()

modern wing
#

Happily lurking and easting some leftover chicken milan.

errant grail
#

Just listening today.

idle owl
#

Finishing up an internal meeting, we'll be there soon!

thorny jay
#

Not participating. I have just put a kind of group hug, but did nothing this week.

stiff pelican
idle owl
modern wing
#

beep-boop.

idle owl
#

😊 Thanks!

solar whale
#

😊

slender iron
idle owl
#

time.microtonic() and time.nanotonic() are the new versions.

solar whale
#

@idle owl be happy to test macropad -- I have some time in the next few days.

idle owl
misty garnet
#

anyone notice a difference in SAMD21 clock frequency depending on whether it's connected to a USB serial, or just powered with the USB socket? I have a Seeeduino XIAO that I'm using for PWM servo control, and it programmed just fine with 60 Hz pulses with 1.5ms pulse widths using the PWM library. When that same microcontroller is just powered via USB, the frequency drops to ~58Hz and the pulse width goes to 1.54ms, indicating to me that something is messing with the chip clock frequency

solar whale
#

@slender iron I do have a v2 and will try to test.

slender iron
#

@misty garnet ya, that's typical. the SAMD21 uses USB as a clock reference when it can

#

when there is no other crystal

misty garnet
#

@slender iron well, that would explain it, thanks. sounds like if I want specific timings for when it's not connected, I need to take that into account and tweak the program values

slender iron
#

you can take a look at the circuitplayground code. it actually stores the clock tuning config so that the timing changes less between on and off usb

#

it takes a bit of flash space though

modern wing
#

thanks all!

misty garnet
#

@slender iron thanks!

ember iris
#

Well it's interesting to hear the thoughts πŸ˜›

modern wing
#

I know we could check out at any time, but we can also leave?

#

Better than that last hotel I stayed at!

manic glacierBOT
#

This came out of #4926 - the scope of which was refined to an initial step which is nearly completed by #4991.

This issue is to address the part of the previous issue not yet dealt with - renaming _pixelbuf and adafruit_pypixelbuf to adafruit_pixelbuf so they match for seamless usage. This will simplify the usage in NeoPixel and DotStar, and any future applications.

The current suggestion is to create a new Python library called adafruit_pixelbuf and copy adafruit_pypixelbuf ...

idle owl
#

@gilded cradle I have some Blinka questions, if you have a few minutes.

gilded cradle
#

Sure @idle owl what did you have?

idle owl
gilded cradle
#

Generally, they aren't available until somebody adds them.

idle owl
#

Ok, how would I go about doing that?

gilded cradle
#

Which module?

idle owl
#

Limor wants this rainbowio module I added that has the colorwheel() function to work with Blinka.

#

And the next thing on my list once it's merged it to make that happen.

gilded cradle
idle owl
#

Alright

gilded cradle
#

You would create a rainbowio.py file. Start with Raspberry Pi. You can look at some of the other modules to get an idea.

idle owl
#

Ok

gilded cradle
#

We probably should create a guide on how to add new modules to Blinka.

idle owl
#

@gilded cradle Is it ok if I ping you when it's merged and have you work with me on adding it?

gilded cradle
#

sure

idle owl
#

Thanks!

manic glacierBOT
turbid radish
#

?Serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

58

Voice Channels

6

Members

29869

Roles

35

idle owl
#

Oi, my fork is still called Adafruit_MicroPython_Blinka. I have apparently done nothing with the Blinka repo in a LONG time.

gilded cradle
#

πŸ˜„

idle owl
#

This is a clear case of delete and start fresh. πŸ˜„

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

manic glacierBOT
#

I'm doing keyboard with display. On display showing total pressed keys, I'm need to write this in controller memory (I'm using pi pico), but all memory operations so long (beetwen 0.4 and 0.7 sec for write). If I press key while data writing, I miss this key (or show with really big delay). My controller has two cores, but now it impossible to use both of them or write data in async operation which no lock main cycle

async won't help you on the RP2040 because the code is running from the...

slender iron
#

@ionic elk got time this week to sync up?

manic glacierBOT
#

The interrupt routine should be entered a subsequent time if the fifo is still full after the first get. This has a bit of cost instead of having a loop here but its pretty minor.

rp2pio_statemachine_construct should do a FIFO join automatically.

What protocols need this tight of timing? I don't know of one.

idle owl
#

@onyx hinge Mind chatting changes a bit? (text chat)

idle owl
#

@lone axle When you have a moment, I'd like to chat about some things. Please DM me when you have a few minutes. Thanks!

#

@slender iron The plan with gamepad is to "replace" it with keypad? e.g. Where gamepad is used, implement keypad? Or did I misunderstand things I heard in passing.

onyx hinge
#

@idle owl yeah if it's still relevant!

idle owl
#

@onyx hinge Quite relevant!

onyx hinge
#

okeiieaieo

idle owl
#

Perhaps you can answer the question I asked Scott about gamepad/keypad first

onyx hinge
#

Yes, I think the idea is to change anything that used gamepad to use keypad, which includes at least some libraries (and guides?)

idle owl
#

Indeed.

#

Ok.

onyx hinge
#

so that gamepad can be removed (in 7, I think)

#

which creates "how do you do a compatible with 6.3 version" problems

idle owl
#

Right.

onyx hinge
#

I think it's worth saying that it's on the table to NOT do this if the consequences are too great.

idle owl
#

Hmm alright

#

worth knowing

onyx hinge
#

if it means we have to wait until we stop supporting 6.3

idle owl
#

Right. I follow.

onyx hinge
#

okay

idle owl
#

Ok

#

Hmm let me share a spreadsheet with you

manic glacierBOT
idle owl
#

@onyx hinge Those are the changes I have listed so far. I don't know where to find the library-specific issues that came up. You may have known some of them? Or was it more that the core stuff affected libraries?

onyx hinge
#

the one I know of that's not listed is the extensive renaming in ulab

idle owl
#

Ok

#

Already implemented?

onyx hinge
#

yes the changes are implemented in 7.0 already

#

ulab is used in some guides and in the examples of some libs but not in lib code itself

idle owl
#

Breaks current code or is still backwards compatible?

onyx hinge
#

The compatibility plan, at least as far as I'm concerned, is to make code that works with 7.0 only.

#

breaks current (6.3) code quite extensively

idle owl
#

Got it

#

Presumably we want a bit of testing with the changes?

onyx hinge
#

if there were library code I'd say otherwise

idle owl
#

And, finally, have we filed any issues about updating code for it?

onyx hinge
#

yeah, I'm set up to test the main ulab guide, but there are some others like philb's light painting one

#

no, I do not think any github issues have been filed

idle owl
#

Ok

onyx hinge
#

the library examples are ```python
libraries/drivers/ov2640/examples/ov2640_displayio_kaluga1_3_ili9341_ulab.py:import ulab.numpy as np
libraries/helpers/ble_adafruit/examples/ble_adafruit_clue.py:import ulab

#

the guides are ```python
CLUE_Light_Painter/bmp2led.py:import ulab
CLUE_Metal_Detector/clue-metal-detector.py:import ulab
Ocean_Resin_Lightbox/code.py:import ulab
Ukulele/code.py:import ulab.numerical as numerical
ulab_Crunch_Numbers_Fast/benchmark.py:import ulab

idle owl
#

Ok created another sheet in there with this information.

onyx hinge
#

OK

idle owl
#

I think we need to file an issue on the core to track this though. I'll sort out that happening.

#

Ok, so as for library changes. Were there things we discussed that were lib-specific, or was it all how core things related to libs?

onyx hinge
#

It seemed like Scott said at some point that "all those things" were in libs, but now I can't remember the things that were in libs

idle owl
#

I tried to follow all of it, but I didn't know I'd be taking over handling it until after it was all discussed πŸ˜„

#

Yeah. Same.

#

Ok.

#

I will start with what I have and email Scott and Dan I suppose, since I said I would email Dan about it.

#

I think that's it for now. Thanks, @onyx hinge !

manic glacierBOT
onyx hinge
#

@idle owl glad I could help some

manic glacierBOT
manic glacierBOT
#

What protocols need this tight of timing? I don't know of one.

I don't know much about serious protocols and which ones might be affected by losing a few tens of microseconds. I guess nobody will be doing IrDA in PulseIO. There's this? http://www.numericana.com/answer/ir.htm#455

I'm in a club for reverse-engineering toys that communicate with each other. One of our members is also making a new toy with a Pi Pico and CircuitPython, and hopes to interface with some existing ones. After ...

manic glacierBOT
manic glacierBOT
manic glacierBOT
orchid basinBOT
#

Bumps addressable from 2.7.0 to 2.8.0.

Changelog
Sourced from addressable's changelog.

Addressable 2.8.0

fixes ReDoS vulnerability in Addressable::Template#match
no longer replaces + with spaces in queries for non-http(s) schemes
fixed encoding ipv6 literals
the :compacted flag for normalized_query now dedupes parameters
fix broken escape_component alias
dropping support for Ruby 2.0 and 2.1
adding Ruby 3.0 compatibility for development tasks
d...

manic glacierBOT
manic glacierBOT
#

FWIW here's some (rough) timing data on the different approaches. This is milliseconds, for 1000000 iterations of calling mp_do_extra with the code in those branches (but with the print removed from list_extra). Calling it for three different types (testing the "extended, has the slot" (list), "extended, doesn't have the slot" (dict) and "not-extended" (str) paths).

(str was a bit of a bad choice in hindsight, because it uses a different path in mp_obj_get_type).

Baseline:

str: ...
spiral elk
#

Is nvm actually implemented on any stm32 device? I am noticing that the blackpill_with_flash device has a linker segment defined for it but the module is not built in. STM32 Feather and blackpill without external flash has neither the module nor any flash space reserved.

#

I'm wondering if that space can't be co-opted for bootloader purposes on the blackpill_with_flash

spiral elk
#

OK, in my local repo I think I've got something with a new board entry and linker map that at least compiles. Given that tinyuf2 is not fully operational yet on the target hardware though I can't test.

#

using sector 0 for bootloader, 1 for isr, 2-7 for firmware (current is 0 isr, 1 nvm (but unused), 2-7 for firmware)

lone sandalBOT
manic glacierBOT
#

@tannewt yea, I was solved this by using external EEPROM. But so many cases in my project when I'd like to use threads. Two text lines on display (len. around 14 sym), each of them updating around 40-60ms, and together in locks my keyboard on 100ms (it's really long when typing). Solved by slice lines and update each symbol separately at different time. To many math (total around 120ms) - solved by partially execute all unimportant functions in loop, step by step. Of course, all problems sol...

manic glacierBOT
#

Hey folks, I just came across this issue while researching an issue I'm experiencing and it sounds exactly like Kattni described above. I'm using the Tiny S2 from Unexpected maker with a 60 neopixel ring. The animation works just fine apart from random flashes of other colours. It occurs even under the most basic of code conditions. Please let me know if there is anything I can do to help debug.

manic glacierBOT
manic glacierBOT
ionic elk
#

@slender iron hi sorry I'm caught in two weeks of insanity, bunch of family stuff + moving + work prep. I'm squeezing some hours in today, should have all of next week free, but the rest of week is mayhem. Today or Friday might be good, if that works

manic glacierBOT
#

I developed two device descriptors that support NRKO (https://emergent.unpythonic.net/01625944378). While doing so, I noticed that the standard adafruit_keyboard class had no way of knowing that the report didn't match what it expected, until it encountered an exception trying to send a wrong-sized report.

I don't know exactly what is necessary or useful, but it seems like it would be nice if Keyboard could instead say "this descriptor isn't quite what I need"; this might consist of loo...

idle owl
#

Getting weirdness on Trinket, where I'm using the DotStar, and it keeps saying pin in use. There's nothing else going on in the code.

#

I think DotStar is borked.

#

Hmph.

#

If someone else has a Trinket and could test this, let me know.

solar whale
#

@idle owl What version of CP?

idle owl
#

@solar whale Absolute latest, I just built it.

solar whale
#

Ill give it a try -- be a few minutes -- need to update and build

idle owl
#

@solar whale You could grab it off of S3. I don't think it's a CP issue.

#

Here is the example I'm using: ```py
import adafruit_dotstar
import board

pixel = adafruit_dotstar.DotStar(board.DOTSTAR_CLOCK, board.DOTSTAR_DATA, 1)

while True:
pixel.fill((255, 255, 0))

#

Give it a minute to sit, or soft reload or something, and then it fails with Traceback (most recent call last): File "code.py", line 4, in <module> File "adafruit_dotstar.py", line 112, in __init__ ValueError: APA102_MOSI in use

#

You can switch the pins to use the APA102* pins, same result.

#

Line 112 is where it switches to using digitalio if busio isn't working.

#

So, I think it's trying to do both even though it should only do one.

solar whale
#

its is working for me -- after soft reboot

#

I have your code as code.py -- I install adafruit_dotstar.mpy and adafruit_pypixelbuf.mpy from todays bundle

idle owl
#

I have one from not today. Let me download today's bundle.

solar whale
#

this is on a trinket m0, correct?

idle owl
#

Yeah

#

Same issue. πŸ˜•

solar whale
#

seems happy here

idle owl
#

Hmm.

solar whale
#
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
  File "code.py", line 7, in <module>
  File "adafruit_pypixelbuf.py", line 204, in fill
KeyboardInterrupt: 

Code done running.

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

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
#

it is running -- I do control C to stop then control d to reboot

idle owl
#

Mine is soft reloading on its own and failing after that.

#

Trying alpha4

#

Same issue.

#

I don't make changes to code, or anything, and it reloads eventually, and fails.

solar whale
#

I am using latest ```
Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 7.0.0-alpha.4-49-g9fdecacec on 2021-07-13; Adafruit Trinket M0 with samd21e18

idle owl
#

I was running latest a minute ago

#

wanted to see if it was something in my build

#

so I tried alpha4 too

#

Alright, thanks for testing. Who knows. I don't have time to dig into this, really. If folks aren't complaining, it's probably a me-issue.

solar whale
#

ah - if I write to the CIRCUITPY drive while it is running , it reloads and fails

idle owl
#

Oh.

#

Ok so it's not a me issue.

#

MacOS does writey-type things all the time I think

#

so I'm getting the reload more often

solar whale
#

probably -- it is fin on my Linux system as long as I don't write to it.....that does sound like a CP issue...

idle owl
#

Hmm.

#

I would have blamed DotStar, but I don't understand what's happening.

solar whale
#
code.py output:
Traceback (most recent call last):
  File "code.py", line 4, in <module>
  File "adafruit_dotstar.py", line 112, in __init__
ValueError: APA102_MOSI in use

Code done running.

```  happens when I write to the CIRCUITPY drive
idle owl
#

So my thought was that it's doing both of those sections (try and except) when it shouldn't be.

solar whale
#

It's odd because it still says "soft reboot" when I write to the DRive -- just like it does when I do a Control-D

idle owl
#

Yeah, but ctrl+D fixes it. It's only on the write action where it reloads on its own that it fails.

solar whale
#

it is not a "NotiMplemented Error" it is a "ValueError"

idle owl
#

I meant, it's trying busio, and then trying digitialio. When it should only do one or the other.

solar whale
#

That try/except woulde be a "notImplemented Error"

idle owl
#

Hm

solar whale
#

never-mind -- it is both

#

sorry

idle owl
#

No worries πŸ™‚

solar whale
#

the reboot should release the MOSI pin -- but there may be two reboot paths in CP -- slightly different.

slender iron
solar whale
#

@idle owl mine behaves the same on my Mac (M1 Mini) -- it is running OK through control D reboots, but if I do touch /Volumes/CIRCUITPY/junk it crashes ```
Press any key to enter the REPL. Use CTRL-D to reload.
soft reboot

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

Code stopped by auto-reload.
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 4, in <module>
File "adafruit_dotstar.py", line 112, in init
ValueError: APA102_MOSI in use

Code done running.

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

idle owl
#

@solar whale So you think it's a CP issue?

solar whale
#

Yes -- I think there is something wrong in the auto-reload.

idle owl
#

Can you file an issue for it, please?

solar whale
#

sure.

idle owl
#

Thank you!

#

@gilded cradle Hello! I'm looking at adding rainbowio to Blinka. Seems like all the different modules are implemented slightly differently, and I'm not sure which one to model after, or what I'm supposed to be importing. Also, it should be supported on every board, it simply contains the colorwheel() function. But I don't know that it would work on everything for certain. That's an assumption.

#

As in what to import inside the detector lines.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.4-49-g9fdecacec on 2021-07-13; Adafruit Trinket M0 with samd21e18

Code/REPL

code.py:

import adafruit_dotstar
import board

pixel = adafruit_dotstar.DotStar(board.DOTSTAR_CLOCK, board.DOTSTAR_DATA, 1)

while True:
    pixel.fill((255, 255, 0))


### Behavior

Runs normally and continues to run normally after a  Control-D soft reboot

but if I write soemthing to the CIRCUITPY drive w...
orchid basinBOT
#

USB-C is a pretty notable feature to search on.

I also considered a feature for USB Micro, but then I felt it would be excluding USB A, USB Mini, Castellated, and pin headers. I felt adding each possible USB connectivity would make the filter list lengthier and a little awkward.

I also correct the markdown syntax on a board to remove the "Wi-Fi Bluetooth/BTLE" category. It now filters into each category correctly.

solar whale
#

@idle owl filed -- add any comments you want.

solar whale
#

you're welcome!

idle owl
#

@gilded cradle I feel like there's more to this that I'm missing πŸ˜„

gilded cradle
#

@idle owl if there's nothing board specific about it, then there's no reason to detect the board. πŸ™‚

idle owl
gilded cradle
#

It kind of depends on how you make use of rainbowio in CircuitPython. Do you have a code example?

idle owl
#

@gilded cradle Yeah. Here's a pseudocode example: ```py
import neopixel
import board
import rainbowio

pixels = pixel-setup

while True:
pixels.fill(rainbowio.colorwheel(0))```

#

Or from rainbowio import colorwheel but yeah.

gilded cradle
#

Probably something like this then:

[imports]

def colorwheel(color):
    # Code to display rainbows goes here
#

I imagine it will be fairly small

idle owl
#

So it's a python implementation of it..?

gilded cradle
#

yes

idle owl
#

I'm still confused πŸ˜•

#

Hmm ok

gilded cradle
#

Blinka is 100% Python

idle owl
#

Oh!

gilded cradle
#

We even rewrote the ioctl stuff to Python

idle owl
#

So it's not really "using" CircuitPython.... it's reimplementing it?

gilded cradle
#

Yes

idle owl
#

That was where I was lost, I think.

gilded cradle
#

No worries

idle owl
#

OK, I'll give this a try.

gilded cradle
#

I should say it's really like 98% Python since there's a tiny bit of compiled code such as libgpiod stuff.

idle owl
#

Fair enough.

idle owl
#

@gilded cradle How do I test this? I've tried multiple ways of trying to "install" Blinka from my local copy, but it's not working. What am I missing?

gilded cradle
idle owl
#

Ok. Thanks.

gilded cradle
#

np. I think I have that in my Blinka guide.

idle owl
#

@gilded cradle Have you seen this before? This is with an example that previously worked. Traceback (most recent call last): File "/Users/kattni/neopixel.py", line 4, in <module> import neopixel File "/Users/kattni/neopixel.py", line 6, in <module> pixel = neopixel.NeoPixel(board.NEOPIXEL, 1) AttributeError: partially initialized module 'neopixel' has no attribute 'NeoPixel' (most likely due to a circular import)

gilded cradle
idle owl
#

Oi. Ok...

#

The new module doesn't import anything. And it does that even without the new module.

gilded cradle
idle owl
#

Yeah.

gilded cradle
#

Rename it and it should fix it

idle owl
#

Oh, seriously?

#

🀦 Gah.

gilded cradle
#

Yeah, there's already a neopixel.py and it's getting confused

solar whale
#

I feel so much better now, having done that myself!,

idle owl
#

Now I'm getting a new error, but hey, progress.

#

Finally!

#

oi.

#

Ok it works.

gilded cradle
#

πŸŽ‰

idle owl
#

@gilded cradle Should I add an example using it?

#

Not sure how to make a board-agnostic example with LEDs though

#

so maybe skip it for now.

#

Answered my own question.

#

PR incoming.

#

@gilded cradle Actually one more thing - do I add it to setup.py ?

#

And do we have to do something to make it end up on PyPI?

gilded cradle
#

To get it to PyPI, just publish a new release.

gilded cradle
#

yes

idle owl
gilded cradle
#

New release of Blinka. Nothing separate. We have displayio and bleio separate because they're big repos.

idle owl
#

Ah ok.

#

Thanks!

gilded cradle
#

yw

idle owl
#

@gilded cradle PR submitted!

gilded cradle
#

Thanks, I'll take a look

idle owl
#

@gilded cradle Failed on things I didn't change?

gilded cradle
#

Yeah, looking...

#

I think Pylint had an update

idle owl
#

Oh... Hah. Yeah it does that.

#

Does Blinka use pre-commit?

#

We had to pin it in the libs because of pre-commit.

#

Doesn't appear to. That's a whole other thing to set up if we want to do it.

gilded cradle
#

No, it's on the to-do list.

idle owl
#

You could pin Pylint in the meantime.

#

Want me to add that to the PR?

gilded cradle
#

Yes please

idle owl
#

On it.

gilded cradle
#

Thank you

idle owl
#

Pinning to the version used in the libs.

#

@gilded cradle Well that narrowed it down to 2 failures from that huge list.

#

I'll fix it.

#

It's an issue with the disables.

gilded cradle
#

Yeah. it probably hasn't run since an even older version. Thanks.

manic glacierBOT
idle owl
#

@gilded cradle Whew. Ok. Passing now.

gilded cradle
idle owl
#

Sure!

manic glacierBOT
#

I don't know much about serious protocols and which ones might be affected by losing a few tens of microseconds.

This is my impression too. I think what we have is good enough and we shouldn't spend time making it better when it won't get us anything additionally.

I'm going to close this issue. If you find other devices that expect more accuracy (rather than synthetic test signals) please open issues for those. Thanks!

thorny jay
#

@turbid radish In the newsletter, there is that picture, that does not seems to match the description above or after:

manic glacierBOT
solar whale
#

@idle owl You are probably aware of this, but your keypad demo in the macropad guide needs to be updated for the new rainbowio -- it tries to import colorwheel from _pixelbuf and throws an error

idle owl
solar whale
#

Not sure -- is the change in alpha.4 or after that

#

anyone using the "latest"releases, can figure it out on their own πŸ˜‰

#

but if it's in alpha.4, I'd recommend updating it.

idle owl
#

After alpha.4

#

I was going to wait until the next release.

onyx hinge
#

It dates way back to this project ... https://emergent.unpythonic.net/01113670404 but I just liked the image.

solar whale
#

Then I think it's ok to wait -- unless you want to go through the try/except trouble...

idle owl
#

I really don't. πŸ˜„ That was the whole point of this.

#

To avoid that.

#

I've got it on my radar, there's quite a few things in Learn to be updated. I mean, relative to the other changes we caused, there's NOTHING.

#

But it's a short list anyway.

solar whale
#

No problem -- As I noted -- people on the "cutting edge" should expect such things.

idle owl
#

True! Thanks for letting me know though. If you run into it after the next release, definitely let me know again.

manic glacierBOT
idle owl
#

@lone axle Hey! So I talked to Dan - he'll be back tomorrow sometime and will look more closely at the list. In terms of priority, I think we'll decide together because it all needs to be done, so perhaps whatever is simplest first. Or already in progress.

#

@lone axle I have a spreadsheet that I want to go over with you at some point later this week or next week depending on when we sync up. It's meant to simplify things, but it ended up getting a bit complicated, heh. Or maybe it's not as bad as I think it is?

lone axle
idle owl
manic glacierBOT
#

iirc my branch that added the descriptor as a property increased binary size by 100ish bytes so it wasn't something to add lightly.

The hack I arrived at was that I could tell the difference between the two descriptors by trying to send an all-zeros report and see which length succeeded. This is OK for keyboards since all-zeros is "no keys pressed". It's probably not a general solution.

ionic elk
#

@slender iron is it ever acceptable to set a PWMIO to a frequency of 0?

#

(it is not ok for ESP32S2 but I'm wondering if this is a think we want to check for in shared bindings)

manic glacierBOT
#

Hi @bsatrom, that chip looks neat! Looks like TinyUSB already has support for it: https://github.com/hathach/tinyusb/tree/master/hw/bsp/stm32l4r5nucleo

Our stm port (in ports/stm) relies on the STM HAL so it shouldn't be too bad to add support within that port. The README includes build instructions: https://github.com/adafruit/circuitpython/tree/main/ports/stm It doesn't look like there is any L4R5 support yet in CP so you'll likely want to mimic an existing board and mirror the chip fami...

#

I would encourage you to check out #3069 and #3192, which is where we discussed adding the F1 series - I laid out the steps required to add a new STM32 family in some detail there, and you can see the commits involved in adding the new family. While we ultimately closed it (the selection dev boards for the high end F1s wasn't great) there are parts of that implementation I'd encourage you to try and re-use, such as the page-based flash implementation.

I've made a number of python utilities...

slender iron
ionic elk
#

@slender iron want me to add a ValueError in Shared Bindings for it?

#

I'm putting through a PR fixing that ESP32 timer leak

manic glacierBOT
manic glacierBOT
ornate breach
#

Is there a possibility that the ESP32-C3 will work with the Native Bluetooth CircuitPython port?

manic glacierBOT
manic glacierBOT
jaunty juniper
wide sail
#

Hi Neradoc. Any response or news about setting the ESP32S2 as an access point? I tried this: https://github.com/adafruit/circuitpython/issues/4246 (see anecdata's post) which seems to work for him but fail for me, on feathers2 (fail with start_ap doesn't exists for radio object, at wifi.radio.start_ap("Bob", "abcd1234")). So I have set the board as STA... but would be much better as AP. Let me know if heard something about that!

GitHub

Implement API to run an Access Point on the S2 instead of connecting to one. Just to track the feature request.

#

PS: Ha ha, didn't realised you actually opened this article...

jaunty juniper
#

are you useing the latest version of Circuitpython ?

wide sail
#

Latest stable, from what I understand. 6.3.0, if I remember well.

#

Yep, just checked: Adafruit CircuitPython 6.3.0 on 2021-06-01; FeatherS2 with ESP32S2

wide sail
jaunty juniper
#

yeah so no, AP mode is in 7

wide sail
#

Oh, goody. Is it stable enough?

jaunty juniper
#

eeeeeeeeeeeeeh you can try it, some things are definitely not stable in it, still a lot of bugs 😦

wide sail
#

Hmm... I don't need much - AP spiting the connected sensors' data through some kind of UDP socket, that's all... I'll try and see how it goes. May post here based on the result. πŸ˜‰

manic glacierBOT
stiff pelican
#

PR incoming

jaunty juniper
#

thanks πŸ™‚

manic glacierBOT
steady thistle
#

Hi all, is the new WebBluetooth feature expected to work on the Feather nRF52840 Express? The latest release from S3 (adafruit-circuitpython-feather_nrf52840_express-en_US-20210714-e7c5165.uf2) does the blue flash but then nothing, almost like it crashes/halts. I scanned for Bluetooth devices with an nRF52 dongle and couldn't see "CIRC". It's also unresponsive over USB-Serial. Short video of the test here: https://www.youtube.com/watch?v=4OcNAR42abc

Quick attempt to use WebBluetooth from the latest Circuitpython build adafruit-circuitpython-feather_nrf52840_express-en_US-20210714-e7c5165.uf2

β–Ά Play video
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.4 on 2021-07-08; Adafruit Metro M4 Express with samd51j19

Code/REPL

import time
import board
from neopixel import NeoPixel

pixel = NeoPixel(board.NEOPIXEL, 1, brightness=0.3)

lightshow = [0xFF0000, 0xCCCC00, 0x00CC00, 0xCCCC00]
step = 0
while True:
    pixel[0] = lightshow[step % len(lightshow)]
    time.sleep(0.1)
    step += 1

Behavior

Traceback (most recent call l...
#

I want to implement FTP on IOTS2 module through circulePython.
Because OTA updates the underlying firmware, I can't update the main code of code.py, which bothers me a lot.

I believe #3454 might allow what you want to do, by uploading the file to the board, then resetting to run a script that replaces the old code.py with the new one and reset again to run the new code.py from then on. You have to make the drive writable too, that's covered in [the learn guides](https://learn.adaf...

slender iron
crimson ferry
#

@wide sail The AP as the UDP server, with multiple clients? The trick will be to determine the IP addresses of the connected UDP clients at the AP level. As I noted in the PR, the AP is currently fixed at the default IP address 192.168.4.1, and Station clients to that AP seem to get assigned IP addresses incrementing from there by the underlying DHCP on the AP device, but I'd say that could be a bit fragile. But UDP functions like recvfrom_into will reveal the IP.

#

If there are not multiple UDP clients, then I don't think it matters which is the AP and which is the Station, or they could both be Stations, they're just IP devices on the network.

onyx hinge
#

hm, my project was going well but just after I changed my code so that it tries to write to CIRCUITPY from CircuitPython (storage.remount in boot.py) .. it crashes when I construct the camera object, which was working 99% before that (and certainly not hard-reset-crashing before). I'm going to try a fresh flash of CP itself and see if that cures anything.

#

well re-flashing it fixed the problem and now I successfully wrote a jpeg so .. that's nice

manic glacierBOT
solar whale
#

For a discussin in #general-tech Does anyone know if bleio is supported on the RP2040? -- it is not in the default build.

#

nevermind -- yes it is -- _bleio

#

What am I forgetting to do if I get "No adapter available" when I try to usr any of the ble examples with an Airlift -- I have NINA 1.7.1 installed.

latent star
#

Does this wiring look correct for the debug to a second USB? I haven't tried this level of debug before.

slender iron
slender iron
#

its early so there definitely bugs

manic glacierBOT
latent star
slender iron
#

yup

#

you could also use a second circuitpython board

jaunty juniper
severe fjord
#

I'm building CircuitPython for a super-simple custom board I have with an ESP32-S2 Wrover module on it, and I've gotten TinyUF2 built and flashed, and I built the latest CircuitPython from main but when I copy over the .uf2 file I get a series of RGB LED flashes and the CircuitPython drive doesn't show up. Is there something I look into to help debug what I have wrong here? I don't have a JTAG programmer on me, but the LED pattern appears to be Purple -> 4x Yellow -> Purple -> Purple

slender iron
#

with ESP the debug UART is a good thing to read

#

I think the 4x yellow might be the safe mode wait for CP

#

purple is the bootloader I think

severe fjord
#

Gotcha, I can definitely try out reading the UART! I can hook up a UART->USB adapter to these pins that I've defined in my mpconfigboard.h?

#define DEFAULT_UART_BUS_RX (&pin_GPIO44)
#define DEFAULT_UART_BUS_TX (&pin_GPIO43)
#

Or is it a different set of pins? What baud rate should I need?

slender iron
#

its not the default uart pins... its an idf setting

#

and you do a DEBUG=1 build of circuitpython

severe fjord
#

Gotcha, thanks! I'll dig around a bit then! Hopefully it'll be very obvious what's wrong once I can see that debug info

slender iron
severe fjord
#

Ah, perfect, that's super helpful, thanks!

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Ah - I found that 7.0.0 Alpha.4 does actually boot and mount but it took quite a long time -- maybe 20 - 30 seconds after pressing the RESET button



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

Adafruit CircuitPython 7.0.0-alpha.4 on 2021-07-08; Adafruit Feather STM32F405 Express with STM32F405RG
>>> 


also same with newest. build

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

Press any key to enter the REPL. Use ...
minor tangle
#

Question on circuit python and RP2040 Feather. Are there plans to port the alarm library to the RP2040 Feather? I sure could use the functionality that the library provides.

jaunty juniper
manic glacierBOT
jaunty juniper
idle owl
#

@tulip sleet At some point, I'd like to go over the breaking changes situation with you. I have plenty to do in the meantime. I'd like to get Tim spun up on that and info from you is the last piece, I think, before I can start that bit.

slender iron
#

@tulip sleet @onyx hinge I'm at my desk now if we want to go over the 7.0.0 issue list

onyx hinge
#

@slender iron I'm around as well

slender iron
#

(no rush from me)

tulip sleet
#

i am here too. My regular desktop seems to have a thermal problem and I had to roll back to my older computer.

#

@slender iron @onyx hinge ^^

slender iron
#

maybe needs new thermal paste on the cpu?

#

I had one desktop unhappy until I redid the cpu cooler

#

want to do issues now?

tulip sleet
#

sure; eating noodles but can do that in the background

slender iron
#

kk

#

lets video in the amelia earhart channel

tulip sleet
#

@onyx hinge ^^

onyx hinge
#

OK, join you in a moment!

manic glacierBOT
#

With dynamic USB descriptors (#4689) you can do things like this. In my experimentation, I successfully created a descriptor with NKRO which also worked in the BIOS boot menu of a Dell (https://emergent.unpythonic.net/01626210345 & https://emergent.unpythonic.net/01625944378). However, functioning as a boot keyboard (particcularly on macs) is still a problem (#1136).

idle owl
#

I mean we're breaking everything else, might as well break more! πŸ˜„

manic glacierBOT
idle owl
#

I have an appointment at 2pm, I need to drop off.

manic glacierBOT
analog bridge
#

hi @slender iron @tulip sleet @onyx hinge , looks like you are going over the 7.0.0 issues... I had some comments about a couple of those issues, I tried joining in but my mic is acting up so I'll leave my comments on the issue themselves, btw when is 7.0.0 planned to release?

tulip sleet
#

we want to release it "soon", but we have no schedule (we basically never do -- it's done when it's done)

#

we are trying to prune the 7.0.0 issue list to make it clearer what we really need

onyx hinge
#

@slender iron @tulip sleet my internet broke, I'll rejoin when it comes back

tulip sleet
#

i can still hear you fine

storm minnow
manic glacierBOT
crimson ferry
onyx hinge
#

@crimson ferry generally speaking, higher optimization levels are regarded as interfering with the quality of debug information, so esp-idf turns optimization levels down when debug is enabled.

manic glacierBOT
slender iron
#

we're switching to prioritizing bug squashing so we can get it more stable

storm minnow
#

Yeah, I think it's better to know what you need to do and do it rather than try to plan a date and rush to meet deadlines

solar whale
#

just tried to build microbit_v2 but failed with this ```jerryneedell@jerryneedell-ubuntu-macmini:~/projects/circuitpython/ports/nrf$ make BOARD=microbit_v2 -j8
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated

215752 bytes used, 62776 bytes free in flash firmware space out of 278528 bytes (272.0kB).
38528 bytes used, 92544 bytes free in ram for stack and heap out of 131072 bytes (128.0kB).

Create build-microbit_v2/firmware.uf2
python3 ../../tools/uf2/utils/uf2conv.py -f 0xADA52840 -c -o "build-microbit_v2/firmware.uf2" build-microbit_v2/firmware.hex
make: execvp: hexmerge.py: Permission denied
make: *** [Makefile:270: build-microbit_v2/firmware.combined.hex] Error 127
make: *** Waiting for unfinished jobs....
Converting to uf2, output size: 431616, start address: 0x27000
Wrote 431616 bytes to build-microbit_v2/firmware.uf2

slender iron
#

did you install pip install intelhex?

solar whale
#

ah -- no -- will do and retry

#

says I already have it installed

#
Requirement already satisfied: intelhex in /home/jerryneedell/.local/lib/python3.8/site-packages (2.2.1)
slender iron
#

hrm, not sure why you'd get a permission issue

solar whale
#

Actually, did it fail -- or just was it waiting -- the files are there....

slender iron
#

is there a firmware.combined.hex file?

solar whale
#
background.o  common.ld     firmware.bin      firmware.uf2   main.P       sd_mutex.P
background.P  device        firmware.elf      genhdr         nrfx         shared-bindings
bluetooth     extmod        firmware.elf.map  ld_defines.pp  peripherals  shared-module
boards        fatfs_port.o  firmware.hex      lib            py           supervisor
common-hal    fatfs_port.P  firmware.objs     main.o         sd_mutex.o
#

no

onyx hinge
#

@idle owl @tulip sleet I think something like```c
#if CIRCUITPY_PIXELBUF
extern const struct _mp_obj_module_t pixelbuf_module;
#define PIXELBUF_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__pixelbuf),(mp_obj_t)&pixelbuf_module },
{ MP_OBJ_NEW_QSTR(MP_QSTR_adafruit_pixelbuf, ... },
#else
#define PIXELBUF_MODULE
#endif

slender iron
#

that is needed because it'll have the softdevice included

solar whale
#

ok -- I'll look at the makefile and see if I can figure it out.

tulip sleet
storm minnow
#

Personally I consider ASAP to be lacking a schedule, just... When it can be done. But yeah, I think it's better to have loose goals and go with the flow of what's needed. It's not like it needs to be done or someone loses their job!

idle owl
#

@lone axle Shared the spreadsheet with you for breaking changes. We can go over it when we're both available. Simply wanted to get it to you.

tulip sleet
#

"I think I'll make a cake. I have to buy the ingredients, and then mix things up and put them in the oven. I might get interrupted, but I will have a cake eventually."

storm minnow
#

Cake: Soonℒ️

#

And in this case, it's CP7 Flavored :3

ember iris
idle owl
#

Wisdom from Dan.

lone axle
idle owl
manic glacierBOT
#

It is still an issue (as far as I know). I haven't had any time to look at it lately though.

What I do know:

  1. The behavior is what would be expected if the column select command is sent 0 instead of a real value. Verified this by sending 0 on purpose.
  2. The logic analyzer shows the correct value being sent, but the display renders otherwise. I'm not sure why the discrepancy.
  3. I changed the flow at one point to send each column select command byte one by one (ignoring DMA). In that ...
solar whale
#

@slender iron do I have to specify anything other than make BOARD=microbit_v2 ?

tulip sleet
solar whale
#

@tulip sleet Thanks -- but still getting the permission error -- happens on Linux and Mac...

slender iron
#

Try running hexmerge directly

storm minnow
#

So I'm interested in helping with the dev process for CP... but I've never used GitHub, and I'm still pretty new to CP -- should I wait until I'm more familiar with CP before trying to help? Or are there smaller things to be done that I can be helpful and also become more familiar with CP?

slender iron
#

(On my phone)

solar whale
#

OK -- trying to figure out the full command....

tulip sleet
solar whale
#

hmmm -- where is hexmerge??

tulip sleet
#

we have a few "good first issue" issues marked

solar whale
#

ahh erryneedell@solar whaleeedell-ubuntu-macmini:~/projects/circuitpython/ports/nrf/build-microbit_v2-s140$ hexmerge.py bash: /home/jerryneedell/.local/bin/hexmerge.py: Permission denied

tulip sleet
storm minnow
tulip sleet
solar whale
#

no idea

tulip sleet
#

πŸ™‚ how old is it?

stuck elbow
#

someone must have pip-installed it

solar whale
#
-rw-rw-r-- 1 jerryneedell jerryneedell   4542 May 12  2020 hex2dump.py
-rw-rw-r-- 1 jerryneedell jerryneedell   2850 May 12  2020 hexdiff.py
-rw-rw-r-- 1 jerryneedell jerryneedell   3662 May 12  2020 hexinfo.py
-rw-rw-r-- 1 jerryneedell jerryneedell   6207 May 12  2020 hexmerge.py
-```
#

I pip installed intelhex

stuck elbow
#

you got hexed

solar whale
#

re-installed -- mow executable

#

yay! that worked!

#

Now for the really silly question -- how do I get it onto the microbit_v2?

tulip sleet
#

i think it shows up as a drive, and you drag the .hex to it. Kind of like UF2.

solar whale
#

Thanks! I will give it a try tomorrow .... priority interrupt at home πŸ˜‰

idle owl
#

Now the big question is, should the Adafruit pixelbuf Python repo be called Adafruit_CircuitPython_Pixelbuf or Adafruit_CircuitPython_pixelbuf. It won't affect the file name, so it's simply a matter of choice.

tulip sleet
#

or even PixelBuf? I think BusDevice is the example to follow?

idle owl
#

I think it's become a proper noun at this point. So Pixelbuf works.

#

I named my phone after it (it's a Pixel to begin with) but the lady in my headphones tells me they're "Connected to pixel-byoof" and it makes me snicker every time. Not as much as her saying they're connected to "Robo-creep" (My computer is called Robocrepe. She doesn't know French apparently.)

stuck elbow
#

@idle owl would it be pronounced better if you added one more f at the end?

onyx hinge
#

byooff?

stuck elbow
#

btw, I name my computers by computer constructs from fiction, and my work computer is called murderbot, which has led to some weird looks already

onyx hinge
#

Entertaining series of books, the ones with "murderbot". I was put off by the name, but glad I tried it anyway.

stuck elbow
#

yeah, it's a self-deprecating name

onyx hinge
#

that's a good way to put it without too much spoiler

#

It's not their goal

storm minnow
#

My current main workstation is Rocinante

onyx hinge
#

watching a fictional TV show is their goal

stuck elbow
#

my other computers are ghostwheel and wintermute

#

and owl

storm minnow
#

All of my machine names are from media [except a few test things, lol]

manic glacierBOT
#

The Cucumber boards are basically Saola boards, with different form factor, an LED, and second USB-C connector (and sensors on the "S" versions). Saola firmware runs just fine on these boards.

In this PR, are we doing 1 board (R/RS), 2 boards (R and RS, or M/MS and R/RS), or all 4 boards (M, MS, R , RS)?

If R & RS are combined, I think it's OK as is to define SDA and SCL, but not I2C, though on the R version, it's just Gravitech's color coding and compatibility with the RS version...

idle owl
#

@tulip sleet Hah, joke's on me - the class in adafruit_pypixelbuf is called PixelBuf.

#

Β―_(ツ)_/Β―

#

The simpletest is kind of gnarly in Pypixelbuf. But there's really not a good way to test that lib alone. Most folks aren't using it directly. Haven't heard anything bad about it, so I'm not going to think to hard about it.

manic glacierBOT
#

Are there any other Adafruit pin naming conventions (like board.LED) we should add extra pin names for in board? Saola is bare-bones pins.c, only IO pins, RX/TX, and NEOPIXEL.

If there is a single-color LED, definitely add board.LED. In general we try to make the pin names correspond to the board silkscreen names. It is not necessary to add board.TX, etc., if they are not labeled as such.

Should we try to normalize pin naming longer-term across all ESP32-S2 boards?
...

idle owl
#

I thought I misread that as Cucumber, but no it was not a misread.

#

Ok, I need to test it, but I think the adafruit_pixelbuf Python implementation is ready to go.

manic glacierBOT
idle owl
#

Tested on Trinket. Works.

#

Tested on QT Py for NeoPixel. Trinket is DotStar. Both work.

#

@tulip sleet The Python side of things is in place and ready to deploy. I'll look at the CircuitPython side of things now and tomorrow. Is that quickly enough to ensure it ends up in alpha.5?

manic glacierBOT
#

@tannewt - let's not merge this yet. I'll see if I can get things to have
more consistent timing.

On Thu, Jul 15, 2021 at 2:37 PM dmcomm @.***> wrote:

I propose making the minimum pulse time a whole PWM cycle instead of half.

β€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/pull/4964#issuecomment-880961042,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I did two definitions, for the M variants and the R variants.

@skieast can you commit the M/MS version? Are there material differences besides in ports/esp32s2/boards/gravitech_cucumber_*/sdkconfig?

I don't have an M board to test so my version for that board is theoretical.
The only changes should be in sdkconfig, mpconfigboard.c (MICROPY_HW_BOARD_NAME), mpconfigboard.mk (USB_PID and USB_PRODUCT). As I can't test this board I would not commit my initial changes

manic glacierBOT
manic glacierBOT
#

@dmcomm - I agree with your proposal; I changed the minimum pulse to be a whole PWM cycle and it helps. Also, I'm not sure if your excellent test scripts are just to show a condition; but if you want more accurate pulseout timings on the RP2040 you should consider changing the PWM duty_cycle value to 65535. That helps the pulse consistency, particularly for shorter pulses. @tannewt I think we can merge this one now.

manic glacierBOT
#

CircuitPython version

7.0.0-alpha.4 on Tiny2040

Code/REPL

import board
import busio
import displayio
import digitalio
from adafruit_st7789 import ST7789
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
import usb_midi
import adafruit_midi
from adafruit_midi.note_on          import NoteOn
from adafruit_midi.note_off         import NoteOff

#  if you want to use this as an HID keyboard, set keyboa...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
solar whale
#

I am trying to checkout the MicrBit V2 build, but I am very confused about how to actually access it. Are there instructions anywhere for using it? I have it loaded on the board and but I just can't make much progress via code.circuitpython.org.

solar whale
#

I get this far using the USB connection, but not sure what to do next...

manic glacierBOT
manic glacierBOT
turbid radish
idle owl
#

@tulip sleet Good morning. I'm going to proceed with the _pixelbuf rename. I will definitely need some help. I talked briefly with Jeff about it yesterday, so at least one question is essentially answered, but there will certainly be more.

#

Already have one.

#

@tulip sleet Let me know when you're available.

manic glacierBOT
#

I would be happy to help with testing this build, but I am completely baffled about how to use the board.
I have occasionally managed to get the serial device to spit out the CP version info (see screenshot), but nothing else. I can see the CIRCPY BLE device but have made no progress connecting to it.
Should I be able to get to the REPL via something like screen? I can connect, but get no responses....
Clearly, I am missing something. Are there any instructions for using code.circuitpython...

solar whale
idle owl
#

Hmm. I might have done it.

#
>>> import adafruit_pixelbuf
>>> dir(adafruit_pixelbuf)
['__class__', '__name__', 'PixelBuf']
>>>```
tulip sleet
#

That looks good. Suppose you import _pixelbuf

idle owl
#
>>> dir(_pixelbuf)
['__class__', '__name__', 'PixelBuf']```
#

This is what it looks like: #if CIRCUITPY_PIXELBUF extern const struct _mp_obj_module_t pixelbuf_module; #define PIXELBUF_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_adafruit_pixelbuf),(mp_obj_t)&pixelbuf_module },\ { MP_OBJ_NEW_QSTR(MP_QSTR__pixelbuf),(mp_obj_t)&pixelbuf_module }, #else #define PIXELBUF_MODULE #endif

#

I presume we delete the fourth line once 7 is released stable?

tulip sleet
#

I think we would delete it in 8

idle owl
#

I didn't change the references to CIRCUITPY_PIXELBUF because CIRCUITPY_BUSDEVICE is how that was done.....

tulip sleet
#

so, yes, when main becomes 8.0.0 dev branch

idle owl
#

I guess I can PR what I did and you can tell me if I missed things?

tulip sleet
#

that made sense to me; CIRCUITPY_ADAFRUIT_PIXELBUF was too long.

#

did you edit the doc string in shared-bindings to change the class name? You might add a note that it's also available as _pixelbuf, but that's deprecated.

idle owl
#

I did not change the class name. Let me check what I did there.

#

There's nothing there to change. I didn't change the class name. Should I have?

#

That would change a lot more that I would need help with because I don't follow what C is doing with "classes".

tulip sleet
#

you need to change __init__.c; that's where the module name is. The class name is the same; it's the module name that's changing

idle owl
#

Oh. I missed that instance of it.

#

Thanks. Fixing now.

tulip sleet
#

i wonder about the TODO there

jaunty juniper
manic glacierBOT
idle owl
#

Works on CPX. Circuit Playground Library no longer works on CPX. lol.

#

@tulip sleet Oi. The import block in NeoPixel and DotStar gets uglier for the time being. py try: import adafruit_pixelbuf except ImportError: try: import _pixelbuf as adafruit_pixelbuf except ImportError: import adafruit_pypixelbuf as adafruit_pixelbuf

#

Unless I'm missing something to maintain compatibility for now.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.4 on 2021-07-08; Adafruit CircuitPlayground Express with samd21g18

Code/REPL

import adafruit_circuitplayground.express

Behavior

main.py output:
Traceback (most recent call last):
File "main.py", line 1, in
File "adafruit_circuitplayground/init.py", line 12, in
File "adafruit_circuitplayground/express.py", line 31, in
File "adafruit_circuitplayground/circuit_playground_ba...

idle owl
#

Hah. Literally just found this out ^^

#

I need to redo the library to not use gamepad. I'm uncertain how to do that since the point of the gamepad usage in it is to track "were pressed" for the buttons.

idle owl
#

Hold on, trying something.

tulip sleet
#

I was going to write a tiny library for were_pressed kinds of things.

#

the problem is that gamepad takes DigitalInOut's but keypad takes pins, so there is a use conflict for .button_a and keypad, for instance. But this is not hard to re-code

#

Let me write the little helper code. I was thinking about it last night.

idle owl
#

Ok.

#

Thanks.

#

Because this is something we need to fix ASAP.

#

heh

#

Whatever I did is running in safe mode. πŸ˜„

manic glacierBOT
idle owl
#

Now it came up. "Expected a Pin". So that didn't work.

#

Oh I see what you mean.

#

Pin in use now.

tidal kiln
#

@idle owl hey. got library / bundle question if you have time.

tidal kiln
idle owl
#

Hmm.

#

What's different?

#

So I know what I'm looking for here.

tidal kiln
#

there's more code in the bundle version

idle owl
#

"more code"? More files? More in specific files?

tidal kiln
#

the uart.py file in the bundle has this:

class BNO08X_UART(BNO08X):
    """Library for the BNO08x IMUs from Hillcrest Laboratories

    :param uart: The UART device the BNO08x is connected to.
    :param ~digitalio.DigitalInOut reset: The pin object to reset
    :param bool debug: Enables print statements used for debugging. Defaults to `False`

and a ton more lines of documentation

tulip sleet
#

is this a master vs main issue?

tidal kiln
#

yah. i'm wondering same.

#

it was renamed

#

or moved, etc.

idle owl
#

The latest release has the extra docs.

#

I think it needs a new release?

#

wait

tidal kiln
#

but it's like the repo code is behind

idle owl
#

yeah it does.

#

Master was deleted. And I think took that code with it: "This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository." is what it says when you view the commit for the latest release.

tulip sleet
#

PR #23 was merged into master

idle owl
#

Yeah PR 23 needs to be recreated.

#

Dylan thought she caught all of those that happened with.

#

But apparently this one slipped through.

tidal kiln
#

ok, so a known hiccup that can happen with the branch move?

idle owl
#

Yeah if PRs were open, and they weren't manually updated to be merged into main, then they could be merged into master still.

#

also, a weird thing where they sometimes autoclosed, but that's not this.

tidal kiln
#

need any more info from me?

idle owl
#

File an issue and assign it to Dylan please.

tidal kiln
#

in that repo?

idle owl
#

On the repo.

#

Yeah.

tidal kiln
#

w3rd

idle owl
#

With a link to that commit. And a quick explanation.

#

Thanks!

tidal kiln
#

done

idle owl
#

Cheers.

manic glacierBOT
slender iron
#

@solar whale what OS were you using chrome on?

solar whale
#

macOS and chrome book

slender iron
#

I've gotten it to work on macos

#

the first step to debugging is opening the web developer tools to see the javascript console output

solar whale
#

Ok. Should screen work to get to the REPL via USB?

slender iron
#

yes but its actually through the uart

#

I was debating leaving that on. I suspect I should turn it off soon to reduce confusion

solar whale
#

Ah so do I need a uart to usb converter connection

slender iron
#

no, the microbit has an interface chip on it

#

just explaining why its a ble-only board

solar whale
#

Hmm, I connect but no response in screen

slender iron
#

did you try ctrl-c?