#circuitpython-dev

1 messages Β· Page 37 of 1

idle owl
#

Whee I broke my timing.

#

I was genuinely hoping that was the issue.

#

It's happening super rapidly now.

tulip sleet
#

I even get an email: Subject: [adafruit/circuitpython] Run failed: Build CI - 8.1.0 (b1a28bc)

#

but only because I initiated those runs

idle owl
#

Oh, come on. πŸ€¦πŸ»β€β™€οΈ

#

I removed the thing that reset the time check for that block somehow.

crimson ferry
#

2038, right, that's the end of time (I think) for CircuitPython```py

sys.maxsize
2147483647
time.localtime(2147483647)
struct_time(tm_year=2038, tm_mon=1, tm_mday=19, tm_hour=3, tm_min=14, tm_sec=7, tm_wday=1, tm_yday=19, tm_isdst=-1)

idle owl
#

Hooray! Back to error free.

#

Which is super hooray.

brazen hatch
idle owl
#

@tulip sleet Turns out 6 pings per second is too much for the ESPIDF. πŸ˜‚

#

@crimson ferry OK, so I made this work, but kept my original code intact, like a smart person for once. Are you saying this is completely unnecessary, and I should simply use time.time() in place of monotonic()?

#

That's completely fine, but I wanted to clarify before I revert all of this, llol.

crimson ferry
#

should be fine for rough-one-second intervals

idle owl
crimson ferry
#

no floats, no rollover, no extra dependences

jaunty juniper
idle owl
#

FWIW, it was keeping in time with the RTC intervals in the time I let it run.

#

e.g. I had it printing time.time() and monotonic() at the same time as the code block print, and it was exactly 1 second apart.

crimson ferry
#

the code might have gotten sync'd up to a second boundary

#

(or drift due to float precision - but not likely if you've been resetting it)

#

oh, n/m, I think I misunderstood

idle owl
#

I'm saying the time.time() interval was matchy with the RTC 1 second interval.

#

Which is a good thing, I believe.

crimson ferry
#

yeah, I believe everything comes from the same clock internally?

idle owl
#

Fair enough.

#

This was a much simpler change. Thank you. πŸ˜„

#

But I got RTC working! Saving that code. Because that was a whole ordeal. And I can crib it later.

#

My ping times here are showing 0.0ms maybe 75% of the time. Is that seriously right?

#

Am I having a good internet day? Or is CircuitPython lying or something, heh...

crimson ferry
#

RTC is nice, on espressif even more nice since it will keep real clock time across reloads AND soft resets, making nice timestamps once you set the RTC

crimson ferry
brazen hatch
#

I can set it just fine with my date implementation

#

It just works.

jaunty juniper
#

interesting

brazen hatch
manic glacierBOT
#

Confirmed this fix works for me on the Qt Py ESP32-S2. Thank you @dhalbert for the quick solution.

`Wi-Fi: off | code.py | 8.1.0-2-g9040ac8bcWi-Fi: off | code.py | 8.1.0-2-g9040ac8bc<TouchAlarm>
Wi-Fi: off | Done | 8.1.0-2-g9040ac8bcWi-Fi: off | Done | 8.1.0-2-g9040ac8bc
Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.
Pretending to deep sleep until alarm, CTRL-C or file write.
Woken...

idle owl
jaunty juniper
#

note that the error I showed would be a limitation of the implementation of time.localtime(), not a limitation of struct_time itself

brazen hatch
#

i will try switching it

midnight ember
jaunty juniper
brazen hatch
#

Wait, doesnt CP do parity bit?

jaunty juniper
#

does the GPS do it ?

empty salmon
#

I like the AVR chips for their price, low power capability, and availability.

manic glacierBOT
tulip sleet
midnight ember
#

As far as i could tell it seemed like gps data was trying to merge with the time struct. I don’t know how else it would overrun the int size.

#

I didn’t know about error handling then. Might be able to revisit it.

manic glacierBOT
#

@tyeth I'm assuming you read https://learn.adafruit.com/circuitpython-safe-mode. Without safemode.py, the reason is printed in the REPL. The original motivation of safemode.py was not to do a more thorough diagnosis, but to recover even in the presence of a safemode.

I can add more detailed examples to the guide. I'd rather not complicate the beginner's experience with a pre-programmed safemode.py.

#

for some reason make fetch-submodules does not pull in "tools/huffman". I had to explicitly get it with cd tools/huffman; git checkout

I did a fresh clone of my fork, and did make fetch-submodules. huffman got cloned and populated as I would expect. I am using git 2.40.1 on Ubuntu 22.04. I use the git PPA to get a newer version than 22.04 would normally provide.

Maybe there is something wonky about your clone. You could try git remove-submodules and then `git fetch-submodule...

orchid basinBOT
brazen hatch
#

It's ready for review. How was Camera not a feature?

#

Have there really been that few CP boards with a camera?

manic glacierBOT
midnight ember
#

ESP used to be the only one powerful enough to do a camera of any kind, maybe a few others. yeah there aren't many.

#

now with supercharged boards like iMX we might see more higher power projects.

brazen hatch
manic glacierBOT
manic glacierBOT
#

This is weird. I have also been building on an Ubuntu 22 x86_64 box and I swear I saw it there too.
But I just did a fresh checkout on Ubuntu (git 2.34.1) and macos (homebrew git 2.39.1) and I am not experiencing this issue now. I do know that someone else on a Mac I was helping build a board definition had the same problem and they perhaps did not have homebrew git. And at one point during this I was having PATH issues wrt homebrew.
Closing this issue because I think the problem was me.

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-alpha.2-132-g3ab9920927

Running on ESP32-S2 (custom board).

Code/REPL

import time
import board
import analogbufio
import array
import supervisor
import asyncio
import gc
import busio
import sdcardio, storage, os

# Mount file system
sd_spi = busio.SPI(clock=board.SCLK, MOSI=board.SD_DIN, MISO=board.SD_DOUT)
sdcard = sdcardio.SDCard(sd_spi, cs=board.CS)
vfs = storage.VfsFat(sdcard)
storage.m...
manic glacierBOT
brazen hatch
#

Ok, guys, I want you to hear me out.
I feel a speed difference between .bin and .uf2.
Like, actual difference in speed of the board during operation.
the uf2 feels faster???

#

I seriously need to make boardbench.

#

I have no way to prove it right now.

manic glacierBOT
#

@dhalbert

I'm assuming you read https://learn.adafruit.com/circuitpython-safe-mode.
Sadly not :) I think I had in the past I believe, but re-reading it now there's a few useful things I picked up. I wonder if another example showing a more complex case or an external link to a repo/project/learn-guide with bundle with the "log all the things locally (exceptions and reboot reasons with time/traceback) and then to adafruit IO after reboots (or immediately if recoverable error? I'm just us...

thorny jay
# brazen hatch It's ready for review. How was `Camera` not a feature?

I am pretty sure Camera was already suggested by me.
Either in a meeting, or as an issue.
And the answer could have been: "We need to limit the number of feature." + "Only a few board have Camera, and people looking for that will get the information from the learn guide... or the feature matrix."
But that is from memory, I could be wrong.

brazen hatch
#

Well, it's in the PR. I guess I will find out soon enough.

manic glacierBOT
manic glacierBOT
crimson ferry
#

not sure where to ask for a semi-official opinion... Does Adafruit have a preference for which pins on a Feather (RP2040) should be Wire1 in Arduino? https://github.com/earlephilhower/arduino-pico/issues/1465 D6/D9 and D112/D13 are used by a lot of featherwings, RX and TX probably not, D24/D25 are SWD

onyx hinge
#

thanks Dan

manic glacierBOT
tulip sleet
tidal kiln
#

in terms of "preference" - most definitely that SCL/SDA be Wire.

manic glacierBOT
#

These changes look OK to me.

One thing to note. The modules below, which you currently have turned off, are implemented in a port-independent way in shared-modules. So you could turn them on and they should just work:

        CIRCUITPY_BITBANGIO ?= 0
        CIRCUITPY_KEYPAD ?= 0
        CIRCUITPY_TOUCHIO ?= 0

bitbangio and keypad use common-hal DigitalInOut operations to do their work, so those should just work immediately.

touchio has both native and generic ...

crimson ferry
#

@tidal kiln thanks for getting involved, it was quite confusing

proven garnet
#

Just a heads up to everyone I'll be patching the pylint and jQuery (RTD) issues this evening, so those issues should be resolved within the next few days. Also to merge/rebase if needed.

#

Though the latter point shouldn't apply to most if anyone I think.

crimson ferry
#

@graceful rain dev stuff better in here... you can put it in the make command line, but you'll need to turn off some modules to allow the debug build to fit on flash, see #circuitpython-dev message

#

backtrace decode utility is at ports/espressif/tools/decode_backtrace

graceful rain
#

thanks @crimson ferry wow this is really getting into the weeds. Where does this decode_backtrace go in my own test program? I'm not too sure what I'm looking at or how to use it, haha. "Enter the backtrace line at the "? " prompt." - what does that mean?

crimson ferry
#

first, you have to hook up your host to the debug serial pins and monitor that (19 & 20 I think on the S2?), then when you get a safemode / hard fault, there will be a list of addresses... those get pasted into decode_backtrace and out will come a stack of the C code line numbers

graceful rain
#

Ok, thanks. So that decode_backtrace code is running on the host?

brazen hatch
#

yep

#

It reads the debug .elf and uses it to decode the inputted backtrace

graceful rain
#

Sorry one more question. How does that code know what serial port to listen to. I don't see it defined anywhere

brazen hatch
#

Your question is vague.
In your os? In terms of board pins?

graceful rain
#

Yes, in my OS (Linux)

slender iron
#

the python script doesn't connect to it

#

just use your normal serial terminal

#

and then copy the backtrace line over from there

graceful rain
#

oh ok

#

Thanks!

crimson ferry
#

does the backtrace go to the regular serial console? I thought it went to the debug console

#

I always hook up the second USB to get debug messages and safemode backtraces

slender iron
manic glacierBOT
manic glacierBOT
#

@ktroo I don't understand why there are now merge conflicts noted, since you are just adding files.

Do you see @skieast's suggestion of removing pins that are not accessible?

I don't understand the merge conflicts either. Strange. But I am new to this whole process, so maybe I did something accidentally.
I did see @skieast's suggestions. On board neopixel is already defined:
https://github.com/adafruit/circuitpython/blob/5c4997850c84c8add0b2967acd99c0643d390521/ports/espressif/b...

#

@ktroo I don't understand why there are now merge conflicts noted, since you are just adding files.
Do you see @skieast's suggestion of removing pins that are not accessible?

I don't understand the merge conflicts either. Strange. But I am new to this whole process, so maybe I did something accidentally. I did see @skieast's suggestions. On board neopixel is already defined:

https://github.com/adafruit/circuitpython/blob/5c4997850c84c8add0b2967acd99c0643d390521/ports/es...

manic glacierBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
#

I still think that the clear at least should be optional. There's really no reason to clear the display prior to displaying the desired image, except that it takes twice as long as it needs to.

BTW, re: the busy pin, I would also suggest that we consider the method override here. I have another eink display, it has a busy pin, but it's only set as a result of sending a "busy check" command. i.e:

is_busy():
send_command(busy_cmd)
digital_read(busy_pin)

manic glacierBOT
graceful rain
#

@crimson ferry got a debug build up, and observed debug serial, but it didn't really show anything aside from the usual:

Build:Oct 25 2019
rst:0x3 (RTC_SW_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x4002b865
SPIWP:0xee
mode:DIO, clock div:1
load:0x3ffe6100,len:0x1688
load:0x4004c000,len:0x1048
load:0x40050000,len:0x2f04
entry 0x4004c350
I (24) boot: ESP-IDF v4.4-dev-3608-gbbe2a1bf34 2nd stage bootloader
I (24) boot: compile time 23:14:23
I (24) boot: chip revision: 0
I (28) qio_mode: Enabling default flash chip QIO
I (33) boot.esp32s2: SPI Speed      : 80MHz
I (38) boot.esp32s2: SPI Mode       : QIO
I (43) boot.esp32s2: SPI Flash Size : 4MB
I (47) boot: Enabling RNG early entropy source...
I (53) boot: Partition Table:
I (56) boot: ## Label            Usage          Type ST Offset   Length
I (64) boot:  0 nvs              WiFi data        01 02 00009000 00005000
I (71) boot:  1 otadata          OTA data         01 00 0000e000 00002000
I (79) boot:  2 ota_0            OTA app          00 10 00010000 00160000
I (86) boot:  3 ota_1            OTA app          00 11 00170000 00160000
I (93) boot:  4 uf2              factory app      00 00 002d0000 00040000
crimson ferry
#

So it hasn’t gone into safe mode yet?

#

When it does, the crash dump will print there with the traceback addresses

manic glacierBOT
manic glacierBOT
#

Here is the CircuitPython level driver I did with the waveshare breakout for the 7": https://github.com/adafruit/Adafruit_CircuitPython_ACeP7In/blob/main/adafruit_acep7in.py

I see a couple little differences in the sequences but it is mostly the same.

I tried the py library, it worked, so took the changes into the board.c and it's working just fine now. I'm not sure if it was the rotation, or moving the PON command. Don't care at this point, hard to argue with success.

I'm stil...

manic glacierBOT
#

Does it make sense to have these in reverse order? The order you have in the fields array is correct. And in your sample you reverse them again https://github.com/bablokb/circuitpython-examples/blob/master/inkyframe57/main.py#L185

Should this just be ascending order?

The order is correct, to match key-event number with keycode. I reverse it again in my sample code only for the led-list that I am using. L183+184 show how the codes match with the tuple.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0 on 2023-05-22; Adafruit Metro M4 Express with samd51j19

Code/REPL

import board
import busio
import digitalio

print("\n")

cs = digitalio.DigitalInOut(board.D5)
cs.direction = digitalio.Direction.OUTPUT
spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO)

while not spi.try_lock():
    pass
    
baudrates = [1,10,100,1000,5000,10000,25000,50000,100000,500000,1000000,2000000,300000...
manic glacierBOT
#

The actual frequency is set not by a number, but by multipliers and dividers on one of the internal clocks. There are only so many combinations of those available, so it's not possible to set a precise frequency. You should instead always specify the maximum frequency supported by the peripheral you want to talk to, and CircuitPython will use the highest available frequency that is smaller or equal to what you have specified.

brazen hatch
#

πŸ‘€

orchid basinBOT
tulip sleet
#

@onyx hinge @slender iron I am going to make an 8.2.0-beta.0. Release notes are all done. I don't see any imminent PR's. OK by you?

onyx hinge
#

@tulip sleet I have nothing pending for synthio that affects behavior, just an added set of tests

tulip sleet
#

sounds good; the main point of this is to refresh synthio and get some new boards in

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 8\.2\.0\-beta\.0
proven garnet
#

@idle owl heads up that adabot failed the bundle cron last night. I'll dig into it, but letting it fail again might help. I'll have it fixed this week though.

manic glacierBOT
proven garnet
#

🫑 its prooooobably NAU7802

idle owl
#

Agreed

proven garnet
#

But the error text was... lacking in helpful information. I'll likely need to poke it locally

#

Actually, did anyone turn on branch protection for the Adafruit Bundle repo recently? I re-ran it and it's giving me the same issue.

#

I think Adabot is supposed to be able to write to the main branch but can't now for some reason. At least that's what the error suggests.

idle owl
#

OK, I'll check.

proven garnet
#

Oh that might be the old action again, but that's what the error was the first time at least

#

We'll see what re-running does

#

Yup, same thing.

idle owl
#

I am not seeing anything indicating we changed something.

proven garnet
#

hmmmmmmmm, it definitely reads like a permissions issue with actually pushing the changes.

#
   STDERR:
remote: Resolving deltas:   0% (0/3)        
remote: Resolving deltas:  33% (1/3)        
remote: Resolving deltas:  66% (2/3)        
remote: Resolving deltas: 100% (3/3)        
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.        
remote: error: GH006: Protected branch update failed for refs/heads/main.        
remote: error: At least 1 approving review is required by reviewers with write access.        
To https://github.com/adafruit/Adafruit_CircuitPython_Bundle.git
 ! [remote rejected] main -> main (protected branch hook declined)
error: failed to push some refs to 'https://github.com/adafruit/Adafruit_CircuitPython_Bundle.git'
idle owl
#

Do me a favor, and take a look? And do a google search on what setting would block that? Because I did both, and not seeing anything or getting a useful search result.

manic glacierBOT
proven garnet
idle owl
#

Yeah I was seeing that.

#

We need to fix that or figure out excluding Adabot only from that. Except on neopixel. πŸ˜„

proven garnet
#

I can look into that.

idle owl
#

Thanks. But let's figure this out first.

#

Wait.

#

It does say "require a PR before merging".

manic glacierBOT
#

It is common to have write() and readinto() functions that take in WriteableBuffer and ReadableBuffer. The are some cases where you want to send or receive as you go. We've thought about this mostly in terms of async versions of these APIs. However, I wonder if it'd be ok to accept new FIFO types along side the fixed buffers. The corresponding methods would return immediately when given a FIFO. Then, data would be read or written via the FIFO. By taking in a new type, the old API is p...

idle owl
#

But you can create roles that are excluded. Thing is, who is Adabot running as? She's not an actual user I think? So how do we create the exclusion role since I think it runs under multiple users?

proven garnet
idle owl
#

I don't have any way to check when or who did that.

#

But there it is.

proven garnet
#

So giving her an exception should be sufficient for CI purposes

slender iron
#

adabot should be a separate account

tulip sleet
#

I can turn that off immediately. I did it because GitHub started warning about unprotected branches. In regular libraries this makes sense: a library update should have a PR. We can add exclusions.

#

We can give adabot (adafruit-adabot?) this bypass permission:

proven garnet
#

I like making sure no one can write to main, but that's also what will happen a lot haha

tulip sleet
#

I'm sorry I caused trouble here; I didn't realize there was direct pushing to main on the Bundle.

proven garnet
#

No worries! Glad it's not a chase down the rabbit hole if anything πŸ˜„

tulip sleet
#

so what privileges does adafruit-adabot need on the Bundle repo? I think Admin.

proven garnet
#

Is that sweeping permissions? The ones I can think of are anything relating to contents, Actions, and workflows.

tulip sleet
#

or Maintain

#

I can make a custom role

proven garnet
#

That would also be great, and might be futureproof for adding more people

#

If that ever happens

tulip sleet
#

uhh, can't do it without being GitHub Enterprise, which we are not

proven garnet
#

Excluding adabot would help at least

#

Not sure the difference between admin and maintain though in terms of permissions

tulip sleet
#

admin can delete the repo, etc. basically superuser on the repo

#

maintain is not good enough to bypass protections.

#

So I can make adabot be admin, or take away the rule

proven garnet
#

@idle owl, what are your thoughts when you get a chance?

#

Even if you take away the rule, adabot couldn't delete, right?

tulip sleet
#

ok, I did this:

  1. Make adafruit-adabot have Maintain.
  2. Turn off all the branch protection stuff (PR required, etc., except this:
#

I turned this on. I think this will allow PR merges from Librarians, and allow direct pushes from adabot. Is there an easy way to test the adabot role now?

#

I could re-run the failed job from last night?

#

I'm not sure that Librarians can merge PR's to Bundle now, with that set.

#

So worst case, we just delete the protection rule, if this doesn't work.

proven garnet
tulip sleet
#

actually, for 2. above, I added Librarians to who can push, so that should be fine now.

tulip sleet
proven garnet
#

@tulip sleet @idle owl all fixed! Adabot works again!

#

Thanks for the quick fix!

tulip sleet
#

yay! I now understand this better. One more q -- sometimes we do massive changes across all libraries. I thought these were sometimes done without PR's. Is that (still) true? Are the branch protection rules getting in the way of that? Your latest change was all PR's.

proven garnet
#

All those PRs I did were pretty much exclusively due to branch protection. I might PR changes that do require a second look like pylint updates but yesterdays weren't in that category.

tulip sleet
#

but the patch is a direct push to main, is that right? On libraries without branch protection rules that would be no problem, but since I've been adding those rules, then that won't work any more. So I should allow adafruit-adabot to push directly in the branch protection rules, and then it will work agian.

#

i don't know if there were no branch protection rules before, but maybe that was the case.

proven garnet
#

So yeah, allowing adafruit-adabot will fix those and prevent any pushes from humans, but that also means any pushes that are hand-tuned or manual pushes (maybe the patch could be applied like yesterday's to many libraries), it now means all those will need to be PRs now. Before I used to be able to just push directly to main.

manic glacierBOT
#

Please do split issues up, since they can be fixed one at a time.

so we would need to have pull=UP and pull=DOWN as option?!

Instead of that, I think I would add a normally_open=True optional argument, to handle normally closed switches.

I'm not sure we want to add lots more features to keypad, because it makes it larger and it might stop fitting on smaller builds. But adding some kind of access to the Event queues would make it possible to do some of this in Python inste...

proven garnet
#

I think I can sidestep it if I'm provided a PAT and authenticate as adabot, so that's one solution if we want to keep those protections but temporarily allow manual fixes like yesterday's to avoid generating a ton of PRs. Or not, I'm open to solutions of any kind.

#

The other case is I have scripts for doing patches that are patched by parsing repository contents using Python as opposed to git format-patch, so those also come from a human and not adabot. So same things as above apply there. An example of such a patch would be change all SPDX authors to FooBar - git format-patch would fail so I use parse in Python to iterate through all the libraries and do it, checking, writing, committing, and pushing.

manic glacierBOT
#

Before I start opening new issues, let's think if one big change can solve a bunch of problems at once.
Then I think keypad should at least take digitalio.DigitalInOut, adafruit_tca8418.DigitalInOut, adafruit_74hc595.DigitalInOut and the like.
This way we can remove shift register scanner from keypad library altogether without losing shift register support and still gain support for shift register or mixed matrices.

idle owl
#

@proven garnet @tulip sleet Thanks for the fix! If we need to do something more broadly with the libraries, please loop me in.

manic glacierBOT
orchid basinBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
#

Example of doing this in raw python code (micropython): https://raspico.blogspot.com/2022/05/using-pio-to-interface-ps2-keyboard.html

This could be used as a guide for implementing ps2io in "plain circuitpython" or for creating a C implementation in the core.

There's also an implementation of the related IBM PC keyboard protocol in https://learn.adafruit.com/ibm-pc-keyboard-to-usb-hid-with-circuitpython/overview

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0 on 2023-05-22; VCC-GND YD-ESP32-S3 (N16R8) with ESP32S3

and

Adafruit CircuitPython 8.1.0 on 2023-05-22; ESP32-S3-Box-Lite with ESP32S3

and

Adafruit CircuitPython 8.1.0 on 2023-05-22; Espressif ESP32-EYE with ESP32

Code/REPL

from debugfun import breakpoint, vars
import supervisor
supervisor.status_bar.console = False
supervisor.runtime.autoreload = False

help("modules")

import microcontr...
manic glacierBOT
#

Is this still an issue? I don't see that the Espressif issue is closed, but for some reason I thought it had been fixed and added back the temperature check in my wifi code some time ago without any problems since.

As a double-check, just ran this for over an hour on
Adafruit CircuitPython 8.1.0-beta.2 on 2023-04-26; Adafruit QT Py ESP32S2 with ESP32S2:

import time
import os
import wifi
import microcontroller

def seconds_to_iso_time(s, tz):
    st = time.localtime(s)
   ...
cerulean fractal
#

Hi! I have a question: why aren't there any ports for MCU modules? The kind you solder onto a carrier board. What are the challenges for supporting these?

#

Or is it the question of target audience?

lone sandalBOT
manic glacierBOT
#

I'm ok if you want to add a kwarg to make it optional. The code I was modelling after for Good Displays says it is needed so I did that here and think we should by default.

I would support this. I am running an InkyImpression (with the same display as the InkyFrame 5.7") for years now without the initial clear (update is once a day). The visual appearance does improve with a clear, but this can be done e.g. once a week from application code as well.

stuck elbow
#

if you build a board using a module, you can add a board definition for it

cerulean fractal
jaunty juniper
#

Then again, pure modules are not super practical, considering how CP generally relies on a USB port or at least a dedicated serial (with a serial-to-usb chip). You wouldn't really be able to use a generic build without specifying at least one of those

cerulean fractal
#

Yeah, makes sense... There's usually only one USB interface, that can probably be assumed as default

manic glacierBOT
manic glacierBOT
#

From what I understand about audio-frequency signal processing it mostly proceeds in lock-step, so fixed sized buffers are more commonly used. Furthermore, there may be a topology in which the output of one block is consumed as inputs by two or more blocks (or, in unusual circumstances, two copies of an output might be consumed by a single block), which is another way in which a FIFO model doesn't seem matched, since only one consumer gets to consume any particular item from a FIFO.

So, ba...

manic glacierBOT
manic glacierBOT
#

Hello, This issue was reproduced using ESP-IDF sample application which mounted an SD card and then tried to initialize the DMA engine.

I (287) gpio: GPIO[18]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (297) sdspi_transaction: cmd=52, R1 response: command not supported
I (337) sdspi_transaction: cmd=5, R1 response: command not supported
I (377) ADC DMA: Filesystem mounted
Name: SU16G
Type: SDHC/SDXC
Speed: 20 MHz
Size: 15193MB
I (377) ADC DMA: T...
manic glacierBOT
#

Tested on prototype board. STEMMA I2C works. SD card works with sdcardio (sdioio not implemented on RP2040).

Pin naming note:

The Metro RP2040 has a TX/RX swap switch, because on RP2040 GPIO0 must be TX and GPIO1 must be RX, which is opposite from the Arduino pin convention.

Since the RX and TX pins no longer correspond immutably to D0 and D1, ther are two possibilities I can think of for handling this:

  • Omit board.TX and board.RX completely. User will need to specify `boar...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Minor updates to make code for buttons and LEDs running on the PCA10056 compatible with the PCA10100. Focus was to make this code snippet portable between the two boards (They are practically identical...):

import board
from digitalio import DigitalInOut, Direction, Pull
import time

# LED setup.

led1 = DigitalInOut(board.LED1)
led2 = DigitalInOut(board.LED2)
led3 = DigitalInOut(board.LED3)
led4 = DigitalInOut(board.LED4)
led1.direction = Direction.OUTPUT
led2.directi...
manic glacierBOT
#

I have successfully re-recreated this a learned a little bit about it, but still need to dig a bit further and do not have an actual solution to propose.

A few findings from my testing:

  • Line object makes it go much slower than Rect objects. I tested by changing the 150 loop to make Rects instead of Lines and the display refreshes much faster in that case. (even if I make the Rects be 100x100 which is the size of the Bitmap for the Diagonla Lines)
  • Line objects are not just inherentl...
manic glacierBOT
manic glacierBOT
#

8.1.0
QT Py SAMD21
Thonny

https://forums.adafruit.com/viewtopic.php?p=973733

import board
import busio
uart = busio.UART(board.TX, board.RX, baudrate=4800, bits=7, parity=EVEN, stop=2, timeout=0.5)

Note that EVEN is undefined, so it shouldn't get to the constructor call.

Doing the above in the REPL causes the error to be reported followed by a safe mode crash, repeated attempts to reconnect from Thonny. For the user, with an unprotected bootloader, it bricked the b...

manic glacierBOT
orchid basinBOT
#

As an exploration, I implemented circuitpython.org using 11ty here: cp-org-11ty
This exploration is just for fun (and is unfinished) but might be helpful to this issue. Also it doesn't address the renaming/redirect issue.

11ty is nice because:

  • You can create collections programatically. Which could make creating collections based on complex filtering criteria easier than doing it in liquid.
  • You can use any of these templating languages: ...
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0 on 2023-05-22; ESP32-S3-Box-Lite with ESP32S3

Code/REPL

import time
import array
import audiocore
import board
import audiobusio

audio = audiobusio.I2SOut(board.I2S_SCLK, board.I2S_LRCK, board.I2S_CODEC_DSDIN)
d = array.array("H", [0])
d[0] = 0b1111111111111111
print(d)
w = audiocore.RawSample(d, sample_rate=8000)
audio.play(w, loop=True)
while True:
  time.sleep(1)

Behavior

This is...

#

CircuitPython version

Adafruit CircuitPython 8.1.0 on 2023-05-22; ESP32-S3-Box-Lite with ESP32S3

Code/REPL

import board
import audiobusio

audio = audiobusio.I2SOut(board.I2S_SCLK, board.I2S_LRCK, board.I2S_CODEC_DSDIN)

def breakpoint():
    while True:
        _dbg_input = input('> Input:\n')
        print('> Output:')
        if _dbg_input:
            try:
                exec(_dbg_input)
            except Exception as e: 
                ...
manic glacierBOT
#

Hi,

Thank you for your reply.

I figured out where does the 192.168.4.* comes from. It come from a esp8266 running micropython code:

from debugfun import breakpoint, vars
print("Activating network")
import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect('****', '****')

I guess it goes into some kind of AP mode with the same SSID and pwd but not functional.

Also, I guess the Document page need to be modified.
[https://docs.circuitpython.or...

lethal grove
#

Hey folks, anyone want to help with some under-the-hood circuit python library extension stuff?

I'm trying to add a library to CircuitPython (the library in question is from Neuton, a TinyML platform - https://lab.neuton.ai )

My team and I used to have this library compiling, but Neuton went and changed how they distribute their code. Previously, they gave a file tree that was

/YourModel
/Artifacts
/neuton
/include (h files)
/lib (c files)
/neuton_generated

But they've changed it so that /lib contains .a files (https://fileinfo.com/extension/a) - and now CMake is unhappy with our old tools for binding the library into CircuitPython claiming that it can't find a rule to make Neuton.C, which now doesn't exist.

How should I direct CMake to parse a ".a" file.

Even a start on what to read up on would be helpful because it's currently bottlenecking our project and I don't know how to fix it.

Thanks in advance!

brazen hatch
#

or was it .S It's 6am with no sleep, idk anymore

manic glacierBOT
manic glacierBOT
#

The connect comments could be clarified. If the station is disconnected, the code will make several reconnection attempts, but it can't guarantee that the external conditions are ready for a successful connection. Sometimes those retries are enough, sometimes not. And sometimes user code may want to do something else if it can't reconnect, like display an error, or try a different AP.

brazen hatch
#

I feel like wifi reconnection should be something like a periodic check.
If it has connected once successfully, it should do a bunch of attempts at once when it's lost. And then more attempts at intervals within backround_tasks

#

my engluish is dying, 8am after allnighter

#

Doing a bunch of attempts when a problem has just occured is not really helpful in most scenarios.

crimson ferry
#

yeah, we should probably entertain some other strategies

#

tough call though, at some point you may want to send it back to user code to make a decision

brazen hatch
#

As it stands now, it 'wants' to be seemless.
Which it really isn't.
But it's a good time to decide on api changes cuz 9.0.

crimson ferry
#

I seem to recall some discussion of whether web workflow auto-reconnect should trigger more aggressive always-connected approach

#

and then there are still differences in behavior between espressif and raspberrypi

brazen hatch
#

The thing is just that I am now so happy with S3 that picow just feels sad in my eyes.

crimson ferry
#
Adafruit CircuitPython 8.1.0-beta.2 on 2023-04-26; Adafruit QT Py ESP32-S3 no psram with ESP32S3
>>> import os, wifi
>>> wifi.radio.connect(os.getenv("WIFI_SSID"), os.getenv("WIFI_PASSWORD"))
>>> wifi.radio.connected
True
>>> 
soft reboot

Auto-reload is off.

Code done running.

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

Adafruit CircuitPython 8.1.0-beta.2 on 2023-04-26; Adafruit QT Py ESP32-S3 no psram with ESP32S3
>>> import wifi
>>> wifi.radio.connected
False
```vs.```py
Adafruit CircuitPython 8.1.0-rc.0-6-g6cfdbfbdd on 2023-05-21; Raspberry Pi Pico W with rp2040
>>> import os, wifi
>>> wifi.radio.connect(os.getenv("WIFI_SSID"), os.getenv("WIFI_PASSWORD"))
>>> wifi.radio.connected
True
>>> 
soft reboot

Auto-reload is off.

Code done running.

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

Adafruit CircuitPython 8.1.0-rc.0-6-g6cfdbfbdd on 2023-05-21; Raspberry Pi Pico W with rp2040
>>> import wifi
>>> wifi.radio.connected
True
#

(web workflow off in both cases... espressif disconnects on reload, raspberrypi does not)

brazen hatch
#

That's cuz on rp2 it never resets the wifi stuff underneath.

#

Not much can be done with the current code.

crimson ferry
#

your breakfast time, my sleep time (don't know if we had crossed paths yet, but I was in your city last summer πŸ™‚

brazen hatch
#

A rewrite would be needed.
And with the current api, that would be pointless.

brazen hatch
crimson ferry
#

nope

#

I wish Discord supported as much Markdown as GitHub (like <details>)

brazen hatch
#

Discord could do a lot more to be a professional tool.
but doesnt, prolly intentionally

#

Business discord would annihilate slack

humble shadow
#

Hey, I might need some help with editing these files for a new circuitpython board i'm developing. Before I get into it, is this the right channel for these types of questions?

random junco
quaint monolith
#

I've developed a system where I control mouse movement from a Windows device connected to my Raspberry Pi via a socket connection. When I send the movement coordinates (x, y) from the windows device to the Raspberry Pi, the messages sent go so fast, they manage to make the mouse move but slip and don't have time to be properly executed.

I've tried sending the coordinates sequentially with a delay (time.sleep) between each transmission. This works, but it slows down mouse movement considerably, which is undesirable as I jerk and lose a lot of fluidity.

I also tried using an execution queue to process the coordinates sequentially, but this didn't solve the smoothness problem.

I'm now looking for advice on the best approach to solve this problem and make mouse movement smoother, without introducing additional delays or latency.

I would greatly appreciate any help or suggestions to improve the smoothness of mouse movement in my system.

Thank you in advance for your assistance!

brazen hatch
#

Turn mouse acceleration off from sys settings.
To make it look like human movement send many coords of smaller steps to the pc, or even make it go to (x,y) in a curve.
Disclaimer: I pulled an allnighter, may have misread the wall o' text.

#

The trick virtual machine software use is to register the hid device as a pen-touch tablet.

#

So that regardless of os, it doesn't overshoot.

#

Pretty sure it's not in CP as of now though.

#

@quaint monolith

brazen hatch
#

And it still overshot?

#

Weird.
I haven't touched usbhid in a bit, but last I checked it worked fine.

quaint monolith
#

yes, my mouse receives the coordinates and moves but it drifts

quaint monolith
#

but I can't help but send so many

brazen hatch
#

I mean, that really isn't a great idea.
How about implementing some sort of 'fps' cap?
Like, every second I want to send n updates max.
So divide 1 by n.
Setup a time check func that reads last update time & time monotonic.
If the threshold isn't met, discard the update.

#

This way it can just send updates based on that n, regardless of the speed of the code.

#

I suggest starting with a small n like 10.

quaint monolith
#

infact every movement of my mouse means that I have to update the coordinates sent to my raspberry. So if I have 144 fps I have to try to send as much as possible so as not to feel the latency

brazen hatch
#

During development I suggest you don't be overzealous with speed.
Optimisations can be done later, and the handicaps can be removed at any time.

quaint monolith
#

I don't think I fully understand your proposed solution to help me. I don't know if it's the translation into my language that doesn't make me understand, but I'm having trouble.

brazen hatch
#

time.monotonic() - stored_time > 1/n

#

Is the tl;dr.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0 on 2023-05-22; Raspberry Pi Zero W with bcm2835

Code/REPL

print("Hello World!")

Behavior

  • The gadget serial interface and CIRCUITPY drive are unavailable.
  • Inspecting the sd card confirms that the 2nd partition was created successfully.
  • Content of boot_out.txt is as expected and does not provide any clues.

Description

The console on GPIO 14/15 shows the usual output but seems to ...

quaint monolith
brazen hatch
#

I didn't say any "you can't".
What I said is that you should limit the number of 'sends' per second.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0 on 2023-05-22; M5Stack Timer Camera X with ESP32

Code/REPL

Code done running.

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

Adafruit CircuitPython 8.1.0 on 2023-05-22; M5Stack Timer Camera X with ESP32
>>> import os
>>> a = open("/test", "w")
>>> a.close()
>>> os.remove("/test")
>>>

Behavior

root is mounted rw

Description

It could have to do with the web-workflow.

By ...

lethal grove
manic glacierBOT
manic glacierBOT
#

After bisecting it looks like the pystack fix for the espressif chips in commit 7d02bff is causing this:

-    if (stack_get_bottom() != NULL) {
-        mp_stack_set_limit(stack_get_length() - 1024);
+    uint32_t *stack_bottom = stack_get_bottom();
+    if (stack_bottom != NULL) {
+        size_t stack_length = stack_get_length();
+        mp_stack_set_top(stack_bottom + (stack_length / si...
manic glacierBOT
#

Confirmed @RetiredWizard thank you

With

(ENV-circuitpython) graeme@sleeper-service:~/git/circuitpython/ports/broadcom$ git diff
diff --git a/main.c b/main.c
index 122f079129..a32365defe 100644
--- a/main.c
+++ b/main.c
@@ -160,7 +160,6 @@ STATIC void start_mp(supervisor_allocation *heap, supervisor_allocation *pystack
     uint32_t *stack_bottom = stack_get_bottom();
     if (stack_bottom != NULL) {
         size_t stack_length = stack_get_length();
-        mp_stack_set_t...
thorny jay
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0 on 2023-05-22; SAM E54 Xplained Pro with same54p20

Code/REPL

-

Behavior

USB drive appearing instead of CIRCUITPY drive.

Description

Hello, could someone help me understand why after installing the latest CircuitPython to my SAM E54 Xplained Pro, the "CIRCUITPY" drive does not appear but "USB Drive" appears instead?

Additional information

No response

manic glacierBOT
#

Cheers! @RetiredWizard

Serial console setup
Adafruit CircuitPython 8.1.0-dirty on 2023-05-29; Raspberry Pi Zero W with bcm2835
Board ID:raspberrypi_zero_w
UID:00000000XXXXXXXX
0;🐍Done | 8.1.0-dirty
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
0;🐍code.py | 8.1.0-dirtyHello World!
0;🐍Done | 8.1.0-dirty
Code done running.

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

The hunt for one of those elusive 2w's is...

manic glacierBOT
#

Here are some things to check:

  • See https://forums.adafruit.com/viewtopic.php?p=838854#p838854, and the whole thread. A user had trouble, and it turned out some board jumpers were set wrong.
  • (If I remember right:) A user had trouble with a newer SAMD21 Xplained board. It turns out Microchip changed the flash chip on the board during the chip shortage without much if any notification. Perhaps they did something similar on this board. Currently the board build is only expecting an `N25Q2...
vague thicket
#

Hello, is here anybody who could point me to some tutorial for writing/porting epd driver or describe me how to debug SPI data for it? I asked in help with circuitpython, but except @slender iron (thanks!) nobody respond. Display is working under Arduino, but I would like to use it with CPY. It should have Il0371 driver, and I think I have right datasheet for it and I'm also comparing some part (start sequence) to working code in Arduino. I have logic analyzer connect to my ESP32-S3 dev board so I can see what is happening at the bus and compare it to the Arduino code. I have this V1 display (https://www.waveshare.com/wiki/7.5inch_e-Paper_HAT_(B)_Manual#Introduction ), which should have this datasheet ( https://www.waveshare.com/w/upload/2/29/7.5inch_e-paper-b-Specification.pdf ) and I'm trying to change Il0373 driver from Adafruit. I also tried to search this, but without luck. Many thanks for response.

spiral storm
#

What's the best way for including assets (e.g. mp3 files) to be added to the filesystem on init? You can explicitly write small files like the default code.py, but that'd be messy for something as large as an mp3. Is there a path for doing this similar to how we include frozen python modules?

blissful pollen
spiral storm
crimson ferry
#

not sure about nRF though

manic glacierBOT
#

Not tested on hardware yet, but gives plausible results for the new manual host computer test "synthio/note/biquad.py"

My main reference has been https://www.w3.org/TR/audio-eq-cookbook/

each note can have just 0 or 1 biquad filters, there's not a filter topology.

the filter property can in theory be dynamically updated but I didn't test it; I think there's not actually a sound mathematical theory of how changing the a/b coefficients dynamically affects things, since the internal `...

proven garnet
#

Ah nevermind, it just creates a filesystem image file, not a UF2.

dusk mist
# vague thicket Hello, is here anybody who could point me to some tutorial for writing/porting e...

Since we're in the same boat here with trying to port this driver to be displayio-compatible (given that we chatted before about this and I'm working on the 2.13 display), I can help you out up to a certain point because I got mine working... with some caveats. I'm using 8.2 (though I started in 8.1 and it works there too) I got the init to work, but I couldn't get it to refresh the display the normal way.

Everything checks out according to the probe though except for the part where it uploads the framebuffer to RAM, but that's a displayio quirk for good reason. What doesn't make sense is that it won't refresh the display even when I supplied the bitpacked commands. The probe says it's coming in but it just doesn't happen. Knowing that my custom driver works with no delay included, I pretty much just packed everything into the init code and sure enough, it works. I think it's something between the init and the refresh commands that's screwing it up. Possibly the upload to RAM but I dunno. I need to investigate it, maybe even include the busy pin because I know waveshare devices kinda mess that up too.

#

I just realized that it only does that when I hard reset it so that's something to dig into as well. XD

manic glacierBOT
dusk mist
# dusk mist I just realized that it only does that when I hard reset it so that's something ...

I finally got it! It's the baudrate. Turns out, the custom SPI method I was using was at the right speed at 4000000β€”or rather, it hits a speed wall around that point that works just fine. But on displayio, I have to crank it down to something like 10000 because it's way too fast otherwise. Like x10 too fast on 4000000 based on the timings. Now it works. Still needs to hard reset but I'm finally in. XD

manic glacierBOT
manic glacierBOT
#

Cannot reproduce exactly on regular esp32, however got a weird crash.

Adafruit CircuitPython 8.1.0 on 2023-05-22; M5Stack Timer Camera X with ESP32
>>> import board, digitalio, touchio
>>> a = touchio.TouchIn(board.G13)
>>> a.value
False
>>> a.deinit()
>>> a = touchio.TouchIn(board.G4)
>>> a.value
False

This is one of the 3 i2c busses of the board.
On the other one, same deal fine.
On the 3rd one, and specifically pin board.BM8563_SCL, which is pin_GPIO14, this happe...

manic glacierBOT
#

Here are some things to check:

  • See https://forums.adafruit.com/viewtopic.php?p=838854#p838854, and the whole thread. A user had trouble, and it turned out some board jumpers were set wrong.
  • (If I remember right:) A user had trouble with a newer SAMD21 Xplained board. It turns out Microchip changed the flash chip on the board during the chip shortage without much if any notification. Perhaps they did something similar on this board. Currently the board build is only expecting a...
lone sandalBOT
manic glacierBOT
slender iron
slender iron
dusk mist
# slender iron + <@340398038529081346> did you get it going? I'm back from the weekend.

I guess I ran into the same issues people had with this display showing flipped/mirrored images with displayio and eventually rediscovered (as others seem to have) that the adafruit_ssd1680 driver perfectly works fine with the 2.13 inch. I still think Waveshare's implementation clashes with displayio; currently, I can get it to refreshβ€”not display the images I want, but surprisingly the "code is done running" message and at any baudrate. But I don't think it matters much in this case because it's probably their init sequence, which the ssd1680 completely sidesteps.

Not a waste of time though since my main goal is to get the 7.5 inch working (I think dronecz and I have the same model) and this gives me a lot of info to go with. Maybe the ssd1680 works there too but I haven't started yet.

slender iron
#

so the ssd1680 sequence works ok

dusk mist
#

Yeah. I'm totally surprised because its init sequence is pretty simple, which makes me think these displays might have some level of ubiquity with them.

onyx hinge
#

<@&356864093652516868> we'll be having the weekly meeting in round about an hour. Please add your info to the notes doc if you haven't yet! https://docs.google.com/document/d/1VcPOjquw3lEHudLutRlrpuA2AQNsrTsxyYjwu2nnvZY/edit?usp=sharing

#

@lone axle are you good to run the meeting today even though it's tuesday?

lone axle
vague thicket
# slender iron + <@340398038529081346> did you get it going? I'm back from the weekend.

I did not 😦 I tried to change code from @dusk mist , but without luck. Strange for me is that, that display does completely nothing in CPY, but it works in same setup in Arduino. I´m also using this code (https://github.com/lemariva/uPyEINK/blob/master/frozen_modules/e7in5.py ) as reference as far as I can tell it is pretty similar to Arduino implementation (https://github.com/ZinggJM/GxEPD2/blob/master/src/epd3c/GxEPD2_750c.cpp) .

I changed MPY driver to this (comments may not be right).

I watched today stream from @lone axle where he was fighting 7 color EPD and it did not look that hard, even when he was bit lost as IΒ΄m right now.

GitHub

Control a Waveshare 7.5" E-INK display using an ESP32 running MicroPython - uPyEINK/e7in5.py at master Β· lemariva/uPyEINK

GitHub

Arduino Display Library for SPI E-Paper Displays. Contribute to ZinggJM/GxEPD2 development by creating an account on GitHub.

lone axle
slender iron
#

@vague thicket did you try with the regular il0371 driver?

#

I'd get two logic captures and compare them

vague thicket
slender iron
#

ya true. and I'm trying that with mcu flasher stuff too

#

I meant more broadly

manic glacierBOT
blissful pollen
#

Lurking remotely today so did not add any notes

onyx hinge
#
Adafruit Industries - Makers, hackers, artists, designers and engineers!

From the GitHub release page: This is CircuitPython 8.1.0, the latest minor revision of CircuitPython, and is a new stable release. Notable changes to 8.1.0 since 8.0.0 Silicon Labs (SiLabs) MG24 m…

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

From the GitHub release page: This is CircuitPython 8.2.0-beta.0, a beta release for CircuitPython 8.2.0, and is a new unstable release. Notable changes to 8.2.0 since 8.1.0 Continued enhancement o…

onyx hinge
#

sdomoszlai13 was on yesterday's report with a merged pull request, thank you!

idle owl
#

@midnight ember Thanks for handling the SSD1306 support issue!

lone axle
onyx hinge
#

for those who are curious the error that occurs when calling the show method with a Group is: ```Traceback (most recent call last):
File "code.py", line 41, in <module>
TypeError: function takes 1 positional arguments but 2 were given

Could we add specific error handing in `show` that prints a useful error?
onyx hinge
#

thanks all!

#

OK, I'll see y'all around!

lone axle
#

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

vague thicket
#

https github com adafruit Adafruit

midnight ember
#

Just making it back online. The SSD1306 thing I just wanted to bring up the issue. How it's handled is completely up to the librarians and learn guide people that is beyond anything else I could contribute to the conversation. Hearing the discussion amongst the people it's most relevant to was the goal for bringing up the issue.

#

Even something as simple as a header comment # this library is designed for framebuffio and not for displayio use or something as simple as that.

#

whatever you all decide how to handle the confusion is beyond me. had no idea it would affect so many other display libraries. if there's a larger naming convention confusion issue then it should be addressed across the libraries. that was a really interesting conversation.

tidal kiln
midnight ember
#

part of the problem is when google searching circuit python ssd1306 examples it dumps you into an examples folder. you never see the base directory where the deprecated warning is. the deprecated page could have a huge warning with an animated gif myspace style and it would have no effect as the google search bypasses it and dumps you into the examples folder... which is what you want if you're searching for a github example. so the warnings are bypassed. header commenting in the example files is needed too.

midnight ember
idle owl
lone sandalBOT
slender iron
#

@onyx hinge here is my brainstorm for what each physical synthio module would have: ```
Modular synthio

LFO:
OLED for displaying waveform
waveform: rotary switch with detents
rate: pot and input jack
offset: pot and input jack
phase_offset: pot and input jack
scale: pot and input jack
once: toggle
interpolate: toggle
output: output jack

Math:
operation: rotary switch with detents. 14 options
a: pot or input jack
b: pot or input jack
c: pot or input jack
output: output jack

Envelope:
OLED for displaying envelope.
attack_time: pot
decay_time: pot
release_time: pot
attack_level: pot
sustain_level: pot

output: jack

Noterizer:
OLED for waveform
waveform: rotary switch with detents
panning: input jack
amplitude: input jack
bend: input jack
ring_bend: input jack

winged willow
#

Has anyone got any resources for library construction? Specifically for i2c building?
Don’t really know what I’m doing properly but I’m trying to port a library for the Pimoroni IO Expander board.
I’m getting some data out tho it’s not quite right yet, but I’ve a way to go and need to handle interrupts etc somehow too.
Here’s what I have so far:

https://github.com/mathcampbell/IOExpanderCircuitPython

GitHub

CircuitPytthon port of the Pimoroni IO Expander Breakout library - GitHub - mathcampbell/IOExpanderCircuitPython: CircuitPytthon port of the Pimoroni IO Expander Breakout library

slender iron
#

I'd suggest starting with another circuitpython io expander library

onyx hinge
#

@slender iron cool! the number of analog I/Os required for some of those is large!

slender iron
#

None would be analog. The jacks would just connect one thing to another

#

We’ll pots would be analog I guess

still zephyr
# winged willow Has anyone got any resources for library construction? Specifically for i2c buil...

Hello, I took a look at the code that you previously share. I would recommend use the Adafruit_register library, this will handle all the register address and masking and register for you, so you do not need to figure what mask to use. However, I am more a hands on person, so Ill try the code on the hardware. and then compared with other code available, I have done some I2C libraries from scratch for Circuipython. we could discuss if you need. my user handle is jposada202020 in github if you want to take a look. there are also some Circuitpython Expander libraries in the community bundle if you want to take a look https://github.com/adafruit/CircuitPython_Community_Bundle/blob/main/circuitpython_community_library_list.md. Good luck !

manic glacierBOT
#

resolves: #8013

The diff shown on the changes pages is cut into a way that makes it a bit harder to follow at least for me.

The are two main changes.

  1. wrap everything except the return in here: https://github.com/adafruit/circuitpython/blob/bf67ea36405f3285bacc564e17076263ba1a5c6a/shared-module/displayio/Group.c#L441-L468 with an if statement that makes it skip looking into the members of a group that is hidden. This covers a case that wasn't mentioned in the issue which is when a...
midnight ember
#

got a weird import order from pylint submitting an example ```py
Check failure on line 13 in examples/displayio_ssd1306_picowbell_tempsensor.py
GitHub Actions / test
third party import "from adafruit_bme280 import basic as adafruit_bme280" should be placed before "import adafruit_displayio_ssd1306 as ssd1306"

#
import time
import board
import displayio
import busio
import terminalio
from adafruit_display_text import label
from adafruit_bme280 import basic as adafruit_bme280
import adafruit_displayio_ssd1306 as ssd1306
``` if it wants 3rd party imported first then why doesn't it want it imported before time, board, etc..?
#

the way pylint wants things formatted confuses the heck out of me sometimes, but i change it and it's happy so πŸ€·β€β™‚οΈ

#

maybe OCD but I always do imports first and from second, it just looks cleaner. using Mu there's no import order helper.

midnight ember
jaunty juniper
midnight ember
#

is that all it is? lol i can remember that then. πŸ‘

jaunty juniper
#

what pylint considers "3rd party import" I don't know though, are the CP builtin libraries defined in pylintrc ? I never thought about that

midnight ember
#

it only seemed to complain about the imported libraries in /lib yes

#

i've been using circuit python for like a year or two now and didn't know this...

#

i know it sounds really basic but can we get a learn guide on basic import ordering? might seem to be a nuance but not documented in any example to my knowledge.. 😟

crimson ferry
#

it's only relevant with pylint though, right? so, submitted code, maybe could go in the making libraries guide

midnight ember
#

That's true, Mu doesn't care about the ordering only pylint?

edgy edge
#

I'm using a third-party machine learning library (Neuton). The vendor just stop shipping C source code and now supply .a and .h files instead. Is this the best approach to integrating with circuit python? It compiles and links successfully, but feels like a hack. Is there a better way to add an architecture dependent library? Is there a more convenient way to update OBJ to avoid the makefile edit.?```
Vendor supplied library files in lib/Neuton
neutonml folder with init.[ch] and neuton.[ch] in shared-[bindings, modules]

my board's mpconfigboard.mk:
AULITECH_NEUTONML = 1

py/circuitpy_defns.mk:

ifeq ($(AULITECH_NEUTONML),1)
SRC_PATTERNS += neutonml/%
INC += -I$(TOP)/lib/Neuton/neuton/include -I$(TOP)/lib/Neuton
LIB_3P += $(TOP)/lib/Neuton/neuton/lib/libneuton_arm_cm4.a
endif # note the library is architecture specific

ports/nrf/makefile:

$(BUILD)/firmware.elf: $(OBJ) $(GENERATED_LD_FILE)
$(STEPECHO) "LINK $@"
$(Q)echo $(OBJ) $(LIB_3P)> $(BUILD)/firmware.objs

adding LIB_3P to the list of object files

edgy edge
#

slight improvement ties the Library to board.```
my board's mpconfigboard.mk:
AULITECH_NEUTONML = 1
AULITECH_NEUTONML_LIB = lib/Neuton/neuton/lib/libneuton_arm_cm4.a

py/circuitpy_defns.mk:

ifeq ($(AULITECH_NEUTONML),1)
SRC_PATTERNS += neutonml/%
INC += -I$(TOP)/lib/Neuton/neuton/include -I$(TOP)/lib/Neuton
LIB_3P += $(TOP)/$(AULITECH_NEUTONML_LIB)
endif # note the library is now board specific

ports/nrf/makefile:

$(BUILD)/firmware.elf: $(OBJ) $(GENERATED_LD_FILE)
$(STEPECHO) "LINK $@"
$(Q)echo $(OBJ) $(LIB_3P)> $(BUILD)/firmware.objs

adding LIB_3P to the list of object files```

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.5 on 2023-03-31; Waveshare RP2040-Zero with rp2040

Code/REPL

import board
import neopixel

from adafruit_led_animation.animation.rainbow import Rainbow

# Update to match the pin connected to your NeoPixels
pixel_pin = board.GP6
# Update to match the number of NeoPixels you have connected
pixel_num = 8

pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=0.5, auto_write=False)

rainbow = R...
manic glacierBOT
onyx hinge
onyx hinge
onyx hinge
#

Cookie cutter has a v2 file so maybe it's all ok

manic glacierBOT
#

pre-commit passes for me locally on this branch. I must have something out of date compared to the actions container.

I will try getting my stuff updated and re-run it later on tonight.

Do the trailing characters in the version string have significant meaning?

In the actions container I found:

uncrustify (0.72.0+dfsg1-2) 

Whereas locally I have:

❯ uncrustify --version
Uncrustify-0.72.0_f

Which appears to be the same major version but does differ with the ...

idle owl
manic glacierBOT
#

Now that 8.1.0 is out, I am finally getting back to this (sorry!). I think we could target this for 9.0.0. A couple of preliminary questions:

  1. Has your thinking changed since https://docs.google.com/document/d/1xlzTEdP8ovTtz5Sx8voP8R9M8fY88LuyiWBYu0muiRc/edit#, which was written in early February?
  2. Perhaps we could split this into a cleanup PR and a "new features" PR. I'm under the impression this will break the current asyncio impl. But if the current library stops using the currrent...
proven garnet
onyx hinge
onyx hinge
onyx hinge
# proven garnet Let me know if we need to address anything! And thanks <@426200547024961539>!

continuing to pile on, I noticed that there may also be deprecated nodejs actions in community bundle, there sure are in https://github.com/jepler/Jepler_CircuitPython_udecimal/ https://github.com/jepler/Jepler_CircuitPython_udecimal/actions/runs/5134723945

GitHub

Reduced version of the decimal library for CircuitPython - GitHub - jepler/Jepler_CircuitPython_udecimal: Reduced version of the decimal library for CircuitPython

proven garnet
#

Oh wow these are good catches, I should have time to get to them in a little bit or worst case this evening!

tulip sleet
#

@timid bolt now that 8.1.0 is done, I have finally gotten back to looking at asyncio. You'll see my comments in the PR's, but we could have a more general audio or video chat about it too if you have time.

proven garnet
onyx hinge
#

please do

slender iron
slender iron
slender iron
manic glacierBOT
#

CircuitPython version

This was verified using a Raspberry Pi Pico W & CircuitPython 8.1
Earlier this year the team did a wonderful job of allowing our campus network, which approves devices based on MAC address, not password, to work properly. Campus requires the MAC address to be registered. This works great, but when taking devices from my home network to the campus network, I need to first modify the settings.toml file remotely, otherwise when plugging the device into the c...
manic glacierBOT
edgy edge
slender iron
crimson ferry
#

sounds like c-stack

manic glacierBOT
#

Because I just bought Adafrtuit ESP32-S3 Feather :) But no worries, thanks
for the update.

Ε›r., 31 maj 2023, 19:26 uΕΌytkownik Scott Shawcroft @.***>
napisaΕ‚:

Nope, it is still blocked on #5926
https://github.com/adafruit/circuitpython/issues/5926. Why do you want
it on espressif instead of using nrf?

β€”
Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/issues/7171#issuecomment-1570627197,
or unsubscribe
<https://github.com/n...

manic glacierBOT
#

@tannewt Thank you. This will definitely need some changes, it does not properly hide elements if you try to do it after they're created and shown due to what you mentioned needing to have a refresh area for the next frame after it becomes hidden.

Do you know if first_draw is meaning conceptually like the first time this thing has been drawn on the display? i.e. it would be expected to be false once, then get drawn and become true and stay true so long as no further changes are made to i...

proven garnet
proven garnet
proven garnet
#

Also took a look at your repository - looks like as long as there is a pyproject.toml file at all (which triggers the CI) the metadata is allowed to still be defined in setup.py.

slender iron
#

anyone know of a full implementation of uart using PIO?

#

PIOASM only has two separate examples

manic glacierBOT
#

I enabled MICROPY_STACKLESS which resulted in the same "RuntimeError: maximum recursion depth exceeded" message but without the traceback.

I then disabled CIRCUITPY_FULL_BUILD, CIRCUITPY_COUNTIO and CIRCUITPY_BITBANGIO and enabled CIRCUITPY_AUDIOIO and CIRCUITPY_PIXELBUF and the example scripts from the forum post ran without crashing.

I know this isn't a solution but figured it might at least help zero in on the issue.

manic glacierBOT
manic glacierBOT
manic glacierBOT
winged willow
onyx hinge
#

@proven garnet I'm wondering if there also needs to be a way to specify the --package_folder_prefix during the non-release build, build/action.yml. Because the artifacts I get from the jepler_udecimal build are just empty. I may be missing something of course

proven garnet
#

I didn't even realize the non-release build had artifacts

onyx hinge
#

build/action.yml makes the bundle files here:76 run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location . and then uploads them 78 uses: actions/upload-artifact@v3 but the resulting files are incomplete due to the same --package_folder_prefix problem .. but I don't see a way to speecify it, unlike at the actual release step

proven garnet
#

Oh interesting. Yeah, I think the mpy compilation is only patched in the release build, but it should be easy enough to add it to the non-release builds as you suggest

proven garnet
#

I don't even think it would be a library patch - just patch the cookiecutter, find the few libraries that use it, and add the new info to them.

onyx hinge
#

I am sure it's rarely used

#

but since the fix is .. probably .. easy

proven garnet
tulip sleet
proven garnet
#

I named the argument with "package" for that reason, but it's still somewhat confusing because it's still regarding "packaging"

lone axle
#

Anyone know where within the core to find the code that is responsible for changing the display back to displayio.CIRCUITPYTHON_TERMINAL when an exception has been raised? I.e. user has drawn something with displayio and it was successfully rendered, but then some time after that an exception is raised. By default the display goes back to showing the CircuitPython Terminal with the traceback from the exception being the last thing printed and visible.

lone axle
#

I may have worked that out. The display always gets reset after code.py is finished, whether or not it finished successfully or with an exception. During the reset it shows the terminal. If there was an exception it gets printed and can be seen on the display which is now showing the terminal. So there is nothing responsible specifically in the instance of an exception for changing the display it just happens because of the reset, which occurs whether or not there was an exception.

slender iron
manic glacierBOT
#

@tannewt Oddly these work:

ports/atmel-samd/boards/bdmicro_vina_d51_pcb7/mpconfigboard.mk:10:EXTERNAL_FLASH_DEVICES = "MX25L51245G","GD25S512MD"
ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.mk:13:EXTERNAL_FLASH_DEVICES = "MX25L12833F","MX25L51245G","GD25S512MD"
ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.mk:10:EXTERNAL_FLASH_DEVICES = "MX25L51245G","GD25S512MD"

Maybe because there are no spaces.

slender iron
manic glacierBOT
#

While building a simple eBook reader project, I realized if the eBook reader lost power, I would lose the position in the eBook.

I would like to be able to use tell(), to log how much has been played, and seek() to start at the last logged tell() point to continue the reading journey.

I posted this question in the forums and learned that audiocore.WaveFile doesn't support this.

It would be great if we could add support for beginn...

manic glacierBOT
manic glacierBOT
#

tested:

  • board.LED
  • neopixel as status LED
  • i2c scan finds lis3dh sensor
  • psram capacity

not tested:

  • rgb matrix o_O
  • the gpio pins

Introduce new board properties for matrixportal-style boards:

  • MTX_COMMON
  • MTX_ADDRESS

These are intended to simplify use of the RGBMatrix constructor:

matrix = RGBMatrix(..., addr_pins=MTX_ADDRESS[:3], **MTX_COMMON)

removing the need for sending in the following individual parameters:

  • rgb_pins
  • clock_p...
timid bolt
tulip sleet
manic glacierBOT
manic glacierBOT
#

CircuitPython version

N/A

Code/REPL

N/A
Building from the latest Git release.

Behavior

I get the following log when running esp-idf/install.sh :

Detecting the Python interpreter
Checking "python" ...
Python 3.10.6
"python" has been detected
Installing ESP-IDF tools
Current system platform: linux-amd64
Selected targets are: esp32h2, esp32c3, esp32, esp32s3, esp32s2
Installing tools: xtensa-esp-elf-gdb, riscv32-esp-elf-gdb, xtensa-esp32-...

timber mango
#

Can't get esp-idf to build within CircuitPython. Don't know if this is just me doing something dumb. I followed all the guides but there's still this weird error from Git.

#

Anyway, ping me if you have any ideas what's going wrong. Seems like Git can't retrieve the branch it wants?

brazen hatch
#

I suggest having a copy of espidf outside of your CP clone, and exporting that instead.

#

However if you want to fix the one inside your cp clone you should go inside the submodule and inspect with git status

timber mango
#

I might try building seperately. What version should I use?:

#

The latest?

brazen hatch
brazen hatch
timber mango
#

Alright I'll try building from the 'releases/v4.4' branch.

brazen hatch
#

you could just git clone -b as they suggest in their release notes

timber mango
#

That's what I'm doing. In what release notes?

#

The CircuitPython ones?

brazen hatch
#

esp-idf ones

wraith crow
proven garnet
#

@vocal badger Brent, I think this is you, you asked me to reach out to you but wanted to make sure this was the correct handle.

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0 on 2023-05-22; Seeeduino XIAO RP2040 with rp2040

Code/REPL

>>> import board
>>> import audiobusio
>>> audio=audiobusio.I2SOut(bit_clock=board.D8, word_select=board.D9, data=board.D10)

Behavior

Traceback (most recent call last):
  File "", line 1, in 
ValueError: Bit clock and word select must be sequential pins

Description

Attempting to create an I2S object in CircuitPython us...

timid bolt
#

hey @tulip sleet, do you want to chat now?

manic glacierBOT
#

I'm trying to build this on my system (and it very well could be my particular setup), but am running into this error when building:

[851/851] Generating ld/sections.ld
FAILED: esp-idf/esp_system/ld/sections.ld /Users/melissa/Developer/c/circuitpython/ports/espressif/build-adafruit_matrixportal_s3/esp-idf/esp-idf/esp_system/ld/sections.ld
cd /Users/melissa/Developer/c/circuitpython/ports/espressif/build-adafruit_matrixportal_s3/esp-idf/esp-idf/esp_system && python /Users/melissa/Devel...
tulip sleet
timid bolt
#

all right, which room?

tulip sleet
#

amelia earhart is fine

tulip sleet
manic glacierBOT
#

Ok, I've gotten past that issue (plus a few more that I already figured out) and am now stuck on:

In file included from ../../py/obj.h:29,
                 from ../../shared-module/displayio/Bitmap.h:33,
                 from ../../shared-bindings/displayio/Bitmap.h:30,
                 from build-adafruit_matrixportal_s3/autogen_display_resources-en_US.c:2:
esp-idf/components/newlib/platform_include/assert.h:20:10: fatal error: sdkconfig.h: No such file or directory
 #include <sdk...
tulip sleet
manic glacierBOT
timber mango
#

But it's a fresh build that I haven't modified at all.

wraith crow
#

Yep that was when it happened to me as well

timber mango
#

Ah, well I don't understand why. But if it works, I don't have to know! πŸ˜†

#

I was hoping to make some small modifications to my firmware. Namely including the audioio module.

wraith crow
#

That was me as well πŸ˜‚

tulip sleet
#

audioio depends on the existence of a DAC, so it may not work on the board you have in mind.

timber mango
#

It works on the ESP32 right?

#

Just tell me I'm not doing all this only to run into some unsolvable technical problem? Right? πŸ˜“

#

(but I have tested that sending a pwm signal to the pin will produce the correct frequency on the speaker)

#

So do I need audiopwmio instead?

wraith crow
#

Didn't Adafruit just add a little add on board with i2s out?

tulip sleet
#

audioio is only implemented for atmel-samd

#

audioio should really be called audioanalogio. Yes, you could use audiopwmio or audiobusio (I2C) if available

timber mango
#

Okay so what I want is audiopwmio then. I already have audiobusio, it's just not very helpful as I don't have a digital audio device.

#

So after fetching the submodules I need to run 'esp-idf/install.sh'... I think?

tulip sleet
#

right

#

then, before you do a build, run esp-idf/export.sh

#

that sets up the right PATH, etc.

timber mango
#

Still the same problem.

Checking "python" ...
Python 3.10.6
"python" has been detected
Installing ESP-IDF tools
Current system platform: linux-amd64
Selected targets are: esp32s2, esp32h2, esp32c3, esp32s3, esp32
Installing tools: xtensa-esp-elf-gdb, riscv32-esp-elf-gdb, xtensa-esp32-elf, xtensa-esp32s2-elf, xtensa-esp32s3-elf, riscv32-esp-elf, esp32ulp-elf, openocd-esp32
Skipping xtensa-esp-elf-gdb@11.2_20220823 (already installed)
Skipping riscv32-esp-elf-gdb@11.2_20220823 (already installed)
Skipping xtensa-esp32-elf@esp-2021r2-patch5-8.4.0 (already installed)
Skipping xtensa-esp32s2-elf@esp-2021r2-patch5-8.4.0 (already installed)
Skipping xtensa-esp32s3-elf@esp-2021r2-patch5-8.4.0 (already installed)
Skipping riscv32-esp-elf@esp-2021r2-patch5-8.4.0 (already installed)
Skipping esp32ulp-elf@2.35_20220830 (already installed)
Skipping openocd-esp32@v0.11.0-esp32-20221026 (already installed)
Installing Python environment and packages
fatal: No tags can describe '630c2724fc8c69eeaaa1bb025de52b99c5cb11aa'.
Try --always, or create some tags.
WARNING: Git describe was unsuccessful: b''
ERROR: This script was called from a virtual environment, can not create a virtual environment again
#

Hmm, well maybe I can try building my own version of esp-idf from the 4.4 branch of their GitHub?

tulip sleet
#

if git status shows modified submodules, you need to go into each submodule and do git restore .

tulip sleet
timber mango
#

git status says it's clean.

Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean
tulip sleet
#

can also try make remove-submodules and then make fetch-submodules. But the re-clone is easiest unless you will lose some work

#

when submodules move around or change, git can get pretty confused

timber mango
#

I was already using a fresh clone, and I just ran make remove-submodules and make fetch-submodules.

#

I guess I could burn it all and try again?

tulip sleet
#

what is the host OS, and what is the version of git you are using?

timber mango
#
Ubuntu 22.04.2 LTS \n \l

$ git --version
git version 2.34.1
#

Does that help?

tulip sleet
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.0-beta.0 on 2023-05-24; Adafruit Feather ESP32-S2 TFT with ESP32S2

Code/REPL

import wifi
 wifi.radio.connect('...','...')

Behavior

Traceback (most recent call last):
File "", line 1, in
ConnectionError: Unknown failure 15

Description

This test done in the REPL window of mu 1.2.0.

In another testscript with wifi scanning networks results, the transmission I was trying to connect to (...

tulip sleet
#

yes, you are using an older version of git than I am, but same OS. git 2.36.0 is the minimum required to do "partial clones", but you don't really need those

#

I am working on make fetch-submodules variations that will be only for a specfic port, to avoid having to fetch tons of useless stuff

timber mango
#

I can try updating git? I'll grab a snap package or something similar. I expect the distro version is pretty old.

tulip sleet
#

but a staff member had the same problem you are having earlier today (on macOS, though), and installing git-lfs fixed it

timber mango
#

Okay. I've added the 'ppa:git-core/ppa' repository. I'll remove and fetch the submodules again.

#
git version 2.40.1
timber mango
#

Alright that the submodules fetched. Seems to be working a little differently now. Git was throwing errors about things being not a tree before. So the lack of errors now gives my some reason for optimism!

#

Ah... crap. ```Detecting the Python interpreter
Checking "python" ...
Python 3.10.6
"python" has been detected
Installing ESP-IDF tools
Current system platform: linux-amd64
Selected targets are: esp32, esp32s3, esp32c3, esp32s2, esp32h2
Installing tools: xtensa-esp-elf-gdb, riscv32-esp-elf-gdb, xtensa-esp32-elf, xtensa-esp32s2-elf, xtensa-esp32s3-elf, riscv32-esp-elf, esp32ulp-elf, openocd-esp32
Skipping xtensa-esp-elf-gdb@11.2_20220823 (already installed)
Skipping riscv32-esp-elf-gdb@11.2_20220823 (already installed)
Skipping xtensa-esp32-elf@esp-2021r2-patch5-8.4.0 (already installed)
Skipping xtensa-esp32s2-elf@esp-2021r2-patch5-8.4.0 (already installed)
Skipping xtensa-esp32s3-elf@esp-2021r2-patch5-8.4.0 (already installed)
Skipping riscv32-esp-elf@esp-2021r2-patch5-8.4.0 (already installed)
Skipping esp32ulp-elf@2.35_20220830 (already installed)
Skipping openocd-esp32@v0.11.0-esp32-20221026 (already installed)
Installing Python environment and packages
ERROR: This script was called from a virtual environment, can not create a virtual environment again

#

I think that's a known bug with the ESP-IDF build.

tulip sleet
timber mango
#

No I am not running Python in a virtual environment.

tulip sleet
#

are you using the submodule version of ESP-IDF in CircuitPython, or is this some separate thing?

timber mango
#

It seems there was an unrelated virtualenv in my PATH from an old PlatformIO install. Not active, just in the path. Removing it fixes the problem.

#

Excellent, now to build.

manic glacierBOT
manic glacierBOT
#

I can't reproduce this on my ESP32-S2 with 8.2.0-beta.0 (or prior). Is connect successful on prior releases on the same board and in the same physical environment (same AP, same distance from AP, etc.)?

If you catch the exception and retry, does it eventually connect? Something like...

import time
import os
import wifi

time.sleep(3)  # wait for serial

print(f" {time.time()} Connecting...")
while not wifi.radio.connected:
    print(f" {time.time()} {wifi.radio.connect(os.g...
timber mango
#

Alright the build is successful. Time to mod.
So if I'm reading this documentation correctly, all I need to do is to add CIRCUITPY_AUDIOPWMIO = 1 to the specific board's 'mpconfigboard.mk' file?

#

Is that really it?

#

Ah, maybe not.

jaunty juniper
#

that might be because you need a make clean ?

timber mango
#

I ran make clean from the top level directory. Is that correct? Or there some different version I need to run for the espressif directory?

timber mango
#

M5Stack Core Basic (m5stack_core_basic)

#

I ran make BOARD=m5stack_core_basic clean from the espressif directory, but still the same issue.

#

That's an ESP32 based board.

tulip sleet
timber mango
#

I did run make BOARD=m5stack_core_basic clean from that directory.

#

(it doesn't seem to work without specifying the board)

tulip sleet
#

pwm audio is not implemented for any Espressif chip

#

i see

timber mango
#

Ah, crap.

#

So is there any analogue audio support for Espressif chips?

tulip sleet
#

if it were, it probably already be turned on. We don't generally turn things off unless the board is extremely small and it wouldn't fit. ... So you need an I2s amp

#

no

#

you can use PWMOut to make tones, but nothing fancier than that

timber mango
#

Ah, well I guess it's a dead end then. I'll just have to convert my compositions into an array of PWM frequencies or something like that. Maybe I'll write a script for that. Anyway, problem solved.

tulip sleet
timber mango
#

I know, but I'd probably need to design my own module to mod it to the existing board.

timber mango
#

To explain, this is a unit contained within a case. I can't just stick a module on.

tulip sleet
#

does it already have some kind of audio? Was it running Arduino or something?

timber mango
#

Yeah, Arduino and MicroPython I think. Though I think it was just doing tones there as well.

#

I might just have to update to the newer version of the board which does have an I2S amp in the schematic.

#

Anyway, gotta go now, but thanks for all your help! It's been really useful in getting my build working.

tulip sleet
#

sure! sorry it was disappointing. The DAC audio was not really working well (or was not usable) in ESP-IDF when we first looked at it.

lone sandalBOT
manic glacierBOT
#

After testing, the CIRCUITPY drive appears, however there is no output to the matrix. I went ahead and ran one of the examples from the RGB Matrices Learn guide and plugged in the correct pins. After running the code, I'm getting ValueError: rgb_pins[0] is not on the same port as clock. I double-checked pin assignments and they appear correct. Looking at where it’s happening in CP (https://github.com/adafruit/circuitpython/blob/main/shared-bindings/rgbmatrix/RGBMatrix.c#L77), it looks like ...

#

Problem resolved: I made a mistake. I mixed the passwords of the two SSID's of the WiFi system (Netgear Orbi Satellites).

soft reboot

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

192.168.1.80

Code done running.

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

@anecdata thank you for your rapid reply.

lapis shuttle
#

hello friends, does anyone know the difference between MP_OBJ_NEW_QSTR and MP_ROM_QSTR in circuit python port/$arch/$board/pin.c? was trying to port circuit python to a custom board with different pin layouts but confused which one should I use for my pins

manic glacierBOT
manic glacierBOT
#

Just confused about the pins claiming in pin.c
some of pins are defined like this:

{ MP_ROM_QSTR(MP_QSTR_FREELINK_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_12) },

meanwhile, some of pins are defined in another way:

{ MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B1_07) },

So what's the difference between these 2 macros MP_ROM_QSTR MP_OBJ_NEW_QSTR? which one should I go if I port to a custom board with a different pins layout from EVKB?

sorry if this isn't the ri...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Initially, removing and fetching the modules again did not resolve the problem; however updating my Git version from the distro's version 2.26 to the PPA's version 2.40 and doing the same did.

It seems like this problem is just due to an old version of Git not fetching submodules correctly.

In future it might be nice to have a better warning of this Git issue, or even a fatal error if an old version is detected, but I think the issue is resolved for now.

manic glacierBOT
manic glacierBOT
manic glacierBOT
upper ocean
#

Hi folks, I'm hoping to spend some time digging into https://github.com/adafruit/circuitpython/issues/7966 to see if I can find a way to enable native code emitters. Since I'm using an esp32s3 (UM FeatherS3, specifically), I was hoping to using the builtin JTAG for live debugging to see what's going on when CP crashes.

However, all my attempts at using openocd and gdb with this board have failed. For the devs here, I'd love to hear what kind of debug processes you use, especially for developing with the esp32s3. Anyone have a reliable way to live debug w/ gdb? What about getting backtraces from crashes?

Thanks!

GitHub

CircuitPython version Adafruit CircuitPython 8.1.0-beta.2-2-g057c152d6-dirty on 2023-05-10; BPI-Leaf-S3 with ESP32S3 Code/REPL >>> @micropython.native ... def test_fxn(): ... print("T...

manic glacierBOT
brazen hatch
#

CP switches out the jtag for the Circuitpy drive on S3

#

I want to get that changed on DEBUG eventually

manic glacierBOT
manic glacierBOT
#

Hello, I was recently playing around with the espnow module and encountered most of these issues.

However, I found some workarounds and made some examples that are might be worth sharing for anyone who will need to work on these issues or want to use the module thoroughly.

Broadcast messages

While the send method may return a 0x3066 or 0x3069 error when broadcasting, it is only does so under some specific conditions:

  • If you only have the broadcast peer registered, you *...
tulip sleet
#

i have had very little success trying to do use gdb with a J-Link on the ESP boards. It may sort of work for a while, but gets stuck, or is very limited. Instead we have compiled DEBUG=1 and used the ESP_LOG*() macros to see debugging printouts on a designated set of UART pins.

left iris
# manic glacier

Hi newbie here. This was my enhancement request. Now that I have the board I might as well contribute to add one other board. Is there a guide that adafruit has on how to add a new device for circuitpython support? I know it has micropython support cause the main page provides a build. And the device exists in their repo.

I was building my project on the Pico W - ran out of memory sigh and so would be grateful if someone could help πŸ™‚

tulip sleet
#

@left iris ^^

manic glacierBOT
manic glacierBOT
winged willow
#

Hey all. I’m still working on my library to get the Pimoroni IO Expanded Board (Nuvoton ms51 chip) working in circuitpython

Run into a glitch tho - Ive managed to get regular IO pins working - I can see input on pull-up pins etc when they’re switched on etc etc BUT 2 pins don’t work at all. Others do so I can’t see what I’m doing wrong. I’ve checked the registers for those pins against the micropython and arduibo libraries and they’re correct. Is my code wrong or is my board toast..
Here’s the library:
https://github.com/mathcampbell/IOExpanderCircuitPython

GitHub

CircuitPytthon port of the Pimoroni IO Expander Breakout library - GitHub - mathcampbell/IOExpanderCircuitPython: CircuitPytthon port of the Pimoroni IO Expander Breakout library

manic glacierBOT
#

The BLE support available for the Espressif chips is quite limited right now, due to a mismatch between how the the underlying software works and what we need fir CircuitPython. The capabilities are explained here: https://learn.adafruit.com/welcome-to-circuitpython/frequently-asked-questions#faq-3129409. So sorry, no, you can't use the BLE support for HID now. If you are interested in HID support over USB, we'd recommend an ESP32-S2 or ESP32-S3 board if you want to stick with a WiFi-capable ...

upper ocean
# brazen hatch I want to get that changed on DEBUG eventually

Thanks for the info, even if it's non-ideal. I noticed with Arduino there is the option to select USB Modes like "Hardware CDC and JTAG" as well as "MSC". I assume that CP is using the "MSC" option, or something like it, to expose the CP drive, whereas the "Hardware CDC and JTAG" option, aka Serial JTAG, is what we'd want for debugging. What I can't figure out is what settings Arduino is changing when a user selects one or more of these USB Modes. Do you know if it is just a config change like in sdkconfig? It'd be great if the only thing that needed to be done to temporarily disable the CP drive and enable JTAG was to change a couple values in sdkconfig.

brazen hatch
manic glacierBOT
#

i have read through
https://github.com/adafruit/circuitpython/issues/6174
but all i found is to create the settings.toml and put in some credentials to existing networks ... my issue is that i use the board outside far away from any wifi but i do not want to plugin it into something but use it from a tablet or smartphone, so i wna tto use the board in AP mode not STA mode, so now i am a little lost how i can enable the webrepl in AP mode

so i would either suggest adding AP mode as an...

manic glacierBOT
#

CircuitPython version

Official Adafruit CircuitPython v8.1.0
and
Custom compiled Adafruit CircuitPython v8.2.0

Code/REPL

# no custom code (just the factory default code.py file)

Behavior

Description

I have noticed that all pins output 3.3V after a power up. Presumably the internal pull-ups have been activated by default. So I ask here where this is defined in the source code of CircuitPython. Is this intentional or a bug?

_This is my...

manic glacierBOT
#

CircuitPython version

Circuitpython for esp32

Code/REPL

'''import time
import board
from analogio import AnalogIn

GasIn = AnalogIn(board.D34)
TempIn = AnalogIn(board.D35)

Vref=1.65
while True:
time.sleep(2)
Vgas=(GasIn.value/4096)3.3
Vtemp=(TempIn.value/4096)3.3
M=32.27
T=29.0Vtemp-18.0
if T<20:
Mc=M((1.3T)+74)
else:
Mc=M((0.4T)+92)
Cx=(1/Mc)(Vgas-Vref)
print(Cx*1000, "ppb")'''

Behavior

Hi! I am using ULPSM sensors from Digik...

manic glacierBOT
slender iron
winged willow
slender iron
#

A logic analyzer could help you determine what the driver difference is

winged willow
#

seems to be i can read ll the pins, except those where the port needs to be acssed with the 0th bit

gilded cradle
#

@slender iron I need to take care of something that happens the same time as the meeting. Could you read my notes?

gilded cradle
onyx hinge
#

<@&356864093652516868> hey y'all! We'll be holding the weekly meeting in about 30 minutes -- now's a great time to finish up your notes in the notes doc: https://docs.google.com/document/d/1v476RNCHysQUjWEPVojGsr7lcRD1saa2d9-Sdhbq3_Y/edit?usp=sharing

slender iron
#

thanks, meant to do that

digital ibex
#

How is the "In the weeds" section structured? I know it's a place to put other topics of interest, but do I put things in there stated as questions?

slender iron
#

we read each item and then respond/discuss

#

I'll either read the topic or handoff to the poster if they are in the meeting

digital ibex
#

Ok, thanks for clarifying!

slender iron
#

np πŸ™‚

idle owl
digital ibex
#

Thanks, it does looks better now!

onyx hinge
#

@slender iron kattni asked me to read the libraries section today (also noted in the doc)

#

@slender iron about ready to kick things off?

#

oh no we're going up against the apple keynote? 😰

lone axle
digital ibex
#

Looks like I'll be missing the rest of this meeting, sorry. Can someone read off my in the weeds question?

#

Thanks!

slender iron
#

I can read it

digital ibex
#

I'm going to listen in, but I'm text only

lone axle
#

It's a displayio based "emulator" that draws on a display to mimic 7segments, 14segments, or 8x8 matrices.

manic glacierBOT
onyx hinge
#

@lone axle ooh cool!

#

[hum should we put the required mpy version in the banner or boot_out.txt?]

slender iron
#

weeds topic?

ember iris
#

Oh those filters take me back

turbid radish
#

Nice work Jeff

#

I used UV light

#

Yes!

#

Yes, 8 bits data, many address pins

onyx hinge
digital ibex
#

I missed most of what Dan said but I'll look at the recording. Docker is basically a reproducible VM.

onyx hinge
#

github codespaces is billed per hour

#

$0.18/hour for 2 cores & 4GB RAM

digital ibex
#

That's a fair point about USB, I wonder if there's a better container solution or something else to make it easier. Thanks for the input!

blissful pollen
#

If you want to run anything past me about it let me know. If I'm really stuck I can probably ask someone I know for a hint

turbid radish
#

ha ha

digital ibex
#

🀣

#

But it would need to exist on a bunch of CDs for the authentic Microsoft experience!

ember iris
#

I do think if skipping a 9.0 full release makes the process of maintaining code easier, then it's worth skipping after an alpha

onyx hinge
#

rationale: we don't know how much existing software checks for "9" as the first digit of the number and assumes it's working with windows 95/98 and not circuitpython

#

Next meeting is at the normal time on Monday June 12!

turbid radish
#

Windows Forever

digital ibex
#

🐧🐧

onyx hinge
#

Python 3.11 for workgroups

digital ibex
#

Bye all!

onyx hinge
#

πŸ‘‹

lone axle
#

Thanks for hosting Scott. Have a great day everyone πŸ‘‹

ember iris
#

Thank you all! Have a great week!

onyx hinge
#

If hypothetically the docker build looked like sh tools/docker-build espressif adafruit_matrixportal_s3 i'd be super into it because i wouldn't have to worry about anything but getting docker set up initially (and having enough resources)

brazen hatch
#

If nobody does it, I will do it eventually, now stuck doing telnet.

#

I was fumbling around with the chinese w801 chip yesterday, and lost a decent bit of time.
I got uart, wifi and gpio going. The docs are basically non-existent, but I am a tryhard, so did it without any.
I got heap (malloc's) and stack (static allocations in code) going, along with freertos task scheduling.
I wonder how much effort would it take to port circuitpy to it.
The functions it has for all the hardware are very simple, and just work.

#

Also that chip goes like 60Β°C and draws .12A just doing some leds.

slender iron
#

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

manic glacierBOT
#

Hi! Sorry I've not been able to get to this until now. I am having a hard time using this. It seems to be geared to creating static filters that do not change. But filters in synths are usually modulated, a common sound being the low-pass filter sweep bwwwowwww sound. E.g. I would like to do something like the below, but I cannot access the function that goes from frequency & q_factor to biquad coeffs a1,a2,b0,b1,b2:

top_f = 1600
q = 0.5
myfilter = synth.low_pass_filter(frequenc...
#

CircuitPython version

8.1.0

Code/REPL

import wifi

Behavior

Locks up. Full log from REPL:

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371 
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,...
#

Two other things:

  • it appears one cannot set the filter coeffs after instantiation. e.g. this does not work:
def adjust_filter(afilter,w0,Q):  # f,q
    s,c = math.sin(w0), math.cos(w0)
    alpha = s / (2 * Q)
    a0 = 1 + alpha
    afilter.a1 = -2 * c
    afilter.a2 = 1 - alpha
    afilter.b0 = (1 - c) / 2
    afilter.b1 = 1 - c;
    afilter.b2 = (1 - c) / 2
  • Doing lpf = synth.low_pass_filter(frequency=1600, q_factor=0.5) fails with "extra keyword argume...
#

CircuitPython version

adafruit-circuitpython-hardkernel_odroid_go-en_US-8.1.0.bin

Code/REPL

import os
os.listdir()

Behavior

reboot freshly imaged ODroid. Go into REPL, control-C

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371 
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_...
onyx hinge
#

@slender iron this layout of holes gets all the multiples of 0.2" and also allows placing feathers with holes on an 0.7 x 1.8" grid at a variety of locations and orientations. you could do the overlapping holes as shown or as slots.

#

assuming I mathed correctly anyway

slender iron
#

oh, fancy

#

I was thinking about surveying our existing designs

#

that's a very cool design

manic glacierBOT
#

Fixes #8036.

  • Rename top-level make fetch-submodulesandremove-submodulestofetch-all-submodulesandremove-all-submodules`.
  • In each ports/*, provide make fetch-port-submodules, which fetches only the submodules needed for that port.
  • make fetch-port-submodules does not require BOARD to be set, but most port-specific Makefiles assumed that BOARD would always be set. They did not anticipate non-board-specific make targets. Fix that, by fixing how bad or missing `BO...
manic glacierBOT
#

Guys. I have some very painful news.

CIRCUITPY_PYSTACK_SIZE=12288
Adafruit CircuitPython 8.2.0-beta.0 on 2023-05-24; Adafruit Feather ESP32-S3 TFT with ESP32S3

>>> from time import sleep
>>> d=0
>>> a = """try:
...     sleep(0.1)
...     print(d)
...     d += 1
...     exec(a)
... except KeyboardInterrupt:
...     pass
... """
>>> exec(a)
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

[01:14:13.515] Disconnected
brazen hatch
#

πŸ₯²

#

We are still not done with pystack

#

Thankfully now I have c3 with debugging.

manic glacierBOT
winged willow
#

urgh I'm beginning to hate this library lol.

2 weeks i've been smashing away at it. I can read some pins but not others..the pin addresses are correct, Iv'e checked the hardware in the arduino and micropython version...

i even had chatgpt sit and compute the binary for me for each i2c write etc...

slender iron
#

you'll need to provide more specifics. that's 500 lines of code

#

and chatgpt makes stuff up

winged willow
#

hahm, fair, I didn't wanna launch into a whole explanataion if nobody was wanting to

#

yeah..it broke off from exaplining the hex-binary conversion to tell me about president of france

#

so at line 219, the _set_mode method

#

the pin map showing pins: port/bit, taken and cross referenced from the arduino and micropython versions

#

that uses that to decide which registers to address in the setting of the io mode for each pin (input/pullup/adc/input//output etc etc)

#

thing is, pin's 2, 5 and 10 do NOT work. At all.
The rest, do.
The only commomon linking them is that pins 2, 5 and 10, you have to use their port, 0 bit.

#

so I'm thinking the code that assigns that particular pins is doing something bitwise and adressing the wrong bit or something, expect that the code looks right...

#

i got one erroe message suggesting those pins may even be getting set to output instead of pullup

slender iron
#

are you in pwm mode?

#

0 << bit won't do anything

winged willow
#

no; i'm just trying to get the general IO mode going for starters...

slender iron
#

line 266

winged willow
#

haven't even really touched that code yet...

slender iron
#

302 doesn't look right since bit doesn't shift anything

winged willow
#

bypassing all of that to just get IO pins working since on this board all pins can be IO (and are by default), and some are also PWM or ADC

#

a lot of the code is my just copying the (working fully) arduino library;
//5th bit of mode encodes default output pin state
i2cWrite8(ioPin._reg_p, (initialState << 3) | ioPin._pin);

slender iron
#

do you have a datasheet to look at?

winged willow
#

pin in that librbary fo some reason was waht he confusingly labelled not only the actual pin but also the bit to address on teh in pin

#

yes and no

#

but i'm not sure it's entirely accureate cos Pimoroni reference them having their own custom firmware, and it talks about some registers being shifted...

slender iron
#

right, so it's their version of seesaw

#

I'd use a logic analyzer to compare the implementations' i2c traffic

winged willow
#

i'm also getting from the print status messages that my schmitt trigger isn't actually assigned, but i've double triple checked and i'm using the exact same registers and bit operations etc as the other libraries, but it's not writing them for some reason...

slender iron
#

the other thing I'd do is slim the code down to just one thing you are trying to do

winged willow
#

i haven't got one (and wouldn't know hopw to use one if I did tbh, I'm not a programmer really..)

manic glacierBOT
slender iron
#

pimoroni are the folks to ask for support since it is their hardware and firmware

winged willow
#

frankly i'm amazed I've even gotten this working enough to actrually get any data out of it...the other pins work..

#

i only got the board coes I'm building a joystick and it fits neatly in te space I had my mcp23017 but has some adc on it..

slender iron
#

I was expecting to find an if bits: but didn't see any

winged willow
#

where?

slender iron
#

in your code since the value 0 evaluates to false

winged willow
#

no i meant in what section

slender iron
#

any of them

winged willow
#

is that a convention?
I really dont' do much codding otehr than editing other people's, and python of any kind is kinda new to me, I learned a bit of objC years ago then some c++ etc

#

bitwise stuff is just alien to me...

slender iron
#

that's something that could explain why non-zero bits work

winged willow
#

this code is literally just me trying to copy the arduino and c++ code

#

with "what does this mean" questions at chatgpt lol

#

it is quite amazing i've somehow accidentally managed to not only read some data out of it but it even works...I can reliably read an io input pin 1-14 except those whose port needs 0pth bit addressed

#

the annoying thing tho is i'm moderately sure I basically understand how to get data out, and I'm positive I've copied the arduino code perfectly:
you get the bit using the Px registers array, corespoinding to teh port you're acessing; and the value is found in the corect bit of the returned string

slender iron
#

pimoroni may be better to ask since they know the firmware

winged willow
#

yeah I'm thinking so...I even checked the logic thru etc, and it seems to be "right" but trying to write the register for the schmitt trigger doesn't seem to "take"

#

which suggests to me something else is wrong (all likely tied to the 0th bit being read from the port)

#

i just realised I'm not setting bits using the special case registers it mentions///

#

probaly wouldn't explain why the pins don't work propelry buit might explain why they won't pullup

manic glacierBOT
#

Okay this works as expected*:

# synthio_filter_test.py --
# 5 Jun 2023 - @todbot / Tod Kurt
import time, random, board, analogio, audiopwmio, synthio
knob1 = analogio.AnalogIn(board.GP26)
knob2 = analogio.AnalogIn(board.GP27)
audio = audiopwmio.PWMAudioOut(board.GP10)
synth = synthio.Synthesizer(sample_rate=22050)
audio.play(synth)

note1 = synthio.Note(frequency=110)
synth.press(note1)

while True:
    lpf_f = 10 + knob1.value / 32
    lpf_q = knob2.value / 20000
    n...
manic glacierBOT
onyx hinge
manic glacierBOT
manic glacierBOT
#

In CircuitPython espressif port, we have a special case for what Adafruit terms the "double tap pin":

// _reset_pin in common-hal/microcontroller/Pin.c
    #ifdef DOUBLE_TAP_PIN
    // Pull the double tap pin down so that resets come back to CircuitPython.
    pull_down = pull_down || pin_number == DOUBLE_TAP_PIN->number;
    #endif

I do not know if this is equivalent to the functionality on this board; there's also espressif_board_reset_pin_number which allows a particular...

manic glacierBOT
orchid basinBOT
manic glacierBOT
winged willow
#

seem to have fixed the issues with my library. The write function I was using was not constructing teh bytearray properly so that it weas only sending 1's but not 0's...

#

yes, I know i suck at coding

slender iron
winged willow
#

yep it sucks doesn't it

slender iron
#

all part of the game πŸ™‚

winged willow
#

Given it’s only my second time doing any kind of circuitpython (any kind of Python in fact) coding, and the first time was my joysticks β€œif this pin reads true, so the joystick button of the same name” simple stuff, I’m quite smug

slender iron
#

it's a good feeling to get things working

winged willow
#

Admittedly the adc function doesn’t work yet but I’ll get there. It was this or buy a brand new board at 3x the price and have got change my 3d printed joystick design to fit it in.

#

Plus it also means other people can now use this board and not have the pain I have had since I put it on GitHub

manic glacierBOT
#

8.2.0-beta.0 is worse. Doesn't even finish listing the directory contents before going into the ditch.

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371 
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:12748...
manic glacierBOT
tulip sleet
#

<@&356864093652516868> ALL FOLKS who do CircuitPython builds: as of today, https://github.com/adafruit/circuitpython/pull/8070 was merged. ***Fetching submodules has changed. ***There is now a target in the top-level Makefile, make fetch-all-submodules, and there is a target in each port's Makefile, make fetch-port-submodules, which fetches only the submodules needed for that port, to save time and disk space. (Note that the actual target is an an included .mk file: you won't see it directly in the port Makefile.) The instructions in the guide have been updated: https://learn.adafruit.com/building-circuitpython/build-circuitpython#fetch-submodules-3141425. Also note there now is a "Recent Changes" page in the Building CircuitPython guide: https://learn.adafruit.com/building-circuitpython/recent-changes

slender iron
#

@vale spire have you looked into stack size optimization at all? our copy of mp_execute_bytecode takes just over 200 bytes a call

manic glacierBOT
#

This reduces the stack frame size of mp_builtin___import__ by limiting the support path length of files from 256 to 96. This function can be called recursively for nested imports so it adds up.

Also reduce mp_execute_bytecode (vm.c) from 206 a bc call to 124. This too is recursive and adds up. It is reduced by preventing some inlining. It may decrease performance slightly when importing and unpacking.

Adds two new scripts for debugging. One is used from gdb to print frame sizes in a bac...

viscid pine
#

can i get the circuitpythonista role please

lone axle
viscid pine
#

thankyou! πŸ‘

manic glacierBOT
still zephyr
# tulip sleet <@&356864093652516868> **ALL FOLKS who do CircuitPython builds:** as of today, <...

πŸ™‚ had the following error for the raspberrypi port
fatal: Unable to checkout '2001c62d1a0361c44acc7076d8ce91e1d1c66141' in submodule path '../../tools/python-semver' fatal: Unable to checkout '1421ca7fe72a2b173b08be05f9042b79409e783a' in submodule path '../../tools/uf2' Entering '../../data/nvm.toml' error: cannot run data: No such file or directory fatal: run_command returned non-zero status for ../../data/nvm.toml
full log here https://gist.github.com/jposada202020/f0f70d561715e20f8abf8ffdd134732e. This is a fresh cloned repo. I have tried before with an old one doing make remove-all-submodules same thing, I am in ubuntu, maybe doing something wrong...idk

still zephyr
#

2.34.1

tulip sleet
#

i'll bet this is a git version issue. I will put that version in my path and debug. 2.40 (2.36 or later, really) should work. You can use the git ppa if you want to get a later version.

#

thanks for testing that

still zephyr
#

will do, will need to investigate how to add the ppa because keep forgeting :).

still zephyr
#

Thanks doing that atm, I found your previous instructions here πŸ™‚

tulip sleet
#

are you on ubuntu 22.04?

still zephyr
#

yes ubuntu 22.04

#

@tulip sleet problem solved with git 2.40.1 πŸ™‚ Thanks!!!!!

tulip sleet
still zephyr
#

Thanks dahn!

manic glacierBOT
#

#8070 did not work properly with older versions of git that could not do partial clones (before git 2.36). I tested this with git 2.30.1 on several ports, starting with no submodules each time. I was able to simplify the older shallow-depth commands a bit.

Thanks @jposada202020 who found the initial problem.

If you has an older version of git (before 2.36) and are interested in testing, you could try this. The simplest way is probably just replacing tools/fetch-submodules.sh from `mai...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

So this may not be related, but I got the P2ZeroW to boot and the following code produces a rectangle as expected.
However if I try much else, for instance uncomment any of the other shapes like the triange then I get a "RuntimeError: pystack exhauseted "

#print("Hello World!")

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

"""
This example shows the use color and background_color
"""

#Just the rectangle is ok.
#Try any o...
manic glacierBOT
#

I loaded this on a CPX and the test script from the issue does now run. Both this solution and the test I made of turning off CP modules seems to resolve the issue by making more memory available for (I'm guessing) the C-stack. Do you believe the "maximum recursion depth exceeded" message is actually the correct error and the issue was simply caused by starving the stack?

I couldn't really determine what change pushed this over the edge. The 8.0.0 release binaries work for me but buildin...

manic glacierBOT
#

@Macrosii I assume you commented out the mp_stack_set_top call to get the board to boot. That fix is likely to result in some instabilities but you could try setting a larger pystack using the settings.toml file.

Just add the following line to settings.toml:

CIRCUITPY_PYSTACK_SIZE=3600

If that doesn't help try increasing the size, you probably can go pretty high since the pizero has plenty of RAM.

#

I couldn't really determine what change pushed this over the edge. The 8.0.0 release binaries work for me but building 8.0.0 with a newer gcc doesn't work. I suspect it depends on inlining decisions that different compiler versions make. I couldn't attribute it to library changes either.

@tannewt When I tried a bisect I ended at this exact commit, which looks like changes in inlining, but there are other things, because reverting it in latest did not help: https://github.com/adafruit/cir...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Normal 8.0.5 Germany

Code/REPL

from adafruit_macropad import MacroPad
import time
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
from adafruit_hid.keycode import Keycode
from adafruit_hid.consumer_control import ConsumerControl
from adafruit_hid.consumer_control_code import ConsumerControlCode
from adafruit_hid.mouse import Mouse
#from hid_gamepad import Gamepad
import u...
lone sandalBOT
tulip sleet
#

@slender iron should I make an 8.1.1 release to fix the CircuitPlayground issue with stack overflow? The changes are pretty significant, though.

slender iron
#

I'd just wait to 8.2

#

there isn't much else blocking 8.2

#

could do a beta.1 of 8.2