#circuitpython-dev
1 messages · Page 39 of 1
those missing assets are gonna make circup fail too
06/24/2023 16:45:08 WARNING: Unable to connect to https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20230624/adafruit-circuitpython-bundle-py-20230624.zip
(by the way I just realized that my circup.log is 1.47 GB)
do you think it could be a change in the "shogo82148/actions-upload-release-asset" action ? It doesn't look like there was one between yesterday and today. Want to try rerunning it ?
oh wait that was already rerun
so maybe we should delete the release, remake it or make a new release
Yeah, it looked to me like the re-run failed for a different reason, because some of the files already exist. Although oddly it looked like one of the one it said already existed is the one from the XML file not found error if I understood them correctly.
I'm wondering if the root cause was just something transient and tomorrows will work fine (or whenever the next one builds. Maybe we should merge something today in order to ensure there is one tomorrow)
I think the it's the assets from the github release that "already exist", those ones ?
Ohhhh, it was saying they exist in the release assets already, not in AWS.
I think we can delete the release and wait for tomorrow ? that should fix circup
though I'm not ready to delete a release/tag in github...
I do think those are the ones. I don't know how it works but possible if those assets were deleted and then the action re-run maybe it could succeed.
Yeah, same. Not sure what other ramifications of deleting the release entirely, could cause more trouble than fix.
there's a little trashcan icon, so tempting 😅
The boot drive won’t disappear if it doesn’t get all of the data. I’ve never seen an actual failure
@RetiredWizard based on what I'm seeing in the meter displays between the two versions, the distorted one is 1.89W vs 2.17W in the non-distorted version. I'm using this Adafriut https://www.adafruit.com/product/658 5V/10A power supply. Given that it's their power supply, I would have thought it was more than sufficient to drive two of these panels. I know you didn't think your issue was voltage, but I'm wondering if the higher current draw of the 2 panels is causing a voltage drop that is eno...
It would be interesting to measure the voltage at the connection point of your matrix array. Unfortunately, I feel like the precise voltage of a 5 volt power supply can vary by almost a volt and while I haven't done any testing to confirm, I wouldn't be surprised if the output from "regulated" supplies vary under load by up to a volt as well.
I'm attempting to build a very old commit in order to track down a bug that I've found. But I'm getting this error about no make target for protomatter:
circuitpython/ports/atmel-samd (37e85ae) [!?] via C v11.3.0-gcc
❯ make BOARD=pyportal
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
make: *** No rule to make target 'lib/protomatter/core.c', needed by 'build-pyportal/genhdr/qstr.i.last'. Stop.
My best guess is that my submodules are not "sync'd" properly in order to make the build on this random old commit. I tried getting a fresh clone and doing make fetch-all-submodules, then checking out this commit and running the build and it outputs the above error.
Is there some other process I need to use in order for making builds from very old commits to get my submodules set to the proper revision in order to work?
Assuming you have done make clean. It does seem like the makefile has reference to core.c but it doesn't exist.
When I've had issues I've removed the folder with the submodule and just re-synced/updated it
CircuitPython version
Pyportal `8.1.0`, `8.2.0-rc.0` and others.
The last tag where it works successfully is `8.0.0-beta.0`
The first tag where it does not work is `8.0.0-beta.1`
Code/REPL
import board
import displayio
SHAPE_WIDTH = 100
SHAPE_HEIGHT = 100
display = board.DISPLAY
shape = displayio.Shape(SHAPE_WIDTH, SHAPE_HEIGHT, mirror_x=False, mirror_y=False)
palette = displayio.Palette(2)
palette[1] = 0x00FFFF # shape color
tile_g...
resolves: #8113
Tested successfully on a PyPortal by making a build from the PR branch with the test code posted in the issue.
I think that did end up being the fix for me (remove and re-sync) But it was a little more convoluted because it turned out the commit I was at was from before make fetch-submodules existed, so I had to track down the old way to do that (Hug report is in order Tyeth for help with that.)
it also turned out that commit was way older than where I needed to be looking to find the issue I was looking into though so I was able to "jump forward" pretty far in time and didn't have any more submodule weirdness.
It looks like circup is still failling because of the broken release 13hrs ago. Is there a way to tell circup to use the previous release instead?
we could still try removing the latest release, it can't make things worse, can it ?
I wouldn't think so.
In https://github.com/adafruit/circuitpython/blob/main/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/pins.c BUTTON is defined on gpio 2
But according to https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/hw-reference/esp32c3/user-guide-devkitm-1.html the button is on gpio 9
@lone axle @jaunty juniper I am trying to re-run the bundle build. I deleted today's release.
ah you did 👍
i made a change yesterday in the assigned user for something else (updating circuitpython-org pages as adafruit-adabot instead of blank, which was registering as ladyada), but I didn't think it would affect this. The
build failed again in same way.
I will undo my previous change, jsut in case. It was only cosmetic (Limor sees way more commits by her than she would like)
hmm, it wasn't really blank: I can't set a blank one. I'll set it to myself and see what happens.
running yet again
this run is without deletion, so I will probably get a different error. Then I will delete the release and try agian.
... release is still gone, failed the same way, trying some other actions for bundle
whatever you did seems to have fixed circup. I can now list my local modules
i removed today's bundle
@idle owl I was going to re-run the regular job. Should I re-run with your push?
some discussion above
i am going to be afk in less than an hour
I've been working on this for the last hour. I don't think we can manually trigger it with the push. I was going to add a workflow_dispatch which makes it possible to trigger a new job.
Oh you did do someting somewhere.
Regardless, that TOKEN doesn't exist anywhere, so I'm not sure how it ever worked without the change I made.
all I did was set the circuitpython-org user name to adafruit-adabot; I don't really think it has to do with this.
I changed it to myself just in case that affected it, but it's not even used in this repo
That sounds unrelated.
if it doesh't work, you can just delete the bundle release and tag, and yesterday's bundle works.
I did that once already.
Hold on trying to add a thing and not figuring out how
@tulip sleet Wondering if I have to give workflow_dispatch parameters if there is something else in the on: section. I can give it a specific branch easily which is fine because we want it run against main anyway. If that doesn't work, I'll toss it to you to get it to trigger another run that actually uses the updated file. tl;dr: If this build fails, I have one more thing to try, and if that fails, I'm returning the file to my original push.
@tulip sleet It worked! You can now manually trigger the Release Actions run from the GitHub UI. Triggered a new run. (Triggering a run on the previous job was not using the updated release.yml file.)
Well, new failure this time. Rerunning with debug enabled.
Might be the TOKEN change.
I'm not sure it's actually related to the root cause anymore but I did find that those bracketed template things at the end of the URL printed in debug are for a "Hypermedia" url: https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#hypermedia
Hmm.
I don't really understand what all of that means.
(It failed sooner than before, so I'll swap the token back to what it was once this fails, if it seems like that's probably the issue now.)
This all seems like we're going after red herrings because the failure is obtuse.
This is the result of generating the upload_url with the updated token: ##[debug]..=> null ##[debug]=> null ##[debug]Result: null
Reverting that.
i'd say switch it back; in the morning I'll see if the new bundle fails, and if so, I'll just delete it again, same Monday morning, and we'll get other eyes on it on Monday
Though I wish I understood how it worked.
It's a shorthand notation for URLs that can get specific fields populated with variables by some system. I think in our case they aren't problematic, the log printout doesn't seem to be able to handle it so well but the underlying system should be fine with it if I am understanding.
Ok that makes sense.
Ok, this sounds like a better plan than continuing to go in circles.
no vital bundle updates
Ugh, I wanted to run it with debug. Can only do that on rerun apparently.
That was going to be my point in another reply to the failure emails, to the team.
@lone axle Thanks so much for looking into this with me. If nothing else, I now know a few more things about how this works.
@tulip sleet I saw you had triggered one of the runs, I should have messaged you. But I think you were idle, so I wrote it off as maybe you didn't trigger it and I didn't see it right. Parallel debugging happening here.
i was in this channel with neradoc but then went away and saw it didn't work, but no problem, because older bundle was fine
once I deleted the partial new bundle
I messaged Tekktrik about it. He's way more up on CI shenanigans than I am. He's not around right now though. If he can get eyes on it at some point, he might have some insight we didn't think of.
@tulip sleet Failed. On the new failure. Uh oh. I have no debug to know if it used the new file or not. Rerunning one more time with debug to check that.
Then I swear I'm done.
then you'll revert?
Already did!
But it now has the failure it did after I made the change.
So I'm not convinced it is using the reverted file.
That's why enabling debug logging.
It told me before when it wasn't using the new file.
where did you make the change? I see no PR or revert PR in Bundle repo?
I pushed the change to release.yml
Where I made it in the first place.
Directly. Did not PR.
@tulip sleet It is using the reverted file. So... at this point, the only change from before is including the workflow_dispatch which is completely unrelated to any of the rest of the Actions file. What I'm saying is, there are ostensibly no changes, and now it's not generating the upload_url, which it was doing earlier today.
(╯°□°)╯︵ ┻━┻
I'm done with this until Alec can take a look at it. Or until Monday. Whichever is soonest.
let's just wait and see what happens tonight ... yeah
I'm on board with this.
CircuitPython version
Adafruit CircuitPython 8.2.0-rc.0 on 2023-06-23; Raspberry Pi Pico W with rp2040
Code/REPL
from wifi import radio
from socketpool import SocketPool
from builtins import bytearray
from time import sleep
from secrets import secrets
radio.connect(secrets['SSID'], secrets['PASSWD'])
while not radio.connected:
print("Connecting...")
sleep(1)
print(f"Connected at address: {radio.ipv4_address}")
socket = SocketPool(r...
After a little testing, seems like if the control-C happens during conn, addr = s.accept(), then it won't accept connections after reload. But control-C elsewhere it recovers ok.
Howdy 👋 - I am trying to add support for the M5Stack Stick C Plus. The M5Stack Stick C (not Plus) firmware, when loaded on the Plus, gives a garbled display and I think might not be booting all the way. I spent a few hours running down cross-compiler stuff but I'm hung up on:
"/usr/bin/xtensa-esp32-elf-gcc" is not able to compile a simple test program.
once I use make BOARD=m5stack_stick_c_plus (referencing a new directory I made with a few tweaks to the stick c directory)
Is this channel the right place to seek advice on getting my toolchain working?
did you follow the guide to build CP ?
yes, this was after I got mpy-cross going
including that ? https://learn.adafruit.com/building-circuitpython/espressif-build
(what platform are you on ?)
I did not see that. I don't use Linux daily, but we have a gaming laptop dual-boots Manjaro, so that's what I'm using. Aside from having to compile xtensa-esp32-elf-bootstrap and xtensa-esp32-elf-gcc from AUR, most of that guide looks like what I fumbled through to get to where I'm at.
I didn't do the install.sh on the espressif ports dir, looking at that now, and any other hints on this page.
you shouldn't need to compile or do anything for gcc
esp-idf will download all you need to ~/.espressif includding all the binaries for gcc
plus its own python venv (in which you need to install the requirements-dev.txt)
also I gotta sleep, but more people will be there tomorrow in a few hours
(or monday for sure)
I think my problem was I started immediately trying to fight my way through errors after make BOARD (oh gosh, gotta install ninja, oh gosh, gotta install xtensa-esp32-elf-gcc) and never found this espressif-build guide. Thanks again!
Success! Cheers
I'm un-blocked. I'll try actually loading the firmware tomorrow. It is also late here.
At first glance it looks like todays auto-release for the library bundle did succeed.
Yes, it looks ok: it has all the files I expect in the GitHub release assets, and when I use circup it downloads the new bundles just fine. tagging @idle owl
i have no idea what that hiccup was
Fixes #5918
Checked the schematics (pdf), and tested on the board.
CircuitPython version
Adafruit CircuitPython 8.0.5 on 2023-03-31; Raspberry Pi Pico with rp2040
Code/REPL
import typing
Behavior
Traceback (most recent call last):
File "", line 1, in
ImportError: no module named 'typing'
Description
I thought this module is supported.
I read this but I'm a bit confused https://github.com/adafruit/Adafruit_CircuitPython_Typing
Additional information
No response
Nevermind, I found that it should be treated as an exception: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/typing-information
Based on the M5Stack Stick C Board, I modified the LCD settings so the display works at the higher resolution and is aligned with the screen boundaries. I added GPIO for the built-in speaker which was added to this version of the board, and verified the other GPIO pins match the data sheet from M5Stack.
settings.toml exists, but is empty. hard to examine anything else, it keeps crashing.
CircuitPython version
Adafruit CircuitPython 8.1.0 on 2023-05-22
Code/REPL
# Documentation issue; Not in Code/REPL
Behavior
# Documentation issue; Not in Code/REPL
Description
This is a CircuitPython API documentation issue.
In the latest and releases after 7.2.x, the API reference docs no longer have links for the circuitpython_typing types.
For example, in docs for the latest version see `circuitpython_typing.Write...
loaded 8.2.0-rc.0. REPL does not echo to console now, can now get through a import os; os.listdir() without crashing (but still extraneous screen garbage), and import wifi still crashes.
@fovea1959 Are there multiple build versions of the ODroid Go? It's strange @tannewt cannot reproduce this on his sample but it consistently crashes for you. Maybe take a picture of your board that makes the markings on the Espressif module visible, etc.?
CircuitPython version
Adafruit CircuitPython 8.2.0-rc.0 on 2023-06-23; Hardkernel ODroid Go with ESP32
Code/REPL
None
Behavior
After a powerup and connection via the UART, characters typed in the REPL show up on the screen, but are not echoed to the host PC.
Issuing commands import os os.listdir() causes screen garbage.
import wifi still hangs.
Description
No response
Additional information
Is there a way to disable the ...
CircuitPython version
8.2.0-rc.0
Code/REPL
# Run any code using audiobusio
# and at the same time, perform a lengthy write to the CIRCUITPY drive
Behavior
The audio mostly works fine, however, when the audio dma underflows due to not running background tasks frequently enough, unrelated memory is treated as audio data. This can sound like static, a chirp, a honk, etc.
This happens especially frequently when writing to the CIRCUITPY drive, bec...
Didn't test but the change looks correct to me.
CircuitPython version
Adafruit CircuitPython 8.1.0 on 2023-05-22; Raspberry Pi Pico W with rp2040
Code/REPL
# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""CircuitPython I2C Device Address Scan"""
# If you run this and it seems to hang, try manually unlocking
# your I2C bus from the REPL with
# >>> import board
# >>> board.I2C().unlock()
import time
import board
# To use default I2C bu...
You're going to need to create a new busio.I2C object, since the Pico doesn't have one by default.
See https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitpython/pinouts#no-default-board-devices-3082902 for more details about why there is no board.I2C() object, and what you would do instead.
By pausing audio during flash writes, the worst screeching of #8121 is avoided. I don't consider this a full fix, but it greatly improves the by far most common scenario in which the problem occurs, and can't otherwise be worked around
Tested on rp2040 prop feather with a midi synth playing arpeggios. When writing to the flash e.g., with
dd bs=512 count=32 if=/dev/zero of=/media/jepler/CIRCUITPY/boop
the audio goes "tap tap tap tap" during the flash write instead of the squawki...
<@&356864093652516868> Reminder of our weekly discord meeting, in about 1.5 hours, at 2pm US Eastern time. Add your notes to https://docs.google.com/document/d/1VFqasfzcuR1nmpfB-IxASRSf9isPpRWfG1O3ZAUnp8Y/edit?usp=sharing
@tulip sleet @idle owl sorry I was camping this weekend, I heard the CI went wonky, it seems like everything is fixed now?
yes, weird failure, including on re-runs, but the next night's one was fine!
Just tested this on a QTPY RP2040 w/ I2S DAC (PCM5102A) and, yes, SO MUCH BETTER.
(in general, I've found I2S to be more screechy than PWM, with M4 built-in DAC being least screechy).
Now, on reset with USB connected to MacOS: it's mostly quiet with maybe a small bit of chugga-chugga noise (that hilariously to me, sounds reminiscent of GSM cell interference)
This is a great improvement. I may still tell people to include a 5-second delay at the top of their code.py so they don't ge...
Sweet! Glad to hear!
Please make a PR for the new creation ID here: https://github.com/creationid/creators/blob/main/creations/m5stack.md
Thanks!
You can disable the display by calling displayio.release_displays(). With a build you can also comment out all of the display init in the board_init function.
@onyx hinge yup, single buffer mode is basically what I was thinking but it'd DMA two different addresses instead of the same one
This is CircuitPython 8.2.0-rc.0, a release candidate for CircuitPython 8.2.0. We believe it is stable, and are making a release candidate for further testing before final release.
Notable changes ...
It's no secret that we're huge fans of CircuitPython and the plethora of boards from Adafruit that make learning more tactile and colorful. We chat with friend of the show Kattni Rembor, a Creative Engineer sponsored by Adafruit to talk about her work with CircuitPython and the vibrant community that has sprung up around it.
Neither am I.
[background: pipewire is the newer audio library/api/server for linux and many linux distros are in the process of replacing the old software, pulseaudio]
@onyx hinge Wait what? USB A doesn't fit?
I have a bare usb A to C adapter here, and a NeoKey BFF. Holding the entire A connector over the BFF and it fits. Obviously that doesn't take into account connecting the pads up...
Hmm.
Should be.
This fits.
Which has pins coming out the back on both sides of the little PCB in there.
I measured with a ruler, yep 0.6:
@onyx hinge Mostly wondering if there's another USB footprint part to use.
I will be out. I don't think moving it to Wednesday makes sense.
Also an option.
That's what I would suggest.
Thanks @tulip sleet !
Thanks everyone
@onyx hinge Can you also remove it from the hosting calendar?
Thanks for hosting Dan! Have a good week everyone.
Thanks everyone!
@idle owl yes
thanks!
if I have permissions anyway
Thank you! You have perms with your Adafruit account.
@slender iron right before the meeting recording started, I wasn't fully tuned in, but you mentioned me and someone else... maybe some technical issue with my connection to the meeting? It looked fine and muted at my end.
@crimson ferry just how discord hides your username when in streaming mode
@timber mango you were scheduled to host the meeting on july 3, note that we canceled it so you get a pass.
@onyx hinge Wrong person.
oops sorry!
@candid sun you were scheduled to host the meeting on july 3, note that we canceled it so you get a pass.
@onyx hinge ah okay, thanks!
Here is the notes document for the next CircuitPython Weekly meeting, which will be on July 10, 2023. ***Note that we are skipping the week of July 3 due to a US holiday. *** The meeting will be 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/1ajdwXoubhG86rUVabqTcEzHvOKfUgK9TgPdDxqBDlSc/edit?usp=sharing
for usb host on rp2040 I've run into the issue that making a non-default alarm pool (in order to run on core 1) requires malloc
I could 1) change pico-sdk to allow for a statically allocated pool or 2) remove the need for alarm pool in pio usb
A change that does not require modifying pico-sdk (potentially forever) would be nice. They might take simple PR.
I've also gotta see how many changes I have for placing stuff in RAM
I'm leaning 2 which changes the PIO USB library
skipping the alarm stuff simplifies all of that I think
CircuitPython version
Adafruit CircuitPython 8.1.0 on 2023-05-23; ESP32-S3-Box-Lite with ESP32S3
Code/REPL
# Circuit Playground Express Demo Code
# Adjust the pulseio 'board.PIN' if using something else
import pulseio
import board
import adafruit_irremote
pulsein = pulseio.PulseIn(board.G38, maxlen=120, idle_state=True)
decoder = adafruit_irremote.GenericDecode()
while True:
pulses = decoder.read_pulses(pulsein)
print("Heard", len(pul...
fwiw I briefly tried implementing the "DMA controller sets its own next-DMA address" scott suggested but it didn't work right off the bat as a simple change.
It seems like either you'd end up using 4 DMA channels (2 to actually do transfers + 2 to set transfer start addresses), or you would have to use a different method than checking which DMA interrupt fired to know which memory buffer to fill.
Thanks, I've got a PR open on the creators repository now.
Code looks good to me. Suggestion of more descriptive name than cookie.
I would feel comfortable putting this in 8.2.0. How about you?
void audio_dma_unpause_channel_mask(uint32_t channel_mask) {
for (size_t channel = 0; channel < NUM_DMA_CHANNELS; channel++) {
audio_dma_t *dma = MP_STATE_PORT(playing_audio)[channel];
if (dma != NULL && (channel_mask & (1 << channel))) {
void audio_dma_unpause_channel_mask(uint32_t channel_mask);
uint32_t channel_mask = audio_dma_pause_all();
flash_range_erase(CIRCUITPY_CIRCUITPY_DRIVE_START_ADDR + _cache_lba, SECTOR_SIZE);
flash_range_program(CIRCUITPY_CIRCUITPY_DRIVE_START_ADDR + _cache_lba, _cache, SECTOR_SIZE);
_cache_lba = NO_CACHE;
audio_dma_unpause_channel_mask(channel_mask);
I approved and merged the creation id PR.
Just to be clear, do you have one of these, and did you test the build? Thanks.
Also need to figure out why
u = board.UART()gets a hard fault on this board but not other S3 boards. Haven't spotted a difference in board defs from boards that work.
Did you fix this? Not sure if it ready to merge. Thanks.
Do we want to wait until after 8.2 to do this?
Yes, we should wait.
@ZodiusInfuser hi - is this board still in process?
Noticed this while working on the zlib module in MicroPython. FYI we're working on adding compression support -- see https://github.com/micropython/micropython/pull/11879 -- and was looking to see if CircuitPython implemented this already.
The docs say the method is called zlib_decompress but should be just decompress. (See https://docs.circuitpython.org/en/latest/shared-bindings/zlib/index.html )
Hi @dhalbert. Yes it's still very much in progress, just taking its time due to the complexity involved: https://twitter.com/ZodiusInfuser/status/1673292599552090112?t=IEEiOgdyxdWWXQ05dlDzRw&s=19
Actually, that reminded me I still have some local changes in need of committing. Frustratingly I had to use --no-verify as the pre-commit checks failed because they require Uncrustify 0.71, but I have 0.69 but have no way of upgrading WSL.
I can't foresee there being any more functional changes needed to this PR. The question still remains though, of the best way to support the tca9555 without my approach cluttering up the code base as it does now.
they require Uncrustify 0.71, but I have 0.69 but have no way of upgrading WSL
Do you mean you are on Ubuntu 20.04 instead of 22.04? You can upgrade:
https://askubuntu.com/questions/1428423/upgrade-ubuntu-in-wsl2-from-20-04-to-22-04
22.04 has uncrustify 0.72.0.
if you want to stay on 20.04, you can install the pybricks ppa to get 0.71.0:
https://launchpad.net/~pybricks/+archive/ubuntu/ppa
Oh brilliant! Thank you for that @dhalbert. I have upgraded to 22.04 now and have fixed the errors with this PR.
I'd like for this to be in 8.2. Do I need to re-target the branch or is main still where 8.2 comes from?
I took the "cookie" -> "channel_mask" suggestion, just not via the "accept suggestion" button.
I'd like for this to be in 8.2. Do I need to re-target the branch or is main still where 8.2 comes from?
No problem - it's still main. I will make a branch when I make 8.2.0 final.
Thanks! This is a big improvement!
Not yet, converting to Draft. It will run the DevKitC N8R8 fine, but something is different in my changes.
Also needs Seeed VID / PID.
@jimmo pre-commit wants an indentation change. I tried to do it for you (since it says 'maintainers are allowed to edit this pull request') but github didn't permit my push to a branch in your repo.
Hi @dhalbert. Has this been looked at yet?
It's marked "long term", which means that Adafruit folks haven't prioritized working on it (but we welcome others work on it). As far as I know, nobody's started working on it.
Thanks. I only ask because my unrelated Yukon board PR contains some of this change, so I don't want to step on anyone's toes when that eventually gets merged.
OK, the test failure is wild
Any change can add or remove qstrs, which also changes the numbering of qstrs. Strings used as identifiers also get added as qstrs.
The line \.\+63 is intended to check that the bytecode of the function ends with a 63 instruction, AKA RETURN_VALUE. However, with this exact set of qstrs the identifier g gets the qstr number 0x0463 which appears in the instruction bytecode as 04 63, which gets matched by the regular expression.
That causes the rem...
One more comment. The clean refresh time is still incorrect.
Don't remove the plain LED name because it is used in basic examples.
@lone axle need me to look at your esp32spi changes?
That would be great! I do think it's ready for a look by someone else.
Thank you
@lone axle what order should I look at them in?
This is the root one:
https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/pull/167
These ones require the root one to be in place in order to test / evaluate:
https://github.com/adafruit/Adafruit_CircuitPython_Requests/pull/135
https://github.com/adafruit/Adafruit_CircuitPython_WSGI/pull/20
👍
This one deals with the same concept of the socket API: https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k/pull/125 but is not independent from the ESP32SPI once since it's for ethernet.
@tulip sleet looks like 167 is your PR. Do you want to circle back to it or pass it off to foamyguy and I?
@lone axle is there a way we could change requests and wsgi first so that we don't need to do all three at once?
@lone axle I was just going to drop the WSGI server from the ESP32SPI library. If you move any additional functionality to anothe repo, that's fine, but at this point maybe HTTPServer is sufficiently functional?
Are there any changes to be made in #167? I'm not sure I can reassign it to you, but you could push changes to it.
foamyguy did already
Unfortunately HTTPServer cannot be used with ESP32SPI because the latter doesn't implement the bind() function on the socket, which HTTPServer uses. So WSGI library is the only way that I know of for any sort of http server functionality with ESP32SPI.
I have committed all changes that I was able to find that it needed to the PR branch.
ok, now I remember. I kind of remember wondering whether we could a have dummy bind(), but it seemed tricky. It's fine to me to merge my PR when you are ready.
Should we wait to do this switch until after the 4th of July to make sure we're around to fix things that come up?
i am not going away
I'm not 100% certain, but I think if requests is merged without ESP32SPI then ESP32SPI based devices will not be able to successfully use the new version of requests, they'd have to keep using the prior release.
Same for WSGI library I think. If that were merged I'm not sure if it would function with the older version of ESP32SPI.
so do all of them in one bundle release, right, that's what your proposing?
Yep, I think that would be ideal. That way when someone does get get the newer ones installed via default means they'll be getting ones that co-exist and function together.
It wouldn't be the end of the world if it's not done in the same release, but it would mean some folks may need to track down older releases of one or the other of the libraries in order to get things running.
we have to do it some time. You've done a lot of testing, so I think we're ready. Then we also need to make Guide changes of some kind, right?
for doc purposes
Possibly, it will depend what all is covered in the guides. If there is anything that covers the inner workings of ESP32SPI library, it would probably need some changes to reflect the new functions and behaviors that it has now.
But many / most of the guides are built on higher level libraries like adafruit_requests or adafruit_pyportal which abstract away the details anyhow, so project guides using these higher level libraries may not have anything to change.
I tested a small handful of the projects based on those higher level libraries like requests, and pyportal and all the ones I found were working as expected with the new versions. They didn't require any change in the actual project code. I didn't check all of the guide pages for the ones I tested though, it's possible there may have been explanations in there that could need tweaked, though I think it's likely many of them don't go down into the details enough to have info that would need changed.
which ESP32SPI boards have it frozen in, as well as the requests library (so compatible versions) ?
matrixportal, I think
Good thought. I'm pretty sure pyportal does have both frozen in as well.
pyportal, pyportal titano, matrixportal have requests and ESP32SPI frozen. lots more too but they are Espressif
Actually come to think of it, the fact that those are frozen in to many of the devices they're used on means that the bundle being all updated at once is perhaps a little less critical. The vast majority of people will just be using the frozen in versions rather than installing them anyhow.
did you want to wait for that update before 8.2.0 so we can update the frozen libraries ?
I just approved all three PRs but didn't merge
it's way too much churn to update the frozen libs in the rc
i was going to make rc.1 today with the few new changes since Friday. i could do 8.2.0 final Wednesday or Thursday morning, but could also wait until next Wednesday
@onyx hinge do you want the ulab update to be in 8.2.0? Does it fix significant bugs?
@tulip sleet no, I don't think it's critical
if I'd thought of doing it a week ago I'd sing a different song
the shape.set_boundary() fix, the no-screech rp2040, and a minor board fix are all interesting for 8.2.0 final and are merged. There isn't an unmerged PR left that is significant, then. The zlib doc fix does not need to be in 8.2.0 final.
I will make an rc.1 with the current set of merged PR's, and do 8.2.0 final tomw as a new name for rc.1, barring new issues.
I'll start on release notes, should be quick
thanks!
thank you for release-wrangling, Dan!
It looks like the updated version over-fills a number of boards' flash space :-/
One more comment. The clean refresh time is still incorrect.
I still disagree on that. I have two of these Inkys running here with my patch without any problems. It saves me 26s of update time without any problems.
Can you please post some test-code that demonstrates the need for a refresh_time value of 28? If there is no code that fails with 2s then there is no reason to use 28s.
Automated website update for release 8.2.0-rc.1 by Blinka.
Maybe your PSR-setting is the reason why you need such a long refresh_time? You tell the display in the init-sequence to rotate the screen by 180, and then you rotate the content yourself within CircuitPython before sending it to the display.
@onyx hinge Do you have a few minutes to go through a piece of code with me to help me explain it in the guide? It involves seesaw firmware if that matters. Basically I don't get button masking well enough to explain it. Or really at all.
@idle owl I think I have to leave in about 10 minutes so unfortunately not
Ok, no worries. Thanks, anyway.
@tulip sleet Same question, since you appeared. 😄
Looking elsewhere also. No worries.
@tidal kiln Hello! So... it has been requested that I actually explain what's going on in the code in the guide containing this demo, because Anne has run into multiple support issues with this type of code before because it's usually glossed over. I have a starter explanation that Anne wrote up, but she said verify it, and I don't understand any of the button parts well enough to verify anything. I do get the joystick code. But not the button code. https://github.com/adafruit/Adafruit_CircuitPython_seesaw/blob/main/examples/seesaw_gamepad_qt.py
You set up variables that are set to the seesaw firmware pin they are attached to. Then.... button mask is where I get lost.
first - that approach is only needed when using the "bulk" methods
it could be done without a mask, but then would require multiple reads, each being I2C traffic, to read all the pins
Hmm ok
so it's not like it's a required all the time sort of things
Ok got it
it just helps speed things up, since it can get multiple pin states in a single I2C xfer
Ah ok yeah
if you did it without mask and separate calls, under the hood it'd be reading the same register each time, but then only returning the pin of interest - the masking stuff would be happening inside the firmware running on the seesaw chip
with the "bulk" access, the seesaw chip just returns the full register value and leaves it up to user code to deal with
Ohhhh. So it does the work, and only speaks up when something important happens?
Wait no.
Oh! Ok, I think I get what's happening with bulk. The full value would be different with one or more buttons pressed, and the code is written to be aware of that?
yah. easiest to think of just 8 pins as an example.
digital pins are either high/low so a single pin state can be represented by a single bit 0 or 1
and a single byte register could then hold the pin state for 8 pins, with each bit representing 8 different pins
and for 32bit MCU's, it's same deal, just 4 bytes / 32 bits
so the non-bulk would
(1) read register PIN_STATE (which has the state of 8 pins)
(2) do some mask foo stuff to figure out if pin X is 0 or 1
(3) return true/false depending
so if you wanted pin Y, it'd read the same register again and do the same thing
and the I2C traffic could end up being a bottle neck
Ahhhhh ok
you'd use this call to do things without a mask:
https://github.com/adafruit/Adafruit_CircuitPython_seesaw/blob/d99b564ce5dc1784ec22e87626eea59235089916/adafruit_seesaw/seesaw.py#L214-L218
Oh ok
the bulk call is using this seesaw interface call:
https://learn.adafruit.com/adafruit-seesaw-atsamd09-breakout/gpio
Fair enough
it reads the 0x04 register - which, per the seesaw spec, is a 4 byte return
so after this call:
buttons = seesaw.digital_read_bulk(button_mask)
think of buttons as a string of 1's and 0's representing the pin state of 32 digital io pins
Ok.....
the masking is how to check for a given pin's 1 or 0
yep. there's room, per the seesaw spec, for 32 pins.
Ahhh ok
print(bin(buttons)) I find helpful after getting digital_read_builk()
but what it actually is can be port specific - note the separate sections for SAMD and ATTINY with specific details
I did see that.
and then the other thing to keep in mind is that for the ifs, 0 is False and anything else is True
thats how you can just logical & with the mask and that's enough
Because it will only be 0 or 1?
nope. it'll be 0 or something other than 0
for example, let's say it's button 4 you're after
OK
bit 3 would be what you'd look at
Ok
This is really neat!
0b00000000 # nothing pressed
0b00001000 # button 4 pressed
That's something other than 0.
>>> mask = 0b00001001
>>> button = 0b00001000
>>> if button & mask:
... print("button pressed")
...
button pressed
>>> print(button & mask)
8
that would be a mask where buttons 4 AND 1 are of interest
Ok I was confused there for a moment.
but the button value itself is only showing button 4 is pressed
OH! print(bin(buttons)) suddenly makes sense.
but the logic was true, and the actual value it dealt with was 8
The gamepad is 16 bits right? Because the Gamepad buttons are on pins between 0 and 16 inclusive. So, when no buttons are pressed, the mask looks like this becuase 0, 1, 2, 5, 6, 16 are of interest? 0b10000000001100111
And then the associated button is pressed, the 1 in those places become 0?
(at least that's what it's doing)
Sorry if I'm getting ahead of myself here. It clicked when you explained your example mask there.
I was confused before that moment.
about the value I posted above.
Ahhhhhhhh
the gamepad just isn't using any pins above 16
Ok got it
the simple example above would have also printed button pressed if button 1 was pressed instead of 4
so the example has:
if not buttons & (1 << BUTTON_X):
Oh hmm.
to check for specific buttons
yep. and binary format print in python if you're at a repl is also helpful.
>>> BUTTON_X = const(6)
>>> BUTTON_Y = const(2)
>>> BUTTON_A = const(5)
>>> BUTTON_B = const(1)
>>> BUTTON_SELECT = const(0)
>>> BUTTON_START = const(16)
>>> button_mask = const(
... (1 << BUTTON_X)
... | (1 << BUTTON_Y)
... | (1 << BUTTON_A)
... | (1 << BUTTON_B)
... | (1 << BUTTON_SELECT)
... | (1 << BUTTON_START)
... )
>>> print("0b{:016b}".format(button_mask))
0b10000000001100111
>>>
can think of this as being another mask: (1 << BUTTON_X)
being created in place
using the << left shift operator
>>> print("0b{:016b}".format(1 << BUTTON_X))
0b0000000001000000
I printed (bin(buttons)) under the buttons = seesaw.digital_read_bulk(button_mask) call, which printed the same thing.
Because x is in the 5th bit spot?
hey! that's new to me 🙂 knew about hex() figures theres also a bin()
Or whatever the right word to use there.
the_more_you_know.gif
That was Tod's suggestion 😉
keen
When printed there, it updates when you press the buttons. It's nice.
Once I understood the base value anyway.
masks are general - don't always have to be for a single bit
Ok
but in the case of checking for a specific pin, they are. that is, all 0s except for the bit with the pin of interest
Ok
i guess it could be argued that the example could be written without using masks, to be more beginner friendly readable? or somehow show both, since there are those that would want to also see this approach. multiple examples?
Eh...?
for example:
if not digitalRead(BUTTON_X):
print("Button x pressed")
if not digitalRead(BUTTON_Y):
print("Button Y pressed")
if not digitalRead(BUTTON_A):
print("Button A pressed")
if not digitalRead(BUTTON_B):
print("Button B pressed")
if not digitalRead(BUTTON_SELECT):
print("Button Select pressed")
if not digitalRead(BUTTON_START):
print("Button Start pressed")
We use this in all of the guides for things using seesaw
I am unaware of us showing the other way.
it's a tradeoff. the code above would just generate other feedback, since each digitalRead() call is I2C traffic.
Agreed.
So I'd rather explain the existing code.
Anne's point is the seesaw firmware pins are magic numbers to people not In The Know, and then that leads to the rest of the issues with the code. In terms of support problems.
So is it ok to refer to a 16 bit value when referencing the button_mask creation? Or should I refer to 32 bit, and explain that this code isn't using anything over 16.
That the mask can be a subset.
this is guide specific to gamepad?
I do have one. The build runs Hello World. Photo of screen attached. It is not showing up as a circuitpy drive and I haven't gotten REPL to work via USB. I can list files over USB with adafruit-ampy, which I'm not too familiar with but found during my troubleshooting. Ampy get fails on module ubinascii. Additional guidance is welcome. I'm in the discord channel.
hmm...maybe dont say one way or the other. just call it a mask.
Ok
an attiny seesaw has the potential to return more:
https://learn.adafruit.com/adafruit-seesaw-atsamd09-breakout/gpio#gpio-register-setup-on-attiny8x7-3111799
so don't want to give too much importance it being 16 bit
Got it
Can I ping you after I try to write this up? So you can tell me where I didn't quite get it?
sure
Thanks. Will do.
and hopefully explanation above helped?
Hoping so. We'll find out!
@jimmo pre-commit wants an indentation change. I tried to do it for you (since it says 'maintainers are allowed to edit this pull request') but github didn't permit my push to a branch in your repo.
No worries, updated!
Just saw and worth noting https://github.com/micropython/micropython/pull/11879 is working on adding compression.
@tidal kiln DMing you the preview link. Hopefully this is good enough. Hoping to get it back to Anne today.
@ladyada
Also renames USB board name for Metro M7 1011 AirLift, which did not have "AirLift" in its name, and adds I2S pin names on that board that are more consistent with other I2S pin names.
reviewed the changes to the airlift-version M7, thanks.
This is my open PR. Does anyone have an original M5Stack Stick C (not plus) to test the latest stable CircuitPython on? Specifically:
- Does REPL work over USB serial?
- Does it show up as a mass storage circuitpy drive?
it's an ESP32 (no suffix), it cannot do mass storage.
if ampy works to list files, the REPL works, how did you try to connect to it ?
ampy needs to be changed to use binascii instead of ubinascii, I don't know if there's a version somewhere that does that, I know there was a PR to make it fallback to it but 🤷
thonny should work, our official solution is the web workflow
@gamblor21 Some notes based on our experiences with this in MicroPython:
Implement decompressing data streams via the
zlib.decompressobjstyle function like in CPython.
The API for {decompress,compress}obj seems backwards to how I imagine most people want to use this (i.e. reading/writing compressed data to a stream/socket/file). I'm not convinced there's any value in implementing these for a microcontroller target.
GzipFile provides a much better interface.
Unfortunately Gz...
Is there any way that I can help out in implementing this? I'm interested in using the ESB on the NRF52840 for a low latency HID project (BLE is capped at 7.5ms latency). I was looking at the Nordic's ESB protocol docs/examples and was hoping if I could implement it for circuitpython since @dhalbert seems to be busy implementing more important features 👍 . I own a NRF52840DK and the NRF52840 dongle if that is helpful at all.
Hi, have you gotten anywhere with this? I have a project I woul...
Screen on Manjaro Linux (I get some garbled output), cu on OpenBSD which is my actual primary workstation (it sees the USB serial port but it's not responsive). Both of these work great with my AdaFruit Circuit Playground Express. I need to try to figure out the web flow.
We got signal. Needed to manually set baud rate. And the web esp tool works.
No, not in CirPy. We (me and TMRh20) made some progress as an Arduino Lib (C++). Checkout nrf_to_nrf. We also added support in the network layers' v2.0 (RF24Network and RF24Mesh) for the nrf_to_nrf lib. But that nrf_to_nrf lib is still in its infancy - no TX FIFO implemented and no interrupt support (both of which would depend on the RTOS used).
It turns out that the ESB protocol implemented in the nRF Connect SDK (& nRF5 SDK) cannot behave iden...
[just curious, I was trawling the github repo] and couldn't figure out how code that crossed the python/C boundaries was being tested (e.g. bitbangio.I2C). Is there some magic workflow that's testing these in some other way?
CircuitPython version
Adafruit CircuitPython 8.1.0 on 2023-05-23; ESP32-S3-Box-Lite with ESP32S3
Code/REPL
#The default sdkconfig:
CONFIG_ESP32S3_SPIRAM_SUPPORT=y
CONFIG_SPIRAM_TYPE_ESPPSRAM64=y
CONFIG_SPIRAM_SIZE=8388608
CONFIG_SPIRAM_MODE_OCT=y
CONFIG_SPIRAM_SPEED_80M=y
CONFIG_DEFAULT_PSRAM_CLK_IO=30
CONFIG_DEFAULT_PSRAM_CS_IO=26
CONFIG_SPIRAM=y
CONFIG_SPIRAM_BOOT_INIT=y
CONFIG_SPIRAM_USE_MEMMAP=y
CONFIG_SPIRAM_MEMTEST=y
CONFIG_LWIP_LO...
What trips Halfkay mode in Circuitpython8.0 on Teensy 4.0
Fixes #8128
Use sdkconfig from other ESP32-S3 8MB PSRAM boards.
Tested on Espressif ESP32-S3 Box.
>>> espidf.get_total_psram()
0
it's tested by hand. Several years ago we were working on an automated hardware test bed, but there were many stumbling blocks. We would really like such a thing to catch regressions, but it's a lot of work.
Makes sense. Btw, it looks like the circuitpython support in wokwi is new, but is something like it (https://github.com/wokwi/wokwi-ci-action/network/dependents) an option you had looked at before?
the bugs we encounter would typically not be diagnosed in a simulator. They often relate to the actual hardware implementations of various peripherals (I2C, etc.) or system-on-chip things (memory management, etc.)
got it - thanks for the insights!
was it Tekktrik who looked into using wokwi for things like library tests ?
maybe - I don't remember
I think it was
I use wokwi to for basic "tests" on how CirPy differs from normal Python, and for that it's very handy
Following up: REPL works fine from USB serial if I specify the baud rate. WebSerial ESPTool works, Wifi works, and I can upload libraries and code to it through the wifi web file browser. From my end, I'm happy with this and I'm actively using it. Let me know if anything else is needed.
Why doesn't the auto setting work?
circuitpy drive won't work because the ESP32 doesn't have native USB. This is good enough. Thanks!
One more comment. The clean refresh time is still incorrect.
I still disagree on that. I have two of these Inkys running here with my patch without any problems. It saves me 26s of update time without any problems.
I also have one running here with the 28s clean. Just like I posted a video of.
Can you please post some test-code that demonstrates the need for a refresh_time value of 28? If there is no code that fails with 2s then there is no reason to use 28s.
It's the cu...
Do you run these tests "by hand" or via the CI action? (I'd love to see any examples of setting up the wokwi CI flow for CirPy in particular, just for sanity checks)
by hand, I use it to learn Python really
Good question, turns out it also seems to auto config the PSRAM by only adding:
CONFIG_ESP32S3_SPIRAM_SUPPORT=y
So I'll go with that instead and see what testings bring ?
I don't have a ESP32-S3-Box-Lite to test with; but running CircuitPython 8.1.0 on an ESP32-S3-DevKitC-1-N8 I was able to see pulses correctly using the provided script. All I can suggest would be to make sure you are on the correct pin. Perhaps just using digitalio on the pin to verify? Something like:
import digitalio
import board
import time
pin = digitalio.DigitalInOut(board.G38)
while True:
print(pin.value)
time.sleep(.1)
Should show state changes when you use ...
we tried to correct a related problem in #5541 -- in that case, it was reported that the returned value could be negative. It looks like there must still be a case where the returned value can unexpectedly be an erroneously positive number instead.
I think #5541 is probably a mistaken change; the comment above the original return statement outlines why the result of LPUART_TransferGetReceiveCount was not used to give the amount of data actually transferred.
`LPUART_TransferGetReceiv...
@jedgarpark iirc you discovered that setting a UART timeout was required for this to work properly? can you fill in some details? I hope it might be effective to get MIDI over UART working on teensy 4.1 too.
@onyx hinge hi -- you had a comment about why I'm seeing merge conflicts for files like shared-bindings/canio/Message.h snd other files that have no counterpart in MicroPython. Something about them being copied?? Could you re-explain? I would like to have these not appear in the future.
That seems familiar but I am not remembering right now
not a big deal. I've dealt with them now, just merging them back to "ours". the other file is some random one.
looks like there are ways to make merge not look for renames -- see man git-merge down at merge.renames and merge.directoryRenames.
I'm not sure I want to suppress that in general...
I will keep chugging along for now.
these are spurious renames, and I was not sure how to understand the cause.
@onyx hinge want to get my rp2040 usb host code going?
it is in my imx_usb_host branch
(just pushed it)
I'll have a look -- that's in your fork?
yup
fetching .. looks like broadcom decided to update so it'll be a minute
hrm, I didn't touch it at all. maybe you are fetching all of my branches 😬
soemthing else to push?
$ git submodule sync; git submodule update
fatal: remote error: upload-pack: not our ref 1e960631fb4237b18436435ad43ed0f826993d94
Fetched in submodule path 'lib/tinyusb', but it did not contain 1e960631fb4237b18436435ad43ed0f826993d94. Direct fetching of that commit failed.
yeah I asked git to fetch all from you
lemme look
looks like I have some debugging stuff in it
OK advise what I should try next
@onyx hinge try fetching from my tinyusb again. I pushed to a branch
OK checkout works
pushed another commit to the cp branch to include the tinyusb commit
OK, I have a binary. what should I expect to work / not-work?
I won't get out HW right now but just wanna know where it makes sense to start working..
you should be able to import usb.core and usb_host
the regular feather and feather usb host have board_init code for it
I was able to get serial input via HID reports
code is in supervisor/shared/usb/host_keyboard.c
the core takes over the HID device entirely, as it stands?
yes but the pyusb api has functions to disconnect to and from the kernel
(I haven't tested it.)
hah OK
if it was about writing python code to interact with a usb device I was thinking about biting off USB MIDI but that may not be a good idea
you could try it
I'm doing code for the intellikeys
(and totally found an issue with ctrl_transfer)
MIDI's also pretty time sensitive..
intellikeys is ctrl transfer. I think midi would be interrupt
intellikeys firmware loading at least
once I learn more about USB I'll be able to put that statement into context
cool! you can hear all about my progress, or lack of, next week this time!
just for a few minutes? I'm not on S&T tonight and I'm itching to go up and have dinner
we don't need to if you feel like you are ready to poke at it
I think either I'll be OK, or else just a few minutes video chat will not be enough to get me going. Leaning towards the former.
Is the RP2040 USB host for CP still a WIP? had a thought on something to use it for whenever I get two minutes for projects again
so I'll let you get prepped instead. make good use of your time away from all this!
kk, we can just sync next week
@blissful pollen I think if you tune in to S&T you'll get an update.
@blissful pollen it is in progress but does seem to work now
see above for where to find it
🤤 hungry, ttyl
Thanks I think I have the stuff to wire up to a RP2040 device to try it out. Sadly haven't had much time / energy for projects the last couple weeks
Bumping this because I'm eunning into it on a new (to me, and CircuitPython) esp32 dev kit, the M5Stick C Plus, and it affects both the LED and the IR, both for PulseIO and DigitalIo, for example, this will turn the LED on:
led = DigitalInOut(board.LED)
led.direction = Direction.OUTPUT
led.value = False
For things like digitalIO it's mostly just annoying and easy to work around. For trying to control IR devices, it makes the IR transmitter unusable. When I use pulseio on either...
@onyx hinge one last cp push for you to snag. fixes the slowness
yay!
Is anyone seeing PRs or issues on the contributing page? https://circuitpython.org/contributing
I've got blank lists for PRs and issues.
Yep, me too
I changed the user that is identified for these a few days ago to me, to test why all the commits were being marked as by ladyada. Somehow it is not working even though I should have the rights privs. I changed it again and am re-running to see what happens.
actually, hmm, I think this may not be relevant to the missing issues. There is another issue we are working about github tokens.
@idle owl not urgent, but the PAT issue seems to be showing up, or maybe this should be fixed now ^^
Should be fixed. I'll look into it tomorrow if not.
I'm not seeing Actions failures in the process. If that doesn't work, let me know and I'll dig tomorrow.
me neither, maybe the missing content we are seeing here https://circuitpython.org/contributing is from Tuesday after the initial PAT problem and before the fix.
I'm doing a re-run, but I'm not sure it will work.
Keep me posted. I'll check in tomorrow. Thanks.
@ladyada to test
- Add adafruit_qtpy_esp32s3_4mbflash_2mbpsram.
- Remove frozen modules from adafruit_qtpy_esp32s3_nopsram. They did not need to be frozen, and the corresponding Feather did not have these modules frozen. Probably a copy pasta mistake.
Just to be clear, the visible and IR LEDs on the M5Stick C Plus are active low:
https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/schematic/Core/M5StickC_Plus/StickC_Plus_20200616.pdf
It's the currently checked in code.
I would like a code.py example that demonstrates failure.
Your 2s setting is interrupting the process.
Have you tested the busy-pin with the updated PSR setting? And what consequences does "interrupting the process" have? Visually, I see no difference between 2s and 28s: the display is doing nothing until the real update starts. After the clean, during the real update, this is different: the display is indeed flashing for about that time-perio...
set_usb_identification allows people to currently change the manufacturer, product, vendor id and product id but it doesn't allow the changing of the usb interface name. This is currently hard coded in supervisor.mk.
The enhancement request is to also be able to change the usb interface name in the set_usb_identification method call
@tannewt
Thanks for your explanation. I think I need to study more about the steaming interface to make it happen.
@victorallume
I found that our HQ members had made SSL/TLS in MQTT for micropython. Maybe it would help.
https://github.com/renakim/W5100S-EVB-Pico-Micropython/tree/main/examples/AWS
https://github.com/renakim/W5100S-EVB-Pico-Micropython/tree/main/examples/Azure
So I added CircuitPython support for an ESP32-PICO-D4 based board and built successfully. How do I know where to upload my new firmware file to?
I mean, what offset should I use?
0x0? 0x1000?
The build documentation doesn't seem too helpful in this regard.
I uploaded a different firmware with the web uploader that was obviously not designed for my board there's a terminal at least. Mine is just dead I don't know if it's the wrong offset or another problem with my code.
Yeah, it seems 0x0 works for other firmware. Well mine is just borked then. 🙃
for CircuitPython firmware.bin you always use 0x0
TinyUF2 is the complicated one not CP
have you tried a generic ESP32 build that has 4MB flash support, which is what is in the module? e.g. adafruit_huzzah32_breakout
@jepler i can double check next week, but iirc it was just the timeout=0.001 argument that needed to be there for it to work.
My only slight confusion here is when I configure a Midi Device using standard CircuitPython firmware (see my example Python code above) it comes up as CircuitPyton Audio,not CircuitPython MIDI?
MIDI is part of the USB Audio specification, which is confusing. It's a particular kind of "audio" device.
Related to #4191. Since we are talking about the interface name for usb_hid, might be added to that module instead.
@tulip sleet Looks resolved. PRs etc are listed now.
Is GitHub down for anyone else?
Status is green across the board.
But git pull is doing nothing, and visiting in browser says server not found.
me too
Welcome to GitHub's home for real-time and historical data on system performance.
Their system finally caught up.
We're having a really bad day.
I uploaded the UM Pico firmware and got a terminal at least, but my own build is showing no signs of life.
I've checked over my code a few times, I can't figure it out.
compare your board files with the other one, particularly the sdkconfig
All I have in the sdkconfig file is the hostname. The other build has lots of lines about SPIRAM, but I don't have any so I didn't define it.
I'll take another look at my files.
try the HUZZAH32 breakout build too, and make sure the serial lines you chose are correct
I'm using an ESP32-PICO-D4, is that compatible with an ESP32 build?
GitHub appears to be up again.
I'll try building something that definitely works on my board and see if the build environment is the issue.
Ah, thanks. I wasn't sure.
Any one know how to fix ESP_RESET in use error?
Yep, looks like it's my build environment. A prebuilt binary that was previously working doesn't work after I build it.
Oh, hang on. I was uploading circuitpython-firmware.bin rather than firmware.bin. Well... now I just feel silly.
My code works perfectly fine.
How can I override the root page and specify my own routes ?
Would like to host my own website / api but port 80 is already bound by CircuitPython's Web API
@kub3let you could try changing CIRCUITPY_WEB_API_PORT in settings.toml to be a value other than 80 (guide page: https://learn.adafruit.com/getting-started-with-web-workflow-using-the-code-editor/device-setup#creating-a-settings-dot-toml-file-3125968)
Or you could use different names for your WIFI credentials inside settings.toml. If the core system can't find the credentials under those names then it won't start the web workflow server I think.
@FoamyGuy thank you, to be clear I want to keep the Workflow Web API in order to use the /code functionality.
I will change the port for now via settings.toml
Is the web interface something you just get out of the board with CP 8.2.0 or do you need to enable something in the board config?
you have to setup the wifi in settings.toml
I was actually talking about how to enable it for a build.
I think it's enabled by default on supported boards
Doesn't seem to be working on my build. Maybe it's something I did wrong. Not sure.
what's the board?
SQFMI Watchy. An ESP32 board. Something I just added.
esp32 definitely has it enabled by default, otherwise it's a pain to interact with it
but setting up the wifi is still a bit of a pain
WiFi connection is working.
from settings.toml?
Yes. It's got an IP address.
then just go visit circuitpython.local from your browser in the same network
That's the problem. It's not working, it just times out. Just trying to see if I need to enable something.
I'll check my sdkconfig
I'm looking on other esp32 boards and they don't seem to have anything enabled explicitly in their files
Hmm, I rebuilt and reuploaded. Seems to work now. Not sure if it's what I changed or the board just needed a hard reset.
ah, yes, after changing the settings.toml, you need a reset
but if you got an ip address...
in any case, the setting is CIRCUITPY_WEB_WORKFLOW, you can add it to the .mk file if you want to be explicit
I did reset several times, but I think that was just a soft reset. Well I don't know. I also changed my mpboardconfig.
CircuitPython version
Adafruit CircuitPython 8.2.0-rc.1 on 2023-06-27; Adafruit Feather ESP32-S2 TFT with ESP32S2
Code/REPL
import time
while True:
print("Hello World!")
time.sleep(1)
Behavior
Using a Web Workflow serial connection, pressing Ctrl-C does not work as expected. It occasionally works, but not most of the time.
Description
I verified that this works as expected in 8.0.0-beta.6, so it broke along the way. I'm pretty ...
@onyx hinge @slender iron My plan is to wait until Wed July 5 for 8.2.0 final, given that Jeff was mostly off today and it would be good to have normal coverage for the stable release.
Makes sense, no reason to release going into a holiday weekend
Add ES3ink board definition.
Add support for more configurations of shift registers to be used, mainly a shift register matrix with GPIO outputs and shift register inputs;
How do you mean this? I have a board where I have 4 HC165 in parallel, sharing the same CLOCK and LATCH, but each on a different DATA. To make this supported I was thinking about adding a function ShiftRegister.addDataPin(data: microcontroller.Pin, keycount: int) that would resize scanarrays and increase the key_count after the initial set-up....
CircuitPython version
CircuitPython 8.2.0 Release Candidate 1
Code/REPL
no code
Behavior
Circuitpython FW DFU flashing fails and is not working
Description
download 8.1.0 and 8.2.0-rc1
plug in usb and double tal reset for DFU
move 8.2.0-rc1, see copy process work until 80% and abort connection with a file copy error (donwloaded and checked the file integrity)
move 8.1.0, see copy finish normally and circuitpython launching
Additiona...
This is actually due to a bug in the UF2 bootloader on the board. Double-click to get to the FTHR840BOOT drive, and check the bootloader version in INFO_UF2.TXT. It is probably 0.2.6 or 0.2.9. Any version below 0.6.1 cannot load UF2's that contain more than 512kB of payload. CircuitPython 8.2.0 is more than 512kB.
To update the bootloader, follow the instructions here:
https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/update-bootloader
The Arduino method is probably ...
I will add a prominent caveat to the release notes about this.
The nRF bootloader update blurb referred to the README in the bootloader repo. There are now guide pages for this that are more comprehensive, so point to them.
tagging a bunch of you for review and notice: just one review is fine
Is it worth providing a note here like the one you'll put in the release notes? I don't know if you have written that language yet but something like
TinyUF2 bootloaders below version 0.6.1 cannot load CircuitPython 8.2.0. Many boards are factory programmed with an older TinyUF2 version. In bootloader mode, check your TinyUF2 version by looking in the file INFO_UF2.TXT and upgrade if necessary.
Is it worth providing a note here like the one you'll put in the release notes?
Good idea. Pushed a revision. It's not literally TinyUF2, it's the original nRF52 bootloader.
ah OK I don't know the difference between TinyUF2 and the others .. I guess some ports were made before the "tinyusb-ification" that made porting easier?
yes, I think maybe the long-run plan is to merge the nRF code into TinyUF2
Adafruit_nRF52_Bootloader does use tinyusb
@tulip sleet you pointed out that the M5StickC-Plus LED outputs are active low, is there a standard way to deal with that so things like PulseIO work properly? I'm pretty new to this.
Can I put my own board specific library in the firmware by default?
Also, in the github release page for the bootloader, there are a LOT of hex files and zip but no advice which file is for which Board, this could use some love too :)
yes, you can freeze it
hi
well it would be a major boost for hi end embedded applications to have it on zephyr rtos
There are other library implementations still using padding. I put issues in for two I know about, may well be more.
We have had very few requests for inverted PulseOut. It hadn't occurred to us someone would wire a transmitter IR LED this way, but there it is, in the M5StickC. So the issue is open to implement it.
Most of the time for simple GPIO-driven LED's, you can just invert the logic in the program.
Any interest in a port for the ESP32-S3 on the new UNO R4 wifi? I'm currently running the devkit port on it and starting to work on a library for the RA4M1's UART bootloader.
I'm looking at the schematic for the Uno R4 WiFi, and see the quite limited connectivity of the ESP32-S3. What would you want to do with CircuitPython in that situation
You could try one of the existing builds for that module.
espressif_esp32s3_devkitm_1_n8
This change adds skip_self_index argument to bitmap.blit() this argument functions similarly to the existing skip_index argument, but instead of checking in the source bitmap it checked inside the self (destination) bitmap and if the index at the current location is this value then it will get skipped instead of overwritten from the source.
This allows bitmap.blit() to be used to provide a pretty significant speed up in this example script which is using a process called "morpholog...
The intent is to do high level stuff in circuitpython on the ESP32 and realtime control/IO stuff in arduino on the RA4M1 because it seems a bit silly to run high level web stuff on the low power MCU.
I think you can start with the build above. You could modify it and remove nearly all the pins if you care 😆
The devkit port is what I am using. I have an almost working bootloader library for the RA4M1
are you interested in the board because it's 5v? Otherwise it's just kind of an engineering challenge/puzzle
Mainly so I can run realtime control and sensor fusion for IMU corrected steering in arduino. The 5v is also handy for Pololu's sumo bot
have you chosen an existing protocol for communication between the two processors, or are you doing something bespoke for your purposes? (I mean higher level than SPI or whatever.)
I need to dig into the SCI pins and see if I can do SPI or just UART over the shared pins and look into existing RPC solutions once I get program loading working
my eventual goal is to write some wrappers that will let me basically just call exposed arduino functions from circuitpython but that's a ways off
one more note: we have been trying to label pins that are (unusually for the application) the opposite of what one would expect. We add the suffix _INVERTED on the pin name. So the M5StickC-Plus LED pins would be LED_INVERTED, etc.
I think the nrf change is buggy. It's a 14 bit value but it always has bits 0 and 1 as 00 because the ADC is 12bit in this mode of operation. I noticed this from some real tests (everyone needs a hobby):
Adafruit CircuitPython 8.1.0 on 2023-05-22; Adafruit CLUE nRF52840 Express with nRF52840
>>> import board, analogio
>>> adc = analogio.AnalogIn(board.P4)
>>> value = adc.value # Measure AA battery
>>> conversion = adc.reference_voltage / (2**16 - 1)
>>> value = adc.value # M...
Put in a pull request for Adafruit_CircuitPython_NTP, it's broken for my timezone at moment.
https://github.com/adafruit/Adafruit_CircuitPython_NTP/pull/30
How long do these usually take to get addressed?
In the PR you write "This bug made it impossible to get the correct local time" but how ? It's just type hints, they don't have any effect in the real code
it's still good to fix the type hints, provided it works, though I suspect it actually needs to be converted to int after converting to seconds or there might be some precision loss later
Oh, huh you're right. Well it must've been something else then? mpy-cross do anything with these hints does it?
Yeah, it's half an hour off when I pass in the timezone. UTC is correct.
I'll take a look at my code...
I think you'll want line 59 to say
self._tz_offset = int(tz_offset * 60 * 60)
Yeah, that seems to fix the inaccuracy.
But hmm, it shouldn't have been that bad???
Circuitpython floats are 30 bits, which makes the math later lose precision
Anyway I guess I need to push the commits to my branch and submit a new pull request? I'm not really an expert in this kind of Git.
as the epoch timestamps are generally larger than what fits a CP float (which is why time.time() is an int for example)
you can push on your branch, it will update the pull request
Uh, done. Did that work?
tz_offset is supposed to be an int? didn't even know there were offsets that required a float.
offsets are usually unix offsets in seconds like minus or plus hours done in seconds.
The parameter is passed to the API as an hour, so it's obviously going to need a float.
it's assumed to be an int in the code
Anyway the docstring below says it's a float.
weird, maybe docstring is incorrect?
the issue is that math later, that becomes wrong because the sum is made a float, losing precision
self._monotonic_start = (
seconds
+ self._tz_offset
- NTP_TO_UNIX_EPOCH
- (destination // 1_000_000_000)
)
ah yes if using monotonic seconds sometimes aren't really truly seconds
I would assume the docstring is correct, the API takes an argument in hours, then converts it into seconds. So you'd need a float for something like UTC+9.5h
I was talking about the NTP module init function.
Ah, sorry.
i've never used ntp library, nvm
CP floats be like that:
>>> 3897377815
3897377815
>>> f"{3897377815.:f}"
'3897376768.000000'
>>> 3897376768 - 3897377815
-1047
Maybe we should just... pass the argument in seconds in the first place?
that would be an API breaking change, I prefer fixing float values
Yeah, true.
PR tested and approved, someone will come and merge and release (maybe not now, it's ID4 weekend for some people)
It just feels kinda dumb that I converted the UTC seconds offset to an hour float with division only for this library to convert it back again, with all that accuracy loss. 😆
Anyway... I suppose I could just do a hack of setting the _tzoffset property directly. 🤔
eh the resulting seconds don't actually lose accuracy
Any advice or merging a new board definition in? Defs are done and nearly done making a custom library for it.
um make sure to run pre-commit I guess ?
Will do, well, thanks for floating a pull request for me.
I love it how whoever made this guide assumed there was absolutely no possiblility your board wouldn't have a status LED, probably several! 😆
@timber mango thank you for the PR! I'm glad you & @jaunty juniper got to the root of the problem.
@midnight ember there are not only half-hour offset zones but also at least one quarter-hour offset zone (Nepal).
<@&356864093652516868> Anti-reminder that there is no CircuitPython discord meeting today, due to the US holiday tomorrow. The meeting will resume next week, on Monday, July 10.
didn't know that, should still be able to do offset in seconds though even with a float.
my only experience with tz offset is with requests library stuff. using seconds for offset is very easy. converting fromfloat to int back to float with ntp module seems unintuitive in comparison?
yeah as long as we don't have millisecond time zones we should be set for now 😉
I'm thinking if a x * 3600 could result in a float ending in 999.99999 dropping the last second in conversion, maybe we should use round() instead of int() but it doesn't seem to be the case anyway
Another option for scientific precision is to use jepler’s udecimal library https://github.com/jepler/Jepler_CircuitPython_udecimal
Cut traces, soldered wires and tested.
Half and quarter hours offsets will be exact in fp arithmetic, happily. Using round () wouldn't have hurt though
CircuitPython version
Adafruit CircuitPython 8.2.0-rc.0 on 2023-06-23; Raspberry Pi Pico W with rp2040
Code/REPL
import time
import wifi
time.sleep(3) # wait for serial
ap_ssid = "PicoWAP"
ap_password = "picow1234"
print("Stopping station mode.")
wifi.radio.stop_station()
print("Starting AP mode.")
wifi.radio.start_ap(ssid=ap_ssid, password=ap_password)
print("Access point created with SSID: {}, password: {}".format(ap_ssid, ap_password))
print...
ROS - the Robot Operating System - is a powerful open source collection of software for the development of advanced robotics. The core appeal of the system is that it can tie many different pieces of robotics software together across a shared network, such as navigation, prediction, machine learning, motor control, etc, without needing a bunch of custom communication software. This is obviously super important for commercial robotics teams, but it's also used by smalle...
Hello!
Is there any work in progress or a working library for the wio terminal wifi chip (rtl8720d) or it will never be supported?
Given that the MicroPython isn’t currently supporting any of the rtl chips (they supported the ameba boards at some point but I don’t see it in the ports anymore), it’s probably not likely unless Realtek adds support themselves. Having worked on Realtek chips, there’s quite a bit behind NDA that could be a hurdle for being support.
is there a comprehensive listing anywhere all modules that are possible to enable/disable with these flags in the .mk file? https://learn.adafruit.com/building-circuitpython/customizing-included-modules Or anywhere that lists the size of those modules to help someone trying to make a build with certain module figure out what is best to cut based on their needs and the size of the modules?
You can pretty much disable everythin. Some just need others to be disabled too.
A dependency chain if you will.
the list of what can be enabled/disabled in mpconfigboard.mk is pretty much the things in py/circuitpy_mpconfig.mk
then there's the .h
I cannot, emotionally, physically or spiritually fix this.
Left is esp32, right is esp32c3. Same files.
C3 just decided to just ignore all .flush and not print out the line. The line only shows up after you start typing.
How does one man bugreport this even. It's not my stuff. it works on all other mcus. But I have no hope of singling it out.
Of course in repl the virtual console works fine. C3 is gonna be the end of me.
Does anyone know whether ESP32-S2 have a limit on open sockets, or maybe CircuitPython limits them? I am working on Server-Sent Events on adafruit_httpserver and maximum number of connected client I can have is two, then the server does not accept connections, like it does not have available sockets.
EDIT 1: To be precise a am saving open sockets to a list. If there are more than two clients, server does not respond, if I disconnect one, responds normally. Considering that one socket is reserved for served the theoretical limit I am facing might be 3 not 2.
EDIT 2: If I create 3 separate servers, none of them respond to requests. 2 servers respond normally. Behaves similar to problem with SSE.
@plucky tulip is web workflow enabled?
yes
that's eating up something, checking to see if I can give a better answer...
I will test how it behaves with web workflow disabled
I used this code to document Pico W socket limits https://github.com/adafruit/circuitpython/issues/7543#issuecomment-1509307970 maybe try on ESP32-S2?
I get stream=8, dgram=8, raw=8 (w/o web workflow)
CONFIG_LWIP_MAX_SOCKETS=8
With web workflow enabled max 3 servers, but web workflow does not work.
Without web workflow same.
2 servers work with and without web workflow.
web workflow and servers use different ports?
yes, web workflow on 80, servers on 5000, 8000, 9000
no matter what 4th connection does not work
I get 7 sockets with web workflow on (stream, dgram, or raw... same)
maybe there is some other limit
listen is one, each accept is (presumably?) one
(https requests use two each)
could run the socket counter after each accept to see how many are left
each server closes socket after sending response, so they do not stack
curiouser and curiouser
keeps alive the listen one though
I wonder whether it is a hardware limit or a software lock, either way, 8 != 3
if something was leaking sockets, I think we'd expect that after several iterations, no connections could be made
the stable 2 connections is... interesting
not even simultaneous
listen(1)?
even three, two servers, and request that comes to one of them
hmmmm:```
CONFIG_LWIP_MAX_ACTIVE_TCP=4
CONFIG_LWIP_MAX_LISTENING_TCP=4
well, at least it is good to know that is is not user error what I am experiencing, the 4 max sockets kind of limit the usage of SSE to only one client (each client needs an open socket), because one is for server and one for incomming requests, maybe the 4th one is used somewhere else or simply this limit is sockets<4
Thank you @crimson ferry for you help! 
It is on my plans to learn ROS. The idea to use an ESP32 with CircuitPython for reading sensors and send to ROS, is great!! Even because if I understand correctly, ROS can be programmed in Python also.
Note that CircuitPython do not support Bluetooth on ESP32. The wireless communications can then be wifi or ESPNow. I am being using ESPNow on CircuitPython and works very well.
Issue from discussion in https://forums.adafruit.com/viewtopic.php?p=977770.
Copied from there:
We have discussed this, starting several years ago. Zephyr at the time had fixed pin assignments, which did not work for us. There has been progress in that direction: https://github.com/zephyrproject-rtos/z ... sues/11918.
Maybe should fix this in 8.2.x.
Blocking in
decoder.read_pulses(pulsein)lead to crash.
What does "crash" mean in this case? What error did you get?
[low-priority] Submitted a minor PR just to get familiar with the contribution process; any suggestions on what would streamline the review for the dev team? (https://github.com/adafruit/Adafruit_CircuitPython_MAX9744/pull/17)
@tulip sleet did you intend to close #8135 vs leaving it open as long-term?
i did not intend to close it, thanks.
@empty stirrup only thing I noticed was that the special keyword to link a pull request to an issue needs to be in the original message, not a reply .. so I put it there. https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
Ah! Thx for the tip.
and thank you for the contribution.
It's a fantastic project - thanks to all of you
Is there a non-blocking stdin read in circuitpython? usb_cdc.console because the goal is to use any console-ish source of input, such as a USB HID keyboard with USB host..
Nope, as far as I know. CPython doesn't have this -- there are OS-dependent tricks to figure this out, because in general you can't tell. So we had no model for this. And sys.stdin.read() doesn't have a timeout arg
OK maybe something will need to be added..
https://stackoverflow.com/questions/3762881/how-do-i-check-if-stdin-has-some-data. Should this stream actually be sys.stdin? Maybe it should be something else that is smart about where it reads from.
@onyx hinge https://github.com/adafruit/circuitpython/issues/8121 (audio underflow) was partially addressed by https://github.com/adafruit/circuitpython/pull/8123 . Did you want to keep it open with a later milestone for a more complete fix?
@tulip sleet I'd like to keep it open at the moment but move it to long term
done
thanks
@tulip sleet select.poll works with sys.stdin, which will read a char from USB CDC 0 or from the USB HID keyboard attached on USB host.
so a nonblocking or timeout read can be created based on poll
Great! I didn’t know select was functional
@onyx hinge @slender iron I could make 8.2.0 final today. There are a few new bugs noted, but nothing I see that is a showstopper. What think you?
@tulip sleet it's fine by me, I don't have anything that I'm working on for 8.2.0.
The more recent commits in this branch have refactored bitmap.blit() function out of the Bitmap class in displayio and over into the bitmaptools module. It now accepts two Bitmap arguments instead of using self as destination bitmap.
I made that move because adding this new functionality inside of the Bitmap class in displayio caused a few of the SAMD21 builds in some languages to go over the size limit.
The devices that had problems already seem to have bitmaptools disabled, so ...
@idle owl do you know if all our circuitpython projects have "adafruit-travis" as the maintainer? seems weird. I was trying to figure out who/what to add as a co-maintainer for a pypi project I need to put under adafruit control
Uff, no. That isn't right. It's adabot.
Wait that's RTD
I accepted the invite.
@idle owl are you able to accept the invitation "[PyPI] jepler has invited you to join the g722-1-mod project" that you probably got in your adafruit e-mail? the link doesn't work for me but I don't think I have access to log into pypi with that account.
thank you!
Automated website update for release 8.2.0 by Blinka.
according to my records, the username on pypi is indeed still adafruit-travis, for historical reasons
Yeah it is.
I was thinking RTD.
I'm going to see if the PyPI folks can help with a username update, but it's a huge manual process, so the only way they could help is if they have some way to bulk add a maintainer to a huge list of projects. Based on the username-change issues on GitHub, I imagine they do not.
Worth asking anyway.
I don't think it's that important, because it isn't tied to github.
It bugs me. 😄
i have the credentials, I assume you do too
Yes.
did we ever look into whether pypi organizations help us? wasn't that announced at pycon2023?
I mean there is probably still a terrible manual procedure to suffer through but
I asked for it or voted for it or something. Yes, we could start to use that
no, autocorrect, I was not searching for information about "pipe organ"
Yes they're in the settings.
I am quite willing to work on transitioning to that, maybe using RTD and github as models. I am willing to do the tiresome click work.
I want to ask about the username thing first, please.
Because the only way to do it is create a new account.
sure, I don't want to step on any toes here
I don't want to get this all set up and have to do it again.
@tulip sleet thanks for making 8.2. It was fine with me. I was busy with daycare stuff.
still on Ari duty while he naps until Becca's parents get back
yw - no surprises since last week
👍
@slender iron not sure how to make key repeat work with USB keyboard .. but I have great progress with a terminal-based editor running under CP https://github.com/jepler/editor
That's awesome!
I found some very minimal editor to build on, github has everything 🙂
I was thinking you'd track the start of the keypress and the last time you emitted one.
Then when you get a "is there something?" or "give me the next char" you'd check the repeat
hmmmm so move the repeat logic into the receive side instead?
ya
instead of that code running on the other core, hm
I'm not immediately in love with that idea, but I will keep it in mind..
I don't think the HID report to serial code is running on core 1
it runs in tuh_task on core 0
oh, I thought the usb host was on core 1...!
core 1 is doing low level host stuff
oh okay
basically that a peripheral would do
every 1 ms send the usb packets and then queue stuff into tinyusb from the "interrupt"
@onyx hinge how do you switch between running your code and editing it?
@slender iron that's not implemented
Thank you Dan! So excited for this new release, it is yet another great step for audio synthesis especially on rp2040.
You'll need your own USB PID. 0x239A is adafruit's VID. espressif gives them out: https://github.com/espressif/usb-pids
Is there any work in progress or a working library for the wio terminal wifi chip (rtl8720d) or it will never be supported?
No one funded by Adafruit is working on it or plans to. I'd suggest asking Seeed about it.
What would you want from CircuitPython that MicroPython on Zephyr doesn't provide?
Since the API is changing, be explicit here too.
//| skip_source_index: int,
Moving it makes total sense to me. Good to do the API breakage in 9.0. I think this is ok to do without a backwards compatibility because it is an advanced API.
One suggestion for the new API.
It's the currently checked in code.
I would like a code.py example that demonstrates failure.
As far as I know, they all should. The clean code is part of the C module and every refresh.
Your 2s setting is interrupting the process.
Have you tested the busy-pin with the updated PSR setting?
No. I have no idea why rotation would effect the refresh time.
And what consequences does "interrupting the process" have?
I don't know what the consequences are b...
WARNING for nRF52 boards only: If your board has an nRF52 UF2 bootloader whose version is before 0.6.1, you will not be able to load CircuitPython 8.2.0 and later. The 8.2.0 firmware is larger than what the older bootloaders can handle. See these instructions (https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/update-bootloader) for updating your bootloader.
Thank you. The latest commit renames skip_index to skip_source_index I re-tested the latest version with a new build on the PyPortal, it works as expected after changing the arg name in the sample code.
I also have an updated version of bitmap_label that checks for and uses this newer API, I'll submit the PR with that over in it's repo.
Out of curiosity, is https://github.com/adafruit/circuitpython/issues/4106 mainly waiting for someone to diff with MicroPython, and test? Or is the idea to wait until the threading API stabilizes more before even thinking about PRs?
I ask because I may look at poking at it once I grab a Pico W and an ESP32-S3 board, supposing the API stability isn't a blocker.
I've also been thinking about going a route similar to what was mentioned in the issue thread and treating the second CPU as a co-processor, rather than first-class CPU and providing a Python API as well as maybe a Rust/C API (I've become rather enamoured with Rust on embedded after seeing how easy it was for a POC on a SAMD21) to assign it async tasks.
kicad to svg https://hacmanchester.github.io/LaserCutter.PCB.Making/KiCad/KiCad-ExportSvg/ @idle owl @slender iron
Duly noted. Thanks.
I don't think we'll ever implement it like micropython. We'll do the coprocessor approach.
while we haven't worked on the python api, we have recently started using the second core internally for picodvi and (soon) usb host
To be honest, that makes the most sense to me for the MCU use cases that come to mind.
it doesn't really help solve the issue of code location and communication between processors
since those two examples use code compiled into the binary
the closest existing APIs for circuitpython is the ULP coprocessor API for ESP and the PIO API on rp2040
Will take a look at those, thanks!
here and the issue are the best places to discuss
(though the issue has some unproductive people involved)
but if you want specifically to make a uf2 with default files, on many ports you can save the flash into a UF2 that will then install everything when flashed on a board
so you prepare the content you want on a live board, save the UF2, and distribute that
the content of the flash won't survive a erase_filesystem, but the UF2 can be reapplied instead
So are you talking about flashing them with a build before distributing or it that something I should include in the board definition?
yeah flash them with a build on manufacturing
Ah, well no probs then.
@slender iron earlier elsewhere I mentioned I was seeing spontaneous resets from the USB Host feather but now I wonder if it wasn't just me bumping the magnetic USB cable. I'll try again with a non-magnetic cable and see if it keeps happening
UnexpectMaker distributes his boards with default files, but he might just have a script that copies them over mass storage, I think his test jigg uses a Raspberry Pi
you can ask him on his discord
other that that you can do picotool save --all my_full_board.uf2 for RP2040
and esptool can get you a dump of the whole flash as a bin
Yeah, I might do that. I was checking out his builds for clues but I don't see anything out of the ordinary so he's probably just putting the files on after the fact.
also kattni has some script that she uses to help flash and prepare boards that she takes to conventions and stuff for workshops
but that's probably not practical for production quantities
(I mean, I just realised that I could put some sneaky bootstrap into the init code in board.c, it's just a matter of whether I should.)
[ apologies if I missed an existing answer] - is there an existing CP library to run ML inference? If not, is there someone currently working on something like this?
not, that I know of. We have run ML models on our boards, but they are not CircuitPython, e.g. TensorFlowLite https://learn.adafruit.com/search?q=machine%2520learning
Ack - thanks for the info!
Please reopen this issue, as I have it on ESP32-S3 DevKitC N8R2, with CP 8.2.0.
I did apply this PR #5858 on CP 8.2.x and it solved my issue!!
Please reopen this issue, as I have it on ESP32-S3 DevKitC N8R2, with CP 8.2.0.
I did apply this PR #5858 on CP 8.2.x and it solved my issue!!
_Originally posted by @casainho in https://github.com/adafruit/circuitpython/issues/5662#issuecomment-1623529340_
@casainho I have created a new issue. And the new problem is that a simple import wifi crashes?
So you're saying the old change from #5858 fixes your new problem? Was the change from #5858 lost? Thanks.
the current content seems to be:
config ESP_PHY_ENABLE_USB
bool "Enable USB when phy init"
depends on USB_OTG_SUPPORTED || IDF_TARGET_ESP32C3
which is different than either side of #5858. It may have been changed by
commit d3d5e36548fdaf7b0d3b7bce7861986ed8080829
Author: Dan Halbert <halbert@adafruit.com>
Date: Tue Aug 2 22:37:06 2022 -0400
update adafruit/esp-idf for ESP32_ECO3_CACHE_LOCK_FIX fix
and/or
commit 96dd11a1986ad990...
96dd11a1986ad99029a1668cc6b88c322e2947be seems to have caused ESP_PHY_ENABLE_USB to start being defined when building for BOARD=espressif_esp32c3_devkitm_1_n4
The current submodule choice for ESP-IDF is
https://github.com/adafruit/circuitpython/blob/fad86bfb27607ca362c124bcc8ecef671d3fd40f/.gitmodules#L143-L146, which is different from the older choices above (our fork, new branch)
According to https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/api-reference/kconfig.html#config-esp-phy-enable-usb, it is correct to have CONFIG_ESP_PHY_ENABLE_USB=y for ESP32-C3. When I build the board with the tip of main, that value is set in sdkconfig.
@casainho Getting back to the original problem with ESP32-S3 DevKitC N8R2:
I loaded the 8.2.0 .bin from https://circuitpython.org/board/espressif_esp32s3_devkitc_1_n8r2/
I am unable to cause a crash by a simple import wifi:
Adafruit CircuitPython 8.2.0 on 2023-07-05; ESP32-S3-DevKitC-1-N8R2 with ESP32S3
>>>
>>>
>>> import wifi
>>>
@onyx hinge I'm at my desk now if you want to sync up on usb host stuff
@slender iron sure. I went down a non-circuitpython rabbit hole this afternoon but I can wrap that up in 10 and then get on video with you.
👍
@slender iron thanks for your patience, i'm at my desk now
@onyx hinge @slender iron I have a question about the swirly grids. Product copy says "you can pretty much make anything on a 0.1 grid fit". The separate usage of "grid" there is confusing me a bit, and will ultimately confuse others. What is that sentence trying to say? Can you please assist with wording it better?
@idle owl I'll try
Thank you
You know about placing things "on the grid" in fritzing, right?
"on a 0.1 grid" means "if everything was placed on that kind of grid, like in an art or drafting program"
but I do not know a good way to explain that to humans who don't draw the connection
Most boards with hole spacing that is a multiple of 0.1 inch will fit on the swirly grid
This includes Feathers, FeatherWings, and most Stemma QT boards
an examples of things that are NOT on an 0.1" grid would be arduino/metro
an example NOT on a 0.1" grid, because the horizontal distance is 1.15in ..
Ooooh
Thank you!
@stuck elbow see these fonts? https://idleberg.github.io/playdate-arcade-fonts
@dhalbert , it hangs here:
But with the modified CP as I told:
The code with the issue is here: https://github.com/OpenSourceEBike/EBike_EScooter_modular_DIY/tree/issue_wifi/diy_main_board/firmware
And here the CP binary where the issue do not happen: https://github.com/OpenSourceEBike/EBike_EScooter_modular_DIY/blob/issue_wifi/diy_main_board/firmware/circuitpython_binary/adafruit-circuitpython-espressif_esp32s3_devkitc_1_n8r2-en_US-8.2.x-built_issue_import_wifi.bin
Other interesting thing, is that even with original binary CP 8.2.0, the board appears as N32R8, but is is a N8R2.
Added support for multiple data pins which share the same latch and clock, e.g.
k = keypad.ShiftRegisterKeys(
clock=board.GP3,
data=[ board.GP10, board.GP0 ],
latch=board.GP2,
key_count=[ 32, 16 ],
value_when_pressed=False,
)
Backwards compatible, data can also be a single pin instead of a list. The key_count numbers are consequetive, e.g. in the example the first key of GP0 will have number 32.
of course devkitC3 has an S3 on it. 🤯 sorry for confusing that issue further.
I'm sorry for creating confusion by referring to a board with esp32-c3 when this is about a board with an s3 microcontroller (that just happens to have a c in product name too)
I think this might be to do with the byte compiler - code is dynamically compiled as the script runs so I wonder if the "code for a range" or "code for a for function" is taking up that memory
If you put all the code above in a function, then the memory usage stays static:
from gc import mem_free, collect
from sys import stdout
def primem():
collect()
a = mem_free()
stdout.write(str(a))
del a # a is used to not account for the str() in ram
stdout.write(...
@onyx hinge @slender iron Another swirly grid question. Do either of you have any tips or tricks about them yet? A page of them is to be included in the guide, and I am wondering if there's anything to include, or simply make it a placeholder for now.
I figured out that, if done carefully, you can push the STEMMA QT cable connectors through the slots. Means it's easier to mount things on both sides, or create a cleaner look on the top. I'll add that at least.
I .. haven't actually used the swirly grid yet for a "real project"
but that sounds like a good idea
@casainho I have both the N32R8 board and the N8R2 board. If you look on the tin case of the module in the lower left, there is a stamping that includes either N32R8 or N8R2. Could you look at the the one that you have and see what it says. Also the N8R2 says ESP32-S3-WROOM-1 on the N8R2 board, and ESP32-S3-WROOM-2 on the N32R8 board.
I am not sure which line is causing the issue from the screen shots. Could you give me a source link to the line in the repo? Click on the line number to get...
chatgpt makes my jaw drop when it works like I expect: https://chat.openai.com/share/f27a3302-1a9b-41e3-824b-0e6eb8addb9e
welp, almost. Netherlands/Dutch doesn't seem to have been caught properly
but pretty impressive regardless
one small hiccup that's easy to remedy
I think it's fixed after the second prompt
np 🙂
Created #8143, which allows the data and key_count arguments to be a either a single pin as currently, but also a list as well.
@casainho I have both the N32R8 board and the N8R2 board. If you look on the tin case of the module in the lower left, there is a stamping that includes either N32R8 or N8R2. Mine identify properly in
lsusb. Could you look at the the one that you have and see what it says? Also the N8R2 says ESP32-S3-WROOM-1, and ESP32-S3-WROOM-2 on the N32R8 board.
lsusb says "303a:7003 Espressif ESP32-S3-DevKitC-1-N8R2", so I guess that plugin for Visual Code Studio is showing the wrong data.
Pict...
seem a bit small for playdate's resolution
Sorry, I forget to change it after I copied files to make definition for my board. It should be OK now. Thanks
This is a difference we inherited from MicroPython. See https://docs.micropython.org/en/latest/genrst/core_language.html#local-variables-aren-t-included-in-locals-result. This difference saves time and space.
That photo does not look at all like https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html or the photos here: https://www.adafruit.com/product/5310. The buttons are in a completely different place. Could you give a link to the board that you purchased?
This is the board, I bought on Aliexpress:
@casainho Are you using a settings.toml file. If so, what is in it (fine to redact SSID and password)?
@casainho Are you using a
settings.tomlfile. If so, what is in it (fine to redact SSID and password)?
My settings.toml is empty, 0 bytes file.
@slender iron was it only in a dream that you coded an in-place base64 decoder, that re-used the input area as the output?
I did! in the web workflow file
oh for password?
doh, my greps weren't finding things because I was bisecting a problem and was in some early 2022 commit
_base64_in_place(_api_password, strlen(_api_password), sizeof(_api_password) - 1);
@tulip sleet this might be the issue the person is having on the odroid go
(zero byte settings.toml)
@slender iron uff .. what's happening with zero-byte settings.toml?
the person in #8141 is having issues
and I suspect that might be the issue with odroid go too
may be worth testing it with an empty file
was there a particular clue that leads you to this line of thought?
shared/filesystem.c: make_empty_file(&vfs_fat->fatfs, "/settings.toml"); many devices have empty ones
ah, I didn't realize we made it
I was bringing it up based on the last comment of the issue
I don't think I've tested an empty one myself
From e8c7b4a9f4d448dd5ecee5ba9ea7c46161e7c2e9 Mon Sep 17 00:00:00 2001
From: Jeff Epler <jepler@gmail.com>
Date: Fri, 7 Jul 2023 11:28:42 -0500
Subject: [PATCH] test a zero-byte environment file
---
tests/circuitpython/getenv.py | 2 ++
tests/circuitpython/getenv.py.exp | 1 +
2 files changed, 3 insertions(+)
diff --git a/tests/circuitpython/getenv.py b/tests/circuitpython/getenv.py
index 68dd328cfb..f01189a551 100644
--- a/tests/circuitpython/getenv.py
+++ b/tests/circuitpython/getenv.py
@@ -72,6 +72,8 @@ def run_test(key, content):
print(key, str(e))
+run_test("key", b"")
+
for i in range(13):
run_test(f"key{i}", content_good)
diff --git a/tests/circuitpython/getenv.py.exp b/tests/circuitpython/getenv.py.exp
index ba1b1b3f90..925dafb469 100644
--- a/tests/circuitpython/getenv.py.exp
+++ b/tests/circuitpython/getenv.py.exp
@@ -1,3 +1,4 @@
+key None
key0 'hello world'
key1 7
key2 '\n'
--
2.39.2
```I just wrote a test for an empty settings.toml and it didn't immediately turn up a problem
👍
urgh I have to stop worrying about making this the ultimate keyboard mapping and just consider that I can probably write something good enough... (like support for dead-keys and shift-altgr ... altgr support is needed for e.g., {} on french keebs though)
@tannewt wondered if this could be a cause of instability. Many boards in the wild are probably running with an empty settings.toml, since formatting the CIRCUITPY drive creates one
shared/filesystem.c: make_empty_file(&vfs_fat->fatfs, "/settings.toml");
but it also wouldn't hurt to add a test for it in the core tests.
This also adds an expected-result file for the test basics/string_format_error, because the behavior of the test under python 3.11.2 (debian bookworm) dif...
hmm, did you try adding an empty settings.toml to your Odroid Go and retesting?
no, I didn't
FYI, I was able to build 8.2.0 proper for my M5Stack Stick C Plus this week and test it out. Would you like me to start building out a board page for it in circuitpython-org?
sure, thanks, that saves makermelissa time, and you have the board on hand. There is a guide: https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website
Bitbanged here: https://github.com/adafruit/Adafruit_CircuitPython_Debug_Probe
Higher level flashing protocols (like Adafruit_DAP) are here: https://github.com/adafruit/Adafruit_CircuitPython_MCU_Flasher
CircuitPython version
Adafruit CircuitPython 8.1.0 on 2023-05-22; Adafruit Feather ESP32-S3 TFT with ESP32S3
Code/REPL
import board
import audiocore
import audiobusio
import digitalio
import busio
import storage
import adafruit_sdcard
import os
import sys
import time
print("start")
spi = board.SPI()
cs = digitalio.DigitalInOut(board.RX)
print("connect")
sdcard = adafruit_sdcard.SDCard(spi, cs)
print("VfsFat")
vfs = storage.VfsFat(s...
I tested on an adafruit-esp32-s3-tft-feather using the code above, with CircuitPython 8.1.0.
After running, I waited for over 10 minutes, but nothing happened.
I enter characters and it is able to return.
I enter a blank line and it exits.
I have a S3 Box Lite.
UF2: tinyuf2-espressif_esp32s3_box-0.15.0
CircuitPython 8.1.0 on an S3 Box Lite , nothing happened after 5 minutes.
Adafruit CircuitPython 8.1.0 on 2023-05-22; ESP32-S3-Box-Lite with ESP32S3
CircuitPython 8.2.0 on an S3 Box Lite , nothing happened after 5 minutes.
I wonder if this has any relation to #8041
On adafruit_feather_esp32s3_tft, or on S3 Box Lite, I've tested, but none of the problems described in that article occur.
However, the cause of the problem may be really similar.
In addition, my problem will also appear on 8.2.0.
Adafruit CircuitPython 8.2.0 on 2023-07-05; Adafruit Feather ESP32-S3 TFT with ESP32S3.
Getting there. I’m a branch now and hopefully prd next week
Hi, is it possible that the toml parsing and os.getenv does not work on Trinket M0?
At least that is what my test comparing behavior on M0 and RP2040 reveal.
It would make a lot of sense if there is no space left for that on M0, but how am I supposed to know if it is available or not? Both seems to implement "os".
@thorny jay yes, it's not supported there. no, the docs don't reflect it well.
if "well" means "at all"
due to technical limitations we don't have a way to put individual functions in the support matrix
Hopefully I have a good memory and this place exist.
I guess I am going to use the "secret" method importing a file, and protecting the import by a try.
Goal is to externalize the parameter, so that the code behaviour can be modified without touching code.py.
I decided to go M0 because I had a few trinked M0 in stock.
I had to use your TICKS function to have accurate timing and work around the absence of asyncio.
( https://docs.circuitpython.org/en/latest/shared-bindings/supervisor/index.html )
It has been a bit challenging, but I am getting close to my goal.
whee now you can type on a french-layout keyboard (among hopefully many others) with a USB keyboard & CircuitPython in USB host mode! but it depends on Scott's ongoing not yet merged work too .. https://github.com/tannewt/circuitpython/pull/19
CircuitPython version
8.2.0
Code/REPL
# weather station for disabling automatic sprinklers
# https://learn.adafruit.com/weather-wise-wifi-umbrella-stand/code-install-walkthrough
import os
import ssl
import microcontroller
import board
import wifi
import socketpool
import adafruit_requests
if __name__ == '__main__':
def connect_to_network():
# connect to SSID
wifi.radio.enabled = True
wifi.radio.connect(os.getenv('...
