#circuitpython-dev

1 messages · Page 22 of 1

idle owl
#

I'd prefer latest for now. But I understand if other folks want to make a case for pinning.

lone axle
#

They have alluded to potentially being able to disable the pre oct2020 behavior on their end. If it's an option maybe it'd be nice to have them switch all of the older projects over to use the newer behavior that way it's level across the board for us.

idle owl
#

Because we have a significant number of projects that will need it. 🙂

#

I'll check Jeff's list to get a number, as well as being able to provide it to them if they are willing.

lone axle
#

The greater-than does seem successful. I put sphinx-rtd-theme>=1.0.0 and checked the build logs, it did download 1.1.1 which is the newest non-rc build.

idle owl
#

Good to know. Keep an eye on the issue, and we can decide what to do once that's sorted.

idle owl
slender iron
#

@tulip sleet @onyx hinge I'm around a bit while ari naps. Need anything from me?

tulip sleet
slender iron
#

not that I know of. I know I have a few still assigned to me that I will hopefully get to later this week

tulip sleet
#

I may wait until later in the week to get more fixes in. I can reconsider on Wednesday or so.

slender iron
#

kk. I hope to check in like this when I have a chance

tulip sleet
#

i will keep any q's in mind

slender iron
#

you can email or ping me and I'll get back when I can

manic glacierBOT
#

No. I've had an SSD1309 OLED 128×64 display running for a week without issue. I did have to modify my program to fit the smaller size.

I've also been able to get reliable results from the original SSD1322 OLED 256x64 display by performing garbage collection on every loop and automatically soft rebooting the QT PY once a day. Since implementing these changes I've yet to see the dots appear.

One thing different about my SSSD1322 display is that it requires colstart=112 on initializatio...

#

CircuitPython version

Adafruit Circuitpython v8.0.0-beta.6;
Adafruit Circuitpython 20230106-037bfb3;

Code/REPL

N/A

Behavior

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371

Description

Clean tinypico with
esptool.exe --chip esp32 --port COM9 erase_flash

then flash circuitpython via
esptool.exe --chip esp32 --port COM9 write_flash -z 0x1000 ..\adafruit-circuitpython-unexpec...

slender iron
#

@night tundra this is the best place for help getting a board going

manic glacierBOT
#

looking at the output for esptool.exe it is just a wrapper for the python script for windows

.\esptool.exe --chip esp32 --port COM9 write_flash -z 0x1000 ..\tinypico-20220618-v1.19.1.bin
esptool.py v4.4

Just in case though i did install esptool from pip and ran that with the 0x0000 and that seems to be working so it might of just been the 0x1000 vs 0x0000 difference.

I am able to connect via putty serial and hello world completes but i do not see the circuitpy drive, according t...

#

I am able to connect via putty serial and hello world completes but i do not see the circuitpy drive, according to the cricuitpython getting started that should appear once connected

The TinyPico is a plain ESP32, which does not have native USB, so it cannot present a CIRCUITPY drive. You'll have to use Thonny or similar to load files onto it. The REPL is via the USB-serial converter cip.

languid whale
#

Anything new on the esp32s3 ble front?

manic glacierBOT
slender iron
#

I'll need to circle back on it soon

manic glacierBOT
manic glacierBOT
#

Describe my specific problem.
The esp32 c3 initially generates enough voltage to turn on the LED( with 1kΩ resistor ). This does not change when running
pulsein = pulseio.PulseIn(board.D0, maxlen=600, idle_state=True).
Running
ir_led_pulse = pulseio.PulseOut(board.D1, duty_cycle=21845, frequency=38000)
turned off the led.After this.
run
ir_led_pulse.deinit()
the led will light up.
ir_led_pulse is working but pulsein is not.

I don't have a way to see the waveforms, so I can't t...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.6 on 2022-12-21; Adafruit Feather ESP32 V2 with ESP32
Board ID:adafruit_feather_esp32_v2
UID:8EF9D6427042

Code/REPL

# ------------------------------------------------------------------------------------------
# Example:
# Success reading DS18X20 sensors on Feather RP2040(s)
# *** Failure reading all DS18X20 sensors on Feather ESP32-V2(s) ***
#    -I've tested two of each model Feather (RP2040 & E...
manic glacierBOT
manic glacierBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Fixes #7238, but does a lot more also.

  • Per @jepler's suggestion, expands %q must be of type %q to %q must be of type %q, not %q.
  • Adds a new validator for objects in a collection: object in %q must be %q, not %q. Used a lot for pin lists.
  • Adds arg_name to a lot of pin validation routines.
  • Adds arg_name to SPI bus validation routine.
  • Adds arg_name to cp_enum_value to use when validati...
manic glacierBOT
manic glacierBOT
proven garnet
#

GitHub now has organization-wide required workflows in public beta! Could be interesting to see how we could use it and if it even makes sense. Could take some of the burden off of some of the cookiecutter and/or composite actions.

#

I'll look into it and share next week, but saw that on their roadmap a while ago, glad it's in beta.

onyx hinge
#

hum it looks like pico-w may not be able to connect to an open network

manic glacierBOT
tulip sleet
onyx hinge
#

right

#

@tulip sleet can you drop a pointer to that issue in the forum?

tulip sleet
onyx hinge
#

oh -- there was a forum thread about it

tulip sleet
#

also? I didn't see that

#

i don't see such a thread

onyx hinge
#

limor called our attention to it in an email last night late

#

that's why I saw it

tulip sleet
#

i didn't get to that email yet, sure, I have met JohnG in person and gone to an event for a class he teaches at Boston College

#

replied and moved thread to CIrcuitPython subforum

manic glacierBOT
onyx hinge
#

thank you!

tulip sleet
onyx hinge
#

arg yes thank you

tulip sleet
manic glacierBOT
#

Hi,

We're working on a new RP2040 board at Pimoroni, that makes use of two IO expander chips (TCA9555) to offer more pins than the typical 30 (there's a good reason for this that'll remain a secret for now). The board is a good while away still, but I wanted raise this draft PR now to start discussions with the CPy team about the direction I'm going in.

Inspired by the support added for the Pico W's LED (https://github.com/adafruit/circuitpython/pull/6933), I am hoping I can do similar ...

manic glacierBOT
#

For your use case, is it necessary that these appear as genuine digitalio.DigitalInOut objects, or could you implement them in Python and duck-type them to look like DigitalInOuts?

I would say that the CYW43 pin stuff was done the way it was due to the idiosyncrasies of these pass-through pins and their use cases.

I am not sure we would want to expand on that style for I/O expanders in general. If we wanted a more general solution, generalizing either microcontroller.Pin or `Digi...

onyx hinge
#

seems like github is having a bad day today

manic glacierBOT
#

Thanks for the quick reply.

The main thing that took me down this path was that a few of the expander pins are intended for (slowly) controlling the secondary lines of SPI displays (CS, DC). I managed to cobble some python code together for testing, but had to do it without the usual SPI display classes as they require Pin objects. These classes could be hacked to support an IOExpander object I suppose, but having them accept a pin as normal seemed far easier and cleaner for the user.

...

onyx hinge
#

I seem to get this in the full web ui even if I can write CIRCUITPY from Python: Warning: File System is in read only mode. Disable the USB drive to allow write access.

#
storage.remount("/", False)
```this is not enough?
tulip sleet
tulip sleet
#

are you seeing that message in the browser?

onyx hinge
#

same with the non-full UI, werid

wraith crow
#

It seems like the web workflow needs the drive disconnected regardless of the remount setting

#

dismounted....

#

from the host I mean 🙂

onyx hinge
#

is that how it should be, or how it is?

jaunty juniper
#

the web workflow tests for USB mounted, doesn't care about read/write mode

#

(it's not writing "from python")

tulip sleet
#

if the web workflow changes files out from under a mounted drive, then the user looking at CIRCUITPY via USB will be seeing stale data. So that's a reason not to do allow that.

onyx hinge
#

I suppose, CircuitPython has been designed so that it copes OK with the filesystem changing out from under it, but PCs haven't been

idle owl
#

Spudgers.

manic glacierBOT
jaunty juniper
#

has anyone made a spudger spudger spudger spudger song ?

manic glacierBOT
slender iron
# onyx hinge is that how it should be, or how it is?

I don't think it should be that way. The point of changing that mount status is to change the filesystem regardless of the connected host OS. Its a bug on my part because I tested it by disabling the drive all together.

jaunty juniper
#

I feel like it would be more confusing, but to be fair the point of making the drive writeable is already to modify it (from python) even if it's mounted, host OS data synced or not

manic glacierBOT
#

I'm ok adding additional pin types like the CYW43 code does. This makes them available to CP when the VM may not be running. If its only needed by user code in the VM, then I'd push more to make it Python-only.

I wouldn't add it to microcontroller.pin though. That's a lie. :-) If you want to expose them directly then you could expose the expander class through board. Kind of like the built in display.

proven garnet
#

I'm looking into the possibility of using mypy withipre-commit, and I seem to have a memory of there potentially being downsides to using stub files (.pyi) but can't find anything by searching Discord. Is that correct, and if so, what was it? If there aren't any, it may be worth bringing it up in the weeds as typing continues and gets closer to being completed.

manic glacierBOT
manic glacierBOT
#

As an evolution of a use case, this is probably similar to other audio requests...

I will be honest in that this may be ambitious for Python on an an S3, though my hunch now is that it could work. That S3 hums along....

The idea is to take in audio, encode it into a
smaller byte stream, and connect to a gateway on the internet. It's ham radio over internet in this case.

The internet side already exists with hundreds of thousands of users. ( android example included...)

Bei...

manic glacierBOT
#

This, I would say, is a bug and is not consistent with the documentation. Until it is fixed, there should be a note to that effect in the documentation with a work-around, but then that will cause the user's code to fail when the bug is fixed.

If there are, e.g. 3 entries in the FIFO, and they are to be read into an array of uint32, starting at element 1,

dest = array.array('L', [99]*10)
wordsize=4
sm.readinto(dest, start=1*wordsize, end=(1+sm.in_waiting)*wordsize)

is the w...

manic glacierBOT
#

You definatly do not need two cores to stream audio over the Internet. It can be done using cooperative multitasking. The Python asyncio package on one core would work, assuming the one core is fast enough. With audio streaming you trade latency for glitches. Each end has a buffer of audio samples queued up so if a task is blocked for less than the length of the buffer the sound is still OK.

User interface don't have to block, they are usually callback based. You do need a fast ...

manic glacierBOT
#

@chrisalbertson We are not able to do realtime audio processing and perform internet connection at the same time on a single core because fixed resources required to record and encode audio and fill the transmission buffer and that’s impossible to add unpredictably long network operations on the same core. DMA allows to output the prepared buffer but for network transmission we need to have a second core.

manic glacierBOT
#

We've been porting a new board to CP following these instructions: https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython

We rebuilt and flashed CP for an existing board (the ESP32S3 Feather with 4mb flash 2mb psram) and verified that it worked fine, but now that we're porting to our own board (that uses ESP32S3 8mb flash / 8mb psram) we're seeing a bootloop early in the boot process, e.g.:

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x28 ...
manic glacierBOT
orchid basinBOT
manic glacierBOT
#

Thanks for working on this. Should we set this as a draft for now, since you're still tuning it?

I am still interested in using partial clones, either treeless or blobless. They transparently appear to contain the entire commit history but don't fetch everything. Fetches are done on demand, as necessary. I think it may eliminate the depth calculations, and perhaps remove the need to do github API calls, because the info is all local (not sure about that).

Have you looked at https://gith...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
slender iron
#

it changes start= and end= behavior to account for the element size of the given buffer

tulip sleet
manic glacierBOT
#

First of all I believe it would be best to 'by-default' prohibit overclocking.
A typo could be very problematic..
One extra digit is all it takes for the rp2040 to become a potato chip.
Ideally an cpu.safety/cpu.overclock/cpu.cook_mah_pi kind of property should be made available.

I think it's good to try to implement this so that all the modules are ready for any future rp2 chips with different frequencies.

Also, @Lanzaa, to fix the pre-commit check run `pip install pre-commit ...

#

I did not mean dual core is not helpful, just that logically it is not required if the single core is fast enough.

I have an application running now where I use both core of the RP2040. The same code also runs on the dual core ESP32. I am evaluating which is best.

When I found that circuitpython did not allow use of the second core, I switched to micropython.

If transcoding on the RP2040 is slow, try an ESP32. The ES32 is a little fastr and it has hardware floating point so it ...

manic glacierBOT
manic glacierBOT
orchid basinBOT
slender iron
#

@tulip sleet were you going to look at 7431?

manic glacierBOT
tulip sleet
manic glacierBOT
#

Summary: Reading into arrays of 16,32 bit values with start=, end= arguments works. Reading into slices of arrays doesn't.

There is also a regression in that the rp2pio.StateMachine() pin arguments: first_{out,in,set,sideside}_pin and jmp_pin are no longer accepted, and must be specified as a Pin. (Of type Pin, rejecting int pin numbers as well).

TypeError: first_set_pin must be of type Pin, not NoneType

Details:
For the test for reading 3 FIFO entries i...

slender iron
#

@tulip sleet I looked briefly today and got a stack overflow error on the socket select task. Not sure when I added it but it seems like something I did relatively recently

tulip sleet
slender iron
#

I’ve gotta follow up on the prs I did today. I suspect you’ll end up on one my prs at the end of the bisect

manic glacierBOT
#
Adafruit CircuitPython 8.0.0-beta.6-36-gc93d6d5e6 on 2023-01-12; Adafruit QT Py ESP32S2 with ESP32S2

🟢 ESP32-S2 (QT Py) - Web Workflow ENABLED

Code from #7326 runs, and finds other CircuitPython mDNS devices

🔴 ESP32-S2 (QT Py) - Web Workflow NOT ENABLED

Code from #7326 starts to run, but board enters Safe Mode early, timing doesn't seem exactly consistent:

[tio 21:16:34] Connected
=========================
Starting mDNS server...
Connecting to wifi AP... IPv4=19...
tulip sleet
#

i'll try to reproduce and then bisect and then ask you if the cause seems mysterious

manic glacierBOT
#

Went back to a recent pre-PR version and re-verified that:
Adafruit CircuitPython 8.0.0-beta.6-25-gbb3a1c0a2 on 2023-01-04; Adafruit QT Py ESP32S2 with ESP32S2
will find mDNS devices whether Web Workflow is enabled or not.

Similarly:
Adafruit CircuitPython 8.0.0-beta.6-25-gbb3a1c0a2 on 2023-01-04; Raspberry Pi Pico W with rp2040
will find mDNS devices when Web Workflow is not enabled.

slender iron
#

@tulip sleet kk. I did manage to reproduce it today. The stack overflow happened after a keyboard interrupt exception was printed

manic glacierBOT
#

I've cleared/passed the error. I think it was due to initializing an empty
array. As my temporary workaround I pre-allocated an array of zeros.

ulab.numpy.array() #caused error
ulab.numpy.array([]) # caused soft boot from fatal crash.
ulab.numpy.array((0,0,0)) # is my workaround.

Haven't got the time to do beta 8x.

On Wed, 11 Jan 2023 at 21:08, Dan Halbert @.***> wrote:

Thanks. Could you try the 8.0.0-beta.6 build here:
https://circuitpython.org/board/feather_stm32f405_express/ ...

manic glacierBOT
#

I am not sure what you're trying to do with the concatenate(). You have:

big_array=np.concatenate((sensor.acceleration), axis=1)

sensor.acceleration is a 3-tuple, like (2.0, 4.0, 6.0). np.concatenate() takes a sequence of arrays as its first argument, but you passed it a sequence of scalars. In desktop Python, the above causes this error:

>>> np.concatenate((2.0,4.0,6.0), axis=1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<__arr...
manic glacierBOT
#

I've cleared/passed the error. I think it was due to initializing an empty array. As my temporary workaround I pre-allocated an array of zeros.

ulab.numpy.array() #caused error 
ulab.numpy.array([]) # caused soft boot from fatal crash. 
ulab.numpy.array((0,0,0)) # is my workaround.

@teejay0909 It's not quite clear to me, whether these errors are really errors, or part of the bug report on the concatenate function. In any case, if there is anything that bugs you (pun...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.6 on 2022-12-21; Adafruit QT Py ESP32S2 with ESP32S2

Code/REPL

import time
import traceback

import alarm
import supervisor


def main():
    print("Sleeping for 10 seconds")
    time.sleep(10)

    sleep_period = 15
    time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + sleep_period)
    print(f"Entering deep sleep for {sleep_period} seconds")
    alarm.exit_and_deep_sle...
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.6 on 2022-12-21; Adafruit QT Py ESP32S2 with ESP32S2

Code/REPL

import wifi
import supervisor
import time
import traceback
from secrets import secrets

try:
    wifi.radio.connect(secrets["ssid"], secrets["password"], timeout=10)

    # send some data to MQTT broker here, not sure if this matters
except Exception:
    print("Code stopped by unhandled exception:")
    print(traceback.format_e...
manic glacierBOT
#

CircuitPython version

I can write to the 4MB of flash from begininnig to end without a failure (tested with a small .bin from /dev/urandom and verify_flash)
After powercycle i can read it out correctly.
After erase_flash i can read 4MB of 0xff correctly.
After flashing tinyuf2 bootloader i can correctly read all 4 MB back.

Than i install circuitpython 8.0-beta6 (or any other version from 7.1 up)
than executes and works as expected.

But now i can not read the flash any...
manic glacierBOT
manic glacierBOT
#

@v923z I can reproduce something funky when passing a wrong-type argument to ulab's concatenate. Instead of a proper exception, it cuases a segmentation fault on Unix (which would typically be a hardfault on hardware):

$ ./ports/unix/micropython-coverage 
MicroPython 8.0.0-beta.6-20-gcc16bd3d53-dirty on 2023-01-04; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> import ulab.numpy as np
>>> np.concatenate((0,0,0), axis=1)
Segmentation fault

Debugger says

...
manic glacierBOT
manic glacierBOT
#

I got a little further :)

I made a few more changes to board config and can now get CIRCUITPY to appear if I flash circuitpython-firmware.bin from my build. The serial output is this though:

Auto-reload is off.
Running in safe mode! Not running saved code.

You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Crash into the HardFault_Handler.
Please file...
#

This issue also seems to block any deep sleep efforts which is my main concern.

I have a design for a small display that Mandalorian cosplayers use in their gauntlets. I am trying to add a feature where you can put the system into deep sleep and wake it up with a button press later.

The problem that I am having is that once I make the alarm call to put the system to sleep (and I turn off the backlight) the system shows the console and more importantly it turns on the backlight to 100%...

slender iron
#

@tulip sleet at my desk now while Ari naps if you need anything

tulip sleet
slender iron
#

kk, I'm getting through my email and then getting back to the PRs I made yesterday

tulip sleet
#

could you just upload or paste your reproduction program?

slender iron
tulip sleet
#

#7431 uses httpserver but want to see if that is necessry

slender iron
#

I did it with httpserver

#

its whats in the issue with some setup that was omitted

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.6 on 2022-12-21; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3
Board ID:adafruit_feather_esp32s3_4mbflash_2mbpsram

Code/REPL

displayio.OnDiskBitmap("compressed.bmp")

Behavior

The system displays an image, but it is corrupted and looks like it is not using the proper scan line width or something. I see the right colors, but displayed incorrectly

Description

I have tried mak...

slender iron
#

@tulip sleet is it reading flash after CP runs? could be flash chip config

tulip sleet
manic glacierBOT
slender iron
#

cool cool #notmyproblem

manic glacierBOT
#

I went ahead and added the code and hit another issue. I passed in the I/O pin to the display manager and let it control the backlight level:

ST7789(display_bus, rotation=270, width=240, height=135, rowstart=40, colstart=53, auto_refresh=False, backlight_pin=board.D10, brightness=0)

When I try to put the system into deep sleep I get and error that the I/O pin is in use:

alarm.exit_and_deep_sleep_until_alarms(time_alarm, preserve_dios=[digitalio.DigitalInOut(board.D10)])

Traceback ...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
tulip sleet
#

@slender iron I have some socket q's now, if you have any time

slender iron
#

@tulip sleet yup!

tulip sleet
#

aud or vid is fine

#

it

#

it's about blocking and timeouts

slender iron
#

I'm in the marie curie channel

manic glacierBOT
#

Thank you for the thorough testing!

Summary: Reading into arrays of 16,32 bit values with start=, end= arguments works. Reading into slices of arrays doesn't.

Slices of arrays are copies. In order to pre-slice it, you'll need to wrap the array in a memoryview(), which will ignore the type iirc.

There is also a regression in that the rp2pio.StateMachine() pin arguments: first_{out,in,set,sideside}_pin and jmp_pin are no longer accepted, and must be specified as a `Pi...

manic glacierBOT
manic glacierBOT
#

Adafruit CircuitPython 8.0.0-beta.6-25-gbb3a1c0a2 on 2023-01-04; Raspberry Pi Pico W with rp2040

>>> (-1).to_bytes(1, 'big', signed=True)
b'\xff'
>>> int.from_bytes(b'\xff', 'big', signed=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NotImplementedError: signed=True
>>> int.from_bytes(b'\xff', 'big')
255

"[// TODO: Support signed param (assumes signed=False at the moment)](https://github.com/adafruit/circuitpython/blob/72f4a8ebbc67a40e01...

orchid basinBOT
manic glacierBOT
#

While I know this issue was closed several months ago, I am having this exact same problem.

In my case, I am using a Feather RP2040 running CircuitPython 7.3.3, and using a Prop-Maker feather as my amplifier. I have downloaded the stereo.mp3 file that folks in this thread say works for them, and it has a lot of static for me. My code is pretty generic:

`import board
import audiomp3
import audiopwmio
import digitalio

audio = audiopwmio.PWMAudioOut(board.A0)

enable = digitali...

spiral elk
#

@analog bridge Does gpio11 actually function properly on your C3 board in circuitpython?

#

I noticed you didn't have anything in your board.c to take it out of the default vdd_spi mode and change it to alt gpio mode.

analog bridge
spiral elk
#

I was going through all the c3 boards and looking for ones with gpio11 defined, as its an odd pin, not gpio by default.

#

I kind of suspect that its not functional on any of the boards that have it broken out either, as none have any mode setting in board.c

manic glacierBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Ah, I seem to have peeled another layer off the onion! This looks more interesting:

I (421) esp_image: segment 4: paddr=00173118 vaddr=40378434 size=14150h ( 82256) load
I (440) esp_image: segment 5: paddr=00187270 vaddr=600fe000 size=0002ch (    44) load
I (440) esp_image: segment 6: paddr=001872a4 vaddr=600fe030 size=01010h (  4112) load
I (456) boot: Loaded app from partition at offset 0x10000
I (457) boot: Disabling RNG early entropy source...
I (469) opi psram: vendor id : 0x0...
candid granite
#

Hi, I’m not sure if there is something I could do. I had a PR in blinka which was left to die without any comments for more than a year. A month ago, another user needed the same functionality and made an improved version on my PR (https://github.com/adafruit/Adafruit_Blinka/pull/637). However it also didn’t get any feedback. I’m afraid it will also be left to rot and I feel it’s a shame because it’s really useful.

slender iron
#

@tidal kiln ☝️

#

@candid granite this is a good place to ask about it. Please don't assume we're mal-intent on our part though. Its tough to keep up with all of the PRs

manic glacierBOT
manic glacierBOT
candid granite
orchid basinBOT
manic glacierBOT
#

Thank you for the tip. Will this be available on the Feather? I'm using the Feather M4 Express as well as the ESP32S3. Unfortunately, it looks like preserving the I/O on those boards is not yet available, but I'll put the code in anyway and see what happens.

Limitations: preserve_dios is currently only available on Espressif according to the docs

I don't know of anyone adding preserve pin support to the SAMD51 (aka M4). Generally its deep sleep support is less refined.

slender iron
#

@lone axle any android code editor suggestions?

lone axle
#

It's definitely more on the fully feature IDE side of things though. I'm not sure what options are available that are closer to basic text editor.

orchid basinBOT
slender iron
#

@lone axle on a device? I'm thinking to edit CP code over BLE

#

or wifi

lone axle
#

Oh, I see. That Glider app is the only one I'm aware of for BLE editing. Web workflow should theoretically work from a mobile browser on Android, I'm pretty sure I did the most basic test of that from my phone at one point, nothing super fancy though.

slender iron
#

glider should be making the files available to other apps too

lone axle
#

On my current phone I can actually connect via USB with an OTG cable and edit code.py from that app as well. (older Android didn't support the right filesystem type I think)

manic glacierBOT
manic glacierBOT
#

I've progressed down the CYW43 Pin approach, and am honestly rather happy with the user experience! Having the pins for LEDs and buttons just being accessed using board.LED_A and board.USER_SW for example, feels quite magical. I even updated displayio.FourWire to support these expander pins for DC and CS, and although slow, seeing the REPL on screen using the usual example code was rather exciting!

Newest code added to this PR if anyone wants to look. I also tried a technique in `boa...

orchid basinBOT
manic glacierBOT
#

Must be getting closer :)
I rebuilt without the DEBUG flag and now I get a drive appearing, though it is empty and labelled "6MB Volume".
On serial I'm back to the Hardfault_Handler:

Auto-reload is off.
Running in safe mode! Not running saved code.

You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Crash into the HardFault_Handler.
Please file an issue with the contents of your CIRCUITPY drive at 
https://github.com/adafruit/circuitpython/issues

P...
manic glacierBOT
#

All of a sudden I can no longer reproduce this problem. I'm not sure why at all, but Chrome recently got upgrade to Version 109.0.5414.74 .

I am still seeing an odd thing where at the beginning the poll() is being called constantly but after one or more fetches, it is being called only once after each fetch. I am suspicious there is still an issue.

I tried HTTPServer 2.1.0 and 2.2.0 to make sure there was not an accidental fix on the HTTPServer side.

#

Since I don't understand what it's doing, I can't really say how I'd like you to fix it. It just feels weird that "construct" would ever set a flag called "inited" to False and I'm trying to understand what's going on.

What does the "self->inited" flag mean? Is there a better name for it, or a comment that could explain it?

Since it tests out good, probably a different name or a comment explaining what's going on would be helpful, rather than changing the flow of the code.

orchid basinBOT
manic glacierBOT
#

An rp2pio.StateMachine has .background_write() which lets the user queue up large quantities of data to be sent to the Statemachine automatically, refilling in the small FIFO buffer as the data is consumed.

However, there is no equivalent capability to read the FIFO in the background, so after the StateMachine generates 4 (or 8) data values, it is blocked or loses data. Therefore, the user program must constantly poll the input to see if there is anything available to read.

It wou...

slender iron
#

@onyx hinge what was your conclusion about pico + sigrok?

onyx hinge
#

@slender iron Until there are windows & mac binaries for people to download it's a bear to get going, and i wouldn't try to send anyone down that road. Additionally, there are bugs/limitations. One of the scorpio's pins can't be used without modifying the firmware (I think because it controls the power supply mode on the actual pi pico board). one of the bugs requires you to keep all "lower numbered" pins enabled to capture higher numbered pins (this may also be a protocol limitation of the sigrok<->pico firmware communication, a protocol that the FW author invented) so you are stuck at lower sample rates. Adding proper scorpio pinout support would end up being a separate pull request.

But once you get it going you can decode i2c traces and that's pretty cool!

#

if I could clone myself and a real webdev I'd say let's make a fresh digital scope app that runs in the browser with webserial, nothing to install.

#

I also wonder whether there's some other protocol the rp2040 could implement instead, so it works with unmodified sigrok. I didn't go through the list of protocols and find out, though.

manic glacierBOT
#

I have verified on the current version that it works on signed and unsigned 8, 16, and 32 bit destination arrays.
(And agree that it should not 'work' on array.array slices. I was mislead by experience with numpy semantics where a simple slice is a memoryview.)

I also verify that the current version has fixed the regression on the pin arguments.

A feature request #7452 for non-polling read is not part of this merge request, but if enacted would probably be best addressed while this pa...

slender iron
onyx hinge
#

yeah I haven't looked at it from that angle .. like, can you take out the sigrok from pulseview?

#

my need for this isn't particularly acute, since I not only have an 8-channel saleae but also a 4 channel + 16 digital channel scope, so I'm not too motivated to throw my own time at it

#

it sure could help folks though

slender iron
onyx hinge
#

there is a small amount of activity on that PR, but even if it is merged ... the last release of libsigrok was in 2019 so 3+ years ago

slender iron
#

yeah... pretty dead

#

I understand the appeal of the web but I like python too much

#

and plugins are a good way to unblock hardware and protocol support

onyx hinge
#

Agreed

#

is there a website for that "scopehal"? I can't tell much from the github.

slender iron
#

its gui is glscopeclient

#

and there is a quick start link there I think

#

I gotta run. baby timer is expired 🙂

onyx hinge
#

see ya

lone sandalBOT
analog bridge
#

In PR CI, will it be viable to only build a single language (e.g. en_US) and build subsequent languages if the free space is less than a certain threshold level (e.g. 10KB)?

tulip sleet
# analog bridge In PR CI, will it be viable to only build a single language (e.g. `en_US`) and b...

I think we don't have a good handle on what that threshold is. We could build the largest known language, but it varies from board to board a bit. Also, if the PR is changing the message or translation code, we want to build them all to test that. Or, the PR submitter or a tester may want a different language available in the artifacts.

I'm understanding you want to speed up the PR development cycle. We have thought a bit about how to make the builds faster: don't rebuild a .o if you don't need to, etc. I have thought a bit about how to make substituting a language be a link-time-only operation, but that is pretty hard. If the compressed-string handles were the same across all the languages, that would help, but I think that requires an extra level of indirection.

mental nexus
# slender iron I was hoping the tinylogicfriend protocol could be used for this but its also st...

As of a year ago, Libsigrok seems to be relatively inactive. I never got the TinyLogicFriend PR merged, but to be honest my code probably wasn’t the cleanest. My approach was to make a few commands that could be relatively generic. I never found an existing driver that I thought would fit the bill to convert run length encoding (RLE) from the microcontroller board to streaming data on the PC side. Perhaps others can think of another way of using the drivers that already exist on the sigrok side. In fact if you want to do direct streaming it may be easier to do but will have to find a board with enough speed and fast USB to meet those needs.

slender iron
#

@mental nexus any idea how hard it’d be to write a python driver for it?

lone axle
#

Are "private" variables intended to behave different in CircuitPython than CPython?
i.e. I have this in a file called scope_learning.py:

from micropython import const
PUBLIC_CONSTANT = const(0x3)
_PRIVATE_CONSTANT = const(0x5)

And this in code.py:

import scope_learning as learning
print(f"public {learning.PUBLIC_CONSTANT}")
print(f"PRIVATE {learning._PRIVATE_CONSTANT}")

On a microcontroller that resultes in an AttributeError, but in CPython it executes successfully.

manic glacierBOT
#

This contains the following CI enhancements:

  • Cache common submodules: extmod/ulab, lib/ and tools/.
  • Share CP version across jobs to avoid fetching tags in each and every job.
  • Change submodule fetching strategy:
    • tags[Y]: use git submodule update --init for frozen.
    • tags[N]: use git submodule update --init --depth=1 for everything else.
  • Only build mpy-cross when required by the board.
  • Refactor and alphabetically arrange matrix jobs.
  • Use python 3.x for ...
tulip sleet
lone axle
#

Thank you!

tulip sleet
#

@lone axle this saves space and time: space because the dictionary entries are not needed; time because no runtime lookup need be done

lone axle
#

Nice, makes sense to deviate from "suggestion only" in order to make the most of the resources available on this scale. Appreciate the knowledge and reference

mental nexus
#

One good thing about pulseview is it has gui buttons to setup and trigger measurements. Perhaps something in the middle could fake it but I don’t know if the existing drivers can accommodate that.

slender iron
#

Something besides sigrok to get the data

manic glacierBOT
manic glacierBOT
#

Fixes #7431.

  • The new client socket returned by accept() was not set to O_NON_BLOCK all the time, causing it to block until a request was made. Now ensure that it is always set to blocking.

Other fixes:

  • write()s to eventfds should always be 8 bytes. There was a write that was only 4 bytes (writing the fd). This should actually return an error, but it wasn't checked. @tannewt I don't see that the results of these writes are used anywhere, so I think this change is OK, but...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Sure! It looks like you already have had success building CircuitPython, based on your repos. For this particular thing, what you need to do is reimplement what is in ports/raspberrypi/common-hal/analogbufio/ for ports/espressif. The Python API side of the work is already done, in shared-bindings, so you won't need to reimplement that.

So you can start by making a branch in your fork, and copying over the common-hal sources mentioned above. Then you will replace the insides :slight...

manic glacierBOT
#

CircuitPython version

8.0.0-beta.4
8.0.0-beta.5
8.0.0-beta.6

Code/REPL

In boot.py:
import usb_cdc
usb_cdc.enable(console=True, data=True)

code.py:
import usb_cdc
import time

usb_cdc.data.timeout = 5.0

while(1):
    if usb_cdc.data.in_waiting > 0:
        starttime = time.monotonic()
        print(str(usb_cdc.data.read(1)))
        print(str(time.monotonic() - starttime))

Behavior

usb_cdc.data.read(1) times out (time is printe...

manic glacierBOT
manic glacierBOT
analog valve
#

Anyone seen any code that allows a Bluetooth arduino to act as a ble hid host. Ie receive ble keypress

blissful pollen
manic glacierBOT
manic glacierBOT
#

TinyUF2 is a secondary bootloader. It is started by the initial bootloader, and knows to start the "main" application if it is present.

You don't need to do that right now. Get the .bin version working.

Looking at your https://github.com/adafruit/circuitpython/compare/main...hamishcunningham:circuitpython:unphone diffs, the size of flash and PSRAM is still 4MB/2MB, not 8/8, as you say your board is. Also take a look at the 8MB/0MB boards we support. You may need to change the qio to `...

manic glacierBOT
#

Thanks for working on this! I saw the build time of the main jobs as 1 hr 10min, which seems like a big improvement, but it's hard to compare with other runs, whose times include delays waiting for runners.

One query inline.

Did you test partial clone with --filter=tree:0 vs depth 1 for the large repos like esp-idf and the broadcom firmware repo?

If we used a partial clone for the main repo, would that make it easier to do the "what is changed checks" without invoking deeper and ...

#

Do you have a DevKit N8R8 or N8R2 in hand, to test whether the definitions we have work for those boards? If those work and the board files are very similar to yours, then I'd guess the issue is just what differs between your board and those. But I may be saying the obvious - if so, sorry. I'm wondering about strapping pins, etc.

I have a DevKit N8R2 but not an N8R8. I will add it to my next staff order.

#

Aha, I tweaked some more pindefs and now it works! Whahey!
Adafruit CircuitPython 8.0.0-beta.6-38-gfd7f36ee69-dirty on 2023-01-15; unPhone with ESP32S3
THanks for your help, much appreciated :)

Given that I've done a "make all" and a .uf2 has been generated and then (I think) combined with the (first stage?) bootloader.bin, does that mean I'm now running UF2, or is that another step?

Thanks again!

#

Fantastic!

If you are loading a .bin, then you are not using UF2. You need to load combined.bin from a TinyUF2 build onto the board (after erasing it completely). Then TinyUF2 will run after the built-in bootloader. If you do a double-click, it would go into UF2 mode and present a BOOT drive as an MSC USB device, and you would copy the UF2 onto it.

UF2 is a special format that contains information about "put this block of data here", etc.

You may be able to start with https://githu...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.6 on 2022-12-21; Raspberry Pi Pico W with rp2040

Code/REPL

import time
import busio
import board
import displayio
import terminalio
from adafruit_display_text import label
import adafruit_uc8151d

displayio.release_displays()

# This pinout works on a Raspberry Pi Pico 
spi = busio.SPI(board.GP18, MOSI=board.GP19, MISO=board.GP16)  # Uses SCK and MOSI
epd_cs = board.GP17
epd_dc = board.GP2...
manic glacierBOT
#

If I build without the SPI RAM everything works great (except there's not much RAM :grin:). The Micropython build also works fine so I've been comparing the sdkconfig files and one thing I've noticed is that CircuitPython configures the CONFIG_SPIRAM_SPEED_40M=y parameter regardless of whether I set CONFIG_SPIRAM_SPEED_80M=y in the boards/unexpectedmaker_tinypico/sdkconfig or not.

The Micropython build looks to me like it's using the 80M setting so I'd like to try a build with that setting...

manic glacierBOT
#

This new behavior is caused #7100, which fixed a worse problem: #6018: if an attempt was made to read from a CDC device when USB was not (yet) connected, TinyUSB could read from the wrong endpoint and everything would crash.

I noticed this because when I enabled usb_cdc.data and tried 8.0.0-beta.3 or earlier, bad things happen for me when the board tries to come up. It crashes right away, and appears dead. I thought at first there was something wrong with those builds. But I think wheth...

manic glacierBOT
#

The script I use to send data to the macropad does not close the serial port immediately after writing. It only closes the port if the script exits abnormally or on Ctrl+C. I did find something else which is that the device is not seeing that the serial port has a connection when I connect using my script. I added in a line to skip getting serial input if the port is not connected (eg usb_cdc.data.connected). This at least allows the device to not throw an exception or sit waiting indefinitel...

manic glacierBOT
#

I still think that the fact that read(1) times out when data.in_waiting > 0 (but disconnected) is a problem. Is it the expected behavior ? Should the buffer be reset on disconnect ? If you reconnect, the current content is not dropped, so what couldn't be read but was kept now can be read.
In fact the example I gave of sending data in bursts with echo things > port is a method that I've used, is it weird to want to read the remaining buffer after a disconnection ? It was a successful t...

#

@Neradoc -- these are good questions. I agree that we shouldn't have data.in_waiting > 0 if we are disconnected and the data can't be read. But the data is in the TinyUSB buffers, I think, and they may be considered invalid once the connection has gone away. In that case, dropping the connection should really clean things up and discard the data. Or, the buffer and channel state should be clean before and after a connection, so that attempts to read won't cause problems. It wasn't, which ca...

steady saddle
#

Hey all, is this the best channel for finding some help for porting/interacting with a new display driver? I've got a different one and I feel like I'm close but its just not quite there. I had to port CircuitPython to a new baord for this too so I'm not even sure where to start to make sure things work

storm minnow
#

Mhmm, this is the best place for help working with the internals of CP [but I'm not helpful outside of telling you that XD]

tulip sleet
#

what kind of display and what is the controller chip?

steady saddle
#

So I've got a WT32-SC01-Plus - which has a ESP32s3. The display on it has a ST7796UI driver (which is apparently similar to a regular ST7796). http://www.wireless-tag.com/wp-content/uploads/2022/11/WT32-SC01-Plus-V1.3-EN.pdf

I got CP ported over to the board, added the stuff neccessary for ParallelDisplay, and it builds and works - https://github.com/adafruit/circuitpython/compare/main...brewneaux:circuitpython:add-wt32-sc01

Projects using LoyvanGFX work just fine with the board (https://github.com/sukesh-ak/ESP32-TUX/blob/master/main/devices/conf_WT32SCO1-Plus.h), using the Panel_ST7796, so I borrowed the init sequence from that (https://github.com/lovyan03/LovyanGFX/blob/master/src/lgfx/v1/panel/Panel_ST7796.hpp)

This is my test script - the backlight turns on, but nothing displays: https://gist.github.com/brewneaux/a42728ceb3b711ba11e385fccb264aaf

tulip sleet
manic glacierBOT
#

it's hard to compare with other runs, whose times include delays waiting for runners...

Yes, comparing two check suites won't paint the correct picture, I have even noticed a difference of seconds-to-minutes for the same task between runners. I suggest you to take look at individual steps of a job.

Did you test partial clone with --filter=tree:0 vs depth 1 for the large repos like esp-idf and the broadcom firmware repo?

Yes, without tags --depth=1 is better and with tags `--fil...

manic glacierBOT
manic glacierBOT
steady saddle
#

If I do a printf as a dirty hack in a src file, I should get that in the serial console, right?

tulip sleet
#

alternative on Espressif is to use the ESP_LOGx() macros. #include "esp_log.h" and then do ESP_LOGI("tag name", "% str", args...);. You need to be compile with DEBUG=1. Your image may be too big, so turn off ulab temporarily. In mpconfigbard.mk, do CIRCUITPY_ULAB = 0. That will make the image considerably smaller.

#

That output will go to the standard debugging UART TX line, so you can see what's going on before USB comes up, etc.

steady saddle
#

ah thanks!

steady saddle
#

Ive spent most of the day looking at this. It appears the 8080 driver I borrowed from Espressif is getting initialized. I'm starting to think the issue is in the black magic of the DMA that it is doing

steady saddle
#

I may attempt to build a translation layer to LovyanGFX, which seems to support a bit more, unless someone thinks thats a bad idea.

warm fractal
#

hey guys - #help-with-circuitpython channel sent me here. I'm trying to get a custom version of CPy to compile, but I'm getting an error on setup, when running "make -C mpy-cross"

#

`dbj1906@DESKTOP-V5TAK2F:~/circuitpython$ make -C mpy-cross
make: Entering directory '/home/dbj1906/circuitpython/mpy-cross'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
File "<fstring>", line 1
(offstart=)
^
SyntaxError: invalid syntax
../py/py.mk:272: recipe for target 'build/genhdr/compression.generated.h' failed
make: *** [build/genhdr/compression.generated.h] Error 1
make: Leaving directory '/home/dbj1906/circuitpython/mpy-cross'

#

any ideas?

wraith crow
#

If you type: echo $PATH what is displayed?

warm fractal
#

a lot... don't worry about it... I just set up a linux machine in the AWS cloud

#

everything seems to be compiling there

#

I'm sure there some step I missed in my set-up on my Windows machine

jaunty juniper
#

oh interesting:

  • os.chdir("/lib") (in REPL or in code.py)
  • ctrl-C / ctrl-D
  • doesn't run code.py, "code done running"
  • os.getcwd() is still "/lib"
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.6-40-gcc6dbb373 on 2023-01-16; Adafruit QT Py ESP32S2 with ESP32S2
# and earlier betas... not sure when it started, but at least back to October or so

Code/REPL

import time
import random
import traceback
import board
import digitalio
import neopixel
import wifi
import socketpool
import ssl
from adafruit_httpserver.server import HTTPServer
from adafruit_httpserver.request import HTTPRequest
...
manic glacierBOT
mystic flume
#

it allows you to do code like: ```
import board
from async_button import SimpleButton, Button

simple = SimpleButton(board.D0, value_when_pressed=True)
await simple.pressed()

button = Button(board.D1, value_when_pressed=False)
clicks = await button.wait([button.DOUBLE, button.LONG])
if button.DOUBLE in clicks:
print("Double click")
elif button.LONG in clicks:
print("Long click")

#

I'm planning to submit it to the community bundle, but do you think it would be useful enough to go in the adafruit bundle?

manic glacierBOT
proven garnet
mystic flume
#

Ok, no worries, I'll submit a request to the community bundle

manic glacierBOT
candid sun
#

<@&356864093652516868> We'll have our weekly meeting in about 90 minutes from now in this text channel and in the circuitpython voice channel. Please take the time to add your notes in advance to the document: https://docs.google.com/document/d/1aNx4nRN0TXR7JaEv5dAu139IgZDz8aMCPL-wS6WICZI/edit# -- I look forward to everyone's updates!

manic glacierBOT
#

I have changed common_hal_mcu_processor_set_frequency to a void return and improved the documentation:

Thanks for the note! Please make it generic. The same clock caveat will apply across all micros. Please add a suggestion that one sets the frequency before starting to using anything else. That way they should be able to adjust to the new clock.

Any advice on where to put these properties?

Don't add them. Frequency is enough. The common_hal code should verify the value is so...

manic glacierBOT
#

Here's wht the serial interface said:

Auto-reload is off.
Running in safe mode! Not running saved code.

You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Crash into the HardFault_Handler.
Please file an issue with the contents of your CIRCUITPY drive at
https://github.com/adafruit/circuitpython/issues

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

I'll attach all files from the device drive, except for the "secrets.py" file, which I'm not us...

midnight ember
#

Congrats on the working PCB's!

thorny jay
midnight ember
#

Today is the last day for the #CircuitPython2023 wishlist. We’ve gotten a number of #CircuitPython2023 posts so far! Thank you all! It’s not too late to post your own. Please post yours by January 18th and email circuitpython2023@adafruit.com to let us know.

manic glacierBOT
#

Hi Dan,

Thanks for the quick reply. I'm a hobbyist and unfamiliar with the process
of reporting an issue, so please bear with me.

I'm running Adafruit CircuitPython 8.0.0-beta.6-28-g6013cde6a on
2023-01-05; Adafruit Matrix Portal M4 with samd51j19

I use the Mu editor on Windows 11 to update and debug my code, as I have
for several years. The pattern is a predictable one of starting the Mu
editor session, opening the code.py window and the serial window, and then
repeatedly changing the c...

errant grail
#

Thanks Liz!

thorny jay
#

Thanks.

midnight ember
#

Thank you for hosting Liz.

slender iron
#

thanks liz!

candid sun
#

thanks everyone!

ember iris
#

Thanks, have a great week!

thorny jay
tulip sleet
manic glacierBOT
#

I've progressed down the CYW43 Pin approach, and am honestly rather happy with the user experience! Having the pins for LEDs and buttons just being accessed using board.LED_A and board.USER_SW for example, feels quite magical. I even updated displayio.FourWire to support these expander pins for DC and CS, and although slow, seeing the REPL on screen using the usual example code was rather exciting!

Awesome! Sounds like the right approach.

Because of both these things, for my u...

candid sun
#

Here is the notes document for next Monday’s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868>
https://docs.google.com/document/d/1yqZABCU8BjP_njl0_8fed1P2dkDmNqw5o42qjZzLxqc/edit?usp=sharing

manic glacierBOT
#

Hi Dan,

I should add that when this fails (doing a Save) the "busy" Windows icon
appears on my screen at the cursor/mouse position. This spins for about 30
seconds before the serial window shows the text I sent you (crashed, safe
mode, etc). I had never seen this ever before, and at first assumed that I
should just wait for the Save to finish.

I suppose this could or could not be indicative of a problem with the "USB
drive" (not the proper term, I know) on the Matrix Portal M4? Failing o...

jaunty juniper
#

shush dyno I typed too fast !

idle owl
#

I see it though.

#

Do you happen to know if they have a static invite link?

jaunty juniper
#

I didn't finish my sentence 😛

#

in the readme

idle owl
#

I'll try it

#

It works anyway.

jaunty juniper
#

👍

idle owl
#

updating pinned message.

#

@jaunty juniper Done!

manic glacierBOT
slender iron
manic glacierBOT
manic glacierBOT
#

I'd guess something on the order of half dozen results every 15 seconds batch in the loop, sometimes more, sometimes less.

I haven't done much with mDNS recently, but I didn't see it during testing of "Share the web workflow MDNS object with the user" and other recent mDNS changes. I'll try first to just set it up and see if it's still happening. If it is, I can queue it up after 7459, the ESP32-S2 safe mode issue.

slender iron
#

@crimson ferry I'm happy to do debug builds for you

crimson ferry
#

ok, I appreciate that. I'm only here through Thursday then traveling for a bit. Priority (for me) is the ESP32-S2 safe mode, it's pervasive across a bunch of projects I've been trying to do.

#

to capture the trace... that's debug serial (right?), so DevKit is best? N4R2 would match the QT Py best (most of my testing has been on QT Py, but I'd be very surprised if it differed between any -S2)

#

but I have a variety of -S2 if something else is easier

slender iron
#

yup, having debug serial is easiest

#

I bumped some of your issues to 8.x.x

crimson ferry
#

what would we do without issues? 😉

slender iron
#

we can still look at them, I'm just eager to get 8.0.0 out the door

#

😄

crimson ferry
#

yes, of course

slender iron
#

one trick with the backtrace is that you'll want the elf file for the version you get the backtrace for

crimson ferry
#

for that utility, I vaguely remember

slender iron
#

yup yup

lone sandalBOT
manic glacierBOT
manic glacierBOT
lone axle
#

Is it possible to 'catch' an exception that is raised from in the core with something like this: mp_raise_ValueError_varg() I'm trying to catch an exception raised by that inside the core, check a few more things and then re-raise the same exception if some conditions are false, but consume the error and return something else if some conditions are met.

blissful pollen
#

It is, where is it being thrown from? like there are some nlr_push(?) commands to put commands and stuff on the stack.

lone axle
# blissful pollen It is, where is it being thrown from? like there are some nlr_push(?) commands t...

in my case it's raised from inside of validate_obj_is_free_pin() which itself calls assert_pin_free(pin); which is the function that has mp_raise_ValueError_varg() inside of it.

I may not need to be able to catch the exceptions though. Upon thinking it over a bit further I realized I could rearrange my logic a bit and not need to catch the exception. Still gotta figure out how to actually make the other conditions I'm interested in though 😅

blissful pollen
tulip sleet
lone axle
#

I'm trying to catch it from in the C code though, before it makes it into circuitpython code. Can that work from C?

tulip sleet
#

common_hal_mcu_pin_is_free()

#

will return a boolean

#

the only purpose of the throwing routines is to propagate the error to Python

lone axle
#

I see, thank you! I'll look into that one

warm fractal
#

Hey all. I compiled a custom version of CPy (latest build) for my ESP32S2_feather. I only made one change: adding the ability to use 2 displays - added #define CIRCUITPY_DISPLAY_LIMIT (2) to the mpconfigboard.h file. I loaded the UF2 file to the board, and have tested that it works with two displays. The issue I have now is that I get a core crash every time I make a save to my code.py file. the REPL says

You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
NLR jump failed. Likely memory corruption.

any thoughts on what I'm doing wrong? or if there is another change needed?

#

note - the code seems to run as expected on it's first run. I only get the error when I make a change to code.py and said. I usually have to manually unlug/replug to board to get the code to rerun (exit safe mode)

blissful pollen
warm fractal
jaunty juniper
#

maybe the release is what crashes ?
if you could get a debug build and the debug output

warm fractal
#

not exactly sure how to get a debug build and output....

#

code seems to run fine when there is only 1 display... I'll keep playing around with it

jaunty juniper
#

you make with DEBUG=1 and possibly disable some modules to make it fit

warm fractal
#

so "make DEBUG=1 BOARD=adafruit_feather_esp32s2"

manic glacierBOT
jaunty juniper
warm fractal
#

ok, I'll give that a try

#

too little flash!!! even with the CIRCUITPY_ULAB = 0 in the mk file

#

ok.. looks like I need to remove some frozen modules.... tomorrow

calm aspen
#

is anyone aware of a method to minimize the size of a uf2? I've pulled the full binary off of a custom rp2040 board and I'm left with a working 8 meg uf2. I'd really like to be able to get that down to a smaller file since we have to flash so many boards. my hex editing attempts don't work very well

jaunty juniper
#

hmmmmm a UF2 is composed of blocks of 512 bytes. You can probably remove most if not all of the blocks that only contain FF in its data payload (especially in the drive part). It should be possible to automate that.
Here is the format specification, find the size in each block, find the actual data, and test if it should be copied, if not, skip that block, if yes, add it to your output file.
https://github.com/microsoft/uf2

orchid basinBOT
#

GPIO11 on the ESP32-C3 is by default dedicated as the VDD pin for external SPI flash.

This board does not use the pin for that purpose, instead directly connecting it to the 3.3V bus and breaks GPIO out to a board pin. In order to actually use it as a GPIO in Circuitpython requires setting an efuse on the chip (and beyond that will require modifications to ports/espressif/common_hal/microcontroller/Pin.c) and building a custom image. I removed the GPIO from pins.c in https://github.com/ada...

tulip sleet
#

@slender iron when you are available could we talk a bit about the remaining 8.0.0 bugs? Trying to get a sense of what to work on and whether we have any theories.

manic glacierBOT
manic glacierBOT
#

I set the backlight to 0, and then called displayio.release_displays(), and the result was the backlight was left on.

After the displayio.release_displays() call I setup I/O pin D10 and set it low (driving the backlight), but I received the same error that the GPIO was in use when exit_and_deep_sleep_until_alarms() was called:

backlight = digitalio.DigitalInOut(board.D10)
backlight.direction = digitalio.Direction.OUTPUT
backlight.value = False

Traceback (most recent cal...

manic glacierBOT
#

I loaded up modified test code from above (mostly a more robust connect, and bumped the mDNS timeout to 10 seconds) onto an S2 TFT with Adafruit CircuitPython 8.0.0-beta.6-44-g936ecdd2b on 2023-01-18:

import time
import traceback
import wifi
import mdns
from secrets import secrets

MDNSFINDTIMEOUT = 10

def connect():
    while not wifi.radio.ipv4_address:
        try:
            wifi.radio.connect(secrets["ssid"], secrets["password"])
        except ConnectionError as ...
timid bolt
#

Hi all! I'm new here. I'm a software engineer by trade and would like to spend some of my free time working on community projects, like CircuitPython. I would love to know if you have any major feature requests that you're looking for someone to take the lead on. Thanks!

ornate breach
#

Come here and chat, comment on the issue of you need clarity investigating, etc..

#

There are issues that are linked to milestones like version 9 release or enhancements, etc..

slender iron
#

Welcome @timid bolt!

#

We're just about to get 8.0.0 released so it'll be a great time to add new features to CP.

#

What hardware do you have?

timid bolt
#

I have a RP2040 and ESP32-?? (don't remember the model). Happy to get more hardware if needed. (If they are in stock!)

slender iron
#

I'm also in seattle so I could get you stuff too. Any particular interests?

timid bolt
#

Happy to work on an issue to unblock release to get my feat wet.

slender iron
#

they aren't simple

#

looks at rp2040 issues

timid bolt
#

I have particular interests in async/parallel programming, RP2 PIO, USB PD. But my main goal is to do whatever's most useful for the community.

ornate breach
ornate breach
#

Great chip, but lots of weird bugs

#

I do love it though. It’s been great for learning

slender iron
timid bolt
slender iron
#

(though I hate to fix a new issue instead of an old one. 🙂 )

#

we're pretty good about labeling issues with what port and subsystem they are

ornate breach
slender iron
#

the sleep stuff will need a ppk2 or other power monitor (and probably not worth it on rp2040)

ornate breach
#

10-100kHz range 😬

slender iron
#

@tulip sleet's been the person thinking about async most

#

usb host and using the second rp2040 core is probably my next big thing

#

we also just did CircuitPython2023 which is our longer-term brainstorming we do each year

timid bolt
slender iron
#

(fyi I worked at google seattle just before you and did road traffic when I started in 2009)

#

how would you refactor it?

slender iron
#

imx rt will likely be the next platform to get polish from us

timid bolt
#

's lots of interesting stuff here for me! Let me know what's most important and I'll get started.

slender iron
#

I think #7452 is a good place to start

slender iron
#

we've been considering bring async apis to more of the core as well but aren't sure how

#

async requests would be good too (see dan's cp23 post)

stuck elbow
#

making digitalinout awaitable would be nice

#

so that all those int pins could be utilized

tulip sleet
#

(Scott - we are doing CE meeting now)
async requests would be a combo of Python code and also some internal stuff, I think. There is already latent support because Micropython does it

slender iron
#

haha, oops 🙂

#

brt

idle owl
manic glacierBOT
ornate breach
#

Probably would be good to get you on the circuitpythonistas role 🙂

timid bolt
#

The part I think is missing is async support is the ability to register an interrupt handler and have it run as a task in the async loop. With that building block, things like await on digital IO pin become more straightforward.

idle owl
#

@timid bolt Are you interested in being added to the circuitpythonistas Discord role? We send a couple of notifications per week to let folks know when our community meeting is happening. It's typically on Mondays at 2pmET/11amPT, here on Discord. It would definitely be great to have you there, but it's not at all required.

tulip sleet
stuck elbow
tulip sleet
#

(it is a deliberate choice not to have those interrupt handlers)

slender iron
stuck elbow
#

maybe you would actually await on an alarm...

tulip sleet
#

you could await on a pin change. The alarm pin stuff is pretty tied to sleep, though maybe we could break it away.

ornate breach
#

ararmio 👀

tulip sleet
#

@ jepler has done low-level asyncio stuff recently as well; he is off this week

stuck elbow
idle owl
tulip sleet
#

could await on a countio transition

stuck elbow
#

sounds good

#

and countio is already dealing with interrupts

tulip sleet
#

on some boards it's implemented with PWM

#

lemme check that...

manic glacierBOT
stuck elbow
#

like on AVR ;-)

timid bolt
tulip sleet
slender iron
#

we've avoided interrupting other python code too

#

however, my line has always been that I'd merge it if someone wanted to add and maintain it. I just don't think its a priority for adafruit-funded folks

timid bolt
#

Agreed. Trying to run Python user code in an ISR or between Python opcodes is crazy. What I'm suggested in a disciplined way to bring interrupts into cooperative multitasking.

stuck elbow
tulip sleet
timid bolt
tulip sleet
timid bolt
tulip sleet
#

our asyncio library was copied from the Python uasyncio model and modified it slightly. But we just made it a library instead of freezing it. And the native _uasyncio MicroPython support is _asyncio in CircuitPython. A noticeable difference is that a contributor added genuine __await__() support to CircuitPythoin, so there is some low-level stuff that is slightly different.

#

it may be worth reading the closed issues and pull requests related to async/await and asyncio

timid bolt
#

Cool. Amazing. I didn't know CircuitPython was doing something like MP's uasyncio.

tulip sleet
#

the language core is pretty much the same; we merge regularly from MicroPython

timid bolt
#

Yeah, but for some reason I thought you weren't following their asyncio approach because of the differences in your interrupt philosophies. But sounds good. I'll check out the commits on CP asyncio.

tulip sleet
#

i've got to go to another meeting, sorry. Thanks very much being interested on working on CircuitPython. We really appreciate it, and appreciate your expertise as well.

proven garnet
#

The PyPortal doesn't have the ssl module, so this issue regarding not being able to use adafruit_azureiot on it is true, right? If so, is this truly an issue, or a case of board/library incompatibility?

https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/issues/55

GitHub

Disclosure: I'm completely new to adafruit and doing my very first project. I am unable to use the adafruit_azureiot module on my PyPortal or my Metro M4 Airlift Lite. Both of these boards ...

timid bolt
#

Thanks for a great discussion. I've really enjoyed it. I'll follow up in a few days with my thoughts on the PIO background read issue.

slender iron
slender iron
clear halo
manic glacierBOT
#

I tried to reproduce this with the test program above, with the URL's you gave, and also with some of my own. I ran trials for several hours.

I couldn't reproduce, but I have pretty reliable wifi. I also shortened the fetching interval a lot, to see if that made any difference, and tried just http and just https. So maybe it is due to some external failure?

zealous sierra
#

Whenever I use mkdir to create a file it says no such file / directory

manic glacierBOT
#

I have pretty robust commercial-grade wifi. Signal strengths are good and disconnections are very rare. I've been battling this for months on a range of projects, most common theme is httpserver + requests client, it's very reproducible for me.

I also split up the test program above: 4 QT Py ESP32-S2, one running exactly as above, one running the HTTP URL only, one running the HTTPS URL only, and one doing both each loop. Oddly, the one doing only HTTPS has not crashed at all (almost two d...

zealous sierra
#

Its kind of annoying because I have been trying to solve this issue for 3 hours and the literal error is what I am trying to solve. But its broken because it wont let me create the file or directory

tulip sleet
zealous sierra
#

Yeah

tulip sleet
#

are you trying to create a single dir or a multi-directory path?

zealous sierra
#

Should there be a slash at the begging and end also?

tulip sleet
#

Note that os.mkdir() is going to raise OSError: Read-only filesystem normally. Is that what you are seeing?

zealous sierra
tulip sleet
#

If you have done .remount to make it read/write, then create the OTATest directory first, then create the subdiretory

#

you can't create the whole path at once. In regular Python, for instance:

>>> import os
>>> os.mkdir("a/b/c/")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'a/b/c/'
>>> os.mkdir("a/b")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'a/b'
>>> os.mkdir("a")
>>> 
zealous sierra
#

Ok, ill try this. Thank you!

manic glacierBOT
zealous sierra
#
previouse = ""
for i in dr.split("/"):
  os.mkdir(previouse + "/" + i)
  previouse = previouse + "/" + i

I got it working with this

#

thanks for the help

#

for any future readers searching through discord for answeres. Put this in a try except statement also

#

The part inside the for loop

#

specifically the line os.mkdir

#

lol

crimson ferry
#

dan, are you still around? pins 19 & 20 aren't exposed on the QT Py that I could see, but I think I need that for debug serial? I have most flavors of DevKit-C-1... N4R2 (adafruit-circuitpython-espressif_esp32s2_devkitc_1_n4r2-...), N8R2, N8R8

manic glacierBOT
crimson ferry
#

@tulip sleet uart pins needed?

tulip sleet
tulip sleet
#

or something with the default ones broken out already?

crimson ferry
#

adafruit-circuitpython-espressif_esp32s2_devkitc_1_n4r2-...?

tulip sleet
#

i can build for the qt py with custom pins, and if that doesn't work right away I'll build for the devkit

crimson ferry
#

ok, i'll dig out my usb-serial cable

tulip sleet
#

ok, rebuilding for GPIO5 and GPIO16 (TX and RX on the QT Py). I will test before uploading

tulip sleet
crimson ferry
#

building for a different board might require other modules disabled? the devkit also has 4MB flash

tulip sleet
crimson ferry
#

It has 2 USB connectors for 19/20, or I can access every pin

tulip sleet
#

oh, right, never mind. Let me build that, instead of debugging the QT Py

#

i have only done custom pins on plain ESP32, so maybe I am missing a setting. Copied from one of those sdkconfig's

crimson ferry
#

should be a standard devkit build -ulab + debug?

tulip sleet
#

yes, just starting

crimson ferry
#

gotcha, thank you, I really appreciate it, hopefully I'll be self-sufficient again soon 🙂

tulip sleet
#

no problem, these infrequent faults are really bugging me 🙂

#

i really appreciate it as well

#

i don't have that board, I think. I have the old saola boards

crimson ferry
#

if you build it, I will test

#

I can tell you right away if it's working

#

otherwise... tomorrow, getting late out east

tulip sleet
crimson ferry
#

I'm midwest

#

ok, will load...

#

did you happen to save the elf file? that's needed for the utility to backtrace... I'll find the instructions for that later

#

oh, it's there, n/m

tulip sleet
#

ports/espressif/tools/decode_backtrace.py

crimson ferry
#

thanks, debug printing is working, I'll post to issue if/when I get something

tulip sleet
#

fantastic, tyvm

#

i am using UniFi AP's, btw, is that what you have?

crimson ferry
#

Peplink

#

I need multi-wan router since any one internet option here is so bad

#

(no broadband)

proven garnet
#

@slender iron, @tulip sleet - does that mean it should be patched, or is this just the way it is? I don't know too much about SSL or how it would get patched if it even can effectively.

tulip sleet
#

better to write a wrapper than do something with all the client libraries. Or not a wrapper maybe, but just more API calls (two ways to do the same thing)

proven garnet
#

I'm not sure I understand - so you would wrap the problematic function calls in the AzureIoT library, or something else?

jaunty juniper
#

I want something like:

wifi, pool, ssl = adafruit_esp32spi.setup(spi, etc.)
# from then on, use the same code as for builtin wifi
proven garnet
#

That would be nifty

jaunty juniper
#

and then make proxy modules named wifi, socketpool and ssl that act like those same objects and auto-setup with board.* objects if they exist, freeze them on the pyportal and boom ! builtin wifi ! (As far as the python modules are concerned)

wraith crow
#

I believe this would make the Arduino Nano Connect much more compatible as well, I've had some difficulty getting a working socket for NTP purposes with the existing esp32spi

jaunty juniper
#

yeah the ntp library was changed to native wifi, because ESP32SPI has a builtin thing that works by interrogating the nina module, which retrieves the time on its own

crimson ferry
#

you can pull an old version from the NTP library repo that was written for esp32spi

#

or esp.get_time()

jaunty juniper
#

I need to add that to my samples

def get_ntp_time(esp):
    # get_time will raise ValueError if the time isn't available yet so loop until
    # it works.
    now_utc = None
    while now_utc is None:
        try:
            now_utc = time.localtime(esp.get_time()[0])
        except OSError:
            pass
    rtc.RTC().datetime = now_utc
manic glacierBOT
#

Prep DevKit N4R2 debug build: esptool erase flash, storage.erase_filesystem(), esptool firmware.bin, install code and support files, microcontroller.reset().

Having some trouble with TLS connecting. This works:
Adafruit CircuitPython 8.0.0-beta.6-45-g1ab1cd3ba on 2023-01-19; ESP32-S2-DevKitC-1-N4R2 with ESP32S2
but not this debug build:
Adafruit CircuitPython 8.0.0-beta.6-45-g1ab1cd3ba-dirty on 2023-01-18; ESP32-S2-DevKitC-1-N4R2 with ESP32S2
I'll let it keep running with HTTP site...

marsh sierra
#

Getting this error with XIAO ESP32C3 Circuitpython 8.0.0 beta 6 and KMK firmware

code.py output:
Booting
Traceback (most recent call last):
  File "code.py", line 4, in <module>
  File "kmk/kmk_keyboard.py", line 12, in <module>
  File "kmk/hid.py", line 2, in <module>
ImportError: no module named 'usb_hid'

Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.```
spiral elk
#

C3 cannot do HID

#

you need S2 or S3

sick hemlock
stuck elbow
#

as long as it has nrf52840, yes, but it may be some work to prepare custom firmware, and you will need a programmer to flash it

sick hemlock
stuck elbow
#

@sick hemlock note that you will need to add some components to that module to make it work – at least the power circuit

sick hemlock
stuck elbow
#

excellent

sick hemlock
manic glacierBOT
#

Because of both these things, for my use-case I don't think it's even necessary to have an IO Expander object that's exposed. @tannewt, I'm guessing that for your "wouldn't add it to microcontroller.pin" comment, I would need such an object to exist? That wouldn't have any impact on the pin_type ? Rather just change them to appear as tca9555.pin for instance? Which directory should I place such an object in?

I don't think you need a separate object if all useful pins are acce...

tulip sleet
sick hemlock
tulip sleet
#

Adafruit ItsyBitsy is quite small but plenty of pins. You could use a Nordic PCA10059, which is tiny (maybe not enough pins for you), and already supported. But it still requires installing the bootloader. The USB jack is very convenient to get code onto the board, since it will present CIRCUITPY

sick hemlock
tulip sleet
# sick hemlock Is there any kinda of reference guide for tinkering with bootloader/custom fw?

https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/README.md for flashing a new bootloader. https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython as mentioned above for adding boards.

I would still suggest considering the Itsy nRF52840. You can mount it at the edge of your keyboard board so the USB connector is flush with a small case opening, and then make a small hole in the case to hit the reset button. So the keyboard software will be easily maintainable without disassembly. It also has a level-shifted 5V output pin ideal for driving addressable RGB LEDs.

proven garnet
manic glacierBOT
#

Hi @dhalbert. I just wanted to let you know that I had some merge conflicts come up due to your recent arg_name changes in: https://github.com/adafruit/circuitpython/commit/a974402542f71fde63043da5725e3777c95b6861

Specifically, I needed to change these 3 functions from the validate versions to common_hal ones, which in your commit did not have arg_name as a parameter.
image

...

tulip sleet
proven garnet
manic glacierBOT
#
  • I also am seeing https failing on the DEBUG build, on a Metro ESP32-S2. I tried another https host, same thing. I think this is an important clue, indicating maybe there is some uninitialized variable, or we're ignoring error returns at a crucial point, or something.

  • I would like to speed up trying to get the crash happen. Your test program has a 5 minute cycle. I tried faster and that speed. Do you think trying faster might prevent the crash for some reason (no socket timeout, etc.)?

timid bolt
#

Coming back to the idea of using uasyncio Event or ThreadSafeFlag to implement non-polling awaitable pins: how would you call the "set" methods on these classes from CP. The ThreadSafeFlag example uses MP's interrupt API, which I'm guessing should not be available in CP.

manic glacierBOT
#

I'm not sure, I wondered that last night and sped mine up for a time, but didn't notice anything. Very unscientific.

BTW, the debug build is still running on the DevKit from last night, exceptions on the HTTPS url but success on the HTTP adafruit url. Odd, since the original runs HTTPS-only fine but safe modes on HTTP-only. Could even be a data size / alignment issue somewhere?

I'm going to load up one of my earlier more complex projects and see if I can cause safe mode.

stuck elbow
timid bolt
#

Right, something like that is the goal. My question is more about how to get there.

stuck elbow
#

I imagine the __await__ method would install an interrupt corresponding to the Counter object settings, that would flip the Event object that it returned, or something like that, but I have to admit I'm not greatly familiarized with the _asyncio module yet

tulip sleet
#

I had thought about passing an Event into things like countio.

stuck elbow
tulip sleet
#

yes, but maybe I am missing something

#

so a single event might be triggered by multiple things, might be convenient

stuck elbow
#

so it would be something like:

event = asyncio.Event()
counter = countio.Counter(pin)
counter.register(event)
await event.wait()

to await on a pin?

timid bolt
# tulip sleet I had thought about passing an Event into things like `countio`.

I think that could work. My thought is that just waiting on a state change of a pin in a much simpler operation than what countio provides, and perhaps this functionality should belong in digitalio instead.
For example, looking at the rp2 impl of countio: it needs a pwm pin. But maybe on other hardware not every pin supports pwm, but likely more pins would support simple gpio interrupts.

tulip sleet
#

Also, it looks to me like RP2040 countio only uses the interrupt routine when the count register wraps around. Otherwise I think it is completely in hardware.

stuck elbow
#

to do it with DigitalInOut you would still need to select on which kind of change it's triggered

tulip sleet
#

I think a per-transition interrupt for countio could be added, so we could trigger, but a DigitalInOut interrupt might be better. It just has to demultiplex the interrupt.

stuck elbow
#

that would be a third place where an Edge object is defined

tulip sleet
#

maybe should move edge to DigitalInOut

manic glacierBOT
stuck elbow
tulip sleet
#

yes

stuck elbow
#

so something like

event = asyncio.Event()
dio = digitalio.DigitalInOut(board.pin)
dio.register(event, edge=digitalio.Edge.RISING)
await event.wait()
#

possibly also with some way of deregistering

tulip sleet
#

yeah, something like that

timid bolt
#

For digitalio, I think you'd want to await on high/low, more so than rise/fall. Rise/fall can be prone to "time of check, time of use" bugs.

stuck elbow
#

depending on the use case

timid bolt
#

Possibly. I'd like to see an example of the rise/fall use case.

stuck elbow
#

int pins on sensors

#

generally anything where you care that the pin changed at any moment, not what its state is right now

manic glacierBOT
timid bolt
stuck elbow
#

anywhere where it can change by the time you get to it

timid bolt
#

if sensor.idle():
await sensor.wait_for_rise()

Is actually wrong because the pin can rise between lines of python code. Whereas:
if sensor.idel():
await sensor.wait_for_high()

Is robust against that race.

stuck elbow
#

the event would register the change anywhere from the moment it was registered on the pin

tulip sleet
#

e.g. want to trigger low to high. External peripheral has a line that is already high, you want to reset the peripheral, which will make it low, but not before you set things up. When some event happens the peripheral makes the line high

#

e.g. some kind of latching peripheral interrupt line

#

another example, want to respond to a key being released. Undepressed key is low, depressed is high. Set up interrupt to trigger on high-to-low transition

#

can't set up on just low, becuase it's already low

slender iron
# proven garnet Sounds good, I'll keep that in mind!

I think you do want to revamp it as a separate library. That way you don't need to fix all of the reverse dependencies. We also discussed doing the new library natively so that web workflow could work with esp32spi.

timid bolt
# stuck elbow the event would register the change anywhere from the moment it was registered o...

I see what you mean. That would work.
Thinking about the end-user programming experience though, I would strive to get rid of the Event object. I think Events are not on the entry level of the Python async model, and many python async APIs work without them.

sensor_ready = DigitalInOut(...)
while await sensor_ready.wait_for_high():

talk to sensor

I think this code looks a lot cleaner without events. But it would be good to examine some real world code to understand the use case better.

slender iron
#

I don't think we'll want to add to the existing apis. I think we'll want async versions of them

tulip sleet
#

There is no way to implement a C native async def method

stuck elbow
#

so it would be asyncio.PinChange(pin, edge) or something like that?

tulip sleet
#

I don't think I would do that, but my point was I was trying to figure out how to do something async with native modules. I can't await on a native method, but I can pass it something that is awaitable.

slender iron
#

native async methods it probably the right way to go about it

tulip sleet
#

i don't think MicroPyton has this now, though

stuck elbow
#

tbh the whole async stuff both in the big python and especially micropython really feels bolted on

tulip sleet
timid bolt
#

I don't think you need native async methods. The native method gets passed down some sort of object (like Event) that it can use to schedule callbacks in the Python event loop. That's how it is implemented. My suggestion is more about how it is exposed to users. I think there are usability advantages to not exposing the Event object to users, even if an implementation uses one.

tulip sleet
stuck elbow
#

they could have just said that Twisted is the standard

tulip sleet
tulip sleet
#

that Mpy discussion seems very relevant...

slender iron
#

have you found anything that explains why we can't do native async?

tulip sleet
#

the scheduling is all in the asyncio python code, except for some optional helpers in _[u]asyncio

slender iron
#

ah

timid bolt
slender iron
#

is there a reason to keep the scheduling in the python vm?

tulip sleet
#

right. a_digitalinout.some_method() is a native Cmethod, but there is no way to await a native method

slender iron
#

could we return an object we could await?

#

doesn't really know how it works

tulip sleet
#

dio.awaitable_event(LOW_TO_HIGH), for example, could return a native Event-ish object, maybe. But right now Event is a class defined in Python in the asyncio library

#

no, we wouldn't want to move the scheduling. it's much easier done in Python, and it depends on a lot of Python code

timid bolt
#

Right, in big Python this method would return an asyncio.Future object.

tulip sleet
#

and you want to maybe subclass, etc. I wouldn't want to maintain that.

slender iron
#

maintain the scheduling?

tulip sleet
#

maintain the whole library. Huge parts would need to be native

timid bolt
#

I think there would be a HAL functions that associates an irq with an asyncio Future. The native code is huge because it is different for every port. But the native code for any one port should not be huge.

slender iron
#

right so the native api returns a future that we modify in a native interrupt

#

we use native interrupts in many places

tulip sleet
#

right now there is no Future class in MPy/CPy asyncio

#

i think we can get away without having it.

#

or maybe not, but I feel in the CPython world it is partly a legacy.

#

there are too many kinds of things you can await on

slender iron
#

gotta run. baby timer expired

timid bolt
# tulip sleet right now there is no Future class in MPy/CPy asyncio

Right, this leads me to a higher point about micro asyncios in general. I agree big Python's asyncio history is tortured but it looks to me like it has reach a sort of plateau of stability now. So what is the thinking about embracing big Python's asyncio interface warts and all. On one hand it gives a lot of cross-compatibility with big Python (which I believe is a goal of CircuitPython), and re-use of code maintained by CPython. Are there concerns that the code size is too big for micro?

tulip sleet
#

but my point about passing Events in rather than constructing them is that it could be more flexible. It allows the same Event to be shared and triggered by multiple things. (Maybe that is bad, not sure). I think it is very much worth studying what the MPy folks are doing here; they have much more experience writing async code, particularly peterhinch and jimmo

timid bolt
#

hmm, if CPython world it is partly a legacy, what is the future? (no pun intended)

slender iron
#

we should definitely talk to damien and jim before doing anything major

#

they've been thinking about this too

tulip sleet
#

i spent a long time trying to understand asyncio thoroughly. The early styles of use were kind of terrible. I really agree with Nathaniel Smith about the problems with the unconstrained early stuff

slender iron
#

I'd be happy if we didn't need an .irq() equivalent

tulip sleet
#

I would have preferred having a trio library instead of an asyncio library, but it seemed difficult to port. And the MPy library was available for our use with minimal changes needed. In the CPy asyncio guide, I really tried to show a style of use that was clean and simple.

#

now TaskGroup is in CPython 3.11, but it had exception groups as a prerequisite. It took 3 years for that to get implemented. exception groups are a lot of new implementation for MPY and I don't think MIcroPython is going there any time soon. But we can still have TaskGroups with some (slightly incompatible) wrapper for exceptions in tasks or something like that.

timid bolt
#

Does CPython mean CircuitPython or the standard implementation of "big" Python?

tulip sleet
#

CPYthon means "regular Python". We try to say "CPy" for CIrcuitPython. The ambiguity is a problem. So I usually say "regular Python" to the average user

#

"CircPy" never caught on

#

i have to go grocery shopping before it starts to rain, but this has been really interesting, and I need to read that MPy discussion (and it points to further documents).

tulip sleet
timid bolt
# tulip sleet but my point about passing Events in rather than constructing them is that it co...

I think the use of Event like that is valid. But I also think using asyncio.wait (https://docs.python.org/3/library/asyncio-task.html#asyncio.wait) is a more typical way to wait for multiple signals.

tulip sleet
#

The CPython folks are much more concerned with async for network stuff. Arbitrary external events are not something they have thought about a lot. We talked with Nate Smith about this in hallway at PyCon several years ago, but reached no conclusions.

manic glacierBOT
manic glacierBOT
#

Got a halt rather than safe mode, looks like the address is corrupted though, decode_backtrace can't decode it:

Guru Meditation Error: Core  0 panic'ed (Unhandled debug exception). 
Debug exception reason: BREAK instr 
Core  0 register dump:
PC      : 0x400283c0  PS      : 0x00060a36  A0      : 0x3ffd98a4  A1      : 0x3ffd98ac  
A2      : 0x3f4c0058  A3      : 0x00000001  A4      : 0x80036348  A5      : 0x3ffe7b40  
A6      : 0x00060023  A7      : 0x00000003  A8      : 0x00060023  ...
manic glacierBOT
#

This patch fixes two issues relating to microcontroller.on_next_reset() on NRF boards.

  1. Issue #5353. Using the SDK function sd_power_gpregret_set() instead of directly setting NRF_POWER->GPREGRET eliminates
    the problem of immediately resetting the board.
  2. Issue #6975. Adding a test for a runmode of RUNMODE_UF2 in addition to RUNMODE_BOOTLOADER avoids the system firmware failure assertion.
solid juniper
#

I want to add CircuitPython to the Flipper Zero WiFi Dev Board. What existing board should I copy?

slender iron
#

@solid juniper start with one that has the same esp module

#

that way the flash and ram should be setup correctly

solid juniper
slender iron
#

I don't know what the flipper has so I don't know

manic glacierBOT
solid juniper
#

It has an ESP32-S2-WROVER-N4R2. The Saola should have the same, since it has an ESP32-S2-WROVER that has 2MB PSRAM and 4MB Flash.

crimson ferry
solid juniper
crimson ferry
#

generally, microcontroller will have all of the pins, and board will have the pins exposed on your board (with name aliases matching silk, where applicable)

#

VID / PID need to be worked out

#

Q: When the filesystem has been extended, is the former dualbank parition preserved as part of the filesystem simply by virtue of nothing being written to it, or is there some more active protection for when a new UF2 is installed?

solid juniper
solid juniper
#

The first build of CircuitPython for the WiFi Dev Board built successfully. But how do I get it onto the board?

crimson ferry
#

using esptool

#

or you could install a UF2 bootloader (maybe)

jaunty juniper
#

adding a boad to tinyuf2 is usually easier, it doesn't care about the PSRAM configuration or the pins setup

solid juniper
solid juniper
#

How can I get the LED(s) working?

orchid basinBOT
manic glacierBOT
#

When DEBUG=1, there is something wrong with the certificate verification (same errors as in the previous post):

E (13018) esp-x509-crt-bundle: PK verify failed with error FFFFBD70
E (13018) esp-x509-crt-bundle: Failed to verify certificate
E (13018) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x3000
E (13028) esp-tls: Failed to open new connection

@anecdata, when you saw the cert errors shown in your post, was DEBUG=1?

I think I have narrowed it down to some differe...

tulip sleet
#

@crimson ferry I am getting fried. WIll give up for the evening. I was just trying to see if the cert errors disappeared completely in the regular build (but still turning on the logging). This is mysterious but not necessarily related. On the other hand, if it's a use-after-free or something, it could manifest in different ways.

crimson ferry
#

OK, I'm out until late next week, I can pick it up again then.

tulip sleet
#

i am not sure we will hold up 8.0.0-rc.x and the final release to get this fixed, since it's hard to reproduce

#

though you seem to hit it reliably

crimson ferry
#

right, and doesn't seem to be affecting anyone else

tulip sleet
#

thanks for all the testing, and hope your trip goes well

crimson ferry
#

thank you too, I hope to be underwater for much of the trip 🙂

tulip sleet
#

maybe I shouldn't ask further 🙂

#

is it work or rec?

crimson ferry
#

🤿 (rec)

tulip sleet
#

that's what I hoped, as opposed to submarine duty

proven garnet
manic glacierBOT
#

CircuitPython version

CP800b6 daily 
Adafruit CircuitPython 8.0.0-beta.6-43-g1c1cf1cf5 on 2023-01-18; Raspberry Pi Pico W with rp2040
Board ID:raspberry_pi_pico_w

Code/REPL

negative number of bytes to read: -115

Behavior

use: CP800b6 latest ( from 14. and 18. ) ( with bundle /lib/ from 15. and 17. )
on a PICO_W ( nuked )
to connect to a local broker ( RPI mosquitto) OK
BUT
to a remote broker TLS ( HIVEMQ ) ERROR
always get error at subscri...

proven garnet
#

Libraries are all patched, with a few ones that need work tagged with issues I'll get to this weekend (I don't believe any are in the Bundle). It's late so I won't tag, but if you see this thanks Dan for the quick review so I could do this on the off hours!

#

And with that, the libraries have moved away from deprecating actions!

spiral elk
#

Could someone check if espefuse.py in the esptool idf component is working for them?

manic glacierBOT
manic glacierBOT
#

@MicroDev1 Thank you for taking this on! We certainly have gotten a lot of call for it.

I realize this is a draft, and you know there are things left to do, so many of my comments are more just to make a TODO list that can be checked off.

Targeting this for 9.0.0 might make sense, since then we can use ESP-IDF v5.0 from the start. I will set it to that milestone for now.

#

This and ringbuf_write() are very similar to ringbuf_get_n() and ringbuf_put_n(), with some additional return values. Did they come from upstream or did you add them?

I'd rather they take uint8_t* instead of void *. Do the casting on the calling side; that ensures the user knows what they take.

These could wrap the get and put routines, and could be get_all and put_all or something like that.

manic glacierBOT
slender iron
slender iron
#

np

#

I thought I'd do usb host next but then immediately started updating my watch code

#

and then thought about the 7 color epaper because its also 4 bits a pixel

#

plus I've been thinking about eink a bunch

idle owl
slender iron
#

@idle owl yeah, it’d include that. I have a version from waveshare with the same display

idle owl
#

What does the WaveShare one look like?

slender iron
#

I’m making the circuitpython low level stuff work for it like our other eink

idle owl
#

Ah

slender iron
#

You can find it on Amazon too

idle owl
#

Wow those displays look slick.

#

I'm impressed.

slender iron
#

Ya, I’m excited to see how it looks. They are slow to update though (like 30 seconds a refresh)

ember iris
#

Oh that's exciting! I (had as of this weekend thanks to a couple of dumb accidents) a couple of waveshare 7.5in screens in just the standard single black color, but I've been eyeing the color ones for a few years

slender iron
ember iris
#

They apparently have a v3 of that screen now so it's possible the protocol has improved.

idle owl
#

@rugged spindle Hello! Do you go by the same user ID on GitHub as you do here?

rugged spindle
#

I do indeed

idle owl
#

That's a combination of Adafruit libs and Community libs. 🙂

rugged spindle
#

Whoa. And by accident!

idle owl
#

Couldn't have planned it, for sure. 😄

idle owl
rugged spindle
#

That's fine

abstract stump
#

I was playing with HID lately and I was wondering if it is possible to create a dual gamepad or dual mouse-like device. Looking at some custom HID devices it seems that it is possible to create a HID device with 2 gamepads every one with and report and report_id, but I was not able to use the .send_report() including an report_id

tulip sleet
blissful pollen
#

Quick question. I noticed one thing Anne mentioned for CP2023 was a native gif player. Would this be useful? May be something I could work on. Though putting some thought into how this fits into displayio

jaunty juniper
#

man I'm looking into a question on watchdog in the support forum, and it's... tricky to use on RP2040: because it's a hardware watchdog that can't be deinited limited to 8s max, a simple autoreload might trigger it if the timer is shorter than the time it takes your code to reload and get back to the point where it sets and feeds the watchdog...
That actually led to drive corruption within minutes of me testing different parameters to it.

onyx hinge
solid juniper
#

I can't get any of the 3 LEDs on the Flipper Zero WiFi Dev Board to turn on as the status LED.

jaunty juniper
# onyx hinge Maybe the flash write routines in particular should pet the watchdog, or maybe t...

that's an interesting idea, the core could feed the microcontroller.watchdog during USB writes, and maybe during autoreload or something ? The watchdog must not be fed if the code exits, because that's kind of the point (one use is to reset the board when it dies of an unexpected exception) but auto-reload could be a special case (with maybe an option to opt out)
and watchdog.deinit() could be simulated on RP2040 by increasing the delay to the max and feeding it in the core ticks ?

solid juniper
manic glacierBOT
#

CircuitPython 8.0.0-beta.6
Board - Adafruit Feather ESP32s2

Error message:

You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
NLR jump failed. Likely memory corruption.
Please file an issue with the contents of your CIRCUITPY drive at 
https://github.com/adafruit/circuitpython/issues

Code:

import board
import displayio
import vectorio
import terminalio
from adafruit_simplemath import map_range
from adafruit_display_text import bitmap_l...
solid juniper
jaunty juniper
#

well you would follow that example then

solid juniper
abstract stump
#

Yes, I had a problem there but I think it was my bad, I was trying to use two gamepads on one rp2040 but it seems that using a custom HID descriptor is not recognized easy on win10, in the device manager it appears as a unrecognized hid device. And trying to use different report_id on the send_report function showed me an error of invalid report_id. The problem was the find_device function that looks for a device with a usage_page and usage, but in this case my gamepad1 and gamepad2 was getting the same device, so I bypassed the find_device and assigned the usb_hid. devices directly, like usb_hid. devices[0] and [1] that way it works nice now. The find_device function should have and optional variable of report_ids if someone wants a duplicate HID device on a single micro

abstract stump
manic glacierBOT
#

Adds support for the ULP Finite State Machine present on ESP32, ESP32-S2 and ESP32-S3.

import alarm
import espulp

ulp = espulp.ULP(arch=espulp.ULPArch.FSM)
# ulp = espulp.ULP(arch=espulp.ULPArch.RISCV)

print(ulp.arch)

with open("ulp_main.bin", "rb") as f:
    ulp.run(f.read())

ulp_alarm = espulp.ULPAlarm(ulp=ulp)
alarm.exit_and_deep_sleep_until_alarms(ulp_alarm)
manic glacierBOT
#

xs and ys are typed as ReadableBuffer here, but the same arguments are marked as int in the list of params a few lines below here.

I was able to test this successfully on a PicoW with EYESPI connected ST7789 display using code like this:

xs = bytes([4, 101, 101, 19])
ys = bytes([4, 19,  121, 101])
bitmaptools.draw_polygon(color_bitmap, xs, ys, 3)

I think it would be best if the arguments xs and ys could be a list or tuple instead of needing to be specifically the...

manic glacierBOT
#

int in :params list is a mistake, I forgot to change it there.

I think it would be best to allow both List[int] and ReadableBuffer as argument, as first is easy to use, and second allows for optimisations such as using not only bytes but also array of shorts for less memory usage, or even memoryview over such to avoid data copying. I'll try to make it accept both versions (-:

wanton topaz
#

Folks, apologies if this isn't the right place to ask, I hope it is.

stuck elbow
#

what could possibly happen if it isn't

wanton topaz
#

Ah dang, too much slack, keep hitting wrong keys...

I have a Seeed XIAO nRF52840 Sense, but I can't seem to figure out how to use the on board IMU, their examples are arduino ones, and looking into them I can see that they are using I2C to talk to the IMU, and if I look here in the CP source https://github.com/adafruit/circuitpython/tree/main/ports/nrf/boards/Seeed_XIAO_nRF52840_Sensee

I can see this in pins.c

`{ MP_ROM_QSTR(MP_QSTR_IMU_PWR), MP_ROM_PTR(&pin_P1_08) },
{ MP_ROM_QSTR(MP_QSTR_IMU_SCL), MP_ROM_PTR(&pin_P0_27) },
{ MP_ROM_QSTR(MP_QSTR_IMU_SDA), MP_ROM_PTR(&pin_P0_07) },
{ MP_ROM_QSTR(MP_QSTR_IMU_INT1), MP_ROM_PTR(&pin_P0_11) },`

But there's nothing in the mpconfigboard files... looking at their datasheet here:
https://view.officeapps.live.com/op/view.aspx?src=https%3A%2F%2Ffiles.seeedstudio.com%2Fwiki%2FXIAO-BLE%2FXIAO-nRF52840-Senese-pinout_sheet.xlsx&wdOrigin=BROWSELINK

They seem to say that the SDA/SCL are on D16/17 (but also reference pin07/27) but if I try to use board.D16/D17 in CP it just says they aren't defined.... Am I missing something? Is there any way to reference these pins without recompiling the source and editing?? (Alas I'm not super familiar with C++ or compiling CP myself)

Is it just a matter of copying the other files pointers to the pins into the mpconfigboard file like the others?

wanton topaz
stuck elbow
#

you have to create your i2c bus yourself with busio.I2C

wanton topaz
stuck elbow
#

the qstr thing looks a bit weird if you are not used to it

#

it's how constant strings are defined in micropyton and circuitpython

#

also, no need to apologize

stuck elbow
wanton topaz
#

Appreciate it, @stuck elbow thanks for your help... I'm clearly still missing something as the I2C seems to create ok:

from adafruit_lsm6ds.lsm6ds33 import LSM6DS33

i2c = busio.I2C(board.IMU_SCL, board.IMU_SDA)
sensor = LSM6DS33(i2c)

But still getting No pull up found on SDA or SCL; check your wiring ... this seems to work with no wires from arduino without additional wiring so maybe I am wrong.

jaunty juniper
# wanton topaz Appreciate it, <@351136009922019331> thanks for your help... I'm clearly still m...

There's a power pin you need to pull:

import board
import busio
import time
from digitalio import DigitalInOut
from adafruit_lsm6ds.lsm6ds3 import LSM6DS3

power = DigitalInOut(board.IMU_PWR)
power.switch_to_output(True)

i2c = busio.I2C(board.IMU_SCL, board.IMU_SDA)
sensor = LSM6DS3(i2c, address=0x6A)

while True:
    print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2" % (sensor.acceleration))
    print("Gyro X:%.2f, Y: %.2f, Z: %.2f radians/s" % (sensor.gyro))    
    time.sleep(1)
#

(that does work on my board btw)

wanton topaz
#

ah cool, I found this on page 3 of google behind a pile of dusty books. I've never heard of circup before. Thanks @jaunty juniper I would always much rather do things like that myself so I have a bit more sight of whats going on, I'll be using your solution for my project. Thanks again to both of you, would not have figured that one out for a long time!

https://pypi.org/project/circuitpython-seeed-xiao-nrf52840/1.0.0/

jaunty juniper
#

oh it's in the community bundle, nice !

#

those libraries are useful resources to look into to understand some of the inner workings

wanton topaz
#

Yeah, I checked the adafruit bundle but not the community one.

jaunty juniper
#

and yeah circup is very useful

wanton topaz
#

Everyday's a school day! ... all this effort for the stupidest project ever.... putting a microcontroller into a zippo lighter case 😂

#

Signing off here, thanks again @jaunty juniper and @stuck elbow

jaunty juniper
manic glacierBOT
#

Adafruit CircuitPython 8.0.0-beta.6 on 2022-12-21; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3
Board ID:adafruit_feather_esp32s3_4mbflash_2mbpsram
UID:4F21AFA5124C

You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Crash into the HardFault_Handler.
Please file an issue with the contents of your CIRCUITPY drive at 
https://github.com/adafruit/circuitpython/issues

I'm using an external 1.14" display with the ESP32S3 detailed here - ht...

manic glacierBOT
manic glacierBOT
#

I'm having issues with my Cytron Maker PI RP2040 timing issues https://github.com/CytronTechnologies/MAKER-PI-RP2040/issues/5
SO I wanted to use a Adafruit Feather Express M0 as an I2C slave for my HC-SR04 (sonar) unit [robot project]
^
I found this PR https://github.com/adafruit/circuitpython/pull/1064 but that was for version 4 - afaict.
I don't see anything in the 'docs' weblink - just the standard busio.I2C api.
^
Bitbangio was mentioned as a possible alternative - whi...

manic glacierBOT
#

You are looking for the i2ctarget module (or i2cperipheral in CP7).
https://docs.circuitpython.org/en/latest/shared-bindings/i2ctarget/index.html

It is however not available on any M0 build currently, you would have to build it manually by adding CIRCUITPY_I2CTARGET = 1 in mpconfigboard.mk but it's not gonna fit on the trinket unless you disable other modules. It should fit in an express board though.

However, your original issue seems to be a timing problem on RP2040, have you...

#

I tried your original test program on both a Cyrton Maker PI RP2040 and a Raspberry Pi Pico with version 7.3.3 of Circuitpython and didn't see your timing issue. What version of Circuit Python are you running?

Adafruit CircuitPython 7.3.3 on 2022-08-29; Cytron Maker Pi RP2040 with rp2040
>>> import time
>>> for x in range(6):
...     print(x)
...     timestamp2 = time.monotonic_ns()
...     timestamp = time.monotonic()
...     time.sleep(.25)
...     timestamp1 = time.monotonic...
manic glacierBOT
manic glacierBOT
#

Strange, I still get good time output:

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

Adafruit CircuitPython 7.3.3 on 2022-08-29; Cytron Maker Pi RP2040 with rp2040
>>>
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disab                                                                             le.
code.py output:
0
0.25
250000000
1
0.25
250000000
2
0.25
250000000
3
0.250977
250000000
4
0.250977
250000000
5
0....
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

NA

Code/REPL

$ ports/espressif/esp-idf/components/esptool_py/esptool/espefuse.py

Behavior

imports fail due to referencing a class alias that was removed in bitstring library 4.0. The version needs to be forced to 3.1.9 in the build environment.

Description

No response

Additional information

No response

digital shoreBOT
lone axle
#

@stuck elbow I'm curious if you're open to the idea of factoring the Buttons helper inside ugame (i.e. https://github.com/python-ugame/circuitpython-stage/blob/4124dfbdaadce1966f457d7d6c6984e9832999bf/pybadge/ugame.py#L49) into it's own file so that it could be imported independently of the display functionality.

I think at some point in the past it was possible to use that button helper with displayio, but it isn't any longer, when you import it the display gets taken for use by stage. If this helper where in it's own file like ugame_buttons.py it would be possible to import it separately from stage.

Id be willing to work on splitting it out and make a PR if you're open to that change.

stuck elbow
onyx hinge
#

@lone axle @turbid radish says the newsletter is ready for you to grab a preview

stuck elbow
lone axle
#

Interesting conversation , thank you I hadn't seen that. The idea of working it into board somehow does seem like a nice solution

#

I'll brainstorm a bit and see if there is some way to set it up there within my cababilities.

stuck elbow
#

as tannewt observed, a lot of this could be guessed from the pin naming

#

so maybe we don't even need separate files per board, just a couple of naming conventions to try

lone axle
#

aliases inside of board to make pins like board.GAME_BTN_A, board.GAME_BTN_UP etc... that have correct definitions for each board would go a long way. That could cover all of the cases except the joystick ones (assuming pins are connected directly and not through some expander), which definitely does get more complicated.

stuck elbow
lone axle
#

Is it possible to have "blanks" inside of a keypad.Keys object? it assigns a number for each key which is then checked later on to figure out which one has been pressed. Is there a way that it could skip say indexes 0-3, they won't associate with real pins and will never actually register presses but they will still "consume" those numbers of 0-3?

stuck elbow
#

no

#

but the library could provide named constants for the numbers

#

so it doesn't matter what the numbers actually are

lone axle
#

I was thinking along the lines of the mentioned board.KEYS() that could return an initialized keypad object. One issue with that that is mentioned is different devices have different number of buttons. But if there could be blanks maybe that could help equalize it across devices with different buttons. So that at least the consistent ones can work the same across all.

stuck elbow
#

to be honest, we just need a game framework