#circuitpython-dev
1 messages · Page 48 of 1
and it is often (but not always) bitbanged
this seems like 10.0.0 or later
I brought it up because of https://github.com/adafruit/circuitpython/pull/7440
I wouldn't wait until 10 for that
I could see us changing C code that makes digitalinouts internally to take them in in addition to pin
fourwire chip_select is a good example
DigitalInOut as a protocol
but if we made it such
I'm thinking the python duck typing sense
right now duck typing in C is kind of painful, though, would you say?
lookup switch_to_output on the given object and value
you have experience from displayio
I'd rather support python implementations of digitalinout at the same time
an internal protocol restricts you to native implementations
yes, that's the distinction I was looking for
only native implementations can run outside the VM though
so native code that runs outside the VM needs to 1) lookup well know names and 2) check to see if it is a native implementation
So, I'm pushing the pimoroni expander PR to match the style of a Python library and we'll expand internal APIs they want to use so they do the name lookup they need
i would worry a little bit whether doing this is going to impeded "pad" in the future
how so?
+ MP_PROTO_IMPLEMENT(MP_QSTR_Pin)
+ .switch_to_input = mcu_pin_switch_to_input,
+ .switch_to_output = mcu_pin_switch_to_output,
+ .set_value = mcu_pin_set_value,
+ .get_value = mcu_pin_get_value,
+ .get_pull = mcu_pin_get_pull,
+ .get_drive_mode = mcu_pin_get_drive_mode,
+ .get_free = mcu_pin_get_free,
+ .claim = mcu_pin_claim,
+ .never_reset = mcu_pin_never_reset,
+ .reset = mcu_pin_reset,
+};
+
const mp_obj_type_t mcu_pin_type = {
{ &mp_type_type },
.flags = MP_TYPE_FLAG_EXTENDED,
@@ -90,6 +154,7 @@ const mp_obj_type_t mcu_pin_type = {
.print = shared_bindings_microcontroller_pin_print,
MP_TYPE_EXTENDED_FIELDS(
.unary_op = mp_generic_unary_op,
+ .protocol = &mcu_pin_proto,
)
};
```using a protocol was what I was doing in the branch I started, fwiw.
i don't know, just worried the API generalization is going in the wrong diretcion
I'd rather not use a protocol
is there a solution to the i2c bus locking problem?
of i2c bus extenders specifically
code that uses the digitalinouts needs to handle errors when setting values
I think that gaming out what that looks like for a complicated case like KeyMatrix would be informative.
displayio already skips a refresh when the bus is locked
are there any boards that use keymatrix and an IO expander?
I don't think we should convert all things that take in pins to dios
it's not possible to have a row or column pin be on an IO expander right now of course
there are some user-defined keyboards that use such a matrix, not sure they are the greatest design
latency, etc
I don't think it is a "good" use case in the sense that you'd want to encourage it, but it's an approximate worst case because it involves background tasks and potentially a whole pile of pins. say your worst enemy puts 4 row pins and 4 column pins on each of two I/O expanders, just because they could ..
if they are dedicated i2c busses then it works fine but slowly
if not, it skips when the bus is locked by user code
(but also a reason to add a bulk pin read/write api)
(qualia has keys on an io expander but it's just 1 pin = 1 button, not a matrix. but having those work with keypad.Keys sure would be nice!!)
personally I'm worried it will further slow down displayio
https://github.com/adafruit/circuitpython/issues/6445 (keypad.TouchPads)
https://github.com/adafruit/circuitpython/issues/8316 (allow ducktyping for keypad, basically)
https://github.com/adafruit/circuitpython/issues/7919 similar generalizations for keypad
only the use of an io expander would I think
my impression is that you've thought about this stuff a lot (including maybe some more wacky ideas from half an hour ago here), and also know how they compare with MicroPython, etc. Interested in what you think about duck-typing of dio, adding a "pad" concept or making it possible to set strength, pulls, etc. on a Pin, etc.
and you have experience teaching folks to do pin io of various kinds
I haven't been following this recently, because of lack of time, and to be honest all my previous thinking didn't bring me any closer to a solution I could recommend. It's a difficult problem and there are going to be tradeoffs.
i understand, thanks, some ideas enable one thing but make other things harder or more obscure
for keypad specifically, I would prefer a separate class for an expander, that makes use of the interrupt pin on that expander, instead of doing constant scanning like the native pin version (even for the native pin one I wanted to switch to use pin change interrupts eventually, I just didn't have the knowledge to do it)
waiting for i2c transactions inside a timer interrupt is just too miserable
though I have one trick that I'm trying to use for the touch keypad, where I start the transaction in one tick, and instead of waiting for the result, read the result in the next tick
but that ties up the adc
for i2c it would lock the bus
and one tick might still not be enough
yes, maybe a lightweight fast keypad scanner is at cross purposes to dio duck-typing for keypad. And the expanders can have different ways they work and you don't want to support them all in C
support for C code in mpy might help with that
that's a cpu architecture nightmare though
yes, and several other nightmares besides
😄
especially the way it's done in MP with that function array
Greenspun's tenth rule rears its ugly head
I wonder, if the expander version of keypad just took an INT pin, and a python function to call when that pin triggers...
of course it would have to be the "soft interrupt" mechanism from MP
could, but calling back out to python has its issues, gc latency, etc
yes, but you would only do those those calls once per keypress, which is not that often
so the python function would read the expander and then pass the result back to keypad, where it would be turned into events?
yes, precisely
suppose you had an API to stuff events into the EventQueue instead (or some other kind of event queue generalization).
sure, doesn't matter if you do it explicitly with a return value or by side effects
would an asyncio task waking on the interrupt pin be good enough, or it really has to be pre-emptive?
event queue would be generally useful anyways
yeah, I felt bad the EventQueue was so limited, but everything had to fit on small boards
so a python implementation of keypad using asyncio?
but then the users have to use asyncio
it feels like we need an RTOS :D
implementing soft interrupts is not on our list now
so another possibility
make bitbangio work with python implementations of DigitalIO, and make bitbangkeypad and a bunch of other such modules, as needed
possibly in python even
possibly using asyncio
that is interesting, again doing duck-typing in C (if bitbangio is in C). Would be interesting to try to write bitbangio.I2C in Python, would the timing ever work out?
yeah, SPI and I2C not a problem
doing uart over an expander is a next level of challenge
no one has asked for that 🙂
RP2040 PIO
I wonder how it could be documented to make it clear what is possible and what not
are there expanders with PIO?
i mean control the expander with PIO for time-critical things
PIO is replacing C code you have to link in
well, you can always do inline assembly
i will leave that to MP 🙂
even with pio you still have to feed/drain the FIFOs
expanders kinda are that
what if there was only one officially supported expander, and it was seesaw?
imagines the people queueing with torches and pitchforks
wouldn't fly, and that's lock-in (though other people could clone seesaw)
aren't all expanders kinda similar in how you communicate with them, though?
you just read a register and the bits are the states
so if the c code for supporting the expanders let you specify the register address, you would already support most of them?
i don't know, they may have special "features"
maybe we should do a survey of the most common ones
I imagine most of the special features would be handled in the initialization, which would be in python
kinda like displayio lets you specify the commands for pixel operations
that is an interesting idea
This is the approach jeff took for the spi init over i2c io expander code
make just enough configurable
I wonder if we should move to a permanent heap + split MP heaps
I'm looking at this rgbmatrix code and thinking about the complexity of moving things
if we do permanent heap + split heap, then we can promote blocks from one to the other
the permanent heap is in the latest merge; I forget what it is called but it seemed straightforward
I'll find it
Multi heap I think
The more I think about it, the r more I think it’s best to it’d allow us to allocate non mp memory while mp is running
And that’s why we end up having to move things
Could do multiple displays then
found it, it's gc_never_free() which is already in main from the v1.19.1 merge. It keeps a linked list list of permanent_pointers, and marks these as used when gc starts
so you just alloc from the heap normally and then gc_never_free(the thing)
so it fragments the memory
yes, but if you alloc the permanent stuff first, it will be contiguous heap allocs
and you can alloc in multiple different heap areas if you want
so it would be for things like the reserved memory on the esp32?
@tulip sleet I think that only lasts the lifetime of the MP heap though
that is true, sorry
The TX pin is on the header. There's no RX pin, though. I can remove this if it doesn't make sense.
I don't usually set CONSOLE for that. DEBUG=1 will enable IDF output to the pin anyway.
Thanks for your review. It seems we have different philosophies when it comes to the implementation of this IO expander.
To me the IO expanders are an implementation limitation of the product, due to the RP2040 not having enough native IO for the functions we needed. As such this PR is geared towards abstracting their existence away, like how was done for CYW. Now, I understand that the CYW support may have been hastily added and thus should not have been used as a template, but the result...
with split heaps that grow on demand we could run two MP VMs at once
Setting the console will block its use from other things. If RX isn't pulled down, it could cause spurious input chars into CP too.
Thanks for your review. It seems we have different philosophies when it comes to the implementation of this IO expander.
To me the IO expanders are an implementation limitation of the product, due to the RP2040 not having enough native IO for the functions we needed. As such this PR is geared towards abstracting their existence away, like how was done for CYW. Now, I understand that the CYW support may have been hastily added and thus should not have been used as a template, but the ...
I wonder if we could make a special never-free heap that lives across VM's.
and you are forbidden from allocating regular objects in it. (The API is not ideal for that right now.)
in amelia
Would that possibly make all the display allocations easier? I know Framebuffer (or one of those) has a lot of if statements to ensure things persist across restarts
I don't think it's a better user experience when one tries to use the pin for something it isn't meant to work with. It only works with digitalio and therefore should just act like digitalio.
So you're suggesting that rather than having a TcaPin object, since it can only do IO it should skip that step and be a DigitalIO object from the outset? FourWire and such would then accept that for any case, without specifically needing to know about that pin type?
To be fair, this feedbac...
yup!
and I think remove the hard coded limit
That would be useful. Dealing with that for the IS31 was the hardest part
👍
I tried simply increasing the gifio width (conditionally on espressif) but I got hardfaults with the gif I tried to use 😦
CircuitPython version
Adafruit CircuitPython 8.2.6 on 2023-09-12; Adafruit MatrixPortal S3 with ESP32S3
Code/REPL
import board
import displayio
import framebufferio
import rgbmatrix
import busio
import digitalio
uart = busio.UART(board.TX, board.RX, baudrate=115200)
uart.timeout = 0
print("Initialized UART")
displayio.release_displays()
matrix = rgbmatrix.RGBMatrix(
width=64, bit_depth=4,
rgb_pins=[
board.MTX_R1,
...
add support : gifio
fix some errors
Hi, issues posted here are for issues with the website. For help, I'd suggest posting in the support forums at https://forums.adafruit.com/ or chatting via discord at http://adafru.it/discord
With firmware CYW43 bluetooth firmware blobs, BTstack, and a skeleton implementation of _bleio in place flash grows from 85.7% to 88.14% and RAM from 40.14% to 44.35%. This includes both BLE and Wifi support.
I'm filling in functionality by cherry picking existing code wherever possible, otherwise writing new code. My method is adding to the port's _bleio one function at a time, testing, and then moving on.
No blocking issues at this time.
what's the general plan for updating or supporting older code for this?
(displayio.Display change)
@WoutStandaert does it happen every file save? #8294 is intermittent hard fault on save. When it doesn't hard fault the program runs normally fine. I'd say every 4th-5th file save it hard faults on save. If it hard faults on every save for you using UART that might be different because I only tested the RGB matrix capability.
@DJDevon3 At first there was no issue, as long as I stayed away from UART. Only when I added UART it crashed every time yesterday on save. I had to do a power cycle every time because the reset button wouldn't get out of safe mode either. Today it seems every one in two times. Not sure what's different today. The crash is sometimes so severe that I have to drag the UF file back on the disk because the drive is showing up as matrixboot.
I thought I went through the learn guide code and fixed these.
you could check the repo
@tulip sleet thanks. sry. i'm playing catchup on this change. looking now...
OK, looks like this was not done yet. See https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/2429 for example
I must be remembering something else
this can wait until we start releasing 9.0.0 releases, not sure how long that will be
Do we want to provide commented old version for some period of time for people that are still using <= 7.X versions?
curious about this as well
I think in most cases people are using 8.x. We haven't stopped building 7.x bundles yet. There are few things that are unfixed regressions from 7.x to 8.x, but not many.
Commented-out code is yet another thing to explain in the learn guides, so I would be inclined not to do that.
so idea is to just change all code to display.root_group = and then tell people to update to CP 9?
update to CP 8. it's available in 8
ok. just grep'd the learn repo and doesn't look like anything has been updated.
there are a lot of .shows due to NeoPixel, so it may be a bit of sifting
$ grep -r "display.show" | wc -l
298
welp 🙂
do you want to take this on? @slender iron @onyx hinge think it's time to get rid of the .show()s?
apologies if i've missed a bunch of this being discussed in the weeds already
np, it wasn't discussed recently. I think it kind of fell off the radar.
started looking into this due to a feedback comment on the displayio guide
i'll def update that
and i'mthinking discuss both, with mention of versions where it changes, etc.
just in case there are people stuck using older CP versions for some reason
sounds good, if you'd like to do that. show() was really misleading, because it didn't cause anything immediate
i think jeff and scott are afk today. i'll try and make the monday meeting and bring this up in the weeds.
for the bundle we usually have a final zip of things for an old version
ya, I think it's ok to remove in 9
@tulip sleet do you think I should PR these rgbmatrix fixes to 8.2 or main?
(I am)
This prevents leaks but not all use-after-free issues.
@midnight ember ☝️ will hopefully fix your rgbmatrix safemode issues
Hopefully fixed by #8446
I'm not the only one. Just the only one with 12 panels to my knowledge. If you're gonna test go big? 😅
I think Melissa and others have run into the same issue even with 1-4 panels.
Which version should I install to get that update?
or is this slated for 9.0?
I'm going out of town tomorrow and will be gone for 2 weeks. Will have to revisit it when I get back.
Thanks for the updates!
Awesome! That looks much better. Thank you!
I don't think it's a better user experience when one tries to use the pin for something it isn't meant to work with. It only works with digitalio and therefore should just act like digitalio.
So you're suggesting that rather than having a
TcaPinobject, since it can only do IO it should skip that step and be a DigitalIO object from the outset? FourWire and such would then accept that for any case, without specifically needing to know about that pin type?
Yup! Exactly. Any pl...
The PR is on 8.2.x. Once the CI finishes, there will be artifact builds available on github.
Looks good - one style request.
Could you #define this sentinel value with a descriptive name in one of the .h files?
Use sentinel value name instead of magic number.
I could be wrong but I think artifacts are only available to team members. Only way I can grab a build is via the S3 bucket or build it myself using the 8.x main repo. Leaving in a few hours to the beautiful smoky mountains. ⛰️
You should be able to get artifacts from a build. Go to any particular board build, click Summary at the top of the left sidebar, and then scroll down on the summary page to the artifacts list
@tannewt Does the RO2040 Nano support Circuit Python over the web workflow or is that like an ESP32 thing? A friend just got one and we've been struggling to get REPL working over the web workflow.
CircuitPython version
Adafruit CircuitPython 8.2.3 on 2023-08-11; Teensy 4.1 with IMXRT1062DVJ6A
Code/REPL
import adafruit_bno055
import busio
# Initialize the IMU imu_sensor
imu_i2c = busio.I2C(board.SCL, board.SDA)
imu_sensor = adafruit_bno055.BNO055_I2C(imu_i2c)
last_val = 0xFFFF
def temperature():
global last_val # pylint: disable=global-statement
result = imu_sensor.temperature
if abs(result - last_val) == 128:
re...
@atomic summit advised me to post the following here: Today I flashed the latest CPY: Adafruit CircuitPython 9.0.0-alpha.1-50-gaa0d7aad83 on 2023-09-28; FeatherS3 with ESP32S3. The command: 'import feathers3' caused the error: File "feathers3.py", line 23, in <module>. ValueError: Invalid pin, while line 23 is: # Setup the BATTERY voltage sense pin vbat_voltage = AnalogIn(board.BATTERY)If I issue from mu-editor V1.2.0 REPL the commands import board followed by dir(board) then among others appear: BATTERY, VBAT and VBAT_SENSE, so how I can get an 'Invalid pin' error
Thanks Paulsk 🙂
I don't have a board here at home to test with atm, but I'll be hading into the factory later today, so I can also test this across my other boards, but it sounds like the move to IDF 5.0x has done something weird with IO assignments.
Invalid pin in this case means that the pin in question cannot be used as an analog pin
so either the pin references got mangled, and that no longer refers to the pin it was supposed to, or maybe the ADC needs now to be explicitly enabled first, or something similar?
disregard this board.STEMMA_VERTICAL_I2C() issue. I have to do further checking.
sounds like the pins are mixed up allright
thanks @stuck elbow
web workflow is supported on ports with native wifi... that's ESP32 variants (as the main MCU), and Pico W
CircuitPython version
Adafruit CircuitPython 8.2.6 on 2023-09-12; Adafruit CircuitPlayground Express with samd21g18
Code/REPL
# Write your code here :-)
print("Hello World!")
Behavior
Code stopped by auto-reload. Reloading soon.
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
OSError: [Errno 5] Input/output error
Code done running.
Description
- Error on e...
CircuitPython version
Adafruit CircuitPython 8.2.4 on 2023-08-22; Adafruit Feather ESP32-S2 TFT with ESP32S2
Board ID:adafruit_feather_esp32s2_tft
Code/REPL
numbers = [1, 2, 3]
new_numbers = [0, *numbers, 4]
print(new_numbers)
# Expected output: [0, 1, 2, 3, 4]
Behavior
Traceback (most recent call last):
File "", line 1, in
SyntaxError: *numbers must be assignment target
Description
Different behaviour between CircuitPython and Pyt...
Actually now when I thiunk about it, maybe it should be labeled as a feature insted of bug.
I always have a hard time finding Artefacts.
Because I know they should be there, I keep clicking and finally get them, or a zip containing all the language for a board. Still I can never remember the path, I'll try with your hint next time I need it.
The spread operator does work in {Micro,Circuit}Python but I think only as arguments to functions, not in list constructors, e.g.
numbers = [1, 2, 3]
def print_me(a,b,c): print("hi:", a,b,c)
print(numbers)
The operating system shouldn't matter for code running on the board.
What IDE or editor are you using? Is there a safemode.py file or a boot.py file?
I marked this as "enhancement" as well as "third-party". If Micropython ever implements this Python language feature we'd get it with some future merge; otherwise, it's not likely to be prioritized by adafruit folks.
Looking at the quirc library that is used internally by qrio, I found that the library also returns the positions of all four corners of the QR codes it found, but that information is not passed on to the Python object returned.
I wonder if there would be a simple way of somehow adding an option to get that information. That would allow projects that have a moving camera to center on the QR code, and even to calculate a rough position relative to the QR code, similar to how one can do it w...
One way to do it is to add a positions argument to the decode method, that would default to False, and that, if set to True, would make the call return a list of 6-tuples, instead of pairs.
Another way would be to add an additional method, such as get_positions (or a property called positions) that would return a list of 4-tuples with the positions corresponding to the list returned by the last .decode() call. It would return an empty list if there was no call previously. A p...
Visual Studio Code shows an error and the main.py file is empty.
Using the macOS TextEdit program works for me.
As you may imagine, the API was designed to be as simple as possible.
Maybe the extended API would have:
- QRDecoder.analyze() which feeds the pixel data in and returns a list of 4-tuples (quirc_begin() ... quirc_end())
- QRDecoder.extract() which, if it's given an integer, does the decode & extract from the previously analyzed image
this would leave .decode() as analyze() + looped extract().
Alternately, if this is about avoiding the attempt to decode an "obviously too small" co...
Ive tried, VS Code and Mu, it seems like the OS is delaying the write of the file or writing to it more than once and one of those writes gets the error 🤷♂️
I could disable auto-reload but that is not the same experience when using Windows or Linux
Hello @dhalbert, I am looking forward to contributing to this issue. The following changes are proposed after reading your previous comment and @muranyia's comment.
sumitra@sumitra:~/opensource/circuitpython$ git diff
diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c
index 24df2b2d1..669b85c5f 100644
--- a/shared-bindings/rotaryio/IncrementalEncoder.c
+++ b/shared-bindings/rotaryio/IncrementalEncoder.c
@@ -35,7 +35,9 @@
#inclu...
It seems like the problem was discovered on Sonoma beta not long ago:
Also with auto-reload: off the error is there for me and others:
@heygauri Thanks for your proposed change. You are welcome to submit a PR.
To make the doc more precise, I would say "It assumes that the encoder's common pin(s) are connected to ground,and enables pull-ups on pin_a and pin_b.
Thanks for finding this. To encourage Apple to fix this, we suggest using the macOS Feedback Assistant tool to file a clear problem report. Having a number of feedback reports may have helped fix the UF2 problem encountered in early Ventura: https://www.raspberrypi.com/news/the-ventura-problem/
How does a CIRCUITPY drive present differently than an SD card or flash drive?
@heygauri Thanks for your proposed change. You are welcome to submit a PR.
To make the doc more precise, I would say "It assumes that the encoder's common pin(s) are connected to ground,and enables pull-ups on
pin_aandpin_b.
Okay. Thank you for the feedback.
Former Core OS engineer here. Could you get a trace of Mac initiated I/O to the SD card leading up to the I/O error? Is this an Intel or Apple Silicon machine?
Update the documentation in circuitpython/shared-bindings/rotaryio/IncrementalEncoder.c to explicitly state that rotaryio.IncrementalEncoder assumes the encoder's pins are connected to ground and sets pull-ups on the pins accordingly.
Closes #5847
@lone axle are you able to host the meeting today? just checking to make sure
Yep, nice timing :). I'm Moving over the newsletter items and stats now
Hello @kevinjwalters, I'm eager to work on this issue, but I'm unsure about the testing process for the proposed changes. Could you please provide guidance on how I should test the above modifications?
Apple maintains an OSS version of MacOS called Darwin. Corresponding to the release of Sonoma, there is an update to msdosfs to version 608.0.3, the project can be found here msdosfs. The source file of interest is msdosfs_fat.c.
My best guess is that 608.0.3 is initiating a write outside of the CP filesystem's flash extent....
<@&356864093652516868> The weekly meeting will occur here on Discord in the #circuitpython-dev channel in about 1 hour from now. Please add your notes to the document: https://docs.google.com/document/d/12JEwXvIK4qXQrW0834d0OvcB_UJrkzvz7ZYyqQ8iLmg/edit?usp=sharing We look forward to hearing from folks during the meeting!
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
Adafruit CircuitPython 8.2.6 on 2023-09-12; Adafruit Feather M4 Express with samd51j19
Code/REPL
na
Behavior
synthio doesn't appear in the built-ins list for Feather M4 Express
Description
Not sure if there's a reason synthio isn't on Feather M4 Express be or just a simple omission? Looks like it is built in on ItsyBitsy M4.
Additional information
No response
@mortal kernel I saw your not about seeking BLE and WIFI examples in the meeting notes. For BLE this repo has a handful: https://github.com/adafruit/Adafruit_CircuitPython_BLE/tree/main/examples You can also search on Github for other repo's named like Adafruit_CircuitPython_BLE_[something] for various other higher level libraries that are made to interact with different things which will also contain examples/ directory. For WIFI, my goto test scripts are the ones in the examples/ dir in the Adafruit_CircuitPython_Requests, and Adafruit_CircuitPython_MQTT repos.
Sorry skipping the meeting without notes.
No CP this week, I am still running and testing the Teddy Ruxpin code from Limor and Jepler. The image part of the code is incomplete or not working. I want to work on the eyes animations and that is not covered fully in the published code. It requires understanding of PIL and potentially NumPy to process the images. Also the code is object oriented with a lot of decoration... not the kind of Python I usually do on microcontroller.
I was able to build the Feather M4 express locally with synthio but there was mere bytes remaining.
Quickly looking the ItsyBitsy M4 does not include audiobusio (as the SAMD51G does not have I2S) so it likely has more space.
So it may be able to be just squeezed in but then the next core change that affects all builds would cause an issue.
It looks like this was the commit where it was turned off: https://github.com/adafruit/circuitpython/commit/23baf02399f02f9d4a9fecab2ec9cdc974aacee5
The message on it does reference not having enough space.
It might be it does fit on the English build, but does not on one or more of the other languages.
How does a CIRCUITPY drive present differently than a (small) SD card or flash drive, or are those broken too for equivalent FAT12 or FAT16 devices?
It doesn't necessarily. But FAT12, for instance, is not supported on Android. And those may well be broken in the Sonoma beta
October is Open Hardware Month, and we welcome Sid Drmay to tell us everything the Open Source Hardware Association (OSHWA) is planning! Returning guest Ayes...
Please subscribe and tell everyone they might wish to do so too
cpnews@adafruit.com is best
We have posts marked Hacktoberfest
@gilded cradle got a link to that page for eink markings?
I have monkeys and large reptiles as neighbours, and can't recommend coding inside a forest 🙂 <3.
I've got a Circuit Playground Express handy. Just need to update a machine to Sonoma and I should be able to reproduce this bug and get some diagnostic data.
Circuitpython LTS? :p
Thanks everyone
Here is the notes document for next Tuesday’s CircuitPython Weekly meeting. It is at 11am Pacific / 2pm Eastern here on Discord, on Tuesday instead of Monday due to a US holiday. 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/1ghZq1dOYCZS5ptTj100rZ955xsZ209iXcma8Xd81unU/edit?usp=sharing
CircuitPython Weekly Meeting for October 10, 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 par...
ah I see, thanks for looking into it @gamblor21 @FoamyGuy Is it ever the case that people could somehow make a leaner build of the built-ins in order to accommodate the stuff they want? For example, floppyio might not be part of someone's audio project where the do want synthio
@jedgarpark I do think it's possible to create custom builds and enable / disable any core modules that have build flags. It would require modifying the mk file for the board you're building and then making a local build with the process documented in this guide: https://learn.adafruit.com/building-circuitpython
Alternatively there was functionality added so that custom builds can be created inside of Github via an actions task rather than having to do everything locally. I don't have any ...
My guess is delayed write. I see this occasionally with Linux too. I run sync from the command line and then the next reload works as expected.
@tannewt there are still a lot of strings left, but I want to work on it in the coming weeks 😉
Since synthio has improved significantly, we should try to enable it for SAMD51s. Generally newer modules don't get added to older devices that are out of space.
@tannewt Does the RO2040 Nano support Circuit Python over the web workflow or is that like an ESP32 thing? A friend just got one and we've been struggling to get REPL working over the web workflow.
RP2040 Nano is not supported because it is an RP2040 connected to an ESP32. (We call this an airlift for adafruit products.) We are moving to a single core solution with ESP. So, I don't expect we (Adafruit-funded folks) will ever add it.
I'll chat with ladyada and see if I can spend a bit of time on our qualia board with the io expander. That'd give you a model for how to do it.
That would help immensely! Thank you
Unfortunately, I won't be working on this anytime soon. I'm still happy to advise if you find the time to further modify this code.
My guess is delayed write.
We will see! Sonoma just finished installing, I've got Playground Express REPL on UART, and I'm dropping some diagnostic prints in now.
The Template Engine library that was discussed during the weeds recently is all pushed into a repo and I believe it's ready for initial realease / adding to the bundle. https://github.com/FoamyGuy/Adafruit_CircuitPython_TemplateEngine
I'm not sure what the right process is for getting it's real repo created. I think github has a "transfer repo" feature, or if someone creates a new blank one we could push the initial code into it from this one. I think it needs someone with access to the org on Github in order to do that part. If anyone that does have access to do that gets a moment I'd appreciate help with that, let me know if there is anything further on my end to do as well.
I found an issue to split epaperdisplay from displayio
any opinions about it being epaperio or epaperdisplayio?
Is the functionality basically the same? That is if the epaper version looks/feels the same as displayio i like the epaperdisplayio name more personally and will likely help direct people to the right place. But given there is no other epaper module probably does not have a huge impact either way.
ya, I think the idea is to move the EpaperDisplay class to it
may be worth splitting the regular Display out too
in 9.x we'd put them in the old place too
If Display may also get moved out a convention where displayio stands as the main module and epaperio or displaydriverio? or something become the displays. Like all the display like modules have the same convention (if I'm making sense)
Thank you for this work! Will get it in now so that all 9.x alphas have it.
maybe displayio becomes displaycore to match audiocore
Hi, thanks for following up. I have one requested change and some things that I'd like to understand better.
That makes sense to me. Having a clear this is the drivers to display different tech vs here is the common items works well.
We should go further with this as we have more boards with displays that aren't supported by displayio.Display(). (Dotclock displays use FramebufferDisplay for example. We should split displayio.Display out as well as Epaperdisplay.
displayio.Display support LCD and OLED displays that have driver ICs with onboard framebuffer RAM. We should rename it to reflect that.
Also, should we split out the different display busses as well?
@anecdata @tannewt Appreciate the context and information!
Very new to hardware, and community help has been very helpful.
Have a great week ahead!
This removes .show() in favor of .root_group = . One other spot for I2CPeripheral removed too.
As discussed in the weeds a few weeks back, a board specific simpletest script.
I did the Feather ESP32-S2 TFT and made the script illustrate the usage of:
- displayio
- wifi / requests
- LED blink
- Neopixel rainbow cycle
- Button input
I'm interested if anyone has ideas about what else should (or shouldn't) be included in the simpletest script. I wanted to try to feature the built-in hardware as best as possible without making the script overly complex.
One idea I had but di...
displaycore exists as a concept in the core I think. I'm not sure if I understand how you mean to change the names, but if the python / user facing name becomes displaycore and there is still that concept inside the core that is different from what the new name in python code would be referring to I think it could be a little confusing.
if that existing concept is being exposed under it's own name that makes sense to me, though I'm not sure if that is what you mean.
maybe the confusion isn't so bad either, it's only really applying to someone whose mucking about in the internals of the core anyway so I suppose they're already dealing with different concepts under similar names in a few other cases.
I'm not sure exactly what would stay on displaycore but the idea is that it'd include the internal display core stuff
Curious if a new displaycore module would have Bitmap or Gifs or could you even go as far as a _displayio module that underpins it all (just spitballing ideas not sure if this is good / bad)
I think I'm for splitting it anywhere we could save code space by disabling
I don't always get the I/O error, but I always see two consecutive soft reboots whenever I save code.py, so it looks like @tannewt 's guess is correct. Sonoma is writing after a delay.
The delay is fairly long, on the order of 10 to 20 seconds. I can see one shot of writes when I save the file, the delay, then the remaining writes:
flash_write_blocks: block_num=42, num_blocks=1
flash_write_blocks: block_num=43, num_blocks=1
***delay 10 to 20 seconds***
flash_write_blocks: block_num=2, num_blocks=1
flash_write_blocks: block_num=3, num_blocks=1
flash_write_blocks: block_num=4, num_blocks=1
flash_write_blocks: block_num=5, num_blocks=1
flash_write_blocks: block_nu...
This behavior makes macOS more like Linux and Windows. It would be interesting to see if there is also a delay with a regular USB stick, that is, if you do a write and then pull the stick within a few seconds, does it lose the write and/or corrupt the file system?
Hmm, build failures - not sure what is different from before.
The workaround above is far from ideal as it needs to be repeated each time the device is plugged in to the Mac's USB port or for any other operation that causes MacOS to remount the CIRCUITPY filesystem. /etc/fstab is a dead end, Sonoma appears to ignore it for at least USB filesystem mounts. There's a huge amount of variability in the delay, I've seen it as low a 3 seconds and as high as 25 seconds, so increasing CIRCUITPY_AUTORELOAD_DELAY_MS to 30000 mS is probably not a good option....
This behavior makes macOS more like Linux and Windows. It would be interesting to see if there is also a delay with a regular USB stick, that is, if you do a write and then pull the stick within a few seconds, does it lose the write and/or corrupt the file system?
I'd expect it to behave as you describe, it's getting late so I'll write this up and try the stick in the morning. The issue for Sonoma is not that the writes are delayed, it's that once the writes start it's reasonable to exp...
I'll chat with ladyada and see if I can spend a bit of time on our qualia board with the io expander. That'd give you a model for how to do it.
That would help immensely! Thank you
Unfortunately, I won't be working on this anytime soon. I'm still happy to advise if you find the time to further modify this code.
Thank you for letting me know. I'll resist this post launch
This may be mooted by the split heap code we'll take from micropython.
Yes, in this work there's a moment where the heap is deinited, but "supervisor allocations" are still live. Immediately after the heap is reinited, the supervisor allocations are then marked in use by magic / layer violation.
I ran this successfully on a Feather ESP32-S2 TFT and confirmed .root_group = is working as expected and show() no longer exists on Display.
I can try on rgbmatrix / framebuffer and eink but it will not be until later on tonight.
There was a bug, and related to the Silabs supported boards we changed the system clock from 39MHz to 78MHz
This should be suitable for forward and reverse display versions of the ESP32-S2 and ESP32-S3. We may want to list the targeted boards explicitly somewhere.
The writes can be both data writes to the individual files, and also filesystem metadata updates to the FAT. On Windows, the delay was considerably worse on FAT12 than FAT16 and larger. It appeared to be a relic of floppy disk support, to avoid spinning up the disk or wearing it out with frequent writes. See https://github.com/adafruit/circuitpython/issues/111. Supposedly this was fixed at some point in Windows 10, but I haven't had a chance to verify. On Linux, there is a delay for caching r...
@dhalbert That's interesting. Casting about the web, I've found problems reported on versions of MacOS prior to Sonoma. Camera SD cards were getting corrupted, the root cause being removal of the card without dismounting. The posters were looking for a solution that would force noasync when the card automounts, but could never find one. In an earlier post to this thread I tried unmounting the Express and then remounting it with noasync specified. The delay between groups of writes went aw...
@dhalbert Ran the experiment pulling a USB stick after a write:
- Created a 32M FAT12 filesystem on a USB stick
- Wrote the canonical
code.pyto the stick and verified - Mounted the stick on Sonoma and opened it as a folder with VSCode
- Edited a minor change into
code.py - Saved
code.py - Counted one potato, two potatoes and pulled the stick
Wound up with a zero length code.py and without the expected .code.py metadata file.
@eightycc Thanks for testing. If you have a machine that's still running Ventura, it would be interesting to compare. Or maybe someone else can repeat the experiment. I have some but won't have access to them for a while.
@dahlbert Under the covers what's going on is that MacOS copy-on-reads blocks of a file into virtual memory and backs that memory with an unallocated area of the underlying filesystem. Writes become stores into virtual memory, triggering immediate page-outs to the filesystem. Because the filesystem mount flags include MNT_ASYNC, updates to the FAT and the metadata file are deferred until a timeout mechanism forces a flush. This is why pulling the stick results in a zero length file, the fil...
Thank you @bergdahl @lynt-smitka
I think @dglaude was interested in this too.
I think it's important to note that the IOError is temporary and recoverable as long as you don't reset after it.
This got me thinking that if
autoreloadwere to trigger selectively on just writes to the FAT (probably just two on such a small file system) this would eliminate the I/O error at the expense of a delayedautoreload.
That's a good idea, and we've thought about that in the past. But weren't sure that the FAT is the last thing written on all operating systems. The writes on Windows seemed to be a in random order sometimes. Also, writing data files that are in use could cause the progra...
It didn't build before either. I pushed a fix but will need to PR it to protomatter first before this can be merged. Using the CI here to make sure everything is fixed.
hi I had the same issue and thought I leave my rough step dir pio here.
this pio is able to vary step frequency and endposition while stepping. So one does not have to wait for it to reach its target.
the current setup is a 32bit input with a delay in the 21msbs and an endposition in the 11lsbs.
Like eg. Delay of 100 and endpos of 100 (1100100 bin)
000000000000001100100 00001100100
suboptimal limits and quirks; for once I tried to keep the step period constant, with label `compe...
Also, should we split out the different display busses as well?
That makes sense because paralleldisplay is already split out unless it would be more overhead.
Also, writing data files that are in use could cause the program to read bad data or cause program errors, though that's not as common as updating the program files.
Yes, that scenario is going to fail hard with MacOS, and probably with Linux and Windows too! Sharing a filesystem has lots of pitfalls, and this is clearly one of them. The producer and consumer do need some sort of locking, signaling and synchronizing mechanism to make sharing through the filesystem safe.
Can we use busdisplay instead of externalframebufferio?
I had imagined there being duplicates in cases where the hardware is similar enough to use the exact same script. I don't know how many cases like that there are, I'm open to other ideas on how handle them.
Is it possible in a git repo to check in symbolic links? so this file could exist in one place and then be linked to elsewhere to have a sort of "shadow copy" exist there?
I did not anticipate that the same simpletest would fit many board, and that simpletest proposal would start to appear so fast.
One think I wanted was to have the first few simpletest "perfect" to be used as template for other, and I was thinking that maybe some automatic generation would be possible to avoid copy/modify/paste human activities.
I did hope that this one could be a good starting point as inspiration for others. I'm open to any feedback on it. I do think the built-in hardware on a given device will factor in heavily to it's simpletest so there will be some parts that aren't as re-usable between different devices.
Some kind of automated generation would be neat, but I'm not opposed to sourcing some of it it from human activity. It gives us the opportunity for some new "good first issue" type things that people with l...
Is it intentional that rgbmatrix raises ImportError: no module named 'rgbmatrix' on the Matrix Portal S3 starting with this build from S3:
adafruit-circuitpython-adafruit_matrixportal_s3-en_x_pirate-20230922-d6b284e.uf2
This one and newer raise the exception, and the ones below it do allow successful importing of rgbmatrix
If it is intentional where can I find out about the new API for it?
Ahhh, I found discussion at the bottom of #8411 that does discuss rgbmatrix being disabled intentionally.
I wonder if there is some way to make a notice for the Matrix Portal S3 specifically not to use any builds during this window where it is disabled since it renders the primary function of the hardware unusable unless I'm misunderstanding it. Although perhaps the issue is shortlived #8447 is in the works to resolve it.
I tested the matrixportal_s3 artifact from this PR successfully on hardware with a somewhat basic displayio test script. It does allow for successful import of rgbmatrix and seems to be working as expected with my test script.
@dhalbert @IrregularShed I'm currently working on the mentioned issue, but I'm facing confusion regarding which specific file needs to be modified. I have identified multiple audiobusio files. Could you please provide clarity on the exact file that requires modification for this issue?
sumitra@sumitra:~/opensource/circuitpython$ git grep "Bit clock and word select must be sequential pins" .
locale/ID.po:msgid "Bit clock and word select must be sequential pins"
locale/circuitpython.po...
You most likely want to look at the .c file with translate("...") on it. There are also a ton of files (one per each translation) which contain the translated string.
The only ".c " file with "translate" I see is this "ports/raspberrypi/common-hal/audiobusio/I2SOut.c: mp_raise_ValueError(translate("Bit clock and word select must be sequential pins"));"
Do you think that it is the required file?
Got it- thanks!
Perfect, thank you!
@dhalbert Tested the stick pull on MacOS Big Sur (11.7.8) and had no data loss.
Tracing a file save on the same system, there is no appreciable delay between writes. Here is an annotated trace:
flash_write_blocks: ticks=296289, block_num=51, num_blocks=1 file update
flash_write_blocks: ticks=296333, block_num=2, num_blocks=1 FAT update
flash_write_blocks: ticks=296388, block_num=3, num_blocks=1 " "
flash_write_blocks: ticks=296393, block_num=4, num_blocks=1 " "
flash_write_blocks...
Wondering which is the preferred IDE for CP beginners, Mu or Thonny? Something else?
I’ve always used Mu and started there. I know people using Thonny and PyCharm as well. VSCode has worked for me as well.
Thanks for that info. I wasn't aware that PyCharm was in the mix, too!
Some PyCharm hints too in the learn guide: https://learn.adafruit.com/welcome-to-circuitpython/pycharm-and-circuitpython
@heygauri Yes, just edit the message in quotes there inside the translate(). Then do a make translate at the top level, to get that into the circuitpython.pot file. Do not in general edit the files in localedirectly:circuitpython.potis produced by make translate, and the other languages are modified by weblate.
@heygauri Yes, just edit the message in quotes there inside the
translate(). Then do amake translateat the top level, to get that into thecircuitpython.potfile. Do not in general edit the files in localedirectly:circuitpython.potis produced bymake translate, and the other languages are modified by weblate.
Sure I will do this.
@dhalbert Sur, I will do this.
copying the code.py directly in a Terminal causes this error:
cp code.py /Volumes/AL1EN_L/code.py
cp: /Volumes/AL1EN_L/code.py: Input/output error
Can we use
busdisplayinstead ofexternalframebufferio?
Ya, totally open to different module names.
s it possible in a git repo to check in symbolic links? so this file could exist in one place and then be linked to elsewhere to have a sort of "shadow copy" exist there?
I think you can but I'd rather just have one script per board. That'd ensure that editing one doesn't impact another.
@slender iron @lone axle I updated and published circup 1.2.4 to do only 8.x bundles. There was no CircuitPython—Org bundle for 8.x. The last bundle release was two years ago (!). I tried to build a new one but that failed, so I opened an issue about that. To fix, I just copied the old 7.x bundle and uploaded it as 8.x. Now works.
Thank you. I can try to look into that bundle and see if we can get the build working.
@dhalbert Earlier you'd asked whether sync forces proper behavior on MacOS Sonoma. Yes, it does. I've verified that both the command line sync and python os.sync() force updates to the Express filesystem immediately.
I did a small survey and found that the Mu IDE is an entry point for beginners. So, I added an os.sync() to write_and_flush() in logic.py of Mu. With the patch, saving code.py works as expected, i.e., the file and all directory and FAT updates are written out i...
Hi, could@lone axle (or next meeting host?) post a new pinned message with the meeting google doc document? The last one is from Liz pointing to Tim's meeting of the 2 october. Thanks. (I just want to write a hug report to CGrover... before I forget)
On a FAT16 CircuitPython device (UM FeatherS3 with 8.2.6), code saves had a long delay before auto-reload, and in one instance had OSError: [Errno 5] Input/output error. So it doesn't look like only a FAT12 issue.
I would love to have this. Any type of support on this would be most helpful.
MicroPython v1.21 has been released:
https://github.com/micropython/micropython/releases/tag/v1.21.0
If
keypadhad simple tick timestamps, I wonder if that would work for you. Or if countio kept some kind of simple timestamps (e.g.supervisor.tick_ms()values) of the previousnticks, maybe that would be useful. But that wouldn't help your lower-power sleep quest.
As of https://github.com/adafruit/circuitpython/commit/72bfd39a1754ca5b6c6a3c6d6b03444fe92ae49e, keypad events do capture timestamps (using supervisor.ticks_ms()). countio does not yet have this functionality.
From the MicroPython 1.21 release notes:
...the zlib C module has been removed and replaced with a new MicroPython-specific deflate module and DeflateIO class that is optimised to provide efficient streaming compression and decompression. The zlib (and gzip) modules are now implemented in pure Python on top of the deflate module.
Here as a note for myself, or others that may take this on after CP merges with MP 1.21 but this may also result in a space savings by moving some functionalit...
I didn't do any testing with problematic data for this, I just spotted the code looks suspect. Perhaps make some good wav files and then read them in and check the data is ok. That should fail for ones where the % 4 length is wrong. The code pads it with a mid value, 128 (0x80) for unsigned 8 bit, 0 for signed 16 bit.
#!/usr/bin/python3
import wave
sample_rate = 16000
data = bytes(range(32, 32 + 8 + 1))
for length in (4,5,6,7,8):
with wave.open("testdata-u8-{:...
I have a bit of a strange idea. If I were to write a Minecraft modification that allows CircuitPython to be emulated with blocks in-game, would I be allowed to get a board page for it on circuitpython.org or would I have to maintain it in a fork due to its unusual nature?
I might be able to use existing work, like the OpenComputers II mod. If that were to be possible, this could be as easy as replacing the default OS (Linux) with a custom-compiled version of CircuitPython. I'm open to any ideas on this.
Yay! I'll need to update CP to it to get the auto heap growth code
We could do a board page for that if the circuitpython code bits are in the main repo. I think it'd be a new "port"
Good to know! I'll do some research to see what my options are for implementing this.
If you're interested in prior similar projects: https://github.com/FoamyGuy/Minecraft_Feather_RP2040 I created this mod and some tools that go along with it. It's not really emulating a device to a full extent, instead it's very basic just spawning and despawning redstone torches based on messages being sent back and forth via USB serial between the mod and a phyiscal connected microcontroller. The real device could be removed from it though if you have something else send those messages in to the mod. Maybe some components or ideas from this could be helpful to you.
What if it was a Blinka board? Maybe you could install Blinka on the host system and use Python to control redstone in-game. That might be easiest. I could do it with an HTTP server in Python and GET requests in Java for the mod.
That would definitely be neat! I had never considered Blinka running on the same system as the MC server (spigot in my case). You could possible make a subclass of digitalio.DigitalInOut from Blinka that sends the requisite messages to the mod to have it reflect the state with redstone in the game. Then you could have circuitpython code that uses your subclassed dio class.
would it be something like the mod running emulated logic -aka CircuitPython- (can mods be written in C or would it need some RPC or whatever to be run from Java?)... and a few redstone wires as the GPIO?
and some custom block where you write the code?
I'm not sure yet. I don't believe that mods can be easily written in C - pretty sure it's Java/Kotlin only. I think Blinka is my best bet, though - just having a few custom I/O blocks and writing the code on the host system.
sounds like an interesting way to get into CircuitPy/Minecraft internals.. but i dont really see a good "interface" on how a user would actually interact with it
I think having buttons and levers for inputs, and redstone lamps for outputs is sufficient for basic use. Maybe it could even integrate with other mods for more advanced devices.
With the Blinka example, if I'm understanding correctly, they would run a python script on the same PC that Minecraft server is running on (likely same as client is running on as well) with Blinka code in it that would then interact with mod running inside the game.
but at that point you aren't really running circuitpy on minecraft, but using a mod to connect a "fake device" running "usual" circuitpy on the computer with redstone blocks
which would work, but is not what i understood they want to build
tbh i dont really see how CircuitPy logic would be run on/from the mod without something like that, anyway 🙃
That actually is what I want to build. It's less "CircuitPython in Minecraft" and more "CircuitPython with Minecraft" 😉
The commit was amended for PR review into espressif's repo. Next time I'll make a branch to PR to them from.
from my understanding it would be kinda simple (things always go off after saying this)
you would define the low level functions like how to read/write "pins" (redstone wires?), or write to console (messages in chat?) and everything else may just work?
That's the hope!
your mod would pretty much be a server there, listen for circuitpython's messages and react accordingly (reply a pin reading, place a block, etc)
I would like to mess with it too, my Java knowledge is almost 0 but should get used rather faster. Let me know if you open a repo or whatever 👀
Will do, thanks for the offer!
It would be quite interesting using power levels for stuff, eg: hex data over a single wire instead of 4 of them (needs tons of comparators to preserve the level, tho)
At the very least they would be a good way of doing analog signals
When you specify PSRAM_SIZE in mpconfigboard.mk is the size referencing 8bit or 16bit words? So specifically would a 64Mb (8M x 8bits) chip be 8M or 4M?
i would like to assume any size measurement out there to be bytes, but there is always some outlier 🤣 (as in, what PSRAM_SIZE means)
😄 8bit or 16bit bytes?
I understand 64Mb as:
- M being uppercase => "stages" being 1024 (and not 1000)
- b being lowercase => bits (and not bytes)
So, in bytes, i would say:
8 * 1024 * 1024 = 8M
I've never heard about using "byte" to refer to a 16bit thing
IDF5 made 0 valid. Use the NO_ADC macro instead
Watched you test it and change looks good. Just pending everything to build.
Hey @stuck elbow I was just listening to the latest CP weekly meeting about your need for visual fiducials and just wanted to see if you're aware of April Tags?
https://april.eecs.umich.edu/software/apriltag
I've used them with an OpenMV camera:
https://openmv.io/blogs/news/apriltag-marker-tracking-the-future-is-here
Seems like they'd be ideal for your use? I'm sure it could be ported from OpenMV if you wanted to use it with CircuitPython...
The APRIL Robotics Laboratory at the University of Michigan investigates Autonomy, Perception, Robotics, Interfaces, and Learning, and is part of the Computer Science and Engineering department. It is led by Associate Professor Edwin Olson.
Hey folks, if you thought QR Code detection was the best the OpenMV Cam M7 can do, well think again. We now have the state-of-the-art AprilTags Marker Tracking code running on the OpenMV Cam M7. Check this awesomeness out! So, AprilTags are like giant low resolution QR Codes which just encode an ID number. The benefit
yes, I am aware, I mentioned them several times, but porting that code is a lot of work
When I understand correctly this patch frees up Pins GPIO33 and GPIO34, but I cannot see that they are added back to pins.h so that they actually can be used.
@michael-ring Did you mean GPIO43 and GPIO44? Those are the pins that were changed. On this board, I do not see that GPIO43 and GPIO44 are broken out. I'm looking at the pinout diagram here: https://www.waveshare.com/wiki/ESP32-S3-Pico#Pinout_Definition
I mean physical pins 11 and 12, GP33 and GP34 in picture
This is what I see in pins.c, pin_GPIO33 and pin_GPIO34 are missing:
{ MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) },
{ MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) },
{ MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) },
I agree with that. There are other missing pins too. https://github.com/adafruit/circuitpython/blob/8.2.x/ports/espressif/boards/waveshare_esp32_s3_pico/pins.c has a much more complete list, without the pin aliases (Ax, etc.).
@tirtharajsinha would you be able submit a PR to correct pins.c in main here to match 8.2.x? I am wondering if this pins.c was copied from another board that wasn't a good match. @michael-ring If you would like to do a PR to make this match the 8.2.x vers...
I am setting up a build environment for esp32 atm, when this is ready I can check differences between s2 and s3 for pins.c and try on my board.
thanks for addressing the issue, I have created a pull requested #8463 . @dhalbert
As you update the main from 8.2.x regularly, so I have not created pull request in main
These are not broken out on this particular board, or am I missing something? They are labeled in the schematic, but the module pins are not connected to anything.
Thanks. The pins.c in main is very different from the one in 8.2.x, so this may just generate a merge conflict or cause a bad mergewhen we merge from 8.2.x to main. Could you submit a PR against main to minimize the differences in the board definitions? There are necessary differences in the sdkconfig and maybe other places which will remain different.
fyi I tested with my own version, the two pins work as expected, at least as standard GPIO pins
Sorry, never mind. I was confused with the GPIO43 and GPIO44 pins.
Thanks! Sorry for my mixup on the pins in my initial review.
The method described does not work for me. What does work for me is what I changed it to.
Due to some mistakes some pin was misconfigured in board waveshare-esp32-s3-pico. This pull request is to fix those issues.
At the time of rechecking I found a another issue, Pin 19 and 20 were added in pins.c mistakenly.
Hi, @dhalbert I have created a pull request against main in #8464 .
But at the time of rechecking I found a another issue, Pin 19 and 20 were added in pins.c mistakenly. These pins are broken out in these specific board. these pins are used as USB peripheral.
So I have created a another PR ##8465 on 8.2.x. I have already fixed this issue regarding pin (19,20) in PR #8464 to main
Maker of these board have taken some very unusual decisions on remaping the pins.
The error message for creating an I2S object on the rp2040 platform in CircuitPython can be misleading when the word_select and data pins are not sequential. This change updates the error message to provide clearer guidance by specifying "GPIO pins" instead of just "pins". The revised message now reads:
ValueError: Bit clock and word select must be sequential GPIO pins
Closes #8058
@dhalbert I am not sure why I am failing the tests in the PR #8466. I exactly followed the steps you mentioned.
Has anyone tried or had issues with trying to get the web workflow working on the Pico-W lately? Trying to see if I am missing a step, my router is acting weird, or if there is an issue. I'm seeing pretty inconsistent behavior but have never really been into the code in this area.
@heygauri run make translate locally, and then commit the resulting change to locale/circuitpython.pot.
Please note I'm just a hobbyist and do not work for Waveshare.
I believe this contains all that's needed to add support for the Waveshare ESP32-S3-Zero board to circuitpython.
I have successfully created a build and flashed it onto my device and have verified all pins are correctly named and working.
I compiled it and flashed, and it seems to be working.
The neopixel uses GRB colors instead of RGB, so red and green are swapped, but there doesn't currently seem to be an option to handle that.
We might want to enable the espcamera module back, there is no reason why it wouldn't work with this board, there are enough pins, and external ram.
The Waveshare ESP32-S3-Zero board (https://github.com/adafruit/circuitpython/pull/8468) uses a Neopixel with different color order than RGB as the status LED, which means that it blinks green on error, and red on success. This is confusing for the users.
It would be nice to be able to specify a variable in the mpconfigboard.h for that board to swap the colors, so the errors are red and success is green.
I think the easiest way to do that is to add an ifdef in the `supervisor/shared/st...
You don't need a ESP32-S3-Zero board to test it, any board with an on-board neopixel should work, you will just verify that the colors are swapped.
@heygauri run
make translatelocally, and then commit the resulting change tolocale/circuitpython.pot.
I followed the same process, and it updated the error message in locale/circuitpython.pot. However, it also generated some unintended changes, approximately -518 lines, which I am not aware of.
The operating system shouldn't matter for code running on the board. But saving a file triggers auto-reload. You can turn off auto-reload with
supervisor.runtime.autoreload = Falseif that's more convenient.
OSError: [Errno 5]is unexpected.What IDE or editor are you using? Is there a
safemode.pyfile or aboot.pyfile?Update: other(s) are seeing this issue too
Sorry for the basic question, but where does the supervisor.runtime.autoreload = False go? I'm...
The operating system shouldn't matter for code running on the board. But saving a file triggers auto-reload. You can turn off auto-reload with
supervisor.runtime.autoreload = Falseif that's more convenient.
OSError: [Errno 5]is unexpected.
What IDE or editor are you using? Is there asafemode.pyfile or aboot.pyfile?
Update: other(s) are seeing this issue tooSorry for the basic question, but where does the supervisor.runtime.autoreload = False go? I'm ...
Hello, before I fill an issue, on the Feather USB Host with 8.2.6 I was able to toggle on and off the USB, now in 9.x the GPIO is "in use". So I was wondering if there is a way around. I want to enable/disable the Teddy RuxPin (and later change the USB mass storage content... if possible):
import board
import digitalio
led_or_power = digitalio.DigitalInOut(board.USB_HOST_5V_POWER)
# On 9.0.0-alpha.1-63-gc9d7195505: fail with "ValueError: USB_HOST_5V_POWER in use"
# On 8.2.6 it works fine
# To test the code logic, you can replace the line with
#led_or_power = digitalio.DigitalInOut(board.LED)
led_or_power.direction = digitalio.Direction.OUTPUT
while True:
led_or_power.value = True
time.sleep(5)
led_or_power.value = False
time.sleep(5)```
adabot had some updates
or do it in boot.py to close off that interval when starting to run code.py, where an autoreload could still happen
I think this issue is solved. ?
Fixed by #8434. Because the PR was not on main, this issue was not closed when that PR was merged.
The awkward moment when you [experience this in July](#circuitpython-dev message) and ask about it in Discord, but forget to file an actual issue, and then Sonoma ships..
Can I suggest that in the meantime, relevant CP/Adafruit guides get updated with a little note about Sonoma issues with a link to a page noting the workarounds? I don't know what the % of CP users on macOS are, but I'd assume it's more than a handful of us, and S...
Thanks for the suggestions @hopkapi and @anecdata, that's a big help until this bug is fixed.
After some debugging, it would seem the I2C frequency is not compatible with Teensy is why it's failing. After changing it, I was able to make the sensor work:
`import time
import board
import adafruit_bno055
import busio
i2c = busio.I2C(board.SCL, board.SDA, frequency=400000)
sensor = adafruit_bno055.BNO055_I2C(i2c)
last_val = 0xFFFF
def temperature():
global last_val # pylint: disable=global-statement
result = sensor.temperature
if abs(result - last_val) ...
CircuitPython version
Adafruit CircuitPython 8.2.6 on 2023-09-24; EK68Custom with rp2040
Code/REPL
a customised boot.py which automatically locks out interfaces if no interaction during boot.
____________________
from ref.boot_process import run_bootup
run_bootup()
____________________
And at the end of run_bootup():
finally:
if should_disable_ports:
run_ignore_errors(120, lambda: storage.disable_usb_drive())
r...
Was there a weekly meeting 21 hour ago?
I don't see the usual posting here, like extract from the newsletter, I don't see a the call message, the google doc seems only partially completed, there is nothing on Spotify or YouTube.
I was not online, and I think most Monday I will only be able to put notes and listen to the recording.
But I feel the meeting just did not occur yesterday.
The meeting is today
Oh yeah, I see that the date is right in the google doc. My bad.
Sorry I didn’t ping folks with a reminder! I was afk yesterday
<@&356864093652516868> Our meeting will be in just over an hour. Talk with you soon!
After additional study of the codebase I must admit that changing the refresh_time is not the right thing to do. So I will update my pull-request to get the other stuff in.
But I would still like to get rid of the useless time spent in _clean_area. Can we add an option to make this optional? The only reference I found regarding this cleaning is in a document from Waveshare and they state it is necessary because of ghosting. But they give no reference for this claim.
Pimoroni, which us...
You're welcome. It was fun.
CircuitPython version
9.0.0-alpha.1-63-gc9d7195505
Code/REPL
import time
import board
import digitalio
led_or_power = digitalio.DigitalInOut(board.USB_HOST_5V_POWER)
# On 9.0.0-alpha.1-63-gc9d7195505: fail with "ValueError: USB_HOST_5V_POWER in use"
# On 8.2.6 it works fine
# To test the code logic, you can replace the line with
#led_or_power = digitalio.DigitalInOut(board.LED)
led_or_power.direction = digitalio.Direction.OUTPUT
while True:...
👋
Thanks Scott!
Thanks for hosting Scott! Hope everyone has a great week 👋
Thank you for hosting @slender iron
👍
Here is the notes document for next Monday’s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1Z2hOLlAeC6nmtiImTzmkis1pREnbMsQum4Dlls3enaI/edit?usp=sharing
CircuitPython Weekly Meeting for October 16th, 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 p...
@gilded cradle seen this issue about your message board project: https://forums.adafruit.com/viewtopic.php?t=205012 ?
looks like it's targeting absolute newest
but I broke it when I disabled .show()
Yeah, I didn't know about show going away when I wrote it.
using absolute newest can change anything. best to do a fixed newest version when you need it
Yeah, I'll do that in the future (and in the relevant guide).
thank you!
I just want to test that the code works first. I think the reason I didn't point it to a branch at the time was because of the instability issues the matrixportal s3 was having at the time that you addressed.
9.x is the only thing with the bitmaptools improvements right?
bitmaptools existed more generally before that. But displayio.Bitmap.blit() was moved into bitmaptools() more recently
So things that would have previously imported displayio only now need bitmaptools if they were using Bitmap.blit()
one of those things being BitmapLabel from adafruit_display_text which itself is used within several other libraries.
I saw blendmode mentioned in an error on that thread
Ah, not sure on that, less familiar with some of ther other utilities within bitmaptools.
Take a look at safemode.py for a way to force the password.
No idea what the crash it but it seems hard to reproduce on my end. Connecting to the RP2040 via GDB will give more insight via a backtrace.
Please get a proper USB PID for this.
Where does this PID come from? I don't see it listed here: https://github.com/espressif/usb-pids/blob/main/allocated-pids.txt
@lone axle here is an example of a PR that should be released with a major version bump: https://github.com/adafruit/Adafruit_CircuitPython_PCF8523/pull/30
Thank you. I can validate that functionality in the releaser with it.
👍
I think it'd be neat to integrate a label into the flow
to have it autodetect and call out the change
Thanks for safemore.py info. I will implement that, should get me through the security side of things with any luck. I am a total novice for GDB. I could give it a go and get you some info from the RP2040 in that state, but I would need to know a set of commands (and dependencies to install) to get the info.
A couple questions about your API design choices. Thanks for the PR!
Please include the fields here so that it is stubbed out fully.
Why didn't you add to the Info class?
This is a bit weird to me. Almost always there is a 1:1 relationship between Python functions and their C common_hal parts. Could you refactor this so that find() and decode() share code but have two separate common_hal functions that each include their piece of this branch?
Oh, sorry, I forgot to do this.
Because there is no overlap between the two sets of information. I either want one or the other, and a named tuple can't have empty fields.
The only way I can think of doing this cleanly is to rename this function, and then have two one-liner common_hal functions that call it, with true or false. Would that be better?
That's a little better but not what I'm thinking. Ideally this code would be split apart. I bet you can factor out the start through quirc_end and return quirc_count(). You'll end up with a loop in each function that mirrors this one (but simpler without the if).
I would still have two functions identical except for what is inside that if, so I don't see much point? I will try to come up with something.
@stuck elbow a third private function would have the shared piece
I need a clear head for this, it's late for me and I drank a beer already, so I will think about it tomorrow, sorry.
Hi,
I've tried to serve httpS on a Pico W, but it's indeed slow as reported also in: https://github.com/adafruit/circuitpython/issues/7657
Is it possible to use an external crypto chip attached to the Pico W to speedup HTTPS (something like https://learn.adafruit.com/adafruit-atecc608-breakout/overview)?
I just want to know if I'm digging in the right direction [and that it's not a rabbit hole 😄] - IMO an example with this would be highly useful.
Thank you again for your incredibl...
This isn't really a CP issue. The adafruit discord or another electronics forum is a better place to ask this. I don't personally have experience running an https server with CP.
After additional study of the codebase I must admit that changing the refresh_time is not the right thing to do. So I will update my pull-request to get the other stuff in.
Thank you!
But I would still like to get rid of the useless time spent in
_clean_area. Can we add an option to make this optional? The only reference I found regarding this cleaning is in a document from Waveshare and they state it is necessary because of ghosting. But they give no reference for this claim.
...
general design guide like question - should #def like constants go at the module level or class level?
Perhaps another time. Don't have a debug probe.
depends on where they are used
like if it's for internal class use only vs. something user code would need?
yup
user code ones = module level?
or if it's used by one class or many
think something useful could be written and added here?
https://docs.circuitpython.org/en/8.2.x/docs/design_guide.html#driver-constant-naming
for context, relates to this:
https://github.com/adafruit/Adafruit_CircuitPython_AD569x/pull/1#pullrequestreview-1672005117
thinking those should go module level
@candid sun just fyi - see above question. relates to your pr.
@tidal kiln okay thank you!
@slender iron when you have a sec. I'm checking in on the repo for https://github.com/FoamyGuy/Adafruit_CircuitPython_TemplateEngine is there anything further needed on from my end or the existing repo to get the new one created?
Thanks for bugging me. Sorry I failed to make one yesterday. I’m afk for lunch and will try and do it later. Bug me again if I don’t
If they can be const(), then module level, they will be substituted at compile time, the names will go away, and that will save space. https://docs.circuitpython.org/en/latest/docs/design_guide.html#use-of-micropython-const
but if needed in user code? like:
foo_device.gain = GAIN1X
then if class-related, in class, not in module, sure
@tulip sleet actually, i'm just a person in the middle (but also curious about the details). see link above - its liz's pr.
and avoid unnecessary prefixes that are redundant w/r/t class
e.g. make the names as short as reasonable, to save space
not ADS555_ADC_GAIN5, but just GAIN5, or whatever
i just made that up
what's answer specific to pr above?
At my desk and doing it now
Thank you!
@candid sun u wanna chat here about ur pr and those consts? obviously i don't know 🙂
@tidal kiln sure thing 🙂
(i'll update design guide if seems worth it to capture details)
in general, i think your PR is at the point now its good for other CP peeps to review
@tidal kiln okay cool, thank you so much for all of your reviews. i learned a ton and definitely understand library structure a lot more
np. good job sticking with it and the updates.
i think it might be good to include a link to the style guide in this Learn Guide: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library i actually wasn't aware of the style guide until this 😅 unless it's called out somewhere else that i'm not aware of
yah, agree, would be good to link from that guide
Ok I put in a simple safemode.py as per your link:
import microcontroller
microcontroller.reset()
I also DDed over my Win7 OS with latest backup too. Didn't see any issues and the keyboard was detected and installed fine as long as I allowed the firmware to auto-disable things as per my run_bootup.py in the description (aka simple mode). Win7 was happy to let the kb be treated as a kb with no issue. But when (while still in Win7) replugged the kb with the password entered a...
in doing the readthedocs for https://github.com/adafruit/Adafruit_CircuitPython_AD569x , i'm getting this error:
There is a programmable error in your configuration file:
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/adafruit-circuitpython-ad569x/envs/latest/lib/python3.11/site-packages/sphinx/config.py", line 358, in eval_config_file
exec(code, namespace) # NoQA: S102
^^^^^^^^^^^^^^^^^^^^^
File "/home/docs/checkouts/readthedocs.org/user_builds/adafruit-circuitpython-ad569x/checkouts/latest/docs/conf.py", line 121, in <module>
import sphinx_rtd_theme
ModuleNotFoundError: No module named 'sphinx_rtd_theme'```
assuming there's some setting i'm missing? i know stuff for read the docs changed recently
IIRC there was a change in how they handle themes, they spammed e-mails to everyone about how you need to configure your projects now
See for instance https://github.com/adafruit/Adafruit_CircuitPython_HID/commit/30b7cda19bc9286010bfee102517cd7a22cf6c9c. All the existing libraries were patched like this.
thanks!
@ladyada got time to review?
Not quite sure what to list this under but I have recently purchased the SuperMini NRF52840 which seems to be fully compatible with the Nice!Nano.
So I flashed the Nice!Nano CircuitPython build on it and tested all the pins to see if they all map the same and everything seems to be working A-Okay.
So I don't know what the best course of action is here.
- Should the Nice!Nano CircuitPython page ( https://circuitpython.org/board/nice_nano/ ) get an addition for this board?
- Should i...
I have added support for this to my fork:
(and a #define MICROPY_HW_NEOPIXEL_ORDER_GRB (1) line to mpconfigboard.h)
Disclaimer: I am definitely out my element in C as those are the first lines I've ever written in it. Initially I tried adding:
#define MICROPY_HW_NEOPIXEL_GRB (&pin_GPIO21)
to mpconfigboard.h as an alternative to:
`#...
Please note I'm just a hobbyist and do not work for M5Stack.
As already M5stack atoms3 lite is supported by circuitpython, I added M5stack atoms3 support.
http://docs.m5stack.com/en/core/AtomS3
- Internal display support is added
- I2C settings for IMU is added
Please review and comment if there were any suggestion.
I have created a copy of the Waveshare RP2040 LCD 1.28, because the Waveshare RP2040 Touch LCD 1.28 has the LCD Reset pin on GP13 instead of GP12.
It is not a very advanced port. I'll try and add the initialization for the display next. (But the one I copied doesn't have initialization either).
Next steps would be:
- Display initialization
- Adding touch pins
- Add initialization for other modules (like touch, and accelerometer)
Reference:
https://www.waveshare.com/wiki/RP2040-To...
Changed the title to make the pull request more clear.
We discussed on github but I'll mention it here for the sake of completeness. I got it from running lsusb under Linux. I think this was after I already put circuitpython on it though so very likely not what it should be
I've contacted Waveshare to see if they want to request a PID from espressif or if I can/should on their behalf. No response so far.
We might want to enable the espcamera module back, there is no reason why it wouldn't work with this board, there are enough pins, and external ram.
For completeness (we talked about it on discord as well :))
Creating esp32s3 image...
Merged 4 ELF sections
Successfully created esp32s3 image.
1482784 bytes used, -40992 bytes free in flash firmware space out of 1441792 bytes (1408.0kB).
4220 bytes used, 3972 bytes free in 'RTC Fast Memory' out of 8192 bytes (8.0kB)....
@lone axle the update-bundles job failed due to rate limiting and >6 hours https://github.com/adafruit/circuitpython-org/actions/runs/6493746908. I restarted it to see if it would succeed on a re-try.
It seems to have completed successfully, but there are still some exceptions printed in the log, and some messages about API rate limit. Looks like there is wait / retry logic built in to it as well so it was able to succeed eventually.
I did create an 'issue' for this ( see https://github.com/adafruit/circuitpython/issues/8473 ) as I wasn't sure if it warranted its own build.
The SuperMini NRF52840 is fully compatible with the nice!nano and actually works fine just flashing the nice!nano circuitpython build to this board.
These files are thus near identical to the nice!nano just changing the USB PID to the one I got from the board whilst it wasn't flashed with anything yet through lsusb command under linux ( Bus 001...
@candid sun do you need help getting the RTD going for that new library?
@slender iron i did get RTD working with the right theme. i think the only thing pending is adabot accepting the admin invite
sweet, thank you!
thank you very much!
You could add a screen to see the error that happens when the red blink happens.
That sounds like a good approach! Thanks for the update.
Which is the original board? Totally fine to have another for a slightly different board.
Ah, I see. This has "Touch" in the name.
Own build is fine. As we discussed on Discord, I'd rather have separate boards to keep clear names as trademarks. It makes things easier if the boards evolve in the future too.
I disabled bleio (via CIRCUITPY_BLEIO = 0) on S3 boards with little flash because BLE support on ESP is incomplete.
0x239a is Adafruit's USB vendor ID and shouldn't be used for this board. I'd suggest https://github.com/pidcodes/pidcodes.github.com for requesting these boards you have. I approve for third-party, open source use on closed source boards. Make sure to link to your PR here as proof of being open source software.
Does circup support CircuitPython 9.0?
Not possible to add a screen I don't think? ... as I put this keyboard together myself from discrete components and passives, following the RP2040 hardware guide/datasheet. It's not an official castellated board or anything like that. Anyhow, I added a section to my USB detection loop to check if it's in Complex Mode on USB disconnect. If so, it resets the board too. This gives it time to reboot in time with my PC rebooting, ready to enter the UEFI boot selection screen and then subsequen...
I doubt it since we aren't making bundles for it yet
Wow, bleeding edge! Would an issue in the circup project be appropriate?
we're waiting for the MP 1.20 merge since it changes the mpy format again
Ah, gotcha. Thanks!
I think this report in the Raspberry Pi forums is about the same issue: https://forums.raspberrypi.com/viewtopic.php?t=357468.
Some workarounds:
- simply waiting until the write completes: code.py will restart again after the final write. [not tested by me yet]
- Turning off autoreload:
supervisor.runtime.autoreload = False. - Doing
syncin a Terminal window - Adding an
os.sync()in the right place in whatever editor is being used. - Downgrade back to Ventura. I don't know how easy or possible this is.
I will not have an opportunity to try this on a Sonoma Mac for a few days, but will try to characteri...
@main furnace I've been using circup successfully on newest builds but have to pass --py flag to get python instead of mpy files.
another very weird issue if anyone has ideas
https://forums.adafruit.com/viewtopic.php?t=205046
i can't reproduce
Adafruit CircuitPython 8.2.6 on 2023-09-12; Metro MIMXRT1011 with IMXRT1011DAE5A
>>> import board
>>> from adafruit_seesaw import seesaw, rotaryio, digitalio
>>> i2c = board.I2C()
>>>
is there any known issue with M7 and the pull up test? like something that might be marginal?
That looks like a bug in the i2c code of that encoder to me.
Like it crashes or hangs at some point, and holds one of the lines low, which looks to the mcu like a missing resistor
I wonder if adding a delay before creating the i2c object would help, maybe it's just slow startup of the mcu on the encoder?
but only happens in that specific context
the i2c scanner works
and i can't reproduce using same hardware
If the analysis in that other PR ("it looks like the wireless firmware is being loaded during USB device enumeration") is correct, I do not think they would be the same cause.
In CircuitPython, we load the firmware during port_init which I think is before USB enumeration can possibly occur (usb_init is called later in supervisor_workflow_start)
Tested 8.2.6 vs. Adafruit CircuitPython 9.0.0-alpha.1-64-gf14ca95df4 on 2023-10-06; Adafruit QT Py ESP32-S3 no psram with ESP32S3 with plain TCP sockets. There's definitely a regression related to accept().
might be a problem with that particular faulty encoder, and timing
is the encoder firmware versioned?
both examples run the check, so if one works and the other doesn't, consistently, it must be timing
the only other option is memory corruption during the imports
CircuitPython version
Adafruit CircuitPython 8.2.6 on 2023-09-12; Raspberry Pi Pico W with rp2040
Code/REPL
a=1697226806333; print(a); print("%d" % a); print("%f" % a); print(int(a)); print(float(a));
Behavior
This is the output I get from the above code:
1697226806333
1697226806333
1697226670080.000000
1697226806333
1.69723e+12
Description
I get different values between integer and float. I suspect the int to float conversio...
Floats in CircuitPython use 30 bits: 8 bits of exponents and 22 bits of mantissa. There are about 5 1/2 digits of precision. Desktop Python uses 64-bit floats. So your results are expected. Integers can be of indefinite length on all but the smallest ports.
Note: I was able to manually copy over the .UF2 and then the online tool worked fine to "update wifi credentials". That workflow requires selecting the CIRCUITPY drive and works just fine.
Thanks for the summary, @dhalbert. I submitted a detailed Feedback to Apple (and I recommend everyone do that same, as mentioned upthread). My work-around at the moment is to run this very bad idea in a separate terminal window:
while [ 1 ] ; do ; echo "sync" ; sync ; sleep 5; done
Thanks @lynt-smitka, @hexthat and @gfghjjk!
Hmm, I wonder if this is something changed in the API recently.
Ah, that explains it,
I was actually trying to take a unix_timestamp in milliseconds (derived from a api call) and dividing by 1000 so I could use time.localtime(seconds_since_the_epoch) to get a datetime.time_struct suitable for setting the RTC.
time.localtime seems to want a float, but I guess it then converts that back to an integer?
I guess I need to think in smaller numbers because the unix_timestamp in milliseconds is possibly 48bits long!
Assuming my time in ms is:
16972296...
time.localtime() can take an int or a float in "regular" Python. In CircuitPython, it will also take either but it's converted to an int.
>>> import time; print(time.localtime(1697229699.987654321))
This is a real float, but the significant digits after about 5 1/2 digits are dropped. It's not the magnitude of the value (it can be up to about 10**38), but the precision. So you'll get a time, but it won't be as precise as the floating point value.
If you are trying to set your ...
well, in CircuitPython the RTC needs a struct_time object, and that is a part of time. I don't know how else to easily convert an integer timestamp (which might be 32 bits+) into a struct_time object without using the ``time``` library.
But anyway, using an integer timestamp in seconds (rather than a float ms or a float secs) passed to time.localtime seems to work for me and I get the correct struct_time to pass to the RTC, even though that int timestamp is 32bit.
Thanks for l...
@gilded cradle with the new Blinka_DisplayIO I'm curious if you could point me in the right direction for how to get the data from a Display object and use it to load a PIL.Image object? I know it used to use the PIL.Image internally but no longer does.
I'm guessing it is somehow using fill_area() to fill a buffer memoryview which can then somehow be "fed into" PIL to create an Image object, but I'm not sure how. I tried Image.frombuffer() and Image.frombytes() without success, I think there must be some reformating of the data that needs to take place or something.
You can create a struct_time directly: https://docs.circuitpython.org/en/latest/shared-bindings/time/index.html#time.struct_time. That would be convenient if the original source of the time (from the web, say), is in struct_time format. But a integer value in seconds in fine too: you probably don't need it to be any more accurate.
I got seemingly very close with img = Image.frombytes("I;16", (400, 300), buffer.tobytes()) but The size and shape of my image data is correct, but the color is off. This is meant to be green and purple like many of the display driver simpletests.
@lone axle is there a reason why you specifically have to use PIL and can't just use pygame.image.save()?
I'm not sure / probably not really a specific reason other than the code initially used a PIL Image so getting back to that means it'll work without further changes.
I don't have really any other experience with PyGame, and I do have experience (albeit limited) with PIL so it's the thing I'm more likely to try using first. But ultimately I'm open to any solution.
I have some pygame experience, but it was before version 2.0
the docs for image.save are here if you want to try that https://www.pygame.org/docs/ref/image.html#pygame.image.save
my code was ultimately using pygame.image.fromstring() to get it back from the PIL Image to the pygame image
you can use this to get the surface object: https://www.pygame.org/docs/ref/display.html#pygame.display.get_surface
there is probably a way to skip PIL now and go directly from the new displayios concept into pygame's image concept. But I'm not sure how quickly I'll figure it out.
Thank you, I'll take a look at those.
@lone axle Is https://github.com/adafruit/Adafruit_CircuitPython_PIO_UART considered usable?
I'm not sure sorry. I have the most recent commit, but it's unrelated to the core functionality of the library. I don't have any experience with PIO. I wouldn't be surprised if it is not in a usable form yet since it doesn't have a release made for it.
Oops yeah you're right it's something @slender iron wrote. The implementation looks reasonable but must be a reason it wasn't properly released.
I can be pretty lazy when it comes to polishing up libraries
I was just watching the deep dive. I’ll have to go over the code with you. In short, I think you’ll probably need to override the fillarea function and instead of it calling sendpixels, have it draw to a PIL image.
Your approach may be better for long term compatibility though if you can get it working. I think it’s sending the colors as RGB565 iirc
@heygauri run
make translatelocally, and then commit the resulting change tolocale/circuitpython.pot.I followed the same process, and it updated the error message in locale/circuitpython.pot. However, it also generated some unintended changes, approximately -518 lines, which I am not aware of. You can see those changes in this PR.
Update: I followed the document https://learn.adafruit.com/building-circuitpython/linux and below is the output:
$ make translate
find extm...
The missing error messages are because the ulab submodule was not loaded, so its messages were omitted. You can do make fetch-all-submodules from the top level, or descend into ports/atmel-samd (or most other ports), and then do make fetch-port-submodules, which will get ulab.
There were some new translations, so I merged from upstream, and re-did the make translate, and pushed new commits to your branch. Should be all set now. I'll review and merge when the build is done.
Some esp32s3 boards like lilygo t-display-s3 come with a display connected via 8080 interface, so having parallelbus back on ESP would be nice....
I think I found some good news / bad news on the RTD front: https://blog.readthedocs.com/defaulting-latest-build-tools/
The've recently made a change do away with some of the automatic things that happened and were installed during their builds based on the date the project was made. That is good for the sake of consistency, but it does mean that some of the defaults we have been relying on are no longer in place.
Specifically sphinx-rtd-theme used to be installed automatically during a build in RTD, and now it no longer is. This means that any new builds on our libraries (and maybe core?) will fail with this error:
Some of the changes that can be used to fix it are in this diff: https://github.com/adafruit/Adafruit_CircuitPython_TemplateEngine/compare/48c67eb...main basically boils down to needing to include sphinx-rtd-theme in docs/requirements.txt and then setting html_theme and html_theme_path inside of the conf.py file.
However it's probably worth making further changes to it before rolling out to the other libraries. I think some of our logic in conf.py can be made less complex because we don't need to worry about running inside RTD vs. outside / locally. I opted for a more quick and dirty fix, but now that I've found the blog post I have a better understanding of what led to it, and think it can be made even simpler in our conf.
I moved as much as I could without passing too many variables around to a common function, but there is still a lot of duplication. I'm not happy with it, but I can't see how to improve it.
Added UM Blizzard S3 board definitions
Can't test, but looks fine!
Could you submit another PR to main? Note that mpconfigboard.mk and sdkconfig have changed significantly in our 9.0.0 revamp of various things, so just merging this from 8.2.x is not going to work. Check out some examples of your current boards in main.
The missing error messages are because the
ulabsubmodule was not loaded, so its messages were omitted. You can domake fetch-all-submodulesfrom the top level, or descend intoports/atmel-samd(or most other ports), and then domake fetch-port-submodules, which will getulab.There were some new translations, so I merged from upstream (upon reflection, probably not necessary), re-did the
make translate, and pushed new commits to your branch. Should be all set now. I'll r...
is there a way to fetch submodules without getting the ones for the RPi broadcom port
Just got back from vacation. Tried this out first thing with 8.2.6 and still getting the same issue. Will hard fault after about 5-6 file saves in Mu regardless of bit_depth. Also rainbowio of the fireworks no longer works as it did no matter the bit_depth setting used. Because rainbowio isn't working like it was with 8.2.5 perhaps I'm using outdated libraries? I only updated the UF2 to 8.2.6
Should I be using this with a 9.0 alpha instead? It says merged into 8.2.x main, just want to ...
Can't test, but looks fine!
Could you submit another PR to
main? Note thatmpconfigboard.mkandsdkconfighave changed significantly in our 9.0.0 revamp of various things, so just merging this from 8.2.x is not going to work. Check out some examples of your current boards inmain.
Yeah, sure thing. It 9.0 close? I am working on adding 2 more boards at the moment, so do I just add them to main and not bother with 8.x?
Question for @tulip sleet or anyone else with knowledge of C-based CircuitPython classes.
Which is more space/time/CPU efficient: Reusing keypad.Event for my touch sensor events or creating a namedtuple("Event", "key_number pressed released")?
this has been my assumption too. I mean, I'm not using keypad for anything else, but it is built-in
why would using it for something else be a problem?
apologies, I mean I'm loading keypad only for my non-keypad uses. I don't have any real buttons
I'm thinking we are talking past each other, not sure you mean the same thing by "reusing" as I do
Was fighting that macOS Sonoma sync issue all day yesterday - what a disaster 😦
Thankfully I saw the issue posted here last week just before I updated my work Mac Studio to Sonoma, but wow.
keypad has an option to fill in the information in an existing Event object, without creating a new one, that is more efficient than creating a new Event
it's ironic that the issue only exists because macs refuse to support MTP for non-image files
otherwise circuitpython would be using mtp for this
Apple knows best 😉
I'm sure they know what is best for them
Sorry maybe some code will make it clearer. I have a board that has many touchio pads. I want to turn those pads touches into events, like keypad. This is what I'm currently doing: https://github.com/todbot/picotouch_synth/blob/main/circuitpython/pts_drum_machine/picotouch_synth.py#L117
There are no other uses for keypad. I was wondering if using keypad.Event in this was was more/less-efficient than constructing a namedtuple
Sorry, forgot to add the drooling sarcasm emoji - oh Apple don't provide one of those either - how ironic 😉
I'm working on a keypad-like library for touch
ahha yeah me too just for this purpose, thus my question
I mean, one that runs in the background, like keypad does
oh so in the core then, cool!
but it's been slow progress
I'm just so angry, because MTP would solve so many user interface and technical problems – the filesystem would no longer need to be read-only, we could use a flash-friendly filesystem that doesn't wear it and that has much lower chance of corruption, and we would much better know when to restart the code after modification
I'm sure that with a bit of tweaking it could also bring world peace and eternal prosperity
MTP (and its precursor PTP) has been for me fairly frustrating on MacOS. At least several years ago when I had cameras that supported it
yeah, all the other platforms have stable support by now, it's the default mode for transferring files in Android
I suppose iphones do it through a music collection management app still?
through the Image Capture app last I knew
at least it's not the web browser
it is a teeny bit more efficient. Another consideration is that you could mix touch and regular keypad events and not care later. In the long run, it would be nice to have unfettered access to EventQueue objects.
but the efficiency difference is probably inconsequential. Our discussion of this may have taken more time than the runtime difference for a year.
I assume Apple didn't want to support MTP because they wanted an iPod monopoly on Macs. But such marketing considerations have been gone for years.
Has anyone looked into macFUSE for MTP support on MacOS? There's also a project https://github.com/whoozle/android-file-transfer-linux that might work for mounting MTP devices. I've never tried either of them.
hi - did you get any further insight about the Sonoma issue than what's in our issue already? Did you find other people complaining about the consequences of it for ordinary USB drives (or even internal drives)? I am looking for more angles to report its negative consequences.
MTP is a USB class protocol, so if the lower-level driver is blocking stuff, I'm not sure what else we can do. I guess we could add .jpg to all our files 🙂
Dan could be right on about Apple's motives. That said, there's always been a path for a third party to add MTP filesystem support as a kext. AFAICT no one has ever taken on the task.
we already do it with .txt, no?
we support .txt and .py, but if the native MTP is not handling non-image extensions, that's a big pain.
There are MTP add-ons, .e.g. https://openmtp.ganeshrvel.com/
I see other ones, some obsolete
but we really don't want to have to ask our Apple users to do this kind of thing. Impossible for schools, etc.
I've only experienced this on my boards running CP - unfortunately (or fortunately it seems) I do most of my work on my work Mac that is on Ventura still.
I have two Macs and will upgrade one to Sonoma so I can characterize this, maybe take some Beagle or wireshark traces
I had it failing to upload bitstreams yesterday to my BlizzardS3 board in UF2 mode (custom UF2 bootloader we made for BlizzardS3).
if you just wait 10-20 seconds, does it eventually work?
And sometimes I was able to copy the file without error, but it didn't actually update it - until I did a sync.
or is something timing out? I want to see if it's doing something like: write data -- wait 10 seconds -- write metadata
When Windows delays writes, it's more like: wait 10 seconds -- write data and metadata
I found the same thing with updating code.py on the device. I'd update it and do a soft reset (have auto loading off) and it didn't actually update the code even though I got no error.
I had to manually sync the drive.
but - sometimes it worked without a sync.
behavior probably depends on whether the file grows or shrinks, etc. I'm not even sure if it's writing metadata first or data first
On the MacOS Sonoma thing, the annotated traces I put on the issue shows the timing.
or mixed
I tried the os.snyc() in a loop in my code, and that never helped.
It's writing the filedata as soon as it's updated. It's the directory and FAT updates that are delayed.
It it worked for me, it was as inconsistent as not using it.
thanks - I see, I didn't realize until now you had instrumented a build
I looked through the issue on github, but didn't experience anything different from what was already added there.
@mortal kernel is it possible to mount the filesystem as sync or something like that
ok you said
Manually mounting the filesystem specifying option noasync removes the delay. This appears to be a regression in Sonoma.
so it works if mounted noasync?
@atomic summit eightycc's experience is that sync should fix it, so hmm...
You bet. I've remounted with modified mount flags, -o noasync does the trick. Trouble is, MacOS has disabled /etc/fstab, so there's no way at present to make it permanent.
is there something like a udev rule?
sync needs to go immediately following the fclose.
do you have any contacts still at Apple who might be able to explain the behavior change?
i should have re-read the whole thread; you did more extensive experiments than I realized. This all started just when I went out of town for two weeks
I'm waiting to hear back from one of my contacts.
thank you
In the meantime, I've been working on a user agent (a MacOS daemon) that uses the DiskArbitrator framework to modify mount flags. Basically, it remembers mounts you've flagged for synchronous updates and forces the flag during the mount process. It gets started automatically by MacOS and lives in small icon on the toolbar. I got motivated to do this because it's clear this is an issue for more than CP.
yes, I would think more people are going to pull USB sticks and get corruption. Yes, they're supposed to eject, but it used to work
only other mention I've seen is https://forums.raspberrypi.com/viewtopic.php?t=357468; I think that's the same thing
when I search for sonoma disk issues, I get a bunch of other complaints (slow this or that), but nothing really coherent
What's strange is that I've been all over the Sonoma open source code and cannot find anything that's changed that could cause this. I've look hard at vfs in the BSD part of the kernel and at the msdosfs kext. Nada.
That MP issue does look like the same thing. Yeah, I've done searches too. It's hard to draw a straight line to our issue on most of them, but wait a month.
pretty mysterious that you're not seeing any code changes. I wonder if there was a closed-source daemon that was doing prompt syncs or something, and now it's gone
Don't discount the possibility that I've missed something! The code is complicated and has had many fingers in it over the years. There is a closed source bit called FSkit that handles automounting when a device appears, but all the real work of file I/O happens in those two spots I mentioned.
hehe yeah. I like the simplicity of using keypad.Event because I'm familiar with it and I'm not reinventing the wheel. Good to know I'm not doing anything obviously dumb (in this case at least). Thanks!
Yeah, sure thing. It 9.0 close? I am working on adding 2 more boards at the moment, so do I just add them to main and not bother with 8.x?
9.0.0 is not that close. We are finishing the MicroPython v1.20.0 merge, and then we'll start doing alpha's, because the .mpy format will stop changing. But then we also need to do the v1.21.0 merge, and there's a lot of debugging to do too.
No issue if you want to wait and do all the boards at once for main.
Yeah, sure thing. It 9.0 close? I am working on adding 2 more boards at the moment, so do I just add them to main and not bother with 8.x?
9.0.0 is not that close. We are finishing the MicroPython v1.20.0 merge, and then we'll start doing alpha's, because the .mpy format will stop changing. But then we also need to do the v1.21.0 merge, and there's a lot of debugging to do too.
No issue if you want to wait and do all the boards at once for
main.
Ok, thanks for clarifyin...
An 8.2.7 may be imminent, in a day or two. But there will probably be an 8.2.8 also. We will just keep going every few weeks on 8.2.x if there are interesting changes, including new boards.
I hope this is the right place to ask this. If not, let me know. I would love to be able to use the MAX3421 chip to enable USB host functionality on any mcu. I have some experience with this chip and was going to put some time into building support for this chip into the usb_host circuit python core. If I'm successful would this be considered for a pull request, or would you rather not have the comminity contributing code to core modules?
@odd thunder A core dev can better answer authoritatively on the merits (I'm just a community member), but community most definitely contributes to the core (via PRs). But since this feature would rely on an external chip not present on most boards, perhaps it would be an optional module... pin choices for the connection would vary?
@crimson ferry thanks for the response. That makes sense, I can write a library instead, similar to how sensors and other external hardware is supported
hopefully a core dev will chime in, or you could open an issue for discussion
Don't spend your own time on this now: https://www.youtube.com/watch?v=FjbiyjPVoek
we have work in progress
Your timing is impeccable. I’m very excited to see this. How will the functionality be exposed to an application? My use case is to control dslr and mirrorless cameras over usb. I’d be happy to contribute support for this protocol once these updates are live
I don't know exactly, but we have a usb host API already that's very new: https://docs.circuitpython.org/en/latest/shared-bindings/usb/index.html and https://docs.circuitpython.org/en/latest/shared-bindings/usb_host/index.html, so it should be in line with that
I think you want to run "make fetch-port-submodules" from the ports/portname (ie circuitpython/ports/espressif) folder
there will also be arduino support for various chips
Sounds great. Thanks!
With Scott's recent memory work on 9.x, I decided to take another look at this since I believe it's some sort of memory management bug, however the issue still seems to occur using the latest build from main.
I was able to build a debug build by disabling WiFi which actually ended up creating a much smaller image (about 500K free flash, rather than 50K free flash for the standard build). That build still showed the issue but it took much more activity (memory use) before the problem occurr...
Hi,
Apparently another way to improve performance of the TLS handshake is to cache it.
https://arduino-pico.readthedocs.io/en/latest/bearssl-server-secure-class.html#client-sessions-resuming-connections-fast
Is caching of the TLS handshake possible in circuitpython ssl? (mbedtls I think has this ability)
@slender iron I can run the CPy meeting this afternoon, since you did it last week while I was away. I will prep the notes.
<@&356864093652516868> Reminder: There is a CircuitPython weekly meeting in a few hours, 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! https://docs.google.com/document/d/1Z2hOLlAeC6nmtiImTzmkis1pREnbMsQum4Dlls3enaI/edit?usp=sharing
Works for me. Thanks!
I confused myself slightly while looking into this by looking at a library that "fell through the cracks" of the recent RTD change. It was cookie-cut before the change was live there, and it wasn't published when the patch to fix the other libraries was rolled out so it didn't have that fix yet, which essentially was the simplification that I referred to in this post, so that is already done mostly everywhere.
The change that RTD made on 10/3 (outlined in the RTD blogpost) does mean that sphinx-rtd-theme is no longer installed automatically so we'll need to add it to one of our requirements files in order to get the library docs builds to succeed inside of RTD. I've tested that fix successfully in the TestRepo: https://github.com/adafruit/Adafruit_CircuitPython_TestRepo/commit/364a28bd7385e1df0f2faf0b8cec5764b096bacc and RTD build is back to passing successfully with that change https://readthedocs.org/projects/adafruit-circuitpython-testrepo/builds/22241651/
Now running: Adafruit CircuitPython 9.0.0-alpha.1-68-ga4b8afb54f on 2023-10-14; Adafruit-Qualia-S3-RGB666 with ESP32S3
meeting starting in 5 minutes
Do you know of any IDF 5 example code for these boards? What does it use in the IDF to output to it?
The fix isn't in 8.2.6 or 9.0. There will be an 8.2.7 this week hopefully and then we'll merge 8.2.x into main too. Some S3 builds will be from the 8.2.x branch. You'll need to match with the commits.
Build a Keyboard and Mouse Emulator, make a rainbow with RGB LEDs, and work with a microSD card - all with CircuitPython on a Raspberry Pi Pico!
Article with diagrams and code: https://dronebotworkshop.com/pi-pico-circuitpython/
More articles and tutorials: https://dronebotworkshop.com
Join the conversation on the forum: https://forum.dronebotw...
I can update the board defs with the 8.2.x merge into main if needed.
Submissions welcome
Our repos are generally marked with the hacktoberfest tag
hacktoberfest is tagged on the repo, so it counds for all PRs even if they aren't tagged specifically at the PR level.
Yes thanks
Another reason to use the esp32 web workflow ❤️
CircuitPython version Adafruit CircuitPython 8.2.6 on 2023-09-12; Adafruit CircuitPlayground Express with samd21g18 Code/REPL # Write your code here :-) print("Hello World!") Behavior Cod...
do we want a glossary on RTD or should we remove it?
we deleted the MP one
@slender iron I've been building CP 8.2.6 and CP 9.0.0 with the ARM GCC 12.3 toolchain without modifications to CP or Pico SDK. I'm not seeing any problems related to using this toolchain. 🤞
I'm using 13.2 now successfully too
We are announcing the deprecation of automatic installation of several key project dependencies, and builds will no longer install older documentation tool versions by default. Historically, Read the Docs installed a specific version of several dependencies based on the date your project was crea...
we plan to move to 12.3 after finishing the micropython merges
gcc 13 looks like it would save more space, but there is no downloadable toolchain set from ARM yet
How did you cook up the toolchain? Specifically, the 13.2 toolchain.
we just point to the arm download
I run arch linux and they build it themselves from gcc sources
thanks @tulip sleet !
Thanks for hosting Dan! Hope everyone has a great week!
rah!
#Using the Qualia RGB666 board
from tl032 import display
from adafruit_display_text.label import Label
from terminalio import FONT
import displayio
import time
display.rotation=90
group = displayio.Group()
label = Label(FONT, text="Bar Display", color=(44,240,44),
x=display.width//2,
y=display.height*3//4)
group.append(label)
display.root_group=group
It's nice!
anyone want to help lint and release https://github.com/adafruit/Adafruit_CircuitPython_PIO_UART?
@tulip sleet any idea when you want to start the 1.21 merge?
i'd want to do it against main after v1.20 is merged, yes? Immediately afterward is fine. Did you push to my branch for the v1.20 merge and I'll make a regular PR?
sure ga
i am finishing up the meeting notes
👍
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/13dm8Dw4AJq_dwmmmlnnBj79qUaau48uXwYyJTO2_YMs/edit?usp=sharing
@tulip sleet gonna make a PR for 1.20?
i had to take a nap 🙂 . just about to
np. naps are great
I'm starting to test on some boards so I'll make a comment on the PR
Minor notes:
- Removed
#includes fortranslate.handsupervisor/linker.hmany places because they're already included byruntime.h. - Everything converted to use
MP_REGISTER_ROOT_POINTER. - Everything converted to use
MP_DEFINE_CONST_OBJ_TYPE.
I did find this driver (written in c) with a couple of examples to run on a Raspberry Pi, but I haven't been able to compile it...
my CI run is green. only espressif is still going
@slender iron Did we decide on which one of us was going to start the v1.21 merge? I am willing to do that because the repeat merges will look familiar. I can knock off the easy stuff and then we can do pair merging or split up problems as necessary for the rest.
that sounds good to me
I'm reading through the 1.20 merge PR but I'm not sure its worth it
I've only found two weird files
i started that but gave up. which two?
☝️
after the build finishes I will push removing those. Are you doing some board testing? I can pick some ports that don't overlap with you.
I did esp32s3, esp32 and samd51
1011 and silabs are on my desk
pico w would be good to test too
👍
Super interesting to discover the lower level USB stuff. I have a Fomu FPGA running CircuitPython. I was able to wake up my screen, but not yet wakeup my device from sleep and I guess it is just not yet implemented.
Is this task just about sending a wakeup message before sending a key press or is it more involved to implement this?
@tulip sleet I've found a couple other minor things so wait to push
🎉
Two more minor things. Will test imx rt and silabs shortly.
This looks like a typo. I don't think it'll break anything though because it is off by default.
nice, CI passed
i am mostly testing with what's lying around on CIRCUITPY on the boards
i could test spresense
kk, I was gonna skip it
did you test stm?
nope, still working on silabs
spresense will blink

Is this task just about sending a wakeup message before sending a key press or is it more involved to implement this?
I think we just need to do what is described in https://github.com/adafruit/circuitpython/issues/5380#issuecomment-925044500
Smoke tests run:
- Fetch test on ESP32-S3 matrix portal
- 1 + 1 REPL test on Adafruit QtPy ESP32 pico
- 1 + 1 REPL test on Adafruit ItsyBitsy M4 Express
- 1 + 1 REPL test on Adafruit Metro 1011 SD
1 + 1 REPL test on mgm240p (silabs) "feather" fails on S3 as well so it is unrelated to this PR.
I tested Pico W, including wifi, nRF52840 with BLE Heart Rate Monitor, Spresense blinking LEDs, STM32F405 doing I2C.
ok, I have a silabs fix I'll PR tomorrow
The mpy-cross build directories changed but the paths used to upload to S3 were not quite right in some cases.
Unfortunately this has to be merged to confirm that the upload paths are correct.
Fixes errors seen from v1.20 merge here: https://github.com/adafruit/circuitpython/actions/runs/6540604996
I think the merge job here will fail due to mpy-cross upload errors, which I hope are fixed in #8483.
MicroPython has BLE support for the Pico and @dhalbert has just merged https://github.com/adafruit/circuitpython/pull/8481, Is this a start on BLE support for the Pico w?
Here's the overall documentation:
https://docs.espressif.com/projects/esp-idf/en/release-v5.0/esp32/api-reference/peripherals/lcd.html
https://docs.espressif.com/projects/esp-idf/en/v5.1.1/esp32/api-reference/peripherals/lcd.html
https://github.com/espressif/esp-idf/blob/master/components/esp_lcd/src/esp_lcd_panel_io_i80.c
In the last example I did not see any mention of i2s, there are other examples in the directiory that are i2s specific.
LilyGo uses eSPI library for their board, unfortunately they only provide Arduino samples:
https://github.com/Xinyuan-LilyGO/T-Display-S3/tree/main/lib/TFT_eSPI
MicroPython has BLE support for the Pico and @dhalbert has just merged #8481, Is this a start on BLE support for the Pico w?
The MP merge is unrelated because we don't share the BLE subsystem with MP. eightycc's work to get BLE going is more promising.
Thanks for the IDF links. It looks like the right way to go. I was assuming esp_lcd had an onboard framebuffer but it looks like it may not for parallel displays. (That's what we expect.)
pid.codes PR is merged. Please update the values here.
Ok @tannewt, thank you, is there any way to get an update on @eightycc's work?
- Fix watchdog code crash.
- Define status LEDs for all boards.
- Add flash target to Makefile.
- Reduce build verbosity.
These look good to me. Feel free to merge after build.
I think it would be good for the build make target to report if git-lfs is not installed. I wasted a bunch of time debugging that recently.
any thoughts about renaming displayio to displaycore once we move the individual display types out?
I can update the board defs with the 8.2.x merge into main if needed.
Thanks for the offer Scott :) but I should learn the differences, so I'll do them. I'm not quite ready with the other 2 boards yet anyway.
displaycore is longer so you'll get displaycore.displaycore potentially?
if we're going to be stacking a lot of stuff into displays in the future then core does make more sense semantically.
We have audiocore so it would be in line with current naming conventions.
That brings up a question of renaming busio to buscore too? 🤷
this potential change would mean something like from displayio import Bitmap, Group, Tilegrid would be changed to from displaycore import Bitmap, Group, Tilegrid ?
If I'm understanding it correctly I think my only thought is that vectorio should share a suffix with wherever Bitmap and Tilegrid land so if those are displaycore then maybe vectorio changes to vectorcore so that it matches still. Probably the same for terminalio and maybe gifio as well.
I'm not sure I understand the difference in meaning between core and io used in the context of the suffix for the built-in modules though. I've always understood the 'io' suffix to be kind of a catchall for many core modules like displayio, sdcardio, busio, aesio, rainbowio. If it's intended to mean more strictly the pin level input / output that is used by the module then I could see that Bitmap, Group, Tilegrid don't exactly tie into that directly.
there are some others like fontio, qrio, gifio that aren't really tied to the pin level IO either though.
the io suffix helps to make module names unique too
we did audiocode because we wanted audioio to actually be the "audio" output
displayio has come to mean the way we manage object on a display
more than how we output to a display
Hey Scott or Dan or whoever can/wants to chime in:
Is there anything prohibitive about using or building support for QSPI on circuitpython?
not sure what you are asking
Right now I don’t see a way to use SPI flash in QSPI mode
on what port?
I’d like to have that option, but I’m curious if there are limitations with how circuitpython runs where we wouldn’t really see any benefit to using it.
Esp32-S3
Or S2 even
they both support it
I’d like to use it separately from the circuitpy FS
ah, that we don't have
and the s2 and s3 are using the peripheral that can do it already
I don't think any of the others can
you might be able to use the same peripheral with a different chip select
how are you going to use it?
To store game files I don’t want directly accessed from the circuitpy drive
SPI is probably fast enough
But qspi would be pretty cool
the simple option is to use the circuitpy drive
My thoughts are, I have a switch that I toggle that is sort of an upload mode read by boot.py that takes any files in a folder say “new games” and copies them to qspi and the. Deletes the contents of the folder after moved.
The spi flash is then just mounted as a fs accessed by whatever I’m doing in code.py
all so you can hide the game files?
Yeah
I don’t want to hide the circuitpy drive though
Which I know I can do from boot.py
the closest thing I can think of is an sd card
I mostly just want to keep the games safe from accidental erasure of the esp32
Yeah, I just don’t want the bulk of an sd card
But if it’s the only reasonable way, perhaps I’ll just use one
can't you just copy them over again if erased?