#circuitpython-dev
1 messages Β· Page 47 of 1
<@&356864093652516868> We'll have our weekly meeting in less than two hours from now (2pm US ET) in this text channel and in the circuitpython voice channel. Add your notes in advance to the document: https://docs.google.com/document/d/1J0mv2qVnfBwjg4DZj47JYn-WPQI68thUqp8ZYfr14fs/edit
the fact that there aren't RUN_BACKGROUND_TASKS calls in most port i2c writes makes me think that long, non-preemptible i2c transactions haven't been perceived as a problem before now. but it's true that taking away locking would complicate making them pre-emptible (by background tasks) later.
new commits from adabot
Thanks! I thought the cron jobs were initiated from that repo, so this was not an urgent update, but maybe not.
just another comment in support of having it work on pico w. Got excited that circuit python had nice ble support but then realised it didn't work on pico w after installing :[
You can't do slow, fast, slow on i2c because everything on the bus needs to read the address. I think the locks were mainly for future-proofing against concurrency.
Better to have code written with it then not.
CircuitPython version
Adafruit CircuitPython 9.0.0-alpha.1-40-g17ced21e04 on 2023-09-14; M5Stack Timer Camera X with ESP32
Code/REPL
# mount a vfs under /something
import os
os.listdir()
os.listdir("./")
Behavior
>>> listdir()
['ramdisk', 'LjinuxRoot', 'code.py', 'lib', 'boot_out.txt', 'ftp_serv.py', 'boot.py', 'repl.py', 'settings.toml']
>>> listdir("./")
['LjinuxRoot', 'code.py', 'lib', 'boot_out.txt', 'ftp_serv.py', 'boot.py', 'repl...
At this point I think I am cursed to find every tiny issue there is.
I feel this. π
Does it work the second time you run the code? I'm not sure the workflow code runs while user code is running.
What keyboard model is it?
Why should this be in the core instead of a library?
Someone was having an issue with taking a screenshot with a monochrome display due to bitmap colorspace. There doesn't seem to be support for monochrome displays?
They were using a 128x128 Monochrome display I do not have one to test with.
[he...
@slender iron You have a lot of background noise coming through intermittently.
will turn the fan off once the meeting starts
i also have some tree trimming going on π¦
It happens. π
I've got a lot of intermittent background noise. I'm hoping it'll be gone by the time I give my status update, but I might be text only if it's still there.
You can always try anyway, and we can tell you if it's bad. Sometimes things don't come through.
Text only is also completely ok!
Discord has some really excellent noise cancelling algorithms -- it stops most coughs, sneezes, jets, trains, and trucks rolling down the road for me.
I believe I ran into a similar issue with SD card mounts.
yes
loud and clear
[more than once I've been caught talking to myself with a muted setting....]
Writing libraries to support our favorite microcontrollers is a big task, but what if ChatGPT could lend a hand? Adafruit's own Limor "Ladyada" Fried has tasked ChatGPT to write Arduino drivers in her own style, creating a "mini-Limor" bot to handle the task.
We sat down with Fried to talk about how AI can help Adafruit and the wider communit...
I've only tested 8.2.6 with the github stars test on an ESP32-S3 and works np.
π
@turbid radish always has the coolest stuff in the newsletter π
Aww, thanks - you all make (or find) the best content - be sure to send anything you see to cpnews@adafruit.com
For the same reason that a MIDI note value to frequency conversion method is included in the core. SPN is a fairly common notation that has more intrinsic value to musicians than note values. No need to memorize MIDI notes or have frequency tables at-hand.
My typical approach is to use a library method for both so I'm not personally hung up on it being in the core. Having it in a library also makes it easy to change the tuning from A=440 to A=432 ("nature" tuning) or A=441 (harmonica tunin...
When the os.listdir('..') is run from a mounted directory (SD card anyway) the mounted folder is listed rather than the root folder. I.E. the ".." directory shortcut can't parse up thorough a mount point.
FWIW I'd say that midi note numbering is supported just as a sort of historical accident: the original synthio was a midi player and couldn't play notes with arbitrary frequency in Hz.
Another reason to use something outside of the core for conversion from musical notation to frequency is to support different kinds of Musical Temperament, rather than the equal temperament that is the one that you get with MIDI note numbers. we wouldn't w...
Kattni 
π Thank you!
Kattni's moving on? π¦ We will miss you, good luck with your future endeavors!
Good point and interesting historical reference. The SPN conversion method and frequency to MIDI note value methods are already in the Community Bundle, BTW.
[cgrover writes some of the most detailed hug reports I've ever read]
[kattni's upcoming one notwithstanding]
Based on #6913 by @microdev1. Thank you so much!
π
code + community = CircuitPython
β€οΈ
Aww, yes thank you Kattni!
π thanks for seeing me good with words π
@idle owl Thank you so much for all of your work stewarding this community forward over the years. Youβve hand a huge hand in helping this community grow into the welcoming center is is, and the code of conduct you shaped is something I get a special sense of awe inβguiding a community is not small or easy feat, and that is something truly special
You're awesome Kattni, and thank you for all you've done to make our jobs easier.
Thank you @idle owl π«‘
What life? Why exist? How live? Why do I mean? If you find yourself asking asking these big questions, youβre probably a robot. No offense, ChatGPT. A real human would be asking much more important questions of themselves:
How the heck do I run KiCad on Android? Because thereβs nothing more important in life than running an open-source EDA suite...
woot woot, love seeing your e-fidget spinners 2231puppy
Who's gonna be the one to make the first borb on android?
"they have played us for fools. LEDs should be easy to hook up". the meme writes itself.
I'd love to be that person, but it's a royal pain in the rear to use it. It's essentially a full Linux environment and KiCad on top of it. It's slooooow, and the window scaling is all kinds of wrong. I'll see what I can do, though!
run the patch! no concerns from this quarter.
ah, thanks!
still espcamera seems to fail to clone..
I wonder why..
I did clean my submodules
fatal: transport 'file' not allowed
fatal: Fetched in submodule path 'esp-camera', but it did not contain 75035312ed9427557acfee1cd32af2b8e1f13f72. Direct fetching of that commit failed.
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
fatal: transport 'file' not allowed
fatal: Fetched in submodule path 'esp-camera', but it did not contain 75035312ed9427557acfee1cd32af2b8e1f13f72. Direct fetching of that commit failed.
ERROR: fetch-submodules.sh FAILED
every day a new submodules fail
I found a git bug that causes it for me
ποΈ have a good time on your vacation!
git uses the wrong remote name
I'm on arch latest.. what..
it uses the remote name of the outer repo for the inner submodule
I'm on arch latest too
submodules use origin but the outer one may not
(mine usually don't)
so you can change .git/config to set remote to origin while you update
better code completion like PyCharm has would be a very very welcome thing for Mu.
I have a better idea
I will just merge it into a branch on mine.
This should be the simpliest.
(under [branch "<foo>"])
some folks prefer not to have editor and serial in the same app (like me), so free to use any editor / IDE, and any serial program
I'll see if there's something I can make
pycharm with windows doesn't work well with terminal, same with vscode. mu "just works"
I wouldn't generalize my preferences to anyone else π vi & terminals for everyone π
I am amazed nobody went "bloooat" when vscode was mentioned.
As an Arch user, I agree, but I also use it because it's the best option for me. Electron tho π€’
Everyone has their reasons for using different editors. None of them are bad or wrong. You should always use the tool that's right for you. π
we still need i2c locking because there are i2c-based displays that are being used in the background
s(2/3)tft
Good point! I guess my concern is that there isn't a CircuitPython editor that's right for me. Mu is too basic for me, VSCode support is buggy, PyCharm is a big honkin' editor, etc.
there are also some people wanting to add an i2c-based keypad support
What features are you looking for in an editor?
Essentially Mu with better autocomplete and a built-in file manager
Maybe it's a feature that can be enabled or disabled?
same, I'm of the same opinion as Micha. Mu is too basic but it works wonderfully with Circuit Python in a way that PyCharm or VSCode doesn't... at least in Windows. If I was using Linux then PyCharm would be my go to. PyCharm has issues in Windows.
"big python" relies on the operating system doing the locking when they open a device file
If Mu had the helper functions like PyCharm or VSCode stubs has that would make me very happy. That's honestly really all I'm looking for with the IDE. The way Mu works is excellent but it doesn't have helper functions.
you can't treat the expander pins the same as normal gpio pins in keypad interrupt anyways
it takes too long to interact with them, and you can't do this in an interrupt
this is in fact a reason for having locking
I think that from the point of view of usability and transparency, treating pins on expanders as regular GPIO pins is a huge can of worms that will lead to people trying all sort of crazy things and being confused why they don't work or why they are so slow
a true in the weeds section π
thank you all for sitting through that π
did someone say bug hunt? Hacktoberfest is getting close. π
oof it is! I hadn't heard any reminders about it
@lone axle are you someone who knows about making sure our bugs are tagged for hacktoberfest?
also the HTTPServer is a big lib even now
I'm pretty sure GitHub supports that. https://github.com/dracula is an example
i would love to see a learn guide revised for the new iteration of HTTPServer and the template engine. HTTPServer was honestly like the 2nd thing I tried to use the first time I ever used Circuit Python. As a front end dev it's extremely appealing to go straight to.
I can help with that
at that time it was just an f-string, the entire HTTPServer was just one string, so I started doing other electronicy things.
Thank you π
it could go in the circuitpython org on github
Thanks everyone!
Bye all!
but adafruit is best if we have learn guides that use it
lots of discussions today, today was a special day. @idle owl Wish you well, hope you stick around as much as possible.
Thank you!
Thanks for hosting Dan. Have a great week everyone!
Thank you for hosting @tulip sleet what a meeting!
bb thanks for the cool meeting everyone!
thanks everybody! Thanks again to Kattni!
Thanks all, thanks again and good luck on the next chapter @idle owl, Looking forward to seeing it!
Please add me to circuitpythonistas. Thanks!
Thank you so much!
Done!
Oh, come on, Devon...... I didn't need to know we're only that far away from October! π
7 days isn't much time... better get on it. ποΈ just a friendly reminder. π
It boots ljinux just fine.
So pretty much the whole core works.
I will throughtly test everything.
First thing I found:
>>> wifi.radio.connect("Rock4CPlus", "REDACTED")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ConnectionError: No network with that ssid
the lead up to Hacktoberfest last year I think started in like August, it was in the blog regularly. this year it's like oh it's next week.
I honestly forgot about it too until someone said the magic words "bug hunt" in the meeting.
I might not reach my goal, since I'll be on the road for most of the month. oh well! more rewards for someone else.
I'll try to remember to bring it up next week during the meeting, and I'll do some brainstorming on it as well. I'm curious if anyone else has thoughts or ideas for things that we could direct people towards for hacktoberfest this year? On the library side our number of existing 'good first issues' is much lower this year with many of the typing ones being completed and some additional cleanup recently.
In the past we've added the label for all issues whether they are 'good first' or not which we can do again, but I think it'd be great if we can dream up a few things that we could direct people to work on if they come looking to help but don't know know specifically what they want to work on.
Part of last year I think was a live event that kattni and jepler were at... PyCon? They were knocking out a lot of the typing good first issues. I take it there will not be a similar event this year?
I think that was a different time of year, but we did have a big influx of folks from it as well.
We did have some online sprints in discord which were a lot of fun.
PyCon is April/May.
so i was close...
https://us.pycon.org/2022/ this page shows the dates as spring, april / may. I think we had a seperate "batch" of contributions during hacktoberfest last year.
Yep! It was a separate thing.
my memory is horrible, this is why i have a computer
Someone could host some "sprints" if they're up for it. But that's only if someone has cycles, and folks think it's a good time,
(unrelated) When someone with authorization over adabot has a sec can you merge https://github.com/adafruit/adabot/pull/353. Once that is in I can run it on the libraries.
Well if I can get past the 500 errors.....
Ok merged.
Thank you!
Slim pickings right now https://circuitpython.org/contributing/open-issues?label=hacktoberfest
This is a request for the keypad.EventQueue class to offer an asyncio-friendly awaitable alternative to the polling-based .get() method.
This would allow asyncio-based programs to follow a true event-driven programming pattern, and steer away from polling-based logic (which does not encourage good programming habits).
Such an alternative, possibly called keypad.EventQueue.aget(self, timeout=None), would:
- block its calling task until/unless a key event happens
- have an inte...
We discussed this in the weeds today. This is a good interim solution until we decide how to use abstract DigitalInOut-like objects with native bitbangio for native IOExpander support.
A couple of weeks back a seed was planted "in the weeds" about having simpletest scripts for boards checked into the core repo inside the board directory. That might be a good opportunity to get hacktoberfest participants involved in. Maybe we can get one or two of these in before october to iron out any technical details and then we could encourage people to make them for whichever devices they have access to.
Thanks for doing this! One note - looks like xiao is mispelled in the path (xaio)
For the RTD fix patch, I'll need to do some troubleshooting. The --dry-run completed mostly successfully. But when I tried to run it for real it seems every library reported this:
>> Repo: Adafruit_CircuitPython_74HC595 Patch: 11SEP2023_fix_rtd_theme.patch
Error: b'Patch format detection failed.\n'
this might be because of difference between am and apply it looks like there is --use-apply flag for handling that.
Yep, that was it. It appears to be working now
π
Thanks for doing this! One note - looks like
xiaois mispelled in the path (xaio)
Thanks for noticing, I'll fix it all up once we have a PID.
a handful of them reported this error:
>> Repo: Adafruit_CircuitPython_ImageLoad Patch: 11SEP2023_fix_rtd_theme.patch
Error: b"remote: error: GH006: Protected branch update failed for refs/heads/main. \nremote: error: Changes must be made through a pull request. \nTo https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad.git\n ! [remote rejected] main -> main (protected branch hook declined)\nerror: failed to push some refs to 'https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad.git'\n"
Perhaps there are additional protections at the branch or repo level in some cases. I'll make PRs for these ones.
The vast majority seem to have commit successfully. I'll check in on the actions run, and docs build after it's had some time to work.
CircuitPython version
CircuitPython 8.2.6
Code/REPL
circuitpython/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk
USB_VID = 0x239A
USB_PID = 0x8048
USB_PRODUCT = "Monster M4SK"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ"
LONGINT_IMPL = MPZ
CIRCUITPY_SYNTHIO = 0
Behavior
The Circuit Python .UF2 file downloa...
It is true that it should be a SAMD51G19A, and we should fix that. but I downloaded CircuitPython 8.2.6 successfully and it came up. When you say "not working", what did not work?
Both boards refuse to show up on android, even after I fsck them.
This may be because the FAT16 CIRCUITPY presented by the larger flash chip still only has one FAT (File Allocation Table). Most FAT16 filesystems have two.
A FAT16 USB flash drive is working with a Pixel 2 with Android 10.
-
Fixes #8413.
-
MONSTER M4SK had its CPU as SAMD51J19, instead of SAMD51G19. Note that the silk on the board incorrectly says "J".
-
CPU was wrong for CP32-M4 board.
-
A primary difference between '51G and '51J is the that J doesn't have I2S. So automatically turn off
audiobusioon '51G boards. This means the explicitCIRCUITPY_AUDIOBUSIO = 0inmpconfigboard.mkon those boards is no longer necessary. (I left that setting explicit in some boards that are turning off a large number...
Wrong CPU fixed by #8414 and should be in the next 8.2.x CircuitPython release.
@danh Can you point me to documentation for usb_hid in Blinka?
What would it take to use the UART on the ATtiny817 seesaw-breakout?
@tulip sleet I'm around until lunchtime but not available in the afternoon. give me a ping when you want to work on pair merging.
I am all set now, whenever you are available.
@tulip sleet give me 5, then I'll join you
Hi,
I am attempting to implement half duplex uart for a feature on the upcoming Pimoroni Yukon board, and am in need of doing sub millisecond time delays. Micropython has sleep_us on their RP2040 build but CircuitPython does not, and although the regular sleep function accepts any floating point value, it is quantised to milliseconds.
Here is my analyser output from running time.sleep() with any microsecond value:

STATIC mp_obj_t time_sleep(mp_obj_t seconds_o) {
mp_float_t seconds = mp_obj_get_float(seconds_o);
if (seconds < 0) {
mp_raise_ValueError(translate("sleep length must be non-negative"));
}
if (seconds < MICROPY_FLOAT_CONST(.001)) {
mp_float_t usecs = MICROPY_FLOAT_CONST(1e-6) * seconds + MICROPY_FLOAT_CONST(0.5);
common_hal_time_delay_us(us...
use it for what?
It could also use the microsecond sleep for that part of the requested sleep that was less than 1 msec, and use the millisecond sleep for the other part. The microsecond sleep is a busy-wait loop. It doesn't turn off interrupts, so any delay might be longer than requested due to intervening interrupt handling. There are routines to turn interrupts off and on.
I don't think this bug is specific to rp2, the implementation of time_sleep that always calls into delay_ms is in shared-bindings.
Thanks @deshipu! I was completely unaware of that function existing, so that explains my confusion about it being seemingly absent.
@jepler That would be nice, though for my needs I wouldn't want to push for a potentially breaking change like that.
I'm ok with time.sleep() not being super precise because python code execution isn't really either. A GC or background task can take non-trivial time at nearly any point. Python code really shouldn't assume precise timing.
Fixed in 8.2.x by #8414; will be merged into main at the next 8.2.x -> main merge.
CircuitPython version
Adafruit CircuitPython 8.2.6 on 2023-09-12; TinyS3 with ESP32S3
Code/REPL
import digitalio
import time
import board
time.sleep(5) # give us some time to update code via USB when we are stuck in a crash loop.
tmp = digitalio.DigitalInOut(board.D34)
tmp.direction = digitalio.Direction.OUTPUT
Behavior
Board crashes and hard resets
Description
When I try to set D34 pin as output using the digitalio module the board ...
I'm anxious about soldering the headers on my Feather TFT ESP32-S, so I thought I would connect the seesaw breakout and use it to connect to a third board. A bit crazy I guess. Anyway, looking at adafruit_seesaw/seesaw.py there is a function uart_set_baud() but nothing for uart_read() or uart_write().
ah, so you could have solder-free UART?
right
what are you connecting the UART to?
A three-node cluster of raspberry pi picos.
soldering is a good skill but definitely daunting before you get used to it
Not much room for error when the TFT is right next to the header poins.
Maybe I should use the raspberry pi zero instead.
you can put kapton tape to protect the screen
np
Is there a way to read a sub-millisecond time now? In this sort of context, trying to do precise timing with sleep is going to accumulate the delays, and waiting for a specific time tends to be more useful.
I remember monotonic_ns having millisecond precision on RP2040 ages ago.
read no, wait yes
we generally track 1/1024 of a second internally because the RTC does
you really shouldn't assume a bunch of precision as python code runs
that's what native apis are for
This may be because the FAT16 CIRCUITPY presented by the larger flash chip still only has one FAT (File Allocation Table). Most FAT16 filesystems have two.
Well, Android is very picky. It would stand to reason it expects it.
lib/oofatfs/ff.c:5424 -> const UINT n_fats = 1; /* Number of FATs for FAT/FAT32 volume (1 or 2) */
It's an optional feature for fat16, and an unsupported feature of fat12 as far as googling gets me.
Just changing this, neither board is read by and...
@onyx hinge I updated all the type definitions I could find with new style and pushed that. Haven't tried to compile anything yet, that will be tomw.
Good luck reviewing the review.
2mb @ 80m? I would request this is rechecked.
Note to self: Retest different psram chips for speed errors.
This is how OCT is supposed to be defined. This is correct.
On boards with undefined psram size, where it's left on auto what would happen?
chip_id reports 40MHz on the ESP32-S3-DevKitC-1-N8R2
@onyx hinge Just a ping regarding:
https://github.com/adafruit/circuitpython/pull/7718
Circuit Python is Adafruitβs fork of Micro Python. Micro Python does in fact allow concurrent execution of both cores.
Cicuit Pythonβs goal is ease of use and providing library functions for all of adafruitβs hardware. But if your goal is performance, Micro Path is dramatically faster and not just because it can use multiple cores.
That said, many projects donβt need βperformanceβ and ease of use is more important.
I think (?) removing the GIL is on CPytonβs roadmap. But Python,...
The crystal is always 40Mhz, as far as I know.
Testing with a binary is the best way.
You load it up and do:
import espidf
espidf.get_total_psram()
So long as this doesn't hang, and returns the size, the parameters are <= of the correct parameters.
Micro[Python] is dramatically faster and not just because it can use multiple cores
I would not take this as fact. We use essentially the same core interpreter. Some recent benchmarking we did show them roughly comparable. Our library code uses properties a lot more than MicroPython libraries do, which slows things up a bit.
This is not the issue to discuss performance. If you have some benchmarks that show dramatically different performance, we'd be interested in those, and please op...
1.20 merge
No need for benchmarks just try this in Circuit Pythonand see if it works
@micropython.native or,
@micropython.viper or,
try to use two cores at the same time
Yes they are roughly comparable in performance only as long as you do not use the features present only n Micro Python
As said, each has a different target audience
On Sep 20, 2023, at 7:30 AM, Dan Halbert @.***> wrote:
Micro[Python] is dramatically faster and not just because it can use multiple cor...
While it is true that the MP port of RP2 doesn't implement the GIL, I wouldn't be so quick to see this as an advantage. Except for the use case where the spawned thread (the port supports just one of them) can guarantee that it isn't going to touch anything directly or indirectly that will cause both processors to enter multiprocessor unsafe code in core, bad things will happen. Look at the MP ESP32 implementation for a safer and more complete implementation of threads. Yes, it uses the GIL.
should we just close and lock 4106? The original request was for python on the second core and I don't think we'll do that anytime soon
@slender iron I have a quick question for you. In the code at https://github.com/adafruit/circuitpython/blob/main/shared-module/displayio/ColorConverter.c#L206 what is the purpose of running __builtin_bswap16 on a 32-bit unsigned int?
Or rather, what is the effect?
it swaps the bytes
I mean how would using __builtin_bswap32 be different?
Oh, hmm. Ok
AB -> BA instead of ABCD -> DCBA
So ABCD -> ABDC?
yup
Thank you
Not so fast, I'm working on a _thread implementation that I'm planning to spring on the community as a WIP.
at that point in the code it's a 16bit value anyway
Yeah, just adding some code to handle the colors and it wasn't clear.
how would it interact with picodvi and usb_host?
It does seem to be the same folks repeating the same things. I can close and lock it with an explanation: "we may do this sometime, but no plans". Or we can just lock it and leave it open, since it is a legitimate request
the color space dictates what the incoming value is
Yeah, I wasn't sure about the swapped color expected byte orders
Good questions. At first it won't.
I'd argue that as time goes on multiprocessor microcontrollers will become ubiquitous. They are well on their way to doing so now. I expect to see an RP4xxx soon.
when that happens, we'll need a solution that allows c code inside CP to use it too
a number of folks on that thread have attitudes that make me not want to do it and then have to support them
agree with that, but we want to provide mechanisms that are less error-prone than threads for taking advantage of multiprocessing. e.g., asyncio, but not provide user support for any low-level mechanism like _thread that it needs. Any new feature comes with a support burden. _thread is a big support burden. we may want to say "no support provided"
and we already have the ability to use the second core for internal C code. so any solution to merge needs to have some locking to manage who is using the second core
(circuitpython supports the multicore broadcom chips on raspberry pi SBCs if you want a place to test 4 cores)
Here is the notes document for next Mondayβs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youβll be attending the meeting - itβs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weβll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1rA4Zb-rPvZ2IDEfw417YdOcJAgLuj8zJIBPn_7P6vYI/edit?usp=sharing
CircuitPython Weekly Meeting for September, 25 2023 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you canβt make the meeting and would still like to ...
thanks! I had to interrupt my post-meeting tasks on Friday and then got wiped out by a triple vaccination and forgot to follow up
Do other pins work ok? Does GPIO34 fail on other S3 boards?
Oh my, I did both covid and flu shots at the same time once and it knocked me down pretty hard. I swore off of doing more than one at once.
it wasn't terrible but my arms (2 in one, 1 in another) got really sore, and I was just really tired
ok by 30 hours later or so
I wanted to get a hug report that came to mind written in so I don't forget and noticed.
Please give test code for the second step. I'll look into it then. Is the expectation that the reload will reconnect?
I can't reproduce`:
Adafruit CircuitPython 8.2.6 on 2023-09-12; TinyS3 with ESP32S3
>>> import digitalio
>>> import board
>>>
>>> tmp = digitalio.DigitalInOut(board.D34)
>>> tmp.direction = digitalio.Direction.OUTPUT
>>> tmp.value = True
>>> tmp.value = False
>>>
>>> tmp.switch_to_input()
>>> tmp.value
False
>>>
>>> tmp.switch_to_output(False)
>>> tmp.value = True
>>> tmp.value = False
>>>
Please check w/ hardware.
I did. Please assume I tested any Adafruit or Espressif settings changes. I have those boards.
80m works just fine. I tested it:
Adafruit CircuitPython 9.0.0-alpha.1-67-gc86b3ae19f-dirty on 2023-09-20; ESP32-S2-DevKitC-1-N4R2 with ESP32S
Please cut me some slack and watch your tone. It makes me feel bad. I changed 100+ board defs and you found 6 board issues and only two were mistakes.
My friend, I tell people about your stewardship of this project on the regular. You're a legend in the domain of accessible embedded systems. Keep up the wonderful work β€οΈ
Reloads do now reconnect as long as creds are set.
Wifi is reenabled too if it was disabled.
Exact steps:
- Install a
settings.tomlwith wifi credentials and api password. - Reboot the board.
- Ensure web-workflow is up.
- From repl:
import wifi; wifi.radio.enabled=0 - Reload with Ctrl+D.
Profit.Hardfault.
In any case, the fix is not simple (if it was, I would have done it already). This should be done in a seperate pr.
I know, but it's particularly sus, considering no other boards other than the bpi's have such settings.
if it's a r2 chip as most 2mb things are, the settings are wrong.
I just felt this needed to be noticed. It could just be a weird, one off chip.
Also, just tested it.. that always was an issue in 8.x...
This actually turned it from a hardfault to a partially broken mdns.
I apologize. That was insensitive of me.
I am sincerely sorry.
Thank you for the apology.
Is there a way for me to somehow capture the reason of the crash on my board? Like a debugger just plugged in connected to some of the pins? Unexpected maker also said that I should downgrade the firmware and try 8.2.3 or 8.2.4 because he uses that and that is what I should use as well.
DEBUG=1 builds of CP will usually output the ESP-IDF logging onto the UART. That's how I debug crashes. The adafruit discord is a good place to get help doing that if you need it. https://adafru.it/discord in #circuitpython-dev
Ah and I should probably let you know why it's not an easy fix.
Do keep in mind however, I may very well have misjudged some stuff (due to my lack of understanding of mdns), so do take the following with a grain of salt.
If any network change occurs (even a reconnection to the same network), the mdns object effectively breaks and needs to be recreated before it can be used, or a hardfault occurs when it's used.
On top of that, simply adding:
if (reload && !common_hal_mdns_serv...
Okay. I can still reproduce issue on my board. Going to make a build on my Ubuntu machine and come back here with my findings.
I have no idea why. Does it need to be deinited before a disconnection?
If it was already deinited, it would justreturn, not explode.
Ya, this is my assumption. It looks like the underlying mdns is freed with the IDF but the outer CP object doesn't know.
Perhaps we should "trap" any disconnections (due to range, with .connected) and .enabled=0, and have it reset STATIC bool mdns_started = false; in /home/bill88t/git/circuitpython/ports/espressif/common-hal/mdns/Server.c:39?
Perhaps also add checks so that if it's false, common_hal_mdns_server_deinited always returns true.
Hi, thanks for following up. I have one requested change and some things that I'd like to understand better.
This will have to say deprecated in 9, removed in 10.
we don't usually use this style of "abbreviate via import as" in docs. do you mind writing it "watchdog" in full in this example?
I think this isn't really equivalent, because before the None object was used, but now it's WatchDogMode.NONE. Am I mistaken, or does this prevent existing code from working if it tries to check for the None watchdogmode?
@brazen hatch I'm working on a fix along those lines
Is there something I can do to help? Do you want me to pickup a part of it?
I can prolly do the status "reset" in wifi if you want me too.
The rest I am really not confident about.
it's not too difficult. I think I can handle it
testing now
is there an existing issue filed for it?
nope, there isn't
I kinda was trying to fix, so I was like, "why make an issue when you can make a pr".
But I wasn't able to and forgor.
ya totally. I do that too
the repro info was helpful
it still fails after the free...
c3 would be good right now, since you can test the variable value from gdb to make sure
I tried this approach in my setup:
Adafruit CircuitPython 8.2.6 on 2023-09-12; Raspberry Pi Pico W with rp2040
Board ID:raspberry_pi_pico_w
Sadly, the asyncio task silently terminates when it attempts to await the AsyncEventQueue context (just the instance in this case).
I even tried catching BaseException, but there's no exception - the task simply just disappears.
async def run(self):
""" ...
but I guess you can just print the variable directly before every free
I'm using an S2 with console logging instead
I think it's an IDF issue
oh nyo
it frees the list of hostnames but doesn't set the root pointer back to null
not fixed in idf5 either
imma go check idf issues brb
vendor sdks don't usually test stopping and restarting things very well
we're weird
you're telling me nobody uses esp mdns and accounts for when the wifi conn is lost?
So.. What do we do? (Other than make an upstream issue?)
Can we workaround this by setting this stuff directly? (I have no idea what the code looks like for idf mem)
yea there is no upstream issue
we have our own branch of the idf where we can fix it
Ah it was a oneliner, of course.
CircuitPython version
Adafruit CircuitPython 8.2.6 on 2023-09-12; Raspberry Pi Pico with rp2040
Code/REPL
import usb_cdc
usb_cdc.data.timeout = 1
def send_data(data):
data = bytes(data, 'utf-8')
usb_cdc.data.write(data)
while True:
if usb_cdc.data.in_waiting > 0:
data = usb_cdc.data.read(usb_cdc.data.in_waiting)
print(data)
usb_cdc.data.write(bytes("test\n", 'utf-8'))
Behavior
When attempting to ...
We need to reset our MDNS state instead of just the IDF's.
Is your AsyncEventQueue what is in the first post in #6712 or is it what is in https://github.com/adafruit/circuitpython/pull/6712#issuecomment-1210090179 ?
#8418 will fix this issue. Removing the reload here fixes the MDNS info in the meantime.
Maybe?
bool common_hal_wifi_radio_get_connected(wifi_radio_obj_t *self) {
bool result = self->sta_mode && esp_netif_is_netif_up(self->netif);
#if CIRCUITPY_MDNS
if (!result){
mdns_server_deinit_singleton();
}
#endif
return result;
}
@slender iron
to account for disconnections from range?
I wanted to build a version of CircuitPython using the codespace but I got errors because the huffman Python package was missing and the old make target was used to retrieve the submodules.
Here is a working version :)
I'm using the first one from that PR:
class AsyncEventQueue:
"""
Helper class which moves the polling burden from Python code to underlying C code
Reference: https://github.com/adafrui...
What is the host computer, and do you have a simple test script you are running on the host? We would like to try to duplicate your setup.
This is a better place for disconnection cleanup: https://github.com/adafruit/circuitpython/blob/main/ports/espressif/common-hal/wifi/__init__.c#L101
I'm not sure that the loss of the network is actually the issue though
the free in set_enabled seemed problematic
Could you try the simpler code in the subsequent post?
Same, testing will tell. It would prolly be best to get it working first and then account for that edge case.
I just ran into a situation where I attempted nested try/except clauses (mere general errors, non specific). I hadn't stop to think which clause would handle things the inner or outer, or even if the behavior is determined. Any advice here?
I.. Didn't even know this place exists.. It may be fine putting it only in there..
The inner one always (unless one specific KeyboardInterrupt bug creeps up) catches it.
The innermost is going to handle the things in its scope that it handles in its excepts. If it isn't handled there it will go to the outer
I think we want it where the PR adds it so it happens before the disconnect
Thanks! We don't use this ourselves, so we don't often realized when it goes out of date
This is our own version, in a submodule. It is in .gitmodules, so it shouldn't be a PyPi requirement.
[submodule "tools/huffman"]
path = tools/huffman
url = https://github.com/tannewt/huffman.git
I am witnessing it performing the outer try and then promtly failing it with no inner error or exception. Rather weird behavior.
can you reduce it to a simple example? Just raise the exception that it not being caught inside the inner
my actual code is quite complex. I'll work on creating the same conditions with simple code and get back to you. Thanks!
make sure that the inner is really catching the exception or a superclass of it
Sure, but when the network is lost due to range, we don't get that luxury.
I will prolly come up with a few more edge cases overnight.
In any case, if you get it working, I can snuff out the tiny edge cases on my own and pr to your pr.
I will test everything either way.
I'm hoping the idf mdns code will work over disconnect if you don't free it
Please keep in mind if it's like with the KeyboardInterrupt thing, it won't be reproducible in a tiny snippet.
Unless you got a big hulking heap it won't happen, since it's some form of stack error.
Note to self: retest with micropy 1.19/1.20
I use Windows 11 Pro on my computer. To work with the port I tried to use the terminal programs "Termite", "Serial Port Utility" and the web terminal "Serial terminal" from Google chrome labs. All programs receive data from Console, but not from Data.
And could you post your boot.py?
boot.py file:
import usb_cdc
usb_cdc.enable(console=True, data=True)
I would also like to note that the boot_out.txt file has no errors.
Absolutely, changing the make target solves all the problems, I didn't realize it because I hadn't corrected it in that order.
@slender iron It's the esp_lcd_panel_disp_on_off call that is new
The LCD panel initialization flow is slightly changed. Now the esp_lcd_panel_init() will not turn on the display automatically. User needs to call esp_lcd_panel_disp_on_off() to manually turn on the display. Note, this is different from turning on backlight. With this breaking change, user can flash a predefined pattern to the screen before turning on the screen. This can help avoid random noise on the screen after a power on reset.
and make sure refresh_on_demand is false, but it should have been (they renamed it I guess)
@dhalbert I just now tried the 'simpler code', and it does work.
async def run(self):
"""
Continually poll all the buttons and invoke callbacks on push and release
:return:
"""
self.log("run: monitoring buttons")
self.is_running = True
self.keysObj = keypad.Keys(self.pins, value_when_pressed=False, pull=True)
#while self.is_running:
# await self.poll()
event_queue = self.keysObj.events
...
This actually completely fixes the issue! No further changes are needed.
Mdns now recovers from .stop_station(), .enabled=0 and disconnections due to range.
@slender iron yes it appears settings.toml requires DOUBLE QUTOED strings like foo = "BAR". the toml specification supports strings with single-quotes '...' but we do not support it.
As a side note, my project is a MIDI pedal controller board, being used in live music looping, so pedal pushes need to be detected and actioned as instantly as possible, to avoid loop mis-alignments.
It has helped a lot to switch from round-robin pin polling (in my earlier prototype) to now feeding off keypad events, but I'd still like to be able to eliminate all polling from Python code.
@jepler Do you have a comment here? Did I misunderstand what you did in #6712 ?
#6736:
socketpool.Socket, if it doesn't already work with asyncio
...does it? (I have no concept of how to determine or test)
Given that the asyncio task simply "disappears" when using the first helper class in #6712, I'm suspecting an edge case somewhere inside the C code for asyncio.
This suspicion is based on the fact that no exception is being raised.
I turned off rgbmatrix in https://github.com/adafruit/circuitpython/pull/8411/commits/ba22633fb080ed6bdf9e93ebf037a2511e5523d9, the submodule needs to be updated. Can be done as a seperate issue?
I just tried the following complete code on Adafruit CircuitPython 8.2.6 on 2023-09-12; Adafruit PyGamer with samd51j19:
import asyncio
import board
import keypad
import digitalio
import gc
async def blink(pin, interval, count): # Don't forget the async!
with digitalio.DigitalInOut(pin) as led:
led.switch_to_output(value=False)
for _ in range(count):
led.value = True
await asyncio.sleep(interval) # Don't forget the await!
...
I updated the initial comment code so that it works with current versions of asyncio. This code depends on internal details of the asyncio library and as such can be broken by internal changes to asyncio. (https://github.com/adafruit/Adafruit_CircuitPython_asyncio/commit/fb068e2f1bbea264dd4a69a3bb973561509d738f)
It boots ljinux just fine. So pretty much the whole core works.
I will throughtly test everything.
First thing I found:
>>> wifi.radio.connect("Rock4CPlus", "REDACTED") Traceback (most recent call last): File "<stdin>", line 1, in <module> ConnectionError: No network with that ssid
This is an irrelevant issue I just found that also is in current main.
CircuitPython version
Latest master, current commit e39fbf1b26b4fd3b66313e51ccc3db0eba7bd58a
Discovered on s3 while testing idf5, also exhibited on regular esp32.
Code/REPL
import wifi
a = wifi.radio.start_scanning_networks()
for i in a:
print(i.ssid)
print(i.authmode)
a = wifi.radio.stop_scanning_networks()
Behavior
Something is wrong with authmodes, and it's consistent.
main:
WIND_2.4G_422DEA
[wifi.AuthMode.WPA2, wifi.Au...
@dhalbert The Pico W is not a nRF52840 board.
We've put a lot of work into BLE on the nRF52840 and recommend folks using it. Supporting the Pico W isn't a high priority for us (but we're happy to guide and review if someone else wants to take it on.)
This is honestly really disappointing but I'd be happy to take a look at what's still needed to do to implement and give it a try. It's been fully supported in MicroPython since June, I think? Is there a particular stumbling block?
Are you planning to publicize or sell this board? We welcome board definitions but for personal definitions we recommend that you just keep it in your own fork, since it's significant overhead to add new boards.
Oh, in that case this board is a personal project, closing PR. Thanks for looking into.
There is no particular known stumbling block -- it's a matter of developer resources and priorities. BLE is also available on some Espressif chips: we have limited support, there is an issue of missing functionality in the underlying software. nRF52840 boards are available and have fine support.
When this gets sorted, it would be nice to have this added to the asyncio learn guide (along with async sockets, if supported).
The circuitpython (page) says:
Raspberry Pi Pico W brings WiFi + BLE (coming soon) wireless networking to the Pico platform while retaining complete pin compatibility with its older sibling.
If you don't plan on supporting BLE for the Pico W, then don't tell users to wait for it, as it will never happen.
BLE support on Pico W is not currently actively being worked on. Remove "coming soon" language and remove BLE as a feature. See https://github.com/adafruit/circuitpython/issues/7693.
@slender iron https://github.com/adafruit/circuitpython/issues/7693 is another issue I would consider locking but leaving open.
maybe with an ending message "we hear you, we don't have time to work on it now; if you're interested in working on it we'd love your help; contact us in discord"
Your only real response to my offer to help was to change the language from BLE "coming soon" to "not currently supported"?
You should close this issue, too. It's clearly resolved.
Your only real response to my offer to help was to change the language from BLE "coming soon" to "not currently supported"?
The PR was to address https://github.com/adafruit/circuitpython/issues/7693#issuecomment-1729728523, not your offer to help.
You should close this issue, too. It's clearly resolved.
No it's not, and please don't be snarky. Take us at our word. We are not giving an evasive answer. We are flat out on a bunch of other things for 9.0.0 right now.
If you'd lik...
- neopixel removed, could not share function with DBLTAP
- external SPI bus definition is settled
@ladyada
You're right, that was snark, and I apologize.
I'm also frustrated and was piqued that your initial responses to my offer of help was to refer me to other boards and to remove coming soon from the Pico W page.
But I do apologize for the snark. I'm sure you're busy as hell and snark isn't helpful or appreciated.
The firmware/memory thing could well be a problem just for my use case but I'll take a look. I already have another firmware blob in the mix.
And thank you for the disco...
@bullwinkle3000 Thanks for your response! The #circuitpython-dev channel in discord is where the devs hang out. #help-with-circuitpython is for end-user problems.
havent tested with hardware yet!
That works for me!
here is info on how MP is using split heap on esp: https://github.com/orgs/micropython/discussions/12316#discussioncomment-7042106
I don't think MP BLE has bonding support yet
We're going to lock this issue but leave it open. If anyone wants to help add BLE support to Pico W, then please ping us on Discord. :point_up:
Is the 8.2.6 output correct?
I'd like to help with #7693.
great!
it'll hopefully be mostly "implement the _bleio functions in common-hal"
it is not a small project
I like big difficult projects. Give me a day or two to get my bearings. In the meantime please add me to collaborators so I can leave notes in the issue.
I unlocked it, so please post that you are looking into it
I can assign it to you then
Working on this issue. Will post progress as warranted.
actually, I won't assign
I don't think it'll give you access if I lock it again
so I'll leave it unlocked unless it goes south again
I've read it and I feel for you!
I don't want to get you overcommitted by assigning too
That's fine. Just a place to leave notes is what I need.
I turned off
rgbmatrixin ba22633, the submodule needs to be updated. Can be done as a seperate issue?
Yup, we'll need to test a lot once it is all merged in.
@mortal kernel we can hide a bunch of the +1 and other comments to make it easier to follow
It's cool as is. I've developed a talent for selective reading over the decades.
for reference, here is the git issue I "filed": https://lore.kernel.org/git/111c2777-6fd4-45ab-8418-9d064999661c@app.fastmail.com/T/#u
Makes sense -didn't test.
Does adabot have any utility to make releases for libraries that were changed by a patch sweep?
Β―_(γ)_/Β―
kattni might know
@idle owl or @proven garnet do either of you know if adabot (or anything else) has some utility to help with releasing libraries after a patch sweep?
I don't think so for releasing. I think @trim elm has a way to mass automate the release process, but I only added functionality making commits and pushing.
Pretty sure it was an API thing.
Scripted.
There was a repo with a lot of her scripts in it.....
I can't remember where that was. Adabot in a directory maybe?
I took a look back at the scripts I used to create the "missing type" issues for libraries, I think that it's possible to re-purpose that into something for releases. I'll do some testing in my own repos and see if it's going to work how I'm imagining. If it does work out I can submit it to add somewhere.
I'll poke around adabot repo files as well and see if I can find anything in there.
Definitely a very useful tool! I think the adabot tools folder would be a good home for it based on what else is there.
@lone axle not apropos of this, I just was working on a library PR and got a strange error on failure-help-text.yml: https://github.com/adafruit/Adafruit_CircuitPython_MCP3xxx/actions/runs/6266083060
I think I've seen this one before, I chased it a little one day and got the impression it was from the action that attempts to post a comment if the workflows fail. I'm not certain if that conclusion was correct, nor on the operation of that action. I feel like I have seen it successfully leave it's comment since then so perhaps it's not an issue every time it runs.
i will try a re-run, but I'm going to fix the error that caused the failure anyway. Maybe something in .github is out of date?
re-run failed again
I'm not very familiar with the actions JS flavor. The error may stem from this line or the similar one a few down from here accessing issue.number if issue were undefined I think it'd produce the exact error from your failure page. https://github.com/adafruit/circuitpython-action-library-ci-failed/blob/main/index.js#L18
aha, so it's innocuous, no associated issue?
but it should just exit quietly in that case
well a bit further up it sets issue as
const issue = workflow_run.pull_requests[0];
which makes me think maybe it's actually a PR but being called an issue in that context.
As far as I understand it the bot only posts on PRs since that is where the failed workflow run that triggered it would have happened.
agree'd I don't think it's innocuous because it's only a failure of the bot that posts the comment as far as I understand it (whatever the PR is addressing is seperate and unrelated to the failure I believe). It would be good to make it exit quietly, presumably the JS could check for undefined and handle it more gracefully. It is kind of odd that it would be undefined as well though since the PR does exist, that might point to a seperate root cause.
hmm, that is odd
maybe open a quick issue on https://github.com/adafruit/circuitpython-action-library-ci-failed
thanks for posting that
πΈπͺ π
hiya - thought maybe it was a Swedish holiday π
Not today. π
it is equinox
Thanks so much @jepler for your deep-dive on this. TBH the use of yield within an __await__ method did seem interesting.
Changing yield to await inside the helper class got it working.
Now, given that keypad.Keys follows a streaming paradigm, it felt appropriate to rework the helper into an async generator pattern. So I've updated the above to:
class KeysGen:
"""
Helper class which moves the polling burden from Python code to underlying C code
Reference: h...
I'm glad this got you un-stuck. async iterators are already beyond my knowledge level but conceptually that makes good sense.
@jepler I can't strongly enough recommend learning more asyncio stuff.
The implementation of asyncio in CircuitPython is fairly minimal at the moment. But it works amazingly well. Many of the more familiar CPython facilities like asyncio.Queue are not difficult to implement.
With CircuitPython's strategic decision to exclude interrupts, for anything but the most basic programs, asyncio is the only line of defence against sloppy inefficient poll cycles. It facilitates writing of effici...
Repo is called evascripts
Cc @lone axle ^
@lone axle I think i t would sense to fork Eva's repo as adafruit, or copy scripts into adafruit/adabot, etc.
@slender iron I am reviewing the idf 5 PR
Adafruit Metro ESP32-S3 with 16 MB Flash 8 MB PSRAM PID: 5500 appears to have an SD reader, but it's not in the product title or description
(contrast with Adafruit Metro M7 with microSD - Featuring NXP iMX RT1011 PID: 5600)
I think maybe there will be a new hardware revision. I think I recall mention during a meeting of an issue pertaining to the SDCard slot on that device. I have one of the ones that did ship already and it doesn't run SDCard sample code correctly, I didn't chase it or troubleshoot very much though either, and I may have misunderstood the mention in the meeting. I don't know the specifics of what is up with it. But if it doesn't work on the existing revision perhaps it was removed until the new ones start shipping.
yeah I think the product is in hiatus until the revision comes out, hopefully there's a way to get the SD Card working
I don't recall from the stream what the fix was going to be
SD Card is a big plus, but I pointed that out mainly b/c if it will have SD Card, it's a good marketing point to include
and consistent product titles make it easier to find (and compare) stuff
Thank you! The 5.1 changes are almost ready too
they'll be smaller
Thanks for this big endeavor and thanks to @microdev1 also!
The sdkconfig refactoring is really great -- really makes things simpler.
I will add an issue to re-enable rgbmatrix unless you are already working on this.
I will add an issue to re-enable
rgbmatrixunless you are already working on this.
I haven't started yet. Will need to coordinate with @PaintYourDragon I think for the IDF update.
@tulip sleet any objections to merging? thanks for the review!
no, go ahead, I wasn't sure whether bill was doing further testing
follow up PRs will be much easier to follow
merging means I can rebase my 5.1 changes and get them out π
so should there be a reminder issue about rgbmatrix or is that in your queue
I'll make one
i just got an email about cryptography <39.0.1 being a serious security issue
you got it too, i'm sure
Protomatter probably needs to be updated to ESP-IDF 5.
I don't see it yet
@slender iron @tulip sleet Wondering if you see a problem with BTStack licensing?
we were worrying about it, there is some kind of exception for RP2040, but q is whether it's enough
Yeah, I saw that. The way I read it is that the exception is for the Pico W and WH only.
basically anyone with a pico w or wh can use it
ya, we won't use it elsewhere
the wifi driver has a similar license: https://github.com/georgerobotics/cyw43-driver/blob/main/LICENSE.RP
key is:
Raspberry Pi grants to the Customer a non-exclusive, non-transferable, non-sublicensable, irrevocable, perpetual
and worldwide licence to use, copy, store, develop, modify, and transmit BTstack in order to use BTstack with or
integrate BTstack into Products or Customer Products, and distribute BTstack as part of these Products or
Customer Products or their related documentation or SDKs.
so commercial products using CPy on Pico W/WH are OK
or products that integrate the two
βProductβ shall refer to Raspberry Pi hardware products Raspberry Pi Pico W or Raspberry Pi Pico WH.
I believe RPi would have been quite careful about this, because they don't want to restrict the user of their products in any way.
And we have no desire/intention/ability to get the radio module and build a Pico-W-ish thing
Looking through the code I found some 3rd party boards that do have the CYW43 or at least include its driver in their stacks.
they would have licensed it themselves, I assume
For my work it comes down to a choice between making BTStack a part of all existing boards that include CYW43 or fencing it off to just the Pico W/WH.
- H2 is the first ESP without wifi.
- Code size grew so 2MB and 4MB C3s have
_bleiodisabled to make plenty of room. - GCC was updated so some changes are to fix new compiler errors.
- adc and dac drivers were updated to new API. (C6 only supports new adc API.)
- C6 and H2 have a new RTC peripheral, LP_AON, that is used in place of the RTC on those chips.
Some boards have a pico w soldered down
I don't know of any that have the cyw separately from the RP2040
I know damien uses it on some of his stm boards
that's why his license is for rp2040 only
It all sounds good to me. You've put my worries to rest. Thanks!
@onyx hinge any chance you have test code for the qualia + round display?
@slender iron yes, I'll get it to you after lunch
thank you
I'd got the impression that the RMT API was completely changed in ESP-IDF v5, but pulseio hasn't changed, so I guess that means the old API is still there?
ya, they guard it behind warnings
@slender iron https://gist.github.com/jepler/19b0db105a94279c2adabe8963d19848 code for round display which may be tl021wvc02
@onyx hinge I found that but wasn't sure what board it was for. Hoping it was for the newer expander helper. I'll convert it after I eat lunch
rev B board
The SD card is mention in the product guide https://learn.adafruit.com/adafruit-metro-esp32-s3?view=all but that could because of template in the learn system?
Thanks for bringing us up to date!
Approving, but one q about INTERNAL_LIBM. Merge when you wish.
Why did you change this to use the ESP-IDF libm?
There is a rom blob (can't remember which) that links against floor(). Our implementation has it for doubles but it didn't compile. So, I switched it assuming that's what espressif uses.
Hello, I was the original person who posted this issue in the Adafruit forums. I apologize for the delay. My mother has some scary medical conditions happening right now that I have been tending to. Just FYI on my setup. I am the using the Titanto with NINA-FW version 1.7.5 upgraded as well. First thing I did was upgrade it. Per @caternuson I ran an older release, 7.3 and the issue went away (same SD card no change). I have no upgraded to 8.x and I ignored the portions of the "how-to-guide" ...
FYI I'm using a random program for the Apple store to bench the microSD card. Its writing/reading a random 250MB file to the card and its I/O reads are anywhere from 35-60MB/sec with an overall average of about 39/40MB/sec. Reads are about double that averaging 85MB/sec. I dont know the quality of this program though...I'll keep looking for something a little better.
So I found another tool, that let me test several gigs of random IO, still averaging slightly higher numbers than my last post 50's for write and 90's for read. This matched up with the Mac's built in system monitor I watched the IO on there as well. Suffice to say the numbers are not dropping anywhere near the danger zone. Now I have to let my microSD card cool off its toasty hot! :) Cheers.
CircuitPython version
Version: Adafruit CircuitPython 9.0.0-alpha.1-37-g4563c35908 on 2023-09-12; EK68Custom with rp2040
Code/REPL
Here are two minimal examples:
This code works with no crash:
import time
from kmk.kmk_keyboard import KMKKeyboard
from kmk.modules.layers import Layers
from kmk.keys import KC
keyboard = KMKKeyboard()
FN = KC.MO(1)
layers = Layers()
while True:
print("Waiting")
time.s...
The 9.0.0 releases are very early, and not meant for general use. But thanks for reporting this.
What Safe Mode error is reported?
If you use 8.2.6, does it also crash?
How to tell the Safe Mode error? The REPL contains the included text, but no mention of the specific error.
It should print one of these general errors after reporting it was in Safe Mode:
https://learn.adafruit.com/circuitpython-safe-mode/safe-mode-reasons#internal-software-errors-3138327
It's already in the bug description text:
"Hard fault: memory access or instruction error."
This is the third such error from the link you gave,
Ah sorry, I missed that in the original post. In any case, does it also fail on 8.2.6?
Compiling now, will report later.
Managed to checkout remote branch "8.2.x". The issue is now resolved. Didn't realise I needed to checkout the latest remote branch for this.
From REPL:
Adafruit CircuitPython 8.2.6-5-g37180b28dd on 2023-09-23; EK68Custom with rp2040
Will close this off. Thanks for your assistance.
9.0.0-alpha.1-something reflects a bunch of changes that could have caused regressions, mostly at the moment a merge from Micropython v1.19.1. So the crash you describe is interesting, and we should look at it, and I will reopen this issue for that reason. But if you're trying to get something to run for your board, by all means use 8.2.6.
Thanks @dhalbert . Good luck with the bug hunt. I'm just trying to get a stable build for my own PCB so I can use it for a keyboard product that I bought, but did not like the limitations that their mystery MCU gave me. My PCB is mechanically and electrically compatible with the commercial PCB, and is a drop in replacement.
CircuitPython version
Adafruit CircuitPython 8.2.6 on 2023-09-12; Adafruit Feather M4 Express with samd51j19
Supplying 65536 as the value_count argument to a displayio.Bitmap constructor yields
an error that value must be 1..65535:
>>> import displayio
>>> bitmap = displayio.Bitmap(160, 120, 65536)
Traceback (most recent call last):
File "", line 1, in
ValueError: value_count must be 1-65535
>>>
But in a colorspace like RGB565, all 65536 16-bit values are vali...
soory for my newb question.
Is there a way to rename the usb_midi device name?
by default it named CircuitPython usb_midi.ports[x]
i tried to modifing the .uf2 file with an hex editor, but does not work.
i tried with a different length name and the uf2 is not working (no boot)
i tried a second time with the same number of char (13), the uf2 seems to work but the device has the same name CircuitPython....
i tried supervisor.set_usb_identification("Herve Bi", "Herve Bi") but no mo...
@mrbbp Which name exactly do you want to change? What is the current name and what do you want to change it to?
The None object wasn't used before. WatchDogMode.NONE is a replacement for deinit.
I have the debug build.
(It was exciting to make it because the build dependencies had a mismatch:
- esp-idf/install.sh wanted jinja2 version 3.03
- the "requirements-dev.txt" wanted to install jinja2 version 3.1.2 (which I guess is the latest
Build requirment from: https://github.com/adafruit/esp-idf/blob/f50c59e5ec3d28921fda41c1ef207966df6b3233/requirements.txt#L29
"jinja2<3.1; python_version < "3.11" # See https://github.com/espressif/esp-idf/issues/8760"
So I had to reseacrh...
Here is my full code if you are interested:
tinys3_crashes.zip
The board is related here: https://github.com/MakerM0/MagiClick-esp32s3
VID&PID can be found here: https://github.com/espressif/usb-pids
Circuitpython V 8.2.6 WiFi "ConnectionError unknown failure 2" (https://imgur.com/a/LIFq92Q) solved. See image: https://imgur.com/a/X3CrF8q. Board used: UM TinyS3. Is it possible to implement into CPY "wifi.AuthMode.WPA2" by default?
Adafruit CircuitPython 8.2.6 on 2023-09-12; Adafruit PyGamer with samd51j19
>>> import microcontroller
>>> microcontroller.watchdog.mode is None
True
In 8.2.x, None is the value of the mode property before it is set to something else. After this PR, it is WatchDogMode.NONE.
I see this as an incompatibility. It may be minor enough that we just go ahead and do it. @tannewt @dhalbert I would appreciate your opinion on how closely we require backward compatibility.
I w...
@dhalbert
i build a small box with 2 rotatives pot on it and a rp2040 to send midi datas.
I use the pot to have a physical interface to manupulate things in Processing.org
in my sketch the device listed is CircuitPython usb_midi.ports[0]
Available MIDI Devices:
----------Input----------
[0] "Real Time Sequencer"
[1] "CircuitPython usb_midi.ports[0]"
----------Output----------
[0] "Gervill"
[1] "Real Time Sequencer"
[2] "CircuitPython usb_midi.ports[0]"
...
I see. The earlier implementation used WATCHDOGMODE_NONE enum internally and None object for the python side.
Using the None object has two benefits:
- One less QSTR.
- Maintains backward compatibility.
@thorny dove AuthMode is basically an enum, espressif connect doesn't use it directly (the espressif or raspberrypi common-hal functions handle it). It's more directly used to interpret scans, and for creating an access point. Not sure if a default makes sense since folks may use any supported AuthMode. I wonder if including that line was coincidental in fixing the issue. Error 2 is WIFI_RADIO_ERROR_AUTH_EXPIRE
Try using the 8.2.x branch if your main aim is to get a working build. The latest main was just updated to ESP-IDF v5.1, and probably has some regression.
@tannewt Note the jinja2 version skew issue above.
Right now that name is not settable from CircuitPython, but you can make a custom build and change the name. The names that are fixed at compile time are here:
https://github.com/adafruit/circuitpython/blob/1c0155c99b757a1c7840dd6cf6486b1aedfb99d1/shared-module/usb_midi/__init__.c#L182-L185.
This looks good!
In the future, you could try local builds on your own machine to avoid having so many commits pushed to GitHub and having to wait for the results.
Thank you very much.
I will do as you suggested.
add 'reset_bit' to 'dotclockframebuffer.ioexpander_send_init_sequence'
which will toggle the reset pin before init, if not None:
set output, low for 10 ms, set high, then wait 100ms
like this arduino code
https://github.com/moononournation/Arduino_GFX/blob/master/src/databus/Arduino_XCA9554SWSPI.cpp#L27
trying this code with the latest qualia board:
import busio
import microcontroller
import board
import time
import displayio
import dotclockframebuffer
from framebufferio import FramebufferDisplay
displayio.release_displays()
TFT_PINS = dict(board.TFT)
print(TFT_PINS)
TFT_TIMINGS = {
"frequency": 6_500_000, # should be 18_000_000,
"width": 480,
"height": 480,
"hsync_pulse_width": 13,
"hsync_front_porch": 40,
"hsync_back_porch": 20,
"vsync...
CircuitPython version
From S3 builds:
adafruit-circuitpython-m5stack_timer_camera_x-en_US-20230923-1c0155c <-- Doesn't boot idf5.1
adafruit-circuitpython-m5stack_timer_camera_x-en_US-20230922-d6b284e <-- Boots just fine idf5.0
Code/REPL
N/A
But wifi auto-connect is enabled without web-workflow.
Behavior
Stuck at:
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_...
I'll look into the ValueError tomorrow.
is the reset pin assumed to be on the GPIO expander?
My pico is connected to a through UART Serial (115,200/8/1/None) Cellular modem. Most of the time it works fine, but occasionally appears to drop byte. It could be the cellular modem, but it could be the pico. How do I figure this out and what can be done?
do you have a logic analyzer?
Yes. a very basic one.
looking at what is getting transmitted might help to pin-point the issue
you can also use another pico as a logic analyzer
Most things work well. I am performing a GET and then a READ of the result. POSTMAN works fine, so cloud appears fine. But my setup is receiveing b'{"sta": true, "ult":"23949379384759"}' when the fist two keys should be "status" and "result".
record the transmissions with your logic analyzer, and look at what is actually transmitted
I'll give that a go... thanks!
hello, i retried with a new rp2040 and the custom (renamed) .uf2. Now the device show the new name. I retstart my mac and plug the old rp2040 with custom device but it don't show the good name.
You may need to somehow "forget" the device on the Mac. macOS may have cached information about the device. Have you tried rebooting the Mac?
As a simple initial test, can try just running the original example as is using latest release of CircuitPython. See if you can get any SD cards working there. That's all I did.
The info about the SD card performance is secondary.
Yeah I have it up and running on the latest 8x build as you recommended and it is working with a SanDisk microSD card. Now I'm dealing with the secondary bug I seem to have stumbled across its in the forums and they have a github ticket open with the team!
I agree! would you be able to submit a pull request to fix this?
It's been some time since I've built CircuitPython, but I can give it a shot. This should be against 8.2.x (git checkout 8.2.x) I guess?
The CYW43 bluetooth firmware adds ~13KB to the existing ~225KB Wifi-only image. There is one new 6KB blob plus the Wifi + bluetooth blob grows by 7KB over the Wifi-only blob. This should partially answer @dhalbert 's concern about flash and RAM space. I'll have some numbers for btstack flash and RAM usage soon.
is there a circuitpython equivalent to micropython.heap_lock() ? (which incidentally is documented in circuitpython but not available)
There's gc.disable() which isn't a great diagnostic tool but it did help me find the allocations & eliminate them.
@onyx hinge I added a class memorymonitor to find allocations
you need to enable it though
- Fix releasing dot clock framebuffers at soft reset (a possible cause of "ValueError: GPIO2 in use")
- add support for a reset pin on the IO expander
- re-order the arguments & add board.TFT_IO_EXPANDER to ease calling ioexpander_send_init_sequence
Closes #8428 @ladyada
I noticed that the dot clock can be increased to 16MHz without causing screen tearing in my demo :tada: @tannewt
The Espressif LCD EV needs to be updated with board.TFT_IO_EXPANDER, which is why I'm creating th...
<@&356864093652516868> We'll have our weekly meeting in about 80 minutes from now in this text channel and in the circuitpython voice channel. Please take the time to add your notes in advance to the document: https://docs.google.com/document/d/1rA4Zb-rPvZ2IDEfw417YdOcJAgLuj8zJIBPn_7P6vYI/edit -- I look forward to everyone's updates!
CircuitPython Weekly Meeting for September, 25 2023 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you canβt make the meeting and would still like to ...
I'm unclear about the environment variables CIRCUITPY_BLEIO and CIRCUITPY_BLEIO_HCI. How are they intended to be used? Are /device/ble_hci and a port with common-hal/_bleio mutually exclusive?
They are alternate implementations of _bleio: one is for AirLift co-processors, and the other is for native BLE. They can't coexist because both provide _bleio. I don't see any strong reason for making coexistence possible.
HCI is how you talk to co-processors (it's the protocol name)
No, no reason for coexistence, glad I don't need to do it! Going back to _BLEIO and _BLEIO_HCI, it looks like _BLEIO_HCI should be unset for CYW43 (it's native) and _BLEIO should be set. Is that right?
ya, I think you just want BLEIO
Hey. Is there a better way to debug an ESP32 S3 board? Like with an attached debugger somehow? The build with DEBUG=1 doesn't really help. The cause of the crash is not printed I think.
I'm thinking like: building the circuitpython for the board in Eclipse or other IDE, then hitting a debug icon then it loads the code on the chip and when it crashes I can see the call stack or something similar.
did you hook up something to the DBG pin? AFAIK the messages for DEBUG don't come from normal prints in the standard serial console but rather are sent out over that pin.
I am hooked up to the BOARD.TX pin and reading the messages from a uart to usb chip:
The pin that is labeled TX on the silkscreen? Which specific microcontroller are you using? is it an Adafruit board?
I see, sorry I don't have any expereince with that device, I'm not sure which pin is the debug pin on that device. On the Adafruit ones that I have more hands on experience with, there is a pin labeled DBG which you can hook up to a USB serial converter to read the messages from crashes in DEBUG=1 builds.
possibly, I can't say for certain that it isn't TX either though on that device, I just don't know for it.
typically for espressif devices when DEBUG is on it will output an encoded string of hex data, that can be run through a script to return a human readable stack trace.
I think i am already on that DBG pin
but i could add extra debug message entries to the code
Hey, folks. Can I please be added to the circuitpythonistas role? Cheers!
that should be right. It's not "native" in the sense that it's still a co-processor, but that's all hidden under the RP2040-specific library. If the library were more general, there could be a devices/ble_cyw43 or something like that. The point of devices is that it's a port-independent but device-specific, unlike shared-module, which is port-independent and device-independent
i can do that
@idle owl done!
Thank you!
multiple folks doing it at once π
was just merge to CircuitPython: https://github.com/adafruit/circuitpython/pull/8427
The board is related here: https://github.com/MakerM0/MagiClick-esp32s3
VID&PID can be found here: https://github.com/espressif/usb-pids
Is there a guide on how to use J-Link with GDB to debug circuitpython on esp32 boards?
I've never done it. I suspect you may not have a code error because your start reason is POWERON
it could be related to anything connected to GPIO37
I only do printf debugging on esp
u were right
pulling a gpio low probably causes a short somewhere
and that causes a hard reset
thank you
@rancid pilot the closest I know of is https://learn.adafruit.com/adafruit-metro-esp32-s2/debugging-with-openocd
I apparently wrote that page but don't remember anything not written there π
Case can be closed. When I pull my gpio low it causes a short on the power rail and that causes the hard reset.
tannewt from the Discord channel noticed that the reason of the startup in the debug output is "POWERON" so it isn't a code problem but a hardware problem on my part.
[I think right after being added to a role you have to leave and re-join the voice channel before you can talk]
Thanks for the clarification, now I'm getting a better handle on the CP project's organization.
I read that as "Unicorn Micro M" keyboard. I'm a little disappointed to be wrong.
Thank you!
can't wait for more info. I'll have to increase my sponsorship on github too
I'll be refreshing everything there really soon too. So wait on that! π
Will do @slender iron
Yeah I see what you mean. I think the "monthly mention on Twitter" is not a valuable sponsorship level for me. π¬
Oof I forgot that's still there. I'm not even there anymore.
I know
Hi, so Anne suggested I explain why using the web interface of GitHub is important for me. π
It is just that I frequently do mini change by editing comments or readme and such.
Without having to use git and a copy of the repo.
A big technical problem is that changing a location on github means changing the links in the guide. Right now I don't think there's a bulk link change in learn.
https://github.com/adafruit/Adafruit_Learning_System_Guides?search=1 appears to show more than 1000 items fwiw
Learn access is OK.
I like foamyguy's suggestion about a generated list. It could maybe be put in the readme.
It's weird to me that Github just truncates it and doesn't offer pagination. If they had pages then it would at least make everything accessible.
Thanks.
Thanks everyone!
Thanks everyone
Thanks all!
missed the meeting, will catch it on youtube. this is why it's a good idea to put text only way ahead of time just in case.
Thanks for hosting Liz. have a good week everyone π
Thanks everyone, have a great week!
I have put "not present" but in fact it was mostly "text only".
Most of the Monday I am not at home during meeting time, I sometimes listen from the car, but nowdays I am mostly watching on YouTube or listening on Spotify.
And then for timezone reason, I watch most of Adafruit video the next day (especially Show and Tell, Ask an Eng. and Desk of Lady Ada. π
I'm happy with it in the RP2040 port. It's kinda joined at the hip with CYW43 Wifi and the Pico SDK, so leaving it in RP2040 until there's a non-RP2040 board with a CYW43 makes sense to me.
yes, we don't see other CYW43 ports on the horizon
Here is the notes document for next Mondayβs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youβll be attending the meeting - itβs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weβll read them off during the meeting. Hope to see you there! <@&356864093652516868>
https://docs.google.com/document/d/12JEwXvIK4qXQrW0834d0OvcB_UJrkzvz7ZYyqQ8iLmg/edit
CircuitPython Weekly Meeting for Monday, October 2, 2023 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you canβt make the meeting and would still like...
CircuitPython version
n/a
Code/REPL
Just the docs here: https://docs.circuitpython.org/en/latest/shared-bindings/ulab/numpy/linalg/index.html#ulab.numpy.linalg.eig
Behavior
It says it returns (eigenvectors, eigenvalues) while it actually returns (eigenvalues, eigenvectors).
Actual behavior is inline with numpy.
Description
_No ...
ulab is a submodule: the original repo is here: https://github.com/v923z/micropython-ulab/. So submit issues and PR's to that repo.
I found the problem. The Espressif SDK only finds hidden APs using channels between 1 and 11. My AP was using the channel 13.
Something like wifi.radio.connect("myssid", "mypass", bssid=b'\x124Vx\x90\xab') will connect to the hidden AP. I can ping external servers from the board and ping the board from the network.
Here is the code:
import wifi
import ipaddress
import binascii
ipv4 = ipaddress.IPv4Address("192.168.1.100")
netmask = ipaddress.IPv4Address("255.255.255.0"...
You can give a channel number to connect(): https://docs.circuitpython.org/en/latest/shared-bindings/wifi/index.html#wifi.Radio.connect.
The range of channels 1-11 is geographical.
Does anyone know what might be the cause of this error from the gh_release action that runs when libraries are released?
Error: Error: unexpected status code: 403
{"message":"Resource not accessible by integration"}
The 403 makes me think it's something related to permissions of the default token used inside of actions. Maybe there could be some different configuration for this repo vs. the others that could cause it? https://github.com/adafruit/Adafruit_CircuitPython_Wii_Classic/actions/runs/6301808822/job/17107662157
Similar, but on the PyPi release action for this one: it got 403 attempting to upload to pypi:
ERROR HTTPError: 403 Forbidden from https://upload.pypi.org/legacy/
Invalid or non-existent authentication information. See
https://pypi.org/help/#invalid-auth for more information.
https://github.com/adafruit/Adafruit_CircuitPython_BusDevice/actions/runs/6301838308/job/17116177855
I don't really understand how that could be failing for this library though, there are successful pypi release action runs in the past so unless the token or it's permissions were changed in the interim, it should behave the same as it did for prior releases.
It's been some time since I've built CircuitPython, but I can give it a shot. This should be against 8.2.x (git checkout 8.2.x) I guess?
Yes please. That way it'll get into a stable release more quickly. (We periodically merge it back to main too.)
Do you have an adafruit ESP32 board that this breaks on? I don't have any M5Stack boards.
I know but that doesn't work if the AP is hidden.
circuitpython doesn't restrict channel tighter than 1-13 due to its international audience, but if the espressif SDK limits connect() to 1-11, perhaps we should too. Not sure what raspberrypi SDK supports offhand.
I'm pretty sure APs can be created on 1-13, and wifi Monitor can receive 1-13. I see (U.S.) quite a few devices using channel 12, little to none on channel 13. Channels 12 and 13 have use limitations in the U.S.
@slender iron I think I need to change an esp-idf kconfig setting. do you have a minute to walk me through doing it? LCD_RGB_RESTART_IN_VSYNC
I need it to be =Y everywhere it exists, or at least on all S3
@onyx hinge yup! I have time
do you want to do voice/video or text?
either way
let me get ready to do video.
This is another weird actions error https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_FlipClock/actions/runs/6301847922/job/17107796188, but perhaps this one is insignificant. Actions reports that this failed the gh-upload-release-assets due to Error: Input required and not supplied: upload_url but on the actual release page it does have all of the assets attached successfully as far as I can tell. It seems like it thinks it failed, but actually suceeded. I'm not sure why it would think it's failed that way either honestly. The workflow does set the upload-url thusly: upload-url: ${{ github.event.release.upload_url }} which is the same for other repos and it seems to work fine for most libraries, but this one has shown failures on the last 2 releases with the same error (in both cases the actual release page does have the assets showing on it it correctly)
I do not have any unfortunately. Or any other ESP32 boards. I only have S2's and S3's.
Is the issue not reproducible on another esp32 board?
If that is the case, I can debug the definition.
It could be espcamera or the psram or something.
Is the issue not reproducible on another esp32 board?
I did just try it on an ESP32 qtpy and had the same issue. It looks like its due to the analogbufio module not being updated for the new adc api.
CircuitPython version
Adafruit CircuitPython 8.2.6 on 2023-09-12; Raspberry Pi Pico with rp2040
Code/REPL
""" Demonstrates a couple of issues in CircuitPython audio: 8-bit WAV
playing fails with RuntimeError, and RawSample playback does not
clear .playing flag at end.
Test system is RP2040 Pico. Occurs with both audiopwmio and
audiobusio.I2S; example shows just audiopwmio for simplicity.
"""
import array
import time
import board
i...
@lone axle your build problems are interesting, but I am too tired to look π I'll take a look tomw
Is it normal that bitbangio.I2C contructor pins are swapped on S3 boards (compared to busio constructor, and the api doc)?:
had to take my logic analyser out to realise this discrepency.
had to swap scl and sda in the protocol analyser config and everything made sense
looking at the shared-module code at https://github.com/adafruit/circuitpython/blob/main/shared-module/bitbangio/I2C.c i don't see or undesrand why it is swapped. Double checked IC datasheets, eagle library pinout mapping, soldered wires and hooked up to logic analyser. I am 99% sure the swap is not in my hardware.
+1
I think this would be a great feature (as well as one that I personally need :) as it would enable easy single-board bluetooth projects, especially with regards to kmk.
keep up the good work!
sounds like a bug to report
what board is it ? Isn't it just the labels in the board module that are swapped ? Have you tested with busio.I2C() instead and confirmed that you have to swap the pins ? (on the same pins)
Unexpected maker Nano S3
I'll do the test now
super odd, now i get pull up resistor error message
it has pullup resistors
bitbangio does work
I feel like I am a bug magnet π¦
I usually try a power cycle first in that case
and what if you swap the pins ?
does bitbangio even check for pull ups ? π€
busio pulls the pin down, and tests if it goes back up fast enough for the target frequency
pullup is there in resistor array i can measure, all connected
bus length is in centimeters
So i want to use 3 I2C buses, the default one, another one with busio (the hardware supports 2) and a third with bitbangio. All 3 (2*3=6) pullup resistors are there in those resistor array black boxes. Vcc is 3.3V, pullup value is 3300 ohm for each.
but it can pull down and it goes back up fast enough when I use other pins?
I can make a more proper setup on a breadboard, take measurements, do scrrenshots and make a github issue ticket if u like.
yeah I don't know what's going on there
oke, will make proper setup with a breadboard, maybe I am doing smtg wrong on those tiny little boards of mine.
Branch updated, as is the code for Qualia in the initial comment. Note that for rev C boards you'll need to comment out the line setting the i2c address to 0x38.
This PR changes the upper limit of display/Bitmap value_count from 65535 to 65536, per issue #8426.
Submitted PR #8434 to fix this issue.
@danh Wondering if you've approached TLV (tag length value store) in any of the other ble ports? If so, could you point me to one?
are you to the point where you want to get bonding working?
I'm working through BTstack configuration issues right now. TLV is implemented by BTStack for link key storage and the Pico SDK hooks that up to its own flash memory I/O. So, I'd like to see examples (if there are any) of how we fence off a chunk of flash for this sort of thing.
can you disable it to start?
Not easily. At least not without modifying or bypassing SDK code.
BTstack has a btstack_tlv_none.c, but the SDK has nothing similar.
nvm is the closest you'll find in circuitpython probably
how do you specify the flash region for the sdk?
It's in btstack_flash_bank.h which specifies a size and offset.
By default it chooses two sectors at the top of flash.
I'd put it at the top of the code region in flash
(assuming it all fits)
so just below the filesystem
All indications are that it will fit!
π
FYI, with the necessary firmware blobs and most of the BTstack, flash goes from 1344448(85.7%) to 1386304 (88.37%) and static RAM from 105220(40.14%) to 117120(44.68%)
that's not too full π
Thanks @slender iron that keeps me rolling along...
I'm happy to help keep you unblocked. I appreciate you looking into it
So far I'm enjoying the ride. The journey's the reward as SJ used to say whenever someone asked him for a raise!
π
This fixes ESP32 because the BufferedIn used the old ADC API and I2S did too indirectly.
Tested on QT Py ESP32 Pico and Espressif S3 Devkit C N32R8.
Fixes #8429
Did not test; thanks for updating!
Is this off temporarily until it's rewritten? Open a reminder issue?
Fix for first half of issue #8432, the "buffer too small" exception. Also a minor change to the 8- to 16-bit scaling math that previously would cause a slight DC offset.
I can see where the second half of the aforementioned issue (.playing always True w/RawSample) is happening. Donβt have a fix for that yet, but if I can sort that out, and if before this is merged, will add it to this PR.
Just a reminder that due to how make processes things, a same-line comment like this breaks checking configuration options for 1/0: The value of CIRCUITPY_PARALLELDISPLAY becomes "0 " with a trailing space, and so comparing it to the string "0" results in "not equal". Place the comment on the line above if it needs to stay.
This issue appears on the circuit python docs, not on the micropython ulab docs.
If they've fixed it already, then we will get the fix next time we update ulab. This is likely to happen soon.
@thetazero Could you link to the docs where the order is correct?
@onyx hinge i have a few new-style typedefs left to do that have namedtuples inside. I seem to remember you did that for one of them already, and would follow how you did it. Or am I misremembering? I could not find a commit message that mentioned that.
The I2S LCD API went away with 5.x. Not sure what the best approach going forwards is. (Also not sure we use this anywhere.)
GitHub didn't show your comment until after I merged #8435. :facepalm:
PR #8436 fixes the first bug (8-bit WAV playback on RP2040).
The second bug is a bit beyond me but I can see where itβs happening in ports/raspberrypi/audio_dma.c, in audio_dma_load_next_block(). RawSample audio playback is single-buffered, it just plays straight from the array in one pass. Double-buffered audio makes multiple calls through audiosample_get_buffer() and audio_dma_convert_samples() to determine when thereβs no more data to read and to play back; a combination of GET_BUFFER_D...
I was just in the ESP I2S code and it uses these helpers for conversion: https://github.com/adafruit/circuitpython/blob/main/shared-module/audiocore/__init__.c#L74
(They also don't handle the offset but are a good place to centralize this conversion.)
Actually, those helpers don't handle 10 bit output unfortunately. Will review this as-is.
Thanks for the fix! One question.
Why can you remove this? Don't you need to know that the output samples can fit in the output buffer?
Suitable check is already occurring a few lines prior.
Also, look at what those two lines are doing⦠output_length_used, by definition, is now greater than output_length. The test will always return true, indicating an error.
I believe these are the only remaining Library Releases that had trouble that I was unable to figure out:
https://github.com/adafruit/Adafruit_CircuitPython_Wave/actions/runs/6301919145/job/17108014971
403 error on the Github Release assets upload
https://github.com/adafruit/Adafruit_CircuitPython_BusDevice/actions/runs/6301838308
403 error on the PyPi upload
https://github.com/adafruit/Adafruit_CircuitPython_Wii_Classic/actions/runs/6301808822
403 error on the Github Release assets upload
https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_FlipClock/actions/runs/6301847922/job/17107796188
error on Github Release asset upload
Error: Input required and not supplied: upload_url
(but assets do show up on the release page successfully)
The first 3 are similar in nature, 403 errors when trying to upload release assets to either PyPi or Github. The 4th is different, but also potentially less significant because in spite of reporting an error the release page does appear to have the appropriate assets listed.
My best guess on the first 3 are something weird with the token(s) or permission(s) within the repo settings or the systems they are interacting with. I could not really find any rhyme or reason about why they might have failed in anything that is visible to me. It's likely we'll need someone with access to the settings page of the repo, or those other systems to take a look for further troubleshooting.
Looks good to me and I got it working! Thank you!
I agree this check is wrong. However, a correct version is needed because the original check is assuming that samples are a single byte. The second check is trying (but failing) to make sure we have enough buffer for two byte samples.
I think it should be output_length_used *= 2;.
Thatβs whatβs in the PR
mooooon clock demo:
import displayio
displayio.release_displays()
import time
import busio
import board
import digitalio
import os
import ipaddress
import ssl
import wifi
import microcontroller
import socketpool
import adafruit_requests
import adafruit_imageload
import dotclockframebuffer
from framebufferio import FramebufferDisplay
from microcontroller import pin
init_sequence_tl021wvc02 = bytes((
0xff, 0x05, 0x77, 0x01, 0x00, 0x00, 0x10,
0xc0, 0x02, 0x...
@slender iron what's my next step when esp32-s3 gives me a safe mode with "internal watchdog timer expired"? This is coming up when I set 90 degree rotation on this unusual 320x960 pixel dot clock display. It might be some "real problem" or it might just be that it takes a long time to fill the display. It is working fine in normal mode (rotation 0 or 180) but not in 90 or 270-rotated mode.
rst:0x8 (TG1WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
I usually add prints to figure out where it is
what routine needs to be called to stop TG1WDT from biting?
that's the interrupt watchdog so it shouldn't be easy to break
I've seen it due to memory corruption
"merely" running for a long time without calling background tasks shouldn't do it?
or resetting the ram/flash pins
I don't think it should
you could try doing the port yield
I think I see something on the stack that might be getting exceeded
yup, there's some confusion about the size of the "dirty rows" array in displayio. this might also affect rotated rgbmatrix & sharp memory displays.
I think "dirty rows" probably just needs to track the first/last rows updated but π€·
interesting refresh pattern
it's refreshing slowly because a rotated OnDiskBitmap is very inefficient .. it fills in irregularly because of the CPU's data cache. The last thing when a draw finishes is to flush the entire CPU cache so the display can fetch the latest data from psram.
neat!
@onyx hinge I'm changing framebuffer display's refresh to match the main display one
it's much saner
Fine by me! it may conflict with the PR I'm about to put in, but we can work it out
yup, np
I am fine having my code improved, every time I look back it's easy to see there were things I didn't understand. Same for after someone who DOES understand goes over my code and helps me. so thanks!
I think its a copy of the older version that I did π
This enables the "hd458" 320x960 display to work, and fixes problems encountered when rotating it.
Also needs https://raw.githubusercontent.com/adafruit/display-ruler/main/display-ruler-720p.bmp on CIRCUITPY
<details>
<summary>Full program for "hd458" display</summary>
from displayio import release_displays
release_displays()
import displayio
import time
import busio
import board
import digitalio
import microcontroller
import dotclockframebuffer
from framebufferio import FramebufferDisplay
from microcontroller import pin
init_sequence_hd458 = bytes((
b'\xf...
Makes sense to me! Thank you!
I ran into this exact problem when using a serial port with visual basic. To fix this DTR needs to be asserted by the host machine. Can you verify that is the case? Once I did that the program began working. Could be worth checking.....
Under "connected:bool" there is a note that describes this problem.
https://docs.circuitpython.org/en/latest/shared-bindings/usb_cdc/index.html
@nhulsey33 Thanks, I was looking for that reference to C# and couldn't find it.
@onyx hinge I think I'm running down a bug you saw with #8056
when you added matrix portal s3
the supervisor memory alloc and free only work if it isn't moved
that's so far out of my brain right now that I'll take your word for it.
we may be able to use some new MicroPython mechanisms instead (split heap?)?
I haven't looked into how it works so I'm not sure exactly what that entails
btw, I see no usages of CIRCUITPY_PARALLEL_DISPLAY except that it's included by default in larger builds
but no boards specifically turn it on
π
I had to rebase this branch so it needs a retest.
CircuitPython version
origin/main
Code/REPL
$ python3 tools/ci_set_matrix.py supervisor/shared/web_workflow/web_workflow.c supervisor/shared/web_workflow/web_workflow.c
Using files list on commandline
Using jobs list in LAST_FAILED_JOBS
::group::Log: changed_files
{'supervisor/shared/web_workflow/web_workflow.c'}
::endgroup::
::group::Log: last_failed_jobs
{}
::endgroup::
Running: conditionally
Building docs: False
Would set GitHub actions output...
This problem was encountered "in the wild" in #8371.
it looks like I introduced it. PR forthcoming after S&T
I think I've been chasing this bug. The short reasoning is that RGBMatrix uses the supervisor to allocate some memory. When it does, it doesn't hold onto the outer allocation object. Instead, when freeing a pointer, it looks up the allocation object again. This only works if the memory isn't moved by the supervisor (which it does.) This leaks supervisor allocations and the crash occurs when out of allocation objects.
I'm working on a fix now.
I'm about to be away for about six weeks so hopefully @tannewt or @dhalbert can provide the necessary review. Thanks for updating the PR!
Testing:
$ python3 ./tools/ci_set_matrix.py supervisor/shared/web_workflow/websocket.c
prints out a non-empty list of boards to build.
Closes: #8441
This just takes the board files and exposes them as an api endpoint. This would allow folks to pull this data down easier. A specific use case is for the Adafruit shop to figure out what boards work with circuitpython easily. If there are other/better endpoints that already exist, we could use those instead. This could work for anyone that needs the board file details though (which don't exist in the files.json or bootloaders.json file).
Endpoint:
circuitpython.org/api/boards.json
Exam...
Ok, now picow uses wifi_reset like how esp does.
Wifi reset meant to reset the wifi, but disconnecting it is the best we can do right now.
With this wifi.radio.enabled = False now also disconnects both STA and AP.
Thanks @jepler. Have a good break!
lomg
I had a similar issue adding a new display that was refreshing portrait mode even while rotated in landscape mode. The init sequence also holds the key to refresh direction., at least with the display I was using. I used openai to read the data sheet and write the init sequence to refresh in landscape mode. Worth a shot?
Sorry, I was vague. After the times 2 you should recheck the buffer size.
What converter chip? I didn't think this board had one.
CircuitPython version
Adafruit CircuitPython 9.0.0-alpha.1-50-gaa0d7aad83 on 2023-09-28; M5Stack Timer Camera X with ESP32
Code/REPL
https://github.com/bill88t/CircuitPython_FTP_Server, current master 53224fdd20302d4005054011b51a45591f3ac0fd loaded onto the board
code.py:
import wifi
from socketpool import SocketPool
from ftp_server import ftp
from supervisor import reload
if not wifi.radio.connected:
print("No wifi")
reload()
pool ...
I'd rather not change this file. The CYW bits are a hack I'd rather not propagate further. Instead, let's model it more like the existing Python IO expander code. Here is an example. It has two main classes, one for the chip overall and one "DigitalInOut" to act like one via the IO expander. The tca9555 module would have these two classes.
Then board can reference the DIO objects. I don't want t...
Thank you for the reorganization. I think it'll help the changes going forwards.
Overall, I don't want to mimic the CYW implementation and pretend to be a microcontroller pin. It isn't. It is much more limited. Ultimately, that'll confuse folks and riddle the core common-hal implementations with special cases.
Instead, I want to mimic the Python-level IO expander libraries that have a chip class and then *-like classes for the pin functionality. Then, any native code you want to use i...
These should be moved to the DigitalInOut-like object because they are for a single IO.
All of these should be on a TCA9555 object because tca_index (I think) is which chip you are talking to. The TCA9555 object should take in the I2C bus it is on and also the device address.
@tulip sleet @onyx hinge should I change how CYW led pin works in 9? I don't think it should pretend to be a mcu pin. βοΈ
@onyx hinge has thought about this a lot more than me
@slender iron a key reason I decided do to the terrible thing I did is so that examples would work
what is the alternative way to toggle that pin, say?
another idea I had was whether "construct a DigitalIO for a pin" could be made into a method of the pin object, so then it becomes natural for different kinds of pins to be constructed "in a consistent way". board.LED.to_digitalio()
Ya, I know. I'm worried about the long term effect of papering over a weird board design decision
I assume the object will still behave like a DigitalInOut instance with value, direction, etc..
Tested articfact Adafruit CircuitPython 9.0.0-alpha.1-52-g034caf701d on 2023-09-28; Raspberry Pi Pico W with rp2040...
Confirmed no regression with web workflow / auto-connect enabled:
β’ after reload or soft reset, station is connected to wifi.
With web workflow / auto-connect not enabled:
β’ connected station is disconnected after reload or soft reset
β’ AP is not active after reload or soft reset
β’ connected station is disconnected and AP is not active after `wifi.radio.enabled = ...
the IO expander class I linked to has a get_pin(#)
maybe we need board.LED()
like board.I2C()
maybe just board.CWY43_LED() or board.CYW43_LED. I would not like to have to introduce this rather odd thing just for boards like this.
ya, that's where I'm at too
basically the CYW43 is an IO expander in this case.
yes that's exactly right
I do like the idea of moving towards "you call a function to get a thing that implements the digital I/O interface" rather than passing the pin to a DigitalInOut constructor.
the normal blink is ```python
import board
import digitalio
import time
led = digitalio.DigitalInOut(board.LED)
led.switch_to_output()
while True:
led.value = True
time.sleep(0.1)
led.value = False
time.sleep(0.1)
It's also worth thinking over how an incompatible change in this area might help with some frequently requested things like more pad control
drive strength, pulls, inversions via a pad object, not via a DigitalInOut object, so that they still work with special functions such as spi, pio, etc
with cyw you could do ```python
import board
import digitalio
import time
led = board.LED
led.switch_to_output()
while True:
led.value = True
time.sleep(0.1)
led.value = False
time.sleep(0.1)
Yes, I was just thinking about this pin vs pad thing
I think you could add functionality for pad settings to microcontroller.Pin objects
just going to look at MicroPython
another Q is how this generalizes to a bus that has more than one line. spi = board.SCK.to_spi(miso=board.MISO, mosi=board.MOSI) ? π€£ π
machine.Pin is basically a "Pad".
I don't think I'd do the callable thing if I could avoid it
if board.LED becomes a DigitalInOut object, how would you PWM the built-in LED on boards that were NOT cyw43-based?
I guess they could be
The same way you would now. nothing changes for most boards
(I'd rather not change everything)
I'd rather just have a different blink for pico w
If it behaves that differently it probably should not be called board.LED, that invites confusion.
thats ok with me
having it be under any other name means you can make it work how you want
I think it can be left up to board designers how they label it
it's interesting, we could have singleton objects for each pin, but have them have state (pulls, etc.)
but agree that .LED is "reserved"
that's what they already are
they just have their object struct in rom and no functions
what's missing when you just have pin singletons, or can set output values via pads, is that you can't track WHO thinks they're using the resource
like, you have two coroutines that both try to blink the same LED
I'm not saying this is a killer problem, but that is a thing that was NICE about the explicitness of constructing a digitalio object
and I thought it was kind of a key distinction of the CP & MP ways
I don't think forcing the output value of the pad is common
it does need to be muxed to a gpio peripheral usually I think
I just mean two chunks of code both doing board.CYW43_LED.value = ..., and I'm (over-)generalizing from that to a new "no distinction between digitalio &pin anymore" world that nobody actually proposed
ah right. that's the danger of a singleton
so we would have microcontroller.Pin.pull = Pull.HIGH, etc. I am off in left field from what you are talking about.
board.CYW43_LED.as_digitalio() at least keeps an explicit step that reads a lot like constructing a digitalio, and could work in the same way as far as actually marking the pin in use
yes, if we want folks to override pull settings
well, people want to set pulls in circumstances we haven't though of, like some people want a pull on an SPI pin, or something
I wouldn't bother with that. board entries can be any type of object and they are up to the board designer
I think this is where you get an issue with "who decides the pad settings"
setting drive strength without adding things to every peripheral object I think is the actual good use of pads
because you may use the pin for something else besides blinking
when a pin was claimed by SPI then that would be prohibited
that's an argument for board.LED() I think
setting the output value or the direction would be prohibited, but setting pull or drive strength would not
it could raise an error if D13 is in use then
I do feel like having at most one digitalio object for a pin is a good feature, it helps when I fat-finger pin names in my code that uses digitalio.
could you get away with not having DigitalInOut's at all?
def __call__(self): return digitalio.DigitalInOut(self)``` basically?
while True: led.value = not led.value```
not even that, direct pin opeations
led = board.LED
pin output is claimed by a functional thing, or it is not
that makes GPIO different than other periphals
but that is kind of the way most chips are
I don't think you'd want that unless IO expanders also separate pad settings from digitalio
someioexpander.D1.pull =
digitialio goes away. everything is on Pin
Pin.Pull, Pin.DriveStrength, Pin.Direction
no, I wouldn't do that
this is all long term, but I think making the CYW43 LED be a special thing with a special name is OK
you can't set value when another peripheral's signal is muxed
right, I would forbid that
enforcing what the hw won't let you do
DigitalInOut also protects against two parts of the code using the same pin accidentally in a way I feel like this wouldn't.
maybe it doesn't matter. removing digitalio would save bytes, too
we have some API's that take dio's and some that take pins
right, because some need native connections internally
yeah I was bothered by that inconsistency when working on my io expander stuff
even things in the core are inconsistent
mostly in the core it's Pin objects though
like in the sleep code, preserve_dios, because it is really preserving the current state
shared-bindings/_bleio/Adapter.c: digitalio_digitalinout_obj_t *cts = mp_arg_validate_type(args[ARG_cts].u_obj, &digitalio_digitalinout_type, MP_QSTR_cts);
shared-bindings/_pew/PewPew.c: digitalio_digitalinout_obj_t *pin = mp_arg_validate_type(rows[i], &digitalio_digitalinout_type, MP_QSTR_rows);
shared-bindings/_pew/PewPew.c: digitalio_digitalinout_obj_t *pin = mp_arg_validate_type(cols[i], &digitalio_digitalinout_type, MP_QSTR_cols);
shared-bindings/_pew/PewPew.c: digitalio_digitalinout_obj_t *buttons = mp_arg_validate_type(args[ARG_buttons].u_obj, &digitalio_digitalinout_type, MP_QSTR_buttons);
shared-bindings/adafruit_bus_device/spi_device/SPIDevice.c: mp_arg_validate_type_or_none(args[ARG_chip_select].u_obj, &digitalio_digitalinout_type, MP_QSTR_chip_select);
shared-bindings/alarm/__init__.c: dios_array[i] = mp_arg_validate_type(dio, &digitalio_digitalinout_type, MP_QSTR_alarm);
shared-bindings/neopixel_write/__init__.c: mp_arg_validate_type(digitalinout_obj, &digitalio_digitalinout_type, MP_QSTR_digitalinout);
```adafruit_bus_device is because it had to follow the existing code style. the rest of these, less sure why.
do you want to preserve more than gpio state?
it's preserving pulls and output state and direction
neopixel_write is just a function so it takes digitalio to have longer term pin claiming